text
stringlengths
4
6.14k
#ifdef CONFIG_TRACE DEF_HELPER_1(traceTicks, void, i32) DEF_HELPER_0(traceInsn, void) #if HOST_LONG_BITS == 32 DEF_HELPER_2(traceBB32, void, i64, i32) #endif #if HOST_LONG_BITS == 64 DEF_HELPER_2(traceBB64, void, i64, i64) #endif #endif #ifdef CONFIG_MEMCHECK DEF_HELPER_2(on_call, void, i32, i32) DEF_HELPER_1(on_ret, void, i32) #endif #include "def-helper.h"
#ifndef _STRIDE_SEARCH_UTILITIES_H_ #define _STRIDE_SEARCH_UTILITIES_H_ #define EARTH_RADIUS_KM 6371.220 #define ZERO_TOL 2.0e-9 #include <cmath> static const double deg2rad = std::atan(1.0) / 45.0; static const double PI = 4.0 * std::atan(1.0); void llToXYZ(double& x, double& y, double& z, const double& lat, const double& lon); double atan4( const double y, const double x); void XyzToLL(double& lat, double& lon, const double& x, const double& y, const double& z); double sphereDistance(double latA, double lonA, double latB, double lonB); #endif
#define UTS_RELEASE "2.6.32.61"
/* ######################################################################## LXRAD - GUI for X programing ######################################################################## Copyright (c) : 2001-2018 Luis Claudio Gamboa Lopes 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. For e-mail suggestions : lcgamboa@yahoo.com ######################################################################## */ /** * \file cpwindow.h * \author Luis Claudio Gamboa Lopes * \date 05-30-2008 */ #ifndef CPWINDOW #define CPWINDOW #include"cwindow.h" /** \brief Image Control. * * Generic Panel Window Control Class. */ class CPWindow:public CWindow { protected: wxWindow *Window_; public: CPWindow (void); ~CPWindow (void); int Create (CControl * control); void Destroy (void); //propiedades wxWindow* GetWWidget (void); void SetWidth (uint width); void SetHeight (uint height); //operator void *operator new (size_t sz); void operator delete (void *p); //eventos }; #endif
#include "platform.h" char *hook_raw_image_addr() { return (char*) (*(int*)(0x574C+0x18) ? 0x435627D8 : 0x41B724C0); } long hook_raw_size() { return 0x1076D90; } void *vid_get_viewport_live_fb() { void **fb=(void **)0x2300; unsigned char buff = *((unsigned char*)0x2130); // sub_FF839FC8 if (buff == 0) buff = 2; else buff--; return fb[buff]; } void *vid_get_bitmap_fb() { return (void*)0x40471000; } void *vid_get_viewport_fb() { return (void*)0x46443400; } void *vid_get_viewport_fb_d() { return (void*)(*(int*)(0x53C8+0x58)); } // default is same as bitmap /* int vid_get_viewport_width() { return 480; } */ long vid_get_viewport_height() { return 270; } char *camera_jpeg_count_str() { return (char*)0x5CED4; } // PTP display stuff, untested, adapted from ewavr chdkcam patch // reyalp - type probably wrong, chdkcam patch suggests opposite order from a540 (e.g. vuya) int vid_get_palette_type() { return 2; } int vid_get_palette_size() { return 16*4; } void *vid_get_bitmap_active_palette() { return (void*)(*(unsigned int*)(0x8D10+0x20)); // sub_FF903BBC } void *vid_get_bitmap_active_buffer() { return (void*)(*(int*)(0x8D10+0x0C)); //"Add: %p Width : %ld Hight : %ld", sub_FF903C80 } // TODO value of vid_get_viewport_height_proper needs to be checked in play, rec, and the different video modes //int vid_get_viewport_fullscreen_height() { return 270; } // values from chdkcam patch // commented for now, protocol changes needed to handle correctly // note, play mode may be 704, needs to be tested #if 0 int vid_get_viewport_width_proper() { return ((mode_get()&MODE_MASK) == MODE_PLAY)?960:*(int*)0x22D0; // VRAM DataSize } int vid_get_viewport_height_proper() { return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x22D0+4); // VRAM DataSize } #endif
#include <linux/netfilter_bridge/ebtables.h> #include <linux/module.h> #define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \ (1 << NF_BR_POST_ROUTING)) static struct ebt_entries initial_chains[] = { { .name = "PREROUTING", .policy = EBT_ACCEPT, }, { .name = "OUTPUT", .policy = EBT_ACCEPT, }, { .name = "POSTROUTING", .policy = EBT_ACCEPT, } }; static struct ebt_replace_kernel initial_table = { .name = "nat", .valid_hooks = NAT_VALID_HOOKS, .entries_size = 3 * sizeof(struct ebt_entries), .hook_entry = { [NF_BR_PRE_ROUTING] = &initial_chains[0], [NF_BR_LOCAL_OUT] = &initial_chains[1], [NF_BR_POST_ROUTING] = &initial_chains[2], }, .entries = (char *)initial_chains, }; static int check(const struct ebt_table_info *info, unsigned int valid_hooks) { if (valid_hooks & ~NAT_VALID_HOOKS) return -EINVAL; return 0; } static struct ebt_table frame_nat = { .name = "nat", .table = &initial_table, .valid_hooks = NAT_VALID_HOOKS, .check = check, .me = THIS_MODULE, }; static unsigned int ebt_nat_in(unsigned int hook, struct sk_buff *skb, const struct net_device *in , const struct net_device *out, int (*okfn)(struct sk_buff *)) { return ebt_do_table(hook, skb, in, out, dev_net(in)->xt.frame_nat); } static unsigned int ebt_nat_out(unsigned int hook, struct sk_buff *skb, const struct net_device *in , const struct net_device *out, int (*okfn)(struct sk_buff *)) { return ebt_do_table(hook, skb, in, out, dev_net(out)->xt.frame_nat); } static struct nf_hook_ops ebt_ops_nat[] __read_mostly = { { .hook = ebt_nat_out, .owner = THIS_MODULE, .pf = NFPROTO_BRIDGE, .hooknum = NF_BR_LOCAL_OUT, .priority = NF_BR_PRI_NAT_DST_OTHER, }, { .hook = ebt_nat_out, .owner = THIS_MODULE, .pf = NFPROTO_BRIDGE, .hooknum = NF_BR_POST_ROUTING, .priority = NF_BR_PRI_NAT_SRC, }, { .hook = ebt_nat_in, .owner = THIS_MODULE, .pf = NFPROTO_BRIDGE, .hooknum = NF_BR_PRE_ROUTING, .priority = NF_BR_PRI_NAT_DST_BRIDGED, }, }; static int __net_init frame_nat_net_init(struct net *net) { net->xt.frame_nat = ebt_register_table(net, &frame_nat); if (IS_ERR(net->xt.frame_nat)) return PTR_ERR(net->xt.frame_nat); return 0; } static void __net_exit frame_nat_net_exit(struct net *net) { ebt_unregister_table(net, net->xt.frame_nat); } static struct pernet_operations frame_nat_net_ops = { .init = frame_nat_net_init, .exit = frame_nat_net_exit, }; static int __init ebtable_nat_init(void) { int ret; ret = register_pernet_subsys(&frame_nat_net_ops); if (ret < 0) return ret; ret = nf_register_hooks(ebt_ops_nat, ARRAY_SIZE(ebt_ops_nat)); if (ret < 0) unregister_pernet_subsys(&frame_nat_net_ops); return ret; } static void __exit ebtable_nat_fini(void) { nf_unregister_hooks(ebt_ops_nat, ARRAY_SIZE(ebt_ops_nat)); unregister_pernet_subsys(&frame_nat_net_ops); } module_init(ebtable_nat_init); module_exit(ebtable_nat_fini); MODULE_LICENSE("GPL");
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include "..\math\Box.h" #include "..\math\Sphere.h" #include "Camera.h" #include "level.h" #include "weapon.h" #define EPSILON_COL_LVL ( 0.1f ) #define EPSILON_COL_OBJ ( 0.5f ) class Player { public: Player( void ); ~Player( void ); void SetLevel( Level * level ); void Move( float dx, float dy, float dz ); void Rotation( float pitch, float yaw, float roll ); void SetPos( float x, float y, float z ); void SetSize( float w, float h, float d ); void SetCMSize( float r ) { sphere.SetRadius( r ); } void SetWeapon( Weapon * w ) { weapon = w; w->SetPlayer( this ); } void DrawView( void ); const Camera & GetCamera( void ) const { return camera; } private: float width; float height; float depth; Sphere sphere; Level * level; Camera camera; Box box; Weapon *weapon; }; #endif
/* * Copyright (C) 2014-2017 StormCore * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef GameUtilitiesServiceService_h__ #define GameUtilitiesServiceService_h__ #include "Common.h" #include "Service.h" #include "game_utilities_service.pb.h" namespace Battlenet { class Session; namespace Services { class GameUtilities : public Service<game_utilities::v1::GameUtilitiesService> { typedef Service<game_utilities::v1::GameUtilitiesService> GameUtilitiesService; public: GameUtilities(Session* session); uint32 HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response) override; uint32 HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response) override; }; } } #endif // GameUtilitiesServiceService_h__
#ifndef LOGISTICSORDERCONSIGNRESPONSE_H #define LOGISTICSORDERCONSIGNRESPONSE_H #include <TaoApiCpp/TaoResponse.h> #include <TaoApiCpp/domain/ConsignResult.h> /** * @brief TOP RESPONSE API: 货运发货接口。通过该接口可以在通过淘宝对物流公司下单,并且可以享有部分折扣优惠。 * * @author sd44 <sd44sdd44@yeah.net> */ class LogisticsOrderConsignResponse : public TaoResponse { public: virtual ~LogisticsOrderConsignResponse() { } ConsignResult getConsignResult() const; void setConsignResult (ConsignResult consignResult); virtual void parseNormalResponse(); private: /** * @brief 发货结果 **/ ConsignResult consignResult; }; #endif
/* This file is part of the KDE project * Copyright (C) 2011 Boudewijn Rempt <boud@kogmbh.com> * Copyright (C) 2011 Marijn Kruisselbrink <mkruisselbrink@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 KWPAGECACHEMANAGER_H #define KWPAGECACHEMANAGER_H #include "KWPage.h" #include <QCache> #include <QRectF> #include <QImage> #include <QQueue> #include <QSize> #include <QObject> class KWPageCacheManager; class KWPageCache { public: /// create a pagecache object with the existing /// QImage. //KWPageCache(KWPageCacheManager *manager, QImage *img); /// create a new pagecache object with a new QImage KWPageCache(KWPageCacheManager *manager, int w, int h); ~KWPageCache(); KWPageCacheManager* m_manager; QList<QImage> cache; int m_tilesx, m_tilesy; QSize m_size; // List of logical exposed rects in view coordinates // These are the rects that are queued for updating, not // the rects that have already been painted. QVector<QRect> exposed; // true if the whole page should be repainted bool allExposed; }; class KWPageCacheManager { public: KWPageCacheManager(int cacheSize); ~KWPageCacheManager(); KWPageCache *take(const KWPage page); void insert(const KWPage page, KWPageCache *cache); KWPageCache *cache(QSize size); void clear(); private: QCache<KWPage, KWPageCache> m_cache; friend class KWPageCache; }; #endif
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // // Copyright : (C) 2015 Eran Ifrah // File name : PHPEntityVariable.h // // ------------------------------------------------------------------------- // A // _____ _ _ _ _ // / __ \ | | | | (_) | // | / \/ ___ __| | ___| | _| |_ ___ // | | / _ \ / _ |/ _ \ | | | __/ _ ) // | \__/\ (_) | (_| | __/ |___| | || __/ // \____/\___/ \__,_|\___\_____/_|\__\___| // // F i l e // // 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 PHPENTITYVARIABLE_H #define PHPENTITYVARIABLE_H #include "codelite_exports.h" #include "PHPEntityBase.h" // Base class: PHPEntityBase #include <wx/string.h> class WXDLLIMPEXP_CL PHPEntityVariable : public PHPEntityBase { public: virtual wxString FormatPhpDoc(const CommentConfigData& data) const; virtual wxString GetDisplayName() const; virtual bool Is(eEntityType type) const; virtual wxString Type() const; virtual void FromResultSet(wxSQLite3ResultSet& res); protected: wxString m_typeHint; // Incase this variable is instantiated with an expression // keep it wxString m_expressionHint; wxString m_defaultValue; public: /** * @brief * @return */ wxString GetScope() const; virtual void Store(PHPLookupTable* lookup); virtual void PrintStdout(int indent) const; void FromJSON(const JSONElement& json); JSONElement ToJSON() const; /** * @brief format this variable */ wxString ToFuncArgString() const; PHPEntityVariable(); virtual ~PHPEntityVariable(); void SetExpressionHint(const wxString& expressionHint) { this->m_expressionHint = expressionHint; } const wxString& GetExpressionHint() const { return m_expressionHint; } void SetVisibility(int visibility); void SetTypeHint(const wxString& typeHint) { this->m_typeHint = typeHint; } const wxString& GetTypeHint() const { return m_typeHint; } void SetDefaultValue(const wxString& defaultValue) { this->m_defaultValue = defaultValue; } const wxString& GetDefaultValue() const { return m_defaultValue; } wxString GetNameNoDollar() const; virtual wxString ToTooltip() const; // Aliases void SetIsReference(bool isReference) { SetFlag(kVar_Reference, isReference); } bool IsMember() const { return HasFlag(kVar_Member); } bool IsPublic() const { return HasFlag(kVar_Public); } bool IsPrivate() const { return HasFlag(kVar_Private); } bool IsProtected() const { return HasFlag(kVar_Protected); } bool IsFunctionArg() const { return HasFlag(kVar_FunctionArg); } bool IsConst() const { return HasFlag(kVar_Const); } bool IsReference() const { return HasFlag(kVar_Reference); } bool IsStatic() const { return HasFlag(kVar_Static); } bool IsDefine() const { return HasFlag(kVar_Define); } bool IsBoolean() const { return GetTypeHint() == "boolean" || GetTypeHint() == "bool"; } }; #endif // PHPENTITYVARIABLE_H
/** * $Id$ * Copyright (C) 2008 - 2014 Nils Asmussen * * 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. */ #pragma once #include <common.h> class OStream; /** * Causes a panic * * @param os the output-stream * @param argc the number of args * @param argv the arguments * @return 0 on success */ int cons_cmd_panic(OStream &os,size_t argc,char **argv);
#ifndef _cameraspecific_gui_h_ #define _cameraspecific_gui_h_ // button codes as received by gui_main_task #define BGMT_PRESS_LEFT 0x1c #define BGMT_UNPRESS_LEFT 0x1d #define BGMT_PRESS_UP 0x1e #define BGMT_UNPRESS_UP 0x1f #define BGMT_PRESS_RIGHT 0x1a #define BGMT_UNPRESS_RIGHT 0x1b #define BGMT_PRESS_DOWN 0x20 #define BGMT_UNPRESS_DOWN 0x21 #define BGMT_PRESS_SET 0x4 #define BGMT_UNPRESS_SET 0x5 #define BGMT_TRASH 0xA #define BGMT_MENU 6 #define BGMT_INFO 7 #define BGMT_Q 8 #define BGMT_Q_ALT 0xF #define BGMT_PLAY 9 #define BGMT_PRESS_HALFSHUTTER 0x3F #define BGMT_LV 0x18 #define BGMT_WHEEL_LEFT 2 #define BGMT_WHEEL_RIGHT 3 #define BGMT_WHEEL_UP 0 #define BGMT_WHEEL_DOWN 1 // these are not sent always #define BGMT_PRESS_ZOOM_OUT 0xD #define BGMT_UNPRESS_ZOOM_OUT 0xE #define BGMT_PRESS_ZOOM_IN 0xB #define BGMT_UNPRESS_ZOOM_IN 0xC #define BGMT_AV (event->type == 0 && event->param == 0x56 && ( \ (is_movie_mode() && event->arg == 0xe) || \ (shooting_mode == SHOOTMODE_P && event->arg == 0xa) || \ (shooting_mode == SHOOTMODE_AV && event->arg == 0xf) || \ (shooting_mode == SHOOTMODE_M && event->arg == 0xe) || \ (shooting_mode == SHOOTMODE_TV && event->arg == 0x10)) ) #define BGMT_AV_MOVIE (event->type == 0 && event->param == 0x56 && (is_movie_mode() && event->arg == 0xe)) #define BGMT_PRESS_AV (BGMT_AV && (*(int*)(event->obj) & 0x2000000) == 0) #define BGMT_UNPRESS_AV (BGMT_AV && (*(int*)(event->obj) & 0x2000000)) #define BGMT_FLASH_MOVIE (event->type == 0 && event->param == 0x56 && is_movie_mode() && event->arg == 9) #define BGMT_PRESS_FLASH_MOVIE (BGMT_FLASH_MOVIE && (*(int*)(event->obj) & 0x4000000)) #define BGMT_UNPRESS_FLASH_MOVIE (BGMT_FLASH_MOVIE && (*(int*)(event->obj) & 0x4000000) == 0) #define BGMT_ISO_MOVIE (event->type == 0 && event->param == 0x56 && is_movie_mode() && event->arg == 0x1b) #define BGMT_PRESS_ISO_MOVIE (BGMT_ISO_MOVIE && (*(int*)(event->obj) & 0xe0000)) #define BGMT_UNPRESS_ISO_MOVIE (BGMT_ISO_MOVIE && (*(int*)(event->obj) & 0xe0000) == 0) #define GMT_OLC_INFO_CHANGED 0x56 // backtrace copyOlcDataToStorage call in gui_massive_event_loop #define GMT_LOCAL_DIALOG_REFRESH_LV 0x34 // event type = 2, gui code = 0x1000007d in 550d //~ #define GMT_OLC_BLINK_TIMER 0x2f // event type = 2, look for OlcBlinkTimer and send_message_to_gui_main_task // needed for correct shutdown from powersave modes #define GMT_GUICMD_START_AS_CHECK 78 #define GMT_GUICMD_OPEN_SLOT_COVER 75 #define GMT_GUICMD_LOCK_OFF 73 #define BTN_ZEBRAS_FOR_PLAYBACK BGMT_Q_ALT // what button to use for zebras in Play mode #define BTN_ZEBRAS_FOR_PLAYBACK_NAME Q_BTN_NAME #endif
#ifdef GW_DEVEL_DEVICE #ifndef H__DEV_DKONG__H #define H__DEV_DKONG__H #include "device.h" using namespace std; class GW_Game_DKong_Info : public GW_Game_Info { public: GW_Game_DKong_Info(const string &platformdatapath) : GW_Game_Info("dkong", "Nintendo - Donkey Kong", "dkong", platformdatapath, "bg.bmp", true, GW_Platform_RGB_create(255, 0, 255)) {} virtual GW_Game *create(); }; class GW_Game_DKong : public GW_Game { public: enum { PS_BG, PS_BARREL, PS_BARRELFALL, PS_HOOK, PS_CRANE, PS_HEART, PS_KEY, PS_KONGUP, PS_KONGDOWN, PS_KONGFALL, PS_LEVER, PS_MARIO, PS_PLAT, PS_BINDER, PS_LIFE, PS_NUMBER, PS_SEMICOLON, PS_ALARM, PS_GAMEA, PS_GAMEB, PS_AM, PS_PM, }; enum { IM_BG, IM_BARREL, IM_BARRELFALL, IM_HOOK, IM_CRANE, IM_HEART, IM_KEY, IM_KONGUP, IM_KONGDOWN, IM_KONGFALL, IM_LEVER, IM_MARIO, IM_PLAT, IM_BINDER, IM_LIFE, IM_NUMBER, IM_SEMICOLON, IM_ALARM, IM_GAMEA, IM_GAMEB, IM_AM, IM_PM, }; enum { SND_BARREL, SND_BONUS, SND_FALL, SND_JUMP, SND_KONGFALL, SND_MISS, SND_OVER, SND_STEP, }; enum mode_t { MODE_OFF, MODE_IDLE, MODE_GAMEA, MODE_GAMEB, MODE_TIME, MODE_ALARM, MODE_MAX, }; GW_Game_DKong(); virtual void Event(GW_Platform_Event *event); virtual int bgimage_get() { return IM_BG; } protected: virtual GW_Platform_GameType do_gametype_get() { return GPG_LEFTRIGHT; } virtual void do_turnon(); virtual void do_turnoff(); virtual int do_modecount() { return MODE_MAX; } virtual void do_update(); virtual bool do_setmode(int mode); private: void clock_update(int mode = -1); void setnumber(int n, int ps1, int ps2, bool leadzero = true); void display_number(int pos, int n, bool show = true); }; #endif //H__DEV_DKONG__H #endif //GW_DEVEL_DEVICE
/* * This file is part of wl18xx * * Copyright (C) 2011 Texas Instruments Inc. * * 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. * * 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 St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "../wlcore/cmd.h" #include "../wlcore/debug.h" #include "../wlcore/acx.h" #include "acx.h" int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap, u32 sdio_blk_size, u32 extra_mem_blks, u32 len_field_size) { struct wl18xx_acx_host_config_bitmap *bitmap_conf; int ret; bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL); if (!bitmap_conf) { ret = -ENOMEM; goto out; } bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap); bitmap_conf->host_sdio_block_size = cpu_to_le32(sdio_blk_size); bitmap_conf->extra_mem_blocks = cpu_to_le32(extra_mem_blks); bitmap_conf->length_field_size = cpu_to_le32(len_field_size); ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP, bitmap_conf, sizeof(*bitmap_conf)); if (ret < 0) { wl1271_warning("wl1271 bitmap config opt failed: %d", ret); goto out; } out: kfree(bitmap_conf); return ret; } int wl18xx_acx_set_checksum_state(struct wl1271 *wl) { struct wl18xx_acx_checksum_state *acx; int ret=0; wl1271_debug(DEBUG_ACX, "acx checksum state"); acx = kzalloc(sizeof(*acx), GFP_KERNEL); if (!acx) { ret = -ENOMEM; goto out; } acx->checksum_state = CHECKSUM_OFFLOAD_ENABLED; ret = wl1271_cmd_configure(wl, ACX_CHECKSUM_CONFIG, acx, sizeof(*acx)); if (ret < 0) { wl1271_warning("failed to set Tx checksum state: %d", ret); goto out; } out: kfree(acx); return ret; }
#ifndef KEXEC_PPC_H #define KEXEC_PPC_H #define MAXBYTES 128 #define MAX_LINE 160 #define CORE_TYPE_ELF32 1 #define CORE_TYPE_ELF64 2 extern unsigned char setup_simple_start[]; extern uint32_t setup_simple_size; extern struct { uint32_t spr8; } setup_simple_regs; extern unsigned char setup_dol_start[]; extern uint32_t setup_dol_size; extern uint64_t rmo_top; extern struct { uint32_t spr8; } setup_dol_regs; #define SIZE_16M (16*1024*1024UL) int elf_ppc_probe(const char *buf, off_t len); int elf_ppc_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info); void elf_ppc_usage(void); int uImage_ppc_probe(const char *buf, off_t len); int uImage_ppc_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info); void uImage_ppc_usage(void); int dol_ppc_probe(const char *buf, off_t len); int dol_ppc_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info); void dol_ppc_usage(void); /* * During inital setup the kernel does not map the whole memory but a part of * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible). */ #define KERNEL_ACCESS_TOP (24 * 1024 * 1024) /* boot block version 17 as defined by the linux kernel */ struct bootblock { unsigned magic, totalsize, off_dt_struct, off_dt_strings, off_mem_rsvmap, version, last_comp_version, boot_physid, dt_strings_size, dt_struct_size; }; typedef struct mem_rgns { unsigned int size; struct memory_range *ranges; } mem_rgns_t; extern mem_rgns_t usablemem_rgns; extern int max_memory_ranges; extern unsigned long long crash_base, crash_size; extern unsigned long long initrd_base, initrd_size; extern unsigned long long ramdisk_base, ramdisk_size; extern unsigned char reuse_initrd; extern const char *ramdisk; #define COMMAND_LINE_SIZE 512 /* from kernel */ /*fs2dt*/ void reserve(unsigned long long where, unsigned long long length); #endif /* KEXEC_PPC_H */
/* <proc_service.h> replacement for systems that don't have it. Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of GDB. 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/>. */ #ifndef GDB_PROC_SERVICE_H #define GDB_PROC_SERVICE_H #include <sys/types.h> /* ANDROID: */ #ifdef UAPI_HEADERS #if defined(__aarch64__) || defined(__arm__) #include <sys/ptrace.h> typedef unsigned long elf_greg_t; typedef elf_greg_t elf_gregset_t[(sizeof (struct user_pt_regs) / sizeof(elf_greg_t))]; #else #include <sys/user.h> typedef unsigned long long elf_greg_t; #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef struct user_i387_struct elf_fpregset_t; #endif #endif #ifdef HAVE_PROC_SERVICE_H #include <proc_service.h> #else #ifdef HAVE_SYS_PROCFS_H #include <sys/procfs.h> #endif /* Not all platforms bring in <linux/elf.h> via <sys/procfs.h>. If <sys/procfs.h> wasn't enough to find elf_fpregset_t, try the kernel headers also (but don't if we don't need to). */ #ifndef HAVE_ELF_FPREGSET_T # ifdef HAVE_LINUX_ELF_H # include <linux/elf.h> # endif #endif /* ANDROID: for AT_PHDR and AT_PHNUM */ #include <linux/auxvec.h> typedef enum { PS_OK, /* Success. */ PS_ERR, /* Generic error. */ PS_BADPID, /* Bad process handle. */ PS_BADLID, /* Bad LWP id. */ PS_BADADDR, /* Bad address. */ PS_NOSYM, /* Symbol not found. */ PS_NOFREGS /* FPU register set not available. */ } ps_err_e; #ifndef HAVE_LWPID_T typedef unsigned int lwpid_t; #endif #ifndef HAVE_PSADDR_T typedef void *psaddr_t; #endif #ifndef HAVE_PRGREGSET_T typedef elf_gregset_t prgregset_t; #endif #endif /* HAVE_PROC_SERVICE_H */ /* Structure that identifies the target process. */ struct ps_prochandle { /* We don't need to track anything. All context is served from the current inferior. */ }; #endif /* gdb_proc_service.h */
#define pr_fmt(fmt) SAMPLE_CHAR_DRV_NAME ": " fmt #include <linux/module.h> #include <linux/fs.h> #include <linux/cdev.h> #include <linux/device.h> #include "char-device.h" #define SAMPLE_CHAR_DEVS 16 static struct cdev *sample_cdev; static dev_t sample_devt; static struct class *sample_class; static int sample_char_fops_open(struct inode *inode, struct file *filp) { pr_info("open.\n"); return 0; } static int sample_char_fops_release(struct inode *inode, struct file *filp) { pr_info("release.\n"); return 0; } static ssize_t sample_char_fops_read(struct file *filp, char __user *buf, size_t cnt, loff_t *ppos) { pr_info("read %d bytes.\n", (int)cnt); return cnt; } static ssize_t sample_char_fops_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *ppos) { pr_info("write %d bytes.\n", (int)cnt); return cnt; } static const struct file_operations sample_char_fops = { .owner = THIS_MODULE, .open = sample_char_fops_open, .release = sample_char_fops_release, .read = sample_char_fops_read, .write = sample_char_fops_write, .llseek = no_llseek, }; static char *sample_class_devnode(struct device *dev, umode_t *mode) { if (mode != NULL) { *mode = 0666; } return kasprintf(GFP_KERNEL, "sample_char/%s", dev_name(dev)); } static int __init sample_char_device_init(void) { const char *name = "sample_char"; struct device *dev; int ret; ret = alloc_chrdev_region(&sample_devt, 0, SAMPLE_CHAR_DEVS, name); if (ret != 0) { pr_err("alloc_chrdev_region() failed."); goto err_out; } sample_cdev = cdev_alloc(); if (!sample_cdev) { pr_err("cdev_alloc() failed."); ret = -ENODEV; goto err_out_reg; } sample_cdev->owner = THIS_MODULE; sample_cdev->ops = &sample_char_fops; kobject_set_name(&sample_cdev->kobj, "%s", name); ret = cdev_add(sample_cdev, sample_devt, SAMPLE_CHAR_DEVS); if (ret) { pr_err("cdev_add() failed."); goto err_out_alloc; } sample_class = class_create(THIS_MODULE, "sample_char_class"); if (IS_ERR(sample_class)) { pr_err("class_create() failed."); ret = PTR_ERR(sample_class); goto err_out_alloc; } sample_class->devnode = sample_class_devnode; dev = device_create(sample_class, NULL, sample_devt, NULL, "sample_char_dev"); if (IS_ERR(dev)) { pr_err("device_create() failed."); ret = PTR_ERR(dev); goto err_out_class; } pr_info("loaded.\n"); return 0; err_out_class: class_destroy(sample_class); err_out_alloc: cdev_del(sample_cdev); err_out_reg: unregister_chrdev_region(sample_devt, SAMPLE_CHAR_DEVS); err_out: return ret; } static void __exit sample_char_device_exit(void) { device_destroy(sample_class, sample_devt); class_destroy(sample_class); cdev_del(sample_cdev); unregister_chrdev_region(sample_devt, SAMPLE_CHAR_DEVS); pr_info("unloaded.\n"); } module_init(sample_char_device_init); module_exit(sample_char_device_exit); MODULE_AUTHOR("Katsuhiro Suzuki <katsuhiro@katsuster.net>"); MODULE_DESCRIPTION("Sample character device module"); MODULE_LICENSE("GPL");
/* main7-2.c ¼ìÑébo7-2.cµÄÖ÷³ÌÐò */ #include"c1.h" #define MAX_NAME 3 /* ¶¥µã×Ö·û´®µÄ×î´ó³¤¶È+1 */ typedef int InfoType; /* ´æ·ÅÍøµÄȨֵ */ typedef char VertexType[MAX_NAME]; /* ×Ö·û´®ÀàÐÍ */ #include"c7-2.h" #include"bo7-2.c" void print(char *i) { printf("%s ",i); } void main() { int i,j,k,n; ALGraph g; VertexType v1,v2; printf("ÇëÑ¡ÔñÓÐÏòͼ\n"); CreateGraph(&g); Display(g); printf("ɾ³ýÒ»Ìõ±ß»ò»¡£¬ÇëÊäÈë´ýɾ³ý±ß»ò»¡µÄ»¡Î² »¡Í·£º"); scanf("%s%s",v1,v2); DeleteArc(&g,v1,v2); printf("Ð޸Ķ¥µãµÄÖµ£¬ÇëÊäÈëÔ­Öµ ÐÂÖµ: "); scanf("%s%s",v1,v2); PutVex(&g,v1,v2); printf("²åÈëж¥µã£¬ÇëÊäÈë¶¥µãµÄÖµ: "); scanf("%s",v1); InsertVex(&g,v1); printf("²åÈëÓëж¥µãÓйصĻ¡»ò±ß£¬ÇëÊäÈ뻡»ò±ßÊý: "); scanf("%d",&n); for(k=0;k<n;k++) { printf("ÇëÊäÈëÁíÒ»¶¥µãµÄÖµ: "); scanf("%s",v2); printf("¶ÔÓÚÓÐÏòͼ£¬ÇëÊäÈëÁíÒ»¶¥µãµÄ·½Ïò(0:»¡Í· 1:»¡Î²): "); scanf("%d",&j); if(j) InsertArc(&g,v2,v1); else InsertArc(&g,v1,v2); } Display(g); printf("ɾ³ý¶¥µã¼°Ïà¹ØµÄ»¡»ò±ß£¬ÇëÊäÈë¶¥µãµÄÖµ: "); scanf("%s",v1); DeleteVex(&g,v1); Display(g); printf("Éî¶ÈÓÅÏÈËÑË÷µÄ½á¹û:\n"); DFSTraverse(g,print); printf("¹ã¶ÈÓÅÏÈËÑË÷µÄ½á¹û:\n"); BFSTraverse(g,print); DestroyGraph(&g); printf("Çë˳ÐòÑ¡ÔñÓÐÏòÍø,ÎÞÏòͼ,ÎÞÏòÍø\n"); for(i=0;i<3;i++) /* ÑéÖ¤ÁíÍâ3ÖÖÇé¿ö */ { CreateGraph(&g); Display(g); printf("²åÈëж¥µã£¬ÇëÊäÈë¶¥µãµÄÖµ: "); scanf("%s",v1); InsertVex(&g,v1); printf("²åÈëÓëж¥µãÓйصĻ¡»ò±ß£¬ÇëÊäÈ뻡»ò±ßÊý: "); scanf("%d",&n); for(k=0;k<n;k++) { printf("ÇëÊäÈëÁíÒ»¶¥µãµÄÖµ: "); scanf("%s",v2); if(g.kind<=1) /* ÓÐÏò */ { printf("¶ÔÓÚÓÐÏòͼ»òÍø£¬ÇëÊäÈëÁíÒ»¶¥µãµÄ·½Ïò(0:»¡Í· 1:»¡Î²): "); scanf("%d",&j); if(j) InsertArc(&g,v2,v1); else InsertArc(&g,v1,v2); } else /* ÎÞÏò */ InsertArc(&g,v1,v2); } Display(g); printf("ɾ³ý¶¥µã¼°Ïà¹ØµÄ»¡»ò±ß£¬ÇëÊäÈë¶¥µãµÄÖµ: "); scanf("%s",v1); DeleteVex(&g,v1); Display(g); DestroyGraph(&g); } }
/* 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 TISIMPORTER_H #define TISIMPORTER_H #include "Plugins/TileSetMgr.h" namespace GemRB { class TISImporter : public TileSetMgr { private: DataStream* str = nullptr; ieDword headerShift = 0; ieDword TilesCount = 0; ieDword TilesSectionLen = 0; ieDword TileSize = 0; Holder<Sprite2D> badTile; // blank tile to use to fill in bad data public: TISImporter() noexcept = default; TISImporter(const TISImporter&) = delete; ~TISImporter() override; TISImporter& operator=(const TISImporter&) = delete; bool Open(DataStream* stream) override; Tile* GetTile(const std::vector<ieWord>& indexes, unsigned short* secondary = NULL) override; Holder<Sprite2D> GetTile(int index); public: }; } #endif
/********************************************************************* * * Copyright 2010 Broadcom Corporation. All rights reserved. * * Unless you and Broadcom execute a separate written software license agreement * governing use of this software, this software is licensed to you under the * terms of the GNU General Public License version 2, available at * http://www.gnu.org/copyleft/gpl.html (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. ***************************************************************************/ /** * * @file datacomm_def.h * * @brief This file defines the interface difinitions for dlink(data connection) API Services. * ****************************************************************************/ #ifndef _DATACOMM_DEF_H #define _DATACOMM_DEF_H /** Data connection status **/ typedef enum { DC_STATUS_CONNECTING, ///< data connection is in connecting state DC_STATUS_DIALING, ///< DC_STATUS_INITIALIZING, ///< DC_STATUS_VERIFYING, ///< data connection enter this state when csd data call to isp just return CONNECT DC_STATUS_VERIFIED, ///< DC_STATUS_CONNECTED, ///< data connection is connected DC_STATUS_DISCONNECTING, ///< data connection is connecting DC_STATUS_DISCONNECTED, ///< data connection is disconnected DC_STATUS_ERR_NETWORK_FAILURE, ///< DC_STATUS_ERR_CALL_BARRED, ///< DC_STATUS_ERR_NO_ACCOUNT, ///< data connection failed due to invalid data account id DC_STATUS_ERR_NO_CARRIER, ///< data connection failed due to no carrier DC_STATUS_ERR_DATA_LINK_BROKEN, ///< DC_STATUS_ERR_NO_CONNECTION ///< }DC_ConnectionStatus_t; /** Data connection type **/ typedef enum { DC_MODEM_INITIATED, ///< if the phone is used as modem (ppp server) DC_MS_INITIATED ///< if the connection is setup for data over WEDGE/GPRS (such as WAP) }DC_ConnectionType_t; /** Asynchronous message to notify clients data connection information such as connection status, source IP, PCH reject code etc. **/ typedef struct { UInt8 acctId; ///< Data account id DC_ConnectionStatus_t status; ///< Data connection status Result_t rejectCode; ///< Rejection code UInt32 srcIP; ///< Source IP of the phone from PDP activation } DC_ReportCallStatus_t; #endif //_DATACOMM_DEF_H
/* * File : board.h * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://openlab.rt-thread.com/license/LICENSE * * Change Logs: * Date Author Notes * 2006-10-08 Bernard add board.h to this bsp */ #ifndef __BOARD_H__ #define __BOARD_H__ #include <rthw.h> #include <rtthread.h> // These are defined in standard header (at91sam7x256.h) of realview MDK. //#define AT91C_US_RXRDY ((unsigned int) 0x1 << 0) /* US RXRDY Interrupt */ //#define AT91C_US_TXRDY ((unsigned int) 0x1 << 1) /* US TXRDY Interrupt */ //#define AT91C_US_RSTRX ((unsigned int) 0x1 << 2) /* US Reset Receiver */ //#define AT91C_US_RSTTX ((unsigned int) 0x1 << 3) /* US Reset Transmitter */ //#define AT91C_US_RXEN ((unsigned int) 0x1 << 4) /* US Receiver Enable */ //#define AT91C_US_RXDIS ((unsigned int) 0x1 << 5) /* US Receiver Disable */ //#define AT91C_US_TXEN ((unsigned int) 0x1 << 6) /* US Transmitter Enable */ //#define AT91C_US_TXDIS ((unsigned int) 0x1 << 7) /* US Transmitter Disable */ //#define AT91C_US_RSTSTA ((unsigned int) 0x1 << 8) /* US Reset Status Bits */ // //#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) /* USAR) Normal */ //#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) /* USAR) RS485 */ //#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) /* USAR) Hardware Handshaking */ //#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) /* USAR) Modem */ //#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) /* USAR) ISO7816 protocol: T = 0 */ //#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) /* USAR) ISO7816 protocol: T = 1 */ //#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) /* USAR) IrDA */ //#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) /* USAR) Software Handshaking */ // //#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) /* USAR) Clock */ //#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) /* USAR) fdiv1 */ //#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) /* USAR) slow_clock (ARM) */ //#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) /* USAR) External (SCK) */ // //#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) /* USAR) Character Length: 5 bits */ //#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) /* USAR) Character Length: 6 bits */ //#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) /* USAR) Character Length: 7 bits */ //#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) /* USAR) Character Length: 8 bits */ // //#define AT91C_US_PAR_EVEN ((unsigned int) 0x0 << 9) /* DBGU Even Parity */ //#define AT91C_US_PAR_ODD ((unsigned int) 0x1 << 9) /* DBGU Odd Parity */ //#define AT91C_US_PAR_SPACE ((unsigned int) 0x2 << 9) /* DBGU Parity forced to 0 (Space) */ //#define AT91C_US_PAR_MARK ((unsigned int) 0x3 << 9) /* DBGU Parity forced to 1 (Mark) */ //#define AT91C_US_PAR_NONE ((unsigned int) 0x4 << 9) /* DBGU No Parity */ //#define AT91C_US_PAR_MULTI_DROP ((unsigned int) 0x6 << 9) /* DBGU Multi-drop mode */ // //#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) /* USART 1 stop bit */ //#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) /* USART Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits */ //#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) /* USART 2 stop bits */ #define MCK 48054857 #define BR 115200 /* Baud Rate */ #define BRD (MCK/16/BR) /* Baud Rate Divisor */ void rt_hw_board_led_on(int n); void rt_hw_board_led_off(int n); void rt_hw_board_init(void); #endif
#ifndef RESERVATION_STATIONS_H_INCLUDED #define RESERVATION_STATIONS_H_INCLUDED #include "definitions.h" typedef struct { ASMinstr *cmd; uint_fast32_t cycle_issued; uint_fast8_t stalls_ex; uint_fast8_t stalls_wb; } printinfo; typedef struct { ASMinstr cmd; int cycles_remaining; int issuedOnCycle; bool isFree; bool isWaiting; bool isIssuedInTheSameCycle; int stalls_before_ex; int stalls_before_wb; printinfo* printInfo; } Res_Station; extern Res_Station * ResStations; void update_res_stations(); void initializeResStations(); Res_Station* get_free_res_station(); bool there_are_free_res_stations(); #endif // RESERVATION_STATIONS_H_INCLUDED
// ********************************************************************** // // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_UNDEF_SYS_MACROS_H #define ICE_UNDEF_SYS_MACROS_H // // This header includes macros that can end up being dragged into // the generated code from system headers, such as major() or NDEBUG. // If a Slice symbol has the same name as a macro, the generated // code most likely won't compile (but, depending how the macro is // defined, may even compile). // // Here, we undefine symbols that cause such problems. // // The #ifdef ... #endif protection is necessary to prevent // warnings on some platforms. // #ifdef major #undef major #endif #ifdef minor #undef minor #endif #ifdef min #undef min #endif #ifdef max #undef max #endif #endif
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS PairStyle(peri/ves,PairPeriVES) #else #ifndef LMP_PAIR_PERI_VES_H #define LMP_PAIR_PERI_VES_H #include "pair.h" namespace LAMMPS_NS { class PairPeriVES : public Pair { public: double *theta; PairPeriVES(class LAMMPS *); virtual ~PairPeriVES(); int pack_comm(int, int *, double *, int, int *); void unpack_comm(int, int, double *); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); double init_one(int, int); void init_style(); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *) {} void read_restart_settings(FILE *) {} double memory_usage(); double influence_function(double, double, double); void compute_dilatation(); protected: int ifix_peri; double **bulkmodulus; double **shearmodulus; double **s00, **alpha; double **cut; double **m_lambdai; double **m_taubi; double *s0_new; int nmax; void allocate(); }; } #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. E: Incorrect args for pair coefficients Self-explanatory. Check the input script or data file. E: All pair coeffs are not set All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. E: Pair style peri requires atom style peri Self-explanatory. E: Pair peri requires an atom map, see atom_modify Even for atomic systems, an atom map is required to find Peridynamic bonds. Use the atom_modify command to define one. E: Pair peri requires a lattice be defined Use the lattice command for this purpose. E: Pair peri lattice is not identical in x, y, and z The lattice defined by the lattice command must be cubic. E: Fix peri neigh does not exist Somehow a fix that the pair style defines has been deleted. E: Divide by 0 in influence function of pair peri/lps This should not normally occur. It is likely a problem with your model. */
#ifndef octree #define octree // O monitor disponibilizou a estrutura da Octree abaixo, somente modifiquei as variaveis para melhor utilizacao // Armazena as coordenadas do ponto typedef struct _TPonto { float x, y, z; // Coordenadas em R³ do ponto } TPonto; // Estrutura utilizada para armazenar os atomos da proteina typedef struct _OctreePonto { TPonto posicao; // Posição da proteína no espaço de busca } OctreePonto; // Estrutura da Octree typedef struct _Nodo { TPonto origem; // Ponto central do cubo TPonto metadeAresta; // Metade das dimensões do cubo TPonto verticemin; // Menor vértice do cubo TPonto verticemax; // Maior vértice do cubo int nodoOuFolha; // Inteiro que indica se é um nodo interno(0) ou uma folha(1) OctreePonto *conteudo; // Se for uma folha este será utilizado para armazenar um atomo da proteina struct _Nodo *filho[8]; // Se for um nodo interno, este vetor aponta para os filhos } Octree; // Fim da declaracao da Octree /** ESQUEMA DA DIVISÃO DOS CUBOS EM SEUS RESPECTIVOS NOS _____________________________ / / /| / NODE 6 / NODE 5 / | /______________/_____________/ | / / /| | / NODE 2 / NODE 1 / | 5| /______________/_____________/ | /| | | | 1|/ | | NODE 2 | NODE 1 | | | | | | /| 8| |______________|_____________|/ | / | | | 4|/ | NODE 3 | NODE 4 | / | | | / |______________|_____________|/ ROTAÇÃO DO CUBO EM 180º _____________________________ / / /| / NODE 1 / NODE 2 / | /______________/_____________/ | / / /| 2| / NODE 5 / NODE 6 / | | /______________/_____________/ | /| | | | 6|/ | | NODE 5 | NODE 6 | | 3| | | | /| | |______________|_____________|/ | / | | | 7|/ | NODE 8 | NODE 7 | / | | | / |______________|_____________|/ */ // Definicao do cubo do ligante typedef struct _Ligante { TPonto origem; // Guarda o ponto central do cubo do ligante, que é o próprio átomo do ligante TPonto verticemin; // Guarda o vértice mínimo do cubo do ligante TPonto verticemax; // Guarda o vértice máximo do cubo do ligante float tamanhoAresta; // Guarda o tamanho da aresta do cubo do ligante, dado na primeira linha da entrada } TCuboLig; // Fim da definição do cubo do ligante Octree *plantaRaiz(); // Aloca o espaço necessário para a raiz de acordo com o tamanho necessário para a octree void nasceFolha(Octree *Arvore); // Aloca o espaço necessário para criar os 8 filhos de um nodo na árvore void fazMinMaxFolhas(Octree *Arvore); // Calcula os vértices mínimos e máximos, juntamente com a origem, de cada cubo filho criado void insereProteina(float xprot, float yprot, float zprot, Octree *Arvore); // Insere a proteína dada na entrada de acordo com a localização do seu ponto na árvore void criaCuboLigante(TCuboLig **Cubo); // Aloca o espaço necessário para o cubo que conterá o ligante void montaCuboLigante(TCuboLig *Cubo, float arestaCubo);// Faz os cálculos necessários para achar os vértices mínimos e máximos do cubo do ligante int verificaInteracao(TCuboLig *Cubo, Octree *Arvore); // Verifica se a proteína está no espaço delimitado pelo cubo do ligante, retornando 1 caso esteja e 0 caso não esteja int getPointsInsideBox(TCuboLig *Cubo, Octree *Arvore); // Função que faz a chamada das funções para que se calcule o número de interações de cada átomo do ligante com os átomos da proteína e retorna um contador para a função leEntrada() para que seja armazenada o número de interações void desintegraLigante(TCuboLig *Cubo); // Função que dá free no Tipo Abstrato de Dados Cubo que foi criado para armazenar o ligante e possibilitar os cálculos com as demais proteínas void podaArvore(Octree *Arvore); // Função que libera os filhos da árvore, exceto a raiz, que será utilizada posteriormente para alocar outros filhos void desmatamento(Octree *Raiz); // Função que libera a raiz da árvore ao final da execução do programa void leEntrada(Octree *Arvore); // Função "principal" para a execução do programa. É ela que faz todos os cálculos e chama as demais funções #endif
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * * * Copyright (C) 2009 by Jorge Pinto * * 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef _BUTTON_TARGET_H_ #define _BUTTON_TARGET_H_ #include <stdbool.h> #include "config.h" #define BUTTON_SELECT 0x00000001 #define BUTTON_MENU 0x00000002 #define BUTTON_PLAY 0x00000004 #define BUTTON_STOP 0x00000008 #define BUTTON_LEFT 0x00000010 #define BUTTON_RIGHT 0x00000020 #define BUTTON_UP 0x00000040 #define BUTTON_DOWN 0x00000080 #define BUTTON_MAIN (BUTTON_UP|BUTTON_DOWN|BUTTON_RIGHT|BUTTON_LEFT \ |BUTTON_SELECT|BUTTON_MENU|BUTTON_PLAY \ |BUTTON_STOP) bool button_hold(void); void button_init_device(void); int button_read_device(void); /* No Remote control */ #define BUTTON_REMOTE 0 #endif /* _BUTTON_TARGET_H_ */
#include <sys/socket.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <arpa/inet.h> #include <unistd.h> #include <signal.h> int listener_d; void handle_shutdown(int sig) { if(listener_d) close(listener_d); fprintf(stderr, "\nBye!\n"); exit(0); } int catch_signal(int sig, void (*handler)(int)) { struct sigaction action; action.sa_handler = handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; return sigaction(sig, &action, NULL); } void errnoexit(char *msg) { fprintf(stderr, "%s: %s\n", msg, strerror(errno)); } void error(char *msg) { errnoexit(msg); exit(1); } int open_listener_socket() { int s = socket(PF_INET, SOCK_STREAM, 0); //0 represents a protocal number, leave it as 0 here. if(s == -1) error("Can't open a socket"); return s; } void bind_to_port(int socket, int port) { struct sockaddr_in name; name.sin_family = PF_INET; name.sin_port = (in_port_t)htons(port); name.sin_addr.s_addr = htonl(INADDR_ANY); int reuse = 1; if(setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(int))==-1) error("Can't set the reuse option on the socket"); int c = bind(socket, (struct sockaddr *) &name, sizeof(name)); if(c == -1) error("Can't bind to socket"); } int say(int socket, char *s) { int result = send(socket, s, strlen(s), 0); if (result == -1) errnoexit("Error talking to the client"); return result; } int read_in(int socket, char *buf, int len) { char *s = buf; int slen = len; int c = recv(socket, s, slen, 0); while ((c > 0) && (s[c-1] != '\n')) { s += c; slen -= c; c = recv(socket, s, slen, 0); } if (c < 0) return c; else if (c == 0) buf[0] = '\0'; else s[c-1]='\0'; return len - slen; } int main() { if(catch_signal(SIGINT, handle_shutdown)==-1) error("Can't set the interrupt handler"); listener_d = open_listener_socket(); bind_to_port(listener_d, 30000); if(listen(listener_d, 10) == -1) error("Can't listen"); puts("Waiting for connection"); struct sockaddr_storage client_addr; unsigned int address_size = sizeof(client_addr); char buf[255]; while(1){ int connect_d = accept(listener_d, (struct sockaddr *) &client_addr, &address_size); if(connect_d == -1) error("Can't open secondary socket"); if(!fork()){ close(listener_d); if(say(connect_d, "Internet Knock-Knock Protocol Server\r\nVersion 1.0\r\nKnock! Knock!\r\n>") != -1){ read_in(connect_d, buf, sizeof(buf)); if (strncasecmp("Who's there?", buf, 12)){ say(connect_d, "You should say ‘Who’s there?’!\n"); } else{ if (say(connect_d, "Oscar\r\n>") != -1) { read_in(connect_d, buf, sizeof(buf)); if (strncasecmp("Oscar who?", buf, 10)) say(connect_d, "You should say ‘Oscar who?’!\r\n"); else say(connect_d, "Oscar silly question, you get a silly answer\r\n"); } } } close(connect_d); exit(0); } close(connect_d); } return 0; }
// damped-sine "ring" generator #include <math.h> // times and frequencies are in number of samples struct RingGen { float l,r, Fc, Tc, t2; RingGen() { l=0; r=0; Fc=0; Tc=0; } float CalcFc(float F) { return 2*M_PI*sin(M_PI*F); } void SetT(float T) { Tc = pow(0.01, 1.0/T); } void SetFc(float F) { Fc = F; } void Ring(float amp) { l+=amp; } float Process(void) { t2 = l*Fc + r; r=t2; l = l*Tc - t2*Fc; return t2; } };
/*********************************************************************** * * * Copyright (C) 1995 * * University Corporation for Atmospheric Research * * All Rights Reserved * * * ***********************************************************************/ /* * File: ti01c.c * * Author: Bob Lackman * National Center for Atmospheric Research * PO 3000, Boulder, Colorado * * Date: Fri Jan 06 18:31:18 MDT 1995 * * Description: Demonstrates the Title Object resource defaults. * Since using all the defaults would produce a * blank plot, an exception is made in this case and * the main title string is set in the resource file. */ #include <stdio.h> #include <ncarg/hlu/hlu.h> #include <ncarg/hlu/ResList.h> #include <ncarg/hlu/App.h> #include <ncarg/hlu/Title.h> #include <ncarg/hlu/NcgmWorkstation.h> #include <ncarg/hlu/PSWorkstation.h> #include <ncarg/hlu/PDFWorkstation.h> #include <ncarg/hlu/CairoWorkstation.h> int main() { int appid, wid, pid; int rlist; char const *wks_type = "x11"; /* * Initialize the high level utility library */ NhlInitialize(); /* * Create an application context. Set the app dir to the current * directory so the application looks for a resource file in the * working directory. In this example the resource file supplies the * plot title only. */ rlist = NhlRLCreate(NhlSETRL); NhlRLClear(rlist); NhlRLSetString(rlist,NhlNappDefaultParent,"True"); NhlRLSetString(rlist,NhlNappUsrDir,"./"); NhlCreate(&appid,"ti01",NhlappClass,NhlDEFAULT_APP,rlist); if (!strcmp(wks_type,"ncgm") || !strcmp(wks_type,"NCGM")) { /* * Create a meta file workstation object. */ NhlRLClear(rlist); NhlRLSetString(rlist,NhlNwkMetaName,"./ti01c.ncgm"); NhlCreate(&wid,"ti01Work",NhlncgmWorkstationClass, NhlDEFAULT_APP,rlist); } if (!strcmp(wks_type,"x11") || !strcmp(wks_type,"X11")) { /* * Create an X11 workstation. */ NhlRLClear(rlist); NhlRLSetInteger(rlist,NhlNwkPause,True); NhlCreate(&wid,"ti01Work",NhlcairoWindowWorkstationClass, NhlDEFAULT_APP,rlist); } else if (!strcmp(wks_type,"oldps") || !strcmp(wks_type,"OLDPS")) { /* * Create an older-style PostScript workstation. */ NhlRLClear(rlist); NhlRLSetString(rlist,NhlNwkPSFileName,"ti01c.ps"); NhlCreate(&wid,"ti01Work",NhlpsWorkstationClass, NhlDEFAULT_APP,rlist); } else if (!strcmp(wks_type,"oldpdf") || !strcmp(wks_type,"OLDPDF")) { /* * Create an older-style PDF workstation. */ NhlRLClear(rlist); NhlRLSetString(rlist,NhlNwkPDFFileName,"ti01c.pdf"); NhlCreate(&wid,"ti01Work",NhlpdfWorkstationClass, NhlDEFAULT_APP,rlist); } else if (!strcmp(wks_type,"pdf") || !strcmp(wks_type,"PDF") || !strcmp(wks_type,"ps") || !strcmp(wks_type,"PS")) { /* * Create a cairo PS/PDF Workstation object. */ NhlRLClear(rlist); NhlRLSetString(rlist,NhlNwkFileName,"ti01c"); NhlRLSetString(rlist,NhlNwkFormat,(char*)wks_type); NhlCreate(&wid,"ti01Work",NhlcairoDocumentWorkstationClass, NhlDEFAULT_APP,rlist); } else if (!strcmp(wks_type,"png") || !strcmp(wks_type,"PNG")) { /* * Create a cairo PNG Workstation object. */ NhlRLClear(rlist); NhlRLSetString(rlist,NhlNwkFileName,"ti01c"); NhlRLSetString(rlist,NhlNwkFormat,(char*)wks_type); NhlCreate(&wid,"ti01Work",NhlcairoImageWorkstationClass, NhlDEFAULT_APP,rlist); } /* * Specify the viewport extent of the object. */ NhlRLClear(rlist); NhlRLSetFloat(rlist,NhlNvpXF,.2); NhlRLSetFloat(rlist,NhlNvpYF,.8); NhlRLSetFloat(rlist,NhlNvpWidthF,.6); NhlRLSetFloat(rlist,NhlNvpHeightF,.6); NhlCreate(&pid,"Titles",NhltitleClass,wid,rlist); NhlDraw(pid); NhlFrame(wid); NhlDestroy(pid); NhlDestroy(wid); NhlDestroy(appid); NhlClose(); exit(0); }
/* kbhit() and getch() for Linux/UNIX Chris Giese <geezer@execpc.com> http://my.execpc.com/~geezer */ //#ifdef linux #include <sys/time.h> /* struct timeval, select() */ #include <termios.h> /* tcgetattr(), tcsetattr() */ #include <stdlib.h> /* atexit(), exit() */ #include <unistd.h> /* read() */ #include <stdio.h> /* printf() */ #include <string.h> /* memcpy() */ #define CLEARSCR "clear" static struct termios g_old_kbd_mode; /*****************************************************************************/ static void cooked(void) { tcsetattr(0, TCSANOW, &g_old_kbd_mode); } static void raw(void) { static char init; /**/ struct termios new_kbd_mode; if(init) return; /* put keyboard (stdin, actually) in raw, unbuffered mode */ tcgetattr(0, &g_old_kbd_mode); memcpy(&new_kbd_mode, &g_old_kbd_mode, sizeof(struct termios)); new_kbd_mode.c_lflag &= ~(ICANON | ECHO); new_kbd_mode.c_cc[VTIME] = 0; new_kbd_mode.c_cc[VMIN] = 1; tcsetattr(0, TCSANOW, &new_kbd_mode); /* when we exit, go back to normal, "cooked" mode */ atexit(cooked); init = 1; } /*****************************************************************************/ /* SLEEP */ /*****************************************************************************/ void Sleep(int t) { usleep( t*1000 ); } /*****************************************************************************/ /* GETCH */ /*****************************************************************************/ int getch(void) { unsigned char temp; raw(); /* stdin = fd 0 */ if(read(0, &temp, 1) != 1) return 0; return temp; } /*****************************************************************************/ /* KBHIT */ /*****************************************************************************/ int kbhit() { struct timeval timeout; fd_set read_handles; int status; raw(); /* check stdin (fd 0) for activity */ FD_ZERO(&read_handles); FD_SET(0, &read_handles); timeout.tv_sec = timeout.tv_usec = 0; status = select(0 + 1, &read_handles, NULL, NULL, &timeout); if(status < 0) { printf("select() failed in kbhit()\n"); exit(1); } return (status); } //#else // Windows // #include <conio.h> //#define CLEARSCR "cls" //#endif
#ifndef _IXDP2X00_H_ #define _IXDP2X00_H_ #define IXDP2X00_PHYS_CPLD_BASE 0xc7000000 #define IXDP2X00_VIRT_CPLD_BASE 0xfe000000 #define IXDP2X00_CPLD_SIZE 0x00100000 #define IXDP2X00_CPLD_REG(x) \ (volatile unsigned long *)(IXDP2X00_VIRT_CPLD_BASE | x) #define IXDP2400_CPLD_SYSLED IXDP2X00_CPLD_REG(0x0) #define IXDP2400_CPLD_DISP_DATA IXDP2X00_CPLD_REG(0x4) #define IXDP2400_CPLD_CLOCK_SPEED IXDP2X00_CPLD_REG(0x8) #define IXDP2400_CPLD_INT_STAT IXDP2X00_CPLD_REG(0xc) #define IXDP2400_CPLD_REV IXDP2X00_CPLD_REG(0x10) #define IXDP2400_CPLD_SYS_CLK_M IXDP2X00_CPLD_REG(0x14) #define IXDP2400_CPLD_SYS_CLK_N IXDP2X00_CPLD_REG(0x18) #define IXDP2400_CPLD_INT_MASK IXDP2X00_CPLD_REG(0x48) #define IXDP2800_CPLD_INT_STAT IXDP2X00_CPLD_REG(0x0) #define IXDP2800_CPLD_INT_MASK IXDP2X00_CPLD_REG(0x140) #define IXDP2X00_GPIO_I2C_ENABLE 0x02 #define IXDP2X00_GPIO_SCL 0x07 #define IXDP2X00_GPIO_SDA 0x06 #define IXDP2400_SLAVE_ENET_DEVFN 0x18 /* Bus 1 */ #define IXDP2400_MASTER_ENET_DEVFN 0x20 /* Bus 1 */ #define IXDP2400_MEDIA_DEVFN 0x28 /* Bus 1 */ #define IXDP2400_SWITCH_FABRIC_DEVFN 0x30 /* Bus 1 */ #define IXDP2800_SLAVE_ENET_DEVFN 0x20 /* Bus 1 */ #define IXDP2800_MASTER_ENET_DEVFN 0x18 /* Bus 1 */ #define IXDP2800_SWITCH_FABRIC_DEVFN 0x30 /* Bus 1 */ #define IXDP2X00_P2P_DEVFN 0x20 /* Bus 0 */ #define IXDP2X00_21555_DEVFN 0x30 /* Bus 0 */ #define IXDP2X00_SLAVE_NPU_DEVFN 0x28 /* Bus 1 */ #define IXDP2X00_PMC_DEVFN 0x38 /* Bus 1 */ #define IXDP2X00_MASTER_NPU_DEVFN 0x38 /* Bus 1 */ #ifndef __ASSEMBLY__ static inline unsigned int ixdp2x00_master_npu(void) { return !!ixp2000_is_pcimaster(); } void ixdp2x00_init_irq(volatile unsigned long*, volatile unsigned long *, unsigned long); void ixdp2x00_slave_pci_postinit(void); void ixdp2x00_init_machine(void); void ixdp2x00_map_io(void); #endif #endif /*_IXDP2X00_H_ */
#include "sctp_common.h" static void usage(char *progname) { fprintf(stderr, "usage: %s [-r] [-v] stream|seq port\n" "\nWhere:\n\t" "-r After two bindx ADDs, remove one with bindx REM.\n\t" "-v Print context information.\n\t" " The default is to add IPv4 and IPv6 loopback addrs.\n\t" "stream Use SCTP 1-to-1 style or:\n\t" "seq use SCTP 1-to-Many style.\n\t" "port port.\n", progname); exit(1); } int main(int argc, char **argv) { int opt, type, sock, result; struct sockaddr_in ipv4; struct sockaddr_in6 ipv6; unsigned short port; bool rem = false; bool verbose = false; char *context; while ((opt = getopt(argc, argv, "rv")) != -1) { switch (opt) { case 'v': verbose = true; break; case 'r': rem = true; break; default: usage(argv[0]); } } if ((argc - optind) != 2) usage(argv[0]); if (!strcmp(argv[optind], "stream")) type = SOCK_STREAM; else if (!strcmp(argv[optind], "seq")) type = SOCK_SEQPACKET; else usage(argv[0]); port = atoi(argv[optind + 1]); if (!port) usage(argv[0]); if (verbose) { if (getcon(&context) < 0) context = strdup("unavailable"); printf("Process context: %s\n", context); free(context); } sock = socket(PF_INET6, type, IPPROTO_SCTP); if (sock < 0) { perror("socket"); exit(1); } if (verbose) print_context(sock, "Server"); memset(&ipv4, 0, sizeof(struct sockaddr_in)); ipv4.sin_family = AF_INET; ipv4.sin_port = htons(port); ipv4.sin_addr.s_addr = htonl(0x7f000001); result = sctp_bindx(sock, (struct sockaddr *)&ipv4, 1, SCTP_BINDX_ADD_ADDR); if (result < 0) { perror("sctp_bindx ADD - ipv4"); close(sock); exit(1); } if (verbose) printf("sctp_bindx ADD - ipv4\n"); memset(&ipv6, 0, sizeof(struct sockaddr_in6)); ipv6.sin6_family = AF_INET6; ipv6.sin6_port = htons(port); ipv6.sin6_addr = in6addr_loopback; result = sctp_bindx(sock, (struct sockaddr *)&ipv6, 1, SCTP_BINDX_ADD_ADDR); if (result < 0) { perror("sctp_bindx ADD - ipv6"); close(sock); exit(1); } if (verbose) printf("sctp_bindx ADD - ipv6\n"); if (rem) { result = sctp_bindx(sock, (struct sockaddr *)&ipv6, 1, SCTP_BINDX_REM_ADDR); if (result < 0) { perror("sctp_bindx - REM"); close(sock); exit(1); } if (verbose) printf("sctp_bindx REM - ipv6\n"); } close(sock); exit(0); }
// // HTMangeAuthViewController.h // J3Dps // // Created by hadn't on 14-6-1. // Copyright (c) 2014年 hongtao5. All rights reserved. // #import "DrawerViewController.h" @interface HTMangeAuthViewController : DrawerViewController @end
#undef CONFIG_CRYPTO_TGR192
#ifndef FORCINGS_H #define FORCINGS_H #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <structs.h> #include <globals.h> void Forcing_Init(Forcing* forcing); void Forcing_Free(Forcing* forcing); unsigned int PassesOther(Forcing* forcing, double maxtime, ConnData* conninfo); unsigned int PassesBinaryFiles(Forcing* forcing, double maxtime, ConnData* conninfo); unsigned int PassesIrregularBinaryFiles(Forcing* forcing, double maxtime, ConnData* conninfo); unsigned int PassesDatabase(Forcing* forcing, double maxtime, ConnData* conninfo); unsigned int PassesRecurring(Forcing* forcing, double maxtime, ConnData* conninfo); unsigned int PassesDatabase_Irregular(Forcing* forcing, double maxtime, ConnData* conninfo); double NextForcingOther(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingBinaryFiles(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingIrregularBinaryFiles(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingGZBinaryFiles(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingGridCell(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingDatabase(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingRecurring(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); double NextForcingDatabase_Irregular(Link* sys, unsigned int N, Link **my_sys, unsigned int my_N, int* assignments, const GlobalVars * const globals, Forcing* forcing, ConnData* db_connections, const Lookup * const id_to_loc, unsigned int forcing_idx); #endif
#ifndef HEADER_Platform #define HEADER_Platform /* htop - openbsd/Platform.h (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ #include <stdbool.h> #include <sys/types.h> #include "Action.h" #include "BatteryMeter.h" #include "DiskIOMeter.h" #include "Hashtable.h" #include "Meter.h" #include "NetworkIOMeter.h" #include "Process.h" #include "ProcessLocksScreen.h" #include "SignalsPanel.h" #include "generic/gettime.h" #include "generic/hostname.h" #include "generic/uname.h" extern const ProcessField Platform_defaultFields[]; /* see /usr/include/sys/signal.h */ extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; extern const MeterClass* const Platform_meterTypes[]; void Platform_init(void); void Platform_done(void); void Platform_setBindings(Htop_Action* keys); int Platform_getUptime(void); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(void); double Platform_setCPUValues(Meter* this, unsigned int cpu); void Platform_setMemoryValues(Meter* this); void Platform_setSwapValues(Meter* this); char* Platform_getProcessEnv(pid_t pid); char* Platform_getInodeFilename(pid_t pid, ino_t inode); FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid); bool Platform_getDiskIO(DiskIOData* data); bool Platform_getNetworkIO(NetworkIOData* data); void Platform_getBattery(double* percent, ACPresence* isOnAC); static inline void Platform_getHostname(char* buffer, size_t size) { Generic_hostname(buffer, size); } static inline void Platform_getRelease(char** string) { *string = Generic_uname(); } #define PLATFORM_LONG_OPTIONS static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } static inline bool Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { return false; } static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { Generic_gettime_realtime(tv, msec); } static inline void Platform_gettime_monotonic(uint64_t* msec) { Generic_gettime_monotonic(msec); } static inline Hashtable* Platform_dynamicMeters(void) { return NULL; } static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { } static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { } static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { } static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { } static inline Hashtable* Platform_dynamicColumns(void) { return NULL; } static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { } static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { return NULL; } static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { return false; } #endif
#ifndef _TMR1_H #define _TMR1_H /** Section: Included Files */ #include <stdbool.h> #include <stdint.h> /** Section: TMR1 APIs */ void TMR1_Initialize(void); void TMR1_StartTimer(void); void TMR1_Reload(void); void TMR1_ISR(void); #endif // _TMR1_H
/****************************************************************************** $Id$ TextMMS: an ncurses audio player for Linux Copyright (C) 2003 Ben Hoskings <benhoskings@users.sourceforge.net> 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 ******************************************************************************/ #include "state.h" #include "debug.h" const char *err_tostr(state_t state) { static char str[STRLEN_LONG]; switch (state) { case OK: snprintf(str, STRLEN_LONG, "OK"); break; case ERR_NULL: snprintf(str, STRLEN_LONG, "NULL was returned but not expected"); break; case ERR_EMPTY: snprintf(str, STRLEN_LONG, "Structure or path was empty unexpectedly"); break; case ERR_SYNTAX: snprintf(str, STRLEN_LONG, "Invalid syntax"); break; case ERR_EXIST: snprintf(str, STRLEN_LONG, "File did not exist"); break; case ERR_PERMS: snprintf(str, STRLEN_LONG, "File or parent permissions too restrictive"); break; case ERR_FILE: snprintf(str, STRLEN_LONG, "Error while opening or reading file"); break; case ERR_CORRUPT: snprintf(str, STRLEN_LONG, "Corruption encountered within stream"); break; case ERR_FMT: snprintf(str, STRLEN_LONG, "Error within format-specific function"); break; case ERR_SEEK: snprintf(str, STRLEN_LONG, "Error while seeking within file"); break; case ERR_DEC: snprintf(str, STRLEN_LONG, "Error within decoder"); break; case ERR_OUTP: snprintf(str, STRLEN_LONG, "Error within output code"); break; case ERR_THREAD: snprintf(str, STRLEN_LONG, "Thread-related error (e.g. init)"); break; case ERR_AUDIO: snprintf(str, STRLEN_LONG, "Error in audio subsystem (e.g. sound device permissions)"); break; case ERR_AUDIOPROPS: snprintf(str, STRLEN_LONG, "Invalid or unsupported audio properties (e.g. sample rate)"); break; case ERR_NODE: snprintf(str, STRLEN_LONG, "Node wasn't appropriate (e.g. expecting leaf, got branch)"); break; case ERR_BADNODE: snprintf(str, STRLEN_LONG, "Node with corrupted attributes encountered"); break; case ERR_VIS: snprintf(str, STRLEN_LONG, "The specified track (or the first track under this branch) was invisible"); break; case ERR_RULES: snprintf(str, STRLEN_LONG, "Current list rules forbid the playing of those tracks"); break; case ERR_OPEN: snprintf(str, STRLEN_LONG, "Open / start attempted on already opened / started target"); break; case ERR_CLOSE: snprintf(str, STRLEN_LONG, "Close / stop attempted on already closed / stopped target"); break; case ERR_BOUNDS: snprintf(str, STRLEN_LONG, "Value out of legal bounds"); break; case ERR_STATE: snprintf(str, STRLEN_LONG, "The requested action is not possible in the current state"); break; case ERR_NOTBUILT: snprintf(str, STRLEN_LONG, "Code necessary for that action was disabled at compilation"); break; default: snprintf(str, STRLEN_LONG, "Unknown error"); break; } return str; }
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id: sw_i2c.h 17847 2008-06-28 18:10:04Z bagder $ * * Copyright (C) 2006 by Robert Kukla * * 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef _SW_I2C_H #define _SW_I2C_H #define SW_I2C_WRITE 0 #define SW_I2C_READ 1 void sw_i2c_init(void); int sw_i2c_write(unsigned char chip, unsigned char location, unsigned char* buf, int count); int sw_i2c_read (unsigned char chip, unsigned char location, unsigned char* buf, int count); #endif
/* * Copyright (C) 2005-2011 MaNGOS <http://getmangos.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MANGOSSERVER_TEMPSUMMON_H #define MANGOSSERVER_TEMPSUMMON_H #include "Creature.h" #include "ObjectAccessor.h" class TemporarySummon : public Creature { public: explicit TemporarySummon(ObjectGuid summoner = ObjectGuid()); virtual ~TemporarySummon(){}; void Update(uint32 update_diff, uint32 time); void Summon(TempSummonType type, uint32 lifetime); void MANGOS_DLL_SPEC UnSummon(); void SaveToDB(); ObjectGuid const& GetSummonerGuid() const { return m_summoner ; } MANGOS_DLL_SPEC Unit* GetSummoner() const; private: void SaveToDB(uint32, uint8, uint32) // overwrited of Creature::SaveToDB - don't must be called { MANGOS_ASSERT(false); } void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called { MANGOS_ASSERT(false); } TempSummonType m_type; uint32 m_timer; uint32 m_lifetime; ObjectGuid m_summoner; }; #endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2015 Simon Stürz <simon.stuerz@guh.guru> * * * * This file is part of guh. * * * * Guh 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. * * * * Guh 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 guh. If not, see <http://www.gnu.org/licenses/>. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef DEVICECLASSESRESOURCE_H #define DEVICECLASSESRESOURCE_H #include <QObject> #include <QHash> #include "jsontypes.h" #include "restresource.h" #include "httpreply.h" namespace guhserver { class HttpRequest; class DeviceClassesResource : public RestResource { Q_OBJECT public: explicit DeviceClassesResource(QObject *parent = 0); QString name() const override; HttpReply *proccessRequest(const HttpRequest &request, const QStringList &urlTokens) override; private: mutable QHash<DeviceClassId, QPointer<HttpReply>> m_discoverRequests; DeviceClass m_deviceClass; // Process method HttpReply *proccessGetRequest(const HttpRequest &request, const QStringList &urlTokens) override; // Get methods HttpReply *getDeviceClasses(const VendorId &vendorId); HttpReply *getDeviceClass(); HttpReply *getActionTypes(); HttpReply *getActionType(const ActionTypeId &actionTypeId); HttpReply *getStateTypes(); HttpReply *getStateType(const StateTypeId &stateTypeId); HttpReply *getEventTypes(); HttpReply *getEventType(const EventTypeId &eventTypeId); HttpReply *getDiscoverdDevices(const ParamList &discoveryParams); private slots: void devicesDiscovered(const DeviceClassId &deviceClassId, const QList<DeviceDescriptor> deviceDescriptors); }; } #endif // DEVICECLASSESRESOURCE_H
/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir * * Copyright (C) 2003 Red Hat, Inc. * * Licensed under the Academic Free License version 2.0 * * 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 * */ #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents." #endif #ifndef DBUS_ARCH_DEPS_H #define DBUS_ARCH_DEPS_H #include <dbus/dbus-macros.h> DBUS_BEGIN_DECLS #if 1 #define DBUS_HAVE_INT64 1 _DBUS_GNUC_EXTENSION typedef long long dbus_int64_t; _DBUS_GNUC_EXTENSION typedef unsigned long long dbus_uint64_t; #define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION (val##LL)) #define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION (val##ULL)) #else #undef DBUS_HAVE_INT64 #undef DBUS_INT64_CONSTANT #undef DBUS_UINT64_CONSTANT #endif typedef int dbus_int32_t; typedef unsigned int dbus_uint32_t; typedef short dbus_int16_t; typedef unsigned short dbus_uint16_t; /* This is not really arch-dependent, but it's not worth * creating an additional generated header just for this */ #define DBUS_MAJOR_VERSION 1 #define DBUS_MINOR_VERSION 4 #define DBUS_MICRO_VERSION 24 #define DBUS_VERSION_STRING "1.4.24" #define DBUS_VERSION ((1 << 16) | (4 << 8) | (24)) DBUS_END_DECLS #endif /* DBUS_ARCH_DEPS_H */
/* * tcm_sita.h * * SImple Tiler Allocator (SiTA) private structures. * * Author: Ravi Ramachandra <r.ramachandra@ti.com> * * Copyright (C) 2009-2011 Texas Instruments, 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: * * * 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 Texas Instruments Incorporated 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 _TCM_SITA_H #define _TCM_SITA_H #include "tcm.h" /* length between two coordinates */ #define LEN(a, b) ((a) > (b) ? (a) - (b) + 1 : (b) - (a) + 1) enum criteria { CR_MAX_NEIGHS = 0x01, CR_FIRST_FOUND = 0x10, CR_BIAS_HORIZONTAL = 0x20, CR_BIAS_VERTICAL = 0x40, CR_DIAGONAL_BALANCE = 0x80 }; /* nearness to the beginning of the search field from 0 to 1000 */ struct nearness_factor { s32 x; s32 y; }; /* * Statistics on immediately neighboring slots. Edge is the number of * border segments that are also border segments of the scan field. Busy * refers to the number of neighbors that are occupied. */ struct neighbor_stats { u16 edge; u16 busy; }; /* structure to keep the score of a potential allocation */ struct score { struct nearness_factor f; struct neighbor_stats n; struct tcm_area a; u16 neighs; /* number of busy neighbors */ }; struct sita_pvt { spinlock_t lock; /* spinlock to protect access */ struct tcm_pt div_pt; /* divider point splitting container */ struct tcm_area ***map; /* pointers to the parent area for each slot */ }; /* assign coordinates to area */ static inline void assign(struct tcm_area *a, u16 x0, u16 y0, u16 x1, u16 y1) { a->p0.x = x0; a->p0.y = y0; a->p1.x = x1; a->p1.y = y1; } #endif
/* * The ManaPlus Client * Copyright (C) 2011-2015 The ManaPlus Developers * * This file is part of The ManaPlus Client. * * 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 * 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/>. */ #ifndef NET_MAPHANDLER_H #define NET_MAPHANDLER_H #ifdef EATHENA_SUPPORT #include <string> #include "localconsts.h" namespace Net { class MapHandler notfinal { public: virtual ~MapHandler() { } }; } // namespace Net extern Net::MapHandler *mapHandler; #endif // EATHENA_SUPPORT #endif // NET_MAPHANDLER_H
/* * Matroska common data * Copyright (c) 2003-2004 The ffmpeg Project * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "matroska.h" const CodecTags ff_mkv_codec_tags[]={ {"A_AAC" , CODEC_ID_AAC}, {"A_AC3" , CODEC_ID_AC3}, {"A_DTS" , CODEC_ID_DTS}, {"A_EAC3" , CODEC_ID_EAC3}, {"A_FLAC" , CODEC_ID_FLAC}, {"A_MPEG/L2" , CODEC_ID_MP2}, {"A_MPEG/L1" , CODEC_ID_MP2}, {"A_MPEG/L3" , CODEC_ID_MP3}, {"A_PCM/FLOAT/IEEE" , CODEC_ID_PCM_F32LE}, {"A_PCM/FLOAT/IEEE" , CODEC_ID_PCM_F64LE}, {"A_PCM/INT/BIG" , CODEC_ID_PCM_S16BE}, {"A_PCM/INT/BIG" , CODEC_ID_PCM_S24BE}, {"A_PCM/INT/BIG" , CODEC_ID_PCM_S32BE}, {"A_PCM/INT/LIT" , CODEC_ID_PCM_S16LE}, {"A_PCM/INT/LIT" , CODEC_ID_PCM_S24LE}, {"A_PCM/INT/LIT" , CODEC_ID_PCM_S32LE}, {"A_PCM/INT/LIT" , CODEC_ID_PCM_U8}, {"A_QUICKTIME/QDM2" , CODEC_ID_QDM2}, {"A_REAL/14_4" , CODEC_ID_RA_144}, {"A_REAL/28_8" , CODEC_ID_RA_288}, {"A_REAL/ATRC" , CODEC_ID_ATRAC3}, {"A_REAL/COOK" , CODEC_ID_COOK}, // {"A_REAL/SIPR" , CODEC_ID_SIPRO}, {"A_TTA1" , CODEC_ID_TTA}, {"A_VORBIS" , CODEC_ID_VORBIS}, {"A_WAVPACK4" , CODEC_ID_WAVPACK}, {"S_TEXT/UTF8" , CODEC_ID_TEXT}, {"S_TEXT/ASCII" , CODEC_ID_TEXT}, {"S_TEXT/ASS" , CODEC_ID_SSA}, {"S_TEXT/SSA" , CODEC_ID_SSA}, {"S_ASS" , CODEC_ID_SSA}, {"S_SSA" , CODEC_ID_SSA}, {"S_VOBSUB" , CODEC_ID_DVD_SUBTITLE}, {"V_DIRAC" , CODEC_ID_DIRAC}, {"V_MJPEG" , CODEC_ID_MJPEG}, {"V_MPEG1" , CODEC_ID_MPEG1VIDEO}, {"V_MPEG2" , CODEC_ID_MPEG2VIDEO}, {"V_MPEG4/ISO/ASP" , CODEC_ID_MPEG4}, {"V_MPEG4/ISO/AP" , CODEC_ID_MPEG4}, {"V_MPEG4/ISO/SP" , CODEC_ID_MPEG4}, {"V_MPEG4/ISO/AVC" , CODEC_ID_H264}, {"V_MPEG4/MS/V3" , CODEC_ID_MSMPEG4V3}, {"V_REAL/RV10" , CODEC_ID_RV10}, {"V_REAL/RV20" , CODEC_ID_RV20}, {"V_REAL/RV30" , CODEC_ID_RV30}, {"V_REAL/RV40" , CODEC_ID_RV40}, {"V_SNOW" , CODEC_ID_SNOW}, {"V_THEORA" , CODEC_ID_THEORA}, {"V_UNCOMPRESSED" , CODEC_ID_RAWVIDEO}, {"" , CODEC_ID_NONE} }; const CodecMime ff_mkv_mime_tags[] = { {"text/plain" , CODEC_ID_TEXT}, {"image/gif" , CODEC_ID_GIF}, {"image/jpeg" , CODEC_ID_MJPEG}, {"image/png" , CODEC_ID_PNG}, {"image/tiff" , CODEC_ID_TIFF}, {"application/x-truetype-font", CODEC_ID_TTF}, {"application/x-font" , CODEC_ID_TTF}, {"" , CODEC_ID_NONE} };
/* * arch/ppc/boot/include/sandpoint_serial.h * * Location of the COM ports on Motorola SPS Sandpoint machines * * Author: Mark A. Greer * mgreer@mvista.com * * Copyright 2001 MontaVista 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. */ #define COM1 0xfe0003f8 #define COM2 0xfe0002f8 #define COM3 0x00000000 /* No COM3 */ #define COM4 0x00000000 /* No COM4 */
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of PySide2. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef OTHEROBJECTTYPE_H #define OTHEROBJECTTYPE_H #include <list> #include "str.h" #include "libothermacros.h" #include "objecttype.h" #include "collector.h" class OtherObjectType : public ObjectType { public: }; LIBOTHER_API Collector& operator<<(Collector&, const OtherObjectType&); #endif // OTHEROBJECTTYPE_H
// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id$ // // Copyright (C) 1993-1996 by 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 // // DESCRIPTION: // Refresh/render internal state variables (global). // //----------------------------------------------------------------------------- #ifndef __R_STATE__ #define __R_STATE__ // Need data structure definitions. #include "d_player.h" #include "r_data.h" // // Refresh internal data structures, // for rendering. // // needed for texture pegging extern fixed_t *textureheight; // needed for pre rendering (fracs) extern fixed_t *spritewidth; extern fixed_t *spriteoffset; extern fixed_t *spritetopoffset; extern lighttable_t **colormaps; // killough 3/20/98, 4/4/98 extern lighttable_t *fullcolormap; // killough 3/20/98 extern int viewwidth; extern int scaledviewwidth; extern int viewheight; extern int scaledviewheight; // killough 11/98 extern int firstflat; // for global animation extern int *flattranslation; extern int *texturetranslation; // Sprite.... extern int firstspritelump; extern int lastspritelump; extern int numspritelumps; // // Lookup tables for map data. // extern int numsprites; extern spritedef_t *sprites; extern int numvertexes; extern vertex_t *vertexes; extern int numsegs; extern seg_t *segs; extern int numsectors; extern sector_t *sectors; extern int numsubsectors; extern subsector_t *subsectors; extern int numnodes; extern node_t *nodes; extern int numlines; extern line_t *lines; extern int numsides; extern side_t *sides; // // POV data. // extern fixed_t viewx; extern fixed_t viewy; extern fixed_t viewz; extern angle_t viewangle; extern player_t *viewplayer; extern angle_t clipangle; extern int viewangletox[FINEANGLES/2]; extern angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98 extern fixed_t rw_distance; extern angle_t rw_normalangle; // angle to line origin extern int rw_angle1; // Segs count? extern int sscount; extern visplane_t *floorplane; extern visplane_t *ceilingplane; #endif //---------------------------------------------------------------------------- // // $Log$ // Revision 1.2 2000-08-12 21:29:30 fraggle // change license header // // Revision 1.1.1.1 2000/07/29 13:20:41 fraggle // imported sources // // Revision 1.6 1998/05/01 14:49:12 killough // beautification // // Revision 1.5 1998/04/06 04:40:54 killough // Make colormaps completely dynamic // // Revision 1.4 1998/03/23 03:39:48 killough // Add support for arbitrary number of colormaps // // Revision 1.3 1998/02/09 03:23:56 killough // Change array decl to use MAX screen width/height // // Revision 1.2 1998/01/26 19:27:47 phares // First rev with no ^Ms // // Revision 1.1.1.1 1998/01/19 14:03:09 rand // Lee's Jan 19 sources // // //----------------------------------------------------------------------------
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * * Copyright (C) 2007 by Rostilav Checkan * $Id: qwpsdrawer.h 18464 2008-09-08 21:00:29Z Domonoky $ * * 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef WPSDRAWER_H #define WPSDRAWER_H #include <QWidget> #include <QPixmap> #include <QPointer> #include <QTemporaryFile> #include <QMap> #include "wpsstate.h" struct proxy_api; class QWpsState; class QTrackState; typedef int (*pfwps_init)(const char* buff,struct proxy_api *api, bool isfile); typedef int (*pfwps_display)(); typedef int (*pfwps_refresh)(); typedef const char* (*pfget_model_name)(); class QWpsDrawer : public QWidget { Q_OBJECT pfwps_init lib_wps_init; pfwps_display lib_wps_display; pfwps_refresh lib_wps_refresh; pfget_model_name lib_get_model_name; static QPixmap *pix; static QImage backdrop; QWpsState *wpsState; QTrackState *trackState; bool showGrid; bool mResolved; QString mWpsString; QString mCurTarget; static QString mTmpWpsString; struct lib_t { QString target_name; QString lib; }; QMap<int, lib_t> libs_array; protected: virtual void paintEvent(QPaintEvent * event); virtual void closeEvent(QCloseEvent *event); virtual void mouseReleaseEvent ( QMouseEvent * event ) ; void drawBackdrop(); void newTempWps(); void cleanTemp(bool fileToo=true); bool tryResolve(); QString getModelName(QString libraryName); public: QWpsDrawer(QWpsState *ws,QTrackState *ms, QWidget *parent=0); ~QWpsDrawer(); void WpsInit(QString buffer, bool isFile = true); QString wpsString() const { return mWpsString; }; QString tempWps() const { return mTmpWpsString; }; QList<QString> getTargets(); bool setTarget(QString target); static proxy_api api; /***********Drawing api******************/ static void putsxy(int x, int y, const unsigned char *str); static void transparent_bitmap_part(const void *src, int src_x, int src_y, int stride, int x, int y, int width, int height); static void bitmap_part(const void *src, int src_x, int src_y, int stride, int x, int y, int width, int height); static void drawpixel(int x, int y); static void fillrect(int x, int y, int width, int height); static void hline(int x1, int x2, int y); static void vline(int x, int y1, int y2); static void clear_viewport(int x,int y,int w,int h, int color); static bool load_wps_backdrop(char* filename); static int read_bmp_file(const char* filename,int *width, int *height); /****************************************/ public slots: void slotSetVolume(); void slotSetProgress(); void slotShowGrid(bool); void slotWpsStateChanged(wpsstate); void slotTrackStateChanged(trackstate); void slotSetAudioStatus(int); }; #endif
/* * No nick changes in channel UnrealIRCd Module (Channel Mode +N) * (C) Copyright 2014 Travis McArthur (Heero) and the UnrealIRCd team * * 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include "struct.h" #include "common.h" #include "sys.h" #include "numeric.h" #include "msg.h" #include "proto.h" #include "channel.h" #include <time.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _WIN32 #include <io.h> #endif #include <fcntl.h> #include "h.h" #ifdef _WIN32 #include "version.h" #endif ModuleHeader MOD_HEADER(nonickchange) = { "chanmodes/nonickchange", "$Id$", "Channel Mode +N", "3.2-b8-1", NULL }; Cmode_t EXTCMODE_NONICKCHANGE; #define IsNoNickChange(chptr) (chptr->mode.extmode & EXTCMODE_NONICKCHANGE) DLLFUNC int nonickchange_check (aClient *sptr, aChannel *chptr); DLLFUNC int MOD_TEST(nonickchange)(ModuleInfo *modinfo) { return MOD_SUCCESS; } DLLFUNC int MOD_INIT(nonickchange)(ModuleInfo *modinfo) { CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; req.flag = 'N'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NONICKCHANGE); HookAddEx(modinfo->handle, HOOKTYPE_CHAN_PERMIT_NICK_CHANGE, nonickchange_check); MARK_AS_OFFICIAL_MODULE(modinfo); return MOD_SUCCESS; } DLLFUNC int MOD_LOAD(nonickchange)(int module_load) { return MOD_SUCCESS; } DLLFUNC int MOD_UNLOAD(nonickchange)(int module_unload) { return MOD_SUCCESS; } DLLFUNC int nonickchange_check (aClient *sptr, aChannel *chptr) { if (!IsOper(sptr) && !IsULine(sptr) && IsNoNickChange(chptr) && !is_chanownprotop(sptr, chptr)) return HOOK_DENY; return HOOK_ALLOW; }
/** * * Tennix! SDL Port * Copyright (C) 2003, 2007, 2008, 2009 Thomas Perl <thp@thpinfo.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. * **/ #include "tennix.h" #include "input.h" static char joystick_help[100]; void wait_keypress() { SDL_Event e; unsigned char done = 0; SDL_Delay( 100); /* clean up all events */ while( SDL_PollEvent( &e)); while( !done) { if( SDL_PollEvent( &e)) { done = (e.type == SDL_KEYUP || e.type == SDL_MOUSEBUTTONUP); } else { SDL_Delay( 50); } } } void init_joystick() { SDL_JoystickEventState(SDL_ENABLE); } void uninit_joystick() { SDL_JoystickEventState(SDL_IGNORE); } void joystick_list() { int i, n; n = SDL_NumJoysticks(); for (i=0; i<n; i++) { printf("Joystick %d: %s (use with: --joystick \"%s\")\n", i+1, SDL_JoystickName(i), SDL_JoystickName(i)); } } int joystick_open(const char* name) { int i, n; n = SDL_NumJoysticks(); for (i=0; i<n; i++) { if (strcmp(SDL_JoystickName(i), name) == 0) { SDL_JoystickOpen(i); sprintf(joystick_help, "joystick enabled: %s", name); return 1; } } return 0; } char* get_joystick_help() { if (strcmp(joystick_help, "") == 0) { return "no joystick (enable with --joystick)"; } else { return joystick_help; } }
/* * Copyright (C) 2006-2011 B.A.T.M.A.N. contributors: * * Simon Wunderlich, Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * 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 "main.h" #include "bitarray.h" #include <linux/bitops.h> /* returns true if the corresponding bit in the given seq_bits indicates true * and curr_seqno is within range of last_seqno */ int get_bit_status(const unsigned long *seq_bits, uint32_t last_seqno, uint32_t curr_seqno) { int32_t diff, word_offset, word_num; diff = last_seqno - curr_seqno; if (diff < 0 || diff >= TQ_LOCAL_WINDOW_SIZE) { return 0; } else { /* which word */ word_num = (last_seqno - curr_seqno) / WORD_BIT_SIZE; /* which position in the selected word */ word_offset = (last_seqno - curr_seqno) % WORD_BIT_SIZE; if (test_bit(word_offset, &seq_bits[word_num])) return 1; else return 0; } } /* turn corresponding bit on, so we can remember that we got the packet */ void bit_mark(unsigned long *seq_bits, int32_t n) { int32_t word_offset, word_num; /* if too old, just drop it */ if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE) return; /* which word */ word_num = n / WORD_BIT_SIZE; /* which position in the selected word */ word_offset = n % WORD_BIT_SIZE; set_bit(word_offset, &seq_bits[word_num]); /* turn the position on */ } /* shift the packet array by n places. */ static void bit_shift(unsigned long *seq_bits, int32_t n) { int32_t word_offset, word_num; int32_t i; if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE) return; word_offset = n % WORD_BIT_SIZE;/* shift how much inside each word */ word_num = n / WORD_BIT_SIZE; /* shift over how much (full) words */ for (i = NUM_WORDS - 1; i > word_num; i--) { /* going from old to new, so we don't overwrite the data we copy * from. * * left is high, right is low: FEDC BA98 7654 3210 * ^^ ^^ * vvvv * ^^^^ = from, vvvvv =to, we'd have word_num==1 and * word_offset==WORD_BIT_SIZE/2 ????? in this example. * (=24 bits) * * our desired output would be: 9876 5432 1000 0000 * */ seq_bits[i] = (seq_bits[i - word_num] << word_offset) + /* take the lower port from the left half, shift it left * to its final position */ (seq_bits[i - word_num - 1] >> (WORD_BIT_SIZE-word_offset)); /* and the upper part of the right half and shift it left to * it's position */ /* for our example that would be: word[0] = 9800 + 0076 = * 9876 */ } /* now for our last word, i==word_num, we only have the it's "left" * half. that's the 1000 word in our example.*/ seq_bits[i] = (seq_bits[i - word_num] << word_offset); /* pad the rest with 0, if there is anything */ i--; for (; i >= 0; i--) seq_bits[i] = 0; } static void bit_reset_window(unsigned long *seq_bits) { int i; for (i = 0; i < NUM_WORDS; i++) seq_bits[i] = 0; } /* receive and process one packet within the sequence number window. * * returns: * 1 if the window was moved (either new or very old) * 0 if the window was not moved/shifted. */ int bit_get_packet(void *priv, unsigned long *seq_bits, int32_t seq_num_diff, int set_mark) { struct bat_priv *bat_priv = priv; /* sequence number is slightly older. We already got a sequence number * higher than this one, so we just mark it. */ if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) { if (set_mark) bit_mark(seq_bits, -seq_num_diff); return 0; } /* sequence number is slightly newer, so we shift the window and * set the mark if required */ if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) { bit_shift(seq_bits, seq_num_diff); if (set_mark) bit_mark(seq_bits, 0); return 1; } /* sequence number is much newer, probably missed a lot of packets */ if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) || (seq_num_diff < EXPECTED_SEQNO_RANGE)) { bat_dbg(DBG_BATMAN, bat_priv, "We missed a lot of packets (%i) !\n", seq_num_diff - 1); bit_reset_window(seq_bits); if (set_mark) bit_mark(seq_bits, 0); return 1; } /* received a much older packet. The other host either restarted * or the old packet got delayed somewhere in the network. The * packet should be dropped without calling this function if the * seqno window is protected. */ if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) || (seq_num_diff >= EXPECTED_SEQNO_RANGE)) { bat_dbg(DBG_BATMAN, bat_priv, "Other host probably restarted!\n"); bit_reset_window(seq_bits); if (set_mark) bit_mark(seq_bits, 0); return 1; } /* never reached */ return 0; } /* count the hamming weight, how many good packets did we receive? just count * the 1's. */ int bit_packet_count(const unsigned long *seq_bits) { int i, hamming = 0; for (i = 0; i < NUM_WORDS; i++) hamming += hweight_long(seq_bits[i]); return hamming; }
// Copyright (C) 2003 Dennis Syrovatsky. All Rights Reserved. // // This file is part of the VNC system. // // The VNC system 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. // // TightVNC distribution homepage on the Web: http://www.tightvnc.com/ // // If the source code for the VNC system is not available from the place // whence you received this file, check http://www.uk.research.att.com/vnc or contact // the authors on vnc@uk.research.att.com for information on obtaining it. #if !defined(FILETRANSFERITEMINFO_H) #define FILETRANSFERITEMINFO_H #include "windows.h" typedef struct tagFTITEMINFO { char Name[MAX_PATH]; unsigned int Size; unsigned int Data; } FTITEMINFO; typedef struct tagFTSIZEDATA { unsigned int size; unsigned int data; } FTSIZEDATA; class FileTransferItemInfo { public: int GetNumEntries(); char * GetNameAt(int Number); unsigned int GetSizeAt(int Number); unsigned int GetDataAt(int Number); void Free(); void Add(char *Name, unsigned int Size, unsigned int Data); int GetSummaryNamesLength(); FileTransferItemInfo(); virtual ~FileTransferItemInfo(); private: FTITEMINFO * m_pEntries; int m_NumEntries; }; #endif // !defined(FILETRANSFERITEMINFO_H)
/* * Copyright 2008 Cisco Systems, Inc. All rights reserved. * Copyright 2007 Nuova Systems, Inc. All rights reserved. * * [Insert appropriate license here when releasing outside of Cisco] * This program is free software; you may 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. * * 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. * */ #ident "$Id: vnic_cq.c 18893 2008-09-25 02:03:16Z gsapozhnikov $" #include <linux/kernel.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/pci.h> #ifndef NOT_FOR_UPSTREAM_KERNEL #include "kcompat.h" #endif #include "vnic_dev.h" #include "vnic_cq.h" int vnic_cq_mem_size(struct vnic_cq *cq, unsigned int desc_count, unsigned int desc_size) { int mem_size; mem_size = vnic_dev_desc_ring_size(&cq->ring, desc_count, desc_size); return mem_size; } void vnic_cq_free(struct vnic_cq *cq) { vnic_dev_free_desc_ring(cq->vdev, &cq->ring); cq->ctrl = NULL; } int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index, unsigned int desc_count, unsigned int desc_size) { int err; cq->index = index; cq->vdev = vdev; cq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_CQ, index); if (!cq->ctrl) { printk(KERN_ERR "Failed to hook CQ[%d] resource\n", index); return -EINVAL; } err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size); if (err) return err; return 0; } void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, unsigned int color_enable, unsigned int cq_head, unsigned int cq_tail, unsigned int cq_tail_color, unsigned int interrupt_enable, unsigned int cq_entry_enable, unsigned int cq_message_enable, unsigned int interrupt_offset, u64 cq_message_addr) { u64 paddr; paddr = (u64)cq->ring.base_addr | VNIC_PADDR_TARGET; writeq(paddr, &cq->ctrl->ring_base); iowrite32(cq->ring.desc_count, &cq->ctrl->ring_size); iowrite32(flow_control_enable, &cq->ctrl->flow_control_enable); iowrite32(color_enable, &cq->ctrl->color_enable); iowrite32(cq_head, &cq->ctrl->cq_head); iowrite32(cq_tail, &cq->ctrl->cq_tail); iowrite32(cq_tail_color, &cq->ctrl->cq_tail_color); iowrite32(interrupt_enable, &cq->ctrl->interrupt_enable); iowrite32(cq_entry_enable, &cq->ctrl->cq_entry_enable); iowrite32(cq_message_enable, &cq->ctrl->cq_message_enable); iowrite32(interrupt_offset, &cq->ctrl->interrupt_offset); writeq(cq_message_addr, &cq->ctrl->cq_message_addr); } void vnic_cq_clean(struct vnic_cq *cq) { cq->to_clean = 0; cq->last_color = 0; iowrite32(0, &cq->ctrl->cq_head); iowrite32(0, &cq->ctrl->cq_tail); iowrite32(1, &cq->ctrl->cq_tail_color); vnic_dev_clear_desc_ring(&cq->ring); }
#include "seq_oss_writeq.h" #include "seq_oss_event.h" #include "seq_oss_timer.h" #include <sound/seq_oss_legacy.h> #include "../seq_lock.h" #include "../seq_clientmgr.h" #include <linux/wait.h> #include <linux/slab.h> struct seq_oss_writeq * snd_seq_oss_writeq_new(struct seq_oss_devinfo *dp, int maxlen) { struct seq_oss_writeq *q; struct snd_seq_client_pool pool; if ((q = kzalloc(sizeof(*q), GFP_KERNEL)) == NULL) return NULL; q->dp = dp; q->maxlen = maxlen; spin_lock_init(&q->sync_lock); q->sync_event_put = 0; q->sync_time = 0; init_waitqueue_head(&q->sync_sleep); memset(&pool, 0, sizeof(pool)); pool.client = dp->cseq; pool.output_pool = maxlen; pool.output_room = maxlen / 2; snd_seq_oss_control(dp, SNDRV_SEQ_IOCTL_SET_CLIENT_POOL, &pool); return q; } void snd_seq_oss_writeq_delete(struct seq_oss_writeq *q) { if (q) { snd_seq_oss_writeq_clear(q); /* to be sure */ kfree(q); } } void snd_seq_oss_writeq_clear(struct seq_oss_writeq *q) { struct snd_seq_remove_events reset; memset(&reset, 0, sizeof(reset)); reset.remove_mode = SNDRV_SEQ_REMOVE_OUTPUT; /* remove all */ snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_REMOVE_EVENTS, &reset); /* wake up sleepers if any */ snd_seq_oss_writeq_wakeup(q, 0); } int snd_seq_oss_writeq_sync(struct seq_oss_writeq *q) { struct seq_oss_devinfo *dp = q->dp; abstime_t time; time = snd_seq_oss_timer_cur_tick(dp->timer); if (q->sync_time >= time) return 0; /* already finished */ if (! q->sync_event_put) { struct snd_seq_event ev; union evrec *rec; /* put echoback event */ memset(&ev, 0, sizeof(ev)); ev.flags = 0; ev.type = SNDRV_SEQ_EVENT_ECHO; ev.time.tick = time; /* echo back to itself */ snd_seq_oss_fill_addr(dp, &ev, dp->addr.client, dp->addr.port); rec = (union evrec *)&ev.data; rec->t.code = SEQ_SYNCTIMER; rec->t.time = time; q->sync_event_put = 1; snd_seq_kernel_client_enqueue_blocking(dp->cseq, &ev, NULL, 0, 0); } wait_event_interruptible_timeout(q->sync_sleep, ! q->sync_event_put, HZ); if (signal_pending(current)) /* interrupted - return 0 to finish sync */ q->sync_event_put = 0; if (! q->sync_event_put || q->sync_time >= time) return 0; return 1; } void snd_seq_oss_writeq_wakeup(struct seq_oss_writeq *q, abstime_t time) { unsigned long flags; spin_lock_irqsave(&q->sync_lock, flags); q->sync_time = time; q->sync_event_put = 0; if (waitqueue_active(&q->sync_sleep)) { wake_up(&q->sync_sleep); } spin_unlock_irqrestore(&q->sync_lock, flags); } int snd_seq_oss_writeq_get_free_size(struct seq_oss_writeq *q) { struct snd_seq_client_pool pool; pool.client = q->dp->cseq; snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_GET_CLIENT_POOL, &pool); return pool.output_free; } void snd_seq_oss_writeq_set_output(struct seq_oss_writeq *q, int val) { struct snd_seq_client_pool pool; pool.client = q->dp->cseq; snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_GET_CLIENT_POOL, &pool); pool.output_room = val; snd_seq_oss_control(q->dp, SNDRV_SEQ_IOCTL_SET_CLIENT_POOL, &pool); }
/*************************************************************** * Name: TreeControl.h * Purpose: Header for Graphical User Interface Frame Tree Control * Author: Mandrake (askefc@gmail.com) * Created: 2010-09-13 * Copyright: Mandrake () * License: **************************************************************/ #ifndef TREECONTROL_H #define TREECONTROL_H #include <wx/wxprec.h> #include <wx/wx.h> #include <wx/treectrl.h> #include <wx/event.h> #include <wx/sizer.h> #include <wx/validate.h> #include "ID_Names.h" //#define wxID_MAINTREECTRL 1200 class TreeControl : public wxTreeCtrl { friend class GUIFrame; private: protected: wxTreeItemId TCID_Welcome; wxTreeItemId TCID_Config; wxTreeItemId TCID_Config_Sound_ToneGen; wxTreeItemId TCID_Html; wxTreeItemId TCID_Html_Page; wxTreeItemId TCID_Html_Game; wxTreeItemId TCID_Sound; wxTreeItemId TCID_Sound_ToneGen; wxTreeItemId TCID_Sound_Wave; public: TreeControl (wxWindow* parent, wxWindowID id, wxPoint pos, wxSize size, long style, const wxValidator& validator, wxString name ); ~TreeControl(); }; #endif // TREECONTROL_H
#include <linux/backing-dev.h> #include <linux/mtd/mtd.h> #include "internal.h" struct backing_dev_info mtd_bdi_unmappable = { .capabilities = BDI_CAP_MAP_COPY, }; struct backing_dev_info mtd_bdi_ro_mappable = { .capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT | BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP), }; struct backing_dev_info mtd_bdi_rw_mappable = { .capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT | BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP), };
/* Linux driver for Philips webcam (C) 2004-2006 Luc Saillard (luc@saillard.org) NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx driver and thus may have bugs that are not present in the original version. Please send bug reports and support requests to <luc@saillard.org>. The decompression routines have been implemented by reverse-engineering the Nemosoft binary pwcx module. Caveat emptor. 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 */ /* This tables contains entries for the 675/680/690 (Timon) camera, with 4 different qualities (no compression, low, medium, high). It lists the bandwidth requirements for said mode by its alternate interface number. An alternate of 0 means that the mode is unavailable. There are 6 * 4 * 4 entries: 6 different resolutions subqcif, qsif, qcif, sif, cif, vga 6 framerates: 5, 10, 15, 20, 25, 30 4 compression modi: none, low, medium, high When an uncompressed mode is not available, the next available compressed mode will be chosen (unless the decompressor is absent). Sometimes there are only 1 or 2 compressed modes available; in that case entries are duplicated. */ #ifndef PWC_TIMON_H #define PWC_TIMON_H #include <media/pwc-ioctl.h> #define PWC_FPS_MAX_TIMON 6 struct Timon_table_entry { char alternate; /* USB alternate interface */ unsigned short packetsize; /* Normal packet size */ unsigned short bandlength; /* Bandlength when decompressing */ unsigned char mode[13]; /* precomputed mode settings for cam */ }; extern const struct Timon_table_entry Timon_table[PSZ_MAX][PWC_FPS_MAX_TIMON][4]; extern const unsigned int TimonRomTable [16][2][16][8]; extern const unsigned int Timon_fps_vector[PWC_FPS_MAX_TIMON]; #endif
#include "audioDB/audioDB_API.h" #include "test_utils_lib.h" int main(int argc, char *argv[]) { adb_t *adb; adb_insert_t *batch = 0; adb_status_t status; clean_remove_db(TESTDB); adb = audiodb_create(TESTDB, 0, 0, 0); if(!adb) { return 1; } maketestfile("testfeature01", 2, (double[4]) {0,1,1,0}, 4); maketestfile("testfeature10", 2, (double[4]) {1,0,0,1}, 4); batch = (adb_insert_t *) calloc(6, sizeof(adb_insert_t)); if(!batch) { return 1; } batch[0].features = "testfeature01"; batch[1].features = "testfeature01"; batch[2].features = "testfeature10"; batch[3].features = "testfeature10"; batch[4].features = "testfeature01"; batch[5].features = "testfeature10"; audiodb_batchinsert(adb, batch, 6); free(batch); if(audiodb_status(adb, &status) || status.numFiles != 2) return 1; if(audiodb_l2norm(adb)) return 1; adb_datum_t datum = {1, 2, NULL, (double [2]){0, 0.5}, NULL, NULL}; adb_query_id_t qid = {0}; qid.datum = &datum; qid.sequence_length = 1; adb_query_parameters_t parms = {ADB_ACCUMULATION_PER_TRACK, ADB_DISTANCE_EUCLIDEAN_NORMED, 10, 10}; adb_query_refine_t refine = {0}; adb_query_spec_t spec; spec.qid = qid; spec.params = parms; spec.refine = refine; adb_query_results_t *results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 4) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 0); result_present_or_fail(results, "testfeature01", 2, 0, 1); result_present_or_fail(results, "testfeature10", 0, 0, 1); result_present_or_fail(results, "testfeature10", 2, 0, 0); audiodb_query_free_results(adb, &spec, results); spec.params.npoints = 2; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 4) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 0); result_present_or_fail(results, "testfeature01", 2, 0, 1); result_present_or_fail(results, "testfeature10", 0, 0, 1); result_present_or_fail(results, "testfeature10", 2, 0, 0); audiodb_query_free_results(adb, &spec, results); spec.params.npoints = 5; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 4) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 0); result_present_or_fail(results, "testfeature01", 2, 0, 1); result_present_or_fail(results, "testfeature10", 0, 0, 1); result_present_or_fail(results, "testfeature10", 2, 0, 0); audiodb_query_free_results(adb, &spec, results); spec.params.npoints = 1; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 2) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 0); result_present_or_fail(results, "testfeature10", 0, 0, 1); audiodb_query_free_results(adb, &spec, results); spec.qid.datum->data = (double [2]) {0.5, 0}; spec.params.npoints = 10; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 4) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 1); result_present_or_fail(results, "testfeature01", 2, 0, 0); result_present_or_fail(results, "testfeature10", 0, 0, 0); result_present_or_fail(results, "testfeature10", 2, 0, 1); audiodb_query_free_results(adb, &spec, results); spec.params.npoints = 2; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 4) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 1); result_present_or_fail(results, "testfeature01", 2, 0, 0); result_present_or_fail(results, "testfeature10", 0, 0, 0); result_present_or_fail(results, "testfeature10", 2, 0, 1); audiodb_query_free_results(adb, &spec, results); spec.params.npoints = 5; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 4) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 1); result_present_or_fail(results, "testfeature01", 2, 0, 0); result_present_or_fail(results, "testfeature10", 0, 0, 0); result_present_or_fail(results, "testfeature10", 2, 0, 1); audiodb_query_free_results(adb, &spec, results); spec.params.npoints = 1; results = audiodb_query_spec(adb, &spec); if(!results || results->nresults != 2) return 1; result_present_or_fail(results, "testfeature01", 0, 0, 1); result_present_or_fail(results, "testfeature10", 0, 0, 0); audiodb_query_free_results(adb, &spec, results); audiodb_close(adb); return 104; }
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); ~Widget(); protected: virtual bool event(QEvent *event) override; virtual void timerEvent(QTimerEvent *event) override; virtual void closeEvent(QCloseEvent *event) override; virtual void keyPressEvent(QKeyEvent *event) override; virtual bool eventFilter(QObject *watched, QEvent *event) override; private: Ui::Widget *ui; int timer_id_fast_; int timer_id_slow_; }; #endif // WIDGET_H
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager Wireless Applet -- Display wireless access points and allow user control * * Dan Williams <dcbw@redhat.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. * * (C) Copyright 2004 - 2008 Red Hat, Inc. */ #include <string.h> #include <gnome-keyring-memory.h> #include <nm-setting-vpn.h> #include "keyring-helpers.h" #include "../src/nm-openssh-service.h" #define KEYRING_UUID_TAG "connection-uuid" #define KEYRING_SN_TAG "setting-name" #define KEYRING_SK_TAG "setting-key" char * keyring_helpers_lookup_secret (const char *vpn_uuid, const char *secret_name, gboolean *is_session) { GList *found_list = NULL; GnomeKeyringResult ret; GnomeKeyringFound *found; char *secret; ret = gnome_keyring_find_itemsv_sync (GNOME_KEYRING_ITEM_GENERIC_SECRET, &found_list, KEYRING_UUID_TAG, GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, vpn_uuid, KEYRING_SN_TAG, GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, NM_SETTING_VPN_SETTING_NAME, KEYRING_SK_TAG, GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, secret_name, NULL); if ((ret != GNOME_KEYRING_RESULT_OK) || (g_list_length (found_list) == 0)) return NULL; found = (GnomeKeyringFound *) found_list->data; if (strcmp (found->keyring, "session") == 0) *is_session = TRUE; else *is_session = FALSE; secret = found->secret ? g_strdup (found->secret) : NULL; gnome_keyring_found_list_free (found_list); return secret; } GnomeKeyringResult keyring_helpers_save_secret (const char *vpn_uuid, const char *vpn_name, const char *keyring, const char *secret_name, const char *secret) { char *display_name; GnomeKeyringResult ret; GnomeKeyringAttributeList *attrs = NULL; guint32 id = 0; display_name = g_strdup_printf ("VPN %s secret for %s/%s/" NM_SETTING_VPN_SETTING_NAME, secret_name, vpn_name, NM_DBUS_SERVICE_OPENSSH); attrs = gnome_keyring_attribute_list_new (); gnome_keyring_attribute_list_append_string (attrs, KEYRING_UUID_TAG, vpn_uuid); gnome_keyring_attribute_list_append_string (attrs, KEYRING_SN_TAG, NM_SETTING_VPN_SETTING_NAME); gnome_keyring_attribute_list_append_string (attrs, KEYRING_SK_TAG, secret_name); ret = gnome_keyring_item_create_sync (keyring, GNOME_KEYRING_ITEM_GENERIC_SECRET, display_name, attrs, secret, TRUE, &id); gnome_keyring_attribute_list_free (attrs); g_free (display_name); return ret; } static void ignore_callback (GnomeKeyringResult result, gpointer data) { } gboolean keyring_helpers_delete_secret (const char *vpn_uuid, const char *secret_name) { GList *found = NULL, *iter; GnomeKeyringResult ret; g_return_val_if_fail (vpn_uuid != NULL, FALSE); g_return_val_if_fail (secret_name != NULL, FALSE); ret = gnome_keyring_find_itemsv_sync (GNOME_KEYRING_ITEM_GENERIC_SECRET, &found, KEYRING_UUID_TAG, GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, vpn_uuid, KEYRING_SN_TAG, GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, NM_SETTING_VPN_SETTING_NAME, KEYRING_SK_TAG, GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, secret_name, NULL); if (ret != GNOME_KEYRING_RESULT_OK && ret != GNOME_KEYRING_RESULT_NO_MATCH) return FALSE; if (g_list_length (found) == 0) return TRUE; /* delete them all */ for (iter = found; iter; iter = g_list_next (iter)) { GnomeKeyringFound *item = (GnomeKeyringFound *) iter->data; gnome_keyring_item_delete (item->keyring, item->item_id, ignore_callback, NULL, NULL); } gnome_keyring_found_list_free (found); return TRUE; }
/** ****************************************************************************** * @file USB_Host/DynamicSwitch_Standalone/Src/menu.c * @author MCD Application Team * @version V1.3.1 * @date 09-October-2015 * @brief This file implements MSC Menu Functions ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ MSC_DEMO_StateMachine msc_demo; uint8_t prev_select = 0; uint8_t *MSC_main_menu[] = { (uint8_t *)" 1 - File Operations ", (uint8_t *)" 2 - Explorer Disk ", (uint8_t *)" 3 - Re-Enumerate ", }; /* Private function prototypes -----------------------------------------------*/ static void MSC_SelectItem(uint8_t **menu, uint8_t item); /* Private functions ---------------------------------------------------------*/ /** * @brief Manages MSC Menu Process. * @param None * @retval None */ void MSC_MenuProcess(void) { switch(msc_demo.state) { case MSC_DEMO_IDLE: BSP_LCD_SetTextColor(LCD_COLOR_GREEN); BSP_LCD_DisplayStringAtLine(14, (uint8_t *)" "); BSP_LCD_DisplayStringAtLine(15, (uint8_t *)"Use [Buttons Left/Right] to scroll up/down "); BSP_LCD_DisplayStringAtLine(16, (uint8_t *)"Use [Joystick Up/Down] to scroll MSC menu "); BSP_LCD_SetTextColor(LCD_COLOR_WHITE); MSC_SelectItem(MSC_main_menu, 0); msc_demo.state = MSC_DEMO_WAIT; msc_demo.select = 0; break; case MSC_DEMO_WAIT: if(msc_demo.select != prev_select) { prev_select = msc_demo.select; MSC_SelectItem(MSC_main_menu, msc_demo.select & 0x7F); /* Handle select item */ if(msc_demo.select & 0x80) { switch(msc_demo.select & 0x7F) { case 0: msc_demo.state = MSC_DEMO_FILE_OPERATIONS; break; case 1: msc_demo.state = MSC_DEMO_EXPLORER; break; case 2: msc_demo.state = MSC_REENUMERATE; break; default: break; } } } break; case MSC_DEMO_FILE_OPERATIONS: /* Read and Write File Here */ if(Appli_state == APPLICATION_MSC) { MSC_File_Operations(); } msc_demo.state = MSC_DEMO_WAIT; break; case MSC_DEMO_EXPLORER: /* Display disk content */ if(Appli_state == APPLICATION_MSC) { Explore_Disk("0:/", 1); } msc_demo.state = MSC_DEMO_WAIT; break; case MSC_REENUMERATE: /* Force MSC Device to re-enumerate */ USBH_ReEnumerate(&hUSBHost); msc_demo.state = MSC_DEMO_WAIT; break; default: break; } msc_demo.select &= 0x7F; } /** * @brief Manages the menu on the screen. * @param menu: Menu table * @param item: Selected item to be highlighted * @retval None */ static void MSC_SelectItem(uint8_t **menu, uint8_t item) { BSP_LCD_SetTextColor(LCD_COLOR_WHITE); switch(item) { case 0: BSP_LCD_SetBackColor(LCD_COLOR_MAGENTA); BSP_LCD_DisplayStringAtLine(17, menu[0]); BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_DisplayStringAtLine(18, menu[1]); BSP_LCD_DisplayStringAtLine(19, menu[2]); break; case 1: BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_DisplayStringAtLine(17, menu[0]); BSP_LCD_SetBackColor(LCD_COLOR_MAGENTA); BSP_LCD_DisplayStringAtLine(18, menu[1]); BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_DisplayStringAtLine(19, menu[2]); break; case 2: BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_DisplayStringAtLine(17, menu[0]); BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_DisplayStringAtLine(18, menu[1]); BSP_LCD_SetBackColor(LCD_COLOR_MAGENTA); BSP_LCD_DisplayStringAtLine(19, menu[2]); break; } BSP_LCD_SetBackColor(LCD_COLOR_BLACK); } /** * @brief Probes the MSC joystick state. * @param state: Joystick state * @retval None */ void MSC_DEMO_ProbeKey(JOYState_TypeDef state) { /* Handle Menu inputs */ if((state == JOY_UP) && (msc_demo.select > 0)) { msc_demo.select--; } else if((state == JOY_DOWN) && (msc_demo.select < 2)) { msc_demo.select++; } else if(state == JOY_SEL) { msc_demo.select |= 0x80; } } /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * QEMU IRQ/GPIO common code. * * Copyright (c) 2007 CodeSourcery. * * 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. */ #include "qemu-common.h" #include "irq.h" struct IRQState { qemu_irq_handler handler; void *opaque; int n; }; void qemu_set_irq(qemu_irq irq, int level) { if (!irq) return; irq->handler(irq->opaque, irq->n, level); } void qemu_free_irqs(qemu_irq *s) { qemu_free(s[0]); qemu_free(s); } qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n) { qemu_irq *s; struct IRQState *p; int i; s = (qemu_irq *)qemu_mallocz(sizeof(qemu_irq) * n); p = (struct IRQState *)qemu_mallocz(sizeof(struct IRQState) * n); for (i = 0; i < n; i++) { p->handler = handler; p->opaque = opaque; p->n = i; s[i] = p; p++; } return s; } static void qemu_notirq(void *opaque, int line, int level) { struct IRQState *irq = opaque; irq->handler(irq->opaque, irq->n, !level); } qemu_irq qemu_irq_invert(qemu_irq irq) { /* The default state for IRQs is low, so raise the output now. */ qemu_irq_raise(irq); return qemu_allocate_irqs(qemu_notirq, irq, 1)[0]; }
#ifndef _TC_CBQ_H_ #define _TC_CBQ_H_ 1 unsigned tc_cbq_calc_maxidle(unsigned bndw, unsigned rate, unsigned avpkt, int ewma_log, unsigned maxburst); unsigned tc_cbq_calc_offtime(unsigned bndw, unsigned rate, unsigned avpkt, int ewma_log, unsigned minburst); #endif
#include <console/console.h> #include <arch/smp/mpspec.h> #include <arch/ioapic.h> #include <device/pci.h> #include <string.h> #include <stdint.h> static void *smp_write_config_table(void *v) { static const char sig[4] = "PCMP"; static const char oem[8] = "COREBOOT"; static const char productid[12] = "X6DHR-iG "; struct mp_config_table *mc; unsigned char bus_num; unsigned char bus_isa; unsigned char bus_pxhd_1; unsigned char bus_pxhd_2; unsigned char bus_pxhd_3; unsigned char bus_pxhd_4; unsigned char bus_ich5r_1; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); memset(mc, 0, sizeof(*mc)); memcpy(mc->mpc_signature, sig, sizeof(sig)); mc->mpc_length = sizeof(*mc); /* initially just the header */ mc->mpc_spec = 0x04; mc->mpc_checksum = 0; /* not yet computed */ memcpy(mc->mpc_oem, oem, sizeof(oem)); memcpy(mc->mpc_productid, productid, sizeof(productid)); mc->mpc_oemptr = 0; mc->mpc_oemsize = 0; mc->mpc_entry_count = 0; /* No entries yet... */ mc->mpc_lapic = LAPIC_ADDR; mc->mpe_length = 0; mc->mpe_checksum = 0; mc->reserved = 0; smp_write_processors(mc); { device_t dev; /* ich5r */ dev = dev_find_slot(0, PCI_DEVFN(0x1e,0)); if (dev) { bus_ich5r_1 = pci_read_config8(dev, PCI_SECONDARY_BUS); bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); bus_isa++; } else { printk(BIOS_DEBUG, "ERROR - could not find PCI 0:1e.0, using defaults\n"); bus_ich5r_1 = 7; bus_isa = 8; } /* pxhd-1 */ dev = dev_find_slot(1, PCI_DEVFN(0x0,0)); if (dev) { bus_pxhd_1 = pci_read_config8(dev, PCI_SECONDARY_BUS); } else { printk(BIOS_DEBUG, "ERROR - could not find PCI 1:00.0, using defaults\n"); bus_pxhd_1 = 2; } /* pxhd-2 */ dev = dev_find_slot(1, PCI_DEVFN(0x00,2)); if (dev) { bus_pxhd_2 = pci_read_config8(dev, PCI_SECONDARY_BUS); } else { printk(BIOS_DEBUG, "ERROR - could not find PCI 1:00.2, using defaults\n"); bus_pxhd_2 = 3; } /* pxhd-3 */ dev = dev_find_slot(0, PCI_DEVFN(0x4,0)); if (dev) { bus_pxhd_3 = pci_read_config8(dev, PCI_SECONDARY_BUS); } else { printk(BIOS_DEBUG, "ERROR - could not find PCI 0:04.0, using defaults\n"); bus_pxhd_3 = 5; } /* pxhd-4 */ dev = dev_find_slot(0, PCI_DEVFN(0x06,0)); if (dev) { bus_pxhd_4 = pci_read_config8(dev, PCI_SECONDARY_BUS); } else { printk(BIOS_DEBUG, "ERROR - could not find PCI 0:06.0, using defaults\n"); bus_pxhd_4 = 6; } } /* define bus and isa numbers */ for(bus_num = 0; bus_num < bus_isa; bus_num++) { smp_write_bus(mc, bus_num, "PCI "); } smp_write_bus(mc, bus_isa, "ISA "); /* IOAPIC handling */ smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR); { struct resource *res; device_t dev; /* pxhd apic 3 */ dev = dev_find_slot(1, PCI_DEVFN(0x00,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { smp_write_ioapic(mc, 0x03, 0x20, res->base); } } else { printk(BIOS_DEBUG, "ERROR - could not find IOAPIC PCI 1:00.1\n"); } /* pxhd apic 4 */ dev = dev_find_slot(1, PCI_DEVFN(0x00,3)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { smp_write_ioapic(mc, 0x04, 0x20, res->base); } } else { printk(BIOS_DEBUG, "ERROR - could not find IOAPIC PCI 1:00.3\n"); } } mptable_add_isa_interrupts(mc, bus_isa, 0x2, 0); /* ISA backward compatibility interrupts */ smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x74, 0x02, 0x10); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x76, 0x02, 0x12); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x77, 0x02, 0x17); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x75, 0x02, 0x13); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x74, 0x02, 0x10); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x7c, 0x02, 0x12); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x00, 0x7d, 0x02, 0x11); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, bus_pxhd_1, 0x08, 0x03, 0x00); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, bus_pxhd_1, 0x0c, 0x03, 0x06); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, bus_pxhd_1, 0x0d, 0x03, 0x07); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, bus_pxhd_2, 0x08, 0x04, 0x00); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, bus_ich5r_1, 0x04, 0x02, 0x10); smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, bus_pxhd_4, 0x00, 0x02, 0x10); #if 0 smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, (bus_isa - 1), 0x04, 0x02, 0x10); #endif /* Standard local interrupt assignments */ #if 0 smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x00, MP_APIC_ALL, 0x00); #endif smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x00, MP_APIC_ALL, 0x01); /* There is no extension information... */ /* Compute the checksums */ mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length); mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length); printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n", mc, smp_next_mpe_entry(mc)); return smp_next_mpe_entry(mc); } unsigned long write_smp_table(unsigned long addr) { void *v; v = smp_write_floating_table(addr); return (unsigned long)smp_write_config_table(v); }
#pragma once #include "nwcobj.h" struct NWCInfo { wxString strUser; #pragma pack(push, 1) union { short nVersion; struct { char nVerMinor; char nVerMajor; }; }; #pragma pack(pop) bool bUnregistered; wxString strTitle; wxString strAuthor; wxString strLyricist; // from 2.0 wxString strCopyright1; wxString strCopyright2; wxString strComment; UINT nStaffCount; wxString strKeySignature; wxString strTimeSignature; wxString strLyric; }; class CNWCFile { public: wxString strUser; wxString strUnknown1; #pragma pack(push, 1) union { short nVersion; struct { char nVerMinor; char nVerMajor; }; }; char btUnknown2[4]; #pragma pack(pop) wxString strTitle; wxString strAuthor; wxString strLyricist; // from 2.0 wxString strCopyright1; wxString strCopyright2; wxString strComment; #pragma pack(push, 1) BYTE chExtendLastSystem; // 'Y' or 'N' BYTE chIncreaseNoteSpacing; // 'Y' or 'N' BYTE btUnknown3[5]; BYTE btMeasureNumbers; // index of [None, Plain, Circled, Boxed] BYTE btUnknown4[1]; // 0x00 short nMeasureStart; #pragma pack(pop) wxString strMarginTop; wxString strMarginInside; wxString strMarginOutside; wxString strMarginBottom; #pragma pack(push, 1) BYTE bMirrorMargin; // 0 or 1 BYTE btUnknown5[2]; // btUnknown5[0] = 0x07, 0x08 ? has notation typeface BYTE nGroupVisibility[32]; // 0x01:first group, 0x02:second group BYTE bAllowLayering; // 0x00 or 0xFF wxString strNotationTypeface; short nStaffHeight; #pragma pack(pop) // 10 or 12 fontinfo TVector<CFontInfo> mFontInfos; #pragma pack(push, 1) BYTE btTitlePageInfo; BYTE btStaffLabels; short nStartPageNo; short nStaffCount; #pragma pack(pop) BYTE btJustifyPrintedSystemVertically; // version 2.0 TVector<CStaff*> mStaffs; public: CNWCFile(); ~CNWCFile(); void Init(); DWORD Load(wxFile& in, FILE* out, FILELOAD fl=FILELOAD_ALL); protected: DWORD LoadCompressed(wxFile& in, FILE* out, FILELOAD fl); } ;
/************************************************************************ * IRC - Internet Relay Chat, include/paths.h * This file is copyright (C) 2001 Andrew Suffield * <asuffield@freenode.net> * * 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 */ extern const char *work_dir; extern const char *config_file; extern const char *my_binary; extern const char *motd_file; extern const char *main_log_file; extern const char *user_log_file; extern const char *oper_log_file; extern const char *pid_file; extern const char *oper_help_file; extern const char *oper_motd_file; extern const char *kline_config_file; extern const char *dline_config_file; extern const char *max_client_file; extern const char *hash_log_file_base; extern const char *default_dump_file;
/* created by click/linuxmodule/fixincludes.pl on Tue Nov 25 22:39:43 2014 */ /* from /lib/modules/2.6.27.5-117.fc10.i686/build/include/config/isdn/drv/avmb1/t1pci.h */
/* * TFS4 2.0 File System Developed by Flash Planning Group. * * Copyright 2006-2007 by Memory Division, Samsung Electronics, Inc., * San #16, Banwol-Ri, Taean-Eup, Hwasung-City, Gyeonggi-Do, Korea * * All rights reserved. * * This software is the confidential and proprietary information * of Samsung Electronics, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Samsung. */ /** * @file ess_debug.h * @brief Base modue for FFAT debug * @author DongYoung Seo(dy76.seo@samsung.com) * @version JUL-04-2006 [DongYoung Seo] First writing * @see None */ #ifndef _ESS_DEBUG_H_ #define _ESS_DEBUG_H_ #include "ess_types.h" #include "ess_dlist.h" #ifdef ESS_DEBUG #define ESS_DEBUG_PRT #else #undef ESS_DEBUG_PRT #endif #if defined(CONFIG_RTOS) || defined(CONFIG_WINCE) || defined(CONFIG_SYMBIAN) #ifndef __FUNCTION__ #if (__CC_ARM == 1) #define __FUNCTION__ __func__ // for ARM ADS1.2 #else #define __FUNCTION__ "[]" #endif #endif #endif /*defined(CONFIG_RTOS) || defined(CONFIG_WINCE) || defined(CONFIG_SYMBIAN)*/ #ifdef ESS_DEBUG_PRT #define ESS_ASSERTP(f, msg) ((f) ? ((void)0) : ESS_Assert( __FILE__, __LINE__, msg, __FUNCTION__)) #define ESS_ASSERT(f) ESS_ASSERTP(f, NULL) #define ESS_LOG_PRINTF(msg) ESS_PrintLog((const char*)msg, __FILE__, __LINE__, __FUNCTION__) #define ESS_LOG_PRINTFW(msg) ESS_PrintLogWcs(msg, __FILE__, __LINE__) #define ESS_DEBUG_PRINTF ESS_Printf #define ESS_SRC(msg) ESS_Src(msg, __FILE__, __LINE__, __FUNCTION__) // debug begin #ifdef _RFS_TOOLS #undef ESS_DEBUG_PRINTF #undef ESS_LOG_PRINTF #define ESS_DEBUG_PRINTF printf #define ESS_LOG_PRINTF(msg) printf("[%s:%d]"msg"\n", __FILE__, __LINE__) #endif // debug end #else #define ESS_ASSERTP(f, msg) #define ESS_ASSERT(f) #define ESS_LOG_PRINTF(msg) #define ESS_LOG_PRINTFW(msg) #define ESS_SRC(msg) #define ESS_DEBUG_PRINTF ESS_DebugNullPrintf #endif #if defined(CONFIG_RTOS) || defined(CONFIG_WINCE) || defined(CONFIG_LINUX) #define ESS_ABORT() do{ *(int *)0 = 0; }while(1) #else #define ESS_ABORT() #endif /*defined(CONFIG_RTOS) || defined(CONFIG_WINCE) || defined(CONFIG_LINUX)*/ // for stack check #ifdef ESS_STACK_CHECK #define ESS_STACK_VAR t_uint32 dwStackVar; #define ESS_STACK_BEGIN() ESS_StackStart(&dwStackVar, __FUNCTION__) #define ESS_STACK_END() ESS_StackEnd(&dwStackVar, __FUNCTION__) #ifdef __cplusplus extern "C" { #endif //// __cplusplus extern void ESS_StackShow(void); extern void ESS_StackStart(void *pdwStartAddress, const char *pszMsg); extern void ESS_StackEnd(void *pdwEndAddress, const char *pszMsg); #ifdef __cplusplus }; #endif //// __cplusplus #else #define ESS_STACK_VAR #define ESS_STACK_BEGIN() #define ESS_STACK_END() #endif // s : structure name // t : type, alignment byte // m : member variable name // msg : print message #define ESS_DEBUG_BA_ASSERT(s, t, m, msg) \ EssAssert((( (t_uint32)(&((s*)0)->m) &(sizeof(t) - 1)) == 0), "Invalid byte alignent" msg); typedef struct _EssMemUsageEntry { void* pPtr; // allocated memory pointer t_int32 dwSize; // size of memory EssDList stList; // list for management } EssMemUsageEntry; typedef struct _EssMemUsage { EssDList stAllocList; // allocated list EssDList stFreeList; // free entry list EssMemUsageEntry *pAlloc; t_int32 dwMaxAllocSize; // maximum allocation size t_int32 dwMaxUsagesage; // maximum memory usage } EssMemUsage; #ifdef __cplusplus extern "C" { #endif extern void ESS_DebugInit(t_int32 (*_printf)(const char* pFmt,...), t_int32 (*_get_char)(void)); extern void ESS_Assert(const char* psFileName, t_int32 dwLine, char* pszMsg, const char* strFuncName); extern void ESS_DumpBuffer(t_int8* pBuff, t_int32 dwLength); extern char* ESS_PathStart(const char* psFileName); extern void ESS_PrintLog(const char* msg, const char* strFileName, t_int32 nLineNumber, const char* strFuncName); extern const t_int8* ESS_Src(const char* msg, const char* psFileName, t_int32 nLineNumber, const char* strFuncName); extern void ESS_DumpSector(t_int8* buf); extern t_int32 ESS_Printf(char* pFmt, ...); extern t_int32 ESS_DebugNullPrintf(char* pFmt,...); extern t_int32 ESS_DebugNullGetChar(void); #ifdef __cplusplus }; #endif #endif /* #ifndef _ESS_DEBUG_H_ */
#undef TRACE_SYSTEM #define TRACE_SYSTEM task #if !defined(_TRACE_TASK_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_TASK_H #include <linux/tracepoint.h> TRACE_EVENT(task_newtask, TP_PROTO(struct task_struct *task, unsigned long clone_flags), TP_ARGS(task, clone_flags), TP_STRUCT__entry( __field( pid_t, pid) __array( char, comm, TASK_COMM_LEN) __field( unsigned long, clone_flags) __field( int, oom_score_adj) ), TP_fast_assign( __entry->pid = task->pid; memcpy(__entry->comm, task->comm, TASK_COMM_LEN); __entry->clone_flags = clone_flags; __entry->oom_score_adj = task->signal->oom_score_adj; ), TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%d", __entry->pid, __entry->comm, __entry->clone_flags, __entry->oom_score_adj) ); TRACE_EVENT(task_rename, TP_PROTO(struct task_struct *task, char *comm), TP_ARGS(task, comm), TP_STRUCT__entry( __field( pid_t, pid) __array( char, oldcomm, TASK_COMM_LEN) __array( char, newcomm, TASK_COMM_LEN) __field( int, oom_score_adj) ), TP_fast_assign( __entry->pid = task->pid; memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN); memcpy(entry->newcomm, comm, TASK_COMM_LEN); __entry->oom_score_adj = task->signal->oom_score_adj; ), TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%d", __entry->pid, __entry->oldcomm, __entry->newcomm, __entry->oom_score_adj) ); #endif /* This part must be outside protection */ #include <trace/define_trace.h>
/* * Serial Debugger Interface for exynos * * Copyright (C) 2012 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. */ #include <linux/delay.h> #include <linux/io.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/stacktrace.h> #include <linux/uaccess.h> #include <asm/fiq_debugger.h> #include <plat/regs-serial.h> #include <mach/map.h> struct exynos_fiq_debugger { struct fiq_debugger_pdata pdata; struct platform_device *pdev; void __iomem *debug_port_base; int irq; u32 baud; u32 frac_baud; }; static inline struct exynos_fiq_debugger *get_dbg(struct platform_device *pdev) { struct fiq_debugger_pdata *pdata = dev_get_platdata(&pdev->dev); return container_of(pdata, struct exynos_fiq_debugger, pdata); } static inline void exynos_write(struct exynos_fiq_debugger *dbg, unsigned int val, unsigned int off) { __raw_writel(val, dbg->debug_port_base + off); } static inline unsigned int exynos_read(struct exynos_fiq_debugger *dbg, unsigned int off) { return __raw_readl(dbg->debug_port_base + off); } static int debug_port_init(struct platform_device *pdev) { struct exynos_fiq_debugger *dbg = get_dbg(pdev); unsigned long timeout; exynos_write(dbg, dbg->baud, S3C2410_UBRDIV); exynos_write(dbg, dbg->frac_baud, S3C2443_DIVSLOT); /* Mask and clear all interrupts */ exynos_write(dbg, 0xF, S3C64XX_UINTM); exynos_write(dbg, 0xF, S3C64XX_UINTP); exynos_write(dbg, S3C2410_LCON_CS8, S3C2410_ULCON); exynos_write(dbg, S5PV210_UCON_DEFAULT, S3C2410_UCON); exynos_write(dbg, S5PV210_UFCON_DEFAULT, S3C2410_UFCON); exynos_write(dbg, 0, S3C2410_UMCON); /* Reset TX and RX fifos */ exynos_write(dbg, S5PV210_UFCON_DEFAULT | S3C2410_UFCON_RESETBOTH, S3C2410_UFCON); timeout = jiffies + HZ; while (exynos_read(dbg, S3C2410_UFCON) & S3C2410_UFCON_RESETBOTH) if (time_after(jiffies, timeout)) return -ETIMEDOUT; /* Enable all interrupts except TX */ exynos_write(dbg, S3C64XX_UINTM_TXD_MSK, S3C64XX_UINTM); return 0; } static int debug_getc(struct platform_device *pdev) { struct exynos_fiq_debugger *dbg = get_dbg(pdev); u32 stat; int ret = FIQ_DEBUGGER_NO_CHAR; /* Clear all pending interrupts */ exynos_write(dbg, 0xF, S3C64XX_UINTP); stat = exynos_read(dbg, S3C2410_UERSTAT); if (stat & S3C2410_UERSTAT_BREAK) return FIQ_DEBUGGER_BREAK; stat = exynos_read(dbg, S3C2410_UTRSTAT); if (stat & S3C2410_UTRSTAT_RXDR) ret = exynos_read(dbg, S3C2410_URXH); return ret; } static void debug_putc(struct platform_device *pdev, unsigned int c) { struct exynos_fiq_debugger *dbg = get_dbg(pdev); int count = loops_per_jiffy; if (exynos_read(dbg, S3C2410_ULCON) != S3C2410_LCON_CS8) debug_port_init(pdev); while (exynos_read(dbg, S3C2410_UFSTAT) & S5PV210_UFSTAT_TXFULL) if (--count == 0) return; exynos_write(dbg, c, S3C2410_UTXH); } static void debug_flush(struct platform_device *pdev) { struct exynos_fiq_debugger *dbg = get_dbg(pdev); int count = loops_per_jiffy * HZ; while (!(exynos_read(dbg, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE)) if (--count == 0) return; } static int debug_suspend(struct platform_device *pdev) { struct exynos_fiq_debugger *dbg = get_dbg(pdev); exynos_write(dbg, 0xF, S3C64XX_UINTM); return 0; } static int debug_resume(struct platform_device *pdev) { // struct exynos_fiq_debugger *dbg = get_dbg(pdev); debug_port_init(pdev); return 0; } int exynos_fiq_get_pdata(struct platform_device *pdev, int id) { int ret = -ENOMEM; struct exynos_fiq_debugger *dbg = NULL; if (id >= CONFIG_SERIAL_SAMSUNG_UARTS) return -EINVAL; dbg = kzalloc(sizeof(struct exynos_fiq_debugger), GFP_KERNEL); if (!dbg) { pr_err("exynos_fiq_debugger: failed to allocate fiq debugger\n"); goto err_free; } pdev->id = id; dbg->pdata.uart_init = debug_port_init; dbg->pdata.uart_getc = debug_getc; dbg->pdata.uart_putc = debug_putc; dbg->pdata.uart_flush = debug_flush; dbg->pdata.uart_dev_suspend = debug_suspend; dbg->pdata.uart_dev_resume = debug_resume; dbg->pdev = pdev; dbg->debug_port_base = S3C_VA_UARTx(id); dbg->baud = exynos_read(dbg, S3C2410_UBRDIV); dbg->frac_baud = exynos_read(dbg, S3C2443_DIVSLOT); pdev->dev.platform_data = &dbg->pdata; return 0; err_free: kfree(dbg); return ret; }
/* * arch/arm/mach-ixp4xx/include/mach/gpio.h * * IXP4XX GPIO wrappers for arch-neutral GPIO calls * * Written by Milan Svoboda <msvoboda@ra.rockwell.com> * Based on PXA implementation by Philipp Zabel <philipp.zabel@gmail.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __ASM_ARCH_IXP4XX_GPIO_H #define __ASM_ARCH_IXP4XX_GPIO_H #include <linux/kernel.h> #include <mach/hardware.h> #define __ARM_GPIOLIB_COMPLEX static inline int gpio_request(unsigned gpio, const char *label) { return 0; } static inline void gpio_free(unsigned gpio) { might_sleep(); return; } static inline int gpio_direction_input(unsigned gpio) { gpio_line_config(gpio, IXP4XX_GPIO_IN); return 0; } static inline int gpio_direction_output(unsigned gpio, int level) { gpio_line_set(gpio, level); gpio_line_config(gpio, IXP4XX_GPIO_OUT); return 0; } static inline int gpio_get_value(unsigned gpio) { int value; gpio_line_get(gpio, &value); return value; } static inline void gpio_set_value(unsigned gpio, int value) { gpio_line_set(gpio, value); } #include <asm-generic/gpio.h> /* cansleep wrappers */ extern int gpio_to_irq(int gpio); #define gpio_to_irq gpio_to_irq extern int irq_to_gpio(unsigned int irq); #endif
/**************************************************************************** ** ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** This file may be used under the terms of the GNU General Public ** License versions 2.0 or 3.0 as published by the Free Software ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Alternatively you may (at ** your option) use any later version of the GNU General Public ** License if such license has been publicly approved by Trolltech ASA ** (or its successors, if any) and the KDE Free Qt Foundation. In ** addition, as a special exception, Trolltech gives you certain ** additional rights. These rights are described in the Trolltech GPL ** Exception version 1.2, which can be found at ** http://www.trolltech.com/products/qt/gplexception/ and in the file ** GPL_EXCEPTION.txt in this package. ** ** Please review the following information to ensure GNU General ** Public Licensing requirements will be met: ** http://trolltech.com/products/qt/licenses/licensing/opensource/. If ** you are unsure which license is appropriate for your use, please ** review the following information: ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview ** or contact the sales department at sales@trolltech.com. ** ** In addition, as a special exception, Trolltech, as the sole ** copyright holder for Qt Designer, grants users of the Qt/Eclipse ** Integration plug-in the right for the Qt/Eclipse Integration to ** link to functionality provided by Qt Designer and its related ** libraries. ** ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly ** granted herein. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ****************************************************************************/ #ifndef NEWFORM_H #define NEWFORM_H #include "ui_newform.h" #include <QDialog> class QDesignerWorkbench; class NewForm: public QDialog { Q_OBJECT public: NewForm(QDesignerWorkbench *workbench, QWidget *parentWidget, const QString &fileName = QString()); virtual ~NewForm(); QDesignerWorkbench *workbench() const; private slots: void on_buttonBox_clicked(QAbstractButton *btn); void on_treeWidget_itemActivated(QTreeWidgetItem *item); void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *); void on_treeWidget_itemPressed(QTreeWidgetItem *item); void recentFileChosen(); private: QPixmap formPreviewPixmap(const QString &fileName); void loadFrom(const QString &path, bool resourceFile, const QString &uiExtension); private: bool openTemplate(const QString &templateFileName); QDesignerWorkbench *m_workbench; Ui::NewForm ui; QPushButton *m_createButton; QPushButton *m_recentButton; QString m_fileName; }; #endif // NEWFORM_H
#ifndef _LINUX_MQUEUE_H #define _LINUX_MQUEUE_H #define MQ_PRIO_MAX 32768 #define MQ_BYTES_MAX 819200 struct mq_attr { long mq_flags; long mq_maxmsg; long mq_msgsize; long mq_curmsgs; long __reserved[4]; }; #define NOTIFY_NONE 0 #define NOTIFY_WOKENUP 1 #define NOTIFY_REMOVED 2 #define NOTIFY_COOKIE_LEN 32 #endif
// ********************************************************************** // // Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** #ifndef ICE_GRID_REGISTRY_SERVER_ADMIN_ROUTER_H #define ICE_GRID_REGISTRY_SERVER_ADMIN_ROUTER_H #include <IceGrid/Database.h> namespace IceGrid { class RegistryServerAdminRouter : public Ice::BlobjectArrayAsync { public: RegistryServerAdminRouter(const DatabasePtr&); virtual void ice_invoke_async(const Ice::AMD_Object_ice_invokePtr&, const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&); private: const DatabasePtr _database; }; } #endif
#include "testutils.h" static int includes(unsigned alength, const uint8_t *adata, unsigned blength, const uint8_t *bdata) { struct spki_tag *atag = make_tag(alength, adata); struct spki_tag *btag = make_tag(blength, bdata); if (spki_tag_includes(atag, btag)) { release_tag(atag); release_tag(btag); return 1; } else return 0; } #define INCLUDES(a, b) includes(LDATA(a), LDATA(b)) void test_main(void) { ASSERT(INCLUDES("(3:ftp18:ftp.lysator.liu.se)", "(3:ftp18:ftp.lysator.liu.se)")); ASSERT(!INCLUDES("(3:ftp18:ftp.lysator.liu.se)", "(4:http18:ftp.lysator.liu.se)")); ASSERT(INCLUDES("(3:ftp18:ftp.lysator.liu.se)", "(3:ftp18:ftp.lysator.liu.se4:read)")); ASSERT(!INCLUDES("(3:ftp18:ftp.lysator.liu.se4:read)", "(3:ftp18:ftp.lysator.liu.se)")); ASSERT(INCLUDES("(1:*)", "(3:foo)")); ASSERT(!INCLUDES("(3:foo)", "(1:*)")); ASSERT(INCLUDES("(1:*)", "(1:*3:set3:foo3:bar)")); ASSERT(!INCLUDES("(1:*3:set3:foo3:bar)", "(1:*)")); ASSERT(INCLUDES("(1:*3:set(3:foo)(3:bar))", "(3:foo)")); ASSERT(INCLUDES("(1:*3:set(3:foo)(3:bar))", "(3:foo4:read)")); ASSERT(INCLUDES("(1:*3:set(3:foo)(3:bar))", "(3:bar)")); ASSERT(!INCLUDES("(1:*3:set(3:foo)(3:bar))", "(3:baz)")); ASSERT(INCLUDES("(1:*3:set(3:foo)(3:bar))", "(1:*3:set(3:foo))")); ASSERT(INCLUDES("(1:*3:set(3:foo)(3:bar))", "(1:*3:set(3:foo)(3:bar))")); ASSERT(!INCLUDES("(1:*3:set(3:foo)(3:bar))", "(1:*3:set(3:foo)(3:bar)(3:baz))")); ASSERT(!INCLUDES("(1:*3:set(3:foo)(3:bar))", "(1:*3:set(3:foo)(3:baz))")); }
#pragma once #include "InstanceEntity.h" #include "Geometry/GeometricShape.h" #include "Common/CommonMirco.h" #include "PathEngine/LocalBoundary.h" #include "PathEngine/AStarPathCorridor.h" #include "PathEngine/AStarPathfindingInterface.h" namespace hiveCrowd { namespace Kernel { const int HIVE_CROWD_MAX_NEIGHBORS = 6; const int HIVE_CROWD_FIXED_NEIGHBOR = 6; const int HIVE_CROWDAGENT_MAX_CORNERS = 4; const int HIVE_CROWD_MAX_OBSTAVOIDANCE_PRAMAS = 8; enum ECrowdAgentState { HIVE_CROWDAGENT_STATE_INVALID, HIVE_CROWDAGENT_STATE_WALKING, }; enum ECrowdAgentType { EXPERIENCED_AGENT, UNEXPERIENCED_AGENT, }; enum EMoveRequestState { HIVE_CROWDAGENT_TARGET_NONE = 0, HIVE_CROWDAGENT_TARGET_FAILED, HIVE_CROWDAGENT_TARGET_VALID, HIVE_CROWDAGENT_TARGET_REQUESTING, HIVE_CROWDAGENT_TARGET_WAITTING_FOR_QUEUE, HIVE_CROWDAGENT_TARGET_WAITTING_FOR_PATH, HIVE_CROWDAGENT_TARGET_VELOCITY, }; enum EUpdateFlags { HIVE_CROWD_ANTICIPATE_TURNS = 1, HIVE_CROWD_OBSTACLE_AVOIDANCE = 2, HIVE_CROWD_SEPARATION = 4, HIVE_CROWD_OPTIMIZE_VIS = 8, HIVE_CROWD_OPTIMIZE_TOPO = 16, }; struct SAgentParam { ECrowdAgentType AgentType; Ogre::Real Radius; Ogre::Real Height; Ogre::Real MaxAcceleration; Ogre::Real MaxSpeed; Ogre::Real SocialFactor; Ogre::Real IndividualFactor; Ogre::Real PsychologicalTendency; Ogre::Real DistacneAttenubation; Ogre::Real CollosionQueryRange; Ogre::Real NeighborSearchDistance; Ogre::Real PathOptimizationRange; Ogre::Real SeparationWeight; unsigned char UpdateFlags; unsigned char ObstacleAvoidanceType; }; struct SCrowdAgentAnimation { unsigned char Active; Ogre::Vector3 InitPos, StartPos, EndPos; unsigned int PolyRef; Ogre::Real Temp, TempMax; //TODO: rename; }; struct AgentProperty { typedef struct NeighborHood { NeighborHood(void) { NeighborArea = nullptr; NeighborAreaDensity = 0.0f; } ~NeighborHood(void) { SAFE_DELETE(NeighborArea); } Ogre::vector<unsigned int>::type Neighbors; Ogre::vector<Ogre::Real>::type NeighborDistList; Geometry::CGeometricShape* NeighborArea; Ogre::Real NeighborAreaDensity; }IS; hiveCrowd::PathEngine::CAStarPathfindingInterface* PathMemory; Ogre::Real NormalSpeed, HurrySpeed, MaxSpeed, MaxAcceleration, Speed; Ogre::Real DensityThreshold; Ogre::Vector3 CurDirection, TargetPos; Ogre::Vector3 SceneExit; //CrowdAgentData: hiveCrowd::PathEngine::CLocalBoundary* Boundary; hiveCrowd::PathEngine::CPathCorridor* Corridor; Ogre::Real DesiredSpeed; Ogre::Real TopologyOptTime; Ogre::Real TargetReplanTime; Ogre::Vector3 DisPos; Ogre::Vector3 CurVel; Ogre::Vector3 NewVel; Ogre::Vector3 DesiredVel; unsigned int TargetPolyRef; unsigned int TargetPathQueueRef; SAgentParam* AgentParam; bool isActive; bool TargetReplan; IS InfluenceSpace; unsigned char CurPolyState; unsigned char TargetMoveRequestState; unsigned char CornerFlag[HIVE_CROWDAGENT_MAX_CORNERS]; }; class CView; class CBrain; class CAgentManager; class KERNEL_DLL_API CAgent : public CInstanceEntity { public: CAgent(void); CAgent(const char* vName, const Ogre::String& vGroup = ""); CAgent(const Ogre::String& vName, const Ogre::String& vGroup = ""); ~CAgent(void); void setBrain(const Ogre::String& vBrainName, const Ogre::String& vBrainGroup); protected: void _update(Ogre::Real vDeltaTime) override; CMovableObject* _clone(const Ogre::String& vName) override; private: void __updateBodySmoothly(Ogre::Real vDeltaTime); bool __isAdjacent(const Ogre::Vector3& vCurPos, const Ogre::Vector3& vTargetPos); private: CView* m_View; CBrain* m_Brain; friend class CAgentManager; friend class CAgentFactory; }; class KERNEL_DLL_API CAgentFactory : public CInstanceEntityFactory { public: CAgentFactory(void){} virtual ~CAgentFactory(void){} protected: Common::CObject* _createProductImpl(const Ogre::String& vName) const override; Common::CObject* _createProductImpl(const char* vName) const override; }; } }
// -*- c++ -*- // This file is part of the Collective Variables module (Colvars). // The original version of Colvars and its updates are located at: // https://github.com/Colvars/colvars // Please update all Colvars source files before making any changes. // If you wish to distribute your changes, please submit them to the // Colvars repository at GitHub. /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ #ifdef FIX_CLASS FixStyle(colvars,FixColvars) #else #ifndef LMP_FIX_COLVARS_H #define LMP_FIX_COLVARS_H #include "fix.h" #include <mpi.h> class colvarproxy_lammps; namespace LAMMPS_NS { class FixColvars : public Fix { public: FixColvars(class LAMMPS *, int, char **); virtual ~FixColvars(); virtual int setmask(); virtual void init(); virtual void setup(int); virtual int modify_param(int, char **); virtual void min_setup(int vflag) {setup(vflag);}; virtual void min_post_force(int); virtual void post_force(int); virtual void post_force_respa(int, int, int); virtual void end_of_step(); virtual void post_run(); virtual double compute_scalar(); virtual double memory_usage(); virtual void write_restart(FILE *); virtual void restart(char *); protected: colvarproxy_lammps *proxy; // pointer to the colvars proxy class char *conf_file; // name of colvars config file char *inp_name; // name/prefix of colvars restart file char *out_name; // prefix string for all output files char *tmp_name; // name of thermostat fix. int rng_seed; // seed to initialize random number generator int tstat_id; // id of the thermostat fix double energy; // biasing energy of the fix int me; // my MPI rank in this "world". int num_coords; // total number of atoms controlled by this fix tagint *taglist; // list of all atom IDs referenced by colvars. int nmax; // size of atom communication buffer. int size_one; // bytes per atom in communication buffer. struct commdata *comm_buf; // communication buffer double *force_buf; // communication buffer void *idmap; // hash for mapping atom indices to consistent order. int *rev_idmap; // list of the hash keys for reverse mapping. int nlevels_respa; // flag to determine respa levels. int store_forces; // flag to determine whether to store total forces int unwrap_flag; // 1 if atom coords are unwrapped, 0 if not int init_flag; // 1 if initialized, 0 if not static int instances; // count fix instances, since colvars currently // only supports one instance at a time MPI_Comm root2root; // inter-root communicator for multi-replica support void one_time_init(); // one time initialization }; } #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. E: Cannot use fix colvars for atoms with rmass attribute The colvars library assigns atom masses per atom type, thus atom styles which allow setting individual per atom masses are not supported. E: Missing argument to keyword Self-explanatory. A keyword was recognized, but no corresponding value found. Check the input script syntax and compare to the documentation for the command. E: Incorrect fix colvars unwrap flag Self-explanatory. Check the input script syntax. E: Unknown fix colvars parameter Self-explanatory. Check your input script syntax. E: Cannot use fix colvars without atom IDs Atom IDs are not defined, but fix colvars needs them to identify an atom. E: Fix colvars requires an atom map, see atom_modify Use the atom_modify command to create an atom map. W: Using fix colvars with minimization Some of the functionality supported with the colvars library is not meaningful with minimization calculations. E: Could not find tstat fix ID Self-explanatory. The thermostat fix ID provided with the tstat keyword is not defined (yet or anymore). Check your input file. E: Run aborted on request from colvars module Some error condition happened inside the colvars library that prohibits it from continuing. Please examine the output for additional information. */
/* Copyright (C) 2010 Paul Davis Author: Robin Gareus <robin@gareus.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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_video_monitor_h__ #define __ardour_video_monitor_h__ #include <string> #include "ardour/ardour.h" #include "ardour/types.h" #include "ardour/session.h" #include "ardour/session_handle.h" #include "ardour/system_exec.h" namespace ARDOUR { class Session; } class PublicEditor; enum XJSettingOptions { XJ_WINDOW_SIZE = 1, XJ_WINDOW_POS = 2, XJ_WINDOW_ONTOP = 4, XJ_LETTERBOX = 8, XJ_OSD = 16, XJ_OFFSET = 32, XJ_FULLSCREEN = 64, }; /** @class VideoMonitor * @brief communication with xjadeo's remote-control interface */ class VideoMonitor : public sigc::trackable , public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList { public: VideoMonitor (PublicEditor*, std::string); virtual ~VideoMonitor (); void set_filename (std::string filename); void set_fps (float f) {fps = f;} bool is_started (); bool start (); void quit (); void open (std::string); void set_session (ARDOUR::Session *s); void save_session (); void query_full_state (bool); bool set_custom_setting (const std::string, const std::string); const std::string get_custom_setting (const std::string); void restore_settings_mask (int i) { _restore_settings_mask = i;} int restore_settings_mask () const { return _restore_settings_mask;} void set_offset (ARDOUR::sampleoffset_t); void manual_seek (ARDOUR::samplepos_t, bool, ARDOUR::sampleoffset_t); void srsupdate (); void querystate (); bool synced_by_manual_seeks() { return sync_by_manual_seek; } sigc::signal<void> Terminated; PBD::Signal1<void,std::string> UiState; void send_cmd (int what, int param); #if 1 void set_debug (bool onoff) { debug_enable = onoff; } #endif protected: PublicEditor *editor; ARDOUR::SystemExec *process; float fps; void parse_output (std::string d, size_t s); void terminated (); void forward_keyevent (unsigned int); void parameter_changed (std::string const & p); typedef std::map<std::string,std::string> XJSettings; int _restore_settings_mask; bool skip_setting(std::string); XJSettings xjadeo_settings; void xjadeo_sync_setup (); ARDOUR::samplepos_t manually_seeked_frame; ARDOUR::sampleoffset_t video_offset; bool sync_by_manual_seek; sigc::connection clock_connection; sigc::connection state_connection; int state_clk_divide; int starting; int knownstate; int osdmode; PBD::Signal1<void, unsigned int> XJKeyEvent; #if 1 bool debug_enable; #endif }; #endif /* __ardour_video_monitor_h__ */
////////////////////////////////////////////////////////////////////////// /// COPYRIGHT NOTICE /// Copyright (c) 2010, Õã½­¹²´´¼¼ÊõÓÐÏÞ¹«Ë¾ /// All rights reserved. /// /// @file itsip.c /// @brief ЭÒé¿âº¯Êý¶¨Òå /// /// /// /// @version 2.0 /// @author xuliang<gxuliang@gmail.com> /// @date 2010£­04£­24 /// /// /// ÐÞ¶©ËµÃ÷£º×î³õ°æ±¾ //////////////////////////////////////////////////////////////////////////#include <stdio.h> #include <string.h> #include "itsip.h" ////////////////////////////////////////////////////////////////////////// /// /// Ìî³äЭÒéÄÚÈÝ /// @param cmd ÃüÁî×Ö /// @param extlen À©Õ¹³¤¶È /// @param dev_t É豸ÀàÐÍ /// @param *data À©Õ¹ÄÚÈÝ /// @param *its_pkt ЭÒé½á¹¹Ìå /// @author xuliang<gxuliang@gmail.com> /// @date 2010£­04£­24 ////////////////////////////////////////////////////////////////////////// inline void itsip_pack(BYTE cmd, WORD extlen, BYTE dev_t, void *data, ITSIP_PACKET *its_pkt) { its_pkt->head.itsip_head = ITS_HEAD; its_pkt->head.itsip_cmd = cmd; its_pkt->head.itsip_ver = ITSIP_VERSION; its_pkt->head.itsip_thl = ITSIP_THLEN; its_pkt->head.itsip_extlen = extlen; its_pkt->head.itsip_dev_t = dev_t; if (extlen > 0 && data != NULL) { memcpy(its_pkt->data, data, extlen); } }
#ifndef TPX_HYDROGEN_H #define TPX_HYDROGEN_H #include "cantera/tpx/Sub.h" namespace tpx { class hydrogen : public Substance { public: hydrogen() { m_name = "hydrogen"; m_formula = "H2"; } virtual ~hydrogen() {} double MolWt(); double Tcrit(); double Pcrit(); double Vcrit(); double Tmin(); double Tmax(); char* name(); char* formula(); double Pp(); double up(); double sp(); double Psat(); private: double ldens(); double C(int i, double rt, double rt2); double Cprime(int i, double rt, double rt2, double rt3); double I(int i, double egrho); double H(int i, double egrho); double W(int i, double egrho); double icv(int i, double x, double xlg); }; } #endif // ! HYDROGEN_H
///@brief Vector operations. Maybe not the most optimized code, but works (kind of) class BZK_VecOps { public: ///TODO: improve this to handle non-normalized vectors - or maybe rename this. inline static BZK_FixP Angle(BZK_Vec3f &aVec1,BZK_Vec3f &aVec2) { return DotProductFix(aVec1,aVec2); } ///TODO: understand and implement this properly inline static BZK_FixP AngleToNormal(BZK_Vec3f &aVec) { BZK_Vec3f North(0,0,1); return Angle(aVec,North); } ///copy to a 2D vector from another inline static void Copy(BZK_Vec2f &aVecDest,BZK_Vec2f &aVecSrc) { memcpy(&aVecDest,&aVecSrc,sizeof(BZK_Vec2f)); } ///copy to a 3D vector from another inline static void Copy(BZK_Vec3f &aVecDest,BZK_Vec3f &aVecSrc) { memcpy(&aVecDest,&aVecSrc,sizeof(BZK_Vec3f)); } ///return dimensions of a vector ///TODO: useful? clutter? inline static int Components(BZK_Vec2f *Vec) { return (sizeof(*Vec)/sizeof(BZK_FixP)); } inline static BZK_FixP DotProductFix(BZK_Vec3f a,BZK_Vec3f b) { return BZK_FastMath::Mul(a.GetX(),b.GetX())+BZK_FastMath::Mul(a.GetY(),b.GetY())+BZK_FastMath::Mul(a.GetZ(),b.GetZ()); } inline static BZK_FixP DotProductFix(BZK_Vec2f a,BZK_Vec2f b) { return BZK_FastMath::Mul(a.GetX(),b.GetX())+BZK_FastMath::Mul(a.GetY(),b.GetY()); } inline static BZK_Vec3f *MakeVec (BZK_Vec3f a, BZK_Vec3f b) { BZK_Vec3f *NewVec=new BZK_Vec3f; NewVec->SetX(a.GetX()-b.GetX()); NewVec->SetY(a.GetY()-b.GetY()); NewVec->SetZ(a.GetZ()-b.GetZ()); return NewVec; } inline static BZK_Vec3f *VecProduct (BZK_Vec3f a, BZK_Vec3f b) { BZK_FixP aX=a.GetX(); BZK_FixP aY=a.GetY(); BZK_FixP aZ=a.GetZ(); BZK_FixP bX=b.GetX(); BZK_FixP bY=b.GetY(); BZK_FixP bZ=b.GetZ(); BZK_Vec3f *NewVec=new BZK_Vec3f; NewVec->SetX(BZK_FastMath::Mul(aY,bZ)-BZK_FastMath::Mul(aZ,bY)); NewVec->SetY(BZK_FastMath::Mul(aZ,bX)-BZK_FastMath::Mul(aX,bZ)); NewVec->SetZ(BZK_FastMath::Mul(aX,bY)-BZK_FastMath::Mul(aY,bX)); return NewVec; } inline static BZK_FixP DistanceFix (BZK_Vec3f &a, BZK_Vec3f &b) { BZK_FixP ToBeReturned; BZK_Vec3f *DistVec=MakeVec(a,b); ToBeReturned=LengthFix(*DistVec); delete DistVec; return ToBeReturned; } inline static BZK_FixP LengthFix (BZK_Vec3f a) { float ToBeReturned; ToBeReturned=/*sqrt*/BZK_FastMath::FastSqrt((int)BZK_FastMath::Fix32toInt32(DotProductFix(a,a))); return BZK_FastMath::Int32toFix32(ToBeReturned); } inline static BZK_FixP LengthFix (BZK_Vec2f a) { float ToBeReturned; ToBeReturned=/*sqrt*/BZK_FastMath::FastSqrt((int)BZK_FastMath::Fix32toInt32(DotProductFix(a,a))); return BZK_FastMath::Int32toFix32(ToBeReturned); } //--------------------------------------------------------------------------------------- inline static void BSCtoLHC(BZK_Vec3f &aVec) { if (aVec.GetSpace()!=BSC) return; BZK_Vec3f *temp=new BZK_Vec3f; BZK_VecOps::Copy(*temp,aVec); aVec.SetX(temp->GetX()); /// as origins swap from front to back, we have to invert X (what ever this means. I cant remember why I wrote this) aVec.SetY(temp->GetZ()); aVec.SetZ(-temp->GetY()); aVec.SetSpace(LHC); delete temp; } //--------------------------------------------------------------------------------------- inline static void LHCtoBSC(BZK_Vec3f &aVec) { if (aVec.GetSpace()!=LHC) return; BZK_Vec3f *temp=new BZK_Vec3f(); BZK_VecOps::Copy(*temp,aVec); aVec.SetX(temp->GetX()); // idem BSCtoLHC aVec.SetY(-temp->GetZ()); aVec.SetZ(temp->GetY()); aVec.SetSpace(BSC); delete temp; } inline static void VecNormalize (BZK_Vec3f &Vec) { BZK_FixP Modulus=LengthFix(Vec);//+BZK_FastMath::Int32toFix32(1); Vec.SetX(BZK_FastMath::Div(Vec.GetX(),Modulus)); Vec.SetY(BZK_FastMath::Div(Vec.GetY(),Modulus)); Vec.SetZ(BZK_FastMath::Div(Vec.GetZ(),Modulus)); } inline static void Negate (BZK_Vec3f &Vec) { /* BZK_FixP MinusOne=BZK_FastMath::Real32toFix32(-1.0); Vec.SetX(BZK_FastMath::Mul(Vec.GetX(),MinusOne)); Vec.SetY(BZK_FastMath::Mul(Vec.GetY(),MinusOne)); Vec.SetZ(BZK_FastMath::Mul(Vec.GetZ(),MinusOne)); */ Vec.SetX(-Vec.GetX()); Vec.SetY(-Vec.GetY()); Vec.SetZ(-Vec.GetZ()); } inline static void VecNormalize (BZK_Vec2f &Vec) { BZK_FixP Modulus=LengthFix(Vec)+BZK_FastMath::Int32toFix32(1); Vec.SetX(BZK_FastMath::Div(Vec.GetX(),Modulus)); Vec.SetY(BZK_FastMath::Div(Vec.GetY(),Modulus)); } ///@TODO: test inline static BZK_Vec3f* SumVec(BZK_Vec3f VecA,BZK_Vec3f VecB) { BZK_Vec3f *Sum=new BZK_Vec3f(); if (VecA.GetSpace()==VecB.GetSpace()) { Sum->SetX(VecA.GetX()+VecB.GetX()); Sum->SetY(VecA.GetY()+VecB.GetY()); Sum->SetZ(VecA.GetZ()+VecB.GetZ()); } return Sum; } };
/* * Boss Ogg - A Music Server * (c)2004 by Adam Torgerson (adam.torgerson@colorado.edu) * This project's homepage is: http://bossogg.wishy.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 ********************************************************************* * output modification plugin implementation * * the output mod plugins are meant to be used as a * tweak on the audio output, before it is send to the sound card * for example, cross fading and software mixing could be performed * here ********************************************************************* */ #import "output_mod_plugin.h" static GSList *output_mod_list = NULL; /* set the function pointers to NULL */ void output_mod_plugin_clear (output_mod_plugin_s *plugin) { } /* try and open output mod plugin */ output_mod_plugin_s *output_mod_plugin_open (gchar *filename) { GModule *lib = g_module_open (filename, G_MODULE_BIND_LAZY); if (lib == NULL) { LOG ("Could not dlopen '%s': %s", filename, g_module_error ()); return NULL; } output_mod_plugin_s *plugin = (output_mod_plugin_s *)g_malloc (sizeof (output_mod_plugin_s)); plugin->output_mod_description = (output_mod_description_f)get_symbol (lib, "output_mod_description"); plugin->output_mod_configure = (output_mod_configure_f)get_symbol (lib, "output_mod_configure"); plugin->output_mod_get_config = (output_mod_get_config_f)get_symbol (lib, "output_mod_get_config"); plugin->output_mod_run = (output_mod_run_f)get_symbol (lib, "output_mod_run"); plugin->output_mod_name = (output_mod_name_f)get_symbol (lib, "output_mod_name"); plugin->description = plugin->output_mod_description (); output_mod_list = g_slist_append (output_mod_list, plugin); LOG ("Output mod plugin '%s', for '%s' loaded", filename, plugin->description); return plugin; } /* close and free an open output mod plugin */ void output_mod_plugin_close (output_mod_plugin_s *plugin) { output_mod_list = g_slist_remove (output_mod_list, plugin); LOG ("Closing '%s' module", plugin->description); g_module_close (plugin->lib); g_free (plugin); } void output_mod_plugin_close_all_helper (gpointer item, gpointer user_data) { output_mod_plugin_s *plugin = (output_mod_plugin_s *)item; LOG ("Closing '%s' module", plugin->description); g_module_close (plugin->lib); g_free (plugin); } /* close all output mod plugins */ void output_mod_plugin_close_all (void) { if (output_mod_list == NULL) { LOG ("Output mod plugin list already empty"); return; } g_slist_foreach (output_mod_list, output_mod_plugin_close_all_helper, NULL); } typedef struct mod_configure_t { gint arg1; gint arg2; gpointer user_data; } mod_configure_s; void output_mod_plugin_configure_all_helper (gpointer item, gpointer user_data) { output_mod_plugin_s *plugin = (output_mod_plugin_s *)item; mod_configure_s *s = (mod_configure_s *)user_data; plugin->output_mod_configure (s->arg1, s->arg2, s->user_data); } void output_mod_plugin_configure_all (gint arg1, gint arg2, gpointer user_data) { mod_configure_s s; if (output_mod_list == NULL) { LOG ("Output mod plugin list empty"); return; } s.arg1 = arg1; s.arg2 = arg2; s.user_data = user_data; g_slist_foreach (output_mod_list, output_mod_plugin_configure_all_helper, &s); } typedef struct mod_run_t { guchar *chunk; gint size; } mod_run_s; void output_mod_plugin_run_all_helper (gpointer item, gpointer user_data) { output_mod_plugin_s *plugin = (output_mod_plugin_s *)item; mod_run_s *s = (mod_run_s *)user_data; plugin->output_mod_run (s->chunk, s->size); } void output_mod_plugin_run_all (gchar *chunk, gint size) { mod_run_s s; if (output_mod_list == NULL) { LOG ("Output mod plugin list empty"); return; } s.chunk = chunk; s.size = size; g_slist_foreach (output_mod_list, output_mod_plugin_run_all_helper, &s); }
/* * Commandline option parsing functions * * Copyright (c) 2003-2008 Fabrice Bellard * Copyright (c) 2009 Kevin Wolf <kwolf@redhat.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. */ #ifndef QEMU_OPTIONS_H #define QEMU_OPTIONS_H #include <stdint.h> #include "qemu-queue.h" #include "qdict.h" enum QEMUOptionParType { OPT_FLAG, OPT_NUMBER, OPT_SIZE, OPT_STRING, }; typedef struct QEMUOptionParameter { const char *name; enum QEMUOptionParType type; union { uint64_t n; char* s; } value; const char *help; } QEMUOptionParameter; const char *get_opt_name(char *buf, int buf_size, const char *p, char delim); const char *get_opt_value(char *buf, int buf_size, const char *p); int get_next_param_value(char *buf, int buf_size, const char *tag, const char **pstr); int get_param_value(char *buf, int buf_size, const char *tag, const char *str); int check_params(char *buf, int buf_size, const char * const *params, const char *str); /* * The following functions take a parameter list as input. This is a pointer to * the first element of a QEMUOptionParameter array which is terminated by an * entry with entry->name == NULL. */ QEMUOptionParameter *get_option_parameter(QEMUOptionParameter *list, const char *name); int set_option_parameter(QEMUOptionParameter *list, const char *name, const char *value); int set_option_parameter_int(QEMUOptionParameter *list, const char *name, uint64_t value); QEMUOptionParameter *append_option_parameters(QEMUOptionParameter *dest, QEMUOptionParameter *list); QEMUOptionParameter *parse_option_parameters(const char *param, QEMUOptionParameter *list, QEMUOptionParameter *dest); void free_option_parameters(QEMUOptionParameter *list); void print_option_parameters(QEMUOptionParameter *list); void print_option_help(QEMUOptionParameter *list); /* ------------------------------------------------------------------ */ typedef struct QemuOpt QemuOpt; typedef struct QemuOpts QemuOpts; typedef struct QemuOptsList QemuOptsList; enum QemuOptType { QEMU_OPT_STRING = 0, /* no parsing (use string as-is) */ QEMU_OPT_BOOL, /* on/off */ QEMU_OPT_NUMBER, /* simple number */ QEMU_OPT_SIZE, /* size, accepts (K)ilo, (M)ega, (G)iga, (T)era postfix */ }; typedef struct QemuOptDesc { const char *name; enum QemuOptType type; const char *help; } QemuOptDesc; struct QemuOptsList { const char *name; const char *implied_opt_name; bool merge_lists; /* Merge multiple uses of option into a single list? */ QTAILQ_HEAD(, QemuOpts) head; QemuOptDesc desc[]; }; const char *qemu_opt_get(QemuOpts *opts, const char *name); bool qemu_opt_get_bool(QemuOpts *opts, const char *name, bool defval); uint64_t qemu_opt_get_number(QemuOpts *opts, const char *name, uint64_t defval); uint64_t qemu_opt_get_size(QemuOpts *opts, const char *name, uint64_t defval); int qemu_opt_set(QemuOpts *opts, const char *name, const char *value); int qemu_opt_set_bool(QemuOpts *opts, const char *name, bool val); typedef int (*qemu_opt_loopfunc)(const char *name, const char *value, void *opaque); int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque, int abort_on_failure); QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id); QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists); void qemu_opts_reset(QemuOptsList *list); void qemu_opts_loc_restore(QemuOpts *opts); int qemu_opts_set(QemuOptsList *list, const char *id, const char *name, const char *value); const char *qemu_opts_id(QemuOpts *opts); void qemu_opts_del(QemuOpts *opts); int qemu_opts_validate(QemuOpts *opts, QemuOptDesc *desc); int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname); QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, int permit_abbrev); void qemu_opts_set_defaults(QemuOptsList *list, const char *params, int permit_abbrev); QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict); QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict); typedef int (*qemu_opts_loopfunc)(QemuOpts *opts, void *opaque); int qemu_opts_print(QemuOpts *opts, void *dummy); int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void *opaque, int abort_on_failure); #endif
/* * aboot/include/string.h * prototypes for the functions in lib/string.c. * We used to use the definitions from linux/string.h but more recent * kernels don't provide these to userspace code. */ #include <linux/types.h> extern char * ___strtok; extern char * strcpy(char *,const char *); extern char * strncpy(char *,const char *, size_t); extern char * strcat(char *, const char *); extern char * strncat(char *, const char *, size_t); extern int strcmp(const char *,const char *); extern int strncmp(const char *,const char *,size_t); extern char * strchr(const char *,int); extern char * strrchr(const char *,int); extern size_t strlen(const char *); extern size_t strnlen(const char *, size_t); extern size_t strspn(const char *,const char *); extern char * strpbrk(const char * cs,const char * ct); extern char * strtok(char * s,const char * ct); extern void * memset(void * s, int c, size_t count); extern void bcopy(const void * src, void * dest, size_t count); extern void * memcpy(void * dest,const void *src,size_t count); extern void * memmove(void * dest,const void *src,size_t count); extern int memcmp(const void * cs,const void * ct,size_t count); extern void * memscan(void * addr, unsigned char c, size_t size);
/* * Copyright (c) 2011-2014 zhangjianlin ÕżöÁÖ * eamil:jonas88@sina.com * addr: china * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 _IOP_TIMER_H_ #define _IOP_TIMER_H_ #ifdef __cplusplus extern "C" { #endif int iop_init_timer(void *iop_base, int maxev); #ifdef __cplusplus } #endif //__Cplusplus #endif
#ifndef _SYS_WAIT_H #include_next <sys/wait.h> /* Now define the internal interfaces. */ extern __pid_t __waitpid (__pid_t __pid, int *__stat_loc, int __options); libc_hidden_proto (__waitpid) extern int __waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options); extern __pid_t __libc_waitpid (pid_t __pid, int *__stat_loc, int __options); extern __pid_t __libc_wait (int *__stat_loc); extern __pid_t __wait (__WAIT_STATUS __stat_loc); extern __pid_t __wait3 (__WAIT_STATUS __stat_loc, int __options, struct rusage * __usage); extern __pid_t __wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options, struct rusage *__usage) attribute_hidden; #endif
#ifndef MTSEC_H #define MTSEC_H /* MTSec rulesset class * * Copyright (C) 2005, 2007 Lee Begg and the Thousand Parsec 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include <tpserver/ruleset.h> #include <tpserver/designstore.h> #include <tpserver/player.h> namespace MTSecRuleset { class MTSec : public Ruleset{ public: MTSec(); virtual ~MTSec(); std::string getName(); std::string getVersion(); void initGame(); void createGame(); void startGame(); bool onAddPlayer(Player::Ptr player); void onPlayerAdded(Player::Ptr player); protected: // Design definition methods Design::Ptr createScoutDesign( Player::Ptr owner); Design::Ptr createBattleScoutDesign( Player::Ptr owner); // Object creation methods IGObject::Ptr createSiriusSystem( IGObject::Ptr mw_galaxy); IGObject::Ptr createStarSystem( IGObject::Ptr mw_galaxy); IGObject::Ptr createSolSystem( IGObject::Ptr mw_galaxy); IGObject::Ptr createAlphaCentauriSystem( IGObject::Ptr mw_galaxy); void createProperties(); void createComponents(); void createTechTree(); void createResources(); IGObject::Ptr createEmptyFleet( Player::Ptr owner, IGObject::Ptr star, std::string fleetName); void makeNewPlayerFleet( Player::Ptr player, IGObject::Ptr star); IGObject::Ptr makePlayerHomePlanet( Player::Ptr player, IGObject::Ptr star); IGObject::Ptr makeNewPlayerStarSystem( Player::Ptr player); void setNewPlayerTech( Player::Ptr player); Design::Ptr createAlphaMissileDesign( Player::Ptr owner); private: xmlImport *xmlImporter; }; }//end namespace #endif
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/prctl.h> #include <signal.h> #include "perf_event.h" #include "perf_fuzzer.h" #include "fuzzer_determinism.h" #include "fuzzer_logging.h" #include "fuzzer_stats.h" #include "fuzz_prctl.h" void prctl_random_event(void) { int ret; int type; stats.prctl_attempts++; type=rand()%2; if (ignore_but_dont_skip.prctl) return; if (type) { ret=prctl(PR_TASK_PERF_EVENTS_ENABLE); if ((ret==0)&&(logging&TYPE_PRCTL)) { sprintf(log_buffer,"P 1\n"); write(log_fd,log_buffer,strlen(log_buffer)); } } else { ret=prctl(PR_TASK_PERF_EVENTS_DISABLE); if ((ret==0)&&(logging&TYPE_PRCTL)) { sprintf(log_buffer,"P 0\n"); write(log_fd,log_buffer,strlen(log_buffer)); } } /* FIXME: are there others we should be trying? */ if (ret==0) stats.prctl_successful++; }
/* * This file is part of the coreboot project. * * Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de> * * 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 St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdint.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> #include <device/smbus.h> #include "i82371eb.h" #include "i82371eb_smbus.h" /* TODO: Needed later? */ static const struct smbus_bus_operations lops_smbus_bus = { }; static const struct device_operations smbus_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = 0, .scan_bus = scan_static_bus, .enable = 0, .ops_pci = 0, /* No subsystem IDs on 82371EB! */ .ops_smbus_bus = &lops_smbus_bus, }; /* Note: There's no SMBus on 82371FB/SB/MX and 82437MX. */ /* Intel 82371AB/EB/MB */ static const struct pci_driver smbus_driver __pci_driver = { .ops = &smbus_ops, .vendor = PCI_VENDOR_ID_INTEL, .device = PCI_DEVICE_ID_INTEL_82371AB_SMB_ACPI, };
/* * GPIO and IRQ definitions for HTC Magician PDA phones * * Copyright (c) 2007 Philipp Zabel * * 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. * */ #ifndef _MAGICIAN_H_ #define _MAGICIAN_H_ #include <linux/gpio.h> #include <mach/irqs.h> /* * PXA GPIOs */ #define GPIO0_MAGICIAN_KEY_POWER 0 #define GPIO9_MAGICIAN_UNKNOWN 9 #define GPIO10_MAGICIAN_GSM_IRQ 10 #define GPIO11_MAGICIAN_GSM_OUT1 11 #define GPIO13_MAGICIAN_CPLD_IRQ 13 #define GPIO18_MAGICIAN_UNKNOWN 18 #define GPIO22_MAGICIAN_VIBRA_EN 22 #define GPIO26_MAGICIAN_GSM_POWER 26 #define GPIO27_MAGICIAN_USBC_PUEN 27 #define GPIO30_MAGICIAN_BQ24022_nCHARGE_EN 30 #define GPIO37_MAGICIAN_KEY_HANGUP 37 #define GPIO38_MAGICIAN_KEY_CONTACTS 38 #define GPIO40_MAGICIAN_GSM_OUT2 40 #define GPIO48_MAGICIAN_UNKNOWN 48 #define GPIO56_MAGICIAN_UNKNOWN 56 #define GPIO57_MAGICIAN_CAM_RESET 57 #define GPIO75_MAGICIAN_SAMSUNG_POWER 75 #define GPIO83_MAGICIAN_nIR_EN 83 #define GPIO86_MAGICIAN_GSM_RESET 86 #define GPIO87_MAGICIAN_GSM_SELECT 87 #define GPIO90_MAGICIAN_KEY_CALENDAR 90 #define GPIO91_MAGICIAN_KEY_CAMERA 91 #define GPIO93_MAGICIAN_KEY_UP 93 #define GPIO94_MAGICIAN_KEY_DOWN 94 #define GPIO95_MAGICIAN_KEY_LEFT 95 #define GPIO96_MAGICIAN_KEY_RIGHT 96 #define GPIO97_MAGICIAN_KEY_ENTER 97 #define GPIO98_MAGICIAN_KEY_RECORD 98 #define GPIO99_MAGICIAN_HEADPHONE_IN 99 #define GPIO100_MAGICIAN_KEY_VOL_UP 100 #define GPIO101_MAGICIAN_KEY_VOL_DOWN 101 #define GPIO102_MAGICIAN_KEY_PHONE 102 #define GPIO103_MAGICIAN_LED_KP 103 #define GPIO104_MAGICIAN_LCD_POWER_1 104 #define GPIO105_MAGICIAN_LCD_POWER_2 105 #define GPIO106_MAGICIAN_LCD_POWER_3 106 #define GPIO107_MAGICIAN_DS1WM_IRQ 107 #define GPIO108_MAGICIAN_GSM_READY 108 #define GPIO114_MAGICIAN_UNKNOWN 114 #define GPIO115_MAGICIAN_nPEN_IRQ 115 #define GPIO116_MAGICIAN_nCAM_EN 116 #define GPIO119_MAGICIAN_UNKNOWN 119 #define GPIO120_MAGICIAN_UNKNOWN 120 /* * CPLD IRQs */ #define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0) #define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1) #define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2) #define IRQ_MAGICIAN_VBUS (IRQ_BOARD_START + 3) #define MAGICIAN_NR_IRQS (IRQ_BOARD_START + 8) /* * CPLD EGPIOs */ #define MAGICIAN_EGPIO_BASE NR_BUILTIN_GPIO #define MAGICIAN_EGPIO(reg,bit) \ (MAGICIAN_EGPIO_BASE + 8*reg + bit) /* output */ #define EGPIO_MAGICIAN_TOPPOLY_POWER MAGICIAN_EGPIO(0, 2) #define EGPIO_MAGICIAN_LED_POWER MAGICIAN_EGPIO(0, 5) #define EGPIO_MAGICIAN_GSM_RESET MAGICIAN_EGPIO(0, 6) #define EGPIO_MAGICIAN_LCD_POWER MAGICIAN_EGPIO(0, 7) #define EGPIO_MAGICIAN_SPK_POWER MAGICIAN_EGPIO(1, 0) #define EGPIO_MAGICIAN_EP_POWER MAGICIAN_EGPIO(1, 1) #define EGPIO_MAGICIAN_IN_SEL0 MAGICIAN_EGPIO(1, 2) #define EGPIO_MAGICIAN_IN_SEL1 MAGICIAN_EGPIO(1, 3) #define EGPIO_MAGICIAN_MIC_POWER MAGICIAN_EGPIO(1, 4) #define EGPIO_MAGICIAN_CODEC_RESET MAGICIAN_EGPIO(1, 5) #define EGPIO_MAGICIAN_CODEC_POWER MAGICIAN_EGPIO(1, 6) #define EGPIO_MAGICIAN_BL_POWER MAGICIAN_EGPIO(1, 7) #define EGPIO_MAGICIAN_SD_POWER MAGICIAN_EGPIO(2, 0) #define EGPIO_MAGICIAN_CARKIT_MIC MAGICIAN_EGPIO(2, 1) #define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL MAGICIAN_EGPIO(2, 2) #define EGPIO_MAGICIAN_FLASH_VPP MAGICIAN_EGPIO(2, 3) #define EGPIO_MAGICIAN_BL_POWER2 MAGICIAN_EGPIO(2, 4) #define EGPIO_MAGICIAN_BQ24022_ISET2 MAGICIAN_EGPIO(2, 5) #define EGPIO_MAGICIAN_GSM_POWER MAGICIAN_EGPIO(2, 7) /* input */ #define EGPIO_MAGICIAN_CABLE_STATE_AC MAGICIAN_EGPIO(4, 0) #define EGPIO_MAGICIAN_CABLE_STATE_USB MAGICIAN_EGPIO(4, 1) #define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0) #define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1) #define EGPIO_MAGICIAN_BOARD_ID2 MAGICIAN_EGPIO(5, 2) #define EGPIO_MAGICIAN_LCD_SELECT MAGICIAN_EGPIO(5, 3) #define EGPIO_MAGICIAN_nSD_READONLY MAGICIAN_EGPIO(5, 4) #define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1) #endif /* _MAGICIAN_H_ */
int main() { int true_var = 5; int false_var = 0; return !( (true_var || false_var) && !(true_var && false_var) && (true_var && !false_var) && (true_var || false_var && false_var) ); }
/*------------------------------------------------------------------------- fs2sint.c Copyright (C) 2004, Vangelis Rokas <vrokas at otenet.gr> 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.1, 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with other files, some of which are compiled with SDCC, to produce an executable, this library 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. -------------------------------------------------------------------------*/ #include <float.h> /* convert float to signed int */ signed int __fs2sint (float f) _FS_REENTRANT { signed long sl = __fs2slong (f); if (sl >= INT_MAX) return INT_MAX; if (sl <= INT_MIN) return -INT_MIN; return sl; }
/* This file is part of the KDE project Copyright (C) 2005-2006 Jarosław Staniek <staniek@kde.org> This program 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 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KEXIFIELDCOMBOBOX_H #define KEXIFIELDCOMBOBOX_H #include "kexiextwidgets_export.h" #include <KComboBox> class KexiProject; /*! This widget provides a list of fields from a table or query within a combobox, so user can pick one of them. */ class KEXIEXTWIDGETS_EXPORT KexiFieldComboBox : public KComboBox { Q_OBJECT public: explicit KexiFieldComboBox(QWidget *parent = 0); virtual ~KexiFieldComboBox(); public Q_SLOTS: //! \return global project that is used to retrieve schema informationm for this combo box. KexiProject* project() const; //! Sets global project that is used to retrieve schema informationm for this combo box. void setProject(KexiProject *prj); void setTableOrQuery(const QString& name, bool table); QString tableOrQueryName() const; bool isTableAssigned() const; void setFieldOrExpression(const QString& string); void setFieldOrExpression(int index); QString fieldOrExpression() const; QString fieldOrExpressionCaption() const; /*! \return index of selected table or query field. -1 is returned if there is nothing selected or expression is selected of project is not assigned or table or query is not assigned. */ int indexOfField() const; Q_SIGNALS: void selected(); protected Q_SLOTS: void slotActivated(int); void slotReturnPressed(const QString & text); protected: virtual void focusOutEvent(QFocusEvent *e); class Private; Private * const d; }; #endif
/* default_folder.h WJ109 */ #ifndef DEFAULT_FOLDER_H_WJ109 #define DEFAULT_FOLDER_H_WJ109 1 #define DEFAULT_FOLDER_W 512 #define DEFAULT_FOLDER_H 512 extern unsigned char default_folder_img[DEFAULT_FOLDER_W*DEFAULT_FOLDER_H*4]; #endif /* DEFAULT_FOLDER_H_WJ109 */ /* EOB */
// ************************************************************************* // // Copyright 2004-2010 Bruno PAGES . // // This file is part of the BOUML Uml Toolkit. // // 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. // // e-mail : bouml@free.fr // home : http://bouml.free.fr // // ************************************************************************* #ifndef BROWSERNODE_H #define BROWSERNODE_H #include "TreeItem.h" #ifndef REVERSE class BrowserView; #endif class QCString; class QDataStream; class Class; class BrowserNode : public TreeItem { public: BrowserNode(BrowserNode * parent, const char * n); virtual ~BrowserNode() {}; // to avoid compiler warning virtual bool isa_package() const; #ifndef REVERSE BrowserNode(BrowserView * parent, const char * n); void select_in_browser(); virtual void activated(); virtual void selected(); virtual void menu() = 0; virtual void refer(const QString & name) = 0; virtual void backup(QDataStream & dt) const = 0; virtual QString get_path() const = 0; #endif }; #ifndef REVERSE // a sortable list of BrowserNode #include <qlist.h> class BrowserNodeList : public QList<BrowserNode> { public: void search(BrowserNode * bn, int k, const QString & s, bool cs); virtual int compareItems(QCollection::Item item1, QCollection::Item item2); }; #endif #endif
/* * Copyright (c) 2001 Tony Bybell. * * 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. */ /* * debug.c 01feb99ajb * malloc debugs added on 13jul99ajb */ #include <config.h> #include "v2l_debug_lxt2.h" #ifdef DEBUG_MALLOC /* normally this should be undefined..this is *only* for finding stray allocations/frees */ static struct memchunk *mem=NULL; static size_t mem_total=0; static int mem_chunks=0; static void mem_addnode(void *ptr, size_t size) { struct memchunk *m; m=(struct memchunk *)malloc(sizeof(struct memchunk)); m->ptr=ptr; m->size=size; m->next=mem; mem=m; mem_total+=size; mem_chunks++; fprintf(stderr,"mem_addnode: TC:%05d TOT:%010d PNT:%010p LEN:+%d\n",mem_chunks,mem_total,ptr,size); } static void mem_freenode(void *ptr) { struct memchunk *m, *mprev=NULL; m=mem; while(m) { if(m->ptr==ptr) { if(mprev) { mprev->next=m->next; } else { mem=m->next; } mem_total=mem_total-m->size; mem_chunks--; fprintf(stderr,"mem_freenode: TC:%05d TOT:%010d PNT:%010p LEN:-%d\n",mem_chunks,mem_total,ptr,m->size); free(m); return; } mprev=m; m=m->next; } fprintf(stderr,"mem_freenode: PNT:%010p *INVALID*\n",ptr); sleep(1); } #endif /* * wrapped malloc family... */ void *malloc_2(size_t size) { void *ret; ret=malloc(size); if(ret) { DEBUG_M(mem_addnode(ret,size)); } else { fprintf(stderr, "FATAL ERROR : Out of memory, sorry.\n"); exit(1); } return(ret); } void *realloc_2(void *ptr, size_t size) { void *ret; ret=realloc(ptr, size); if(ret) { DEBUG_M(mem_freenode(ptr)); DEBUG_M(mem_addnode(ret,size)); } else { fprintf(stderr, "FATAL ERROR : Out of memory, sorry.\n"); exit(1); } return(ret); } void *calloc_2(size_t nmemb, size_t size) { void *ret; ret=calloc(nmemb, size); if(ret) { DEBUG_M(mem_addnode(ret, nmemb*size)); } else { fprintf(stderr, "FATAL ERROR: Out of memory, sorry.\n"); exit(1); } return(ret); } void free_2(void *ptr) { if(ptr) { DEBUG_M(mem_freenode(ptr)); free(ptr); } else { fprintf(stderr, "WARNING: Attempt to free NULL pointer caught.\n"); } } /* * atoi 64-bit version.. * y/on default to '1' * n/nonnum default to '0' */ TimeType atoi_64(char *str) { TimeType val=0; unsigned char ch, nflag=0; #if 0 switch(*str) { case 'y': case 'Y': return(LLDescriptor(1)); case 'o': case 'O': str++; ch=*str; if((ch=='n')||(ch=='N')) return(LLDescriptor(1)); else return(LLDescriptor(0)); case 'n': case 'N': return(LLDescriptor(0)); break; default: break; } #endif while((ch=*(str++))) { if((ch>='0')&&(ch<='9')) { val=(val*10+(ch&15)); } else if((ch=='-')&&(val==0)&&(!nflag)) { nflag=1; } else if(val) { break; } } return(nflag?(-val):val); }
// Cyphesis Online RPG Server and AI Engine // Copyright (C) 2004-2006 Alistair Riddoch // // 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 // $Id$ #ifndef SERVER_IDLE_H #define SERVER_IDLE_H #include <time.h> class CommServer; /// \brief Base class for any object which needs to be polled regularly. /// /// This should be treated as an interface, so can cleanly be used in /// multiple inheritance. class Idle { protected: explicit Idle(CommServer & svr); public: /// Reference to the object that manages all socket communication. CommServer & m_idleManager; virtual ~Idle(); /// \brief Perform idle tasks. /// /// Called from the server's core idle function whenever it is called. virtual void idle(time_t t) = 0; }; #endif // SERVER_IDLE_H
#include "ports.h" unsigned short pciConfigReadWord (unsigned short bus, unsigned short slot, unsigned short func, unsigned short offset); unsigned short pciCheckVendor(unsigned short bus, unsigned short slot);