text
stringlengths
4
6.14k
/* FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that has become a de facto standard. * * * * Help yourself get started quickly and support the FreeRTOS * * project by purchasing a FreeRTOS tutorial book, reference * * manual, or both from: http://www.FreeRTOS.org/Documentation * * * * Thank you! * * * *************************************************************************** This file is part of the FreeRTOS distribution. FreeRTOS 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 >>!AND MODIFIED BY!<< the FreeRTOS exception. >>! NOTE: The modification to the GPL is included to allow you to distribute >>! a combined work that includes FreeRTOS without being obliged to provide >>! the source code for proprietary components outside of the FreeRTOS >>! kernel. FreeRTOS 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. Full license text is available from the following link: http://www.freertos.org/a00114.html 1 tab == 4 spaces! *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * * not run, what could be wrong?" * * * * http://www.FreeRTOS.org/FAQHelp.html * * * *************************************************************************** http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ #ifndef SAM_7_EMAC_H #define SAM_7_EMAC_H /* * Initialise the EMAC driver. If successful a semaphore is returned that * is used by the EMAC ISR to indicate that Rx packets have been received. * If the initialisation fails then NULL is returned. */ xSemaphoreHandle xEMACInit( void ); /* * Send the current uIP buffer. This copies the uIP buffer to one of the * EMAC Tx buffers, then indicates to the EMAC that the buffer is ready. */ long lEMACSend( void ); /* * Called in response to an EMAC Rx interrupt. Copies the received frame * into the uIP buffer. */ unsigned long ulEMACPoll( void ); #endif
/**************************************************************************** * * $Id: vpMeTracker.h 4056 2013-01-05 13:04:42Z fspindle $ * * This file is part of the ViSP software. * Copyright (C) 2005 - 2013 by INRIA. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.txt at the root directory of this source * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU * GPL, please contact INRIA about acquiring a ViSP Professional * Edition License. * * See http://www.irisa.fr/lagadic/visp/visp.html for more information. * * This software was developed at: * INRIA Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact * INRIA at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * * Description: * Moving edges. * * Authors: * Andrew Comport * Aurelien Yol * *****************************************************************************/ /*! \file vpMeTracker.h \brief Contains abstract elements for a Distance to Feature type feature. */ // =================================================================== /*! \class vpMeTracker \ingroup TrackingImageME \brief Contains abstract elements for a Distance to Feature type feature. 2D state = list of points, 3D state = feature */ // =================================================================== #ifndef vpMeTracker_HH #define vpMeTracker_HH #include <visp/vpColVector.h> #include <visp/vpMeSite.h> #include <visp/vpMe.h> #include <visp/vpTracker.h> #include <math.h> #include <iostream> #include <list> class VISP_EXPORT vpMeTracker : public vpTracker { #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS public: #else protected: #endif //! Tracking dependent variables/functions //! List of tracked moving edges points. std::list<vpMeSite> list ; //! Moving edges initialisation parameters vpMe *me ; unsigned int init_range; int nGoodElement; protected: vpMeSite::vpMeSiteDisplayType selectDisplay ; public: // Constructor/Destructor vpMeTracker() ; vpMeTracker(const vpMeTracker& meTracker) ; virtual ~vpMeTracker() ; void init() ; void initTracking(const vpImage<unsigned char>& I); //! Track sampled pixels. void track(const vpImage<unsigned char>& I); unsigned int numberOfSignal() ; unsigned int totalNumberOfSignal() ; virtual void display(const vpImage<unsigned char> &I, vpColor col)=0; virtual void display(const vpImage<unsigned char>& I); void display(const vpImage<unsigned char>& I, vpColVector &w, unsigned int &index_w); void setDisplay(vpMeSite::vpMeSiteDisplayType select) { selectDisplay = select ; } vpMeTracker& operator =(vpMeTracker& f); int outOfImage( int i , int j , int half , int rows , int cols) ; int outOfImage( vpImagePoint iP , int half , int rows , int cols) ; //!Sample pixels at a given interval virtual void sample(const vpImage<unsigned char> &image)=0; /*! Set the initial range. \param r : initial range. */ void setInitRange(const unsigned int &r) { init_range = r; } /*! Return the initial range. \return Value of init_range. */ inline unsigned int getInitRange() { return init_range; } /*! Set the moving edges initialisation parameters \param me : Moving Edges. */ void setMe(vpMe *me) { this->me = me ; } /*! Return the moving edges initialisation parameters \return Moving Edges. */ inline vpMe* getMe(){ return me; } /*! Set the list of moving edges \param l : list of Moving Edges. */ void setMeList(const std::list<vpMeSite> &l) { list = l; } /*! Return the list of moving edges \return List of Moving Edges. */ inline std::list<vpMeSite>& getMeList() { return list; } inline std::list<vpMeSite> getMeList() const { return list; } /*! Return the number of points that has not been suppressed. \return Number of good points. */ inline int getNbPoints() const { return nGoodElement; } #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS public: int query_range; bool display_point;// if 1 (TRUE) displays the line that is being tracked #endif }; #endif
/* * VncProxyConnectionFactory.h - abstract factory class for VncProxyConnectionFactory objects * * Copyright (c) 2017-2022 Tobias Junghans <tobydox@veyon.io> * * This file is part of Veyon - https://veyon.io * * 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 (see COPYING); if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #pragma once #include "CryptoCore.h" class QTcpSocket; class VncProxyConnection; // clazy:excludeall=copyable-polymorphic class VncProxyConnectionFactory { public: using Password = CryptoCore::PlaintextPassword; virtual ~VncProxyConnectionFactory() = default; virtual VncProxyConnection* createVncProxyConnection( QTcpSocket* clientSocket, int vncServerPort, const Password& vncServerPassword, QObject* parent ) = 0; } ;
/* * DFF -- An Open Source Digital Forensics Framework * Copyright (C) 2009-2010 ArxSys * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. * * See http: *www.digital-forensic.org for more information about this * project. Please do not directly contact any of the maintainers of * DFF for assistance; the project provides a web site, mailing lists * and IRC channels for your use. * * Author(s): * Frederic Baguelin <fba@digital-forensic.org> */ #ifndef __PARTITION_STRUCT_HPP__ #define __PARTITION_STRUCT_HPP__ #define SWAP_INT64(x) ( (((x)>>56) & 0x00000000000000FFLL) \ | (((x)>>40) & 0x000000000000FF00LL) \ | (((x)>>24) & 0x0000000000FF0000LL) \ | (((x)>>8) & 0x00000000FF000000LL) \ | (((x)<<8) & 0x000000FF00000000LL) \ | (((x)<<24) & 0x0000FF0000000000LL) \ | (((x)<<40) & 0x00FF000000000000LL) \ | (((x)<<56) & 0xFF00000000000000LL) ) #define SWAP_INT32(x) ( (((x)>>24) & 0x000000FFL) \ | (((x)>>8) & 0x0000FF00L) \ | (((x)<<8) & 0x00FF0000L) \ | (((x)<<24) & 0xFF000000L) ) #define SWAP_INT16(x) ( (((x)>>8) & 0x00FFL) \ | (((x)>>8) & 0xFF00L) ) \ #ifdef WIN32 #define PACK #else #define PACK __attribute__((packed)) #endif #ifdef WIN32 #pragma pack(1) #endif typedef struct s_partition_entry { char status;//0x80 = bootable, 0x00 = non-bootable, other = invalid char start_head; char start_sector; //sector in bit 5-0, bits 9-8 of cylinders are in bits 7-6... char start_cylinder; // bits 7-0 char type; char end_head; char end_sector; //sector in bit 5-0, bits 9-8 of cylinders are in bits 7-6... char end_cylinder; //bits 7-0 unsigned int lba; unsigned int total_blocks; }PACK partition_entry; typedef struct s_ebr { /* Usually NULL, could contain another boot loader or smthg else... */ /* could also contain IBM Boot Manager starting at 0x18A */ char code[446]; partition_entry part[4]; /* Normally, there are only two partition entries in extended boot records */ /* followed by 32 bytes of NULL byte. It could be used to hide data or even */ /* 2 other partition entries !!! */ /* partition_entry part[2]; */ /* char padding[32]; Usually NULL but could be used to hide smthg */ short mbr_signature; }PACK ebr; typedef struct s_mbr { char code[440]; int disk_signature;//or char DS[4]; short padding; //Usually NULL but could be used to hide smthg... partition_entry part[4]; short mbr_signature; //0xAA55 }PACK mbr; typedef struct s_Info { dff_ui64 offset; unsigned int cluster; unsigned int total_read; string filename; string nname; Node *parent; unsigned char deleted; unsigned char directory; } Info; #endif
#ifndef DEBUGGER_ASSEMBLER_H #define DEBUGGER_ASSEMBLER_H // Directives // Assemblers // A = Acme // B = Big Mac S= S-C Macro Assembler // D = DOS Tool Kit T = TED II // L = Lisa W = Weller's Assembler // M = Merlin // u = MicroSparc // O = ORCA/M enum Assemblers_e { ASM_ACME , ASM_BIG_MAC , ASM_DOS_TOOL_KIT , ASM_LISA , ASM_MERLIN , ASM_MICROSPARC , ASM_ORCA , ASM_SC , ASM_TED , ASM_WELLERS , ASM_CUSTOM ,NUM_ASSEMBLERS }; enum AsmAcmeDirective_e { ASM_A_DEFINE_BYTE ,NUM_ASM_A_DIRECTIVES }; enum AsmBigMacDirective_e { ASM_B_DEFINE_BYTE ,NUM_ASM_B_DIRECTIVES }; enum AsmDosToolKitDirective_e { ASM_D_DEFINE_BYTE ,NUM_ASM_D_DIRECTIVES }; enum AsmLisaDirective_e { ASM_L_DEFINE_BYTE ,NUM_ASM_L_DIRECTIVES }; enum AsmMerlinDirective_e { ASM_M_ASCII , ASM_M_DEFINE_WORD , ASM_M_DEFINE_BYTE , ASM_M_DEFINE_STORAGE , ASM_M_HEX , ASM_M_ORIGIN , NUM_ASM_M_DIRECTIVES , ASM_M_DEFINE_BYTE_ALIAS , ASM_M_DEFINE_WORD_ALIAS }; enum AsmMicroSparcDirective_e { ASM_u_DEFINE_BYTE ,NUM_ASM_u_DIRECTIVES }; enum AsmOrcamDirective_e { ASM_O_DEFINE_BYTE ,NUM_ASM_O_DIRECTIVES }; enum AsmSCMacroDirective_e { ASM_S_ORIGIN ,ASM_S_TARGET_ADDRESS ,ASM_S_END_PROGRAM ,ASM_S_EQUATE ,ASM_S_DATA ,ASM_S_ASCII_STRING ,ASM_S_HEX_STRING ,NUM_ASM_S_DIRECTIVES }; enum AsmTedDirective_e { ASM_T_DEFINE_BYTE ,NUM_ASM_T_DIRECTIVES }; enum AsmWellersDirective_e { ASM_W_DEFINE_BYTE ,NUM_ASM_W_DIRECTIVES }; enum AsmCustomDirective_e { ASM_DEFINE_BYTE ,ASM_DEFINE_WORD // ,ASM_DEFINE_ADDRESS_8 ,ASM_DEFINE_ADDRESS_16 // String/Text/Ascii ,ASM_DEFINE_ASCII_TEXT ,ASM_DEFINE_APPLE_TEXT ,ASM_DEFINE_TEXT_HI_LO // i.e. Applesoft Basic Tokens // FAC ,ASM_DEFINE_FLOAT // Applesoft float ,ASM_DEFINE_FLOAT_X // Applesoft float unpacked/expanded ,NUM_ASM_Z_DIRECTIVES }; // NOTE: Keep in sync AsmDirectives_e g_aAssemblerDirectives ! enum AsmDirectives_e { FIRST_A_DIRECTIVE = 1 , // Acme FIRST_B_DIRECTIVE = FIRST_A_DIRECTIVE + NUM_ASM_A_DIRECTIVES, // Big Mac FIRST_D_DIRECTIVE = FIRST_B_DIRECTIVE + NUM_ASM_B_DIRECTIVES, // DOS Tool Kit FIRST_L_DIRECTIVE = FIRST_D_DIRECTIVE + NUM_ASM_D_DIRECTIVES, // Lisa FIRST_M_DIRECTIVE = FIRST_L_DIRECTIVE + NUM_ASM_L_DIRECTIVES, // Merlin FIRST_u_DIRECTIVE = FIRST_M_DIRECTIVE + NUM_ASM_M_DIRECTIVES, // MicroSparc FIRST_O_DIRECTIVE = FIRST_u_DIRECTIVE + NUM_ASM_u_DIRECTIVES, // Orca FIRST_S_DIRECTIVE = FIRST_O_DIRECTIVE + NUM_ASM_O_DIRECTIVES, // SC FIRST_T_DIRECTIVE = FIRST_S_DIRECTIVE + NUM_ASM_S_DIRECTIVES, // Ted FIRST_W_DIRECTIVE = FIRST_T_DIRECTIVE + NUM_ASM_T_DIRECTIVES, // Weller FIRST_Z_DIRECTIVE = FIRST_W_DIRECTIVE + NUM_ASM_W_DIRECTIVES, // Custom NUM_ASM_DIRECTIVES = FIRST_Z_DIRECTIVE + NUM_ASM_Z_DIRECTIVES // NUM_ASM_DIRECTIVES = 1 + // Opcode ... rest are psuedo opcodes // NUM_ASM_A_DIRECTIVES + // Acme // NUM_ASM_B_DIRECTIVES + // Big Mac // NUM_ASM_D_DIRECTIVES + // DOS Tool Kit // NUM_ASM_L_DIRECTIVES + // Lisa // NUM_ASM_M_DIRECTIVES + // Merlin // NUM_ASM_u_DIRECTIVES + // MicroSparc // NUM_ASM_O_DIRECTIVES + // Orca // NUM_ASM_S_DIRECTIVES + // SC // NUM_ASM_T_DIRECTIVES + // Ted // NUM_ASM_W_DIRECTIVES // Weller }; extern int g_iAssemblerSyntax; extern int g_aAssemblerFirstDirective[ NUM_ASSEMBLERS ]; // Addressing _____________________________________________________________________________________ extern AddressingMode_t g_aOpmodes[ NUM_ADDRESSING_MODES ]; // Assembler ______________________________________________________________________________________ // Hashing for Assembler typedef unsigned int Hash_t; struct HashOpcode_t { int m_iOpcode; Hash_t m_nValue; // functor bool operator () (const HashOpcode_t & rLHS, const HashOpcode_t & rRHS) const { bool bLessThan = (rLHS.m_nValue < rRHS.m_nValue); return bLessThan; } }; struct AssemblerDirective_t { char *m_pMnemonic; Hash_t m_nHash; }; extern int g_bAssemblerOpcodesHashed; // = false; extern Hash_t g_aOpcodesHash[ NUM_OPCODES ]; // for faster mnemonic lookup, for the assembler extern bool g_bAssemblerInput; // = false; extern int g_nAssemblerAddress; // = 0; extern const Opcodes_t *g_aOpcodes; // = NULL; // & g_aOpcodes65C02[ 0 ]; extern const Opcodes_t g_aOpcodes65C02[ NUM_OPCODES ]; extern const Opcodes_t g_aOpcodes6502 [ NUM_OPCODES ]; extern AssemblerDirective_t g_aAssemblerDirectives[ NUM_ASM_DIRECTIVES ]; // Prototypes _______________________________________________________________ int _6502_GetOpmodeOpbyte( const int iAddress, int & iOpmode_, int & nOpbytes_, const DisasmData_t** pData = NULL ); void _6502_GetOpcodeOpmodeOpbyte( int & iOpcode_, int & iOpmode_, int & nOpbytes_ ); bool _6502_GetStackReturnAddress( WORD & nAddress_ ); bool _6502_GetTargets( WORD nAddress, int *pTargetPartial_, int *pTargetPartial2_, int *pTargetPointer_, int * pBytes_ , const bool bIgnoreJSRJMP = true, bool bIgnoreBranch = true ); bool _6502_GetTargetAddress( const WORD & nAddress, WORD & nTarget_ ); bool _6502_IsOpcodeBranch( int nOpcode ); bool _6502_IsOpcodeValid( int nOpcode ); int AssemblerHashMnemonic ( const TCHAR * pMnemonic ); // bool AssemblerGetAddressingMode ( int iArg, int nArgs, WORD nAddress, std::vector<int> & vOpcodes ); void _CmdAssembleHashDump (); int AssemblerDelayedTargetsSize(); void AssemblerStartup (); bool Assemble( int iArg, int nArgs, WORD nAddress ); void AssemblerOn (); void AssemblerOff (); #endif
/** @file visx/exptdriver.h root element in a psychophysics experiment */ /////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2004 California Institute of Technology // Copyright (c) 2004-2007 University of Southern California // Rob Peters <https://github.com/rjpcal/> // // created: Tue May 11 13:33:50 1999 // // -------------------------------------------------------------------- // // This file is part of GroovX. // [https://github.com/rjpcal/groovx] // // GroovX 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. // // GroovX 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 GroovX; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. // /////////////////////////////////////////////////////////////////////// #ifndef GROOVX_VISX_EXPTDRIVER_H_UTC20050626084016_DEFINED #define GROOVX_VISX_EXPTDRIVER_H_UTC20050626084016_DEFINED #include "io/io.h" #include "rutz/tracer.h" #include "visx/elementcontainer.h" struct Tcl_Interp; namespace rutz { class fstring; template <class T> class fwd_iter; } namespace Gfx { class Canvas; } namespace nub { template <class T> class ref; template <class T> class soft_ref; } /////////////////////////////////////////////////////////////////////// /** * * ExptDriver is an implementation of the Experiment interface that * coordinates all objects necessary to run an experiment. * **/ /////////////////////////////////////////////////////////////////////// class ExptDriver : public ElementContainer { private: /// Copy constructor not allowed ExptDriver(const ExptDriver&); /// assignment not allowed ExptDriver& operator=(const ExptDriver&); /// Construct with the applications Tcl interpreter. ExptDriver(); public: /// Dynamically controls the tracing of ExptDriver member functions. static rutz::tracer tracer; /// Factory function. static ExptDriver* make() { return new ExptDriver; } /// Virtual destructor. virtual ~ExptDriver() noexcept; virtual io::version_id class_version_id() const override; virtual void read_from(io::reader& reader) override; virtual void write_to(io::writer& writer) const override; // // Element interface // virtual const nub::soft_ref<Toglet>& getWidget() const override; virtual void vxRun(Element& parent) override; /// End the current trial normally, and move on to the next trial. virtual void vxEndTrialHook() override; /// Stop the experiment since all child elements are finished. virtual void vxAllChildrenFinished() override; ////////////////////////////// // Accessors + Manipulators // ////////////////////////////// /// Return the name of the file currently being used for autosaves const rutz::fstring& getAutosaveFile() const; /// Change the name of the file to use for autosaves void setAutosaveFile(const rutz::fstring& str); /// Return the current autosave period. unsigned int getAutosavePeriod() const; /// Change the autosave period to \a period. void setAutosavePeriod(unsigned int period); /// Get the string used as a prefix for output files generated by the experiment. const rutz::fstring& getFilePrefix() const; /// Specify a string to be used as a prefix for output files generated by the experiment. void setFilePrefix(const rutz::fstring& str); /// Make the global log file (handled by nub::logging) be named after this expt. void claimLogFile() const; /// Return the full contents of the info log. const char* getInfoLog() const; /// Get the script to be executed when the experiment completes. rutz::fstring getDoWhenComplete() const; /// Specify a script to be executed when the experiment completes. void setDoWhenComplete(const rutz::fstring& script); /// Specify the widget in which the experiment should run. void setWidget(const nub::soft_ref<Toglet>& widg); /// Begin the experiment. void edBeginExpt(); /// Resume the experiment after it has been halted. void edResumeExpt(); #if 0 /// Pause the experiment until a top-level dialog box is dismissed. void pause(); #endif /** This saves the experiment file and a summary-of-responses file under unique filenames based on the date and time. */ void storeData(); private: class Impl; Impl* const rep; }; #endif // !GROOVX_VISX_EXPTDRIVER_H_UTC20050626084016_DEFINED
/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * 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. * * Author: * Fabian 'x3n' Landau * Co-authors: * ... * */ /** @file @ingroup Util Command @brief Some functions to exchange text between the OS clipboard and the Shell in Orxonox. Use fromClipboard() to get text from the clipboard (if there is any text) and toClipboard() to put text into the clipboard. These functions can only work properly if there's an OS-specific implementation in Clipboard.cc. If a specific OS is not supported, the clipboard only works within Orxonox, but the exchange with other programs is not possible. */ #ifndef _Clipboard_H__ #define _Clipboard_H__ #include "UtilPrereqs.h" #include <string> namespace orxonox { _UtilExport bool toClipboard(const std::string& text); _UtilExport std::string fromClipboard(); } #endif /* _Clipboard_H__ */
namespace sc { class LocalUHFContribution { private: double * const gmata; double * const gmatb; double * const pmata; double * const pmatb; public: LocalUHFContribution(double *ga, double *pa, double *gb, double *pb) : gmata(ga), gmatb(gb), pmata(pa), pmatb(pb) {} ~LocalUHFContribution() {} void set_bound(double,double) {}; inline void cont1(int ij, int kl, double val) { gmata[ij] += val*(pmata[kl]+pmatb[kl]); gmata[kl] += val*(pmata[ij]+pmatb[ij]); gmatb[ij] += val*(pmata[kl]+pmatb[kl]); gmatb[kl] += val*(pmata[ij]+pmatb[ij]); } inline void cont2(int ij, int kl, double val) { val *= 0.5; gmata[ij] -= val*pmata[kl]; gmata[kl] -= val*pmata[ij]; gmatb[ij] -= val*pmatb[kl]; gmatb[kl] -= val*pmatb[ij]; } inline void cont3(int ij, int kl, double val) { gmata[ij] -= val*pmata[kl]; gmata[kl] -= val*pmata[ij]; gmatb[ij] -= val*pmatb[kl]; gmatb[kl] -= val*pmatb[ij]; } inline void cont4(int ij, int kl, double val) { cont1(ij,kl,val); cont2(ij,kl,val); } inline void cont5(int ij, int kl, double val) { cont1(ij,kl,val); cont3(ij,kl,val); } }; class LocalUHFEnergyContribution { private: double * const pmata; double * const pmatb; public: double ec; double ex; LocalUHFEnergyContribution(double *a, double *b) : pmata(a), pmatb(b) { ec=ex=0; } ~LocalUHFEnergyContribution() {} void set_bound(double,double) {}; inline void cont1(int ij, int kl, double val) { ec += val*(pmata[ij]+pmatb[ij])*(pmata[kl]+pmatb[kl]); } inline void cont2(int ij, int kl, double val) { ex -= 0.5*val*(pmata[ij]*pmata[kl]+pmatb[ij]*pmatb[kl]); } inline void cont3(int ij, int kl, double val) { ex -= val*(pmata[ij]*pmata[kl]+pmatb[ij]*pmatb[kl]); } inline void cont4(int ij, int kl, double val) { cont1(ij,kl,val); cont2(ij,kl,val); } inline void cont5(int ij, int kl, double val) { cont1(ij,kl,val); cont3(ij,kl,val); } }; class LocalUHFGradContribution { private: double * const pmata; double * const pmatb; public: LocalUHFGradContribution(double *a, double *b) : pmata(a), pmatb(b) {} ~LocalUHFGradContribution() {} inline double cont1(int ij, int kl) { return (pmata[ij]*pmata[kl])+(pmatb[ij]*pmatb[kl]) + (pmata[ij]*pmatb[kl])+(pmatb[ij]*pmata[kl]); } inline double cont2(int ij, int kl) { return 2*((pmata[ij]*pmata[kl])+(pmatb[ij]*pmatb[kl])); } }; }
#pragma once // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2019 The MMapper Authors // Author: Ulf Hermann <ulfonk_mennhar@gmx.de> (Alve) // Author: Marek Krejza <krejza@gmail.com> (Caligor) // Author: Nils Schimmelmann <nschimme@gmail.com> (Jahara) #include <memory> #include <QPoint> #include <QString> #include <QWidget> #include <QtCore> #include <QtGlobal> #include "../expandoracommon/coordinate.h" #include "../global/utils.h" #include "mapcanvas.h" class MapCanvas; class MapData; class Mmapper2Group; class PrespammedPath; class QGridLayout; class QKeyEvent; class QMouseEvent; class QObject; class QResizeEvent; class QScrollBar; class QTimer; class MapWindow final : public QWidget { Q_OBJECT public: explicit MapWindow(MapData &mapData, PrespammedPath &pp, Mmapper2Group &gm, QWidget *parent); ~MapWindow() final; public: void keyPressEvent(QKeyEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; void resizeEvent(QResizeEvent *event) override; MapCanvas *getCanvas() const; signals: void sig_setScroll(const glm::vec2 &worldPos); void sig_zoomChanged(float zoom); public slots: void slot_setScrollBars(const Coordinate &, const Coordinate &); void slot_centerOnWorldPos(const glm::vec2 &worldPos); void slot_mapMove(int dx, int dy); void slot_continuousScroll(int dx, int dy); void slot_scrollTimerTimeout(); void slot_graphicsSettingsChanged(); public: void updateScrollBars(); void setZoom(float zoom); float getZoom() const; protected: std::unique_ptr<QTimer> scrollTimer; int m_verticalScrollStep = 0; int m_horizontalScrollStep = 0; std::unique_ptr<QGridLayout> m_gridLayout; std::unique_ptr<QScrollBar> m_horizontalScrollBar; std::unique_ptr<QScrollBar> m_verticalScrollBar; std::unique_ptr<MapCanvas> m_canvas; private: QPoint mousePressPos; QPoint scrollBarValuesOnMousePress; struct NODISCARD KnownMapSize final { glm::ivec3 min{0}; glm::ivec3 max{0}; NODISCARD glm::ivec2 size() const { return glm::ivec2{max - min}; } NODISCARD glm::vec2 scrollToWorld(const glm::ivec2 &scrollPos) const; NODISCARD glm::ivec2 worldToScroll(const glm::vec2 &worldPos) const; } m_knownMapSize; private: void centerOnScrollPos(const glm::ivec2 &scrollPos); };
/*! \file exif-mem.h * \brief Define the ExifMem data type and the associated functions. * ExifMem defines the memory management functions used by the ExifLoader. */ /* exif-mem.h * * Copyright (c) 2003 Lutz Mueller <lutz@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 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., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __EXIF_MEM_H__ #define __EXIF_MEM_H__ #include <libexif/exif-utils.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /*! Should work like calloc() * \param[in] s the size of the block to allocate. * \returns the allocated memory and initialized. */ typedef void * (* ExifMemAllocFunc) (ExifLong s); /*! Should work like realloc() * \param[in] p the pointer to reallocate * \param[in] s the size of the reallocated block * \returns allocated memory */ typedef void * (* ExifMemReallocFunc) (void *p, ExifLong s); /*! Free method for ExifMem * \param[in] p the pointer to free * \returns the freed pointer */ typedef void (* ExifMemFreeFunc) (void *p); /*! ExifMem define a memory allocator */ typedef struct _ExifMem ExifMem; /*! Create a new ExifMem * \param[in] a the allocator function * \param[in] r the reallocator function * \param[in] f the free function */ ExifMem *exif_mem_new (ExifMemAllocFunc a, ExifMemReallocFunc r, ExifMemFreeFunc f); /*! Refcount an ExifMem */ void exif_mem_ref (ExifMem *); /*! Unrefcount an ExifMem * If the refcount reaches 0, the ExifMem is freed */ void exif_mem_unref (ExifMem *); void *exif_mem_alloc (ExifMem *m, ExifLong s); void *exif_mem_realloc (ExifMem *m, void *p, ExifLong s); void exif_mem_free (ExifMem *m, void *p); /*! The default ExifMem for your convenience * \returns return the default ExifMem */ ExifMem *exif_mem_new_default (void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __EXIF_MEM_H__ */
/* * Copyright (C) 2016, 2017 by Rafael Santiago * * This is a free software. You can redistribute it and/or modify under * the terms of the GNU General Public License version 2. * */ #ifndef CP8_ASM_DTP_DTP2_H #define CP8_ASM_DTP_DTP2_H 1 char *cp8_dsm_dtp2(unsigned short nnn); #endif
#ifndef __SEGMENT_H #define __SEGMENT_H typedef struct bound { int bx,by; float bJ; } BOUND; #endif #define TN 6 int segment(unsigned char *rmap,unsigned char *cmap,int N,int nt,int ny,int nx, unsigned char *RGB,char *outfname,char *exten,int type,int dim,int NSCALEi, float displayintensity,int verbose,int tt); int segment2(unsigned char *rmap0,short *rmap,int i,unsigned char *cmap,int N,int nt, int ny,int nx,int tt,int oldTR,float *MINRSIZE,int *offset,int *step,int verbose); int segment1(unsigned char *cmap,int N,int nt,int ny,int nx,int *offset,int *step, short *rmap,unsigned char *rmap0,int oldTR,int i,float MINRSIZE,int redo,int tt); int track(short *rmap,float *J0,float *JT0,int nt,int ny,int nx,float **threshJ1, float MINRSIZE,unsigned char *rmap00,int n2bgrow,int tt,float **threshJ2, int oldTR); int track1(int **tracklen,int TR,int TR2,int imgsize,short *rmap1,short *rmap2, float *JT,unsigned char *rmap0,int *convert,int *TR1,int *newTR); void tempofilt(unsigned char *rmap,int nt,int ny,int nx,int N,unsigned char *cmap, int *offset,int *step); int merge(unsigned char *rmap,unsigned char *cmap,int N,int nt,int ny,int nx,int TR, float threshcolor,int threshtr); int merge1(unsigned char *rmap,unsigned char *cmap,int N,int nt,int ny,int nx,int TR, float threshcolor); int getrmap3(short *rmap,float *J,int ny,int nx,float *threshJ1,int TR,float RSIZE, unsigned char *rmap0,int n2bgrow,float *threshJ2,int oldTR,int *appear); int getrmap1(short *rmap,float *J,int ny,int nx,float *threshJ,int TR,float RSIZE, unsigned char *rmap0,int n2bgrow); int rmapgrow1(short *rmap,int *ky,int *kx,int i,int j,int ny,int nx,float *J, float threshJ,unsigned char *rmap0,int imgsize,int *kl); void removehole(short *rmap11,int nt,int ny,int nx,unsigned char *rmap00); void checkneigh(short rmap2,short rmap2n,int *neigh,int *neighn); int getrmap2(short *rmap1,float *J0,int nt,int ny,int nx,int TR,int oldTR, unsigned char *rmap00,int **done); int rmapgrow2(short *rmap2,int *ky,int *kx,int j,int ny,int nx,unsigned char *rmap0, int *kl); void flood(short *rmap1,float *J0,int nt,int ny,int nx,unsigned char *rmap00, int oldTR,int **done); void getneigh(short *neigh,float *J,int ny,int nx,int iy,int ix,short *rmap, unsigned char *rmap0,int loc); void getJ(unsigned char *cmap,int N,int ny,int nx,float *J,int offset,int step, short *rmap,unsigned char *rmap0,int TR); int getthreshJ(int datasize,float *J,short *rmap,unsigned char *rmap0, float *threshJ1,float *threshJ2,int TR,int status,int *done); void showJ(float *J0,float **threshJ1,float **threshJ2,unsigned char *rmap00, int nt,int ny,int nx); void getJT(unsigned char *cmap,int N,int ny,int nx,float *JT,int offset,int step, short *rmap,unsigned char *rmap0,int TR); float gettotalJS(unsigned char *cmap,int N,int ny,int nx,unsigned char *rmap,int TR, float *totalJ,float **mapmatrix,int oldTR); float gettotalJC(float *B,unsigned char *cmap,int N,float **cb,int dim,int npt, float ST);
#ifndef _ASM_X86_HW_IRQ_H #define _ASM_X86_HW_IRQ_H /* * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar * * moved some of the old arch/i386/kernel/irq.h to here. VY * * IRQ/IPI changes taken from work by Thomas Radke * <tomsoft@informatik.tu-chemnitz.de> * * hacked by Andi Kleen for x86-64. * unified by tglx */ #include <asm/irq_vectors.h> #ifndef __ASSEMBLY__ #include <linux/percpu.h> #include <linux/profile.h> #include <linux/smp.h> #include <linux/atomic.h> #include <asm/irq.h> #include <asm/sections.h> /* Interrupt handlers registered during init_IRQ */ extern void apic_timer_interrupt(void); extern void x86_platform_ipi(void); extern void error_interrupt(void); extern void irq_work_interrupt(void); extern void spurious_interrupt(void); extern void thermal_interrupt(void); extern void reschedule_interrupt(void); extern void mce_self_interrupt(void); extern void invalidate_interrupt(void); extern void invalidate_interrupt0(void); extern void invalidate_interrupt1(void); extern void invalidate_interrupt2(void); extern void invalidate_interrupt3(void); extern void invalidate_interrupt4(void); extern void invalidate_interrupt5(void); extern void invalidate_interrupt6(void); extern void invalidate_interrupt7(void); extern void invalidate_interrupt8(void); extern void invalidate_interrupt9(void); extern void invalidate_interrupt10(void); extern void invalidate_interrupt11(void); extern void invalidate_interrupt12(void); extern void invalidate_interrupt13(void); extern void invalidate_interrupt14(void); extern void invalidate_interrupt15(void); extern void invalidate_interrupt16(void); extern void invalidate_interrupt17(void); extern void invalidate_interrupt18(void); extern void invalidate_interrupt19(void); extern void invalidate_interrupt20(void); extern void invalidate_interrupt21(void); extern void invalidate_interrupt22(void); extern void invalidate_interrupt23(void); extern void invalidate_interrupt24(void); extern void invalidate_interrupt25(void); extern void invalidate_interrupt26(void); extern void invalidate_interrupt27(void); extern void invalidate_interrupt28(void); extern void invalidate_interrupt29(void); extern void invalidate_interrupt30(void); extern void invalidate_interrupt31(void); extern void irq_move_cleanup_interrupt(void); extern void reboot_interrupt(void); extern void threshold_interrupt(void); extern void call_function_interrupt(void); extern void call_function_single_interrupt(void); /* IOAPIC */ #define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs)) extern unsigned long io_apic_irqs; extern void init_VISWS_APIC_irqs(void); extern void setup_IO_APIC(void); extern void disable_IO_APIC(void); struct io_apic_irq_attr { int ioapic; int ioapic_pin; int trigger; int polarity; }; static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr, int ioapic, int ioapic_pin, int trigger, int polarity) { irq_attr->ioapic = ioapic; irq_attr->ioapic_pin = ioapic_pin; irq_attr->trigger = trigger; irq_attr->polarity = polarity; } struct irq_2_iommu { struct intel_iommu *iommu; u16 irte_index; u16 sub_handle; u8 irte_mask; }; /* * This is performance-critical, we want to do it O(1) * * Most irqs are mapped 1:1 with pins. */ struct irq_cfg { struct irq_pin_list *irq_2_pin; cpumask_var_t domain; cpumask_var_t old_domain; u8 vector; u8 move_in_progress : 1; #ifdef CONFIG_IRQ_REMAP struct irq_2_iommu irq_2_iommu; #endif }; extern int assign_irq_vector(int, struct irq_cfg *, const struct cpumask *); extern void send_cleanup_vector(struct irq_cfg *); struct irq_data; int __ioapic_set_affinity(struct irq_data *, const struct cpumask *, unsigned int *dest_id); extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin, struct io_apic_irq_attr *irq_attr); extern void setup_ioapic_dest(void); extern void enable_IO_APIC(void); /* Statistics */ extern atomic_t irq_err_count; extern atomic_t irq_mis_count; /* EISA */ extern void eisa_set_level_irq(unsigned int irq); /* SMP */ extern void smp_apic_timer_interrupt(struct pt_regs *); extern void smp_spurious_interrupt(struct pt_regs *); extern void smp_x86_platform_ipi(struct pt_regs *); extern void smp_error_interrupt(struct pt_regs *); #ifdef CONFIG_X86_IO_APIC extern asmlinkage void smp_irq_move_cleanup_interrupt(void); #endif #ifdef CONFIG_SMP extern void smp_reschedule_interrupt(struct pt_regs *); extern void smp_call_function_interrupt(struct pt_regs *); extern void smp_call_function_single_interrupt(struct pt_regs *); #ifdef CONFIG_X86_32 extern void smp_invalidate_interrupt(struct pt_regs *); #else extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *); #endif #endif extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void); typedef int vector_irq_t[NR_VECTORS]; DECLARE_PER_CPU(vector_irq_t, vector_irq); extern void setup_vector_irq(int cpu); #ifdef CONFIG_X86_IO_APIC extern void lock_vector_lock(void); extern void unlock_vector_lock(void); extern void __setup_vector_irq(int cpu); #else static inline void lock_vector_lock(void) {} static inline void unlock_vector_lock(void) {} static inline void __setup_vector_irq(int cpu) {} #endif #endif /* !ASSEMBLY_ */ #endif /* _ASM_X86_HW_IRQ_H */
/* GIMP - The GNU Image Manipulation Program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * 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 __SCRIPT_FU_TYPES_H__ #define __SCRIPT_FU_TYPES_H__ #include "script-fu-enums.h" typedef struct { GtkAdjustment *adj; gdouble value; gdouble lower; gdouble upper; gdouble step; gdouble page; gint digits; SFAdjustmentType type; } SFAdjustment; typedef struct { gchar *filename; } SFFilename; typedef struct { gchar *name; gdouble opacity; gint spacing; GimpLayerModeEffects paint_mode; } SFBrush; typedef struct { GSList *list; gint history; } SFOption; typedef struct { gchar *type_name; gint history; } SFEnum; typedef union { gint32 sfa_image; gint32 sfa_drawable; gint32 sfa_layer; gint32 sfa_channel; gint32 sfa_vectors; gint32 sfa_display; GimpRGB sfa_color; gint32 sfa_toggle; gchar *sfa_value; SFAdjustment sfa_adjustment; SFFilename sfa_file; gchar *sfa_font; gchar *sfa_gradient; gchar *sfa_palette; gchar *sfa_pattern; SFBrush sfa_brush; SFOption sfa_option; SFEnum sfa_enum; } SFArgValue; typedef struct { SFArgType type; gchar *label; SFArgValue default_value; SFArgValue value; } SFArg; typedef struct { gchar *name; gchar *menu_label; gchar *blurb; gchar *author; gchar *copyright; gchar *date; gchar *image_types; gint n_args; SFArg *args; } SFScript; #endif /* __SCRIPT_FU_TYPES__ */
#include "pieces/walks/skylla_charybdis.h" #include "pieces/walks/locusts.h" #include "solving/move_generator.h" #include "solving/fork.h" #include "debugging/trace.h" static void generate_one_move(numvec dir_arrival, numvec dir_capture) { square const sq_departure = curr_generation->departure; square const sq_capture = sq_departure+dir_capture; square const sq_arrival = sq_capture+dir_arrival; if (is_square_empty(sq_arrival)) { if (is_square_empty(sq_capture)) { curr_generation->arrival = sq_arrival; push_move(); } else generate_locust_capture(sq_capture,dir_arrival); } } /* Generate moves for a Skylla */ void skylla_generate_moves(void) { generate_one_move(dir_up+dir_right, dir_right); generate_one_move(dir_up+dir_right, dir_up); generate_one_move(dir_up+dir_left, dir_up); generate_one_move(dir_up+dir_left, dir_left); generate_one_move(dir_down+dir_left, dir_left); generate_one_move(dir_down+dir_left, dir_down); generate_one_move(dir_down+dir_right, dir_down); generate_one_move(dir_down+dir_right, dir_right); } /* Generate moves for a Charybdis */ void charybdis_generate_moves(void) { generate_one_move(dir_right, dir_up+dir_right); generate_one_move(dir_up, dir_up+dir_right); generate_one_move(dir_up, dir_up+dir_left); generate_one_move(dir_left, dir_up+dir_left); generate_one_move(dir_left, dir_down+dir_left); generate_one_move(dir_down, dir_down+dir_left); generate_one_move(dir_down, dir_down+dir_right); generate_one_move(dir_right, dir_down+dir_right); } static boolean skycharcheck(square chp, square sq_arrival1, square sq_arrival2, validator_id evaluate) { if (is_square_empty(sq_arrival1) && EVALUATE_OBSERVATION(evaluate,chp,sq_arrival1)) return true; if (is_square_empty(sq_arrival2) && EVALUATE_OBSERVATION(evaluate,chp,sq_arrival2)) return true; return false; } boolean skylla_check(validator_id evaluate) { square const sq_target = move_generation_stack[CURRMOVE_OF_PLY(nbply)].capture; return skycharcheck(sq_target+dir_right, sq_target+dir_up+dir_left, sq_target+dir_down+dir_left, evaluate) || skycharcheck(sq_target+dir_left, sq_target+dir_up+dir_right, sq_target+dir_down+dir_right, evaluate) || skycharcheck(sq_target+dir_up, sq_target+dir_down+dir_right, sq_target+dir_down+dir_left, evaluate) || skycharcheck(sq_target+dir_down, sq_target+dir_up+dir_left, sq_target+dir_up+dir_right, evaluate); } boolean charybdis_check(validator_id evaluate) { square const sq_target = move_generation_stack[CURRMOVE_OF_PLY(nbply)].capture; return skycharcheck(sq_target+dir_up+dir_right, sq_target+dir_left, sq_target - 24, evaluate) || skycharcheck(sq_target+dir_down+dir_left, sq_target+dir_right, sq_target + 24, evaluate) || skycharcheck(sq_target+dir_up+dir_left, sq_target+dir_right, sq_target - 24, evaluate) || skycharcheck(sq_target+dir_down+dir_right, sq_target+dir_left, sq_target + 24, evaluate); }
/** * @file * @brief A simple line between two points */ /* Copyright (C) 2002-2015 UFO: Alien Invasion. 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. */ #pragma once #include "ufotypes.h" #include "vector.h" class Line { public: Line () { VectorCopy(vec3_origin, start); VectorCopy(vec3_origin, stop); } Line (const vec3_t _start, const vec3_t _stop) { VectorCopy(_start, start); VectorCopy(_stop, stop); } /** * @brief Copies the values from the given Line * @param[in] other The other Line */ inline void set (const Line& other) { VectorCopy(other.start, start); VectorCopy(other.stop, stop); } /** we explicitly don't make them private for now, because the goal of this class is to NOT handle them separately */ vec3_t start; vec3_t stop; };
#ifndef PREFDEFAULTSLAYOUT_H #define PREFDEFAULTSLAYOUT_H #include "ui_prefdefaultslayout.h" class PrefDefaultsLayout : public QWidget, public Ui_PrefDefaultsLayout { Q_OBJECT public: explicit PrefDefaultsLayout( QWidget* parent = 0 ); }; #endif
#include "..\\include\\dict.h" void show_all_select_results(MYSQL *conn) { MYSQL_RES *res; MYSQL_ROW row; uint num_fields; res = mysql_store_result(conn); num_fields = mysql_num_fields(res); while (row = mysql_fetch_row(res)) { for (int i = 0; i < num_fields; i++) { printf("%s ", row[i] ? row[i] : "NULL"); } printf("\n"); } mysql_free_result(res); return; } void mysql_exe_query(MYSQL *conn, const char *sql) { if (mysql_query(conn, sql)) { exit_with_error(conn); } return; }
/* Return value of complex exponential function for float complex value. Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <complex.h> #include <fenv.h> #include <math.h> #include <math_private.h> #include <float.h> __complex__ float __cexpf (__complex__ float x) { __complex__ float retval; int rcls = fpclassify (__real__ x); int icls = fpclassify (__imag__ x); if (__builtin_expect (rcls >= FP_ZERO, 1)) { /* Real part is finite. */ if (__builtin_expect (icls >= FP_ZERO, 1)) { /* Imaginary part is finite. */ const int t = (int) ((FLT_MAX_EXP - 1) * M_LN2); float sinix, cosix; if (__builtin_expect (icls != FP_SUBNORMAL, 1)) { __sincosf (__imag__ x, &sinix, &cosix); } else { sinix = __imag__ x; cosix = 1.0f; } if (__real__ x > t) { float exp_t = __ieee754_expf (t); __real__ x -= t; sinix *= exp_t; cosix *= exp_t; if (__real__ x > t) { __real__ x -= t; sinix *= exp_t; cosix *= exp_t; } } if (__real__ x > t) { /* Overflow (original real part of x > 3t). */ __real__ retval = FLT_MAX * cosix; __imag__ retval = FLT_MAX * sinix; } else { float exp_val = __ieee754_expf (__real__ x); __real__ retval = exp_val * cosix; __imag__ retval = exp_val * sinix; } } else { /* If the imaginary part is +-inf or NaN and the real part is not +-inf the result is NaN + iNaN. */ __real__ retval = __nanf (""); __imag__ retval = __nanf (""); feraiseexcept (FE_INVALID); } } else if (__builtin_expect (rcls == FP_INFINITE, 1)) { /* Real part is infinite. */ if (__builtin_expect (icls >= FP_ZERO, 1)) { /* Imaginary part is finite. */ float value = signbit (__real__ x) ? 0.0 : HUGE_VALF; if (icls == FP_ZERO) { /* Imaginary part is 0.0. */ __real__ retval = value; __imag__ retval = __imag__ x; } else { float sinix, cosix; if (__builtin_expect (icls != FP_SUBNORMAL, 1)) { __sincosf (__imag__ x, &sinix, &cosix); } else { sinix = __imag__ x; cosix = 1.0f; } __real__ retval = __copysignf (value, cosix); __imag__ retval = __copysignf (value, sinix); } } else if (signbit (__real__ x) == 0) { __real__ retval = HUGE_VALF; __imag__ retval = __nanf (""); if (icls == FP_INFINITE) feraiseexcept (FE_INVALID); } else { __real__ retval = 0.0; __imag__ retval = __copysignf (0.0, __imag__ x); } } else { /* If the real part is NaN the result is NaN + iNaN. */ __real__ retval = __nanf (""); __imag__ retval = __nanf (""); if (rcls != FP_NAN || icls != FP_NAN) feraiseexcept (FE_INVALID); } return retval; } #ifndef __cexpf weak_alias (__cexpf, cexpf) #endif
/* * Generic GPIO card-detect helper * * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de> * * 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/err.h> #include <linux/gpio.h> #include <linux/interrupt.h> #include <linux/jiffies.h> #include <linux/mmc/host.h> #include <linux/mmc/slot-gpio.h> #include <linux/module.h> #include <linux/slab.h> struct mmc_gpio { int ro_gpio; int cd_gpio; char *ro_label; bool status; char cd_label[0]; }; int mmc_gpio_get_status(struct mmc_host *host) { int ret = -ENOSYS; struct mmc_gpio *ctx = host->slot.handler_priv; if (!ctx || !gpio_is_valid(ctx->cd_gpio)) goto out; ret = !gpio_get_value_cansleep(ctx->cd_gpio) ^ !!(host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH); out: return ret; } EXPORT_SYMBOL(mmc_gpio_get_status); int mmc_gpio_send_uevent(struct mmc_host *host) { char *envp[2]; char state_string[16]; int status; status = mmc_gpio_get_status(host); if (unlikely(status < 0)) goto out; snprintf(state_string, sizeof(state_string), "SWITCH_STATE=%d", status); envp[0] = state_string; envp[1] = NULL; kobject_uevent_env(&host->class_dev.kobj, KOBJ_ADD, envp); out: return status; } static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) { struct mmc_host *host = dev_id; struct mmc_gpio *ctx = host->slot.handler_priv; int status; if (!host->ops) goto out; if (host->ops->card_event) host->ops->card_event(host); status = mmc_gpio_get_status(host); if (unlikely(status < 0)) goto out; if (status ^ ctx->status) { pr_info("%s: slot status change detected (%d -> %d), GPIO_ACTIVE_%s\n", mmc_hostname(host), ctx->status, status, (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) ? "HIGH" : "LOW"); ctx->status = status; host->caps |= host->caps_uhs; host->removed_cnt = 0; host->crc_count = 0; #if 0 mmc_detect_change(host, msecs_to_jiffies(200)); #else disable_irq_nosync(host->slot.cd_irq); cancel_delayed_work(&host->detect); mmc_debounce1(host); #endif mmc_gpio_send_uevent(host); } out: return IRQ_HANDLED; } static int mmc_gpio_alloc(struct mmc_host *host) { size_t len = strlen(dev_name(host->parent)) + 4; struct mmc_gpio *ctx; mutex_lock(&host->slot.lock); ctx = host->slot.handler_priv; if (!ctx) { ctx = devm_kzalloc(&host->class_dev, sizeof(*ctx) + 2 * len, GFP_KERNEL); if (ctx) { ctx->ro_label = ctx->cd_label + len; snprintf(ctx->cd_label, len, "%s cd", dev_name(host->parent)); snprintf(ctx->ro_label, len, "%s ro", dev_name(host->parent)); ctx->cd_gpio = -EINVAL; ctx->ro_gpio = -EINVAL; host->slot.handler_priv = ctx; } } mutex_unlock(&host->slot.lock); return ctx ? 0 : -ENOMEM; } int mmc_gpio_get_ro(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; if (!ctx || !gpio_is_valid(ctx->ro_gpio)) return -ENOSYS; return !gpio_get_value_cansleep(ctx->ro_gpio) ^ !!(host->caps2 & MMC_CAP2_RO_ACTIVE_HIGH); } EXPORT_SYMBOL(mmc_gpio_get_ro); int mmc_gpio_get_cd(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; if (!ctx || !gpio_is_valid(ctx->cd_gpio)) return -ENOSYS; return !gpio_get_value_cansleep(ctx->cd_gpio) ^ !!(host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH); } EXPORT_SYMBOL(mmc_gpio_get_cd); int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio) { struct mmc_gpio *ctx; int ret; if (!gpio_is_valid(gpio)) return -EINVAL; ret = mmc_gpio_alloc(host); if (ret < 0) return ret; ctx = host->slot.handler_priv; ret = devm_gpio_request_one(&host->class_dev, gpio, GPIOF_DIR_IN, ctx->ro_label); if (ret < 0) return ret; ctx->ro_gpio = gpio; return 0; } EXPORT_SYMBOL(mmc_gpio_request_ro); int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio) { struct mmc_gpio *ctx; int irq = gpio_to_irq(gpio); int ret; ret = mmc_gpio_alloc(host); if (ret < 0) return ret; ctx = host->slot.handler_priv; ret = devm_gpio_request_one(&host->class_dev, gpio, GPIOF_DIR_IN, ctx->cd_label); if (ret < 0) return ret; if (irq >= 0 && host->caps & MMC_CAP_NEEDS_POLL) irq = -EINVAL; ctx->cd_gpio = gpio; host->slot.cd_irq = irq; ret = mmc_gpio_get_status(host); if (ret < 0) return ret; ctx->status = ret; if (irq >= 0) { ret = devm_request_threaded_irq(&host->class_dev, irq, NULL, mmc_gpio_cd_irqt, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, ctx->cd_label, host); if (ret < 0) irq = ret; } if (irq < 0) host->caps |= MMC_CAP_NEEDS_POLL; return 0; } EXPORT_SYMBOL(mmc_gpio_request_cd); void mmc_gpio_free_ro(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; int gpio; if (!ctx || !gpio_is_valid(ctx->ro_gpio)) return; gpio = ctx->ro_gpio; ctx->ro_gpio = -EINVAL; devm_gpio_free(&host->class_dev, gpio); } EXPORT_SYMBOL(mmc_gpio_free_ro); void mmc_gpio_free_cd(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; int gpio; if (!ctx || !gpio_is_valid(ctx->cd_gpio)) return; if (host->slot.cd_irq >= 0) { devm_free_irq(&host->class_dev, host->slot.cd_irq, host); host->slot.cd_irq = -EINVAL; } gpio = ctx->cd_gpio; ctx->cd_gpio = -EINVAL; devm_gpio_free(&host->class_dev, gpio); } EXPORT_SYMBOL(mmc_gpio_free_cd);
/* * The ManaPlus Client * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INPUT_INPUTFUNCTION_H #define INPUT_INPUTFUNCTION_H #include "input/inputitem.h" #include "localconsts.h" const unsigned int inputFunctionSize = 3; struct InputFunction final { InputItem values[inputFunctionSize]; }; #endif // INPUT_INPUTFUNCTION_H
/* * kmod - one tool to rule them all * * Copyright (C) 2011-2013 ProFUSION embedded systems * * 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/>. */ #pragma once #include "macro.h" struct kmod_cmd { const char *name; int (*cmd)(int argc, char *argv[]); const char *help; }; extern const struct kmod_cmd kmod_cmd_compat_lsmod; extern const struct kmod_cmd kmod_cmd_compat_rmmod; extern const struct kmod_cmd kmod_cmd_compat_insmod; extern const struct kmod_cmd kmod_cmd_compat_modinfo; extern const struct kmod_cmd kmod_cmd_compat_modprobe; #ifdef _GNU_SOURCE extern const struct kmod_cmd kmod_cmd_compat_depmod; #endif extern const struct kmod_cmd kmod_cmd_list; extern const struct kmod_cmd kmod_cmd_static_nodes; #include "log.h"
/***************************************************************************//** * @file drv_usart.h * @brief USART driver of RT-Thread RTOS for MiniSTM32 * COPYRIGHT (C) 2011, RT-Thread Development Team * @author onelife * @version 0.4 beta ******************************************************************************* * @section License * The license and distribution terms for this file may be found in the file * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE ******************************************************************************* * @section Change Logs * Date Author Notes * 2012-02-18 onelife Initial creation of USART module driver for * MiniSTM32 (not yet supported slave mode and H/W flow control) s ******************************************************************************/ #ifndef __DRV_USART_H__ #define __DRV_USART_H__ /* Includes ------------------------------------------------------------------*/ /* Exported define -----------------------------------------------------------*/ #define USART_TASK_STACK_SIZE (512) #define USART_RX_MESSAGE_SIZE (4) #define USART_RX_MESSAGE_QUEUE_SIZE (1) #define USART_DMA_QUEUE_SIZE (5) #define USART_INT_RX_BUFFER_SIZE (64) #define USART_WAIT_TIME_TX (RT_TICK_PER_SECOND / 100 * 3) #define USART_RETRY_TIMES_RX (10) /* Config options */ #define USART_CONFIG_DIRECT_EXE (1 << 0) /* Direct execute */ #define USART_CONFIG_9BIT (1 << 1) /* Word length */ #define USART_CONFIG_REMAP_GET(cfg) ((cfg >> 2) & 0x03) #define USART_CONFIG_DMA_TX (1 << 4) /* DMA TX */ #define USART_CONFIG_INT_RX (1 << 5) /* INT RX */ #define USART_CONFIG_CONSOLE (1 << 6) /* Console device */ /* Status options */ #define USART_STATUS_MASK (0x0003) #define USART_STATUS_DIRECT_EXE (1 << 0) #define USART_STATUS_9BIT (1 << 1) #define USART_STATUS_START (1 << 2) #define USART_STATUS_READ_ONLY (1 << 3) #define USART_STATUS_WRITE_ONLY (1 << 4) #define USART_STATUS_NONBLOCKING (1 << 5) #define USART_STATUS_TX_BUSY (1 << 6) #define USART_STATUS_RX_BUSY (1 << 7) /* USART command options */ #define USART_COMMAND_STATUS (0x000001) #define USART_COMMAND_OPEN (0x000002) #define USART_COMMAND_CLOSE (0x000004) #define USART_COMMAND_READ (0x000008) #define USART_COMMAND_WRITE (0x000010) #define USART_COMMAND_CONTROL (0x000020) #define USART_COMMAND_WAIT_TIME (RT_TICK_PER_SECOND / 10) /* Exported types ------------------------------------------------------------*/ struct miniStm32_usart_device { rt_uint8_t counter; rt_uint8_t number; volatile rt_uint16_t status; USART_TypeDef *usart_device; void *tx_mode; void *rx_mode; struct rt_semaphore lock; }; struct miniStm32_usart_cmd_message { rt_uint32_t cmd; rt_uint32_t other; rt_size_t size; rt_uint8_t *ptr; }; struct miniStm32_usart_ret_message { rt_uint32_t cmd; rt_uint32_t other; rt_size_t size; rt_err_t ret; }; union miniStm32_usart_exec_message { struct miniStm32_usart_cmd_message cmd; struct miniStm32_usart_ret_message ret; }; struct miniStm32_usart_task_struct { struct rt_thread thread; struct rt_messagequeue rx_msgs; struct rt_event tx_evts; rt_uint8_t stack[USART_TASK_STACK_SIZE]; rt_uint8_t rx_msg_pool[USART_RX_MESSAGE_QUEUE_SIZE * \ (USART_RX_MESSAGE_SIZE + 4)]; }; struct miniStm32_usart_unit_struct { struct miniStm32_usart_task_struct task; struct rt_device device; struct miniStm32_usart_device usart; }; struct miniStm32_usart_unit_init { rt_uint8_t number; rt_uint32_t config; rt_uint32_t frequency; const rt_uint8_t *name; struct miniStm32_usart_unit_struct *unit; }; struct miniStm32_usart_int_mode { rt_uint8_t buffer[USART_INT_RX_BUFFER_SIZE]; rt_uint32_t read_index, save_index; }; struct miniStm32_usart_dma_node { /* buffer info */ rt_uint32_t *data_ptr; rt_uint16_t data_size; struct miniStm32_usart_dma_node *next, *prev; }; struct miniStm32_usart_dma_mode { DMA_Channel_TypeDef *dma_chn; struct miniStm32_usart_dma_node *list_head, *list_tail; /* Memory pool */ struct rt_mempool dma_mp; rt_uint8_t mem_pool[USART_DMA_QUEUE_SIZE * \ (sizeof(struct miniStm32_usart_dma_node) + 4)]; }; /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ rt_err_t miniStm32_hw_usart_init(void); #endif /* __DRV_USART_H__ */
/* * Copyright (C) 2013 by Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef APRSRX_H #define APRSRX_H #include <wx/wx.h> class CAPRSRX { public: CAPRSRX(); ~CAPRSRX(); void process(const wxFloat32* audio, unsigned int length); private: wxFloat32* m_corrMarkI; wxFloat32* m_corrMarkQ; wxFloat32* m_corrSpaceI; wxFloat32* m_corrSpaceQ; unsigned int m_dcd; unsigned int m_phase; unsigned int m_last; unsigned int m_subsamp; unsigned char* m_buf; unsigned char* m_ptr; bool m_state; unsigned int m_bitStream; unsigned int m_bitBuf; bool m_dump; wxString m_dumper; void rxbit(bool bit); void decodeMicE(const unsigned char* packet, unsigned int length); }; #endif
#ifndef MAN_H #define MAN_H #include "define.h" /*---------------------------------------------------------*/ /* The 'DC_Man' class is used for making a movable man */ /* for use in the DC Project. Its functions are as follows */ /*---------------------------------------------------------*/ class DC_Man { public: //man surface SDL_Surface *Man_Surface; //default constructor DC_Man(void); //returns the 'X' coordinate of this man int Get_X(void) { return X; }; //returns the 'Y' coordinate of this man int Get_Y(void) { return Y; }; //returns the size (in pixels) of this man int Get_Size(void) { return Size; }; //sets this man 'X' coordinate void Set_X(int x); //sets this man 'Y' coordinate void Set_Y(int y); //sets this man's type void Set_Type(int type); //egts this man's type int Get_Type(void) { return Type; }; //sets this man's animation phase void Set_Anim(int anim); //gets this man's animation phase int Get_Anim(void) { return Anim; }; //sets this man's size void Set_Size(int size); //inits man to screen void Draw(); //sets this man's x/y coords on his "ouch" void Set_OuchX(int ouch, int x); //gets ouch int Get_OuchX(void) { return OuchX; }; void Set_Ouch(int ouch, int x, int y); int Get_Ouch(void) { return Ouch; }; //sets this man's x/y coords on his "ouch" void Set_OuchY(int ouch, int y); //gets ouch int Get_OuchY(void) { return OuchY; }; //moves the man in a given direction void Move(int last_direction, int active); private: //declares vars int direction; int X,Y; int Size; int Type; int Ouch; int OuchX; int OuchY; int Anim; SDL_Surface *Img_Sentry; SDL_Surface *Img_Random; SDL_Surface *Img_Follow; SDL_Surface *Img_Opposite; }; #endif
/* * Copyright (c) 2014 CASIA(Institute of Automation,Chinese Academy of Sciences) * * fb resource and device definitions * * 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/kernel.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/list.h> #include <linux/ioport.h> #include <linux/platform_device.h> #include <asm/mach/arch.h> #include <asm/mach/irq.h> #include <mach/irqs.h> #include <mach/map.h> #include <mach/regs-lcd.h> #include <mach/devs.h> #include <mach/fb.h> static struct mapu_display_info mapu_fb_info={ .width=1920, .height=1080, .xres=1920, .yres=1080, .bpp=32, }; static struct resource mapu_lcd_resource[] = { [0] ={ .start=MAPU_PA_LCD, .end=MAPU_PA_LCD+LCD_SIZE-1, .flags=IORESOURCE_MEM, }, [1] ={ .start=IRQ_LCD, .end=IRQ_LCD, .flags=IORESOURCE_IRQ, } }; static u64 mapu_device_lcd_dmamask=0xffffffffUL; /* lcd devices */ extern struct platform_device mapu_lcd_dev= { .name="mapu-lcd", .id=-1, .resource=mapu_lcd_resource, .num_resources=ARRAY_SIZE(mapu_lcd_resource), .dev= { .platform_data=&mapu_fb_info , .dma_mask=&mapu_device_lcd_dmamask, .coherent_dma_mask=0xffffffffUL, } };
/* * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) * Copyright (C) 2003, 2007, 2008, 2009, 2016 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef ArgList_h #define ArgList_h #include "CallFrame.h" #include "Register.h" #include <wtf/HashSet.h> #include <wtf/Vector.h> namespace JSC { class SlotVisitor; class MarkedArgumentBuffer { WTF_MAKE_NONCOPYABLE(MarkedArgumentBuffer); friend class VM; friend class ArgList; private: static const size_t inlineCapacity = 8; typedef HashSet<MarkedArgumentBuffer*> ListSet; public: // Constructor for a read-write list, to which you may append values. // FIXME: Remove all clients of this API, then remove this API. MarkedArgumentBuffer() : m_size(0) , m_capacity(inlineCapacity) , m_buffer(m_inlineBuffer) , m_markSet(0) { } ~MarkedArgumentBuffer() { if (m_markSet) m_markSet->remove(this); if (EncodedJSValue* base = mallocBase()) fastFree(base); } size_t size() const { return m_size; } bool isEmpty() const { return !m_size; } JSValue at(int i) const { if (i >= m_size) return jsUndefined(); return JSValue::decode(slotFor(i)); } void clear() { m_size = 0; } void append(JSValue v) { if (m_size >= m_capacity || mallocBase()) return slowAppend(v); slotFor(m_size) = JSValue::encode(v); ++m_size; } void removeLast() { ASSERT(m_size); m_size--; } JSValue last() { ASSERT(m_size); return JSValue::decode(slotFor(m_size - 1)); } static void markLists(HeapRootVisitor&, ListSet&); private: void expandCapacity(); void addMarkSet(JSValue); JS_EXPORT_PRIVATE void slowAppend(JSValue); EncodedJSValue& slotFor(int item) const { return m_buffer[item]; } EncodedJSValue* mallocBase() { if (m_buffer == m_inlineBuffer) return 0; return &slotFor(0); } int m_size; int m_capacity; EncodedJSValue m_inlineBuffer[inlineCapacity]; EncodedJSValue* m_buffer; ListSet* m_markSet; }; class ArgList { friend class Interpreter; friend class JIT; public: ArgList() : m_args(0) , m_argCount(0) { } ArgList(ExecState* exec) : m_args(reinterpret_cast<JSValue*>(&exec[CallFrame::argumentOffset(0)])) , m_argCount(exec->argumentCount()) { } ArgList(const MarkedArgumentBuffer& args) : m_args(reinterpret_cast<JSValue*>(args.m_buffer)) , m_argCount(args.size()) { } JSValue at(int i) const { if (i >= m_argCount) return jsUndefined(); return m_args[i]; } bool isEmpty() const { return !m_argCount; } size_t size() const { return m_argCount; } JS_EXPORT_PRIVATE void getSlice(int startIndex, ArgList& result) const; private: JSValue* data() const { return m_args; } JSValue* m_args; int m_argCount; }; } // namespace JSC #endif // ArgList_h
/* * Xiphos Bible Study Tool * biblesync_glue.h * * Copyright (C) 2000-2016 Xiphos Developer 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 Library 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 _BIBLESYNC_GLUE_H__ #define _BIBLESYNC_GLUE_H__ #include <gtk/gtk.h> #include <glib/gi18n.h> #include "main/configs.h" #ifdef __cplusplus #include <map> #include <string> using namespace std; extern "C" { typedef struct _speaker { string uuid; string user; string ipaddr; string app; string device; string ref; string direct; bool listen; } BSP_Speaker; typedef std::map<string, BSP_Speaker> BSP_SpeakerMap; typedef BSP_SpeakerMap::iterator BSP_SpeakerMapIterator; int biblesync_compare_speaker(const void *Lvoid, const void *Rvoid); #endif // __cplusplus void biblesync_navigate(char cmd, char *speaker, char *bible, char *verse, char *alt, char *group, char *domain, char *info, char *dump); void biblesync_update_speaker(); int biblesync_mode_select(int m, char *p); int biblesync_personal(); int biblesync_active(); int biblesync_active_xmit_allowed(); const char *biblesync_get_passphrase(); void biblesync_transmit_verse_list(char *modname, char *vlist); void biblesync_privacy(gboolean privacy); void biblesync_prep_and_xmit(const char *mod_name, const char *key); void biblesync_set_clear_all_listen(gboolean listen); #ifdef __cplusplus } #endif #endif /* _BIBLESYNC_GLUE_H__ */
/* * env.c * * Created on: 2017. 2. 7. * Author: root */ #include <stdio.h> #include <stdlib.h> #include "env.h" #include "common.h" int get_air_env(AIR_ENV *env) { if (!getenv("DB_HOME")) { fprintf(stderr, "DB_HOME is not defined\n"); return -1; } if (!getenv("CONF_HOME")) { fprintf(stderr, "CONF_HOME is not defined\n"); return -1; } if (!getenv("PCAP_HOME")) { fprintf(stderr, "PCAP_HOME is not defined\n"); return -1; } SNP(env->DB_HOME, "%s", getenv("DB_HOME")); SNP(env->CONF_HOME, "%s", getenv("CONF_HOME")); SNP(env->PCAP_HOME, "%s", getenv("PCAP_HOME")); SNP(env->PROFILE_DB, "%s/%s", env->DB_HOME, "profiles.db"); /* printf("DB_HOME=%s\n", env->DB_HOME); printf("CONF_HOME=%s\n", env->CONF_HOME); printf("PCAP_HOME=%s\n", env->PCAP_HOME); printf("PROFILE_DB=%s\n", env->PROFILE_DB); */ return 0; }
/** * (c) 2014-2016 Alexandro Sanchez Bach. All rights reserved. * Released under GPL v2 license. Read LICENSE for more details. */ #pragma once #include "nucleus/common.h" #include "../hle_macro.h" #include <mutex> namespace sys { struct sys_lwmutex_attribute_t { BE<U32> protocol; BE<U32> recursive; S08 name[8]; }; // Auxiliary classes struct sys_lwmutex_t { #if defined(NUCLEUS_TARGET_ANDROID) && defined(NUCLEUS_COMPILER_GCC) std::mutex lwmutex; #else std::timed_mutex lwmutex; #endif sys_lwmutex_attribute_t attr; }; // SysCalls HLE_FUNCTION(sys_lwmutex_create, BE<U32>* lwmutex_id, sys_lwmutex_attribute_t* attr); HLE_FUNCTION(sys_lwmutex_destroy, U32 lwmutex_id); HLE_FUNCTION(sys_lwmutex_lock, U32 lwmutex_id, U64 timeout); HLE_FUNCTION(sys_lwmutex_trylock, U32 lwmutex_id); HLE_FUNCTION(sys_lwmutex_unlock, U32 lwmutex_id); } // namespace sys
/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2020 Mark Samman <mark.samman@gmail.com> * Modifications made by Caduceus <decapitatedsoulot@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef FS_MOUNTS_H_73716D11906A4C5C9F4A7B68D34C9BA6 #define FS_MOUNTS_H_73716D11906A4C5C9F4A7B68D34C9BA6 struct Mount { Mount(uint8_t id, uint16_t clientId, std::string name, int32_t speed, bool premium) : name(name), speed(speed), clientId(clientId), id(id), premium(premium) {} std::string name; int32_t speed; uint16_t clientId; uint8_t id; bool premium; }; class Mounts { public: bool reload(); bool loadFromXml(); Mount* getMountByID(uint8_t id); Mount* getMountByClientID(uint16_t clientId); const std::vector<Mount>& getMounts() const { return mounts; } private: std::vector<Mount> mounts; }; #endif
#include <SDL/SDL.h> #include <stdio.h> void fillSurfaceWithColor(SDL_Surface *surf, Uint32 color) { SDL_Rect dstrect; dstrect.x = 0; dstrect.y = 0; dstrect.w = surf->w; dstrect.h = surf->h; SDL_FillRect(surf, &dstrect, color); return; } void fillSurfaceWithBlack(SDL_Surface *surf) { Uint32 color; /* Set Background color */ color = SDL_MapRGB(surf->format, 0x00, 0x00, 0x00); /* fill black color on the screen */ fillSurfaceWithColor(surf, color); }
/** * This header is generated by class-dump-z 0.2b. * * Source: /System/Library/PrivateFrameworks/OfficeImport.framework/OfficeImport */ #import <OfficeImport/OfficeImport-Structs.h> #import <OfficeImport/NSCopying.h> #import <OfficeImport/XXUnknownSuperclass.h> @class NSString; __attribute__((visibility("hidden"))) @interface OIXMLNode : XXUnknownSuperclass <NSCopying> { @private unsigned _kind; // 4 = 0x4 NSString *_name; // 8 = 0x8 id _value; // 12 = 0xc } @property(retain) NSString *name; // G=0x84e9; S=0x13b5; converted property @property(retain) id stringValue; // G=0x86b9; S=0x3665; converted property @property(retain) id objectValue; // G=0x2cf431; S=0x13f9; converted property @property(readonly, assign) unsigned kind; // G=0x86a9; converted property + (id)textWithStringValue:(id)stringValue; // 0x7b79 + (id)attributeWithName:(id)name stringValue:(id)value; // 0x130d + (id)elementWithName:(id)name; // 0x35bd + (id)elementWithName:(id)name stringValue:(id)value; // 0x9f239 + (void)_escapeHTMLAttributeCharacters:(id)characters withQuote:(unsigned short)quote appendingToString:(CFStringRef)string; // 0x2cf4f5 + (void)_escapeCharacters:(const unsigned short *)characters amount:(unsigned)amount escapeWhiteSpaces:(BOOL)spaces inString:(id)string appendingToString:(CFStringRef)string5; // 0x86d9 - (id)initWithKind:(unsigned)kind; // 0x13a5 - (id)initWithKind:(unsigned)kind name:(id)name stringValue:(id)value; // 0x1361 - (id)copyWithZone:(NSZone *)zone; // 0x2cf459 - (void)dealloc; // 0x8d2f9 // converted property getter: - (unsigned)kind; // 0x86a9 // converted property setter: - (void)setName:(id)name; // 0x13b5 // converted property getter: - (id)name; // 0x84e9 // converted property setter: - (void)setStringValue:(id)value; // 0x3665 // converted property getter: - (id)stringValue; // 0x86b9 // converted property setter: - (void)setObjectValue:(id)value; // 0x13f9 // converted property getter: - (id)objectValue; // 0x2cf431 - (id)description; // 0x2cf585 - (id)XMLString; // 0x82a9 - (id)openingTagString; // 0x2cf441 - (id)contentString; // 0x2cf575 - (id)closingTagString; // 0x2cf44d - (void)_appendXMLStringToString:(CFStringRef)string level:(int)level; // 0x8561 @end
//------------------------------------------------------------------------- /* Copyright (C) 2010 EDuke32 developers and contributors This file is part of EDuke32. EDuke32 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #ifndef sounds_mapster32_h_ #define sounds_mapster32_h_ #include "build.h" #include "sounds_common.h" #pragma pack(push,1) /// vvv sound structs from duke3d.h typedef struct { int32_t voice; int32_t ow; } SOUNDOWNER; typedef struct { char *filename, *ptr; int32_t length, num, soundsiz; SOUNDOWNER SoundOwner[4]; int16_t ps,pe,vo; char pr,m; volatile char lock; char *definedname; // new } sound_t; #define MAXSOUNDS 4096 extern sound_t g_sounds[MAXSOUNDS]; extern int32_t g_numEnvSoundsPlaying; extern int32_t NumVoices; int32_t S_SoundStartup(void); void S_SoundShutdown(void); int32_t S_PlaySound3D(int32_t, int32_t, const vec3_t*); void S_PlaySound(int32_t); int32_t A_PlaySound(uint32_t num, int32_t i); void S_StopSound(int32_t num); void S_StopEnvSound(int32_t num,int32_t i); void S_Update(void); int32_t A_CheckSoundPlaying(int32_t i, int32_t num); int32_t S_CheckSoundPlaying(int32_t i, int32_t num); void S_ClearSoundLocks(void); int32_t S_SoundsPlaying(int32_t i); int32_t S_InvalidSound(int32_t num); int32_t S_SoundFlags(int32_t num); #pragma pack(pop) #endif
/********************************************************************** * * Copyright (C) Imagination Technologies Ltd. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions 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, except * as otherwise stated in writing, 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. * * The full GNU General Public License is included in this distribution in * the file called "COPYING". * * Contact Information: * Imagination Technologies Ltd. <gpl-support@imgtec.com> * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK * ******************************************************************************/ #ifndef __INCLUDED_PRIVATE_DATA_H_ #define __INCLUDED_PRIVATE_DATA_H_ #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT) #include <linux/list.h> #include <drm/drmP.h> #endif typedef struct { IMG_UINT32 ui32OpenPID; #if defined (SUPPORT_SID_INTERFACE) IMG_SID hKernelMemInfo; #else IMG_HANDLE hKernelMemInfo; #endif #if defined(SUPPORT_DRI_DRM) && defined(PVR_SECURE_DRM_AUTH_EXPORT) struct list_head sDRMAuthListItem; struct drm_file *psDRMFile; #endif #if defined(SUPPORT_MEMINFO_IDS) IMG_UINT64 ui64Stamp; #endif IMG_HANDLE hBlockAlloc; #if defined(SUPPORT_DRI_DRM_EXT) IMG_PVOID pPriv; #endif } PVRSRV_FILE_PRIVATE_DATA; #endif
#include <stdio.h> #include <stdlib.h> int len; struct foo { char* p; char c; char* pad; int x; } * d; char* str; int main(int argc, char** argv) { struct foo bar, *ptr; char c = '1'; int i; str = "I am a String!\n"; len = 10; bar.x = 1; struct foo* p = &bar; p->c = 'a'; // FIXME: 32-bit only if (*(int*)((void*)p + sizeof(struct foo) - 4) != bar.x) exit(-1); printf("%zu\n", sizeof(struct foo)); printf("%c\n", bar.c); d = malloc(sizeof(struct foo) * len); ptr = d; for (i = 0; i < len; ++i) { ptr->p = "one"; ptr->pad = str; ptr->x = i; ptr->c = c; ++ptr; ++c; } ptr = d; for (i = 0; i < len; ++i) { printf("%d------------\n", i); printf("%s\n", ptr->p); printf("%s\n", ptr->pad); printf("%d\n", ptr->x); printf("%c\n", ptr->c); printf("--------------\n"); ++ptr; } ptr = d; for (i = 0; i < len; ++i) { printf("%d------------\n", i); printf("%s\n", (*ptr).p); printf("%s\n", (*ptr).pad); printf("%d\n", (*ptr).x); printf("%c\n", (*ptr).c); printf("--------------\n"); ++ptr; } return 0; }
/* This file originates from the linux kernel provided in Samsung's YP-R0 Open * Source package. */ /* * Bigbang project * Copyright (c) 2009 VPS R&D Group, Samsung Electronics, Inc. * All rights reserved. */ /** * This file defines data structures and APIs for Freescale SC900776 * * @name sc900776.h * @author Eung Chan Kim (eungchan.kim@samsung.com) * @version 0.1 * @see */ #ifndef __SC900776_H__ #define __SC900776_H__ typedef enum { SC900776_DEVICE_ID = 0x01, /* 01h R */ SC900776_CONTROL, /* 02h R/W */ SC900776_INTERRUPT1, /* 03h R/C */ SC900776_INTERRUPT2, /* 04h R/C */ SC900776_INTERRUPT_MASK1, /* 05h R/W */ SC900776_INTERRUPT_MASK2, /* 06h R/W */ SC900776_ADC_RESULT, /* 07h R */ SC900776_TIMING_SET1, /* 08h R/W */ SC900776_TIMING_SET2, /* 09h R/W */ SC900776_DEVICE_TYPE1, /* 0Ah R */ SC900776_DEVICE_TYPE2, /* 0Bh R */ SC900776_BUTTON1, /* 0Ch R/C */ SC900776_BUTTON2, /* 0Dh R/C */ /* 0Eh ~ 12h : reserved */ SC900776_MANUAL_SWITCH1 = 0x13, /* 13h R/W */ SC900776_MANUAL_SWITCH2, /* 14h R/W */ /* 15h ~ 1Fh : reserved */ SC900776_FSL_STATUS = 0x20, /* 20h R */ SC900776_FSL_CONTROL, /* 21h R/W */ SC900776_TIME_DELAY, /* 22h R/W */ SC900776_DEVICE_MODE, /* 23h R/W */ SC900776_REG_MAX } eSc900776_register_t; typedef enum { DEVICETYPE1_UNDEFINED = 0, DEVICETYPE1_USB, // 0x04 0x00 // normal usb cable & ad200 DEVICETYPE1_DEDICATED, // 0x40 0x00 // dedicated charger cable DEVICETYPE2_JIGUARTON, // 0x00 0x08 // Anygate_UART jig DEVICETYPE2_JIGUSBOFF, // 0x00 0x01 // USB jig(AS center) DEVICETYPE2_JIGUSBON, // 0x00 0x02 // Anygate_USB jig with boot-on, not tested } eMinivet_device_t; /* * sc900776 register bit definitions */ #define MINIVET_DEVICETYPE1_USBOTG 0x80 /* 1: a USBOTG device is attached */ #define MINIVET_DEVICETYPE1_DEDICATED 0x40 /* 1: a dedicated charger is attached */ #define MINIVET_DEVICETYPE1_USBCHG 0x20 /* 1: a USB charger is attached */ #define MINIVET_DEVICETYPE1_5WCHG 0x10 /* 1: a 5-wire charger (type 1 or 2) is attached */ #define MINIVET_DEVICETYPE1_UART 0x08 /* 1: a UART cable is attached */ #define MINIVET_DEVICETYPE1_USB 0x04 /* 1: a USB host is attached */ #define MINIVET_DEVICETYPE1_AUDIO2 0x02 /* 1: an audio accessory type 2 is attached */ #define MINIVET_DEVICETYPE1_AUDIO1 0x01 /* 1: an audio accessory type 1 is attached */ #define MINIVET_DEVICETYPE2_AV 0x40 /* 1: an audio/video cable is attached */ #define MINIVET_DEVICETYPE2_TTY 0x20 /* 1: a TTY converter is attached */ #define MINIVET_DEVICETYPE2_PPD 0x10 /* 1: a phone powered device is attached */ #define MINIVET_DEVICETYPE2_JIGUARTON 0x08 /* 1: a UART jig cable with the BOOT-on option is attached */ #define MINIVET_DEVICETYPE2_JIGUARTOFF 0x04 /* 1: a UART jig cable with the BOOT-off option is attached */ #define MINIVET_DEVICETYPE2_JIGUSBON 0x02 /* 1: a USB jig cable with the BOOT-on option is attached */ #define MINIVET_DEVICETYPE2_JIGUSBOFF 0x01 /* 1: a USB jig cable with the BOOT-off option is attached */ #define MINIVET_FSLSTATUS_FETSTATUS 0x40 /* 1: The on status of the power MOSFET */ #define MINIVET_FSLSTATUS_IDDETEND 0x20 /* 1: ID resistance detection finished */ #define MINIVET_FSLSTATUS_VBUSDETEND 0x10 /* 1: VBUS power supply type identification completed */ #define MINIVET_FSLSTATUS_IDGND 0x08 /* 1: ID pin is shorted to ground */ #define MINIVET_FSLSTATUS_IDFLOAT 0x04 /* 1: ID line is floating */ #define MINIVET_FSLSTATUS_VBUSDET 0x02 /* 1: VBUS voltage is higher than the POR */ #define MINIVET_FSLSTATUS_ADCSTATUS 0x01 /* 1: ADC conversion completed */ #define SC900776_I2C_SLAVE_ADDR 0x25 typedef struct { unsigned char addr; unsigned char value; }__attribute__((packed)) sMinivet_t; #define DRV_IOCTL_MINIVET_MAGIC 'M' typedef enum { E_IOCTL_MINIVET_INIT = 0, E_IOCTL_MINIVET_WRITE_BYTE, E_IOCTL_MINIVET_READ_BYTE, E_IOCTL_MINIVET_DET_VBUS, E_IOCTL_MINIVET_MANUAL_USB, E_IOCTL_MINIVET_MANUAL_UART, E_IOCTL_MINIVET_MAX } eSc900776_ioctl_t; #define IOCTL_MINIVET_INIT _IO(DRV_IOCTL_MINIVET_MAGIC, E_IOCTL_MINIVET_INIT) #define IOCTL_MINIVET_WRITE_BYTE _IOW(DRV_IOCTL_MINIVET_MAGIC, E_IOCTL_MINIVET_WRITE_BYTE, sMinivet_t) #define IOCTL_MINIVET_READ_BYTE _IOR(DRV_IOCTL_MINIVET_MAGIC, E_IOCTL_MINIVET_READ_BYTE, sMinivet_t) #define IOCTL_MINIVET_DET_VBUS _IO(DRV_IOCTL_MINIVET_MAGIC, E_IOCTL_MINIVET_DET_VBUS) #define IOCTL_MINIVET_MANUAL_USB _IO(DRV_IOCTL_MINIVET_MAGIC, E_IOCTL_MINIVET_MANUAL_USB) #define IOCTL_MINIVET_MANUAL_UART _IO(DRV_IOCTL_MINIVET_MAGIC, E_IOCTL_MINIVET_MANUAL_UART) #ifndef __MINIVET_ENUM__ #define __MINIVET_ENUM__ enum { EXT_PWR_UNPLUGGED = 0, EXT_PWR_PLUGGED, EXT_PWR_NOT_OVP, EXT_PWR_OVP, }; #endif /* __MINIVET_ENUM__ */ #endif /* __MINIVET_IOCTL_H__ */
/* * motors.h * * Specifies motor ports. */ #ifndef MOTORS_H_ #define MOTORS_H_ // Drive Motors #define driveBackLeft 1 #define driveBackRight 10 #define driveMiddleLeft 2 #define driveMiddleRight 9 #define driveFrontLeft 3 #define driveFrontRight 8 // Lift Motors #define liftLeft 4 /* power expander (A) */ #define liftRight 7 /* power expander (B) */ // Intake/Manipulator Motors #define intakeLeft 5 #define intakeRight 6 #define potLiftLeft 1 #define potLiftRight 2 #define imeDriveLeft 0 #define imeDriveRight 1 #define gyro 1 #define hookPiston 1 #define winchPiston 2 #endif /* MOTORS_H_ */
/* *-------------------------------------------------------------------------- * File Name: global.h * * Author: Zhao Yanbai [zhaoyanbai@126.com] * Sat Jan 23 14:12:40 2010 * * Description: none * *-------------------------------------------------------------------------- */ #ifndef _GLOBAL_H #define _GLOBAL_H #ifndef __STRING #define __STRING(x) #x #endif #endif //_GLOBAL_H
#ifndef __VFMW_SEC_SHARE_H__ #define __VFMW_SEC_SHARE_H__ #include "vfmw.h" // Interface of SEC Share SINT32 SEC_ShareZone_Init(UINT32 Share); VOID SEC_ShareZone_Exit(VOID); SINT32 SEC_EventReport(SINT32 ChanID, SINT32 Type, VOID* pArgs, UINT32 Len); SINT32 SEC_ReadRawStream(SINT32 InstID, STREAM_DATA_S *pRawPacket); SINT32 SEC_ReleaseRawStream(SINT32 InstID, STREAM_DATA_S *pRawPacket); SINT32 SEC_ControlAdjust(SINT32 ChanID, VDEC_CID_E eCmdID, VOID *pArgs); SINT32 SEC_ControlConverse(SINT32 ChanID, VDEC_CID_E eCmdID, VOID *pArgs); SINT32 SEC_Buffer_Handler(SINT32 ChanID, SINT32 Type, VOID *pArgs); SINT32 SEC_ReadProc(SINT8 *Page, SINT32 Count); SINT32 SEC_WriteProc(UINT32 Option, SINT32 Value); #endif
/* ** Job Arranger for ZABBIX ** Copyright (C) 2012 FitechForce, Inc. 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 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. **/ /* ** $Date:: 2013-04-17 13:03:22 +0900 #$ ** $Revision: 4412 $ ** $Author: ossinfra@FITECHLABS.CO.JP $ **/ #ifndef JOBARG_LISTENER_H #define JOBARG_LISTENER_H #include "threads.h" extern char *CONFIG_HOSTS_ALLOWED; extern int CONFIG_TIMEOUT; extern char *CONFIG_HOSTNAME; ZBX_THREAD_ENTRY(listener_thread, args); #endif
// ************************************************************************* // // Copyright 2004-2010 Bruno PAGES . // // This file is part of the BOUML Uml Toolkit. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // e-mail : bouml@free.fr // home : http://bouml.free.fr // // ************************************************************************* #ifndef CODMSGSUPPORT_H #define CODMSGSUPPORT_H #include <qlist.h> #include "Settings.h" #include "ColMsg.h" class QString; class QTextStream; class CodObjCanvas; class BrowserNode; class CodMsgSupport { protected: ColMsgList msgs; CollaborationDiagramSettings settings; public: CodMsgSupport(){}; virtual ~CodMsgSupport(); ColMsgList & get_msgs() { return msgs; }; void delete_it(ColMsgList & top); virtual void remove_it(ColMsg * msg) = 0; virtual void save(QTextStream & st, bool ref, QString & warning) const = 0; virtual void get_from_to(CodObjCanvas *& from, CodObjCanvas *& to, bool forward) = 0; virtual void update_msgs() = 0; virtual bool copyable() const = 0; bool supports(BrowserNode *); }; #endif
/* -*- c++ -*- capabilities.h This file is part of tdeio_smtp, the KDE SMTP tdeioslave. Copyright (c) 2003 Marc Mutz <mutz@kde.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. 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 In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __KIOSMTP_CAPABILITIES_H__ #define __KIOSMTP_CAPABILITIES_H__ #include <tqmap.h> #include <tqcstring.h> #include <tqstring.h> #include <tqstringlist.h> class TQStrIList; namespace KioSMTP { class Response; class Capabilities { public: Capabilities() {} static Capabilities fromResponse( const Response & response ); void add( const TQString & cap, bool replace=false ); void add( const TQString & name, const TQStringList & args, bool replace=false ); void clear() { mCapabilities.clear(); } bool have( const TQString & cap ) const { return mCapabilities.find( cap.upper() ) != mCapabilities.end(); } bool have( const TQCString & cap ) const { return have( TQString( cap.data() ) ); } bool have( const char * cap ) const { return have( TQString::fromLatin1( cap ) ); } TQString asMetaDataString() const; TQString authMethodMetaData() const; TQStrIList saslMethods() const; TQString createSpecialResponse( bool tls ) const; TQStringList saslMethodsQSL() const; private: TQMap<TQString,TQStringList> mCapabilities; }; } // namespace KioSMTP #endif // __KIOSMTP_CAPABILITIES_H__
// // NAGGameScene.h // Miner // // Created by AndrewShmig on 5/25/14. // Copyright (c) 2014 Non Atomic Games. All rights reserved. // @import SpriteKit; @interface NAGGameScene : SKScene @end
#include "stdafx.h" #include "Wuapi.h" #include <iostream> #include <ATLComTime.h> using namespace std; // VARIABLE DECLARATIONS PVOID OldValue = NULL; // system code to be run (after arch detection) void mainCode(bool aMode, bool guiMC) { if(guiMC == true) { // GUI mode system("wusa /uninstall /kb:3035583"); } else if (guiMC == false) { // console mode system("wusa /uninstall /kb:3035583 /quiet /norestart"); } system("TASKKILL /IM GWX.EXE /T /F"); if(aMode == true) { // advanced mode code goes here // take ownership of %windir%\System32\GWX\ and delete contents system("takeown /f %windir%\\System32\\GWX\\ /R /D Y"); system("ATTRIB -S %windir%\\System32\\GWX\\* /S /D"); system("DEL /F /Q %windir%\\System32\\GWX\\* /S"); system("ATTRIB +R %windir%\\System32\\GWX\\* /S /D"); } // hide update } // WoW64 Detection: typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); LPFN_ISWOW64PROCESS fnIsWow64Process; BOOL IsWow64() { BOOL bIsWow64 = FALSE; //IsWow64Process is not available on all supported versions of Windows. //Use GetModuleHandle to get a handle to the DLL that contains the function //and GetProcAddress to get a pointer to the function if available. fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress( GetModuleHandle(TEXT("kernel32")),"IsWow64Process"); if(NULL != fnIsWow64Process) { if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { //handle error } } return bIsWow64; } // main logic function (for both CMD and GUI use) void run(bool aMode, bool gui) { // aMode is a boolean that determines advanced mode. Should be declared before calling run(); OSVERSIONINFO osvi; BOOL bIsSupported; ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osvi); bIsSupported = ( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 1) || ( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 2) || ( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 3) ))); // run code if(bIsSupported) // Windows 7 or Windows 8.1 { if(IsWow64()) // 64-bit Windows (WoW64) { if( Wow64DisableWow64FsRedirection(&OldValue) ) { // Anything in this block uses the system native files and not the WoW64 ones // put native WoW64 code here mainCode(aMode, gui); //system("wusa /?"); // use this for testing // Immediately re-enable redirection. Note that any resources // associated with OldValue are cleaned up by this call. if ( FALSE == Wow64RevertWow64FsRedirection(OldValue) ) { // Failure to re-enable redirection should be considered // a criticial failure and execution aborted. } } } else // 32-bit Windows (or native x64) { // actually run wusa mainCode(aMode, gui); } } else { // unsupported OS message box (XP/Vista/8 RTM) if being run from a gui // unsupported message in console if being run from CMD if(gui == true) { MessageBox(NULL, "This applicatiion requires Windows 7 SP1 or Windows 8.1", "Unsupported Operating System", MB_ICONWARNING | MB_OK); } else { cout << "This applicatiion requires Windows 7 SP1 or Windows 8.1" << endl; } } // run the "hide update" dialog if(bIsSupported == true && gui == true) { CDialog hideDlg(IDD_HIDEUPDATE); // Create and show the dialog box INT_PTR oRet = -1; oRet = hideDlg.DoModal(); } }
/******************** (C) COPYRIGHT 2011 STMicroelectronics ******************** * File Name : usb_pwr.h * Author : MCD Application Team * Version : V3.3.0 * Date : 21-March-2011 * Description : Connection/disconnection & power management header ******************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USB_PWR_H #define __USB_PWR_H /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ typedef enum _RESUME_STATE { RESUME_EXTERNAL, RESUME_INTERNAL, RESUME_LATER, RESUME_WAIT, RESUME_START, RESUME_ON, RESUME_OFF, RESUME_ESOF } RESUME_STATE; typedef enum _DEVICE_STATE { UNCONNECTED, ATTACHED, POWERED, SUSPENDED, ADDRESSED, CONFIGURED } DEVICE_STATE; /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void Suspend(void); void Resume_Init(void); void Resume(RESUME_STATE eResumeSetVal); RESULT PowerOn(void); RESULT PowerOff(void); /* External variables --------------------------------------------------------*/ extern __IO uint32_t bDeviceState; /* USB device status */ extern __IO bool fSuspendEnabled; /* true when suspend is possible */ #endif /*__USB_PWR_H*/ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
inline UINT EncodingToCodePage( char * encoding ) { if( stricmp(encoding,"utf8") == 0 || stricmp(encoding,"utf-8") == 0 ) return CP_UTF8; else if( stricmp(encoding,"iso-8859-1") == 0 || stricmp(encoding,"iso8859-1") == 0 ) return 28591; else if( stricmp(encoding,"iso-8859-2") == 0 || stricmp(encoding,"iso8859-2") == 0 ) return 28592; else if( stricmp(encoding,"iso-8859-3") == 0 || stricmp(encoding,"iso8859-3") == 0 ) return 28593; else if( stricmp(encoding,"iso-8859-4") == 0 || stricmp(encoding,"iso8859-4") == 0 ) return 28594; else if( stricmp(encoding,"iso-8859-5") == 0 || stricmp(encoding,"iso8859-5") == 0 ) return 28595; else if( stricmp(encoding,"iso-8859-6") == 0 || stricmp(encoding,"iso8859-6") == 0 ) return 28596; else if( stricmp(encoding,"iso-8859-7") == 0 || stricmp(encoding,"iso8859-7") == 0 ) return 28597; else if( stricmp(encoding,"iso-8859-8") == 0 || stricmp(encoding,"iso8859-8") == 0 ) return 28598; else if( stricmp(encoding,"iso-8859-9") == 0 || stricmp(encoding,"iso8859-9") == 0 ) return 28599; else if( stricmp(encoding,"iso-8859-13") == 0 || stricmp(encoding,"iso8859-13") == 0 ) return 28603; else if( stricmp(encoding,"iso-8859-15") == 0 || stricmp(encoding,"iso8859-15") == 0 ) return 28605; else if( stricmp(encoding,"windows-1250") == 0 || stricmp(encoding,"microsoft-cp1250") == 0 ) return 1250; else if( stricmp(encoding,"windows-1251") == 0 || stricmp(encoding,"microsoft-cp1251") == 0 ) return 1251; else if( stricmp(encoding,"windows-1252") == 0 || stricmp(encoding,"microsoft-cp1252") == 0 ) return 1252; else if( stricmp(encoding,"windows-1253") == 0 || stricmp(encoding,"microsoft-cp1253") == 0 ) return 1253; else if( stricmp(encoding,"windows-1254") == 0 || stricmp(encoding,"microsoft-cp1254") == 0 ) return 1254; else if( stricmp(encoding,"windows-1255") == 0 || stricmp(encoding,"microsoft-cp1255") == 0 ) return 1255; else if( stricmp(encoding,"windows-1256") == 0 || stricmp(encoding,"microsoft-cp1256") == 0 ) return 1256; else if( stricmp(encoding,"windows-1257") == 0 || stricmp(encoding,"microsoft-cp1257") == 0 ) return 1257; else if( stricmp(encoding,"windows-1258") == 0 || stricmp(encoding,"microsoft-cp1258") == 0 ) return 1258; else if( stricmp(encoding,"windows-1259") == 0 || stricmp(encoding,"microsoft-cp1259") == 0 ) return 1259; else if( stricmp(encoding,"koi8-r") == 0 || stricmp(encoding,"koi8-u") == 0 ) return 20866; else return 1252; }
#include <linux/wait.h> #include <linux/timer.h> struct lbtf_private; #define CMD_TYPE_REQUEST 0xF00DFACE #define CMD_TYPE_DATA 0xBEADC0DE #define CMD_TYPE_INDICATION 0xBEEFFACE #define BOOT_CMD_FW_BY_USB 0x01 #define BOOT_CMD_FW_IN_EEPROM 0x02 #define BOOT_CMD_UPDATE_BOOT2 0x03 #define BOOT_CMD_UPDATE_FW 0x04 #define BOOT_CMD_MAGIC_NUMBER 0x4C56524D struct bootcmd { __le32 magic; uint8_t cmd; uint8_t pad[11]; }; #define BOOT_CMD_RESP_OK 0x0001 #define BOOT_CMD_RESP_FAIL 0x0000 struct bootcmdresp { __le32 magic; uint8_t cmd; uint8_t result; uint8_t pad[2]; }; struct if_usb_card { struct usb_device *udev; struct urb *rx_urb, *tx_urb, *cmd_urb; struct lbtf_private *priv; struct sk_buff *rx_skb; uint8_t ep_in; uint8_t ep_out; int8_t bootcmdresp; int ep_in_size; void *ep_out_buf; int ep_out_size; const struct firmware *fw; struct timer_list fw_timeout; wait_queue_head_t fw_wq; uint32_t fwseqnum; uint32_t totalbytes; uint32_t fwlastblksent; uint8_t CRC_OK; uint8_t fwdnldover; uint8_t fwfinalblk; __le16 boot2_version; }; struct fwheader { __le32 dnldcmd; __le32 baseaddr; __le32 datalength; __le32 CRC; }; #define FW_MAX_DATA_BLK_SIZE 600 struct fwdata { struct fwheader hdr; __le32 seqnum; uint8_t data[0]; }; struct fwsyncheader { __le32 cmd; __le32 seqnum; }; #define FW_HAS_DATA_TO_RECV 0x00000001 #define FW_HAS_LAST_BLOCK 0x00000004
//******************************************************************************* // COPYRIGHT NOTES // --------------- // This is a part of BCGControlBar Library Professional Edition // Copyright (C) 1998-2010 BCGSoft Ltd. // All rights reserved. // // This source code can be used, distributed or modified // only under terms and conditions // of the accompanying license agreement. //******************************************************************************* // // BCGPProgressCtrl.h : header file // #if !defined(AFX_BCGPPROGRESSCTRL_H__23E0C43A_6498_403C_AB8F_7A395D9C2FA4__INCLUDED_) #define AFX_BCGPPROGRESSCTRL_H__23E0C43A_6498_403C_AB8F_7A395D9C2FA4__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "BCGCBPro.h" ///////////////////////////////////////////////////////////////////////////// // CBCGPProgressCtrl window class BCGCBPRODLLEXPORT CBCGPProgressCtrl : public CProgressCtrl { DECLARE_DYNAMIC(CBCGPProgressCtrl) // Construction public: CBCGPProgressCtrl(); // Attributes public: BOOL m_bOnGlass; BOOL m_bVisualManagerStyle; // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CBCGPProgressCtrl) //}}AFX_VIRTUAL // Implementation public: virtual ~CBCGPProgressCtrl(); // Generated message map functions protected: //{{AFX_MSG(CBCGPProgressCtrl) afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnPaint(); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); afx_msg void OnNcPaint(); //}}AFX_MSG afx_msg LRESULT OnBCGSetControlVMMode (WPARAM, LPARAM); afx_msg LRESULT OnBCGSetControlAero (WPARAM, LPARAM); DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_BCGPPROGRESSCTRL_H__23E0C43A_6498_403C_AB8F_7A395D9C2FA4__INCLUDED_)
/* SPDX-License-Identifier: GPL-2.0-only */ #include <console/console.h> #include <bootmode.h> #include <boot/coreboot_tables.h> #include <device/device.h> #include <southbridge/intel/bd82x6x/pch.h> #include <southbridge/intel/common/gpio.h> #include <ec/quanta/ene_kb3940q/ec.h> #include <vendorcode/google/chromeos/chromeos.h> #include "ec.h" #define WP_GPIO 6 #define DEVMODE_GPIO 54 #define FORCE_RECOVERY_MODE 0 void fill_lb_gpios(struct lb_gpios *gpios) { struct lb_gpio chromeos_gpios[] = { /* lid switch value from EC */ {-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, /* Power Button - Hardcode Low as power button may still be * pressed when read here.*/ {-1, ACTIVE_HIGH, 0, "power"}, /* Was VGA Option ROM loaded? */ /* -1 indicates that this is a pseudo GPIO */ {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, }; lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); } int get_write_protect_state(void) { return !get_gpio(WP_GPIO); } int get_lid_switch(void) { return (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1; } int get_recovery_mode_switch(void) { int ec_rec_mode = 0; if (FORCE_RECOVERY_MODE) { printk(BIOS_DEBUG, "FORCING RECOVERY MODE.\n"); return 1; } if (ENV_RAMSTAGE) { if (ec_mem_read(EC_CODE_STATE) == EC_COS_EC_RO) ec_rec_mode = 1; printk(BIOS_DEBUG, "RECOVERY MODE FROM EC: %x\n", ec_rec_mode); } return ec_rec_mode; } static const struct cros_gpio cros_gpios[] = { CROS_GPIO_REC_AH(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), CROS_GPIO_WP_AL(WP_GPIO, CROS_GPIO_DEVICE_NAME), }; void mainboard_chromeos_acpi_generate(void) { // TODO: MLR // The firmware read/write status is a "virtual" switch and // will be handled elsewhere. Until then hard-code to // read/write instead of read-only for developer mode. if (CONFIG(CHROMEOS_NVS)) chromeos_set_ecfw_rw(); chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); } int get_ec_is_trusted(void) { /* Do not have a Chrome EC involved in entering recovery mode; Always return trusted. */ return 1; }
//===--- DiagnosticDriver.h - Diagnostics for libdriver ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_DRIVERDIAGNOSTIC_H #define LLVM_CLANG_DRIVERDIAGNOSTIC_H #include "clang/Basic/Diagnostic.h" namespace clang { namespace diag { enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM, #define DRIVERSTART #include "clang/Basic/DiagnosticDriverKinds.inc" #undef DIAG NUM_BUILTIN_DRIVER_DIAGNOSTICS }; } // end namespace diag } // end namespace clang #endif
/* * Minion http://minion.sourceforge.net * Copyright (C) 2006-09 * * 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. */ /* * linked_ptr - simple reference linked pointer * (like reference counting, just using a linked list of the references * instead of their count.) * * The implementation stores three pointers for every linked_ptr, but * does not allocate anything on the free store. */ #ifndef LINKED_PTR_H #define LINKED_PTR_H template <class X> class minion_shared_ptr { public: #define TEMPLATE_FUNCTION template <class Y> TEMPLATE_FUNCTION friend class minion_shared_ptr; typedef X element_type; explicit minion_shared_ptr(X* p = 0) throw() : itsPtr(p) {itsPrev = itsNext = this;} ~minion_shared_ptr() {release();} minion_shared_ptr(const minion_shared_ptr& r) throw() {acquire(r);} minion_shared_ptr& operator=(const minion_shared_ptr& r) { if (this != &r) { release(); acquire(r); } return *this; } #ifdef PRIV template <class Y> friend class minion_shared_ptr; #endif template <class Y> minion_shared_ptr(const minion_shared_ptr<Y>& r) throw() {acquire(r);} template <class Y> minion_shared_ptr& operator=(const minion_shared_ptr<Y>& r) { if (this != &r) { release(); acquire(r); } return *this; } X& operator*() const throw() {return *itsPtr;} X* operator->() const throw() {return itsPtr;} X* get() const throw() {return itsPtr;} bool unique() const throw() {return itsPrev ? itsPrev==this : true;} #ifdef PRIV private: #endif X* itsPtr; mutable const minion_shared_ptr* itsPrev; mutable const minion_shared_ptr* itsNext; void acquire(const minion_shared_ptr& r) throw() { // insert this to the list itsPtr = r.itsPtr; itsNext = r.itsNext; itsNext->itsPrev = this; itsPrev = &r; r.itsNext = this; } template <class Y> void acquire(const minion_shared_ptr<Y>& r) throw() { // insert this to the list itsPtr = r.itsPtr; itsNext = r.itsNext; itsNext->itsPrev = this; itsPrev = &r; r.itsNext = this; } void release() { // erase this from the list, delete if unique if (unique()) delete itsPtr; else { itsPrev->itsNext = itsNext; itsNext->itsPrev = itsPrev; itsPrev = itsNext = 0; } itsPtr = 0; } }; template<typename T> bool operator<(const minion_shared_ptr<T>& lhs, const minion_shared_ptr<T>& rhs) { return lhs.get() < rhs.get(); } template<typename T> bool operator==(const minion_shared_ptr<T>& lhs, const minion_shared_ptr<T>& rhs) { return lhs.get() == rhs.get(); } #endif // LINKED_PTR_H
/* * Copyright 2015 Linaro Limited * * 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. */ #ifndef _DT_BINDINGS_CLK_MSM_RPMCC_H #define _DT_BINDINGS_CLK_MSM_RPMCC_H /* msm8916 */ #define RPM_XO_CLK_SRC 0 #define RPM_XO_A_CLK_SRC 1 #define RPM_PCNOC_CLK 2 #define RPM_PCNOC_A_CLK 3 #define RPM_SNOC_CLK 4 #define RPM_SNOC_A_CLK 5 #define RPM_BIMC_CLK 6 #define RPM_BIMC_A_CLK 7 #define RPM_QDSS_CLK 8 #define RPM_QDSS_A_CLK 9 #define RPM_BB_CLK1 10 #define RPM_BB_CLK1_A 11 #define RPM_BB_CLK2 12 #define RPM_BB_CLK2_A 13 #define RPM_RF_CLK1 14 #define RPM_RF_CLK1_A 15 #define RPM_RF_CLK2 16 #define RPM_RF_CLK2_A 17 #define RPM_BB_CLK1_PIN 18 #define RPM_BB_CLK1_A_PIN 19 #define RPM_BB_CLK2_PIN 20 #define RPM_BB_CLK2_A_PIN 21 #define RPM_RF_CLK1_PIN 22 #define RPM_RF_CLK1_A_PIN 23 #define RPM_RF_CLK2_PIN 24 #define RPM_RF_CLK2_A_PIN 25 #define RPM_AGGR1_NOC_CLK 26 #define RPM_AGGR1_NOC_A_CLK 27 #define RPM_AGGR2_NOC_CLK 28 #define RPM_AGGR2_NOC_A_CLK 29 #define RPM_CNOC_CLK 30 #define RPM_CNOC_A_CLK 31 #define RPM_MMAXI_CLK 32 #define RPM_MMAXI_A_CLK 33 #define RPM_IPA_CLK 34 #define RPM_IPA_A_CLK 35 #define RPM_CE1_CLK 36 #define RPM_CE1_A_CLK 37 #define RPM_DIV_CLK1 38 #define RPM_DIV_CLK1_AO 39 #define RPM_DIV_CLK2 40 #define RPM_DIV_CLK2_AO 41 #define RPM_DIV_CLK3 42 #define RPM_DIV_CLK3_AO 43 #define RPM_LN_BB_CLK 44 #define RPM_LN_BB_A_CLK 45 #endif
/* SPDX-License-Identifier: LGPL-2.1+ */ #include "alloc-util.h" #include "fd-util.h" #include "escape.h" #include "libmount-util.h" #include "tests.h" static void test_libmount_unescaping_one( const char *title, const char *string, bool may_fail, const char *expected_source, const char *expected_target) { /* A test for libmount really */ int r; log_info("/* %s %s */", __func__, title); _cleanup_(mnt_free_tablep) struct libmnt_table *table = NULL; _cleanup_(mnt_free_iterp) struct libmnt_iter *iter = NULL; _cleanup_fclose_ FILE *f = NULL; assert_se(table = mnt_new_table()); assert_se(iter = mnt_new_iter(MNT_ITER_FORWARD)); f = fmemopen((char*) string, strlen(string), "re"); assert_se(f); assert_se(mnt_table_parse_stream(table, f, title) >= 0); struct libmnt_fs *fs; const char *source, *target; _cleanup_free_ char *x = NULL, *cs = NULL, *s = NULL, *ct = NULL, *t = NULL; /* We allow this call and the checks below to fail in some cases. See the case definitions below. */ r = mnt_table_next_fs(table, iter, &fs); if (r != 0 && may_fail) { log_error_errno(r, "mnt_table_next_fs failed: %m"); return; } assert_se(r == 0); assert_se(x = cescape(string)); assert_se(source = mnt_fs_get_source(fs)); assert_se(target = mnt_fs_get_target(fs)); assert_se(cs = cescape(source)); assert_se(ct = cescape(target)); assert_se(cunescape(source, UNESCAPE_RELAX, &s) >= 0); assert_se(cunescape(target, UNESCAPE_RELAX, &t) >= 0); log_info("from '%s'", x); log_info("source: '%s'", source); log_info("source: '%s'", cs); log_info("source: '%s'", s); log_info("expected: '%s'", strna(expected_source)); log_info("target: '%s'", target); log_info("target: '%s'", ct); log_info("target: '%s'", t); log_info("expected: '%s'", strna(expected_target)); assert_se(may_fail || streq(source, expected_source)); assert_se(may_fail || streq(target, expected_target)); assert_se(mnt_table_next_fs(table, iter, &fs) == 1); } static void test_libmount_unescaping(void) { test_libmount_unescaping_one( "escaped space + utf8", "729 38 0:59 / /tmp/„zupa\\040zębowa” rw,relatime shared:395 - tmpfs die\\040Brühe rw,seclabel", false, "die Brühe", "/tmp/„zupa zębowa”" ); test_libmount_unescaping_one( "escaped newline", "729 38 0:59 / /tmp/x\\012y rw,relatime shared:395 - tmpfs newline rw,seclabel", false, "newline", "/tmp/x\ny" ); /* The result of "mount -t tmpfs '' /tmp/emptysource". * This will fail with libmount <= v2.33. * See https://github.com/karelzak/util-linux/commit/18a52a5094. */ test_libmount_unescaping_one( "empty source", "760 38 0:60 / /tmp/emptysource rw,relatime shared:410 - tmpfs rw,seclabel", true, "", "/tmp/emptysource" ); /* The kernel leaves \r as is. * Also see https://github.com/karelzak/util-linux/issues/780. */ test_libmount_unescaping_one( "foo\\rbar", "790 38 0:61 / /tmp/foo\rbar rw,relatime shared:425 - tmpfs tmpfs rw,seclabel", true, "tmpfs", "/tmp/foo\rbar" ); } int main(int argc, char *argv[]) { test_setup_logging(LOG_DEBUG); test_libmount_unescaping(); return 0; }
/* * uics8900.c - CS8900 submenu * * Written by * Bas Wassink <b.wassink@ziggo.nl> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * 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 "vice.h" #include <stdio.h> #include "lib.h" #include "util.h" #include "cartridge.h" #include "uiapi.h" #include "uicartridge.h" #include "uilib.h" #include "uimenu.h" #include "uics8900.h" /** \brief Callback for setting the ethernet interface */ static UI_CALLBACK(uics8900_set_interface_name) { char *name = util_concat(_("Name"), ":", NULL); uilib_select_string((char *)UI_MENU_CB_PARAM, _("Ethernet interface"), name); lib_free(name); } ui_menu_entry_t uics8900_submenu[] = { { N_("Interface"), UI_MENU_TYPE_DOTS, (ui_callback_t)uics8900_set_interface_name, (ui_callback_data_t)"ETHERNET_INTERFACE", NULL, (ui_keysym_t)0, (ui_hotkey_modifier_t)0 }, UI_MENU_ENTRY_LIST_END };
/* * Copyright (C) 2008 The Android Open Source Project * 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. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _SYS_KLOG_H_ #define _SYS_KLOG_H_ #include <sys/cdefs.h> __BEGIN_DECLS #define KLOG_CLOSE 0 #define KLOG_OPEN 1 #define KLOG_READ 2 #define KLOG_READ_ALL 3 #define KLOG_READ_CLEAR 4 #define KLOG_CLEAR 5 #define KLOG_DISABLE 6 #define KLOG_ENABLE 7 #define KLOG_SETLEVEL 8 #define KLOG_UNREADSIZE 9 #define KLOG_WRITE 10 extern int klogctl(int, char *, int); __END_DECLS #endif
// Copyright (c) 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 CONTENT_BROWSER_RENDERER_HOST_MEMORY_BENCHMARK_MESSAGE_FILTER_H_ #define CONTENT_BROWSER_RENDERER_HOST_MEMORY_BENCHMARK_MESSAGE_FILTER_H_ #include <string> #include "content/public/browser/browser_message_filter.h" namespace content { class MemoryBenchmarkMessageFilter : public BrowserMessageFilter { public: MemoryBenchmarkMessageFilter(); virtual bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok) OVERRIDE; private: virtual ~MemoryBenchmarkMessageFilter(); void OnHeapProfilerDump(const std::string& reason); DISALLOW_COPY_AND_ASSIGN(MemoryBenchmarkMessageFilter); }; } #endif
/* dh.h * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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. * * wolfSSL 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-1335, USA */ /*! \file wolfssl/wolfcrypt/dh.h */ #ifndef WOLF_CRYPT_DH_H #define WOLF_CRYPT_DH_H #include <wolfssl/wolfcrypt/types.h> #ifndef NO_DH #if defined(HAVE_FIPS) && \ defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) #include <wolfssl/wolfcrypt/fips.h> #endif /* HAVE_FIPS_VERSION >= 2 */ #include <wolfssl/wolfcrypt/integer.h> #include <wolfssl/wolfcrypt/random.h> #ifdef WOLFSSL_KCAPI_DH #include <wolfssl/wolfcrypt/port/kcapi/kcapi_dh.h> #endif #ifdef __cplusplus extern "C" { #endif #ifdef WOLFSSL_ASYNC_CRYPT #include <wolfssl/wolfcrypt/async.h> #endif typedef struct DhParams { #ifdef HAVE_FFDHE_Q const byte* q; word32 q_len; #endif /* HAVE_FFDHE_Q */ const byte* p; word32 p_len; const byte* g; word32 g_len; } DhParams; /* Diffie-Hellman Key */ struct DhKey { mp_int p, g, q; /* group parameters */ #ifdef WOLFSSL_DH_EXTRA mp_int pub; mp_int priv; #endif void* heap; #ifdef WOLFSSL_ASYNC_CRYPT WC_ASYNC_DEV asyncDev; #endif int trustedGroup; #ifdef WOLFSSL_KCAPI_DH struct kcapi_handle* handle; #endif }; #ifndef WC_DH_TYPE_DEFINED typedef struct DhKey DhKey; #define WC_DH_TYPE_DEFINED #endif enum { WC_FFDHE_2048 = 256, WC_FFDHE_3072 = 257, WC_FFDHE_4096 = 258, WC_FFDHE_6144 = 259, WC_FFDHE_8192 = 260, }; #ifdef HAVE_PUBLIC_FFDHE #ifdef HAVE_FFDHE_2048 WOLFSSL_API const DhParams* wc_Dh_ffdhe2048_Get(void); #endif #ifdef HAVE_FFDHE_3072 WOLFSSL_API const DhParams* wc_Dh_ffdhe3072_Get(void); #endif #ifdef HAVE_FFDHE_4096 WOLFSSL_API const DhParams* wc_Dh_ffdhe4096_Get(void); #endif #ifdef HAVE_FFDHE_6144 WOLFSSL_API const DhParams* wc_Dh_ffdhe6144_Get(void); #endif #ifdef HAVE_FFDHE_8192 WOLFSSL_API const DhParams* wc_Dh_ffdhe8192_Get(void); #endif #endif WOLFSSL_API int wc_InitDhKey(DhKey* key); WOLFSSL_API int wc_InitDhKey_ex(DhKey* key, void* heap, int devId); WOLFSSL_API int wc_FreeDhKey(DhKey* key); WOLFSSL_API int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, byte* priv, word32* privSz, byte* pub, word32* pubSz); WOLFSSL_API int wc_DhAgree(DhKey* key, byte* agree, word32* agreeSz, const byte* priv, word32 privSz, const byte* otherPub, word32 pubSz); WOLFSSL_API int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32); /* wc_DhKeyDecode is in asn.c */ WOLFSSL_API int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz); WOLFSSL_API int wc_DhSetKey_ex(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz, const byte* q, word32 qSz); WOLFSSL_API int wc_DhSetNamedKey(DhKey* key, int name); WOLFSSL_API int wc_DhGetNamedKeyParamSize(int name, word32* p, word32* g, word32* q); WOLFSSL_API word32 wc_DhGetNamedKeyMinSize(int name); WOLFSSL_API int wc_DhCmpNamedKey(int name, int noQ, const byte* p, word32 pSz, const byte* g, word32 gSz, const byte* q, word32 qSz); WOLFSSL_API int wc_DhCopyNamedKey(int name, byte* p, word32* pSz, byte* g, word32* gSz, byte* q, word32* qSz); #ifdef WOLFSSL_DH_EXTRA WOLFSSL_API int wc_DhImportKeyPair(DhKey* key, const byte* priv, word32 privSz, const byte* pub, word32 pubSz); WOLFSSL_API int wc_DhExportKeyPair(DhKey* key, byte* priv, word32* pPrivSz, byte* pub, word32* pPubSz); WOLFSSL_LOCAL int wc_DhKeyCopy(DhKey* src, DhKey* dst); #endif WOLFSSL_API int wc_DhSetCheckKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz, const byte* q, word32 qSz, int trusted, WC_RNG* rng); WOLFSSL_API int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz, byte* g, word32* gInOutSz); WOLFSSL_API int wc_DhCheckPubKey(DhKey* key, const byte* pub, word32 pubSz); WOLFSSL_API int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz, const byte* prime, word32 primeSz); WOLFSSL_API int wc_DhCheckPubValue(const byte* prime, word32 primeSz, const byte* pub, word32 pubSz); WOLFSSL_API int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 pubSz); WOLFSSL_API int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 pubSz, const byte* prime, word32 primeSz); WOLFSSL_API int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz, const byte* priv, word32 privSz); WOLFSSL_API int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh); WOLFSSL_API int wc_DhExportParamsRaw(DhKey* dh, byte* p, word32* pSz, byte* q, word32* qSz, byte* g, word32* gSz); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* NO_DH */ #endif /* WOLF_CRYPT_DH_H */
#ifndef _TESTS_H_ #define _TESTS_H_ #include "UnitTest/UnitTest.h" #include "NewRendererTest/NewRendererTest.h" #include "ConsoleTest/ConsoleTest.h" #include "NewEventDispatcherTest/NewEventDispatcherTest.h" #include "ActionsTest/ActionsTest.h" #include "TransitionsTest/TransitionsTest.h" #include "ActionsProgressTest/ActionsProgressTest.h" #include "EffectsTest/EffectsTest.h" #include "ClickAndMoveTest/ClickAndMoveTest.h" #include "RotateWorldTest/RotateWorldTest.h" #include "ParticleTest/ParticleTest.h" #include "ActionsEaseTest/ActionsEaseTest.h" #include "MotionStreakTest/MotionStreakTest.h" #include "DrawPrimitivesTest/DrawPrimitivesTest.h" #include "TouchesTest/TouchesTest.h" #include "MenuTest/MenuTest.h" #include "ActionManagerTest/ActionManagerTest.h" #include "LayerTest/LayerTest.h" #include "SceneTest/SceneTest.h" #include "ParallaxTest/ParallaxTest.h" #include "TileMapTest/TileMapTest.h" #include "IntervalTest/IntervalTest.h" #include "LabelTest/LabelTest.h" #include "LabelTest/LabelTestNew.h" #include "TextInputTest/TextInputTest.h" #include "SpriteTest/SpriteTest.h" #include "SchedulerTest/SchedulerTest.h" #include "RenderTextureTest/RenderTextureTest.h" #include "Box2DTest/Box2dTest.h" #include "Box2DTestBed/Box2dView.h" #include "EffectsAdvancedTest/EffectsAdvancedTest.h" #include "AccelerometerTest/AccelerometerTest.h" #include "KeypadTest/KeypadTest.h" #include "KeyboardTest/KeyboardTest.h" #include "InputTest/MouseTest.h" #include "PerformanceTest/PerformanceTest.h" #include "ZwoptexTest/ZwoptexTest.h" #include "CocosDenshionTest/CocosDenshionTest.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPEN) #if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) // bada don't support libcurl #if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) #include "CurlTest/CurlTest.h" #endif #endif #endif #include "UserDefaultTest/UserDefaultTest.h" #include "BugsTest/BugsTest.h" #include "Texture2dTest/Texture2dTest.h" #include "FontTest/FontTest.h" #include "CurrentLanguageTest/CurrentLanguageTest.h" #include "TextureCacheTest/TextureCacheTest.h" #include "NodeTest/NodeTest.h" #include "ShaderTest/ShaderTest.h" #include "ShaderTest/ShaderTest2.h" #include "ExtensionsTest/ExtensionsTest.h" #include "MutiTouchTest/MutiTouchTest.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) #include "ClippingNodeTest/ClippingNodeTest.h" #include "ChipmunkTest/ChipmunkTest.h" #endif #include "FileUtilsTest/FileUtilsTest.h" #include "SpineTest/SpineTest.h" #include "TexturePackerEncryptionTest/TextureAtlasEncryptionTest.h" #include "DataVisitorTest/DataVisitorTest.h" #include "ConfigurationTest/ConfigurationTest.h" #include "PhysicsTest/PhysicsTest.h" #include "ReleasePoolTest/ReleasePoolTest.h" #endif
/* ui-log.c: functions for log output * * Copyright (C) 2006 Lars Hjemli * * Licensed under GNU General Public License v2 * (see COPYING for full license text) */ #include "cgit.h" #include "html.h" #include "ui-shared.h" int files, add_lines, rem_lines; void count_lines(char *line, int size) { if (size <= 0) return; if (line[0] == '+') add_lines++; else if (line[0] == '-') rem_lines++; } void inspect_files(struct diff_filepair *pair) { unsigned long old_size = 0; unsigned long new_size = 0; int binary = 0; files++; if (ctx.repo->enable_log_linecount) cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, &binary, count_lines); } void show_commit_decorations(struct commit *commit) { struct name_decoration *deco; static char buf[1024]; buf[sizeof(buf) - 1] = 0; deco = lookup_decoration(&name_decoration, &commit->object); while (deco) { if (!prefixcmp(deco->name, "refs/heads/")) { strncpy(buf, deco->name + 11, sizeof(buf) - 1); cgit_log_link(buf, NULL, "branch-deco", buf, NULL, NULL, 0, NULL, NULL, ctx.qry.showmsg); } else if (!prefixcmp(deco->name, "tag: refs/tags/")) { strncpy(buf, deco->name + 15, sizeof(buf) - 1); cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf); } else if (!prefixcmp(deco->name, "refs/tags/")) { strncpy(buf, deco->name + 10, sizeof(buf) - 1); cgit_tag_link(buf, NULL, "tag-deco", ctx.qry.head, buf); } else if (!prefixcmp(deco->name, "refs/remotes/")) { strncpy(buf, deco->name + 13, sizeof(buf) - 1); cgit_log_link(buf, NULL, "remote-deco", NULL, sha1_to_hex(commit->object.sha1), NULL, 0, NULL, NULL, ctx.qry.showmsg); } else { strncpy(buf, deco->name, sizeof(buf) - 1); cgit_commit_link(buf, NULL, "deco", ctx.qry.head, sha1_to_hex(commit->object.sha1)); } deco = deco->next; } } void print_commit(struct commit *commit) { struct commitinfo *info; char *tmp; int cols = 2; info = cgit_parse_commit(commit); htmlf("<tr%s><td>", ctx.qry.showmsg ? " class='logheader'" : ""); tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); html_link_open(tmp, NULL, NULL); cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); html_link_close(); htmlf("</td><td%s>", ctx.qry.showmsg ? " class='logsubject'" : ""); cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, sha1_to_hex(commit->object.sha1)); show_commit_decorations(commit); html("</td><td>"); html_txt(info->author); if (ctx.repo->enable_log_filecount) { files = 0; add_lines = 0; rem_lines = 0; cgit_diff_commit(commit, inspect_files); html("</td><td>"); htmlf("%d", files); if (ctx.repo->enable_log_linecount) { html("</td><td>"); htmlf("-%d/+%d", rem_lines, add_lines); } } html("</td></tr>\n"); if (ctx.qry.showmsg) { if (ctx.repo->enable_log_filecount) { cols++; if (ctx.repo->enable_log_linecount) cols++; } htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>", cols); html_txt(info->msg); html("</td></tr>\n"); } cgit_free_commitinfo(info); } static const char *disambiguate_ref(const char *ref) { unsigned char sha1[20]; const char *longref; longref = fmt("refs/heads/%s", ref); if (get_sha1(longref, sha1) == 0) return longref; return ref; } void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) { struct rev_info rev; struct commit *commit; const char *argv[] = {NULL, NULL, NULL, NULL, NULL}; int argc = 2; int i, columns = 3; if (!tip) tip = ctx.qry.head; argv[1] = disambiguate_ref(tip); if (grep && pattern && (!strcmp(grep, "grep") || !strcmp(grep, "author") || !strcmp(grep, "committer"))) argv[argc++] = fmt("--%s=%s", grep, pattern); if (path) { argv[argc++] = "--"; argv[argc++] = path; } init_revisions(&rev, NULL); rev.abbrev = DEFAULT_ABBREV; rev.commit_format = CMIT_FMT_DEFAULT; rev.verbose_header = 1; rev.show_root_diff = 0; setup_revisions(argc, argv, &rev, NULL); load_ref_decorations(DECORATE_FULL_REFS); rev.show_decorations = 1; rev.grep_filter.regflags |= REG_ICASE; compile_grep_patterns(&rev.grep_filter); prepare_revision_walk(&rev); if (pager) html("<table class='list nowrap'>"); html("<tr class='nohover'><th class='left'>Age</th>" "<th class='left'>Commit message"); if (pager) { html(" ("); cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL, NULL, ctx.qry.head, ctx.qry.sha1, ctx.qry.path, ctx.qry.ofs, ctx.qry.grep, ctx.qry.search, ctx.qry.showmsg ? 0 : 1); html(")"); } html("</th><th class='left'>Author</th>"); if (ctx.repo->enable_log_filecount) { html("<th class='left'>Files</th>"); columns++; if (ctx.repo->enable_log_linecount) { html("<th class='left'>Lines</th>"); columns++; } } html("</tr>\n"); if (ofs<0) ofs = 0; for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { free(commit->buffer); commit->buffer = NULL; free_commit_list(commit->parents); commit->parents = NULL; } for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) { print_commit(commit); free(commit->buffer); commit->buffer = NULL; free_commit_list(commit->parents); commit->parents = NULL; } if (pager) { htmlf("</table><div class='pager'>", columns); if (ofs > 0) { cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, ctx.qry.sha1, ctx.qry.path, ofs - cnt, ctx.qry.grep, ctx.qry.search, ctx.qry.showmsg); html("&nbsp;"); } if ((commit = get_revision(&rev)) != NULL) { cgit_log_link("[next]", NULL, NULL, ctx.qry.head, ctx.qry.sha1, ctx.qry.path, ofs + cnt, ctx.qry.grep, ctx.qry.search, ctx.qry.showmsg); } html("</div>"); } else if ((commit = get_revision(&rev)) != NULL) { html("<tr class='nohover'><td colspan='3'>"); cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, NULL, 0, NULL, NULL, ctx.qry.showmsg); html("</td></tr>\n"); } }
/* * c_dynload.c * * Created on: Jan 21, 2014 * Author: Xander Soldaat <xander@robotc.net> * * Copyright (C) 2014 Robomatter/National Instruments * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef C_DYNLOAD_H_ #define C_DYNLOAD_H_ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <dlfcn.h> #define DYNLOAD_MAX_VM_FILENAME 64 #define DYNLOAD_MAX_ENTRYPOINT_NAME 64 #define DYNLOAD_MAX_BUFSIZE 256 #define DYNLOAD_MAX_ENTRYPOINTS 10 #define DYNLOAD_VM_ROBOTC 0 #define DYNLOAD_VM_LABVIEW 1 #define DYNLOAD_VM_SO_PATH "/home/root/lms2012/3rdparty-vm" #define DYNLOAD_VM_ROBOTC_SO_NAME "librobotc.so" #define DYNLOAD_VM_LABVIEW_SO_NAME "libvireobridge.so" typedef void (*tEntryPointFunc)(void); #ifdef DEBUG_DYNLOAD unsigned long updateCounter; #endif struct tVirtualMachineInfo { int vmIndex; void *soHandle; char fileName[DYNLOAD_MAX_VM_FILENAME]; int entryPoints; char entryPointName[DYNLOAD_MAX_ENTRYPOINTS][DYNLOAD_MAX_ENTRYPOINT_NAME]; tEntryPointFunc entryPointFunc[DYNLOAD_MAX_ENTRYPOINTS]; tEntryPointFunc vm_exit; tEntryPointFunc vm_update; tEntryPointFunc vm_close; }; typedef void (*vmInitPointFunc)(struct tVirtualMachineInfo*); void dynloadInit(); void dynloadVMExit(); void dynloadVMLoad(); void dynLoadGetVM(); void dynLoadVMClose(); void dynloadUpdateVM(); void dynloadEntry_0(); void dynloadEntry_1(); void dynloadEntry_2(); void dynloadEntry_3(); void dynloadEntry_4(); void dynloadEntry_5(); void dynloadEntry_6(); void dynloadEntry_7(); void dynloadEntry_8(); void dynloadEntry_9(); #endif /* C_DYNLOAD_H_ */
/************************************************************ Copyright 1996 by Thomas E. Dickey <dickey@clark.net> Copyright 2017 D. R. Commander All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project shall not * be used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from the XFree86 Project. */ #ifndef EXTINIT_H #define EXTINIT_H #include "extnsionst.h" #ifdef COMPOSITE extern _X_EXPORT Bool noCompositeExtension; extern void CompositeExtensionInit(void); #endif #ifdef DAMAGE extern _X_EXPORT Bool noDamageExtension; extern void DamageExtensionInit(void); #endif #if defined(DBE) extern _X_EXPORT Bool noDbeExtension; extern void DbeExtensionInit(void); #endif #if defined(DPMSExtension) extern _X_EXPORT Bool noDPMSExtension; extern void DPMSExtensionInit(void); #endif extern Bool noGEExtension; extern void GEExtensionInit(void); #ifdef GLXEXT extern _X_EXPORT Bool noGlxExtension; extern void GlxExtensionInit(void); #endif #ifdef PANORAMIX extern _X_EXPORT Bool noPanoramiXExtension; extern void PanoramiXExtensionInit(void); #endif #ifdef RANDR extern _X_EXPORT Bool noRRExtension; extern void RRExtensionInit(void); #endif #if defined(XRECORD) extern void RecordExtensionInit(void); #endif extern _X_EXPORT Bool noRenderExtension; extern void RenderExtensionInit(void); #if defined(RES) extern _X_EXPORT Bool noResExtension; extern void ResExtensionInit(void); #endif #if defined(SCREENSAVER) extern _X_EXPORT Bool noScreenSaverExtension; extern void ScreenSaverExtensionInit(void); #endif extern void ShapeExtensionInit(void); #ifdef MITSHM extern _X_EXPORT Bool noMITShmExtension; extern void ShmExtensionInit(void); #endif extern void SyncExtensionInit(void); extern void XCMiscExtensionInit(void); #ifdef XCSECURITY extern _X_EXPORT Bool noSecurityExtension; extern void SecurityExtensionInit(void); #endif #ifdef XF86BIGFONT extern _X_EXPORT Bool noXFree86BigfontExtension; extern void XFree86BigfontExtensionInit(void); #endif extern void BigReqExtensionInit(void); extern _X_EXPORT Bool noXFixesExtension; extern void XFixesExtensionInit(void); extern void XInputExtensionInit(void); extern void XkbExtensionInit(void); #if defined(XSELINUX) extern _X_EXPORT Bool noSELinuxExtension; extern void SELinuxExtensionInit(void); #endif #ifdef XTEST extern void XTestExtensionInit(void); #endif #if defined(XV) extern _X_EXPORT Bool noXvExtension; extern void XvExtensionInit(void); extern void XvMCExtensionInit(void); #endif #if defined(DRI3) extern void dri3_extension_init(void); #endif #if defined(PRESENT) #include "presentext.h" #endif #ifdef TURBOVNC extern void vncExtensionInit(void); #ifdef NVCONTROL extern Bool noNVCTRLExtension; extern void nvCtrlExtensionInit(void); #endif #endif #endif
/* This file is part of Warzone 2100. Copyright (C) 1999-2004 Eidos Interactive Copyright (C) 2005-2017 Warzone 2100 Project Warzone 2100 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. Warzone 2100 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 Warzone 2100; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /***************************************************************************/ /* * pieBlitFunc.h * * patch for exisitng ivis rectangle draw functions. * */ /***************************************************************************/ #ifndef _pieBlitFunc_h #define _pieBlitFunc_h /***************************************************************************/ #include "lib/framework/frame.h" #include "lib/framework/string_ext.h" #include "lib/framework/vector.h" #include "glm/core/type.hpp" #include "piedef.h" #include "ivisdef.h" #include "pietypes.h" #include "piepalette.h" #include "pieclip.h" /***************************************************************************/ /* * Global Definitions */ /***************************************************************************/ #define NUM_BACKDROPS 7 /* These are Qamly's hacks used for map previews. They need to be power of * two sized until we clean up this mess properly. */ #define BACKDROP_HACK_WIDTH 512 #define BACKDROP_HACK_HEIGHT 512 /***************************************************************************/ /* * Global Classes */ /***************************************************************************/ enum GFXTYPE { GFX_TEXTURE, GFX_COLOUR, GFX_COUNT }; /// Generic graphics using VBOs drawing class class GFX { public: /// Initialize class and allocate GPU resources GFX(GFXTYPE type, GLenum drawType = GL_TRIANGLES, int coordsPerVertex = 3); /// Destroy GPU held resources ~GFX(); /// Load texture data from file, allocate space for it, and put it on the GPU void loadTexture(const char *filename, GLenum filter = GL_LINEAR); /// Allocate space on the GPU for texture of given parameters. If image is non-NULL, /// then that memory buffer is uploaded to the GPU. void makeTexture(int width, int height, GLenum filter = GL_LINEAR, GLenum format = GL_RGBA, const GLvoid *image = nullptr); /// Upload given memory buffer to already allocated texture space on the GPU void updateTexture(const GLvoid *image, int width = -1, int height = -1); /// Upload vertex and texture buffer data to the GPU void buffers(int vertices, const GLvoid *vertBuf, const GLvoid *texBuf); /// Draw everything void draw(const glm::mat4 &modelViewProjectionMatrix); private: GFXTYPE mType; GLenum mFormat; int mWidth; int mHeight; GLenum mdrawType; int mCoordsPerVertex; GLuint mBuffers[VBO_COUNT]; GLuint mTexture; int mSize; }; /***************************************************************************/ /* * Global ProtoTypes */ /***************************************************************************/ glm::mat4 defaultProjectionMatrix(); void iV_ShadowBox(int x0, int y0, int x1, int y1, int pad, PIELIGHT first, PIELIGHT second, PIELIGHT fill); void iV_Line(int x0, int y0, int x1, int y1, PIELIGHT colour); void iV_Lines(const std::vector<glm::ivec4> &lines, PIELIGHT colour); void iV_Box2(int x0, int y0, int x1, int y1, PIELIGHT first, PIELIGHT second); static inline void iV_Box(int x0, int y0, int x1, int y1, PIELIGHT first) { iV_Box2(x0, y0, x1, y1, first, first); } void pie_BoxFill(int x0, int y0, int x1, int y1, PIELIGHT colour, REND_MODE rendermode = REND_OPAQUE); void iV_DrawImage(GLuint TextureID, Vector2i position, Vector2i offset, Vector2i size, float angle, REND_MODE mode, PIELIGHT colour); void iV_DrawImageText(GLuint TextureID, Vector2i position, Vector2i offset, Vector2i size, float angle, REND_MODE mode, PIELIGHT colour); void iV_DrawImage(IMAGEFILE *ImageFile, UWORD ID, int x, int y, const glm::mat4 &modelViewProjection = defaultProjectionMatrix()); void iV_DrawImage2(const QString &filename, float x, float y, float width = -0.0f, float height = -0.0f); void iV_DrawImageTc(Image image, Image imageTc, int x, int y, PIELIGHT colour, const glm::mat4 &modelViewProjection = defaultProjectionMatrix()); void iV_DrawImageRepeatX(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Width, const glm::mat4 &modelViewProjection = defaultProjectionMatrix()); void iV_DrawImageRepeatY(IMAGEFILE *ImageFile, UWORD ID, int x, int y, int Height, const glm::mat4 &modelViewProjection = defaultProjectionMatrix()); static inline void iV_DrawImage(Image image, int x, int y) { iV_DrawImage(image.images, image.id, x, y); } static inline void iV_DrawImageTc(IMAGEFILE *imageFile, unsigned id, unsigned idTc, int x, int y, PIELIGHT colour) { iV_DrawImageTc(Image(imageFile, id), Image(imageFile, idTc), x, y, colour); } void iV_TransBoxFill(float x0, float y0, float x1, float y1); void pie_UniTransBoxFill(float x0, float y0, float x1, float y1, PIELIGHT colour); bool pie_InitRadar(); bool pie_ShutdownRadar(); void pie_DownLoadRadar(UDWORD *buffer); void pie_RenderRadar(const glm::mat4 &modelViewProjectionMatrix); void pie_SetRadar(GLfloat x, GLfloat y, GLfloat width, GLfloat height, int twidth, int theight, bool filter); enum SCREENTYPE { SCREEN_RANDOMBDROP, SCREEN_CREDITS, SCREEN_MISSIONEND, }; void pie_LoadBackDrop(SCREENTYPE screenType); #endif //
#ifndef COIN_SOTIMERSENSOR_H #define COIN_SOTIMERSENSOR_H /**************************************************************************\ * * This file is part of the Coin 3D visualization library. * Copyright (C) 1998-2008 by Kongsberg SIM. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.GPL at the root directory of this source * distribution for additional information about the GNU GPL. * * For using Coin with software that can not be combined with the GNU * GPL, and for taking advantage of the additional benefits of our * support services, please contact Kongsberg SIM about acquiring * a Coin Professional Edition License. * * See http://www.coin3d.org/ for more information. * * Kongsberg SIM, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. * http://www.sim.no/ sales@sim.no coin-support@coin3d.org * \**************************************************************************/ #include <Inventor/sensors/SoTimerQueueSensor.h> class COIN_DLL_API SoTimerSensor : public SoTimerQueueSensor { typedef SoTimerQueueSensor inherited; public: SoTimerSensor(void); SoTimerSensor(SoSensorCB * func, void * data); virtual ~SoTimerSensor(void); void setBaseTime(const SbTime & base); const SbTime & getBaseTime(void) const; void setInterval(const SbTime & interval); const SbTime & getInterval(void) const; virtual void schedule(void); virtual void unschedule(void); void reschedule(const SbTime & schedtime); private: virtual void trigger(void); SbTime base, interval; SbBool setbasetime; SbBool istriggering; }; #endif // !COIN_SOTIMERSENSOR_H
/****************************************************************************** * This file is part of evfilter library. * * * * Evfilter library is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * Evfilter library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with evfilter library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * * * Copyright (C) 2008-2010 Cyril Hrubis <metan@ucw.cz> * * * ******************************************************************************/ #ifndef __SDL_UTILS_H__ #define __SDL_UTILS_H__ #include <stdint.h> #include <SDL/SDL.h> struct sdl_scroll_buf; struct sdl_scroll_buf *sdl_scroll_buf_new(SDL_Surface *dest, const char *title, Sint16 x, Sint16 y, Uint16 w, Uint16 h); void sdl_scroll_buf_add(struct sdl_scroll_buf *sb, const char *mesg, Uint32 color); #endif /* __SDL_UTILS_H__ */
/* linux/arch/arm/mach-via/board-broadcom-bt.c */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/err.h> #include <linux/irq.h> #include <asm/mach-types.h> //#include <asm/gpio.h> #include <asm/io.h> #include <linux/skbuff.h> #include <linux/wlan_plat.h> #include <linux/clk.h> //Add by Sober #include <mach/hardware.h> //Sober: This needs to be redefined again!! #define BT2AP_WAKE 142 //via_gpio_bt_hostwake #define AP2BT_WAKE 140 //via_gpio_bt_extwake static struct platform_device bcm4330_bluetooth = { .name = "bcm4330_bluetooth", .id = -1, }; #ifdef BT_BLUEZ_SLEEP_SUPPORT static struct platform_device brcm_bluesleep_device = { .name = "bluesleep", .id = -1, //.num_resources = ARRAY_SIZE(bluesleep_resources), //.resource = bluesleep_resources, }; #endif void __init via_add_bcm4330_bt_device(void) { #ifdef BT_BLUEZ_SLEEP_SUPPORT platform_device_register(&brcm_bluesleep_device); #endif platform_device_register(&bcm4330_bluetooth); } int __init broadcom_bt_init(void) { int ret =0; printk(KERN_INFO "%s: start\n", __func__); #ifdef CONFIG_VTC_BCM4330_QILIANP0_POWER_SWITCH //PMU_GTCXO_EN WIFI/BT_PEN SUS_GPIO_CTRL_Rx062_BYTE_VAL |= BIT0; SUS_GPIO_OC_Rx0A2_BYTE_VAL |= BIT0; SUS_GPIO_OD_Rx0E2_BYTE_VAL &= ~BIT0; #endif via_add_bcm4330_bt_device(); return ret; } arch_initcall(broadcom_bt_init); //device_initcall(broadcom_bt_init); //harry mask temp
#pragma once /* * Copyright (C) 2005-2008 Team XBMC * http://www.xbmc.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, 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 XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "utils/StdString.h" #ifdef _WIN32 #undef SetPort // WIN32INCLUDES this is defined as SetPortA in WinSpool.h which is being included _somewhere_ #endif class CURL { public: CURL(const CStdString& strURL); CURL(); virtual ~CURL(void); void Reset(); void Parse(const CStdString& strURL); void SetFileName(const CStdString& strFileName); void SetHostName(const CStdString& strHostName); void SetUserName(const CStdString& strUserName); void SetPassword(const CStdString& strPassword); void SetProtocol(const CStdString& strProtocol); void SetOptions(const CStdString& strOptions); void SetProtocolOptions(const CStdString& strOptions); void SetPort(int port); bool HasPort() const; int GetPort() const; const CStdString& GetHostName() const; const CStdString& GetDomain() const; const CStdString& GetUserName() const; const CStdString& GetPassWord() const; const CStdString& GetFileName() const; const CStdString& GetProtocol() const; const CStdString GetTranslatedProtocol() const; const CStdString& GetFileType() const; const CStdString& GetShareName() const; const CStdString& GetOptions() const; const CStdString& GetProtocolOptions() const; const CStdString GetFileNameWithoutPath() const; /* return the filename excluding path */ char GetDirectorySeparator() const; CStdString Get() const; CStdString GetWithoutUserDetails() const; CStdString GetWithoutFilename() const; bool IsLocal() const; static bool IsFileOnly(const CStdString &url); ///< return true if there are no directories in the url. static bool IsFullPath(const CStdString &url); ///< return true if the url includes the full path static void Decode(CStdString& strURLData); static void Encode(CStdString& strURLData); protected: int m_iPort; CStdString m_strHostName; CStdString m_strShareName; CStdString m_strDomain; CStdString m_strUserName; CStdString m_strPassword; CStdString m_strFileName; CStdString m_strProtocol; CStdString m_strFileType; CStdString m_strOptions; CStdString m_strProtocolOptions; };
/* ***** BEGIN LICENSE BLOCK ***** * Source last modified: $Id: hxmediasource.h,v 1.2 2006/09/19 23:56:33 gashish Exp $ * * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved. * * The contents of this file, and the files included with this file, * are subject to the current version of the RealNetworks Public * Source License (the "RPSL") available at * http://www.helixcommunity.org/content/rpsl unless you have licensed * the file under the current version of the RealNetworks Community * Source License (the "RCSL") available at * http://www.helixcommunity.org/content/rcsl, in which case the RCSL * will apply. You may also obtain the license terms directly from * RealNetworks. You may not use this file except in compliance with * the RPSL or, if you have a valid RCSL with RealNetworks applicable * to this file, the RCSL. Please see the applicable RPSL or RCSL for * the rights, obligations and limitations governing use of the * contents of the file. * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the * "GPL") in which case the provisions of the GPL are applicable * instead of those above. If you wish to allow use of your version of * this file only under the terms of the GPL, and not to allow others * to use your version of this file under the terms of either the RPSL * or RCSL, indicate your decision by deleting the provisions above * and replace them with the notice and other provisions required by * the GPL. If you do not delete the provisions above, a recipient may * use your version of this file under the terms of any one of the * RPSL, the RCSL or the GPL. * * This file is part of the Helix DNA Technology. RealNetworks is the * developer of the Original Code and owns the copyrights in the * portions it created. * * This file, and the files included with this file, is distributed * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET * ENJOYMENT OR NON-INFRINGEMENT. * * Technology Compatibility Kit Test Suite(s) Location: * http://www.helixcommunity.org/content/tck * * Contributor(s): * * ***** END LICENSE BLOCK ***** */ #ifndef _HX_MEDIA_SOURCE_H_ #define _HX_MEDIA_SOURCE_H_ #ifdef _SYMBIAN struct CHXMediaSource { public: enum CHXMediaSourceType { ECMMFClip = 0, EDescriptor, ERFile, EFileName }; CHXMediaSourceType mType; void* m_pData; }; #else struct CHXMediaSource { void* m_pData; }; #endif #endif // _HX_MEDIA_SOURCE_H_
/* * Voxels 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. * * Voxels 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 Voxels; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * */ #ifndef COMPRESSED_STREAM_H_INCLUDED #define COMPRESSED_STREAM_H_INCLUDED #include "stream/stream.h" #include <vector> using namespace std; namespace stream { class ZLibFormatException final : public IOException { public: ZLibFormatException(const string &msg) : IOException("zlib error : " + msg) { } }; class ExpandReader final : public Reader { private: shared_ptr<Reader> preader; Reader &reader; shared_ptr<void> state; static constexpr size_t bufferSize = 1 << 16; vector<uint8_t> buffer, compressedBuffer; size_t bufferPointer = 0; bool moreAvailable = false, gotEOF = false; void readBuffer(); void readCompressedBuffer(); public: ExpandReader(shared_ptr<Reader> preader) : ExpandReader(*preader) { this->preader = preader; } ExpandReader(Reader &reader); virtual ~ExpandReader() { } virtual bool dataAvailable() override { if(bufferPointer < buffer.size()) return true; return false; } virtual uint8_t readByte() override { if(dataAvailable()) return buffer[bufferPointer++]; readBuffer(); return buffer[bufferPointer++]; } }; class CompressWriter final : public Writer { private: shared_ptr<Writer> pwriter; Writer &writer; shared_ptr<void> state; static constexpr size_t bufferSize = 1 << 16; vector<uint8_t> buffer, compressedBuffer; void writeBuffer(); void writeCompressedBuffer(); public: CompressWriter(shared_ptr<Writer> pwriter) : CompressWriter(*pwriter) { this->pwriter = pwriter; } CompressWriter(Writer &writer); virtual ~CompressWriter() { } void finish(); virtual void flush() override { finish(); writer.flush(); } virtual void writeByte(uint8_t v) override { if(writeWaits()) { writeBuffer(); } buffer.push_back(v); } virtual bool writeWaits() override { if(buffer.size() >= bufferSize) return true; return false; } }; } #endif // COMPRESSED_STREAM_H_INCLUDED
/* * Copyright (C) 2001-2004 Peter J Jones (pjones@pmade.org) * All Rights Reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name of the Author 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 AUTHOR 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 AUTHOR * 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. */ /** @file * This file contains the definition of the Netxx::Timeout class. **/ #ifndef _netxx_timeout_h_ #define _netxx_timeout_h_ namespace Netxx { /** * The Netxx::Timeout class is used by the other Netxx classes to specifiy a * timeout value. A timeout is broken down into seconds and microseconds. * This class also has a default constructor for a null timeout, that is, no * timeout. * * As a side note, just in case you did not know, there are one million * microseconds in one second. **/ class Timeout { public: //#################################################################### /** * Construct a null timeout. This means that a timeout value should not * be used at all. This is the default for most Netxx classes. * * @author Peter Jones **/ //#################################################################### Timeout (void) : sec_(0), usec_(0) { } //#################################################################### /** * Construct a Netxx::Timeout with the given length in seconds and * optionally the addition of the given microseconds. * * @param sec The number of seconds for the timeout. * @param usec An optional number of microseconds. * @author Peter Jones **/ //#################################################################### explicit Timeout (long sec, long usec=0) : sec_(sec), usec_(usec) {} //#################################################################### /** * Set the seconds part of the timeout. * * @param sec The new value for the seconds field. * @author Peter Jones **/ //#################################################################### void set_sec (long sec) { sec_ = sec; } //#################################################################### /** * Get the seconds field of the timeout. * * @return The timeout's seconds field. * @author Peter Jones **/ //#################################################################### long get_sec (void) const { return sec_; } //#################################################################### /** * Set the microseconds field for the timeout. * * @param usec The microseconds to use for this timeout. * @author Peter Jones **/ //#################################################################### void set_usec (long usec) { usec_ = usec; } //#################################################################### /** * Get the microseconds field for this timeout. * * @return The timeout's microseconds field. * @author Peter Jones **/ //#################################################################### long get_usec (void) const { return usec_; } //#################################################################### /** * Test to see if this timeout is valid or null. * * @return True if this timeout has been set with a value. * @return False if this timeout is NULL (set to zero). * @author Peter Jones **/ //#################################################################### operator bool (void) const { return sec_ || usec_; } private: long sec_; long usec_; }; // end Netxx::Timeout class } // end Netxx namespace #endif
////////////////////////////////////////////////////////////////////// // BasicSynth Composer // /// @file Text editor window class declaration. // // Copyright 2010, Daniel R. Mitchell // License: Creative Commons/GNU-GPL // (http://creativecommons.org/licenses/GPL/2.0/) // (http://www.gnu.org/licenses/gpl.html) ////////////////////////////////////////////////////////////////////// #ifndef TEXT_EDITOR_FLTK_H #define TEXT_EDITOR_FLTK_H #include <regex.h> #define RESUBS 10 class TextEditorFltk : public Fl_Text_Editor, public TextEditor { protected: bsString file; ProjectItem *pi; int changed; int findFlags; bsString findText; bsString matchText; int findStart; int findEnd; int matchStart; int matchEnd; regex_t re; regmatch_t resubs[RESUBS]; bool InitFind(int flags, const char *text, bool insel); bool DoFind(); int DoReplace(const char *rtext); public: TextEditorFltk(int X, int Y, int W, int H); virtual ~TextEditorFltk(); void TextChanged(int pos, int inserted, int deleted, int restyled); void CallbackEvent(Fl_Widget *wdg); void Resize(wdgRect& rc); void Restyle(int position); void UpdateUI(); int IsKeyword(char *txt); virtual ProjectItem *GetItem(); virtual void SetItem(ProjectItem *p); virtual void Undo(); virtual void Redo(); virtual void Cut(); virtual void Copy(); virtual void Paste(); virtual void Find(); virtual void FindNext(); virtual void SelectAll(); virtual void GotoLine(int ln); virtual void GotoPosition(int pos); virtual void SetMarker() { } virtual void SetMarkerAt(int line, int on) { } virtual void NextMarker() { } virtual void PrevMarker() { } virtual void ClearMarkers() { } virtual void Cancel(); virtual long EditState(); virtual int IsChanged(); virtual void Focus() { take_focus(); } virtual int OpenFile(const char *fname); virtual int SaveFile(const char *fname); virtual int GetText(bsString& text); virtual int SetText(bsString& text); virtual int Find(int flags, const char *ftext); virtual int MatchSel(int flags, const char *ftext); virtual void Replace(const char *rtext); virtual int ReplaceAll(int flags, const char *ftext, const char *rtext, SelectInfo& sel); virtual int GetSelection(SelectInfo& sel); virtual void SetSelection(SelectInfo& sel); }; #endif
// FiSHy, a plugin for Colloquy providing Blowfish encryption. // Copyright (C) 2007 Henning Kiel // // 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. #import <Cocoa/Cocoa.h> @class JVDirectChatPanel; @class MVChatConnection; @protocol JVChatViewController; /// Checks if chatViewController is a JVDirectChatPanel or a subclass of JVDirectChatPanel. If it is, it returns a correctly casted reference, if not, just nil. JVDirectChatPanel *FiSHDirectChatPanelForChatViewController(id <JVChatViewController> chatViewController); /// Returns the name for the supplied object. chatObject is either a ChatRoom or a ChatUser. Returns nil, if chatObject is not of any supported class. NSString *FiSHNameForChatObject(id chatObject); BOOL FiSHIsIRCConnection(id connection);
#include <cbehave/cbehave.h> #include <stdlib.h> #include <string.h> #include <c_hashmap/hashmap.h> // All tests in this file adapted from example code in the original c_hashmap // package's main.c FEATURE(hashmap_put, "Hashmap put") SCENARIO("Put one value") GIVEN("a new hashmap") map_t map = hashmap_new(); WHEN("I put a new value in") int value = 42; int error = hashmap_put(map, "somekey", &value); THEN("the operation should be successful"); SHOULD_INT_EQUAL(error, (int)MAP_OK); hashmap_free(map); SCENARIO_END FEATURE_END FEATURE(hashmap_get, "Hashmap get") SCENARIO("Get an existing value") GIVEN("a hashmap with a value") map_t map = hashmap_new(); int value = 42; hashmap_put(map, "somekey", &value); WHEN("I get it via its key") int *valueOut; int error = hashmap_get(map, "somekey", (void **)&valueOut); THEN("the operation should be successful") SHOULD_INT_EQUAL(error, (int)MAP_OK); AND("the value should match"); SHOULD_INT_EQUAL(value, *valueOut); hashmap_free(map); SCENARIO_END SCENARIO("Get non-existing value") GIVEN("a hashmap with a value") map_t map = hashmap_new(); int value = 42; hashmap_put(map, "somekey", &value); WHEN("I get a non-existing key") int *valueOut; int error = hashmap_get(map, "notkey", (void **)&valueOut); THEN("the operation should be unsuccessful") SHOULD_INT_EQUAL(error, (int)MAP_MISSING); hashmap_free(map); SCENARIO_END FEATURE_END FEATURE(hashmap_remove, "Hashmap remove") SCENARIO("Remove an existing value") GIVEN("a hashmap with a value") map_t map = hashmap_new(); int value = 42; hashmap_put(map, "somekey", &value); WHEN("I remove it via its key") int error = hashmap_remove(map, "somekey"); THEN("the operation should be successful") SHOULD_INT_EQUAL(error, (int)MAP_OK); hashmap_free(map); SCENARIO_END FEATURE_END static int copy_key(any_t data, any_t key) { char **keys = (char **)data; while (*keys != NULL) keys++; *keys = strdup(key); return MAP_OK; } FEATURE(hashmap_iterate_keys_sorted, "Hashmap iterate keys sorted") SCENARIO("Iterate a hashmap sorted by keys") GIVEN("a hashmap with keys a, b, c") map_t map = hashmap_new(); int value3 = 3; hashmap_put(map, "c", &value3); int value2 = 2; hashmap_put(map, "b", &value2); int value1 = 1; hashmap_put(map, "a", &value1); WHEN("I iterate it by keys sorted") char *keys[3]; memset(keys, 0, sizeof keys); const int error = hashmap_iterate_keys_sorted(map, copy_key, keys); THEN("the keys should be in order") SHOULD_INT_EQUAL(error, MAP_OK); SHOULD_STR_EQUAL(keys[0], "a"); SHOULD_STR_EQUAL(keys[1], "b"); SHOULD_STR_EQUAL(keys[2], "c"); for (int i = 0; i < 3; i++) free(keys[i]); hashmap_free(map); SCENARIO_END FEATURE_END CBEHAVE_RUN( "c_hashmap features are:", TEST_FEATURE(hashmap_put), TEST_FEATURE(hashmap_get), TEST_FEATURE(hashmap_remove), TEST_FEATURE(hashmap_iterate_keys_sorted) )
#ifndef _SWELL_MENUGEN_H_ #define _SWELL_MENUGEN_H_ /** SWELL - (Simple Windows Emulation Layer Library) Copyright (C) 2006 and later, Cockos Incorporated. Dynamic menu generation This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Usage: See: mac_resgen.php etc */ #include "swell.h" #ifdef BEGIN #undef BEGIN #endif #ifdef END #undef END #endif typedef struct SWELL_MenuResourceIndex { const char *resid; void (*createFunc)(HMENU hMenu); struct SWELL_MenuResourceIndex *_next; } SWELL_MenuResourceIndex; extern SWELL_MenuResourceIndex *SWELL_curmodule_menuresource_head; #define SWELL_MENUGEN_POPUP_PREFIX "/.BO^O:" #define SWELL_MENUGEN_ENDPOPUP "EN%%%^:" struct SWELL_MenuGen_Entry { const char *name; // will begin with SWELL_MENUGEN_POPUP_PREFIX on submenus, and will be SWELL_MENUGEN_ENDPOPUP at the end of a submenu unsigned short idx; unsigned short flags; }; class SWELL_MenuGenHelper { public: SWELL_MenuResourceIndex m_rec; SWELL_MenuGenHelper(SWELL_MenuResourceIndex **h, void (*cf)(HMENU), int recid) { m_rec.resid=MAKEINTRESOURCE(recid); m_rec.createFunc=cf; m_rec._next=*h; *h = &m_rec; } }; #define SWELL_DEFINE_MENU_RESOURCE_BEGIN(recid) \ static void __swell_menu_cf__##recid(HMENU hMenu); \ static SWELL_MenuGenHelper __swell_menu_cf_helper__##recid(&SWELL_curmodule_menuresource_head, __swell_menu_cf__##recid, recid); \ static void __swell_menu_cf__##recid(HMENU hMenu) { static const SWELL_MenuGen_Entry list[]={{NULL,0,0 #define SWELL_DEFINE_MENU_RESOURCE_END(recid) } }; SWELL_GenerateMenuFromList(hMenu,list+1,sizeof(list)/sizeof(list[0])-1); } #define GRAYED 1 #define INACTIVE 2 #define POPUP }, { SWELL_MENUGEN_POPUP_PREFIX #define MENUITEM }, { #define SEPARATOR NULL, 0xffff #define BEGIN #define END }, { SWELL_MENUGEN_ENDPOPUP #endif//_SWELL_MENUGEN_H_
/* C -programmering, en innføring. Eksempel 34 */ #include <stdlib.h> #include <time.h> #include <stdio.h> #include "modell.h" #include "spaceinvader.h" #include "rektangel.h" #include "kanon.h" Kanon * Kanon_opprett(void * spaceinvader) { Skjerm * skjerm = ((Spaceinvader*)spaceinvader)->skjerm; Kanon *kanon = (Kanon*)malloc(sizeof(Kanon)); kanon->spaceinvader = spaceinvader; int x = (skjerm->bredde / 2) - 25; int y = skjerm->hoeyde - 50; int b = 50; int h = 20; kanon->r = Rektangel_opprett (x,y,b,h); int teller; for (teller = 0; teller < MAX_ANTALL_PROSJEKTIL; teller++) { kanon->ild[teller] = NULL; } kanon->tiks = SDL_GetTicks(); return kanon; } int Kanon_slett (Kanon ** kanon) { free(*kanon); return 0; } void Kanon_render (Kanon * kanon) { Skjerm * skjerm = ((Spaceinvader*)kanon->spaceinvader)->skjerm; SDL_Rect rect; rect.x = kanon->r->x; rect.y = kanon->r->y; rect.w = kanon->r->b; rect.h = kanon->r->h; SDL_SetRenderDrawColor (skjerm->ren, 200, 200, 200, 255); SDL_RenderFillRect (skjerm->ren, &rect); /* Render ild- givningen. */ int teller; for (teller = 0; teller < MAX_ANTALL_PROSJEKTIL; teller++) { if (kanon->ild[teller] != NULL) { Prosjektil * prosjektil = kanon->ild[teller]; Prosjektil_render (prosjektil); } } } void Kanon_flytt_til_venstre (Kanon * kanon) { int d = 5; if (kanon->r->x > (d + 10)) { kanon->r->x -= d; } } void Kanon_flytt_til_hoeyre (Kanon * kanon) { Spaceinvader * spaceinvader = (Spaceinvader*)kanon->spaceinvader; Skjerm * skjerm = spaceinvader->skjerm; int d = 5; if ((kanon->r->x + kanon->r->b) < (skjerm->bredde - d - 10)) { kanon->r->x += d; } } void Kanon_fyr_av_et_prosjektil (Kanon * kanon) { Spaceinvader * spaceinvader = (Spaceinvader*)kanon->spaceinvader; /* Uint32 t = SDL_GetTicks(); Uint32 d = 150; Uint32 g = kanon->tiks + d; if ( g > t) { return; } kanon->tiks = t; */ /* Finn neste ledige plass i ild- givningen. */ int teller; for (teller = 0; teller < MAX_ANTALL_PROSJEKTIL; teller++) { if (kanon->ild[teller] == NULL) { break; } } if (teller == MAX_ANTALL_PROSJEKTIL) { return; } /* Opprett et nytt prosjektilobjekt, og plasser dette i ild- givningen. */ int type = 0; int x = kanon->r->x + (kanon->r->b / 2); int y = kanon->r->y; kanon->ild[teller] = Prosjektil_opprett (spaceinvader,type,x,y); } void Kanon_tikk (Kanon * kanon) { int teller; for (teller = 0; teller < MAX_ANTALL_PROSJEKTIL; teller++) { if (kanon->ild[teller] != NULL) { Prosjektil * prosjektil = kanon->ild[teller]; int r = Prosjektil_tikk (prosjektil); /* Om r er lik 1 har prosjektilet gått ut av fokus. */ if ( r == 1) { Prosjektil_slett (&prosjektil); kanon->ild[teller] = NULL; } } } } void Kanon_sjekk_treff (Kanon * kanon) { Spaceinvader * spaceinvader = (Spaceinvader*)kanon->spaceinvader; Modell * modell = spaceinvader->modell; int teller; for (teller = 0; teller < MAX_ANTALL_PROSJEKTIL; teller++) { if (kanon->ild[teller] != NULL) { Prosjektil * prosjektil = kanon->ild[teller]; if (prosjektil->status == 1) { continue; } /* Såfremt prosjektilet er kommet opp til nederste ufo, må vi begynne å sjekke etter mulige kolisjoner. */ if (prosjektil->r->y <= modell->ufo_nivaa) { Ufoer * ufoer = modell->ufoer; int teller2; for (teller2 = 54; teller2 >= 0; teller2 --) { Ufo * ufo = ufoer->ufo[teller2]; if (ufo->status == 0) { Rektangel * r1 = ufo->r; Rektangel * r2 = prosjektil->r; int b; b = Rektangel_overlapp (r1,r2); if (b == 1) { ufo->status = 1; prosjektil->status = 1; if (ufo->id < 20) modell->poeng+=2; else modell->poeng+=1; break; } } } } } } }
/* * Copyright 2006 Rob Kendrick <rjek@rjek.com> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * * NetSurf 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. * * NetSurf 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 <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <gtk/gtk.h> #include "utils/log.h" #include "content/content.h" #include "content/hlcache.h" #include "content/urldb.h" #include "utils/messages.h" #include "utils/utils.h" #include "desktop/browser.h" #include "gtk/resources.h" #include "gtk/login.h" struct session_401 { nsurl *url; /**< URL being fetched */ lwc_string *host; /**< Host for user display */ char *realm; /**< Authentication realm */ nserror (*cb)(bool proceed, void *pw); /**< Continuation callback */ void *cbpw; /**< Continuation data */ GtkBuilder *x; /**< Our glade windows */ GtkWindow *wnd; /**< The login window itself */ GtkEntry *user; /**< Widget with username */ GtkEntry *pass; /**< Widget with password */ }; static void create_login_window(nsurl *url, lwc_string *host, const char *realm, nserror (*cb)(bool proceed, void *pw), void *cbpw); static void destroy_login_window(struct session_401 *session); static void nsgtk_login_next(GtkWidget *w, gpointer data); static void nsgtk_login_ok_clicked(GtkButton *w, gpointer data); static void nsgtk_login_cancel_clicked(GtkButton *w, gpointer data); void gui_401login_open(nsurl *url, const char *realm, nserror (*cb)(bool proceed, void *pw), void *cbpw) { lwc_string *host; host = nsurl_get_component(url, NSURL_HOST); assert(host != NULL); create_login_window(url, host, realm, cb, cbpw); lwc_string_unref(host); } /* create a new instance of the login window, and get handles to all * the widgets we're interested in. */ void create_login_window(nsurl *url, lwc_string *host, const char *realm, nserror (*cb)(bool proceed, void *pw), void *cbpw) { struct session_401 *session; GtkWindow *wnd; GtkLabel *lhost, *lrealm; GtkEntry *euser, *epass; GtkButton *bok, *bcan; GtkBuilder* builder; nserror res; res = nsgtk_builder_new_from_resname("login", &builder); if (res != NSERROR_OK) { LOG("Login UI builder init failed"); return; } gtk_builder_connect_signals(builder, NULL); wnd = GTK_WINDOW(gtk_builder_get_object(builder, "wndLogin")); lhost = GTK_LABEL(gtk_builder_get_object(builder, "labelLoginHost")); lrealm = GTK_LABEL(gtk_builder_get_object(builder, "labelLoginRealm")); euser = GTK_ENTRY(gtk_builder_get_object(builder, "entryLoginUser")); epass = GTK_ENTRY(gtk_builder_get_object(builder, "entryLoginPass")); bok = GTK_BUTTON(gtk_builder_get_object(builder, "buttonLoginOK")); bcan = GTK_BUTTON(gtk_builder_get_object(builder, "buttonLoginCan")); /* create and fill in our session structure */ session = calloc(1, sizeof(struct session_401)); session->url = nsurl_ref(url); session->host = lwc_string_ref(host); session->realm = strdup(realm ? realm : "Secure Area"); session->cb = cb; session->cbpw = cbpw; session->x = builder; session->wnd = wnd; session->user = euser; session->pass = epass; /* fill in our new login window */ gtk_label_set_text(GTK_LABEL(lhost), lwc_string_data(host)); gtk_label_set_text(lrealm, realm); gtk_entry_set_text(euser, ""); gtk_entry_set_text(epass, ""); /* attach signal handlers to the Login and Cancel buttons in our new * window to call functions in this file to process the login */ g_signal_connect(G_OBJECT(bok), "clicked", G_CALLBACK(nsgtk_login_ok_clicked), (gpointer)session); g_signal_connect(G_OBJECT(bcan), "clicked", G_CALLBACK(nsgtk_login_cancel_clicked), (gpointer)session); /* attach signal handlers to the entry boxes such that pressing * enter in one progresses the focus onto the next widget. */ g_signal_connect(G_OBJECT(euser), "activate", G_CALLBACK(nsgtk_login_next), (gpointer)epass); g_signal_connect(G_OBJECT(epass), "activate", G_CALLBACK(nsgtk_login_next), (gpointer)bok); /* make sure the username entry box currently has the focus */ gtk_widget_grab_focus(GTK_WIDGET(euser)); /* finally, show the window */ gtk_widget_show(GTK_WIDGET(wnd)); } void destroy_login_window(struct session_401 *session) { nsurl_unref(session->url); lwc_string_unref(session->host); free(session->realm); gtk_widget_destroy(GTK_WIDGET(session->wnd)); g_object_unref(G_OBJECT(session->x)); free(session); } void nsgtk_login_next(GtkWidget *w, gpointer data) { gtk_widget_grab_focus(GTK_WIDGET(data)); } void nsgtk_login_ok_clicked(GtkButton *w, gpointer data) { /* close the window and destroy it, having continued the fetch * assoicated with it. */ struct session_401 *session = (struct session_401 *)data; const gchar *user = gtk_entry_get_text(session->user); const gchar *pass = gtk_entry_get_text(session->pass); char *auth; auth = malloc(strlen(user) + strlen(pass) + 2); sprintf(auth, "%s:%s", user, pass); urldb_set_auth_details(session->url, session->realm, auth); free(auth); session->cb(true, session->cbpw); destroy_login_window(session); } void nsgtk_login_cancel_clicked(GtkButton *w, gpointer data) { struct session_401 *session = (struct session_401 *) data; session->cb(false, session->cbpw); /* close and destroy the window */ destroy_login_window(session); }
/* * Copyright (C) 2001 Momchil Velikov * Portions Copyright (C) 2001 Christoph Hellwig * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _LINUX_RADIX_TREE_H #define _LINUX_RADIX_TREE_H #include <linux/sched.h> #include <linux/preempt.h> #include <linux/types.h> #define RADIX_TREE_MAX_TAGS 2 /* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */ struct radix_tree_root { unsigned int height; gfp_t gfp_mask; struct radix_tree_node *rnode; }; #define RADIX_TREE_INIT(mask) { \ .height = 0, \ .gfp_mask = (mask), \ .rnode = NULL, \ } #define RADIX_TREE(name, mask) \ struct radix_tree_root name = RADIX_TREE_INIT(mask) #define INIT_RADIX_TREE(root, mask) \ do { \ (root)->height = 0; \ (root)->gfp_mask = (mask); \ (root)->rnode = NULL; \ } while (0) int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); void *radix_tree_lookup(struct radix_tree_root *, unsigned long); void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); void *radix_tree_delete(struct radix_tree_root *, unsigned long); unsigned int radix_tree_gang_lookup(struct radix_tree_root *root, void **results, unsigned long first_index, unsigned int max_items); /* * On a mutex based kernel we can freely schedule within the radix code: */ #ifdef CONFIG_PREEMPT_RT static inline int radix_tree_preload(gfp_t gfp_mask) { return 0; } #else int radix_tree_preload(gfp_t gfp_mask); #endif void radix_tree_init(void); void *radix_tree_tag_set(struct radix_tree_root *root, unsigned long index, unsigned int tag); void *radix_tree_tag_clear(struct radix_tree_root *root, unsigned long index, unsigned int tag); int radix_tree_tag_get(struct radix_tree_root *root, unsigned long index, unsigned int tag); unsigned int radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, unsigned long first_index, unsigned int max_items, unsigned int tag); int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); static inline void radix_tree_preload_end(void) { #ifndef CONFIG_PREEMPT_RT preempt_enable(); #endif } #endif /* _LINUX_RADIX_TREE_H */
#ifndef MEASURETIME_H #define MEASURETIME_H #ifdef __MACH__ #include <mach/clock.h> #include <mach/mach.h> #endif double gettime(){ // Fix for Mac OS X #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time clock_serv_t cclock; mach_timespec_t spec; host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); clock_get_time(cclock, &spec); mach_port_deallocate(mach_task_self(), cclock); #else struct timespec spec; clockid_t types[] = { CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID, (clockid_t) - 1 }; clock_gettime (types[0], &spec); clock_gettime(CLOCK_REALTIME, &spec); #endif return spec.tv_nsec/(double)1E9 + spec.tv_sec; } #endif // MEASURETIME_H
/* * PPRacer * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de> * * Copyright (C) 1999-2001 Jasmin F. Patry * * 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 _PP_TYPES_H_ #define _PP_TYPES_H_ #include "etracer.h" #include "ppgltk/alg/color.h" #include "ppgltk/alg/vec2d.h" #include "ppgltk/alg/vec3d.h" #include "ppgltk/alg/matrix.h" typedef struct { pp::Vec3d p[3]; pp::Vec2d t[3]; } triangle_t; /// Ray (half-line) typedef struct { pp::Vec3d pt; pp::Vec3d vec; } ray_t; /// Material typedef struct { pp::Color diffuse; pp::Color specular; float specular_exp; } material_t; /// Light typedef struct { bool is_on; GLfloat ambient[4]; GLfloat diffuse[4]; GLfloat specular[4]; GLfloat position[4]; GLfloat spot_direction[3]; GLfloat spot_exponent; GLfloat spot_cutoff; GLfloat constant_attenuation; GLfloat linear_attenuation; GLfloat quadratic_attenuation; } light_t; /// Key frame for animation sequences typedef struct { float time; pp::Vec3d pos; /// angle of rotation about y axis float yaw; /// angle of rotation about x axis float pitch; float l_shldr; float r_shldr; float l_hip; float r_hip; } key_frame_t; /// Scene graph node types. typedef enum { Empty, Sphere } geometry_t; /// Data for Sphere node type. typedef struct { float radius; /// How many divisions do we use to draw a sphere? int divisions; } sphere_t; /// Tux's eyes typedef enum { TuxLeftEye = 0, TuxRightEye = 1 } tux_eye_t; /// Scene graph node. typedef struct scene_node_struct { struct scene_node_struct* parent; struct scene_node_struct* next; struct scene_node_struct* child; /// type of node geometry_t geom; union { sphere_t sphere; } param; material_t* mat; /// Do we draw the shadow of this node? bool render_shadow; /// Is this node one of tux's eyes? bool eye; /// If so, which one? tux_eye_t which_eye; /// The forward and inverse transforms pp::Matrix trans; pp::Matrix invtrans; /// name of node (for debugging) char *name; } scene_node_t; #define NUM_TERRAIN_TYPES 64 /// Difficulty levels typedef enum { DIFFICULTY_LEVEL_EASY, DIFFICULTY_LEVEL_NORMAL, DIFFICULTY_LEVEL_HARD, DIFFICULTY_LEVEL_INSANE, DIFFICULTY_NUM_LEVELS } difficulty_level_t; /// Race conditions typedef enum { RACE_CONDITIONS_SUNNY, RACE_CONDITIONS_CLOUDY, RACE_CONDITIONS_NIGHT, RACE_CONDITIONS_EVENING, RACE_CONDITIONS_NUM_CONDITIONS } race_conditions_t; /// View mode typedef enum { BEHIND, FOLLOW, ABOVE, NUM_VIEW_MODES } view_mode_t; //// View point typedef struct { /// View mode view_mode_t mode; /// position of camera pp::Vec3d pos; /// position of player pp::Vec3d plyr_pos; /// viewing direction pp::Vec3d dir; /// up direction pp::Vec3d up; /// inverse view matrix pp::Matrix inv_view_mat; /// has view been initialized? bool initialized; } view_t; /// Control mode typedef enum { KEYBOARD = 0, MOUSE = 1, JOYSTICK = 2 } control_mode_t; /// Control data typedef struct { /// control mode control_mode_t mode; /// turning [-1,1] float turn_fact; /// animation step [-1,1] float turn_animation; /// is player braking? bool is_braking; /// is player paddling? bool is_paddling; float paddle_time; bool begin_jump; bool jumping; bool jump_charging; float jump_amt; float jump_start_time; bool barrel_roll_left; bool barrel_roll_right; float barrel_roll_factor; bool front_flip; bool back_flip; float flip_factor; } control_t; #endif // _PP_TYPES_H_
#include <sys/cdefs.h> __FBSDID("$FreeBSD: release/8.2.0/lib/libc/gen/getprogname.c 93399 2002-03-29 22:43:43Z markm $"); #include "namespace.h" #include <stdlib.h> #include "un-namespace.h" #include "libc_private.h" __weak_reference(_getprogname, getprogname); const char * _getprogname(void) { return (__progname); }
/*----------------------------------------------------------------- sprintf.c - formatted output conversion Copyright (C) 1999, Martijn van Balen <aed AT iae.nl> Refactored by - Maarten Brock (2004) This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, if you link this library with other files, some of which are compiled with SDCC, to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. -------------------------------------------------------------------------*/ #include <stdarg.h> #include <stdio.h> static void put_char_to_string (char c, void* p) _REENTRANT { char **buf = (char **)p; *(*buf)++ = c; } int vsprintf (char *buf, const char *format, va_list ap) { int i; i = _print_format (put_char_to_string, &buf, format, ap); *buf = 0; return i; } int sprintf (char *buf, const char *format, ...) { va_list arg; int i; va_start (arg, format); i = _print_format (put_char_to_string, &buf, format, arg); *buf = 0; va_end (arg); return i; }
/* * Copyright © 2011 Keith Packard <keithp@keithp.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 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. * * 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. */ /* * ao_log_single.c * * Stores a sequence of fixed-size (32 byte) chunks * without splitting memory up into separate flights */ #include "ao.h" #include "ao_product.h" static __xdata struct ao_task ao_log_single_task; __xdata uint8_t ao_log_running; __xdata uint8_t ao_log_mutex; __pdata uint32_t ao_log_start_pos; __pdata uint32_t ao_log_end_pos; __pdata uint32_t ao_log_current_pos; __xdata union ao_log_single ao_log_single_write_data; __xdata union ao_log_single ao_log_single_read_data; uint8_t ao_log_single_write(void) { uint8_t wrote = 0; ao_mutex_get(&ao_log_mutex); { if (ao_log_current_pos >= ao_log_end_pos && ao_log_running) ao_log_single_stop(); if (ao_log_running) { wrote = 1; ao_storage_write(ao_log_current_pos, &ao_log_single_write_data, AO_LOG_SINGLE_SIZE); ao_log_current_pos += AO_LOG_SINGLE_SIZE; } } ao_mutex_put(&ao_log_mutex); return wrote; } static uint8_t ao_log_single_valid(void) { __xdata uint8_t *d = ao_log_single_read_data.bytes; uint8_t i; for (i = 0; i < AO_LOG_SINGLE_SIZE; i++) if (*d++ != 0xff) return 1; return 0; } uint8_t ao_log_single_read(uint32_t pos) { if (!ao_storage_read(pos, &ao_log_single_read_data, AO_LOG_SINGLE_SIZE)) return 0; return ao_log_single_valid(); } void ao_log_single_start(void) { if (!ao_log_running) { ao_log_running = 1; ao_wakeup(&ao_log_running); } } void ao_log_single_stop(void) { if (ao_log_running) { ao_log_running = 0; } } void ao_log_single_restart(void) { /* Find end of data */ ao_log_end_pos = ao_storage_config; for (ao_log_current_pos = 0; ao_log_current_pos < ao_storage_config; ao_log_current_pos += ao_storage_block) { if (!ao_log_single_read(ao_log_current_pos)) break; } if (ao_log_current_pos > 0) { ao_log_current_pos -= ao_storage_block; for (; ao_log_current_pos < ao_storage_config; ao_log_current_pos += sizeof (struct ao_log_telescience)) { if (!ao_log_single_read(ao_log_current_pos)) break; } } } void ao_log_single_set(void) { printf("Logging currently %s\n", ao_log_running ? "on" : "off"); ao_cmd_hex(); if (ao_cmd_status == ao_cmd_success) { if (ao_cmd_lex_i) { printf("Logging from %ld to %ld\n", ao_log_current_pos, ao_log_end_pos); ao_log_single_start(); } else { printf ("Log stopped at %ld\n", ao_log_current_pos); ao_log_single_stop(); } } ao_cmd_status = ao_cmd_success; } void ao_log_single_delete(void) { uint32_t pos; ao_cmd_hex(); if (ao_cmd_status != ao_cmd_success) return; if (ao_cmd_lex_i != 1) { ao_cmd_status = ao_cmd_syntax_error; printf("No such flight: %d\n", ao_cmd_lex_i); return; } ao_log_single_stop(); for (pos = 0; pos < ao_storage_config; pos += ao_storage_block) { if (!ao_log_single_read(pos)) break; ao_storage_erase(pos); } ao_log_current_pos = ao_log_start_pos = 0; if (pos == 0) printf("No such flight: %d\n", ao_cmd_lex_i); else printf ("Erased\n"); } uint8_t ao_log_full(void) { return ao_log_current_pos >= ao_log_end_pos; } uint8_t ao_log_present(void) { return ao_log_single_read(0); } static void ao_log_single_query(void) { printf("Logging enabled: %d\n", ao_log_running); printf("Log start: %ld\n", ao_log_start_pos); printf("Log cur: %ld\n", ao_log_current_pos); printf("Log end: %ld\n", ao_log_end_pos); ao_log_single_extra_query(); } const struct ao_cmds ao_log_single_cmds[] = { { ao_log_single_set, "L <0 off, 1 on>\0Set logging" }, { ao_log_single_list, "l\0List stored logs" }, { ao_log_single_delete, "d 1\0Delete all stored logs" }, { ao_log_single_query, "q\0Query log status" }, { 0, NULL }, }; void ao_log_single_init(void) { ao_log_running = 0; ao_cmd_register(&ao_log_single_cmds[0]); ao_add_task(&ao_log_single_task, ao_log_single, "log"); }
/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp <dok@directfb.org>, Andreas Hundt <andi@fischlustig.de>, Sven Neumann <neo@directfb.org>, Ville Syrjälä <syrjala@sci.fi> and Claudio Ciccani <klan@users.sf.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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __INPUT_DRIVER_H__ #define __INPUT_DRIVER_H__ #include <core/input.h> static int driver_get_available( void ); static void driver_get_info( InputDriverInfo *info ); static DFBResult driver_open_device( CoreInputDevice *device, unsigned int number, InputDeviceInfo *info, void **driver_data ); static DFBResult driver_get_keymap_entry( CoreInputDevice *device, void *driver_data, DFBInputDeviceKeymapEntry *entry ); #ifdef DFB_INPUTDRIVER_HAS_AXIS_INFO static DFBResult driver_get_axis_info( CoreInputDevice *device, void *driver_data, DFBInputDeviceAxisIdentifier axis, DFBInputDeviceAxisInfo *ret_info ); #endif static void driver_close_device( void *driver_data ); static const InputDriverFuncs driver_funcs = { .GetAvailable = driver_get_available, .GetDriverInfo = driver_get_info, .OpenDevice = driver_open_device, .GetKeymapEntry = driver_get_keymap_entry, .CloseDevice = driver_close_device, #ifdef DFB_INPUTDRIVER_HAS_AXIS_INFO .GetAxisInfo = driver_get_axis_info #endif }; #define DFB_INPUT_DRIVER(shortname) \ __attribute__((constructor)) void directfb_##shortname##_ctor( void ); \ __attribute__((destructor)) void directfb_##shortname##_dtor( void ); \ \ void \ directfb_##shortname##_ctor( void ) \ { \ direct_modules_register( &dfb_input_modules, DFB_INPUT_DRIVER_ABI_VERSION, \ #shortname, &driver_funcs ); \ } \ \ void \ directfb_##shortname##_dtor( void ) \ { \ direct_modules_unregister( &dfb_input_modules, #shortname ); \ } #endif
/* SconeServer (http://www.sconemad.com) Socket address for TCP/IP version 4 (host:port) Copyright (c) 2000-2011 Andrew Wedgbury <wedge@sconemad.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. You should have received a copy of the GNU General Public License along with this program (see the file COPYING); if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef ipSocketAddress_h #define ipSocketAddress_h #include <sconex/SocketAddress.h> #include <sconex/Module.h> //============================================================================= class IPSocketAddress : public scx::SocketAddress { public: IPSocketAddress(scx::Module* module, const scx::ScriptRef* args); IPSocketAddress(const IPSocketAddress& c); virtual ~IPSocketAddress(); // SocketAddress methods virtual scx::ScriptObject* new_copy() const; virtual bool valid_for_bind() const; virtual bool valid_for_connect() const; virtual void set_sockaddr(const struct sockaddr* sa); virtual const struct sockaddr* get_sockaddr() const; virtual socklen_t get_sockaddr_size() const; // ScriptObject methods virtual std::string get_string() const; virtual scx::ScriptRef* script_op(const scx::ScriptAuth& auth, const scx::ScriptRef& ref, const scx::ScriptOp& op, const scx::ScriptRef* right=0); // Address/host methods void set_address(const std::string& addr); void set_address(int ip1,int ip2,int ip3,int ip4); std::string get_address() const; // Get ip address in form xxx.xxx.xxx.xxx const std::string& get_host() const; // Get host name (resolves if required) // Port/service methods void set_port(const std::string& port); void set_port(unsigned short port); unsigned short get_port() const; // Get the port in numerical form const std::string& get_service() const; // Get the service name (resolves if required) std::string get_type_name() const; // Get a string describing the socket type, e.g. "tcp" or "udp" protected: scx::Module::Ref m_module; struct sockaddr_in m_addr; std::string m_host; std::string m_service; bool m_valid; }; #endif
// Adapter Without network // SQLGetData() test // SQLNumResultCols test // #include<stdio.h> #include<stdlib.h> #include<sql.h> #include<sqlext.h> #include<string.h> //************************************************************************* inline void checkrc(int rc,int line) { if(rc) { printf("ERROR %d at line %d\n",rc,line); exit(1); } } //************************************************************************* int InsertTest(SQLHANDLE env,SQLHANDLE dbc,SQLHANDLE stmt) { int ret; int f1=90; // f1 field int f2=20;//f2 field ret = SQLPrepare(stmt,(unsigned char*)"INSERT INTO t1 VALUES(?,?)",SQL_NTS); checkrc(ret,__LINE__); // BIND PARAMETER ret = SQLBindParameter(stmt,1,SQL_PARAM_INPUT,SQL_C_SLONG,SQL_INTEGER,0,0,&f1,0,NULL); checkrc(ret,__LINE__); ret = SQLBindParameter(stmt,2,SQL_PARAM_INPUT,SQL_C_SLONG,SQL_INTEGER,0,0,&f2,0,NULL); checkrc(ret,__LINE__); int i,count=0; for(i=0;i<10;i++) { f1++; f2++; ret = SQLExecute(stmt); checkrc(ret,__LINE__); ret = SQLTransact(env,dbc,SQL_COMMIT); checkrc(ret,__LINE__); count++; } printf("Total row inserted=%d\n",count); return 0; } //*********************************************************************** // FETCH ROWS FROM THE TABLE "T1"......select * from T1; int FetchTest(SQLHANDLE env, SQLHANDLE dbc, SQLHANDLE stmt) { int ret; int f1=0; // f1 field int f2=0;//f2 field int rettype ; ret = SQLPrepare(stmt,(unsigned char*)"SELECT f1,f2 FROM t1 ",SQL_NTS); rettype = ret; if(rettype!=0)return 1; /* ret = SQLBindCol(stmt,1,SQL_C_SLONG,&f1,0,NULL); ret = SQLBindCol(stmt,2,SQL_C_SLONG,&f2,0,NULL); */ int j, count=0; ret = SQLExecute(stmt); SQLSMALLINT noc; ret = SQLNumResultCols(stmt,&noc); printf("SQLNumResultCol() returns = %d\n",noc); SQLINTEGER slen = SQL_NTS; while(SQL_SUCCEEDED(ret = SQLFetch(stmt))) { ret=SQLGetData(stmt, 1, SQL_C_SLONG, &f1, 0,&slen ); checkrc(ret,__LINE__); ret=SQLGetData(stmt, 2, SQL_C_SLONG, &f2, 0,&slen ); checkrc(ret,__LINE__); count++; printf("F1=%d\tF2=%d\n",f1,f2); } ret = SQLCloseCursor(stmt); checkrc(ret,__LINE__); ret = SQLTransact(env,dbc,SQL_COMMIT); checkrc(ret,__LINE__); printf("Total row fetched=%d\n",count); return 0; } int main() { SQLHENV env; SQLHDBC dbc; SQLHSTMT stmt; SQLRETURN ret; SQLCHAR outstr[1024]; SQLSMALLINT outstrlen; // Aloocate an environment handle ret=SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&env); checkrc(ret,__LINE__); //we need odbc3 support SQLSetEnvAttr(env,SQL_ATTR_ODBC_VERSION,(void*)SQL_OV_ODBC3,0); //ALLOCATE A Connection handle ret = SQLAllocHandle(SQL_HANDLE_DBC,env,&dbc); checkrc(ret,__LINE__); // connect to the DSN mydsn ret = SQLConnect (dbc, (SQLCHAR *) "DSN=mycsql;MODE=ADAPTER;SERVER=localhost;PORT=5678;", (SQLSMALLINT) strlen ("DSN=mycsql;MODE=ADAPTER;SERVER=localhost;PORT=5678;"), (SQLCHAR *) "root", (SQLSMALLINT) strlen ("root"), (SQLCHAR *) "manager", (SQLSMALLINT) strlen ("")); if(SQL_SUCCEEDED(ret)) { printf("\nConnected to the Data Source..\n"); } else { printf("error in connection\n"); return 1; ret = SQLFreeHandle(SQL_HANDLE_DBC,dbc); checkrc(ret,__LINE__); ret = SQLFreeHandle(SQL_HANDLE_ENV,env); checkrc(ret,__LINE__); return 1; } //****************************************************************** // TABLE CREATED ret = SQLAllocHandle(SQL_HANDLE_STMT,dbc,&stmt); checkrc(ret,__LINE__); SQLCHAR table[100]= "CREATE TABLE t1(f1 INT,f2 INT)"; ret = SQLPrepare(stmt,table,SQL_NTS); checkrc(ret,__LINE__); ret = SQLExecute(stmt); checkrc(ret,__LINE__); printf("\nTABLE CREATED\n"); //**************************************************************** InsertTest(env,dbc,stmt); //***************************************************************** int ret1; ret1=FetchTest(env,dbc,stmt); //**************************************************************** ret = SQLPrepare(stmt,(unsigned char*)"DROP TABLE t1",SQL_NTS); checkrc(ret,__LINE__); ret = SQLExecute(stmt); checkrc(ret,__LINE__); printf("Table 't1' dropped\n"); ret = SQLFreeHandle(SQL_HANDLE_STMT,stmt); checkrc(ret,__LINE__); ret = SQLDisconnect(dbc); checkrc(ret,__LINE__); ret = SQLFreeHandle(SQL_HANDLE_DBC,dbc); checkrc(ret,__LINE__); ret = SQLFreeHandle(SQL_HANDLE_ENV,env); checkrc(ret,__LINE__); return 0; }
/** * @file * * This include file contains some definitions specific to the * JMR3904 simulator in gdb. */ /* * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #ifndef _BSP_H #define _BSP_H #ifdef __cplusplus extern "C" { #endif #include <bspopts.h> #include <bsp/default-initial-extension.h> #include <rtems.h> #include <rtems/iosupp.h> #include <rtems/console.h> #include <rtems/clockdrv.h> #include <libcpu/tx3904.h> #define BSP_FEATURE_IRQ_EXTENSION #define BSP_SHARED_HANDLER_SUPPORT 1 #ifdef __cplusplus } #endif #endif
/* * Copyright (C) 2013-2015 DeathCore <http://www.noffearrdeathproject.net/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __BATTLEGROUNDTP_H #define __BATTLEGROUNDTP_H #include "Battleground.h" #include "BattlegroundScore.h" class BattlegroundTPScore final : public BattlegroundScore { protected: BattlegroundTPScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0), FlagReturns(0) { } void UpdateScore(uint32 type, uint32 value) override { switch (type) { case SCORE_FLAG_CAPTURES: FlagCaptures += value; break; case SCORE_FLAG_RETURNS: FlagReturns += value; break; default: BattlegroundScore::UpdateScore(type, value); break; } } void BuildObjectivesBlock(std::vector<int32>& stats) override { stats.push_back(FlagCaptures); stats.push_back(FlagReturns); } uint32 GetAttr1() const final override { return FlagCaptures; } uint32 GetAttr2() const final override { return FlagReturns; } uint32 FlagCaptures; uint32 FlagReturns; }; class BattlegroundTP : public Battleground { public: BattlegroundTP(); ~BattlegroundTP(); }; #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ #define UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ #include "base/compiler_specific.h" #include "base/strings/string16.h" #include "ui/base/accessibility/accessibility_types.h" #include "ui/base/models/dialog_model.h" #include "ui/base/ui_base_types.h" #include "ui/views/widget/widget_delegate.h" namespace views { class DialogClientView; class VIEWS_EXPORT DialogDelegate : public ui::DialogModel, public WidgetDelegate { public: virtual ~DialogDelegate(); static Widget* CreateDialogWidget(DialogDelegate* dialog, gfx::NativeWindow context, gfx::NativeWindow parent); virtual View* CreateExtraView(); virtual View* CreateTitlebarExtraView(); virtual View* CreateFootnoteView(); virtual bool Cancel(); virtual bool Accept(bool window_closing); virtual bool Accept(); virtual bool Close(); virtual base::string16 GetDialogLabel() const OVERRIDE; virtual base::string16 GetDialogTitle() const OVERRIDE; virtual int GetDialogButtons() const OVERRIDE; virtual int GetDefaultDialogButton() const OVERRIDE; virtual bool ShouldDefaultButtonBeBlue() const OVERRIDE; virtual base::string16 GetDialogButtonLabel( ui::DialogButton button) const OVERRIDE; virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; virtual View* GetInitiallyFocusedView() OVERRIDE; virtual DialogDelegate* AsDialogDelegate() OVERRIDE; virtual ClientView* CreateClientView(Widget* widget) OVERRIDE; virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) OVERRIDE; static NonClientFrameView* CreateDialogFrameView(Widget* widget); static NonClientFrameView* CreateDialogFrameView(Widget* widget, bool force_opaque_border); virtual bool UseNewStyleForThisDialog() const; virtual void OnClosed() {} const DialogClientView* GetDialogClientView() const; DialogClientView* GetDialogClientView(); protected: virtual ui::AccessibilityTypes::Role GetAccessibleWindowRole() const OVERRIDE; }; class VIEWS_EXPORT DialogDelegateView : public DialogDelegate, public View { public: DialogDelegateView(); virtual ~DialogDelegateView(); virtual void DeleteDelegate() OVERRIDE; virtual Widget* GetWidget() OVERRIDE; virtual const Widget* GetWidget() const OVERRIDE; virtual View* GetContentsView() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); }; } #endif
/** * @file sha512_224.c * @brief SHA-512/224 (Secure Hash Algorithm) * * @section License * * Copyright (C) 2010-2013 Oryx Embedded. All rights reserved. * * This file is part of CycloneCrypto Open. * * 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. * * @section Description * * SHA-512/224 is a secure hash algorithm for computing a condensed representation * of an electronic message. Refer to FIPS 180-4 for more details * * @author Oryx Embedded (www.oryx-embedded.com) * @version 1.3.8 **/ //Switch to the appropriate trace level #define TRACE_LEVEL CRYPTO_TRACE_LEVEL //Dependencies #include <string.h> #include "crypto.h" #include "sha512_224.h" //Check crypto library configuration #if (SHA512_224_SUPPORT == ENABLED) //SHA-512/224 object identifier (2.16.840.1.101.3.4.2.5) static const uint8_t sha512_224Oid[] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x05}; //Common interface for hash algorithms const HashAlgo sha512_224HashAlgo = { "SHA-512/224", sha512_224Oid, sizeof(sha512_224Oid), sizeof(Sha512_224Context), SHA512_224_BLOCK_SIZE, SHA512_224_DIGEST_SIZE, (HashAlgoCompute) sha512_224Compute, (HashAlgoInit) sha512_224Init, (HashAlgoUpdate) sha512_224Update, (HashAlgoFinal) sha512_224Final }; /** * @brief Digest a message using SHA-512/224 * @param[in] data Pointer to the message being hashed * @param[in] length Length of the message * @param[out] digest Pointer to the calculated digest * @return Error code **/ error_t sha512_224Compute(const void *data, size_t length, uint8_t *digest) { //Allocate a memory buffer to hold the SHA-512/224 context Sha512_224Context *context = osMemAlloc(sizeof(Sha512_224Context)); //Failed to allocate memory? if(!context) return ERROR_OUT_OF_MEMORY; //Initialize the SHA-512/224 context sha512_224Init(context); //Digest the message sha512_224Update(context, data, length); //Finalize the SHA-512/224 message digest sha512_224Final(context, digest); //Free previously allocated memory osMemFree(context); //Successful processing return NO_ERROR; } /** * @brief Initialize SHA-512/224 message digest context * @param[in] context Pointer to the SHA-512/224 context to initialize **/ void sha512_224Init(Sha512_224Context *context) { //Set initial hash value context->h[0] = 0x8C3D37C819544DA2; context->h[1] = 0x73E1996689DCD4D6; context->h[2] = 0x1DFAB7AE32FF9C82; context->h[3] = 0x679DD514582F9FCF; context->h[4] = 0x0F6D2B697BD44DA8; context->h[5] = 0x77E36F7304C48942; context->h[6] = 0x3F9D85A86A1D36C8; context->h[7] = 0x1112E6AD91D692A1; //Number of bytes in the buffer context->size = 0; //Total length of the message context->totalSize = 0; } /** * @brief Update the SHA-512/224 context with a portion of the message being hashed * @param[in] context Pointer to the SHA-512/224 context * @param[in] data Pointer to the buffer being hashed * @param[in] length Length of the buffer **/ void sha512_224Update(Sha512_224Context *context, const void *data, size_t length) { //The function is defined in the exact same manner as SHA-512 sha512Update(context, data, length); } /** * @brief Finish the SHA-512/224 message digest * @param[in] context Pointer to the SHA-512/224 context * @param[out] digest Calculated digest (optional parameter) **/ void sha512_224Final(Sha512_224Context *context, uint8_t *digest) { //The function is defined in the exact same manner as SHA-512 sha512Final(context, NULL); //Copy the resulting digest if(digest != NULL) memcpy(digest, context->digest, SHA512_224_DIGEST_SIZE); } #endif
// // CityManageViewController.h // 天气 // // Created by qianfeng on 14/5/9. // Copyright © 2014年 zhangying. All rights reserved. // #import "BaseViewController.h" @protocol CityManageViewControllerDelegate <NSObject> - (void)cityManagerVCPopToLocationCity; - (void)changeCurrentChooseCity:(NSInteger)cityIndex; @end @interface CityManageViewController : BaseViewController @property (nonatomic, weak) id<CityManageViewControllerDelegate> delegate; @end
/* * %kadu copyright begin% * Copyright 2011 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) * %kadu copyright end% * * 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/>. */ #pragma once #include "configuration/configuration-aware-object.h" #include <QtCore/QObject> #include <QtCore/QPointer> #include <injeqt/injeqt.h> class Configuration; class PathsProvider; class AutostatusConfiguration : public QObject, private ConfigurationAwareObject { Q_OBJECT public: Q_INVOKABLE explicit AutostatusConfiguration(QObject *parent = nullptr); virtual ~AutostatusConfiguration(); int autoTime() { return AutoTime; } int autoStatus() { return AutoStatus; } const QString &statusFilePath() { return StatusFilePath; } protected: virtual void configurationUpdated(); private: QPointer<Configuration> m_configuration; QPointer<PathsProvider> m_pathsProvider; int AutoTime; int AutoStatus; QString StatusFilePath; private slots: INJEQT_SET void setConfiguration(Configuration *configuration); INJEQT_SET void setPathsProvider(PathsProvider *pathsProvider); INJEQT_INIT void init(); };
#define INET6 #define BUILD_TARGET #define MODULE_DATATYPE void #define MODULE_NAME "TRACE" #include "../module_iface.h" ModuleDef _module = { .type = MODULE_TYPE, .name = MODULE_NAME, .size = IP6T_ALIGN(0), .size_uspace = IP6T_ALIGN(0), }; ModuleDef *init(void) { return(&_module); } /* vim: ts=4 */
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Copyright (C) 2009 Sun Microsystems, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include <drizzled/statement.h> namespace drizzled { class Session; namespace statement { class ChangeSchema : public Statement { public: ChangeSchema(Session *in_session) : Statement(in_session) { set_command(SQLCOM_CHANGE_DB); } bool execute(); }; } /* namespace statement */ } /* namespace drizzled */
#ifndef REDDIT_CONSTANTS_H #define REDDIT_CONSTANTS_H namespace reddit { const char kCommentPrefix[] = "t1"; const char kAccountPrefix[] = "t2"; const char kLinkPrefix[] = "t3"; const char kMessagePrefix[] = "t4"; const char kSubredditPrefix[] = "t5"; const char kListingPrefix[] = "Listing"; const char kMorePrefix[] = "more"; const char kRedditUrl[] = "http://reddit.com/"; }; // namespace reddit #endif
#ifndef _X86_IRQFLAGS_H_ #define _X86_IRQFLAGS_H_ #include <asm/processor-flags.h> #ifndef __ASSEMBLY__ /* * Interrupt control: */ static inline unsigned long native_save_fl(void) { unsigned long flags; /* * "=rm" is safe here, because "pop" adjusts the stack before * it evaluates its effective address -- this is part of the * documented behavior of the "pop" instruction. */ asm volatile("# __raw_save_flags\n\t" "pushf ; pop %0" : "=rm" (flags) : /* no input */ : "memory"); return flags; } static inline void native_restore_fl(unsigned long flags) { asm volatile("push %0 ; popf" : /* no output */ :"g" (flags) :"memory", "cc"); } static inline void native_irq_disable(void) { asm volatile("cli": : :"memory"); } static inline void native_irq_enable(void) { asm volatile("sti": : :"memory"); } static inline void native_safe_halt(void) { asm volatile("sti; hlt": : :"memory"); } static inline void native_halt(void) { asm volatile("hlt": : :"memory"); } #endif #ifdef CONFIG_PARAVIRT #include <asm/paravirt.h> #else #ifndef __ASSEMBLY__ static inline unsigned long arch_local_save_flags(void) { return native_save_fl(); } static inline void arch_local_irq_restore(unsigned long flags) { native_restore_fl(flags); } static inline void arch_local_irq_disable(void) { native_irq_disable(); } static inline void arch_local_irq_enable(void) { native_irq_enable(); } /* * Used in the idle loop; sti takes one instruction cycle * to complete: */ static inline void arch_safe_halt(void) { native_safe_halt(); } /* * Used when interrupts are already enabled or to * shutdown the processor: */ static inline void halt(void) { native_halt(); } /* * For spinlocks, etc: */ static inline unsigned long arch_local_irq_save(void) { unsigned long flags = arch_local_save_flags(); arch_local_irq_disable(); return flags; } #else #define ENABLE_INTERRUPTS(x) sti #define DISABLE_INTERRUPTS(x) cli #ifdef CONFIG_X86_64 #define SWAPGS swapgs /* * Currently paravirt can't handle swapgs nicely when we * don't have a stack we can rely on (such as a user space * stack). So we either find a way around these or just fault * and emulate if a guest tries to call swapgs directly. * * Either way, this is a good way to document that we don't * have a reliable stack. x86_64 only. */ #define SWAPGS_UNSAFE_STACK swapgs #define PARAVIRT_ADJUST_EXCEPTION_FRAME /* */ #define INTERRUPT_RETURN iretq #define USERGS_SYSRET64 \ swapgs; \ sysretq; #define USERGS_SYSRET32 \ swapgs; \ sysretl #define ENABLE_INTERRUPTS_SYSEXIT32 \ swapgs; \ sti; \ sysexit #else #define INTERRUPT_RETURN iret #define ENABLE_INTERRUPTS_SYSEXIT sti; sysexit #define GET_CR0_INTO_EAX movl %cr0, %eax #endif #endif /* __ASSEMBLY__ */ #endif /* CONFIG_PARAVIRT */ #ifndef __ASSEMBLY__ static inline int arch_irqs_disabled_flags(unsigned long flags) { return !(flags & X86_EFLAGS_IF); } static inline int arch_irqs_disabled(void) { unsigned long flags = arch_local_save_flags(); return arch_irqs_disabled_flags(flags); } #else #ifdef CONFIG_X86_64 #define ARCH_LOCKDEP_SYS_EXIT call lockdep_sys_exit_thunk #define ARCH_LOCKDEP_SYS_EXIT_IRQ \ TRACE_IRQS_ON; \ sti; \ SAVE_REST; \ LOCKDEP_SYS_EXIT; \ RESTORE_REST; \ cli; \ TRACE_IRQS_OFF; #else #define ARCH_LOCKDEP_SYS_EXIT \ pushl %eax; \ pushl %ecx; \ pushl %edx; \ call lockdep_sys_exit; \ popl %edx; \ popl %ecx; \ popl %eax; #define ARCH_LOCKDEP_SYS_EXIT_IRQ #endif #ifdef CONFIG_TRACE_IRQFLAGS # define TRACE_IRQS_ON call trace_hardirqs_on_thunk; # define TRACE_IRQS_OFF call trace_hardirqs_off_thunk; #else # define TRACE_IRQS_ON # define TRACE_IRQS_OFF #endif #ifdef CONFIG_DEBUG_LOCK_ALLOC # define LOCKDEP_SYS_EXIT ARCH_LOCKDEP_SYS_EXIT # define LOCKDEP_SYS_EXIT_IRQ ARCH_LOCKDEP_SYS_EXIT_IRQ # else # define LOCKDEP_SYS_EXIT # define LOCKDEP_SYS_EXIT_IRQ # endif #endif /* __ASSEMBLY__ */ #endif
/*This module is created to simulate a dynamic array and to make/alter linked lists F.A. Kuipers 25/01/2000*/ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <assert.h> /*dynamic_array represents an array of integers*/ struct dynamic_array{ int data; /*data gives the data in the array*/ int index; /*index gives the place in the array*/ struct dynamic_array* next; /*point to the next element in the array*/ }; /*dynamic_vector represents a array of doubles*/ struct dynamic_vector{ double data; int index; struct dynamic_vector* next; }; /*This function calculates the length of a dynamic_array, by retrieving the maximum index number*/ int length_array(struct dynamic_array* head) { struct dynamic_array* current = head; int count = 0; if(current!=NULL){ while(current!=NULL){ if((current->index)>count) count = current->index; current = current->next; } return count+1; } else return 0; } /*This function puts an element at the head of the array*/ void putdata(struct dynamic_array** headref, int index, int data) { struct dynamic_array* newnode = malloc(sizeof(struct dynamic_array)); newnode->data = data; newnode->index = index; newnode->next = (*headref); (*headref) = newnode; } /*This function retrieves the data placed at a certain index. If there is no data present, a 0 will be returned*/ int getdata(struct dynamic_array* head, int index) { struct dynamic_array* current = head; int count = 0; /*the index of the node we're currently looking at*/ int result; while(current != NULL){ if(current->index==index) return(current->data); count++; current = current->next; } return(0); } /*This function inserts data at a certain place in the array (index). This function calls the function putdata*/ void insertdata(struct dynamic_array** headref, int index, int data) { if(*headref==NULL){ putdata(headref,index,data); } else{ struct dynamic_array* current = *headref; struct dynamic_array* prevcur; while((current!=NULL)&&(current->index!=index)){ prevcur = current; current = current->next; } if(current!=NULL){ current->data = data; } else{ putdata(&(prevcur->next),index,data); } } } /*This function deallocates the memmory allocated for the dynamic array. When a dynamic array isn't used any more, this function should be called*/ void delete_array(struct dynamic_array** headref) { struct dynamic_array* current = *headref; struct dynamic_array* next; while(current!=NULL){ next = current->next; free(current); current = next; } *headref = NULL; } /*The function below are the same as above, but apply to the dynamic array of doubles*/ int length_vector(struct dynamic_vector* head) { struct dynamic_vector* temp = head; int count = 0; if(temp!=NULL){ while(temp!=NULL){ if((temp->index)>count) count = temp->index; temp = temp->next; } return count+1; } else return 0; } void putdatad(headref, index, data) struct dynamic_vector** headref; int index; double data; { struct dynamic_vector* newnode = malloc(sizeof(struct dynamic_vector)); newnode->data = data; newnode->index = index; newnode->next = (*headref); (*headref) = newnode; } double getdatad(head, index) struct dynamic_vector* head; int index; { struct dynamic_vector* new = head; int count = 0; double result; while(new != NULL){ if(new->index==index){ result = (new->data); return result; } count++; new = new->next; } return 0.0; } void insertdatad(headref, index, data) struct dynamic_vector** headref; int index; double data; { if(*headref==NULL){ putdatad(headref, index, data); } else{ struct dynamic_vector* current = *headref; struct dynamic_vector* prevcur; while((current!=NULL)&&(current->index!=index)){ prevcur = current; current = current->next; } if(current!=NULL){ current->data = data; } else{ putdatad(&(prevcur->next), index, data); } } } void delete_vector(struct dynamic_vector** headref) { struct dynamic_vector* current = *headref; struct dynamic_vector* next; while(current!=NULL){ next = current->next; free(current); current = next; } *headref = NULL; }
/* * Author: MontaVista Software, Inc. <source@mvista.com> * * 2008 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #include <linux/init.h> #include <linux/mvl_patch.h> static __init int regpatch(void) { return mvl_register_patch(916); } module_init(regpatch);
/* This file is part of the KDE project Copyright (C) 1998, 1999 Torben Weis <weis@kde.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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __konq_textviewitem_h__ #define __konq_textviewitem_h__ #include <qlistview.h> #include <qstring.h> #include <kio/global.h> #include <klocale.h> #include "konq_listviewitems.h" #include "konq_textviewwidget.h" class KFileItem; class QPainter; #define KTVI_REGULAR 0 #define KTVI_REGULARLINK 1 #define KTVI_EXEC 2 #define KTVI_DIR 3 #define KTVI_DIRLINK 4 #define KTVI_BADLINK 5 #define KTVI_SOCKET 6 #define KTVI_CHARDEV 7 #define KTVI_BLOCKDEV 8 #define KTVI_FIFO 9 #define KTVI_UNKNOWN 10 class KonqTextViewItem : public KonqBaseListViewItem { public: /** * Create an item in the text toplevel representing a file * @param _parent the parent widget, the text view * @param _fileitem the file item created by KDirLister */ KonqTextViewItem( KonqTextViewWidget *_parent, KFileItem* _fileitem ); virtual ~KonqTextViewItem() {/*cerr<<"~KonqTextViewItem: "<<text(1)<<endl;*/ }; virtual int compare( QListViewItem* i, int col, bool ascending ) const; // virtual QString key( int _column, bool asc) const; /** Call this before destroying the text view (decreases reference count * on the view)*/ virtual void paintCell( QPainter *_painter, const QColorGroup & _cg, int _column, int _width, int _alignment ); // virtual void paintFocus( QPainter *_painter, const QColorGroup & _cg, const QRect & r ); virtual void updateContents(); protected: virtual void setup(); int type; }; inline KonqTextViewItem::KonqTextViewItem( KonqTextViewWidget *_parent, KFileItem* _fileitem ) :KonqBaseListViewItem( _parent,_fileitem ) { updateContents(); } #endif
/* * Common AAC and AC-3 parser * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2003 Michael Niedermayer * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/common.h" #include "parser.h" #include "aac_ac3_parser.h" int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) { AACAC3ParseContext *s = s1->priv_data; ParseContext *pc = &s->pc; int len, i; int new_frame_start; get_next: i=END_NOT_FOUND; if(s->remaining_size <= buf_size){ if(s->remaining_size && !s->need_next_header){ i= s->remaining_size; s->remaining_size = 0; }else{ //we need a header first len=0; for(i=s->remaining_size; i<buf_size; i++){ s->state = (s->state<<8) + buf[i]; if((len=s->sync(s->state, s, &s->need_next_header, &new_frame_start))) break; } if(len<=0){ i=END_NOT_FOUND; }else{ s->state=0; i-= s->header_size -1; s->remaining_size = len; if(!new_frame_start || pc->index+i<=0){ s->remaining_size += i; goto get_next; } } } } if(ff_combine_frame(pc, i, &buf, &buf_size)<0){ s->remaining_size -= FFMIN(s->remaining_size, buf_size); *poutbuf = NULL; *poutbuf_size = 0; return buf_size; } *poutbuf = buf; *poutbuf_size = buf_size; /* update codec info */ if(s->codec_id) avctx->codec_id = s->codec_id; /* Due to backwards compatible HE-AAC the sample rate, channel count, and total number of samples found in an AAC ADTS header are not reliable. Bit rate is still accurate because the total frame duration in seconds is still correct (as is the number of bits in the frame). */ if (avctx->codec_id != AV_CODEC_ID_AAC) { avctx->sample_rate = s->sample_rate; /* allow downmixing to stereo (or mono for AC-3) */ if(avctx->request_channels > 0 && avctx->request_channels < s->channels && (avctx->request_channels <= 2 || (avctx->request_channels == 1 && (avctx->codec_id == AV_CODEC_ID_AC3 || avctx->codec_id == AV_CODEC_ID_EAC3)))) { avctx->channels = avctx->request_channels; } else { avctx->channels = s->channels; avctx->channel_layout = s->channel_layout; } avctx->frame_size = s->samples; avctx->audio_service_type = s->service_type; } avctx->bit_rate = s->bit_rate; return i; }
/* LFN.c - long file name functions. Copyright (C) 2000 Imre Leber 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. If you have any questions, comments, suggestions, or fixes please email me at: imre.leber@worldonline.be */ #include <assert.h> #include "../../misc/bool.h" #include "../header/rdwrsect.h" #include "../header/direct.h" unsigned char CalculateSFNCheckSum(struct DirectoryEntry* entry) { short i; unsigned char result = 0; assert(entry); for (i = 0; i < 8; i++) result = ((result & 1) ? 0x80 : 0) + (result >> 1) + entry->filename[i]; for (i = 0; i < 3; i++) result = ((result & 1) ? 0x80 : 0) + (result >> 1) + entry->extension[i]; return result; }