text
stringlengths
4
6.14k
#include "mixrate.h" #define ALIGNED __attribute__ ((aligned(4)))
/****************************************************************************** * * This file is part of openDarkEngine project * Copyright (C) 2005-2009 openDarkEngine 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 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 * * $Id$ * *****************************************************************************/ #ifndef __PHYSSPHEREMODEL_H #define __PHYSSPHEREMODEL_H #include "PhysModel.h" namespace Opde { /** @brief Spherical physics model. * Model that is consisted of a sphere. */ class PhysSphereModel : public PhysModel { public: PhysSphereModel(int objid); ~PhysSphereModel(); }; } // namespace Opde #endif
// mldatepicker.h // // A Calendar Widget. // // (C) Copyright 2002-2007 Fred Gleason <fredg@paravelsystems.com> // // $Id: mldatepicker.h,v 1.3 2010/11/22 13:11:40 cvs Exp $ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU Library 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., 675 Mass Ave, Cambridge, MA 02139, USA. // #ifndef MLDATEPICKER_H #define MLDATEPICKER_H #include <QtGui/QWidget> #include <QtGui/QSizePolicy> #include <QtGui/QPushButton> #include <QtGui/QColor> #include <QtCore/QString> #include <QtCore/QDateTime> #include <QtGui/QLabel> #include <QtGui/QComboBox> #include <QtGui/QSpinBox> #include <QtGui/QMouseEvent> // // Display Settings // #define MLDATEPICKER_X_ORIGIN 20 #define MLDATEPICKER_X_INTERVAL 25 #define MLDATEPICKER_Y_ORIGIN 30 #define MLDATEPICKER_Y_INTERVAL 20 class MLDatePicker : public QWidget { Q_OBJECT public: MLDatePicker(int low_year,int high_year,QWidget *parent=0, const char *name=0); ~MLDatePicker(); QSize sizeHint() const; QSizePolicy sizePolicy() const; QDate date() const; bool setDate(QDate date); private slots: void monthActivatedData(int id); void yearActivatedData(int id); void yearChangedData(int year); protected: void mousePressEvent(QMouseEvent *e); private: void PrintDays(); void PrintDay(int day,int dow_offset); void SelectDay(int day,int dow_offset,bool state); QComboBox *pick_month_box; QComboBox *pick_year_box; QSpinBox *pick_year_spin; QLabel *pick_date_label[6][7]; QDate pick_date; int pick_low_year; int pick_high_year; }; #endif // MLDATEPICKER_H
/*RBP = cpu_state + 128 R12 = ram (if block->flags & CODEBLOCK_NO_IMMEDIATES)*/ #define REG_AX 0 #define REG_CX 1 #define REG_DX 2 #define REG_BX 3 #define REG_SP 4 #define REG_BP 5 #define REG_SI 6 #define REG_DI 7 #define REG_EAX 0 #define REG_ECX 1 #define REG_EDX 2 #define REG_EBX 3 #define REG_ESP 4 #define REG_EBP 5 #define REG_ESI 6 #define REG_EDI 7 #define REG_RAX 0 #define REG_RCX 1 #define REG_RDX 2 #define REG_RBX 3 #define REG_RSP 4 #define REG_RBP 5 #define REG_RSI 6 #define REG_RDI 7 #define REG_R8 8 #define REG_R9 9 #define REG_R10 10 #define REG_R11 11 #define REG_R12 12 #define REG_R13 13 #define REG_R14 14 #define REG_R15 15 #define REG_XMM0 0 #define REG_XMM1 1 #define REG_XMM2 2 #define REG_XMM3 3 #define REG_XMM4 4 #define REG_XMM5 5 #define REG_XMM6 6 #define REG_XMM7 7 #define REG_XMM_TEMP REG_XMM7 #define CODEGEN_HOST_REGS 3 #define CODEGEN_HOST_FP_REGS 7 extern void *codegen_mem_load_byte; extern void *codegen_mem_load_word; extern void *codegen_mem_load_long; extern void *codegen_mem_load_quad; extern void *codegen_mem_load_single; extern void *codegen_mem_load_double; extern void *codegen_mem_store_byte; extern void *codegen_mem_store_word; extern void *codegen_mem_store_long; extern void *codegen_mem_store_quad; extern void *codegen_mem_store_single; extern void *codegen_mem_store_double; extern void *codegen_gpf_rout; extern void *codegen_exit_rout;
#ifndef SYMBOL_PICKER_H #define SYMBOL_PICKER_H #include "image_processor_data.h" // Class implements symbol selector, // depending of color class SymbolPicker { public: // Constructors SymbolPicker(); SymbolPicker(const ImageProcessorData &); // Destructor ~SymbolPicker(); // Method for selecting a symbol, // depending of color QChar pickTheSymbol(const QRgb &); private: // Pointer to ImageProcessorData class object ImageProcessorData *Data; }; #endif // SYMBOL_PICKER_H
/* * Copyright (C) 2013 Fusion IO. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 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., 59 Temple Place - Suite 330, * Boston, MA 021110-1307, USA. */ #ifndef __BTRFS_TESTS #define __BTRFS_TESTS #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS #define test_msg(fmt, ...) pr_info("BTRFS: selftest: " fmt, ##__VA_ARGS__) struct btrfs_root; int btrfs_test_free_space_cache(void); int btrfs_test_extent_buffer_operations(void); int btrfs_test_extent_io(void); int btrfs_test_inodes(void); int btrfs_test_qgroups(void); #ifdef CONFIG_BTRFS_ZADARA int zbtrfs_test_zjournal(void); int zbtrfs_test_ztenant(void); struct btrfs_fs_info; int zbtrfs_test_fs_ztenant(struct btrfs_fs_info *fs_info); #endif /*CONFIG_BTRFS_ZADARA*/ int btrfs_init_test_fs(void); void btrfs_destroy_test_fs(void); struct inode *btrfs_new_test_inode(void); struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void); void btrfs_free_dummy_root(struct btrfs_root *root); #else static inline int btrfs_test_free_space_cache(void) { return 0; } static inline int btrfs_test_extent_buffer_operations(void) { return 0; } static inline int btrfs_init_test_fs(void) { return 0; } static inline void btrfs_destroy_test_fs(void) { } static inline int btrfs_test_extent_io(void) { return 0; } static inline int btrfs_test_inodes(void) { return 0; } static inline int btrfs_test_qgroups(void) { return 0; } #ifdef CONFIG_BTRFS_ZADARA static inline int zbtrfs_test_zjournal(void) { return 0; } static inline int zbtrfs_test_ztenant(void) { return 0; } #endif /*CONFIG_BTRFS_ZADARA*/ #endif #endif
/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * getopt.c: Uses getopt to fetch the command line options. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * 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 * * $Id: getopt.c 786 2006-08-27 08:48:04Z michael $ */ #include "stdinc.h" #include "ircd_getopt.h" #define OPTCHAR '-' static void usage(const char *name); void parseargs(int *argc, char ***argv, struct lgetopt *opts) { int i; char *progname = (*argv)[0]; /* loop through each argument */ for (;;) { int found = 0; (*argc)--; (*argv)++; if (*argc < 1) { return; } /* check if it *is* an arg.. */ if ((*argv)[0][0] != OPTCHAR) { return; } (*argv)[0]++; /* search through our argument list, and see if it matches */ for (i = 0; opts[i].opt; i++) { if (!strcmp(opts[i].opt, (*argv)[0])) { /* found our argument */ found = 1; switch (opts[i].argtype) { case YESNO: *((int *)opts[i].argloc) = 1; break; case INTEGER: if (*argc < 2) { fprintf(stderr, "Error: option '%c%s' requires an argument\n", OPTCHAR, opts[i].opt); usage((*argv)[0]); } *((int *)opts[i].argloc) = atoi((*argv)[1]); (*argc)--; (*argv)++; break; case STRING: if (*argc < 2) { fprintf(stderr, "error: option '%c%s' requires an argument\n", OPTCHAR, opts[i].opt); usage(progname); } *((char**)opts[i].argloc) = malloc(strlen((*argv)[1]) + 1); strcpy(*((char**)opts[i].argloc), (*argv)[1]); (*argc)--; (*argv)++; break; case USAGE: usage(progname); /*NOTREACHED*/ default: fprintf(stderr, "Error: internal error in parseargs() at %s:%d\n", __FILE__, __LINE__); exit(EXIT_FAILURE); } } } if (!found) { fprintf(stderr, "error: unknown argument '%c%s'\n", OPTCHAR, (*argv)[0]); usage(progname); } } } static void usage(const char *name) { int i; fprintf(stderr, "Usage: %s [options]\n", name); fprintf(stderr, "Where valid options are:\n"); for (i = 0; myopts[i].opt; i++) { fprintf(stderr, "\t%c%-10s %-20s%s\n", OPTCHAR, myopts[i].opt, (myopts[i].argtype == YESNO || myopts[i].argtype == USAGE) ? "" : myopts[i].argtype == INTEGER ? "<number>" : "<string>", myopts[i].desc); } exit(EXIT_FAILURE); }
#ifndef MusicPlayer_h #define MusicPlayer_h #include "Arduino.h" #include "WaveHC.h" #include "WaveUtil.h" class MusicPlayer { public: MusicPlayer(); // Init must be called before using MusicPlayer! Returns false on error. bool Init(); void Play(); void Stop(); void Pause(); bool IsPaused(); void Resume(); void NextPlaylist(); bool NextSong(); long GetNormalPlaybackRate(); void SetPlaybackRate(long rate); // Checks to see if the current song has ended, and, if so, plays the next one. // TODO: Need to figure out how to listen to the WaveHC timer so I don't need this dumb method. void KeepPlaying(); private: SdReader card; // This object holds the information for the card FatVolume vol; // This holds the information for the partition on the card FatReader root; // This holds the information for the volumes root directory FatReader playlist; // Current playlist dir dir_t dirBuf; // Buffer for directory reads FatReader song; // This object represent the WAV file WaveHC wave; // This is the only wave (audio) object, since we will only play one at a time }; #endif MusicPlayer_h
/* * This file is part of the KDE libraries * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be> * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * 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 DRIVERITEM_H #define DRIVERITEM_H #include <tqlistview.h> class DrBase; class DriverItem : public TQListViewItem { public: DriverItem(TQListView *parent, DrBase *item); DriverItem(TQListViewItem *parent, TQListViewItem *after, DrBase *item); void updateText(); void updateTextRecursive(); DrBase* drItem() const { return m_item; } bool hasConflict() { return m_conflict; } bool updateConflict(); void paintCell(TQPainter*, const TQColorGroup&, int, int, int); private: DrBase *m_item; bool m_conflict; }; #endif
/* many odd sized allocations and interspersed frees */ #include <assert.h> #include <stdlib.h> #include "mem.h" int main() { assert(Mem_Init(4096) == 0); void * ptr[9]; ptr[0] = Mem_Alloc(1); ptr[1] = (Mem_Alloc(5)); ptr[2] = (Mem_Alloc(14)); ptr[3] = (Mem_Alloc(8)); assert(ptr[0] != NULL); assert(ptr[1] != NULL); assert(ptr[2] != NULL); assert(ptr[3] != NULL); assert(Mem_Free(ptr[1]) == 0); assert(Mem_Free(ptr[0]) == 0); assert(Mem_Free(ptr[3]) == 0); Mem_Dump(); ptr[4] = (Mem_Alloc(1)); ptr[5] = (Mem_Alloc(4)); assert(ptr[4] != NULL); assert(ptr[5] != NULL); assert(Mem_Free(ptr[5]) == 0); ptr[6] = (Mem_Alloc(9)); ptr[7] = (Mem_Alloc(33)); assert(ptr[6] != NULL); assert(ptr[7] != NULL); assert(Mem_Free(ptr[4]) == 0); ptr[8] = (Mem_Alloc(55)); assert(ptr[8] != NULL); assert(Mem_Free(ptr[2]) == 0); assert(Mem_Free(ptr[7]) == 0); assert(Mem_Free(ptr[8]) == 0); assert(Mem_Free(ptr[6]) == 0); Mem_Dump(); exit(0); }
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2012 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sterling Hughes <sterling@php.net> | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef SYSLOG_H #define SYSLOG_H #define WIN32_LEAN_AND_MEAN #include <windows.h> #define LOG_EMERG 1 #define LOG_ALERT 1 #define LOG_CRIT 1 #define LOG_ERR 4 #define LOG_WARNING 5 #define LOG_NOTICE 6 #define LOG_INFO 6 #define LOG_DEBUG 6 #define LOG_PRIMASK 0x07 #define LOG_PRI(p) ((p) & LOG_PRIMASK) #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) #define LOG_KERN (0<<3) #define LOG_USER (1<<3) #define LOG_MAIL (2<<3) #define LOG_DAEMON (3<<3) #define LOG_AUTH (4<<3) #define LOG_SYSLOG (5<<3) #define LOG_LPR (6<<3) #define LOG_NEWS (7<<3) #define LOG_UUCP (8<<3) #define LOG_CRON (9<<3) #define LOG_AUTHPRIV (10<<3) #define LOG_NFACILITIES 10 #define LOG_FACMASK 0x03f8 #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) #define LOG_MASK(pri) (1 << (pri)) #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* * Option flags for openlog. * * LOG_ODELAY no longer does anything. * LOG_NDELAY is the inverse of what it used to be. */ #define LOG_PID 0x01 /* log the pid with each message */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ #define LOG_PERROR 0x20 /* log to stderr as well */ extern void closelog(void); extern void openlog(const char *, int, int); extern void syslog(int, const char *, ...); #endif /* SYSLOG_H */
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __javax_swing_ToggleButtonModel__ #define __javax_swing_ToggleButtonModel__ #pragma interface #include <javax/swing/DefaultButtonModel.h> extern "Java" { namespace javax { namespace swing { class ToggleButtonModel; class JComponent; } } } class javax::swing::ToggleButtonModel : public ::javax::swing::DefaultButtonModel { public: // actually package-private ToggleButtonModel (::javax::swing::JComponent *); public: virtual void setPressed (jboolean); static ::java::lang::Class class$; }; #endif /* __javax_swing_ToggleButtonModel__ */
/* Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com> This file is part of GlusterFS. This file is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. */ #ifndef __QB_MEM_TYPES_H__ #define __QB_MEM_TYPES_H__ #include "mem-types.h" enum gf_qb_mem_types_ { gf_qb_mt_qb_conf_t = gf_common_mt_end + 1, gf_qb_mt_qb_inode_t, gf_qb_mt_qb_local_t, gf_qb_mt_coroutinesynctask_t, gf_qb_mt_end }; #endif
const unsigned char F6x8[][6] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // sp { 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00 }, // ! { 0x00, 0x00, 0x07, 0x00, 0x07, 0x00 }, // " { 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 }, // # { 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12 }, // $ { 0x00, 0x62, 0x64, 0x08, 0x13, 0x23 }, // % { 0x00, 0x36, 0x49, 0x55, 0x22, 0x50 }, // & { 0x00, 0x00, 0x06, 0x09, 0x06, 0x00 }, // ° { 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00 }, // ( { 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 }, // ) { 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14 }, // * { 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08 }, // + { 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00 }, // , { 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 }, // - { 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 }, // . { 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 }, // / { 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 { 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1 { 0x00, 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2 { 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3 { 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4 { 0x00, 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5 { 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6 { 0x00, 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7 { 0x00, 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8 { 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9 { 0x00, 0x00, 0x36, 0x36, 0x00, 0x00 }, // : { 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 }, // ; { 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 }, // < { 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 }, // = { 0x00, 0x00, 0x41, 0x22, 0x14, 0x08 }, // > { 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 }, // ? { 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E }, // @ { 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C }, // A { 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B { 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C { 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D { 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E { 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F { 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G { 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H { 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I { 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J { 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K { 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L { 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M { 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N { 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O { 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P { 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q { 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R { 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 }, // S { 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T { 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U { 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V { 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W { 0x00, 0x63, 0x14, 0x08, 0x14, 0x63 }, // X { 0x00, 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y { 0x00, 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z { 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [ { 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55 }, // \ { 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00 }, // ] { 0x00, 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^ { 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 }, // _ { 0x00, 0x00, 0x01, 0x02, 0x04, 0x00 }, // ' { 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 }, // a { 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b { 0x00, 0x38, 0x44, 0x44, 0x44, 0x20 }, // c { 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F }, // d { 0x00, 0x38, 0x54, 0x54, 0x54, 0x18 }, // e { 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f { 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C }, // g { 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h { 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i { 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00 }, // j { 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k { 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l { 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m { 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n { 0x00, 0x38, 0x44, 0x44, 0x44, 0x38 }, // o { 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18 }, // p { 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC }, // q { 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r { 0x00, 0x48, 0x54, 0x54, 0x54, 0x20 }, // s { 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t { 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u { 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v { 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w { 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 }, // x { 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // y { 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z { 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 } // horizontal lines };
/***********************************************************************/ /* */ /* MODULE: 711x_common.h */ /* DATE: 96/12/19 */ /* PURPOSE: Define addresses of major hardware components of */ /* BCM711X */ /* */ /***********************************************************************/ /* Copyright (c) 1999-2005, Broadcom Corporation * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __BCM7115_H #define __BCM7115_H #if __cplusplus extern "C" { #endif /********************************************************************** *generic GET_FIELD & SET_FIELD **********************************************************************/ /** * m = memory, c = core, r = register, f = field, d = data. */ #if !defined(GET_FIELD) && !defined(SET_FIELD) #define BRCM_ALIGN(c,r,f) c##_##r##_##f##_ALIGN #define BRCM_BITS(c,r,f) c##_##r##_##f##_BITS #define BRCM_MASK(c,r,f) c##_##r##_##f##_MASK #define BRCM_SHIFT(c,r,f) c##_##r##_##f##_SHIFT #define GET_FIELD(m,c,r,f) \ ((((m) & BRCM_MASK(c,r,f)) >> BRCM_SHIFT(c,r,f)) << BRCM_ALIGN(c,r,f)) #define SET_FIELD(m,c,r,f,d) \ ((m) = (((m) & ~BRCM_MASK(c,r,f)) | ((((d) >> BRCM_ALIGN(c,r,f)) << \ BRCM_SHIFT(c,r,f)) & BRCM_MASK(c,r,f))) \ ) #define SET_TYPE_FIELD(m,c,r,f,d) SET_FIELD(m,c,r,f,c##_##d) #define SET_NAME_FIELD(m,c,r,f,d) SET_FIELD(m,c,r,f,c##_##r##_##f##_##d) #define SET_VALUE_FIELD(m,c,r,f,d) SET_FIELD(m,c,r,f,d) #endif /* GET & SET */ /********************************************************************** * Base addresses **********************************************************************/ #define MINITITAN_ADR_BASE 0xffe00000 /* Minititan 1MB, 0xfffe,0000-0xffef0000 */ #define IDE_ADR_BASE 0xfffb0000 /* IDE 64KB, 0xfffb,0000-0xfffb,ffff */ #define XPT_ADR_BASE 0xfffc0000 /* Transport 32KB, 0xfffc,0000-0xfffc,7fff */ #define VIDEO_ADR_BASE 0xfffc8000 /* Video Display */ #define BGE_ADR_BASE 0xfffc8c00 /* Graphic 32KB, 0xfffc,8000-0xfffc,ffff */ #define PCM_AUDIO_ADR_BASE 0xfffc8800 /* PCM Audio */ #define MEM_DMA_ADR_BASE 0xfffc8f00 /* Memory DMA */ #define ADP_ADR_BASE 0xfffd0000 /* Audio 16KB, 0xfffd,0000-0xfffd,3fff */ #define BTSC_ADR_BASE 0xfffd4000 /* BTSC, 16KB, 0xfffd,4000-0xfffd,7fff*/ #define UPG_ADR_BASE 0xfffe0000 /* UPG, 512B, 0xfffe,0000-0xfffe,01ff */ #define QAM_ADR_BASE 0xfffe0000 /* QAM Base */ #define QAM_OB_ADR_BASE 0xfffe0200 /* QAM OB, 256B, 0xfffe,0200-0xfffe,02ff */ #define QAM_IB_ADR_BASE 0xfffe0300 /* QAM IB, 256B, 0xfffe,0300-0xfffe,03ff */ #define US_ADR_BASE 0xfffe0400 /* Upstream, 512B, 0xfffe,0400-0xfffe,05ff */ #define INTC_ADR_BASE 0xfffe0600 /* interrupts controller registers */ #define TIMR_ADR_BASE 0xfffe0700 /* timer registers */ #define BRIDGE_ADR_BASE 0xfffe0900 /* Bridge ACC, 256B, 0xfffe,0900-0xfffe,09ff */ #define DAVIC_ADR_BASE 0xfffe0a00 /* Davic MAC, 512B, 0xfffe,0a00-0xfffe,0bff */ #define DMA_ADR_BASE 0xfffe6000 /* DMA control registers */ #define EBI_ADR_BASE 0xfffe7000 /* EBI control registers */ #define TM_TOP_ADR_BASE 0xfffe8000 /* TM_TOP, 256B */ #define USB_HOST_ADR_BASE 0xfffe8100 /* USB Host, 256B */ #define USB_DEV_ADR_BASE 0xfffe8200 /* USB Device, 256B */ #define PID_FIL_ADR_BASE 0xfffe8400 /* PID Filter */ #define MODEM_ADR_BASE 0xfffe8500 /* soft modem, 256B*/ #define PROBE_ADR_BASE 0xff200000 /* probe (ejata) */ #define DSU_ADR_BASE 0xff300000 /* dsu (ejtag) */ #define DDR_BASE_ADR_REG MINITITAN_ADR_BASE /* SDRAM base address reg */ /******************************************************************* BCM7115 Modules *******************************************************************/ #include "bcm711x_cpu.h" #include "bcmupg.h" /* definitions for UPG section of BCM711x */ #include "bcmqamds.h" #include "bcmqamob.h" #include "bcmqamus.h" #include "bcmebi.h" #include "bcmdma.h" #include "bcmtimer.h" #include "bcmintc.h" #include "bcmpcmreg.h" /* Pcm Registers */ #include "bcmvideoreg.h" /* Video Registers */ #include "bcmbgereg.h" /* Video Registers */ #if __cplusplus } #endif #endif
// Copyright (c) 2005, Google 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 Google Inc. 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. // --- // This file is a compatibility layer that defines Google's version of // command line flags that are used for configuration. // // We put flags into their own namespace. It is purposefully // named in an opaque way that people should have trouble typing // directly. The idea is that DEFINE puts the flag in the weird // namespace, and DECLARE imports the flag from there into the // current namespace. The net result is to force people to use // DECLARE to get access to a flag, rather than saying // extern bool FLAGS_logtostderr; // or some such instead. We want this so we can put extra // functionality (like sanity-checking) in DECLARE if we want, // and make sure it is picked up everywhere. // // We also put the type of the variable in the namespace, so that // people can't DECLARE_int32 something that they DEFINE_bool'd // elsewhere. #ifndef BASE_COMMANDLINEFLAGS_H_ #define BASE_COMMANDLINEFLAGS_H_ #include "tcconfig.h" #include <string> #include <string.h> // for memchr #include <stdlib.h> // for getenv #include "base/basictypes.h" #define DECLARE_VARIABLE(type, name) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##type##_instead { \ extern PERFTOOLS_DLL_DECL type FLAGS_##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_##type##_instead::FLAGS_##name #define DEFINE_VARIABLE(type, name, value, meaning) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##type##_instead { \ PERFTOOLS_DLL_DECL type FLAGS_##name(value); \ char FLAGS_no##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_##type##_instead::FLAGS_##name // bool specialization #define DECLARE_bool(name) \ DECLARE_VARIABLE(bool, name) #define DEFINE_bool(name, value, meaning) \ DEFINE_VARIABLE(bool, name, value, meaning) // int32 specialization #define DECLARE_int32(name) \ DECLARE_VARIABLE(int32, name) #define DEFINE_int32(name, value, meaning) \ DEFINE_VARIABLE(int32, name, value, meaning) // int64 specialization #define DECLARE_int64(name) \ DECLARE_VARIABLE(int64, name) #define DEFINE_int64(name, value, meaning) \ DEFINE_VARIABLE(int64, name, value, meaning) #define DECLARE_uint64(name) \ DECLARE_VARIABLE(uint64, name) #define DEFINE_uint64(name, value, meaning) \ DEFINE_VARIABLE(uint64, name, value, meaning) // double specialization #define DECLARE_double(name) \ DECLARE_VARIABLE(double, name) #define DEFINE_double(name, value, meaning) \ DEFINE_VARIABLE(double, name, value, meaning) // Special case for string, because we have to specify the namespace // std::string, which doesn't play nicely with our FLAG__namespace hackery. #define DECLARE_string(name) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ extern std::string FLAGS_##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name #define DEFINE_string(name, value, meaning) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ std::string FLAGS_##name(value); \ char FLAGS_no##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name // These macros (could be functions, but I don't want to bother with a .cc // file), make it easier to initialize flags from the environment. #define EnvToString(envname, dflt) \ (!getenv(envname) ? (dflt) : getenv(envname)) #define EnvToBool(envname, dflt) \ (!getenv(envname) ? (dflt) : memchr("tTyY1\0", getenv(envname)[0], 6) != NULL) #define EnvToInt(envname, dflt) \ (!getenv(envname) ? (dflt) : strtol(getenv(envname), NULL, 10)) #define EnvToInt64(envname, dflt) \ (!getenv(envname) ? (dflt) : strtoll(getenv(envname), NULL, 10)) #define EnvToDouble(envname, dflt) \ (!getenv(envname) ? (dflt) : strtod(getenv(envname), NULL)) #endif // BASE_COMMANDLINEFLAGS_H_
/* * Copyright (c) 2019 Eric Christoffersen (impolexg@outlook.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 */ #if !defined(BICYCLESIM_H) #define BICYCLESIM_H #include "RealtimeData.h" #include "PhysicsUtility.h" #include <chrono> class BicycleWheel { double m_massKG, m_I, m_equivalentMassKG; public: BicycleWheel(double outerR, // outer radius in meters (for circumference) double innerR, // inner rim radius double weightKG, // total wheel weight double centerWeightKG, double spokeCount, double spokeMass); BicycleWheel() {} double KEMass() const { return MassKG() + EquivalentMassKG(); } double MassKG() const { return m_massKG; } double EquivalentMassKG() const { return m_equivalentMassKG; } double I() const { return m_I; } }; struct BicycleConstants { double m_crr; // coefficient rolling resistance double m_Cm; // coefficient of powertrain loss double m_Cd; // coefficient of drag double m_A; // frontal area (m2) double m_T; // temp in kelvin BicycleConstants() : m_crr(0.004), m_Cm(1.0), m_Cd(1.0 - 0.0045), m_A(0.5), m_T(293.15) {} BicycleConstants(double crr, double Cm, double Cd, double A, double T) : m_crr(crr), m_Cm(Cm), m_Cd(Cd), m_A(A), m_T(T) {} }; struct SpeedDistance { double v, d; }; class BicycleSimState { enum Names { eWatts = 0, eAltitude, eSlope, eLastName }; double v[eLastName]; public: double Watts() const { return (v[eWatts]); } double Altitude()const { return (v[eAltitude]); } double Slope() const { return (v[eSlope]); } double& Watts() { return (v[eWatts]); } double& Altitude() { return (v[eAltitude]); } double& Slope() { return (v[eSlope]); } void Clear() { for (int i = 0; i < eLastName; i++) { v[i] = 0.0; } } BicycleSimState() {} BicycleSimState(const RealtimeData &rtData) { Clear(); this->Altitude() = rtData.getAltitude(); this->Slope() = rtData.getSlope(); this->Watts() = rtData.getWatts(); } // Linear interpolate all fields to new sim state. static BicycleSimState Interpolate(const BicycleSimState &v0, const BicycleSimState &v1, double t0, double t1, double t) { if (t == t0) return v0; if (t == t1) return v1; double p = (t - t0) / (t1 - t0); BicycleSimState r; for (int i = 0; i < eLastName; i++) { r.v[i] = (v1.v[i] - v0.v[i]) * p + v0.v[i]; } return r; } }; class Bicycle { // Invariant bicycle and rider properties. BicycleConstants m_constants; BicycleWheel m_frontWheel, m_rearWheel; double m_bicycleMassWithoutWheelsKG, m_riderMassKG; double m_KEMass; // effective mass used for computing kinetic energy // Dynamic data persisted for modelling momentum. BicycleSimState m_state; double m_Velocity; // velocity in meters per second. bool m_isFirstSample; std::chrono::high_resolution_clock::time_point m_prevSampleTime; void Init(BicycleConstants constants, double riderWeightKG, double bicycleMassWithoutWheelsKG, BicycleWheel frontWheel, BicycleWheel rearWheel); double SampleDT(); // Gather sample time stamp and return dt (in seconds) double FilterWattIncrease(double watts); // Reduce power spikes by limiting power growth per sample period public: Bicycle(Context* context, BicycleConstants constants, double riderWeightKG, double bicycleMassWithoutWheelsKG, BicycleWheel frontWheel, BicycleWheel rearWheel); Bicycle(Context* context); SpeedDistance SampleSpeed(BicycleSimState &newState); double MassKG() const; // Actual mass of bike and rider. double EquivalentMassKG() const; // Additional mass due to rotational inertia double KEMass() const; // Total effective kinetic mass const BicycleWheel &FrontWheel() const { return m_frontWheel; } const BicycleWheel &RearWheel() const { return m_rearWheel; } // Reset timer. This forces next sample to use 0.1s as its dt. void reset() { m_isFirstSample = true; } // Restart sim. Reset time and all history. void clear() { m_Velocity = 0.0; reset(); this->m_state.Clear(); } double KEFromV(double v) const; // Compute kinetic energy of bike and rider (J) at speed v (in m/s) double VFromKE(double ke) const; // Compute velocity (m/s) from kinetic energy of bike and rider (J) double WattsForV(const BicycleSimState &simState, double v) const; // Compute new velocity in m/s after simState applied for dt seconds. double V(const BicycleSimState &simState, // current sim state double v, // current velocity (m/s) double dt) const; // impulse duration double DV(const BicycleSimState &simState, // current sim state double v) const; // current velocity }; #endif // BICYCLESIM_H
// -*- C++ -*- // // 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 // // Copyright (c) Dimitry Kloper <kloper@users.sf.net> 2002-2012 // // This file is a part of the Scooter project. // // boxfish_cfg.h -- configuration facility, constructs a simple // XML configuration file // #ifndef _boxfish_cfg_h_ #define _boxfish_cfg_h_ #include <string> #include <vector> #include <boost/program_options.hpp> #include <QtCore/QObject> #include <QtCore/QString> #include <QtXml/QDomDocument> #include <QtXml/QDomElement> namespace boxfish { class Config: public QObject { Q_OBJECT public: Config(); virtual ~Config(); std::vector<std::string> init(int argc, char **argv); std::vector<std::string> init(std::vector<std::string> args); QString path() const; bool is_writable() const; bool is_readable() const; bool defined( const QString &key ); QString get( const QString &key ); QString cwd() const; bool cwd( const QString &key ); QString undef( const QString &key ); public slots: void relocate( const QString &p ); void set( const QString &key, const QString& value ); void remove( const QString& key ); void flush(); void revert(); signals: void usage_requested( QString message ); void bad_option( QString message ); void bad_xml( QString message ); void read_denied( QString message ); void write_denied( QString message ); protected: QString default_path() const; QDomElement find( const QString& k, int *suffix ); void load_defaults(); std::vector<std::string> init( boost::program_options::command_line_parser &parser); public: typedef boost::shared_ptr<Config> shared_reference; public: static shared_reference create(); static shared_reference main(); private: QString m_path; QDomDocument *m_doc; QDomElement m_cwd; bool m_dirty; static shared_reference m_global_cfg; }; }; // end of namespace boxfish #endif /* _boxfish_cfg_h_ */ // // boxfish_cfg.h -- end of file //
/* IEEE754 floating point arithmetic * single precision */ /* * MIPS floating point support * Copyright (C) 1994-2000 Algorithmics Ltd. * * ######################################################################## * * This program is free software; you can distribute 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 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 "ieee754sp.h" ieee754sp ieee754sp_scalb(ieee754sp x, int n) { COMPXSP; CLEARCX; EXPLODEXSP; switch (xc) { case IEEE754_CLASS_SNAN: return ieee754sp_nanxcpt(x, "scalb", x, n); case IEEE754_CLASS_QNAN: case IEEE754_CLASS_INF: case IEEE754_CLASS_ZERO: return x; case IEEE754_CLASS_DNORM: SPDNORMX; break; case IEEE754_CLASS_NORM: break; } SPNORMRET2(xs, xe + n, xm << 3, "scalb", x, n); } ieee754sp ieee754sp_ldexp(ieee754sp x, int n) { return ieee754sp_scalb(x, n); }
/* * Error Corrected Code Controller (ECC) - System peripherals regsters. * Based on AT91SAM9260 datasheet revision B. * * Copyright (C) 2007 Andrew Victor * Copyright (C) 2007 Atmel Corporation. * * 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 ATMEL_NAND_ECC_H #define ATMEL_NAND_ECC_H #define ATMEL_ECC_CR 0x00 /* Control register */ #define ATMEL_ECC_RST (1 << 0) /* Reset parity */ #define ATMEL_ECC_MR 0x04 /* Mode register */ #define ATMEL_ECC_PAGESIZE (3 << 0) /* Page Size */ #define ATMEL_ECC_PAGESIZE_528 (0) #define ATMEL_ECC_PAGESIZE_1056 (1) #define ATMEL_ECC_PAGESIZE_2112 (2) #define ATMEL_ECC_PAGESIZE_4224 (3) #define ATMEL_ECC_SR 0x08 /* Status register */ #define ATMEL_ECC_RECERR (1 << 0) /* Recoverable Error */ #define ATMEL_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */ #define ATMEL_ECC_MULERR (1 << 2) /* Multiple Errors */ #ifdef CONFIG_MTD_NAND_ATMEL_ECC_HW_HSIAO #define ATMEL_ECC_PER_256 (1 << 4) #define ATMEL_ECC_PR0 0x0c #define ATMEL_ECC_PR1 0x10 #define ATMEL_ECC_SR2 0x14 #define ATMEL_ECC_PR2 0x18 #define ATMEL_ECC_PR3 0x1c #define ATMEL_ECC_PR4 0x20 #define ATMEL_ECC_PR5 0x24 #define ATMEL_ECC_PR6 0x28 #define ATMEL_ECC_PR7 0x2c #define ATMEL_ECC_PR8 0x30 #define ATMEL_ECC_PR9 0x34 #define ATMEL_ECC_PR10 0x38 #define ATMEL_ECC_PR11 0x3c #define ATMEL_ECC_PR12 0x40 #define ATMEL_ECC_PR13 0x44 #define ATMEL_ECC_PR14 0x48 #define ATMEL_ECC_PR15 0x4c #else #define ATMEL_ECC_PR 0x0c /* Parity register */ #define ATMEL_ECC_BITADDR (0xf << 0) /* Bit Error Address */ #define ATMEL_ECC_WORDADDR (0xfff << 4) /* Word Error Address */ #define ATMEL_ECC_NPR 0x10 /* NParity register */ #define ATMEL_ECC_NPARITY (0xffff << 0) /* NParity */ #endif /* CONFIG_MTD_NAND_ATMEL_ECC_HW_HSIAO */ #endif
/* Copyright (C) 2002-2009 Paul Davis 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 __gtk_ardour_port_matrix_component_h__ #define __gtk_ardour_port_matrix_component_h__ #include <gtkmm/eventbox.h> class PortMatrixBody; /** One component of the PortMatrix. This is a cairo-rendered * Pixmap. */ class PortMatrixComponent { public: PortMatrixComponent (PortMatrixBody *); virtual ~PortMatrixComponent (); void setup (); GdkPixmap* get_pixmap (GdkDrawable *); std::pair<uint32_t, uint32_t> dimensions (); void require_render () { _render_required = true; } void require_rebuild () { _dimension_computation_required = true; _render_required = true; } /** @return width of columns in the grid */ static uint32_t column_width () { return 32; } /** @return height of rows in the grid */ static uint32_t row_height () { return 32; } protected: /** @return width of borders drawn around labels */ static uint32_t label_border_width () { return 1; } /** @return padding between a name and the nearest line */ static uint32_t name_pad () { return 8; } /** @return width of thin lines in the grid */ static uint32_t thin_grid_line_width () { return 1; } /** @return width of thick lines in the grid */ static uint32_t thick_grid_line_width () { return 2; } /** @return space around the connection indicator */ static uint32_t connection_indicator_pad () { return 8; } /** @return angle of column labels, in radians */ static double angle () { return M_PI / 4; } /* XXX I guess these colours should come from a theme, or something */ /** @return background colour */ static Gdk::Color background_colour () { return Gdk::Color ("#000000"); } /** @return text colour */ static Gdk::Color text_colour () { return Gdk::Color ("#ffffff"); } /** @return grid line colour */ static Gdk::Color grid_colour () { return Gdk::Color ("#333333"); } /** @return colour of association blobs */ static Gdk::Color association_colour () { return Gdk::Color ("#00ff00"); } /** @return colour to paint grid squares when they can't be associated */ static Gdk::Color unknown_colour () { return Gdk::Color ("#cccccc"); } /* XXX */ static Gdk::Color get_a_bundle_colour (int x) { if ((x % 2) == 0) { return Gdk::Color ("#547027"); } else { return Gdk::Color ("#3552a6"); } } void set_source_rgb (cairo_t *, Gdk::Color const &); void set_source_rgba (cairo_t *, Gdk::Color const &, double); /** Render the complete component to a cairo context. */ virtual void render (cairo_t *) = 0; /** Compute any required dimensions. This must set up * _width and _height. */ virtual void compute_dimensions () = 0; PortMatrixBody* _body; ///< the PortMatrixBody that we're in uint32_t _width; ///< full width of the contents uint32_t _height; ///< full height of the contents private: GdkPixmap* _pixmap; ///< pixmap bool _render_required; ///< true if the rendered pixmap is out of date bool _dimension_computation_required; ///< true if the dimensions are out of date }; #endif
#include <defs.h> #include <stdio.h> #include <string.h> #include <console.h> #include <kdebug.h> #include <picirq.h> #include <trap.h> #include <clock.h> #include <intr.h> #include <pmm.h> #include <kmonitor.h> #include <trap.h> int kern_init(void) __attribute__((noreturn)); void grade_backtrace(void); static void lab1_switch_test(void); int kern_init(void) { extern char edata[], end[]; memset(edata, 0, end - edata); cons_init(); // init the console const char *message = "(THU.CST) os is loading ..."; cprintf("%s\n\n", message); print_kerninfo(); grade_backtrace(); pmm_init(); // init physical memory management pic_init(); // init interrupt controller idt_init(); // init interrupt descriptor table clock_init(); // init clock interrupt intr_enable(); // enable irq interrupt //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test() // user/kernel mode switch test lab1_switch_test(); /* do nothing */ while (1); } void __attribute__((noinline)) grade_backtrace2(int arg0, int arg1, int arg2, int arg3) { mon_backtrace(0, NULL, NULL); } void __attribute__((noinline)) grade_backtrace1(int arg0, int arg1) { grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1); } void __attribute__((noinline)) grade_backtrace0(int arg0, int arg1, int arg2) { grade_backtrace1(arg0, arg2); } void grade_backtrace(void) { grade_backtrace0(0, (int)kern_init, 0xffff0000); } static void lab1_print_cur_status(void) { static int round = 0; uint16_t reg1, reg2, reg3, reg4; asm volatile ( "mov %%cs, %0;" "mov %%ds, %1;" "mov %%es, %2;" "mov %%ss, %3;" : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4)); cprintf("%d: @ring %d\n", round, reg1 & 3); cprintf("%d: cs = %x\n", round, reg1); cprintf("%d: ds = %x\n", round, reg2); cprintf("%d: es = %x\n", round, reg3); cprintf("%d: ss = %x\n", round, reg4); round ++; } static void lab1_switch_to_user(void) { //LAB1 CHALLENGE 1 : 2011011384 //subl $8, %esp is a very tricky way "pad" the struct //In this way, although we trap from kernel to kernel, //tf->tf_esp and tf->tf_ss point to the memory we padded here. //So we can access and modify these fields without corrupting the kernel asm volatile ( "subl $8, %%esp\n" "int %0\n" "movl %%ebp, %%esp" : :"i" (T_SWITCH_TOU) ); } static void lab1_switch_to_kernel(void) { //LAB1 CHALLENGE 1 : 2011011384 //movl %ebp, %esp forces to clear the stack asm volatile ( "int %0\n" "movl %%ebp, %%esp" : :"i" (T_SWITCH_TOK) ); } static void lab1_switch_test(void) { lab1_print_cur_status(); #ifndef DEBUG_GRADE while(cons_getc() != '3'); #endif cprintf("+++ switch to user mode +++\n"); lab1_switch_to_user(); lab1_print_cur_status(); #ifndef DEBUG_GRADE while(cons_getc() != '0'); #endif cprintf("+++ switch to kernel mode +++\n"); lab1_switch_to_kernel(); lab1_print_cur_status(); }
#pragma once #include <cstdio> #include <cassert> #include <memory> #include "game/common.h" // User Interface ////////////////////////////////////////////////////////////////////////////////////////////////////// namespace sdl { using namespace std; // Classes ///////////////////////////////////////////////////////////////////////////////////////////////////////// class Game { public: Game(); ~Game(); bool is_ok() const; bool run(); private: class Impl; unique_ptr<Impl> impl; }; // Functions /////////////////////////////////////////////////////////////////////////////////////////////////////// // Global Variables //////////////////////////////////////////////////////////////////////////////////////////////// }
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. * * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. */ #include <errno.h> #include <sys/types.h> #include <string.h> #include <stdlib.h> #include <argz.h> #include <envz.h> void envz_strip (char **envz, size_t *envz_len) { char *entry = 0; int len = 0; int null_found = 0; while((entry = argz_next(*envz, *envz_len, entry))) { if(!strchr(entry, '=')) { null_found = 1; len = strlen(entry) + 1; /* Make sure this is not the last entry in envz. If it is, it will be chopped off by the realloc anyway.*/ if(*envz + *envz_len != entry + len - 1) { memmove(entry, entry + len, *envz + *envz_len - entry - len); } *envz_len -= len; } } if(null_found) { *envz = (char *)realloc(*envz, *envz_len); } }
/************************************************************************ * Algorytm : Pracownia AiSD_B - Tabliczka Mnozenia * * URL : www.ii.uni.wroc.pl/~mbi/dyd/aisd_13s * * Autor : Marek Jenda * * Data : 2013-03-31 * * UWAGI : Algorytm w wersji alfa. Powinien pracowac w O(klogk), * * : ale z nieustalonych jeszcze powodow dziala dluzej. * ************************************************************************/ /// TODO : ogolna optymalizacja /// uporzadkowac zmienne, (niektorym dac mniejszy rozmiar) /// zoptymalizowac kolejke (umieszczanie elementu od korzenia?) /// eksperymentalnie ustalic wielkosc kolejki. /// moze cos jest nie tak z doborem elementow z tabliczki mnozenia do kolejki? #include <stdio.h> #include <stdlib.h> #define MAX_QUEUE 1000000 #define INF 1000000000001 typedef unsigned long long int ULL; ULL a[MAX_QUEUE]; int n; void ZmienElem(ULL* t, int i, ULL u); void PrzesunNizej(ULL* t, int i); void PrzesunWyzej(ULL* t, int i); void BudujKopiec(ULL* t); ULL FindMax(ULL* t); void DeleteMax(ULL* t); void InsertNode(ULL* t, ULL u); int main() { int i, j, m, k, l, o, bo, bl; ULL last = 0; // ostatnim wypisanym elementem jest 0 (element z poza listy) n = 0; // wielkosc kolejki = 0 bo = 1, bl = 0; // indeksy pozwalajace wypisywanie elementow z macierzy po skosie i od przekatnej w dol; scanf("%d %d", &m, &k); a[1] = (ULL)INF; // pozwala uniknac wejscia w pierwszego ifa w petli glownej. /// petla glowna: wypisuje elementy po skosie i od przekatnej w dol for(o = l = m; o > 0 && l > 0 && k > 0; o -= ((++bo) % 2), l -= ((++bl) % 2)) for(i = o, j = l; i <= m && j >= 1 && k > 0; i++, j--) { if((ULL)i*j > a[1]) { // jezeli element jest wiekszy od najwiekszego w kolejce to po prostu go wypisz last = a[1]; printf("%llu\n", a[1]); k--; } else { InsertNode(a, (ULL)i*j); // umiesc elemenet w kolejce if(n > MAX_QUEUE-10 && k > 0) { // jezeli zblizamy sie do konca kolejki to zacznij wypisywac elementy while(last == a[1]) // radz sobie z duplikatami DeleteMax(a); last = a[1]; printf("%llu\n", a[1]); DeleteMax(a); k--; } } } // to samo co w petli glownej, wypisywanie elementow. while(n > 0 && k > 0) { if(last == a[1]) { DeleteMax(a); continue; } last = a[1]; printf("%llu \n", a[1]); DeleteMax(a); k--; } return 0; } /// KOLEJKA PRIORYTETOWA TYPU MAX // oparta na strukturze tablicowej przekazywanej przez wskaznik. // UWAGA: Rozmiar kopca jest zawarty w zmiennej n bedacej zmienna globalna // zamienia elemen o podanym indeksie z nowym elemenetem void ZmienElem(ULL* t, int i, ULL u) { ULL x; x = t[i]; t[i] = u; if(u < x) { PrzesunNizej(t, i); } else PrzesunWyzej(t, i); } // przesuwa nizej elemen z podanego indeksu w celu uzyskania struktury kopca void PrzesunNizej(ULL* t, int i) { int k, j, doub; ULL s; k = i; do { j = k; doub = j << 1; if(doub <= n && t[doub] > t[k]) k = doub; if(doub < n && t[doub + 1] > t[k]) k = doub + 1; s = t[j]; t[j] = t[k]; t[k] = s; } while(j != k); } // przesuwa wyzej elemen z podanego indeksu w celu uzyskania struktury kopca void PrzesunWyzej(ULL* t, int i) { int k, j, half; ULL s; k = i; do { j = k; half = j >> 1; if( j > 1 && t[half] < t[k]) k = half; s = t[j]; t[j] = t[k]; t[k] = s; } while(j != k); } // buduje kopiec dla podanej tablicy void BudujKopiec(ULL* t) { int i; for(i = n / 2; i > 0; i--) PrzesunNizej(t, i); } // zwraca element najwiekszy ULL FindMax(ULL* t){ return t[1]; } // usuwa najwiekszy element void DeleteMax(ULL* t){ t[1] = t[n]; n--; PrzesunNizej(t, 1); } // wstawia nowy element do kopca /// TODO: Czy w podanym programie aby na pewno umieszczanie nowego elementu w lisciu /// jest optymalne? Przeciez niemal za kazdym razem powedruje on w okolice korzenia! void InsertNode(ULL* t, ULL u) { n++; a[n] = u; PrzesunWyzej(t, n); }
// stdafx.h : ±ê׼ϵͳ°üº¬ÎļþµÄ°üº¬Îļþ£¬ // »òÊǾ­³£Ê¹Óõ«²»³£¸ü¸ÄµÄ // ÌØ¶¨ÓÚÏîÄ¿µÄ°üº¬Îļþ // #pragma once #include "targetver.h" #define WIN32_LEAN_AND_MEAN // ´Ó Windows Í·ÎļþÖÐÅųý¼«ÉÙʹÓõÄÐÅÏ¢ // Windows Í·Îļþ: #include <windows.h> #include <wchar.h> #include <string> //#include <ostringstream> #include <sstream> using namespace std; // TODO: ÔÚ´Ë´¦ÒýÓóÌÐòÐèÒªµÄÆäËûÍ·Îļþ
// -*- C++ -*- // This file is part of the aMule Project. // // Copyright (c) 2004-2011 Angel Vidal ( kry@amule.org ) // Copyright (c) 2004-2011 aMule Team ( admin@amule.org / http://www.amule.org ) // Copyright (c) 2003-2011 Barry Dunne (http://www.emule-project.net) // // Any parts of this program derived from the xMule, lMule or eMule project, // or contributed by third-party developers are copyrighted by their // respective authors. // // 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 // // Note To Mods // /* Please do not change anything here and release it.. There is going to be a new forum created just for the Kademlia side of the client.. If you feel there is an error or a way to improve something, please post it in the forum first and let us look at it.. If it is a real improvement, it will be added to the offical client.. Changing something without knowing what all it does can cause great harm to the network if released in mass form.. Any mod that changes anything within the Kademlia side will not be allowed to advertise there client on the eMule forum.. */ #ifndef __SEARCHMANAGER_H__ #define __SEARCHMANAGER_H__ #include "../utils/UInt128.h" #include "../routing/Maps.h" #include "../../Tag.h" class CMemFile; //////////////////////////////////////// namespace Kademlia { //////////////////////////////////////// class CSearch; class CRoutingZone; class CKadClientSearcher; typedef std::list<wxString> WordList; typedef std::map<CUInt128, CSearch*> SearchMap; class CSearchManager { friend class CRoutingZone; friend class CKademlia; public: static bool IsSearching(uint32_t searchID) throw(); static void StopSearch(uint32_t searchID, bool delayDelete); static void StopAllSearches(); // Search for a particular file // Will return unique search id, returns zero if already searching for this file. static CSearch* PrepareLookup(uint32_t type, bool start, const CUInt128& id); // Will return unique search id, returns zero if already searching for this keyword. static CSearch* PrepareFindKeywords(const wxString& keyword, uint32_t searchTermsDataSize, const uint8_t *searchTermsData, uint32_t searchid); static bool StartSearch(CSearch* search); static void ProcessResponse(const CUInt128& target, uint32_t fromIP, uint16_t fromPort, ContactList *results); static void ProcessResult(const CUInt128& target, const CUInt128& answer, TagPtrList *info); static void ProcessPublishResult(const CUInt128& target, const uint8_t load, const bool loadResponse); static void GetWords(const wxString& str, WordList *words, bool allowDuplicates = false); static void UpdateStats() throw(); static bool AlreadySearchingFor(const CUInt128& target) throw() { return m_searches.count(target) > 0; } static const wxChar* GetInvalidKeywordChars() { return wxT(" ()[]{}<>,._-!?:;\\/\""); } static void CancelNodeFWCheckUDPSearch(); static bool FindNodeFWCheckUDP(); static bool IsFWCheckUDPSearch(const CUInt128& target); static void SetNextSearchID(uint32_t nextID) throw() { m_nextID = nextID; } private: static void FindNode(const CUInt128& id, bool complete); static bool FindNodeSpecial(const CUInt128& id, CKadClientSearcher *requester); static void CancelNodeSpecial(CKadClientSearcher *requester); static void JumpStart(); static uint32_t m_nextID; static SearchMap m_searches; }; } // End namespace #endif // __SEARCHMANAGER_H__ // File_checked_for_headers
/*- * Copyright (C) 2013 Matt Windsor <mattbw@FreeBSD.org> * * Licensed under the GNU General Public License Version 2 * * 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 <atf-c.h> #include <string.h> /* ATF_CHECK_STREQ */ #include <glib.h> /* gchar, g_free */ #include "pkg.h" /* pkg... */ #include "repo.h" /* repo_... */ #include "testutils.h" /* gen_pkg */ /* ATF/kyua tests for 'repo.c'. */ ATF_TC(repo_of_package_valid_local); ATF_TC_HEAD(repo_of_package_valid_local, tc) { atf_tc_set_md_var(tc, "descr", "Test 'repo_of_package' on a local (file) package."); } ATF_TC_BODY(repo_of_package_valid_local, tc) { struct pkg *pkg; pkg = gen_pkg(PKG_FILE); ATF_REQUIRE(pkg != NULL); ATF_CHECK_STREQ(repo_of_package(pkg), "local"); pkg_free(pkg); } ATF_TC(repo_of_package_valid_installed); ATF_TC_HEAD(repo_of_package_valid_installed, tc) { atf_tc_set_md_var(tc, "descr", "Test 'repo_of_package' on an installed package."); } ATF_TC_BODY(repo_of_package_valid_installed, tc) { struct pkg *pkg; pkg = gen_pkg(PKG_INSTALLED); ATF_REQUIRE(pkg != NULL); ATF_CHECK_STREQ(repo_of_package(pkg), "installed"); pkg_free(pkg); } ATF_TC(repo_of_package_valid_remote); ATF_TC_HEAD(repo_of_package_valid_remote, tc) { atf_tc_set_md_var(tc, "descr", "Test 'repo_of_package' on a remote package."); } ATF_TC_BODY(repo_of_package_valid_remote, tc) { struct pkg *pkg; pkg = gen_pkg(PKG_REMOTE); ATF_REQUIRE(pkg != NULL); ATF_CHECK_STREQ(repo_of_package(pkg), "packagesite"); pkg_free(pkg); } ATF_TC(repo_type_test); ATF_TC_HEAD(repo_type_test, tc) { atf_tc_set_md_var(tc, "descr", "Test repo_type_no_remote_check."); } ATF_TC_BODY(repo_type_test, tc) { ATF_CHECK_EQ(repo_type_no_remote_check("installed"), REPO_LOCAL); ATF_CHECK_EQ(repo_type_no_remote_check("derp"), REPO_REMOTE); ATF_CHECK_EQ(repo_type_no_remote_check(""), REPO_ANY); ATF_CHECK_EQ(repo_type_no_remote_check(NULL), REPO_ANY); } /* * TEST PACK */ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, repo_type_test); ATF_TP_ADD_TC(tp, repo_of_package_valid_local); ATF_TP_ADD_TC(tp, repo_of_package_valid_installed); ATF_TP_ADD_TC(tp, repo_of_package_valid_remote); return atf_no_error(); }
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef MANDELBROTWIDGET_H #define MANDELBROTWIDGET_H #include <QPixmap> #include <QWidget> #include "renderthread.h" //! [0] class MandelbrotWidget : public QWidget { Q_OBJECT public: MandelbrotWidget(QWidget *parent = 0); protected: void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent *event); void keyPressEvent(QKeyEvent *event); void wheelEvent(QWheelEvent *event); void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); private slots: void updatePixmap(const QImage &image, double scaleFactor); private: void zoom(double zoomFactor); void scroll(int deltaX, int deltaY); RenderThread thread; QPixmap pixmap; QPoint pixmapOffset; QPoint lastDragPos; double centerX; double centerY; double pixmapScale; double curScale; }; //! [0] #endif
/* Copyright (C) 2008 Paul Davis Author: Sampo Savolainen 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_plugin_eq_gui_h #define __ardour_plugin_eq_gui_h #include <ardour/buffer_set.h> #include <ardour/plugin_insert.h> #include <ardour/plugin.h> #include <gtkmm/table.h> #include <gtkmm/drawingarea.h> #include <gtkmm/combobox.h> #include <gtkmm/liststore.h> class FFT; class PluginEqGui : public Gtk::Table { public: PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert>); ~PluginEqGui(); private: // Setup void set_buffer_size(uint32_t, uint32_t); void change_dB_scale(); // Analysis void run_impulse_analysis(); void signal_collect_callback(ARDOUR::BufferSet *, ARDOUR::BufferSet *); float _signal_analysis_running; // Drawing virtual void on_hide(); virtual void on_show(); void stop_updating(); void start_updating(); void resize_analysis_area(Gtk::Allocation&); void redraw_analysis_area(); void draw_analysis_scales(cairo_t *); bool expose_analysis_area(GdkEventExpose *); void draw_scales_power(Gtk::Widget *, cairo_t *); void plot_impulse_amplitude(Gtk::Widget *,cairo_t *); void draw_scales_phase(Gtk::Widget *,cairo_t *); void plot_impulse_phase(Gtk::Widget *,cairo_t *); void plot_signal_amplitude_difference(Gtk::Widget *,cairo_t *); // Helpers bool timeout_callback(); void redraw_scales(); // Fields: // analysis parameters float _samplerate; float _min_dB; float _max_dB; float _step_dB; float _log_coeff; float _log_max; nframes_t _buffer_size; nframes_t _signal_buffer_size; // buffers ARDOUR::BufferSet _bufferset; // dimensions float _analysis_width; float _analysis_height; // My objects FFT *_impulse_fft; FFT *_signal_input_fft; FFT *_signal_output_fft; boost::shared_ptr<ARDOUR::Plugin> _plugin; boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert; // gui objects Gtk::DrawingArea *_analysis_area; cairo_surface_t *_analysis_scale_surface; // dB scale selection: class dBSelectionColumns : public Gtk::TreeModel::ColumnRecord { public: dBSelectionColumns() { add(dBMin); add(dBMax); add(dBStep); add(name); } Gtk::TreeModelColumn<float> dBMin; Gtk::TreeModelColumn<float> dBMax; Gtk::TreeModelColumn<float> dBStep; Gtk::TreeModelColumn<Glib::ustring> name; }; dBSelectionColumns dBColumns; Gtk::ComboBox *dBScaleCombo; Glib::RefPtr<Gtk::ListStore> dBScaleModel; Gtk::CheckButton *_phase_button; // signals and connections sigc::connection _update_connection; sigc::connection _window_unmap_connection; sigc::connection _window_map_connection; }; #endif
/* * Copyright 2013-2015 Kreogist Dev Team * * This file is part of Kreogist Cuties. * * Kreogist Cuties 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. * * Kreogist Cuties 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 Kreogist Cuties. If not, see <http://www.gnu.org/licenses/>. */ #ifndef KCTABMANAGER_H #define KCTABMANAGER_H #include "kcglobal.h" #include <QTabWidget> namespace KCTabManagerNamespace { enum TabManagerActions { FileNew, FileOpen, FileSave, FileSaveAs, FileSaveAll, FileClose, FileCloseAll, FileCloseAllOthers, FileExit, EditUndo, EditRedo, EditCut, EditCopy, EditPaste, EditSelectAll, TabManagerActionsCount }; } using namespace KCTabManagerNamespace; class KCCodeEditor; class KCTabStyle; class KCTabManager : public QTabWidget { Q_OBJECT public: explicit KCTabManager(QWidget *parent = 0); ~KCTabManager(); void generateMenuActionList(QList<MenuActions> &list); signals: public slots: int newFile(const QString &suffix=""); private slots: void retranslate(); private: void initialActions(); int addCodeEditor(KCCodeEditor *editor); QTabBar *m_tabBar; static KCTabStyle *m_tabStyle; int m_newFileCount=0; QString m_untitledText; QAction *m_tabManagerAction[TabManagerActionsCount]; }; #endif // KCTABMANAGER_H
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ #define COMPONENTS_VARIATIONS_VARIATIONS_ASSOCIATED_DATA_H_ #include <map> #include <string> #include "base/metrics/field_trial.h" namespace chrome_variations { typedef int VariationID; const VariationID EMPTY_ID = 0; struct ActiveGroupId { uint32 name; uint32 group; }; ActiveGroupId MakeActiveGroupId(const std::string& trial_name, const std::string& group_name); struct ActiveGroupIdCompare { bool operator() (const ActiveGroupId& lhs, const ActiveGroupId& rhs) const { if (lhs.group != rhs.group) return lhs.group < rhs.group; return lhs.name < rhs.name; } }; enum IDCollectionKey { GOOGLE_WEB_PROPERTIES, GOOGLE_UPDATE_SERVICE, ID_COLLECTION_COUNT, }; void AssociateGoogleVariationID(IDCollectionKey key, const std::string& trial_name, const std::string& group_name, VariationID id); void AssociateGoogleVariationIDForce(IDCollectionKey key, const std::string& trial_name, const std::string& group_name, VariationID id); VariationID GetGoogleVariationID(IDCollectionKey key, const std::string& trial_name, const std::string& group_name); bool AssociateVariationParams(const std::string& trial_name, const std::string& group_name, const std::map<std::string, std::string>& params); bool GetVariationParams(const std::string& trial_name, std::map<std::string, std::string>* params); std::string GetVariationParamValue(const std::string& trial_name, const std::string& param_name); namespace testing { void ClearAllVariationIDs(); void ClearAllVariationParams(); } } #endif
/*point.h is part of lucifer a laser show controller. Copyrignt 2010 Dan Mills <dmills@exponent.myzen.co.uk> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. 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 */ #ifndef POINT_INC #define POINT_INC #include <QVector3D> #include <QColor> #include <ostream> /// \brief A point in 3d space that may be blanked and has a colour. /// Used as a control point for various line types. class Point : public QVector3D, public QColor { public: bool blanked; Point (QVector3D v, QColor c) : QVector3D(v), QColor(c), blanked (true) {} friend std::ostream& operator << (std::ostream& s, const Point & p); }; typedef Point Vector; #endif
/********* * * In the name of the Father, and of the Son, and of the Holy Spirit. * * This file is part of BibleTime's source code, http://www.bibletime.info/. * * Copyright 1999-2016 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License * version 2.0. * **********/ #ifndef BT_WINDOW_INTERFACE_H #define BT_WINDOW_INTERFACE_H #include <QList> #include <QObject> #include <QString> #include "backend/managers/cswordbackend.h" #include "mobile/models/roleitemmodel.h" class CSwordKey; class CSwordVerseKey; class CSwordModuleInfo; class BtModuleTextModel; namespace btm { class BookKeyChooser; class KeyNameChooser; class VerseChooser; struct History { QString moduleName; QString reference; }; class BtWindowInterface : public QObject { Q_OBJECT Q_PROPERTY(int currentModelIndex READ getCurrentModelIndex NOTIFY currentModelIndexChanged) Q_PROPERTY(int fontSize READ getFontSize WRITE setFontSize NOTIFY textChanged) Q_PROPERTY(QString fontName READ getFontName NOTIFY textChanged) Q_PROPERTY(QString highlightWords READ getHighlightWords WRITE setHighlightWords) Q_PROPERTY(QString moduleLanguage READ getModuleLanguage) Q_PROPERTY(QString moduleName READ getModuleName WRITE setModuleName NOTIFY moduleChanged) Q_PROPERTY(QString reference READ getReference WRITE setReference NOTIFY referenceChange) Q_PROPERTY(QVariant textModel READ getTextModel NOTIFY textModelChanged) Q_PROPERTY(bool historyBackwardVisible READ getHistoryBackwardVisible NOTIFY historyChanged) Q_PROPERTY(bool historyForwardVisible READ getHistoryForwardVisible NOTIFY historyChanged) public: Q_INVOKABLE void changeModule(); Q_INVOKABLE void changeReference(); Q_INVOKABLE void saveWindowStateToConfig(int windowIndex); Q_INVOKABLE void updateCurrentModelIndex(); Q_INVOKABLE void updateTextFonts(); Q_INVOKABLE void updateKeyText(int modelIndex); Q_INVOKABLE void moveHistoryBackward(); Q_INVOKABLE void moveHistoryForward(); Q_INVOKABLE void setHistoryPoint(); Q_INVOKABLE void setModuleToBeginning(); BtWindowInterface(QObject *parent = nullptr); ~BtWindowInterface(); int getCurrentModelIndex() const; int getFontSize() const; QString getFontName() const; QString getHighlightWords() const; CSwordKey* getKey() const; QString getModuleLanguage() const; QString getModuleName() const; QString getReference() const; QVariant getTextModel(); void moduleNameChanged(const QString& moduleName); void setFontSize(int size); void setHighlightWords(const QString& words); void setModuleName(const QString& moduleName); void setReference(const QString& key); bool getHistoryBackwardVisible() const; bool getHistoryForwardVisible() const; signals: void currentModelIndexChanged(); void historyChanged(); void moduleChanged(); void referenceChange(); void textChanged(); void textModelChanged(); private slots: void referenceChanged(); void referenceChosen(); void referenceChosen(int index); void reloadModules(CSwordBackend::SetupChangedReason reason); private: const CSwordModuleInfo* module() const; void updateModel(); CSwordKey* m_key; RoleItemModel* m_textModel; BtModuleTextModel* m_moduleTextModel; BookKeyChooser* m_bookKeyChooser; KeyNameChooser* m_keyNameChooser; VerseChooser* m_verseKeyChooser; QString m_highlightWords; QString m_moduleName; QList<History> m_history; int m_historyIndex; }; } // end namespace #endif
void bfm_decode_mainrom(running_machine &machine, const char *rom_region, UINT8* codec_data);
/****************************************************************************** * Icinga 2 * * Copyright (C) 2012 Icinga Development Team (http://www.icinga.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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ #ifndef ANDFILTER_H #define ANDFILTER_H #include "livestatus/combinerfilter.h" using namespace icinga; namespace livestatus { /** * @ingroup livestatus */ class AndFilter : public CombinerFilter { public: DECLARE_PTR_TYPEDEFS(AndFilter); AndFilter(void); virtual bool Apply(const Table::Ptr& table, const Value& row); }; } #endif /* ANDFILTER_H */
/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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. ***********************************************************************/ #ifndef FC__MAPVIEW_H #define FC__MAPVIEW_H #include <gtk/gtk.h> /* common */ #include "fc_types.h" /* client */ #include "citydlg_common.h" #include "mapview_g.h" #include "mapview_common.h" /* client/gui-gtk-4.0 */ #include "canvas.h" #include "graphics.h" GdkPixbuf *get_thumb_pixbuf(int onoff); #define CURSOR_INTERVAL 200 /* milliseconds */ gboolean overview_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data); gboolean map_canvas_draw(GtkWidget *w, cairo_t *cr, gpointer data); gboolean map_canvas_configure(GtkWidget *w, GdkEventConfigure *ev, gpointer data); void put_unit_image(struct unit *punit, GtkImage *p, int height); void put_unit_image_city_overlays(struct unit *punit, GtkImage *p, int height, int *upkeep_cost, int happy_cost); void scrollbar_jump_callback(GtkAdjustment *adj, gpointer hscrollbar); void update_map_canvas_scrollbars_size(void); void pixmap_put_overlay_tile(GdkWindow *pixmap, float zoom, int canvas_x, int canvas_y, struct sprite *ssprite); void pixmap_put_overlay_tile_draw(struct canvas *pcanvas, int canvas_x, int canvas_y, struct sprite *ssprite, bool fog); void mapview_freeze(void); void mapview_thaw(void); bool mapview_is_frozen(void); #endif /* FC__MAPVIEW_H */
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ /* * U-boot - main board file * * Copyright (c) 2008-2009 Analog Devices Inc. * * Licensed under the GPL-2 or later. */ #include <common.h> #include <config.h> #include <net.h> #include <netdev.h> #include <asm/blackfin.h> #include <asm/net.h> #include <asm/mach-common/bits/otp.h> #include <asm/sdh.h> int checkboard(void) { printf("Board: Bluetechnix TCM-BF518 board\n"); printf(" Support: http://www.bluetechnix.com/\n"); printf(" http://blackfin.uclinux.org/\n"); return 0; } #if defined(CONFIG_BFIN_MAC) static void board_init_enetaddr(uchar *mac_addr) { bool valid_mac = false; #if 0 /* the MAC is stored in OTP memory page 0xDF */ uint32_t ret; uint64_t otp_mac; ret = bfrom_OtpRead(0xDF, OTP_LOWER_HALF, &otp_mac); if (!(ret & OTP_MASTER_ERROR)) { uchar *otp_mac_p = (uchar *)&otp_mac; for (ret = 0; ret < 6; ++ret) mac_addr[ret] = otp_mac_p[5 - ret]; if (is_valid_ether_addr(mac_addr)) valid_mac = true; } #endif if (!valid_mac) { puts("Warning: Generating 'random' MAC address\n"); bfin_gen_rand_mac(mac_addr); } eth_setenv_enetaddr("ethaddr", mac_addr); } int board_eth_init(bd_t *bis) { return bfin_EMAC_initialize(bis); } #endif int misc_init_r(void) { #ifdef CONFIG_BFIN_MAC uchar enetaddr[6]; if (!eth_getenv_enetaddr("ethaddr", enetaddr)) board_init_enetaddr(enetaddr); #endif return 0; } #ifdef CONFIG_BFIN_SDH int board_mmc_init(bd_t *bis) { return bfin_mmc_init(bis); } #endif
//########################################################################### // // FILE: DSP28x_Project.h // // TITLE: DSP28x Project Headerfile and Examples Include File // //########################################################################### // $TI Release: F2806x C/C++ Header Files and Peripheral Examples V136 $ // $Release Date: Apr 15, 2013 $ //########################################################################### #ifndef DSP28x_PROJECT_H #define DSP28x_PROJECT_H #include "F2806x_Cla_typedefs.h"// F2806x CLA Type definitions #include "F2806x_Device.h" // F2806x Headerfile Include File #include "F2806x_Examples.h" // F2806x Examples Include File #endif // end of DSP28x_PROJECT_H definition
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id$ * * Copyright (C) 2005 by Kevin Ferrare * * 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 _GUI_ICON_H_ #define _GUI_ICON_H_ #include "screen_access.h" /* Defines a type for the icons since it's not the same thing on * char-based displays and bitmap displays */ #ifdef HAVE_LCD_BITMAP typedef const unsigned char * ICON; #else typedef long ICON; #endif /* Don't #ifdef icon values, or we wont be able to use the same bmp for every target. */ enum themable_icons { NOICON = -1, Icon_NOICON = NOICON, /* Dont put this in a .bmp */ Icon_Audio, Icon_Folder, Icon_Playlist, Icon_Cursor, Icon_Wps, Icon_Firmware, Icon_Font, Icon_Language, Icon_Config, Icon_Plugin, Icon_Bookmark, Icon_Preset, Icon_Queued, Icon_Moving, Icon_Keyboard, Icon_Reverse_Cursor, Icon_Questionmark, Icon_Menu_setting, Icon_Menu_functioncall, Icon_Submenu, Icon_Submenu_Entered, Icon_Recording, Icon_Voice, Icon_General_settings_menu, Icon_System_menu, Icon_Playback_menu, Icon_Display_menu, Icon_Remote_Display_menu, Icon_Radio_screen, Icon_file_view_menu, Icon_EQ, Icon_Rockbox, Icon_Last_Themeable, }; /* * Draws a cursor at a given position, if th * - screen : the screen where we put the cursor * - x, y : the position, in character, not in pixel !! * - on : true if the cursor must be shown, false if it must be erased */ extern void screen_put_cursorxy(struct screen * screen, int x, int y, bool on); /* * Put an icon on a screen at a given position * (the position is given in characters) * If the given icon is Icon_blank, the icon * at the given position will be erased * - screen : the screen where we put our icon * - x, y : the position, pixel value !! * - icon : the icon to put */ extern void screen_put_iconxy(struct screen * screen, int x, int y, enum themable_icons icon); #ifdef HAVE_LCD_CHARCELLS # define screen_put_icon(s, x, y, i) screen_put_iconxy(s, x, y, i) # define screen_put_icon_with_offset(s, x, y, w, h, i) screen_put_icon(s, x, y, i) #else /* For both of these, the icon will be placed in the center of the rectangle */ /* as above, but x,y are letter position, NOT PIXEL */ extern void screen_put_icon(struct screen * screen, int x, int y, enum themable_icons icon); /* as above (x,y are letter pos), but with a pxiel offset for both */ extern void screen_put_icon_with_offset(struct screen * display, int x, int y, int off_x, int off_y, enum themable_icons icon); #endif void icons_init(void); #ifdef HAVE_LCD_CHARCELLS # define CURSOR_CHAR 0xe10c # define get_icon_width(a) 1 # define get_icon_height(a) 1 /* needs to be verified */ #else int get_icon_width(enum screen_type screen_type); int get_icon_height(enum screen_type screen_type); int get_icon_format(enum screen_type screen_type); #endif #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) \ && !defined(HAVE_LCD_CHARCELLS) int get_icon_format(enum screen_type screen_type); #else # define get_icon_format(a) FORMAT_MONO #endif #endif /*_GUI_ICON_H_*/
/* Copyright (C) 2001-2007 Tensilica, Inc. All Rights Reserved. */ /* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. 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 would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, this software is distributed without any warranty that it is free of the rightful claim of any third person regarding infringement or the like. Any license provided herein, whether implied or otherwise, applies only to this software file. Patent licenses, if any, provided herein do not apply to combinations of this program with other software, or any other product whatsoever. You should have received a copy of the GNU General Public License along with this program; if not, write the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, Mountain View, CA 94043, or: http://www.sgi.com For further information regarding this notice, see: http://oss.sgi.com/projects/GenInfo/NoticeExplan */ #ifndef em_dwarf_INCLUDED #define em_dwarf_INCLUDED #include <dwarf.h> #include <libdwarf.h> #include "srcpos.h" #include "targ_em_dwarf.h" #if defined(__cplusplus) extern Dwarf_P_Debug Em_Dwarf_Begin (BOOL is_64bit, BOOL dwarf_trace, BOOL is_cplus, symbol_index_recorder record_symidx = NULL); extern void Em_Dwarf_Write_Scns (Cg_Dwarf_Sym_To_Elfsym_Ofst translate_elfsym = NULL); #else extern Dwarf_P_Debug Em_Dwarf_Begin (BOOL is_64bit, BOOL dwarf_trace, BOOL is_cplus); extern void Em_Dwarf_Write_Scns (void); #endif #if defined(__cplusplus) extern "C" { #endif extern INT data_alignment_factor; extern void Em_Dwarf_End (void); extern pSCNINFO Em_Dwarf_Find_Dwarf_Scn (size_t scndx); extern pSCNINFO Em_Dwarf_Find_Dwarf_Scn_By_Name (char *name); extern INT Em_Dwarf_Prepare_Output (void); extern void Em_Dwarf_Add_Line_Entry ( INT code_address, SRCPOS srcpos); extern void Em_Dwarf_Add_Include (UINT16 incl_idx, char *name); extern void Em_Dwarf_Add_File ( UINT16 file_idx, char *name, UINT16 incl_idx, Dwarf_Unsigned modification_time, Dwarf_Unsigned file_size); /* Given a file_index, return the filename and the path for the file. */ extern void Em_Dwarf_File_Index_To_Name ( INT file_index, char **filename, char **path); /* eh_offset should be -1 if no eh region */ extern void Em_Dwarf_Process_PU (Dwarf_Unsigned begin_label, Dwarf_Unsigned end_label, INT32 begin_offset, INT32 end_offset, Dwarf_P_Die PU_die, Dwarf_P_Fde fde, Elf64_Word eh_symindex, INT eh_offset); extern void Em_Dwarf_Start_Text_Region (pSCNINFO scninfo, INT start_offset); extern void Em_Dwarf_Start_Text_Region_Semi_Symbolic (pSCNINFO, INT, Dwarf_Unsigned, Dwarf_Addr); extern void Em_Dwarf_End_Text_Region (pSCNINFO scninfo, INT end_offset); extern void Em_Dwarf_End_Text_Region_Semi_Symbolic (pSCNINFO, INT, Dwarf_Unsigned, Dwarf_Addr); #if defined(__cplusplus) } #endif #endif /* em_dwarf_INCLUDED */
/* Allow in-tree programs to #include <flux/optparse.h> like out-of-tree would. */ #include "src/common/liboptparse/optparse.h"
#ifndef NEWFILEDIALOG_H #define NEWFILEDIALOG_H #include <QDialog> #include "directorytreelister.h" #define DUB_QUOTES "\"" #define DOT_TXT ".txt" #define REP_CHAR "$" namespace Ui { class NewFileDialog; } class NewFileDialog : public QDialog { Q_OBJECT public: explicit NewFileDialog(QDir *rootDirectory, QWidget *parent, QString caption, QString filename = "", bool dir = false); ~NewFileDialog(); QString getFile(); QString getDirectory(); NPFile *getSelected(); bool isDirectory(); public slots: void itemClicked(NPFile *item); void insertDate(); private: Ui::NewFileDialog *ui; DirectoryTreeLister *dtl; NPFile *item; QDir *rootDir; bool hasRecognisedEnding(QString *file); void makeLegalName(QString *file); }; #endif // NEWFILEDIALOG_H
/* * Copyright (c) 2002-2003 Jesper K. Pedersen <blackie@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 version 2 as published by the Free Software Foundation. * * 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 __repeatwidget #define __repeatwidget #include "singlecontainerwidget.h" #include <tqvbox.h> class TQButtonGroup; class KDialogBase; class TQCheckBox; class TQSpinBox; class RepeatRegExp; /** Widget containging the configuration for a @ref RepeatWidget @internal */ class RepeatRangeWindow :public TQVBox { Q_OBJECT public: enum REPEATTYPE {ANY, ATLEAST, ATMOST, EXACTLY, MINMAX}; RepeatRangeWindow( TQWidget* parent, const char* name = 0 ); TQString text(); int min(); int max(); void set( REPEATTYPE tp, int min, int max ); protected slots: void slotItemChange( int which ); void slotUpdateMinVal( int minVal ); void slotUpdateMaxVal( int minVal ); private: void createLine( TQWidget* parent, TQString text, TQSpinBox** spin, REPEATTYPE tp ); TQSpinBox* _leastTimes; TQSpinBox* _mostTimes; TQSpinBox* _exactlyTimes; TQSpinBox* _rangeFrom; TQSpinBox* _rangeTo; TQButtonGroup* _group; }; /** RegExp widget for `repeated content' @internal */ class RepeatWidget :public SingleContainerWidget { Q_OBJECT public: RepeatWidget( RegExpEditorWindow* editorWindow, TQWidget *parent, const char *name = 0); RepeatWidget( RepeatRegExp* regexp, RegExpEditorWindow* editorWindow, TQWidget* parent, const char* name = 0); void init(); virtual TQSize sizeHint() const; virtual RegExp* regExp() const; virtual RegExpType type() const { return REPEAT; } virtual int edit(); protected: virtual void paintEvent( TQPaintEvent *e ); protected slots: void slotConfigCanceled(); void slotConfigWindowClosed(); private: KDialogBase* _configWindow; RepeatRangeWindow* _content; mutable TQSize _textSize; mutable TQSize _childSize; TQByteArray _backup; }; #endif // __repeatwidget
/* * kernel/power/autosleep.c * * Opportunistic sleep support. * * Copyright (C) 2012 Rafael J. Wysocki <rjw@sisk.pl> */ #include <linux/device.h> #include <linux/mutex.h> #include <linux/pm_wakeup.h> #include "power.h" static suspend_state_t autosleep_state; static struct workqueue_struct *autosleep_wq; /* * Note: it is only safe to mutex_lock(&autosleep_lock) if a wakeup_source * is active, otherwise a deadlock with try_to_suspend() is possible. * Alternatively mutex_lock_interruptible() can be used. This will then fail * if an auto_sleep cycle tries to freeze processes. */ static DEFINE_MUTEX(autosleep_lock); static struct wakeup_source *autosleep_ws; static void try_to_suspend(struct work_struct *work) { unsigned int initial_count, final_count; if (!pm_get_wakeup_count(&initial_count, true)) goto out; mutex_lock(&autosleep_lock); if (!pm_save_wakeup_count(initial_count) || system_state != SYSTEM_RUNNING) { mutex_unlock(&autosleep_lock); goto out; } if (autosleep_state == PM_SUSPEND_ON) { mutex_unlock(&autosleep_lock); return; } if (autosleep_state >= PM_SUSPEND_MAX) hibernate(); else pm_suspend(autosleep_state); mutex_unlock(&autosleep_lock); if (!pm_get_wakeup_count(&final_count, false)) goto out; /* * If the wakeup occured for an unknown reason, wait to prevent the * system from trying to suspend and waking up in a tight loop. */ if (final_count == initial_count) schedule_timeout_uninterruptible(HZ / 2); out: queue_up_suspend_work(); } static DECLARE_WORK(suspend_work, try_to_suspend); void queue_up_suspend_work(void) { if (autosleep_state > PM_SUSPEND_ON) queue_work(autosleep_wq, &suspend_work); } suspend_state_t pm_autosleep_state(void) { return autosleep_state; } int pm_autosleep_lock(void) { return mutex_lock_interruptible(&autosleep_lock); } void pm_autosleep_unlock(void) { mutex_unlock(&autosleep_lock); } int pm_autosleep_set_state(suspend_state_t state) { #ifndef CONFIG_HIBERNATION if (state >= PM_SUSPEND_MAX) return -EINVAL; #endif __pm_stay_awake(autosleep_ws); mutex_lock(&autosleep_lock); autosleep_state = state; __pm_relax(autosleep_ws); if (state > PM_SUSPEND_ON) { pm_wakep_autosleep_enabled(true); } else { pm_wakep_autosleep_enabled(false); } mutex_unlock(&autosleep_lock); return 0; } int __init pm_autosleep_init(void) { autosleep_ws = wakeup_source_register("autosleep"); if (!autosleep_ws) return -ENOMEM; autosleep_wq = alloc_ordered_workqueue("autosleep", 0); if (autosleep_wq) return 0; wakeup_source_unregister(autosleep_ws); return -ENOMEM; }
/************************************************************************ * * Copyright (c) 2014-2022 Barbara Geller & Ansel Sermersheim * Copyright (c) 1997-2014 by Dimitri van Heesch * * DoxyPressApp 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. * * DoxyPressApp 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. * * Documents produced by DoxyPress are derivative works derived from the * input used in their production; they are not affected by this license. * *************************************************************************/ #ifndef DIALOG_XP_GETDIR_H #define DIALOG_XP_GETDIR_H #include <QFileDialog> #include <QFileSystemModel> #include <QTreeWidgetItem> #include "ui_dialog_xp_getdir.h" #include "mainwindow.h" struct netServers { QString serverName; bool isAvailable; }; struct netShares { QString serverName; QString shareName; }; class Dialog_XP_GetDir : public QDialog { CS_OBJECT(Dialog_XP_GetDir) public: Dialog_XP_GetDir(MainWindow *from, const QString title, const QString path, QFileDialog::FileDialogOptions options); ~Dialog_XP_GetDir(); QString getDirectory(); void showMe(const QString &); QSize sizeHint() const; private: Ui::Dialog_XP_GetDir *m_ui; QFileSystemModel *m_model_R; QString m_path; QModelIndex m_index_R; QList<netServers> m_netServers; QList<netShares> m_netShares; QString driveType(QString drive); QList<netServers> getWin_NetServers(); void showDirectories(QTreeWidgetItem * current,QTreeWidgetItem * previous); void network(); void ok(); void cancel(); }; #endif
#include <stdlib.h> #define MAX_URL_LENGTH 256 #define doc_root "/root/lemur/html" #define HEADER_IF_MODIFIED_SINCE "If-Modified-Since: " #define RFC1123_DATE_FMT "%a, %d %b %Y %H:%M:%S %Z" #define header_end "\r\n" #define header_400 "HTTP/1.1 400 Bad Request\r\nServer: lemur/1.0\r\n" \ "Content-Type: text/html\r\nConnection: Close\r\n\r\n<h1>Bad request</h1>" #define header_404 "HTTP/1.1 404 Not Found\r\nServer: lemur/1.0\r\n" \ "Content-Type: text/html\r\nConnection: Close\r\n\r\n<h1>Not found</h1>" #define header_200_start "HTTP/1.1 200 OK\r\nServer: lemur/1.0\r\n" \ "Content-Type: text/html\r\nConnection: Close\r\n" #define header_304_start "HTTP/1.1 304 Not Modified\r\nServer: lemur/1.0\r\n" \ "Content-Type: text/html\r\nConnection: Close\r\n" struct http_request_t{ static const int BUF_SIZE = 4096; int test; int sock; //int status; int response_code; int fd; int read_pos; int write_pos; int total_length; char buf[BUF_SIZE]; }; void init_request_t(http_request_t *request, int fd); void reset_request_t(http_request_t *request); void cleanup_request_t(http_request_t *request); void handle_error(http_request_t *request, const char *error_string); void handle_response_code_400(http_request_t *request); void handle_response_code_404(http_request_t *request); void do_request(void *arg); void do_response(void *arg); int write_all(http_request_t *rt, char *buf, int n); void send_response(http_request_t *rt); int get_index_file(char *filename, struct stat *pstat); void write_to_header(http_request_t *request, const char *str);
#ifndef NILTS_COMMON_ARGS_H #define NILTS_COMMON_ARGS_H //----STANDARD---- #include "string" //----LOCAL---- #include "core/application.h" #include "common/io.h" using namespace std; namespace Nilts { void checkArguments(Core::AppConfig* config, int argc, char* argv[]) { for (int count = 0; count < argc; count ++) { if (string(argv[count]) == "-s") { config->server_not_client = true; IO::output("Running in server mode."); } } } } #endif // NILTS_COMMON_ARGS_H
/* arch/arm/mach-msm/nand_partitions.c * * Code to extract partition information from ATAG set up by the * bootloader. * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2008-2009,2011 The Linux Foundation. All rights reserved. * Author: Brian Swetland <swetland@google.com> * * 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/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <asm/mach/flash.h> #include <linux/io.h> #include <asm/setup.h> #include <linux/mtd/nand.h> #include <linux/mtd/partitions.h> #include <mach/msm_iomap.h> #include <mach/board.h> #ifdef CONFIG_MSM_SMD #include "smd_private.h" #endif /* configuration tags specific to msm */ static struct mtd_partition msm_nand_partitions[SMEM_MAX_PARTITIONS + MSM_MTD_MAX_PARTS]; static char msm_nand_names[ARRAY_SIZE(msm_nand_partitions) * SMEM_MAX_PART_NAME]; extern struct flash_platform_data msm_nand_data; static int __init parse_tag_msm_partition(const struct tag *tag) { struct mtd_partition *ptn = msm_nand_partitions; char *name = msm_nand_names; struct msm_ptbl_entry *entry = (void *) &tag->u; unsigned count, n; count = (tag->hdr.size - 2) / (sizeof(struct msm_ptbl_entry) / sizeof(__u32)); if (count > MSM_MAX_PARTITIONS) count = MSM_MAX_PARTITIONS; for (n = 0; n < count; n++) { memcpy(name, entry->name, 15); name[15] = 0; ptn->name = name; ptn->offset = entry->offset; ptn->size = entry->size; printk(KERN_INFO "Partition (from atag) %s " "-- Offset:%llx Size:%llx\n", ptn->name, ptn->offset, ptn->size); name += 16; entry++; ptn++; } msm_nand_data.nr_parts = count; msm_nand_data.parts = msm_nand_partitions; return 0; } __tagtable(ATAG_MSM_PARTITION, parse_tag_msm_partition); #ifdef CONFIG_MSM_SMD int check_fs_partition(char *partition_name, char *mtd_name) { int i; char *fs_parts[] = SMEM_LINUX_FS_PARTS; char *mtd_names[] = SMEM_LINUX_MTD_NAME; for (i = 0; i < ARRAY_SIZE(fs_parts); i++) { if (strcmp(partition_name, fs_parts[i]) == 0) { strncpy(mtd_name, mtd_names[i], SMEM_MAX_PART_NAME); return 0; } } return -1; } static int get_nand_partitions(void) { struct smem_flash_partition_table *partition_table; struct smem_flash_partition_entry *part_entry; u32 *flash_type_ptr; u32 flash_type; struct mtd_partition *ptn = msm_nand_partitions + msm_nand_data.nr_parts; char *name = msm_nand_names + (msm_nand_data.nr_parts * SMEM_MAX_PART_NAME); int part; partition_table = (struct smem_flash_partition_table *) smem_alloc(SMEM_AARM_PARTITION_TABLE, sizeof(struct smem_flash_partition_table)); if (!partition_table) { printk(KERN_WARNING "%s: no flash partition table in shared " "memory\n", __func__); return -ENOENT; } if ((partition_table->magic1 != (u32) SMEM_FLASH_PART_MAGIC1) || (partition_table->magic2 != (u32) SMEM_FLASH_PART_MAGIC2) || (partition_table->version != (u32) SMEM_FLASH_PART_VERSION)) { printk(KERN_WARNING "%s: version mismatch -- magic1=%#x, " "magic2=%#x, version=%#x\n", __func__, partition_table->magic1, partition_table->magic2, partition_table->version); return -EFAULT; } flash_type_ptr = smem_alloc(SMEM_BOOT_FLASH_TYPE, sizeof(u32)); if (!flash_type_ptr) { printk(KERN_WARNING "%s: no flash type in shared memory," "assuming NAND", __func__); flash_type = SMEM_FLASH_NAND; } else { flash_type = *flash_type_ptr; } if (flash_type != SMEM_FLASH_NAND) return 0; /* Get the LINUX FS partition info */ for (part = 0; part < partition_table->numparts; part++) { part_entry = &partition_table->part_entry[part]; /* Find a match for the Linux file system partition */ if (check_fs_partition(part_entry->name, name) == 0) { ptn->name = name; /*TODO: Get block count and size info */ ptn->offset = part_entry->offset; /* For SMEM, -1 indicates remaining space in flash, * but for MTD it is 0 */ if (part_entry->length == (u32)-1) ptn->size = 0; else ptn->size = part_entry->length; printk(KERN_INFO "Partition(from smem) %s " "-- Offset:%llx Size:%llx\n", ptn->name, ptn->offset, ptn->size); msm_nand_data.nr_parts++; ptn++; name += SMEM_MAX_PART_NAME; } } if (msm_nand_data.nr_parts) { msm_nand_data.parts = msm_nand_partitions; return 0; } printk(KERN_WARNING "%s: no partition table found!", __func__); return -ENODEV; } #else static int get_nand_partitions(void) { if (msm_nand_data.nr_parts) return 0; printk(KERN_WARNING "%s: no partition table found!", __func__); return -ENODEV; } #endif device_initcall(get_nand_partitions);
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id$ * * Copyright (C) 2010 by Thomas Martitz * * Generic ARM threading support * * 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. * ****************************************************************************/ #include <windows.h> #include "system.h" #define INIT_MAIN_THREAD #define THREAD_STARTUP_INIT(core, thread, function) \ ({ (thread)->context.stack_size = (thread)->stack_size, \ (thread)->context.stack = (uintptr_t)(thread)->stack; \ (thread)->context.start = function; }) static void init_main_thread(void *addr) { struct regs *context = (struct regs*)addr; /* we must convert the current main thread to a fiber to be able to * schedule other fibers */ context->uc = ConvertThreadToFiber(NULL); context->stack_size = 0; } static inline void store_context(void* addr) { (void)addr; /* nothing to do here, Fibers continue after the SwitchToFiber call */ } static void start_thread(void) { void (*func)(void) = GetFiberData(); func(); /* go out if thread function returns */ thread_exit(); } /* * Load context and run it * * Resume execution from the last load_context call for the thread */ static inline void load_context(const void* addr) { struct regs *context = (struct regs*)addr; if (UNLIKELY(context->start)) { /* need setup before switching to it */ context->uc = CreateFiber(context->stack_size, (LPFIBER_START_ROUTINE)start_thread, context->start); /* can't assign stack pointer, only stack size */ context->stack_size = 0; context->start = NULL; } SwitchToFiber(context->uc); }
// Authors: Hong Jiang <hjiang@dev-gems.com> #ifndef BASE_TYPES_H__ #define BASE_TYPES_H__ // ‘static_assert’ will become a keyword in C++0x namespace base { struct true_type { }; struct false_type { }; template <typename T> struct my_static_assert; // intentionally undefined. template <> struct my_static_assert<true_type> {}; template <typename T> struct my_static_assert_not; // intentionally undefined. template <> struct my_static_assert_not<false_type> {}; } // namespace base #endif // BASE_TYPES_H__
/* * include/pmc/ll_events.h * * Data types and functions to deal with low-level events (HW event counts) * * Copyright (c) 2015 Juan Carlos Saez <jcsaezal@ucm.es> * * This code is licensed under the GNU GPL v2. */ #ifndef PMC_LL_EVENTS_H #define PMC_LL_EVENTS_H #include <pmc/common/pmc_const.h> #include <pmc/common/pmc_types.h> /* * HW event forward declaration. * A definition of this structure must be provided for * every supported architecture */ struct hw_event; typedef struct hw_event hw_event_t; /*************** Available operations for hw_events ***************************/ /* This function starts the count of a HW event (from its previous value) */ static inline void __start_count_hw_event ( struct hw_event* exp ); /* This function starts the count of a HW event (from 0) */ static inline void __restart_count_hw_event ( struct hw_event* exp ); /* This function stops the count of a HW event */ static inline void __stop_count_hw_event ( struct hw_event* exp ); /* This function clears the count of a HW event */ static inline void __clear_count_hw_event ( struct hw_event* exp ); /* This function reads the value from the HW event's PMC */ static inline void __read_count_hw_event (struct hw_event* exp ); /* This function returns the last value gathered from the PMC */ static inline uint64_t __get_last_value_hw_event (struct hw_event* exp ); /* This function saves the context of a HW event */ static inline void __save_context_hw_event (struct hw_event* exp); /* This function saves the context of a HW event */ static inline void __restore_context_hw_event (struct hw_event* exp ); /* This function returns PMCs reset value */ static inline uint64_t __get_reset_value_hw_event (struct hw_event* exp ); /** This code loads architecture-specific definition and implementation of a hw_event **/ #if defined(CONFIG_PMC_CORE_2_DUO) #include <pmc/core2duo/hw_events.h> #include <pmc/core2duo/pmc_bit_layout.h> #include <pmc/core2duo/pmc_const.h> #elif defined(CONFIG_PMC_CORE_I7) #include <pmc/corei7/hw_events.h> #include <pmc/corei7/pmc_bit_layout.h> #include <pmc/corei7/pmc_const.h> #elif defined(CONFIG_PMC_PENTIUM_4_HT) #include <pmc/p4ht/hw_events.h> #elif defined(CONFIG_PMC_AMD) #include <pmc/amd/hw_events.h> #include <pmc/amd/pmc_bit_layout.h> #include <pmc/amd/pmc_const.h> #elif defined(CONFIG_PMC_ARM) #include <pmc/arm/hw_events.h> #include <pmc/arm/pmc_bit_layout.h> #include <pmc/arm/pmc_const.h> #elif defined(CONFIG_PMC_ARM64) #include <pmc/arm64/hw_events.h> #include <pmc/arm64/pmc_bit_layout.h> #include <pmc/arm64/pmc_const.h> #elif defined(CONFIG_PMC_PHI) #include <pmc/phi/hw_events.h> #include <pmc/phi/pmc_bit_layout.h> #include <pmc/phi/pmc_const.h> #else "There is no monitoring support for current architecture" #endif /* A low level event is a HW event with an additional identifier*/ typedef struct { char id[MAX_EXP_ID]; /*Event ID*/ struct hw_event event; unsigned int pmc_id; /* Performance counter id associated with this event */ } low_level_exp; /*************** Available operations for low_level_events ***************************/ static inline void init_low_level_exp ( low_level_exp* exp,const char *name) { strcpy ( exp->id,name ); exp->pmc_id=0; } static inline void init_low_level_exp_id ( low_level_exp* exp,const char *name, unsigned int pmc_id) { strcpy ( exp->id,name ); exp->pmc_id=pmc_id; } /* Wrapper operations for low_level_exps */ #define __start_count(p_exp) __start_count_hw_event(&((p_exp)->event)) #define __restart_count(p_exp) __restart_count_hw_event(&((p_exp)->event)) #define __stop_count(p_exp) __stop_count_hw_event(&((p_exp)->event)) #define __clear_count(p_exp) __clear_count_hw_event(&((p_exp)->event)) #define __read_count(p_exp) __read_count_hw_event(&((p_exp)->event)) #define __get_last_value(p_exp) __get_last_value_hw_event(&((p_exp)->event)) #define __save_context_event(p_exp) __save_context_hw_event(&((p_exp)->event)) #define __restore_context_event(p_exp) __restore_context_hw_event(&((p_exp)->event)) #define __get_reset_value(p_exp) __get_reset_value_hw_event(&((p_exp)->event)) #endif
#include "../rt2860/dfs.h"
/* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.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. ** ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** ** Commercial non-GPL licensing of this software is possible. ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. ** ** $Id: pulse.h,v 1.1.1.1 2012/03/27 04:02:56 dqliu Exp $ **/ #ifndef __PULSE_H__ #define __PULSE_H__ #ifdef __cplusplus extern "C" { #endif uint8_t pulse_decode(ic_stream *ics, int16_t *spec_coef, uint16_t framelen); #ifdef __cplusplus } #endif #endif
/* This file is part of the dynarmic project. * Copyright (c) 2016 MerryMage * This software may be used and distributed according to the terms of the GNU * General Public License version 2 or any later version. */ #pragma once #include <initializer_list> #include <dynarmic/A64/config.h> #include "common/common_types.h" #include "frontend/A64/location_descriptor.h" #include "frontend/A64/types.h" #include "frontend/ir/ir_emitter.h" #include "frontend/ir/value.h" namespace Dynarmic { namespace A64 { /** * Convenience class to construct a basic block of the intermediate representation. * `block` is the resulting block. * The user of this class updates `current_location` as appropriate. */ class IREmitter : public IR::IREmitter { public: explicit IREmitter(IR::Block& block, LocationDescriptor descriptor) : IR::IREmitter(block), current_location(descriptor) {} LocationDescriptor current_location; u64 PC(); u64 AlignPC(size_t alignment); void SetCheckBit(const IR::U1& value); IR::U1 GetCFlag(); void SetNZCV(const IR::NZCV& nzcv); void CallSupervisor(u32 imm); void ExceptionRaised(Exception exception); IR::U8 ReadMemory8(const IR::U64& vaddr); IR::U16 ReadMemory16(const IR::U64& vaddr); IR::U32 ReadMemory32(const IR::U64& vaddr); IR::U64 ReadMemory64(const IR::U64& vaddr); void WriteMemory8(const IR::U64& vaddr, const IR::U8& value); void WriteMemory16(const IR::U64& vaddr, const IR::U16& value); void WriteMemory32(const IR::U64& vaddr, const IR::U32& value); void WriteMemory64(const IR::U64& vaddr, const IR::U64& value); IR::U32 GetW(Reg source_reg); IR::U64 GetX(Reg source_reg); IR::U128 GetD(Vec source_vec); IR::U128 GetQ(Vec source_vec); IR::U64 GetSP(); void SetW(Reg dest_reg, const IR::U32& value); void SetX(Reg dest_reg, const IR::U64& value); void SetD(Vec dest_vec, const IR::U128& value); void SetQ(Vec dest_vec, const IR::U128& value); void SetSP(const IR::U64& value); void SetPC(const IR::U64& value); }; } // namespace IR } // namespace Dynarmic
/* * This file is part of the coreboot project. * * Copyright (C) 2012 Advanced Micro Devices, 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <device/pci_def.h> #include <device/device.h> /* warning: Porting.h includes an open #pragma pack(1) */ #include <Porting.h> #include <AGESA.h> #include <amdlib.h> #include <soc/southbridge.h> #include <dimmSpd.h> /*----------------------------------------------------------------------------- * * readSmbusByteData - read a single SPD byte from any offset */ static int readSmbusByteData(int iobase, int address, char *buffer, int offset) { unsigned int status; UINT64 limit; address |= 1; // set read bit __outbyte(iobase + 0, 0xff); // clear error status __outbyte(iobase + 1, 0x1f); // clear error status __outbyte(iobase + 3, offset); // offset in eeprom __outbyte(iobase + 4, address); // slave address and read bit __outbyte(iobase + 2, 0x48); // read byte command // time limit to avoid hanging for unexpected error status limit = __rdtsc() + 2000000000 / 10; for (;;) { status = __inbyte(iobase); if (__rdtsc() > limit) break; if ((status & 2) == 0) continue; // SMBusInterrupt not set, keep waiting if ((status & 1) == 1) continue; // HostBusy set, keep waiting break; } buffer[0] = __inbyte(iobase + 5); if (status == 2) status = 0; // check for done with no errors return status; } /*----------------------------------------------------------------------------- * * readSmbusByte - read a single SPD byte from the default offset * this function is faster function readSmbusByteData */ static int readSmbusByte(int iobase, int address, char *buffer) { unsigned int status; UINT64 limit; __outbyte(iobase + 0, 0xff); // clear error status __outbyte(iobase + 2, 0x44); // read command // time limit to avoid hanging for unexpected error status limit = __rdtsc() + 2000000000 / 10; for (;;) { status = __inbyte(iobase); if (__rdtsc() > limit) break; if ((status & 2) == 0) continue; // SMBusInterrupt not set, keep waiting if ((status & 1) == 1) continue; // HostBusy set, keep waiting break; } buffer[0] = __inbyte(iobase + 5); if (status == 2) status = 0; // check for done with no errors return status; } /*--------------------------------------------------------------------------- * * readspd - Read one or more SPD bytes from a DIMM. * Start with offset zero and read sequentially. * Optimization relies on autoincrement to avoid * sending offset for every byte. * Reads 128 bytes in 7-8 ms at 400 KHz. */ static int readspd(int iobase, int SmbusSlaveAddress, char *buffer, int count) { int index, error; printk(BIOS_SPEW, "-------------READING SPD-----------\n"); printk(BIOS_SPEW, "iobase: 0x%08X, SmbusSlave: 0x%08X, count: %d\n", iobase, SmbusSlaveAddress, count); /* read the first byte using offset zero */ error = readSmbusByteData(iobase, SmbusSlaveAddress, buffer, 0); if (error) { printk(BIOS_ERR, "-------------SPD READ ERROR-----------\n"); return error; } /* read the remaining bytes using auto-increment for speed */ for (index = 1 ; index < count ; index++) { error = readSmbusByte(iobase, SmbusSlaveAddress, &buffer[index]); if (error) { printk(BIOS_ERR, "-------------SPD READ ERROR-----------\n"); return error; } } printk(BIOS_SPEW, "\n"); printk(BIOS_SPEW, "-------------FINISHED READING SPD-----------\n"); return 0; } static void writePmReg(int reg, int data) { __outbyte(PM_INDEX, reg); __outbyte(PM_DATA, data); } static void setupFch(int ioBase) { writePmReg(0x2d, ioBase >> 8); writePmReg(0x2c, ioBase | 1); /* set SMBus clock to 400 KHz */ __outbyte(ioBase + 0x0e, 66000000 / 400000 / 4); } int sb_readSpd(int spdAddress, char *buf, size_t len) { int ioBase = 0xb00; setupFch(ioBase); return readspd(ioBase, spdAddress, buf, len); }
#ifndef __CHARTABLE_TWO_FILE_LINE_LAYER_CHART_H__ #define __CHARTABLE_TWO_FILE_LINE_LAYER_CHART_H__ /*LICENSE_START*/ /* * Copyright (C) 2017 Washington University School of Medicine * * 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. */ /*LICENSE_END*/ #include <memory> #include "BrainConstants.h" #include "ChartableTwoFileBaseChart.h" #include "ChartTwoLineLayerContentTypeEnum.h" namespace caret { class BoundingBox; class ChartTwoDataCartesian; class CiftiBrainModelsMap; class MapFileDataSelector; class SceneClassAssistant; class ChartableTwoFileLineLayerChart : public ChartableTwoFileBaseChart { public: ChartableTwoFileLineLayerChart(const ChartTwoLineLayerContentTypeEnum::Enum lineLayerContentType, CaretMappableDataFile* parentCaretMappableDataFile); ChartableTwoFileLineLayerChart(const ChartableTwoFileLineLayerChart&); ChartableTwoFileLineLayerChart& operator=(const ChartableTwoFileLineLayerChart&); virtual ~ChartableTwoFileLineLayerChart(); ChartTwoLineLayerContentTypeEnum::Enum getLineLayerContentType() const; virtual bool isValid() const override; virtual bool isEmpty() const override; virtual void receiveEvent(Event* event) override; int32_t getNumberOfChartMaps() const; void getChartMapNames(std::vector<AString>& mapNamesOut); void clearChartLines(); // ADD_NEW_METHODS_HERE protected: /* Since line may be normalized, must access throught ChartTwoOverlay */ ChartTwoDataCartesian* getChartMapLineForChartTwoOverlay(const int32_t chartMapIndex); /* Since line may be normalized, must access throught ChartTwoOverlay */ bool getBoundsForChartTwoOverlay(const int32_t mapIndex, BoundingBox& boundingBoxOut) const; virtual void saveSubClassDataToScene(const SceneAttributes* sceneAttributes, SceneClass* sceneClass) override; virtual void restoreSubClassDataFromScene(const SceneAttributes* sceneAttributes, const SceneClass* sceneClass) override; private: enum class VolumeOpMode { MAP_NAMES, VOXEL_XYZ }; ChartTwoDataCartesian* loadChartForMapFileSelector(const MapFileDataSelector& mapFileSelector); ChartTwoDataCartesian* createChartData() const; void getMapNamesFromCiftiBrainMap(const CiftiBrainModelsMap& brainModelsMap, std::vector<AString>& mapNames); void setVolumeMapNamesAndVoxelXYZ(); ChartTwoDataCartesian* getChartMapLinePrivate(const int32_t chartMapIndex); bool getBoundsPrivate(const int32_t mapIndex, BoundingBox& boundingBoxOut) const; std::unique_ptr<SceneClassAssistant> m_sceneAssistant; std::vector<std::unique_ptr<ChartTwoDataCartesian>> m_mapLineCharts; std::vector<AString> m_mapLineChartNames; std::vector<float> m_voxelXYZ; ChartTwoLineLayerContentTypeEnum::Enum m_lineLayerContentType; bool m_volumeAttributesValid = false; // ADD_NEW_MEMBERS_HERE friend class ChartTwoOverlay; }; #ifdef __CHARTABLE_TWO_FILE_LINE_LAYER_CHART_DECLARE__ #endif // __CHARTABLE_TWO_FILE_LINE_LAYER_CHART_DECLARE__ } // namespace #endif //__CHARTABLE_TWO_FILE_LINE_LAYER_CHART_H__
/* * java-gnome, a UI library for writing GTK and GNOME programs from Java! * * Copyright © 2006-2011 Operational Dynamics Consulting, Pty Ltd and Others * * The code in this file, and the program it is a part of, is made available * to you by its authors as open source software: you can redistribute it * and/or modify it under the terms of the GNU General Public License version * 2 ("GPL") 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 GPL for more details. * * You should have received a copy of the GPL along with this program. If not, * see http://www.gnu.org/licenses/. The authors of this program may be * contacted through http://java-gnome.sourceforge.net/. * * Linking this library statically or dynamically with other modules is making * a combined work based on this library. Thus, the terms and conditions of * the GPL cover the whole combination. As a special exception (the * "Claspath Exception"), the copyright holders of this library give you * permission to link this library with independent modules to produce an * executable, regardless of the license terms of these independent modules, * and to copy and distribute the resulting executable under terms of your * choice, provided that you also meet, for each linked independent module, * the terms and conditions of the license of that module. An independent * module is a module which is not derived from or based on this library. If * you modify this library, you may extend the Classpath Exception to your * version of the library, but you are not obligated to do so. If you do not * wish to do so, delete this exception statement from your version. */ /* * THIS FILE IS GENERATED CODE! * * To modify its contents or behaviour, either update the generation program, * change the information in the source defs file, or implement an override for * this class. */ #include <jni.h> #include <gtk/gtk.h> #include "bindings_java.h" #include "org_gnome_gtk_GtkVScale.h" JNIEXPORT jlong JNICALL Java_org_gnome_gtk_GtkVScale_gtk_1vscale_1new ( JNIEnv* env, jclass cls, jlong _adjustment ) { GtkWidget* result; jlong _result; GtkAdjustment* adjustment; // convert parameter adjustment adjustment = (GtkAdjustment*) _adjustment; // call function result = gtk_vscale_new(adjustment); // cleanup parameter adjustment // translate return value to JNI type _result = (jlong) result; // cleanup return value if (result != NULL) { bindings_java_memory_cleanup((GObject*)result, TRUE); } // and finally return _result; } JNIEXPORT jlong JNICALL Java_org_gnome_gtk_GtkVScale_gtk_1vscale_1new_1with_1range ( JNIEnv* env, jclass cls, jdouble _min, jdouble _max, jdouble _step ) { GtkWidget* result; jlong _result; gdouble min; gdouble max; gdouble step; // convert parameter min min = (gdouble) _min; // convert parameter max max = (gdouble) _max; // convert parameter step step = (gdouble) _step; // call function result = gtk_vscale_new_with_range(min, max, step); // cleanup parameter min // cleanup parameter max // cleanup parameter step // translate return value to JNI type _result = (jlong) result; // cleanup return value if (result != NULL) { bindings_java_memory_cleanup((GObject*)result, TRUE); } // and finally return _result; }
/* Copyright (C) 2015 Mateusz Kulikowski <mateusz.kulikowski@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, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include "printk.h" #include "elf64.h" #include "util.h" #include "task.h" #include "page.h" static const char *pheader_types[] = { "Unused", "Load", "Dynamic", "Interpreter", "Note", "Reserved (shlib)", "Program Header", "Thread-Local-Storage" }; static const char * str_perms(uint16_t perms) { static char p[4]={0,}; if (perms & PF_X) p[2] = 'x'; else p[2] = '-'; if (perms & PF_W) p[1] = 'w'; else p[1] = '-'; if (perms & PF_R) p[0] = 'r'; else p[0] = '-'; return p; } static void parse_program_header(struct task * t,void * blob, unsigned size, unsigned num, unsigned hdr_offset) { dbg("Parsing program header. size: %d number: %d\n", size, num); Elf64_Phdr * hdr = blob; if (size != sizeof(Elf64_Phdr)) panic("Wrong program header size.\n"); while (num--) { dbg("%s perms: %s file_ofs: %#llx", pheader_types[hdr->p_type], str_perms(hdr->p_flags), hdr->p_offset); printk(" paddr: %#llx vaddr: %#llx file_size: %#llx mem_size: %#llx align: %#llx\n", hdr->p_paddr, hdr->p_vaddr, hdr->p_filesz, hdr->p_memsz, hdr->p_align); if (hdr->p_type == PT_LOAD) { if (t->vma_addr == 0) { t->vma_size = ALIGN_PGUP(hdr->p_memsz); t->vma_addr = page_alloc(t->vma_size >> PAGE_SHIFT); info("Loading program... %d bytes to %d (%d) byte mem blob at %#x\n", hdr->p_filesz, hdr->p_memsz, t->vma_size, t->vma_addr); memcpy(t->vma_addr, blob + hdr->p_offset - hdr_offset, hdr->p_filesz); memset(t->vma_addr + hdr->p_filesz, 0, t->vma_size - hdr->p_filesz); } } hdr ++; } } static const char * sheader_types[] = { "NULL", "progbits", "symtab", "strtab", "rela", "hash", "dynamic", "note", "nobits", "rel", "res(shlib)", "dynsym", "init_array", "fini_array", "preinit_array", "group", "symtab_shndx", }; static const char *get_sheader_type(unsigned type) { if (type < (sizeof(sheader_types)/sizeof(sheader_types[0]))) return sheader_types[type]; return "???"; } static void parse_section_header(void * blob, unsigned size, unsigned num, unsigned stridx) { info("Parsing section header. size: %d number: %d strings at section %d\n", size, num, stridx); if (sizeof(Elf64_Shdr) != size) panic("Wrong session header size.\n"); Elf64_Shdr * hdr = blob; while (num --) { dbg("name: %d type: %s\n", hdr->sh_name, get_sheader_type(hdr->sh_type)); hdr++; } } static void parse_elf(struct task * t, void * blob, unsigned size) { Elf64_Ehdr *hdr = blob; dbg("Parsing ELF header @ %#llx; %d bytes\n", blob, size); if (size < sizeof(Elf64_Ehdr)) { wrn("Image too small.\n"); goto fail; } if (!IS_ELF(*hdr)) { wrn("Image is not ELF.\n"); goto fail; } if (hdr->e_ident[EI_CLASS] != ELFCLASS64) { wrn("Unsupported elf class\n"); goto fail; } if (hdr->e_ident[EI_DATA] != ELFDATA2LSB) { wrn("Unsupported elf endiannes\n"); goto fail; } dbg("ABI: %02x ABI_v: %02x \n", hdr->e_ident[EI_OSABI], hdr->e_ident[EI_ABIVERSION]); dbg("type: %hx machine: %hd version: %x\n", hdr->e_type, hdr->e_machine, hdr->e_version); if (hdr->e_machine != EM_AARCH64) { wrn("Unsupported target machine.\n"); goto fail; } dbg("entry: %#llx program header starts at %#llx section header starts at %#llx\n", hdr->e_entry, hdr->e_phoff, hdr->e_shoff); dbg("arch_flags: %#x elf_header_size: %#hx\n", hdr->e_flags, hdr->e_ehsize); parse_program_header(t, blob + hdr->e_phoff, hdr->e_phentsize, hdr->e_phnum, hdr->e_phoff); // parse_section_header(blob + hdr->e_shoff, hdr->e_shentsize, hdr->e_shnum, hdr->e_shstrndx); return; fail: panic("And it failed...\n"); } int load_elf(struct task * task, void * blob, unsigned size) { info("Loading task %s; blob size: %d\n", task->name, size); parse_elf(task, blob, size); return task->vma_addr == 0; }
/* *** Open Grid Dialog *** src/gui/opengrid.h Copyright T. Youngs 2007-2018 This file is part of Aten. Aten 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. Aten 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 Aten. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ATEN_OPENGRIDDIALOG_H #define ATEN_OPENGRIDDIALOG_H #include "gui/ui_opengrid.h" #include "gui/filedialog.h" #include "plugins/interfaces/fileplugin.h" #include "base/namespace.h" // Forward Declarations (Qt) /* none */ ATEN_BEGIN_NAMESPACE // Forward Declarations (Aten) /* none */ ATEN_END_NAMESPACE ATEN_USING_NAMESPACE // Open Grid Dialog class AtenOpenGrid : public QDialog, public AtenFileDialog { // All Qt declarations derived from QObject must include this macro Q_OBJECT public: // Constructor AtenOpenGrid(QWidget* parent, QDir startingDirectory, const RefList<FilePluginInterface,KVMap>& filePlugins); // Main form declaration Ui::OpenGridDialog ui; /* * Widget Functions */ private slots: void on_PluginOptionsButton_clicked(bool checked); void on_OpenButton_clicked(bool checked); void on_CancelButton_clicked(bool checked); public: // Execute dialog bool execute(int currentPluginsLogPoint, QString currentFilename = QString(), const FilePluginInterface* currentPlugin = NULL); // Return standard import options from dialog FilePluginStandardImportOptions standardImportOptions(); // Return standard export options from dialog FilePluginStandardExportOptions standardExportOptions(); /* * Signals / Slots */ private slots: // Update standard options from plugin's local options void updateStandardOptionsFromPlugin(); }; #endif
///////////////////////////////////////////////////////////////////////////// // Name: contrib/samples/ogl/ogledit/doc.h // Purpose: Document classes // Author: Julian Smart // Modified by: // Created: 12/07/98 // RCS-ID: $Id: doc.h 38810 2006-04-18 22:26:26Z PC $ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _OGLSAMPLE_DOC_H_ #define _OGLSAMPLE_DOC_H_ #include "wx/docview.h" #include "wx/cmdproc.h" #include "wx/string.h" #include "wx/ogl/ogl.h" // base header of OGL, includes and adjusts wx/deprecated/setup.h #if wxUSE_PROLOGIO #include "wx/deprecated/wxexpr.h" #endif #include "wx/ogl/ogl.h" #if wxUSE_STD_IOSTREAM #include <iosfwd> #endif /* * Override a few members for this application */ class MyDiagram: public wxDiagram { public: MyDiagram(void) {} #if wxUSE_PROLOGIO bool OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr); bool OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr); #endif }; /* * A few new shape classes so we have a 1:1 mapping * between palette symbol and unique class */ class wxRoundedRectangleShape: public wxRectangleShape { DECLARE_DYNAMIC_CLASS(wxRoundedRectangleShape) private: public: wxRoundedRectangleShape(double w = 0.0, double h = 0.0); }; class wxDiamondShape: public wxPolygonShape { DECLARE_DYNAMIC_CLASS(wxDiamondShape) private: public: wxDiamondShape(double w = 0.0, double h = 0.0); }; /* * All shape event behaviour is routed through this handler, so we don't * have to derive from each shape class. We plug this in to each shape. */ class MyEvtHandler: public wxShapeEvtHandler { public: wxString label; MyEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = wxEmptyString):wxShapeEvtHandler(prev, shape) { label = lab; } ~MyEvtHandler(void) { } void OnLeftClick(double x, double y, int keys = 0, int attachment = 0); void OnBeginDragRight(double x, double y, int keys = 0, int attachment = 0); void OnDragRight(bool draw, double x, double y, int keys = 0, int attachment = 0); void OnEndDragRight(double x, double y, int keys = 0, int attachment = 0); void OnEndSize(double x, double y); }; /* * A diagram document, which contains a diagram. */ class DiagramDocument: public wxDocument { DECLARE_DYNAMIC_CLASS(DiagramDocument) private: public: MyDiagram diagram; DiagramDocument(void); ~DiagramDocument(void); #if wxUSE_STD_IOSTREAM virtual wxSTD ostream& SaveObject(wxSTD ostream& stream); virtual wxSTD istream& LoadObject(wxSTD istream& stream); #else virtual wxOutputStream& SaveObject(wxOutputStream& stream); virtual wxInputStream& LoadObject(wxInputStream& stream); #endif inline wxDiagram *GetDiagram() { return &diagram; } bool OnCloseDocument(void); }; /* * Most user interface commands are routed through this, to give us the * Undo/Redo mechanism. If you add more commands, such as changing the shape colour, * you will need to add members to 'remember' what the user applied (for 'Do') and what the * previous state was (for 'Undo'). * You can have one member for each property to be changed. Assume we also have * a pointer member wxShape *shape, which is set to the shape being changed. * Let's assume we're changing the shape colour. Our member for this is shapeColour. * * - In 'Do': * o Set a temporary variable 'temp' to the current colour for 'shape'. * o Change the colour to the new colour. * o Set shapeColour to the _old_ colour, 'temp'. * - In 'Undo': * o Set a temporary variable 'temp' to the current colour for 'shape'. * o Change the colour to shapeColour (the old colour). * o Set shapeColour to 'temp'. * * So, as long as we have a pointer to the shape being changed, * we only need one member variable for each property. * * PROBLEM: when an Add shape command is redone, the 'shape' pointer changes. * Assume, as here, that we keep a pointer to the old shape so we reuse it * when we recreate. */ class DiagramCommand: public wxCommand { protected: DiagramDocument *doc; int cmd; wxShape *shape; // Pointer to the shape we're acting on wxShape *fromShape; wxShape *toShape; wxClassInfo *shapeInfo; double x; double y; bool selected; bool deleteShape; // Storage for property commands const wxBrush *shapeBrush; wxPen *shapePen; wxString shapeLabel; public: // Multi-purpose constructor for creating, deleting shapes DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, wxClassInfo *shapeInfo = NULL, double x = 0.0, double y = 0.0, bool sel = false, wxShape *theShape = NULL, wxShape *fs = NULL, wxShape *ts = NULL); // Property-changing command constructors DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape); DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape); ~DiagramCommand(void); bool Do(void); bool Undo(void); inline void SetShape(wxShape *s) { shape = s; } inline wxShape *GetShape(void) { return shape; } inline wxShape *GetFromShape(void) { return fromShape; } inline wxShape *GetToShape(void) { return toShape; } inline wxClassInfo *GetShapeInfo(void) { return shapeInfo; } inline bool GetSelected(void) { return selected; } void RemoveLines(wxShape *shape); }; #endif // _OGLSAMPLE_DOC_H_
/* * $Id: mxf_macros.h,v 1.5 2008/11/07 14:12:59 philipn Exp $ * * General purpose macros * * Copyright (C) 2006 Philip de Nier <philipn@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MXF_MACROS_H__ #define __MXF_MACROS_H__ #ifdef __cplusplus extern "C" { #endif /* * Command checking macros * ...ORET - check succeeds, otherwise return 0 * ...OFAIL - check succeeds, otherwise goto fail */ #define CHK_ORET(cmd) \ if (!(cmd)) \ { \ mxf_log_error("'%s' failed, in %s:%d\n", #cmd, __FILE__, __LINE__); \ return 0; \ } #define CHK_OFAIL(cmd) \ if (!(cmd)) \ { \ mxf_log_error("'%s' failed, in %s:%d\n", #cmd, __FILE__, __LINE__); \ goto fail; \ } #define CHK_MALLOC_ORET(var, type) \ CHK_ORET((var = (type*)malloc(sizeof(type))) != NULL); #define CHK_MALLOC_OFAIL(var, type) \ CHK_OFAIL((var = (type*)malloc(sizeof(type))) != NULL); #define CHK_MALLOC_ARRAY_ORET(var, type, length) \ CHK_ORET((var = (type*)malloc(sizeof(type) * (length))) != NULL); #define CHK_MALLOC_ARRAY_OFAIL(var, type, length) \ CHK_OFAIL((var = (type*)malloc(sizeof(type) * (length))) != NULL); /* * Free the memory and set the variable to NULL */ #define SAFE_FREE(d_ptr) \ if (*d_ptr != NULL) \ { \ free(*d_ptr); \ *d_ptr = NULL; \ } /* * Helpers for logging */ /* e.g. mxf_log_error("Some error %d" LOG_LOC_FORMAT, x, LOG_LOC_PARAMS); */ #define LOG_LOC_FORMAT ", in %s:%d\n" #define LOG_LOC_PARAMS __FILE__, __LINE__ /* * 64-bit printf formatting */ #if defined(_MSC_VER) #define PFi64 "I64d" #define PFu64 "I64u" #define PFoff "I64d" #elif defined(__x86_64__) #define PFi64 "ld" #define PFu64 "lu" #define PFoff "ld" #else #define PFi64 "lld" #define PFu64 "llu" #define PFoff "lld" #endif /* * size_t printf formatting varies by platform */ #if defined(__APPLE__) || defined(__x86_64__) #define PFszt "lu" #else #define PFszt "u" #endif #ifdef __cplusplus } #endif #endif
/* * Adium is the legal property of its developers, whose names are listed in the copyright file included * with this source distribution. * * 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. */ #import <Adium/AIAbstractListController.h> #import <Adium/AIInterfaceControllerProtocol.h> #define PREF_DETACHED_GROUPS @"Detached Groups" #define KEY_LIST_LAYOUT_NAME @"List Layout Name" #define KEY_LIST_THEME_NAME @"List Theme Name" #define KEY_LIST_DETACHABLE @"List Detachable" #define DetachedContactListIsEmpty @"DetachedContactListIsEmpty" @class AIListWindowController, AICLPreferences, AIListContact, ESContactListAdvancedPreferences; @protocol AIMultiContactListComponent; @interface AISCLViewPlugin : AIPlugin <AIMultiContactListComponent, NSMenuDelegate> { NSMutableArray *contactLists; ESContactListAdvancedPreferences *advancedPreferences; AIContactListWindowStyle windowStyle; AIListWindowController *defaultController; BOOL hasLoaded; NSMenuItem *menuItem_nextDetached; NSMenuItem *menuItem_previousDetached; NSMenuItem *menuItem_consolidate; NSMenuItem *detachMenuItem; NSMenuItem *attachMenuItem; NSMenu *attachSubmenu; NSUInteger detachedCycle; } //Manage multiple windows - (void)closeContactList:(AIListWindowController *)window; //Contact List Controller - (AIListWindowController *)contactListWindowController; - (void)contactListDidClose:(NSNotification *)notification; - (void)showContactListAndBringToFront:(BOOL)bringToFront; - (BOOL)contactListIsVisibleAndMain; - (BOOL)contactListIsVisible; - (void)closeContactList; - (void)closeDetachedContactLists; @end
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // // copyright : (C) 2008 by Eran Ifrah // file name : quickdebugdlg.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 __quickdebugdlg__ #define __quickdebugdlg__ #include "quickdebugbase.h" #include "quickdebuginfo.h" class QuickDebugDlg : public QuickDebugBase { protected: virtual void OnRemoteBrowedDebuggee(wxCommandEvent& event); virtual void OnRemoteBrowseDebugger(wxCommandEvent& event); virtual void OnRemoteBrowseWD(wxCommandEvent& event); virtual void OnDebuggerChanged(wxCommandEvent& event); virtual void OnDebugOverSshUI(wxUpdateUIEvent& event); virtual void OnSelectAlternateDebugger(wxCommandEvent& event); void OnButtonBrowseExe(wxCommandEvent& event); void OnButtonDebug(wxCommandEvent& event); void OnButtonCancel(wxCommandEvent& event); void OnButtonBrowseWD(wxCommandEvent& event); void Initialize(); void UpdateDebuggerExecutable(const QuickDebugInfo& info); wxArrayString GetStartupCmds(); void SetComboBoxValue(wxComboBox* combo, const wxString& value); public: QuickDebugDlg(wxWindow* parent); virtual ~QuickDebugDlg(); }; #endif // __quickdebugdlg__
#ifndef _LINUX_LP_H #define _LINUX_LP_H /* * usr/include/linux/lp.h c.1991-1992 James Wiegand * many modifications copyright (C) 1992 Michael K. Johnson * Interrupt support added 1993 Nigel Gamble */ /* * Per POSIX guidelines, this module reserves the LP and lp prefixes * These are the lp_table[minor].flags flags... */ #define LP_EXIST 0x0001 #define LP_SELEC 0x0002 #define LP_BUSY 0x0004 #define LP_OFFL 0x0008 #define LP_NOPA 0x0010 #define LP_ERR 0x0020 #define LP_ABORT 0x0040 /* timeout for each character. This is relative to bus cycles -- it * is the count in a busy loop. THIS IS THE VALUE TO CHANGE if you * have extremely slow printing, or if the machine seems to slow down * a lot when you print. If you have slow printing, increase this * number and recompile, and if your system gets bogged down, decrease * this number. This can be changed with the tunelp(8) command as well. */ #define LP_INIT_CHAR 1000 /* The parallel port specs apparently say that there needs to be * a .5usec wait before and after the strobe. Since there are wildly * different computers running linux, I can't come up with a perfect * value, but since it worked well on most printers before without, * I'll initialize it to 0. */ #define LP_INIT_WAIT 0 /* This is the amount of time that the driver waits for the printer to * catch up when the printer's buffer appears to be filled. If you * want to tune this and have a fast printer (i.e. HPIIIP), decrease * this number, and if you have a slow printer, increase this number. * This is in hundredths of a second, the default 2 being .05 second. * Or use the tunelp(8) command, which is especially nice if you want * change back and forth between character and graphics printing, which * are wildly different... */ #define LP_INIT_TIME 2 /* IOCTL numbers */ #define LPCHAR 0x0001 /* corresponds to LP_INIT_CHAR */ #define LPTIME 0x0002 /* corresponds to LP_INIT_TIME */ #define LPABORT 0x0004 /* call with TRUE arg to abort on error, FALSE to retry. Default is retry. */ #define LPSETIRQ 0x0005 /* call with new IRQ number, or 0 for polling (no IRQ) */ #define LPGETIRQ 0x0006 /* get the current IRQ number */ #define LPWAIT 0x0008 /* corresponds to LP_INIT_WAIT */ /* timeout for printk'ing a timeout, in jiffies (100ths of a second). This is also used for re-checking error conditions if LP_ABORT is not set. This is the default behavior. */ #define LP_TIMEOUT_INTERRUPT (60 * HZ) #define LP_TIMEOUT_POLLED (10 * HZ) #define LP_B(minor) lp_table[(minor)].base /* IO address */ #define LP_F(minor) lp_table[(minor)].flags /* flags for busy, etc. */ #define LP_S(minor) inb_p(LP_B((minor)) + 1) /* status port */ #define LP_C(minor) (lp_table[(minor)].base + 2) /* control port */ #define LP_CHAR(minor) lp_table[(minor)].chars /* busy timeout */ #define LP_TIME(minor) lp_table[(minor)].time /* wait time */ #define LP_WAIT(minor) lp_table[(minor)].wait /* strobe wait */ #define LP_IRQ(minor) lp_table[(minor)].irq /* interrupt # */ /* 0 means polled */ #define LP_BUFFER_SIZE 256 struct lp_struct { int base; unsigned int irq; int flags; unsigned int chars; unsigned int time; unsigned int wait; struct wait_queue *lp_wait_q; char *lp_buffer; }; /* * bit defines for 8255 status port * base + 1 * accessed with LP_S(minor), which gets the byte... */ #define LP_PBUSY 0x80 /* active low */ #define LP_PACK 0x40 /* active low */ #define LP_POUTPA 0x20 #define LP_PSELECD 0x10 #define LP_PERRORP 0x08 /* active low*/ /* * defines for 8255 control port * base + 2 * accessed with LP_C(minor) */ #define LP_PINTEN 0x10 #define LP_PSELECP 0x08 #define LP_PINITP 0x04 /* active low */ #define LP_PAUTOLF 0x02 #define LP_PSTROBE 0x01 /* * the value written to ports to test existence. PC-style ports will * return the value written. AT-style ports will return 0. so why not * make them the same ? */ #define LP_DUMMY 0x00 /* * This is the port delay time. Your mileage may vary. * It is used only in the lp_init() routine. */ #define LP_DELAY 150000 /* * function prototypes */ extern long lp_init(long); #endif
// SimpleData.h // // Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Matthew Flood // See file AUTHORS for contact information // // This file is part of RudeCGI. // // RudeCGI 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. // // RudeCGI 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 RudeCGI; (see COPYING) if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. //------------------------------------------------------------------------ #ifndef INCLUDED_SimpleData_H #define INCLUDED_SimpleData_H #ifndef INCLUDED_DataObject_H #include "DataObject.h" #endif #ifndef INCLUDED_STRING #include <string> #define INCLUDED_STRING #endif namespace rude{ namespace cgiparser{ // this class is a liteweight hash table // it expects values to be simple cstrings, // not binary data. For binary data, use // Req_FileObject. // class SimpleData: public DataObject { // holds the fieldname // std::string d_name; // holds the string value // std::string d_value; public: // CONSTRUCTORS // SimpleData(); SimpleData(const char *name, const char *value); // DESTRUCTOR // ~SimpleData(); // returns the fieldname if it exists, // or an empty string // const char *getFieldName() const; // returns the value if it exists, // or the empty string // const char *getValue() const; // returns the length of the value, // or 0 if there is no value // int getLength() const; // since this is not a file object, // this will always return NULL // const char *getFilepath() const; // since this is not a file object, // this will always return NULL // const char *getFilename() const; // since this is not a file object, // this will always return NULL // const char *getContentType() const; // sets the value of the data object // If value is NULL, the internal value will // be the empty string // void setValue(const char *value); // sets the identifying name of the data object // if name is NULL, the internal value will be the empty string // void setFieldName(const char *name); // always "form" const char *datasource() const; }; }} // end namespaces #endif
/* Copyright (C) 1997-2001 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. */ // // these are the key numbers that should be passed to Key_Event // typedef enum { K_TAB = 9, K_ENTER = 13, K_ESCAPE = 27, K_SPACE = 32, // normal keys should be passed as lowercased ascii K_BACKSPACE = 127, K_UPARROW, K_DOWNARROW, K_LEFTARROW, K_RIGHTARROW, K_ALT, K_CTRL, K_SHIFT, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_INS, K_DEL, K_PGDN, K_PGUP, K_HOME, K_END, K_KP_HOME = 160, K_KP_UPARROW, K_KP_PGUP, K_KP_LEFTARROW, K_KP_5, K_KP_RIGHTARROW, K_KP_END, K_KP_DOWNARROW, K_KP_PGDN, K_KP_ENTER, K_KP_INS, K_KP_DEL, K_KP_SLASH, K_KP_MINUS, K_KP_PLUS, K_PAUSE = 255, // // mouse buttons generate virtual keys // K_MOUSE1 = 200, K_MOUSE2, K_MOUSE3, K_MOUSE4, K_MOUSE5, // // joystick buttons // K_JOY1, K_JOY2, K_JOY3, K_JOY4, // // aux keys are for multi-buttoned joysticks to generate so they can use // the normal binding process // K_AUX1, K_AUX2, K_AUX3, K_AUX4, K_AUX5, K_AUX6, K_AUX7, K_AUX8, K_AUX9, K_AUX10, K_AUX11, K_AUX12, K_AUX13, K_AUX14, K_AUX15, K_AUX16, K_AUX17, K_AUX18, K_AUX19, K_AUX20, K_AUX21, K_AUX22, K_AUX23, K_AUX24, K_AUX25, K_AUX26, K_AUX27, K_AUX28, K_AUX29, K_AUX30, K_AUX31, K_AUX32, K_MWHEELDOWN, K_MWHEELUP, K_GAMEPAD_LSTICK_UP = 300, K_GAMEPAD_LSTICK_DOWN, K_GAMEPAD_LSTICK_LEFT, K_GAMEPAD_LSTICK_RIGHT, K_GAMEPAD_RSTICK_UP, K_GAMEPAD_RSTICK_DOWN, K_GAMEPAD_RSTICK_LEFT, K_GAMEPAD_RSTICK_RIGHT, K_GAMEPAD_LT, K_GAMEPAD_RT, K_GAMEPAD_A, K_GAMEPAD_B, K_GAMEPAD_X, K_GAMEPAD_Y, K_GAMEPAD_BACK, K_GAMEPAD_GUIDE, K_GAMEPAD_START, K_GAMEPAD_LEFT_STICK, K_GAMEPAD_RIGHT_STICK, K_GAMEPAD_LS, K_GAMEPAD_RS, K_GAMEPAD_UP, K_GAMEPAD_DOWN, K_GAMEPAD_LEFT, K_GAMEPAD_RIGHT, } keynum_t; /* // // these are the key numbers that should be passed to Key_Event // #define K_TAB 9 #define K_ENTER 13 #define K_ESCAPE 27 #define K_SPACE 32 // normal keys should be passed as lowercased ascii #define K_BACKSPACE 127 #define K_UPARROW 128 #define K_DOWNARROW 129 #define K_LEFTARROW 130 #define K_RIGHTARROW 131 #define K_ALT 132 #define K_CTRL 133 #define K_SHIFT 134 #define K_F1 135 #define K_F2 136 #define K_F3 137 #define K_F4 138 #define K_F5 139 #define K_F6 140 #define K_F7 141 #define K_F8 142 #define K_F9 143 #define K_F10 144 #define K_F11 145 #define K_F12 146 #define K_INS 147 #define K_DEL 148 #define K_PGDN 149 #define K_PGUP 150 #define K_HOME 151 #define K_END 152 #define K_KP_HOME 160 #define K_KP_UPARROW 161 #define K_KP_PGUP 162 #define K_KP_LEFTARROW 163 #define K_KP_5 164 #define K_KP_RIGHTARROW 165 #define K_KP_END 166 #define K_KP_DOWNARROW 167 #define K_KP_PGDN 168 #define K_KP_ENTER 169 #define K_KP_INS 170 #define K_KP_DEL 171 #define K_KP_SLASH 172 #define K_KP_MINUS 173 #define K_KP_PLUS 174 #define K_PAUSE 255 // // mouse buttons generate virtual keys // #define K_MOUSE1 200 #define K_MOUSE2 201 #define K_MOUSE3 202 // // joystick buttons // #define K_JOY1 203 #define K_JOY2 204 #define K_JOY3 205 #define K_JOY4 206 // // aux keys are for multi-buttoned joysticks to generate so they can use // the normal binding process // #define K_AUX1 207 #define K_AUX2 208 #define K_AUX3 209 #define K_AUX4 210 #define K_AUX5 211 #define K_AUX6 212 #define K_AUX7 213 #define K_AUX8 214 #define K_AUX9 215 #define K_AUX10 216 #define K_AUX11 217 #define K_AUX12 218 #define K_AUX13 219 #define K_AUX14 220 #define K_AUX15 221 #define K_AUX16 222 #define K_AUX17 223 #define K_AUX18 224 #define K_AUX19 225 #define K_AUX20 226 #define K_AUX21 227 #define K_AUX22 228 #define K_AUX23 229 #define K_AUX24 230 #define K_AUX25 231 #define K_AUX26 232 #define K_AUX27 233 #define K_AUX28 234 #define K_AUX29 235 #define K_AUX30 236 #define K_AUX31 237 #define K_AUX32 238 #define K_MWHEELDOWN 239 #define K_MWHEELUP 240 //Knightmare 12/22/2001 #define K_MOUSE4 241 #define K_MOUSE5 242 //end Knightmare */ #define MAX_KEYEVENTS 512 extern char *keybindings[MAX_KEYEVENTS]; extern hash32_t keybindinghashes[MAX_KEYEVENTS]; extern int32_t key_repeats[MAX_KEYEVENTS]; extern int32_t anykeydown; extern char chat_buffer[]; extern int32_t chat_bufferlen; extern int32_t chat_backedit; extern qboolean chat_team; void Key_Event (int32_t key, qboolean down, unsigned time); void Key_Init (void); void Key_WriteBindings (FILE *f); void Key_SetBinding (int32_t keynum, char *binding); void Key_ClearStates (void); int32_t Key_GetKey (void);
/** ****************************************************************************** * @file stm32f4xx_it.c * @author MCD Application Team * @version V1.0.1 * @date 26-February-2014 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2014 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 "stm32f4xx_it.h" /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { HAL_IncTick(); } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f4xx.s). */ /******************************************************************************/ /** * @brief This function handles DMA2 Stream 3 interrupt request. * @param None * @retval None */ void DMA2_Stream3_IRQHandler(void) { BSP_SD_DMA_Rx_IRQHandler(); } /** * @brief This function handles DMA2 Stream 6 interrupt request. * @param None * @retval None */ void DMA2_Stream6_IRQHandler(void) { BSP_SD_DMA_Tx_IRQHandler(); } /** * @brief This function handles SDIO interrupt request. * @param None * @retval None */ void SDIO_IRQHandler(void) { BSP_SD_IRQHandler(); } /** * @brief This function handles PPP interrupt request. * @param None * @retval None */ /*void PPP_IRQHandler(void) { }*/ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#ifndef __CMESSAGEBOARD_H #define __CMESSAGEBOARD_H #include <SDL.h> #include "common/defines.h" #include "common/CRect.h" #include "common/CDrawArea.h" #include "COptions.h" const int KMaxMessagesOnBoard=6; const int KMaxMessagesLengthOnBoard=80; const int KNetMessageMaxLength=(KMaxMessagesLengthOnBoard-KPlayerNameMaxLength-1); class CGameGraphicsInterface; class CDrawArea; class CMessageBoard { public: CMessageBoard(); ~CMessageBoard(); void AddMessage(const char* msg); void Run(CDrawArea& aDirtyArea); void Draw(CGameGraphicsInterface* aGGI,CDrawArea& aDrawArea); void Clear(); void SetDrawOffset( int aOffset ); // vertical offset to messageboard private: CDrawArea iCleanArea; bool iNeedUpdate; int iOffset; int iClearTime; std::vector< std::string > iMessages; SDL_sem* iSemaphore; }; #endif
/* * lirc.h: LIRC remote control * * See the main source file 'vdr.c' for copyright information and * how to reach the author. * * $Id$ */ #ifndef __LIRC_H #define __LIRC_H #include <sys/un.h> #include "remote.h" #include "thread.h" class cLircRemote : public cRemote, private cThread { private: enum { LIRC_KEY_BUF = 30, LIRC_BUFFER_SIZE = 128 }; int f; struct sockaddr_un addr; virtual void Action(void); bool Connect(void); public: cLircRemote(const char *DeviceName); virtual ~cLircRemote(); virtual bool Ready(void); }; #endif //__LIRC_H
#include <../../nrnconf.h> #include "hoc.h" extern int hoc_is_double_arg(); extern double* getarg(); extern double* hoc_pgetarg(); #define INTERPOLATE 1 typedef struct TableArg { int nsize; double* argvec; /* if nil use min,max */ double min; double max; #if INTERPOLATE double frac; /* temporary storage */ #endif } TableArg; typedef struct FuncTable { double* table; TableArg* targs; double value; /* if constant this is it */ } FuncTable; static int arg_index(ta, x) TableArg* ta; double x; { int j; if (ta->argvec) { int t0, t1; #if INTERPOLATE ta->frac = 0.; #endif t0 = 0; t1 = ta->nsize-1; if (x <= ta->argvec[t0]) { j = 0; }else if (x >= ta->argvec[t1]) { j = t1; }else{ while (t0 < (t1-1)) { j = (t0 + t1)/2; #if 0 printf("x[%d]=%g x[%d]=%g x[%d]=%g\n", t0, ta->argvec[t0], j, ta->argvec[j], t1, ta->argvec[t1]); #endif if (ta->argvec[j] <= x) { t0 = j; }else{ t1 = j; } } j = t0; #if INTERPOLATE ta->frac = (x - ta->argvec[j])/(ta->argvec[j+1] - ta->argvec[j]); #if 0 printf("x[%d]=%g frac=%g x=%g\n", j, ta->argvec[j], ta->frac, x); #endif #endif } }else{ #if INTERPOLATE ta->frac = 0.; #endif if (x <= ta->min) { j = 0; }else if (x >= ta->max) { j = ta->nsize -1; }else{ double d, x1; d = (ta->max - ta->min)/((double)(ta->nsize - 1)); x1 = (x - ta->min)/d; j = (int)x1; #if INTERPOLATE ta->frac = x1 - (double)j; #endif } } return j; } static double inter(frac, tab, j) double frac; double* tab; int j; { if (frac > 0.) { return (1. - frac)*tab[j] + frac*tab[j+1]; }else{ return tab[j]; } } static double interp(frac, x1, x2) double frac, x1, x2; { if (frac > 0.) { return (1. - frac)*x1 + frac*x2; }else{ return x1; } } double hoc_func_table(ft, n, args) FuncTable* ft; int n; double* args; { int i, j; double* tab; if (!ft) { hoc_execerror("table not specified in hoc_func_table", (char*)0); } tab = ft->table; j = 0; for (i=0; i < n; ++i) { j = (j * ft->targs[i].nsize) + arg_index(ft->targs + i, args[i]); /* printf("calculating j: i=%d args=%g j=%d frac=%g\n", i, args[i], j, ft->targs[i].frac); */ } #if INTERPOLATE if (n == 1) { return inter(ft->targs[0].frac, tab, j); }else if (n == 2) { /* adjacent indices ar adjacent values of y dimension */ double y1, y2; double fy = ft->targs[1].frac; y1 = inter(fy, tab, j); /* printf("calculating y1: fy=%g j=%d y1=%g, tabj=%g\n", fy, j, y1, tab[j]); */ if (ft->targs[0].frac) { /* x dimension fraction */ int j1 = j + ft->targs[1].nsize; y2 = inter(fy, tab, j1); /* printf("calculating y2: fx=%g fy=%g j1=%d y2=%g tabj1=%g\n", ft->targs[0].frac, fy, j1, y2, tab[j1]); */ return interp(ft->targs[0].frac, y1, y2); }else{ return y1; } }else{ return tab[j]; } #else return tab[j]; #endif } hoc_spec_table(ppt, n) FuncTable** ppt; int n; { int i, argcnt; FuncTable* ft; TableArg* ta; if (!*ppt) { *ppt = (FuncTable*) ecalloc(1, sizeof(FuncTable)); (*ppt)->targs = (TableArg*) ecalloc(n, sizeof(TableArg)); } ft = *ppt; ta = ft->targs; argcnt = 2; if (!ifarg(2)) { /* set to constant */ ft->value = *getarg(1); ft->table = &ft->value; for (i=0; i < n; ++i) { ta[i].nsize = 1; ta[i].argvec = (double*)0; ta[i].min = 1e20; ta[i].max = 1e20; } return; } if (hoc_is_object_arg(1)) { int ns; if (n > 1) { hoc_execerror("Vector arguments allowed only for functions", "of one variable"); } ns = vector_arg_px(1, &ft->table); ta[0].nsize = vector_arg_px(2, &ta[0].argvec); if (ns != ta[0].nsize) { hoc_execerror("Vector arguments not same size", (char*)0); } }else{ for (i = 0; i < n; ++i) { ta[i].nsize = *getarg(argcnt++); if (ta[i].nsize < 1) { hoc_execerror("size arg < 1 in hoc_spec_table", (char*)0); } if (hoc_is_double_arg(argcnt)) { ta[i].min = *getarg(argcnt++); ta[i].max = *getarg(argcnt++); if (ta[i].max < ta[i].min) { hoc_execerror("min > max in hoc_spec_table", (char*)0); } ta[i].argvec = (double*)0; }else{ ta[i].argvec = hoc_pgetarg(argcnt++); } } ft->table = hoc_pgetarg(1); } }
/* * Copyright (C) 2004-2009 Geometer Plus <contact@geometerplus.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef __ZLIMAGE_H__ #define __ZLIMAGE_H__ #include <string> #include <shared_ptr.h> class ZLImage { protected: ZLImage(); public: virtual ~ZLImage(); virtual bool isSingle() const = 0; }; class ZLSingleImage : public ZLImage { protected: ZLSingleImage(const std::string &mimeType); virtual ~ZLSingleImage(); public: bool isSingle() const { return true; } const std::string &mimeType() const; virtual const fb::shared_ptr<std::string> stringData() const = 0; private: std::string myMimeType; }; class ZLMultiImage : public ZLImage { protected: ZLMultiImage(); virtual ~ZLMultiImage(); public: bool isSingle() const { return false; } virtual unsigned int rows() const = 0; virtual unsigned int columns() const = 0; virtual fb::shared_ptr<const ZLImage> subImage(unsigned int row, unsigned int column) const = 0; }; inline ZLImage::ZLImage() {} inline ZLImage::~ZLImage() {} inline ZLSingleImage::ZLSingleImage(const std::string &mimeType) : myMimeType(mimeType) {} inline ZLSingleImage::~ZLSingleImage() {} inline const std::string &ZLSingleImage::mimeType() const { return myMimeType; } inline ZLMultiImage::ZLMultiImage() : ZLImage() {} inline ZLMultiImage::~ZLMultiImage() {} #endif /* __ZLIMAGE_H__ */
#include <stdio.h> #include <string.h> #include <core.h> #include "core_pxe.h" #include "lwip/api.h" #include "lwip/dns.h" /* DNS CLASS values we care about */ #define CLASS_IN 1 /* DNS TYPE values we care about */ #define TYPE_A 1 #define TYPE_CNAME 5 /* * The DNS header structure */ struct dnshdr { uint16_t id; uint16_t flags; /* number of entries in the question section */ uint16_t qdcount; /* number of resource records in the answer section */ uint16_t ancount; /* number of name server resource records in the authority records section*/ uint16_t nscount; /* number of resource records in the additional records section */ uint16_t arcount; } __attribute__ ((packed)); /* * The DNS query structure */ struct dnsquery { uint16_t qtype; uint16_t qclass; } __attribute__ ((packed)); /* * The DNS Resource recodes structure */ struct dnsrr { uint16_t type; uint16_t class; uint32_t ttl; uint16_t rdlength; /* The lenght of this rr data */ char rdata[]; } __attribute__ ((packed)); uint32_t dns_server[DNS_MAX_SERVERS] = {0, }; /* * parse the ip_str and return the ip address with *res. * return true if the whole string was consumed and the result * was valid. * */ static bool parse_dotquad(const char *ip_str, uint32_t *res) { const char *p = ip_str; uint8_t part = 0; uint32_t ip = 0; int i; for (i = 0; i < 4; i++) { while (is_digit(*p)) { part = part * 10 + *p - '0'; p++; } if (i != 3 && *p != '.') return false; ip = (ip << 8) | part; part = 0; p++; } p--; *res = htonl(ip); return *p == '\0'; } /* * Actual resolver function. * * Points to a null-terminated in _name_ and returns the ip addr in * _ip_ if it exists and can be found. If _ip_ = 0 on exit, the * lookup failed. _name_ will be updated */ __export uint32_t pxe_dns(const char *name) { err_t err; struct ip_addr ip; char fullname[512]; /* * Return failure on an empty input... this can happen during * some types of URL parsing, and this is the easiest place to * check for it. */ if (!name || !*name) return 0; /* If it is a valid dot quad, just return that value */ if (parse_dotquad(name, &ip.addr)) return ip.addr; /* Make sure we have at least one valid DNS server */ if (!dns_getserver(0).addr) return 0; /* Is it a local (unqualified) domain name? */ if (!strchr(name, '.') && LocalDomain[0]) { snprintf(fullname, sizeof fullname, "%s.%s", name, LocalDomain); name = fullname; } err = netconn_gethostbyname(name, &ip); if (err) return 0; return ip.addr; }
/**************************************************************************** ** Form interface generated from reading ui file 'listvieweditor.ui' ** ** Created: Sun Nov 2 20:32:32 2014 ** by: The User Interface Compiler ($Id: main.cpp 8 2005-11-16 19:36:46Z dmik $) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef LISTVIEWEDITORBASE_H #define LISTVIEWEDITORBASE_H #include <qvariant.h> #include <qdialog.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QSpacerItem; class QTabWidget; class QWidget; class QPushButton; class QGroupBox; class QLabel; class QLineEdit; class QSpinBox; class QListView; class QListViewItem; class QCheckBox; class QListBox; class QListBoxItem; class ListViewEditorBase : public QDialog { Q_OBJECT public: ListViewEditorBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~ListViewEditorBase(); QTabWidget* tabWidget; QWidget* Widget10; QPushButton* itemDelete; QGroupBox* GroupBox1; QLabel* Label2; QLabel* Label1; QLineEdit* itemText; QSpinBox* itemColumn; QLabel* Label4; QLabel* itemPixmap; QPushButton* itemDeletePixmap; QPushButton* itemChoosePixmap; QPushButton* itemNew; QListView* itemsPreview; QPushButton* itemNewSub; QPushButton* itemUp; QPushButton* itemDown; QPushButton* itemLeft; QPushButton* itemRight; QWidget* Widget11; QGroupBox* GroupBox1_2; QLabel* Label2_2; QLabel* colPixmap; QPushButton* colDeletePixmap; QPushButton* colChoosePixmap; QLabel* Label1_2; QLineEdit* colText; QCheckBox* colClickable; QCheckBox* colResizable; QPushButton* colDelete; QPushButton* colDown; QPushButton* colNew; QPushButton* colUp; QListBox* colPreview; QPushButton* helpButton; QPushButton* applyButton; QPushButton* okButton; QPushButton* cancelButton; protected: QVBoxLayout* ListViewEditorBaseLayout; QGridLayout* Widget10Layout; QSpacerItem* Vertical_Spacing1; QGridLayout* GroupBox1Layout; QHBoxLayout* Layout2; QGridLayout* Widget11Layout; QSpacerItem* Vertical_Spacing2; QGridLayout* GroupBox1Layout_2; QHBoxLayout* Layout1; QSpacerItem* Horizontal_Spacing2; protected slots: virtual void languageChange(); virtual void init(); virtual void destroy(); virtual void applyClicked(); virtual void columnClickable(bool); virtual void columnDownClicked(); virtual void columnPixmapChosen(); virtual void columnPixmapDeleted(); virtual void columnResizable(bool); virtual void columnTextChanged(const QString &); virtual void columnUpClicked(); virtual void currentColumnChanged(QListBoxItem*); virtual void currentItemChanged(QListViewItem*); virtual void deleteColumnClicked(); virtual void initTabPage(const QString &); virtual void itemColChanged(int); virtual void itemDeleteClicked(); virtual void itemDownClicked(); virtual void itemLeftClicked(); virtual void itemNewClicked(); virtual void itemNewSubClicked(); virtual void itemPixmapChoosen(); virtual void itemPixmapDeleted(); virtual void itemTextChanged(const QString &); virtual void itemUpClicked(); virtual void newColumnClicked(); virtual void itemRightClicked(); virtual void okClicked(); }; #endif // LISTVIEWEDITORBASE_H
/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_STRING_UTILS_H #define __LXC_STRING_UTILS_H #include <stdarg.h> #include "config.h" #include "initutils.h" #include "macro.h" /* convert variadic argument lists to arrays (for execl type argument lists) */ extern char **lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup); extern const char **lxc_va_arg_list_to_argv_const(va_list ap, size_t skip); /* * Some simple string functions; if they return pointers, they are allocated * buffers. */ extern char *lxc_string_replace(const char *needle, const char *replacement, const char *haystack); extern bool lxc_string_in_array(const char *needle, const char **haystack); extern char *lxc_string_join(const char *sep, const char **parts, bool use_as_prefix); /* * Normalize and split path: Leading and trailing / are removed, multiple * / are compactified, .. and . are resolved (.. on the top level is considered * identical to .). * Examples: * / -> { NULL } * foo/../bar -> { bar, NULL } * ../../ -> { NULL } * ./bar/baz/.. -> { bar, NULL } * foo//bar -> { foo, bar, NULL } */ extern char **lxc_normalize_path(const char *path); /* remove multiple slashes from the path, e.g. ///foo//bar -> /foo/bar */ extern char *lxc_deslashify(const char *path); extern char *lxc_append_paths(const char *first, const char *second); /* * Note: the following two functions use strtok(), so they will never * consider an empty element, even if two delimiters are next to * each other. */ extern bool lxc_string_in_list(const char *needle, const char *haystack, char sep); extern char **lxc_string_split(const char *string, char sep); extern char **lxc_string_split_and_trim(const char *string, char sep); extern char **lxc_string_split_quoted(char *string); /* Append string to NULL-terminated string array. */ extern int lxc_append_string(char ***list, char *entry); /* Some simple array manipulation utilities */ typedef void (*lxc_free_fn)(void *); typedef void *(*lxc_dup_fn)(void *); extern int lxc_grow_array(void ***array, size_t *capacity, size_t new_size, size_t capacity_increment); extern void lxc_free_array(void **array, lxc_free_fn element_free_fn); extern size_t lxc_array_len(void **array); extern void **lxc_append_null_to_array(void **array, size_t count); extern void remove_trailing_newlines(char *l); /* Helper functions to parse numbers. */ extern int lxc_safe_uint(const char *numstr, unsigned int *converted); extern int lxc_safe_int(const char *numstr, int *converted); extern int lxc_safe_long(const char *numstr, long int *converted); extern int lxc_safe_long_long(const char *numstr, long long int *converted); extern int lxc_safe_ulong(const char *numstr, unsigned long *converted); extern int lxc_safe_uint64(const char *numstr, uint64_t *converted, int base); /* Handles B, kb, MB, GB. Detects overflows and reports -ERANGE. */ extern int parse_byte_size_string(const char *s, int64_t *converted); /* * Concatenate all passed-in strings into one path. Do not fail. If any piece * is not prefixed with '/', add a '/'. */ __attribute__((sentinel)) extern char *must_concat(size_t *len, const char *first, ...); __attribute__((sentinel)) extern char *must_make_path(const char *first, ...); __attribute__((sentinel)) extern char *must_append_path(char *first, ...); /* Return copy of string @entry. Do not fail. */ extern char *must_copy_string(const char *entry); /* Re-allocate a pointer, do not fail */ extern void *must_realloc(void *orig, size_t sz); extern int lxc_char_left_gc(const char *buffer, size_t len); extern int lxc_char_right_gc(const char *buffer, size_t len); extern char *lxc_trim_whitespace_in_place(char *buffer); extern int lxc_is_line_empty(const char *line); extern void remove_trailing_slashes(char *p); #endif /* __LXC_STRING_UTILS_H */
/** * HandVu - a library for computer vision-based hand gesture * recognition. * Copyright (C) 2004 Mathias Kolsch, matz@cs.ucsb.edu * * 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. * * $Id: HandVuFilter.h,v 1.11 2005/10/30 23:00:43 matz Exp $ **/ #include "IHandVuFilter.h" #include "ImageOverlay.h" class CUserStudyA; class CUserStudyB; class HandVu; typedef vector<HVFilterEventListener*> HVFEListenerVector; class CHandVuFilter : public CTransInPlaceFilter, public IHandVuFilter, public RefClock, public ISpecifyPropertyPages, public CPersistStream { public: DECLARE_IUNKNOWN; static CUnknown * WINAPI CreateInstance(LPUNKNOWN punk, HRESULT *phr); // Reveals HandVuFilter and ISpecifyPropertyPages STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv); // CPersistStream stuff HRESULT ScribbleToStream(IStream *pStream); HRESULT ReadFromStream(IStream *pStream); // Overrriden from CTransformFilter base class HRESULT Transform(IMediaSample *pMediaSample); HRESULT CheckInputType(const CMediaType *mtIn); HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut); HRESULT DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *pProperties); HRESULT GetMediaType(int iPosition, CMediaType *pMediaType); // These implement the custom IHandVuFilter interface STDMETHODIMP GetHandVuFilterParams(HandVuFilterParams& params) const; STDMETHODIMP SetHandVuFilterParams(const HandVuFilterParams& params); STDMETHODIMP Initialize(int width, int height, int iPixelSize, CameraController* pCamCon); STDMETHODIMP LoadConductor(const string& filename); STDMETHODIMP ConductorLoaded(bool* pLoaded); STDMETHODIMP StartRecognition(int obj_id); STDMETHODIMP StopRecognition(int obj_id); STDMETHODIMP IsActive(bool* pActive); STDMETHODIMP GetState(int obj_id, hvState& state); STDMETHODIMP GetCenterPosition(double* pX, double* pY); STDMETHODIMP GetRecognizedPosture(string& descriptor); STDMETHODIMP SetOverlayLevel(int level); STDMETHODIMP GetOverlayLevel(int* pLevel); STDMETHODIMP CorrectDistortion(bool enable); STDMETHODIMP CanCorrectDistortion(bool* pPossible); STDMETHODIMP IsCorrectingDistortion(bool* pOn); STDMETHODIMP SetDetectionArea(int left, int top, int right, int bottom); STDMETHODIMP RecomputeNormalLatency(); STDMETHODIMP SetAdjustExposure(bool enable); STDMETHODIMP CanAdjustExposure(bool* pLoaded); STDMETHODIMP IsAdjustingExposure(bool* pEnabled); STDMETHODIMP AddListener(HVFilterEventListener* pHVFListener); STDMETHODIMP RemoveListener(HVFilterEventListener* pHVFListener); STDMETHODIMP ToggleMaintenanceApp(); STDMETHODIMP ToggleFDLOnly(); STDMETHODIMP OnLButtonUp(UINT nFlags, double x, double y); STDMETHODIMP OnMouseMove(UINT nFlags, double x, double y); STDMETHODIMP TakeSnapshot(); STDMETHODIMP GetVersion(string& version); #if defined(HAVE_USER_STUDY) STDMETHODIMP AbortStudyHV1Task(); STDMETHODIMP AbortStudyHV1Session(); STDMETHODIMP StartStudyHV1(); STDMETHODIMP StartStudyHV2(); #endif STDMETHODIMP SetTimecodeReader(IUnknown* tcr); STDMETHODIMP SetVerbosity(int level, const string& logfilename); // ISpecifyPropertyPages interface STDMETHODIMP GetPages(CAUUID *pPages); // CPersistStream override STDMETHODIMP GetClassID(CLSID *pClsid); virtual RefTime GetCurrentTimeUsec() const; virtual RefTime GetSampleTimeUsec() const; private: // Constructor CHandVuFilter(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr, bool bModifiesData=true); ~CHandVuFilter(); // Look after doing the special effect BOOL CanPerformHandVuFilter(const CMediaType *pMediaType) const; void HandVuFramenumber(); string GetTimecode(); void SaveImageArea(IplImage* pImg); private: // Private play critical section mutable CCritSec m_HandVuFilterLock; HandVuFilterParams m_params; IplImage* m_pColorHeader; bool m_img_bottom_up; int m_cxImage, m_cyImage; // image size, once we saw one CComPtr<IAMTimecodeReader> m_pIAMTCReader; RefTime m_t_sample; HVFEListenerVector m_HVFListenerPtrs; CImageOverlay* m_pOverlay; #ifdef HAVE_USER_STUDY CUserStudyA* m_pUserStudyA; CUserStudyB* m_pUserStudyB; #endif bool m_show_maintenanceapp; bool m_take_one_snapshot; bool m_is_initialized; bool m_FDL_only; bool m_FDL_is_initialized; }; // HandVuFilter
/* * COPYRIGHT * * PCB, interactive printed circuit board design * Copyright (C) 1994,1995,1996 Thomas Nau * * 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. * * Contact addresses for paper mail and Email: * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany * Thomas.Nau@rz.uni-ulm.de * * RCS: $Id$ */ /* prototypes for move routines */ #ifndef PCB_MOVE_H #define PCB_MOVE_H #include "global.h" /* --------------------------------------------------------------------------- * some useful transformation macros and constants */ #define MOVE(xs,ys,deltax,deltay) \ { \ ((xs) += (deltax)); \ ((ys) += (deltay)); \ } #define MOVE_BOX_LOWLEVEL(b,dx,dy) \ { \ MOVE((b)->X1,(b)->Y1,(dx),(dy)) \ MOVE((b)->X2,(b)->Y2,(dx),(dy)) \ } #define MOVE_VIA_LOWLEVEL(v,dx,dy) \ { \ MOVE((v)->X,(v)->Y,(dx),(dy)) \ MOVE_BOX_LOWLEVEL(&((v)->BoundingBox),(dx),(dy)); \ } #define MOVE_PIN_LOWLEVEL(p,dx,dy) \ { \ MOVE((p)->X,(p)->Y,(dx),(dy)) \ MOVE_BOX_LOWLEVEL(&((p)->BoundingBox),(dx),(dy)); \ } #define MOVE_ARC_LOWLEVEL(a,dx,dy) \ { \ MOVE((a)->X,(a)->Y,(dx),(dy)) \ MOVE_BOX_LOWLEVEL(&((a)->BoundingBox),(dx),(dy)); \ } /* Rather than mode the line bounding box, we set it so the point bounding * boxes are updated too. */ #define MOVE_LINE_LOWLEVEL(l,dx,dy) \ { \ MOVE((l)->Point1.X,(l)->Point1.Y,(dx),(dy)) \ MOVE((l)->Point2.X,(l)->Point2.Y,(dx),(dy)) \ SetLineBoundingBox ((l)); \ } #define MOVE_PAD_LOWLEVEL(p,dx,dy) \ { \ MOVE((p)->Point1.X,(p)->Point1.Y,(dx),(dy)) \ MOVE((p)->Point2.X,(p)->Point2.Y,(dx),(dy)) \ SetPadBoundingBox ((p)); \ } #define MOVE_TEXT_LOWLEVEL(t,dx,dy) \ { \ MOVE_BOX_LOWLEVEL(&((t)->BoundingBox),(dx),(dy)); \ MOVE((t)->X, (t)->Y, (dx), (dy)); \ } #define MOVE_TYPES \ (VIA_TYPE | LINE_TYPE | TEXT_TYPE | ELEMENT_TYPE | ELEMENTNAME_TYPE | \ POLYGON_TYPE | POLYGONPOINT_TYPE | LINEPOINT_TYPE | ARC_TYPE) #define MOVETOLAYER_TYPES \ (LINE_TYPE | TEXT_TYPE | POLYGON_TYPE | RATLINE_TYPE | ARC_TYPE) /* --------------------------------------------------------------------------- * prototypes */ void MovePolygonLowLevel (PolygonTypePtr, Coord, Coord); void MoveElementLowLevel (DataTypePtr, ElementTypePtr, Coord, Coord); void *MoveObject (int, void *, void *, void *, Coord, Coord); void *MoveObjectToLayer (int, void *, void *, void *, LayerTypePtr, bool); void *MoveObjectAndRubberband (int, void *, void *, void *, Coord, Coord); bool MoveSelectedObjectsToLayer (LayerTypePtr); /* index is 0..MAX_LAYER-1. If old_index is -1, a new layer is inserted at that index. If new_index is -1, the specified layer is deleted. Returns non-zero on error, zero if OK. */ int MoveLayer(int old_index, int new_index); #endif
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by subtitlesource.rc // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
/* * Hisilicon K3 SOC camera driver source file * * Copyright (C) Huawei Technology Co., Ltd. * * Author: z00250052 * Email: * Date: 2014-08-21 * * 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 __HW_ALAN_KERNEL_COMPAT32_H__ #define __HW_ALAN_KERNEL_COMPAT32_H__ #include <linux/videodev2.h> #include <linux/compat.h> #include <linux/uaccess.h> #include <media/v4l2-event.h> #include <media/v4l2-fh.h> #include <media/huawei/isp_cfg.h> struct v4l2_event32 { __u32 type; union { struct v4l2_event_vsync vsync; struct v4l2_event_ctrl ctrl; struct v4l2_event_frame_sync frame_sync; __u8 data[128]; } u; __u32 pending; __u32 sequence; #ifdef CONFIG_COMPAT struct compat_timespec timestamp; #else struct timespec timestamp; #endif __u32 id; __u32 reserved[8]; }; struct v4l2_clip32 { struct v4l2_rect c; compat_caddr_t next; }; struct v4l2_window32 { struct v4l2_rect w; __u32 field; /* enum v4l2_field */ __u32 chromakey; compat_caddr_t clips; /* actually struct v4l2_clip32 * */ __u32 clipcount; compat_caddr_t bitmap; }; struct v4l2_format32 { __u32 type; /* enum v4l2_buf_type */ union { struct v4l2_pix_format pix; struct v4l2_pix_format_mplane pix_mp; struct v4l2_window32 win; struct v4l2_vbi_format vbi; struct v4l2_sliced_vbi_format sliced; __u8 raw_data[200]; /* user-defined */ } fmt; }; typedef struct _tag_hwisp_stream_buf_info32 { union { void* user_buffer_handle; int64_t _user_buffer_handle; }; uint32_t y_addr_phy; uint32_t u_addr_phy; uint32_t v_addr_phy; uint32_t y_addr_iommu; uint32_t u_addr_iommu; uint32_t v_addr_iommu; int ion_fd; union { struct ion_handle *ion_vc_hdl; int64_t _ion_vc_hdl; }; union { void *ion_vaddr; int64_t _ion_vaddr; }; union { struct compat_timeval timestamp; int64_t _timestamp[2]; }; ovisp23_port_info_t port; } hwisp_stream_buf_info_t32; typedef struct _tag_hwcam_buf_status32 { int id; int buf_status; struct compat_timeval tv; } hwcam_buf_status_t32; #define VIDIOC_G_FMT32 _IOWR('V', 4, struct v4l2_format32) #define VIDIOC_S_FMT32 _IOWR('V', 5, struct v4l2_format32) #define VIDIOC_DQEVENT32 _IOR ('V', 89, struct v4l2_event32) #define HWCAM_V4L2_IOCTL_REQUEST_ACK32 _IOW('A', BASE_VIDIOC_PRIVATE + 0x20, struct v4l2_event32) #define HWCAM_V4L2_IOCTL_NOTIFY32 _IOW('A', BASE_VIDIOC_PRIVATE + 0x21, struct v4l2_event32) #define HWCAM_V4L2_IOCTL_THERMAL_GUARD32 _IOWR('A', BASE_VIDIOC_PRIVATE + 0x22, struct v4l2_event32) #define HWISP_STREAM_IOCTL_ENQUEUE_BUF32 _IOW('A', BASE_VIDIOC_PRIVATE + 0x01, hwisp_stream_buf_info_t32) #define HWISP_STREAM_IOCTL_DEQUEUE_BUF32 _IOR('A', BASE_VIDIOC_PRIVATE + 0x02, hwisp_stream_buf_info_t32) #define HWCAM_V4L2_IOCTL_GET_BUF32 _IOR('A', BASE_VIDIOC_PRIVATE + 0x06, hwcam_buf_status_t32) #define HWCAM_V4L2_IOCTL_PUT_BUF32 _IOW('A', BASE_VIDIOC_PRIVATE + 0x07, hwcam_buf_status_t32) #define HWCAM_V4L2_IOCTL_BUF_DONE32 _IOW('A', BASE_VIDIOC_PRIVATE + 0x08, hwcam_buf_status_t32) long compat_get_v4l2_event_data(struct v4l2_event *kp, struct v4l2_event32 __user *up); long compat_put_v4l2_event_data(struct v4l2_event *kp, struct v4l2_event32 __user *up); long compat_get_v4l2_format_data(struct v4l2_format *kp, struct v4l2_format32 __user *up); long compat_put_v4l2_format_data(struct v4l2_format *kp, struct v4l2_format32 __user *up); long compat_get_hwisp_stream_buf_info(hwisp_stream_buf_info_t *kp, hwisp_stream_buf_info_t32 __user *up); long compat_put_hwisp_stream_buf_info(hwisp_stream_buf_info_t *kp, hwisp_stream_buf_info_t32 __user *up); long compat_get_hwcam_buf_status_data(hwcam_buf_status_t *kp, hwcam_buf_status_t32 __user *up); long compat_put_hwcam_buf_status_data(hwcam_buf_status_t *kp, hwcam_buf_status_t32 __user *up); #endif
/* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>. */ #ifndef TRINITYCORE_AREATRIGGER_H #define TRINITYCORE_AREATRIGGER_H #include "Object.h" class Unit; class SpellInfo; class AreaTrigger : public WorldObject, public GridObject<AreaTrigger> { public: AreaTrigger(); ~AreaTrigger(); void AddToWorld(); void RemoveFromWorld(); bool CreateAreaTrigger(uint32 guidlow, uint32 triggerEntry, Unit* caster, SpellInfo const* spell, Position const& pos); void Update(uint32 p_time); void Remove(); uint32 GetSpellId() const { return GetUInt32Value(AREATRIGGER_SPELLID); } int32 GetDuration() const { return _duration; } void SetDuration(int32 newDuration) { _duration = newDuration; } void Delay(int32 delaytime) { SetDuration(GetDuration() - delaytime); } Unit* GetCaster() const { return m_caster; } uint64 GetCasterGUID() const { return GetUInt64Value(AREATRIGGER_CASTER); } void BindToCaster(); void UnbindFromCaster(); float GetVisualRadius() const { return m_visualRadius; } void SetVisualRadius(float radius) { m_visualRadius = radius; } protected: int32 _duration; Unit* m_caster; float m_visualRadius; }; #endif
/* * IPv6 packet mangling table, a port of the IPv4 mangle table to IPv6 * * Copyright (C) 2000-2001 by Harald Welte <laforge@gnumonks.org> * Copyright (C) 2000-2004 Netfilter Core Team <coreteam@netfilter.org> * * 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. */ #include <linux/module.h> #include <linux/netfilter_ipv6/ip6_tables.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); MODULE_DESCRIPTION("ip6tables mangle table"); #define MANGLE_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | \ (1 << NF_INET_LOCAL_IN) | \ (1 << NF_INET_FORWARD) | \ (1 << NF_INET_LOCAL_OUT) | \ (1 << NF_INET_POST_ROUTING)) static const struct { struct ip6t_replace repl; struct ip6t_standard entries[5]; struct ip6t_error term; } initial_table __net_initdata = { .repl = { .name = "mangle", .valid_hooks = MANGLE_VALID_HOOKS, .num_entries = 6, .size = sizeof(struct ip6t_standard) * 5 + sizeof(struct ip6t_error), .hook_entry = { [NF_INET_PRE_ROUTING] = 0, [NF_INET_LOCAL_IN] = sizeof(struct ip6t_standard), [NF_INET_FORWARD] = sizeof(struct ip6t_standard) * 2, [NF_INET_LOCAL_OUT] = sizeof(struct ip6t_standard) * 3, [NF_INET_POST_ROUTING] = sizeof(struct ip6t_standard) * 4, }, .underflow = { [NF_INET_PRE_ROUTING] = 0, [NF_INET_LOCAL_IN] = sizeof(struct ip6t_standard), [NF_INET_FORWARD] = sizeof(struct ip6t_standard) * 2, [NF_INET_LOCAL_OUT] = sizeof(struct ip6t_standard) * 3, [NF_INET_POST_ROUTING] = sizeof(struct ip6t_standard) * 4, }, }, .entries = { IP6T_STANDARD_INIT(NF_ACCEPT), /* PRE_ROUTING */ IP6T_STANDARD_INIT(NF_ACCEPT), /* LOCAL_IN */ IP6T_STANDARD_INIT(NF_ACCEPT), /* FORWARD */ IP6T_STANDARD_INIT(NF_ACCEPT), /* LOCAL_OUT */ IP6T_STANDARD_INIT(NF_ACCEPT), /* POST_ROUTING */ }, .term = IP6T_ERROR_INIT, /* ERROR */ }; static const struct xt_table packet_mangler = { .name = "mangle", .valid_hooks = MANGLE_VALID_HOOKS, .me = THIS_MODULE, .af = NFPROTO_IPV6, }; /* The work comes in here from netfilter.c. */ static unsigned int ip6t_in_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { return ip6t_do_table(skb, hook, in, out, dev_net(in)->ipv6.ip6table_mangle); } static unsigned int ip6t_post_routing_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { return ip6t_do_table(skb, hook, in, out, dev_net(out)->ipv6.ip6table_mangle); } static unsigned int ip6t_local_out_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { unsigned int ret; struct in6_addr saddr, daddr; u_int8_t hop_limit; u_int32_t flowlabel, mark; #if 0 /* root is playing with raw sockets. */ if (skb->len < sizeof(struct iphdr) || ip_hdrlen(skb) < sizeof(struct iphdr)) { if (net_ratelimit()) printk("ip6t_hook: happy cracking.\n"); return NF_ACCEPT; } #endif /* save source/dest address, mark, hoplimit, flowlabel, priority, */ memcpy(&saddr, &ipv6_hdr(skb)->saddr, sizeof(saddr)); memcpy(&daddr, &ipv6_hdr(skb)->daddr, sizeof(daddr)); mark = skb->mark; hop_limit = ipv6_hdr(skb)->hop_limit; /* flowlabel and prio (includes version, which shouldn't change either */ flowlabel = *((u_int32_t *)ipv6_hdr(skb)); ret = ip6t_do_table(skb, hook, in, out, dev_net(out)->ipv6.ip6table_mangle); if (ret != NF_DROP && ret != NF_STOLEN && (memcmp(&ipv6_hdr(skb)->saddr, &saddr, sizeof(saddr)) || memcmp(&ipv6_hdr(skb)->daddr, &daddr, sizeof(daddr)) || skb->mark != mark || ipv6_hdr(skb)->hop_limit != hop_limit)) return ip6_route_me_harder(skb) == 0 ? ret : NF_DROP; return ret; } static struct nf_hook_ops ip6t_ops[] __read_mostly = { { .hook = ip6t_in_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_PRE_ROUTING, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_in_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_LOCAL_IN, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_in_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_FORWARD, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_local_out_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_LOCAL_OUT, .priority = NF_IP6_PRI_MANGLE, }, { .hook = ip6t_post_routing_hook, .owner = THIS_MODULE, .pf = NFPROTO_IPV6, .hooknum = NF_INET_POST_ROUTING, .priority = NF_IP6_PRI_MANGLE, }, }; static int __net_init ip6table_mangle_net_init(struct net *net) { if (!net_ipt_module_permitted(net, VE_IP_MANGLE6)) return 0; /* Register table */ net->ipv6.ip6table_mangle = ip6t_register_table(net, &packet_mangler, &initial_table.repl); if (IS_ERR(net->ipv6.ip6table_mangle)) return PTR_ERR(net->ipv6.ip6table_mangle); net_ipt_module_set(net, VE_IP_MANGLE6); return 0; } static void __net_exit ip6table_mangle_net_exit(struct net *net) { if (!net_is_ipt_module_set(net, VE_IP_MANGLE6)) return; ip6t_unregister_table(net->ipv6.ip6table_mangle); } static struct pernet_operations ip6table_mangle_net_ops = { .init = ip6table_mangle_net_init, .exit = ip6table_mangle_net_exit, }; static int __init ip6table_mangle_init(void) { int ret; ret = register_pernet_subsys(&ip6table_mangle_net_ops); if (ret < 0) return ret; /* Register hooks */ ret = nf_register_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); if (ret < 0) goto cleanup_table; return ret; cleanup_table: unregister_pernet_subsys(&ip6table_mangle_net_ops); return ret; } static void __exit ip6table_mangle_fini(void) { nf_unregister_hooks(ip6t_ops, ARRAY_SIZE(ip6t_ops)); unregister_pernet_subsys(&ip6table_mangle_net_ops); } module_init(ip6table_mangle_init); module_exit(ip6table_mangle_fini);
// Allocator that wraps "C" malloc -*- C++ -*- // Copyright (C) 2001-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. 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 3, 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. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file ext/malloc_allocator.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _MALLOC_ALLOCATOR_H #define _MALLOC_ALLOCATOR_H 1 #include <cstdlib> #include <cstddef> #include <new> #include <bits/functexcept.h> #include <bits/move.h> #if __cplusplus >= 201103L #include <type_traits> #endif namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief An allocator that uses malloc. * @ingroup allocators * * This is precisely the allocator defined in the C++ Standard. * - all allocation calls malloc * - all deallocation calls free */ template<typename _Tp> class malloc_allocator { public: typedef _Tp value_type; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; #if __cplusplus <= 201703L typedef _Tp* pointer; typedef const _Tp* const_pointer; typedef _Tp& reference; typedef const _Tp& const_reference; template<typename _Tp1> struct rebind { typedef malloc_allocator<_Tp1> other; }; #endif #if __cplusplus >= 201103L // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2103. propagate_on_container_move_assignment typedef std::true_type propagate_on_container_move_assignment; #endif _GLIBCXX20_CONSTEXPR malloc_allocator() _GLIBCXX_USE_NOEXCEPT { } _GLIBCXX20_CONSTEXPR malloc_allocator(const malloc_allocator&) _GLIBCXX_USE_NOEXCEPT { } template<typename _Tp1> _GLIBCXX20_CONSTEXPR malloc_allocator(const malloc_allocator<_Tp1>&) _GLIBCXX_USE_NOEXCEPT { } #if __cplusplus <= 201703L ~malloc_allocator() _GLIBCXX_USE_NOEXCEPT { } pointer address(reference __x) const _GLIBCXX_NOEXCEPT { return std::__addressof(__x); } const_pointer address(const_reference __x) const _GLIBCXX_NOEXCEPT { return std::__addressof(__x); } #endif // NB: __n is permitted to be 0. The C++ standard says nothing // about what the return value is when __n == 0. _Tp* allocate(size_type __n, const void* = 0) { if (__builtin_expect(__n > this->_M_max_size(), false)) { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 3190. allocator::allocate sometimes returns too little storage if (__n > (std::size_t(-1) / sizeof(_Tp))) std::__throw_bad_array_new_length(); std::__throw_bad_alloc(); } _Tp* __ret = 0; #if __cpp_aligned_new #if __cplusplus > 201402L && _GLIBCXX_HAVE_ALIGNED_ALLOC if (alignof(_Tp) > alignof(std::max_align_t)) { __ret = static_cast<_Tp*>(::aligned_alloc(alignof(_Tp), __n * sizeof(_Tp))); } #else # define _GLIBCXX_CHECK_MALLOC_RESULT #endif #endif if (!__ret) __ret = static_cast<_Tp*>(std::malloc(__n * sizeof(_Tp))); if (!__ret) std::__throw_bad_alloc(); #ifdef _GLIBCXX_CHECK_MALLOC_RESULT #undef _GLIBCXX_CHECK_MALLOC_RESULT if (reinterpret_cast<std::size_t>(__ret) % alignof(_Tp)) { // Memory returned by malloc is not suitably aligned for _Tp. deallocate(__ret, __n); std::__throw_bad_alloc(); } #endif return __ret; } // __p is not permitted to be a null pointer. void deallocate(_Tp* __p, size_type) { std::free(static_cast<void*>(__p)); } #if __cplusplus <= 201703L size_type max_size() const _GLIBCXX_USE_NOEXCEPT { return _M_max_size(); } #if __cplusplus >= 201103L template<typename _Up, typename... _Args> void construct(_Up* __p, _Args&&... __args) noexcept(std::is_nothrow_constructible<_Up, _Args...>::value) { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } template<typename _Up> void destroy(_Up* __p) noexcept(std::is_nothrow_destructible<_Up>::value) { __p->~_Up(); } #else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 402. wrong new expression in [some_] allocator::construct void construct(pointer __p, const _Tp& __val) { ::new((void *)__p) value_type(__val); } void destroy(pointer __p) { __p->~_Tp(); } #endif #endif // ! C++20 template<typename _Up> friend _GLIBCXX20_CONSTEXPR bool operator==(const malloc_allocator&, const malloc_allocator<_Up>&) _GLIBCXX_NOTHROW { return true; } #if __cpp_impl_three_way_comparison < 201907L template<typename _Up> friend _GLIBCXX20_CONSTEXPR bool operator!=(const malloc_allocator&, const malloc_allocator<_Up>&) _GLIBCXX_NOTHROW { return false; } #endif private: _GLIBCXX_CONSTEXPR size_type _M_max_size() const _GLIBCXX_USE_NOEXCEPT { #if __PTRDIFF_MAX__ < __SIZE_MAX__ return std::size_t(__PTRDIFF_MAX__) / sizeof(_Tp); #else return std::size_t(-1) / sizeof(_Tp); #endif } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif
#define SORT merge_sort #include "../utest_sort.h" UT_SORT(merge) #undef SORT
/**************************************************************************** * * * Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * * License: * * GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * * * ****************************************************************************/ #pragma once #include <Common/LogClass.h> #include <Project64-core/N64System/N64Types.h> #include <Project64-core/N64System/Mips/RegisterClass.h> #include <Project64-core/3rdParty/zip.h> class CSystemTimer { public: enum TimerType { UnknownTimer, CompareTimer, SoftResetTimer, ViTimer, AiTimerInterrupt, AiTimerBusy, AiTimerDMA, SiTimer, PiTimer, RspTimer, RSPTimerDlist, DDPiTimer, DDSeekTimer, DDMotorTimer, MaxTimer }; struct TIMER_DETAILS { union { int64_t reserved; bool Active; }; int64_t CyclesToTimer; }; public: CSystemTimer(CRegisters &Reg, int32_t & NextTimer); void SetTimer(TimerType Type, uint32_t Cycles, bool bRelative); uint32_t GetTimer(TimerType Type); void StopTimer(TimerType Type); void UpdateTimers(); void TimerDone(); void Reset(); void UpdateCompareTimer(); bool SaveAllowed(); void SaveData(zipFile & file) const; void SaveData(CFile & file) const; void LoadData(zipFile & file); void LoadData(CFile & file); void RecordDifference(CLog &LogFile, const CSystemTimer& rSystemTimer); TimerType CurrentType() const { return m_Current; } bool operator == (const CSystemTimer& rSystemTimer) const; bool operator != (const CSystemTimer& rSystemTimer) const; private: CSystemTimer(void); // Disable default constructor CSystemTimer(const CSystemTimer&); // Disable copy constructor CSystemTimer& operator=(const CSystemTimer&); // Disable assignment TIMER_DETAILS m_TimerDetatils[MaxTimer]; int32_t m_LastUpdate; //Timer at last update int32_t & m_NextTimer; TimerType m_Current; bool m_inFixTimer; CRegisters & m_Reg; void SetCompareTimer(); void FixTimers(); };
/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved. * * The information contained herein is property of Nordic Semiconductor ASA. * Terms and conditions of usage are described in detail in NORDIC * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. * * Licensees are granted free, non-transferable use of the information. NO * WARRANTY of ANY KIND is provided. This heading must NOT be removed from * the file. * */ /** @file * @defgroup uart_example_main main.c * @{ * @ingroup uart_example * @brief UART Example Application main file. * * This file contains the source code for a sample application using UART. * * @image html example_board_setup_a.jpg "Use board setup A for this example." */ #include "simple_uart.h" #include <stdbool.h> #include <stdint.h> #include "nrf.h" #include "nrf_gpio.h" #include "boards.h" //#define ENABLE_LOOPBACK_TEST /**< if defined, then this example will be a loopback test, which means that TX should be connected to RX to get data loopback. */ #define ERROR_PIN (LED_0) /**< gpio pin number to show error if loopback is enabled. */ #define MAX_TEST_DATA_BYTES (15U) /**< max number of test bytes to be used for tx and rx. */ #ifndef ENABLE_LOOPBACK_TEST /** @brief Function for sending 'Exit!' string to UART. * * @note Execution is blocked until UART peripheral detects all characters have been sent. */ static __INLINE void uart_quit() { simple_uart_putstring((const uint8_t *)" \n\rExit!\n\r"); } /** @brief Function for sending 'Start:' string to UART. * @details Execution is blocked until UART peripheral detects all characters have been sent. */ static __INLINE void uart_start() { simple_uart_putstring((const uint8_t *)" \n\rStart: "); } #else /** @brief Function for setting the @ref ERROR_PIN high, and then enter an infinite loop. * This function is called if any of the nRF6350 functions fail. */ static void show_error(void) { nrf_gpio_pin_write(ERROR_PIN, 1); while(true) { // Do nothing. } } /** @brief Function for testing UART loop back. * @details Transmitts one character at a time to check if the data received from the loopback is same as the transmitted data. * @note @ref TX_PIN_NUMBER must be connected to @ref RX_PIN_NUMBER) */ static void uart_loopback_test() { uint8_t *tx_data = (uint8_t *)("\n\rLOOPBACK_TEST"); uint8_t rx_data; // Start sending one byte and see if you get the same for(uint32_t i = 0; i < MAX_TEST_DATA_BYTES; i++) { bool status; simple_uart_put(tx_data[i]); status = simple_uart_get_with_timeout(2, &rx_data); if ((rx_data != tx_data[i]) || (!status)) { show_error(); } } return; } #endif /** * @brief Function for main application entry. */ int main(void) { simple_uart_config(RTS_PIN_NUMBER, TX_PIN_NUMBER, CTS_PIN_NUMBER, RX_PIN_NUMBER, HWFC); nrf_gpio_cfg_output(ERROR_PIN); // ERROR_PIN configured as output. #ifndef ENABLE_LOOPBACK_TEST uart_start(); while(true) { uint8_t cr = simple_uart_get(); simple_uart_put(cr); if(cr == 'q' || cr == 'Q') { uart_quit(); while(true) { // Do nothing. } } } #else // This part of the example is just for testing the loopback . while(true) { uart_loopback_test(); } #endif } /** @} */
/* Aeskulap - DICOM image viewer and network client Copyright (C) 2005 Alexander Pipelka This file is part of Aeskulap. Aeskulap 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. Aeskulap 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 Aeskulap; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Alexander Pipelka pipelka@teleweb.at Last Update: $Author: braindead $ Update Date: $Date: 2005/09/22 15:40:46 $ Source File: $Source: /sources/aeskulap/aeskulap/widgets/serieslayouttoolbutton.h,v $ CVS/RCS Revision: $Revision: 1.3 $ Status: $State: Exp $ */ #ifndef AESKULAP_SERIESLAYOUTTOOLBUTTON_H #define AESKULAP_SERIESLAYOUTTOOLBUTTON_H #include <gtkmm.h> #include <gtkmm/menutoolbutton.h> class SeriesLayoutToolButton : public Gtk::MenuToolButton { public: SeriesLayoutToolButton(); void accelerate(Gtk::Window& window); void set_layout(int x, int y); sigc::signal<void, int, int> signal_change_layout; protected: void on_clicked(); void on_change_layout(int index); Gtk::Menu m_menu; private: int m_index; }; #endif // AESKULAP_SERIESLAYOUTTOOLBUTTON_H
/* * This file is part of the coreboot project. * * Copyright 2019 Google LLC * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <arch/acpi_device.h> #include <arch/acpigen.h> #include <console/console.h> #include <device/pci.h> #include <device/pci_ids.h> #include "chip.h" static void ish_fill_ssdt_generator(struct device *dev) { struct drivers_intel_ish_config *config = dev->chip_info; struct device *root = dev->bus->dev; struct acpi_dp *dsd; if (!dev->enabled || !config || !config->firmware_name) return; acpigen_write_scope(acpi_device_path(root)); dsd = acpi_dp_new_table("_DSD"); acpi_dp_add_string(dsd, "firmware-name", config->firmware_name); acpi_dp_write(dsd); acpigen_pop_len(); /* Scope */ printk(BIOS_INFO, "%s: Set firmware-name: %s\n", acpi_device_path(root), config->firmware_name); } static struct device_operations intel_ish_ops = { .read_resources = DEVICE_NOOP, .set_resources = DEVICE_NOOP, .enable_resources = DEVICE_NOOP, .acpi_fill_ssdt_generator = ish_fill_ssdt_generator, }; static void intel_ish_enable(struct device *dev) { /* This dev is a generic device that is a child to the ISH PCI device */ dev->ops = &intel_ish_ops; } /* Copy of default_pci_ops_dev with scan_bus addition */ static const struct device_operations pci_ish_device_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = pci_dev_init, .scan_bus = &scan_generic_bus, /* Non-default */ .ops_pci = &pci_dev_ops_pci, }; static const unsigned short pci_device_ids[] = { PCI_DEVICE_ID_INTEL_CNL_ISHB, 0 }; static const struct pci_driver ish_intel_driver __pci_driver = { .ops = &pci_ish_device_ops, .vendor = PCI_VENDOR_ID_INTEL, .devices = pci_device_ids, }; struct chip_operations drivers_intel_ish_ops = { CHIP_NAME("Intel ISH Chip") .enable_dev = intel_ish_enable, };
/* * (C) Copyright 2007-2013 * Allwinner Technology Co., Ltd. <www.allwinnertech.com> * Jerry Wang <wangflord@allwinnertech.com> * * See file CREDITS for list of people who contributed to this * 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 <common.h> #include <asm/io.h> #include <pmu.h> #include <asm/arch/timer.h> #include <asm/arch/key.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> #include <boot_type.h> #include <sys_partition.h> #include <sys_config.h> /* The sunxi internal brom will try to loader external bootloader * from mmc0, nannd flash, mmc2. * We check where we boot from by checking the config * of the gpio pin. */ DECLARE_GLOBAL_DATA_PTR; extern int sunxi_clock_get_axi(void); extern int sunxi_clock_get_ahb(void); extern int sunxi_clock_get_apb1(void); extern int sunxi_clock_get_pll6(void); u32 get_base(void) { u32 val; __asm__ __volatile__("mov %0, pc \n":"=r"(val)::"memory"); val &= 0xF0000000; val >>= 28; return val; } /* do some early init */ void s_init(void) { watchdog_disable(); } void reset_cpu(ulong addr) { watchdog_enable(); #ifndef CONFIG_FPGA loop_to_die: goto loop_to_die; #endif } void v7_outer_cache_enable(void) { return ; } void v7_outer_cache_inval_all(void) { return ; } void v7_outer_cache_flush_range(u32 start, u32 stop) { return ; } void enable_caches(void) { icache_enable(); dcache_enable(); } void disable_caches(void) { icache_disable(); dcache_disable(); } int display_inner(void) { tick_printf("version: %s\n", uboot_spare_head.boot_head.version); return 0; } int script_init(void) { uint offset, length; char *addr; offset = uboot_spare_head.boot_head.uboot_length; length = uboot_spare_head.boot_head.length - uboot_spare_head.boot_head.uboot_length; addr = (char *)CONFIG_SYS_TEXT_BASE + offset; debug("script offset=%x, length = %x\n", offset, length); if(length) { memcpy((void *)SYS_CONFIG_MEMBASE, addr, length); script_parser_init((char *)SYS_CONFIG_MEMBASE); } else { script_parser_init(NULL); } #if defined(CONFIG_SUNXI_SCRIPT_REINIT) { void *tmp_target_buffer = (void *)(CONFIG_SYS_TEXT_BASE - 0x01000000); memset(tmp_target_buffer, 0, 1024 * 1024); memcpy(tmp_target_buffer, (void *)CONFIG_SYS_TEXT_BASE, uboot_spare_head.boot_head.length); } #endif return 0; } int power_source_init(void) { int pll1; int dcdc3_vol; if(script_parser_fetch("power_sply", "dcdc3_vol", &dcdc3_vol, 1)) { dcdc3_vol = 1200; } if(axp_probe() > 0) { axp_probe_factory_mode(); if(!axp_probe_power_supply_condition()) { if(!axp_set_supply_status(0, PMU_SUPPLY_DCDC3, dcdc3_vol, -1)) { tick_printf("PMU: dcdc3 %d\n", dcdc3_vol); sunxi_clock_set_corepll(uboot_spare_head.boot_data.run_clock, 0); } else { printf("axp_set_dcdc3 fail\n"); } } else { printf("axp_probe_power_supply_condition error\n"); } } else { printf("axp_probe error\n"); } pll1 = sunxi_clock_get_corepll(); tick_printf("PMU: pll1 %d Mhz,PLL6=%d Mhz\n", pll1,sunxi_clock_get_pll6()); printf("AXI=%d Mhz,AHB=%d Mhz, APB1=%d Mhz \n", sunxi_clock_get_axi(),sunxi_clock_get_ahb(),sunxi_clock_get_apb1()); axp_set_charge_vol_limit(); axp_set_all_limit(); axp_set_hardware_poweron_vol(); axp_set_power_supply_output(); power_limit_init(); return 0; }
/********* * * In the name of the Father, and of the Son, and of the Holy Spirit. * * This file is part of BibleTime's source code, http://www.bibletime.info/. * * Copyright 1999-2015 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ #ifndef BTINFORENDERING_H #define BTINFORENDERING_H #include <QList> #include <QPair> #include <QString> #include "backend/drivers/btmodulelist.h" namespace Rendering { enum InfoType { Abbreviation, CrossReference, Footnote, Lemma, Morph, WordTranslation, WordGloss, Text, Reference, // for rendering references Key // sword key reference for commentary display }; typedef QPair<InfoType, QString> InfoData; typedef QList<InfoData> ListInfoData; /** Parse string for attributes */ ListInfoData detectInfo(QString const & data); /** Process list of InfoData and format all data into string */ QString formatInfo(const ListInfoData & info, BtConstModuleList const & modules = BtConstModuleList()); QString formatInfo(QString const & info, QString const & lang = QString()); QString decodeAbbreviation(QString const & data); /** * \param modules render references to each Bible module in the list, if empty use standard Bible. * If module was provided in reference (KJV:John.1.1) this parameter has no effect. */ QString decodeCrossReference(QString const & data, BtConstModuleList const & modules = BtConstModuleList()); QString decodeFootnote(QString const & data); QString decodeStrongs(QString const & data); QString decodeMorph(QString const & data); QString getWordTranslation(QString const & data); } /* namespace Rendering { */ #endif // BTINFORENDERING_H
// Apogee Online RPG Test 3D Client // Copyright (C) 2000-2003 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 #ifndef APOGEE_TERRAIN_RENDERER_H #define APOGEE_TERRAIN_RENDERER_H #include "EntityRenderer.h" #include "GL.h" #include <Mercator/Terrain.h> namespace Atlas { namespace Message { class Element; } } class TerrainRenderer : public EntityRenderer { public: typedef std::map<int, GLuint> DisplayListColumn; typedef std::map<int, DisplayListColumn> DisplayListStore; Mercator::Terrain m_terrain; protected: DisplayListStore m_displayLists; int m_numLineIndeces; int m_numHalfIndeces; unsigned short * const m_lineIndeces; unsigned short * const m_halfIndeces; std::string m_textures[8]; GLuint m_alphaTextures[8]; GLuint m_landscapeList; bool m_haveTerrain; void enableRendererState(); void disableRendererState(); void generateAlphaTextures(Mercator::Segment *); void drawRegion(Mercator::Segment *); void drawMap(Mercator::Terrain &, const PosType & camPos); void drawSea(Renderer &, Mercator::Terrain &); void drawShadow(const WFMath::Point<2> & pos, float radius = 1.f); void removeDisplayList(int x, int y); void readTerrainFrom(const Atlas::Message::Element &); bool readTerrain(); public: TerrainRenderer(Renderer &, RenderableEntity & e); virtual ~TerrainRenderer(); void load(const std::string &) { } void flush(); virtual void render(Renderer &, const PosType & camPos); virtual void select(Renderer &, const PosType & camPos); }; #endif // APOGEE_TERRAIN_RENDERER_H
/* MegaZeux * * Copyright (C) 1996 Greg Janson * * 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 */ /* Declaration for ERROR.CPP */ #ifndef __ERROR_H #define __ERROR_H #include "compat.h" #define ERROR_OPT_FAIL 1 #define ERROR_OPT_RETRY 2 #define ERROR_OPT_EXIT 4 #define ERROR_OPT_OK 8 #define ERROR_OPT_NO_HELP 16 #define ERROR_OPT_SUPPRESS 32 __M_BEGIN_DECLS enum error_type { ERROR_T_WARNING = 0, ERROR_T_ERROR = 1, ERROR_T_FATAL = 2, }; enum error_code { E_DEFAULT, E_INVOKE_SELF_FAILED, E_CORE_FATAL_BUG, E_FILE_DOES_NOT_EXIST, E_IO_READ, E_IO_WRITE, E_SAVE_FILE_INVALID, E_SAVE_VERSION_OLD, E_SAVE_VERSION_TOO_RECENT, E_WORLD_FILE_INVALID, E_WORLD_FILE_VERSION_OLD, E_WORLD_FILE_VERSION_TOO_RECENT, E_WORLD_DECRYPT_WRITE_PROTECTED, E_WORLD_LOCKED, E_WORLD_IO_POST_VALIDATION, E_WORLD_IO_SAVING, E_WORLD_BOARD_MISSING, E_WORLD_BOARD_CORRUPT, E_WORLD_BOARD_TRUNCATED_SAFE, E_WORLD_ROBOT_MISSING, E_BOARD_FILE_INVALID, E_BOARD_FILE_FUTURE_VERSION, E_BOARD_ROBOT_CORRUPT, E_BOARD_SCROLL_CORRUPT, E_BOARD_SENSOR_CORRUPT, E_BOARD_SUMMARY, E_MZM_DOES_NOT_EXIST, E_MZM_FILE_INVALID, E_MZM_FILE_FROM_SAVEGAME, E_MZM_FILE_VERSION_TOO_RECENT, E_MZM_ROBOT_CORRUPT, E_LOAD_BC_CORRUPT, E_NO_LAYER_RENDERER, E_NO_EXTENDED_CHARSETS, E_ZIP, E_ZIP_BOARD_CORRUPT, E_ZIP_BOARD_MISSING_DATA, E_ZIP_ROBOT_CORRUPT, E_ZIP_SCROLL_CORRUPT, E_ZIP_SENSOR_CORRUPT, E_ZIP_ROBOT_MISSING_FROM_BOARD, E_ZIP_ROBOT_MISSING_FROM_DATA, E_ZIP_ROBOT_DUPLICATED, #ifdef CONFIG_EDITOR E_CANT_OVERWRITE_PLAYER, E_ANSI_IMPORT, E_ANSI_EXPORT, E_TEXT_EXPORT, E_SFX_IMPORT, E_SFX_EXPORT, #endif #ifdef CONFIG_UPDATER E_UPDATE, E_UPDATE_RETRY, #endif #ifdef CONFIG_DEBYTECODE E_DBC_WORLD_OVERWRITE_OLD, E_DBC_SAVE_ROBOT_UNSUPPORTED, #endif NUM_ERROR_CODES }; CORE_LIBSPEC int error(const char *string, enum error_type type, unsigned int options, unsigned int code); CORE_LIBSPEC int error_message(enum error_code id, int parameter, const char *string); CORE_LIBSPEC void set_error_suppression(enum error_code id, boolean enable); int get_and_reset_error_count(void); void reset_error_suppression(void); __M_END_DECLS #endif // __ERROR_H
/* * Copyright (c) 2013-2021, Christian Ferrari <tiian@users.sourceforge.net> * All rights reserved. * * This file is part of FLoM. * * FLoM 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. * * FLoM 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 FLoM. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include "flom.h" /* * This example program shows the basic usage of libflom API library with * a dynamically allocated handle; it uses a resource set instead of the * default resource and displays the name of the element obtained. * These are the steps: * 1. declare a pointer for type flom_handle_t * 2. create (allocate and initialize) a new handle using function * flom_handle_new() * 3. set custom properties different from default values: * 3a. use a different AF_UNIX/PF_LOCAL socket to reach FLoM daemon * 3b. specifies a resource name to lock * 4. acquire a lock using function flom_handle_lock() * 5. execute the code protected by the acquired lock * 6. release the lock using function flom_handle_unlock() * 7. delete (clean-up and deallocate) the handle using function * flom_handle_delete() * * Compilation command: * make -f example_makefile advanced_dynamic * * Note: this program needs an already started FLoM daemon, for instance: * flom -s /tmp/my_socket_name -d -1 -- true * ./advanced_dynamic * * The program itself is not verbose, but you might activate tracing if you * were interested to understand what's happen: * export FLOM_TRACE_MASK=0x80000 * ./advanced_dynamic */ int main(int argc, char *argv[]) { int ret_cod; /* step 1: handle declaration */ flom_handle_t *my_handle = NULL; /* step 2: new handle creation */ if (NULL == (my_handle = flom_handle_new())) { fprintf(stderr, "flom_handle_init() returned %p\n", my_handle); exit(1); } /* step 3a: set a different AF_UNIX/PF_LOCAL socket to connect to FLoM daemon */ if (FLOM_RC_OK != (ret_cod = flom_handle_set_socket_name( my_handle, "/tmp/my_socket_name"))) { fprintf(stderr, "flom_handle_set_socket_name() returned %d, '%s'\n", ret_cod, flom_strerror(ret_cod)); exit(1); } /* step 3b: set a different (non default) resource name to lock */ if (FLOM_RC_OK != (ret_cod = flom_handle_set_resource_name( my_handle, "Red.Blue.Gree"))) { fprintf(stderr, "flom_handle_set_resource_name() returned %d, '%s'\n", ret_cod, flom_strerror(ret_cod)); exit(1); } /* step 4: lock acquisition */ if (FLOM_RC_OK != (ret_cod = flom_handle_lock(my_handle))) { fprintf(stderr, "flom_handle_lock() returned %d, '%s'\n", ret_cod, flom_strerror(ret_cod)); exit(1); } else if (NULL != flom_handle_get_locked_element(my_handle)) { printf("flom_handle_get_locked_element(): '%s'\n", flom_handle_get_locked_element(my_handle)); } /* step 5: execute the code that needs lock protection */ /* step 6: lock release */ if (FLOM_RC_OK != (ret_cod = flom_handle_unlock(my_handle))) { fprintf(stderr, "flom_handle_unlock() returned %d, '%s'\n", ret_cod, flom_strerror(ret_cod)); exit(1); } /* step 7: delete the handle */ flom_handle_delete(my_handle); /* exit */ return 0; }
/* A part of kestrel Kestrel Kernel Project Copyright 2007-2014 BMY-Soft Copyright 2007-2014 PC GO Ld. 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. */ #include <kestrel/kernel.h> #include <kestrel/time.h> #include <kestrel/errno.h> #include <kestrel/sched.h> static unsigned long int _uptime; void init_timer() { kernel_puts("function: init_timer()"); __asm__(" movb $0x34, %%al\n" " outb %%al, $0x43\n" " movb $0x9c, %%al\n" " outb %%al, $0x40\n" " movb $0x2e, %%al\n" " outb %%al, $0x40\n" ::: "%eax"); } unsigned int test_number = 0; void timer_interrupt_handler() { //static int i = 0; //stop(); //kernel_puts("function: timer_interrupt_handler()"); //if(i == 1000) kernel_printf("%d //kernel_putchar('.'); //kernel_printf("%d ", test_number); //__asm__("cli\n"); //kernel_panic("timer_interrupt_handler", ENOSYS); _uptime++; if(_uptime & 2) schedule(); } unsigned long int get_uptime() { return _uptime; }
/* Copyright (C) 2005, 2010 - Cryptic Sea This file is part of Gish. Gish 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. */ void listvideomodes(void) { int count; SDL_Rect **sdlmode; numofsdlvideomodes=0; sdlmode=SDL_ListModes(NULL,SDL_OPENGL|SDL_FULLSCREEN); if (sdlmode==(SDL_Rect **)-1) { sdlvideomode[numofsdlvideomodes].resolutionx=640; sdlvideomode[numofsdlvideomodes].resolutiony=480; sdlvideomode[numofsdlvideomodes].bitsperpixel=32; numofsdlvideomodes++; sdlvideomode[numofsdlvideomodes].resolutionx=800; sdlvideomode[numofsdlvideomodes].resolutiony=600; sdlvideomode[numofsdlvideomodes].bitsperpixel=32; numofsdlvideomodes++; sdlvideomode[numofsdlvideomodes].resolutionx=1024; sdlvideomode[numofsdlvideomodes].resolutiony=768; sdlvideomode[numofsdlvideomodes].bitsperpixel=32; numofsdlvideomodes++; return; } for (count=0;sdlmode[count]!=NULL && count<64;count++) { //if (SDL_VideoModeOK(sdlmode[count]->w,sdlmode[count]->h,32,SDL_OPENGL|SDL_FULLSCREEN)) { sdlvideomode[numofsdlvideomodes].resolutionx=sdlmode[count]->w; sdlvideomode[numofsdlvideomodes].resolutiony=sdlmode[count]->h; sdlvideomode[numofsdlvideomodes].bitsperpixel=32; numofsdlvideomodes++; } //if (SDL_VideoModeOK(sdlmode[count]->w,sdlmode[count]->h,16,SDL_OPENGL|SDL_FULLSCREEN)) { sdlvideomode[numofsdlvideomodes].resolutionx=sdlmode[count]->w; sdlvideomode[numofsdlvideomodes].resolutiony=sdlmode[count]->h; sdlvideomode[numofsdlvideomodes].bitsperpixel=16; numofsdlvideomodes++; } } }
#ifndef _ASM_SH_IO_SNAPGEAR_H #define _ASM_SH_IO_SNAPGEAR_H #if defined(CONFIG_CPU_SH4) #define IRL0_IRQ 2 #define IRL0_PRIORITY 13 #define IRL1_IRQ 5 #define IRL1_PRIORITY 10 #define IRL2_IRQ 8 #define IRL2_PRIORITY 7 #define IRL3_IRQ 11 #define IRL3_PRIORITY 4 #endif #define __IO_PREFIX snapgear #include <asm/io_generic.h> #ifdef CONFIG_SH_SECUREEDGE5410 #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000) extern unsigned short secureedge5410_ioport; #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \ (secureedge5410_ioport = \ ((secureedge5410_ioport & ~(mask)) | ((val) & (mask))))) #define SECUREEDGE_READ_IOPORT() \ ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817)) #endif #endif /* _ASM_SH_IO_SNAPGEAR_H */
#ifndef VIEWER_TOOLBAR_H #define VIEWER_TOOLBAR_H #include <QToolBar> #include <QAction> #include <QIcon> #include <QMenu> class ViewerToolBar : public QToolBar { Q_OBJECT public: explicit ViewerToolBar(QWidget *parent = NULL); QAction *start_Action; QAction *restore_Action; QMenu *start_Menu; QAction *destroy_Action; QMenu *destroy_Menu; QAction *save_Action; QAction *pause_Action; QAction *reboot_Action; QAction *reset_Action; QAction *shutdown_Action; QMenu *snapshot_Menu; QAction *createSnapshot; QAction *moreSnapshot_Actions; QAction *snapshot_Action; QAction *reconnect_Action; QAction *keySeq_Action; QMenu *keySequenceMenu; QAction *sendKeySeq_BackSpc; QAction *sendKeySeq_Del; QAction *sendKeySeq_1; QAction *sendKeySeq_2; QAction *sendKeySeq_3; QAction *sendKeySeq_4; QAction *sendKeySeq_5; QAction *sendKeySeq_6; QAction *sendKeySeq_7; QAction *sendKeySeq_8; QAction *copyFiles_Action; QAction *copyToClipboard; QAction *pasteClipboard; signals: void execMethod(const QStringList&); private slots: void showMenu(); void detectTriggerredAction(QAction*); }; #endif // VIEWER_TOOLBAR_H
#pragma once #include "..\Util\Logger.h" #include "..\Util\SafeRelease.h" #include "TerrainException.h" namespace MagicGear { /** \class HeightMap \brief height map data, image import/export */ template<typename T> class HeightMap { public: HeightMap(void) { m_pData = NULL; m_width = m_height = 0; } ~HeightMap(void) { destroy(); } //! alloc memory, init members void create(int w, int h, int initVal) { ASSERT(w>0 && h>0); // free old data destroy(); // m_width = w; m_height = h; // alloc int bufSize = getDataSize(); m_pData = (T*)malloc(bufSize); if(m_pData == NULL) { LOG("height map alloc failed ,w = %d, h = %d", w, h); throw TerrainException("height map create failed."); } memset(m_pData, initVal, bufSize); } //! destroy void destroy() { SAFE_FREE(m_pData); m_width = m_height = 0; } int getWidth() const { return m_width; } int getHeight() const { return m_height;} int getDataSize() const { return m_width*m_height*sizeof(T);} void* getRawData() const{ return m_pData; } inline bool isValidIndex(int x,int y) const { return x>=0 && y>=0 && x<m_width && y<m_height; } inline int getIndex(int x, int y) const { return y*m_width + x; } inline T getValue(int x, int y) const { ASSERT(isValidIndex(x, y)); return m_pData[getIndex(x, y)]; } inline void setValue(int x, int y, T val) { ASSERT(isValidIndex(x, y)); m_pData[getIndex(x, y)] = val; } private: T* m_pData; int m_width, m_height; private:// non-copyable HeightMap( const HeightMap& ); const HeightMap& operator=( const HeightMap& ); }; }//namespace MagicGear
/* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2004-08-26 * Description : a digikam image editor plugin to * simulate charcoal drawing. * * Copyright (C) 2004-2015 by Gilles Caulier <caulier dot gilles at gmail dot 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, 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. * * ============================================================ */ #ifndef CHARCOALTOOL_H #define CHARCOALTOOL_H // Local includes #include "editortool.h" using namespace Digikam; namespace DigikamFxFiltersImagePlugin { class CharcoalTool : public EditorToolThreaded { Q_OBJECT public: explicit CharcoalTool(QObject* const parent); ~CharcoalTool(); private Q_SLOTS: void slotResetSettings(); private: void readSettings(); void writeSettings(); void preparePreview(); void prepareFinal(); void setPreviewImage(); void setFinalImage(); private: class Private; Private* const d; }; } // namespace DigikamFxFiltersImagePlugin #endif /* CHARCOALTOOL_H */
#ifndef CETesteMediaDuasAmostras_h #define CETesteMediaDuasAmostras_h #include <Estatistica/CEstatistica.h> // + Testing the means of two samples /** * @brief Classe de estatística para duas amostras. * */ class CETesteMediaDuasAmostras:public CEstatistica { public: /// Construtor CETesteMediaDuasAmostras ():CEstatistica () { } /// Destrutor virtual ~ CETesteMediaDuasAmostras (); /// Realiza o teste de duas amostras int TesteMediaDuasAmostras (CEstatistica & B, double testedDifference, double _probabilidade, double &calcT, double &tableT, int &passTest); }; #endif
#include <inotify.h> int io_inotify(io_loop_t *loop, io_handle_t *handle) { int fd; if((fd = inotify_init1(IN_NONBLOCK)) == -1) return -1; return io__handle_init(handle, loop, fd); }