text
stringlengths
4
6.14k
#include <assert.h> int unknown1(); int unknown2(); int unknown3(); int unknown4(); void main(int n) { int x=0; int y=0; int i=0; int m=10; while(i<n) { i++; x++; if(i%2 == 0) y++; } if(i==m) static_assert(x==2*y); }
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_Module_h #define mozilla_Module_h #include "nscore.h" #include "nsID.h" #include "nsIFactory.h" #include "nsCOMPtr.h" // for already_AddRefed namespace mozilla { /** * A module implements one or more XPCOM components. This structure is used * for both binary and script modules, but the registration members * (cids/contractids/categoryentries) are unused for modules which are loaded * via a module loader. */ struct Module { static const unsigned int kVersion = 30; struct CIDEntry; typedef already_AddRefed<nsIFactory> (*GetFactoryProcPtr) (const Module& module, const CIDEntry& entry); typedef nsresult (*ConstructorProcPtr)(nsISupports* aOuter, const nsIID& aIID, void** aResult); typedef nsresult (*LoadFuncPtr)(); typedef void (*UnloadFuncPtr)(); /** * This selector allows CIDEntrys to be marked so that they're only loaded * into certain kinds of processes. */ enum ProcessSelector { ANY_PROCESS = 0, MAIN_PROCESS_ONLY, CONTENT_PROCESS_ONLY }; /** * The constructor callback is an implementation detail of the default binary * loader and may be null. */ struct CIDEntry { const nsCID* cid; bool service; GetFactoryProcPtr getFactoryProc; ConstructorProcPtr constructorProc; ProcessSelector processSelector; }; struct ContractIDEntry { const char* contractid; nsID const * cid; ProcessSelector processSelector; }; struct CategoryEntry { const char* category; const char* entry; const char* value; }; /** * Binary compatibility check, should be kModuleVersion. */ unsigned int mVersion; /** * An array of CIDs (class IDs) implemented by this module. The final entry * should be { nullptr }. */ const CIDEntry* mCIDs; /** * An array of mappings from contractid to CID. The final entry should * be { nullptr }. */ const ContractIDEntry* mContractIDs; /** * An array of category manager entries. The final entry should be * { nullptr }. */ const CategoryEntry* mCategoryEntries; /** * When the component manager tries to get the factory for a CID, it first * checks for this module-level getfactory callback. If this function is * not implemented, it checks the CIDEntry getfactory callback. If that is * also nullptr, a generic factory is generated using the CIDEntry * constructor callback which must be non-nullptr. */ GetFactoryProcPtr getFactoryProc; /** * Optional Function which are called when this module is loaded and * at shutdown. These are not C++ constructor/destructors to avoid * calling them too early in startup or too late in shutdown. */ LoadFuncPtr loadProc; UnloadFuncPtr unloadProc; }; } // namespace #if defined(MOZILLA_INTERNAL_API) # define NSMODULE_NAME(_name) _name##_NSModule # define NSMODULE_DECL(_name) extern mozilla::Module const *const NSMODULE_NAME(_name) # define NSMODULE_DEFN(_name) NSMODULE_DECL(_name) #else # define NSMODULE_NAME(_name) NSModule # define NSMODULE_DEFN(_name) extern "C" NS_EXPORT mozilla::Module const *const NSModule #endif #endif // mozilla_Module_h
/** * @file output.h * @brief Output routines. * @author Hanno Rein <hanno@hanno-rein.de> * @details If MPI is enabled, most functions output one file per * node. They automatically add a subscript _0, _1, .. to each file. * The user has to join them together manually. One exception is * output_append_velocity_dispersion() which only outputs one file. * * @section LICENSE * Copyright (c) 2011 Hanno Rein, Shangfei Liu * * This file is part of rebound. * * rebound 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. * * rebound 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 rebound. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef _OUTPUT_H #define _OUTPUT_H /** * This function checks if a new output is required at this time. * @return The return value is 1 if an output is required and 0 otherwise. * @param interval Output interval. */ int output_check(double interval); /** * This function checks if a new output is required at this time. * @return The return value is 1 if an output is required and 0 otherwise. * @param interval Output interval. * @param phase Phase (if 0, then this function is equal to output_check()). */ int output_check_phase(double interval,double phase); /** * Outputs the current number of particles, the time and the time difference since the last output to the screen. */ void output_timing(); /** * Outputs an ASCII file with the positions and velocities of all particles. * @param filename Output filename. */ void output_ascii(char* filename); /** * Outputs an ASCII file with orbital paramters of all particles. * @details The orbital parameters are calculated with respect the center of mass. * Particles are assumed to be sorted from the inside out, the central object having index 0. * @param filename Output filename. */ void output_orbits(char* filename); /** * Appends an ASCII file with orbital paramters of all particles. * @details The orbital parameters are calculated with respect the center of mass. * Particles are assumed to be sorted from the inside out, the central object having index 0. * @param filename Output filename. */ void output_append_orbits(char* filename); /** * Appends the positions and velocities of all particles to an ASCII file. * @param filename Output filename. */ void output_append_ascii(char* filename); /** * Dumps all particle structs into a binary file. * @param filename Output filename. */ void output_binary(char* filename); /** * Dumps only the positions of all particles into a binary file. * @param filename Output filename. */ void output_binary_positions(char* filename); /** * Appends the velocity dispersion of the particles to an ASCII file. * @param filename Output filename. */ void output_append_velocity_dispersion(char* filename); /** * Output a string to the default log file 'config.log' * @param name Description of value * @param value Value to be outputted */ void output_double(char* name, double value); /** * Output a string to the default log file 'config.log' * @param name Description of value * @param value Value to be outputted */ void output_int(char* name, int value); /** * Delete a directory if it exists, create it and chdir to it. * The name consists of 'out__' appended by all nondefault command line arguments received by input_get_double(), etc. */ void output_prepare_directory(); #if defined(OPENGL) && defined(LIBPNG) /** * Outputs a screenshot of the current OpenGL view. * @details Requires OpenGL and LIBPNG to be installed. * The filename is generated by appending a nine digit number and ".png" to dirname. * The number is increased every time an output is generated. One can then use ffmpeg to * compile movies with the command 'ffmpeg -qscale 5 -r 20 -b 9600 -i %09d.png movie.mp4'. * @param dirname Output directory (e.g. 'src/'). Must end with a slash. Directory must exist. */ void output_png(char* dirname); /** * Outputs a single screenshot of the current OpenGL view. * @details Requires OpenGL and LIBPNG to be installed. * @param filename Output filename. */ void output_png_single(char* filename); #endif // OPENGL && LIBPNG #ifdef PROFILING /** * Profiling categories */ enum profiling_categories { PROFILING_CAT_INTEGRATOR, PROFILING_CAT_BOUNDARY, PROFILING_CAT_GRAVITY, PROFILING_CAT_COLLISION, #ifdef OPENGL PROFILING_CAT_VISUALIZATION, #endif // OPENGL PROFILING_CAT_NUM, }; void profiling_start(); void profiling_stop(int cat); #define PROFILING_START() profiling_start(); #define PROFILING_STOP(C) profiling_stop(C); #else // PROFILING #define PROFILING_START() // Dummy, do nothing #define PROFILING_STOP(C) #endif // PROFILING #endif
/***************************************************************************** * Copyright (C) 2004-2018 The pykep development team, * * Advanced Concepts Team (ACT), European Space Agency (ESA) * * * * https://gitter.im/esa/pykep * * https://github.com/esa/pykep * * * * act@esa.int * * * * 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 KEP_TOOLBOX_TAYLOR_H_ #define KEP_TOOLBOX_TAYLOR_H_ typedef double MY_FLOAT; #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <keplerian_toolbox/detail/visibility.hpp> /* * MY_FLOAT is the data type to be used in computing derivatives. * It may be 'float', 'double' or user defined private data types * like 'doubledouble', 'complex' etc. */ /* for double or doubledouble, don't need to initialize */ #define InitMyFloat(r) #define ClearMyFloat(r) /* assign b to a */ #define AssignMyFloat(a, b) \ { \ (a) = (b); \ } /* create a MY_FLOAT from a, assign to r. a is an integer or a float */ #define MakeMyFloatA(r, a) (r = (double)(a)) /* create a MY_FLOAT from string, a is an integer or a float, s is its string representation */ #define MakeMyFloatC(r, s, a) (r = (double)(a)) /* create a MY_FLOAT from a, assign to r and return r */ #define MakeMyFloatB(r, a) (r = (double)(a), r) /* addition r=a+b */ #define AddMyFloatA(r, a, b) (r = (a) + (b)) /* substraction r=a-b */ #define SubstractMyFloatA(r, a, b) (r = (a) - (b)) /* multiplication r=a*b */ #define MultiplyMyFloatA(r, a, b) (r = (a) * (b)) /* division r=a/b */ #define DivideMyFloatA(r, a, b) (r = (a) / (b)) /* division by an integer r=a/i */ #define DivideMyFloatByInt(r, a, i) (r = (a) / (double)(i)) /* negation r=-a*/ #define NegateMyFloatA(r, a) (r = -(a)) /* square root r=sqrt(a) */ #define sqrtMyFloatA(r, a) (r = sqrt(a)) /* exponentiation r=a^b */ #define ExponentiateMyFloatA(r, a, b) (r = pow((a), (b))) /* exponentiation r=a^b, b is an integer */ #define ExponentiateMyFloatIA(r, a, b) (r = pow((a), (double)(b))) /* sin(a) r=sin(a) */ #define sinMyFloatA(r, a) (r = sin((a))) /* cos(a) r=cos(a) */ #define cosMyFloatA(r, a) (r = cos((a))) /* tan(a) r=tan(a) */ #define tanMyFloatA(r, a) (r = tan((a))) /* atan(a) r=atan(a) */ #define atanMyFloatA(r, a) (r = atan((a))) /* exp(a) r=exp(a) */ #define expMyFloatA(r, a) (r = exp((a))) /* log(a) r=log(a) */ #define logMyFloatA(r, a) (r = log((a))) /* sinh(a) r=sinh(a) */ #define sinhMyFloatA(r, a) (r = sinh(a)) /* cosh(a) r=cosh(a) */ #define coshMyFloatA(r, a) (r = cosh(a)) /* tanh(a) r=tanh(a) */ #define tanhMyFloatA(r, a) (r = tanh(a)) /* log10(a) r=log10(a) */ #define log10MyFloatA(r, a) (r = log10((a))) /* fabs(a) r=fabs(a) */ #define fabsMyFloatA(r, a) (r = fabs(a)) /* convert to int */ #define MyFloatToInt(ir, fa) (ir = (int)(fa)) /* convert to double */ #define MyFloatToDouble(ir, fa) (ir = (double)(fa)) /* boolean operation */ #define MyFloatA_GE_B(a, b) ((a) >= (b)) #define MyFloatA_GT_B(a, b) ((a) > (b)) #define MyFloatA_LE_B(a, b) ((a) <= (b)) #define MyFloatA_LT_B(a, b) ((a) < (b)) #define MyFloatA_EQ_B(a, b) ((a) == (b)) #define MyFloatA_NEQ_B(a, b) ((a) != (b)) /************************************************************************/ #endif // KEP_TOOLBOX_TAYLOR_H_ MY_FLOAT **taylor_coefficients_fixed_thrust(MY_FLOAT t, MY_FLOAT *x, int order, double mu, double veff, double ux, double uy, double uz); MY_FLOAT **taylor_coefficients_fixed_thrustA(MY_FLOAT t, MY_FLOAT *x, int order, int reuse_last_computation, double mu, double veff, double ux, double uy, double uz); KEP_TOOLBOX_DLL_PUBLIC int taylor_step_fixed_thrust(MY_FLOAT *ti, MY_FLOAT *x, int dir, int step_ctl, double log10abserr, double log10relerr, MY_FLOAT *endtime, MY_FLOAT *ht, int *order, double mu, double veff, double ux, double uy, double uz);
/* * @OPENGROUP_COPYRIGHT@ * COPYRIGHT NOTICE * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc. * Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for * the full copyright text. * * This software is subject to an open license. It may only be * used on, with or for operating systems which are themselves open * source systems. You must contact The Open Group for a license * allowing distribution and sublicensing of this software on, with, * or for operating systems which are not Open Source programs. * * See http://www.opengroup.org/openmotif/license for full * details of the license agreement. Any use, reproduction, or * distribution of the program constitutes recipient's acceptance of * this agreement. * * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS * PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY * WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY * OR FITNESS FOR A PARTICULAR PURPOSE * * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT * NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE * EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */ /* * HISTORY */ /* $TOG: AtomMgr.h /main/12 1997/09/10 11:15:15 mgreess $ */ /* * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */ #ifndef _XmAtomMgr_h #define _XmAtomMgr_h #include <Xm/Xm.h> #include <X11/Xresource.h> #ifdef __cplusplus extern "C" { #endif /* X11r5' XInternAtom equivalent */ extern Atom XmInternAtom( Display *display, String name, #if NeedWidePrototypes int only_if_exists ); #else Boolean only_if_exists ); #endif /* NeedWidePrototypes */ /* X11r5's XGetAtomName equivalent */ extern String XmGetAtomName( Display *display, Atom atom); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* This macro name is confusing, and of unknown benefit. * #define XmNameToAtom(display, atom) \ * XmGetAtomName(display, atom) */ #endif /* _XmAtomMgr_h */
// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams #ifndef MAP_PATH_H #define MAP_PATH_H #include "map.h" // enum cell_chk #include "../common/cbasetypes.h" #define MOVE_COST 10 #define MOVE_DIAGONAL_COST 14 #define MAX_WALKPATH 32 struct walkpath_data { unsigned char path_len,path_pos; unsigned char path[MAX_WALKPATH]; }; struct shootpath_data { int rx,ry,len; int x[MAX_WALKPATH]; int y[MAX_WALKPATH]; }; #define check_distance_bl(bl1, bl2, distance) (path->check_distance((bl1)->x - (bl2)->x, (bl1)->y - (bl2)->y, distance)) #define check_distance_blxy(bl, x1, y1, distance) (path->check_distance((bl)->x - (x1), (bl)->y - (y1), distance)) #define check_distance_xy(x0, y0, x1, y1, distance) (path->check_distance((x0) - (x1), (y0) - (y1), distance)) #define distance_bl(bl1, bl2) (path->distance((bl1)->x - (bl2)->x, (bl1)->y - (bl2)->y)) #define distance_blxy(bl, x1, y1) (path->distance((bl)->x - (x1), (bl)->y - (y1))) #define distance_xy(x0, y0, x1, y1) (path->distance((x0) - (x1), (y0) - (y1))) #define check_distance_client_bl(bl1, bl2, distance) (path->check_distance_client((bl1)->x - (bl2)->x, (bl1)->y - (bl2)->y, distance)) #define check_distance_client_blxy(bl, x1, y1, distance) (path->check_distance_client((bl)->x-(x1), (bl)->y-(y1), distance)) #define check_distance_client_xy(x0, y0, x1, y1, distance) (path->check_distance_client((x0)-(x1), (y0)-(y1), distance)) #define distance_client_bl(bl1, bl2) (path->distance_client((bl1)->x - (bl2)->x, (bl1)->y - (bl2)->y)) #define distance_client_blxy(bl, x1, y1) (path->distance_client((bl)->x-(x1), (bl)->y-(y1))) #define distance_client_xy(x0, y0, x1, y1) (path->distance_client((x0)-(x1), (y0)-(y1))) struct path_interface { // calculates destination cell for knockback int (*blownpos) (int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count); // tries to find a walkable path bool (*search) (struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell); // tries to find a shootable path bool (*search_long) (struct shootpath_data *spd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell); bool (*check_distance) (int dx, int dy, int distance); unsigned int (*distance) (int dx, int dy); bool (*check_distance_client) (int dx, int dy, int distance); int (*distance_client) (int dx, int dy); }; struct path_interface *path; void path_defaults(void); #endif /* MAP_PATH_H */
#pragma once #include "ofMain.h" class testApp : public ofBaseApp { public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); void gotMessage(ofMessage msg); };
#include <stdio.h> unsigned long entryPoint ( unsigned long n, void *x, size_t elem_size ) { unsigned long i;
/** * This file is part of meta. * * Author(s): Jens Finkhaeuser <jens@finkhaeuser.de> * * Copyright (c) 2015 Jens Finkhaeuser. * * This software is licensed under the terms of the GNU GPLv3 for personal, * educational and non-profit use. For all other uses, alternative license * options are available. Please contact the copyright holder for additional * information, stating your intended usage. * * You can find the full text of the GPLv3 in the COPYING file in this code * distribution. * * This software is distributed on an "AS IS" BASIS, WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. **/ #ifndef META_INTTYPES_H #define META_INTTYPES_H #ifndef __cplusplus #error You are trying to include a C++ only header file #endif #include <meta/meta.h> #if defined(META_HAVE_STD_HEADERS) # include <cstdint> # include <cinttypes> # include <climits> #elif defined(META_HAVE_TR1_HEADERS) # include <tr1/cstdint> # include <tr1/cinttypes> # include <tr1/climits> #else # include <stdint.h> # include <inttypes.h> # include <limits.h> #endif #if defined(META_WIN32) # undef min # undef max #endif #endif // guard
/// @todo move everything here Carta::Lib namespace #pragma once #include "CartaLib/Hooks/HookIDs.h" #include "IImage.h" #include <QImage> #include <QObject> #include <QDebug> #include <QJsonObject> #include <cstdint> /// Every hook as a unique ID and we are using 64bit integers for hook IDs /// The IDs will allow us to do static_cast<> downcasting inside plugins. typedef int64_t HookId; /// base hook event /// Currently the purpose of this base class is to implement IDs /// TODO: does this need inheritance from QObject class BaseHook // : public QObject { // Q_OBJECT public: /// TODO: I have not yet figured out how to specialize some of the templates for /// void return type... hence the FakeVoid aliased to char typedef char FakeVoid; BaseHook() = delete; /// only one constructor, requires a hook ID explicit BaseHook( const HookId & id ) : m_hookId( id ) { } /// get the dynamic hook ID HookId hookId() const { return m_hookId; } /// a convenience (and preferred way) to compare whether a given hook instance is /// of a particular hook type. By using this we can hide the implementation details... template < typename HookType > static bool isHook( const BaseHook & hook ) { return hook.hookId() == HookType::staticId; } /// returns treu if this hook is an instace of HookType template < typename HookType > bool is() const { return hookId() == HookType::staticId; } protected: /// dynamic hook ID HookId m_hookId; }; /// parsed plugin.json information struct PluginJson { /// API version against which QString api; /// name of the plugin QString name; /// version of the plugin QString version; /// type of the plugin (e.g. "cpp") QString typeString; /// description of the plugin QString description; /// about the plugin QString about; /// list of depenencies of the plugin QStringList depends; }; /// plugin interface /// Every plugin must implement this interface class IPlugin { public: /// information passed to plugins during initialize() struct InitInfo { /// full path to the directory from where the plugin was loaded QString pluginPath; /// parsed json QJsonObject json; }; /// called immediately after the plugin was loaded /// TODO: should be pure virtual, don't be lazy! /// /// This is different from the Initialize hook, which is delivered after /// all plugins have been loaded and after core is started. virtual void initialize( const InitInfo & initInfo ) { Q_UNUSED( initInfo ); } /// at startup plugins will be asked to return a list of hook ids they are /// interested in listening to virtual std::vector < HookId > getInitialHookList() = 0; /// this is what we end up calling to do all work virtual bool handleHook( BaseHook & hookData ) = 0; /// virtual empty destructor virtual ~IPlugin() { } }; #define CARTA_HOOK_BOILER1( name ) \ CLASS_BOILERPLATE( name ); \ enum { staticId = static_cast < HookId > ( Carta::Lib::Hooks::UniqueHookIDs::name ## _ID ) } /// just before rendering a view, plugins are given a chance to modify the rendered image /// \todo remove this, it was only a proof of concept hook class PreRender : public BaseHook { CARTA_HOOK_BOILER1( PreRender ); public: typedef FakeVoid ResultType; struct Params { Params( QString p_viewName, QImage * p_imgPtr ) { imgPtr = p_imgPtr; viewName = p_viewName; } QImage * imgPtr; QString viewName; }; PreRender( Params * pptr ) : BaseHook( staticId ), paramsPtr( pptr ) { } ResultType result; Params * paramsPtr; }; // This is needed to setup the Qt metatype system to enable qobject_cast<> downcasting. // It must be outside of any namespace!!! Q_DECLARE_INTERFACE( IPlugin, "org.cartaviewer.IPlugin" )
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: mods/deathmatch/logic/CBlipManager.h * PURPOSE: Blip entity manager class * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ class CBlipManager; #ifndef __CBLIPMANAGER_H #define __CBLIPMANAGER_H #include "CBlip.h" #include <list> class CBlipManager { friend class CBlip; public: CBlipManager(void); ~CBlipManager(void) { DeleteAll(); }; CBlip* Create(CElement* pParent, CXMLNode* pNode = NULL); CBlip* CreateFromXML(CElement* pParent, CXMLNode& Node, CEvents* pEvents); void DeleteAll(void); unsigned int Count(void) { return static_cast<unsigned int>(m_List.size()); }; bool Exists(CBlip* pBlip); list<CBlip*>::const_iterator IterBegin(void) { return m_List.begin(); }; list<CBlip*>::const_iterator IterEnd(void) { return m_List.end(); }; static bool IsValidIcon(unsigned long ulIcon) { return ulIcon <= 63; }; private: list<CBlip*> m_List; }; #endif
//# BlobException.h: Blob Exception class. //# //# Copyright (C) 2004 //# ASTRON (Netherlands Institute for Radio Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands //# //# This file is part of the LOFAR software suite. //# The LOFAR software suite 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. //# //# The LOFAR software suite is distributed in the hope that it will be useful, //# but WITHOUT ANY WARRANTY; without even the implied warranty of //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //# GNU General Public License for more details. //# //# You should have received a copy of the GNU General Public License along //# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. //# //# $Id$ #ifndef LOFAR_BLOB_BLOBEXCEPTION_H #define LOFAR_BLOB_BLOBEXCEPTION_H // \file // Blob Exception class. //# Includes #include <Common/Exception.h> namespace LOFAR { EXCEPTION_CLASS (BlobException, Exception); } #endif
/****************************************************************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann * * This library is free software; you can redistribute it and/or * modify it under the terms of the Qwt License, Version 1.0 *****************************************************************************/ #ifndef QWT_WEEDING_CURVE_FITTER_H #define QWT_WEEDING_CURVE_FITTER_H #include "qwt_curve_fitter.h" /*! \brief A curve fitter implementing Douglas and Peucker algorithm The purpose of the Douglas and Peucker algorithm is that given a 'curve' composed of line segments to find a curve not too dissimilar but that has fewer points. The algorithm defines 'too dissimilar' based on the maximum distance (tolerance) between the original curve and the smoothed curve. The runtime of the algorithm increases non linear ( worst case O( n*n ) ) and might be very slow for huge polygons. To avoid performance issues it might be useful to split the polygon ( setChunkSize() ) and to run the algorithm for these smaller parts. The disadvantage of having no interpolation at the borders is for most use cases irrelevant. The smoothed curve consists of a subset of the points that defined the original curve. In opposite to QwtSplineCurveFitter the Douglas and Peucker algorithm reduces the number of points. By adjusting the tolerance parameter according to the axis scales QwtSplineCurveFitter can be used to implement different level of details to speed up painting of curves of many points. */ class QWT_EXPORT QwtWeedingCurveFitter : public QwtCurveFitter { public: explicit QwtWeedingCurveFitter( double tolerance = 1.0 ); virtual ~QwtWeedingCurveFitter(); void setTolerance( double ); double tolerance() const; void setChunkSize( uint ); uint chunkSize() const; virtual QPolygonF fitCurve( const QPolygonF& ) const QWT_OVERRIDE; virtual QPainterPath fitCurvePath( const QPolygonF& ) const QWT_OVERRIDE; private: virtual QPolygonF simplify( const QPolygonF& ) const; class Line; class PrivateData; PrivateData* m_data; }; #endif
/* * include/asm-ppc/namei.h * Adapted from include/asm-alpha/namei.h * * Included from fs/namei.c */
/* * Copyright (C) 2007-2013 Dyson Technology Ltd, 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 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include "Workbench.h" #include <QtGui/QMainWindow> #include <memory> class WorkbenchUi; class HelpViewer; class QToolButton; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow( QWidget* parent = 0 ); virtual ~MainWindow(); void Reload(); void MergeWithActivePath( const WbPath& desiredPath ); void Start(); protected: virtual void closeEvent( QCloseEvent* event ); private slots: void ShowHelp(); void ShowAboutGTS(); void ShowAboutQt(); private: Ui::MainWindow* m_ui; WorkbenchUi* m_workbenchUi; HelpViewer* m_helpViewer; QToolButton* m_cornerButton; }; #endif // MAINWINDOW_H
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/> // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef NL_DBGROUP_LIST_SHEET_TEXT_PHRASE_H #define NL_DBGROUP_LIST_SHEET_TEXT_PHRASE_H #include "nel/misc/types_nl.h" #include "dbgroup_list_sheet_text.h" // *************************************************************************** /** * Special TextList for displaying Phrase Sheet. Optionally display progression info * \author Lionel Berenguier * \author Nevrax France * \date 2003 */ class CDBGroupListSheetTextPhrase : public CDBGroupListSheetText { public: /// Constructor CDBGroupListSheetTextPhrase(const TCtorParam &param); // A child node struct CSheetChildPhrase : public CDBGroupListSheetText::CSheetChild { CSheetChildPhrase(); virtual void init(CDBGroupListSheetText *pFather, uint index); virtual bool isInvalidated(CDBGroupListSheetText *pFather); virtual void update(CDBGroupListSheetText *pFather); virtual void updateViewText(CDBGroupListSheetText *pFather); virtual sint getSectionId() const; NLMISC::CCDBNodeLeaf *LevelDB; uint LevelCache; }; virtual CSheetChild *createSheetChild() { return new CSheetChildPhrase; } // for section mgt virtual void getCurrentBoundSectionId(sint &minSectionId, sint &maxSectionId); virtual CInterfaceGroup *createSectionGroup(const std::string &igName); virtual void deleteSectionGroup(CInterfaceGroup *group); virtual void setSectionGroupId(CInterfaceGroup *, uint sectionId); }; #endif // NL_DBGROUP_LIST_SHEET_TEXT_PHRASE_H /* End of dbgroup_list_sheet_text_phrase.h */
#ifndef __SamplePlugin_CTimeSignalGenerator_H__ #define __SamplePlugin_CTimeSignalGenerator_H__ #include "../ovp_defines.h" #include <toolkit/ovtk_all.h> #include <ebml/TWriterCallbackProxy.h> namespace OpenViBEPlugins { namespace Samples { class CTimeSignalGenerator : public OpenViBEToolkit::TBoxAlgorithm<OpenViBE::Plugins::IBoxAlgorithm> { public: CTimeSignalGenerator(void); virtual void release(void); virtual OpenViBE::uint64 getClockFrequency(void); virtual OpenViBE::boolean initialize(void); virtual OpenViBE::boolean uninitialize(void); virtual OpenViBE::boolean processClock(OpenViBE::Kernel::IMessageClock& rMessageClock); virtual OpenViBE::boolean process(void); _IsDerivedFromClass_Final_(OpenViBEToolkit::TBoxAlgorithm<OpenViBE::Plugins::IBoxAlgorithm>, OVP_ClassId_TimeSignalGenerator) public: virtual void writeSignalOutput(const void* pBuffer, const EBML::uint64 ui64BufferSize); protected: EBML::TWriterCallbackProxy1<OpenViBEPlugins::Samples::CTimeSignalGenerator> m_oSignalOutputWriterCallbackProxy; OpenViBEToolkit::IBoxAlgorithmSignalOutputWriter* m_pSignalOutputWriterHelper; EBML::IWriter* m_pSignalOutputWriter; OpenViBE::boolean m_bHeaderSent; OpenViBE::uint32 m_ui32SamplingFrequency; OpenViBE::uint32 m_ui32GeneratedEpochSampleCount; OpenViBE::float64* m_pSampleBuffer; OpenViBE::uint32 m_ui32SentSampleCount; }; class CTimeSignalGeneratorDesc : public OpenViBE::Plugins::IBoxAlgorithmDesc { public: virtual void release(void) { } virtual OpenViBE::CString getName(void) const { return OpenViBE::CString("Time signal"); } virtual OpenViBE::CString getAuthorName(void) const { return OpenViBE::CString("Yann Renard"); } virtual OpenViBE::CString getAuthorCompanyName(void) const { return OpenViBE::CString("INRIA/IRISA"); } virtual OpenViBE::CString getShortDescription(void) const { return OpenViBE::CString("Simple time signal generator (for use with DSP)"); } virtual OpenViBE::CString getDetailedDescription(void) const { return OpenViBE::CString(""); } virtual OpenViBE::CString getCategory(void) const { return OpenViBE::CString("Samples"); } virtual OpenViBE::CString getVersion(void) const { return OpenViBE::CString("1.0"); } virtual OpenViBE::CIdentifier getCreatedClass(void) const { return OVP_ClassId_TimeSignalGenerator; } virtual OpenViBE::Plugins::IPluginObject* create(void) { return new OpenViBEPlugins::Samples::CTimeSignalGenerator(); } virtual OpenViBE::CString getStockItemName(void) const { return OpenViBE::CString("gtk-execute"); } virtual OpenViBE::boolean getBoxPrototype( OpenViBE::Kernel::IBoxProto& rPrototype) const { rPrototype.addOutput("Generated signal", OV_TypeId_Signal); rPrototype.addSetting("Sampling frequency", OV_TypeId_Integer, "512"); rPrototype.addSetting("Generated epoch sample count", OV_TypeId_Integer, "32"); return true; } _IsDerivedFromClass_Final_(OpenViBE::Plugins::IBoxAlgorithmDesc, OVP_ClassId_TimeSignalGeneratorDesc) }; }; }; #endif // __SamplePlugin_CTimeSignalGenerator_H__
#ifndef PETCLEARPATROLPOINTSCOMMAND_H_ #define PETCLEARPATROLPOINTSCOMMAND_H_ #include "server/zone/objects/creature/commands/QueueCommand.h" #include "server/zone/objects/creature/AiAgent.h" #include "server/zone/objects/creature/DroidObject.h" #include "server/zone/managers/creature/PetManager.h" class PetClearPatrolPointsCommand : public QueueCommand { public: PetClearPatrolPointsCommand(const String& name, ZoneProcessServer* server) : QueueCommand(name, server) { } int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments) const { ManagedReference<PetControlDevice*> controlDevice = creature->getControlDevice().castTo<PetControlDevice*>(); if (controlDevice == NULL) return GENERALERROR; ManagedReference<AiAgent*> pet = cast<AiAgent*>(creature); if( pet == NULL ) return GENERALERROR; if (pet->hasRidingCreature()) return GENERALERROR; // Check if droid has power if( controlDevice->getPetType() == PetManager::DROIDPET ) { ManagedReference<DroidObject*> droidPet = cast<DroidObject*>(pet.get()); if( droidPet == NULL ) return GENERALERROR; if( !droidPet->hasPower() ){ pet->showFlyText("npc_reaction/flytext","low_power", 204, 0, 0); // "*Low Power*" return GENERALERROR; } } // ignore if pet is in combat if (pet->isInCombat()) return GENERALERROR; Locker clocker(controlDevice, creature); controlDevice->clearPatrolPoints(); if (pet->getFollowState() == AiAgent::PATROLLING) { pet->setOblivious(); } ManagedReference<SceneObject*> targetObject = server->getZoneServer()->getObject(target, true); if (targetObject != NULL || targetObject->isPlayerCreature() ) { CreatureObject* player = cast<CreatureObject*>(targetObject.get()); player->sendSystemMessage("@pet/pet_menu:patrol_removed"); // Patrol points forgotten } return SUCCESS; } }; #endif /* PETCLEARPATROLPOINTSCOMMAND_H_ */
/*************************************************************************** ** ** Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef MFEEDBACKPLAYERPRIV_H #define MFEEDBACKPLAYERPRIV_H #include <QLocalSocket> #include <QMap> #include <QTimer> #include <QElapsedTimer> #include <QDataStream> #include <QObject> #include "mexport.h" class MFeedbackPlayerPrivate : public QObject { Q_OBJECT public: MFeedbackPlayerPrivate(QObject *parent); virtual ~MFeedbackPlayerPrivate(); bool init(const QString &applicationName); void sendPlaybackRequest(const QString &name); private slots: void onConnected(); void onSocketError(QLocalSocket::LocalSocketError socketError); void connectIdle(); public: QLocalSocket socket; QDataStream socketStream; QString applicationName; // Number of reconnection attempts. This value is zeroed when a connection is // successfully established. int reconnectionAttempts; // Contains the intervals, in milliseconds, to wait before attempting // to reconnect to feedback-manager daemon. // list[0] is the time to wait before trying to connect and reconnect for the first time. // If the first attempt fails then it waits list[1] milliseconds before attempting // to reconnect for the second time and so on. // It gives up trying to reconnect when failedReconnections == list.size() QList<int> reconnectionIntervalsList; // Contains time (in milliseconds) from the previous successfull connection // to the feedback daemon. QElapsedTimer previousSuccessfullConnection; // Contains number of successive successfull connections to feedback daemon // that have happened in less than fastReconnectionTime. int fastReconnectionCount; }; #endif
/* Copyright (C) 2009 William Hart Copyright (C) 2010 Sebastian Pancratz This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <gmp.h> #include "flint.h" #include "fmpz.h" #include "fmpz_poly.h" #include "ulong_extras.h" int main(void) { int i, result; FLINT_TEST_INIT(state); flint_printf("div_divconquer...."); fflush(stdout); /* Compare with full division, no aliasing */ for (i = 0; i < 100 * flint_test_multiplier(); i++) { fmpz_poly_t a, b, q, r, q2; fmpz_poly_init(a); fmpz_poly_init(b); fmpz_poly_init(q); fmpz_poly_init(r); fmpz_poly_init(q2); fmpz_poly_randtest(a, state, n_randint(state, 200), 100); fmpz_poly_randtest_not_zero(b, state, n_randint(state, a->length + 1) + 1, 100); fmpz_poly_divrem_divconquer(q, r, a, b); fmpz_poly_div_divconquer(q2, a, b); result = (fmpz_poly_equal(q, q2)); if (!result) { flint_printf("FAIL:\n"); fmpz_poly_print(a), flint_printf("\n\n"); fmpz_poly_print(b), flint_printf("\n\n"); fmpz_poly_print(q), flint_printf("\n\n"); fmpz_poly_print(r), flint_printf("\n\n"); fmpz_poly_print(q2), flint_printf("\n\n"); abort(); } fmpz_poly_clear(a); fmpz_poly_clear(b); fmpz_poly_clear(q); fmpz_poly_clear(r); fmpz_poly_clear(q2); } /* Check q and a alias */ for (i = 0; i < 100 * flint_test_multiplier(); i++) { fmpz_poly_t a, b, q; fmpz_poly_init(a); fmpz_poly_init(b); fmpz_poly_init(q); fmpz_poly_randtest(a, state, n_randint(state, 100), 200); fmpz_poly_randtest_not_zero(b, state, n_randint(state, 100) + 1, 200); fmpz_poly_div_divconquer(q, a, b); fmpz_poly_div_divconquer(a, a, b); result = (fmpz_poly_equal(a, q)); if (!result) { flint_printf("FAIL:\n"); fmpz_poly_print(a), flint_printf("\n\n"); fmpz_poly_print(q), flint_printf("\n\n"); abort(); } fmpz_poly_clear(a); fmpz_poly_clear(b); fmpz_poly_clear(q); } /* Check q and b alias */ for (i = 0; i < 100 * flint_test_multiplier(); i++) { fmpz_poly_t a, b, q; fmpz_poly_init(a); fmpz_poly_init(b); fmpz_poly_init(q); fmpz_poly_randtest(a, state, n_randint(state, 100), 200); fmpz_poly_randtest_not_zero(b, state, n_randint(state, 100) + 1, 200); fmpz_poly_div_divconquer(q, a, b); fmpz_poly_div_divconquer(b, a, b); result = (fmpz_poly_equal(b, q)); if (!result) { flint_printf("FAIL:\n"); fmpz_poly_print(a), flint_printf("\n\n"); fmpz_poly_print(q), flint_printf("\n\n"); abort(); } fmpz_poly_clear(a); fmpz_poly_clear(b); fmpz_poly_clear(q); } FLINT_TEST_CLEANUP(state); flint_printf("PASS\n"); return 0; }
/*************************************************************************** begin : Fri Apr 18 2014 copyright : (C) 2014 by Martin Preuss email : martin@libchipcard.de *************************************************************************** * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * * MA 02111-1307 USA * * * ***************************************************************************/ int GWEN_Parser__CheckElementAndChildren(const GWEN_PARSER_ELEMENT *eDefinitions, const GWEN_PARSER_ELEMENT *eData, int depth) { int rv; const GWEN_PARSER_ELEMENT *dReal=eDefinitions; const GWEN_PARSER_ELEMENT *eDefChild=NULL; const GWEN_PARSER_ELEMENT *eDataChild=NULL; /* check choice or direct element */ if (GWEN_ParserElement_GetElementType(eDefinitions)==GWEN_ParserElementType_Choice) { /* check choice */ dReal=GWEN_Parser__GetChoice(eDefinitions, eData); if (dReal==NULL) { DBG_DEBUG(GWEN_LOGDOMAIN, "No matching choice found"); return GWEN_ERROR_BAD_DATA; } } else { /* compare directly */ rv=GWEN_Parser__CheckElement(eDefinitions, eData); if (rv<0) { DBG_DEBUG(GWEN_LOGDOMAIN, "here (%d)", rv); return rv; } } /* check children */ eDefChild=GWEN_ParserElement_Tree_GetFirstChild(dReal); if (eData) eDataChild=GWEN_ParserElement_Tree_GetFirstChild(eData); rv=GWEN_Parser__CheckSequence(eDefChild, eDataChild, depth+1); if (rv<0) { DBG_DEBUG(GWEN_LOGDOMAIN, "here (%d)", rv); return rv; } return 0; } int GWEN_Parser__CheckSequence(const GWEN_PARSER_ELEMENT *eDefinitions, const GWEN_PARSER_ELEMENT *eData, int depth) { const GWEN_PARSER_ELEMENT *d; const GWEN_PARSER_ELEMENT *e; int count=0; d=eDefinitions; e=eData; DBG_VERBOUS(GWEN_LOGDOMAIN, "Entering sequence [%d]", depth); while (d) { int rv; DBG_VERBOUS(GWEN_LOGDOMAIN, "Checking definition \"%s\" (%s) against \"%s\" (%s) [%d]", d?GWEN_ParserElement_GetName(d):"-?-", GWEN_ParserElementType_toString(GWEN_ParserElement_GetElementType(d)), e?(GWEN_ParserElement_GetName(e)):"-NULL-", e?(GWEN_ParserElementType_toString(GWEN_ParserElement_GetElementType(e))):"-NULL-", depth); rv=GWEN_Parser__CheckElementAndChildren(d, e, depth+1); if (rv==0) { DBG_VERBOUS(GWEN_LOGDOMAIN, "Matches [%d]", depth); /* does match */ if ((GWEN_ParserElement_GetMaxOccurs(d)==-1)|| (count<GWEN_ParserElement_GetMaxOccurs(d))) { /* number is ok, advance to next */ DBG_VERBOUS(GWEN_LOGDOMAIN, "Element \"%s\" (%s) is ok (%d) [%d]", e?(GWEN_ParserElement_GetName(e)):"-NULL-", e?(GWEN_ParserElementType_toString(GWEN_ParserElement_GetElementType(e))):"-NULL-", count+1, depth); count++; if (e) e=GWEN_ParserElement_Tree_GetNext(e); } else { DBG_INFO(GWEN_LOGDOMAIN, "Too many counts of this element (%d, maxOccurs=%d)", count, GWEN_ParserElement_GetMaxOccurs(d)); return GWEN_ERROR_BAD_DATA; } } else { /* does not match */ DBG_VERBOUS(GWEN_LOGDOMAIN, "Does not match [%d]", depth); if (count<GWEN_ParserElement_GetMinOccurs(d)) { /* too few counts */ DBG_INFO(GWEN_LOGDOMAIN, "Too few counts of element \"%s\" ([%s], got %d, minOccurs=%d) [%d]", d?GWEN_ParserElement_GetName(d):"-?-", GWEN_ParserElementType_toString(GWEN_ParserElement_GetElementType(d)), count, GWEN_ParserElement_GetMinOccurs(d), depth); return GWEN_ERROR_BAD_DATA; } else { /* ok, advance to next definition */ DBG_VERBOUS(GWEN_LOGDOMAIN, "Element \"%s\" (%s) does not match, but that's ok [%d]", e?(GWEN_ParserElement_GetName(e)):"-NULL-", e?(GWEN_ParserElementType_toString(GWEN_ParserElement_GetElementType(e))):"-NULL-", depth); count=0; d=GWEN_ParserElement_Tree_GetNext(d); } } } if (e) { DBG_INFO(GWEN_LOGDOMAIN, "Still data elements but no definition elements"); return GWEN_ERROR_BAD_DATA; } DBG_VERBOUS(GWEN_LOGDOMAIN, "Leaving sequence [%d]", depth); return 0; } int GWEN_Parser_CheckTree(const GWEN_PARSER_ELEMENT_TREE *tDefinitions, const GWEN_PARSER_ELEMENT_TREE *tData) { const GWEN_PARSER_ELEMENT *d; const GWEN_PARSER_ELEMENT *e; int rv; d=GWEN_ParserElement_Tree_GetFirst(tDefinitions); e=GWEN_ParserElement_Tree_GetFirst(tData); rv=GWEN_Parser__CheckSequence(d, e, 0); if (rv<0) { DBG_DEBUG(GWEN_LOGDOMAIN, "here (%d)", rv); return rv; } return 0; }
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QtCore/QMap> #include <QtCore/QVariant> #include <QtGui/QCloseEvent> #include <QtGui/QClipboard> #include <QtWidgets/QMainWindow> #include <QtPrintSupport/QPrinter> #ifdef YAGY_ENABLE_INSPECTOR #include <QtWebKitWidgets/QWebInspector> #endif #include "yacasserver.h" #include "yacas/yacas.h" #include "preferences.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(Preferences& prefs, QWidget* parent = 0); ~MainWindow(); public slots: void eval(int idx, QString expr); QStringList complete(QString s); void help(QString, int); bool isWebGLEnabled(); void copyToClipboard( QString newText ); void on_contentsChanged(); protected: void closeEvent(QCloseEvent*); void loadYacasPage(); private slots: void initObjectMapping(); void print(QPrinter*); void on_action_New_triggered(); void on_action_Open_triggered(); void on_action_Save_triggered(); void on_action_Save_As_triggered(); void on_action_Print_triggered(); void on_action_Close_triggered(); void on_action_Quit_triggered(); void on_actionCu_t_triggered(); void on_action_Copy_triggered(); void on_action_Paste_triggered(); void on_actionPreferences_triggered(); void on_action_Next_triggered(); void on_action_Previous_triggered(); void on_actionInsert_Before_triggered(); void on_actionInsert_After_triggered(); void on_actionDelete_Current_triggered(); void on_action_Use_triggered(); void on_action_Import_triggered(); void on_action_Export_triggered(); void on_actionEvaluate_Current_triggered(); void on_actionEvaluate_All_triggered(); void on_action_Stop_triggered(); void on_action_Restart_triggered(); void on_actionYacas_Manual_triggered(); void on_actionCurrent_Symbol_Help_triggered(); void on_action_About_triggered(); void handle_engine_busy(bool); void handle_prefs_changed(); private: void _save(); void _update_title(); bool isWebGLSupported(); Preferences& _prefs; Ui::MainWindow* _ui; class NullBuffer: public std::streambuf { public: int overflow(int c) { return c; } }; NullBuffer _null_buffer; std::ostream _null_stream; QString _scripts_path; YacasServer* _yacas_server; CYacas* _yacas2tex; QScopedPointer<QPrinter> _printer; bool _has_file; bool _modified; QString _fname; static QList<MainWindow*> _windows; static unsigned _cntr; #ifdef YAGY_ENABLE_INSPECTOR QWebInspector* _inspector; #endif }; #endif // MAINWINDOW_H
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the qmake application of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef MAKEFILEDEPS_H #define MAKEFILEDEPS_H #include <qstringlist.h> #include <qfileinfo.h> QT_BEGIN_NAMESPACE struct SourceFile; struct SourceDependChildren; class SourceFiles; class QMakeLocalFileName { uint is_null : 1; mutable QString real_name, local_name; public: QMakeLocalFileName() : is_null(1) { } QMakeLocalFileName(const QString &); bool isNull() const { return is_null; } inline const QString &real() const { return real_name; } const QString &local() const; bool operator==(const QMakeLocalFileName &other) { return (this->real_name == other.real_name); } bool operator!=(const QMakeLocalFileName &other) { return !(*this == other); } }; class QMakeSourceFileInfo { private: //quick project lookups SourceFiles *files, *includes; bool files_changed; QList<QMakeLocalFileName> depdirs; //sleezy buffer code char *spare_buffer; int spare_buffer_size; char *getBuffer(int s); //actual guts bool findMocs(SourceFile *); bool findDeps(SourceFile *); void dependTreeWalker(SourceFile *, SourceDependChildren *); //cache QString cachefile; protected: virtual QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool forOpen=false); virtual QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &); virtual QFileInfo findFileInfo(const QMakeLocalFileName &); public: QMakeSourceFileInfo(const QString &cachefile=""); virtual ~QMakeSourceFileInfo(); QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; } void setDependencyPaths(const QList<QMakeLocalFileName> &); enum DependencyMode { Recursive, NonRecursive }; inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; } inline DependencyMode dependencyMode() const { return dep_mode; } enum SourceFileType { TYPE_UNKNOWN, TYPE_C, TYPE_UI, TYPE_QRC }; enum SourceFileSeek { SEEK_DEPS=0x01, SEEK_MOCS=0x02 }; void addSourceFiles(const QStringList &, uchar seek, SourceFileType type=TYPE_C); void addSourceFile(const QString &, uchar seek, SourceFileType type=TYPE_C); bool containsSourceFile(const QString &, SourceFileType type=TYPE_C); int included(const QString &file); QStringList dependencies(const QString &file); bool mocable(const QString &file); virtual QMap<QString, QStringList> getCacheVerification(); virtual bool verifyCache(const QMap<QString, QStringList> &); void setCacheFile(const QString &cachefile); //auto caching void loadCache(const QString &cf); void saveCache(const QString &cf); private: DependencyMode dep_mode; }; QT_END_NAMESPACE #endif // MAKEFILEDEPS_H
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDECLARATIVEGEOMAPPIXMAPOBJECT_H #define QDECLARATIVEGEOMAPPIXMAPOBJECT_H #include "qdeclarativegeomapobject_p.h" #include "qdeclarativecoordinate_p.h" #include "qgeomappixmapobject.h" #include <QColor> #include <QUrl> #include <QNetworkReply> QTM_BEGIN_NAMESPACE class QDeclarativeGeoMapPixmapObject : public QDeclarativeGeoMapObject { Q_OBJECT Q_ENUMS(Status) Q_PROPERTY(QDeclarativeCoordinate* coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged) Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(QPoint offset READ offset WRITE setOffset NOTIFY offsetChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) public: enum Status { Null, Ready, Loading, Error }; QDeclarativeGeoMapPixmapObject(QDeclarativeItem *parent = 0); ~QDeclarativeGeoMapPixmapObject(); QDeclarativeCoordinate* coordinate(); void setCoordinate(QDeclarativeCoordinate *coordinate); QUrl source() const; void setSource(const QUrl &source); QPoint offset() const; void setOffset(const QPoint &offset); Status status() const; Q_SIGNALS: void coordinateChanged(const QDeclarativeCoordinate *coordinate); void sourceChanged(const QUrl &source); void offsetChanged(const QPoint &offset); void statusChanged(QDeclarativeGeoMapPixmapObject::Status status); private Q_SLOTS: void coordinateLatitudeChanged(double latitude); void coordinateLongitudeChanged(double longitude); void coordinateAltitudeChanged(double altitude); void finished(); void error(QNetworkReply::NetworkError error); private: void setStatus(const QDeclarativeGeoMapPixmapObject::Status status); void load(); QGeoMapPixmapObject* pixmap_; QDeclarativeCoordinate *coordinate_; QUrl source_; QNetworkReply *reply_; Status status_; Q_DISABLE_COPY(QDeclarativeGeoMapPixmapObject) }; QTM_END_NAMESPACE QML_DECLARE_TYPE(QTM_PREPEND_NAMESPACE(QDeclarativeGeoMapPixmapObject)); #endif
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** Commercial Usage ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef PROFILEEDITOR_H #define PROFILEEDITOR_H #include <texteditor/basetextdocument.h> #include <texteditor/basetexteditor.h> namespace TextEditor { class FontSettings; class TextEditorActionHandler; } namespace Qt4ProjectManager { class Qt4Manager; class Qt4Project; namespace Internal { class ProFileEditorFactory; class ProFileHighlighter; class ProFileEditor; class ProFileEditorEditable : public TextEditor::BaseTextEditorEditable { public: ProFileEditorEditable(ProFileEditor *); QList<int> context() const; bool duplicateSupported() const { return true; } Core::IEditor *duplicate(QWidget *parent); QString id() const; bool isTemporary() const { return false; } private: QList<int> m_context; }; class ProFileEditor : public TextEditor::BaseTextEditor { Q_OBJECT public: ProFileEditor(QWidget *parent, ProFileEditorFactory *factory, TextEditor::TextEditorActionHandler *ah); ~ProFileEditor(); bool save(const QString &fileName = QString()); ProFileEditorFactory *factory() { return m_factory; } TextEditor::TextEditorActionHandler *actionHandler() const { return m_ah; } protected: TextEditor::BaseTextEditorEditable *createEditableInterface(); public slots: virtual void setFontSettings(const TextEditor::FontSettings &); private: ProFileEditorFactory *m_factory; TextEditor::TextEditorActionHandler *m_ah; }; class ProFileDocument : public TextEditor::BaseTextDocument { Q_OBJECT public: ProFileDocument(); QString defaultPath() const; QString suggestedFileName() const; }; } // namespace Internal } // namespace Qt4ProjectManager #endif // PROFILEEDITOR_H
/*************************************************************************** ** ** Copyright (C) 2012 Jolla Ltd. ** Contact: Robin Burchell <robin.burchell@jollamobile.com> ** ** This file is part of lipstick. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef PULSEAUDIOCONTROL_H #define PULSEAUDIOCONTROL_H #include <QObject> #include <dbus/dbus.h> /*! * \class PulseAudioControl * * \brief Gets and sets the volume using the MainVolume API. */ class PulseAudioControl : public QObject { Q_OBJECT public: //! Construct a PulseAudioControl instance PulseAudioControl(QObject *parent = NULL); //! Destroys the PulseAudioControl instance virtual ~PulseAudioControl(); /*! * Queries the PulseAudio daemon for the volume levels (current and maximum). * If successful, maximumVolumeSet and currentVolumeSet signals will be * emitted. */ void update(); signals: /*! * Sent when the current volume level has changed. * * \param level The new volume level */ void currentVolumeSet(int level); /*! * Sent when the maximum volume level has changed. * * \param level The new maximum volume level */ void maximumVolumeSet(int level); public slots: /*! * Changes the volume level through the volume backend. * * \param volume The desired volume level */ void setVolume(int volume); private: //! Opens connection to PulseAudio daemon. void openConnection(); /*! * Stores the current volume and the maximum volume. * * \param currentStep The current volume step * \param stepCount Number of volume steps */ void setSteps(quint32 currentStep, quint32 stepCount); //! Registers a signal handler to listen to the PulseAudio MainVolume1 StepsUpdated signal void addSignalMatch(); /*! * The signal handler for PulseAudio's MainVolume1 signal * * \param conn D-Bus connection structure * \param message signal message * \param control PulseAudioControl instance handling this signal */ static DBusHandlerResult stepsUpdatedSignalHandler(DBusConnection *conn, DBusMessage *message, void *control); //! D-Bus connection structure DBusConnection *dbusConnection; Q_DISABLE_COPY(PulseAudioControl) #ifdef UNIT_TEST friend class Ut_PulseAudioControl; #endif }; #endif
/* Copyright (C) 2010 Fredrik Johansson This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <gmp.h> #include "flint.h" #include "nmod_vec.h" #include "nmod_mat.h" #include "ulong_extras.h" int main(void) { nmod_mat_t A, X, B, AX; slong i, m, n, r; mp_limb_t mod; int solved; FLINT_TEST_INIT(state); flint_printf("solve...."); fflush(stdout); for (i = 0; i < 1000 * flint_test_multiplier(); i++) { m = n_randint(state, 20); n = n_randint(state, 20); mod = n_randtest_prime(state, 0); nmod_mat_init(A, m, m, mod); nmod_mat_init(B, m, n, mod); nmod_mat_init(X, m, n, mod); nmod_mat_init(AX, m, n, mod); nmod_mat_randrank(A, state, m); nmod_mat_randtest(B, state); /* Dense */ if (n_randint(state, 2)) nmod_mat_randops(A, 1+n_randint(state, 1+m*m), state); solved = nmod_mat_solve(X, A, B); nmod_mat_mul(AX, A, X); if (!nmod_mat_equal(AX, B) || !solved) { flint_printf("FAIL:\n"); flint_printf("AX != B!\n"); flint_printf("A:\n"); nmod_mat_print_pretty(A); flint_printf("B:\n"); nmod_mat_print_pretty(B); flint_printf("X:\n"); nmod_mat_print_pretty(X); flint_printf("AX:\n"); nmod_mat_print_pretty(AX); flint_printf("\n"); abort(); } nmod_mat_clear(A); nmod_mat_clear(B); nmod_mat_clear(X); nmod_mat_clear(AX); } /* Test singular systems */ for (i = 0; i < 1000 * flint_test_multiplier(); i++) { m = 1 + n_randint(state, 20); n = 1 + n_randint(state, 20); r = n_randint(state, m); mod = n_randtest_prime(state, 0); nmod_mat_init(A, m, m, mod); nmod_mat_init(B, m, n, mod); nmod_mat_init(X, m, n, mod); nmod_mat_init(AX, m, n, mod); nmod_mat_randrank(A, state, r); nmod_mat_randtest(B, state); /* Dense */ if (n_randint(state, 2)) nmod_mat_randops(A, 1+n_randint(state, 1+m*m), state); solved = nmod_mat_solve(X, A, B); if (solved) { flint_printf("FAIL:\n"); flint_printf("singular system was 'solved'\n"); nmod_mat_print_pretty(A); nmod_mat_print_pretty(X); nmod_mat_print_pretty(B); abort(); } nmod_mat_clear(A); nmod_mat_clear(B); nmod_mat_clear(X); nmod_mat_clear(AX); } FLINT_TEST_CLEANUP(state); flint_printf("PASS\n"); return 0; }
/* * Copyright (C) 2011 Igalia S.L. * * Contact: Iago Toral Quiroga <itoral@igalia.com> * * Authors: Juan A. Suarez Romero <jasuarez@igalia.com> * * 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; version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #if !defined (_GRILO_H_INSIDE_) && !defined (GRILO_COMPILATION) #error "Only <grilo.h> can be included directly." #endif #ifndef _GRL_RELATED_KEYS_H_ #define _GRL_RELATED_KEYS_H_ #include <glib-object.h> #include <grl-metadata-key.h> #include <grl-definitions.h> G_BEGIN_DECLS #define GRL_TYPE_RELATED_KEYS \ (grl_related_keys_get_type()) #define GRL_RELATED_KEYS(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ GRL_TYPE_RELATED_KEYS, \ GrlRelatedKeys)) #define GRL_RELATED_KEYS_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ GRL_TYPE_RELATED_KEYS, \ GrlRelatedKeysClass)) #define GRL_IS_RELATED_KEYS(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ GRL_TYPE_RELATED_KEYS)) #define GRL_IS_RELATED_KEYS_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ GRL_TYPE_RELATED_KEYS)) #define GRL_RELATED_KEYS_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ GRL_TYPE_RELATED_KEYS, \ GrlRelatedKeysClass)) typedef struct _GrlRelatedKeys GrlRelatedKeys; typedef struct _GrlRelatedKeysPrivate GrlRelatedKeysPrivate; typedef struct _GrlRelatedKeysClass GrlRelatedKeysClass; G_DEFINE_AUTOPTR_CLEANUP_FUNC (GrlRelatedKeys, g_object_unref) struct _GrlRelatedKeys { GObject parent; /*< private >*/ GrlRelatedKeysPrivate *priv; gpointer _grl_reserved[GRL_PADDING_SMALL]; }; /** * GrlRelatedKeysClass: * @parent_class: the parent class structure * * Grilo Data Multivalued class */ struct _GrlRelatedKeysClass { GObjectClass parent_class; /*< private >*/ gpointer _grl_reserved[GRL_PADDING]; }; GType grl_related_keys_get_type (void) G_GNUC_CONST; GrlRelatedKeys *grl_related_keys_new (void); GrlRelatedKeys *grl_related_keys_new_valist (GrlKeyID key, va_list args); GrlRelatedKeys *grl_related_keys_new_with_keys (GrlKeyID key, ...); void grl_related_keys_set (GrlRelatedKeys *relkeys, GrlKeyID key, const GValue *value); void grl_related_keys_set_string (GrlRelatedKeys *relkeys, GrlKeyID key, const gchar *strvalue); void grl_related_keys_set_int (GrlRelatedKeys *relkeys, GrlKeyID key, gint intvalue); void grl_related_keys_set_float (GrlRelatedKeys *relkeys, GrlKeyID key, gfloat floatvalue); void grl_related_keys_set_boolean (GrlRelatedKeys *relkeys, GrlKeyID key, gboolean booleanvalue); void grl_related_keys_set_binary(GrlRelatedKeys *relkeys, GrlKeyID key, const guint8 *buf, gsize size); void grl_related_keys_set_boxed (GrlRelatedKeys *relkeys, GrlKeyID key, gconstpointer boxed); void grl_related_keys_set_int64 (GrlRelatedKeys *relkeys, GrlKeyID key, gint64 intvalue); const GValue *grl_related_keys_get (GrlRelatedKeys *relkeys, GrlKeyID key); const gchar *grl_related_keys_get_string (GrlRelatedKeys *relkeys, GrlKeyID key); gint grl_related_keys_get_int (GrlRelatedKeys *relkeys, GrlKeyID key); gfloat grl_related_keys_get_float (GrlRelatedKeys *relkeys, GrlKeyID key); gboolean grl_related_keys_get_boolean (GrlRelatedKeys *relkeys, GrlKeyID key); const guint8 *grl_related_keys_get_binary(GrlRelatedKeys *relkeys, GrlKeyID key, gsize *size); gconstpointer grl_related_keys_get_boxed (GrlRelatedKeys *relkeys, GrlKeyID key); gint64 grl_related_keys_get_int64 (GrlRelatedKeys *relkeys, GrlKeyID key); void grl_related_keys_remove (GrlRelatedKeys *relkeys, GrlKeyID key); gboolean grl_related_keys_has_key (GrlRelatedKeys *relkeys, GrlKeyID key); GList *grl_related_keys_get_keys (GrlRelatedKeys *relkeys); GrlRelatedKeys *grl_related_keys_dup (GrlRelatedKeys *relkeys); G_END_DECLS #endif /* _GRL_RELATED_KEYS_H_ */
/*************************************************************************** ** ** Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef MPROGRESSINDICATORBARVIEW_P_H #define MPROGRESSINDICATORBARVIEW_P_H #include <QObject> #include "mprogressindicatorbarview.h" class MStyle; class MProgressIndicator; class MScalableImage; class QPropertyAnimation; class QTimer; class MProgressIndicatorBarViewPrivate : public QObject { Q_OBJECT Q_DECLARE_PUBLIC(MProgressIndicatorBarView) public: MProgressIndicatorBarViewPrivate(); ~MProgressIndicatorBarViewPrivate(); void drawBar(QPainter* painter) const; void clearBarImages(); void clearAnimationCache(); const QImage* getCurrentCachedImage() const; bool fullWidth() const; bool barImagesCreated() const; void animate(bool); void setupAnimation(); void setupBarImages(); const MWindow* getMWindow(); MProgressIndicator *controller; public Q_SLOTS: void setAnimationCacheIndex(); void switcherEntered(); void switcherExited(); protected: MProgressIndicatorBarView *q_ptr; private: void createBarImages(); void createAnimationCache(); void drawComposedRectangle(QPainter* painter, const QRectF& rect) const; void drawTexture(QPainter* painter, const QRectF& rect) const; QTimer* animationTimer; QImage leftEndImage; QImage rightEndImage; QImage barBodyImage; bool inSwitcher; QList<QImage*> animationCache; int animationCacheIndex; #ifdef UNIT_TEST friend class Ut_MProgressIndicatorBarView; #endif #ifdef M_UNIT_TEST M_UNIT_TEST; #endif }; #endif // MPROGRESSINDICATORBARVIEW_P_H
/* BEGIN_COMMON_COPYRIGHT_HEADER * (c)LGPL2+ * * LXDE-Qt - a lightweight, Qt based, desktop toolset * http://razor-qt.org * * Copyright: 2012 Razor team * Authors: * Petr Vanek <petr@scribus.info> * * This program or library is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * END_COMMON_COPYRIGHT_HEADER */ #ifndef NOTIFICATION_H #define NOTIFICATION_H #include <QObject> #include <QTimer> #include <QIcon> #include <QDateTime> #include "ui_notification.h" class NotificationActionsWidget; class NotificationTimer; /*! Implementation of one notification. * * Notification on-click behavior is defined in mouseReleaseEvent() */ class Notification : public QWidget, public Ui::Notification { Q_OBJECT public: /*! Construct a notification. * Parameters are described in \c Notifyd::Notify() */ explicit Notification(const QString &application, const QString &summary, const QString &body, const QString &icon, int timeout, const QStringList& actions, const QVariantMap& hints, QWidget *parent = 0); /*! Set new values (update) for existing notification. * Parameters are described in \c Notifyd::Notify() */ void setValues(const QString &application, const QString &summary, const QString &body, const QString &icon, int timeout, const QStringList& actions, const QVariantMap& hints); QString application() const; QString summary() const; QString body() const; signals: //! the server set timeout passed. Notification should close itself. void timeout(); //! User clicked the "close" button void userCanceled(); /*! User selected some of actions provided * \param actionKey an action key */ void actionTriggered(const QString &actionKey); protected: void enterEvent(QEvent * event); void leaveEvent(QEvent * event); /*! Define on-click behavior in the notification area. Currently it implements: - if there is one action or at least one default action, this default action is triggered on click. \see NotificationActionsWidget::hasDefaultAction() \see NotificationActionsWidget::defaultAction() - it tries to find caller window by a) application name. \see XfitMan::getApplicationName() b) window title. \see XfitMan::getWindowTitle() if it can be found the window is raised and the notification is closed - leave notification as-is. */ void mouseReleaseEvent(QMouseEvent * event); private: NotificationTimer *m_timer; QPixmap m_pixmap; NotificationActionsWidget *m_actionWidget; // mandatory for stylesheets void paintEvent(QPaintEvent *); QPixmap getPixmapFromHint(const QVariant &argument) const; QPixmap getPixmapFromString(const QString &str) const; private slots: void closeButton_clicked(); }; /*! A timer with pause/resume functionality * */ class NotificationTimer : public QTimer { Q_OBJECT public: NotificationTimer(QObject *parent=0); public slots: void start(int msec); void pause(); void resume(); private: QDateTime m_startTime; qint64 m_intervalMsec; }; #endif // NOTIFICATION_H
/**************************************************************************** ** ** Copyright (C) 2013 Jolla Ltd. ** Contact: lorn.potter@jollamobile.com ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ****************************************************************************/ #ifndef QOFONOQLOCATIONREPORTING_H #define QOFONOQLOCATIONREPORTING_H #include <QObject> #include <QDBusVariant> #include <QStringList> class QOfonoLocationReportingPrivate; class QOfonoLocationReporting : public QObject { Q_OBJECT Q_PROPERTY(QString modemPath READ modemPath WRITE setModemPath NOTIFY modemPathChanged) Q_PROPERTY(QString type READ type) Q_PROPERTY(bool enabled READ enabled) public: explicit QOfonoLocationReporting(QObject *parent = 0); ~QOfonoLocationReporting(); QString modemPath() const; void setModemPath(const QString &path); QString type() const; bool enabled() const; bool isValid() const; public slots: void release(); int request(); Q_SIGNALS: void modemPathChanged(const QString &path); private: QOfonoLocationReportingPrivate *d_ptr; private slots: }; #endif // QOFONOQLOCATIONREPORTING_H
/* * This file is part of the DOM implementation for KDE. * * Copyright (C) 2007 Rob Buis <buis@kde.org> * (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef SVGInlineTextBox_h #define SVGInlineTextBox_h #if ENABLE(SVG) #include "InlineTextBox.h" namespace WebCore { class SVGRootInlineBox; struct SVGChar; struct SVGTextDecorationInfo; class SVGInlineTextBox : public InlineTextBox { public: SVGInlineTextBox(RenderObject* obj); virtual int virtualHeight() const { return m_height; } void setHeight(int h) { m_height = h; } virtual int selectionTop(); virtual int selectionHeight(); virtual int offsetForPosition(int x, bool includePartialGlyphs = true) const; virtual int positionForOffset(int offset) const; virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty); virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos); // SVGs custom paint text method void paintCharacters(RenderObject::PaintInfo&, int tx, int ty, const SVGChar&, const UChar* chars, int length, SVGPaintServer*); // SVGs custom paint selection method void paintSelection(int boxStartOffset, const SVGChar&, const UChar*, int length, GraphicsContext*, RenderStyle*, const Font&); // SVGs custom paint decoration method void paintDecoration(ETextDecoration, GraphicsContext*, int tx, int ty, int width, const SVGChar&, const SVGTextDecorationInfo&); SVGRootInlineBox* svgRootInlineBox() const; // Helper functions shared with SVGRootInlineBox float calculateGlyphWidth(RenderStyle* style, int offset, int extraCharsAvailable, int& charsConsumed, String& glyphName) const; float calculateGlyphHeight(RenderStyle*, int offset, int extraCharsAvailable) const; FloatRect calculateGlyphBoundaries(RenderStyle*, int offset, const SVGChar&) const; SVGChar* closestCharacterToPosition(int x, int y, int& offset) const; private: friend class RenderSVGInlineText; bool svgCharacterHitsPosition(int x, int y, int& offset) const; int m_height; }; } // namespace WebCore #endif #endif // SVGInlineTextBox_h
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWINDOWSSTYLE_P_H #define QWINDOWSSTYLE_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #include "qwindowsstyle.h" #include "qcommonstyle_p.h" #ifndef QT_NO_STYLE_WINDOWS #include <qlist.h> #include <qdatetime.h> #include <qhash.h> QT_BEGIN_NAMESPACE class QTime; class QProgressBar; class QWindowsStylePrivate : public QCommonStylePrivate { Q_DECLARE_PUBLIC(QWindowsStyle) public: QWindowsStylePrivate(); bool hasSeenAlt(const QWidget *widget) const; bool altDown() const { return alt_down; } bool alt_down; QList<const QWidget *> seenAlt; int menuBarTimer; QList<QProgressBar *> bars; int animationFps; int animateTimer; QTime startTime; int animateStep; QColor inactiveCaptionText; QColor activeCaptionColor; QColor activeGradientCaptionColor; QColor inactiveCaptionColor; QColor inactiveGradientCaptionColor; }; QT_END_NAMESPACE #endif // QT_NO_STYLE_WINDOWS #endif //QWINDOWSSTYLE_P_H
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSHAREDMEMORY_P_H #define QSHAREDMEMORY_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qsharedmemory.h" #ifdef QT_NO_SHAREDMEMORY # ifndef QT_NO_SYSTEMSEMAPHORE namespace QSharedMemoryPrivate { int createUnixKeyFile(const QString &fileName); QString makePlatformSafeKey(const QString &key, const QString &prefix = QLatin1String("qipc_sharedmemory_")); } #endif #else #include "qsystemsemaphore.h" #include "private/qobject_p.h" #ifdef Q_OS_WIN #include <qt_windows.h> #elif defined(Q_OS_SYMBIAN) #include <e32std.h> #include <sys/types.h> #else #include <sys/sem.h> #endif QT_BEGIN_NAMESPACE #ifndef QT_NO_SYSTEMSEMAPHORE /*! Helper class */ class QSharedMemoryLocker { public: inline QSharedMemoryLocker(QSharedMemory *sharedMemory) : q_sm(sharedMemory) { Q_ASSERT(q_sm); } inline ~QSharedMemoryLocker() { if (q_sm) q_sm->unlock(); } inline bool lock() { if (q_sm && q_sm->lock()) return true; q_sm = 0; return false; } private: QSharedMemory *q_sm; }; #endif // QT_NO_SYSTEMSEMAPHORE class Q_AUTOTEST_EXPORT QSharedMemoryPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QSharedMemory) public: QSharedMemoryPrivate(); void *memory; int size; QString key; QSharedMemory::SharedMemoryError error; QString errorString; #ifndef QT_NO_SYSTEMSEMAPHORE QSystemSemaphore systemSemaphore; bool lockedByMe; #endif static int createUnixKeyFile(const QString &fileName); static QString makePlatformSafeKey(const QString &key, const QString &prefix = QLatin1String("qipc_sharedmemory_")); #ifdef Q_OS_WIN HANDLE handle(); #else key_t handle(); #endif bool initKey(); bool cleanHandle(); bool create(int size); bool attach(QSharedMemory::AccessMode mode); bool detach(); #ifdef Q_OS_SYMBIAN void setErrorString(const QString &function, TInt errorCode); #else void setErrorString(const QString &function); #endif #ifndef QT_NO_SYSTEMSEMAPHORE bool tryLocker(QSharedMemoryLocker *locker, const QString function) { if (!locker->lock()) { errorString = QSharedMemory::tr("%1: unable to lock").arg(function); error = QSharedMemory::LockError; return false; } return true; } #endif // QT_NO_SYSTEMSEMAPHORE private: #ifdef Q_OS_WIN HANDLE hand; #elif defined(Q_OS_SYMBIAN) RChunk chunk; #else key_t unix_key; #endif }; QT_END_NAMESPACE #endif // QT_NO_SHAREDMEMORY #endif // QSHAREDMEMORY_P_H
//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html #pragma once #include "ComputeEigenstrainBeamBase.h" /** * ComputeEigenstrainBeamFromVariable computes an eigenstrain from displacement and rotational * eigenstrain variables */ class ComputeEigenstrainBeamFromVariable : public ComputeEigenstrainBeamBase { public: static InputParameters validParams(); ComputeEigenstrainBeamFromVariable(const InputParameters & parameters); protected: virtual void computeQpEigenstrain() override; /// Number of displacement eigenstrain variables const unsigned int _ndisp; /// Number of rotational eigenstrain variables const unsigned int _nrot; /// Displacemenet eigenstrain variable values std::vector<const VariableValue *> _disp; /// Rotational eigenstrain variable values std::vector<const VariableValue *> _rot; };
//===-- R600ISelLowering.h - R600 DAG Lowering Interface -*- C++ -*--------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // /// \file /// \brief R600 DAG Lowering interface definition // //===----------------------------------------------------------------------===// #ifndef R600ISELLOWERING_H #define R600ISELLOWERING_H #include "AMDGPUISelLowering.h" namespace llvm { class R600InstrInfo; class R600TargetLowering : public AMDGPUTargetLowering { public: R600TargetLowering(TargetMachine &TM); virtual MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock * BB) const; virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const; virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; void ReplaceNodeResults(SDNode * N, SmallVectorImpl<SDValue> &Results, SelectionDAG &DAG) const; virtual SDValue LowerFormalArguments( SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc DL, SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const; virtual EVT getSetCCResultType(LLVMContext &, EVT VT) const; private: unsigned Gen; /// Each OpenCL kernel has nine implicit parameters that are stored in the /// first nine dwords of a Vertex Buffer. These implicit parameters are /// lowered to load instructions which retrieve the values from the Vertex /// Buffer. SDValue LowerImplicitParameter(SelectionDAG &DAG, EVT VT, SDLoc DL, unsigned DwordOffset) const; void lowerImplicitParameter(MachineInstr *MI, MachineBasicBlock &BB, MachineRegisterInfo & MRI, unsigned dword_offset) const; SDValue OptimizeSwizzle(SDValue BuildVector, SDValue Swz[], SelectionDAG &DAG) const; /// \brief Lower ROTL opcode to BITALIGN SDValue LowerROTL(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const; SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFPTOUINT(SDValue Op, SelectionDAG &DAG) const; SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const; SDValue LowerTrig(SDValue Op, SelectionDAG &DAG) const; SDValue stackPtrToRegIndex(SDValue Ptr, unsigned StackWidth, SelectionDAG &DAG) const; void getStackAddress(unsigned StackWidth, unsigned ElemIdx, unsigned &Channel, unsigned &PtrIncr) const; bool isZero(SDValue Op) const; virtual SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const; }; } // End namespace llvm; #endif // R600ISELLOWERING_H
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtSql module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSQL_MYSQL_H #define QSQL_MYSQL_H #include <QtSql/qsqldriver.h> #include <QtSql/qsqlresult.h> #if defined (Q_OS_WIN32) #include <QtCore/qt_windows.h> #endif #include <mysql.h> #ifdef QT_PLUGIN #define Q_EXPORT_SQLDRIVER_MYSQL #else #define Q_EXPORT_SQLDRIVER_MYSQL Q_SQL_EXPORT #endif QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QMYSQLDriverPrivate; class QMYSQLResultPrivate; class QMYSQLDriver; class QSqlRecordInfo; class QMYSQLResult : public QSqlResult { friend class QMYSQLDriver; friend class QMYSQLResultPrivate; public: explicit QMYSQLResult(const QMYSQLDriver* db); ~QMYSQLResult(); QVariant handle() const; protected: void cleanup(); bool fetch(int i); bool fetchNext(); bool fetchLast(); bool fetchFirst(); QVariant data(int field); bool isNull(int field); bool reset (const QString& query); int size(); int numRowsAffected(); QVariant lastInsertId() const; QSqlRecord record() const; void virtual_hook(int id, void *data); bool nextResult(); #if MYSQL_VERSION_ID >= 40108 bool prepare(const QString& stmt); bool exec(); #endif private: QMYSQLResultPrivate* d; }; class Q_EXPORT_SQLDRIVER_MYSQL QMYSQLDriver : public QSqlDriver { Q_OBJECT friend class QMYSQLResult; public: explicit QMYSQLDriver(QObject *parent=0); explicit QMYSQLDriver(MYSQL *con, QObject * parent=0); ~QMYSQLDriver(); bool hasFeature(DriverFeature f) const; bool open(const QString & db, const QString & user, const QString & password, const QString & host, int port, const QString& connOpts); void close(); QSqlResult *createResult() const; QStringList tables(QSql::TableType) const; QSqlIndex primaryIndex(const QString& tablename) const; QSqlRecord record(const QString& tablename) const; QString formatValue(const QSqlField &field, bool trimStrings) const; QVariant handle() const; QString escapeIdentifier(const QString &identifier, IdentifierType type) const; protected Q_SLOTS: bool isIdentifierEscapedImplementation(const QString &identifier, IdentifierType type) const; protected: bool beginTransaction(); bool commitTransaction(); bool rollbackTransaction(); private: void init(); QMYSQLDriverPrivate* d; }; QT_END_NAMESPACE QT_END_HEADER #endif // QSQL_MYSQL_H
/* * Copyright 2001 Rafael Steil <rafael@insanecorp.com> * * SPDX-License-Identifier: LGPL-2.1+ * License-Filename: LICENSES/LGPL-2.1.txt */ #ifndef _ERROR_H #define _ERROR_H 1 #ifdef __cplusplus extern "C" { #endif #define E_WARNING 0 #define E_FATAL 1 #define E_CAUTION 2 #define E_INFORMATION 3 #define E_MEMORY 4 extern void libcgi_error(int error_code, const char *msg, ...); extern const char *libcgi_error_type[]; #ifdef __cplusplus } #endif #endif
/* * @BEGIN LICENSE * * Psi4: an open-source quantum chemistry software package * * Copyright (c) 2007-2021 The Psi4 Developers. * * The copyrights for code used from other parties are included in * the corresponding files. * * This file is part of Psi4. * * Psi4 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, version 3. * * Psi4 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 Psi4; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * @END LICENSE */ #ifndef _PSI_SRC_LIB_LIBDIIS_DIISMANAGER_H_ #define _PSI_SRC_LIB_LIBDIIS_DIISMANAGER_H_ #include <vector> #include <map> #include "psi4/pragma.h" #include "psi4/libdiis/diisentry.h" #include "psi4/libmints/matrix.h" namespace psi { class PSIO; /** @brief The DIISManager class handles DIIS extrapolations. */ class PSI_API DIISManager { public: /** * @brief How the quantities are to be stored; * * OnDisk - Stored on disk, and retrieved when required * InCore - Stored in memory throughout */ enum class StoragePolicy { InCore, OnDisk }; /** * @brief How vectors are removed from the subspace, when required * * LargestError - The vector corresponding to the largest error is removed * OldestFirst - A first-in-first-out policy is used */ enum class RemovalPolicy { LargestError, OldestAdded }; DIISManager(int maxSubspaceSize, const std::string& label, RemovalPolicy = RemovalPolicy::LargestError, StoragePolicy = StoragePolicy::OnDisk); DIISManager() { _maxSubspaceSize = 0; } ~DIISManager(); // C-style variadic allows you to DIIS "direct sums" of quantities. // For instance, orbital-optimized theories can do a combined DIIS on orbital amplitudes and T2 void set_error_vector_size(int numQuantities, ...); void set_vector_size(int numQuantities, ...); bool extrapolate(int numQuatities, ...); bool add_entry(int numQuatities, ...); // Wrappers for those who dislike variadic void set_error_vector_size(SharedMatrix error) { DIISManager::set_error_vector_size(1, error.get()); } void set_vector_size(SharedMatrix state) { DIISManager::set_vector_size(1, state.get()); } bool add_entry(SharedMatrix state, SharedMatrix error) { return DIISManager::add_entry(2, state.get(), error.get()); } bool extrapolate(SharedMatrix extrapolated) { return DIISManager::extrapolate(1, extrapolated.get()); } int remove_entry(); void reset_subspace(); void delete_diis_file(); /// The number of vectors currently in the subspace int subspace_size(); protected: int get_next_entry_id(); /// How the vectors are handled in memory StoragePolicy _storagePolicy; /// How vectors are removed from the subspace RemovalPolicy _removalPolicy; /// The maximum number of vectors allowed in the subspace int _maxSubspaceSize; /// The size of the error vector int _errorVectorSize; /// The size of the vector int _vectorSize; /// The number of components in the error vector int _numErrorVectorComponents; /// The number of components in the vector int _numVectorComponents; /// The counter that keeps track of how many entries have been added int _entryCount; /// The DIIS entries std::vector<DIISEntry> _subspace; /// The types used in building the vector and the error vector std::vector<DIISEntry::InputType> _componentTypes; /// The types used in the vector std::vector<size_t> _componentSizes; /// The label used in disk storage of the DIISEntry objects std::string _label; /// The PSIO object to use for I/O std::shared_ptr<PSIO> _psio; }; } // namespace psi #endif // Header guard
#include "qep.h" /* QEP/C public interface */ #include "qbomb.h" /* QBomb derived from QFsm */ static QBomb l_qbomb; /* an instance of QBomb FSM */ int main() { QBomb_ctor(&l_bomb); /* QBomb "constructor" invokes QFsm_ctor() */ QMSM_INIT(&l_qbomb.super, (QEvt *)0); /* trigger initial transition */ for (;;) { /* event loop */ QEvt e; . . . /* wait for the next event and assign it to the event object e */ . . . QMSM_DISPATCH(&l_qbomb.super, &e); /* dispatch e */ } return 0; }
/***************************************************************************** * Product: BSP for State-Local Storage Example, 80x86, Vanilla, Open Watcom * Last Updated for Version: 4.1.01 * Date of the Last Update: Nov 04, 2009 * * Q u a n t u m L e a P s * --------------------------- * innovating embedded systems * * Copyright (C) 2002-2009 Quantum Leaps, LLC. All rights reserved. * * This software may be distributed and modified under the terms of the GNU * General Public License version 2 (GPL) as published by the Free Software * Foundation and appearing in the file GPL.TXT included in the packaging of * this file. Please note that GPL Section 2[b] requires that all works based * on this software must also be made publicly available under the terms of * the GPL ("Copyleft"). * * Alternatively, this software may be distributed and modified under the * terms of Quantum Leaps commercial licenses, which expressly supersede * the GPL and are specifically designed for licensees interested in * retaining the proprietary status of their code. * * Contact information: * Quantum Leaps Web site: http://www.quantum-leaps.com * e-mail: info@quantum-leaps.com *****************************************************************************/ #ifndef bsp_h #define bsp_h #define BSP_TICKS_PER_SEC 50 void BSP_init(int argc, char *argv[]); void BSP_exit(void); #endif /* bsp_h */
#ifndef __GRAPH_GTK_TYPES_H__ #define __GRAPH_GTK_TYPES_H__ typedef struct _GraphGtkPad GraphGtkPad; typedef struct _GraphGtkPadClass GraphGtkPadClass; typedef struct _GraphGtkView GraphGtkView; typedef struct _GraphGtkViewClass GraphGtkViewClass; typedef struct _GraphGtkConnection GraphGtkConnection; typedef struct _GraphGtkConnectionClass GraphGtkConnectionClass; typedef struct _GraphGtkNode GraphGtkNode; typedef struct _GraphGtkNodeClass GraphGtkNodeClass; #endif /* __GRAPH_GTK_TYPES_H__ */
/******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRTUT8UNPACK_H #define FAIRTUT8UNPACK_H #include "FairUnpack.h" class TClonesArray; /** * An example unpacker of MBS data. */ class FairTut8Unpack : public FairUnpack { public: /** Standard Constructor. Input - MBS parameters of the detector. */ FairTut8Unpack(Short_t type = 94, Short_t subType = 9400, Short_t procId = 10, Short_t subCrate = 1, Short_t control = 3); /** Destructor. */ virtual ~FairTut8Unpack(); /** Initialization. Called once, before the event loop. */ virtual Bool_t Init(); /** Process an MBS sub-event. */ virtual Bool_t DoUnpack(Int_t* data, Int_t size); /** Clear the output structures. */ virtual void Reset(); /** Method for controling the functionality. */ inline Int_t GetNHitsTotal() { return fNHitsTotal; } protected: /** Register the output structures. */ virtual void Register(); private: TClonesArray* fRawData; /**< Array of output raw items. */ Int_t fNHits; /**< Number of raw items in current event. */ Int_t fNHitsTotal; /**< Total number of raw items. */ public: // Class definition ClassDef(FairTut8Unpack, 1) }; #endif
// // MNSWorklog.h // // Copyright 2014 MediaNet Software // This file is part of MNSJiraRESTClient. // // MNSJiraRESTClient 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 3 of the License. // // MNSJiraRESTClient 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 MNSJiraRESTClient. If not, see <http://www.gnu.org/licenses/>. #import "MNSAddressableNamedEntity.h" #import "MNSBasicUser.h" #import "MNSVisibility.h" @interface MNSWorklog : NSObject <MNSAddressable> @property (copy, nonatomic) NSString *selfUrl; @property (copy, nonatomic) NSString *issueUri; @property (strong, nonatomic) MNSBasicUser *author; @property (strong, nonatomic) MNSBasicUser *updateAuthor; @property (copy, nonatomic) NSString *comment; @property (strong, nonatomic) NSDate *creationDate; @property (strong, nonatomic) NSDate *updateDate; @property (strong, nonatomic) NSDate *startDate; @property (assign, nonatomic) NSInteger minutesSpent; @property (strong, nonatomic) MNSVisibility *visibility; @end
// Copyright (c) 2012-2015, The CryptoNote developers, The Bytecoin developers // // This file is part of Bytecoin. // // Bytecoin 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 3 of the License, or // (at your option) any later version. // // Bytecoin 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 Bytecoin. If not, see <http://www.gnu.org/licenses/>. #pragma once #include <cstdint> #include <string> #include <boost/program_options.hpp> namespace CryptoNote { class MinerConfig { public: MinerConfig(); static void initOptions(boost::program_options::options_description& desc); void init(const boost::program_options::variables_map& options); std::string extraMessages; std::string startMining; uint32_t miningThreads; }; } //namespace CryptoNote
// agents.h #ifndef AGENTS_H #define AGENTS_H #include <iostream> #include <string> #include <map> #include <set> #include "map.h" class Agent { protected: Agent(); Agent(std::string); std::string name; std::set<std::string> items; public: virtual bool act(std::string, std::string)=0; Room * cr; }; class Asteroid : public Agent { protected: int start_time; int time_left; public: Asteroid(std::string); bool act(std::string, std::string); void get_time(); void get_end_time(); }; class Player : public Agent { public: Player(); Player(std::string, std::set<std::string>); std::map<std::string, bool> conditions; int get_info(Asteroid &); bool act(std::string, std::string); std::string get_name(); bool take_item(std::string); bool drop_item(std::string); bool use_item(std::string); void check_items(); }; Player read_player_info(); // Levels void level_one(Player &); void alien(Player &); void end_game(Player &); // void end_game(Monster &); #endif
/*- * Copyright (c) 2014 Michael Roe * All rights reserved. * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE 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. */ /* * This is a simple test program for FreeBSD's libstand. * * This program is intended to be linked against libstand (not the normal C * run-time library), and run on bare metal (i.e. without an operating system). */ /* * When cross-compiling this program, the --sysroot option will be passed to * the compiler, so that it uses the header files for the target system * (BERI BSD) rather than the host system on which the cross-compiler is * being run. * * libstand is designed so that it's replacements for libc functions * have the same type signature as is declared in <stdlib.h> etc. */ #include <stdio.h> #include <stdlib.h> int test(void) { long x; printf("Hello World!\n"); x = random(); printf("Result of random() = %ld\n", x); x = strtol("42", (char **) 0, 0); printf("Result of strtol() = %ld\n", x); return (0); }
/* Q Light Controller enttecdmxusbconfig.h Copyright (C) Heikki Junnila Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef ENTTECDMXUSBCONFIG_H #define ENTTECDMXUSBCONFIG_H #include <QDialog> class DMXUSBWidget; class QTreeWidgetItem; class DMXUSB; class QPushButton; class QTreeWidget; class QComboBox; class DMXUSBConfig : public QDialog { Q_OBJECT public: DMXUSBConfig(DMXUSB *plugin, QWidget* parent = 0); ~DMXUSBConfig(); private slots: void slotTypeComboActivated(int index); void slotRefresh(); private: QComboBox* createTypeCombo(DMXUSBWidget* widget); private: DMXUSB* m_plugin; QTreeWidget* m_tree; QPushButton* m_refreshButton; QPushButton* m_closeButton; bool m_ignoreItemChanged; }; #endif
/* Copyright (c) 2007 Cyrus Daboo. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // CMessagePartProp.h : header file // #ifndef __CMESSAGEPARTPROP__MULBERRY__ #define __CMESSAGEPARTPROP__MULBERRY__ #include "CDialogDirector.h" ///////////////////////////////////////////////////////////////////////////// // CMessagePartProp dialog class CAttachment; class CStaticText; class CTextDisplay; class JXTextButton; class CMessagePartProp : public CDialogDirector { // Construction public: CMessagePartProp(JXDirector* supervisor); static bool PoseDialog(const CAttachment& attach, bool multi); protected: // begin JXLayout JXTextButton* mOKBtn; JXTextButton* mCancelBtn; CStaticText* mName; CStaticText* mType; CStaticText* mEncoding; CStaticText* mID; CStaticText* mDisposition; CTextDisplay* mDescription; CTextDisplay* mParams; CStaticText* mOpenWith; // end JXLayout virtual void OnCreate(); void SetFields(const CAttachment& attach, bool multi); }; #endif
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once #include "Layer.h" namespace paddle { /** * \brief This layer calculate softmax in image channel dimension. */ class SwitchOrderLayer : public Layer { public: explicit SwitchOrderLayer(const LayerConfig& config) : Layer(config) {} ~SwitchOrderLayer() {} bool init(const LayerMap& layerMap, const ParameterMap& parameterMap) override; void forward(PassType passType) override; void backward(const UpdateCallback& callback = nullptr) override; void setInDims(); void setOutDims(); protected: std::vector<std::shared_ptr<FunctionBase>> nchw2nhwc_; std::vector<std::shared_ptr<FunctionBase>> nhwc2nchw_; TensorShape inDims_; TensorShape outDims_; std::vector<int> heightAxis_; std::vector<int> widthAxis_; size_t reshapeHeight_; size_t reshapeWidth_; }; } // namespace paddle
/* * Copyright 2016 Davide Pianca * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef EXCEPTION_H #define EXCEPTION_H #include <proc/proc.h> #include <types.h> void default_ir_handler(); extern void invop_handle(); extern void gpf_handle(); extern void pf_handle(); extern void syscall_handle(); void ex_divide_by_zero(); // 0 void ex_single_step(); // 1 void ex_nmi(); // 2 void ex_breakpoint(); // 3 void ex_overflow(); // 4 void ex_bounds_check(); // 5 void ex_invalid_opcode(struct regs *re); // 6 void ex_device_not_available(); // 7 void ex_double_fault(); // 8 // 9 reserved void ex_invalid_tss(); // 10 void ex_segment_not_present(); // 11 void ex_stack_fault(); // 12 void ex_gpf(struct regs_error *re); // 13 void ex_page_fault(struct regs_error *re); // 14 // 15 reserved void ex_fpu_error(); // 16 void ex_alignment_check(); // 17 void ex_machine_check(); // 18 void ex_simd_fpu(); // 19 // 20 - 31 reserved void return_exception(); #endif
/* * This file is part of the Soletta™ Project * * Copyright (C) 2015 Intel Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <inttypes.h> #include "sol-macros.h" #include "sol-log.h" #include "sol-str-table.h" #include "sol-util-internal.h" SOL_API const struct sol_str_table * sol_str_table_entry_lookup(const struct sol_str_table *table, const struct sol_str_slice key) { const struct sol_str_table *iter; errno = EINVAL; SOL_NULL_CHECK(table, NULL); for (iter = table; iter->key; iter++) { if (iter->len == key.len && memcmp(iter->key, key.data, key.len) == 0) { errno = 0; return iter; } } errno = ENOENT; return NULL; } SOL_API int16_t sol_str_table_lookup_fallback(const struct sol_str_table *table, const struct sol_str_slice key, int16_t fallback) { const struct sol_str_table *entry; if (SOL_UNLIKELY(key.len > INT16_MAX)) { errno = EINVAL; return fallback; } entry = sol_str_table_entry_lookup(table, key); if (!entry) return fallback; errno = EINVAL; SOL_NULL_CHECK(table, fallback); return entry->val; } SOL_API const struct sol_str_table_ptr * sol_str_table_ptr_entry_lookup(const struct sol_str_table_ptr *table, const struct sol_str_slice key) { const struct sol_str_table_ptr *iter; errno = EINVAL; SOL_NULL_CHECK(table, NULL); for (iter = table; iter->key; iter++) { if (iter->len == key.len && memcmp(iter->key, key.data, key.len) == 0) { errno = 0; return iter; } } errno = ENOENT; return NULL; } SOL_API const void * sol_str_table_ptr_lookup_fallback(const struct sol_str_table_ptr *table, const struct sol_str_slice key, const void *fallback) { const struct sol_str_table_ptr *entry; entry = sol_str_table_ptr_entry_lookup(table, key); if (!entry) return fallback; return entry->val; } SOL_API const struct sol_str_table_int64 * sol_str_table_int64_entry_lookup(const struct sol_str_table_int64 *table, const struct sol_str_slice key) { const struct sol_str_table_int64 *iter; errno = EINVAL; SOL_NULL_CHECK(table, NULL); for (iter = table; iter->key; iter++) { if (iter->len == key.len && memcmp(iter->key, key.data, key.len) == 0) { errno = 0; return iter; } } errno = ENOENT; return NULL; } SOL_API int64_t sol_str_table_int64_lookup_fallback(const struct sol_str_table_int64 *table, const struct sol_str_slice key, int64_t fallback) { const struct sol_str_table_int64 *entry; entry = sol_str_table_int64_entry_lookup(table, key); if (!entry) return fallback; return entry->val; }
/** * @file libsbml-config-common.h * @brief Configuration variables * @author Ben Bornstein * * $Id$ * $HeadURL$ * *<!--------------------------------------------------------------------------- * This file is part of libSBML. Please visit http://sbml.org for more * information about SBML, and the latest version of libSBML. * * Copyright (C) 2013-2016 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK * 3. University of Heidelberg, Heidelberg, Germany * * Copyright (C) 2009-2013 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK * * Copyright (C) 2006-2008 by the California Institute of Technology, * Pasadena, CA, USA * * Copyright (C) 2002-2005 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. Japan Science and Technology Agency, Japan * * 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. A copy of the license agreement is provided * in the file named "LICENSE.txt" included with this software distribution and * also available online as http://sbml.org/software/libsbml/license.html *------------------------------------------------------------------------- --> * * If this file is named <tt>libsbml-config-unix.h</tt>, then it was * generated from <tt>libsbml-config-unix.h.in</tt> by the @c configure * script at the top level of the libSBML source tree. * * @note This file is handled unusually. The file itself is generated by * @c configure, but unlike other files that are likewise automatically * generated, it is also checked into the source repository. The need for * this is due to the fact that under Windows, developers may not be * running @c configure at all (e.g., if they are using the MSVC * environment). The <tt>libsbml-config-win.h</tt> file therefore needs to * be provided directly in order for people to be able to compile the * sources under Windows. For consistency, the file * <tt>libsbml-config-unix.h</tt> is also similarly checked in. Developers * must remember to check in the .h version of this file in the source code * repository prior to major releases, so that an up-to-date .h file is * present in distributions. This is admittedly an undesirable and * error-prone situation, but it is currently the best alternative we have * been able to find. */ /* Define to 1 if you have the <check.h> header file. */ /* #undef HAVE_CHECK_H */ /* Define to 1 if you have the <expat.h> header file. */ #define HAVE_EXPAT_H 1 /* Define to 1 to use the Expat XML library */ /* #undef USE_EXPAT */ /* Define to 1 if you have the <errno.h> header file. */ #define HAVE_ERRNO_H 1 /* Define to 1 if you have the <ieeefp.h> header file. */ /* #undef HAVE_IEEEFP_H */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you have the <math.h> header file. */ #define HAVE_MATH_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* Define to 1 to enable primitive memory tracing. */ /* #undef TRACE_MEMORY */ /* Define to 1 to build the SBML layout extension. */ /* #undef USE_LAYOUT */ /* Define to 1 to build the SBML groups extension. */ /* #undef USE_GROUPS */ /* Define to build the SBML FBC extension. */ /* #undef USE_FBC */ /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define to allow the c-functions in util.c and memory.c exit the application in case of an allocation / file system error. */ /* #undef EXIT_ON_ERROR */ /* Define to specify that the legacy math implementation ought to be used. */ /* #undef LIBSBML_USE_LEGACY_MATH */ #include <sbml/common/libsbml-config-packages.h>
#ifndef LWIP_HDR_LWIP_CHECK_H #define LWIP_HDR_LWIP_CHECK_H /* Common header file for lwIP unit tests using the check framework */ #include <config.h> #include <check.h> #include <stdlib.h> #define FAIL_RET() do { fail(); return; } while(0) #define EXPECT(x) fail_unless(x) #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) typedef struct { TFun func; const char *name; } testfunc; #define TESTFUNC(x) {(x), "" # x "" } /* Modified function from check.h, supplying function name */ #define tcase_add_named_test(tc,tf) \ _tcase_add_test((tc),(tf).func,(tf).name,0, 0, 0, 1) /** typedef for a function returning a test suite */ typedef Suite* (suite_getter_fn)(void); /** Create a test suite */ Suite* create_suite(const char* name, testfunc *tests, size_t num_tests, SFun setup, SFun teardown); #ifdef LWIP_UNITTESTS_LIB int lwip_unittests_run(void) #endif /* helper functions */ #define SKIP_POOL(x) (1 << x) #define SKIP_HEAP (1 << MEMP_MAX) void lwip_check_ensure_no_alloc(unsigned int skip); #endif /* LWIP_HDR_LWIP_CHECK_H */
/*========================================================================= * * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkUnsharpMaskLevelSetImageFilter_h #define itkUnsharpMaskLevelSetImageFilter_h #include "itkSparseFieldFourthOrderLevelSetImageFilter.h" namespace itk { /** * \class UnsharpMaskLevelSetImageFilter * * \brief This class implements a detail enhancing filter by making use of the * 4th-order level set isotropic diffusion (smoothing) PDE. * * \par INPUT and OUTPUT * This is a volume to volume filter; however, it is meant to process (smooth) * surfaces. The input surface is an isosurface of the input volume. The * isosurface value to be processed can be set by calling SetIsoSurfaceValue * (default is 0). The output surface is the 0-isosurface of the output volume, * regardless of the input isosurface value. To visualize the input/output * surfaces to this filter a mesh extraction method such as marching cubes can * be used. * * \par * This filter is an example of how the 4th order level set PDE framework can * be used for general purpose surface processing. It is motivated by unsharp * masking from image processing which is a way of enhancing detail. This * filter acts much like the IsotropicFourthOrderLevelSetImageFilter because it * first smoothes the normal vectors via isotropic diffusion. However, as a * post-processing step we extrapolate from the original normals in the * direction opposite to the new processes normals. By refitting the surface to * these extrapolated vectors we achieve detail enhancement. This process is * not the same as running the isotropic diffusion process in reverse. * * \par IMPORTANT * Because this filters enhances details on the surface, it will also amplify * noise! This filter is provided only as an example of graphics oriented * post-processing. Do not use it on noisy data. * * \par PARAMETERS * As mentioned before, the IsoSurfaceValue parameter chooses which isosurface * of the input to process. The MaxFilterIterations parameter determine the * number of iterations for which this filter will run. Since, this filter * enhances detail AND noise MaxFilterIterations above a couple of hundred are * unreasonable. Finally NormalProcessUnsharpWeight controls the amount of * extrapolation (or equivalently the amount of detail enhancement). This value * should be in the range [0.1,1] for reasonable results. * \ingroup ITKLevelSets */ template <typename TInputImage, typename TOutputImage> class ITK_TEMPLATE_EXPORT UnsharpMaskLevelSetImageFilter : public SparseFieldFourthOrderLevelSetImageFilter<TInputImage, TOutputImage> { public: ITK_DISALLOW_COPY_AND_ASSIGN(UnsharpMaskLevelSetImageFilter); /** Standard class type aliases */ using Self = UnsharpMaskLevelSetImageFilter; using Superclass = SparseFieldFourthOrderLevelSetImageFilter<TInputImage, TOutputImage>; using Pointer = SmartPointer<Self>; using ConstPointer = SmartPointer<const Self>; /** Run-time type information (and related methods) */ itkTypeMacro(UnsharpMaskLevelSetImageFilter, SparseFieldFourthOrderLevelSetImageFilter); /** Standard new macro */ itkNewMacro(Self); /** The sparse image type used in LevelSetFunctionWithRefitTerm */ using SparseImageType = typename Superclass::SparseImageType; /** The level set function class with a refit term that forces the curvature of the moving front to match a prescribed curvature image. */ using FunctionType = LevelSetFunctionWithRefitTerm<TOutputImage, SparseImageType>; /** The radius type for the neighborhoods. */ using RadiusType = typename FunctionType::RadiusType; itkGetConstMacro(MaxFilterIteration, unsigned int); itkSetMacro(MaxFilterIteration, unsigned int); protected: UnsharpMaskLevelSetImageFilter(); ~UnsharpMaskLevelSetImageFilter() override = default; void PrintSelf(std::ostream & os, Indent indent) const override; /** The LevelSetFunctionWithRefitTerm object. */ typename FunctionType::Pointer m_Function; /** The number of iterations for which this filter will run. */ unsigned int m_MaxFilterIteration; /** This filter halts when the iteration count reaches the specified count. */ bool Halt() override { if (this->GetElapsedIterations() == m_MaxFilterIteration) { return true; } else { return false; } } }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION # include "itkUnsharpMaskLevelSetImageFilter.hxx" #endif #endif
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Fluent Bit * ========== * Copyright (C) 2015-2022 The Fluent Bit Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FLB_TAIL_SIGNAL_H #define FLB_TAIL_SIGNAL_H #include "tail_config.h" static inline int tail_signal_manager(struct flb_tail_config *ctx) { int n; uint64_t val = 0xc001; /* * The number of signal reads might be less than the written signals, this * means that some event is still pending in the queue. On that case we * don't need to signal it again. */ if (ctx->ch_reads < ctx->ch_writes) { return 1; } /* Reset counters: prevent an overflow, unlikely..but let's keep safe */ if (ctx->ch_reads == ctx->ch_writes) { ctx->ch_reads = 0; ctx->ch_writes = 0; } /* Insert a dummy event into the channel manager */ n = flb_pipe_w(ctx->ch_manager[1], (const char *) &val, sizeof(val)); if (n == -1) { flb_errno(); return -1; } else { ctx->ch_writes++; } return n; } static inline int tail_signal_pending(struct flb_tail_config *ctx) { int n; uint64_t val = 0xc002; /* Insert a dummy event into the 'pending' channel */ n = flb_pipe_w(ctx->ch_pending[1], (const char *) &val, sizeof(val)); /* * If we get EAGAIN, it simply means pending channel is full. As * notification is already pending, it's safe to ignore. */ if (n == -1 && !FLB_PIPE_WOULDBLOCK()) { flb_errno(); return -1; } return n; } static inline int tail_consume_pending(struct flb_tail_config *ctx) { int ret; uint64_t val; /* * We need to consume the pending bytes. Loop until we would have * blocked (pipe is empty). */ do { ret = flb_pipe_r(ctx->ch_pending[0], (char *) &val, sizeof(val)); if (ret <= 0 && !FLB_PIPE_WOULDBLOCK()) { flb_errno(); return -1; } } while (!FLB_PIPE_WOULDBLOCK()); return 0; } #endif
#pragma once #include "../../include/nn/SpatialMaxPooling.h" namespace cpptorch { namespace serializer { template<typename T, GPUFlag F> class SpatialMaxPooling : public nn::SpatialMaxPooling<T, F> { public: void unserialize(const object_torch *obj, object_reader<T, F> *mb) { const object_table *obj_tbl = obj->data_->to_table(); this->kW_ = *obj_tbl->get("kW"); this->kH_ = *obj_tbl->get("kH"); this->dW_ = *obj_tbl->get("dW"); this->dH_ = *obj_tbl->get("dH"); this->padW_ = *obj_tbl->get("padW"); this->padH_ = *obj_tbl->get("padH"); this->ceil_mode_ = *obj_tbl->get("ceil_mode"); } }; } }
// // YBNavScanCodeController.h // test // // Created by MAC on 15/11/29. // Copyright © 2015年 MAC. All rights reserved. // #import <UIKit/UIKit.h> @interface YBNavScanCodeController : UINavigationController @end
/* * Copyright 2017 MongoDB, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Internal struct to represent a command we will send to the server - command * parameters are collected in a mongoc_cmd_parts_t until we know the server's * wire version and whether it is mongos, then we collect the parts into a * mongoc_cmd_t, and gather that into a mongoc_rpc_t. */ #ifndef MONGOC_CMD_PRIVATE_H #define MONGOC_CMD_PRIVATE_H #if !defined(MONGOC_COMPILATION) #error "Only <mongoc.h> can be included directly." #endif #include <bson.h> #include "mongoc-server-stream-private.h" #include "mongoc-read-prefs.h" #include "mongoc.h" #include "mongoc-opts-private.h" BSON_BEGIN_DECLS typedef enum { MONGOC_CMD_PARTS_ALLOW_TXN_NUMBER_UNKNOWN, MONGOC_CMD_PARTS_ALLOW_TXN_NUMBER_YES, MONGOC_CMD_PARTS_ALLOW_TXN_NUMBER_NO } mongoc_cmd_parts_allow_txn_number_t; typedef struct _mongoc_cmd_t { const char *db_name; mongoc_query_flags_t query_flags; const bson_t *command; const char *command_name; const uint8_t *payload; int32_t payload_size; const char *payload_identifier; const mongoc_server_stream_t *server_stream; int64_t operation_id; mongoc_client_session_t *session; bool is_acknowledged; } mongoc_cmd_t; typedef struct _mongoc_cmd_parts_t { mongoc_cmd_t assembled; mongoc_query_flags_t user_query_flags; const bson_t *body; bson_t read_concern_document; bson_t write_concern_document; bson_t extra; const mongoc_read_prefs_t *read_prefs; bson_t assembled_body; bool is_read_command; bool is_write_command; bool prohibit_lsid; mongoc_cmd_parts_allow_txn_number_t allow_txn_number; bool is_retryable_write; bool has_temp_session; mongoc_client_t *client; } mongoc_cmd_parts_t; void mongoc_cmd_parts_init (mongoc_cmd_parts_t *op, mongoc_client_t *client, const char *db_name, mongoc_query_flags_t user_query_flags, const bson_t *command_body); void mongoc_cmd_parts_set_session (mongoc_cmd_parts_t *parts, mongoc_client_session_t *cs); bool mongoc_cmd_parts_append_opts (mongoc_cmd_parts_t *parts, bson_iter_t *iter, int max_wire_version, bson_error_t *error); bool mongoc_cmd_parts_set_read_concern (mongoc_cmd_parts_t *parts, const mongoc_read_concern_t *rc, int max_wire_version, bson_error_t *error); bool mongoc_cmd_parts_set_write_concern (mongoc_cmd_parts_t *parts, const mongoc_write_concern_t *wc, int max_wire_version, bson_error_t *error); bool mongoc_cmd_parts_append_read_write (mongoc_cmd_parts_t *parts, mongoc_read_write_opts_t *rw_opts, int max_wire_version, bson_error_t *error); bool mongoc_cmd_parts_assemble (mongoc_cmd_parts_t *parts, const mongoc_server_stream_t *server_stream, bson_error_t *error); bool mongoc_cmd_is_compressible (mongoc_cmd_t *cmd); void mongoc_cmd_parts_cleanup (mongoc_cmd_parts_t *op); BSON_END_DECLS #endif /* MONGOC_CMD_PRIVATE_H */
/* * Definitions for debugging * * Copyright 1998, 2002 Juergen Schmied * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef __WINE_SHELL32_DEBUGHLP_H #define __WINE_SHELL32_DEBUGHLP_H #include <stdarg.h> #include "windef.h" #include "winbase.h" #include "winuser.h" #include "shlobj.h" extern void pdump (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN; extern BOOL pcheck (LPCITEMIDLIST pidl) DECLSPEC_HIDDEN; extern const char * shdebugstr_guid( const struct _GUID *id ) DECLSPEC_HIDDEN; #endif /* __WINE_SHELL32_DEBUGHLP_H */
// // CoreAudioUtil.h // 5-19Recorder // // Created by wyman on 2017/5/24. // Copyright © 2017年 wyman. All rights reserved. // #ifndef CoreAudioUtil_h #define CoreAudioUtil_h #include <stdio.h> #include <AudioToolbox/AudioToolbox.h> #define LOG_ASDB // 是否开启打印ASDB /** * 校验SSStatus错误 */ extern void CheckError(OSStatus error, const char *operation); /** * 打印AudioStreamBasicDescription */ extern void LogASBD(AudioStreamBasicDescription *asbd, const char *operaton); /** * 获取当前设备的采样率 */ extern OSStatus MyGetDefaultInputDeviceSampleRate(Float64 *sampleRate); #pragma mark - AudioQueue 一些信息工具方法 // ------ 录音 /** * 从 AudioQueueRef 中拷贝 magic cookie 到文件 */ extern void MyCopyEncoderCookieToFile(AudioQueueRef queue, AudioFileID recordFile); /** * 根据 AudioStreamBasicDescription 和 时长 来计算 AudioQueueInput【录音】 的buffer大小 * * 1.根据 AudioStreamBasicDescription 可以知道采样率 * 2.根据 second * sample 可以知道采样数【帧数】 * 3.根据 AudioStreamBasicDescription 可以知道是不是CBR 是的话直接计算出播放的dataSize作为buffer大小 * 4.根据 AudioStreamBasicDescription 知道是VBR 此时需要通过 AudioStreamBasicDescription 获取 packet数【可变packet】 * 5.根据 AudioQueueRef 获取 VBR下 最大的packetSize:kAudioQueueProperty_MaximumOutputPacketSize * */ extern int MyComputeRecordBufferSize(const AudioStreamBasicDescription *format, AudioQueueRef queue, float second); // ------ 播放 /** * 从 AudioFileID 中拷贝 magic cookie 到queue */ extern void MyCopyEncoderCookieToQueue(AudioFileID recordFile, AudioQueueRef queue); /** * 根据 AudioStreamBasicDescription 和 时长 来计算指定文件 AudioFileID【播放】的buffer大小 同时记录packet数 * * 1.根据 AudioStreamBasicDescription 知道采样 * 2.根据 second * sample 可以知道采样数【帧数】 * 3.根据 fileID 可以获取属性 kAudioFilePropertyPacketSizeUpperBound 知道最大的packet大小 * 4.根据 AudioStreamBasicDescription 可知CBR下 时间段内的packet数 同时计算buffer大小 * 5.校验保证每次buffer大小至少有一个完整packet 上下界校验 */ extern int MyComputePlaybackBufferSize(AudioFileID fileID, AudioStreamBasicDescription *format, float seconds, UInt32 *outNumPackets); #endif /* CoreAudioUtil_h */
/** ******************************************************************************* * @file OpenPDMFilter.h * @author CL * @version V1.0.0 * @date 9-September-2015 * @brief Header file for Open PDM audio software decoding Library. * This Library is used to decode and reconstruct the audio signal * produced by ST MEMS microphone (MP45Dxxx, MP34Dxxx). ******************************************************************************* * @attention * * <h2><center>&copy; COPYRIGHT 2018 STMicroelectronics</center></h2> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************* */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __OPENPDMFILTER_H #define __OPENPDMFILTER_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include <stdint.h> /* Definitions ---------------------------------------------------------------*/ /* * Enable to use a Look-Up Table to improve performances while using more FLASH * and RAM memory. * Note: Without Look-Up Table up to stereo@16KHz configuration is supported. */ #define USE_LUT #define SINCN 3 #define DECIMATION_MAX 128 #define FILTER_GAIN 16 #define HTONS(A) ((((uint16_t)(A) & 0xff00) >> 8) | \ (((uint16_t)(A) & 0x00ff) << 8)) #define RoundDiv(a, b) (((a)>0)?(((a)+(b)/2)/(b)):(((a)-(b)/2)/(b))) #define SaturaLH(N, L, H) (((N)<(L))?(L):(((N)>(H))?(H):(N))) /* Types ---------------------------------------------------------------------*/ typedef struct { /* Public */ float LP_HZ; float HP_HZ; uint16_t Fs; uint8_t In_MicChannels; uint8_t Out_MicChannels; uint8_t Decimation; uint8_t MaxVolume; /* Private */ uint32_t Coef[SINCN]; uint16_t FilterLen; int64_t OldOut, OldIn, OldZ; uint16_t LP_ALFA; uint16_t HP_ALFA; uint16_t bit[5]; uint16_t byte; } TPDMFilter_InitStruct; /* Exported functions ------------------------------------------------------- */ void Open_PDM_Filter_Init(TPDMFilter_InitStruct *init_struct); void Open_PDM_Filter_64(uint8_t* data, uint16_t* data_out, uint16_t mic_gain, TPDMFilter_InitStruct *init_struct); void Open_PDM_Filter_128(uint8_t* data, uint16_t* data_out, uint16_t mic_gain, TPDMFilter_InitStruct *init_struct); #ifdef __cplusplus } #endif #endif // __OPENPDMFILTER_H /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ec2/EC2_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/ec2/model/ResponseMetadata.h> #include <aws/ec2/model/CancelledSpotInstanceRequest.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Xml { class XmlDocument; } // namespace Xml } // namespace Utils namespace EC2 { namespace Model { /** * <p>Contains the output of CancelSpotInstanceRequests.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequestsResult">AWS * API Reference</a></p> */ class AWS_EC2_API CancelSpotInstanceRequestsResponse { public: CancelSpotInstanceRequestsResponse(); CancelSpotInstanceRequestsResponse(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); CancelSpotInstanceRequestsResponse& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result); /** * <p>One or more Spot Instance requests.</p> */ inline const Aws::Vector<CancelledSpotInstanceRequest>& GetCancelledSpotInstanceRequests() const{ return m_cancelledSpotInstanceRequests; } /** * <p>One or more Spot Instance requests.</p> */ inline void SetCancelledSpotInstanceRequests(const Aws::Vector<CancelledSpotInstanceRequest>& value) { m_cancelledSpotInstanceRequests = value; } /** * <p>One or more Spot Instance requests.</p> */ inline void SetCancelledSpotInstanceRequests(Aws::Vector<CancelledSpotInstanceRequest>&& value) { m_cancelledSpotInstanceRequests = std::move(value); } /** * <p>One or more Spot Instance requests.</p> */ inline CancelSpotInstanceRequestsResponse& WithCancelledSpotInstanceRequests(const Aws::Vector<CancelledSpotInstanceRequest>& value) { SetCancelledSpotInstanceRequests(value); return *this;} /** * <p>One or more Spot Instance requests.</p> */ inline CancelSpotInstanceRequestsResponse& WithCancelledSpotInstanceRequests(Aws::Vector<CancelledSpotInstanceRequest>&& value) { SetCancelledSpotInstanceRequests(std::move(value)); return *this;} /** * <p>One or more Spot Instance requests.</p> */ inline CancelSpotInstanceRequestsResponse& AddCancelledSpotInstanceRequests(const CancelledSpotInstanceRequest& value) { m_cancelledSpotInstanceRequests.push_back(value); return *this; } /** * <p>One or more Spot Instance requests.</p> */ inline CancelSpotInstanceRequestsResponse& AddCancelledSpotInstanceRequests(CancelledSpotInstanceRequest&& value) { m_cancelledSpotInstanceRequests.push_back(std::move(value)); return *this; } inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; } inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; } inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = std::move(value); } inline CancelSpotInstanceRequestsResponse& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;} inline CancelSpotInstanceRequestsResponse& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;} private: Aws::Vector<CancelledSpotInstanceRequest> m_cancelledSpotInstanceRequests; ResponseMetadata m_responseMetadata; }; } // namespace Model } // namespace EC2 } // namespace Aws
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY - 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. *====================================================================*/ /* * splitimage2pdf.c * * Syntax: splitimage2pdf filein nx ny fileout * * nx = number of horizontal tiles * ny = number of vertical tiles * * Generates pdf of image tiles. Rotates the image before * tiling if the tiles otherwise will have larger width than * height. * * N.B. This requires ps2pdf. It should be rewritten to generate pdf * directly, instead of PostScript */ #include "allheaders.h" /* fill factor on 8.5 x 11 inch output page */ static const l_float32 FILL_FACTOR = 0.95; int main(int argc, char **argv) { char *filein, *fileout, *fname; char buffer[512]; const char *psfile = "/tmp/junk_split_image.ps"; l_int32 nx, ny, i, w, h, d, ws, hs, n, res, ignore; l_float32 scale; PIX *pixs, *pixt, *pixr; PIXA *pixa; static char mainName[] = "splitimage2pdf"; if (argc != 5) return ERROR_INT(" Syntax: splitimage2pdf filein nx ny fileout", mainName, 1); filein = argv[1]; nx = atoi(argv[2]); ny = atoi(argv[3]); fileout = argv[4]; lept_rm(NULL, "junk_split_image.ps"); if ((pixs = pixRead(filein)) == NULL) return ERROR_INT("pixs not made", mainName, 1); d = pixGetDepth(pixs); if (d == 1 ) lept_rm(NULL, "junk_split_image.tif"); else if (d == 8 || d == 32) lept_rm(NULL, "junk_split_image.jpg"); else return ERROR_INT("d not in {1,8,32} bpp", mainName, 1); pixGetDimensions(pixs, &ws, &hs, NULL); if (ny * ws > nx * hs) pixr = pixRotate90(pixs, 1); else pixr = pixClone(pixs); pixa = pixaSplitPix(pixr, nx, ny, 0, 0); n = pixaGetCount(pixa); res = 300; for (i = 0; i < n; i++) { pixt = pixaGetPix(pixa, i, L_CLONE); pixGetDimensions(pixt, &w, &h, NULL); scale = L_MIN(FILL_FACTOR * 2550 / w, FILL_FACTOR * 3300 / h); fname = NULL; if (d == 1) { fname = genPathname("/tmp", "junk_split_image.tif"); pixWrite(fname, pixt, IFF_TIFF_G4); if (i == 0) { convertG4ToPS(fname, psfile, "w", 0, 0, 300, scale, 1, FALSE, TRUE); } else { convertG4ToPS(fname, psfile, "a", 0, 0, 300, scale, 1, FALSE, TRUE); } } else { fname = genPathname("/tmp", "junk_split_image.jpg"); pixWrite(fname, pixt, IFF_JFIF_JPEG); if (i == 0) { convertJpegToPS(fname, psfile, "w", 0, 0, 300, scale, 1, TRUE); } else { convertJpegToPS(fname, psfile, "a", 0, 0, 300, scale, 1, TRUE); } } lept_free(fname); pixDestroy(&pixt); } snprintf(buffer, sizeof(buffer), "ps2pdf %s %s", psfile, fileout); ignore = system(buffer); /* ps2pdf */ pixaDestroy(&pixa); pixDestroy(&pixr); pixDestroy(&pixs); return 0; }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsINameSpaceManager_h___ #define nsINameSpaceManager_h___ #include "nsISupports.h" #include "nsStringGlue.h" class nsIAtom; class nsString; #define kNameSpaceID_Unknown -1 // 0 is special at C++, so use a static const int32_t for // kNameSpaceID_None to keep if from being cast to pointers // Note that the XBL cache assumes (and asserts) that it can treat a // single-byte value higher than kNameSpaceID_LastBuiltin specially. static const int32_t kNameSpaceID_None = 0; #define kNameSpaceID_XMLNS 1 // not really a namespace, but it needs to play the game #define kNameSpaceID_XML 2 #define kNameSpaceID_XHTML 3 #define kNameSpaceID_XLink 4 #define kNameSpaceID_XSLT 5 #define kNameSpaceID_XBL 6 #define kNameSpaceID_MathML 7 #define kNameSpaceID_RDF 8 #define kNameSpaceID_XUL 9 #define kNameSpaceID_SVG 10 #define kNameSpaceID_XMLEvents 11 #define kNameSpaceID_LastBuiltin 11 // last 'built-in' namespace #define NS_NAMESPACEMANAGER_CONTRACTID "@mozilla.org/content/namespacemanager;1" #define NS_INAMESPACEMANAGER_IID \ { 0xd74e83e6, 0xf932, 0x4289, \ { 0xac, 0x95, 0x9e, 0x10, 0x24, 0x30, 0x88, 0xd6 } } /** * The Name Space Manager tracks the association between a NameSpace * URI and the int32_t runtime id. Mappings between NameSpaces and * NameSpace prefixes are managed by nsINameSpaces. * * All NameSpace URIs are stored in a global table so that IDs are * consistent accross the app. NameSpace IDs are only consistent at runtime * ie: they are not guaranteed to be consistent accross app sessions. * * The nsINameSpaceManager needs to have a live reference for as long as * the NameSpace IDs are needed. * */ class nsINameSpaceManager : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_INAMESPACEMANAGER_IID) virtual nsresult RegisterNameSpace(const nsAString& aURI, int32_t& aNameSpaceID) = 0; virtual nsresult GetNameSpaceURI(int32_t aNameSpaceID, nsAString& aURI) = 0; virtual int32_t GetNameSpaceID(const nsAString& aURI) = 0; virtual bool HasElementCreator(int32_t aNameSpaceID) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsINameSpaceManager, NS_INAMESPACEMANAGER_IID) nsresult NS_GetNameSpaceManager(nsINameSpaceManager** aInstancePtrResult); void NS_NameSpaceManagerShutdown(); #endif // nsINameSpaceManager_h___
/* $NetBSD: eisavar.h,v 1.24 2008/04/28 20:23:48 martin Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Jason R. Thorpe. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Christopher G. Demetriou * for the NetBSD Project. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _DEV_EISA_EISAVAR_H_ #define _DEV_EISA_EISAVAR_H_ /* * Definitions for EISA autoconfiguration. * * This file describes types and functions which are used for EISA * configuration. Some of this information is machine-specific, and is * separated into eisa_machdep.h. */ struct eisa_cfg_mem; struct eisa_cfg_irq; struct eisa_cfg_dma; struct eisa_cfg_io; #include <sys/bus.h> #include <dev/eisa/eisareg.h> /* For ID register & string info. */ /* * Structures and definitions needed by the machine-dependent header. */ struct eisabus_attach_args; /* * Machine-dependent definitions. */ #include <machine/eisa_machdep.h> typedef int eisa_slot_t; /* really only needs to be 4 bits */ /* * EISA bus attach arguments. */ struct eisabus_attach_args { const char *_eba_busname; /* XXX placeholder */ bus_space_tag_t eba_iot; /* eisa i/o space tag */ bus_space_tag_t eba_memt; /* eisa mem space tag */ bus_dma_tag_t eba_dmat; /* DMA tag */ eisa_chipset_tag_t eba_ec; }; /* * EISA device attach arguments. */ struct eisa_attach_args { bus_space_tag_t ea_iot; /* eisa i/o space tag */ bus_space_tag_t ea_memt; /* eisa mem space tag */ bus_dma_tag_t ea_dmat; /* DMA tag */ eisa_chipset_tag_t ea_ec; eisa_slot_t ea_slot; u_int8_t ea_vid[EISA_NVIDREGS]; u_int8_t ea_pid[EISA_NPIDREGS]; char ea_idstring[EISA_IDSTRINGLEN]; }; int eisabusprint(void *, const char *); /* * EISA Configuration entries, set up by an EISA Configuration Utility. */ struct eisa_cfg_mem { bus_addr_t ecm_addr; bus_size_t ecm_size; int ecm_isram; int ecm_decode; int ecm_unitsize; }; struct eisa_cfg_irq { int eci_irq; int eci_ist; int eci_shared; }; struct eisa_cfg_dma { int ecd_drq; int ecd_shared; int ecd_size; #define ECD_SIZE_8BIT 0 #define ECD_SIZE_16BIT 1 #define ECD_SIZE_32BIT 2 #define ECD_SIZE_RESERVED 3 int ecd_timing; #define ECD_TIMING_ISA 0 #define ECD_TIMING_TYPEA 1 #define ECD_TIMING_TYPEB 2 #define ECD_TIMING_TYPEC 3 }; struct eisa_cfg_io { bus_addr_t ecio_addr; bus_size_t ecio_size; int ecio_shared; }; #endif /* _DEV_EISA_EISAVAR_H_ */
#ifndef __INET_BREAKPOINTPATHLOSS_H #define __INET_BREAKPOINTPATHLOSS_H #include "inet/physicallayer/base/packetlevel/PathLossBase.h" namespace inet { namespace physicallayer { /** * Implementation of a breakpoint path loss model. */ class INET_API BreakpointPathLoss : public PathLossBase { protected: /** @brief initial path loss */ double l01, l02; /** @brief pathloss exponents */ double alpha1, alpha2; /** @brief Breakpoint distance squared. */ m breakpointDistance; protected: virtual void initialize(int stage) override; public: BreakpointPathLoss(); virtual std::ostream& printToStream(std::ostream& stream, int level) const override; virtual double computePathLoss(mps propagationSpeed, Hz frequency, m distance) const override; virtual m computeRange(mps propagationSpeed, Hz frequency, double loss) const override; }; } // namespace physicallayer } // namespace inet #endif // ifndef __INET_BREAKPOINTPATHLOSS_H
/*- * Copyright (c) 2003, 2004, 2005, 2007 Lev Walkin <vlm@lionet.info>. * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ /* * Declarations internally useful for the ASN.1 support code. */ #ifndef ASN_INTERNAL_H #define ASN_INTERNAL_H #include "asn_application.h" /* Application-visible API */ #ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */ #include <assert.h> /* for assert() macro */ #endif #ifdef __cplusplus extern "C" { #endif /* Environment version might be used to avoid running with the old library */ #define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */ int get_asn1c_environment_version(void); /* Run-time version */ #define CALLOC(nmemb, size) calloc(nmemb, size) #define MALLOC(size) malloc(size) #define REALLOC(oldptr, size) realloc(oldptr, size) #define FREEMEM(ptr) free(ptr) #define asn_debug_indent 0 #define ASN_DEBUG_INDENT_ADD(i) do{}while(0) /* * A macro for debugging the ASN.1 internals. * You may enable or override it. */ #ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ #if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ #ifdef __GNUC__ #ifdef ASN_THREAD_SAFE /* Thread safety requires sacrifice in output indentation: * Retain empty definition of ASN_DEBUG_INDENT_ADD. */ #else /* !ASN_THREAD_SAFE */ #undef ASN_DEBUG_INDENT_ADD #undef asn_debug_indent int asn_debug_indent; #define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0) #endif /* ASN_THREAD_SAFE */ #define ASN_DEBUG(fmt, args...) do { \ int adi = asn_debug_indent; \ while(adi--) fprintf(stderr, " "); \ fprintf(stderr, fmt, ##args); \ fprintf(stderr, " (%s:%d)\n", \ __FILE__, __LINE__); \ } while(0) #else /* !__GNUC__ */ void ASN_DEBUG_f(const char *fmt, ...); #define ASN_DEBUG ASN_DEBUG_f #endif /* __GNUC__ */ #else /* EMIT_ASN_DEBUG != 1 */ #if __STDC_VERSION__ >= 199901L #define ASN_DEBUG(...) do{}while(0) #else /* not C99 */ static void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } #endif /* C99 or better */ #endif /* EMIT_ASN_DEBUG */ #endif /* ASN_DEBUG */ /* * Invoke the application-supplied callback and fail, if something is wrong. */ #define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0) #define ASN__E_CALLBACK(foo) do { \ if(foo) goto cb_failed; \ } while(0) #define ASN__CALLBACK(buf, size) \ ASN__E_CALLBACK(ASN__E_cbc(buf, size)) #define ASN__CALLBACK2(buf1, size1, buf2, size2) \ ASN__E_CALLBACK(ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2)) #define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \ ASN__E_CALLBACK(ASN__E_cbc(buf1, size1) \ || ASN__E_cbc(buf2, size2) \ || ASN__E_cbc(buf3, size3)) #define ASN__TEXT_INDENT(nl, level) do { \ int tmp_level = (level); \ int tmp_nl = ((nl) != 0); \ int tmp_i; \ if(tmp_nl) ASN__CALLBACK("\n", 1); \ if(tmp_level < 0) tmp_level = 0; \ for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) \ ASN__CALLBACK(" ", 4); \ er.encoded += tmp_nl + 4 * tmp_level; \ } while(0) #define _i_INDENT(nl) do { \ int tmp_i; \ if((nl) && cb("\n", 1, app_key) < 0) \ return -1; \ for(tmp_i = 0; tmp_i < ilevel; tmp_i++) \ if(cb(" ", 4, app_key) < 0) \ return -1; \ } while(0) /* * Check stack against overflow, if limit is set. */ #define ASN__DEFAULT_STACK_MAX (30000) static int GCC_NOTUSED ASN__STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { if(ctx && ctx->max_stack_size) { /* ctx MUST be allocated on the stack */ ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); if(usedstack > 0) usedstack = -usedstack; /* grows up! */ /* double negative required to avoid int wrap-around */ if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { ASN_DEBUG("Stack limit %ld reached", (long)ctx->max_stack_size); return -1; } } return 0; } #ifdef __cplusplus } #endif #endif /* ASN_INTERNAL_H */
/* * Copyright 2010-2011 Research In Motion Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <QSettings> class ConfigData { public: static ConfigData* getInstance(); ~ConfigData(void); void writeSettings(); QString toolingContent(); void toolingContent(QString content); QSize windowSize(); void windowSize(QSize size); QPoint windowPosition(); void windowPosition(QPoint position); unsigned int windowState(); void windowState(unsigned int state); QString localStoragePath(); void localStoragePath(QString path); QString buildServiceCommand(); void buildServiceCommmand(QString cmd); unsigned short buildServicePort(); void buildServicePort(unsigned short port); unsigned int hardwareAccelerationEnabled(); void hardwareAccelerationEnabled(unsigned int hwEnabled); unsigned int webGLEnabled(); void webGLEnabled(unsigned int glEnabled); private: ConfigData(void); void readSettings(); static const QString CONFIGURATION_FILE_NAME; static const QString APPLICATION_NAME_IN_SETTINGS; static const QString TOOLING_CONTENT_NAME_IN_SETTINGS; static const QString TOOLING_CONTENT_DEFAULT; static const QString MAIN_WINDOW_SIZE_NAME_IN_SETTINGS; static const QString LOCAL_STORAGE_PATH_IN_SETTINGS; static const QSize MAIN_WINDOW_SIZE_DEFAULT; static const QString MAIN_WINDOW_POSITION_NAME_IN_SETTINGS; static const QString MAIN_WINDOW_STATE_NAME_IN_SETTINGS; static const QPoint MAIN_WINDOW_POSITION_DEFAULT; static const unsigned int MAIN_WINDOW_STATE_DEFAULT; static const QString LOCAL_STORAGE_PATH_DEFAULT; static const QString BUILD_SERVICE_COMMAND_IN_SETTINGS; static const QString BUILD_SERVICE_COMMAND_DEFAULT; static const QString BUILD_SERVICE_PORT_IN_SETTINGS; static const QString BUILD_SERVICE_PORT_DEFAULT; static const QString HARDWARE_ACCELERATION_IN_SETTINGS; static const unsigned int HARDWARE_ACCELERATION_DEFAULT; static const QString WEBGL_ENABLED_IN_SETTINGS; static const unsigned int WEBGL_ENABLED_DEFAULT; static ConfigData* _instance; static bool _instanceFlag; QSettings *_settings; QString _toolingContent; QSize _mainWindowSize; QPoint _mainWindowPosition; unsigned int _mainWindowState; QString _localStoragePath; QString _applicationStoragePath; QString _buildServiceCommand; QString _buildServicePort; unsigned int _hardwareAccelerationEnabled; unsigned int _webGLEnabled; };
/* * ============================================================================ * Name : btengdomaincrkeys.h * Part of : Bluetooth Engine / Bluetooth Engine * Description : Bluetooth Engine domain central repository key definitions. * Version : %version: 1.1.3 % * * Copyright © 2006 Nokia. All rights reserved. * This material, including documentation and any related computer * programs, is protected by copyright controlled by Nokia. All * rights are reserved. Copying, including reproducing, storing, * adapting or translating, any or all of this material requires the * prior written consent of Nokia. This material also contains * confidential information which may not be disclosed to others * without the prior written consent of Nokia. * ============================================================================ * Template version: 4.1 */ #ifndef BTENG_DOMAIN_CR_KEYS_H #define BTENG_DOMAIN_CR_KEYS_H #include <btserversdkcrkeys.h> /** Bluetooth Engine CenRep Uid */ const TUid KCRUidBluetoothEngine = { 0x10204DAB }; /** * CenRep key for storing Bluetooth feature settings. * Indicates if Bluetooth Headset Profile is supported or not. * * Possible integer values: * 0 Headset Profile not supported * 1 Headset Profile supported * * Default value: 1 */ const TUint32 KBTHspSupported = 0x00000001; /** Enumeration for Headset profile support */ enum TBTHspSupported { EBTHspNotSupported = 0, EBTHspSupported }; /** * CenRep key for storing Bluetooth feature settings. * Product specific settings for activating BT in offline mode. * * Possible integer values: * 0 BT activation disabled in offline mode * 1 BT activation enabled in offline mode * * Default value: 1 */ const TUint32 KBTEnabledInOffline = 0x00000002; /** Enumeration for Bluetooth activation in offline mode */ enum TBTEnabledInOfflineMode { EBTDisabledInOfflineMode = 0, EBTEnabledInOfflineMode }; /** * CenRep key for storing Bluetooth feature settings. * Indicates if eSCO is supported. * * Possible integer values: * 0 eSCO not supported * 1 eSCO not supported * * Default value: 0 */ const TUint32 KBTEScoSupportedLV = 0x00000003; /** Enumeration for eSCO support */ enum TBTEScoSupported { EBTEScoNotSupported = 0, EBTEScoSupported }; /** * CenRep key for storing Bluetooth feature settings. * Indicates if device selection/passkey setting by means * other than user input is enabled. * * Possible integer values: * 0 Out-of-band setting is disabled * 1 Out-of-band setting is enabled * * Default value: 0 */ const TUint32 KBTOutbandDeviceSelectionLV = 0x00000004; /** Enumeration for out-of-band selection mode */ enum TBTOutbandSelection { EBTOutbandDisabled = 0, EBTOutbandEnabled }; /** * CenRep key for storing Bluetooth feature settings. * Stores the Bluetooth Vendor ID. * * The integer value is specified by the Bluetooth SIG, and used for the * Device Identification Profile. It needs to be pre-set by each product. */ const TUint32 KBTVendorID = 0x00000005; /** * CenRep key for storing Bluetooth feature settings. * Stores the Bluetooth Product ID. * * The integer value is used for the Device Identification Profile. It is * product-specific, and the values are managed by the company * (as identified by the Vendor ID) It needs to be pre-set by each product. */ const TUint32 KBTProductID = 0x00000006; /** * CenRep key for storing Bluetooth feature settings. * Indicates if supports remote volume control over AVRCP Controller. * * Possible integer values: * 0 supported * 1 supported * * Default value: 1 */ const TUint32 KBTAvrcpVolCTLV = 0x00000007; /** Enumeration for remote volume control AVRCP Controller support */ enum TBTAvrcpVolCTSupported { EBTAvrcpVolCTNotSupported = 0, EBTAvrcpVolCTSupported }; /** * CenRep key for storing Bluetooth feature settings. * Indicates if the auto-pairing feature for audio devices is supported. * * Possible integer values: * 0 supported * 1 supported * * Default value: 0 */ const TUint32 KBTAutoPairingLV = 0x00000008; /** Enumeration for remote volume control AVRCP Controller support */ enum TBTAutoPairingSupported { EBTAutoPairingNotSupported = 0, EBTAutoPairingSupported }; /** * CenRep key for storing Bluetooth feature settings. * Indicates if the Bluetooth/IrDa Receiving Indicator feature is supported. * * Possible integer values: * 0 supported * 1 supported * * Default value: 0 */ const TUint32 KBTBTIRReceiveIndicatorLV = 0x00000009; /** Enumeration for remote volume control AVRCP Controller support */ enum TBTReceiveIndicatorSupported { EBTIRReceiveIndicatorNotSupported = 0, EBTIRReceiveIndicatorSupported }; /** Bluetooth Local Device Address CenRep UID */ const TUid KCRUidBluetoothLocalDeviceAddress = { 0x10204DAA }; /** * CenRep key for storing the Bluetooth local device address. * * Default value (in string format): "" */ const TUint32 KBTLocalDeviceAddress = 0x00000001; // BTENG_DOMAIN_CR_KEYS_H #endif
#pragma once // Hiding until enemy get out from its sight template<typename _Object> class CStateControlHideLite : public CState<_Object> { typedef CState<_Object> inherited; typedef CState<_Object>* state_ptr; struct { Fvector position; u32 node; } target; u32 m_time_finished; public: CStateControlHideLite (_Object *obj) : inherited(obj) {} virtual ~CStateControlHideLite () {} virtual void reinit (); virtual void initialize (); virtual void execute (); virtual void finalize (); virtual bool check_completion (); virtual bool check_start_conditions (); private: void select_target_point (); }; #include "controller_state_attack_hide_lite_inline.h"
/* * Copyright (c) 2009-2012 by Farsight Security, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Import. */ #include "private.h" /* Internal functions. */ nmsg_res _input_pcap_read(nmsg_input_t input, nmsg_message_t *msg) { nmsg_res res; size_t sz; struct nmsg_ipdg dg; struct timespec ts; uint8_t *pbuf; /* get next ip datagram from pcap source */ res = nmsg_pcap_input_read(input->pcap, &dg, &ts); if (res != nmsg_res_success) return (res); /* convert ip datagram to payload */ res = nmsg_msgmod_ipdg_to_payload(input->msgmod, input->clos, &dg, &pbuf, &sz); if (res != nmsg_res_pbuf_ready) return (res); /* encapsulate nmsg payload */ *msg = nmsg_message_from_raw_payload(input->msgmod->plugin->vendor.id, input->msgmod->plugin->msgtype.id, pbuf, sz, &ts); if (*msg == NULL) { free(pbuf); return (nmsg_res_memfail); } return (nmsg_res_success); } nmsg_res _input_pcap_read_raw(nmsg_input_t input, nmsg_message_t *msg) { return (nmsg_msgmod_pkt_to_payload(input->msgmod, input->clos, input->pcap, msg)); }
// // ReadMe.h // MiniCom // // Created by wlp on 14-8-14. // Copyright (c) 2014年 wanglipeng. All rights reserved. // #ifndef MiniCom_ReadMe_h #define MiniCom_ReadMe_h /* 组织目录说明 1、LIb(第三方类库) GTMBase64 封装了关于base64的方法 slib及rsa 封装了rsa解密的方法 tcp 长连接 SDWebImage 图片缓存封装 ASI http封装 FMDB 数据库封装 HUD 遮罩封装 JSONKit json库 Reachability 网络监测类库 2、class common 工具类 DataBase 数据管理类包括数据库 Manager 账户管理 音频播放管理 广场信息管理类 群组信息管理类 MyHttp 封装了针对本项目的关于网络的类 Model 各模块的数据类型 View 各个模块的自定义VIew ViewControl 各个视图控制器 Main:主界面(子view广场、群组、我的、发送消息) Loading:loading动画页 Login:登录模块 Chat:聊天模块 SquareMess:广场详情 UserInfo:好友信息 GroupInfo:群组信息 Own: MoreFriend(找到更多密友) AddFriend(添加好友) NewFriend(好友请求) CitcleSet(好友分组设置) Group: GroupManager(群组管理) GroupMemberSet(添加群成员) GroupNewLocal(创建群组设置位置) GroupCreatSuccess(创建群组成功后,确认页面) AccountVC MyInfo(我的名片) MyInfoCHange(修改个人信息) MyInfoCHangePassword(修改密码) EditMess SendMessage(发送广场信息) ChoosePhoto(选择图片) RecordVoice(录制音频) 3、resources 资源文件 */ #endif
/* ----------------------------------------------------------------------------------------------- Copyright (C) 2013 Henry van Merode. 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, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------------------------- */ #ifndef __PU_FORCE_FIELD_AFFECTOR_FACTORY_H__ #define __PU_FORCE_FIELD_AFFECTOR_FACTORY_H__ #include "ParticleUniversePrerequisites.h" #include "ParticleUniverseAffectorFactory.h" #include "ParticleUniverseForceFieldAffector.h" #include "ParticleUniverseForceFieldAffectorTokens.h" namespace ParticleUniverse { /** Factory class responsible for creating the ForceFieldAffector. */ class _ParticleUniverseExport ForceFieldAffectorFactory : public ParticleAffectorFactory { public: ForceFieldAffectorFactory(void) {}; virtual ~ForceFieldAffectorFactory(void) {}; /** See ParticleAffectorFactory */ String getAffectorType(void) const { return "ForceField"; } /** See ParticleAffectorFactory */ ParticleAffector* createAffector(void) { return _createAffector<ForceFieldAffector>(); } /** See ScriptReader */ virtual bool translateChildProperty(ScriptCompiler* compiler, const AbstractNodePtr &node) { return mForceFieldAffectorTranslator.translateChildProperty(compiler, node); }; /** See ScriptReader */ virtual bool translateChildObject(ScriptCompiler* compiler, const AbstractNodePtr &node) { return mForceFieldAffectorTranslator.translateChildObject(compiler, node); }; /* */ virtual void write(ParticleScriptSerializer* serializer , const IElement* element) { // Delegate mForceFieldAffectorWriter.write(serializer, element); } protected: ForceFieldAffectorWriter mForceFieldAffectorWriter; ForceFieldAffectorTranslator mForceFieldAffectorTranslator; }; } #endif
/* * libjingle * Copyright 2004--2005, Google Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef TALK_XMPP_XMPPCLIENTSETTINGS_H_ #define TALK_XMPP_XMPPCLIENTSETTINGS_H_ #include "talk/p2p/base/port.h" #include "talk/base/cryptstring.h" #include "talk/xmpp/xmppengine.h" namespace buzz { class XmppUserSettings { public: XmppUserSettings() : use_tls_(buzz::TLS_DISABLED), allow_plain_(false) { } void set_user(const std::string& user) { user_ = user; } void set_host(const std::string& host) { host_ = host; } void set_pass(const talk_base::CryptString& pass) { pass_ = pass; } void set_auth_token(const std::string& mechanism, const std::string& token) { auth_mechanism_ = mechanism; auth_token_ = token; } void set_resource(const std::string& resource) { resource_ = resource; } void set_use_tls(const TlsOptions use_tls) { use_tls_ = use_tls; } void set_allow_gtalk_username_custom_domain(bool b) { allow_gtalk_username_custom_domain_ = b; } void set_allow_plain(bool f) { allow_plain_ = f; } void set_test_server_domain(const std::string& test_server_domain) { test_server_domain_ = test_server_domain; } void set_token_service(const std::string& token_service) { token_service_ = token_service; } const std::string& user() const { return user_; } const std::string& host() const { return host_; } const talk_base::CryptString& pass() const { return pass_; } const std::string& auth_mechanism() const { return auth_mechanism_; } const std::string& auth_token() const { return auth_token_; } const std::string& resource() const { return resource_; } TlsOptions use_tls() const { return use_tls_; } bool allow_plain() const { return allow_plain_; } const std::string& test_server_domain() const { return test_server_domain_; } const std::string& token_service() const { return token_service_; } bool allow_gtalk_username_custom_domain() const { return allow_gtalk_username_custom_domain_; } private: std::string user_; std::string host_; talk_base::CryptString pass_; std::string auth_mechanism_; std::string auth_token_; std::string resource_; TlsOptions use_tls_; bool allow_gtalk_username_custom_domain_; bool allow_plain_; std::string test_server_domain_; std::string token_service_; }; class XmppClientSettings : public XmppUserSettings { public: XmppClientSettings() : protocol_(cricket::PROTO_TCP), proxy_(talk_base::PROXY_NONE), proxy_port_(80), use_proxy_auth_(false) { } void set_server(const talk_base::SocketAddress& server) { server_ = server; } void set_protocol(cricket::ProtocolType protocol) { protocol_ = protocol; } void set_proxy(talk_base::ProxyType f) { proxy_ = f; } void set_proxy_host(const std::string& host) { proxy_host_ = host; } void set_proxy_port(int port) { proxy_port_ = port; }; void set_use_proxy_auth(bool f) { use_proxy_auth_ = f; } void set_proxy_user(const std::string& user) { proxy_user_ = user; } void set_proxy_pass(const talk_base::CryptString& pass) { proxy_pass_ = pass; } const talk_base::SocketAddress& server() const { return server_; } cricket::ProtocolType protocol() const { return protocol_; } talk_base::ProxyType proxy() const { return proxy_; } const std::string& proxy_host() const { return proxy_host_; } int proxy_port() const { return proxy_port_; } bool use_proxy_auth() const { return use_proxy_auth_; } const std::string& proxy_user() const { return proxy_user_; } const talk_base::CryptString& proxy_pass() const { return proxy_pass_; } private: talk_base::SocketAddress server_; cricket::ProtocolType protocol_; talk_base::ProxyType proxy_; std::string proxy_host_; int proxy_port_; bool use_proxy_auth_; std::string proxy_user_; talk_base::CryptString proxy_pass_; }; } #endif // TALK_XMPP_XMPPCLIENT_H_
/* * Copyright 1993-2014 NVIDIA Corporation. All rights reserved. * * NOTICE TO LICENSEE: * * This source code and/or documentation ("Licensed Deliverables") are * subject to NVIDIA intellectual property rights under U.S. and * international Copyright laws. * * These Licensed Deliverables contained herein is PROPRIETARY and * CONFIDENTIAL to NVIDIA and is being provided under the terms and * conditions of a form of NVIDIA software license agreement by and * between NVIDIA and Licensee ("License Agreement") or electronically * accepted by Licensee. Notwithstanding any terms or conditions to * the contrary in the License Agreement, reproduction or disclosure * of the Licensed Deliverables to any third party without the express * written consent of NVIDIA is prohibited. * * ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, * DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, * “MATERIALS”) ARE BEING PROVIDED “AS IS.” WITHOUT EXPRESS OR IMPLIED * WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD * TO THESE LICENSED DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE LICENSE * AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, * INCIDENTAL, 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 THESE LICENSED DELIVERABLES. * * Information furnished is believed to be accurate and reliable. However, * NVIDIA assumes no responsibility for the consequences of use of such * information nor for any infringement of patents or other rights of * third parties, which may result from its use. No License is granted * by implication or otherwise under any patent or patent rights of NVIDIA * Corporation. Specifications mentioned in the software are subject to * change without notice. This publication supersedes and replaces all * other information previously supplied. * * NVIDIA Corporation products are not authorized for use as critical * components in life support devices or systems without express written * approval of NVIDIA Corporation. * * U.S. Government End Users. These Licensed Deliverables are a * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT * 1995), consisting of "commercial computer software" and "commercial * computer software documentation" as such terms are used in 48 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government * only as a commercial end item. Consistent with 48 C.F.R.12.212 and * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all * U.S. Government End Users acquire the Licensed Deliverables with * only those rights set forth herein. * * Any use of the Licensed Deliverables in individual and commercial * software must include, in the user documentation and internal * comments to the code, the above Disclaimer and U.S. Government End * Users Notice. */ //--------------------------------------------------------------------------- // stdio.h // // Replacement for #include <stdio.h> // Used to fixup and deficiencies in the platform headers // //--------------------------------------------------------------------------- #ifndef _COMMON_INCLUDE_STD_STDIO_H_ #define _COMMON_INCLUDE_STD_STDIO_H_ #include <stdio.h> #ifdef __cplusplus extern "C" { #endif #if defined(NV_BUILD_TOOLCHAIN_MSVC) #define vsnprintf _vsnprintf #endif #ifdef __cplusplus } #endif #endif
/* * This file is part of the Soletta Project * * Copyright (C) 2016 Intel Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <inttypes.h> #include <stdio.h> #include <sol-bluetooth.h> #include <sol-buffer.h> #include <sol-log.h> #include <sol-str-table.h> #include <sol-util.h> #define BASE_UUID { .type = SOL_BT_UUID_TYPE_128, \ .val128 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB, } \ } static int string_to_uuid128(struct sol_bt_uuid *uuid, const char *str) { uint32_t data0, data4; uint16_t data1, data2, data3, data5; uint8_t *val = uuid->val128; if (sscanf(str, "%08" SCNx32 "-%04" SCNx16 "-%04" SCNx16 "-%04" SCNx16 "-%08" SCNx32 "%04" SCNx16, &data0, &data1, &data2, &data3, &data4, &data5) != 6) return -EINVAL; data0 = sol_util_be32_to_cpu(data0); data1 = sol_util_be16_to_cpu(data1); data2 = sol_util_be16_to_cpu(data2); data3 = sol_util_be16_to_cpu(data3); data4 = sol_util_be32_to_cpu(data4); data5 = sol_util_be16_to_cpu(data5); memcpy(&val[0], &data0, 4); memcpy(&val[4], &data1, 2); memcpy(&val[6], &data2, 2); memcpy(&val[8], &data3, 2); memcpy(&val[10], &data4, 4); memcpy(&val[14], &data5, 2); return 0; } static void uuid16_to_uuid128(const struct sol_bt_uuid *u16, struct sol_bt_uuid *u128) { uint16_t val; val = sol_util_cpu_to_be16(u16->val16); memcpy(&u128->val128[2], &val, sizeof(val)); } static void uuid32_to_uuid128(const struct sol_bt_uuid *u32, struct sol_bt_uuid *u128) { uint32_t val; val = sol_util_cpu_to_be32(u32->val32); memcpy(&u128->val128[0], &val, sizeof(val)); } static void uuid_to_uuid128(const struct sol_bt_uuid *u, struct sol_bt_uuid *u128) { switch (u->type) { case SOL_BT_UUID_TYPE_128: *u128 = *u; break; case SOL_BT_UUID_TYPE_32: uuid32_to_uuid128(u, u128); break; case SOL_BT_UUID_TYPE_16: uuid16_to_uuid128(u, u128); break; } } SOL_API int sol_bt_uuid_from_str(struct sol_bt_uuid *uuid, const struct sol_str_slice str) { int r; SOL_NULL_CHECK(uuid, -EINVAL); switch (str.len) { case 4: uuid->type = SOL_BT_UUID_TYPE_16; uuid->val16 = strtoul(str.data, NULL, 16); break; case 8: uuid->type = SOL_BT_UUID_TYPE_32; uuid->val32 = strtoull(str.data, NULL, 16); break; case 36: uuid->type = SOL_BT_UUID_TYPE_128; r = string_to_uuid128(uuid, str.data); SOL_INT_CHECK(r, < 0, r); break; default: return -EINVAL; } return 0; } SOL_API int sol_bt_uuid_to_str(const struct sol_bt_uuid *uuid, struct sol_buffer *buffer) { uint32_t tmp0, tmp4; uint16_t tmp1, tmp2, tmp3, tmp5; struct sol_bt_uuid u = BASE_UUID; int r; SOL_NULL_CHECK(uuid, -EINVAL); SOL_NULL_CHECK(buffer, -EINVAL); uuid_to_uuid128(uuid, &u); memcpy(&tmp0, &u.val128[0], sizeof(tmp0)); memcpy(&tmp1, &u.val128[4], sizeof(tmp1)); memcpy(&tmp2, &u.val128[6], sizeof(tmp2)); memcpy(&tmp3, &u.val128[8], sizeof(tmp3)); memcpy(&tmp4, &u.val128[10], sizeof(tmp4)); memcpy(&tmp5, &u.val128[14], sizeof(tmp5)); r = sol_buffer_append_printf(buffer, "%.8" PRIx32 "-%.4" PRIx16 "-%.4" PRIx16 "-%.4" PRIx16 "-%.8" PRIx32 "%.4" PRIx16, sol_util_cpu_to_be32(tmp0), sol_util_cpu_to_be16(tmp1), sol_util_cpu_to_be16(tmp2), sol_util_cpu_to_be16(tmp3), sol_util_cpu_to_be32(tmp4), sol_util_cpu_to_be16(tmp5)); return r ? -errno : 0; } SOL_API bool sol_bt_uuid_equal(const struct sol_bt_uuid *u1, const struct sol_bt_uuid *u2) { struct sol_bt_uuid u1_128 = BASE_UUID; struct sol_bt_uuid u2_128 = BASE_UUID; if (!u1 && !u2) return true; if (!u1 || !u2) return false; if (u1->type == u2->type) return memcmp(u1->val, u2->val, u1->type) == 0; uuid_to_uuid128(u1, &u1_128); uuid_to_uuid128(u2, &u2_128); return memcmp(u1_128.val128, u2_128.val128, u1_128.type) == 0; } SOL_API const char * sol_bt_transport_to_str(enum sol_bt_transport transport) { static const char *transports[] = { [SOL_BT_TRANSPORT_ALL] = "all", [SOL_BT_TRANSPORT_LE] = "le", [SOL_BT_TRANSPORT_BREDR] = "bredr", }; if (transport < sol_util_array_size(transports)) return transports[transport]; return NULL; } enum sol_bt_transport sol_bt_transport_from_str(const char *str) { static const struct sol_str_table table[] = { SOL_STR_TABLE_ITEM("all", SOL_BT_TRANSPORT_ALL), SOL_STR_TABLE_ITEM("le", SOL_BT_TRANSPORT_LE), SOL_STR_TABLE_ITEM("bredr", SOL_BT_TRANSPORT_BREDR), { }, }; return sol_str_table_lookup_fallback(table, sol_str_slice_from_str(str), SOL_BT_TRANSPORT_ALL); }
/*========================================================================= * * Copyright Marius Staring, Stefan Klein, David Doria. 2011. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __extractindexfromvectorimage_h_ #define __extractindexfromvectorimage_h_ #include "ITKToolsBase.h" #include "itkImageFileReader.h" #include "itkComposeImageFilter.h" #include "itkImageFileWriter.h" #include "itkVectorIndexSelectionCastImageFilter.h" #include "itkImage.h" #include "itkVectorImage.h" #include "itkVector.h" /** \class ITKToolsExtractIndexBase * * Untemplated pure virtual base class that holds * the Run() function and all required parameters. */ class ITKToolsExtractIndexBase : public itktools::ITKToolsBase { public: /** Constructor. */ ITKToolsExtractIndexBase() { this->m_InputFileName = ""; this->m_OutputFileName = ""; }; /** Destructor. */ ~ITKToolsExtractIndexBase(){}; /** Input member parameters. */ std::string m_InputFileName; std::string m_OutputFileName; std::vector<unsigned int> m_Indices; }; // end class ITKToolsExtractIndexBase /** \class ITKToolsExtractIndex * * Templated class that implements the Run() function * and the New() function for its creation. */ template< unsigned int VDimension, class TComponentType > class ITKToolsExtractIndex : public ITKToolsExtractIndexBase { public: /** Standard ITKTools stuff. */ typedef ITKToolsExtractIndex Self; itktoolsOneTypeNewMacro( Self ); ITKToolsExtractIndex(){}; ~ITKToolsExtractIndex(){}; /** Run function. */ void Run( void ) { /** Use vector image type that dynamically determines vector length: */ typedef itk::VectorImage< TComponentType, VDimension > VectorImageType; typedef itk::Image< TComponentType, VDimension > ScalarImageType; typedef itk::ImageFileReader< VectorImageType > ImageReaderType; typedef itk::VectorIndexSelectionCastImageFilter< VectorImageType, ScalarImageType > IndexExtractorType; typedef itk::ImageFileWriter< VectorImageType > ImageWriterType; /** Read input image. */ typename ImageReaderType::Pointer reader = ImageReaderType::New(); reader->SetFileName( this->m_InputFileName ); reader->Update(); /** Extract indices. */ // Create the assembler typedef itk::ComposeImageFilter<ScalarImageType> ImageToVectorImageFilterType; typename ImageToVectorImageFilterType::Pointer imageToVectorImageFilter = ImageToVectorImageFilterType::New(); for( unsigned int i = 0; i < this->m_Indices.size(); ++i ) { typename IndexExtractorType::Pointer extractor = IndexExtractorType::New(); extractor->SetInput( reader->GetOutput() ); extractor->SetIndex( this->m_Indices[ i ] ); extractor->Update(); //extractor->DisconnectPipeline(); imageToVectorImageFilter->SetInput( i, extractor->GetOutput() ); } imageToVectorImageFilter->Update(); /** Write output image. */ typename ImageWriterType::Pointer writer = ImageWriterType::New(); writer->SetFileName( this->m_OutputFileName ); writer->SetInput( imageToVectorImageFilter->GetOutput() ); writer->Update(); } // end Run() }; // end class ITKToolsExtractIndex #endif // end #ifndef __extractindexfromvectorimage_h_
/* * Copyright (C) 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ANGLEInstancedArrays_h #define ANGLEInstancedArrays_h #include "WebGLExtension.h" namespace WebCore { class WebGLRenderingContext; class ANGLEInstancedArrays : public WebGLExtension { public: explicit ANGLEInstancedArrays(WebGLRenderingContext*); virtual ~ANGLEInstancedArrays(); virtual ExtensionName getName() const; static bool supported(WebGLRenderingContext*); void drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount); void drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, GC3Dsizei primcount); void vertexAttribDivisorANGLE(GC3Duint index, GC3Duint divisor); }; } // namespace WebCore #endif // ANGLEInstancedArrays_h
#ifndef _HO_GETOPT_LONG_H #define _HO_GETOPT_LONG_H #include <netinet/in.h> #include <arpa/inet.h> #ifdef __cplusplus extern "C" { #endif struct ho_option { void (*get_val)(const struct ho_option *opt, const char *in_val); char *name; int has_arg; void *flag; int val; }; static inline void ho_opt_int(const struct ho_option *opt, const char *in_val) { *(int *)opt->flag = atoi(in_val); } static inline void ho_opt_double(const struct ho_option *opt, const char *in_val) { *(double *)opt->flag = atof(in_val); } static inline void ho_opt_ip(const struct ho_option *opt, const char *in_val) { struct in_addr addr; if (inet_aton(in_val, &addr) == 0) { perror("inet_aton"); } *(int *)opt->flag = addr.s_addr; } static inline void ho_opt_port(const struct ho_option *opt, const char *in_val) { *(unsigned short *)opt->flag = htons(atoi(in_val)); } #ifdef __cplusplus } #endif #endif
/*- * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * * This software was developed by Semihalf under sponsorship * from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE 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. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD: soc2013/dpl/head/sbin/nandfs/rmsnap.c 235866 2012-05-17 10:11:18Z gber $"); #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <sysexits.h> #include <fs/nandfs/nandfs_fs.h> #include <libnandfs.h> #include "nandfs.h" static void rmsnap_usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, "\trmsnap snap node\n"); } int nandfs_rmsnap(int argc, char **argv) { struct nandfs fs; uint64_t cpno; int error; if (argc != 2) { rmsnap_usage(); return (EX_USAGE); } cpno = strtoll(argv[0], (char **)NULL, 10); if (cpno == 0) { fprintf(stderr, "%s must be a number greater than 0\n", argv[0]); return (EX_USAGE); } nandfs_init(&fs, argv[1]); error = nandfs_open(&fs); if (error == -1) { fprintf(stderr, "nandfs_open: %s\n", nandfs_errmsg(&fs)); goto out; } error = nandfs_delete_snap(&fs, cpno); if (error == -1) fprintf(stderr, "nandfs_delete_snap: %s\n", nandfs_errmsg(&fs)); out: nandfs_close(&fs); nandfs_destroy(&fs); return (error); }
// Copyright ©2005, 2006 Freescale Semiconductor, Inc. // Please see the License for the specific language governing rights and // limitations under the License. // =========================================================================== // StDMTransactionHider.h © 1996-97 Metrowerks Inc. All rights reserved. // =========================================================================== // // Created: 06/05/96 // $Date: 2006/01/18 01:32:39 $ // $History: StDMTransactionHider.h $ // // ***************** Version 3 ***************** // User: scouten QDate: 02/20/97 Time: 14:50 // Updated in $/Constructor/Source files/CO- Core/Data model/Undo-redo // Improved commenting. // // ***************** Version 2 ***************** // User: scouten Date: 01/24/97 Time: 17:22 // Checked in '$/Constructor/Source files/CO- Core/Data model/Undo-redo' // Comment: Fixed CR/LF problem // // ***************** Version 1 ***************** // User: scouten Date: 10/16/96 Time: 01:33 // Created // Comment: Baseline source 15 October 1996. // // =========================================================================== #pragma once // =========================================================================== // * Forward class declarations // =========================================================================== class StDMTransactionBuilder; // =========================================================================== // * StDMTransactionHider // =========================================================================== // // StDMTransactionHider is a helper class which disables the // StDMTransactionBuilder temporarily. Use it if, in the course of // executing the command, you make changes to the data model that // should not be undone or redone. // // =========================================================================== class StDMTransactionHider { public: StDMTransactionHider(); virtual ~StDMTransactionHider(); protected: StDMTransactionBuilder* mSavedBuilder; };
/* Copyright (c) by Emil Valkov, All rights reserved. License: http://www.opensource.org/licenses/bsd-license.php */ #include <cv.h> #include <highgui.h> #include <stdio.h> #include <unistd.h> #include "RaspiCamCV.h" int main(int argc, char *argv[ ]){ RASPIVID_CONFIG * config = (RASPIVID_CONFIG*)malloc(sizeof(RASPIVID_CONFIG)); config->width=320; config->height=240; config->bitrate=0; // zero: leave as default config->framerate=0; config->monochrome=0; int opt; while ((opt = getopt(argc, argv, "lxm")) != -1) { switch (opt) { case 'l': // large config->width = 640; config->height = 480; break; case 'x': // extra large config->width = 960; config->height = 720; break; case 'm': // monochrome config->monochrome = 1; break; default: fprintf(stderr, "Usage: %s [-x] [-l] [-m] \n", argv[0], opt); fprintf(stderr, "-l: Large mode\n"); fprintf(stderr, "-x: Extra large mode\n"); fprintf(stderr, "-l: Monochrome mode\n"); exit(EXIT_FAILURE); } } /* Could also use hard coded defaults method: raspiCamCvCreateCameraCapture(0) */ RaspiCamCvCapture * capture = (RaspiCamCvCapture *) raspiCamCvCreateCameraCapture2(0, config); free(config); CvFont font; double hScale=0.4; double vScale=0.4; int lineWidth=1; cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX|CV_FONT_ITALIC, hScale, vScale, 0, lineWidth, 8); cvNamedWindow("RaspiCamTest", 1); int exit =0; do { IplImage* image = raspiCamCvQueryFrame(capture); char text[200]; sprintf( text , "w=%.0f h=%.0f fps=%.0f bitrate=%.0f monochrome=%.0f" , raspiCamCvGetCaptureProperty(capture, RPI_CAP_PROP_FRAME_WIDTH) , raspiCamCvGetCaptureProperty(capture, RPI_CAP_PROP_FRAME_HEIGHT) , raspiCamCvGetCaptureProperty(capture, RPI_CAP_PROP_FPS) , raspiCamCvGetCaptureProperty(capture, RPI_CAP_PROP_BITRATE) , raspiCamCvGetCaptureProperty(capture, RPI_CAP_PROP_MONOCHROME) ); cvPutText (image, text, cvPoint(05, 40), &font, cvScalar(255, 255, 0, 0)); sprintf(text, "Press ESC to exit"); cvPutText (image, text, cvPoint(05, 80), &font, cvScalar(255, 255, 0, 0)); cvShowImage("RaspiCamTest", image); char key = cvWaitKey(10); switch(key) { case 27: // Esc to exit exit = 1; break; case 60: // < (less than) raspiCamCvSetCaptureProperty(capture, RPI_CAP_PROP_FPS, 25); // Currently NOOP break; case 62: // > (greater than) raspiCamCvSetCaptureProperty(capture, RPI_CAP_PROP_FPS, 30); // Currently NOOP break; } } while (!exit); cvDestroyWindow("RaspiCamTest"); raspiCamCvReleaseCapture(&capture); return 0; }
/** * PurgeEvasionParallel.c * Parallel encryption/decryption for * purgeEvasion using RThreadPool. * Author Kucheruavyu Ilya (kojiba@ro.ru) * 12/8/15 Ukraine Kharkiv * _ _ _ _ * | | (_|_) | * | | _____ _ _| |__ __ _ * | |/ / _ \| | | '_ \ / _` | * | < (_) | | | |_) | (_| | * |_|\_\___/| |_|_.__/ \__,_| * _/ | * |__/ **/ #include "PurgeEvasionParallel.h" #include "RayFoundation/RThread/RThreadPool.h" #include "RayFoundation/REncoding/PurgeEvasionUtils.h" #ifndef RAY_EMBEDDED typedef struct PrivatePEWokerData { uint8_t keyTemp[purgeBytesCount]; uint64_t cipherCount; uint8_t *partStart; } PrivatePEWokerData; void privatePEEncryptPart(PrivatePEWokerData *worker) { uint64_t iterator; uint8_t keyTemp[purgeBytesCount]; forAll(iterator, worker->cipherCount) { evasionRand((uint64_t *) worker->keyTemp); memcpy(keyTemp, worker->keyTemp, purgeBytesCount); purgeEncrypt((uint64_t *) (worker->partStart + iterator * purgeBytesCount), (uint64_t *) keyTemp); } deallocator(worker); } void* encryptPurgeEvasionParallel(const void *text, uint64_t size, uint64_t key[8], uint64_t *cryptedSize, unsigned workers) { uint8_t *result = nil; uint64_t hash[8]; uint64_t totalSize = size + sizeof(uint64_t); uint8_t workerKey[purgeBytesCount]; uint64_t ciphersForWorker; uint64_t additionalForLastWorker; unsigned iterator; uint64_t keyIterator; uint64_t cipherCount = totalSize / purgeBytesCount; uint64_t addition = totalSize % purgeBytesCount; if(addition != 0) { totalSize += purgeBytesCount - addition; ++cipherCount; } result = RAlloc(totalSize); if(result) { RThreadPool *pool = nil; *cryptedSize = 0; memcpy(result, &size, sizeof(uint64_t)); // add size in front memcpy(result + sizeof(uint64_t), text, size); // copy other text if (addition != 0) { // add some zeros if needed memset(result + size + sizeof(uint64_t), 0, purgeBytesCount - addition); } evasionHashData(result + sizeof(uint64_t), totalSize - sizeof(uint64_t), (uint64_t *)hash); // hash data with padding ciphersForWorker = cipherCount / workers; additionalForLastWorker = cipherCount - ciphersForWorker * workers; pool = c(RThreadPool)(nil); if(pool != nil) { $(pool, m(setDelegateFunction, RThreadPool)), (RThreadFunction) privatePEEncryptPart); forAll(iterator, workers) { PrivatePEWokerData *arg = allocator(PrivatePEWokerData); if(arg != nil){ // setup part key if(iterator != 0) { forAll(keyIterator, ciphersForWorker) { evasionRand((uint64_t *) workerKey); } } else { memcpy(workerKey, key, purgeBytesCount); } memcpy(arg->keyTemp, workerKey, purgeBytesCount); arg->partStart = result + iterator * ciphersForWorker * purgeBytesCount; if(iterator == workers - 1) { arg->cipherCount = ciphersForWorker + additionalForLastWorker; } else { arg->cipherCount = ciphersForWorker; } $(pool, m(addWithArg, RThreadPool)), arg, no); } else { RError("encryptPurgeEvasionParallel. Can't allocate workers argument.", pool); deleter(pool, RThreadPool); return nil; } } $(pool, m(join, RThreadPool))); // wait workers deleter(pool, RThreadPool); // add hash and encrypt last // setup last key for hash forAll(keyIterator, ciphersForWorker + additionalForLastWorker + 1) { evasionRand((uint64_t *) workerKey); } // crypt hash by last key purgeEncrypt(hash, (uint64_t *) workerKey); // encrypt hash memset(workerKey, 0, purgeBytesCount); // append hash result = RReAlloc(result, totalSize + evasionBytesCount); if(result != nil) { memcpy(result + totalSize, hash, evasionBytesCount); // append hash *cryptedSize = totalSize; // store *cryptedSize += evasionBytesCount; } elseError( RError("encryptPurgeEvasionParallel. Error realloc result for hash.", nil); ) } elseError( RError("encryptPurgeEvasionParallel. Can't allocate thread pool.", nil); ) } elseError( RError("encryptPurgeEvasionParallel. Can't allocate result array.", nil); ) return result; } #endif /* RAY_EMBEDDED */
/*- * Copyright (c) 2009 Sam Leffler, Errno Consulting * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: soc2013/dpl/head/sys/net80211/ieee80211_ageq.h 195422 2009-07-05 18:17:37Z sam $ */ #ifndef _NET80211_IEEE80211_STAGEQ_H_ #define _NET80211_IEEE80211_STAGEQ_H_ struct ieee80211_node; struct mbuf; struct ieee80211_ageq { ieee80211_ageq_lock_t aq_lock; int aq_len; /* # items on queue */ int aq_maxlen; /* max queue length */ int aq_drops; /* frames dropped */ struct mbuf *aq_head; /* frames linked w/ m_nextpkt */ struct mbuf *aq_tail; /* last frame in queue */ }; void ieee80211_ageq_init(struct ieee80211_ageq *, int maxlen, const char *name); void ieee80211_ageq_cleanup(struct ieee80211_ageq *); void ieee80211_ageq_mfree(struct mbuf *); int ieee80211_ageq_append(struct ieee80211_ageq *, struct mbuf *, int age); void ieee80211_ageq_drain(struct ieee80211_ageq *); void ieee80211_ageq_drain_node(struct ieee80211_ageq *, struct ieee80211_node *); struct mbuf *ieee80211_ageq_age(struct ieee80211_ageq *, int quanta); struct mbuf *ieee80211_ageq_remove(struct ieee80211_ageq *, struct ieee80211_node *match); #endif /* _NET80211_IEEE80211_STAGEQ_H_ */
#ifndef _IVW_MODULE_PVM_DEFINE_H_ #define _IVW_MODULE_PVM_DEFINE_H_ #ifdef INVIWO_ALL_DYN_LINK //DYNAMIC // If we are building DLL files we must declare dllexport/dllimport #ifdef IVW_MODULE_PVM_EXPORTS #ifdef _WIN32 #define IVW_MODULE_PVM_API __declspec(dllexport) #else //UNIX (GCC) #define IVW_MODULE_PVM_API __attribute__ ((visibility ("default"))) #endif #else #ifdef _WIN32 #define IVW_MODULE_PVM_API __declspec(dllimport) #else #define IVW_MODULE_PVM_API #endif #endif #else //STATIC #define IVW_MODULE_PVM_API #endif #endif /* _IVW_MODULE_PVM_DEFINE_H_ */
// // NSRegularExpression+BlockReplace.h // // Created by Ben Syverson on 2013/7/30. // /* License: ======== © Copyright 2013 Ben Syverson <http://bensyverson.com> 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. */ #import <Foundation/Foundation.h> @interface NSRegularExpression (BlockReplace) - (NSString *)replaceMatchesInString:string options:(NSMatchingOptions)options usingBlock:(NSString * (^)(NSArray *groups))block; @end
/* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Copyright (c) 1995 John Hay. 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * static char sccsid[] = "@(#)if.c 5.1 (Berkeley) 6/4/85"; (routed/if.c) * * $FreeBSD: soc2013/dpl/head/usr.sbin/IPXrouted/if.c 122803 2003-11-15 17:10:56Z trhodes $ */ #ifndef lint static const char sccsid[] = "@(#)if.c 8.1 (Berkeley) 6/5/93"; #endif /* not lint */ /* * Routing Table Management Daemon */ #include "defs.h" extern struct interface *ifnet; /* * Find the interface with address addr. */ struct interface * if_ifwithaddr(addr) struct sockaddr *addr; { register struct interface *ifp; #define same(a1, a2) \ (bcmp((caddr_t)((a1)->sa_data), (caddr_t)((a2)->sa_data), 10) == 0) for (ifp = ifnet; ifp; ifp = ifp->int_next) { if (ifp->int_flags & IFF_REMOTE) continue; if (ifp->int_addr.sa_family != addr->sa_family) continue; if (same(&ifp->int_addr, addr)) break; if ((ifp->int_flags & IFF_BROADCAST) && same(&ifp->int_broadaddr, addr)) break; } return (ifp); } /* * Find the point-to-point interface with destination address addr. */ struct interface * if_ifwithdstaddr(addr) struct sockaddr *addr; { register struct interface *ifp; for (ifp = ifnet; ifp; ifp = ifp->int_next) { if ((ifp->int_flags & IFF_POINTOPOINT) == 0) continue; if (same(&ifp->int_dstaddr, addr)) break; } return (ifp); } /* * Find the interface on the network * of the specified address. */ struct interface * if_ifwithnet(addr) register struct sockaddr *addr; { register struct interface *ifp; register int af = addr->sa_family; register int (*netmatch)(); if (af >= AF_MAX) return (0); netmatch = afswitch[af].af_netmatch; for (ifp = ifnet; ifp; ifp = ifp->int_next) { if (ifp->int_flags & IFF_REMOTE) continue; if (af != ifp->int_addr.sa_family) continue; if ((*netmatch)(addr, &ifp->int_addr)) break; } return (ifp); } /* * Find an interface from which the specified address * should have come from. Used for figuring out which * interface a packet came in on -- for tracing. */ struct interface * if_iflookup(addr) struct sockaddr *addr; { register struct interface *ifp, *maybe; register int af = addr->sa_family; register int (*netmatch)(); if (af >= AF_MAX) return (0); maybe = 0; netmatch = afswitch[af].af_netmatch; for (ifp = ifnet; ifp; ifp = ifp->int_next) { if (ifp->int_addr.sa_family != af) continue; if (same(&ifp->int_addr, addr)) break; if ((ifp->int_flags & IFF_BROADCAST) && same(&ifp->int_broadaddr, addr)) break; if (maybe == 0 && (*netmatch)(addr, &ifp->int_addr)) maybe = ifp; } if (ifp == 0) ifp = maybe; return (ifp); }
// Copyright ©2005, 2006 Freescale Semiconductor, Inc. // Please see the License for the specific language governing rights and // limitations under the License. // =========================================================================== // VPLToggleButton.h © 1996-97 Metrowerks Inc. All rights reserved. // =========================================================================== // // Created: 11/15/96 // $Date: 2006/01/18 01:34:03 $ // $History: VPLToggleButton.h $ // // ***************** Version 3 ***************** // User: scouten QDate: 01/24/97 Time: 15:02 // Updated in $/Constructor/Source files/H1- MacOS/Editors/Views/Drawing agents // Updated for refactored RFMap classes. // // ***************** Version 2 ***************** // User: scouten QDate: 12/13/96 Time: 15:52 // Updated in $/Constructor/Source files/Editors/Views/PowerPlant/Drawing agents // Updated to Clint's drop 12/13/96. // // ***************** Version 1 ***************** // User: scouten QDate: 11/17/96 Time: 14:18 // Created in $/Constructor/Source files/Editors/Views/PowerPlant/Drawing agents // Added drawing agent. // // =========================================================================== #pragma once // MacOS : Editors : Views : Drawing agents #include "VPLControl.h" // PowerPlant : GA : Grayscale controls #include <LToggleButton.h> // =========================================================================== // * VPLToggleButton // =========================================================================== // Drawing agent for the PowerPlant class LToggleButton. class VPLToggleButton : public VPLControl { public: static VEDrawingAgent* CreateAgent() { return new VPLToggleButton; } VPLToggleButton() {} virtual ~VPLToggleButton() {} virtual LPane* CreateFromStream(LStream* inStream); virtual Boolean ListenToMap(); virtual void ResourceChanged( RMResource* inResource); protected: virtual void ValueChangedSelf( FourCharCode inAttributeKey, DMAttribute* inAttribute); }; // =========================================================================== // * VPFToggleButton // =========================================================================== // Helper class for LToggleButton. Restricts search for graphics resources // to the top resource file. class VPFToggleButton : public LToggleButton { public: VPFToggleButton(LStream* inStream); virtual ~VPFToggleButton(); protected: virtual void LoadGraphic(); virtual void DrawGraphic( ResIDT inGraphicID); // data members protected: Handle mIcon; Handle mIconSuite; PicHandle mPicture; friend class VPLToggleButton; };
/*- * Copyright (c) 2011, 2012 LSI Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE 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. * * LSI MPT-Fusion Host Adapter FreeBSD * * $FreeBSD: soc2013/dpl/head/sys/dev/mps/mps_mapping.h 238444 2012-06-28 03:48:54Z ken $ */ #ifndef _MPS_MAPPING_H #define _MPS_MAPPING_H /** * struct _map_phy_change - PHY entries recieved in Topology change list * @physical_id: SAS address of the device attached with the associate PHY * @device_info: bitfield provides detailed info about the device * @dev_handle: device handle for the device pointed by this entry * @slot: slot ID * @is_processed: Flag to indicate whether this entry is processed or not */ struct _map_phy_change { uint64_t physical_id; uint32_t device_info; uint16_t dev_handle; uint16_t slot; uint8_t reason; uint8_t is_processed; }; /** * struct _map_topology_change - entries to be removed from mapping table * @dpm_entry_num: index of this device in device persistent map table * @dev_handle: device handle for the device pointed by this entry */ struct _map_topology_change { uint16_t enc_handle; uint16_t exp_handle; uint8_t num_entries; uint8_t start_phy_num; uint8_t num_phys; uint8_t exp_status; struct _map_phy_change *phy_details; }; extern int mpssas_get_sas_address_for_sata_disk(struct mps_softc *ioc, u64 *sas_address, u16 handle, u32 device_info); #endif
/* dovend.h */ /* $FreeBSD: soc2013/dpl/head/libexec/bootpd/dovend.h 97459 2002-05-28 18:31:41Z alfred $ */ extern int dovend_rfc1497(struct host *hp, u_char *buf, int len); extern int insert_ip(int, struct in_addr_list *, u_char **, int *); extern void insert_u_long(u_int32, u_char **);
/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD: release/9.1.0/sys/libkern/flsl.c 128019 2004-04-07 20:46:16Z imp $"); #include <sys/libkern.h> /* * Find Last Set bit */ int flsl(long mask) { int bit; if (mask == 0) return (0); for (bit = 1; mask != 1; bit++) mask = (unsigned long)mask >> 1; return (bit); }
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////// #include "CIMFixtureBase.h" class UNIX_ElementConfigurationFixture : public CIMFixtureBase { public: UNIX_ElementConfigurationFixture(); ~UNIX_ElementConfigurationFixture(); virtual void Run(); };
/* * THE UNICODE TEST SUITE FOR CINDER: https://github.com/arielm/Unicode * COPYRIGHT (C) 2013, ARIEL MALKA ALL RIGHTS RESERVED. * * THE FOLLOWING SOURCE-CODE IS DISTRIBUTED UNDER THE MODIFIED BSD LICENSE: * https://github.com/arielm/Unicode/blob/master/LICENSE.md */ #pragma once #include "TextLayout.h" #include "VirtualFont.h" class TextLayoutKey { public: VirtualFont *virtualFont; TextRun run; TextLayoutKey(VirtualFont *virtualFont, const TextRun &run) : virtualFont(virtualFont), run(run) {} bool operator<(const TextLayoutKey &rhs) const { if (virtualFont == rhs.virtualFont) { return (run < rhs.run); } else { return (virtualFont < rhs.virtualFont); } } }; class TextLayoutCache { public: TextLayout* get(VirtualFont *virtualFont, const TextRun &run); void purge(); protected: std::map<TextLayoutKey, std::unique_ptr<TextLayout>> cache; };
/*- * Copyright (c) 2005 Scott Long * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE 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. * * $FreeBSD: soc2013/dpl/head/sys/mips/include/bus_dma.h 202218 2010-01-12 21:36:08Z imp $ */ #ifndef _MIPS_BUS_DMA_H_ #define _MIPS_BUS_DMA_H_ #include <sys/bus_dma.h> #endif /* _MIPS_BUS_DMA_H_ */
#include <stdint.h> #include "platform.h" #include "primitives.h" #include "internals.h" struct exp16_sig32 softfloat_normSubnormalF32Sig( uint_fast32_t sig ) { int shiftCount; struct exp16_sig32 z; shiftCount = softfloat_countLeadingZeros32( sig ) - 8; z.exp = 1 - shiftCount; z.sig = sig<<shiftCount; return z; }
#ifndef LUA_FONTSTYLE_H_ #define LUA_FONTSTYLE_H_ #include "Font.h" namespace gameplay { // Lua bindings for enum conversion functions for Font::Style. Font::Style lua_enumFromString_FontStyle(const char* s); const char* lua_stringFromEnum_FontStyle(Font::Style e); } #endif
// Copyright (c) 2014-2018 Bauhaus-Universitaet Weimar // This Software is distributed under the Modified BSD License, see license.txt. // // Virtual Reality and Visualization Research Group // Faculty of Media, Bauhaus-Universitaet Weimar // http://www.uni-weimar.de/medien/vr #ifndef TILE_PROVIDER_DELTAECALCULATOR_H #define TILE_PROVIDER_DELTAECALCULATOR_H //#define DELTA_E_CALCULATOR_LOG_PROGRESS #include <chrono> #include <iomanip> #include <iostream> #include <lamure/vt/common.h> #include <lamure/vt/pre/AtlasFile.h> #include <lamure/vt/pre/OffsetIndex.h> namespace vt { namespace pre { class VT_DLL DeltaECalculator : public AtlasFile { public: explicit DeltaECalculator(const char* fileName); void calculate(size_t maxMemory); }; } // namespace pre } // namespace vt #endif // TILE_PROVIDER_DELTAECALCULATOR_H
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_64b.c Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE805.label.xml Template File: sources-sink-64b.tmpl.c */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate using malloc() and set data pointer to a small buffer * GoodSource: Allocate using malloc() and set data pointer to a large buffer * Sinks: memmove * BadSink : Copy int array to data using memmove * Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files * * */ #include "std_testcase.h" #ifndef OMITBAD void CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int * * dataPtr = (int * *)dataVoidPtr; /* dereference dataPtr into data */ int * data = (*dataPtr); { int source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memmove(data, source, 100*sizeof(int)); printIntLine(data[0]); free(data); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE122_Heap_Based_Buffer_Overflow__c_CWE805_int_memmove_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int * * dataPtr = (int * *)dataVoidPtr; /* dereference dataPtr into data */ int * data = (*dataPtr); { int source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memmove(data, source, 100*sizeof(int)); printIntLine(data[0]); free(data); } } #endif /* OMITGOOD */
/*----------------------------------------------------------------------------*/ /* Copyright (c) FIRST 2008-2017. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ #pragma once /** @file * Contains global utility functions */ #include <stdint.h> #include <string> #include "llvm/StringRef.h" #define wpi_assert(condition) \ wpi_assert_impl(condition, #condition, "", __FILE__, __LINE__, __FUNCTION__) #define wpi_assertWithMessage(condition, message) \ wpi_assert_impl(condition, #condition, message, __FILE__, __LINE__, \ __FUNCTION__) #define wpi_assertEqual(a, b) \ wpi_assertEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__) #define wpi_assertEqualWithMessage(a, b, message) \ wpi_assertEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, __FUNCTION__) #define wpi_assertNotEqual(a, b) \ wpi_assertNotEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__) #define wpi_assertNotEqualWithMessage(a, b, message) \ wpi_assertNotEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, \ __FUNCTION__) bool wpi_assert_impl(bool conditionValue, llvm::StringRef conditionText, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName); bool wpi_assertEqual_impl(int valueA, int valueB, llvm::StringRef valueAString, llvm::StringRef valueBString, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName); bool wpi_assertNotEqual_impl(int valueA, int valueB, llvm::StringRef valueAString, llvm::StringRef valueBString, llvm::StringRef message, llvm::StringRef fileName, int lineNumber, llvm::StringRef funcName); void wpi_suspendOnAssertEnabled(bool enabled); namespace frc { int GetFPGAVersion(); int64_t GetFPGARevision(); uint64_t GetFPGATime(); bool GetUserButton(); std::string GetStackTrace(int offset); } // namespace frc