text stringlengths 4 6.14k |
|---|
#include "kernel/ifftw.h"
extern void X(codelet_e01_8)(planner *);
extern void X(codelet_e10_8)(planner *);
extern const solvtab X(solvtab_rdft_r2r);
const solvtab X(solvtab_rdft_r2r) = {
SOLVTAB(X(codelet_e01_8)),
SOLVTAB(X(codelet_e10_8)),
SOLVTAB_END
};
|
/***********************************************************************
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
#ifdef OPUS_ENABLED
#include "opus/opus_config.h"
#endif
#include "opus/silk/SigProc_FIX.h"
#include "opus/silk/resampler_private.h"
/* Second order AR filter with single delay elements */
void silk_resampler_private_AR2(
opus_int32 S[], /* I/O State vector [ 2 ] */
opus_int32 out_Q8[], /* O Output signal */
const opus_int16 in[], /* I Input signal */
const opus_int16 A_Q14[], /* I AR coefficients, Q14 */
opus_int32 len /* I Signal length */
)
{
opus_int32 k;
opus_int32 out32;
for( k = 0; k < len; k++ ) {
out32 = silk_ADD_LSHIFT32( S[ 0 ], (opus_int32)in[ k ], 8 );
out_Q8[ k ] = out32;
out32 = silk_LSHIFT( out32, 2 );
S[ 0 ] = silk_SMLAWB( S[ 1 ], out32, A_Q14[ 0 ] );
S[ 1 ] = silk_SMULWB( out32, A_Q14[ 1 ] );
}
}
|
/*
* WARNING: do not edit!
* Generated by Makefile from include/openssl/opensslconf.h.in
*
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <openssl/opensslv.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef OPENSSL_ALGORITHM_DEFINES
# error OPENSSL_ALGORITHM_DEFINES no longer supported
#endif
/*
* OpenSSL was configured with the following options:
*/
#ifndef OPENSSL_NO_COMP
# define OPENSSL_NO_COMP
#endif
#ifndef OPENSSL_NO_MD2
# define OPENSSL_NO_MD2
#endif
#ifndef OPENSSL_NO_RC5
# define OPENSSL_NO_RC5
#endif
#ifndef OPENSSL_THREADS
# define OPENSSL_THREADS
#endif
#ifndef OPENSSL_RAND_SEED_OS
# define OPENSSL_RAND_SEED_OS
#endif
#ifndef OPENSSL_NO_AFALGENG
# define OPENSSL_NO_AFALGENG
#endif
#ifndef OPENSSL_NO_ASAN
# define OPENSSL_NO_ASAN
#endif
#ifndef OPENSSL_NO_ASM
# define OPENSSL_NO_ASM
#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
# define OPENSSL_NO_CRYPTO_MDEBUG
#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
#endif
#ifndef OPENSSL_NO_DEVCRYPTOENG
# define OPENSSL_NO_DEVCRYPTOENG
#endif
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
#endif
#ifndef OPENSSL_NO_EGD
# define OPENSSL_NO_EGD
#endif
#ifndef OPENSSL_NO_EXTERNAL_TESTS
# define OPENSSL_NO_EXTERNAL_TESTS
#endif
#ifndef OPENSSL_NO_FUZZ_AFL
# define OPENSSL_NO_FUZZ_AFL
#endif
#ifndef OPENSSL_NO_FUZZ_LIBFUZZER
# define OPENSSL_NO_FUZZ_LIBFUZZER
#endif
#ifndef OPENSSL_NO_HEARTBEATS
# define OPENSSL_NO_HEARTBEATS
#endif
#ifndef OPENSSL_NO_MSAN
# define OPENSSL_NO_MSAN
#endif
#ifndef OPENSSL_NO_SCTP
# define OPENSSL_NO_SCTP
#endif
#ifndef OPENSSL_NO_SSL3
# define OPENSSL_NO_SSL3
#endif
#ifndef OPENSSL_NO_SSL3_METHOD
# define OPENSSL_NO_SSL3_METHOD
#endif
#ifndef OPENSSL_NO_UBSAN
# define OPENSSL_NO_UBSAN
#endif
#ifndef OPENSSL_NO_UNIT_TEST
# define OPENSSL_NO_UNIT_TEST
#endif
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
# define OPENSSL_NO_WEAK_SSL_CIPHERS
#endif
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
# define OPENSSL_NO_DYNAMIC_ENGINE
#endif
/*
* Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
* don't like that. This will hopefully silence them.
*/
#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
/*
* Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
* declarations of functions deprecated in or before <version>. Otherwise, they
* still won't see them if the library has been built to disable deprecated
* functions.
*/
#ifndef DECLARE_DEPRECATED
# define DECLARE_DEPRECATED(f) f;
# ifdef __GNUC__
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
# undef DECLARE_DEPRECATED
# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
# endif
# elif defined(__SUNPRO_C)
# if (__SUNPRO_C >= 0x5130)
# undef DECLARE_DEPRECATED
# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
# endif
# endif
#endif
#ifndef OPENSSL_FILE
# ifdef OPENSSL_NO_FILENAMES
# define OPENSSL_FILE ""
# define OPENSSL_LINE 0
# else
# define OPENSSL_FILE __FILE__
# define OPENSSL_LINE __LINE__
# endif
#endif
#ifndef OPENSSL_MIN_API
# define OPENSSL_MIN_API 0
#endif
#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
# undef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT OPENSSL_MIN_API
#endif
/*
* Do not deprecate things to be deprecated in version 1.2.0 before the
* OpenSSL version number matches.
*/
#if OPENSSL_VERSION_NUMBER < 0x10200000L
# define DEPRECATEDIN_1_2_0(f) f;
#elif OPENSSL_API_COMPAT < 0x10200000L
# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_2_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x10100000L
# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_1_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x10000000L
# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_0_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x00908000L
# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_0_9_8(f)
#endif
/* Generate 80386 code? */
#undef I386_ONLY
#undef OPENSSL_UNISTD
#define OPENSSL_UNISTD <unistd.h>
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
/*
* The following are cipher-specific, but are part of the public API.
*/
#if !defined(OPENSSL_SYS_UEFI)
# define BN_LLONG
/* Only one for the following should be defined */
# undef SIXTY_FOUR_BIT_LONG
# undef SIXTY_FOUR_BIT
# define THIRTY_TWO_BIT
#endif
#define RC4_INT unsigned char
#ifdef __cplusplus
}
#endif
|
//
// MIT License
//
// Copyright (c) 2014 Bob McCune http://bobmccune.com/
// Copyright (c) 2014 TapHarmonic, LLC http://tapharmonic.com/
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <AVFoundation/AVFoundation.h>
#import "THCameraControllerDelegate.h"
#import "THError.h"
FOUNDATION_EXPORT NSString *const THMovieCreatedNotification;
@interface THBaseCameraController : NSObject
@property (weak, nonatomic) id <THCameraControllerDelegate> delegate;
@property (strong, nonatomic, readonly) AVCaptureSession *captureSession;
@property (strong, nonatomic, readonly) dispatch_queue_t dispatchQueue;
// Session Configuration
- (BOOL)setupSession:(NSError **)error;
- (BOOL)setupSessionInputs:(NSError **)error;
- (BOOL)setupSessionOutputs:(NSError **)error;
- (NSString *)sessionPreset;
- (void)startSession;
- (void)stopSession;
@end
|
/*************************************************************************/
/* audio_effect_filter.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef AUDIOEFFECTFILTER_H
#define AUDIOEFFECTFILTER_H
#include "servers/audio/audio_effect.h"
#include "servers/audio/audio_filter_sw.h"
class AudioEffectFilter;
class AudioEffectFilterInstance : public AudioEffectInstance {
GDCLASS(AudioEffectFilterInstance, AudioEffectInstance);
friend class AudioEffectFilter;
Ref<AudioEffectFilter> base;
AudioFilterSW filter;
AudioFilterSW::Processor filter_process[2][4];
template <int S>
void _process_filter(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count);
public:
virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) override;
AudioEffectFilterInstance();
};
class AudioEffectFilter : public AudioEffect {
GDCLASS(AudioEffectFilter, AudioEffect);
public:
enum FilterDB {
FILTER_6DB,
FILTER_12DB,
FILTER_18DB,
FILTER_24DB,
};
friend class AudioEffectFilterInstance;
AudioFilterSW::Mode mode;
float cutoff;
float resonance;
float gain;
FilterDB db;
protected:
static void _bind_methods();
public:
void set_cutoff(float p_freq);
float get_cutoff() const;
void set_resonance(float p_amount);
float get_resonance() const;
void set_gain(float p_amount);
float get_gain() const;
void set_db(FilterDB p_db);
FilterDB get_db() const;
Ref<AudioEffectInstance> instantiate() override;
AudioEffectFilter(AudioFilterSW::Mode p_mode = AudioFilterSW::LOWPASS);
};
VARIANT_ENUM_CAST(AudioEffectFilter::FilterDB)
class AudioEffectLowPassFilter : public AudioEffectFilter {
GDCLASS(AudioEffectLowPassFilter, AudioEffectFilter);
void _validate_property(PropertyInfo &property) const override {
if (property.name == "gain") {
property.usage = PROPERTY_USAGE_NONE;
}
}
public:
AudioEffectLowPassFilter() :
AudioEffectFilter(AudioFilterSW::LOWPASS) {}
};
class AudioEffectHighPassFilter : public AudioEffectFilter {
GDCLASS(AudioEffectHighPassFilter, AudioEffectFilter);
void _validate_property(PropertyInfo &property) const override {
if (property.name == "gain") {
property.usage = PROPERTY_USAGE_NONE;
}
}
public:
AudioEffectHighPassFilter() :
AudioEffectFilter(AudioFilterSW::HIGHPASS) {}
};
class AudioEffectBandPassFilter : public AudioEffectFilter {
GDCLASS(AudioEffectBandPassFilter, AudioEffectFilter);
void _validate_property(PropertyInfo &property) const override {
if (property.name == "gain") {
property.usage = PROPERTY_USAGE_NONE;
}
}
public:
AudioEffectBandPassFilter() :
AudioEffectFilter(AudioFilterSW::BANDPASS) {}
};
class AudioEffectNotchFilter : public AudioEffectFilter {
GDCLASS(AudioEffectNotchFilter, AudioEffectFilter);
public:
AudioEffectNotchFilter() :
AudioEffectFilter(AudioFilterSW::NOTCH) {}
};
class AudioEffectBandLimitFilter : public AudioEffectFilter {
GDCLASS(AudioEffectBandLimitFilter, AudioEffectFilter);
public:
AudioEffectBandLimitFilter() :
AudioEffectFilter(AudioFilterSW::BANDLIMIT) {}
};
class AudioEffectLowShelfFilter : public AudioEffectFilter {
GDCLASS(AudioEffectLowShelfFilter, AudioEffectFilter);
public:
AudioEffectLowShelfFilter() :
AudioEffectFilter(AudioFilterSW::LOWSHELF) {}
};
class AudioEffectHighShelfFilter : public AudioEffectFilter {
GDCLASS(AudioEffectHighShelfFilter, AudioEffectFilter);
public:
AudioEffectHighShelfFilter() :
AudioEffectFilter(AudioFilterSW::HIGHSHELF) {}
};
#endif // AUDIOEFFECTFILTER_H
|
/* error I/O that uses either stderr or REprintf depending on the build */
#ifndef RSERR_H__
#define RSERR_H__
#ifndef NO_CONFIG_H
#include "config.h"
#endif
#if defined STANDALONE_RSERVE && defined RSERVE_PKG
#undef RSERVE_PKG
#endif
#include <stdio.h>
#include <stdarg.h>
#ifndef STANDALONE_RSERVE
#include <R_ext/Print.h> /* for REvprintf */
#endif
static void RSEprintf(const char *format, ...) {
va_list(ap);
va_start(ap, format);
#ifdef STANDALONE_RSERVE
vfprintf(stderr, format, ap);
#else
REvprintf(format, ap);
#endif
va_end(ap);
}
#endif
|
#ifndef _NFS_FS_I
#define _NFS_FS_I
#include <asm/types.h>
#include <linux/list.h>
#include <linux/nfs.h>
/*
* NFSv3 Access mode cache
*/
struct nfs_access_cache {
unsigned long jiffies;
struct rpc_cred * cred;
int mask;
int err;
};
/*
* nfs fs inode data in memory
*/
struct nfs_inode_info {
/*
* The 64bit 'inode number'
*/
__u64 fileid;
/*
* NFS file handle
*/
struct nfs_fh fh;
/*
* Various flags
*/
unsigned short flags;
/*
* read_cache_jiffies is when we started read-caching this inode,
* and read_cache_mtime is the mtime of the inode at that time.
* attrtimeo is for how long the cached information is assumed
* to be valid. A successful attribute revalidation doubles
* attrtimeo (up to acregmax/acdirmax), a failure resets it to
* acregmin/acdirmin.
*
* We need to revalidate the cached attrs for this inode if
*
* jiffies - read_cache_jiffies > attrtimeo
*
* and invalidate any cached data/flush out any dirty pages if
* we find that
*
* mtime != read_cache_mtime
*/
unsigned long read_cache_jiffies;
__u64 read_cache_ctime;
__u64 read_cache_mtime;
__u64 read_cache_isize;
unsigned long attrtimeo;
unsigned long attrtimeo_timestamp;
/*
* Timestamp that dates the change made to read_cache_mtime.
* This is of use for dentry revalidation
*/
unsigned long cache_mtime_jiffies;
struct nfs_access_cache cache_access;
/*
* This is the cookie verifier used for NFSv3 readdir
* operations
*/
__u32 cookieverf[2];
/*
* This is the list of dirty unwritten pages.
*/
struct list_head read;
struct list_head dirty;
struct list_head commit;
struct list_head writeback;
unsigned int nread,
ndirty,
ncommit,
npages;
/* Credentials for shared mmap */
struct rpc_cred *mm_cred;
};
/*
* Legal inode flag values
*/
#define NFS_INO_STALE 0x0001 /* possible stale inode */
#define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */
#define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */
#define NFS_IS_SNAPSHOT 0x0010 /* a snapshot file */
#define NFS_INO_FLUSH 0x0020 /* inode is due for flushing */
#define NFS_INO_MAPPED 0x0040 /* page invalidation failed */
/*
* NFS lock info
*/
struct nfs_lock_info {
u32 state;
u32 flags;
struct nlm_host *host;
};
/*
* Lock flag values
*/
#define NFS_LCK_GRANTED 0x0001 /* lock has been granted */
#define NFS_LCK_RECLAIM 0x0002 /* lock marked for reclaiming */
#endif
|
/* This file is part of the KDE project
* Copyright (C) 2006-2007 Thomas Zander <zander@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KODOCKREGISTRY_
#define KODOCKREGISTRY_
#include "KoGenericRegistry.h"
#include "KoDockFactoryBase.h"
#include "flake_export.h"
#include <QObject>
/**
* This singleton class keeps a register of all available dockers,
* or rather, of the factories that can create the QDockWidget instances
* for the mainwindows.
* Note that adding your KoDockFactoryBase to this registry will mean it will automatically be
* added to an application, no extra code is required for that.
*
* @see KoCanvasObserverBase
*/
class FLAKE_EXPORT KoDockRegistry : public KoGenericRegistry<KoDockFactoryBase*>
{
public:
~KoDockRegistry();
/**
* Return an instance of the KoDockRegistry
* Create a new instance on first call and return the singleton.
*/
static KoDockRegistry *instance();
private:
KoDockRegistry();
KoDockRegistry(const KoDockRegistry&);
KoDockRegistry operator=(const KoDockRegistry&);
void init();
class Private;
Private *d;
};
#endif
|
/***************************************************************************
main_win.h - description
-------------------
copyright : (C) 2003 by ShadowPrince
email : shadow@emulation64.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef MAIN_WIN_H
#define MAIN_WIN_H
extern BOOL CALLBACK CfgDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
extern void ShowMessage(LPSTR lpszMessage) ;
extern void EnableToolbar();
extern void CreateStatusBarWindow( HWND hwnd );
extern void SetStatusMode( int mode );
extern char *getPluginName( char *pluginpath, int plugintype);
extern char* getExtension(char *str);
/********* Global Variables **********/
extern char TempMessage[800];
extern int emu_launched; // emu_emulating
extern int emu_paused;
extern int recording;
extern HWND hTool, mainHWND, hStatus, hRomList, hStatusProgress;
extern HINSTANCE app_hInstance;
extern BOOL manualFPSLimit;
extern char statusmsg[800];
extern char gfx_name[255];
extern char input_name[255];
extern char sound_name[255];
extern char rsp_name[255];
extern HWND hwnd_plug;
extern HANDLE EmuThreadHandle;
extern char AppPath[MAX_PATH];
extern void EnableEmulationMenuItems(BOOL flag);
extern BOOL StartRom(char *fullRomPath);
extern void resetEmu() ;
extern void resumeEmu(BOOL quiet);
extern void pauseEmu(BOOL quiet);
//extern void closeRom();
extern void search_plugins();
extern void rewind_plugin();
extern int get_plugin_type();
extern char *next_plugin();
extern void exec_config(char *name);
extern void exec_test(char *name);
extern void exec_about(char *name);
extern void EnableStatusbar();
extern void OpenMoviePlaybackDialog();
extern void OpenMovieRecordDialog();
typedef struct _HOTKEY {
int key;
BOOL shift;
BOOL ctrl;
BOOL alt;
int command;
} HOTKEY;
#define NUM_HOTKEYS (40)
typedef struct _CONFIG {
unsigned char ConfigVersion ;
//Language
char DefaultLanguage[100];
// Alert Messages variables
BOOL showFPS;
BOOL showVIS;
BOOL alertBAD;
BOOL alertHACK;
BOOL savesERRORS;
// General vars
BOOL limitFps;
BOOL compressedIni;
int guiDynacore;
BOOL UseFPSmodifier;
int FPSmodifier;
// Advanced vars
BOOL StartFullScreen;
BOOL PauseWhenNotActive;
BOOL OverwritePluginSettings;
BOOL GuiToolbar;
BOOL GuiStatusbar;
BOOL AutoIncSaveSlot;
//Compatibility Options
//BOOL NoAudioDelay;
//BOOL NoCompiledJump;
//Rom Browser Columns
BOOL Column_GoodName;
BOOL Column_InternalName;
BOOL Column_Country;
BOOL Column_Size;
BOOL Column_Comments;
BOOL Column_FileName;
BOOL Column_MD5;
// Directories
BOOL DefaultPluginsDir;
BOOL DefaultSavesDir;
BOOL DefaultScreenshotsDir;
char PluginsDir[MAX_PATH];
char SavesDir[MAX_PATH];
char ScreenshotsDir[MAX_PATH];
// Recent Roms
char RecentRoms[10][MAX_PATH];
BOOL RecentRomsFreeze;
//Window
int WindowWidth;
int WindowHeight;
int WindowPosX;
int WindowPosY;
//Rom Browser
int RomBrowserSortColumn;
char RomBrowserSortMethod[10];
BOOL RomBrowserRecursion;
HOTKEY hotkey [NUM_HOTKEYS];
} CONFIG;
extern CONFIG Config;
#endif
|
/* GemRB - Infinity Engine Emulator
* Copyright (C) 2003 The GemRB Project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
*/
#ifndef PLTIMPORTER_H
#define PLTIMPORTER_H
#include "PalettedImageMgr.h"
namespace GemRB {
class PLTImporter : public PalettedImageMgr {
private:
ieDword Width, Height;
void* pixels;
public:
PLTImporter(void);
~PLTImporter(void);
bool Open(DataStream* stream);
Sprite2D* GetSprite2D(unsigned int type, ieDword col[8]);
};
}
#endif
|
/*
** Zabbix
** Copyright (C) 2001-2014 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
#ifndef ZABBIX_CHECKS_SIMPLE_H
#define ZABBIX_CHECKS_SIMPLE_H
#include "common.h"
#include "dbcache.h"
#include "sysinfo.h"
int get_value_simple(DC_ITEM *item, AGENT_RESULT *result);
#endif
|
/*
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vid_dos.h: header file for DOS-specific video stuff
typedef struct vmode_s {
struct vmode_s *pnext;
char *name;
char *header;
unsigned width;
unsigned height;
float aspect;
unsigned rowbytes;
int planar;
int numpages;
void *pextradata;
int (*setmode)(viddef_t *vid, struct vmode_s *pcurrentmode);
void (*swapbuffers)(viddef_t *vid, struct vmode_s *pcurrentmode,
vrect_t *rects);
void (*setpalette)(viddef_t *vid, struct vmode_s *pcurrentmode,
unsigned char *palette);
void (*begindirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode,
int x, int y, byte *pbitmap, int width,
int height);
void (*enddirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode,
int x, int y, int width, int height);
} vmode_t;
// vid_wait settings
#define VID_WAIT_NONE 0
#define VID_WAIT_VSYNC 1
#define VID_WAIT_DISPLAY_ENABLE 2
extern int numvidmodes;
extern vmode_t *pvidmodes;
extern int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes;
extern byte *VGA_pagebase;
extern vmode_t *VGA_pcurmode;
extern cvar_t vid_wait;
extern cvar_t vid_nopageflip;
extern cvar_t _vid_wait_override;
extern unsigned char colormap256[32][256];
extern void *vid_surfcache;
extern int vid_surfcachesize;
void VGA_Init (void);
void VID_InitVESA (void);
void VID_InitExtra (void);
void VGA_WaitVsync (void);
void VGA_ClearVideoMem (int planar);
void VGA_SetPalette(viddef_t *vid, vmode_t *pcurrentmode, unsigned char *pal);
void VGA_SwapBuffersCopy (viddef_t *vid, vmode_t *pcurrentmode,
vrect_t *rects);
qboolean VGA_FreeAndAllocVidbuffer (viddef_t *vid, int allocnewbuffer);
qboolean VGA_CheckAdequateMem (int width, int height, int rowbytes,
int allocnewbuffer);
void VGA_BeginDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x,
int y, byte *pbitmap, int width, int height);
void VGA_EndDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x,
int y, int width, int height);
void VGA_UpdateLinearScreen (void *srcptr, void *destptr, int width,
int height, int srcrowbytes, int destrowbytes);
|
/**********************************************************************
*
* Filename: circbuf.h
*
* Description: An easy-to-use circular buffer class.
*
* Notes:
*
*
* Copyright (c) 1998 by Michael Barr. This software is placed into
* the public domain and may be used for any purpose. However, this
* notice must not be changed or removed and no warranty is either
* expressed or implied by its publication or distribution.
**********************************************************************/
#ifndef _CIRCBUF_H
#define _CIRCBUF_H
typedef unsigned char item;
class CircBuf
{
public:
CircBuf(int nItems);
~CircBuf();
void add(item);
item remove();
void flush() {
head=0;
tail=head;
count=0;
}
int isEmpty() {
if((head==tail)&count==0)
return 1;
else
return 0;
}
int isFull() {
if((head==tail)&count!=0)
return 1;
else
return 0;
}
private:
item * array;
int size;
int head;
int tail;
int count;
};
#endif /* _CIRCBUF_H */
|
/*
* General Purpose functions for the global management of the
* 8260 Communication Processor Module.
* Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
* Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
* 2.3.99 Updates
*
* In addition to the individual control of the communication
* channels, there are a few functions that globally affect the
* communication processor.
*
* Buffer descriptors must be allocated from the dual ported memory
* space. The allocator for that is here. When the communication
* process is reset, we reclaim the memory available. There is
* currently no deallocator for this memory.
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/bootmem.h>
#include <asm/irq.h>
#include <asm/mpc8260.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/immap_8260.h>
#include <asm/cpm_8260.h>
static uint dp_alloc_base; /* Starting offset in DP ram */
static uint dp_alloc_top; /* Max offset + 1 */
static uint host_buffer; /* One page of host buffer */
static uint host_end; /* end + 1 */
cpm8260_t *cpmp; /* Pointer to comm processor space */
/* We allocate this here because it is used almost exclusively for
* the communication processor devices.
*/
immap_t *immr;
void
m8260_cpm_reset(void)
{
volatile immap_t *imp;
volatile cpm8260_t *commproc;
uint vpgaddr;
immr = imp = (volatile immap_t *)IMAP_ADDR;
commproc = &imp->im_cpm;
/* Reclaim the DP memory for our use.
*/
dp_alloc_base = CPM_DATAONLY_BASE;
dp_alloc_top = dp_alloc_base + CPM_DATAONLY_SIZE;
/* Set the host page for allocation.
*/
host_buffer =
(uint) alloc_bootmem_pages(PAGE_SIZE * NUM_CPM_HOST_PAGES);
host_end = host_buffer + (PAGE_SIZE * NUM_CPM_HOST_PAGES);
vpgaddr = host_buffer;
/* Tell everyone where the comm processor resides.
*/
cpmp = (cpm8260_t *)commproc;
}
/* Allocate some memory from the dual ported ram.
* To help protocols with object alignment restrictions, we do that
* if they ask.
*/
uint
m8260_cpm_dpalloc(uint size, uint align)
{
uint retloc;
uint align_mask, off;
uint savebase;
align_mask = align - 1;
savebase = dp_alloc_base;
if ((off = (dp_alloc_base & align_mask)) != 0)
dp_alloc_base += (align - off);
if ((dp_alloc_base + size) >= dp_alloc_top) {
dp_alloc_base = savebase;
return(CPM_DP_NOSPACE);
}
retloc = dp_alloc_base;
dp_alloc_base += size;
return(retloc);
}
/* We also own one page of host buffer space for the allocation of
* UART "fifos" and the like.
*/
uint
m8260_cpm_hostalloc(uint size, uint align)
{
uint retloc;
uint align_mask, off;
uint savebase;
align_mask = align - 1;
savebase = host_buffer;
if ((off = (host_buffer & align_mask)) != 0)
host_buffer += (align - off);
if ((host_buffer + size) >= host_end) {
host_buffer = savebase;
return(0);
}
retloc = host_buffer;
host_buffer += size;
return(retloc);
}
/* Set a baud rate generator. This needs lots of work. There are
* eight BRGs, which can be connected to the CPM channels or output
* as clocks. The BRGs are in two different block of internal
* memory mapped space.
* The baud rate clock is the system clock divided by something.
* It was set up long ago during the initial boot phase and is
* is given to us.
* Baud rate clocks are zero-based in the driver code (as that maps
* to port numbers). Documentation uses 1-based numbering.
*/
#define BRG_INT_CLK (((bd_t *)__res)->bi_brgfreq * 1000000)
#define BRG_UART_CLK (BRG_INT_CLK/16)
/* This function is used by UARTS, or anything else that uses a 16x
* oversampled clock.
*/
void
m8260_cpm_setbrg(uint brg, uint rate)
{
volatile uint *bp;
/* This is good enough to get SMCs running.....
*/
if (brg < 4) {
bp = (uint *)&immr->im_brgc1;
}
else {
bp = (uint *)&immr->im_brgc5;
brg -= 4;
}
bp += brg;
*bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN;
}
/* This function is used to set high speed synchronous baud rate
* clocks.
*/
void
m8260_cpm_fastbrg(uint brg, uint rate, int div16)
{
volatile uint *bp;
/* This is good enough to get SMCs running.....
*/
if (brg < 4) {
bp = (uint *)&immr->im_brgc1;
}
else {
bp = (uint *)&immr->im_brgc5;
brg -= 4;
}
bp += brg;
*bp = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN;
if (div16)
*bp |= CPM_BRG_DIV16;
}
|
/* -*- c++ -*- */
/*
* Copyright 2006-2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_AUDIO_PORTAUDIO_SOURCE_H
#define INCLUDED_AUDIO_PORTAUDIO_SOURCE_H
#include <gr_audio_source.h>
#include <gr_buffer.h>
#include <gruel/thread.h>
#include <string>
#include <portaudio.h>
#include <stdexcept>
PaStreamCallback portaudio_source_callback;
/*!
* \brief Audio source using PORTAUDIO
* \ingroup audio_blk
*
* Input samples must be in the range [-1,1].
*/
class audio_portaudio_source : public audio_source {
friend PaStreamCallback portaudio_source_callback;
unsigned int d_sampling_rate;
std::string d_device_name;
bool d_ok_to_block;
bool d_verbose;
unsigned int d_portaudio_buffer_size_frames; // number of frames in a portaudio buffer
PaStream *d_stream;
PaStreamParameters d_input_parameters;
gr_buffer_sptr d_writer; // buffer used between work and callback
gr_buffer_reader_sptr d_reader;
gruel::mutex d_ringbuffer_mutex;
gruel::condition_variable d_ringbuffer_cond;
bool d_ringbuffer_ready;
// random stats
int d_noverruns; // count of overruns
void output_error_msg (const char *msg, int err);
void bail (const char *msg, int err) throw (std::runtime_error);
void create_ringbuffer();
public:
audio_portaudio_source (int sampling_rate, const std::string device_name,
bool ok_to_block);
~audio_portaudio_source ();
bool check_topology (int ninputs, int noutputs);
int work (int ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
#endif /* INCLUDED_AUDIO_PORTAUDIO_SOURCE_H */
|
#ifndef BOOKMARKSEDITDIALOG_H
#define BOOKMARKSEDITDIALOG_H
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets/QDialog>
#else
#include <QDialog>
#endif
#include <QVector>
#include <QDebug>
#include "Bookmark.h"
#include "Bookmarks.h"
namespace Ui {
class BookmarksEditDialog;
}
class BookmarksEditDialog : public QDialog
{
Q_OBJECT
public:
explicit BookmarksEditDialog(QWidget *parent,Bookmarks* bookmarks);
~BookmarksEditDialog();
void setTitle(QString t);
void setBand(QString b);
void setFrequency(QString f);
void setMode(QString m);
void setFilter(QString f);
public slots:
void deleteBookmark();
void bookmarkRowChanged(int);
void updateBookmark();
signals:
void bookmarkDeleted(int entry);
void bookmarkSelected(int entry);
void bookmarkUpdated(int entry,QString title);
private:
Ui::BookmarksEditDialog *ui;
QVector<Bookmark*> bookmarks;
};
#endif // BOOKMARKSEDITDIALOG_H
|
/*
* Copyright (c) 1998-2006 The TCPDUMP project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
* distributions retain the above copyright notice and this paragraph
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* miscellaneous checksumming routines
*
* Original code by Hannes Gredler (hannes@gredler.at)
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <netdissect-stdinc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "netdissect.h"
/*
* CRC-10 table generated using the following Python snippet:
import sys
crc_table = []
for i in range(256):
accum = i << 2
for j in range(8):
accum <<= 1
if accum & 0x400:
accum ^= 0x633
crc_table.append(accum)
for i in range(len(crc_table)/8):
for j in range(8):
sys.stdout.write("0x%04x, " % crc_table[i*8+j])
sys.stdout.write("\n")
*/
static const uint16_t crc10_table[256] =
{
0x0000, 0x0233, 0x0255, 0x0066, 0x0299, 0x00aa, 0x00cc, 0x02ff,
0x0301, 0x0132, 0x0154, 0x0367, 0x0198, 0x03ab, 0x03cd, 0x01fe,
0x0031, 0x0202, 0x0264, 0x0057, 0x02a8, 0x009b, 0x00fd, 0x02ce,
0x0330, 0x0103, 0x0165, 0x0356, 0x01a9, 0x039a, 0x03fc, 0x01cf,
0x0062, 0x0251, 0x0237, 0x0004, 0x02fb, 0x00c8, 0x00ae, 0x029d,
0x0363, 0x0150, 0x0136, 0x0305, 0x01fa, 0x03c9, 0x03af, 0x019c,
0x0053, 0x0260, 0x0206, 0x0035, 0x02ca, 0x00f9, 0x009f, 0x02ac,
0x0352, 0x0161, 0x0107, 0x0334, 0x01cb, 0x03f8, 0x039e, 0x01ad,
0x00c4, 0x02f7, 0x0291, 0x00a2, 0x025d, 0x006e, 0x0008, 0x023b,
0x03c5, 0x01f6, 0x0190, 0x03a3, 0x015c, 0x036f, 0x0309, 0x013a,
0x00f5, 0x02c6, 0x02a0, 0x0093, 0x026c, 0x005f, 0x0039, 0x020a,
0x03f4, 0x01c7, 0x01a1, 0x0392, 0x016d, 0x035e, 0x0338, 0x010b,
0x00a6, 0x0295, 0x02f3, 0x00c0, 0x023f, 0x000c, 0x006a, 0x0259,
0x03a7, 0x0194, 0x01f2, 0x03c1, 0x013e, 0x030d, 0x036b, 0x0158,
0x0097, 0x02a4, 0x02c2, 0x00f1, 0x020e, 0x003d, 0x005b, 0x0268,
0x0396, 0x01a5, 0x01c3, 0x03f0, 0x010f, 0x033c, 0x035a, 0x0169,
0x0188, 0x03bb, 0x03dd, 0x01ee, 0x0311, 0x0122, 0x0144, 0x0377,
0x0289, 0x00ba, 0x00dc, 0x02ef, 0x0010, 0x0223, 0x0245, 0x0076,
0x01b9, 0x038a, 0x03ec, 0x01df, 0x0320, 0x0113, 0x0175, 0x0346,
0x02b8, 0x008b, 0x00ed, 0x02de, 0x0021, 0x0212, 0x0274, 0x0047,
0x01ea, 0x03d9, 0x03bf, 0x018c, 0x0373, 0x0140, 0x0126, 0x0315,
0x02eb, 0x00d8, 0x00be, 0x028d, 0x0072, 0x0241, 0x0227, 0x0014,
0x01db, 0x03e8, 0x038e, 0x01bd, 0x0342, 0x0171, 0x0117, 0x0324,
0x02da, 0x00e9, 0x008f, 0x02bc, 0x0043, 0x0270, 0x0216, 0x0025,
0x014c, 0x037f, 0x0319, 0x012a, 0x03d5, 0x01e6, 0x0180, 0x03b3,
0x024d, 0x007e, 0x0018, 0x022b, 0x00d4, 0x02e7, 0x0281, 0x00b2,
0x017d, 0x034e, 0x0328, 0x011b, 0x03e4, 0x01d7, 0x01b1, 0x0382,
0x027c, 0x004f, 0x0029, 0x021a, 0x00e5, 0x02d6, 0x02b0, 0x0083,
0x012e, 0x031d, 0x037b, 0x0148, 0x03b7, 0x0184, 0x01e2, 0x03d1,
0x022f, 0x001c, 0x007a, 0x0249, 0x00b6, 0x0285, 0x02e3, 0x00d0,
0x011f, 0x032c, 0x034a, 0x0179, 0x0386, 0x01b5, 0x01d3, 0x03e0,
0x021e, 0x002d, 0x004b, 0x0278, 0x0087, 0x02b4, 0x02d2, 0x00e1
};
static void
init_crc10_table(void)
{
#define CRC10_POLYNOMIAL 0x633
register int i, j;
register uint16_t accum;
uint16_t verify_crc10_table[256];
for ( i = 0; i < 256; i++ )
{
accum = ((unsigned short) i << 2);
for ( j = 0; j < 8; j++ )
{
if ((accum <<= 1) & 0x400) accum ^= CRC10_POLYNOMIAL;
}
verify_crc10_table[i] = accum;
}
assert(memcmp(verify_crc10_table,
crc10_table,
sizeof(verify_crc10_table)) == 0);
#undef CRC10_POLYNOMIAL
}
uint16_t
verify_crc10_cksum(uint16_t accum, const u_char *p, int length)
{
register int i;
for ( i = 0; i < length; i++ )
{
accum = ((accum << 8) & 0x3ff)
^ crc10_table[( accum >> 2) & 0xff]
^ *p++;
}
return accum;
}
/* precompute checksum tables */
void
init_checksum(void) {
init_crc10_table();
}
/*
* Creates the OSI Fletcher checksum. See 8473-1, Appendix C, section C.3.
* The checksum field of the passed PDU does not need to be reset to zero.
*/
uint16_t
create_osi_cksum (const uint8_t *pptr, int checksum_offset, int length)
{
int x;
int y;
uint32_t mul;
uint32_t c0;
uint32_t c1;
uint16_t checksum;
int idx;
c0 = 0;
c1 = 0;
for (idx = 0; idx < length; idx++) {
/*
* Ignore the contents of the checksum field.
*/
if (idx == checksum_offset ||
idx == checksum_offset+1) {
c1 += c0;
pptr++;
} else {
c0 = c0 + *(pptr++);
c1 += c0;
}
}
c0 = c0 % 255;
c1 = c1 % 255;
mul = (length - checksum_offset)*(c0);
x = mul - c0 - c1;
y = c1 - mul - 1;
if ( y >= 0 ) y++;
if ( x < 0 ) x--;
x %= 255;
y %= 255;
if (x == 0) x = 255;
if (y == 0) y = 255;
y &= 0x00FF;
checksum = ((x << 8) | y);
return checksum;
}
|
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
*/
#pragma once
namespace MTP {
void clearLoaderPriorities();
}
enum LocationType {
UnknownFileLocation = 0,
DocumentFileLocation = 0x4e45abe9, // mtpc_inputDocumentFileLocation
AudioFileLocation = 0x74dc404d, // mtpc_inputAudioFileLocation
VideoFileLocation = 0x3d0364ec, // mtpc_inputVideoFileLocation
};
inline LocationType mtpToLocationType(mtpTypeId type) {
switch (type) {
case mtpc_inputDocumentFileLocation: return DocumentFileLocation;
case mtpc_inputAudioFileLocation: return AudioFileLocation;
case mtpc_inputVideoFileLocation: return VideoFileLocation;
default: return UnknownFileLocation;
}
}
inline mtpTypeId mtpFromLocationType(LocationType type) {
switch (type) {
case DocumentFileLocation: return mtpc_inputDocumentFileLocation;
case AudioFileLocation: return mtpc_inputAudioFileLocation;
case VideoFileLocation: return mtpc_inputVideoFileLocation;
case UnknownFileLocation:
default: return 0;
}
}
enum StorageFileType {
StorageFileUnknown = 0xaa963b05, // mtpc_storage_fileUnknown
StorageFileJpeg = 0x7efe0e, // mtpc_storage_fileJpeg
StorageFileGif = 0xcae1aadf, // mtpc_storage_fileGif
StorageFilePng = 0xa4f63c0, // mtpc_storage_filePng
StorageFilePdf = 0xae1e508d, // mtpc_storage_filePdf
StorageFileMp3 = 0x528a0677, // mtpc_storage_fileMp3
StorageFileMov = 0x4b09ebbc, // mtpc_storage_fileMov
StorageFilePartial = 0x40bc6f52, // mtpc_storage_filePartial
StorageFileMp4 = 0xb3cea0e4, // mtpc_storage_fileMp4
StorageFileWebp = 0x1081464c, // mtpc_storage_fileWebp
};
inline StorageFileType mtpToStorageType(mtpTypeId type) {
switch (type) {
case mtpc_storage_fileJpeg: return StorageFileJpeg;
case mtpc_storage_fileGif: return StorageFileGif;
case mtpc_storage_filePng: return StorageFilePng;
case mtpc_storage_filePdf: return StorageFilePdf;
case mtpc_storage_fileMp3: return StorageFileMp3;
case mtpc_storage_fileMov: return StorageFileMov;
case mtpc_storage_filePartial: return StorageFilePartial;
case mtpc_storage_fileMp4: return StorageFileMp4;
case mtpc_storage_fileWebp: return StorageFileWebp;
case mtpc_storage_fileUnknown:
default: return StorageFileUnknown;
}
}
inline mtpTypeId mtpFromStorageType(StorageFileType type) {
switch (type) {
case StorageFileGif: return mtpc_storage_fileGif;
case StorageFilePng: return mtpc_storage_filePng;
case StorageFilePdf: return mtpc_storage_filePdf;
case StorageFileMp3: return mtpc_storage_fileMp3;
case StorageFileMov: return mtpc_storage_fileMov;
case StorageFilePartial: return mtpc_storage_filePartial;
case StorageFileMp4: return mtpc_storage_fileMp4;
case StorageFileWebp: return mtpc_storage_fileWebp;
case StorageFileUnknown:
default: return mtpc_storage_fileUnknown;
}
}
struct StorageImageSaved {
StorageImageSaved() : type(StorageFileUnknown) {
}
StorageImageSaved(StorageFileType type, const QByteArray &data) : type(type), data(data) {
}
StorageFileType type;
QByteArray data;
};
enum LocalLoadStatus {
LocalNotTried,
LocalNotFound,
LocalLoading,
LocalLoaded,
LocalFailed,
};
typedef void *TaskId; // no interface, just id
struct mtpFileLoaderQueue;
class mtpFileLoader : public QObject, public RPCSender {
Q_OBJECT
public:
mtpFileLoader(int32 dc, const uint64 &volume, int32 local, const uint64 &secret, int32 size = 0);
mtpFileLoader(int32 dc, const uint64 &id, const uint64 &access, LocationType type, const QString &to, int32 size, bool todata = false);
bool done() const {
return complete;
}
mtpTypeId fileType() const {
return type;
}
const QByteArray &bytes() const {
return data;
}
QByteArray imageFormat() const;
QPixmap imagePixmap() const;
QString fileName() const {
return fname;
}
float64 currentProgress() const;
int32 currentOffset(bool includeSkipped = false) const;
int32 fullSize() const;
void setFileName(const QString &filename); // set filename for duplicateInData loader
void pause();
void start(bool loadFirst = false, bool prior = true);
void cancel();
bool loading() const;
uint64 objId() const;
~mtpFileLoader();
void localLoaded(const StorageImageSaved &result, const QByteArray &imageFormat = QByteArray(), const QPixmap &imagePixmap = QPixmap());
mtpFileLoader *prev, *next;
int32 priority;
signals:
void progress(mtpFileLoader *loader);
void failed(mtpFileLoader *loader, bool started);
private:
mtpFileLoaderQueue *queue;
bool inQueue, complete;
LocalLoadStatus _localStatus;
bool tryLoadLocal();
void cancelRequests();
typedef QMap<mtpRequestId, int32> Requests;
Requests requests;
int32 skippedBytes;
int32 nextRequestOffset;
bool lastComplete;
void started(bool loadFirst, bool prior);
void removeFromQueue();
void loadNext();
void finishFail();
bool loadPart();
void partLoaded(int32 offset, const MTPupload_File &result, mtpRequestId req);
bool partFailed(const RPCError &error);
int32 dc;
LocationType _locationType;
uint64 volume; // for photo locations
int32 local;
uint64 secret;
uint64 id; // for other locations
uint64 access;
QFile file;
QString fname;
bool fileIsOpen;
bool duplicateInData;
QByteArray data;
int32 size;
mtpTypeId type;
TaskId _localTaskId;
mutable QByteArray _imageFormat;
mutable QPixmap _imagePixmap;
void readImage() const;
};
|
/*
* Copyright (C) 2005-2011 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008-2011 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010-2011 Project SkyFire <http://www.projectskyfire.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SC_FOLLOWERAI_H
#define SC_FOLLOWERAI_H
#include "ScriptSystem.h"
enum eFollowState
{
STATE_FOLLOW_NONE = 0x000,
STATE_FOLLOW_INPROGRESS = 0x001, //must always have this state for any follow
STATE_FOLLOW_RETURNING = 0x002, //when returning to combat start after being in combat
STATE_FOLLOW_PAUSED = 0x004, //disables following
STATE_FOLLOW_COMPLETE = 0x008, //follow is completed and may end
STATE_FOLLOW_PREEVENT = 0x010, //not implemented (allow pre event to run, before follow is initiated)
STATE_FOLLOW_POSTEVENT = 0x020 //can be set at complete and allow post event to run
};
class FollowerAI : public ScriptedAI
{
public:
explicit FollowerAI(Creature* pCreature);
~FollowerAI() {}
//virtual void WaypointReached(uint32 uiPointId) = 0;
void MovementInform(uint32 uiMotionType, uint32 uiPointId);
void AttackStart(Unit*);
void MoveInLineOfSight(Unit*);
void EnterEvadeMode();
void JustDied(Unit*);
void JustRespawned();
void UpdateAI(const uint32); //the "internal" update, calls UpdateFollowerAI()
virtual void UpdateFollowerAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
void StartFollow(Player* pPlayer, uint32 uiFactionForFollower = 0, const Quest* pQuest = NULL);
void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
void SetFollowComplete(bool bWithEndEvent = false);
bool HasFollowState(uint32 uiFollowState) { return (m_uiFollowState & uiFollowState); }
protected:
Player* GetLeaderForFollower();
private:
void AddFollowState(uint32 uiFollowState) { m_uiFollowState |= uiFollowState; }
void RemoveFollowState(uint32 uiFollowState) { m_uiFollowState &= ~uiFollowState; }
bool AssistPlayerInCombat(Unit* pWho);
uint64 m_uiLeaderGUID;
uint32 m_uiUpdateFollowTimer;
uint32 m_uiFollowState;
const Quest* m_pQuestForFollow; //normally we have a quest
};
#endif
|
/*
* RELIC is an Efficient LIbrary for Cryptography
* Copyright (C) 2007-2015 RELIC Authors
*
* This file is part of RELIC. RELIC is legal property of its developers,
* whose names are not listed here. Please refer to the COPYRIGHT file
* for contact information.
*
* RELIC is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* RELIC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with RELIC. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file
*
* Implementation of least common multiple.
*
* @ingroup bn
*/
#include "relic_core.h"
/*============================================================================*/
/* Public definitions */
/*============================================================================*/
void bn_lcm(bn_t c, const bn_t a, const bn_t b) {
bn_t u, v;
bn_null(u);
bn_null(v);
TRY {
bn_new(u);
bn_new(v);
bn_gcd(u, a, b);
if (bn_cmp_abs(a, b) == CMP_LT) {
bn_div(v, a, u);
bn_mul(c, b, v);
} else {
bn_div(v, b, u);
bn_mul(c, a, v);
}
c->sign = BN_POS;
}
CATCH_ANY {
THROW(ERR_CAUGHT);
}
FINALLY {
bn_free(u);
bn_free(v);
}
}
|
/**
*
* Phantom OS
*
* Copyright (C) 2005-2011 Dmitry Zavalishin, dz@dz.ru
*
* Static constructors runner. General init/stop functions runner.
*
*
**/
#define DEBUG_MSG_PREFIX "lzma"
#include <debug_ext.h>
#define debug_level_flow 0
#define debug_level_error 10
#define debug_level_info 10
#include "LzmaDec.h"
#include <errno.h>
#include <malloc.h>
#include <stdio.h>
#include <lzma.h>
static void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
static void SzFree(void *p, void *address) { p = p; free(address); }
static ISzAlloc alloc = { SzAlloc, SzFree };
errno_t plain_lzma_decode( void *dest, size_t *dest_len, void *src, size_t *src_len, int logLevel )
{
Byte propData[5];
ELzmaStatus status;
SRes rc = LzmaDecode( dest, dest_len, src, src_len,
propData, sizeof(propData), LZMA_FINISH_END,
&status, &alloc);
switch(rc)
{
case SZ_OK: break;
case SZ_ERROR_DATA:
SHOW_ERROR0( logLevel, "Broken data" );
return EFTYPE;
case SZ_ERROR_MEM:
SHOW_ERROR0( logLevel, "Out of mem" );
return ENOMEM;
case SZ_ERROR_UNSUPPORTED:
SHOW_ERROR0( logLevel, "Unsupported props" );
return EINVAL;
case SZ_ERROR_INPUT_EOF:
SHOW_ERROR0( logLevel, "Premature data end" );
return ENOSPC;
}
switch(status)
{
case LZMA_STATUS_FINISHED_WITH_MARK: break;
case LZMA_STATUS_NOT_SPECIFIED: // impossible
case LZMA_STATUS_NEEDS_MORE_INPUT:
case LZMA_STATUS_NOT_FINISHED:
case LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK:
SHOW_ERROR0( logLevel, "Premature data end" );
return ENOSPC;
}
return 0;
}
|
//
// UIScreenMode+TFEasyCoder.h
// TFEasyCoder
//
// Created by ztf on 16/10/26.
// Copyright © 2016年 ztf. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "TFEasyCoderConst.h"
typedef void(^UIScreenModeEasyCoderBlock) (UIScreenMode * ins);
@interface UIScreenMode (TFEasyCoder)
+( UIScreenMode *)easyCoder:(UIScreenModeEasyCoderBlock)block;
-(UIScreenMode *)easyCoder:(UIScreenModeEasyCoderBlock)block;
//superclass pros NSObject
-(UIScreenMode *(^)(NSArray * accessibilityElements))set_accessibilityElements;
-(UIScreenMode *(^)(NSArray * accessibilityCustomActions))set_accessibilityCustomActions;
-(UIScreenMode *(^)(BOOL isAccessibilityElement))set_isAccessibilityElement;
-(UIScreenMode *(^)(NSString * accessibilityLabel))set_accessibilityLabel;
-(UIScreenMode *(^)(NSString * accessibilityHint))set_accessibilityHint;
-(UIScreenMode *(^)(NSString * accessibilityValue))set_accessibilityValue;
-(UIScreenMode *(^)(unsigned long long accessibilityTraits))set_accessibilityTraits;
-(UIScreenMode *(^)(UIBezierPath * accessibilityPath))set_accessibilityPath;
-(UIScreenMode *(^)(CGPoint accessibilityActivationPoint))set_accessibilityActivationPoint;
-(UIScreenMode *(^)(NSString * accessibilityLanguage))set_accessibilityLanguage;
-(UIScreenMode *(^)(BOOL accessibilityElementsHidden))set_accessibilityElementsHidden;
-(UIScreenMode *(^)(BOOL accessibilityViewIsModal))set_accessibilityViewIsModal;
-(UIScreenMode *(^)(BOOL shouldGroupAccessibilityChildren))set_shouldGroupAccessibilityChildren;
-(UIScreenMode *(^)(long long accessibilityNavigationStyle))set_accessibilityNavigationStyle;
-(UIScreenMode *(^)(id value,NSString *key))set_ValueKey;
@end |
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <linux/sched.h>
extern int tty_ioctl(int dev, int cmd, int arg);
typedef int (*ioctl_ptr)(int dev,int cmd,int arg);
#define NRDEVS ((sizeof (ioctl_table))/(sizeof (ioctl_ptr)))
static ioctl_ptr ioctl_table[]={
NULL, /* nodev */
NULL, /* /dev/mem */
NULL, /* /dev/fd */
NULL, /* /dev/hd */
tty_ioctl, /* /dev/ttyx */
tty_ioctl, /* /dev/tty */
NULL, /* /dev/lp */
NULL}; /* named pipes */
int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct file * filp;
int dev,mode;
if (fd >= NR_OPEN || !(filp = current->filp[fd]))
return -EBADF;
mode=filp->f_inode->i_mode;
if (!S_ISCHR(mode) && !S_ISBLK(mode))
return -EINVAL;
dev = filp->f_inode->i_zone[0];
if (MAJOR(dev) >= NRDEVS)
panic("unknown device for ioctl");
if (!ioctl_table[MAJOR(dev)])
return -ENOTTY;
return ioctl_table[MAJOR(dev)](dev,cmd,arg);
}
|
/**
* @file
* @brief
*
* @date 06.09.13
* @author Ilia Vaprol
*/
#ifndef IFADDRS_H_
#define IFADDRS_H_
#include <sys/cdefs.h>
#include <sys/socket.h>
__BEGIN_DECLS
struct ifaddrs {
struct ifaddrs *ifa_next; /* Next item in list */
char *ifa_name; /* Name of interface */
unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */
struct sockaddr *ifa_addr; /* Address of interface */
struct sockaddr *ifa_netmask; /* Netmask of interface */
union {
struct sockaddr *ifu_broadaddr; /* Bcast address of interface */
struct sockaddr *ifu_dstaddr; /* P2P destination address */
} ifa_ifu;
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
void *ifa_data; /* Address-specific data */
};
/**
* Get interfaces address information
*/
int getifaddrs(struct ifaddrs **out_ifa);
/**
* Free data returned by getifaddrs
*/
void freeifaddrs(struct ifaddrs *ifa);
__END_DECLS
#endif /* IFADDRS_H_ */
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_COMMON_KEYBOARD_KEYBOARD_UI_OBSERVER_H_
#define ASH_COMMON_KEYBOARD_KEYBOARD_UI_OBSERVER_H_
#include "ash/ash_export.h"
#include "base/macros.h"
namespace ash {
class ASH_EXPORT KeyboardUIObserver {
public:
virtual void OnKeyboardEnabledStateChanged(bool new_enabled) = 0;
protected:
virtual ~KeyboardUIObserver() {}
};
} // namespace ash
#endif // ASH_COMMON_KEYBOARD_KEYBOARD_UI_OBSERVER_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_
#define BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_
#include <vector>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "blimp/net/blimp_net_export.h"
#include "blimp/net/connection_handler.h"
namespace blimp {
class BlimpConnection;
class BlimpMessage;
// Authenticates connections and passes successfully authenticated connections
// to |connection_handler|.
class BLIMP_NET_EXPORT EngineAuthenticationHandler : public ConnectionHandler {
public:
// |client_token|: used to authenticate incoming connection.
// |connection_handler|: a new connection is passed on to it after the
// connection is authenticate this handler.
EngineAuthenticationHandler(ConnectionHandler* connection_handler,
const std::string& client_token);
~EngineAuthenticationHandler() override;
// ConnectionHandler implementation.
void HandleConnection(std::unique_ptr<BlimpConnection> connection) override;
private:
// Used to abandon pending authenticated connections if |this| is deleted.
base::WeakPtrFactory<ConnectionHandler> connection_handler_weak_factory_;
// Used to authenticate incoming connection. Engine is assigned to one client
// only, and all connections from that client shall carry the same token.
const std::string client_token_;
DISALLOW_COPY_AND_ASSIGN(EngineAuthenticationHandler);
};
} // namespace blimp
#endif // BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_
|
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP9_ENCODER_DENOISER_H_
#define VP9_ENCODER_DENOISER_H_
#include "vp9/encoder/vp9_block.h"
#include "vpx_scale/yv12config.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MOTION_MAGNITUDE_THRESHOLD (8 * 3)
typedef enum vp9_denoiser_decision {
COPY_BLOCK,
FILTER_BLOCK
} VP9_DENOISER_DECISION;
typedef struct vp9_denoiser {
YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES];
YV12_BUFFER_CONFIG mc_running_avg_y;
int increase_denoising;
} VP9_DENOISER;
void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
YV12_BUFFER_CONFIG src,
FRAME_TYPE frame_type,
int refresh_alt_ref_frame,
int refresh_golden_frame,
int refresh_last_frame);
void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
int mi_row, int mi_col, BLOCK_SIZE bs,
PICK_MODE_CONTEXT *ctx);
void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx);
void vp9_denoiser_update_frame_stats(MB_MODE_INFO *mbmi,
unsigned int sse, PREDICTION_MODE mode,
PICK_MODE_CONTEXT *ctx);
int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
int ssx, int ssy,
#if CONFIG_VP9_HIGHBITDEPTH
int use_highbitdepth,
#endif
int border);
#if CONFIG_VP9_TEMPORAL_DENOISING
int total_adj_strong_thresh(BLOCK_SIZE bs, int increase_denoising);
#endif
void vp9_denoiser_free(VP9_DENOISER *denoiser);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // VP9_ENCODER_DENOISER_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_
#define UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_
#include <map>
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/timer.h"
#include "ui/aura/client/tooltip_client.h"
#include "ui/aura/window_observer.h"
#include "ui/base/events/event_handler.h"
#include "ui/gfx/point.h"
#include "ui/gfx/screen_type_delegate.h"
#include "ui/views/views_export.h"
namespace aura {
class Window;
}
namespace views {
namespace corewm {
namespace test {
class TooltipControllerTestHelper;
} // namespace test
// TooltipController provides tooltip functionality for aura shell.
class VIEWS_EXPORT TooltipController : public aura::client::TooltipClient,
public ui::EventHandler,
public aura::WindowObserver {
public:
explicit TooltipController(gfx::ScreenType screen_type);
virtual ~TooltipController();
// Overridden from aura::client::TooltipClient.
virtual void UpdateTooltip(aura::Window* target) OVERRIDE;
virtual void SetTooltipShownTimeout(aura::Window* target,
int timeout_in_ms) OVERRIDE;
virtual void SetTooltipsEnabled(bool enable) OVERRIDE;
// Overridden from ui::EventHandler.
virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE;
virtual void OnCancelMode(ui::CancelModeEvent* event) OVERRIDE;
// Overridden from aura::WindowObserver.
virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
const gfx::Point& mouse_location() const { return curr_mouse_loc_; }
private:
friend class test::TooltipControllerTestHelper;
class Tooltip;
// Returns the max width of the tooltip when shown at the specified location.
int GetMaxWidth(const gfx::Point& location) const;
// Returns the bounds to fit the tooltip in.
gfx::Rect GetBoundsForTooltip(const gfx::Point& origin) const;
// Trims the tooltip to fit in the width |max_width|, setting |text| to the
// clipped result, |width| to the width (in pixels) of the clipped text
// and |line_count| to the number of lines of text in the tooltip. |x| and |y|
// give the location of the tooltip in screen coordinates. |max_width| comes
// from GetMaxWidth().
static void TrimTooltipToFit(int max_width,
string16* text,
int* width,
int* line_count);
void TooltipTimerFired();
void TooltipShownTimerFired();
// Updates the tooltip if required (if there is any change in the tooltip
// text or the aura::Window.
void UpdateIfRequired();
// Only used in tests.
bool IsTooltipVisible();
bool IsDragDropInProgress();
// This lazily creates the Tooltip instance so that the tooltip window will
// be initialized with appropriate drop shadows.
Tooltip* GetTooltip();
// Returns true if the cursor is visible.
bool IsCursorVisible();
int GetTooltipShownTimeout();
const gfx::ScreenType screen_type_;
aura::Window* tooltip_window_;
string16 tooltip_text_;
// These fields are for tracking state when the user presses a mouse button.
aura::Window* tooltip_window_at_mouse_press_;
string16 tooltip_text_at_mouse_press_;
bool mouse_pressed_;
scoped_ptr<Tooltip> tooltip_;
base::RepeatingTimer<TooltipController> tooltip_timer_;
// Timer to timeout the life of an on-screen tooltip. We hide the tooltip when
// this timer fires.
base::OneShotTimer<TooltipController> tooltip_shown_timer_;
gfx::Point curr_mouse_loc_;
bool tooltips_enabled_;
std::map<aura::Window*, int> tooltip_shown_timeout_map_;
DISALLOW_COPY_AND_ASSIGN(TooltipController);
};
} // namespace corewm
} // namespace views
#endif // UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_H_
|
void f() {
int icnt;
sizeof (int[icnt]);
__alignof__ (int[icnt]);
}
|
/*
Copyright 1999-2007 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MagickCore image compression/decompression methods.
*/
#ifndef _MAGICKCORE_COMPRESS_H
#define _MAGICKCORE_COMPRESS_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
typedef enum
{
UndefinedCompression,
NoCompression,
BZipCompression,
FaxCompression,
Group4Compression,
JPEGCompression,
JPEG2000Compression,
LosslessJPEGCompression,
LZWCompression,
RLECompression,
ZipCompression
} CompressionType;
typedef struct _Ascii85Info
Ascii85Info;
extern MagickExport MagickBooleanType
HuffmanDecodeImage(Image *),
HuffmanEncodeImage(const ImageInfo *,Image *),
Huffman2DEncodeImage(const ImageInfo *,Image *),
LZWEncodeImage(Image *,const size_t,unsigned char *),
PackbitsEncodeImage(Image *,const size_t,unsigned char *),
ZLIBEncodeImage(Image *,const size_t,unsigned char *);
extern MagickExport void
Ascii85Encode(Image *,const unsigned char),
Ascii85Flush(Image *),
Ascii85Initialize(Image *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
|
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_FRAME_RESOURCE_FETCHER_PROPERTIES_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_FRAME_RESOURCE_FETCHER_PROPERTIES_H_
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/loader/fetch/loader_freeze_mode.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher_properties.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
namespace blink {
class Document;
class DocumentLoader;
// FrameResourceFetcherProperties is a ResourceFetcherProperties implementation
// for Frame.
class CORE_EXPORT FrameResourceFetcherProperties final
: public ResourceFetcherProperties {
public:
FrameResourceFetcherProperties(DocumentLoader& document_loader,
Document& document);
~FrameResourceFetcherProperties() override = default;
void Trace(Visitor*) const override;
// ResourceFetcherProperties implementation
const FetchClientSettingsObject& GetFetchClientSettingsObject()
const override {
return *fetch_client_settings_object_;
}
bool IsMainFrame() const override;
ControllerServiceWorkerMode GetControllerServiceWorkerMode() const override;
int64_t ServiceWorkerId() const override;
bool IsPaused() const override;
LoaderFreezeMode FreezeMode() const override;
bool IsDetached() const override { return false; }
bool IsLoadComplete() const override;
bool ShouldBlockLoadingSubResource() const override;
bool IsSubframeDeprioritizationEnabled() const override;
scheduler::FrameStatus GetFrameStatus() const override;
const KURL& WebBundlePhysicalUrl() const override;
int GetOutstandingThrottledLimit() const override;
private:
const Member<DocumentLoader> document_loader_;
const Member<Document> document_;
Member<const FetchClientSettingsObject> fetch_client_settings_object_;
const KURL web_bundle_physical_url_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_FRAME_RESOURCE_FETCHER_PROPERTIES_H_
|
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#if !defined( C_WORLD_H )
#define C_WORLD_H
#ifdef _WIN32
#pragma once
#endif
#include "c_baseentity.h"
#if defined( CLIENT_DLL )
#define CWorld C_World
#endif
class C_World : public C_BaseEntity
{
public:
DECLARE_CLASS( C_World, C_BaseEntity );
DECLARE_CLIENTCLASS();
C_World( void );
~C_World( void );
// Override the factory create/delete functions since the world is a singleton.
virtual bool Init( int entnum, int iSerialNum );
virtual void Release();
virtual void Precache();
virtual void Spawn();
// Don't worry about adding the world to the collision list; it's already there
virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_NOT_COLLIDE; }
virtual void OnDataChanged( DataUpdateType_t updateType );
virtual void PreDataUpdate( DataUpdateType_t updateType );
float GetWaveHeight() const;
const char *GetDetailSpriteMaterial() const;
public:
enum
{
MAX_DETAIL_SPRITE_MATERIAL_NAME_LENGTH = 256,
};
float m_flWaveHeight;
Vector m_WorldMins;
Vector m_WorldMaxs;
bool m_bStartDark;
float m_flMaxOccludeeArea;
float m_flMinOccluderArea;
float m_flMinPropScreenSpaceWidth;
float m_flMaxPropScreenSpaceWidth;
bool m_bColdWorld;
private:
void RegisterSharedActivities( void );
char m_iszDetailSpriteMaterial[MAX_DETAIL_SPRITE_MATERIAL_NAME_LENGTH];
};
inline float C_World::GetWaveHeight() const
{
return m_flWaveHeight;
}
inline const char *C_World::GetDetailSpriteMaterial() const
{
return m_iszDetailSpriteMaterial;
}
void ClientWorldFactoryInit();
void ClientWorldFactoryShutdown();
C_World* GetClientWorldEntity();
#endif // C_WORLD_H |
/* blas/source_syrk_r.h
*
* Copyright (C) 2001 Brian Gough
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
{
INDEX i, j, k;
int uplo, trans;
const BASE alpha_real = CONST_REAL0(alpha);
const BASE alpha_imag = CONST_IMAG0(alpha);
const BASE beta_real = CONST_REAL0(beta);
const BASE beta_imag = CONST_IMAG0(beta);
if ((alpha_real == 0.0 && alpha_imag == 0.0)
&& (beta_real == 1.0 && beta_imag == 0.0))
return;
if (Order == CblasRowMajor) {
uplo = Uplo;
/* FIXME: original blas does not make distinction between Trans and ConjTrans?? */
trans = (Trans == CblasNoTrans) ? CblasNoTrans : CblasTrans;
} else {
uplo = (Uplo == CblasUpper) ? CblasLower : CblasUpper;
trans = (Trans == CblasNoTrans) ? CblasTrans : CblasNoTrans;
}
/* form y := beta*y */
if (beta_real == 0.0 && beta_imag == 0.0) {
if (uplo == CblasUpper) {
for (i = 0; i < N; i++) {
for (j = i; j < N; j++) {
REAL(C, ldc * i + j) = 0.0;
IMAG(C, ldc * i + j) = 0.0;
}
}
} else {
for (i = 0; i < N; i++) {
for (j = 0; j <= i; j++) {
REAL(C, ldc * i + j) = 0.0;
IMAG(C, ldc * i + j) = 0.0;
}
}
}
} else if (!(beta_real == 1.0 && beta_imag == 0.0)) {
if (uplo == CblasUpper) {
for (i = 0; i < N; i++) {
for (j = i; j < N; j++) {
const BASE Cij_real = REAL(C, ldc * i + j);
const BASE Cij_imag = IMAG(C, ldc * i + j);
REAL(C, ldc * i + j) = beta_real * Cij_real - beta_imag * Cij_imag;
IMAG(C, ldc * i + j) = beta_real * Cij_imag + beta_imag * Cij_real;
}
}
} else {
for (i = 0; i < N; i++) {
for (j = 0; j <= i; j++) {
const BASE Cij_real = REAL(C, ldc * i + j);
const BASE Cij_imag = IMAG(C, ldc * i + j);
REAL(C, ldc * i + j) = beta_real * Cij_real - beta_imag * Cij_imag;
IMAG(C, ldc * i + j) = beta_real * Cij_imag + beta_imag * Cij_real;
}
}
}
}
if (alpha_real == 0.0 && alpha_imag == 0.0)
return;
if (uplo == CblasUpper && trans == CblasNoTrans) {
for (i = 0; i < N; i++) {
for (j = i; j < N; j++) {
BASE temp_real = 0.0;
BASE temp_imag = 0.0;
for (k = 0; k < K; k++) {
const BASE Aik_real = CONST_REAL(A, i * lda + k);
const BASE Aik_imag = CONST_IMAG(A, i * lda + k);
const BASE Ajk_real = CONST_REAL(A, j * lda + k);
const BASE Ajk_imag = CONST_IMAG(A, j * lda + k);
temp_real += Aik_real * Ajk_real - Aik_imag * Ajk_imag;
temp_imag += Aik_real * Ajk_imag + Aik_imag * Ajk_real;
}
REAL(C, i * ldc + j) += alpha_real * temp_real - alpha_imag * temp_imag;
IMAG(C, i * ldc + j) += alpha_real * temp_imag + alpha_imag * temp_real;
}
}
} else if (uplo == CblasUpper && trans == CblasTrans) {
for (i = 0; i < N; i++) {
for (j = i; j < N; j++) {
BASE temp_real = 0.0;
BASE temp_imag = 0.0;
for (k = 0; k < K; k++) {
const BASE Aki_real = CONST_REAL(A, k * lda + i);
const BASE Aki_imag = CONST_IMAG(A, k * lda + i);
const BASE Akj_real = CONST_REAL(A, k * lda + j);
const BASE Akj_imag = CONST_IMAG(A, k * lda + j);
temp_real += Aki_real * Akj_real - Aki_imag * Akj_imag;
temp_imag += Aki_real * Akj_imag + Aki_imag * Akj_real;
}
REAL(C, i * ldc + j) += alpha_real * temp_real - alpha_imag * temp_imag;
IMAG(C, i * ldc + j) += alpha_real * temp_imag + alpha_imag * temp_real;
}
}
} else if (uplo == CblasLower && trans == CblasNoTrans) {
for (i = 0; i < N; i++) {
for (j = 0; j <= i; j++) {
BASE temp_real = 0.0;
BASE temp_imag = 0.0;
for (k = 0; k < K; k++) {
const BASE Aik_real = CONST_REAL(A, i * lda + k);
const BASE Aik_imag = CONST_IMAG(A, i * lda + k);
const BASE Ajk_real = CONST_REAL(A, j * lda + k);
const BASE Ajk_imag = CONST_IMAG(A, j * lda + k);
temp_real += Aik_real * Ajk_real - Aik_imag * Ajk_imag;
temp_imag += Aik_real * Ajk_imag + Aik_imag * Ajk_real;
}
REAL(C, i * ldc + j) += alpha_real * temp_real - alpha_imag * temp_imag;
IMAG(C, i * ldc + j) += alpha_real * temp_imag + alpha_imag * temp_real;
}
}
} else if (uplo == CblasLower && trans == CblasTrans) {
for (i = 0; i < N; i++) {
for (j = 0; j <= i; j++) {
BASE temp_real = 0.0;
BASE temp_imag = 0.0;
for (k = 0; k < K; k++) {
const BASE Aki_real = CONST_REAL(A, k * lda + i);
const BASE Aki_imag = CONST_IMAG(A, k * lda + i);
const BASE Akj_real = CONST_REAL(A, k * lda + j);
const BASE Akj_imag = CONST_IMAG(A, k * lda + j);
temp_real += Aki_real * Akj_real - Aki_imag * Akj_imag;
temp_imag += Aki_real * Akj_imag + Aki_imag * Akj_real;
}
REAL(C, i * ldc + j) += alpha_real * temp_real - alpha_imag * temp_imag;
IMAG(C, i * ldc + j) += alpha_real * temp_imag + alpha_imag * temp_real;
}
}
} else {
BLAS_ERROR("unrecognized operation");
}
}
|
/*
Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MagickCore X11 widget methods.
*/
#ifndef _MAGICKCORE_WIDGET_H
#define _MAGICKCORE_WIDGET_H
#if defined(MAGICKCORE_X11_DELEGATE)
#include "magick/xwindow-private.h"
#endif
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#if defined(MAGICKCORE_X11_DELEGATE)
extern MagickExport int
XCommandWidget(Display *,XWindows *,const char **,XEvent *),
XConfirmWidget(Display *,XWindows *,const char *,const char *),
XDialogWidget(Display *,XWindows *,const char *,const char *,char *),
XMenuWidget(Display *,XWindows *,const char *,const char **,char *);
extern MagickExport MagickBooleanType
XPreferencesWidget(Display *,XResourceInfo *,XWindows *);
extern MagickExport void
DestroyXWidget(void),
XColorBrowserWidget(Display *,XWindows *,const char *,char *),
XFileBrowserWidget(Display *,XWindows *,const char *,char *),
XFontBrowserWidget(Display *,XWindows *,const char *,char *),
XInfoWidget(Display *,XWindows *,const char *),
XListBrowserWidget(Display *,XWindows *,XWindowInfo *,const char **,
const char *,const char *,char *),
XNoticeWidget(Display *,XWindows *,const char *,const char *),
XProgressMonitorWidget(Display *,XWindows *,const char *,
const MagickOffsetType,const MagickSizeType),
XTextViewWidget(Display *,const XResourceInfo *,XWindows *,
const MagickBooleanType,const char *,const char **);
#endif
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
|
// some ternary extension fields,
// including $GF(3^m) = GF(3)[x]/(x^m + x^t + 2)$,
// $GF(3^{2*m}) = GF(3^m)[x]/(x^2 + 1)$,
// $GF(3^{3*m}) = GF(3^m)[x]/(x^3 - x - 1)$,
// and $GF(3^{6*m}) = GF(3^{2*m})[x]/(x^3 - x - 1)$
//
// Requires:
// * pbc_field.h
#ifndef __PBC_TERNARY_EXTENSION_FIELD_H__
#define __PBC_TERNARY_EXTENSION_FIELD_H__
/* initialize $f$ as $GF(3)[x]/(x^m + x^t + 2)$ */
void field_init_gf3m(field_t f, unsigned m, unsigned t);
/* initialize $f$ as $base_field[x]/(x^2 + 1)$ */
void field_init_gf32m(field_t f, field_t base_field);
/* initialize $f$ as $base_field[x]/(x^3 - x - 1)$ */
void field_init_gf33m(field_t f, field_t base_field);
#endif //__PBC_TERNARY_EXTENSION_FIELD_H__
|
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas at Austin nor the names
of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_trsv_basic_check( obj_t* alpha,
obj_t* a,
obj_t* x );
void bli_trsv_check( obj_t* alpha,
obj_t* a,
obj_t* x );
void bli_trsv_int_check( obj_t* alpha,
obj_t* a,
obj_t* x,
cntx_t* cntx,
trsv_t* cntl );
|
/* $Xorg: Synchro.c,v 1.4 2001/02/09 02:03:37 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/Synchro.c,v 1.3 2003/04/13 19:22:18 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
static int _XSyncFunction(register Display *dpy)
{
XSync(dpy,0);
return 0;
}
int (*XSynchronize(Display *dpy, int onoff))(Display *)
{
int (*temp)(Display *);
int (*func)(Display *) = NULL;
if (onoff)
func = _XSyncFunction;
LockDisplay(dpy);
if (dpy->flags & XlibDisplayPrivSync) {
temp = dpy->savedsynchandler;
dpy->savedsynchandler = func;
} else {
temp = dpy->synchandler;
dpy->synchandler = func;
}
UnlockDisplay(dpy);
return (temp);
}
int (*XSetAfterFunction(
Display *dpy,
int (*func)(
Display*
)
))(Display *)
{
int (*temp)(Display *);
LockDisplay(dpy);
if (dpy->flags & XlibDisplayPrivSync) {
temp = dpy->savedsynchandler;
dpy->savedsynchandler = func;
} else {
temp = dpy->synchandler;
dpy->synchandler = func;
}
UnlockDisplay(dpy);
return (temp);
}
|
/* Copyright (c) 2007 by Errata Security */
#include "protos.h"
#include "ferret.h"
#include "netframe.h"
#include "formats.h"
void process_icmp(struct Seaper *seap, struct NetFrame *frame, const unsigned char *px, unsigned length)
{
unsigned type = px[0];
unsigned code = px[1];
unsigned checksum = ex16be(px+2);
length;frame;checksum;
process_record(seap,
"TEST",REC_SZ,"icmp",-1,
"type", REC_UNSIGNED, &type, sizeof(unsigned),
"code", REC_UNSIGNED, &code, sizeof(code),
0);
}
void process_icmpv6(struct Seaper *seap, struct NetFrame *frame, const unsigned char *px, unsigned length)
{
unsigned type = px[0];
unsigned code = px[1];
unsigned checksum = ex16be(px+2);
length;frame;checksum;
process_record(seap,
"TEST",REC_SZ,"icmp",-1,
"type", REC_UNSIGNED, &type, sizeof(unsigned),
"code", REC_UNSIGNED, &code, sizeof(code),
0);
if (frame->dst_ipv6[0] == 0xFF)
process_record(seap,
"ID-MAC",REC_MACADDR,frame->src_mac, 6,
"ipv6",REC_IPv6,frame->src_ipv6, 16,
0);
}
|
#include "plugin.h"
void
plugin_init(void)
{
}
|
/* altivec_predict.h, this file is part of the
* AltiVec optimized library for MJPEG tools MPEG-1/2 Video Encoder
* Copyright (C) 2002 James Klicman <james@klicman.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdint.h>
#include "altivec_conf.h"
#define ALTIVEC_TEST_PREDICT /* {{{ */ \
( ( defined(ALTIVEC_BENCHMARK) || defined(ALTIVEC_VERIFY) ) && \
ALTIVEC_TEST_FUNCTION(pred_comp) ) \
/* }}} */
#ifdef __cplusplus
extern "C" {
#endif
ALTIVEC_FUNCTION(pred_comp, void,
(uint8_t *src, uint8_t *dst, int lx,
int w, int h, int x, int y, int dx, int dy, int addflag));
#ifdef __cplusplus
}
#endif
|
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
/* { dg-add-options arm_v8_1m_mve_fp } */
/* { dg-additional-options "-O2" } */
#include <arm_mve.h>
int8x16_t foo (int8x16_t a, int16_t b)
{
return vaddq (a, (b<<3));
}
int16x8_t foo1 (int16x8_t a, int16_t b)
{
return vaddq (a, (b<<3));
}
int32x4_t foo2 (int32x4_t a, int16_t b)
{
return vaddq (a, (b<<3));
}
uint8x16_t foo3 (uint8x16_t a, int16_t b)
{
return vaddq (a, (b<<3));
}
uint16x8_t foo4 (uint16x8_t a, int16_t b)
{
return vaddq (a, (b<<3));
}
uint32x4_t foo5 (uint32x4_t a, int16_t b)
{
return vaddq (a, (b<<3));
}
float16x8_t foo6 (float16x8_t a)
{
return vaddq (a, (float16_t)23.6);
}
float32x4_t foo7 (float32x4_t a)
{
return vaddq (a, (float32_t)23.46);
}
float16x8_t foo8 (float16x8_t a)
{
return vaddq (a, 23.6);
}
float32x4_t foo9 (float32x4_t a)
{
return vaddq (a, 23.46);
}
/* { dg-final { scan-assembler-not "__ARM_undef" } } */
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2011-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/msg.h>
#include <stdio.h>
#include <pthread.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdlib.h>
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
/* System V IPC identifiers. */
static int shmid = -1, semid = -1, msqid = -1;
/* Delete any System V IPC resources that were allocated. */
static void
ipc_cleanup (void)
{
if (shmid >= 0)
shmctl (shmid, IPC_RMID, NULL);
if (semid >= 0)
semctl (semid, 0, IPC_RMID, NULL);
if (msqid >= 0)
msgctl (msqid, IPC_RMID, NULL);
}
void *
thread_proc (void *args)
{
pthread_mutex_lock (&mutex);
pthread_mutex_unlock (&mutex);
}
int
main (void)
{
const int flags = IPC_CREAT | 0666;
key_t shmkey = 3925, semkey = 7428, msgkey = 5294;
FILE *fd;
pthread_t thread;
struct sockaddr_in sock_addr;
int sock;
unsigned short port;
socklen_t size;
int status, try, retries = 1000;
atexit (ipc_cleanup);
for (try = 0; try < retries; ++try)
{
shmid = shmget (shmkey, 4096, flags | IPC_EXCL);
if (shmid >= 0)
break;
++shmkey;
}
if (shmid < 0)
{
printf ("Cannot create shared-memory region after %d tries.\n", retries);
return 1;
}
for (try = 0; try < retries; ++try)
{
semid = semget (semkey, 1, flags | IPC_EXCL);
if (semid >= 0)
break;
++semkey;
}
if (semid < 0)
{
printf ("Cannot create semaphore after %d tries.\n", retries);
return 1;
}
for (try = 0; try < retries; ++try)
{
msqid = msgget (msgkey, flags | IPC_EXCL);
if (msqid >= 0)
break;
++msgkey;
}
if (msqid < 0)
{
printf ("Cannot create message queue after %d tries.\n", retries);
return 1;
}
fd = fopen ("/dev/null", "r");
/* Lock the mutex to prevent the new thread from finishing immediately. */
pthread_mutex_lock (&mutex);
pthread_create (&thread, NULL, thread_proc, 0);
sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0)
{
printf ("Cannot create socket.\n");
return 1;
}
sock_addr.sin_family = AF_INET;
sock_addr.sin_port = 0; /* Bind to a free port. */
sock_addr.sin_addr.s_addr = htonl (INADDR_ANY);
status = bind (sock, (struct sockaddr *) &sock_addr, sizeof (sock_addr));
if (status < 0)
{
printf ("Cannot bind socket.\n");
return 1;
}
/* Find the assigned port number of the socket. */
size = sizeof (sock_addr);
status = getsockname (sock, (struct sockaddr *) &sock_addr, &size);
if (status < 0)
{
printf ("Cannot find name of socket.\n");
return 1;
}
port = ntohs (sock_addr.sin_port);
status = listen (sock, 1);
if (status < 0)
{
printf ("Cannot listen on socket.\n");
return 1;
}
/* Set breakpoint here. */
fclose (fd);
close (sock);
pthread_mutex_unlock (&mutex);
pthread_join (thread, NULL);
return 0;
}
|
/*
* main.c --- ext2 resizer main program
*
* Copyright (C) 1997, 1998 by Theodore Ts'o and
* PowerQuest, Inc.
*
* Copyright (C) 1999, 2000, 2001 by Theosore Ts'o
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
*/
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
extern char *optarg;
extern int optind;
#endif
#include <fcntl.h>
#include "resize2fs.h"
#include "../version.h"
char *program_name, *device_name;
static void usage (char *prog)
{
fprintf (stderr, _("usage: %s [-d debug_flags] [-f] [-F] [-p] device [new-size]\n\n"), prog);
exit (1);
}
static errcode_t resize_progress_func(ext2_resize_t rfs, int pass,
unsigned long cur, unsigned long max)
{
ext2_sim_progmeter progress;
const char *label;
errcode_t retval;
progress = (ext2_sim_progmeter) rfs->prog_data;
if (max == 0)
return 0;
if (cur == 0) {
if (progress)
ext2fs_progress_close(progress);
progress = 0;
switch (pass) {
case E2_RSZ_EXTEND_ITABLE_PASS:
label = _("Extending the inode table");
break;
case E2_RSZ_BLOCK_RELOC_PASS:
label = _("Relocating blocks");
break;
case E2_RSZ_INODE_SCAN_PASS:
label = _("Scanning inode table");
break;
case E2_RSZ_INODE_REF_UPD_PASS:
label = _("Updating inode references");
break;
case E2_RSZ_MOVE_ITABLE_PASS:
label = _("Moving inode table");
break;
default:
label = _("Unknown pass?!?");
break;
}
printf(_("Begin pass %d (max = %lu)\n"), pass, max);
retval = ext2fs_progress_init(&progress, label, 30,
40, max, 0);
if (retval)
progress = 0;
rfs->prog_data = (void *) progress;
}
if (progress)
ext2fs_progress_update(progress, cur);
if (cur >= max) {
if (progress)
ext2fs_progress_close(progress);
progress = 0;
rfs->prog_data = 0;
}
return 0;
}
static void check_mount(char *device)
{
errcode_t retval;
int mount_flags;
retval = ext2fs_check_if_mounted(device, &mount_flags);
if (retval) {
com_err(_("ext2fs_check_if_mount"), retval,
_("while determining whether %s is mounted."),
device);
return;
}
if (!(mount_flags & EXT2_MF_MOUNTED))
return;
fprintf(stderr, _("%s is mounted; can't resize a "
"mounted filesystem!\n\n"), device);
exit(1);
}
int main (int argc, char ** argv)
{
errcode_t retval;
ext2_filsys fs;
int c;
int flags = 0;
int flush = 0;
int force = 0;
int fd;
blk_t new_size = 0;
blk_t max_size = 0;
io_manager io_ptr;
char *tmp;
initialize_ext2_error_table();
fprintf (stderr, _("resize2fs %s (%s)\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE);
if (argc && *argv)
program_name = *argv;
while ((c = getopt (argc, argv, "d:fFhp")) != EOF) {
switch (c) {
case 'h':
usage(program_name);
break;
case 'f':
force = 1;
break;
case 'F':
flush = 1;
break;
case 'd':
flags |= atoi(optarg);
break;
case 'p':
flags |= RESIZE_PERCENT_COMPLETE;
break;
default:
usage(program_name);
}
}
if (optind == argc)
usage(program_name);
device_name = argv[optind++];
if (optind < argc) {
new_size = strtoul(argv[optind++], &tmp, 0);
if (*tmp) {
com_err(program_name, 0, _("bad filesystem size - %s"),
argv[optind - 1]);
exit(1);
}
}
if (optind < argc)
usage(program_name);
check_mount(device_name);
if (flush) {
fd = open(device_name, O_RDONLY, 0);
if (fd < 0) {
com_err("open", errno,
_("while opening %s for flushing"),
device_name);
exit(1);
}
retval = ext2fs_sync_device(fd, 1);
if (retval) {
com_err(argv[0], retval,
_("while trying to flush %s"),
device_name);
exit(1);
}
close(fd);
}
if (flags & RESIZE_DEBUG_IO) {
io_ptr = test_io_manager;
test_io_backing_manager = unix_io_manager;
} else
io_ptr = unix_io_manager;
retval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,
io_ptr, &fs);
if (retval) {
com_err (program_name, retval, _("while trying to open %s"),
device_name);
printf (_("Couldn't find valid filesystem superblock.\n"));
exit (1);
}
/*
* Check for compatibility with the feature sets. We need to
* be more stringent than ext2fs_open().
*/
if ((fs->super->s_feature_compat & ~EXT2_LIB_FEATURE_COMPAT_SUPP) ||
(fs->super->s_feature_incompat & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP)) {
com_err(program_name, EXT2_ET_UNSUPP_FEATURE,
"(%s)", device_name);
exit(1);
}
/*
* Get the size of the containing partition, and use this for
* defaults and for making sure the new filesystme doesn't
* exceed the partition size.
*/
retval = ext2fs_get_device_size(device_name, fs->blocksize,
&max_size);
if (retval) {
com_err(program_name, retval,
_("while trying to determine filesystem size"));
exit(1);
}
if (!new_size)
new_size = max_size;
if (!force && (new_size > max_size)) {
fprintf(stderr, _("The containing partition (or device)"
" is only %d blocks.\nYou requested a new size"
" of %d blocks.\n\n"), max_size,
new_size);
exit(1);
}
if (new_size == fs->super->s_blocks_count) {
fprintf(stderr, _("The filesystem is already %d blocks "
"long. Nothing to do!\n\n"), new_size);
exit(0);
}
if (!force && (fs->super->s_lastcheck < fs->super->s_mtime)) {
fprintf(stderr, _("Please run 'e2fsck -f %s' first.\n\n"),
device_name);
exit(1);
}
retval = resize_fs(fs, new_size, flags,
((flags & RESIZE_PERCENT_COMPLETE) ?
resize_progress_func : 0));
if (retval) {
com_err(program_name, retval, _("while trying to resize %s"),
device_name);
ext2fs_close (fs);
}
printf(_("The filesystem on %s is now %d blocks long.\n\n"),
device_name, new_size);
return (0);
}
|
/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
* File Name : cortexm3_macro.h
* Author : MCD Application Team
* Version : V2.0.3
* Date : 09/22/2008
* Description : Header file for cortexm3_macro.s.
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __CORTEXM3_MACRO_H
#define __CORTEXM3_MACRO_H
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x_type.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void __WFI(void);
void __WFE(void);
void __SEV(void);
void __ISB(void);
void __DSB(void);
void __DMB(void);
void __SVC(void);
u32 __MRS_CONTROL(void);
void __MSR_CONTROL(u32 Control);
u32 __MRS_PSP(void);
void __MSR_PSP(u32 TopOfProcessStack);
u32 __MRS_MSP(void);
void __MSR_MSP(u32 TopOfMainStack);
void __RESETPRIMASK(void);
void __SETPRIMASK(void);
u32 __READ_PRIMASK(void);
void __RESETFAULTMASK(void);
void __SETFAULTMASK(void);
u32 __READ_FAULTMASK(void);
void __BASEPRICONFIG(u32 NewPriority);
u32 __GetBASEPRI(void);
u16 __REV_HalfWord(u16 Data);
u32 __REV_Word(u32 Data);
#endif /* __CORTEXM3_MACRO_H */
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/
|
/* Binary mode I/O.
Copyright 2017-2019 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#define BINARY_IO_INLINE _GL_EXTERN_INLINE
#include "binary-io.h"
#if defined __DJGPP__ || defined __EMX__
# include <errno.h>
# include <unistd.h>
int
__gl_setmode_check (int fd)
{
if (isatty (fd))
{
errno = EINVAL;
return -1;
}
else
return 0;
}
#endif
|
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andrey Hristov <andrey@mysql.com> |
| Ulf Wendel <uwendel@mysql.com> |
| Georg Richter <georg@mysql.com> |
+----------------------------------------------------------------------+
$Id$
*/
#ifndef PHP_MYSQLND_H
#define PHP_MYSQLND_H
#define phpext_mysqlnd_ptr &mysqlnd_module_entry
extern zend_module_entry mysqlnd_module_entry;
#endif /* PHP_MYSQLND_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
|
#pragma once
#include "DomoticzHardware.h"
class CSBFSpot : public CDomoticzHardwareBase
{
public:
CSBFSpot(const int ID, const std::string &SBFConfigFile);
~CSBFSpot(void);
bool WriteToHardware(const char *pdata, const unsigned char length) override;
void ImportOldMonthData();
private:
void SendMeter(const unsigned char ID1,const unsigned char ID2, const double musage, const double mtotal, const std::string &defaultname);
bool GetMeter(const unsigned char ID1,const unsigned char ID2, double &musage, double &mtotal);
void Init();
bool StartHardware() override;
bool StopHardware() override;
void Do_Work();
void GetMeterDetails();
int getSunRiseSunSetMinutes(const bool bGetSunRise);
void ImportOldMonthData(const uint64_t DevID, const int Year, const int Month);
private:
std::string m_SBFConfigFile;
std::string m_SBFInverter;
std::string m_SBFDataPath;
std::string m_SBFPlantName;
std::string m_SBFDateFormat;
std::string m_SBFTimeFormat;
std::string m_LastDateTime;
std::shared_ptr<std::thread> m_thread;
};
|
/* Copyright (c) 2012, The Linux Foundataion. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __QCAMERA_ALLOCATOR__
#define __QCAMERA_ALLOCATOR__
extern "C" {
#include <mm_camera_interface.h>
}
namespace qcamera {
class QCameraMemory;
class QCameraHeapMemory;
class QCameraAllocator {
public:
virtual QCameraMemory *allocateStreamBuf(cam_stream_type_t stream_type,
int size,
int stride,
int scanline,
uint8_t &bufferCnt) = 0;
virtual int32_t allocateMoreStreamBuf(QCameraMemory *mem_obj,
int size,
uint8_t &bufferCnt) = 0;
virtual QCameraHeapMemory *allocateStreamInfoBuf(cam_stream_type_t stream_type) = 0;
virtual ~QCameraAllocator() {}
};
}; /* namespace qcamera */
#endif /* __QCAMERA_ALLOCATOR__ */
|
/*
* File: ftk_font_freetype.c
* Author: Li XianJing <xianjimli@hotmail.com>
* Brief: freetype font.
*
* Copyright (c) 2009 - 2010 Li XianJing <xianjimli@hotmail.com>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* History:
* ================================================================
* 2012-6-29 woodysu@gmail.com modified
* 2009-10-03 Li XianJing <xianjimli@hotmail.com> created
*
*/
#include "ftk_log.h"
#include <ft2build.h>
#include FT_GLYPH_H
#include "ftk_util.h"
#include "ftk_mmap.h"
#include "ftk_font.h"
typedef struct _FontFreetypePrivInfo
{
int bold;
int italic;
size_t size;
FT_Face face;
FT_Library library;
}PrivInfo;
static int ftk_font_freetype_height(FtkFont* thiz)
{
DECL_PRIV(thiz, priv);
return_val_if_fail(thiz != NULL, 0);
return priv->size;
}
static Ret ftk_font_freetype_lookup (FtkFont* thiz, unsigned short code, FtkGlyph* glyph)
{
int index = 0;
FT_Error err = 0;
DECL_PRIV(thiz, priv);
return_val_if_fail(thiz != NULL && glyph != NULL, RET_FAIL);
index = FT_Get_Char_Index(priv->face, code);
err = FT_Load_Glyph(priv->face, index, FT_LOAD_DEFAULT|FT_LOAD_RENDER);
return_val_if_fail(err == 0, RET_FAIL);
glyph->code = code;
glyph->x = priv->face->glyph->bitmap_left;
glyph->y = priv->face->glyph->bitmap_top;
glyph->w = priv->face->glyph->bitmap.width;
glyph->h = priv->face->glyph->bitmap.rows;
glyph->data = priv->face->glyph->bitmap.buffer;
// For fix a bug-- the actual bitmap of some fonts is larger than it's font size
if (glyph->h > thiz->height(thiz)) {
ftk_logw("Bug font code: %04x\n", code);
glyph->h = thiz->height(thiz);
}
return RET_OK;
}
void ftk_font_freetype_destroy(FtkFont* thiz)
{
if(thiz != NULL)
{
DECL_PRIV(thiz, priv);
FT_Done_Face(priv->face);
FT_Done_FreeType(priv->library);
FTK_ZFREE(thiz, sizeof(*thiz) + sizeof(PrivInfo));
}
return;
}
FtkFont* ftk_font_create (const char* filename, FtkFontDesc* font_desc)
{
int size = 0;
FtkFont* thiz = NULL;
return_val_if_fail(filename != NULL && font_desc != NULL, NULL);
size = ftk_font_desc_get_size(font_desc);
thiz = FTK_NEW_PRIV(FtkFont);
if(thiz != NULL)
{
FT_Error err = 0;
DECL_PRIV(thiz, priv);
thiz->ref = 1;
thiz->height = ftk_font_freetype_height;
thiz->lookup = ftk_font_freetype_lookup;
thiz->destroy= ftk_font_freetype_destroy;
priv->size = size;
err = FT_Init_FreeType(&priv->library );
if((err = FT_New_Face(priv->library, filename, 0, &priv->face)))
{
ftk_loge("load %s failed.\n", filename);
FT_Done_FreeType(priv->library);
FTK_ZFREE(thiz, sizeof(FtkFont));
}
else
{
err = FT_Select_Charmap(priv->face, ft_encoding_unicode);
if(err)
{
err = FT_Select_Charmap(priv->face, ft_encoding_latin_1 );
}
assert(err == 0);
err = FT_Set_Pixel_Sizes(priv->face, 0, size);
assert(err == 0);
ftk_logd("fonfile:%s\n", filename);
ftk_logd("font family_name:%s\n", priv->face->family_name);
ftk_logd("font style_name:%s\n", priv->face->style_name);
}
}
return thiz;
}
|
// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬
// »òÊǾ³£Ê¹Óõ«²»³£¸ü¸ÄµÄ
// ÌØ¶¨ÓÚÏîÄ¿µÄ°üº¬Îļþ
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // ´Ó Windows Í·ÎļþÖÐÅųý¼«ÉÙʹÓõÄÐÅÏ¢
// Windows Í·Îļþ:
#include <windows.h>
// TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÐèÒªµÄÆäËûÍ·Îļþ
|
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2012-12-05 Bernard the first version
*/
#include <rthw.h>
#include <rtthread.h>
#include <board.h>
extern int rt_application_init(void);
extern void rt_hw_board_init(void);
/**
* This function will startup RT-Thread RTOS.
*/
void rtthread_startup(void)
{
/* initialzie hardware interrupt */
rt_hw_interrupt_init();
/* initialize board */
rt_hw_board_init();
/* show RT-Thread version */
rt_show_version();
/* initialize memory system */
#ifdef RT_USING_HEAP
rt_system_heap_init(HEAP_BEGIN, HEAP_END);
#endif
/* initialize scheduler system */
rt_system_scheduler_init();
/* initialize timer and soft timer thread */
rt_system_timer_init();
rt_system_timer_thread_init();
/* initialize application */
rt_application_init();
/* initialize idle thread */
rt_thread_idle_init();
/* start scheduler */
rt_system_scheduler_start();
/* never reach here */
return ;
}
int main(void)
{
/* disable interrupt first */
rt_hw_interrupt_disable();
/* invoke rtthread_startup */
rtthread_startup();
return 0;
}
|
/* LwIP SNTP example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "esp_log.h"
#include "esp_attr.h"
#include "esp_sleep.h"
#include "nvs_flash.h"
#include "lwip/err.h"
#include "apps/sntp/sntp.h"
/* The examples use simple WiFi configuration that you can set via
'make menuconfig'.
If you'd rather not, just change the below entries to strings with
the config you want - ie #define EXAMPLE_WIFI_SSID "mywifissid"
*/
#define EXAMPLE_WIFI_SSID CONFIG_WIFI_SSID
#define EXAMPLE_WIFI_PASS CONFIG_WIFI_PASSWORD
/* FreeRTOS event group to signal when we are connected & ready to make a request */
static EventGroupHandle_t wifi_event_group;
/* The event group allows multiple bits for each event,
but we only care about one event - are we connected
to the AP with an IP? */
const int CONNECTED_BIT = BIT0;
static const char *TAG = "example";
/* Variable holding number of times ESP32 restarted since first boot.
* It is placed into RTC memory using RTC_DATA_ATTR and
* maintains its value when ESP32 wakes from deep sleep.
*/
RTC_DATA_ATTR static int boot_count = 0;
static void obtain_time(void);
static void initialize_sntp(void);
static void initialise_wifi(void);
static esp_err_t event_handler(void *ctx, system_event_t *event);
void app_main()
{
++boot_count;
ESP_LOGI(TAG, "Boot count: %d", boot_count);
time_t now;
struct tm timeinfo;
time(&now);
localtime_r(&now, &timeinfo);
// Is time set? If not, tm_year will be (1970 - 1900).
if (timeinfo.tm_year < (2016 - 1900)) {
ESP_LOGI(TAG, "Time is not set yet. Connecting to WiFi and getting time over NTP.");
obtain_time();
// update 'now' variable with current time
time(&now);
}
char strftime_buf[64];
// Set timezone to Eastern Standard Time and print local time
setenv("TZ", "EST5EDT,M3.2.0/2,M11.1.0", 1);
tzset();
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
ESP_LOGI(TAG, "The current date/time in New York is: %s", strftime_buf);
// Set timezone to China Standard Time
setenv("TZ", "CST-8", 1);
tzset();
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
ESP_LOGI(TAG, "The current date/time in Shanghai is: %s", strftime_buf);
const int deep_sleep_sec = 10;
ESP_LOGI(TAG, "Entering deep sleep for %d seconds", deep_sleep_sec);
esp_deep_sleep(1000000LL * deep_sleep_sec);
}
static void obtain_time(void)
{
ESP_ERROR_CHECK( nvs_flash_init() );
initialise_wifi();
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT,
false, true, portMAX_DELAY);
initialize_sntp();
// wait for time to be set
time_t now = 0;
struct tm timeinfo = { 0 };
int retry = 0;
const int retry_count = 10;
while(timeinfo.tm_year < (2016 - 1900) && ++retry < retry_count) {
ESP_LOGI(TAG, "Waiting for system time to be set... (%d/%d)", retry, retry_count);
vTaskDelay(2000 / portTICK_PERIOD_MS);
time(&now);
localtime_r(&now, &timeinfo);
}
ESP_ERROR_CHECK( esp_wifi_stop() );
}
static void initialize_sntp(void)
{
ESP_LOGI(TAG, "Initializing SNTP");
sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, "pool.ntp.org");
sntp_init();
}
static void initialise_wifi(void)
{
tcpip_adapter_init();
wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK( esp_event_loop_init(event_handler, NULL) );
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) );
wifi_config_t wifi_config = {
.sta = {
.ssid = EXAMPLE_WIFI_SSID,
.password = EXAMPLE_WIFI_PASS,
},
};
ESP_LOGI(TAG, "Setting WiFi configuration SSID %s...", wifi_config.sta.ssid);
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
ESP_ERROR_CHECK( esp_wifi_start() );
}
static esp_err_t event_handler(void *ctx, system_event_t *event)
{
switch(event->event_id) {
case SYSTEM_EVENT_STA_START:
esp_wifi_connect();
break;
case SYSTEM_EVENT_STA_GOT_IP:
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
/* This is a workaround as ESP32 WiFi libs don't currently
auto-reassociate. */
esp_wifi_connect();
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
break;
default:
break;
}
return ESP_OK;
}
|
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef XSLTUnicodeSort_h
#define XSLTUnicodeSort_h
#include <libxslt/xsltInternals.h>
namespace blink {
void xsltUnicodeSortFunction(xsltTransformContextPtr ctxt,
xmlNodePtr* sorts,
int nbsorts);
}
#endif
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_QUIC_CRYPTO_CHACHA20_POLY1305_DECRYPTER_H_
#define NET_QUIC_CRYPTO_CHACHA20_POLY1305_DECRYPTER_H_
#include <stddef.h>
#include <stdint.h>
#include "base/macros.h"
#include "net/quic/crypto/aead_base_decrypter.h"
namespace net {
// A ChaCha20Poly1305Decrypter is a QuicDecrypter that implements the
// AEAD_CHACHA20_POLY1305 algorithm specified in
// draft-agl-tls-chacha20poly1305-04, except that it truncates the Poly1305
// authenticator to 12 bytes. Create an instance by calling
// QuicDecrypter::Create(kCC12).
//
// It uses an authentication tag of 16 bytes (128 bits). There is no
// fixed nonce prefix.
class NET_EXPORT_PRIVATE ChaCha20Poly1305Decrypter : public AeadBaseDecrypter {
public:
enum {
kAuthTagSize = 12,
};
ChaCha20Poly1305Decrypter();
~ChaCha20Poly1305Decrypter() override;
const char* cipher_name() const override;
uint32_t cipher_id() const override;
private:
DISALLOW_COPY_AND_ASSIGN(ChaCha20Poly1305Decrypter);
};
} // namespace net
#endif // NET_QUIC_CRYPTO_CHACHA20_POLY1305_DECRYPTER_H_
|
#ifndef SCENE_CONFIG_H
#define SCENE_CONFIG_H
#include <QtCore/qglobal.h>
#ifdef demo_framework_EXPORTS
# define scene_EXPORTS
#endif
#ifdef scene_EXPORTS
# define SCENE_EXPORT Q_DECL_EXPORT
#else
# define SCENE_EXPORT Q_DECL_IMPORT
#endif
#endif // SCENE_CONFIG_H
|
/*
* Copyright 2019 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkPathMakers_DEFINED
#define SkPathMakers_DEFINED
#include "include/core/SkPathTypes.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRRect.h"
template <unsigned N> class SkPath_PointIterator {
public:
SkPath_PointIterator(SkPathDirection dir, unsigned startIndex)
: fCurrent(startIndex % N)
, fAdvance(dir == SkPathDirection::kCW ? 1 : N - 1) { }
const SkPoint& current() const {
SkASSERT(fCurrent < N);
return fPts[fCurrent];
}
const SkPoint& next() {
fCurrent = (fCurrent + fAdvance) % N;
return this->current();
}
protected:
SkPoint fPts[N];
private:
unsigned fCurrent;
unsigned fAdvance;
};
class SkPath_RectPointIterator : public SkPath_PointIterator<4> {
public:
SkPath_RectPointIterator(const SkRect& rect, SkPathDirection dir, unsigned startIndex)
: SkPath_PointIterator(dir, startIndex) {
fPts[0] = SkPoint::Make(rect.fLeft, rect.fTop);
fPts[1] = SkPoint::Make(rect.fRight, rect.fTop);
fPts[2] = SkPoint::Make(rect.fRight, rect.fBottom);
fPts[3] = SkPoint::Make(rect.fLeft, rect.fBottom);
}
};
class SkPath_OvalPointIterator : public SkPath_PointIterator<4> {
public:
SkPath_OvalPointIterator(const SkRect& oval, SkPathDirection dir, unsigned startIndex)
: SkPath_PointIterator(dir, startIndex) {
const SkScalar cx = oval.centerX();
const SkScalar cy = oval.centerY();
fPts[0] = SkPoint::Make(cx, oval.fTop);
fPts[1] = SkPoint::Make(oval.fRight, cy);
fPts[2] = SkPoint::Make(cx, oval.fBottom);
fPts[3] = SkPoint::Make(oval.fLeft, cy);
}
};
class SkPath_RRectPointIterator : public SkPath_PointIterator<8> {
public:
SkPath_RRectPointIterator(const SkRRect& rrect, SkPathDirection dir, unsigned startIndex)
: SkPath_PointIterator(dir, startIndex) {
const SkRect& bounds = rrect.getBounds();
const SkScalar L = bounds.fLeft;
const SkScalar T = bounds.fTop;
const SkScalar R = bounds.fRight;
const SkScalar B = bounds.fBottom;
fPts[0] = SkPoint::Make(L + rrect.radii(SkRRect::kUpperLeft_Corner).fX, T);
fPts[1] = SkPoint::Make(R - rrect.radii(SkRRect::kUpperRight_Corner).fX, T);
fPts[2] = SkPoint::Make(R, T + rrect.radii(SkRRect::kUpperRight_Corner).fY);
fPts[3] = SkPoint::Make(R, B - rrect.radii(SkRRect::kLowerRight_Corner).fY);
fPts[4] = SkPoint::Make(R - rrect.radii(SkRRect::kLowerRight_Corner).fX, B);
fPts[5] = SkPoint::Make(L + rrect.radii(SkRRect::kLowerLeft_Corner).fX, B);
fPts[6] = SkPoint::Make(L, B - rrect.radii(SkRRect::kLowerLeft_Corner).fY);
fPts[7] = SkPoint::Make(L, T + rrect.radii(SkRRect::kUpperLeft_Corner).fY);
}
};
#endif
|
// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
// reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the name Chromium Embedded
// Framework nor the names of its contributors may be used to endorse
// or promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _CEF_EXPORT_H
#define _CEF_EXPORT_H
#include "cef_build.h"
#if defined(COMPILER_MSVC)
#ifdef BUILDING_CEF_SHARED
#define CEF_EXPORT __declspec(dllexport)
#elif USING_CEF_SHARED
#define CEF_EXPORT __declspec(dllimport)
#else
#define CEF_EXPORT
#endif
#define CEF_CALLBACK __stdcall
#elif defined(COMPILER_GCC)
#define CEF_EXPORT __attribute__ ((visibility("default")))
#define CEF_CALLBACK
#endif // COMPILER_GCC
#endif // _CEF_EXPORT_H
|
/* $OpenBSD: verr.c,v 1.9 2012/12/05 23:20:00 deraadt Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
extern char *__progname; /* Program name, from crt0. */
#define __dead __attribute__((__noreturn__))
__dead void
_verr(int eval, const char *fmt, va_list ap)
{
int sverrno;
sverrno = errno;
(void)fprintf(stderr, "%s: ", __progname);
if (fmt != NULL) {
(void)vfprintf(stderr, fmt, ap);
(void)fprintf(stderr, ": ");
}
(void)fprintf(stderr, "%s\n", strerror(sverrno));
exit(eval);
}
__dead void
verr(int eval, const char *fmt, va_list ap) __attribute__((weak, alias("_verr")));
|
/* CFPlugIn_Factory.h
Copyright (c) 1999-2016, Apple Inc. and the Swift project authors
Portions Copyright (c) 2014-2016 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
*/
#if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__)
#define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1
#include "CFBundle_Internal.h"
CF_EXTERN_C_BEGIN
typedef struct __CFPFactory *_CFPFactoryRef;
extern _CFPFactoryRef _CFPFactoryCreate(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInFactoryFunction func);
extern _CFPFactoryRef _CFPFactoryCreateByName(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInRef plugIn, CFStringRef funcName);
extern _CFPFactoryRef _CFPFactoryFind(CFUUIDRef factoryID, Boolean enabled);
extern CFUUIDRef _CFPFactoryCopyFactoryID(_CFPFactoryRef factory);
extern CFPlugInRef _CFPFactoryCopyPlugIn(_CFPFactoryRef factory);
extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator, _CFPFactoryRef factory, CFUUIDRef typeID);
extern void _CFPFactoryDisable(_CFPFactoryRef factory);
extern void _CFPFactoryFlushFunctionCache(_CFPFactoryRef factory);
extern void _CFPFactoryAddType(_CFPFactoryRef factory, CFUUIDRef typeID);
extern void _CFPFactoryRemoveType(_CFPFactoryRef factory, CFUUIDRef typeID);
extern Boolean _CFPFactorySupportsType(_CFPFactoryRef factory, CFUUIDRef typeID);
extern CFArrayRef _CFPFactoryFindCopyForType(CFUUIDRef typeID);
/* These methods are called by CFPlugInInstance when an instance is created or destroyed. If a factory's instance count goes to 0 and the factory has been disabled, the factory is destroyed. */
extern void _CFPFactoryAddInstance(_CFPFactoryRef factory);
extern void _CFPFactoryRemoveInstance(_CFPFactoryRef factory);
CF_EXTERN_C_END
#endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */
|
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CryptoKeyUsage_h
#define CryptoKeyUsage_h
#if ENABLE(SUBTLE_CRYPTO)
namespace WebCore {
enum {
CryptoKeyUsageEncrypt = 1 << 0,
CryptoKeyUsageDecrypt = 1 << 1,
CryptoKeyUsageSign = 1 << 2,
CryptoKeyUsageVerify = 1 << 3,
CryptoKeyUsageDeriveKey = 1 << 4,
CryptoKeyUsageDeriveBits = 1 << 5,
CryptoKeyUsageWrapKey = 1 << 6,
CryptoKeyUsageUnwrapKey = 1 << 7
};
typedef int CryptoKeyUsage;
}
#endif // ENABLE(SUBTLE_CRYPTO)
#endif // CryptoKeyUsage_h
|
/*
* (c) 2015 flabberast <s3+flabbergast@sdfeu.org>
*
* Based on the following work:
* - Guillaume Duc's raw hid example (MIT License)
* https://github.com/guiduc/usb-hid-chibios-example
* - PJRC Teensy examples (MIT License)
* https://www.pjrc.com/teensy/usb_keyboard.html
* - hasu's TMK keyboard code (GPL v2 and some code Modified BSD)
* https://github.com/tmk/tmk_keyboard/
* - ChibiOS demo code (Apache 2.0 License)
* http://www.chibios.org
*
* Since some GPL'd code is used, this work is licensed under
* GPL v2 or later.
*/
#include "ch.h"
#include "hal.h"
#include "usb_main.h"
/* TMK includes */
#include "report.h"
#include "host.h"
#include "host_driver.h"
#include "keyboard.h"
#include "action.h"
#include "action_util.h"
#include "mousekey.h"
#include "led.h"
#include "sendchar.h"
#include "debug.h"
#include "printf.h"
#ifdef SLEEP_LED_ENABLE
#include "sleep_led.h"
#endif
#ifdef SERIAL_LINK_ENABLE
#include "serial_link/system/serial_link.h"
#endif
#ifdef VISUALIZER_ENABLE
#include "visualizer/visualizer.h"
#endif
#ifdef MIDI_ENABLE
#include "qmk_midi.h"
#endif
#ifdef STM32_EEPROM_ENABLE
#include "eeprom_stm32.h"
#endif
#include "suspend.h"
#include "wait.h"
/* -------------------------
* TMK host driver defs
* -------------------------
*/
/* declarations */
uint8_t keyboard_leds(void);
void send_keyboard(report_keyboard_t *report);
void send_mouse(report_mouse_t *report);
void send_system(uint16_t data);
void send_consumer(uint16_t data);
/* host struct */
host_driver_t chibios_driver = {
keyboard_leds,
send_keyboard,
send_mouse,
send_system,
send_consumer
};
#ifdef VIRTSER_ENABLE
void virtser_task(void);
#endif
#ifdef RAW_ENABLE
void raw_hid_task(void);
#endif
#ifdef CONSOLE_ENABLE
void console_task(void);
#endif
/* TESTING
* Amber LED blinker thread, times are in milliseconds.
*/
/* set this variable to non-zero anywhere to blink once */
// static THD_WORKING_AREA(waThread1, 128);
// static THD_FUNCTION(Thread1, arg) {
// (void)arg;
// chRegSetThreadName("blinker");
// while (true) {
// systime_t time;
// time = USB_DRIVER.state == USB_ACTIVE ? 250 : 500;
// palClearLine(LINE_CAPS_LOCK);
// chSysPolledDelayX(MS2RTC(STM32_HCLK, time));
// palSetLine(LINE_CAPS_LOCK);
// chSysPolledDelayX(MS2RTC(STM32_HCLK, time));
// }
// }
/* Main thread
*/
int main(void) {
/* ChibiOS/RT init */
halInit();
chSysInit();
#ifdef STM32_EEPROM_ENABLE
EEPROM_Init();
#endif
// TESTING
// chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
keyboard_setup();
/* Init USB */
init_usb_driver(&USB_DRIVER);
/* init printf */
init_printf(NULL,sendchar_pf);
#ifdef MIDI_ENABLE
setup_midi();
#endif
#ifdef SERIAL_LINK_ENABLE
init_serial_link();
#endif
#ifdef VISUALIZER_ENABLE
visualizer_init();
#endif
host_driver_t* driver = NULL;
/* Wait until the USB or serial link is active */
while (true) {
#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE)
if(USB_DRIVER.state == USB_ACTIVE) {
driver = &chibios_driver;
break;
}
#else
driver = &chibios_driver;
break;
#endif
#ifdef SERIAL_LINK_ENABLE
if(is_serial_link_connected()) {
driver = get_serial_link_driver();
break;
}
serial_link_update();
#endif
wait_ms(50);
}
/* Do need to wait here!
* Otherwise the next print might start a transfer on console EP
* before the USB is completely ready, which sometimes causes
* HardFaults.
*/
wait_ms(50);
print("USB configured.\n");
/* init TMK modules */
keyboard_init();
host_set_driver(driver);
#ifdef SLEEP_LED_ENABLE
sleep_led_init();
#endif
print("Keyboard start.\n");
/* Main loop */
while(true) {
#if !defined(NO_USB_STARTUP_CHECK)
if(USB_DRIVER.state == USB_SUSPENDED) {
print("[s]");
#ifdef VISUALIZER_ENABLE
visualizer_suspend();
#endif
while(USB_DRIVER.state == USB_SUSPENDED) {
/* Do this in the suspended state */
#ifdef SERIAL_LINK_ENABLE
serial_link_update();
#endif
suspend_power_down(); // on AVR this deep sleeps for 15ms
/* Remote wakeup */
if(suspend_wakeup_condition()) {
usbWakeupHost(&USB_DRIVER);
}
}
/* Woken up */
// variables has been already cleared by the wakeup hook
send_keyboard_report();
#ifdef MOUSEKEY_ENABLE
mousekey_send();
#endif /* MOUSEKEY_ENABLE */
#ifdef VISUALIZER_ENABLE
visualizer_resume();
#endif
}
#endif
keyboard_task();
#ifdef CONSOLE_ENABLE
console_task();
#endif
#ifdef VIRTSER_ENABLE
virtser_task();
#endif
#ifdef RAW_ENABLE
raw_hid_task();
#endif
}
}
|
/* lzo1a_99.c -- implementation of the LZO1A-99 algorithm
This file is part of the LZO real-time data compression library.
Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#define COMPRESS_ID 99
#define DDBITS 3
#define CLEVEL 9
/***********************************************************************
//
************************************************************************/
#define LZO_NEED_DICT_H 1
#include "config1a.h"
/***********************************************************************
// compression internal entry point.
************************************************************************/
static int
_lzo1a_do_compress ( const lzo_bytep in, lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem,
lzo_compress_t func )
{
int r;
/* don't try to compress a block that's too short */
if (in_len == 0)
{
*out_len = 0;
r = LZO_E_OK;
}
else if (in_len <= MIN_LOOKAHEAD + 1)
{
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
*out_len = 0;
r = LZO_E_NOT_COMPRESSIBLE;
#else
*out_len = pd(STORE_RUN(out,in,in_len), out);
r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
#endif
}
else
r = func(in,in_len,out,out_len,wrkmem);
return r;
}
/***********************************************************************
//
************************************************************************/
#if !defined(COMPRESS_ID)
#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
#endif
#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1a_cm.ch"
#include "lzo1b_c.ch"
/***********************************************************************
//
************************************************************************/
#define LZO_COMPRESS \
LZO_CPP_ECONCAT3(lzo1a_,COMPRESS_ID,_compress)
#define LZO_COMPRESS_FUNC \
LZO_CPP_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func)
/***********************************************************************
//
************************************************************************/
LZO_PUBLIC(int)
LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len,
lzo_bytep out, lzo_uintp out_len,
lzo_voidp wrkmem )
{
return _lzo1a_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
}
/*
vi:ts=4:et
*/
|
/*
* tps65217.c
*
* TPS65217 chip family multi-function driver
*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/regmap.h>
#include <linux/err.h>
#include <linux/mfd/core.h>
#include <linux/mfd/tps65217.h>
/*
*/
int tps65217_reg_read(struct tps65217 *tps, unsigned int reg,
unsigned int *val)
{
return regmap_read(tps->regmap, reg, val);
}
EXPORT_SYMBOL_GPL(tps65217_reg_read);
/*
*/
int tps65217_reg_write(struct tps65217 *tps, unsigned int reg,
unsigned int val, unsigned int level)
{
int ret;
unsigned int xor_reg_val;
switch (level) {
case TPS65217_PROTECT_NONE:
return regmap_write(tps->regmap, reg, val);
case TPS65217_PROTECT_L1:
xor_reg_val = reg ^ TPS65217_PASSWORD_REGS_UNLOCK;
ret = regmap_write(tps->regmap, TPS65217_REG_PASSWORD,
xor_reg_val);
if (ret < 0)
return ret;
return regmap_write(tps->regmap, reg, val);
case TPS65217_PROTECT_L2:
xor_reg_val = reg ^ TPS65217_PASSWORD_REGS_UNLOCK;
ret = regmap_write(tps->regmap, TPS65217_REG_PASSWORD,
xor_reg_val);
if (ret < 0)
return ret;
ret = regmap_write(tps->regmap, reg, val);
if (ret < 0)
return ret;
ret = regmap_write(tps->regmap, TPS65217_REG_PASSWORD,
xor_reg_val);
if (ret < 0)
return ret;
return regmap_write(tps->regmap, reg, val);
default:
return -EINVAL;
}
}
EXPORT_SYMBOL_GPL(tps65217_reg_write);
/*
*/
int tps65217_update_bits(struct tps65217 *tps, unsigned int reg,
unsigned int mask, unsigned int val, unsigned int level)
{
int ret;
unsigned int data;
ret = tps65217_reg_read(tps, reg, &data);
if (ret) {
dev_err(tps->dev, "Read from reg 0x%x failed\n", reg);
return ret;
}
data &= ~mask;
data |= val & mask;
ret = tps65217_reg_write(tps, reg, data, level);
if (ret)
dev_err(tps->dev, "Write for reg 0x%x failed\n", reg);
return ret;
}
int tps65217_set_bits(struct tps65217 *tps, unsigned int reg,
unsigned int mask, unsigned int val, unsigned int level)
{
return tps65217_update_bits(tps, reg, mask, val, level);
}
EXPORT_SYMBOL_GPL(tps65217_set_bits);
int tps65217_clear_bits(struct tps65217 *tps, unsigned int reg,
unsigned int mask, unsigned int level)
{
return tps65217_update_bits(tps, reg, mask, 0, level);
}
EXPORT_SYMBOL_GPL(tps65217_clear_bits);
static struct regmap_config tps65217_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
};
static int __devinit tps65217_probe(struct i2c_client *client,
const struct i2c_device_id *ids)
{
struct tps65217 *tps;
struct tps65217_board *pdata = client->dev.platform_data;
int i, ret;
unsigned int version;
tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
if (!tps)
return -ENOMEM;
tps->pdata = pdata;
tps->regmap = regmap_init_i2c(client, &tps65217_regmap_config);
if (IS_ERR(tps->regmap)) {
ret = PTR_ERR(tps->regmap);
dev_err(tps->dev, "Failed to allocate register map: %d\n",
ret);
return ret;
}
i2c_set_clientdata(client, tps);
tps->dev = &client->dev;
ret = tps65217_reg_read(tps, TPS65217_REG_CHIPID, &version);
if (ret < 0) {
dev_err(tps->dev, "Failed to read revision"
" register: %d\n", ret);
goto err_regmap;
}
dev_info(tps->dev, "TPS65217 ID %#x version 1.%d\n",
(version & TPS65217_CHIPID_CHIP_MASK) >> 4,
version & TPS65217_CHIPID_REV_MASK);
for (i = 0; i < TPS65217_NUM_REGULATOR; i++) {
struct platform_device *pdev;
pdev = platform_device_alloc("tps65217-pmic", i);
if (!pdev) {
dev_err(tps->dev, "Cannot create regulator %d\n", i);
continue;
}
pdev->dev.parent = tps->dev;
platform_device_add_data(pdev, &pdata->tps65217_init_data[i],
sizeof(pdata->tps65217_init_data[i]));
tps->regulator_pdev[i] = pdev;
platform_device_add(pdev);
}
return 0;
err_regmap:
regmap_exit(tps->regmap);
return ret;
}
static int __devexit tps65217_remove(struct i2c_client *client)
{
struct tps65217 *tps = i2c_get_clientdata(client);
int i;
for (i = 0; i < TPS65217_NUM_REGULATOR; i++)
platform_device_unregister(tps->regulator_pdev[i]);
regmap_exit(tps->regmap);
return 0;
}
static const struct i2c_device_id tps65217_id_table[] = {
{"tps65217", 0xF0},
{/* */}
};
MODULE_DEVICE_TABLE(i2c, tps65217_id_table);
static struct i2c_driver tps65217_driver = {
.driver = {
.name = "tps65217",
},
.id_table = tps65217_id_table,
.probe = tps65217_probe,
.remove = __devexit_p(tps65217_remove),
};
static int __init tps65217_init(void)
{
return i2c_add_driver(&tps65217_driver);
}
subsys_initcall(tps65217_init);
static void __exit tps65217_exit(void)
{
i2c_del_driver(&tps65217_driver);
}
module_exit(tps65217_exit);
MODULE_AUTHOR("AnilKumar Ch <anilkumar@ti.com>");
MODULE_DESCRIPTION("TPS65217 chip family multi-function driver");
MODULE_LICENSE("GPL v2");
|
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <memmap.h>
#include <hwregs/reg_map.h>
#include <hwregs/reg_rdwr.h>
#include <hwregs/l2cache_defs.h>
#include <asm/io.h>
#define L2CACHE_SIZE 64
int __init l2cache_init(void)
{
reg_l2cache_rw_ctrl ctrl = {0};
reg_l2cache_rw_cfg cfg = {.en = regk_l2cache_yes};
ctrl.csize = L2CACHE_SIZE;
ctrl.cbase = L2CACHE_SIZE / 4 + (L2CACHE_SIZE % 4 ? 1 : 0);
REG_WR(l2cache, regi_l2cache, rw_ctrl, ctrl);
/* */
memset((void *)(MEM_INTMEM_START | MEM_NON_CACHEABLE), 0, 2*1024);
/* */
REG_WR(l2cache, regi_l2cache, rw_cfg, cfg);
return 0;
}
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2012 Google Inc.
* Copyright (C) 2015-2016 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef IRQROUTE_H
#define IRQROUTE_H
#include <soc/irq.h>
#include <soc/pci_devs.h>
#define PCI_DEV_PIRQ_ROUTES \
PCI_DEV_PIRQ_ROUTE(XHCI_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(ME_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(GBE_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(EHCI2_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(HDA_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(PCIE_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(EHCI1_DEV, A, B, C, D), \
PCI_DEV_PIRQ_ROUTE(SATA_DEV, A, B, C, D)
/*
* Route each PIRQ[A-H] to a PIC IRQ[0-15]
* Reserved: 0, 1, 2, 8, 13
* ACPI/SCI: 10
*/
#define PIRQ_PIC_ROUTES \
PIRQ_PIC(A, 5), \
PIRQ_PIC(B, 6), \
PIRQ_PIC(C, 7), \
PIRQ_PIC(D, 10), \
PIRQ_PIC(E, 11), \
PIRQ_PIC(F, 12), \
PIRQ_PIC(G, 14), \
PIRQ_PIC(H, 15)
#endif /* IRQROUTE_H */
|
/*
* Copyright (c) 2006-2008 Chelsio, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _CHELSIO_DEFS_H
#define _CHELSIO_DEFS_H
#include <linux/skbuff.h>
#include <net/tcp.h>
#include "t3cdev.h"
#include "cxgb3_offload.h"
#define VALIDATE_TID 1
void *cxgb_alloc_mem(unsigned long size);
void cxgb_free_mem(void *addr);
/*
*/
static inline union active_open_entry *atid2entry(const struct tid_info *t,
unsigned int atid)
{
return &t->atid_tab[atid - t->atid_base];
}
static inline union listen_entry *stid2entry(const struct tid_info *t,
unsigned int stid)
{
return &t->stid_tab[stid - t->stid_base];
}
/*
*/
static inline struct t3c_tid_entry *lookup_tid(const struct tid_info *t,
unsigned int tid)
{
struct t3c_tid_entry *t3c_tid = tid < t->ntids ?
&(t->tid_tab[tid]) : NULL;
return (t3c_tid && t3c_tid->client) ? t3c_tid : NULL;
}
/*
*/
static inline struct t3c_tid_entry *lookup_stid(const struct tid_info *t,
unsigned int tid)
{
union listen_entry *e;
if (tid < t->stid_base || tid >= t->stid_base + t->nstids)
return NULL;
e = stid2entry(t, tid);
if ((void *)e->next >= (void *)t->tid_tab &&
(void *)e->next < (void *)&t->atid_tab[t->natids])
return NULL;
return &e->t3c_tid;
}
/*
*/
static inline struct t3c_tid_entry *lookup_atid(const struct tid_info *t,
unsigned int tid)
{
union active_open_entry *e;
if (tid < t->atid_base || tid >= t->atid_base + t->natids)
return NULL;
e = atid2entry(t, tid);
if ((void *)e->next >= (void *)t->tid_tab &&
(void *)e->next < (void *)&t->atid_tab[t->natids])
return NULL;
return &e->t3c_tid;
}
int attach_t3cdev(struct t3cdev *dev);
void detach_t3cdev(struct t3cdev *dev);
#endif
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#pragma once
#include "SceneryObject.h"
extern "C"
{
#include "../world/scenery.h"
}
class BannerObject final : public SceneryObject
{
private:
rct_scenery_entry _legacyType = { 0 };
public:
explicit BannerObject(const rct_object_entry &entry) : SceneryObject(entry) { }
void * GetLegacyData() override { return &_legacyType; }
void ReadLegacy(IReadObjectContext * context, IStream * stream) override;
void Load() override;
void Unload() override;
void DrawPreview(rct_drawpixelinfo * dpi, sint32 width, sint32 height) const override;
};
|
/* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
* Copyright (c) 2014 Steven Lovegrove
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <ostream>
#include <functional>
namespace pangolin
{
// Find the open brace preceeded by '$'
inline const char* FirstOpenBrace(const char* str, char token = '$', char open = '{')
{
bool symbol = false;
for(; *str != '\0'; ++str ) {
if( *str == token) {
symbol = true;
}else{
if( symbol ) {
if( *str == open ) {
return str;
} else {
symbol = false;
}
}
}
}
return 0;
}
// Find the first matching end brace. str includes open brace
inline const char* MatchingEndBrace(const char* str, char open = '{', char close = '}')
{
int b = 0;
for(; *str != '\0'; ++str ) {
if( *str == open ) {
++b;
}else if( *str == close ) {
--b;
if( b == 0 ) {
return str;
}
}
}
return 0;
}
inline std::string Transform(const std::string& val, std::function<std::string(const std::string&)> dictionary, char token = '$', char open = '{', char close = '}')
{
std::string expanded = val;
while(true)
{
const char* brace = FirstOpenBrace(expanded.c_str(), token, open);
if(brace)
{
const char* endbrace = MatchingEndBrace(brace);
if( endbrace )
{
std::ostringstream oss;
oss << std::string(expanded.c_str(), brace-1);
const std::string inexpand = Transform( std::string(brace+1,endbrace), dictionary, token, open, close );
oss << dictionary(inexpand);
oss << std::string(endbrace+1, expanded.c_str() + expanded.length() );
expanded = oss.str();
continue;
}
}
break;
}
return expanded;
}
}
|
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <windows.h>
#include "webrtc/base/constructormagic.h"
#include "webrtc/modules/desktop_capture/desktop_geometry.h"
namespace webrtc {
// Output the window rect, with the left/right/bottom frame border cropped if
// the window is maximized. |cropped_rect| is the cropped rect relative to the
// desktop. |original_rect| is the original rect returned from GetWindowRect.
// Returns true if all API calls succeeded.
bool GetCroppedWindowRect(HWND window,
DesktopRect* cropped_rect,
DesktopRect* original_rect);
typedef HRESULT (WINAPI *DwmIsCompositionEnabledFunc)(BOOL* enabled);
class AeroChecker {
public:
AeroChecker();
~AeroChecker();
bool IsAeroEnabled();
private:
HMODULE dwmapi_library_;
DwmIsCompositionEnabledFunc func_;
RTC_DISALLOW_COPY_AND_ASSIGN(AeroChecker);
};
} // namespace webrtc
|
/* @(#) interface to utility functions for udpxy
*
* Copyright 2008-2011 Pavel V. Cherenkov (pcherenkov@gmail.com)
*
* This file is part of udpxy.
*
* udpxy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* udpxy is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with udpxy. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTILH_UDPXY_200712181853
#define UTILH_UDPXY_200712181853
#include <sys/types.h>
#include <stdio.h>
struct timeval;
#ifdef __cplusplus
extern "C" {
#endif
/* write buffer to a file
*/
ssize_t
save_buffer( const void* buf, size_t len, const char* filename );
/* read text file into a buffer
*
*/
ssize_t
txtf_read (const char* fpath, char* dst, size_t maxlen, FILE* log);
/* start process as a daemon
*
*/
#define DZ_STDIO_OPEN 1 /* do not close STDIN, STDOUT, STDERR */
int
daemonize(int options, FILE* log);
/* multiplex error output to custom log
* and syslog
*/
void
mperror( FILE* fp, int err, const char* format, ... );
/* create and lock file with process's ID
*/
int
make_pidfile( const char* fpath, pid_t pid, FILE* log );
/* write path to application's pidfile into the the buffer
* (fail of destination directory is not writable)
*/
int
set_pidfile( const char* appname, int port, char* buf, size_t len );
/* write buffer to designated socket/file
* return number of bytes read/written or one of the error
* codes below
*/
#define IO_ERR -1 /* generic error */
#define IO_BLK -2 /* operation timed out or would block */
ssize_t
write_buf( int fd, const char* data, const ssize_t len, FILE* log );
/* read data chunk of designated size into buffer
*/
ssize_t
read_buf( int fd, char* buf, const ssize_t len, FILE* log );
/* output hex dump of a memory fragment
*/
void
hex_dump( const char* msg, const char* data, size_t len, FILE* log );
/* check for expected size, complain if not matched
*/
int
sizecheck( const char* msg, ssize_t expct, ssize_t len,
FILE* log, const char* func );
/* check for a potential buffer overrun by
* evaluating target buffer and the portion
* of that buffer to be accessed
*/
int
buf_overrun( const char* buf, size_t buflen,
size_t offset, size_t dlen,
FILE* log );
/* write timestamp-prepended formatted message to file
*/
int
tmfprintf( FILE* stream, const char* format, ... );
/* write timestamp-prepended message to file
*/
int
tmfputs( const char* s, FILE* stream );
/* print out command-line
*/
void
printcmdln( FILE* stream, const char* msg,
int argc, char* const argv[] );
/* convert timespec to time_t
* where
* timespec format: [+|-]dd:hh24:mi:ss
*
* @return 0 if success, n>0 if parse error at position n,
* -1 otherwise
*/
int
a2time( const char* str, time_t* t, time_t from );
/* convert ASCII size spec (positive) into numeric value
* size spec format:
* num[modifier], where num is an ASCII representation of
* any positive integer and
* modifier ::= [Kb|K|Mb|M|Gb|G]
*/
int
a2size( const char* str, ssize_t* pval );
int
a2int64( const char* str, int64_t* pval );
/* returns asctime w/o CR character at the end
*/
struct tm;
const char*
Zasctime( const struct tm* tm );
/* adjust nice value if needed
*/
int
set_nice( int val, FILE* log );
/* check and report a deviation in values: n_was and n_is are not supposed
* to differ more than by delta
*/
void
check_fragments( const char* action, ssize_t total, ssize_t n_was, ssize_t n_is,
ssize_t delta, FILE* log );
/* create timestamp string in YYYY-mm-dd HH24:MI:SS.MSEC from struct timeval
*/
static const int32_t TVSTAMP_GMT = 1;
int
mk_tvstamp( const struct timeval* tv, char* buf, size_t* len,
int32_t flags );
/* retrieve UNIX time value from given environment
* variable, otherwise return default */
time_t
get_timeval( const char* envar, const time_t deflt );
/* retrieve flag value as 1 = true, 0 = false
* from an environment variable set in the form
* of 0|1|'true'|'false'|'yes'|'no'
*/
int
get_flagval( const char* envar, const int deflt );
/* retrieve LONG value from given environment
* variable, otherwise return default */
ssize_t
get_sizeval( const char* envar, const ssize_t deflt );
/* retrieve/reset string representation of pid,
*/
const char*
get_pidstr( int reset, const char* pfx );
/* retrieve system info string
*/
const char*
get_sysinfo (int* perr);
/* return 1 if err is one of the errors signifying possibility of a block, 0 otherwise.
*/
int
would_block(int err);
/* return 1 if this kind of error should not be captures in syslog, 0 otherwise.
*/
int
no_fault(int err);
/* populate info string with application's credentials (version, patch, etc.)
*/
void
mk_app_info(const char *appname, char *info, size_t infolen);
#ifdef __cplusplus
}
#endif
#endif /* UTILH_UDPXY_200712181853 */
/* __EOF__ */
|
/*
SuperCollider real time audio synthesis system
Copyright (c) 2002 James McCartney. All rights reserved.
http://www.audiosynth.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PYRINTERPRETER_H_
#define _PYRINTERPRETER_H_
#include "PyrSlot.h"
#include "VMGlobals.h"
#include "SC_Export.h"
extern bool gRunningInterpreterThread;
extern int gNumClasses;
extern int gNumClassVars;
bool initInterpreter(VMGlobals *g, PyrSymbol *selector, int numArgsPushed);
bool initRuntime(VMGlobals *g, int poolSize, AllocPool *inPool);
void Interpret(VMGlobals *g);
int doSpecialUnaryArithMsg(VMGlobals *g, int numArgsPushed);
int prSpecialBinaryArithMsg(VMGlobals *g, int numArgsPushed);
int doSpecialBinaryArithMsg(VMGlobals *g, int numArgsPushed, bool isPrimitive);
void DumpBackTrace(VMGlobals *g);
void DumpStack(VMGlobals *g, PyrSlot *sp);
void DumpFrame(struct PyrFrame *frame);
bool FrameSanity(PyrFrame *frame, const char *tagstr);
struct PyrProcess* newPyrProcess(VMGlobals *g, struct PyrClass *classobj);
void startProcess(VMGlobals *g, PyrSymbol *selector);
SC_DLLEXPORT_C void runInterpreter(VMGlobals *g, PyrSymbol *selector, int numArgsPushed);
#endif
|
/*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPJ_INCLUDES_H
#define OPJ_INCLUDES_H
/*
* This must be included before any system headers,
* since they can react to macro defined there
*/
#include "opj_config_private.h"
/*
==========================================================
Standard includes used by the library
==========================================================
*/
#include <memory.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <time.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
/*
Use fseeko() and ftello() if they are available since they use
'off_t' rather than 'long'. It is wrong to use fseeko() and
ftello() only on systems with special LFS support since some systems
(e.g. FreeBSD) support a 64-bit off_t by default.
*/
#if defined(OPJ_HAVE_FSEEKO)
# define fseek fseeko
# define ftell ftello
#endif
#if defined(WIN32) && !defined(Windows95) && !defined(__BORLANDC__) && \
!(defined(_MSC_VER) && _MSC_VER < 1400) && \
!(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800)
/*
Windows '95 and Borland C do not support _lseeki64
Visual Studio does not support _fseeki64 and _ftelli64 until the 2005 release.
Without these interfaces, files over 2GB in size are not supported for Windows.
*/
# define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence)
# define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff)
# define OPJ_FTELL(stream) /* __int64 */ _ftelli64(stream)
# define OPJ_STAT_STRUCT_T struct _stati64
# define OPJ_STAT(path,stat_buff) _stati64(path,/* struct _stati64 */ stat_buff)
#else
# define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence)
# define OPJ_FSTAT(fildes,stat_buff) fstat(fildes,stat_buff)
# define OPJ_FTELL(stream) ftell(stream)
# define OPJ_STAT_STRUCT_T struct stat
# define OPJ_STAT(path,stat_buff) stat(path,stat_buff)
#endif
/*
==========================================================
OpenJPEG interface
==========================================================
*/
#include "openjpeg.h"
/*
==========================================================
OpenJPEG modules
==========================================================
*/
/* Ignore GCC attributes if this is not GCC */
#ifndef __GNUC__
#define __attribute__(x) /* __attribute__(x) */
#endif
/*
The inline keyword is supported by C99 but not by C90.
Most compilers implement their own version of this keyword ...
*/
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#endif /* INLINE */
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ != 199901L)
/* Not a C99 compiler */
#ifdef __GNUC__
#define restrict __restrict__
#else
#define restrict /* restrict */
#endif
#endif
/* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__)
static INLINE long lrintf(float f){
#ifndef _M_IX86
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
#else
int i;
_asm{
fld f
fistp i
};
return i;
#endif
}
#endif
#include "opj_inttypes.h"
#include "opj_clock.h"
#include "opj_malloc.h"
#include "function_list.h"
#include "event.h"
#include "bio.h"
#include "cio.h"
#include "image.h"
#include "invert.h"
#include "j2k.h"
#include "jp2.h"
#include "mqc.h"
#include "raw.h"
#include "bio.h"
#include "pi.h"
#include "tgt.h"
#include "tcd.h"
#include "t1.h"
#include "dwt.h"
#include "t2.h"
#include "mct.h"
#include "opj_intmath.h"
#ifdef USE_JPIP
#include "cidx_manager.h"
#include "indexbox_manager.h"
#endif
/* JPWL>> */
#ifdef USE_JPWL
#include "openjpwl/jpwl.h"
#endif /* USE_JPWL */
/* <<JPWL */
/* V2 */
#endif /* OPJ_INCLUDES_H */
|
/* ****************************************************************************
* eID Middleware Project.
* Copyright (C) 2008-2010 FedICT.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version
* 3.0 as published by the Free Software Foundation.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, see
* http://www.gnu.org/licenses/.
**************************************************************************** */
#ifndef __UTIL_H__
#define __UTIL_H__
extern DWORD BeidGetPubKey(PCARD_DATA pCardData, DWORD cbCertif, PBYTE pbCertif, DWORD *pcbPubKey, PBYTE *ppbPubKey);
extern DWORD BeidCreateMSRoots(PCARD_DATA pCardData, DWORD *pcbMSRoots, PBYTE *ppbMSRoots);
#endif |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_FRAMEWORK_TENSOR_KEY_H_
#define TENSORFLOW_CORE_FRAMEWORK_TENSOR_KEY_H_
#include "tensorflow/core/framework/tensor.h"
namespace tensorflow {
class TensorKey : public Tensor {
public:
using Tensor::Tensor;
TensorKey(const Tensor& t) : Tensor(t) {}
// Equality operator. Needed for absl hashing.
friend bool operator==(const TensorKey& t1, const TensorKey& t2) {
if (t1.dtype() != t2.dtype() || t1.shape() != t2.shape()) {
return false;
}
if (DataTypeCanUseMemcpy(t1.dtype())) {
return t1.tensor_data() == t2.tensor_data();
}
if (t1.dtype() == DT_STRING) {
const auto s1 = t1.unaligned_flat<tstring>();
const auto s2 = t2.unaligned_flat<tstring>();
for (int64_t i = 0, n = t1.NumElements(); i < n; ++i) {
if (TF_PREDICT_FALSE(s1(i) != s2(i))) {
return false;
}
}
return true;
}
return false;
}
friend bool operator!=(const TensorKey& t1, const TensorKey& t2) {
return !(t1 == t2);
}
// Needed for absl hash function.
template <typename H>
friend H AbslHashValue(H h, const TensorKey& k) {
const uint8* d = static_cast<uint8*>(k.data());
size_t s = k.AllocatedBytes();
std::vector<uint8> vec;
vec.reserve(s);
for (int i = 0; i < s; i++) {
vec.push_back(d[i]);
}
return H::combine(std::move(h), s);
}
};
} // namespace tensorflow
#endif
|
/* nest101.h */
#include "nest102.h"
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ4_DECODER_DATABASE_H_
#define WEBRTC_MODULES_AUDIO_CODING_NETEQ4_DECODER_DATABASE_H_
#include <map>
#include "webrtc/common_types.h" // NULL
#include "webrtc/modules/audio_coding/neteq4/interface/audio_decoder.h"
#include "webrtc/modules/audio_coding/neteq4/packet.h"
#include "webrtc/system_wrappers/interface/constructor_magic.h"
#include "webrtc/typedefs.h"
namespace webrtc {
// Forward declaration.
class AudioDecoder;
class DecoderDatabase {
public:
enum DatabaseReturnCodes {
kOK = 0,
kInvalidRtpPayloadType = -1,
kCodecNotSupported = -2,
kInvalidSampleRate = -3,
kDecoderExists = -4,
kDecoderNotFound = -5,
kInvalidPointer = -6
};
// Struct used to store decoder info in the database.
struct DecoderInfo {
// Constructors.
DecoderInfo()
: codec_type(kDecoderArbitrary),
fs_hz(8000),
decoder(NULL),
external(false) {
}
DecoderInfo(NetEqDecoder ct, int fs, AudioDecoder* dec, bool ext)
: codec_type(ct),
fs_hz(fs),
decoder(dec),
external(ext) {
}
// Destructor. (Defined in decoder_database.cc.)
~DecoderInfo();
NetEqDecoder codec_type;
int fs_hz;
AudioDecoder* decoder;
bool external;
};
static const uint8_t kMaxRtpPayloadType = 0x7F; // Max for a 7-bit number.
// Maximum value for 8 bits, and an invalid RTP payload type (since it is
// only 7 bits).
static const uint8_t kRtpPayloadTypeError = 0xFF;
DecoderDatabase()
: active_decoder_(-1),
active_cng_decoder_(-1) {
}
virtual ~DecoderDatabase() {}
// Returns true if the database is empty.
virtual bool Empty() const { return decoders_.empty(); }
// Returns the number of decoders registered in the database.
virtual int Size() const { return decoders_.size(); }
// Resets the database, erasing all registered payload types, and deleting
// any AudioDecoder objects that were not externally created and inserted
// using InsertExternal().
virtual void Reset();
// Registers |rtp_payload_type| as a decoder of type |codec_type|. Returns
// kOK on success; otherwise an error code.
virtual int RegisterPayload(uint8_t rtp_payload_type,
NetEqDecoder codec_type);
// Registers an externally created AudioDecoder object, and associates it
// as a decoder of type |codec_type| with |rtp_payload_type|.
virtual int InsertExternal(uint8_t rtp_payload_type,
NetEqDecoder codec_type,
int fs_hz, AudioDecoder* decoder);
// Removes the entry for |rtp_payload_type| from the database.
// Returns kDecoderNotFound or kOK depending on the outcome of the operation.
virtual int Remove(uint8_t rtp_payload_type);
// Returns a pointer to the DecoderInfo struct for |rtp_payload_type|. If
// no decoder is registered with that |rtp_payload_type|, NULL is returned.
virtual const DecoderInfo* GetDecoderInfo(uint8_t rtp_payload_type) const;
// Returns one RTP payload type associated with |codec_type|, or
// kDecoderNotFound if no entry exists for that value. Note that one
// |codec_type| may be registered with several RTP payload types, and the
// method may return any of them.
virtual uint8_t GetRtpPayloadType(NetEqDecoder codec_type) const;
// Returns a pointer to the AudioDecoder object associated with
// |rtp_payload_type|, or NULL if none is registered. If the AudioDecoder
// object does not exist for that decoder, the object is created.
virtual AudioDecoder* GetDecoder(uint8_t rtp_payload_type);
// Returns true if |rtp_payload_type| is registered as a |codec_type|.
virtual bool IsType(uint8_t rtp_payload_type,
NetEqDecoder codec_type) const;
// Returns true if |rtp_payload_type| is registered as comfort noise.
virtual bool IsComfortNoise(uint8_t rtp_payload_type) const;
// Returns true if |rtp_payload_type| is registered as DTMF.
virtual bool IsDtmf(uint8_t rtp_payload_type) const;
// Returns true if |rtp_payload_type| is registered as RED.
virtual bool IsRed(uint8_t rtp_payload_type) const;
// Sets the active decoder to be |rtp_payload_type|. If this call results in a
// change of active decoder, |new_decoder| is set to true. The previous active
// decoder's AudioDecoder object is deleted.
virtual int SetActiveDecoder(uint8_t rtp_payload_type, bool* new_decoder);
// Returns the current active decoder, or NULL if no active decoder exists.
virtual AudioDecoder* GetActiveDecoder();
// Sets the active comfort noise decoder to be |rtp_payload_type|. If this
// call results in a change of active comfort noise decoder, the previous
// active decoder's AudioDecoder object is deleted.
virtual int SetActiveCngDecoder(uint8_t rtp_payload_type);
// Returns the current active comfort noise decoder, or NULL if no active
// comfort noise decoder exists.
virtual AudioDecoder* GetActiveCngDecoder();
// Returns kOK if all packets in |packet_list| carry payload types that are
// registered in the database. Otherwise, returns kDecoderNotFound.
virtual int CheckPayloadTypes(const PacketList& packet_list) const;
private:
typedef std::map<uint8_t, DecoderInfo> DecoderMap;
DecoderMap decoders_;
int active_decoder_;
int active_cng_decoder_;
DISALLOW_COPY_AND_ASSIGN(DecoderDatabase);
};
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ4_DECODER_DATABASE_H_
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <Foundation/Foundation.h>
@class DVTLanguageSpecification, NSArray;
@interface DVTSourceModelParserProductionRule : NSObject
{
int _rc;
id *_tokenPredictSetBuffer;
unsigned long long _tokenPredictSetBufferSize;
id *_nodePredictSetBuffer;
unsigned long long _nodePredictSetBufferSize;
BOOL _blockScope;
BOOL _inheritsNodeType;
BOOL _ignoreToken;
BOOL _itemIsVolatile;
BOOL _saveEndToken;
BOOL _interiorRuleMayHaveTemporaryLexerFlags;
short _itemSyntaxType;
int _startToken;
int _endToken;
int _altEndToken;
DVTLanguageSpecification *_startProduction;
DVTLanguageSpecification *_endProduction;
DVTLanguageSpecification *_altEndProduction;
NSArray *_predictSet;
NSArray *_interiorProductionRules;
DVTLanguageSpecification *_langSpec;
long long _itemToken;
unsigned long long _lexerMode;
NSArray *_tokenInteriorPredictSet;
NSArray *_nodeInteriorPredictSet;
}
+ (void)initializeProductionsForLanguageSpecification:(id)arg1;
+ (unsigned long long)indexOfProductionMatchingNode:(id)arg1 inProduction:(id)arg2;
+ (unsigned long long)indexOfProductionMatchingToken:(int)arg1 inProduction:(id)arg2;
+ (int)tokenForSymbol:(id)arg1;
@property(nonatomic) BOOL interiorRuleMayHaveTemporaryLexerFlags; // @synthesize interiorRuleMayHaveTemporaryLexerFlags=_interiorRuleMayHaveTemporaryLexerFlags;
@property(retain, nonatomic) NSArray *nodeInteriorPredictSet; // @synthesize nodeInteriorPredictSet=_nodeInteriorPredictSet;
@property(retain, nonatomic) NSArray *tokenInteriorPredictSet; // @synthesize tokenInteriorPredictSet=_tokenInteriorPredictSet;
@property(nonatomic) unsigned long long lexerMode; // @synthesize lexerMode=_lexerMode;
@property(nonatomic) BOOL saveEndToken; // @synthesize saveEndToken=_saveEndToken;
@property(nonatomic) BOOL itemIsVolatile; // @synthesize itemIsVolatile=_itemIsVolatile;
@property(nonatomic) BOOL ignoreToken; // @synthesize ignoreToken=_ignoreToken;
@property(nonatomic) BOOL inheritsNodeType; // @synthesize inheritsNodeType=_inheritsNodeType;
@property(nonatomic) BOOL blockScope; // @synthesize blockScope=_blockScope;
@property(nonatomic) short itemSyntaxType; // @synthesize itemSyntaxType=_itemSyntaxType;
@property(nonatomic) long long itemToken; // @synthesize itemToken=_itemToken;
@property(readonly, nonatomic) DVTLanguageSpecification *langSpec; // @synthesize langSpec=_langSpec;
@property(retain, nonatomic) NSArray *interiorProductionRules; // @synthesize interiorProductionRules=_interiorProductionRules;
@property(readonly, nonatomic) NSArray *predictSet; // @synthesize predictSet=_predictSet;
@property(nonatomic) DVTLanguageSpecification *altEndProduction; // @synthesize altEndProduction=_altEndProduction;
@property(nonatomic) int altEndToken; // @synthesize altEndToken=_altEndToken;
@property(nonatomic) DVTLanguageSpecification *endProduction; // @synthesize endProduction=_endProduction;
@property(readonly, nonatomic) DVTLanguageSpecification *startProduction; // @synthesize startProduction=_startProduction;
@property(readonly, nonatomic) int endToken; // @synthesize endToken=_endToken;
@property(readonly, nonatomic) int startToken; // @synthesize startToken=_startToken;
- (void).cxx_destruct;
- (unsigned long long)hash;
- (BOOL)isEqual:(id)arg1;
- (id)description;
- (BOOL)matchEndNode:(id)arg1;
- (BOOL)matchEndToken:(int)arg1;
- (BOOL)matchNode:(id)arg1;
- (BOOL)matchToken:(int)arg1;
@property(readonly, nonatomic) BOOL scopeProduction;
- (id *)_nodePredictSetBuffer;
- (id *)_tokenPredictSetBuffer;
- (void)dealloc;
- (id)initWithStartProduction:(id)arg1 langSpec:(id)arg2;
- (id)initWithStartToken:(int)arg1 endToken:(int)arg2 langSpec:(id)arg3 predictSet:(id)arg4;
- (BOOL)_isDeallocating;
- (BOOL)_tryRetain;
- (unsigned long long)retainCount;
- (oneway void)release;
- (id)retain;
@end
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MarkingVisitorImpl_h
#define MarkingVisitorImpl_h
#include "platform/heap/Heap.h"
#include "platform/heap/ThreadState.h"
#include "platform/heap/Visitor.h"
#include "wtf/Functional.h"
#include "wtf/HashFunctions.h"
#include "wtf/Locker.h"
#include "wtf/RawPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/TypeTraits.h"
namespace blink {
template <typename Derived>
class MarkingVisitorImpl {
protected:
inline void markHeader(HeapObjectHeader* header, const void* objectPointer, TraceCallback callback)
{
ASSERT(header);
ASSERT(objectPointer);
// Check that we are not marking objects that are outside
// the heap by calling Heap::contains. However we cannot
// call Heap::contains when outside a GC and we call mark
// when doing weakness for ephemerons. Hence we only check
// when called within.
ASSERT(!ThreadState::current()->isInGC() || Heap::containedInHeapOrOrphanedPage(header));
if (!toDerived()->shouldMarkObject(objectPointer))
return;
// If you hit this ASSERT, it means that there is a dangling pointer
// from a live thread heap to a dead thread heap. We must eliminate
// the dangling pointer.
// Release builds don't have the ASSERT, but it is OK because
// release builds will crash in the following header->isMarked()
// because all the entries of the orphaned heaps are zapped.
ASSERT(!pageFromObject(objectPointer)->orphaned());
if (header->isMarked())
return;
header->mark();
#if ENABLE(GC_PROFILING)
toDerived()->recordObjectGraphEdge(objectPointer);
#endif
if (callback)
Heap::pushTraceCallback(const_cast<void*>(objectPointer), callback);
}
inline void mark(const void* objectPointer, TraceCallback callback)
{
if (!objectPointer)
return;
HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer);
markHeader(header, header->payload(), callback);
}
inline void registerDelayedMarkNoTracing(const void* objectPointer)
{
Heap::pushPostMarkingCallback(const_cast<void*>(objectPointer), &markNoTracingCallback);
}
inline void registerWeakMembers(const void* closure, const void* objectPointer, WeakPointerCallback callback)
{
Heap::pushWeakPointerCallback(const_cast<void*>(closure), const_cast<void*>(objectPointer), callback);
}
inline void registerWeakTable(const void* closure, EphemeronCallback iterationCallback, EphemeronCallback iterationDoneCallback)
{
Heap::registerWeakTable(const_cast<void*>(closure), iterationCallback, iterationDoneCallback);
}
#if ENABLE(ASSERT)
inline bool weakTableRegistered(const void* closure)
{
return Heap::weakTableRegistered(closure);
}
#endif
inline bool isMarked(const void* objectPointer)
{
return HeapObjectHeader::fromPayload(objectPointer)->isMarked();
}
inline bool ensureMarked(const void* objectPointer)
{
if (!objectPointer)
return false;
if (!toDerived()->shouldMarkObject(objectPointer))
return false;
#if ENABLE(ASSERT)
if (isMarked(objectPointer))
return false;
toDerived()->markNoTracing(objectPointer);
#else
// Inline what the above markNoTracing() call expands to,
// so as to make sure that we do get all the benefits.
HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer);
if (header->isMarked())
return false;
header->mark();
#endif
return true;
}
Derived* toDerived()
{
return static_cast<Derived*>(this);
}
protected:
inline void registerWeakCellWithCallback(void** cell, WeakPointerCallback callback)
{
Heap::pushWeakCellPointerCallback(cell, callback);
}
private:
static void markNoTracingCallback(Visitor* visitor, void* object)
{
visitor->markNoTracing(object);
}
};
} // namespace blink
#endif
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_STORE_H_
#define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_STORE_H_
#include <string>
#include "base/bind.h"
#include "base/containers/hash_tables.h"
#include "base/containers/mru_cache.h"
#include "base/macros.h"
#include "components/dom_distiller/core/article_entry.h"
#include "components/dom_distiller/core/proto/distilled_article.pb.h"
namespace dom_distiller {
// The maximum number of items to keep in the cache before deleting some.
const int kDefaultMaxNumCachedEntries = 32;
// This is a simple interface for saving and loading of distilled content for an
// ArticleEntry.
class DistilledContentStore {
public:
typedef base::Callback<
void(bool /* success */, scoped_ptr<DistilledArticleProto>)> LoadCallback;
typedef base::Callback<void(bool /* success */)> SaveCallback;
virtual void SaveContent(const ArticleEntry& entry,
const DistilledArticleProto& proto,
SaveCallback callback) = 0;
virtual void LoadContent(const ArticleEntry& entry,
LoadCallback callback) = 0;
DistilledContentStore() {};
virtual ~DistilledContentStore() {};
private:
DISALLOW_COPY_AND_ASSIGN(DistilledContentStore);
};
// This content store keeps up to |max_num_entries| of the last accessed items
// in its cache. Both loading and saving content is counted as access.
// Lookup can be done based on entry ID or URL.
class InMemoryContentStore : public DistilledContentStore {
public:
explicit InMemoryContentStore(const int max_num_entries);
~InMemoryContentStore() override;
// DistilledContentStore implementation
void SaveContent(const ArticleEntry& entry,
const DistilledArticleProto& proto,
SaveCallback callback) override;
void LoadContent(const ArticleEntry& entry, LoadCallback callback) override;
// Synchronously saves the content.
void InjectContent(const ArticleEntry& entry,
const DistilledArticleProto& proto);
private:
// The CacheDeletor gets called when anything is removed from the ContentMap.
class CacheDeletor {
public:
explicit CacheDeletor(InMemoryContentStore* store);
~CacheDeletor();
void operator()(const DistilledArticleProto& proto);
private:
InMemoryContentStore* store_;
};
void AddUrlToIdMapping(const ArticleEntry& entry,
const DistilledArticleProto& proto);
void EraseUrlToIdMapping(const DistilledArticleProto& proto);
typedef base::MRUCacheBase<std::string,
DistilledArticleProto,
InMemoryContentStore::CacheDeletor> ContentMap;
typedef base::hash_map<std::string, std::string> UrlMap;
ContentMap cache_;
UrlMap url_to_id_;
};
} // dom_distiller
#endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_CONTENT_CACHE_H_
|
/*
* Copyright (c) 2015-2016 ARM Limited. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __COAP_SECURITY_HANDLER_STUB_H__
#define __COAP_SECURITY_HANDLER_STUB_H__
#include <inttypes.h>
#include "coap_security_handler.h"
typedef struct tsh{
coap_security_t *sec_obj;
int int_value;
int counter;
int values[10];
int (*send_cb)(int8_t socket_id, uint8_t *address_ptr, uint16_t port, const unsigned char *, size_t);
int (*receive_cb)(int8_t socket_id, unsigned char *, size_t);
void (*start_timer_cb)(int8_t timer_id, uint32_t min, uint32_t fin);
int (*timer_status_cb)(int8_t timer_id);
} thread_sec_def;
extern thread_sec_def coap_security_handler_stub;
#endif //__COAP_SECURITY_HANDLER_STUB_H__
|
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#ifdef _WIN32
#include <windows.h>
#endif
#include "Common/CommonTypes.h"
#include "Common/MathUtil.h"
#include "VideoCommon/VideoBackendBase.h"
// These are accurate (disregarding AA modes).
enum
{
EFB_WIDTH = 640,
EFB_HEIGHT = 528,
};
// XFB width is decided by EFB copy operation. The VI can do horizontal
// scaling (TODO: emulate).
const u32 MAX_XFB_WIDTH = EFB_WIDTH;
// Although EFB height is 528, 574-line XFB's can be created either with
// vertical scaling by the EFB copy operation or copying to multiple XFB's
// that are next to each other in memory (TODO: handle that situation).
const u32 MAX_XFB_HEIGHT = 574;
// This structure should only be used to represent a rectangle in EFB
// coordinates, where the origin is at the upper left and the frame dimensions
// are 640 x 528.
typedef MathUtil::Rectangle<int> EFBRectangle;
// This structure should only be used to represent a rectangle in standard target
// coordinates, where the origin is at the lower left and the frame dimensions
// depend on the resolution settings. Use Renderer::ConvertEFBRectangle to
// convert an EFBRectangle to a TargetRectangle.
struct TargetRectangle : public MathUtil::Rectangle<int>
{
#ifdef _WIN32
// Only used by D3D backend.
const RECT *AsRECT() const
{
// The types are binary compatible so this works.
return (const RECT *)this;
}
RECT *AsRECT()
{
// The types are binary compatible so this works.
return (RECT *)this;
}
#endif
};
#ifdef _WIN32
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, __VA_ARGS__)
#else
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, ##__VA_ARGS__)
#endif
// warning: mapping buffer should be disabled to use this
// #define LOG_VTX() DEBUG_LOG(VIDEO, "vtx: %f %f %f, ", ((float*)g_vertex_manager_write_ptr)[-3], ((float*)g_vertex_manager_write_ptr)[-2], ((float*)g_vertex_manager_write_ptr)[-1]);
#define LOG_VTX()
typedef enum
{
API_OPENGL = 1,
API_D3D = 2,
API_NONE = 3
} API_TYPE;
inline u32 RGBA8ToRGBA6ToRGBA8(u32 src)
{
u32 color = src;
color &= 0xFCFCFCFC;
color |= (color >> 6) & 0x03030303;
return color;
}
inline u32 RGBA8ToRGB565ToRGBA8(u32 src)
{
u32 color = (src & 0xF8FCF8);
color |= (color >> 5) & 0x070007;
color |= (color >> 6) & 0x000300;
color |= 0xFF000000;
return color;
}
inline u32 Z24ToZ16ToZ24(u32 src)
{
return (src & 0xFFFF00) | (src >> 16);
}
/* Returns the smallest power of 2 which is greater than or equal to num */
inline u32 MakePow2(u32 num)
{
--num;
num |= num >> 1;
num |= num >> 2;
num |= num >> 4;
num |= num >> 8;
num |= num >> 16;
++num;
return num;
}
// returns the exponent of the smallest power of two which is greater than val
inline unsigned int GetPow2(unsigned int val)
{
unsigned int ret = 0;
for (; val; val >>= 1)
++ret;
return ret;
}
|
/***************************************************************************
tag: The SourceWorks Tue Sep 7 00:55:18 CEST 2010 OperationInterfaceI.h
OperationInterfaceI.h - description
-------------------
begin : Tue September 07 2010
copyright : (C) 2010 The SourceWorks
email : peter@thesourceworks.com
***************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public *
* License as published by the Free Software Foundation; *
* version 2 of the License. *
* *
* As a special exception, you may use this file as part of a free *
* software library without restriction. Specifically, if other files *
* instantiate templates or use macros or inline functions from this *
* file, or you compile this file and link it with other files to *
* produce an executable, this file does not by itself cause the *
* resulting executable to be covered by the GNU General Public *
* License. This exception does not however invalidate any other *
* reasons why the executable file might be covered by the GNU General *
* Public License. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307 USA *
* *
***************************************************************************/
// -*- C++ -*-
//
// $Id$
// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****
// TAO and the TAO IDL Compiler have been developed by:
// Center for Distributed Object Computing
// Washington University
// St. Louis, MO
// USA
// http://www.cs.wustl.edu/~schmidt/doc-center.html
// and
// Distributed Object Computing Laboratory
// University of California at Irvine
// Irvine, CA
// USA
// http://doc.ece.uci.edu/
// and
// Institute for Software Integrated Systems
// Vanderbilt University
// Nashville, TN
// USA
// http://www.isis.vanderbilt.edu/
//
// Information about TAO is available at:
// http://www.cs.wustl.edu/~schmidt/TAO.html
// TAO_IDL - Generated from
// ../../../ACE_wrappers/TAO/TAO_IDL/be/be_codegen.cpp:1133
#ifndef ORO_CORBA_OPERATIONREPOSITORYI_H_
#define ORO_CORBA_OPERATIONREPOSITORYI_H_
#include "corba.h"
#ifdef CORBA_IS_TAO
#include "OperationInterfaceS.h"
#else
#include "OperationInterfaceC.h"
#endif
#include "../../OperationInterface.hpp"
#include "../../internal/SendHandleC.hpp"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
class RTT_corba_CSendHandle_i
: public virtual POA_RTT::corba::CSendHandle,
public virtual PortableServer::RefCountServantBase
{
RTT::internal::SendHandleC mhandle, morig;
RTT::OperationInterfacePart* mofp;
std::vector<RTT::base::DataSourceBase::shared_ptr> cargs;
public:
// Constructor
RTT_corba_CSendHandle_i (RTT::internal::SendHandleC const& sh, RTT::OperationInterfacePart* ofp);
// Destructor
virtual ~RTT_corba_CSendHandle_i (void);
virtual
::RTT::corba::CSendStatus collect (
::RTT::corba::CAnyArguments_out args);
virtual
::RTT::corba::CSendStatus collectIfDone (
::RTT::corba::CAnyArguments_out args);
virtual
::RTT::corba::CSendStatus checkStatus (
void);
virtual
::CORBA::Any * ret (
void);
virtual
void checkArguments (
const ::RTT::corba::CAnyArguments & args);
virtual
void dispose ();
};
class RTT_corba_COperationInterface_i
: public virtual POA_RTT::corba::COperationInterface
{
RTT::OperationInterface* mfact;
PortableServer::POA_var mpoa;
public:
//Constructor
RTT_corba_COperationInterface_i(RTT::OperationInterface* mfact, PortableServer::POA_ptr the_poa);
PortableServer::POA_ptr _default_POA();
// Destructor
virtual ~RTT_corba_COperationInterface_i (void);
virtual
RTT::corba::COperationInterface::COperationList * getOperations (
void);
virtual
::RTT::corba::CDescriptions * getArguments (
const char * operation);
virtual
char * getResultType (
const char * operation);
virtual
char* getArgumentType(
const char*,
CORBA::UShort);
virtual
char* getCollectType(
const char*,
CORBA::UShort);
virtual ::CORBA::UShort getArity (
const char * operation);
virtual ::CORBA::UShort getCollectArity (
const char * operation);
virtual
char * getDescription (
const char * operation);
virtual
void checkOperation (
const char * operation,
const ::RTT::corba::CAnyArguments & args);
virtual
::CORBA::Any * callOperation (
const char * operation,
::RTT::corba::CAnyArguments & args);
virtual
::RTT::corba::CSendHandle_ptr sendOperation (
const char * operation,
const ::RTT::corba::CAnyArguments & args);
};
#endif /* OPERATIONREPOSITORYI_H_ */
|
/*
* This file Copyright (C) Mnemosyne LLC
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* $Id: session-dialog.h 11092 2010-08-01 20:36:13Z charles $
*/
#ifndef SESSION_DIALOG_H
#define SESSION_DIALOG_H
#include <QDialog>
#include <QWidgetList>
class Prefs;
class Session;
class QCheckBox;
class QLineEdit;
class QRadioButton;
class QSpinBox;
class SessionDialog: public QDialog
{
Q_OBJECT
public:
SessionDialog( Session& session, Prefs& prefs, QWidget * parent = 0 );
~SessionDialog( ) { }
private slots:
void onAccepted( );
void resensitize( );
private:
QCheckBox * myAuthCheckBox;
QRadioButton * myRemoteRadioButton;
QLineEdit * myHostLineEdit;
QSpinBox * myPortSpinBox;
QLineEdit * myUsernameLineEdit;
QLineEdit * myPasswordLineEdit;
QCheckBox * myAutomaticCheckBox;
private:
Session& mySession;
Prefs& myPrefs;
QWidgetList myRemoteWidgets;
QWidgetList myAuthWidgets;
};
#endif
|
#ifndef _INTELFB_H
#define _INTELFB_H
/* $DHD: intelfb/intelfb.h,v 1.40 2003/06/27 15:06:25 dawes Exp $ */
#include <linux/agp_backend.h>
#include <linux/fb.h>
/*** Version/name ***/
#define INTELFB_VERSION "0.9.4"
#define INTELFB_MODULE_NAME "intelfb"
#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM"
/*** Debug/feature defines ***/
#ifndef DEBUG
#define DEBUG 0
#endif
#ifndef VERBOSE
#define VERBOSE 0
#endif
#ifndef REGDUMP
#define REGDUMP 0
#endif
#ifndef DETECT_VGA_CLASS_ONLY
#define DETECT_VGA_CLASS_ONLY 1
#endif
#ifndef ALLOCATE_FOR_PANNING
#define ALLOCATE_FOR_PANNING 1
#endif
#ifndef PREFERRED_MODE
#define PREFERRED_MODE "1024x768-32@70"
#endif
/*** hw-related values ***/
/* Resource Allocation */
#define INTELFB_FB_ACQUIRED 1
#define INTELFB_MMIO_ACQUIRED 2
/* PCI ids for supported devices */
#define PCI_DEVICE_ID_INTEL_830M 0x3577
#define PCI_DEVICE_ID_INTEL_845G 0x2562
#define PCI_DEVICE_ID_INTEL_85XGM 0x3582
#define PCI_DEVICE_ID_INTEL_865G 0x2572
#define PCI_DEVICE_ID_INTEL_915G 0x2582
#define PCI_DEVICE_ID_INTEL_915GM 0x2592
#define PCI_DEVICE_ID_INTEL_945G 0x2772
#define PCI_DEVICE_ID_INTEL_945GM 0x27A2
/* Size of MMIO region */
#define INTEL_REG_SIZE 0x80000
#define STRIDE_ALIGNMENT 16
#define STRIDE_ALIGNMENT_I9XX 64
#define PALETTE_8_ENTRIES 256
/*** Macros ***/
/* basic arithmetic */
#define KB(x) ((x) * 1024)
#define MB(x) ((x) * 1024 * 1024)
#define BtoKB(x) ((x) / 1024)
#define BtoMB(x) ((x) / 1024 / 1024)
#define GTT_PAGE_SIZE KB(4)
#define ROUND_UP_TO(x, y) (((x) + (y) - 1) / (y) * (y))
#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y))
#define ROUND_UP_TO_PAGE(x) ROUND_UP_TO((x), GTT_PAGE_SIZE)
#define ROUND_DOWN_TO_PAGE(x) ROUND_DOWN_TO((x), GTT_PAGE_SIZE)
/* messages */
#define PFX INTELFB_MODULE_NAME ": "
#define ERR_MSG(fmt, args...) printk(KERN_ERR PFX fmt, ## args)
#define WRN_MSG(fmt, args...) printk(KERN_WARNING PFX fmt, ## args)
#define NOT_MSG(fmt, args...) printk(KERN_NOTICE PFX fmt, ## args)
#define INF_MSG(fmt, args...) printk(KERN_INFO PFX fmt, ## args)
#if DEBUG
#define DBG_MSG(fmt, args...) printk(KERN_DEBUG PFX fmt, ## args)
#else
#define DBG_MSG(fmt, args...) while (0) printk(fmt, ## args)
#endif
/* get commonly used pointers */
#define GET_DINFO(info) (info)->par
/* misc macros */
#define ACCEL(d, i) \
((d)->accel && !(d)->ring_lockup && \
((i)->var.accel_flags & FB_ACCELF_TEXT))
/*#define NOACCEL_CHIPSET(d) \
((d)->chipset != INTEL_865G)*/
#define NOACCEL_CHIPSET(d) \
(0)
#define FIXED_MODE(d) ((d)->fixed_mode)
/*** Driver paramters ***/
#define RINGBUFFER_SIZE KB(64)
#define HW_CURSOR_SIZE KB(4)
/* Intel agpgart driver */
#define AGP_PHYSICAL_MEMORY 2
/*** Data Types ***/
/* supported chipsets */
enum intel_chips {
INTEL_830M,
INTEL_845G,
INTEL_85XGM,
INTEL_852GM,
INTEL_852GME,
INTEL_855GM,
INTEL_855GME,
INTEL_865G,
INTEL_915G,
INTEL_915GM,
INTEL_945G,
INTEL_945GM,
};
struct intelfb_hwstate {
u32 vga0_divisor;
u32 vga1_divisor;
u32 vga_pd;
u32 dpll_a;
u32 dpll_b;
u32 fpa0;
u32 fpa1;
u32 fpb0;
u32 fpb1;
u32 palette_a[PALETTE_8_ENTRIES];
u32 palette_b[PALETTE_8_ENTRIES];
u32 htotal_a;
u32 hblank_a;
u32 hsync_a;
u32 vtotal_a;
u32 vblank_a;
u32 vsync_a;
u32 src_size_a;
u32 bclrpat_a;
u32 htotal_b;
u32 hblank_b;
u32 hsync_b;
u32 vtotal_b;
u32 vblank_b;
u32 vsync_b;
u32 src_size_b;
u32 bclrpat_b;
u32 adpa;
u32 dvoa;
u32 dvob;
u32 dvoc;
u32 dvoa_srcdim;
u32 dvob_srcdim;
u32 dvoc_srcdim;
u32 lvds;
u32 pipe_a_conf;
u32 pipe_b_conf;
u32 disp_arb;
u32 cursor_a_control;
u32 cursor_b_control;
u32 cursor_a_base;
u32 cursor_b_base;
u32 cursor_size;
u32 disp_a_ctrl;
u32 disp_b_ctrl;
u32 disp_a_base;
u32 disp_b_base;
u32 cursor_a_palette[4];
u32 cursor_b_palette[4];
u32 disp_a_stride;
u32 disp_b_stride;
u32 vgacntrl;
u32 add_id;
u32 swf0x[7];
u32 swf1x[7];
u32 swf3x[3];
u32 fence[8];
u32 instpm;
u32 mem_mode;
u32 fw_blc_0;
u32 fw_blc_1;
};
struct intelfb_heap_data {
u32 physical;
u8 __iomem *virtual;
u32 offset; // in GATT pages
u32 size; // in bytes
};
struct intelfb_info {
struct fb_info *info;
struct fb_ops *fbops;
struct pci_dev *pdev;
struct intelfb_hwstate save_state;
/* agpgart structs */
struct agp_memory *gtt_fb_mem; // use all stolen memory or vram
struct agp_memory *gtt_ring_mem; // ring buffer
struct agp_memory *gtt_cursor_mem; // hw cursor
/* use a gart reserved fb mem */
u8 fbmem_gart;
/* mtrr support */
u32 mtrr_reg;
u32 has_mtrr;
/* heap data */
struct intelfb_heap_data aperture;
struct intelfb_heap_data fb;
struct intelfb_heap_data ring;
struct intelfb_heap_data cursor;
/* mmio regs */
u32 mmio_base_phys;
u8 __iomem *mmio_base;
/* fb start offset (in bytes) */
u32 fb_start;
/* ring buffer */
u32 ring_head;
u32 ring_tail;
u32 ring_tail_mask;
u32 ring_space;
u32 ring_lockup;
/* palette */
u32 pseudo_palette[17];
/* chip info */
int pci_chipset;
int chipset;
const char *name;
int mobile;
/* current mode */
int bpp, depth;
u32 visual;
int xres, yres, pitch;
int pixclock;
/* current pipe */
int pipe;
/* some flags */
int accel;
int hwcursor;
int fixed_mode;
int ring_active;
int flag;
/* hw cursor */
int cursor_on;
int cursor_blanked;
u8 cursor_src[64];
/* initial parameters */
int initial_vga;
struct fb_var_screeninfo initial_var;
u32 initial_fb_base;
u32 initial_video_ram;
u32 initial_pitch;
/* driver registered */
int registered;
/* index into plls */
int pll_index;
};
#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G)||(dinfo->chipset == INTEL_915GM)||((dinfo)->chipset == INTEL_945G)||(dinfo->chipset==INTEL_945GM))
/*** function prototypes ***/
extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);
#endif /* _INTELFB_H */
|
/* Test consistence of results of stat and stat64.
Copyright (C) 2000-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>
int
main (int argc, char *argv[])
{
int i;
int result = 0;
for (i = 1; i < argc; ++i)
{
struct stat st;
struct stat64 st64;
int same;
if (stat (argv[i], &st) != 0)
{
if (errno != EOVERFLOW)
{
/* Something is wrong. */
printf ("stat(\"%s\",....) failed: %m", argv[i]);
result = 1;
}
continue;
}
if (stat64 (argv[i], &st64) != 0)
{
if (errno != ENOSYS)
{
/* Something is wrong. */
printf ("stat64(\"%s\",....) failed: %m", argv[i]);
result = 1;
}
continue;
}
printf ("\nName: %s\n", argv[i]);
#define TEST(name) \
same = st.name == st64.name; \
printf (#name ": %jd vs %jd %s\n", \
(intmax_t) st.name, (intmax_t) st64.name, \
same ? "OK" : "FAIL"); \
result |= ! same
TEST (st_dev);
TEST (st_ino);
TEST (st_mode);
TEST (st_nlink);
TEST (st_uid);
TEST (st_gid);
#ifdef _STATBUF_ST_RDEV
TEST (st_rdev);
#endif
#ifdef _STATBUF_ST_BLKSIZE
TEST (st_blksize);
#endif
TEST (st_blocks);
TEST (st_atime);
TEST (st_mtime);
TEST (st_ctime);
}
return result;
}
|
/*
* Compressed RAM block device
*
* Copyright (C) 2008, 2009, 2010 Nitin Gupta
*
* This code is released using a dual license strategy: BSD/GPL
* You can choose the licence that better fits your requirements.
*
* Released under the terms of 3-clause BSD License
* Released under the terms of GNU General Public License Version 2.0
*
* Project home: http://compcache.googlecode.com
*/
#ifndef _ZRAM_DRV_H_
#define _ZRAM_DRV_H_
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include "sub-projects/allocators/xvmalloc-kmod/xvmalloc.h"
/*
* Some arbitrary value. This is just to catch
* invalid value for num_devices module parameter.
*/
static const unsigned max_num_devices = 32;
/*
* Stored at beginning of each compressed object.
*
* It stores back-reference to table entry which points to this
* object. This is required to support memory defragmentation.
*/
struct zobj_header {
#if 0
u32 table_idx;
#endif
};
/*-- Configurable parameters */
/* Default zram disk size: 25% of total RAM */
static const unsigned default_disksize_perc_ram = 25;
/*
* Pages that compress to size greater than this are stored
* uncompressed in memory.
*/
static const unsigned max_zpage_size = PAGE_SIZE / 4 * 3;
/*
* NOTE: max_zpage_size must be less than or equal to:
* XV_MAX_ALLOC_SIZE - sizeof(struct zobj_header)
* otherwise, xv_malloc() would always return failure.
*/
/*-- End of configurable params */
#define SECTOR_SHIFT 9
#define SECTOR_SIZE (1 << SECTOR_SHIFT)
#define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
#define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT)
/* Flags for zram pages (table[page_no].flags) */
enum zram_pageflags {
/* Page is stored uncompressed */
ZRAM_UNCOMPRESSED,
/* Page consists entirely of zeros */
ZRAM_ZERO,
__NR_ZRAM_PAGEFLAGS,
};
/*-- Data structures */
/* Allocated for each disk page */
struct table {
struct page *page;
u16 offset;
u8 count; /* object ref count (not yet used) */
u8 flags;
} __attribute__((aligned(4)));
struct zram_stats {
u64 compr_size; /* compressed size of pages stored */
u64 num_reads; /* failed + successful */
u64 num_writes; /* --do-- */
u64 failed_reads; /* should NEVER! happen */
u64 failed_writes; /* can happen when memory is too low */
u64 invalid_io; /* non-page-aligned I/O requests */
u64 notify_free; /* no. of swap slot free notifications */
u64 discard; /* no. of block discard callbacks */
u32 pages_zero; /* no. of zero filled pages */
u32 pages_stored; /* no. of pages currently stored */
u32 good_compress; /* % of pages with compression ratio<=50% */
u32 pages_expand; /* % of incompressible pages */
};
struct zram {
struct xv_pool *mem_pool;
void *compress_workmem;
void *compress_buffer;
struct table *table;
spinlock_t stat64_lock; /* protect 64-bit stats */
struct mutex lock; /* protect compression buffers against
* concurrent writes */
struct request_queue *queue;
struct gendisk *disk;
int init_done;
/* Prevent concurrent execution of device init and reset */
struct mutex init_lock;
/*
* This is the limit on amount of *uncompressed* worth of data
* we can store in a disk.
*/
u64 disksize; /* bytes */
struct zram_stats stats;
};
extern struct zram *devices;
extern unsigned int num_devices;
#ifdef CONFIG_SYSFS
extern struct attribute_group zram_disk_attr_group;
#endif
extern int zram_init_device(struct zram *zram);
extern void zram_reset_device(struct zram *zram);
#endif
|
/*
Unix SMB/CIFS implementation.
Samba utility functions
Copyright (C) Andrew Tridgell 1992-2001
Copyright (C) Simo Sorce 2001
Copyright (C) Jeremy Allison 2005
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
/* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */
#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((const unsigned char *)(src))[0],\
((unsigned char *)(dest))[1] = ((const unsigned char *)(src))[1], (dest))
/* return an ascii version of a ucs2 character */
#define UCS2_TO_CHAR(c) (((c) >> UCS2_SHIFT) & 0xff)
static int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
/*******************************************************************
Count the number of two-byte pairs in a UTF16 string.
********************************************************************/
size_t strlen_w(const smb_ucs2_t *src)
{
size_t len;
smb_ucs2_t c;
for(len = 0; *(COPY_UCS2_CHAR(&c,src)); src++, len++) {
;
}
return len;
}
/*******************************************************************
Count up to max number of characters in a smb_ucs2_t string.
********************************************************************/
size_t strnlen_w(const smb_ucs2_t *src, size_t max)
{
size_t len;
smb_ucs2_t c;
for(len = 0; (len < max) && *(COPY_UCS2_CHAR(&c,src)); src++, len++) {
;
}
return len;
}
/*******************************************************************
Wide strchr().
********************************************************************/
smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c)
{
smb_ucs2_t cp;
while (*(COPY_UCS2_CHAR(&cp,s))) {
if (c == cp) {
return discard_const_p(smb_ucs2_t, s);
}
s++;
}
if (c == cp) {
return discard_const_p(smb_ucs2_t, s);
}
return NULL;
}
smb_ucs2_t *strchr_wa(const smb_ucs2_t *s, char c)
{
return strchr_w(s, UCS2_CHAR(c));
}
/*******************************************************************
Wide strrchr().
********************************************************************/
smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c)
{
smb_ucs2_t cp;
const smb_ucs2_t *p = s;
int len = strlen_w(s);
if (len == 0) {
return NULL;
}
p += (len - 1);
do {
if (c == *(COPY_UCS2_CHAR(&cp,p))) {
return discard_const_p(smb_ucs2_t, p);
}
} while (p-- != s);
return NULL;
}
/*******************************************************************
Wide version of strrchr that returns after doing strrchr 'n' times.
********************************************************************/
smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n)
{
smb_ucs2_t cp;
const smb_ucs2_t *p = s;
int len = strlen_w(s);
if (len == 0 || !n) {
return NULL;
}
p += (len - 1);
do {
if (c == *(COPY_UCS2_CHAR(&cp,p))) {
n--;
}
if (!n) {
return discard_const_p(smb_ucs2_t, p);
}
} while (p-- != s);
return NULL;
}
/*******************************************************************
Wide strstr().
********************************************************************/
smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins)
{
const smb_ucs2_t *r;
size_t inslen;
if (!s || !*s || !ins || !*ins) {
return NULL;
}
inslen = strlen_w(ins);
r = s;
while ((r = strchr_w(r, *ins))) {
if (strncmp_w(r, ins, inslen) == 0) {
return discard_const_p(smb_ucs2_t, r);
}
r++;
}
return NULL;
}
/*******************************************************************
Convert a string to lower case.
return True if any char is converted
This is unsafe for any string involving a UTF16 character
********************************************************************/
bool strlower_w(smb_ucs2_t *s)
{
smb_ucs2_t cp;
bool ret = false;
while (*(COPY_UCS2_CHAR(&cp,s))) {
smb_ucs2_t v = tolower_m(cp);
if (v != cp) {
COPY_UCS2_CHAR(s,&v);
ret = true;
}
s++;
}
return ret;
}
/*******************************************************************
Convert a string to upper case.
return True if any char is converted
This is unsafe for any string involving a UTF16 character
********************************************************************/
bool strupper_w(smb_ucs2_t *s)
{
smb_ucs2_t cp;
bool ret = false;
while (*(COPY_UCS2_CHAR(&cp,s))) {
smb_ucs2_t v = toupper_m(cp);
if (v != cp) {
COPY_UCS2_CHAR(s,&v);
ret = true;
}
s++;
}
return ret;
}
static int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len)
{
smb_ucs2_t cpa, cpb;
size_t n = 0;
while ((n < len) && (*(COPY_UCS2_CHAR(&cpb,b))) && (*(COPY_UCS2_CHAR(&cpa,a)) == cpb)) {
a++;
b++;
n++;
}
return (len - n)?(*(COPY_UCS2_CHAR(&cpa,a)) - *(COPY_UCS2_CHAR(&cpb,b))):0;
}
/*
The *_wa() functions take a combination of 7 bit ascii
and wide characters They are used so that you can use string
functions combining C string constants with ucs2 strings
The char* arguments must NOT be multibyte - to be completely sure
of this only pass string constants */
int strcmp_wa(const smb_ucs2_t *a, const char *b)
{
smb_ucs2_t cp = 0;
while (*b && *(COPY_UCS2_CHAR(&cp,a)) == UCS2_CHAR(*b)) {
a++;
b++;
}
return (*(COPY_UCS2_CHAR(&cp,a)) - UCS2_CHAR(*b));
}
smb_ucs2_t toupper_w(smb_ucs2_t v)
{
smb_ucs2_t ret;
/* LE to native. */
codepoint_t cp = SVAL(&v,0);
cp = toupper_m(cp);
/* native to LE. */
SSVAL(&ret,0,cp);
return ret;
}
|
/**
******************************************************************************
* @file system_stm32l4xx.h
* @author MCD Application Team
* @version V1.3.1
* @date 21-April-2017
* @brief CMSIS Cortex-M4 Device System Source File for STM32L4xx devices.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/** @addtogroup CMSIS
* @{
*/
/** @addtogroup stm32l4xx_system
* @{
*/
/**
* @brief Define to prevent recursive inclusion
*/
#ifndef __SYSTEM_STM32L4XX_H
#define __SYSTEM_STM32L4XX_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup STM32L4xx_System_Includes
* @{
*/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Exported_Variables
* @{
*/
/* The SystemCoreClock variable is updated in three ways:
1) by calling CMSIS function SystemCoreClockUpdate()
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
Note: If you use this function to configure the system clock; then there
is no need to call the 2 first functions listed above, since SystemCoreClock
variable is updated automatically.
*/
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */
extern const uint32_t MSIRangeTable[12]; /*!< MSI ranges table values */
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Exported_Constants
* @{
*/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Exported_Macros
* @{
*/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Exported_Functions
* @{
*/
extern void SystemInit(void);
extern void SystemCoreClockUpdate(void);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /*__SYSTEM_STM32L4XX_H */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef editline_editline_h
#define editline_editline_h
/*
* Copyright 1992,1993 Simmule Turner and Rich Salz. All rights reserved.
*
* This software is not subject to any license of the American Telephone
* and Telegraph Company or of the Regents of the University of California.
*
* Permission is granted to anyone to use this software for any purpose on
* any computer system, and to alter it and redistribute it freely, subject
* to the following restrictions:
* 1. The authors are not responsible for the consequences of use of this
* software, no matter how awful, even if they arise from flaws in it.
* 2. The origin of this software must not be misrepresented, either by
* explicit claim or by omission. Since few users ever read sources,
* credits must appear in the documentation.
* 3. Altered versions must be plainly marked as such, and must not be
* misrepresented as being the original software. Since few users
* ever read sources, credits must appear in the documentation.
* 4. This notice may not be removed or altered.
*/
/*
** Internal header file for editline library.
*/
#include <stdio.h>
#if defined(HAVE_STDLIB)
#include <stdlib.h>
#include <string.h>
#endif /* defined(HAVE_STDLIB) */
#if defined(SYS_UNIX)
#include "unix.h"
#endif /* defined(SYS_UNIX) */
#if defined(SYS_OS9)
#include "os9.h"
#endif /* defined(SYS_OS9) */
#if !defined(SIZE_T)
#define SIZE_T unsigned int
#endif /* !defined(SIZE_T) */
typedef unsigned char CHAR;
#if defined(HIDE)
#define STATIC static
#else
#define STATIC /* NULL */
#endif /* !defined(HIDE) */
#define CONST const
#define MEM_INC 64
#define SCREEN_INC 256
#define DISPOSE(p) free((char*)(p))
#define NEW(T, c) \
((T*)malloc((unsigned int)(sizeof (T) * (c))))
#define RENEW(p, T, c) \
(p = (T*)realloc((char*)(p), (unsigned int)(sizeof (T) * (c))))
#define COPYFROMTO(new, p, len) \
(void)memcpy((char*)(new), (char*)(p), (int)(len))
/*
** Variables and routines internal to this package.
*/
extern unsigned rl_eof;
extern unsigned rl_erase;
extern unsigned rl_intr;
extern unsigned rl_kill;
extern unsigned rl_quit;
extern char *rl_complete();
extern int rl_list_possib();
extern void rl_ttyset(int);
extern void rl_add_slash();
#if !defined(HAVE_STDLIB)
extern char *getenv();
extern char *malloc();
extern char *realloc();
extern char *memcpy();
extern char *strcat();
extern char *strchr();
extern char *strrchr();
extern char *strcpy();
extern char *strdup();
extern int strcmp();
extern int strlen();
extern int strncmp();
#endif /* !defined(HAVE_STDLIB) */
#endif /* editline_editline_h */
|
/*************************************************************************
* *
* Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. *
* All rights reserved. Email: russ@q12.org Web: www.q12.org *
* *
* Threading implementation private header file. *
* Copyright (C) 2011-2012 Oleh Derevenko. All rights reserved. *
* e-mail: odar@eleks.com (change all "a" to "e") *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* *
*************************************************************************/
/*
* Threading implementation header for library private functions.
*/
#ifndef _ODE__PRIVATE_THREADING_IMPL_H_
#define _ODE__PRIVATE_THREADING_IMPL_H_
#include <ode/threading.h>
// This function has been removed from public headers as there is no need for it
// to be accessible to outer code at this time. In future it is possible
// it could be published back again.
/**
* @brief Allocates built-in self-threaded threading implementation object.
*
* A self-threaded implementation is a type of implementation that performs
* processing of posted calls by means of caller thread itself. This type of
* implementation does not need thread pool to serve it.
*
* The processing is arranged in a way to prevent call stack depth growth
* as more and more nested calls are posted.
*
* @returns ID of object allocated or NULL on failure
*
* @ingroup threading
* @see dThreadingAllocateMultiThreadedImplementation
* @see dThreadingFreeImplementation
*/
/*ODE_API */dThreadingImplementationID dThreadingAllocateSelfThreadedImplementation();
#endif // #ifndef _ODE__PRIVATE_THREADING_IMPL_H_
|
// This is core/vnl/vnl_double_1x3.h
#ifndef vnl_double_1x3_h_
#define vnl_double_1x3_h_
//:
// \file
// \brief 1x3 matrix of double
//
// vnl_double_1x3 is a vnl_matrix<double> of fixed size 1x3.
// It is merely a typedef for vnl_matrix_fixed<double,1,3>
//
// \author Peter Vanroose
// \date 1 April 2003
//
//-----------------------------------------------------------------------------
#include "vnl_matrix_fixed.h"
typedef vnl_matrix_fixed<double,1,3> vnl_double_1x3;
#endif // vnl_double_1x3_h_
|
/*-------------------------------------------------------------------------
*
* Stack.h
*
* Implements a Stack of objects using lists
*-------------------------------------------------------------------------
*/
#ifndef Stack_H_
#define Stack_H_
#include "c.h"
#include "postgres_ext.h"
#include "nodes/pg_list.h"
typedef struct Stack
{
List *containerList;
} Stack;
extern void Init(Stack *st);
extern void Push(Stack *st, void *element);
extern bool IsEmpty(Stack *st);
extern void *Peek(Stack *st);
extern void *Pop(Stack *st);
#endif /* Stack_H_ */
|
/*-------------------------------------------------------------------------
*
* predtest.h
* prototypes for predtest.c
*
*
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/predtest.h
*
*-------------------------------------------------------------------------
*/
#ifndef PREDTEST_H
#define PREDTEST_H
#include "nodes/primnodes.h"
extern bool predicate_implied_by(List *predicate_list,
List *restrictinfo_list);
extern bool predicate_refuted_by(List *predicate_list,
List *restrictinfo_list);
#endif /* PREDTEST_H */
|
/*
* This file is a part of the open source stm32plus library.
* Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk>
* Please see website for licensing terms.
*/
#pragma once
// ensure the MCU series is correct
#ifndef STM32PLUS_F4
#error This class can only be used with the STM32F4 series
#endif
namespace stm32plus {
/**
* Feature collection for this DMA channel. Parameterise this class with the features
* that you want to use on this channel.
*/
template<class... Features>
class Dma1Channel4Stream7 : public Dma,
public Features... {
public:
/**
* Constructor
*/
Dma1Channel4Stream7()
: Dma(DMA1_Stream7,DMA_Channel_4,DMA_FLAG_TCIF7,DMA_FLAG_HTIF7,DMA_FLAG_TEIF7),
Features(static_cast<Dma&>(*this))... {
ClockControl<PERIPHERAL_DMA1>::On();
}
};
/**
* Types for the peripherals mapped to this channel
*/
template<class... Features> using Uart5TxDmaChannel=Dma1Channel4Stream7<Features...>;
}
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_COCOA_APPLESCRIPT_TAB_APPLESCRIPT_H_
#define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_TAB_APPLESCRIPT_H_
#import <Cocoa/Cocoa.h>
#import "chrome/browser/ui/cocoa/applescript/element_applescript.h"
namespace content {
class WebContents;
}
class Profile;
// Represents a tab scriptable item in applescript.
@interface TabAppleScript : ElementAppleScript {
@private
content::WebContents* _webContents; // weak.
Profile* _profile; // weak.
// Contains the temporary URL when a user creates a new folder/item with
// url specified like
// |make new tab with properties {url:"http://google.com"}|.
NSString* _tempURL;
}
// Doesn't actually create the tab here but just assigns the ID, tab is created
// when it calls insertInTabs: of a particular window, it is used in cases
// where user assigns a tab to a variable like |set var to make new tab|.
- (instancetype)init;
// Does not create a new tab but uses an existing one.
- (instancetype)initWithWebContents:(content::WebContents*)webContents;
// Assigns a tab, sets its unique ID and also copies temporary values.
- (void)setWebContents:(content::WebContents*)webContents;
// Return the URL currently visible to the user in the location bar.
- (NSString*)URL;
// Sets the URL, returns an error if it is invalid.
- (void)setURL:(NSString*)aURL;
// The title of the tab.
- (NSString*)title;
// Is the tab loading any resource?
- (NSNumber*)loading;
// Standard user commands.
- (void)handlesUndoScriptCommand:(NSScriptCommand*)command;
- (void)handlesRedoScriptCommand:(NSScriptCommand*)command;
// Edit operations on the page.
- (void)handlesCutScriptCommand:(NSScriptCommand*)command;
- (void)handlesCopyScriptCommand:(NSScriptCommand*)command;
- (void)handlesPasteScriptCommand:(NSScriptCommand*)command;
// Selects all contents on the page.
- (void)handlesSelectAllScriptCommand:(NSScriptCommand*)command;
// Navigation operations.
- (void)handlesGoBackScriptCommand:(NSScriptCommand*)command;
- (void)handlesGoForwardScriptCommand:(NSScriptCommand*)command;
- (void)handlesReloadScriptCommand:(NSScriptCommand*)command;
- (void)handlesStopScriptCommand:(NSScriptCommand*)command;
// Used to print a tab.
- (void)handlesPrintScriptCommand:(NSScriptCommand*)command;
// Used to save a tab, if no file is specified, prompts the user to enter it.
- (void)handlesSaveScriptCommand:(NSScriptCommand*)command;
// Used to close a tab.
- (void)handlesCloseScriptCommand:(NSScriptCommand*)command;
// Displays the HTML of the tab in a new tab.
- (void)handlesViewSourceScriptCommand:(NSScriptCommand*)command;
// Executes a piece of javascript in the tab.
- (id)handlesExecuteJavascriptScriptCommand:(NSScriptCommand*)command;
@end
#endif // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_TAB_APPLESCRIPT_H_
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_POLICY_LINUX_BPF_IME_POLICY_LINUX_H_
#define SANDBOX_POLICY_LINUX_BPF_IME_POLICY_LINUX_H_
#include "sandbox/linux/bpf_dsl/bpf_dsl.h"
#include "sandbox/policy/export.h"
#include "sandbox/policy/linux/bpf_base_policy_linux.h"
namespace sandbox {
namespace policy {
class SANDBOX_POLICY_EXPORT ImeProcessPolicy : public BPFBasePolicy {
public:
ImeProcessPolicy();
ImeProcessPolicy(const ImeProcessPolicy&) = delete;
ImeProcessPolicy& operator=(const ImeProcessPolicy&) = delete;
~ImeProcessPolicy() override;
bpf_dsl::ResultExpr EvaluateSyscall(int sysno) const override;
};
} // namespace policy
} // namespace sandbox
#endif // SANDBOX_POLICY_LINUX_BPF_IME_POLICY_LINUX_H_
|
/* Copyright (C) 2005 - 2008 Jeff Dike <jdike@{linux.intel,addtoit}.com> */
/* Much of this ripped from drivers/char/hw_random.c, see there for other
* copyright.
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*/
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/miscdevice.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <irq_kern.h>
#include <os.h>
/*
* core module and version information
*/
#define RNG_VERSION "1.0.0"
#define RNG_MODULE_NAME "hw_random"
#define RNG_MISCDEV_MINOR 183 /* official */
/* Changed at init time, in the non-modular case, and at module load
* time, in the module case. Presumably, the module subsystem
* protects against a module being loaded twice at the same time.
*/
static int random_fd = -1;
static DECLARE_WAIT_QUEUE_HEAD(host_read_wait);
static int rng_dev_open (struct inode *inode, struct file *filp)
{
/* enforce read-only access to this chrdev */
if ((filp->f_mode & FMODE_READ) == 0)
return -EINVAL;
if ((filp->f_mode & FMODE_WRITE) != 0)
return -EINVAL;
return 0;
}
static atomic_t host_sleep_count = ATOMIC_INIT(0);
static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
loff_t *offp)
{
u32 data;
int n, ret = 0, have_data;
while (size) {
n = os_read_file(random_fd, &data, sizeof(data));
if (n > 0) {
have_data = n;
while (have_data && size) {
if (put_user((u8) data, buf++)) {
ret = ret ? : -EFAULT;
break;
}
size--;
ret++;
have_data--;
data >>= 8;
}
}
else if (n == -EAGAIN) {
DECLARE_WAITQUEUE(wait, current);
if (filp->f_flags & O_NONBLOCK)
return ret ? : -EAGAIN;
atomic_inc(&host_sleep_count);
reactivate_fd(random_fd, RANDOM_IRQ);
add_sigio_fd(random_fd);
add_wait_queue(&host_read_wait, &wait);
set_task_state(current, TASK_INTERRUPTIBLE);
schedule();
set_task_state(current, TASK_RUNNING);
remove_wait_queue(&host_read_wait, &wait);
if (atomic_dec_and_test(&host_sleep_count)) {
ignore_sigio_fd(random_fd);
deactivate_fd(random_fd, RANDOM_IRQ);
}
}
else
return n;
if (signal_pending (current))
return ret ? : -ERESTARTSYS;
}
return ret;
}
static const struct file_operations rng_chrdev_ops = {
.owner = THIS_MODULE,
.open = rng_dev_open,
.read = rng_dev_read,
.llseek = noop_llseek,
};
/* rng_init shouldn't be called more than once at boot time */
static struct miscdevice rng_miscdev = {
RNG_MISCDEV_MINOR,
RNG_MODULE_NAME,
&rng_chrdev_ops,
};
static irqreturn_t random_interrupt(int irq, void *data)
{
wake_up(&host_read_wait);
return IRQ_HANDLED;
}
/*
* rng_init - initialize RNG module
*/
static int __init rng_init (void)
{
int err;
err = os_open_file("/dev/random", of_read(OPENFLAGS()), 0);
if (err < 0)
goto out;
random_fd = err;
err = um_request_irq(RANDOM_IRQ, random_fd, IRQ_READ, random_interrupt,
0, "random", NULL);
if (err)
goto err_out_cleanup_hw;
sigio_broken(random_fd, 1);
err = misc_register (&rng_miscdev);
if (err) {
printk (KERN_ERR RNG_MODULE_NAME ": misc device register "
"failed\n");
goto err_out_cleanup_hw;
}
out:
return err;
err_out_cleanup_hw:
os_close_file(random_fd);
random_fd = -1;
goto out;
}
/*
* rng_cleanup - shutdown RNG module
*/
static void __exit rng_cleanup (void)
{
os_close_file(random_fd);
misc_deregister (&rng_miscdev);
}
module_init (rng_init);
module_exit (rng_cleanup);
MODULE_DESCRIPTION("UML Host Random Number Generator (RNG) driver");
MODULE_LICENSE("GPL");
|
/* BFD support for the Altera Nios II processor.
Copyright (C) 2012-2015 Free Software Foundation, Inc.
Contributed by Nigel Gray (ngray@altera.com).
Contributed by Mentor Graphics, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
static const bfd_arch_info_type *
nios2_compatible (const bfd_arch_info_type *a,
const bfd_arch_info_type *b)
{
if (a->arch != b->arch)
return NULL;
if (a->bits_per_word != b->bits_per_word)
return NULL;
if (a->mach == bfd_mach_nios2)
return a;
else if (b->mach == bfd_mach_nios2)
return b;
else if (a->mach != b->mach)
return NULL;
return a;
}
#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
{ \
BITS_WORD, /* bits in a word */ \
BITS_ADDR, /* bits in an address */ \
8, /* 8 bits in a byte */ \
bfd_arch_nios2, \
NUMBER, \
"nios2", \
PRINT, \
3, \
DEFAULT, \
nios2_compatible, \
bfd_default_scan, \
bfd_arch_default_fill, \
NEXT \
}
#define NIOS2R1_NEXT &arch_info_struct[0]
#define NIOS2R2_NEXT &arch_info_struct[1]
static const bfd_arch_info_type arch_info_struct[] =
{
N (32, 32, bfd_mach_nios2r1, "nios2:r1", FALSE, NIOS2R2_NEXT),
N (32, 32, bfd_mach_nios2r2, "nios2:r2", FALSE, NULL),
};
const bfd_arch_info_type bfd_nios2_arch =
N (32, 32, 0, "nios2", TRUE, NIOS2R1_NEXT);
|
/*************************************************************************/
/* self_list.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef SELF_LIST_H
#define SELF_LIST_H
#include "typedefs.h"
template <class T>
class SelfList {
public:
class List {
SelfList<T> *_first;
public:
void add(SelfList<T> *p_elem) {
ERR_FAIL_COND(p_elem->_root);
p_elem->_root = this;
p_elem->_next = _first;
p_elem->_prev = NULL;
if (_first)
_first->_prev = p_elem;
_first = p_elem;
}
void add_last(SelfList<T> *p_elem) {
ERR_FAIL_COND(p_elem->_root);
if (!_first) {
add(p_elem);
return;
}
SelfList<T> *e = _first;
while (e->next()) {
e = e->next();
}
e->_next = p_elem;
p_elem->_prev = e->_next;
p_elem->_root = this;
}
void remove(SelfList<T> *p_elem) {
ERR_FAIL_COND(p_elem->_root != this);
if (p_elem->_next) {
p_elem->_next->_prev = p_elem->_prev;
}
if (p_elem->_prev) {
p_elem->_prev->_next = p_elem->_next;
}
if (_first == p_elem) {
_first = p_elem->_next;
}
p_elem->_next = NULL;
p_elem->_prev = NULL;
p_elem->_root = NULL;
}
_FORCE_INLINE_ SelfList<T> *first() { return _first; }
_FORCE_INLINE_ const SelfList<T> *first() const { return _first; }
_FORCE_INLINE_ List() { _first = NULL; }
_FORCE_INLINE_ ~List() { ERR_FAIL_COND(_first != NULL); }
};
private:
List *_root;
T *_self;
SelfList<T> *_next;
SelfList<T> *_prev;
public:
_FORCE_INLINE_ bool in_list() const { return _root; }
_FORCE_INLINE_ SelfList<T> *next() { return _next; }
_FORCE_INLINE_ SelfList<T> *prev() { return _prev; }
_FORCE_INLINE_ const SelfList<T> *next() const { return _next; }
_FORCE_INLINE_ const SelfList<T> *prev() const { return _prev; }
_FORCE_INLINE_ T *self() const { return _self; }
_FORCE_INLINE_ SelfList(T *p_self) {
_self = p_self;
_next = NULL;
_prev = NULL;
_root = NULL;
}
_FORCE_INLINE_ ~SelfList() {
if (_root)
_root->remove(this);
}
};
#endif // SELF_LIST_H
|
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GUAC_TEST_UTIL_SUITE_H
#define _GUAC_TEST_UTIL_SUITE_H
/**
* Test suite containing unit tests for utility functions built into libguac.
* These utility functions are included for convenience rather as integral
* requirements of the core.
*
* @file util_suite.h
*/
#include "config.h"
/**
* A single Unicode character encoded as one byte with UTF-8.
*/
#define UTF8_1b "g"
/**
* A single Unicode character encoded as two bytes with UTF-8.
*/
#define UTF8_2b "\xc4\xa3"
/**
* A single Unicode character encoded as three bytes with UTF-8.
*/
#define UTF8_3b "\xe7\x8a\xac"
/**
* A single Unicode character encoded as four bytes with UTF-8.
*/
#define UTF8_4b "\xf0\x90\x84\xa3"
/**
* Registers the utility test suite with CUnit.
*/
int register_util_suite();
/**
* Unit test for the guac_pool structure and related functions. The guac_pool
* structure provides a consistent source of pooled integers. This unit test
* checks that the associated functions behave as documented (returning
* integers in the proper order, allocating new integers as necessary, etc.).
*/
void test_guac_pool();
/**
* Unit test for libguac's Unicode convenience functions. This test checks that
* the functions provided for determining string length, character length, and
* for reading and writing UTF-8 behave as specified in the documentation.
*/
void test_guac_unicode();
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.