text
stringlengths
4
6.14k
/*************************************************************************** file : grscreen.h created : Thu May 15 22:11:19 CEST 2003 copyright : (C) 2003 by Eric Espié email : eric.espie@torcs.org version : $Id: grscreen.h 6436 2016-06-04 22:42:23Z beaglejoe $ ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _GRSCREEN_H_ #define _GRSCREEN_H_ #include <car.h> //tCarElt #include "grcam.h" //Cameras class cGrBoard; class cGrFrameInfo; class cGrScreen { protected: int id; tCarElt *curCar; // Current car viewed. tCarElt **cars; // List of cars. int curCamHead; // The current camera list. tGrCamHead cams[10]; // From F2 to F11. int subcamIndex[10]; // current subcam index (for each list) class cGrPerspCamera *curCam; // The current camera. class cGrCarCamMirror *mirrorCam; // The mirror camera. class cGrPerspCamera *dispCam; // The display camera. class cGrOrthoCamera *boardCam; // The board camera. class cGrBackgroundCam *bgCam; // The background camera. class cGrBoard *board; // The board. int drawCurrent; // Should the current car be drawn. int scrx, scry, scrw, scrh; float viewOffset; float viewRatio; int fakeWidth; int boardWidth; bool active; // Is the screen activated. bool selectNextFlag; bool selectPrevFlag; int mirrorFlag; void loadParams(tSituation *s); // Load from parameters files. void saveCamera(void); public: cGrScreen(int id); ~cGrScreen(); void activate(int x, int y, int w, int h, float v); inline void deactivate(void) { active = false; } inline void setZoom(const long zoom) { curCam->setZoom(zoom); } int isInScreen(int x, int y); void update(tSituation *s, const cGrFrameInfo* frameInfo); void camDraw(tSituation *s); void updateCurrent(tSituation *s); void selectCamera(long cam); void selectNthCamera(long cam, int nthCam); int getNthCamera(void); float getViewOffset(void) { return viewOffset; } void selectBoard(const long brd); void selectTrackMap(); void setCurrentCar(tCarElt *newCurCar); void initCams(tSituation *s); void initBoard(void); inline void selectNextCar(void) { selectNextFlag = true; } inline void selectPrevCar(void) { selectPrevFlag = true; } void switchMirror(void); inline tCarElt *getCurrentCar(void) { return curCar; } inline cGrCamera* getCurCamera(void) { return curCam; } inline float getViewRatio(void) { return viewRatio; } inline int getCurCamHead(void) { return curCamHead; } inline bool isActive(void) { return active; } inline int getId(void) { return id; } inline int getScrX (void) { return scrx; } inline int getScrY (void) { return scry; } inline int getScrW (void) { return scrw; } inline int getScrH (void) { return scrh; } inline int getBoardWidth(void) { return boardWidth; } }; #endif //_GRSCREEN_H_
/************************************************************************ * * Copyright 2011 Jonatan Liljedahl <lijon@kymatica.com> * * This file is part of SuperCollider Qt GUI. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * ************************************************************************/ #pragma once #include "../painting.h" #include "../debug.h" #include <QPrintDialog> #include <QPrinter> #include <QPainter> class QcPenPrinter : public QObject { Q_OBJECT Q_PROPERTY( QRect pageRect READ pageRect ); Q_PROPERTY( QRect paperRect READ paperRect ); Q_PROPERTY( int fromPage READ fromPage ); Q_PROPERTY( int toPage READ toPage ); public: QcPenPrinter(): dialog(0) {} ~QcPenPrinter() { delete dialog; } QRect pageRect() const { return printer.pageRect(); } QRect paperRect() const { return printer.paperRect(); } int fromPage() const { return printer.fromPage(); } int toPage() const { return printer.toPage(); } Q_SIGNALS: void dialogDone(int); void printFunc(); private Q_SLOTS: void show() { if( !dialog ) { dialog = new QPrintDialog(&printer); dialog->setWindowTitle( QStringLiteral("Print Document") ); dialog->setOptions ( QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintPageRange | QAbstractPrintDialog::PrintShowPageSize ); connect( dialog, SIGNAL(finished(int)), this, SIGNAL(dialogDone(int)) ); } if( dialog->isVisible() ) qcWarningMsg("WARNING: Print dialog already open."); else dialog->exec(); } void print() { QPainter painter; painter.begin(&printer); QtCollider::beginPainting(&painter); Q_EMIT ( printFunc() ); painter.end(); QtCollider::endPainting(); } void newPage() { printer.newPage(); } private: QPrinter printer; QPrintDialog *dialog; };
/* Capstone Disassembly Engine */ /* By Nguyen Anh Quynh, 2018 */ #include <string.h> #include <stddef.h> // offsetof macro // alternatively #include "../../utils.h" like everyone else #include "EVMDisassembler.h" #include "EVMMapping.h" static short opcodes[256] = { EVM_INS_STOP, EVM_INS_ADD, EVM_INS_MUL, EVM_INS_SUB, EVM_INS_DIV, EVM_INS_SDIV, EVM_INS_MOD, EVM_INS_SMOD, EVM_INS_ADDMOD, EVM_INS_MULMOD, EVM_INS_EXP, EVM_INS_SIGNEXTEND, -1, -1, -1, -1, EVM_INS_LT, EVM_INS_GT, EVM_INS_SLT, EVM_INS_SGT, EVM_INS_EQ, EVM_INS_ISZERO, EVM_INS_AND, EVM_INS_OR, EVM_INS_XOR, EVM_INS_NOT, EVM_INS_BYTE, -1, -1, -1, -1, -1, EVM_INS_SHA3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, EVM_INS_ADDRESS, EVM_INS_BALANCE, EVM_INS_ORIGIN, EVM_INS_CALLER, EVM_INS_CALLVALUE, EVM_INS_CALLDATALOAD, EVM_INS_CALLDATASIZE, EVM_INS_CALLDATACOPY, EVM_INS_CODESIZE, EVM_INS_CODECOPY, EVM_INS_GASPRICE, EVM_INS_EXTCODESIZE, EVM_INS_EXTCODECOPY, EVM_INS_RETURNDATASIZE, EVM_INS_RETURNDATACOPY, -1, EVM_INS_BLOCKHASH, EVM_INS_COINBASE, EVM_INS_TIMESTAMP, EVM_INS_NUMBER, EVM_INS_DIFFICULTY, EVM_INS_GASLIMIT, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, EVM_INS_POP, EVM_INS_MLOAD, EVM_INS_MSTORE, EVM_INS_MSTORE8, EVM_INS_SLOAD, EVM_INS_SSTORE, EVM_INS_JUMP, EVM_INS_JUMPI, EVM_INS_PC, EVM_INS_MSIZE, EVM_INS_GAS, EVM_INS_JUMPDEST, -1, -1, -1, -1, EVM_INS_PUSH1, EVM_INS_PUSH2, EVM_INS_PUSH3, EVM_INS_PUSH4, EVM_INS_PUSH5, EVM_INS_PUSH6, EVM_INS_PUSH7, EVM_INS_PUSH8, EVM_INS_PUSH9, EVM_INS_PUSH10, EVM_INS_PUSH11, EVM_INS_PUSH12, EVM_INS_PUSH13, EVM_INS_PUSH14, EVM_INS_PUSH15, EVM_INS_PUSH16, EVM_INS_PUSH17, EVM_INS_PUSH18, EVM_INS_PUSH19, EVM_INS_PUSH20, EVM_INS_PUSH21, EVM_INS_PUSH22, EVM_INS_PUSH23, EVM_INS_PUSH24, EVM_INS_PUSH25, EVM_INS_PUSH26, EVM_INS_PUSH27, EVM_INS_PUSH28, EVM_INS_PUSH29, EVM_INS_PUSH30, EVM_INS_PUSH31, EVM_INS_PUSH32, EVM_INS_DUP1, EVM_INS_DUP2, EVM_INS_DUP3, EVM_INS_DUP4, EVM_INS_DUP5, EVM_INS_DUP6, EVM_INS_DUP7, EVM_INS_DUP8, EVM_INS_DUP9, EVM_INS_DUP10, EVM_INS_DUP11, EVM_INS_DUP12, EVM_INS_DUP13, EVM_INS_DUP14, EVM_INS_DUP15, EVM_INS_DUP16, EVM_INS_SWAP1, EVM_INS_SWAP2, EVM_INS_SWAP3, EVM_INS_SWAP4, EVM_INS_SWAP5, EVM_INS_SWAP6, EVM_INS_SWAP7, EVM_INS_SWAP8, EVM_INS_SWAP9, EVM_INS_SWAP10, EVM_INS_SWAP11, EVM_INS_SWAP12, EVM_INS_SWAP13, EVM_INS_SWAP14, EVM_INS_SWAP15, EVM_INS_SWAP16, EVM_INS_LOG0, EVM_INS_LOG1, EVM_INS_LOG2, EVM_INS_LOG3, EVM_INS_LOG4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, EVM_INS_CREATE, EVM_INS_CALL, EVM_INS_CALLCODE, EVM_INS_RETURN, EVM_INS_DELEGATECALL, EVM_INS_CALLBLACKBOX, -1, -1, -1, -1, EVM_INS_STATICCALL, -1, -1, EVM_INS_REVERT, -1, EVM_INS_SUICIDE, }; bool EVM_getInstruction(csh ud, const uint8_t *code, size_t code_len, MCInst *MI, uint16_t *size, uint64_t address, void *inst_info) { unsigned char opcode; if (code_len == 0) return false; opcode = code[0]; if (opcodes[opcode] == -1) { // invalid opcode return false; } // valid opcode MI->address = address; MI->OpcodePub = MI->Opcode = opcode; if (opcode >= EVM_INS_PUSH1 && opcode <= EVM_INS_PUSH32) { unsigned char len = (opcode - EVM_INS_PUSH1 + 1); if (code_len < 1 + (size_t)len) { // not enough data return false; } *size = 1 + len; memcpy(MI->evm_data, code + 1, len); } else *size = 1; if (MI->flat_insn->detail) { memset(MI->flat_insn->detail, 0, offsetof(cs_detail, evm)+sizeof(cs_evm)); EVM_get_insn_id((cs_struct *)ud, MI->flat_insn, opcode); if (MI->flat_insn->detail->evm.pop) { MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_STACK_READ; MI->flat_insn->detail->groups_count++; } if (MI->flat_insn->detail->evm.push) { MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_STACK_WRITE; MI->flat_insn->detail->groups_count++; } // setup groups switch(opcode) { default: break; case EVM_INS_ADD: case EVM_INS_MUL: case EVM_INS_SUB: case EVM_INS_DIV: case EVM_INS_SDIV: case EVM_INS_MOD: case EVM_INS_SMOD: case EVM_INS_ADDMOD: case EVM_INS_MULMOD: case EVM_INS_EXP: case EVM_INS_SIGNEXTEND: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_MATH; MI->flat_insn->detail->groups_count++; break; case EVM_INS_MSTORE: case EVM_INS_MSTORE8: case EVM_INS_CALLDATACOPY: case EVM_INS_CODECOPY: case EVM_INS_EXTCODECOPY: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_MEM_WRITE; MI->flat_insn->detail->groups_count++; break; case EVM_INS_MLOAD: case EVM_INS_CREATE: case EVM_INS_CALL: case EVM_INS_CALLCODE: case EVM_INS_RETURN: case EVM_INS_DELEGATECALL: case EVM_INS_REVERT: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_MEM_READ; MI->flat_insn->detail->groups_count++; break; case EVM_INS_SSTORE: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_STORE_WRITE; MI->flat_insn->detail->groups_count++; break; case EVM_INS_SLOAD: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_STORE_READ; MI->flat_insn->detail->groups_count++; break; case EVM_INS_JUMP: case EVM_INS_JUMPI: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_JUMP; MI->flat_insn->detail->groups_count++; break; case EVM_INS_STOP: case EVM_INS_SUICIDE: MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_HALT; MI->flat_insn->detail->groups_count++; break; } } return true; }
/* This file is part of Darling. Copyright (C) 2017 Lubos Dolezel Darling 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. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface CITextImageGenerator : NSObject @end
#pragma once #include <map> #include <list> #include <string> /* This class allows for used memory to be tagged on a per-module basis Note: Currently, freeing memory for a given module can leave the heap fragmented. There is currently no defragmentation procedure in place, but one can be added later */ class TaggedHeap { private: /*Private variables*/ void* _heap; std::map<std::string, std::pair<void*, size_t>> _tags; // associate module tag with its share of memory std::map<std::string, void*> _nextFree; // address of the next free blocks in a tag's part of the heap size_t _usedSpace; size_t _capacity; public: TaggedHeap(void*, size_t); // Constructor for creating TaggedHeap bool CreateTag(std::string tag, size_t size); void* requestBlocks(std::string tag, size_t size, size_t num); // Request blocks from a specific tag bool clearTag(std::string tag); // Clear memory from a given tag void clearAll(); // Clear the entire heap size_t getCapacity(); // Get the capacity of the TaggedHeap void* getNextFree(const std::string &tag); size_t getSize(const std::string &tag); };
/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK_INTEGER = 258, TOK_NAME = 259, TOK_STRING = 260, TOK_LIT_CODE = 261, TOK_LBRACE = 262, TOK_RBRACE = 263, TOK_COLON = 264, TOK_SEMICOLON = 265, TOK_ARROW = 266, TOK_LPAREN = 267, TOK_RPAREN = 268, TOK_COMMA = 269, TOK_TERMINALS = 270, TOK_TOKEN = 271, TOK_NONTERM = 272, TOK_FUN = 273, TOK_VERBATIM = 274, TOK_IMPL_VERBATIM = 275, TOK_PRECEDENCE = 276, TOK_OPTION = 277, TOK_EXPECT = 278, TOK_CONTEXT_CLASS = 279, TOK_SUBSETS = 280, TOK_DELETE = 281, TOK_REPLACE = 282, TOK_FORBID_NEXT = 283, TOK_ERROR = 284 }; #endif /* Tokens. */ #define TOK_INTEGER 258 #define TOK_NAME 259 #define TOK_STRING 260 #define TOK_LIT_CODE 261 #define TOK_LBRACE 262 #define TOK_RBRACE 263 #define TOK_COLON 264 #define TOK_SEMICOLON 265 #define TOK_ARROW 266 #define TOK_LPAREN 267 #define TOK_RPAREN 268 #define TOK_COMMA 269 #define TOK_TERMINALS 270 #define TOK_TOKEN 271 #define TOK_NONTERM 272 #define TOK_FUN 273 #define TOK_VERBATIM 274 #define TOK_IMPL_VERBATIM 275 #define TOK_PRECEDENCE 276 #define TOK_OPTION 277 #define TOK_EXPECT 278 #define TOK_CONTEXT_CLASS 279 #define TOK_SUBSETS 280 #define TOK_DELETE 281 #define TOK_REPLACE 282 #define TOK_FORBID_NEXT 283 #define TOK_ERROR 284 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 105 "grampar.y" { int num; LocString *str; SourceLoc loc; ASTList<TopForm> *topFormList; TopForm *topForm; ASTList<TermDecl> *termDecls; TermDecl *termDecl; ASTList<TermType> *termTypes; TermType *termType; ASTList<PrecSpec> *precSpecs; ASTList<SpecFunc> *specFuncs; SpecFunc *specFunc; ASTList<LocString> *stringList; ASTList<ProdDecl> *prodDecls; ProdDecl *prodDecl; ASTList<RHSElt> *rhsList; RHSElt *rhsElt; } /* Line 1489 of yacc.c. */ #line 131 "grampar.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif
#include <stdlib.h> // for NULL #include <R_ext/Rdynload.h> /* FIXME: Check these declarations against the C/Fortran source code. */ /* .C calls */ extern void aggregation(void *, void *, void *, void *, void *, void *); static const R_CMethodDef CEntries[] = { {"aggregation", (DL_FUNC) &aggregation, 6}, {NULL, NULL, 0} }; void R_init_RSGHB(DllInfo *dll) { R_registerRoutines(dll, CEntries, NULL, NULL, NULL); R_useDynamicSymbols(dll, FALSE); }
/// @file AP_MotorsTri.h /// @brief Motor control class for Tricopters #pragma once #include <AP_Common/AP_Common.h> #include <AP_Math/AP_Math.h> // ArduPilot Mega Vector/Matrix math Library #include <SRV_Channel/SRV_Channel.h> #include "AP_MotorsMulticopter.h" // tail servo uses channel 7 #define AP_MOTORS_CH_TRI_YAW CH_7 #define AP_MOTORS_TRI_SERVO_RANGE_DEG_MIN 5 // minimum angle movement of tail servo in degrees #define AP_MOTORS_TRI_SERVO_RANGE_DEG_MAX 80 // maximum angle movement of tail servo in degrees /// @class AP_MotorsTri class AP_MotorsTri : public AP_MotorsMulticopter { public: /// Constructor AP_MotorsTri(uint16_t loop_rate, uint16_t speed_hz = AP_MOTORS_SPEED_DEFAULT) : AP_MotorsMulticopter(loop_rate, speed_hz) { }; // init void init(motor_frame_class frame_class, motor_frame_type frame_type); // set frame class (i.e. quad, hexa, heli) and type (i.e. x, plus) void set_frame_class_and_type(motor_frame_class frame_class, motor_frame_type frame_type); // set update rate to motors - a value in hertz void set_update_rate( uint16_t speed_hz ); // output_test_seq - spin a motor at the pwm value specified // motor_seq is the motor's sequence number from 1 to the number of motors on the frame // pwm value is an actual pwm value that will be output, normally in the range of 1000 ~ 2000 virtual void output_test_seq(uint8_t motor_seq, int16_t pwm) override; // output_to_motors - sends minimum values out to the motors virtual void output_to_motors(); // get_motor_mask - returns a bitmask of which outputs are being used for motors or servos (1 means being used) // this can be used to ensure other pwm outputs (i.e. for servos) do not conflict virtual uint16_t get_motor_mask(); // output a thrust to all motors that match a given motor // mask. This is used to control tiltrotor motors in forward // flight. Thrust is in the range 0 to 1 void output_motor_mask(float thrust, uint8_t mask) override; protected: // output - sends commands to the motors void output_armed_stabilizing(); // call vehicle supplied thrust compensation if set void thrust_compensation(void) override; // calc_yaw_radio_output - calculate final radio output for yaw channel int16_t calc_yaw_radio_output(float yaw_input, float yaw_input_max); // calculate radio output for yaw servo, typically in range of 1100-1900 // parameters SRV_Channel *_yaw_servo; // yaw output channel float _pivot_angle; // Angle of yaw pivot float _thrust_right; float _thrust_rear; float _thrust_left; };
/***************************************************************************/ /* */ /* cffparse.h */ /* */ /* CFF token stream parser (specification) */ /* */ /* Copyright 1996-2017 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef CFFPARSE_H_ #define CFFPARSE_H_ #include <ft2build.h> #include "cfftypes.h" #include FT_INTERNAL_OBJECTS_H FT_BEGIN_HEADER /* CFF uses constant parser stack size; */ /* CFF2 can increase from default 193 */ #define CFF_MAX_STACK_DEPTH 96 /* * There are plans to remove the `maxstack' operator in a forthcoming * revision of the CFF2 specification, increasing the (then static) stack * size to 513. By making the default stack size equal to the maximum * stack size, the operator is essentially disabled, which has the * desired effect in FreeType. */ #define CFF2_MAX_STACK 513 #define CFF2_DEFAULT_STACK 513 #define CFF_CODE_TOPDICT 0x1000 #define CFF_CODE_PRIVATE 0x2000 #define CFF2_CODE_TOPDICT 0x3000 #define CFF2_CODE_FONTDICT 0x4000 #define CFF2_CODE_PRIVATE 0x5000 typedef struct CFF_ParserRec_ { FT_Library library; FT_Byte* start; FT_Byte* limit; FT_Byte* cursor; FT_Byte** stack; FT_Byte** top; FT_UInt stackSize; /* allocated size */ FT_UInt object_code; void* object; FT_UShort num_designs; /* a copy of `CFF_FontRecDict->num_designs' */ FT_UShort num_axes; /* a copy of `CFF_FontRecDict->num_axes' */ } CFF_ParserRec, *CFF_Parser; FT_LOCAL( FT_Long ) cff_parse_num( CFF_Parser parser, FT_Byte** d ); FT_LOCAL( FT_Error ) cff_parser_init( CFF_Parser parser, FT_UInt code, void* object, FT_Library library, FT_UInt stackSize, FT_UShort num_designs, FT_UShort num_axes ); FT_LOCAL( void ) cff_parser_done( CFF_Parser parser ); FT_LOCAL( FT_Error ) cff_parser_run( CFF_Parser parser, FT_Byte* start, FT_Byte* limit ); enum { cff_kind_none = 0, cff_kind_num, cff_kind_fixed, cff_kind_fixed_thousand, cff_kind_string, cff_kind_bool, cff_kind_delta, cff_kind_callback, cff_kind_blend, cff_kind_max /* do not remove */ }; /* now generate handlers for the most simple fields */ typedef FT_Error (*CFF_Field_Reader)( CFF_Parser parser ); typedef struct CFF_Field_Handler_ { int kind; int code; FT_UInt offset; FT_Byte size; CFF_Field_Reader reader; FT_UInt array_max; FT_UInt count_offset; #ifdef FT_DEBUG_LEVEL_TRACE const char* id; #endif } CFF_Field_Handler; FT_END_HEADER #endif /* CFFPARSE_H_ */ /* END */
/* xoreos - A reimplementation of BioWare's Aurora engine * * xoreos is the legal property of its developers, whose names * can be found in the AUTHORS file distributed with this source * distribution. * * xoreos 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. * * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>. */ /** @file * Trigger in a Neverwinter Nights 2 area. */ #ifndef ENGINES_NWN2_TRIGGER_H #define ENGINES_NWN2_TRIGGER_H #include "src/engines/aurora/trigger.h" #include "src/engines/nwn2/object.h" #include "src/engines/nwn2/trap.h" namespace Engines { namespace NWN2 { class Trigger : public ::Engines::Trigger, public Object, public Trap { public: Trigger(const Aurora::GFF3Struct &gff); // .--- Object void show(); void hide(); void notifyNotSeen(); bool isVisible() const; // '--- /** Get the reputation of the trigger with the source. */ uint8_t getReputation(Object *source) const; /** Create a trap on the trigger. */ void createTrap(uint8_t trapType, uint32_t faction, const Common::UString &disarm, const Common::UString &triggered); protected: void load(const Aurora::GFF3Struct &gff); void loadBlueprint(const Aurora::GFF3Struct &gff); }; } // End of namespace NWN2 } // End of namespace Engines #endif // ENGINES_NWN2_TRIGGER_H
/* ============================================================================ Name : binary2shellcode.c Author : Hamza Megahed Version : 2.0 Copyright : Copyright 2012-2013 Hamza Megahed Description : Binary to Shellcode converter on Linux ============================================================================ */ /* ============================================================================ This file is part of binary2shellcode. binary2shellcode 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. binary2shellcode 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 binary2shellcode. If not, see <http://www.gnu.org/licenses/>. =========================================================================== */ /********************************* Headers *********************************/ #include <stdio.h> #include <stdlib.h> /*==========================================================================*/ int main(int argc, char *argv[]) { /********************************* Local Variables **************************/ char v[500] ; char v2[100]; FILE *ft; /*==========================================================================*/ /*check in there is no input file .. argc < 2*/ /*if no file input then exit normally */ /*clean screen*/ system("clear"); printf("\n"); printf("\t////////////////////////////////////////////////////\n"); printf("\t///////// Binary to Shellcode Converter ////////////\n"); printf("\t////////////////////////////////////////////////////\n"); printf("\n"); /* test if there is no input file */ if(argc == 1) { printf("Usage: %s InputBinaryFile\n", argv[0]); exit(0); } /*open file to test for exist*/ ft = fopen(argv[1], "r"); if (!ft) { printf("Unable to open file: %s\n", argv[1]); exit(-1); } fclose(ft); printf("\t\t\tBinary Name = %s\n", argv[1]); printf(" size in bytes = \n"); /*use sprintf to concat the command with argv[] and put all of it in v */ snprintf(v2,100, "size %s | grep '[0-9]' | cut -f4 ", argv[1]); snprintf (v,500, "objdump -D %s |grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-6 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\\\x/g'|paste -d '' -s", argv[1]); /* use system () to execute the command line inside v */ system(v2); printf("\n"); printf(" Shellcode = \n\n"); system(v); printf("\n"); /* Exit normally */ return EXIT_SUCCESS; }
#ifndef __JVX_NOISE_RECUCTION_TYPEDEFS_H__ #define __JVX_NOISE_RECUCTION_TYPEDEFS_H__ #include "jvx_noiseestimator.h" #include "jvx_fft_tools/jvx_fft_core.h" #include "jvx_fft_tools/jvx_fft_tools.h" #include "jvx_dataformats.h" typedef enum { JVX_NR_NOISE_WEIGHTING_RULE_TALKTHROUGH = 0, JVX_NR_NOISE_WEIGHTING_RULE_WIENER, JVX_NR_NOISE_WEIGHTING_RULE_MMSE_STSA, JVX_NR_NOISE_WEIGHTING_RULE_MMSE_LSA, JVX_NR_NOISE_WEIGHTING_RULE_MMSE_LAPLACE, JVX_NR_NOISE_WEIGHTING_RULE_SUPER_GAUSS_MAP, JVX_NR_NOISE_WEIGHTING_RULE_SUPER_GAUSS_JMAP } jvxNoiseReductionGainCalculationRule; typedef enum { JVX_NR_PARAMS_AS_ADDRESS_NR_PARAMETERS = 0x1, JVX_NR_PARAMS_AS_ADDRESS_MS_NE = 0x2, JVX_NR_PARAMS_AS_ADDRESS_MMSE_NE = 0x4, JVX_NR_PARAMS_AS_ADDRESS_SPP_NE = 0x8, JVX_NR_PARAMS_AS_ADDRESS_POLYNWN_NE = 0x10, JVX_NR_PARAMS_AS_ADDRESS_MUSIC_TONE_BLOCK = 0x20, JVX_NR_PARAMS_AS_ADDRESS_WEIGHTING_RULE = 0x40, } jvxNoiseReduction_address_as; typedef enum { JVX_NR_PARAMS_S_ADDRESS_ANALYSIS_FFT = 0x1, } jvxNoiseReduction_address_sy; typedef struct { jvxData alpha_c_min; jvxData alpha_c_const_0; jvxData alpha_c_const_1; jvxData alpha_min; jvxData alpha_max; } alpha_smooth_nestimator; typedef struct { jvxInt32 framesize; jvxInt32 buffersize; jvxInt32 fftsize; jvxInt32 samplerate; jvxDataFormat format; struct { jvxFftTools_fwkType fftFrameworkType; // Reference 1 jvxInt32 desiredNumFilterCoeffs; // No reference jvx_windowType desiredWindowType; // No reference } fft_processing; struct { jvxData lookback_window_sec; // Reference 16 jvxData startup_smooth; // Reference 17 jvxData stop_smooth; // Reference 18 jvxData update_at_once; // Reference 19 } minStatControl_init; struct { jvxData lookback_window_sec; // Reference 20 jvxData startup_alpha; // Reference 23 jvxData stop_alpha; // Reference 24 jvxData update_at_once; // Reference 25 } mmseControl_init; struct { jvxData ph1_mean; // Reference 26 } sppControl_init; jvx_polynWN_noiseEstimator_cfg_const polynWNControl_init; } jvxNoiseReductionParameters_init; typedef struct { jvx_noiseEstimator_types fftNoiseEstimatorType; // Reference 2 jvxBool use_second_fft_analysis; // Reference 3 jvxData alpha; // Reference 4 jvxData min_apriori_snr; // Reference 5 jvxData min_gain; // Reference 6 struct { jvxData smoothing_factor; // Reference 7 jvxData corridor_plus; // Reference 8 jvxData corridor_minus; // Reference 9 jvxBool is_active; // Reference 10 } block_musical_tones; jvxNoiseReductionGainCalculationRule weighting_rule; // Reference 11 jvxBool employ_antialias_weight_processing; // Reference 12 jvxBool auto_aliasing; // Reference 13 //jvxData smoothingFactor_energyInput; //jvxData smoothingFactor_energyOutput; //jvxBool gainControlActive; //jvxData gainControl_maxGain; struct { jvxData over_estimation_factor; // Reference 29 jvxData beta_min; // Reference 35 jvxData beta_max; // Reference 36 jvxData av; // Reference 37 alpha_smooth_nestimator alpha_smooth; // Reference 30- Reference 34 } minStatControl_runtime; struct { jvxData alpha; // Reference 38 jvxData gmin; // Reference 39 //alpha_smooth_nestimator alpha_smooth; // Reference 40 - Reference 44 } mmseControl_runtime; struct { jvxData alpha_ph1_mean; // Reference 45 jvxData alpha_psd; // Reference 46 jvxData q; // Reference 47 jvxData xopt_db; // Reference 48 //alpha_smooth_nestimator alpha_smooth; // Reference 49 - Reference 53 } sppControl_runtime; jvx_polynWN_noiseEstimator_cfg_async polynWNControl_runtime; } jvxNoiseReductionParameters_runtime_async; typedef struct { struct { jvxInt32 percentAnalysisWinFftSize; // Reference 15 jvx_windowType wintype; // Reference 14 } fft_analysis; struct { jvxInt32 numGains; } readOnly; // jvxInt32 neAnalysisSize; } jvxNoiseReductionParameters_runtime_sync; #endif
/* * This file is part of the Yices SMT Solver. * Copyright (C) 2017 SRI International. * * Yices 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. * * Yices 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 Yices. If not, see <http://www.gnu.org/licenses/>. */ /* * SETS OF UNSIGNED INTEGERS REPRESENTED AS BITVECTORS */ #ifndef __INT_BV_SETS_H #define __INT_BV_SETS_H #include <stdint.h> #include <stdbool.h> #include "utils/bitvectors.h" /* * Structure: * - data = bitvector * - size = number of bits in mask * - nbits = number of meaningful bits (i.e. initialized) */ typedef struct int_bvset_s { byte_t *data; uint32_t size; uint32_t nbits; } int_bvset_t; // default and maximal size #define DEF_INT_BVSET_SIZE 1024 #define MAX_INT_BVSET_SIZE UINT32_MAX /* * Initialize set: * - n = initial size. If n == 0, the default size is used. * - the set is initially empty */ extern void init_int_bvset(int_bvset_t *set, uint32_t n); /* * Delete set: release memory */ extern void delete_int_bvset(int_bvset_t *set); /* * Empty the set */ static inline void reset_int_bvset(int_bvset_t *set) { set->nbits = 0; } /* * Check whether the set is empty (has been reset) */ static inline bool int_bvset_is_empty(int_bvset_t *set) { return set->nbits == 0; } /* * Check whether x belongs to set */ static inline bool int_bvset_member(int_bvset_t *set, uint32_t x) { return x < set->nbits && tst_bit(set->data, x); } /* * Check whether x belongs to set and if not add x to the set * - return true if x was absent * - return false if x was present in set (then set does not change) */ extern bool int_bvset_add_check(int_bvset_t *set, uint32_t x); /* * Add x to the set */ extern void int_bvset_add(int_bvset_t *set, uint32_t x); /* * Remove x from the set */ extern void int_bvset_remove(int_bvset_t *sat, uint32_t x); #endif /* __INT_BV_SETS_H */
// Copyright (C) 2009 Andre Massing // // This file is part of DOLFIN. // // DOLFIN 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. // // DOLFIN 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 DOLFIN. If not, see <http://www.gnu.org/licenses/>. // // First added: 2009-09-11 // Last changed: 2011-11-10 #ifndef CGAL_POINT_3_POINT_3_INTERSECTION_H #define CGAL_POINT_3_POINT_3_INTERSECTION_H #include <CGAL/Point_3.h> #include <CGAL/Object.h> #include <iostream> /// @file This file contains some small extension to the CGAL library, /// for instance unifying their do_intersect functions to also deal /// with Point_3 and Primitive intersections or some additional /// intersection collision test. CGAL_BEGIN_NAMESPACE #if CGAL_VERSION_NR < 1030601000 namespace CGALi { #else namespace internal { #endif template <class K > inline bool do_intersect(const typename K::Point_3 & pt1, const typename K::Point_3 & pt2, const K & k) { return pt1 == pt2; } template <class K> Object intersection(const typename K::Point_3 &pt1, const typename K::Point_3 &pt2) { if (pt1 == pt2) { return make_object(pt1); } return Object(); } }// namespace CGALi template <class K> inline bool do_intersect(const Point_3<K> &pt1, const Point_3<K> &pt2) { typedef typename K::Do_intersect_3 Do_intersect; return Do_intersect()(pt1, pt2); } template <class K> inline Object intersection(const Point_3<K> &pt1, const Point_3<K> &pt2) { typedef typename K::Intersect_3 Intersect; return Intersect()(pt1, pt2); } CGAL_END_NAMESPACE #endif
/* This file is part of Darling. Copyright (C) 2017 Lubos Dolezel Darling 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. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface AVAudioMixSweepFilterEffectParametersInternal : NSObject @end
// // srecord - manipulate eprom load files // Copyright (C) 2001, 2002, 2005-2008, 2010 Peter Miller // // This program 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. // // 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 Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see // <http://www.gnu.org/licenses/>. // #ifndef SRECORD_INPUT_FILTER_NOT_H #define SRECORD_INPUT_FILTER_NOT_H #include <srecord/input/filter.h> namespace srecord { /** * The srecord::input_filter_not class is used to represent an input stream * which bit-wise NOTs the data. */ class input_filter_not: public input_filter { public: /** * The destructor. */ virtual ~input_filter_not(); private: /** * The constructor. * * @param deeper * The input source to be filtered. */ input_filter_not(const input::pointer &deeper); public: /** * The create class method is used to create new dynamically * allocated instances of this class. * * @param deeper * The incoming data source */ static pointer create(const input::pointer &deeper); protected: // See base class for documentation. bool read(record &record); private: /** * The default constructor. Do not use. */ input_filter_not(); /** * The copy constructor. Do not use. */ input_filter_not(const input_filter_not &); /** * The assignment operator. Do not use. */ input_filter_not &operator=(const input_filter_not &); }; }; #endif // SRECORD_INPUT_FILTER_NOT_H
/* This file is part of Darling. Copyright (C) 2019 Lubos Dolezel Darling 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. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface EKUndoSliceOutcome : NSObject @end
extern uint32_t (*call_x86_thiscall_0)(void*); extern uint32_t (*call_x86_thiscall_1)(void*, uint32_t); extern uint32_t (*call_x86_thiscall_2)(void*, uint32_t, uint32_t); extern uint32_t (*call_x86_thiscall_3)(void*, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_thiscall_4)(void*, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_thiscall_5)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_thiscall_6)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_cdecl_0)(void*); extern uint32_t (*call_x86_cdecl_1)(void*, uint32_t); extern uint32_t (*call_x86_cdecl_2)(void*, uint32_t, uint32_t); extern uint32_t (*call_x86_cdecl_3)(void*, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_cdecl_4)(void*, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_cdecl_5)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_cdecl_6)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_stdcall_0)(void*); extern uint32_t (*call_x86_stdcall_1)(void*, uint32_t); extern uint32_t (*call_x86_stdcall_2)(void*, uint32_t, uint32_t); extern uint32_t (*call_x86_stdcall_3)(void*, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_stdcall_4)(void*, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_stdcall_5)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*call_x86_stdcall_6)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); extern uint32_t (*_run_with_stack)(void*, void (*f)());
/* * This file is part of Cleanflight, Betaflight and INAV. * * 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/. * * Alternatively, the contents of this file may be used under the terms * of the GNU General Public License Version 3, as described below: * * This file is free software: you may copy, redistribute 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 file 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/. * * Copyright: INAVFLIGHT OU */ #pragma once bool baro2SMPB02BDetect(baroDev_t *baro);
/* Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG */ #if !defined(AFX_OPTSPROXYPAGE_H__52021EB8_498D_4587_9FBA_320F205EB035__INCLUDED_) #define AFX_OPTSPROXYPAGE_H__52021EB8_498D_4587_9FBA_320F205EB035__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif class COptsProxyPage : public CPropertyPage { DECLARE_DYNCREATE(COptsProxyPage) public: COptsProxyPage(); ~COptsProxyPage(); //{{AFX_DATA(COptsProxyPage) enum { IDD = IDD_OPTS_PROXY }; //}}AFX_DATA //{{AFX_VIRTUAL(COptsProxyPage) public: virtual BOOL OnApply(); protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL protected: BOOL CrackProxyName(LPCSTR pszName, CString &strName, USHORT &uPort); void UpdateEnabled(); void ApplyLanguage(); //{{AFX_MSG(COptsProxyPage) virtual BOOL OnInitDialog(); afx_msg void OnAuthorization(); afx_msg void OnGetfromie(); afx_msg void OnManually(); afx_msg void OnDontuseproxy(); afx_msg void OnChangeProxyname(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} #endif
/* vim: set expandtab ts=4 sw=4: */ /* * You may redistribute this program 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 NDPHeader_H #define NDPHeader_H #include "util/Assert.h" #include "util/Endian.h" #include <stdint.h> struct NDPHeader_NeighborAdvert { uint8_t oneThirtyFive; uint8_t zero; uint16_t checksum; uint8_t bits; uint8_t reserved[3]; uint8_t targetAddr[16]; }; #define NDPHeader_NeighborAdvert_SIZE 24 Assert_compileTime(sizeof(struct NDPHeader_NeighborAdvert) == NDPHeader_NeighborAdvert_SIZE); #define NDPHeader_NeighborAdvert_bits_ROUTER (1<<7) #define NDPHeader_NeighborAdvert_bits_SOLICITED (1<<6) #define NDPHeader_NeighborAdvert_bits_OVERRIDE (1<<5) struct NDPHeader_NeighborAdvert_MacOpt { uint8_t two; // type uint8_t one; // length in 8 byte increments uint8_t mac[6]; }; #endif
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include "diffeditor_global.h" #include <coreplugin/diffservice.h> #include <extensionsystem/iplugin.h> namespace DiffEditor { namespace Internal { class DiffEditorServiceImpl : public QObject, public Core::DiffService { Q_OBJECT Q_INTERFACES(Core::DiffService) public: DiffEditorServiceImpl(); void diffFiles(const QString &leftFileName, const QString &rightFileName) override; void diffModifiedFiles(const QStringList &fileNames) override; }; class DiffEditorPlugin final : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "DiffEditor.json") public: ~DiffEditorPlugin() final; bool initialize(const QStringList &arguments, QString *errorMessage) final; private: class DiffEditorPluginPrivate *d = nullptr; #ifdef WITH_TESTS private slots: void testMakePatch_data(); void testMakePatch(); void testReadPatch_data(); void testReadPatch(); void testFilterPatch_data(); void testFilterPatch(); #endif // WITH_TESTS }; } // namespace Internal } // namespace DiffEditor
/* * Copyright (C) 2013 Nivis LLC. * Email: opensource@nivis.com * Website: http://www.nivis.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * Redistribution and use in source and binary forms must retain this * copyright notice. * 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 ROUTEENGINE_H_ #define ROUTEENGINE_H_ #include "Common/NETypes.h" #include "Model/Routing/RouteTypes.h" #include "Model/Operations/OperationsProcessor.h" #include "Routing/Algorithms/DoubleExitMultiSinkGraphRouting.h" #include "Routing/Algorithms/OutboundAlgorithm.h" #include "Routing/Algorithms/EvaluateInboundGraphAfterRemoveDevice.h" namespace NE { namespace Model { class RouteEngine { LOG_DEF("I.M.RouteEngine"); private: /** * This is the graph that will be called to optimize an existing route. */ NE::Model::Routing::AlgorithmPointer graphRoutingInboundAlgorithm; NE::Model::Routing::AlgorithmPointer graphRoutingAlgorithmRemoveDevices; NE::Model::Routing::AlgorithmPointer graphRoutingOutboundAlgorithm; public: RouteEngine(); virtual ~RouteEngine(); void periodicEvaluateInboundGraph( Subnet::PTR subnet, GraphPointer & inBoundGraph, Address32 destination, DoubleExitEdges &usedEdges, DoubleExitEdges &notUsedEdges); void periodicEvaluateOutBoundGraph( Subnet::PTR subnet, GraphPointer & outBoundGraph, Address32 destination, DoubleExitEdges &usedEdges, DoubleExitEdges &notUsedEdges); void reverseEdge( Subnet::PTR subnet, OutboundGraphMap &outboundGraph, const DoubleExitEdges &usedEdgesInBound, Address16 destination); void createOutboundGraph(Subnet::PTR subnet, OutboundGraphMap &outboundGraph, DoubleExitEdges &usedEdges, Address16 source, Address16 destination); void recursiveReverseBackupPath(DoubleExitEdges &usedEdges, const DoubleExitEdges &usedEdgesInBound, Address16 destination); void recursiveReversePreferedPath(DoubleExitEdges &usedEdges, const DoubleExitEdges &usedEdgesInBound, Address16 destination); void detectNotUsedEdges(Subnet::PTR subnet, const DoubleExitEdges & edgesFromGraph, const DoubleExitEdges & usedEdges, DoubleExitEdges &notUsedEdges); void selectPaths(Subnet::PTR subnet, DoubleExitEdges &usedEdges, Address16 src, Address16 dst); void filterUsedEdges(Subnet::PTR subnet, DoubleExitEdges &usedEdges); }; } } #endif /* ROUTEENGINE_H_ */
/* * state_error.c * * Created: 29/01/2014 21:10:25 * Author: Xevel */ #include "state_error.h" #include <Hardware_lib/led.h> #include <Hardware_lib/motor.h> #include <Hardware_lib/sensor_board.h> #include "states.h" #include "../error.h" void state_error_init(){ led_set(255, 5, 5); // pink motor_set(0); if (0){ // TODO if sensor board has been init sensor_board_heater_on(false); } // flush input buffer while (usb_serial_get_nb_received()){ usb_serial_get_byte(); } } void state_error_play(){ if(usb_serial_get_nb_received()){ uint8_t c = usb_serial_get_byte(); fprintf( &USBSerialStream, "ERR int:%u, ERR post:%u\r\n", error_internal(), error_post() ); // These commands are there to make troubleshooting easier, but are not advertised anywhere to the user. switch (c){ case 'i': // clear internal error error_set_internal(INTERNAL_ERROR_NO_ERROR); break; case 'p': // clear post error error_set_post(POST_ERROR_NO_ERROR); break; case 'r': // Return to normal state state_set_next(&main_fsm, &state_normal); break; default: break; } } } void state_error_end(){ //Nobody ever gets out ! (at least not normally) } //*********************************************************** // Helpers //***********************************************************
/* * Copyright (c) 2008-2010 Lu, Chao-Ming (Tetralet). All rights reserved. * * This file is part of LilyTerm. * * LilyTerm 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. * * LilyTerm 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 LilyTerm. If not, see <http://www.gnu.org/licenses/>. */ #include <gtk/gtk.h> #include <vte/vte.h> // for L10n #include <locale.h> #include <glib/gi18n.h> // for exit() #include <stdlib.h> // for strcmp() #include <string.h> // for chdir() #include <unistd.h> // for opendir() readdir() closedir() #include <dirent.h> // for getpwuid() #include <pwd.h> // for g_chdir() #include <glib/gstdio.h> #include "lilyterm.h" #ifdef USE_XPARSEGEOMETRY // for XParseGeometry() #include <X11/Xlib.h> #endif gboolean window_option(struct Window *win_data, gchar *encoding, int argc, char *argv[]); char **set_process_data (pid_t entry_pid, gint *ppid, StrAddr **cmd); gboolean window_key_press(GtkWidget *widget, GdkEventKey *event, struct Window *win_data); void window_style_set(GtkWidget *window, GtkStyle *previous_style, struct Window *win_data); void window_size_request(GtkWidget *window, GtkRequisition *requisition, struct Window *win_data); void window_size_allocate(GtkWidget *window, GtkAllocation *allocation, struct Window *win_data); gboolean window_get_focus(GtkWidget *window, GdkEventFocus *event, struct Window *win_data); gboolean window_lost_focus(GtkWidget *window, GdkEventFocus *event, struct Window *win_data); #ifdef ENABLE_PAGE_ADDED void notebook_page_added(GtkNotebook *notebook, GtkWidget *child, guint page_num, struct Window *win_data); #endif // void notebook_page_removed (GtkNotebook *notebook, GtkWidget *child, guint page_num, struct Window *win_data); void reorder_page_after_added_removed_page(struct Window *win_data, guint page_num); void destroy_window(struct Window *win_data); GtkNotebook *create_window(GtkNotebook *notebook, GtkWidget *page, gint x, gint y, struct Window *win_data); gboolean window_state_event(GtkWidget *widget, GdkEventWindowState *event, struct Window *win_data); #ifdef FATAL void dump_data(struct Window *win_data, struct Page *page_data); void print_color(gchar *name, GdkColor *color); #endif void win_data_dup(struct Window *win_data_orig, struct Window *win_data); gboolean fullscreen_show_hide_scroll_bar (struct Window *win_data);
#ifndef C_MOM_DISTRIB_C12_Ben_H #define C_MOM_DISTRIB_C12_Ben_H #include "GConstants.h" #include "CLorentzDistrib.h" #include "dirs.h" //O. Benhar //Momentum distribution normalized to 1 at interval [0:800 MeV/c] // notation: k = momentum in fm^-1 // p = momentum in MeV class CMomDistrib_C12_Ben: public CMomDistrib { public: CMomDistrib_C12_Ben() :m_pRes(42), m_pStep(20.0), m_coeff( 1.0/(4.0*pi/fermi3) ), m_lorCenterV(147.0), m_lorHalfWidth(90.0), m_lorCoeff(0.0418) { m_Distrib = new double[m_pRes]; m_lorentz = new CLorentzDistrib(m_lorCenterV, m_lorHalfWidth); std::ifstream inputFile; open_data_file(inputFile,"sf/C12_Ben.dat" ); if (inputFile.fail()) { std::cerr<<"Indispensable file 'C12_Ben.dat' not found"<<std::endl; exit(25); } double p(0), val(0.0); for (int iCnt(0); iCnt<m_pRes; ++iCnt) { inputFile>>p>>val; m_Distrib[iCnt] = val*(4*pi); } }; double Tot(const double p) const; double MF(const double p) const; double Corr(const double p) const; double TotMean()const {return 168.241 ;} double generate() const; private: const int m_pRes; const double m_pStep; const double m_coeff; mutable double* m_Distrib; const double m_lorCenterV; const double m_lorHalfWidth; const double m_lorCoeff; const CLorentzDistrib *m_lorentz; }; double CMomDistrib_C12_Ben::Tot(const double p) const { //p = m_pStep*(np-0.5) + pR if ( p >= 790.0 ) return m_coeff*0.0405*exp(-0.285*p*p*fermi2); const int np( static_cast<int>((p+0.5*m_pStep)/m_pStep) ); const double pR( p-m_pStep*(np-0.5) ); const double c0( m_Distrib[np] ); const double c1( m_Distrib[np+1] ); double f( (c1 - c0)*pR/m_pStep + c0 ); return m_coeff*f; } double CMomDistrib_C12_Ben::MF(const double p) const { //av momentum 168.241 MeV/c const double k2(p*p*fermi2); if ( p <= 330.0 ) return Tot(p) - m_coeff*( 0.426*exp(-1.6*k2) + 0.04968*exp(-0.305*k2) ); return 0.0; } double CMomDistrib_C12_Ben::Corr(const double p) const { //Corr part is 21.8045% of normalization for protons and neutrons const double k2(p*p*fermi2); if ( p <= 330.0 ) return m_coeff*( 0.426*exp(-1.6*k2) + 0.04968*exp(-0.305*k2) ); return Tot(p); } double CMomDistrib_C12_Ben::generate() const { while (true) { const double p( m_lorentz->generate() ); if ( p<0.0 || p>800.0 ) continue; if ( frandom()*m_lorCoeff*m_lorentz->eval(p) < p*p*Tot(p) ) return p; } return 0.0; } #endif
/* Cuckoo Sandbox - Automated Malware Analysis. Copyright (C) 2010-2015 Cuckoo Foundation. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <windows.h> #include "hooking.h" #include "pipe.h" #include "log.h" #include "misc.h" #define UNHOOK_MAXCOUNT 2048 #define UNHOOK_BUFSIZE 256 typedef struct _region_t { uint32_t region_length; const uint8_t *region_address; uint8_t region_original[UNHOOK_BUFSIZE]; uint8_t region_modified[UNHOOK_BUFSIZE]; char funcname[64]; uint32_t region_reported; } region_t; static HANDLE g_unhook_thread_handle, g_watcher_thread_handle, g_main_thread; static uint32_t g_region_index, g_unhook_exited, g_unhook_enabled; static region_t g_regions[UNHOOK_MAXCOUNT]; void unhook_detect_add_region(const char *funcname, const uint8_t *addr, const uint8_t *original, const uint8_t *modified, uint32_t length) { if(g_region_index == UNHOOK_MAXCOUNT) { pipe("CRITICAL:Reached maximum number of unhook detection entries!"); return; } region_t *r = &g_regions[g_region_index]; r->region_length = length; r->region_address = addr; if(funcname != NULL) { strcpy(r->funcname, funcname); } memcpy(r->region_original, original, MIN(length, UNHOOK_BUFSIZE)); memcpy(r->region_modified, modified, MIN(length, UNHOOK_BUFSIZE)); g_region_index++; } void unhook_detect_remove_dead_regions() { uint32_t outidx = 0; for (uint32_t idx = 0; idx < g_region_index; idx++) { region_t *r = &g_regions[idx]; // Remove the region by ignoring it. if(page_is_readable(r->region_address) == 0) { continue; } memcpy(&g_regions[outidx++], r, sizeof(region_t)); } g_region_index = outidx; } static DWORD WINAPI _unhook_detect_thread(LPVOID param) { (void) param; static int watcher_first = 1; while (g_main_thread == NULL || WaitForSingleObject(g_main_thread, 10) == WAIT_TIMEOUT) { if(WaitForSingleObject(g_watcher_thread_handle, 500) != WAIT_TIMEOUT) { if(watcher_first != 0) { if(is_shutting_down() == 0) { log_anomaly("unhook", NULL, "Unhook watcher thread has been corrupted!"); } watcher_first = 0; } Sleep(100); } if(g_unhook_enabled == 0) continue; for (uint32_t idx = 0; idx < g_region_index; idx++) { region_t *r = &g_regions[idx]; // Check whether this memory region still equals what we made it. if(memcmp(r->region_address, r->region_modified, r->region_length) == 0) { continue; } // By default we assume the hook has been modified. const char *msg = "Function hook was modified!"; // If the memory region matches the original contents, then it // has been restored to its original state. if(memcmp(r->region_address, r->region_original, r->region_length) == 0) { msg = "Function was unhooked/restored!"; } if(r->region_reported == 0) { if(is_shutting_down() == 0) { log_anomaly("unhook", r->funcname, msg); } r->region_reported = 1; } } } g_unhook_exited = 1; return 0; } static DWORD WINAPI _unhook_watch_thread(LPVOID param) { (void) param; while (WaitForSingleObject(g_unhook_thread_handle, 1000) == WAIT_TIMEOUT); if(g_unhook_exited == 0 && is_shutting_down() == 0) { log_anomaly("unhook", NULL, "Unhook detection thread has been corrupted!"); } return 0; } int unhook_init_detection(int first_process) { g_unhook_exited = 0; g_unhook_enabled = 1; // TODO Note that this only works with the QueueUserAPC injection method // as CreateRemoteThread creates a new thread. In the case of // CreateRemoteThread this could be solved through a global variable that // gets initialized by the first real thread. // TODO What about processes that are injected after they've already been // started? (In the case malware injects into another process). if(first_process != 0) { DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_main_thread, 0, FALSE, DUPLICATE_SAME_ACCESS); } g_unhook_thread_handle = CreateThread(NULL, 0, &_unhook_detect_thread, NULL, 0, NULL); g_watcher_thread_handle = CreateThread(NULL, 0, &_unhook_watch_thread, NULL, 0, NULL); if(g_unhook_thread_handle != NULL && g_watcher_thread_handle != NULL) { return 0; } pipe("CRITICAL:Error initializing unhook detection threads!"); return -1; } void unhook_detect_disable() { g_unhook_enabled = 0; } void unhook_detect_enable() { g_unhook_enabled = 1; }
// obtainable.h #ifndef ObtainABLE_H_ #define ObtainABLE_H_ #include "entity.h" #include "collider_interface.h" namespace nan2 { class Obtainable : public Entity, public ColliderInterface { private: const static Vector2 SIZE_; Entity* content_; public: Obtainable(World* world, Entity* content, const Vector2& position); ~Obtainable(); Entity* content(); virtual const AABB collider() const; }; } #endif
/* * Copyright 2014 benaryorg (benaryorg@benaryos.org) * * This file is part of benaryOS. * * benaryOS 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. * * benaryOS 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 benaryOS. If not, see <http://www.gnu.org/licenses/>. * */ #include <constants.h> extern void *pmm_alloc_block(void); extern uint32_t pid_get(void); void task_create_cpu(struct cpu_state *dst,void *entry) { struct cpu_state cpu= { .eax=0, .ebx=0, .ecx=0, .edx=0, .esi=0, .edi=0, .ebp=0, .esp=0, .eip=(uint32_t)entry, .cs=0, .ss=0, .eflags=0x202, }; *dst=cpu; } struct task *task_create_kernel(void *entry) { struct task *task=(struct task *)pmm_alloc_block(); task->pid=pid_get(); char *stack=(char *)pmm_alloc_block(); struct cpu_state *state=(struct cpu_state *)(stack+4096-sizeof(struct cpu_state)); task_create_cpu(state,entry); state->cs=0x08; task->cpu=state; return task; } struct task *task_create_user(void *entry) { struct task *task=(struct task *)pmm_alloc_block(); task->pid=pid_get(); char *stack=(char *)pmm_alloc_block(); struct cpu_state *state=(struct cpu_state *)(stack+4096-sizeof(struct cpu_state)); task_create_cpu(state,entry); state->cs=0x18|0x03; state->ss=0x20|0x03; state->esp=(uint32_t)(((char *)pmm_alloc_block())+4096); task->cpu=state; return task; }
/* Generated automatically. DO NOT EDIT! */ #define SIMD_HEADER "simd-generic128.h" #include "../common/t1buv_10.c"
// // // Description: This file is part of FET // // // Author: Lalescu Liviu <Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)> // Copyright (C) 2003 Liviu Lalescu <http://lalescu.ro/liviu/> // /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef SUBJECTSFORM_H #define SUBJECTSFORM_H #include "ui_subjectsform_template.h" class SubjectsForm : public QDialog, Ui::SubjectsForm_template { Q_OBJECT public: SubjectsForm(QWidget* parent); ~SubjectsForm(); public slots: void addSubject(); void removeSubject(); void renameSubject(); void moveSubjectUp(); void moveSubjectDown(); void sortSubjects(); void subjectChanged(int index); void activateSubject(); void deactivateSubject(); void comments(); }; #endif
#pragma once #include <cstdint> #include "augs/window_framework/event.h" augs::event::keys::key translate_glfw_key(int); augs::event::keys::key translate_glfw_mouse_key(int);
/* randsurf.c */ int randsurf(char *, int, int, int);
/* * yafdb-validate - Yafdb validation tool * * Copyright (c) 2014-2015 FOXEL SA - http://foxel.ch * Please read <http://foxel.ch/license> for more information. * * * Author(s): * * Kevin Velickovic <k.velickovic@foxel.ch> * * * This file is part of the FOXEL project <http://foxel.ch>. * * 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/>. * * * Additional Terms: * * You are required to preserve legal notices and author attributions in * that material or in the Appropriate Legal Notices displayed by works * containing it. * * You are required to attribute the work as explained in the "Usage and * Attribution" section of <http://foxel.ch/license>. */ #ifndef UTILS_H #define UTILS_H /* Includes */ #include <QImage> #include <QThread> #include <opencv/cv.h> #include <opencv/highgui.h> #include <inter-all.h> #include <gnomonic-all.h> #include "objectrect.h" /* Image info structure */ struct image_info_struct{ QImage* image; int width; int height; int channels; }; /* Function to convert an OpenCV IplImage into a QImage */ QImage* IplImage2QImage(IplImage *iplImg); /* Function to export an object to disk */ void exportRect(ObjectRect* rect, image_info_struct image_info, QString destination, float zoom_level = 1.5); /* Function to clamp a specified value */ float clamp(float x, float a, float b); /* Function to clamp a specified radian value */ float clampRad(float x, float a, float b); #endif // UTILS_H
/* Copyright 2002-2013 CEA LIST This file is part of LIMA. LIMA 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. LIMA 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 LIMA. If not, see <http://www.gnu.org/licenses/> */ /************************************************************************ * * @file NormalizationUtils.h * @author Besancon Romaric (romaric.besancon@cea.fr) * @date Tue Jun 13 2006 * copyright Copyright (C) 2006-2012 by CEA LIST * Project s2lp * * @brief helper functions for normalization actions * * ***********************************************************************/ #ifndef NORMALIZATIONUTILS_H #define NORMALIZATIONUTILS_H #include "SpecificEntitiesExport.h" #include "linguisticProcessing/core/LinguisticAnalysisStructure/AnalysisGraph.h" namespace Lima { namespace LinguisticProcessing { LIMA_SPECIFICENTITIES_EXPORT bool testMicroCategory(const std::set<LinguisticCode>* micros, const Common::PropertyCode::PropertyAccessor* microAccessor, const LinguisticCode properties); LIMA_SPECIFICENTITIES_EXPORT bool testMicroCategory(const std::set<LinguisticCode>* micros, const Common::PropertyCode::PropertyAccessor* microAccessor, const LinguisticAnalysisStructure::MorphoSyntacticData* data); // test if numeric form (tstatus=t_integer) LIMA_SPECIFICENTITIES_EXPORT bool isInteger(LinguisticAnalysisStructure::Token* token); } // end namespace } // end namespace #endif
#pragma once #include "../Packet.h" class RemoveEntityPacket : public Packet { public: virtual ~RemoveEntityPacket(); virtual int getId() const; virtual void write(RakNet::BitStream *) const; virtual void read(RakNet::BitStream *); virtual void handle(const RakNet::RakNetGUID &, NetEventCallback *) const; };
// // BmobIMAudioMessage.h // BmobIMSDK // // Created by Bmob on 16/1/30. // Copyright © 2016年 bmob. All rights reserved. // #import "BmobIMFileMessage.h" @interface BmobIMAudioMessage : BmobIMFileMessage @property (readonly, nonatomic) NSTimeInterval duration; /** * 创建音频消息 * * @param url 音频文件的url * @param attributes 用户自定义的属性 * * @return 图片信息 */ +(instancetype)messageWithUrl:(NSString *)url attributes:(NSDictionary *)attributes; @end
/* Copyright (C) 2011 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 "fmpz.h" #include "fmpz_poly.h" #include "nmod_poly.h" #include "ulong_extras.h" int main(void) { int i; FLINT_TEST_INIT(state); flint_printf("get/set_nmod_poly...."); fflush(stdout); for (i = 0; i < 1000 * flint_test_multiplier(); i++) { fmpz_poly_t A; nmod_poly_t M, M2; slong length; mp_limb_t mod; length = n_randint(state, 50); mod = n_randtest_prime(state, 0); nmod_poly_init(M, mod); nmod_poly_init(M2, mod); fmpz_poly_init(A); nmod_poly_randtest(M, state, length); if (i % 2 == 0) fmpz_poly_set_nmod_poly(A, M); else fmpz_poly_set_nmod_poly_unsigned(A, M); fmpz_poly_scalar_mul_ui(A, A, UWORD(2)); nmod_poly_add(M, M, M); fmpz_poly_get_nmod_poly(M2, A); if (!nmod_poly_equal(M, M2)) { flint_printf("FAIL!\n"); abort(); } fmpz_poly_clear(A); nmod_poly_clear(M); nmod_poly_clear(M2); } FLINT_TEST_CLEANUP(state); flint_printf("PASS\n"); return 0; }
/*** This file is part of catta. catta 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. catta 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 catta; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ***/ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <assert.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <catta/domain.h> #include <catta/defs.h> #include <catta/malloc.h> #include <catta/log.h> #include "../src/dns.h" #include "../src/util.h" int main(CATTA_GCC_UNUSED int argc, CATTA_GCC_UNUSED char *argv[]) { char t[CATTA_DOMAIN_NAME_MAX], *m; const char *a, *b, *c, *d; CattaDnsPacket *p; CattaRecord *r, *r2; uint8_t rdata[CATTA_DNS_RDATA_MAX]; size_t l; p = catta_dns_packet_new(0); assert(catta_dns_packet_append_name(p, a = "Ahello.hello.hello.de.")); assert(catta_dns_packet_append_name(p, b = "Bthis is a test.hello.de.")); assert(catta_dns_packet_append_name(p, c = "Cthis\\.is\\.a\\.test\\.with\\.dots.hello.de.")); assert(catta_dns_packet_append_name(p, d = "Dthis\\\\is another test.hello.de.")); catta_hexdump(CATTA_DNS_PACKET_DATA(p), p->size); assert(catta_dns_packet_consume_name(p, t, sizeof(t)) == 0); catta_log_debug(">%s<", t); assert(catta_domain_equal(a, t)); assert(catta_dns_packet_consume_name(p, t, sizeof(t)) == 0); catta_log_debug(">%s<", t); assert(catta_domain_equal(b, t)); assert(catta_dns_packet_consume_name(p, t, sizeof(t)) == 0); catta_log_debug(">%s<", t); assert(catta_domain_equal(c, t)); assert(catta_dns_packet_consume_name(p, t, sizeof(t)) == 0); catta_log_debug(">%s<", t); assert(catta_domain_equal(d, t)); catta_dns_packet_free(p); /* RDATA PARSING AND SERIALIZATION */ /* Create an CattaRecord with some usful data */ r = catta_record_new_full("foobar.local", CATTA_DNS_CLASS_IN, CATTA_DNS_TYPE_HINFO, CATTA_DEFAULT_TTL); assert(r); r->data.hinfo.cpu = catta_strdup("FOO"); r->data.hinfo.os = catta_strdup("BAR"); /* Serialize it into a blob */ assert((l = catta_rdata_serialize(r, rdata, sizeof(rdata))) != (size_t) -1); /* Print it */ catta_hexdump(rdata, l); /* Create a new record and fill in the data from the blob */ r2 = catta_record_new(r->key, CATTA_DEFAULT_TTL); assert(r2); assert(catta_rdata_parse(r2, rdata, l) >= 0); /* Compare both versions */ assert(catta_record_equal_no_ttl(r, r2)); /* Free the records */ catta_record_unref(r); catta_record_unref(r2); r = catta_record_new_full("foobar", 77, 77, CATTA_DEFAULT_TTL); assert(r); assert(r->data.generic.data = catta_memdup("HALLO", r->data.generic.size = 5)); m = catta_record_to_string(r); assert(m); catta_log_debug(">%s<", m); catta_free(m); catta_record_unref(r); return 0; }
/* Teem: Tools to process and visualize scientific data and images . Copyright (C) 2013, 2012, 2011, 2010, 2009 University of Chicago Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library 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. The terms of redistributing and/or modifying this software also include exceptions to the LGPL that facilitate static linking. 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 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "unrrdu.h" #include "privateUnrrdu.h" #define INFO "Print out min and max values in one or more nrrds" static const char *_unrrdu_minmaxInfoL = (INFO ". Unlike other commands, this doesn't produce a nrrd. It only " "prints to standard out the min and max values found in the input nrrd(s), " "and it also indicates if there are non-existent values.\n " "* Uses nrrdRangeNewSet"); int unrrdu_minmaxDoit(const char *me, char *inS, int blind8BitRange, FILE *fout) { Nrrd *nrrd; NrrdRange *range; airArray *mop; mop = airMopNew(); airMopAdd(mop, nrrd=nrrdNew(), (airMopper)nrrdNuke, airMopAlways); if (nrrdLoad(nrrd, inS, NULL)) { biffMovef(me, NRRD, "%s: trouble loading \"%s\"", me, inS); airMopError(mop); return 1; } range = nrrdRangeNewSet(nrrd, blind8BitRange); airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); airSinglePrintf(fout, NULL, "min: %.17g\n", range->min); airSinglePrintf(fout, NULL, "max: %.17g\n", range->max); if (range->min == range->max) { if (0 == range->min) { fprintf(fout, "# min == max == 0.0 exactly\n"); } else { fprintf(fout, "# min == max\n"); } } if (range->hasNonExist) { fprintf(fout, "# has non-existent values\n"); } airMopOkay(mop); return 0; } int unrrdu_minmaxMain(int argc, const char **argv, const char *me, hestParm *hparm) { hestOpt *opt = NULL; char *err, **inS; airArray *mop; int pret, blind8BitRange; unsigned int ni, ninLen; #define B8DEF "false" mop = airMopNew(); hestOptAdd(&opt, "blind8", "bool", airTypeBool, 1, 1, &blind8BitRange, B8DEF, /* NOTE: not using nrrdStateBlind8BitRange here for consistency with previous behavior */ "whether to blindly assert the range of 8-bit data, " "without actually going through the data values, i.e. " "uchar is always [0,255], signed char is [-128,127]. " "Note that even if you do not use this option, the default " "(" B8DEF ") is potentialy over-riding the effect of " "environment variable NRRD_STATE_BLIND_8_BIT_RANGE; " "see \"unu env\""); hestOptAdd(&opt, NULL, "nin1", airTypeString, 1, -1, &inS, NULL, "input nrrd(s)", &ninLen); airMopAdd(mop, opt, (airMopper)hestOptFree, airMopAlways); USAGE(_unrrdu_minmaxInfoL); PARSE(); airMopAdd(mop, opt, (airMopper)hestParseFree, airMopAlways); for (ni=0; ni<ninLen; ni++) { if (ninLen > 1) { fprintf(stdout, "==> %s <==\n", inS[ni]); } if (unrrdu_minmaxDoit(me, inS[ni], blind8BitRange, stdout)) { airMopAdd(mop, err = biffGetDone(me), airFree, airMopAlways); fprintf(stderr, "%s: trouble with \"%s\":\n%s", me, inS[ni], err); /* continue working on the remaining files */ } if (ninLen > 1 && ni < ninLen-1) { fprintf(stdout, "\n"); } } airMopOkay(mop); return 0; } UNRRDU_CMD(minmax, INFO);
/* Copyright (C) 2013 Fredrik Johansson This file is part of Arb. Arb 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 "acb_poly.h" ARB_DLL extern slong acb_poly_newton_exp_cutoff; int main() { slong iter; flint_rand_t state; flint_printf("exp_series...."); fflush(stdout); flint_randinit(state); for (iter = 0; iter < 10000 * arb_test_multiplier(); iter++) { slong m, n, bits1, bits2, bits3; acb_poly_t a, b, c, d; bits1 = 2 + n_randint(state, 100); bits2 = 2 + n_randint(state, 100); bits3 = 2 + n_randint(state, 100); if (iter > 1000) { acb_poly_newton_exp_cutoff = 5 + n_randint(state, 50); } if (n_randint(state, 100) == 0) { m = 1 + n_randint(state, 100); n = 1 + n_randint(state, 100); } else { m = 1 + n_randint(state, 20); n = 1 + n_randint(state, 20); } acb_poly_init(a); acb_poly_init(b); acb_poly_init(c); acb_poly_init(d); acb_poly_randtest(a, state, m, bits1, 5); acb_poly_randtest(b, state, m, bits1, 5); acb_poly_randtest(c, state, 1 + n_randint(state, 300), bits1, 10); acb_poly_randtest(d, state, 1 + n_randint(state, 300), bits1, 10); /* check exp(a+b) = exp(a) exp(b) */ acb_poly_exp_series(c, a, n, bits2); acb_poly_exp_series(d, b, n, bits2); acb_poly_mullow(c, c, d, n, bits2); acb_poly_add(d, a, b, bits3); acb_poly_exp_series(d, d, n, bits3); /* also aliasing test */ if (!acb_poly_overlaps(c, d)) { flint_printf("FAIL\n\n"); flint_printf("a = "); acb_poly_printd(a, 15); flint_printf("\n\n"); flint_printf("b = "); acb_poly_printd(b, 15); flint_printf("\n\n"); flint_printf("c = "); acb_poly_printd(c, 15); flint_printf("\n\n"); flint_printf("d = "); acb_poly_printd(d, 15); flint_printf("\n\n"); flint_abort(); } acb_poly_clear(a); acb_poly_clear(b); acb_poly_clear(c); acb_poly_clear(d); } flint_randclear(state); flint_cleanup(); flint_printf("PASS\n"); return EXIT_SUCCESS; }
// IFC SDK : IFC2X3 C++ Early Classes // Copyright (C) 2009 CSTB // // 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. // The full license is in Licence.txt file included with this // distribution or is available at : // http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html // // 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. #ifndef IFC2X3_IFCRIGHTCIRCULARCONE_H #define IFC2X3_IFCRIGHTCIRCULARCONE_H #include <ifc2x3/DefinedTypes.h> #include <ifc2x3/Export.h> #include <ifc2x3/IfcCsgPrimitive3D.h> #include <Step/BaseVisitor.h> #include <Step/ClassType.h> #include <Step/SPFData.h> #include <string> namespace ifc2x3 { class CopyOp; /** * Generated class for the IfcRightCircularCone Entity. * */ class IFC2X3_EXPORT IfcRightCircularCone : public IfcCsgPrimitive3D { public: /** * Accepts a read/write Step::BaseVisitor. * * @param visitor the read/write Step::BaseVisitor to accept */ virtual bool acceptVisitor(Step::BaseVisitor *visitor); /** * Returns the class type as a human readable std::string. * */ virtual const std::string &type() const; /** * Returns the Step::ClassType of this specific class. Useful to compare with the isOfType method for example. * */ static const Step::ClassType &getClassType(); /** * Returns the Step::ClassType of the instance of this class. (might be a subtype since it is virtual and overloaded). * */ virtual const Step::ClassType &getType() const; /** * Compares this instance's Step::ClassType with the one passed as parameter. Checks the type recursively (to the mother classes). * * @param t */ virtual bool isOfType(const Step::ClassType &t) const; /** * Gets the value of the explicit attribute 'Height'. * */ virtual IfcPositiveLengthMeasure getHeight(); /** * (const) Returns the value of the explicit attribute 'Height'. * * @return the value of the explicit attribute 'Height' */ virtual const IfcPositiveLengthMeasure getHeight() const; /** * Sets the value of the explicit attribute 'Height'. * * @param value */ virtual void setHeight(IfcPositiveLengthMeasure value); /** * unset the attribute 'Height'. * */ virtual void unsetHeight(); /** * Test if the attribute 'Height' is set. * * @return true if set, false if unset */ virtual bool testHeight() const; /** * Gets the value of the explicit attribute 'BottomRadius'. * */ virtual IfcPositiveLengthMeasure getBottomRadius(); /** * (const) Returns the value of the explicit attribute 'BottomRadius'. * * @return the value of the explicit attribute 'BottomRadius' */ virtual const IfcPositiveLengthMeasure getBottomRadius() const; /** * Sets the value of the explicit attribute 'BottomRadius'. * * @param value */ virtual void setBottomRadius(IfcPositiveLengthMeasure value); /** * unset the attribute 'BottomRadius'. * */ virtual void unsetBottomRadius(); /** * Test if the attribute 'BottomRadius' is set. * * @return true if set, false if unset */ virtual bool testBottomRadius() const; friend class ExpressDataSet; protected: /** * @param id * @param args */ IfcRightCircularCone(Step::Id id, Step::SPFData *args); virtual ~IfcRightCircularCone(); /** */ virtual bool init(); /** * @param obj * @param copyop */ virtual void copy(const IfcRightCircularCone &obj, const CopyOp &copyop); private: /** */ static Step::ClassType s_type; /** */ Step::Real m_height; /** */ Step::Real m_bottomRadius; }; } #endif // IFC2X3_IFCRIGHTCIRCULARCONE_H
/* Copyright (C) 2018 Daniel Schultz 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 <https://www.gnu.org/licenses/>. */ #include "mpoly.h" /* shift_right (resp. left) divides (resp. multiplies) A in place by x^amount, where x is the variable of index var. No reallocation on Abits is performed: The shift right version asserts that the division was exact, and the shift left version tries to assert that the result fits in the same number of bits. */ void _mpoly_gen_shift_right(ulong * Aexp, flint_bitcnt_t Abits, slong Alength, slong var, ulong amount, const mpoly_ctx_t mctx) { slong i, N; ulong *one; #if FLINT_WANT_ASSERT ulong mask; #endif TMP_INIT; FLINT_ASSERT(Abits <= FLINT_BITS); #if FLINT_WANT_ASSERT mask = 0; for (i = 0; i < FLINT_BITS/Abits; i++) mask = (mask << Abits) + (UWORD(1) << (Abits - 1)); #endif TMP_START; N = mpoly_words_per_exp(Abits, mctx); one = (ulong *) TMP_ALLOC(N*sizeof(ulong)); mpoly_gen_monomial_sp(one, var, Abits, mctx); for (i = 0; i < Alength; i++) { mpoly_monomial_msub(Aexp + N*i, Aexp + N*i, amount, one, N); FLINT_ASSERT(!mpoly_monomial_overflows(Aexp + N*i, N, mask)); } TMP_END; } void _mpoly_gen_shift_right_fmpz( ulong * Aexp, flint_bitcnt_t Abits, slong Alength, slong var, const fmpz_t amount, const mpoly_ctx_t mctx) { slong i, N; ulong * gen; TMP_INIT; FLINT_ASSERT(fmpz_sgn(amount) >= 0); if (fmpz_is_zero(amount)) return; TMP_START; N = mpoly_words_per_exp(Abits, mctx); gen = (ulong *) TMP_ALLOC(N*sizeof(ulong)); if (Abits > FLINT_BITS) { mpoly_gen_monomial_offset_mp(gen, var, Abits, mctx); mpoly_monomial_mul_fmpz(gen, gen, N, amount); for (i = 0; i < Alength; i++) mpoly_monomial_sub_mp(Aexp + N*i, Aexp + N*i, gen, N); } else { mpoly_gen_monomial_sp(gen, var, Abits, mctx); FLINT_ASSERT(fmpz_abs_fits_ui(amount)); mpoly_monomial_mul_ui(gen, gen, N, fmpz_get_ui(amount)); for (i = 0; i < Alength; i++) mpoly_monomial_sub(Aexp + N*i, Aexp + N*i, gen, N); } TMP_END; } void _mpoly_gen_shift_left(ulong * Aexp, flint_bitcnt_t Abits, slong Alength, slong var, ulong amount, const mpoly_ctx_t mctx) { slong i, N; ulong *one; #if FLINT_WANT_ASSERT ulong mask; #endif TMP_INIT; FLINT_ASSERT(Abits <= FLINT_BITS); #if FLINT_WANT_ASSERT mask = 0; for (i = 0; i < FLINT_BITS/Abits; i++) mask = (mask << Abits) + (UWORD(1) << (Abits - 1)); #endif TMP_START; N = mpoly_words_per_exp(Abits, mctx); one = (ulong *) TMP_ALLOC(N*sizeof(ulong)); mpoly_gen_monomial_sp(one, var, Abits, mctx); for (i = 0; i < Alength; i++) { mpoly_monomial_madd(Aexp + N*i, Aexp + N*i, amount, one, N); FLINT_ASSERT(!mpoly_monomial_overflows(Aexp + N*i, N, mask)); } TMP_END; }
// IFC SDK : IFC2X3 C++ Early Classes // Copyright (C) 2009 CSTB // // 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. // The full license is in Licence.txt file included with this // distribution or is available at : // http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html // // 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. #ifndef IFC2X3_IFCCONIC_H #define IFC2X3_IFCCONIC_H #include <ifc2x3/DefinedTypes.h> #include <ifc2x3/Export.h> #include <ifc2x3/IfcCurve.h> #include <Step/BaseVisitor.h> #include <Step/ClassType.h> #include <Step/Referenced.h> #include <Step/SPFData.h> #include <string> namespace ifc2x3 { class CopyOp; class IfcAxis2Placement; /** * Generated class for the IfcConic Entity. * */ class IFC2X3_EXPORT IfcConic : public IfcCurve { public: /** * Accepts a read/write Step::BaseVisitor. * * @param visitor the read/write Step::BaseVisitor to accept */ virtual bool acceptVisitor(Step::BaseVisitor *visitor); /** * Returns the class type as a human readable std::string. * */ virtual const std::string &type() const; /** * Returns the Step::ClassType of this specific class. Useful to compare with the isOfType method for example. * */ static const Step::ClassType &getClassType(); /** * Returns the Step::ClassType of the instance of this class. (might be a subtype since it is virtual and overloaded). * */ virtual const Step::ClassType &getType() const; /** * Compares this instance's Step::ClassType with the one passed as parameter. Checks the type recursively (to the mother classes). * * @param t */ virtual bool isOfType(const Step::ClassType &t) const; /** * Gets the value of the explicit attribute 'Position'. * */ virtual IfcAxis2Placement *getPosition(); /** * (const) Returns the value of the explicit attribute 'Position'. * * @return the value of the explicit attribute 'Position' */ virtual const IfcAxis2Placement *getPosition() const; /** * Sets the value of the explicit attribute 'Position'. * * @param value */ virtual void setPosition(const Step::RefPtr< IfcAxis2Placement > &value); /** * unset the attribute 'Position'. * */ virtual void unsetPosition(); /** * Test if the attribute 'Position' is set. * * @return true if set, false if unset */ virtual bool testPosition() const; friend class ExpressDataSet; protected: /** * @param id * @param args */ IfcConic(Step::Id id, Step::SPFData *args); virtual ~IfcConic(); /** */ virtual bool init(); /** * @param obj * @param copyop */ virtual void copy(const IfcConic &obj, const CopyOp &copyop); private: /** */ static Step::ClassType s_type; /** */ Step::RefPtr< IfcAxis2Placement > m_position; }; } #endif // IFC2X3_IFCCONIC_H
/* * gst_factory_model.h * * Created on: Aug 13, 2015 * Author: loganek */ #ifndef SRC_GST_DEBUGGER_MODELS_GST_FACTORY_MODEL_H_ #define SRC_GST_DEBUGGER_MODELS_GST_FACTORY_MODEL_H_ #include <gstreamermm.h> #include <vector> #include <map> class FactoryModel { std::string name; std::vector<Glib::RefPtr<Gst::PadTemplate>> pad_templates; std::map<std::string, std::string> meta; public: FactoryModel(const std::string &factory_name) : name (factory_name) {} void append_template(const Glib::RefPtr<Gst::PadTemplate> &tpl); void append_meta(const std::string &key, const std::string &value) { meta[key] = value; } std::string get_name() const { return name; } std::vector<Glib::RefPtr<Gst::PadTemplate>> get_pad_templates() const { return pad_templates; } std::map<std::string, std::string> get_metadata() const { return meta; } }; #endif /* SRC_GST_DEBUGGER_MODELS_GST_FACTORY_MODEL_H_ */
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** 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. ** **************************************************************************/ #ifndef CPPCLASSESFILTER_H #define CPPCLASSESFILTER_H #include <cpplocatorfilter.h> namespace CppTools { namespace Internal { class CppClassesFilter : public CppLocatorFilter { Q_OBJECT public: CppClassesFilter(CppModelManager *manager); ~CppClassesFilter(); QString displayName() const { return tr("Classes"); } QString id() const { return QLatin1String("Classes"); } Priority priority() const { return Medium; } }; } // namespace Internal } // namespace CppTools #endif // CPPCLASSESFILTER_H
/* Copyright (C) 2013 Mike Hansen 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 <https://www.gnu.org/licenses/>. */ #ifdef T #include "templates.h" int TEMPLATE(T, is_invertible_f)(TEMPLATE(T, t) rop, const TEMPLATE(T, t) op, const TEMPLATE(T, ctx_t) ctx) { TEMPLATE(T, t) inv; TEMPLATE(T, init)(inv, ctx); TEMPLATE(T, gcdinv)(rop, inv, op, ctx); TEMPLATE(T, clear)(inv, ctx); return TEMPLATE(T, is_one)(rop, ctx); } #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Mobility Components. ** ** $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 QVIDEORENDERERCONTROL_H #define QVIDEORENDERERCONTROL_H #include "qmediacontrol.h" QT_BEGIN_NAMESPACE class QAbstractVideoSurface; QT_END_NAMESPACE QT_BEGIN_NAMESPACE class Q_MULTIMEDIA_EXPORT QVideoRendererControl : public QMediaControl { Q_OBJECT public: ~QVideoRendererControl(); virtual QAbstractVideoSurface *surface() const = 0; virtual void setSurface(QAbstractVideoSurface *surface) = 0; protected: QVideoRendererControl(QObject *parent = 0); }; #define QVideoRendererControl_iid "com.nokia.Qt.QVideoRendererControl/1.0" Q_MEDIA_DECLARE_CONTROL(QVideoRendererControl, QVideoRendererControl_iid) QT_END_NAMESPACE #endif // QVIDEORENDERERCONTROL_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 Designer 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 QMAINWINDOW_CONTAINER_H #define QMAINWINDOW_CONTAINER_H #include <QtDesigner/QDesignerContainerExtension> #include <QtDesigner/QExtensionFactory> #include <extensionfactory_p.h> #include <QtGui/QMainWindow> QT_BEGIN_NAMESPACE namespace qdesigner_internal { class QMainWindowContainer: public QObject, public QDesignerContainerExtension { Q_OBJECT Q_INTERFACES(QDesignerContainerExtension) public: explicit QMainWindowContainer(QMainWindow *widget, QObject *parent = 0); virtual int count() const; virtual QWidget *widget(int index) const; virtual int currentIndex() const; virtual void setCurrentIndex(int index); virtual void addWidget(QWidget *widget); virtual void insertWidget(int index, QWidget *widget); virtual void remove(int index); private: QMainWindow *m_mainWindow; QList<QWidget*> m_widgets; }; typedef ExtensionFactory<QDesignerContainerExtension, QMainWindow, QMainWindowContainer> QMainWindowContainerFactory; } // namespace qdesigner_internal QT_END_NAMESPACE #endif // QMAINWINDOW_CONTAINER_H
/* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef RenderBoxModelObject_h #define RenderBoxModelObject_h #include "RenderObject.h" namespace WebCore { // Values for vertical alignment. const int PositionTop = -0x7fffffff; const int PositionBottom = 0x7fffffff; const int PositionUndefined = 0x80000000; // This class is the base for all objects that adhere to the CSS box model as described // at http://www.w3.org/TR/CSS21/box.html class RenderBoxModelObject : public RenderObject { public: RenderBoxModelObject(Node*); virtual ~RenderBoxModelObject(); virtual void destroy(); int relativePositionOffsetX() const; int relativePositionOffsetY() const; IntSize relativePositionOffset() const { return IntSize(relativePositionOffsetX(), relativePositionOffsetY()); } // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow) // to return the remaining width on a given line (and the height of a single line). virtual int offsetLeft() const; virtual int offsetTop() const; virtual int offsetWidth() const = 0; virtual int offsetHeight() const = 0; virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateBoxModelInfoFromStyle(); bool hasSelfPaintingLayer() const; RenderLayer* layer() const { return m_layer; } virtual bool requiresLayer() const { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasMask() || hasReflection(); } // This will work on inlines to return the bounding box of all of the lines' border boxes. virtual IntRect borderBoundingBox() const = 0; // Virtual since table cells override virtual int paddingTop(bool includeIntrinsicPadding = true) const; virtual int paddingBottom(bool includeIntrinsicPadding = true) const; virtual int paddingLeft(bool includeIntrinsicPadding = true) const; virtual int paddingRight(bool includeIntrinsicPadding = true) const; virtual int borderTop() const { return style()->borderTopWidth(); } virtual int borderBottom() const { return style()->borderBottomWidth(); } virtual int borderLeft() const { return style()->borderLeftWidth(); } virtual int borderRight() const { return style()->borderRightWidth(); } virtual int marginTop() const = 0; virtual int marginBottom() const = 0; virtual int marginLeft() const = 0; virtual int marginRight() const = 0; bool hasHorizontalBordersPaddingOrMargin() const { return hasHorizontalBordersOrPadding() || marginLeft() != 0 || marginRight() != 0; } bool hasHorizontalBordersOrPadding() const { return borderLeft() != 0 || borderRight() != 0 || paddingLeft() != 0 || paddingRight() != 0; } virtual int containingBlockWidthForContent() const; virtual void childBecameNonInline(RenderObject* /*child*/) { } void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true); bool paintNinePieceImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool begin = true, bool end = true); void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, InlineFlowBox* = 0, CompositeOperator = CompositeSourceOver); // The difference between this inline's baseline position and the line's baseline position. int verticalPosition(bool firstLine) const; // Called by RenderObject::destroy() (and RenderWidget::destroy()) and is the only way layers should ever be destroyed void destroyLayer(); protected: void calculateBackgroundImageGeometry(const FillLayer*, int tx, int ty, int w, int h, IntRect& destRect, IntPoint& phase, IntSize& tileSize); private: virtual bool isBoxModelObject() const { return true; } IntSize calculateFillTileSize(const FillLayer*, IntSize scaledSize) const; friend class RenderView; RenderLayer* m_layer; // Used to store state between styleWillChange and styleDidChange static bool s_wasFloating; static bool s_hadLayer; static bool s_layerWasSelfPainting; }; inline RenderBoxModelObject* toRenderBoxModelObject(RenderObject* object) { ASSERT(!object || object->isBoxModelObject()); return static_cast<RenderBoxModelObject*>(object); } inline const RenderBoxModelObject* toRenderBoxModelObject(const RenderObject* object) { ASSERT(!object || object->isBoxModelObject()); return static_cast<const RenderBoxModelObject*>(object); } // This will catch anyone doing an unnecessary cast. void toRenderBoxModelObject(const RenderBoxModelObject*); } // namespace WebCore #endif // RenderBoxModelObject_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 QtGui 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 QUNDOVIEW_H #define QUNDOVIEW_H #include <QtGui/qlistview.h> #include <QtCore/qstring.h> #ifndef QT_NO_UNDOVIEW QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QUndoViewPrivate; class QUndoStack; class QUndoGroup; class QIcon; QT_MODULE(Gui) class Q_GUI_EXPORT QUndoView : public QListView { Q_OBJECT Q_DECLARE_PRIVATE(QUndoView) Q_PROPERTY(QString emptyLabel READ emptyLabel WRITE setEmptyLabel) Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon) public: explicit QUndoView(QWidget *parent = 0); explicit QUndoView(QUndoStack *stack, QWidget *parent = 0); #ifndef QT_NO_UNDOGROUP explicit QUndoView(QUndoGroup *group, QWidget *parent = 0); #endif ~QUndoView(); QUndoStack *stack() const; #ifndef QT_NO_UNDOGROUP QUndoGroup *group() const; #endif void setEmptyLabel(const QString &label); QString emptyLabel() const; void setCleanIcon(const QIcon &icon); QIcon cleanIcon() const; public Q_SLOTS: void setStack(QUndoStack *stack); #ifndef QT_NO_UNDOGROUP void setGroup(QUndoGroup *group); #endif private: Q_DISABLE_COPY(QUndoView) }; QT_END_NAMESPACE QT_END_HEADER #endif // QT_NO_UNDOVIEW #endif // QUNDOVIEW_H
/* radare - LGPL - Copyright 2014-2017 - inisider */ #include <string.h> #include <r_util.h> #include <r_core.h> #include "pdb_downloader.h" static bool checkPrograms () { #if __WINDOWS__ && !__CYGWIN__ const char nul[] = "nul"; if (r_sys_cmd ("expand -? >nul") != 0) { return false; } #else const char nul[] = "/dev/null"; if (r_sys_cmd ("cabextract -v > /dev/null") != 0) { return false; } #endif if (r_sys_cmdf ("curl --version > %s", nul) != 0) { return false; } return true; } static int download(struct SPDBDownloader *pd) { SPDBDownloaderOpt *opt = pd->opt; char *curl_cmd = NULL; char *extractor_cmd = NULL; char *abspath_to_archive = NULL; char *archive_name = NULL; const char *basepath = "."; int res = 1, archive_name_len = 0; if (!opt->dbg_file || !*opt->dbg_file) { // no pdb debug file return 0; } if (!checkPrograms ()) { return 0; } // dbg_file len is > 0 archive_name_len = strlen (opt->dbg_file); archive_name = malloc (archive_name_len+1); if (!archive_name) { return 0; } memcpy (archive_name, opt->dbg_file, archive_name_len+1); archive_name[archive_name_len - 1] = '_'; if (opt->path && *opt->path) { basepath = opt->path; } abspath_to_archive = r_str_newf ("%s%s%s", basepath, R_SYS_DIR, archive_name); curl_cmd = r_str_newf ("curl -sA \"%s\" \"%s/%s/%s/%s\" -o \"%s\"", opt->user_agent, opt->symbol_server, opt->dbg_file, opt->guid, archive_name, abspath_to_archive); // eprintf ("%s\n", curl_cmd); #if __WINDOWS__ && !__CYGWIN__ const char *cabextractor = "expand"; const char *format = "%s %s %s"; char *abspath_to_file = strdup (abspath_to_archive); if (abspath_to_file) { int abspath_to_archive_len = archive_name_len + strlen (basepath) + 2; abspath_to_file[abspath_to_archive_len - 2] = 'b'; // extact_cmd -> %1 %2 %3 // %1 - 'expand' // %2 - absolute path to archive // %3 - absolute path to file that will be dearchive extractor_cmd = r_str_newf (format, cabextractor, abspath_to_archive, abspath_to_file); } #else const char *cabextractor = "cabextract"; const char *format = "%s -d \"%s\" \"%s\""; // cabextract -d %1 %2 // %1 - path to directory where to extract all files from cab arhcive // %2 - absolute path to cab archive extractor_cmd = r_str_newf (format, cabextractor, basepath, abspath_to_archive); #endif if (r_sys_cmd (curl_cmd) != 0) { eprintf("curl has not been finish with success\n"); res = 0; } if (opt->extract > 0) { if (res && (r_sys_cmd (extractor_cmd) != 0)) { eprintf ("cab extrach has not been finished with success\n"); res = 0; } r_file_rm (abspath_to_archive); } R_FREE (archive_name); R_FREE (curl_cmd); R_FREE (extractor_cmd); R_FREE (abspath_to_archive); return res; } void init_pdb_downloader(SPDBDownloaderOpt *opt, SPDBDownloader *pd) { pd->opt = R_NEW0 (SPDBDownloaderOpt); if (!pd->opt) { return; } pd->opt->dbg_file = strdup (opt->dbg_file); pd->opt->guid = strdup (opt->guid); pd->opt->symbol_server = strdup (opt->symbol_server); pd->opt->user_agent = strdup (opt->user_agent); pd->opt->path = strdup (opt->path); pd->opt->extract = opt->extract; pd->download = download; } void deinit_pdb_downloader(SPDBDownloader *pd) { R_FREE (pd->opt->dbg_file); R_FREE (pd->opt->guid); R_FREE (pd->opt->symbol_server); R_FREE (pd->opt->user_agent); R_FREE (pd->opt->path); R_FREE (pd->opt); pd->download = 0; } int r_bin_pdb_download(RCore* core, int isradjson, int* actions_done, SPDBOptions* options) { int ret; char *path; SPDBDownloaderOpt opt; SPDBDownloader pdb_downloader; RBinInfo *info = r_bin_get_info (core->bin); if (!info || !info->debug_file_name) { eprintf ("Can't find debug filename\n"); return 1; } if (!options || !options->symbol_server || !options->user_agent) { eprintf ("Can't retrieve pdb configurations\n"); return 1; } path = info->file ? r_file_dirname (info->file) : strdup ("."); opt.dbg_file = info->debug_file_name; opt.guid = info->guid; opt.symbol_server = options->symbol_server; opt.user_agent = options->user_agent; opt.path = path; opt.extract = options->extract; init_pdb_downloader (&opt, &pdb_downloader); ret = pdb_downloader.download (&pdb_downloader); if (isradjson && actions_done) { printf ("%s\"pdb\":{\"file\":\"%s\",\"download\":%s}", *actions_done ? "," : "", opt.dbg_file, ret ? "true" : "false"); } else { printf ("PDB \"%s\" download %s\n", opt.dbg_file, ret ? "success" : "failed"); } if (actions_done) { (*actions_done)++; } deinit_pdb_downloader (&pdb_downloader); free (path); return 0; }
/* This file is part of the Zero Reserve Plugin for Retroshare. Zero Reserve 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. Zero Reserve 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 Zero Reserve. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ZERORESERVEPLUGIN_H #define ZERORESERVEPLUGIN_H #include <retroshare/rsplugin.h> #include <retroshare-gui/mainpage.h> #include "util/rsthreads.h" #include <string> class OrderBook; class p3ZeroReserveRS; class ConfigPage; class ZeroReserveDialog; class ZeroReservePlugin: public RsPlugin { public: ZeroReservePlugin() ; virtual ~ZeroReservePlugin() {} virtual MainPage *qt_page() const ; virtual QIcon *qt_icon() const ; virtual QTranslator *qt_translator(QApplication *app, const QString& languageCode, const QString& externalDir) const; virtual QDialog * qt_about_page() const; virtual ConfigPage *qt_config_page() const ; virtual void stop(); virtual void getPluginVersion(int& major,int& minor,int& svn_rev) const ; virtual void setPlugInHandler(RsPluginHandler *pgHandler); virtual std::string configurationFileName() const { return "zeroreserve.cfg" ; } virtual std::string getShortPluginDescription() const ; virtual std::string getPluginName() const; virtual RsPQIService * rs_pqi_service() const; virtual void setInterfaces(RsPlugInInterfaces& interfaces); /** interface between a worker thread and the GUI thread. Only GUI thread can open a dialog */ void placeMsg( const std::string & _msg ); void displayMsg(); bool isStopped(){ return m_stopped; } private: mutable RsPluginHandler *mPlugInHandler; mutable ZeroReserveDialog * mainpage ; mutable QIcon* mIcon ; mutable RsPeers* m_peers; OrderBook * m_asks; OrderBook * m_bids; mutable p3ZeroReserveRS * m_ZeroReserve; static RsMutex widget_creation_mutex; QList< QString > m_messages; RsMutex m_messages_mutex; bool m_stopped; }; extern ZeroReservePlugin * g_ZeroReservePlugin; #endif
#pragma once #include "envoy/network/io_handle.h" #include "openssl/bio.h" namespace Envoy { namespace Extensions { namespace TransportSockets { namespace Tls { /** * Creates a custom BIO that can read from/write to an IoHandle. It's equivalent to a socket BIO * but instead of relying on access to an fd, it relies on IoHandle APIs for all interactions. */ // NOLINTNEXTLINE(readability-identifier-naming) BIO* BIO_new_io_handle(Envoy::Network::IoHandle* io_handle); } // namespace Tls } // namespace TransportSockets } // namespace Extensions } // namespace Envoy
//////////////////////////////////////////////////////////////////////////// // Module : game_level_cross_table_inline.h // Created : 20.02.2003 // Modified : 13.11.2003 // Author : Dmitriy Iassenev // Description : Cross table between game and level graphs inline functions //////////////////////////////////////////////////////////////////////////// #pragma once #ifdef AI_COMPILER IC CGameLevelCrossTable::CGameLevelCrossTable(LPCSTR fName) #else IC CGameLevelCrossTable::CGameLevelCrossTable() #endif { #ifndef AI_COMPILER string256 fName; FS.update_path (fName,"$level$",CROSS_TABLE_NAME); #endif m_tpCrossTableVFS = FS.r_open(fName); R_ASSERT2 (m_tpCrossTableVFS,"Can't open cross table!"); IReader *chunk = m_tpCrossTableVFS->open_chunk(CROSS_TABLE_CHUNK_VERSION); R_ASSERT2 (chunk,"Cross table is corrupted!"); chunk->r (&m_tCrossTableHeader,sizeof(m_tCrossTableHeader)); chunk->close (); R_ASSERT2 (m_tCrossTableHeader.version() == XRAI_CURRENT_VERSION,"Cross table version mismatch!"); m_chunk = m_tpCrossTableVFS->open_chunk(CROSS_TABLE_CHUNK_DATA); R_ASSERT2 (m_chunk,"Cross table is corrupted!"); m_tpaCrossTable = (CCell*)m_chunk->pointer(); }; IC CGameLevelCrossTable::~CGameLevelCrossTable() { VERIFY (m_chunk); m_chunk->close (); VERIFY (m_tpCrossTableVFS); FS.r_close (m_tpCrossTableVFS); }; IC const CGameLevelCrossTable::CCell &CGameLevelCrossTable::vertex(u32 level_vertex_id) const { VERIFY (level_vertex_id < header().level_vertex_count()); return (m_tpaCrossTable[level_vertex_id]); } IC u32 CGameLevelCrossTable::CHeader::version() const { return (dwVersion); } IC u32 CGameLevelCrossTable::CHeader::level_vertex_count() const { return (dwNodeCount); } IC u32 CGameLevelCrossTable::CHeader::game_vertex_count() const { return (dwGraphPointCount); } IC const xrGUID &CGameLevelCrossTable::CHeader::level_guid () const { return (m_level_guid); } IC const xrGUID &CGameLevelCrossTable::CHeader::game_guid () const { return (m_game_guid); } IC GameGraph::_GRAPH_ID CGameLevelCrossTable::CCell::game_vertex_id() const { return (tGraphIndex); } IC float CGameLevelCrossTable::CCell::distance() const { return (fDistance); } IC const CGameLevelCrossTable::CHeader &CGameLevelCrossTable::header() const { return (m_tCrossTableHeader); }
// Copyright (c) 2010, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // --- // Author: Guilin Chen #ifndef UTIL_GTL_LIBC_ALLOCATOR_WITH_REALLOC_H_ #define UTIL_GTL_LIBC_ALLOCATOR_WITH_REALLOC_H_ #include "sparseconfig.h" #include <stdlib.h> // for malloc/realloc/free #include <stddef.h> // for ptrdiff_t _START_GOOGLE_NAMESPACE_ template<class T> class libc_allocator_with_realloc { public: typedef T value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef T* pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; libc_allocator_with_realloc() {} libc_allocator_with_realloc(const libc_allocator_with_realloc&) {} ~libc_allocator_with_realloc() {} pointer address(reference r) const { return &r; } const_pointer address(const_reference r) const { return &r; } pointer allocate(size_type n, const_pointer = 0) { return static_cast<pointer>(malloc(n * sizeof(value_type))); } void deallocate(pointer p, size_type) { free(p); } pointer reallocate(pointer p, size_type n) { return static_cast<pointer>(realloc(p, n * sizeof(value_type))); } size_type max_size() const { return static_cast<size_type>(-1) / sizeof(value_type); } void construct(pointer p, const value_type& val) { new(p) value_type(val); } void destroy(pointer p) { p->~value_type(); } template <class U> libc_allocator_with_realloc(const libc_allocator_with_realloc<U>&) {} template<class U> struct rebind { typedef libc_allocator_with_realloc<U> other; }; }; // libc_allocator_with_realloc<void> specialization. template<> class libc_allocator_with_realloc<void> { public: typedef void value_type; typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; template<class U> struct rebind { typedef libc_allocator_with_realloc<U> other; }; }; template<class T> inline bool operator==(const libc_allocator_with_realloc<T>&, const libc_allocator_with_realloc<T>&) { return true; } template<class T> inline bool operator!=(const libc_allocator_with_realloc<T>&, const libc_allocator_with_realloc<T>&) { return false; } _END_GOOGLE_NAMESPACE_ #endif // UTIL_GTL_LIBC_ALLOCATOR_WITH_REALLOC_H_
/* 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 "DataProvider.h" namespace paddle { class MultiDataProvider : public DataProvider { protected: std::vector<std::unique_ptr<DataProvider>> subDataProviders_; public: MultiDataProvider(const DataConfig& config, const ModelConfig& modelConfig, bool useGpu); ~MultiDataProvider() {} virtual void reset(); virtual void shuffle(); virtual int64_t getSize() { return -1; } virtual int64_t getNextBatchInternal(int64_t size, DataBatch* batch); bool isTestMode() const { return isTestMode_; } private: int totalDataRatio_; bool isTestMode_; }; } // namespace paddle
#pragma once #include "envoy/extensions/filters/http/grpc_json_transcoder/v3/transcoder.pb.h" #include "envoy/extensions/filters/http/grpc_json_transcoder/v3/transcoder.pb.validate.h" #include "source/extensions/filters/http/common/factory_base.h" namespace Envoy { namespace Extensions { namespace HttpFilters { namespace GrpcJsonTranscoder { /** * Config registration for the gRPC JSON transcoder filter. @see NamedHttpFilterConfigFactory. */ class GrpcJsonTranscoderFilterConfig : public Common::FactoryBase< envoy::extensions::filters::http::grpc_json_transcoder::v3::GrpcJsonTranscoder> { public: GrpcJsonTranscoderFilterConfig() : FactoryBase("envoy.filters.http.grpc_json_transcoder") {} private: Http::FilterFactoryCb createFilterFactoryFromProtoTyped( const envoy::extensions::filters::http::grpc_json_transcoder::v3::GrpcJsonTranscoder& proto_config, const std::string& stats_prefix, Server::Configuration::FactoryContext& context) override; Router::RouteSpecificFilterConfigConstSharedPtr createRouteSpecificFilterConfigTyped( const envoy::extensions::filters::http::grpc_json_transcoder::v3::GrpcJsonTranscoder&, Server::Configuration::ServerFactoryContext& context, ProtobufMessage::ValidationVisitor& validator) override; }; } // namespace GrpcJsonTranscoder } // namespace HttpFilters } // namespace Extensions } // namespace Envoy
// // Copyright 2004-present Facebook. 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. // #import <Foundation/Foundation.h> #import "SimulatorInfo.h" #import "TestRunState.h" #import "TestingFramework.h" @interface OCUnitTestRunner : NSObject { @protected NSDictionary *_buildSettings; SimulatorInfo *_simulatorInfo; NSArray *_focusedTestCases; NSArray *_allTestCases; NSArray *_arguments; NSDictionary *_environment; BOOL _garbageCollection; BOOL _freshSimulator; BOOL _resetSimulator; BOOL _newSimulatorInstance; BOOL _noResetSimulatorOnFailure; BOOL _freshInstall; BOOL _waitForDebugger; NSInteger _testTimeout; NSArray *_reporters; NSDictionary *_framework; } @property (nonatomic, copy, readonly) NSArray *reporters; /** * Filters a list of test cases by removing test cases with names matching * `skippedTestCases` constraints and, if set, all tests cases not matching * `onlyTestCases` ones. * * @param allTestCases An array of test cases ('ClassA/test1', 'ClassB/test2', 'Class') * @param onlyTestCases An array of test case name constraints defining what test * cases should only be included ('Class*', 'Class1', 'ClassA/test*', 'ClassB/test2') * @param skippedTestCases An array of test case name constraints defining what test * cases should be removed ('Class*', 'Class1', 'ClassA/test*', 'ClassB/test2') * @param error An output parameter which is set if error occures during filtering. */ + (NSArray *)filterTestCases:(NSArray *)allTestCases onlyTestCases:(NSArray *)onlyTestCases skippedTestCases:(NSArray *)skippedTestCases error:(NSString **)error; - (instancetype)initWithBuildSettings:(NSDictionary *)buildSettings simulatorInfo:(SimulatorInfo *)simulatorInfo focusedTestCases:(NSArray *)focusedTestCases allTestCases:(NSArray *)allTestCases arguments:(NSArray *)arguments environment:(NSDictionary *)environment freshSimulator:(BOOL)freshSimulator resetSimulator:(BOOL)resetSimulator newSimulatorInstance:(BOOL)newSimulatorInstance noResetSimulatorOnFailure:(BOOL)noResetSimulatorOnFailure freshInstall:(BOOL)freshInstall waitForDebugger:(BOOL)waitForDebugger testTimeout:(NSInteger)testTimeout reporters:(NSArray *)reporters processEnvironment:(NSDictionary *)processEnvironment; - (BOOL)runTests; - (NSMutableArray *)commonTestArguments; - (NSArray *)testArgumentsWithSpecifiedTestsToRun; - (NSDictionary *)testEnvironmentWithSpecifiedTestConfiguration; - (NSMutableDictionary *)otestEnvironmentWithOverrides:(NSDictionary *)overrides; @end
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Manuel Baesler //////////////////////////////////////////////////////////////////////////////// #pragma once #include "Basics/ConditionVariable.h" #include "Basics/Thread.h" #include "Statistics/figures.h" #include <velocypack/Builder.h> #include <velocypack/Slice.h> struct TRI_vocbase_t; namespace arangodb { class StatisticsWorker final : public Thread { public: explicit StatisticsWorker(TRI_vocbase_t& vocbase); ~StatisticsWorker() { shutdown(); } void run() override; void beginShutdown() override; private: // removes old statistics void collectGarbage(); void collectGarbage(std::string const& collection, double time) const; // calculate per second statistics void historian(); void computePerSeconds(velocypack::Builder& result, velocypack::Slice const& current, velocypack::Slice const& prev); void generateRawStatistics(velocypack::Builder& result, double const& now); // calculate per 15 seconds statistics void historianAverage(); void compute15Minute(velocypack::Builder& builder, double start); // create statistics collections void createCollections() const; void createCollection(std::string const&) const; std::shared_ptr<arangodb::velocypack::Builder> lastEntry(std::string const& collection, double start) const; void avgPercentDistributon(velocypack::Builder& result, velocypack::Slice const&, velocypack::Slice const&, velocypack::Builder const&) const; // save one statistics object void saveSlice(velocypack::Slice const&, std::string const&) const; static constexpr uint64_t STATISTICS_INTERVAL = 10; // 10 secs static constexpr uint64_t GC_INTERVAL = 8 * 60; // 8 mins static constexpr uint64_t HISTORY_INTERVAL = 15 * 60; // 15 mins static constexpr double INTERVAL = 10.0; // 10 secs enum GarbageCollectionTask { GC_STATS, GC_STATS_RAW, GC_STATS_15 }; GarbageCollectionTask _gcTask; // type of garbage collection task to run arangodb::basics::ConditionVariable _cv; velocypack::Builder _bytesSentDistribution; velocypack::Builder _bytesReceivedDistribution; velocypack::Builder _requestTimeDistribution; // builder object used to create bind variables. this is reused for each query std::shared_ptr<velocypack::Builder> _bindVars; // a reusable builder to save a few memory allocations per statistics // invocation velocypack::Builder _rawBuilder; velocypack::Builder _tempBuilder; std::string _clusterId; TRI_vocbase_t& _vocbase; // vocbase for querying/persisting statistics collections }; } // namespace arangodb
/* * 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/application-autoscaling/ApplicationAutoScaling_EXPORTS.h> #include <aws/core/AmazonSerializableWebServiceRequest.h> #include <aws/core/utils/UnreferencedParam.h> #include <aws/core/http/HttpRequest.h> namespace Aws { namespace ApplicationAutoScaling { class AWS_APPLICATIONAUTOSCALING_API ApplicationAutoScalingRequest : public AmazonSerializableWebServiceRequest { public: virtual ~ApplicationAutoScalingRequest () {} virtual Aws::String SerializePayload() const override = 0; void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); } inline Aws::Http::HeaderValueCollection GetHeaders() const override { auto headers = GetRequestSpecificHeaders(); if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0)) { headers.insert(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, AMZN_JSON_CONTENT_TYPE_1_1 )); } return headers; } protected: virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); } }; } // namespace ApplicationAutoScaling } // namespace Aws
/* * Copyright (c) 2018, NXP * * SPDX-License-Identifier: Apache-2.0 */ #include <init.h> #include <fsl_iomuxc.h> #include <fsl_gpio.h> #ifdef CONFIG_ETH_MCUX_0 static gpio_pin_config_t enet_gpio_config = { .direction = kGPIO_DigitalOutput, .outputLogic = 0, .interruptMode = kGPIO_NoIntmode }; #endif static int mimxrt1020_evk_init(struct device *dev) { ARG_UNUSED(dev); CLOCK_EnableClock(kCLOCK_Iomuxc); CLOCK_EnableClock(kCLOCK_IomuxcSnvs); /* LED */ IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_05_GPIO1_IO05, 0); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_05_GPIO1_IO05, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); /* SW0 */ IOMUXC_SetPinMux(IOMUXC_SNVS_WAKEUP_GPIO5_IO00, 0); #ifdef CONFIG_UART_MCUX_LPUART_1 /* LPUART1 TX/RX */ IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); #endif #ifdef CONFIG_UART_MCUX_LPUART_2 /* LPUART2 TX/RX */ IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_08_LPUART2_TX, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_09_LPUART2_RX, 0); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_08_LPUART2_TX, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_09_LPUART2_RX, IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); #endif #ifdef CONFIG_I2C_1 /* LPI2C1 SCL, SDA */ IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_14_LPI2C1_SCL, 1); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_15_LPI2C1_SDA, 1); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_14_LPI2C1_SCL, IOMUXC_SW_PAD_CTL_PAD_PUS(3) | IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_ODE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_15_LPI2C1_SDA, IOMUXC_SW_PAD_CTL_PAD_PUS(3) | IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_ODE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); #endif #ifdef CONFIG_I2C_4 /* LPI2C4 SCL, SDA */ IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_02_LPI2C4_SCL, 1); IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_03_LPI2C4_SDA, 1); IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_02_LPI2C4_SCL, IOMUXC_SW_PAD_CTL_PAD_PUS(3) | IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_ODE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_03_LPI2C4_SDA, IOMUXC_SW_PAD_CTL_PAD_PUS(3) | IOMUXC_SW_PAD_CTL_PAD_PKE_MASK | IOMUXC_SW_PAD_CTL_PAD_ODE_MASK | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) | IOMUXC_SW_PAD_CTL_PAD_DSE(6)); #endif #ifdef CONFIG_ETH_MCUX_0 IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_04_GPIO1_IO04, 0U); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_06_GPIO1_IO22, 0U); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_10_ENET_RDATA00, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_09_ENET_RDATA01, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_11_ENET_RX_EN, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_14_ENET_TDATA00, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_15_ENET_TDATA01, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_13_ENET_TX_EN, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_08_ENET_REF_CLK1, 1); IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_12_ENET_RX_ER, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_EMC_41_ENET_MDC, 0); IOMUXC_SetPinMux(IOMUXC_GPIO_EMC_40_ENET_MDIO, 0); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_04_GPIO1_IO04, 0xB0A9u); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_06_GPIO1_IO22, 0xB0A9u); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_10_ENET_RDATA00, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_09_ENET_RDATA01, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_11_ENET_RX_EN, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_14_ENET_TDATA00, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_15_ENET_TDATA01, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_13_ENET_TX_EN, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_08_ENET_REF_CLK1, 0x31); IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_12_ENET_RX_ER, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_EMC_41_ENET_MDC, 0xB0E9); IOMUXC_SetPinConfig(IOMUXC_GPIO_EMC_40_ENET_MDIO, 0xB829); IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, true); /* Initialize ENET_INT GPIO */ GPIO_PinInit(GPIO1, 4, &enet_gpio_config); GPIO_PinInit(GPIO1, 22, &enet_gpio_config); /* pull up the ENET_INT before RESET. */ GPIO_WritePinOutput(GPIO1, 22, 1); GPIO_WritePinOutput(GPIO1, 4, 0); #endif return 0; } #ifdef CONFIG_ETH_MCUX_0 static int mimxrt1020_evk_phy_reset(struct device *dev) { /* RESET PHY chip. */ k_busy_wait(USEC_PER_MSEC * 10U); GPIO_WritePinOutput(GPIO1, 4, 1); return 0; } #endif SYS_INIT(mimxrt1020_evk_init, PRE_KERNEL_1, 0); #ifdef CONFIG_ETH_MCUX_0 SYS_INIT(mimxrt1020_evk_phy_reset, PRE_KERNEL_2, 0); #endif
/* -*- C++ -*- */ //============================================================================= /** * @file Gadget_Part.h * * $Id: Gadget_Part.h 80826 2008-03-04 14:51:23Z wotte $ * * @author Christopher Kohlhoff <chris@kohlhoff.com> */ //============================================================================= #ifndef GADGET_PART_H #define GADGET_PART_H #include "ace/Bound_Ptr.h" #include "ace/Synch_Traits.h" #include "ace/Thread_Mutex.h" /** * @class Gadget_Part * * @brief An interface for some high-level application object. */ class Gadget_Part { public: /// Destructor. virtual ~Gadget_Part (void); /// Ask the part to print information about itself. virtual void print_info (void) = 0; /// Ask the part to remove itself from the gadget that contains it. virtual void remove_from_owner (void) = 0; }; // The Gadget_Part_var smart pointer has shared (reference counted) ownership // semantics. typedef ACE_Strong_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX> Gadget_Part_var; // The Gadget_Part_ptr smart pointer has no ownership semantics, but supports // conversion back into a Gadget_var. typedef ACE_Weak_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX> Gadget_Part_ptr; #endif /* GADGET_PART_H */
/* * 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/firehose/Firehose_EXPORTS.h> #include <aws/core/utils/Array.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace Firehose { namespace Model { /** * <p>The unit of data in a delivery stream.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/Record">AWS API * Reference</a></p> */ class AWS_FIREHOSE_API Record { public: Record(); Record(const Aws::Utils::Json::JsonValue& jsonValue); Record& operator=(const Aws::Utils::Json::JsonValue& jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The data blob, which is base64-encoded when the blob is serialized. The * maximum size of the data blob, before base64-encoding, is 1,000 KB.</p> */ inline const Aws::Utils::ByteBuffer& GetData() const{ return m_data; } /** * <p>The data blob, which is base64-encoded when the blob is serialized. The * maximum size of the data blob, before base64-encoding, is 1,000 KB.</p> */ inline void SetData(const Aws::Utils::ByteBuffer& value) { m_dataHasBeenSet = true; m_data = value; } /** * <p>The data blob, which is base64-encoded when the blob is serialized. The * maximum size of the data blob, before base64-encoding, is 1,000 KB.</p> */ inline void SetData(Aws::Utils::ByteBuffer&& value) { m_dataHasBeenSet = true; m_data = std::move(value); } /** * <p>The data blob, which is base64-encoded when the blob is serialized. The * maximum size of the data blob, before base64-encoding, is 1,000 KB.</p> */ inline Record& WithData(const Aws::Utils::ByteBuffer& value) { SetData(value); return *this;} /** * <p>The data blob, which is base64-encoded when the blob is serialized. The * maximum size of the data blob, before base64-encoding, is 1,000 KB.</p> */ inline Record& WithData(Aws::Utils::ByteBuffer&& value) { SetData(std::move(value)); return *this;} private: Aws::Utils::ByteBuffer m_data; bool m_dataHasBeenSet; }; } // namespace Model } // namespace Firehose } // namespace Aws
/* * 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/dms/DatabaseMigrationService_EXPORTS.h> #include <aws/dms/DatabaseMigrationServiceRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/dms/model/Tag.h> #include <utility> namespace Aws { namespace DatabaseMigrationService { namespace Model { /** * <p/><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResourceMessage">AWS * API Reference</a></p> */ class AWS_DATABASEMIGRATIONSERVICE_API AddTagsToResourceRequest : public DatabaseMigrationServiceRequest { public: AddTagsToResourceRequest(); Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline const Aws::String& GetResourceArn() const{ return m_resourceArn; } /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline void SetResourceArn(const Aws::String& value) { m_resourceArnHasBeenSet = true; m_resourceArn = value; } /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline void SetResourceArn(Aws::String&& value) { m_resourceArnHasBeenSet = true; m_resourceArn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline void SetResourceArn(const char* value) { m_resourceArnHasBeenSet = true; m_resourceArn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline AddTagsToResourceRequest& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline AddTagsToResourceRequest& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the AWS DMS resource the tag is to be added * to. AWS DMS resources include a replication instance, endpoint, and a * replication task.</p> */ inline AddTagsToResourceRequest& WithResourceArn(const char* value) { SetResourceArn(value); return *this;} /** * <p>The tag to be assigned to the DMS resource.</p> */ inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; } /** * <p>The tag to be assigned to the DMS resource.</p> */ inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; } /** * <p>The tag to be assigned to the DMS resource.</p> */ inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** * <p>The tag to be assigned to the DMS resource.</p> */ inline AddTagsToResourceRequest& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;} /** * <p>The tag to be assigned to the DMS resource.</p> */ inline AddTagsToResourceRequest& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;} /** * <p>The tag to be assigned to the DMS resource.</p> */ inline AddTagsToResourceRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } /** * <p>The tag to be assigned to the DMS resource.</p> */ inline AddTagsToResourceRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } private: Aws::String m_resourceArn; bool m_resourceArnHasBeenSet; Aws::Vector<Tag> m_tags; bool m_tagsHasBeenSet; }; } // namespace Model } // namespace DatabaseMigrationService } // namespace Aws
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Andrey Abramov /// @author Vasiliy Nabatchikov //////////////////////////////////////////////////////////////////////////////// #pragma once #include <memory> namespace arangodb { namespace aql { class Optimizer; struct OptimizerRule; class ExecutionPlan; } // namespace aql namespace iresearch { /// @brief moves document materialization from view nodes to materialize nodes void lateDocumentMaterializationArangoSearchRule(arangodb::aql::Optimizer* opt, std::unique_ptr<arangodb::aql::ExecutionPlan> plan, arangodb::aql::OptimizerRule const& rule); /// @brief no document materialization for view nodes if stored values contain all fields void noDocumentMaterializationArangoSearchRule(arangodb::aql::Optimizer* opt, std::unique_ptr<arangodb::aql::ExecutionPlan> plan, arangodb::aql::OptimizerRule const& rule); /// @brief move filters and sort conditions into views void handleViewsRule(arangodb::aql::Optimizer* opt, std::unique_ptr<arangodb::aql::ExecutionPlan> plan, arangodb::aql::OptimizerRule const& rule); /// @brief scatter view query in cluster /// this rule inserts scatter, gather and remote nodes so operations on sharded /// views void scatterViewInClusterRule(arangodb::aql::Optimizer* opt, std::unique_ptr<arangodb::aql::ExecutionPlan> plan, arangodb::aql::OptimizerRule const& rule); } // namespace iresearch } // namespace arangodb
/* This file is a part of libcds - Concurrent Data Structures library (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_LAZY_LIST_H #define CDSLIB_CONTAINER_DETAILS_MAKE_LAZY_LIST_H #include <cds/details/binary_functor_wrapper.h> namespace cds { namespace container { //@cond namespace details { template <class GC, typename T, class Traits> struct make_lazy_list { typedef GC gc; typedef T value_type; typedef Traits original_type_traits; struct node_type : public intrusive::lazy_list::node<gc, typename original_type_traits::lock_type> { value_type m_Value; node_type() {} template <typename Q> node_type( Q const& v ) : m_Value(v) {} template <typename... Args> node_type( Args&&... args ) : m_Value( std::forward<Args>(args)...) {} }; typedef typename original_type_traits::allocator::template rebind<node_type>::other allocator_type; typedef cds::details::Allocator< node_type, allocator_type > cxx_allocator; struct node_deallocator { void operator ()( node_type * pNode ) { cxx_allocator().Delete( pNode ); } }; typedef typename std::conditional< original_type_traits::sort, typename opt::details::make_comparator< value_type, original_type_traits >::type, typename opt::details::make_equal_to< value_type, original_type_traits >::type >::type key_comparator; struct value_accessor { value_type const & operator()( node_type const & node ) const { return node.m_Value; } }; template <typename Less> struct less_wrapper { typedef cds::details::compare_wrapper< node_type, cds::opt::details::make_comparator_from_less<Less>, value_accessor > type; }; template <typename Equal> struct equal_to_wrapper { typedef cds::details::predicate_wrapper< node_type, Equal, value_accessor > type; }; struct intrusive_traits: public original_type_traits { typedef intrusive::lazy_list::base_hook< opt::gc<gc>, cds::opt::lock_type< typename original_type_traits::lock_type >> hook; typedef node_deallocator disposer; static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::lazy_list::traits::link_checker; typedef typename std::conditional< std::is_same< typename original_type_traits::equal_to, cds::opt::none >::value, cds::opt::none, typename equal_to_wrapper< typename original_type_traits::equal_to >::type >::type equal_to; typedef typename std::conditional< original_type_traits::sort || !std::is_same<typename original_type_traits::compare, cds::opt::none>::value || !std::is_same<typename original_type_traits::less, cds::opt::none>::value, cds::details::compare_wrapper< node_type, typename opt::details::make_comparator< value_type, original_type_traits >::type, value_accessor >, cds::opt::none >::type compare; }; typedef intrusive::LazyList<gc, node_type, intrusive_traits> type; }; } // namespace details //@endcond }} // namespace cds::container #endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H
// ILMovieDBConstants.h // // Copyright (c) 2013 Gustavo Leguizamon (http://goopi.me) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #pragma mark - API URLs extern NSString * const kILMovieDBBaseURL; extern NSString * const kILMovieDBBaseURLSSL; #pragma mark - Configuration extern NSString * const kILMovieDBConfiguration; #pragma mark - Movies extern NSString * const kILMovieDBMovie; extern NSString * const kILMovieDBMovieAlternativeTitles; extern NSString * const kILMovieDBMovieCredits; extern NSString * const kILMovieDBMovieImages; extern NSString * const kILMovieDBMovieKeywords; extern NSString * const kILMovieDBMovieReleases; extern NSString * const kILMovieDBMovieTrailers; extern NSString * const kILMovieDBMovieTranslations; extern NSString * const kILMovieDBMovieSimilarMovies; extern NSString * const kILMovieDBMovieReviews; extern NSString * const kILMovieDBMovieLists; extern NSString * const kILMovieDBMovieChanges; extern NSString * const kILMovieDBMovieLatest; extern NSString * const kILMovieDBMovieUpcoming; extern NSString * const kILMovieDBMovieTheatres; extern NSString * const kILMovieDBMoviePopular; extern NSString * const kILMovieDBMovieTopRated; #pragma mark - Genres extern NSString * const kILMovieDBGenreList; extern NSString * const kILMovieDBGenreMovies; #pragma mark - Collections extern NSString * const kILMovieDBCollection; extern NSString * const kILMovieDBCollectionImages; #pragma mark - Search extern NSString * const kILMovieDBSearchMovie; extern NSString * const kILMovieDBSearchPerson; extern NSString * const kILMovieDBSearchCollection; extern NSString * const kILMovieDBSearchList; extern NSString * const kILMovieDBSearchCompany; extern NSString * const kILMovieDBSearchKeyword; #pragma mark - People extern NSString * const kILMovieDBPeople; extern NSString * const kILMovieDBPeopleMovieCredits; extern NSString * const kILMovieDBPeopleImages; extern NSString * const kILMovieDBPeopleChanges; extern NSString * const kILMovieDBPeoplePopular; extern NSString * const kILMovieDBPeopleLatest; #pragma mark - Lists extern NSString * const kILMovieDBList; extern NSString * const kILMovieDBListItemStatus; #pragma mark - Companies extern NSString * const kILMovieDBCompany; extern NSString * const kILMovieDBCompanyMovies; #pragma mark - Keywords extern NSString * const kILMovieDBKeyword; extern NSString * const kILMovieDBKeywordMovies; #pragma mark - Discover extern NSString * const kILMovieDBDiscover; #pragma mark - Reviews extern NSString * const kILMovieDBReview; #pragma mark - Changes extern NSString * const kILMovieDBChangesMovie; extern NSString * const kILMovieDBChangesPerson; #pragma mark - Jobs extern NSString * const kILMovieDBJobList;
#ifdef RENAME_INTERNAL_SHAPELIB_SYMBOLS #include "gdal_shapelib_symbol_rename.h" #endif #include "shpopen.c"
/* $Id: osdep-darwin.c,v 1.1.1.2 2011/08/17 18:40:06 jmmv Exp $ */ /* * Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <sys/types.h> #include <sys/sysctl.h> #include <event.h> #include <stdlib.h> #include <string.h> #include <unistd.h> char *osdep_get_name(int, char *); struct event_base *osdep_event_init(void); #define unused __attribute__ ((unused)) char * osdep_get_name(int fd, unused char *tty) { int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, 0 }; size_t size; struct kinfo_proc kp; if ((mib[3] = tcgetpgrp(fd)) == -1) return (NULL); size = sizeof kp; if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1) return (NULL); if (*kp.kp_proc.p_comm == '\0') return (NULL); return (strdup(kp.kp_proc.p_comm)); } struct event_base * osdep_event_init(void) { /* * On OS X, kqueue and poll are both completely broken and don't * work on anything except socket file descriptors (yes, really). */ setenv("EVENT_NOKQUEUE", "1", 1); setenv("EVENT_NOPOLL", "1", 1); return (event_init()); }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" #import "SKPaymentTransactionObserver.h" #import "SKProductsRequestDelegate.h" @class NSMutableDictionary, NSObject<OS_dispatch_queue>, NSString, SKProductsRequest; @interface NIAInAppBillingProvider : NSObject <SKPaymentTransactionObserver, SKProductsRequestDelegate> { SKProductsRequest *_productsRequest; NSObject<OS_dispatch_queue> *_workQueue; _Bool _addedObserver; shared_ptr_ec83ff60 _delegate; NSMutableDictionary *_itemToProduct; } + (id)formatPrice:(id)arg1; @property(retain) NSMutableDictionary *itemToProduct; // @synthesize itemToProduct=_itemToProduct; - (id).cxx_construct; - (void).cxx_destruct; - (void)productsRequest:(id)arg1 didReceiveResponse:(id)arg2; - (void)paymentQueue:(id)arg1 removedTransactions:(id)arg2; - (void)paymentQueue:(id)arg1 updatedTransactions:(id)arg2; - (void)removeObserver; - (void)addObserver; - (id)getProductForItem:(id)arg1; - (void)processTransactions:(id)arg1; - (void)tryToCompleteOutstandingTransactions; - (void)removeTransactions:(id)arg1; - (void)finishTransaction:(id)arg1; - (void)didProcessAppleBilling:(_Bool)arg1 transactions:(id)arg2; - (void)completeOnePurchase:(id)arg1; - (void)purchaseItem:(id)arg1 forUser:(id)arg2; - (void)purchasableItems:(id)arg1; @property(readonly) _Bool isTransactionInProgress; @property(readonly) _Bool isBillingAvailable; - (void)setDelegate:(const shared_ptr_ec83ff60 *)arg1; - (void)dealloc; - (id)initWithDelegate:(const shared_ptr_ec83ff60 *)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
/* 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 <dlfcn.h> #include <mutex> // NOLINT #include "paddle/fluid/platform/dynload/dynamic_loader.h" #include "warpctc/include/ctc.h" namespace paddle { namespace platform { namespace dynload { extern std::once_flag warpctc_dso_flag; extern void* warpctc_dso_handle; /** * The following macro definition can generate structs * (for each function) to dynamic load warpctc routine * via operator overloading. */ #define DYNAMIC_LOAD_WARPCTC_WRAP(__name) \ struct DynLoad__##__name { \ template <typename... Args> \ auto operator()(Args... args) -> decltype(__name(args...)) { \ using warpctcFunc = decltype(&::__name); \ std::call_once(warpctc_dso_flag, []() { \ warpctc_dso_handle = paddle::platform::dynload::GetWarpCTCDsoHandle(); \ }); \ static void* p_##_name = dlsym(warpctc_dso_handle, #__name); \ return reinterpret_cast<warpctcFunc>(p_##_name)(args...); \ } \ }; \ extern DynLoad__##__name __name #define DECLARE_DYNAMIC_LOAD_WARPCTC_WRAP(__name) \ DYNAMIC_LOAD_WARPCTC_WRAP(__name) #define WARPCTC_ROUTINE_EACH(__macro) \ __macro(get_warpctc_version); \ __macro(ctcGetStatusString); \ __macro(compute_ctc_loss); \ __macro(get_workspace_size) WARPCTC_ROUTINE_EACH(DECLARE_DYNAMIC_LOAD_WARPCTC_WRAP); #undef DYNAMIC_LOAD_WARPCTC_WRAP } // namespace dynload } // namespace platform } // namespace paddle
// // HOKDeeplink+Private.h // Hoko // // Created by Hoko, S.A. on 23/07/14. // Copyright (c) 2015 Hoko, S.A. All rights reserved. // #import "HOKDeeplinking.h" #import "HOKDeeplink.h" extern NSString *const HOKDeeplinkSmartlinkIdentifierKey; @interface HOKDeeplink (Private) + (HOKDeeplink *)deeplinkWithURLScheme:(NSString *)urlScheme route:(NSString *)route routeParameters:(NSDictionary *)routeParameters queryParameters:(NSDictionary *)queryParameters metadata:(NSDictionary *)metadata sourceApplication:(NSString *)sourceApplication deeplinkURL:(NSString *)deeplinkURL deferred:(BOOL)isDeferred unique:(BOOL)unique; - (void)setMetadata:(NSDictionary *)metadata; - (void)postWithToken:(NSString *)token; - (void)requestMetadataWithToken:(NSString *)token completion:(void (^)(void))completion; @property (nonatomic, strong, readonly) NSString *urlScheme; @property (nonatomic, strong, readonly) NSString *sourceApplication; @property (nonatomic, strong, readonly) NSDictionary *generateSmartlinkJSON; @property (nonatomic, strong, readonly) NSString *smartlinkClickIdentifier; @property (nonatomic, strong, readonly) NSString *smartlinkIdentifier; @property (nonatomic, readonly) BOOL isSmartlink; @property (nonatomic, readonly) BOOL hasURLs; @property (nonatomic, readonly) BOOL needsMetadata; @property (nonatomic) BOOL isDeferred; @property (nonatomic) BOOL wasOpened; @property (nonatomic, strong, readonly) NSString *url; @end
/* * 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/mediaconvert/MediaConvert_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace MediaConvert { namespace Model { enum class M2tsEbpAudioInterval { NOT_SET, VIDEO_AND_FIXED_INTERVALS, VIDEO_INTERVAL }; namespace M2tsEbpAudioIntervalMapper { AWS_MEDIACONVERT_API M2tsEbpAudioInterval GetM2tsEbpAudioIntervalForName(const Aws::String& name); AWS_MEDIACONVERT_API Aws::String GetNameForM2tsEbpAudioInterval(M2tsEbpAudioInterval value); } // namespace M2tsEbpAudioIntervalMapper } // namespace Model } // namespace MediaConvert } // namespace Aws
// Copyright (c) 2010, Razvan Petru // All rights reserved. // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, this // list of conditions and the following disclaimer in the documentation and/or other // materials provided with the distribution. // * The name of the contributors may not be used to endorse or promote products // derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef QSLOGDEST_H #define QSLOGDEST_H #include <memory> class QString; namespace QsLogging { class Destination { public: virtual ~Destination(){} virtual void write(const QString& message) = 0; }; typedef std::auto_ptr<Destination> DestinationPtr; //! Creates logging destinations/sinks. The caller will have ownership of //! the newly created destinations. class DestinationFactory { public: static DestinationPtr MakeFileDestination(const QString& filePath); static DestinationPtr MakeDebugOutputDestination(); }; } // end namespace #endif // QSLOGDEST_H
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // 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 _FASTRTPS_FASTRTPS_DLL_H_ #define _FASTRTPS_FASTRTPS_DLL_H_ #include <fastrtps/config.h> // normalize macros #if !defined(FASTRTPS_DYN_LINK) && !defined(FASTRTPS_STATIC_LINK) \ && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK) #define FASTRTPS_STATIC_LINK #endif #if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTRTPS_DYN_LINK) #define FASTRTPS_DYN_LINK #endif #if defined(FASTRTPS_DYN_LINK) && defined(FASTRTPS_STATIC_LINK) #error Must not define both FASTRTPS_DYN_LINK and FASTRTPS_STATIC_LINK #endif #if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTRTPS_NO_LIB) #define FASTRTPS_NO_LIB #endif // enable dynamic linking #if defined(_WIN32) #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK) #if defined(fastrtps_EXPORTS) #define RTPS_DllAPI __declspec( dllexport ) #else #define RTPS_DllAPI __declspec( dllimport ) #endif // FASTRTPS_SOURCE #else #define RTPS_DllAPI #endif #else #define RTPS_DllAPI #endif // _WIN32 // Auto linking. #if !defined(FASTRTPS_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \ && !defined(FASTRTPS_NO_LIB) // Set properties. #define EPROSIMA_LIB_NAME fastrtps #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTRTPS_DYN_LINK) #define EPROSIMA_DYN_LINK #endif #include <fastrtps/eProsima_auto_link.h> #endif // auto-linking disabled #endif // _fastrtps_fastrtps_DLL_H_
void start(); void end();
/* * Copyright (c) 2004-2007 Hyperic, Inc. * Copyright (c) 2009 SpringSource, 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. */ #ifndef SIGAR_OS_H #define SIGAR_OS_H #ifndef _POSIX_PTHREAD_SEMANTICS #define _POSIX_PTHREAD_SEMANTICS #endif typedef unsigned long long int u_int64_t; #include <ctype.h> #include <assert.h> #ifndef DMALLOC #include <malloc.h> #endif #include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <sys/types.h> #include <sys/processor.h> #include <sys/sysinfo.h> #include <sys/param.h> #include <kstat.h> #include <procfs.h> #include <zone.h> #include "get_mib2.h" /* avoid -Wall warning since solaris doesnt have a prototype for this */ int getdomainname(char *, int); typedef struct { kstat_t **ks; int num; char *name; int nlen; } kstat_list_t; SIGAR_INLINE kid_t sigar_kstat_update(sigar_t *sigar); int sigar_get_kstats(sigar_t *sigar); void sigar_init_multi_kstats(sigar_t *sigar); void sigar_free_multi_kstats(sigar_t *sigar); int sigar_get_multi_kstats(sigar_t *sigar, kstat_list_t *kl, const char *name, kstat_t **retval); void sigar_koffsets_lookup(kstat_t *ksp, int *offsets, int kidx); int sigar_proc_psinfo_get(sigar_t *sigar, sigar_pid_t pid); int sigar_proc_usage_get(sigar_t *sigar, prusage_t *prusage, sigar_pid_t pid); int sigar_proc_status_get(sigar_t *sigar, pstatus_t *pstatus, sigar_pid_t pid); #define CPU_ONLINE(n) \ (p_online(n, P_STATUS) == P_ONLINE) typedef enum { KSTAT_SYSTEM_BOOT_TIME, KSTAT_SYSTEM_LOADAVG_1, KSTAT_SYSTEM_LOADAVG_2, KSTAT_SYSTEM_LOADAVG_3, KSTAT_SYSTEM_MAX } kstat_system_off_e; typedef enum { KSTAT_MEMPAGES_ANON, KSTAT_MEMPAGES_EXEC, KSTAT_MEMPAGES_VNODE, KSTAT_MEMPAGES_MAX } kstat_mempages_off_e; typedef enum { KSTAT_SYSPAGES_FREE, KSTAT_SYSPAGES_MAX } kstat_syspages_off_e; enum { KSTAT_KEYS_system, KSTAT_KEYS_mempages, KSTAT_KEYS_syspages, } kstat_keys_e; typedef struct ps_prochandle * (*proc_grab_func_t)(pid_t, int, int *); typedef void (*proc_free_func_t)(struct ps_prochandle *); typedef int (*proc_create_agent_func_t)(struct ps_prochandle *); typedef void (*proc_destroy_agent_func_t)(struct ps_prochandle *); typedef void (*proc_objname_func_t)(struct ps_prochandle *, uintptr_t, const char *, size_t); typedef char * (*proc_dirname_func_t)(const char *, char *, size_t); typedef char * (*proc_exename_func_t)(struct ps_prochandle *, char *, size_t); typedef int (*proc_fstat64_func_t)(struct ps_prochandle *, int, void *); typedef int (*proc_getsockopt_func_t)(struct ps_prochandle *, int, int, int, void *, int *); typedef int (*proc_getsockname_func_t)(struct ps_prochandle *, int, struct sockaddr *, socklen_t *); struct sigar_t { SIGAR_T_BASE; int solaris_version; int use_ucb_ps; int joyent; zoneid_t zoneid; char *zonenm; char *zonenm_short; uint64_t cpu_prev_time, cpu_total; kstat_ctl_t *kc; /* kstat_lookup() as needed */ struct { kstat_t **cpu; kstat_t **cpu_info; processorid_t *cpuid; unsigned int lcpu; /* number malloced slots in the cpu array above */ kstat_t *system; kstat_t *syspages; kstat_t *mempages; } ks; struct { int system[KSTAT_SYSTEM_MAX]; int mempages[KSTAT_MEMPAGES_MAX]; int syspages[KSTAT_SYSPAGES_MAX]; } koffsets; int pagesize; time_t last_getprocs; sigar_pid_t last_pid; psinfo_t *pinfo; sigar_cpu_list_t cpulist; /* libproc.so interface */ void *plib; proc_grab_func_t pgrab; proc_free_func_t pfree; proc_create_agent_func_t pcreate_agent; proc_destroy_agent_func_t pdestroy_agent; proc_objname_func_t pobjname; proc_dirname_func_t pdirname; proc_exename_func_t pexename; proc_fstat64_func_t pfstat64; proc_getsockopt_func_t pgetsockopt; proc_getsockname_func_t pgetsockname; sigar_cache_t *pargs; solaris_mib2_t mib2; }; #ifdef SIGAR_64BIT #define KSTAT_UINT ui64 #else #define KSTAT_UINT ui32 #endif #define kSTAT_exists(v, type) \ (sigar->koffsets.type[v] != -2) #define kSTAT_ptr(v, type) \ ((kstat_named_t *)ksp->ks_data + sigar->koffsets.type[v]) #define kSTAT_uint(v, type) \ (kSTAT_exists(v, type) ? kSTAT_ptr(v, type)->value.KSTAT_UINT : 0) #define kSTAT_ui32(v, type) \ (kSTAT_exists(v, type) ? kSTAT_ptr(v, type)->value.ui32 : 0) #define kSYSTEM(v) kSTAT_ui32(v, system) #define kMEMPAGES(v) kSTAT_uint(v, mempages) #define kSYSPAGES(v) kSTAT_uint(v, syspages) #define sigar_koffsets_init(sigar, ksp, type) \ if (sigar->koffsets.type[0] == -1) \ sigar_koffsets_lookup(ksp, sigar->koffsets.type, KSTAT_KEYS_##type) #define sigar_koffsets_init_system(sigar, ksp) \ sigar_koffsets_init(sigar, ksp, system) #define sigar_koffsets_init_mempages(sigar, ksp) \ sigar_koffsets_init(sigar, ksp, mempages) #define sigar_koffsets_init_syspages(sigar, ksp) \ sigar_koffsets_init(sigar, ksp, syspages) #define HAVE_READDIR_R #define HAVE_GETPWNAM_R #define HAVE_GETPWUID_R #define SIGAR_EMIB2 (SIGAR_OS_START_ERROR+1) #endif /* SIGAR_OS_H */
/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013, PAL Robotics S.L. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of hiDOF, Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. ////////////////////////////////////////////////////////////////////////////// /// \author Adolfo Rodriguez Tsouroukdissian #ifndef HARDWARE_INTERFACE_HARDWARE_RESOURCE_MANAGER_H #define HARDWARE_INTERFACE_HARDWARE_RESOURCE_MANAGER_H #include <string> #include <hardware_interface/hardware_interface.h> #include <hardware_interface/internal/resource_manager.h> namespace hardware_interface { struct ClaimResources; struct DontClaimResources; /** * \brief Base class for handling hardware resources. * * Hardware resources are encapsulated inside handle instances, and this class allows to register and get them by name. * It is also possible to specify through the \b ClaimPolicy template parameter whether getting a handle claims * the corresponding resource or not, like in the following example * \code * // If unspecified, the resource manager will not claim resources * { * HardwareResourceManager<JointStateHandle> m; * // Populate m * m.getHandle("handle_name"); // DOES NOT claim the "handle_name" resource * } * * // Explicitly set ClaimPolicy to DontClaimResources * { * HardwareResourceManager<JointStateHandle, DontClaimResources> m; * // Populate m * m.getHandle("handle_name"); // DOES NOT claim the "handle_name" resource * } * * // Explicitly set ClaimPolicy to ClaimResources * { * HardwareResourceManager<JointHandle, ClaimResources> m; * // Populate m * m.getHandle("handle_name"); // DOES claim the "handle_name" resource * } * * \endcode * \tparam ResourceHandle Resource handle type. The only requisite on the type is that it implements a * <tt>std::string getName()</tt> method. * \tparam ClaimPolicy Specifies the resource claiming policy for resource handling */ template <class ResourceHandle, class ClaimPolicy = DontClaimResources> class HardwareResourceManager : public HardwareInterface, public ResourceManager<ResourceHandle> { public: typedef ResourceHandle ResourceHandleType; /** \name Non Real-Time Safe Functions *\{*/ /** * \brief Get a resource handle by name. * * \note If the \b ClaimPolicy template parameter is set to \b ClaimResources, calling this method will internally * claim the resource. * If set to \b DontClaimResources, calling this method will not claim the resource. * \param name Resource name. * \return Resource associated to \e name. If the resource name is not found, an exception is thrown. */ ResourceHandle getHandle(const std::string& name) { try { ResourceHandle out = this->ResourceManager<ResourceHandle>::getHandle(name); // If ClaimPolicy type is ClaimResources, the below method claims resources, for DontClaimResources it's a no-op ClaimPolicy::claim(this, name); return out; } catch(const std::logic_error& e) { throw HardwareInterfaceException(e.what()); } } /*\}*/ }; /** \cond HIDDEN_SYMBOLS */ struct ClaimResources { static void claim(HardwareInterface* hw, const std::string& name) {hw->claim(name);} }; struct DontClaimResources { static void claim(HardwareInterface* /*hw*/, const std::string& /*name*/) {} }; /** \endcond */ } #endif // HARDWARE_INTERFACE_HARDWARE_RESOURCE_MANAGER_H
// This is core/vnl/vnl_c_na_vector.h #ifndef vnl_c_na_vector_h_ #define vnl_c_na_vector_h_ #ifdef VCL_NEEDS_PRAGMA_INTERFACE #pragma interface #endif //: // \file // \brief Math on blocks of memory // // NA aware vnl_c_vector-like interfaces to lowlevel memory-block operations. // // \author Andrew W. Fitzgibbon, Ian Scott // \date 3 Nov 2010 // // \verbatim // Modifications // \endverbatim // //----------------------------------------------------------------------------- #include <iosfwd> #include <cmath> #include <vcl_compiler.h> #include <vnl/vnl_numeric_traits.h> #include "vnl/vnl_export.h" // avoid messing about with aux_* functions for gcc 2.7 -- fsm template <class T, class S> VNL_TEMPLATE_EXPORT void vnl_c_na_vector_one_norm(T const *p, unsigned n, S *out); template <class T, class S> VNL_TEMPLATE_EXPORT void vnl_c_na_vector_two_norm(T const *p, unsigned n, S *out); template <class T, class S> VNL_TEMPLATE_EXPORT void vnl_c_na_vector_two_norm_squared(T const *p, unsigned n, S *out); //: vnl_c_na_vector interfaces to NA-aware lowlevel memory-block operations. VCL_TEMPLATE_EXPORT template <class T> class VNL_TEMPLATE_EXPORT vnl_c_na_vector { public: typedef typename vnl_numeric_traits<T>::abs_t abs_t; typedef typename vnl_numeric_traits<T>::real_t real_t; static T sum(T const* v, unsigned n); static inline abs_t squared_magnitude(T const *p, unsigned n) { abs_t val; vnl_c_na_vector_two_norm_squared(p, n, &val); return val; } static T mean(T const *p, unsigned n); //: one_norm : sum of abs values static inline abs_t one_norm(T const *p, unsigned n) { abs_t val; vnl_c_na_vector_one_norm(p, n, &val); return val; } //: two_norm : sqrt of sum of squared abs values static inline abs_t two_norm(T const *p, unsigned n) { abs_t val; vnl_c_na_vector_two_norm(p, n, &val); return val; } //: two_nrm2 : sum of squared abs values static inline abs_t two_nrm2(T const *p, unsigned n) { abs_t val; vnl_c_na_vector_two_norm_squared(p, n, &val); return val; } }; //: Input & output // \relatesalso vnl_c_na_vector template <class T> VNL_TEMPLATE_EXPORT std::ostream& print_na_vector(std::ostream&, T const*, unsigned); #endif // vnl_c_na_vector_h_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ #define UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_ #include <string> #include "base/compiler_specific.h" #include "base/macros.h" #include "base/strings/string16.h" #include "ui/views/controls/button/label_button.h" class SkPaint; namespace gfx { enum class VectorIconId; } namespace views { class InkDropHover; class InkDropRipple; // A native themed class representing a checkbox. This class does not use // platform specific objects to replicate the native platforms looks and feel. class VIEWS_EXPORT Checkbox : public LabelButton { public: static const char kViewClassName[]; explicit Checkbox(const base::string16& label); ~Checkbox() override; // Sets a listener for this checkbox. Checkboxes aren't required to have them // since their state can be read independently of them being toggled. void set_listener(ButtonListener* listener) { listener_ = listener; } // Sets/Gets whether or not the checkbox is checked. virtual void SetChecked(bool checked); bool checked() const { return checked_; } protected: // Returns whether MD is enabled; exists for the sake of brevity. static bool UseMd(); // Overridden from LabelButton: void Layout() override; const char* GetClassName() const override; void GetAccessibleState(ui::AXViewState* state) override; void OnPaint(gfx::Canvas* canvas) override; void OnFocus() override; void OnBlur() override; void OnNativeThemeChanged(const ui::NativeTheme* theme) override; std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; SkColor GetInkDropBaseColor() const override; gfx::ImageSkia GetImage(ButtonState for_state) const override; // Set the image shown for each button state depending on whether it is // [checked] or [focused]. void SetCustomImage(bool checked, bool focused, ButtonState for_state, const gfx::ImageSkia& image); // Paints a focus indicator for the view. virtual void PaintFocusRing(gfx::Canvas* canvas, const SkPaint& paint); // Gets the vector icon id used to draw the icon based on the current state of // |checked_|. virtual gfx::VectorIconId GetVectorIconId() const; private: // Overridden from Button: void NotifyClick(const ui::Event& event) override; ui::NativeTheme::Part GetThemePart() const override; void GetExtraParams(ui::NativeTheme::ExtraParams* params) const override; // True if the checkbox is checked. bool checked_; // The images for each button state. gfx::ImageSkia images_[2][2][STATE_COUNT]; DISALLOW_COPY_AND_ASSIGN(Checkbox); }; } // namespace views #endif // UI_VIEWS_CONTROLS_BUTTON_CHECKBOX_H_
/**************************************************************************** * sched/pthread/pthread_condsignal.c * * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <pthread.h> #include <errno.h> #include <debug.h> #include "pthread/pthread.h" /**************************************************************************** * Definitions ****************************************************************************/ /**************************************************************************** * Private Type Declarations ****************************************************************************/ /**************************************************************************** * Global Variables ****************************************************************************/ /**************************************************************************** * Private Variables ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: pthread_cond_signal * * Description: * A thread can signal on a condition variable. * * Parameters: * None * * Return Value: * None * * Assumptions: * ****************************************************************************/ int pthread_cond_signal(FAR pthread_cond_t *cond) { int ret = OK; int sval; sdbg("cond=0x%p\n", cond); if (!cond) { ret = EINVAL; } else { /* Get the current value of the semaphore */ if (sem_getvalue((sem_t*)&cond->sem, &sval) != OK) { ret = EINVAL; } /* If the value is less than zero (meaning that one or more * thread is waiting), then post the condition semaphore. * Only the highest priority waiting thread will get to execute */ else { /* One of my objectives in this design was to make pthread_cond_signal * usable from interrupt handlers. However, from interrupt handlers, * you cannot take the associated mutex before signaling the condition. * As a result, I think that there could be a race condition with * the following logic which assumes that the if sval < 0 then the * thread is waiting. Without the mutex, there is no atomic, protected * operation that will guarantee this to be so. */ sdbg("sval=%d\n", sval); if (sval < 0) { sdbg("Signalling...\n"); ret = pthread_givesemaphore((sem_t*)&cond->sem); } } } sdbg("Returning %d\n", ret); return ret; }
/** * @file * @copyright Copyright 2016 GNSS Sensor Ltd. All right reserved. * @author Sergey Khabarov - sergeykhbr@gmail.com * @brief HostIO bus interface. */ #ifndef __DEBUGGER_PLUGIN_IHOSTIO_H__ #define __DEBUGGER_PLUGIN_IHOSTIO_H__ #include "iface.h" #include <inttypes.h> #include "coreservices/icpuriscv.h" namespace debugger { static const char *const IFACE_HOSTIO = "IHostIO"; class IHostIO : public IFace { public: IHostIO() : IFace(IFACE_HOSTIO) {} /** * @return Response error code */ virtual uint64_t write(uint16_t adr, uint64_t val) =0; virtual uint64_t read(uint16_t adr, uint64_t *val) =0; /** * CPU Debug interface (only for simulator) */ virtual ICpuRiscV *getCpuInterface() =0; }; } // namespace debugger #endif // __DEBUGGER_PLUGIN_IHOSTIO_H__
// OCHamcrest by Jon Reid, https://qualitycoding.org // Copyright 2021 hamcrest. See LICENSE.txt #import <Foundation/Foundation.h> #import <stdarg.h> @protocol HCMatcher; NS_ASSUME_NONNULL_BEGIN /*! * @abstract Returns an array of values from a variable-length comma-separated list terminated * by <code>nil</code>. */ FOUNDATION_EXPORT NSArray * HCCollectItems(id item, va_list args); /*! * @abstract Returns an array of matchers from a mixed array of items and matchers. * @discussion Each item is wrapped in HCWrapInMatcher to transform non-matcher items into equality * matchers. */ FOUNDATION_EXPORT NSArray<id <HCMatcher>> * HCWrapIntoMatchers(NSArray *items); NS_ASSUME_NONNULL_END
#include "tommath_private.h" #ifdef MP_REDUCE_2K_SETUP_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* determines the setup value */ mp_err mp_reduce_2k_setup_l(const mp_int *a, mp_int *d) { mp_err err; mp_int tmp; if ((err = mp_init(&tmp)) != MP_OKAY) { return err; } if ((err = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) { goto LBL_ERR; } if ((err = s_mp_sub(&tmp, a, d)) != MP_OKAY) { goto LBL_ERR; } LBL_ERR: mp_clear(&tmp); return err; } #endif
// Copyright ©2005, 2006 Freescale Semiconductor, Inc. // Please see the License for the specific language governing rights and // limitations under the License. // =========================================================================== // LScrollBar.h PowerPlant 2.2.2 ©1997-2005 Metrowerks Inc. // =========================================================================== #ifndef _H_LScrollBar #define _H_LScrollBar #pragma once #include <LControlPane.h> #if PP_Uses_Pragma_Import #pragma import on #endif PP_Begin_Namespace_PowerPlant // --------------------------------------------------------------------------- class LScrollBar : public LControlPane { public: enum { class_ID = FOUR_CHAR_CODE('sbar'), imp_class_ID = FOUR_CHAR_CODE('isba') }; LScrollBar( LStream* inStream, ClassIDT inImpID = imp_class_ID); LScrollBar( const SPaneInfo& inPaneInfo, MessageT inValueMessage, SInt32 inValue, SInt32 inMinValue, SInt32 inMaxValue, bool inLiveScrolling = false, ClassIDT inImpID = imp_class_ID); virtual ~LScrollBar(); virtual void DoTrackAction( SInt16 inHotSpot, SInt32 inValue); void SetScrollViewSize( SInt32 inViewSize ); struct SScrollMessage { LScrollBar* scrollBar; SInt16 hotSpot; SInt32 value; }; protected: virtual void ActivateSelf(); virtual void DeactivateSelf(); virtual void DoneTracking( SInt16 inHotSpot, Boolean inGoodTrack); private: void InitScrollBar(); }; PP_End_Namespace_PowerPlant #if PP_Uses_Pragma_Import #pragma import reset #endif #endif
/* * Copyright (C) 2010 Alex Milowski (alex@milowski.com). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef RenderMathMLRow_h #define RenderMathMLRow_h #if ENABLE(MATHML) #include "RenderMathMLBlock.h" namespace WebCore { class RenderMathMLRoot; class RenderMathMLRow : public RenderMathMLBlock { public: RenderMathMLRow(Element&, PassRef<RenderStyle>); RenderMathMLRow(Document&, PassRef<RenderStyle>); static RenderPtr<RenderMathMLRow> createAnonymousWithParentRenderer(RenderMathMLRoot&); void updateOperatorProperties(); protected: virtual void layout(); private: virtual bool isRenderMathMLRow() const override final { return true; } virtual const char* renderName() const override { return isAnonymous() ? "RenderMathMLRow (anonymous)" : "RenderMathMLRow"; } }; RENDER_OBJECT_TYPE_CASTS(RenderMathMLRow, isRenderMathMLRow()) } #endif // ENABLE(MATHML) #endif // RenderMathMLRow_h
/* * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". * * Author: Ceriel J.H. Jacobs */ /* F I L E L I S T S T R U C T U R E */ struct file_list { char *a_filename; /* name of file */ char *a_dir; /* directory in which it resides */ struct idf *a_idf; /* its idf-structure */ struct file_list *a_next; /* next in list */ char a_notfound; /* could not open ... */ }; #define f_walk(list, ctrl) \ for (ctrl = (list); ctrl; ctrl = ctrl->a_next) #define f_filename(a) ((a)->a_filename) #define f_idf(a) ((a)->a_idf) #define f_dir(a) ((a)->a_dir) #define f_notfound(a) ((a)->a_notfound)
/* * Copyright (c) 2004,2005 Hewlett-Packard Company * All rights reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the Hewlett-Packard Company nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _H_hardware_h #define _H_hardware_h #include "msp430hardware.h" #include "MSP430ADC12.h" // msp2150 cts pin TOSH_ASSIGN_PIN(CTS0, 1, 5); // LEDs TOSH_ASSIGN_PIN(RED_LED_1, 4, 4); TOSH_ASSIGN_PIN(RED_LED_2, 4, 5); TOSH_ASSIGN_PIN(GREEN_LED, 4, 6); TOSH_ASSIGN_PIN(YELLOW_LED, 4, 7); // LCD Pins #define LCD_LEFT_L_NUM (2) // CS address slave #define LCD_RIGHT_L_NUM (3) // CS address master #define LCD_RESET_L_NUM (4) // reset #define LCD_CMD_L_NUM (5) // A0 is low for command mode #define LCD_WR_L_NUM (6) // assert WR, data latches on edge of deassertion #define LCD_RD_L_NUM (7) // assert RD ** first read just latches the data so you need 2 reads to get 1 byte #define LCD_LEFT_L_VAL (1 << LCD_LEFT_L_NUM) // CS address slave #define LCD_RIGHT_L_VAL (1 << LCD_RIGHT_L_NUM) // CS address master #define LCD_RESET_L_VAL (1 << LCD_RESET_L_NUM) // reset #define LCD_CMD_L_VAL (1 << LCD_CMD_L_NUM) // A0 is low for command mode #define LCD_WR_L_VAL (1 << LCD_WR_L_NUM) // assert WR, data latches on edge of deassertion #define LCD_RD_L_VAL (1 << LCD_RD_L_NUM) // assert RD ** first read just latches the data so you need 2 reads to get 1 byte #define LCD_CMD_PORT (P2OUT) #define LCD_CMD_MASK (0xfc) #define LCD_DATA_IN_PORT (P3IN) #define LCD_DATA_OUT_PORT (P3OUT) #define LCD_DATA_DIR_PORT (P3DIR) #define LCD_DATA_READ (0x00) #define LCD_DATA_WRITE (0xff) //backlight TOSH_ASSIGN_PIN(LCD_BACKLIGHT, 1, 4); //data bus TOSH_ASSIGN_PIN(LCD_D0, 3, 0); TOSH_ASSIGN_PIN(LCD_D1, 3, 1); TOSH_ASSIGN_PIN(LCD_D2, 3, 2); TOSH_ASSIGN_PIN(LCD_D3, 3, 3); // hacked for uart test TOSH_ASSIGN_PIN(LCD_D4, 5, 4); TOSH_ASSIGN_PIN(LCD_D5, 5, 5); // TOSH_ASSIGN_PIN(LCD_D6, 3, 6); TOSH_ASSIGN_PIN(LCD_D7, 3, 7); // UART pins // first three are dummies, used by lcd TOSH_ASSIGN_PIN(SOMI0, 3, 2); TOSH_ASSIGN_PIN(SIMO0, 3, 1); TOSH_ASSIGN_PIN(UCLK0, 3, 3); TOSH_ASSIGN_PIN(UTXD0, 3, 4); TOSH_ASSIGN_PIN(URXD0, 3, 5); // control lines TOSH_ASSIGN_PIN(LCD_LEFT_L, 2, LCD_LEFT_L_NUM); TOSH_ASSIGN_PIN(LCD_RIGHT_L, 2, LCD_RIGHT_L_NUM); TOSH_ASSIGN_PIN(LCD_RESET_L, 2, LCD_RESET_L_NUM); TOSH_ASSIGN_PIN(LCD_CMD_L, 2, LCD_CMD_L_NUM); TOSH_ASSIGN_PIN(LCD_WR_L, 2, LCD_WR_L_NUM); TOSH_ASSIGN_PIN(LCD_RD_L, 2, LCD_RD_L_NUM); void TOSH_SET_PIN_DIRECTIONS(void) { //LEDS TOSH_MAKE_RED_LED_1_OUTPUT(); TOSH_MAKE_RED_LED_2_OUTPUT(); TOSH_MAKE_GREEN_LED_OUTPUT(); TOSH_MAKE_YELLOW_LED_OUTPUT(); TOSH_SET_RED_LED_1_PIN(); TOSH_SET_RED_LED_2_PIN(); TOSH_SET_GREEN_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); //UART PINS TOSH_MAKE_UTXD0_OUTPUT(); TOSH_CLR_UTXD0_PIN(); TOSH_CLR_URXD0_PIN(); // LCD TOSH_MAKE_LCD_BACKLIGHT_OUTPUT(); TOSH_CLR_LCD_BACKLIGHT_PIN(); // control lines the state of the // data lines is controlled by the code // as it is a bidirectional bus TOSH_MAKE_LCD_LEFT_L_OUTPUT(); TOSH_SET_LCD_LEFT_L_PIN(); TOSH_MAKE_LCD_RIGHT_L_OUTPUT(); TOSH_SET_LCD_RIGHT_L_PIN(); TOSH_MAKE_LCD_RESET_L_OUTPUT(); TOSH_SET_LCD_RESET_L_PIN(); TOSH_MAKE_LCD_CMD_L_OUTPUT(); TOSH_SET_LCD_CMD_L_PIN(); TOSH_MAKE_LCD_WR_L_OUTPUT(); TOSH_SET_LCD_WR_L_PIN(); TOSH_MAKE_LCD_RD_L_OUTPUT(); TOSH_SET_LCD_RD_L_PIN(); TOSH_MAKE_LCD_D0_OUTPUT(); TOSH_SET_LCD_D0_PIN(); TOSH_MAKE_LCD_D1_OUTPUT(); TOSH_SET_LCD_D1_PIN(); TOSH_MAKE_LCD_D2_OUTPUT(); TOSH_SET_LCD_D2_PIN(); TOSH_MAKE_LCD_D3_OUTPUT(); TOSH_SET_LCD_D3_PIN(); TOSH_MAKE_LCD_D4_OUTPUT(); TOSH_SET_LCD_D4_PIN(); TOSH_MAKE_LCD_D5_OUTPUT(); TOSH_SET_LCD_D5_PIN(); TOSH_MAKE_LCD_D6_OUTPUT(); TOSH_SET_LCD_D6_PIN(); TOSH_MAKE_LCD_D7_OUTPUT(); TOSH_SET_LCD_D7_PIN(); } #endif // _H_hardware_h
/* * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2009 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef HTTPHeaderMap_h #define HTTPHeaderMap_h #include "platform/PlatformExport.h" #include "wtf/HashMap.h" #include "wtf/PassOwnPtr.h" #include "wtf/Vector.h" #include "wtf/text/AtomicString.h" #include "wtf/text/AtomicStringHash.h" #include "wtf/text/StringHash.h" #include <utility> namespace blink { typedef Vector<std::pair<String, String> > CrossThreadHTTPHeaderMapData; // FIXME: Not every header fits into a map. Notably, multiple Set-Cookie header fields are needed to set multiple cookies. class PLATFORM_EXPORT HTTPHeaderMap : public HashMap<AtomicString, AtomicString, CaseFoldingHash> { public: HTTPHeaderMap(); ~HTTPHeaderMap(); // Gets a copy of the data suitable for passing to another thread. PassOwnPtr<CrossThreadHTTPHeaderMapData> copyData() const; void adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData>); const AtomicString& get(const AtomicString& name) const; AddResult add(const AtomicString& name, const AtomicString& value); // Alternate accessors that are faster than converting the char* to AtomicString first. bool contains(const char*) const; const AtomicString& get(const char*) const; AddResult add(const char* name, const AtomicString& value); }; } // namespace blink #endif // HTTPHeaderMap_h
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_GPU_VP9_DECODER_H_ #define MEDIA_GPU_VP9_DECODER_H_ #include <stddef.h> #include <stdint.h> #include <memory> #include <vector> #include "base/macros.h" #include "base/memory/ref_counted.h" #include "media/filters/vp9_parser.h" #include "media/gpu/accelerated_video_decoder.h" #include "media/gpu/vp9_picture.h" namespace media { // This class implements an AcceleratedVideoDecoder for VP9 decoding. // Clients of this class are expected to pass raw VP9 stream and are expected // to provide an implementation of VP9Accelerator for offloading final steps // of the decoding process. // // This class must be created, called and destroyed on a single thread, and // does nothing internally on any other thread. class MEDIA_GPU_EXPORT VP9Decoder : public AcceleratedVideoDecoder { public: class MEDIA_GPU_EXPORT VP9Accelerator { public: VP9Accelerator(); virtual ~VP9Accelerator(); // Create a new VP9Picture that the decoder client can use for initial // stages of the decoding process and pass back to this accelerator for // final, accelerated stages of it, or for reference when decoding other // pictures. // // When a picture is no longer needed by the decoder, it will just drop // its reference to it, and it may do so at any time. // // Note that this may return nullptr if the accelerator is not able to // provide any new pictures at the given time. The decoder must handle this // case and treat it as normal, returning kRanOutOfSurfaces from Decode(). virtual scoped_refptr<VP9Picture> CreateVP9Picture() = 0; // Submit decode for |pic| to be run in accelerator, taking as arguments // information contained in it, as well as current segmentation and loop // filter state in |seg| and |lf|, respectively, and using pictures in // |ref_pictures| for reference. // // Note that returning from this method does not mean that the decode // process is finished, but the caller may drop its references to |pic| // and |ref_pictures| immediately, and the data in |seg| and |lf| does not // need to remain valid after this method returns. // // Return true when successful, false otherwise. virtual bool SubmitDecode( const scoped_refptr<VP9Picture>& pic, const Vp9Segmentation& seg, const Vp9LoopFilter& lf, const std::vector<scoped_refptr<VP9Picture>>& ref_pictures) = 0; // Schedule output (display) of |pic|. // // Note that returning from this method does not mean that |pic| has already // been outputted (displayed), but guarantees that all pictures will be // outputted in the same order as this method was called for them, and that // they are decoded before outputting (assuming SubmitDecode() has been // called for them beforehand). Decoder may drop its references to |pic| // immediately after calling this method. // // Return true when successful, false otherwise. virtual bool OutputPicture(const scoped_refptr<VP9Picture>& pic) = 0; private: DISALLOW_COPY_AND_ASSIGN(VP9Accelerator); }; VP9Decoder(VP9Accelerator* accelerator); ~VP9Decoder() override; // AcceleratedVideoDecoder implementation. void SetStream(const uint8_t* ptr, size_t size) override; bool Flush() override WARN_UNUSED_RESULT; void Reset() override; DecodeResult Decode() override WARN_UNUSED_RESULT; gfx::Size GetPicSize() const override; size_t GetRequiredNumOfPictures() const override; private: // Update ref_frames_ based on the information in current frame header. void RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic); // Decode and possibly output |pic| (if the picture is to be shown). // Return true on success, false otherwise. bool DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic); // Called on error, when decoding cannot continue. Sets state_ to kError and // releases current state. void SetError(); enum State { kNeedStreamMetadata, // After initialization, need a keyframe. kDecoding, // Ready to decode from any point. kAfterReset, // After Reset(), need a resume point. kError, // Error in decode, can't continue. }; // Current decoder state. State state_; // Current frame header to be used in decoding the next picture. std::unique_ptr<Vp9FrameHeader> curr_frame_hdr_; // Reference frames currently in use. std::vector<scoped_refptr<VP9Picture>> ref_frames_; // Current coded resolution. gfx::Size pic_size_; Vp9Parser parser_; // VP9Accelerator instance owned by the client. VP9Accelerator* accelerator_; DISALLOW_COPY_AND_ASSIGN(VP9Decoder); }; } // namespace media #endif // MEDIA_GPU_VP9_DECODER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_INSTALLER_UTIL_PRODUCT_H_ #define CHROME_INSTALLER_UTIL_PRODUCT_H_ #pragma once #include <set> #include <string> #include <vector> #include "base/memory/scoped_ptr.h" #include "chrome/installer/util/browser_distribution.h" class CommandLine; namespace installer { class ChannelInfo; class MasterPreferences; class Product; class ProductOperations; // Represents an installation of a specific product which has a one-to-one // relation to a BrowserDistribution. A product has registry settings, related // installation/uninstallation actions and exactly one Package that represents // the files on disk. The Package may be shared with other Product instances, // so only the last Product to be uninstalled should remove the package. // Right now there are no classes that derive from Product, but in // the future, as we move away from global functions and towards a data driven // installation, each distribution could derive from this class and provide // distribution specific functionality. class Product { public: explicit Product(BrowserDistribution* distribution); ~Product(); void InitializeFromPreferences(const MasterPreferences& prefs); void InitializeFromUninstallCommand(const CommandLine& uninstall_command); BrowserDistribution* distribution() const { return distribution_; } bool is_type(BrowserDistribution::Type type) const { return distribution_->GetType() == type; } bool is_chrome() const { return distribution_->GetType() == BrowserDistribution::CHROME_BROWSER; } bool is_chrome_frame() const { return distribution_->GetType() == BrowserDistribution::CHROME_FRAME; } bool HasOption(const std::wstring& option) const { return options_.find(option) != options_.end(); } // Returns true if the set of options is mutated by this operation. bool SetOption(const std::wstring& option, bool set) { if (set) return options_.insert(option).second; else return options_.erase(option) != 0; } // Returns the path to the directory that holds the user data. This is always // inside "Users\<user>\Local Settings". Note that this is the default user // data directory and does not take into account that it can be overriden with // a command line parameter. FilePath GetUserDataPath() const; // Launches Chrome without waiting for it to exit. bool LaunchChrome(const FilePath& application_path) const; // Launches Chrome with given command line, waits for Chrome indefinitely // (until it terminates), and gets the process exit code if available. // The function returns true as long as Chrome is successfully launched. // The status of Chrome at the return of the function is given by exit_code. // NOTE: The 'options' CommandLine object should only contain parameters. // The program part will be ignored. bool LaunchChromeAndWait(const FilePath& application_path, const CommandLine& options, int32* exit_code) const; // Sets the boolean MSI marker for this installation if set is true or clears // it otherwise. The MSI marker is stored in the registry under the // ClientState key. bool SetMsiMarker(bool system_install, bool set) const; // Returns true if setup should create an entry in the Add/Remove list // of installed applications. bool ShouldCreateUninstallEntry() const; // See ProductOperations::AddKeyFiles. void AddKeyFiles(std::vector<FilePath>* key_files) const; // See ProductOperations::AddComDllList. void AddComDllList(std::vector<FilePath>* com_dll_list) const; // See ProductOperations::AppendUninstallFlags. void AppendUninstallFlags(CommandLine* command_line) const; // See ProductOperations::AppendRenameFlags. void AppendRenameFlags(CommandLine* command_line) const; // See Productoperations::SetChannelFlags. bool SetChannelFlags(bool set, ChannelInfo* channel_info) const; protected: enum CacheStateFlags { MSI_STATE = 0x01 }; BrowserDistribution* distribution_; scoped_ptr<ProductOperations> operations_; std::set<std::wstring> options_; private: DISALLOW_COPY_AND_ASSIGN(Product); }; } // namespace installer #endif // CHROME_INSTALLER_UTIL_PRODUCT_H_
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memcpy_51b.c Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.label.xml Template File: sources-sink-51b.tmpl.c */ /* * @description * CWE: 121 Stack Based Buffer Overflow * BadSource: Set data pointer to the bad buffer * GoodSource: Set data pointer to the good buffer * Sink: memcpy * BadSink : Copy int array to data using memcpy * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different source files * * */ #include "std_testcase.h" /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */ #ifndef OMITBAD void CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memcpy_51b_badSink(int * data) { { int source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memcpy(data, source, 100*sizeof(int)); printIntLine(data[0]); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE121_Stack_Based_Buffer_Overflow__CWE805_int_declare_memcpy_51b_goodG2BSink(int * data) { { int source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memcpy(data, source, 100*sizeof(int)); printIntLine(data[0]); } } #endif /* OMITGOOD */
#ifndef NBODY_H #define NBODY_H // Compute gravitational force between two bodies. // Body mass is stored in w component of the Vec4f. __host__ __device__ Vec4f gravitation(const Vec4f &i, const Vec4f &j); // Compute the gravitational force induced on "target" body by all // masses in the bodies array. __host__ __device__ Vec4f accumulateForce(const Vec4f &target, const Vec4f *bodies, int N); class accumulate_force_functor { public: Vec4f *forceVectors; Vec4f *bodies; int N; accumulate_force_functor(Vec4f *set_forceVectors, Vec4f *set_bodies, int set_N); __host__ __device__ void operator()(int idx); }; #endif
#ifndef GEPETTO_VIEWER_FPSMANIPULATOR_H #define GEPETTO_VIEWER_FPSMANIPULATOR_H // // KeyboardManipulator // gepetto-viewer // // Alternative CameraManipulator for OSG, use keyboard and mouse // KeyBinding are inspired by the classic system in games // // Created by Pierre Fernbach in january 2016 // #include <osgGA/FirstPersonManipulator> #include <osgViewer/Viewer> #include <osg/Camera> #include <osgViewer/GraphicsWindow> namespace osgGA { const double startSpeed_ = 2.; /** FirstPersonManipulator is base class for camera control based on position and orientation of camera, like walk, drive, and flight manipulators. */ class OSGGA_EXPORT KeyboardManipulator : public FirstPersonManipulator { typedef FirstPersonManipulator inherited; public: KeyboardManipulator( int flags = DEFAULT_SETTINGS ); KeyboardManipulator( const KeyboardManipulator& fpm, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); /// Constructor with reference to the graphic window, needed for hidding mouse cursor KeyboardManipulator(osgViewer::GraphicsWindow* window, int flags = DEFAULT_SETTINGS ); META_Object( osgGA, KeyboardManipulator ); protected : virtual bool handleKeyDown( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool handleKeyUp( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool handleFrame( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool handleMousePush( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); virtual bool handleMouseRelease( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); // virtual bool handleMouseWheel( const GUIEventAdapter& ea, GUIActionAdapter& us ); virtual bool performMovementLeftMouseButton( const double eventTimeDelta, const double dx, const double dy ); virtual void rotateRoll( const double roll/*,const osg::Vec3d& localUp */); virtual void getUsage(osg::ApplicationUsage &usage) const; bool initKeyboard(); private : double speed_; double speedX_; double speedY_; double speedZ_; double speedRoll_; /* double zNear_; double zFar_; double fovy_; double ratio_;*/ osg::Quat rotateRoll_; // osg::Quat rotatePitch_; // osg::Quat rotateYaw_; osg::Vec3d localUp_; int keyLayout_; //osg::Camera* camera_; osgViewer::GraphicsWindow* gWindow_; // Display *display_; int keycode_; bool rightClic_; bool ctrl_; bool shift_; bool noRoll_; };// end class /* * zqsd for azerty keyboard, if qwerty keyboard is detected, the keySym will be modified * */ enum KeyBinding { key_forward = GUIEventAdapter::KEY_W, //depend on qwerty / azerty key_backward = GUIEventAdapter::KEY_S, key_right = GUIEventAdapter::KEY_D, key_left = GUIEventAdapter::KEY_A, key_roll_right = GUIEventAdapter::KEY_E, key_roll_left = GUIEventAdapter::KEY_Q, key_up = GUIEventAdapter::KEY_Space, key_down = GUIEventAdapter::KEY_V }; enum keyLayout{ LAYOUT_unknown,LAYOUT_azerty,LAYOUT_qwerty }; }//namespace osgGA #endif // FPSMANIPULATOR_H
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_ARC_ENTERPRISE_ARC_DATA_REMOVE_REQUESTED_PREF_HANDLER_H_ #define COMPONENTS_ARC_ENTERPRISE_ARC_DATA_REMOVE_REQUESTED_PREF_HANDLER_H_ #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "components/prefs/pref_change_registrar.h" class PrefService; namespace arc { namespace data_snapshotd { // This class handles ARC data remove requests and notifies the owner if ARC // data remove is requested. class ArcDataRemoveRequestedPrefHandler final { public: ArcDataRemoveRequestedPrefHandler(const ArcDataRemoveRequestedPrefHandler&) = delete; ArcDataRemoveRequestedPrefHandler& operator=( const ArcDataRemoveRequestedPrefHandler&) = delete; ~ArcDataRemoveRequestedPrefHandler(); // Creates the instance if ARC data removal is not requested yet, otherwise // returns nullptr and calls |callback| right away. // |callback| is called once ARC data removal is requested. static std::unique_ptr<ArcDataRemoveRequestedPrefHandler> Create( PrefService* prefs, base::OnceClosure callback); private: // The instance observes the changes of kArcDataRemoveRequested in |prefs|. // |callback| is invoked once the pref is set. ArcDataRemoveRequestedPrefHandler(PrefService* prefs, base::OnceClosure callback); void OnPrefChanged(); // If |callback| is a valid callback, it is invoked once ARC data remove is // requested. base::OnceClosure callback_; // Observes changes to kArcDataRemoveRequested pref. PrefChangeRegistrar pref_change_registrar_; base::WeakPtrFactory<ArcDataRemoveRequestedPrefHandler> weak_ptr_factory_{ this}; }; } // namespace data_snapshotd } // namespace arc #endif // COMPONENTS_ARC_ENTERPRISE_ARC_DATA_REMOVE_REQUESTED_PREF_HANDLER_H_
/* * Copyright (c) 2005-2012 by KoanLogic s.r.l. - All rights reserved. */ #ifndef _U_ALLOC_H_ #define _U_ALLOC_H_ #include <u/libu_conf.h> #include <sys/types.h> #ifdef __cplusplus extern "C" { #endif void u_memory_set_malloc (void *(*f_malloc)(size_t)); void u_memory_set_calloc (void *(*f_calloc)(size_t, size_t)); void u_memory_set_realloc (void *(*f_realloc)(void *, size_t)); void u_memory_set_free (void (*f_free)(void *)); void *u_malloc (size_t sz); void *u_calloc (size_t cnt, size_t sz); void *u_zalloc (size_t sz); void *u_realloc (void *ptr, size_t sz); void u_free (void *ptr); #ifdef __cplusplus } #endif #endif /* !_U_ALLOC_H_ */
/* copyright(C) 2002 H.Kawai (under KL-01). */ #if (!defined(STDLIB_H)) #define STDLIB_H 1 #if (defined(__cplusplus)) extern "C" { #endif #include "go_lib.h" #define _ATTRIB_NORETURN __attribute__ ((noreturn)) double GO_atof(const char *s); int GO_atoi(const char *s); double GO_strtod(const char *s, char **endp); /* float GO_strtof(const char *s, char **endp) */ /* #define GO_strtof(s, endp) ((float) strtod(s, endp)) */ long GO_strtol(const char *s, char **endp, int base); unsigned long GO_strtoul(const char *s, char **endp, int base); int GO_rand(void); void *GO_calloc(size_t nobj, size_t size); void *GO_malloc(size_t size); void *GO_realloc(void *p, size_t size); void GO_free(void *p); void GO_abort(void) _ATTRIB_NORETURN; void GO_exit(int status) _ATTRIB_NORETURN; int GO_atexit(void (*)(void)); int GO_system(const char *s); /* #define GO_system(s) (GOL_sysabort(GO_TERM_BUGTRAP), 0) */ /* char *GO_getenv(const char *name); */ /* #define GO_getenv(name) (GOL_sysabort(GO_TERM_BUGTRAP), NULL) */ #define GO_getenv(name) ((char *) NULL) void *GO_bsearch(const void *key, const void *base, size_t n, size_t size, int (*cmp)(const void *keyval, const void *datum)); void GO_qsort(const void *base, size_t n, size_t size, int (*cmp)(const void *, const void *)); int GO_abs(int n); typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; div_t GO_div(int num, int denom); /* int GO_mblen(const char *, size_t); */ extern UINT GO_rand_seed; #undef _ATTRIB_NORETURN #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 #define RAND_MAX 32767 #define atof(s) GO_atof(s) #define atoi(s) GO_atoi(s) #define atol(s) (long) GO_atoi(s) #define strtod(s, endp) GO_strtod(s, endp) #define strtol(s, endp, base) GO_strtol(s, endp, base) #define strtoul(s, endp, base) GO_strtoul(s, endp, base) #define rand() GO_rand() #define srand(seed) (void) (GO_rand_seed = (seed)) #define calloc(nobj, size) GO_calloc(nobj, size) #define malloc(size) GO_malloc(size) #define realloc(p, size) GO_realloc(p, size) /* #define free(p) GO_free(p) */ #define free GO_free #define abort() GO_abort() #define exit(status) GO_exit(status) #define atexit(fcn) GO_atexit(fcn) #define system(s) GO_system(s) #define getenv(name) GO_getenv(name) #define bsearch(key, base, n, size, cmp) GO_bsearch(key, base, n, size, cmp) #define qsort(base, n, size, cmp) GO_qsort(base, n, size, cmp) #define abs(n) GO_abs(n) #define labs(n) GO_abs(n) #define div(num, denom) GO_div(num, denom) #define ldiv(num, denom) (ldiv_t) GO_div(num, denom) #if (defined(__cplusplus)) } #endif #endif
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE476_NULL_Pointer_Dereference__int64_t_63b.c Label Definition File: CWE476_NULL_Pointer_Dereference.label.xml Template File: sources-sinks-63b.tmpl.c */ /* * @description * CWE: 476 NULL Pointer Dereference * BadSource: Set data to NULL * GoodSource: Initialize data * Sinks: * GoodSink: Check for NULL before attempting to print data * BadSink : Print data * Flow Variant: 63 Data flow: pointer to data passed from one function to another in different source files * * */ #include "std_testcase.h" #include <wchar.h> #ifndef OMITBAD void CWE476_NULL_Pointer_Dereference__int64_t_63b_badSink(int64_t * * dataPtr) { int64_t * data = *dataPtr; /* POTENTIAL FLAW: Attempt to use data, which may be NULL */ printLongLongLine(*data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE476_NULL_Pointer_Dereference__int64_t_63b_goodG2BSink(int64_t * * dataPtr) { int64_t * data = *dataPtr; /* POTENTIAL FLAW: Attempt to use data, which may be NULL */ printLongLongLine(*data); } /* goodB2G uses the BadSource with the GoodSink */ void CWE476_NULL_Pointer_Dereference__int64_t_63b_goodB2GSink(int64_t * * dataPtr) { int64_t * data = *dataPtr; /* FIX: Check for NULL before attempting to print data */ if (data != NULL) { printLongLongLine(*data); } else { printLine("data is NULL"); } } #endif /* OMITGOOD */
/* Copyright 2016 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* BMA2x2 gsensor module for Chrome EC */ #ifndef __CROS_EC_ACCEL_BMA2x2_H #define __CROS_EC_ACCEL_BMA2x2_H #include "accel_bma2x2_public.h" /*** Chip-specific registers ***/ /* REGISTER ADDRESS DEFINITIONS */ #define BMA2x2_EEP_OFFSET 0x16 #define BMA2x2_IMAGE_BASE 0x38 #define BMA2x2_IMAGE_LEN 22 #define BMA2x2_CHIP_ID_ADDR 0x00 #define BMA255_CHIP_ID_MAJOR 0xfa /* DATA ADDRESS DEFINITIONS */ #define BMA2x2_X_AXIS_LSB_ADDR 0x02 #define BMA2x2_X_AXIS_MSB_ADDR 0x03 #define BMA2x2_Y_AXIS_LSB_ADDR 0x04 #define BMA2x2_Y_AXIS_MSB_ADDR 0x05 #define BMA2x2_Z_AXIS_LSB_ADDR 0x06 #define BMA2x2_Z_AXIS_MSB_ADDR 0x07 #define BMA2x2_TEMP_ADDR 0x08 #define BMA2x2_AXIS_LSB_NEW_DATA 0x01 /* STATUS ADDRESS DEFINITIONS */ #define BMA2x2_STAT1_ADDR 0x09 #define BMA2x2_STAT2_ADDR 0x0A #define BMA2x2_STAT_TAP_SLOPE_ADDR 0x0B #define BMA2x2_STAT_ORIENT_HIGH_ADDR 0x0C #define BMA2x2_STAT_FIFO_ADDR 0x0E #define BMA2x2_RANGE_SELECT_ADDR 0x0F #define BMA2x2_RANGE_SELECT_MSK 0x0F #define BMA2x2_RANGE_2G 3 #define BMA2x2_RANGE_4G 5 #define BMA2x2_RANGE_8G 8 #define BMA2x2_RANGE_16G 12 #define BMA2x2_RANGE_TO_REG(_range) \ ((_range) < 8 ? BMA2x2_RANGE_2G + ((_range) / 4) * 2 : \ BMA2x2_RANGE_8G + ((_range) / 16) * 4) #define BMA2x2_REG_TO_RANGE(_reg) \ ((_reg) < BMA2x2_RANGE_8G ? 2 + (_reg) - BMA2x2_RANGE_2G : \ 8 + ((_reg) - BMA2x2_RANGE_8G) * 2) #define BMA2x2_BW_SELECT_ADDR 0x10 #define BMA2x2_BW_MSK 0x1F #define BMA2x2_BW_7_81HZ 0x08 /* LowPass 7.8125HZ */ #define BMA2x2_BW_15_63HZ 0x09 /* LowPass 15.625HZ */ #define BMA2x2_BW_31_25HZ 0x0A /* LowPass 31.25HZ */ #define BMA2x2_BW_62_50HZ 0x0B /* LowPass 62.50HZ */ #define BMA2x2_BW_125HZ 0x0C /* LowPass 125HZ */ #define BMA2x2_BW_250HZ 0x0D /* LowPass 250HZ */ #define BMA2x2_BW_500HZ 0x0E /* LowPass 500HZ */ #define BMA2x2_BW_1000HZ 0x0F /* LowPass 1000HZ */ /* Do not use BW lower than 7813, because __fls cannot be call for 0 */ #define BMA2x2_BW_TO_REG(_bw) \ ((_bw) < 125000 ? \ BMA2x2_BW_7_81HZ + __fls(((_bw) * 10) / 78125) : \ BMA2x2_BW_125HZ + __fls((_bw) / 125000)) #define BMA2x2_REG_TO_BW(_reg) \ ((_reg) < BMA2x2_BW_125HZ ? \ (78125 << ((_reg) - BMA2x2_BW_7_81HZ)) / 10 : \ 125000 << ((_reg) - BMA2x2_BW_125HZ)) #define BMA2x2_MODE_CTRL_ADDR 0x11 #define BMA2x2_LOW_NOISE_CTRL_ADDR 0x12 #define BMA2x2_DATA_CTRL_ADDR 0x13 #define BMA2x2_DATA_HIGH_BW 0x80 #define BMA2x2_DATA_SHADOW_DIS 0x40 #define BMA2x2_RST_ADDR 0x14 #define BMA2x2_CMD_SOFT_RESET 0xb6 /* INTERRUPT ADDRESS DEFINITIONS */ #define BMA2x2_INTR_ENABLE1_ADDR 0x16 #define BMA2x2_INTR_ENABLE2_ADDR 0x17 #define BMA2x2_INTR_SLOW_NO_MOTION_ADDR 0x18 #define BMA2x2_INTR1_PAD_SELECT_ADDR 0x19 #define BMA2x2_INTR_DATA_SELECT_ADDR 0x1A #define BMA2x2_INTR2_PAD_SELECT_ADDR 0x1B #define BMA2x2_INTR_SOURCE_ADDR 0x1E #define BMA2x2_INTR_SET_ADDR 0x20 #define BMA2x2_INTR_CTRL_ADDR 0x21 #define BMA2x2_INTR_CTRL_RST_INT 0x80 /* FEATURE ADDRESS DEFINITIONS */ #define BMA2x2_LOW_DURN_ADDR 0x22 #define BMA2x2_LOW_THRES_ADDR 0x23 #define BMA2x2_LOW_HIGH_HYST_ADDR 0x24 #define BMA2x2_HIGH_DURN_ADDR 0x25 #define BMA2x2_HIGH_THRES_ADDR 0x26 #define BMA2x2_SLOPE_DURN_ADDR 0x27 #define BMA2x2_SLOPE_THRES_ADDR 0x28 #define BMA2x2_SLOW_NO_MOTION_THRES_ADDR 0x29 #define BMA2x2_TAP_PARAM_ADDR 0x2A #define BMA2x2_TAP_THRES_ADDR 0x2B #define BMA2x2_ORIENT_PARAM_ADDR 0x2C #define BMA2x2_THETA_BLOCK_ADDR 0x2D #define BMA2x2_THETA_FLAT_ADDR 0x2E #define BMA2x2_FLAT_HOLD_TIME_ADDR 0x2F #define BMA2x2_SELFTEST_ADDR 0x32 #define BMA2x2_EEPROM_CTRL_ADDR 0x33 #define BMA2x2_EEPROM_REMAIN_OFF 4 #define BMA2x2_EEPROM_REMAIN_MSK 0xF0 #define BMA2x2_EEPROM_LOAD 0x08 #define BMA2x2_EEPROM_RDY 0x04 #define BMA2x2_EEPROM_PROG 0x02 #define BMA2x2_EEPROM_PROG_EN 0x01 #define BMA2x2_SERIAL_CTRL_ADDR 0x34 /* OFFSET ADDRESS DEFINITIONS */ #define BMA2x2_OFFSET_CTRL_ADDR 0x36 #define BMA2x2_OFFSET_RESET 0x80 #define BMA2x2_OFFSET_TRIGGER_OFF 5 #define BMA2x2_OFFSET_TRIGGER_MASK (0x3 << BMA2x2_OFFSET_TRIGGER_OFF) #define BMA2x2_OFFSET_CAL_READY 0x10 #define BMA2x2_OFFSET_CAL_SLOW_X 0x04 #define BMA2x2_OFFSET_CAL_SLOW_Y 0x02 #define BMA2x2_OFFSET_CAL_SLOW_Z 0x01 #define BMA2x2_OFC_SETTING_ADDR 0x37 #define BMA2x2_OFC_TARGET_AXIS_OFF 1 #define BMA2x2_OFC_TARGET_AXIS_LEN 2 #define BMA2x2_OFC_TARGET_AXIS(_axis) \ (BMA2x2_OFC_TARGET_AXIS_LEN * (_axis) + BMA2x2_OFC_TARGET_AXIS_OFF) #define BMA2x2_OFC_TARGET_0G 0 #define BMA2x2_OFC_TARGET_PLUS_1G 1 #define BMA2x2_OFC_TARGET_MINUS_1G 2 #define BMA2x2_OFFSET_X_AXIS_ADDR 0x38 #define BMA2x2_OFFSET_Y_AXIS_ADDR 0x39 #define BMA2x2_OFFSET_Z_AXIS_ADDR 0x3A /* GP ADDRESS DEFINITIONS */ #define BMA2x2_GP0_ADDR 0x3B #define BMA2x2_GP1_ADDR 0x3C /* FIFO ADDRESS DEFINITIONS */ #define BMA2x2_FIFO_MODE_ADDR 0x3E #define BMA2x2_FIFO_DATA_OUTPUT_ADDR 0x3F #define BMA2x2_FIFO_WML_TRIG 0x30 /* Sensor resolution in number of bits. This sensor has fixed resolution. */ #define BMA2x2_RESOLUTION 12 #endif /* __CROS_EC_ACCEL_BMA2x2_H */