text
stringlengths
4
6.14k
#ifndef HEADERFILE_H #define HEADERFILE_H #include <iostream> #include <cstdlib> template<typename T> class readFile{ public: const T ** readImages(const char * fileName, size_t & size, size_t & row, size_t & column){ FILE * f = fopen(fileName, "r"); if(f == NULL){ fprintf(stderr, "Filename is not valid !!!\n"); return NULL; } for(int i = 0; i < 4; i++){ char temp; fscanf(f, "%c", &temp); } size = 0; for(int i = 0; i < 4; i++){ char temp; fscanf(f, "%c", &temp); size_t temp2 = temp; temp2 = temp2 % 256; size = size * 256 + temp2; } row = 0; for(int i = 0; i < 4; i++){ char temp; fscanf(f, "%c", &temp); row = row * 256 + temp; } column = 0; for(int i = 0; i < 4; i++){ char temp; fscanf(f, "%c", &temp); column = column * 256 + temp; } size_t imageSize = row * column; T ** images = new T * [size]; for(int i = 0; i < size; i++){ images[i] = new T[imageSize]; } for(int i = 0; i < size; i++){ for(int j = 0; j < imageSize; j++){ unsigned char temp; fscanf(f, "%c", &temp); images[i][j] = (double) temp / 255; } } fclose(f); return (const double **)images; } const T ** readLabels(const char * fileName, size_t & size){ FILE * f = fopen(fileName, "r"); if(f == NULL){ fprintf(stderr, "Filename is not valid !!!\n"); return NULL; } for(int i = 0; i < 4; i++){ char temp; fscanf(f, "%c", &temp); } size = 0; for(int i = 0; i < 4; i++){ char temp; fscanf(f, "%c", &temp); size_t temp2 = temp; temp2 = temp2 % 256; size = size * 256 + temp2; } T ** labels = new T*[size]; for(int i = 0; i < size; i++){ labels[i] = new T[10]; } for(int i = 0; i < size; i++){ char temp; fscanf(f, "%c", &temp); labels[i][(int)temp] = 1.0; } fclose(f); return (const double **)labels; } void showImage(const T ** images, const T** labels, size_t indexImage, size_t row, size_t column){ for(int i = 0; i < 10; i++){ if(labels[indexImage][i] == 1.0){ printf("the label for this image is %d\n\n", i); break; } } for(int i = 0; i < row; i++){ for(int j = 0; j < column; j++){ if(images[indexImage][i * row + j] > .5){ printf("*"); }else{ printf(" "); } } printf("\n"); } } }; #endif
#ifndef FAS_EVENTSPOLLER_H #define FAS_EVENTSPOLLER_H #include <vector> #include <Timestamp.h> #include <Events.h> #include <boost/function.hpp> #include <boost/noncopyable.hpp> namespace fas { class Poller : boost::noncopyable { public: enum type { EPOLL, POLL, }; Poller(); virtual bool EventsAdd(Events* events) = 0; virtual bool EventsMod(Events* events) = 0; virtual bool EventsDel(Events* events) = 0; virtual Timestamp Loop(std::vector<Events> &events, int timeout) = 0; }; } #endif // FAS_EVENTSPOLLER_H
/* This file is part of HSPlasma. * * HSPlasma 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. * * HSPlasma 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 HSPlasma. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _PFGUIDIALOGMOD_H #define _PFGUIDIALOGMOD_H #include "pfGUIControlMod.h" class PLASMA_DLL pfGUIDialogMod : public virtual plSingleModifier { CREATABLE(pfGUIDialogMod, kGUIDialogMod, plSingleModifier) public: enum Flags { kModal, kDerivedFlagsStart }; protected: unsigned int fTagID, fVersion; plKey fRenderMod; char fName[128]; std::vector<plKey> fControls; pfGUIColorScheme fColorScheme; plKey fProcReceiver, fSceneNode; public: pfGUIDialogMod(); virtual void read(hsStream* S, plResManager* mgr); virtual void write(hsStream* S, plResManager* mgr); protected: virtual void IPrcWrite(pfPrcHelper* prc); virtual void IPrcParse(const pfPrcTag* tag, plResManager* mgr); public: const std::vector<plKey>& getControls() const { return fControls; } std::vector<plKey>& getControls() { return fControls; } void addControl(plKey ctrl) { fControls.push_back(ctrl); } void delControl(size_t idx) { fControls.erase(fControls.begin() + idx); } void clearControls() { fControls.clear(); } unsigned int getTagID() const { return fTagID; } unsigned int getVersion() const { return fVersion; } plKey getRenderMod() const { return fRenderMod; } plString getName() const { return fName; } plKey getProcReceiver() const { return fProcReceiver; } plKey getSceneNode() const { return fSceneNode; } void setTagID(unsigned int id) { fTagID = id; } void setVersion(unsigned int version) { fVersion = version; } void setRenderMod(plKey mod) { fRenderMod = mod; } void setName(const char* name) { strncpy(fName, name, 128); } void setProcReceiver(plKey receiver) { fProcReceiver = receiver; } void setSceneNode(plKey node) { fSceneNode = node; } const pfGUIColorScheme& getColorScheme() const { return fColorScheme; } pfGUIColorScheme& getColorScheme() { return fColorScheme; } }; #endif
/*******************************************************************************\ * map.c -- Using GUI. * * Copyright (C) 2015 Teofanes Enrique Paz Moron <teofanesp12@gmail.com> * * * * FireZero 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/>. * *******************************************************************************/ void create_map(){ }
/* * LibrePCB - Professional EDA for everyone! * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors. * https://librepcb.org/ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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 LIBREPCB_TEXT_H #define LIBREPCB_TEXT_H /******************************************************************************* * Includes ******************************************************************************/ #include "../alignment.h" #include "../fileio/cmd/cmdlistelementinsert.h" #include "../fileio/cmd/cmdlistelementremove.h" #include "../fileio/cmd/cmdlistelementsswap.h" #include "../fileio/serializableobjectlist.h" #include "../graphics/graphicslayername.h" #include "../units/all_length_units.h" #include <QtCore> /******************************************************************************* * Namespace / Forward Declarations ******************************************************************************/ namespace librepcb { /******************************************************************************* * Class Text ******************************************************************************/ /** * @brief The Text class */ class Text final : public SerializableObject { Q_DECLARE_TR_FUNCTIONS(Text) public: // Signals enum class Event { UuidChanged, LayerNameChanged, TextChanged, PositionChanged, RotationChanged, HeightChanged, AlignChanged, }; Signal<Text, Event> onEdited; typedef Slot<Text, Event> OnEditedSlot; // Constructors / Destructor Text() = delete; Text(const Text& other) noexcept; Text(const Uuid& uuid, const Text& other) noexcept; Text(const Uuid& uuid, const GraphicsLayerName& layerName, const QString& text, const Point& pos, const Angle& rotation, const PositiveLength& height, const Alignment& align) noexcept; explicit Text(const SExpression& node); ~Text() noexcept; // Getters const Uuid& getUuid() const noexcept { return mUuid; } const GraphicsLayerName& getLayerName() const noexcept { return mLayerName; } const Point& getPosition() const noexcept { return mPosition; } const Angle& getRotation() const noexcept { return mRotation; } const PositiveLength& getHeight() const noexcept { return mHeight; } const Alignment& getAlign() const noexcept { return mAlign; } const QString& getText() const noexcept { return mText; } // Setters bool setLayerName(const GraphicsLayerName& name) noexcept; bool setText(const QString& text) noexcept; bool setPosition(const Point& pos) noexcept; bool setRotation(const Angle& rotation) noexcept; bool setHeight(const PositiveLength& height) noexcept; bool setAlign(const Alignment& align) noexcept; /// @copydoc librepcb::SerializableObject::serialize() void serialize(SExpression& root) const override; // Operator Overloadings bool operator==(const Text& rhs) const noexcept; bool operator!=(const Text& rhs) const noexcept { return !(*this == rhs); } Text& operator=(const Text& rhs) noexcept; private: // Data Uuid mUuid; GraphicsLayerName mLayerName; QString mText; Point mPosition; Angle mRotation; PositiveLength mHeight; Alignment mAlign; }; /******************************************************************************* * Class TextList ******************************************************************************/ struct TextListNameProvider { static constexpr const char* tagname = "text"; }; using TextList = SerializableObjectList<Text, TextListNameProvider, Text::Event>; using CmdTextInsert = CmdListElementInsert<Text, TextListNameProvider, Text::Event>; using CmdTextRemove = CmdListElementRemove<Text, TextListNameProvider, Text::Event>; using CmdTextsSwap = CmdListElementsSwap<Text, TextListNameProvider, Text::Event>; /******************************************************************************* * End of File ******************************************************************************/ } // namespace librepcb #endif // LIBREPCB_TEXT_H
/* * src/iowait.c * * 2016-01-01 written by Hoyleeson <hoyleeson@gmail.com> * Copyright (C) 2015-2016 by Hoyleeson. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; version 2. * */ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <include/iowait.h> #include <include/hash.h> #define RES_SLOT_SHIFT (6) #define RES_SLOT_CAPACITY (1 << RES_SLOT_SHIFT) #define RES_SLOT_MASK (RES_SLOT_CAPACITY - 1) int iowait_init(iowait_t *wait) { int i; pthread_mutex_init(&wait->lock, NULL); wait->slots = malloc(sizeof(struct hlist_head) * RES_SLOT_CAPACITY); for (i = 0; i < RES_SLOT_CAPACITY; i++) INIT_HLIST_HEAD(&wait->slots[i]); return 0; } static struct hlist_head *watcher_slot_head(iowait_t *wait, int type, int seq) { unsigned long key; key = type << 16 | seq; key = hash_long(key, RES_SLOT_SHIFT); return &wait->slots[key]; } void iowait_watcher_init(iowait_watcher_t *watcher, int type, int seq, void *result, int count) { watcher->type = type; watcher->seq = seq; watcher->res = result; watcher->count = count; init_completion(&watcher->done); } int iowait_register_watcher(iowait_t *wait, iowait_watcher_t *watcher) { struct hlist_head *rsh; rsh = watcher_slot_head(wait, watcher->type, watcher->seq); pthread_mutex_lock(&wait->lock); hlist_add_head(&watcher->hentry, rsh); pthread_mutex_unlock(&wait->lock); return 0; } int wait_for_response_data(iowait_t *wait, iowait_watcher_t *watcher, int *res) { int ret; ret = wait_for_completion_timeout(&watcher->done, WAIT_RES_DEAD_LINE); if (res != NULL) *res = watcher->count; pthread_mutex_lock(&wait->lock); hlist_del_init(&watcher->hentry); pthread_mutex_unlock(&wait->lock); return ret; } int post_response_data(iowait_t *wait, int type, int seq, void *result, int count) { iowait_watcher_t *watcher = NULL; struct hlist_head *rsh; struct hlist_node *tmp; rsh = watcher_slot_head(wait, type, seq); pthread_mutex_lock(&wait->lock); hlist_for_each_entry(watcher, tmp, rsh, hentry) { if (watcher->type == type && watcher->seq == seq) { pthread_mutex_unlock(&wait->lock); goto found; } } pthread_mutex_unlock(&wait->lock); return -EINVAL; found: if ((watcher->count == 0) || (watcher->count != 0 && watcher->count > count)) watcher->count = count; memcpy(watcher->res, result, watcher->count); complete(&watcher->done); return 0; } int wait_for_response(iowait_t *wait, iowait_watcher_t *watcher) { return wait_for_response_data(wait, watcher, NULL); } int post_response(iowait_t *wait, int type, int seq, void *result, void (*fn)(void *dst, void *src)) { struct hlist_head *rsh; struct hlist_node *r; iowait_watcher_t *watcher; rsh = watcher_slot_head(wait, type, seq); pthread_mutex_lock(&wait->lock); hlist_for_each_entry(watcher, r, rsh, hentry) { if (watcher->type == type && watcher->seq == seq) { pthread_mutex_unlock(&wait->lock); goto found; } } pthread_mutex_unlock(&wait->lock); return -EINVAL; found: fn(watcher->res, result); complete(&watcher->done); return 0; }
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #ifndef MATERIALPROXYFACTORY_H #define MATERIALPROXYFACTORY_H #pragma once #include "materialsystem/imaterialproxyfactory.h" class CMaterialProxyFactory : public IMaterialProxyFactory { public: IMaterialProxy *CreateProxy( const char *proxyName ); void DeleteProxy( IMaterialProxy *pProxy ); }; #endif // MATERIALPROXYFACTORY_H
#ifndef INCLUDE_KERNEL_TERMIOS_H_ #define INCLUDE_KERNEL_TERMIOS_H_ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; #define NCCS 19 struct termios { tcflag_t c_iflag; /* input mode flags */ tcflag_t c_oflag; /* output mode flags */ tcflag_t c_cflag; /* control mode flags */ tcflag_t c_lflag; /* local mode flags */ cc_t c_line; /* line discipline */ cc_t c_cc[NCCS]; /* control characters */ }; /* c_cc characters */ #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VTIME 5 #define VMIN 6 #define VSWTC 7 #define VSTART 8 #define VSTOP 9 #define VSUSP 10 #define VEOL 11 #define VREPRINT 12 #define VDISCARD 13 #define VWERASE 14 #define VLNEXT 15 #define VEOL2 16 #ifdef __KERNEL__ /* intr=^C quit=^\ erase=del kill=^U eof=^D vtime=\0 vmin=\1 sxtc=\0 start=^Q stop=^S susp=^Z eol=\0 reprint=^R discard=^U werase=^W lnext=^V eol2=\0 */ #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" #endif /* c_iflag bits */ #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IUCLC 0001000 #define IXON 0002000 #define IXANY 0004000 #define IXOFF 0010000 #define IMAXBEL 0020000 /* c_oflag bits */ #define OPOST 0000001 #define OLCUC 0000002 #define ONLCR 0000004 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #define NLDLY 0000400 #define NL0 0000000 #define NL1 0000400 #define CRDLY 0003000 #define CR0 0000000 #define CR1 0001000 #define CR2 0002000 #define CR3 0003000 #define TABDLY 0014000 #define TAB0 0000000 #define TAB1 0004000 #define TAB2 0010000 #define TAB3 0014000 #define XTABS 0014000 #define BSDLY 0020000 #define BS0 0000000 #define BS1 0020000 #define VTDLY 0040000 #define VT0 0000000 #define VT1 0040000 #define FFDLY 0100000 #define FF0 0000000 #define FF1 0100000 /* c_cflag bit meaning */ #define CBAUD 0010017 #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 #define EXTA B19200 #define EXTB B38400 #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 #define CS8 0000060 #define CSTOPB 0000100 #define CREAD 0000200 #define PARENB 0000400 #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 #define CBAUDEX 0010000 #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define CIBAUD 002003600000 /* input baud rate (not used) */ #define CRTSCTS 020000000000 /* flow control */ /* c_lflag bits */ #define ISIG 0000001 #define ICANON 0000002 #define XCASE 0000004 #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define TOSTOP 0000400 #define ECHOCTL 0001000 #define ECHOPRT 0002000 #define ECHOKE 0004000 #define FLUSHO 0010000 #define PENDIN 0040000 #define IEXTEN 0100000 /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 #define TCION 3 /* tcflush() and TCFLSH use these */ #define TCIFLUSH 0 #define TCOFLUSH 1 #define TCIOFLUSH 2 /* tcsetattr uses these */ #define TCSANOW 0 #define TCSADRAIN 1 #define TCSAFLUSH 2 #endif /* INCLUDE_KERNEL_TERMIOS_H_ */
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: ../pdfreporter-core/src/org/oss/pdfreporter/engine/util/MD5Digest.java // #include "J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_OrgOssPdfreporterEngineUtilMD5Digest") #ifdef RESTRICT_OrgOssPdfreporterEngineUtilMD5Digest #define INCLUDE_ALL_OrgOssPdfreporterEngineUtilMD5Digest 0 #else #define INCLUDE_ALL_OrgOssPdfreporterEngineUtilMD5Digest 1 #endif #undef RESTRICT_OrgOssPdfreporterEngineUtilMD5Digest #if !defined (OrgOssPdfreporterEngineUtilMD5Digest_) && (INCLUDE_ALL_OrgOssPdfreporterEngineUtilMD5Digest || defined(INCLUDE_OrgOssPdfreporterEngineUtilMD5Digest)) #define OrgOssPdfreporterEngineUtilMD5Digest_ #define RESTRICT_JavaIoSerializable 1 #define INCLUDE_JavaIoSerializable 1 #include "java/io/Serializable.h" @interface OrgOssPdfreporterEngineUtilMD5Digest : NSObject < JavaIoSerializable > #pragma mark Public - (instancetype)initWithLong:(jlong)low withLong:(jlong)high; - (jboolean)isEqual:(id)obj; - (NSUInteger)hash; - (NSString *)description; @end J2OBJC_EMPTY_STATIC_INIT(OrgOssPdfreporterEngineUtilMD5Digest) FOUNDATION_EXPORT void OrgOssPdfreporterEngineUtilMD5Digest_initWithLong_withLong_(OrgOssPdfreporterEngineUtilMD5Digest *self, jlong low, jlong high); FOUNDATION_EXPORT OrgOssPdfreporterEngineUtilMD5Digest *new_OrgOssPdfreporterEngineUtilMD5Digest_initWithLong_withLong_(jlong low, jlong high) NS_RETURNS_RETAINED; FOUNDATION_EXPORT OrgOssPdfreporterEngineUtilMD5Digest *create_OrgOssPdfreporterEngineUtilMD5Digest_initWithLong_withLong_(jlong low, jlong high); J2OBJC_TYPE_LITERAL_HEADER(OrgOssPdfreporterEngineUtilMD5Digest) #endif #pragma pop_macro("INCLUDE_ALL_OrgOssPdfreporterEngineUtilMD5Digest")
// Pekka Pirila's sports timekeeping program (Finnish: tulospalveluohjelma) // Copyright (C) 2015 Pekka Pirila // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //--------------------------------------------------------------------------- #ifndef UnitLahestyjatH #define UnitLahestyjatH //--------------------------------------------------------------------------- #include <System.Classes.hpp> #include <Vcl.Controls.hpp> #include <Vcl.StdCtrls.hpp> #include <Vcl.Forms.hpp> #include <Vcl.Grids.hpp> #include "VDef.h" #include <Vcl.ExtCtrls.hpp> #define NLAHEST 4 #define MAXLAHCOL 5 class lahIkkParamClass { public: int FontSize; int ColW[MAXLAHCOL]; int ColOn[MAXLAHCOL]; lahIkkParamClass(void); // void operator=(lahIkkParamClass&); int writeParams(TextFl *outfl, int level); int readParams(xml_node *node, int *inode, int nnode); }; typedef cellTp rowTplah[MAXLAHCOL]; //--------------------------------------------------------------------------- class TFormLahestyjat : public TForm { __published: // IDE-managed Components TDrawGrid *DG1; TLabel *Label1; TLabel *Label2; TComboBox *CBSarja; TLabel *Label3; TComboBox *CBOsuus; TLabel *Label4; TComboBox *CBPiste; TRadioGroup *RGFont; void __fastcall DG1DrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect, TGridDrawState State); void __fastcall FormResize(TObject *Sender); void __fastcall FormShow(TObject *Sender); void __fastcall RGFontClick(TObject *Sender); void __fastcall CBSarjaClick(TObject *Sender); void __fastcall CBOsuusChange(TObject *Sender); void __fastcall CBPisteClick(TObject *Sender); private: // User declarations rowTplah *Cells; int CellRows; public: // User declarations __fastcall TFormLahestyjat(TComponent* Owner); void __fastcall Paivita(TObject *Sender); lahIkkParamClass IkkParam; int applyParams(void); int Sarja; int Osuus; int Piste; int maxSeur; }; //--------------------------------------------------------------------------- extern PACKAGE TFormLahestyjat *FormLahestyjat[NLAHEST]; //--------------------------------------------------------------------------- #endif
// Copyright CERN and copyright holders of ALICE O2. This software is // distributed under the terms of the GNU General Public License v3 (GPL // Version 3), copied verbatim in the file "COPYING". // // See http://alice-o2.web.cern.ch/license for full licensing information. // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// \file PadResponse.h /// \brief Definition of the Pad Response /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de #ifndef ALICEO2_TPC_PadResponse_H_ #define ALICEO2_TPC_PadResponse_H_ #include "TGraph2D.h" #include "TPCBase/Mapper.h" namespace o2 { namespace TPC { /// \class PadResponse /// This class deals with the induction of the signal on the pad plane. /// The actual Pad Response Function (PRF) is simulated with Garfield++/COMSOL and dumped to a file. /// This file is read by this class and dumped to a TGraph2D for each pad size individually (IROC / OROC1-2 / OROC3). /// The pad response is then computed by evaluating this TGraph2D for a given pad size by evaluating the PRF at the electron position with respect to the pad centre. class PadResponse { public: /// Default constructor PadResponse(); /// Destructor virtual ~PadResponse()=default; /// Import the PRF from a .dat file to a TGraph2D /// \param file Name of the .dat file /// \param grPRF TGraph2D to which the PRF will be written /// \return Boolean if succesful or not bool importPRF(std::string file, std::unique_ptr<TGraph2D>& grPRF) const; /// Compute the impact of the pad response for electrons arriving at the GEM stack /// \param posEle Position of the electron in real space /// \param digiPadPos Position of the electron in pad space /// \return Normalized pad response float getPadResponse(GlobalPosition3D posEle, DigitPos digiPadPos) const; private: std::unique_ptr<TGraph2D> mIROC; ///< TGraph2D holding the PRF for the IROC (4x7.5 mm2 pads) std::unique_ptr<TGraph2D> mOROC12; ///< TGraph2D holding the PRF for the OROC1 and OROC2 (6x10 mm2 pads) std::unique_ptr<TGraph2D> mOROC3; ///< TGraph2D holding the PRF for the OROC3 (6x15 mm2 pads) }; } } #endif // ALICEO2_TPC_PadResponse_H_
/// @addtogroup vectalg /// @{ ///////////////////////////////////////////////////////////////////////////// /// @file Vector.h /// /// @author The CAPD Group ///////////////////////////////////////////////////////////////////////////// // Copyright (C) 2000-2005 by the CAPD Group. // // This file constitutes a part of the CAPD library, // distributed under the terms of the GNU General Public License. // Consult http://capd.wsb-nlu.edu.pl/ for details. #ifndef _CAPD_VECTALG_EMPTYINTERSECTIONEXCEPTION_H_ #define _CAPD_VECTALG_EMPTYINTERSECTIONEXCEPTION_H_ #include <stdexcept> class EmptyIntersectionException : public std::runtime_error{ public: EmptyIntersectionException(const char * msg):std::runtime_error(msg){ } }; #endif /* _CAPD_VECTALG_EMPTYINTERSECTIONEXCEPTION_H_ */ /// @}
#include <stdio.h> #include <inttypes.h> static uint64_t next_code(uint64_t prev_code) { return (prev_code * 252533LL) % 33554393LL; } int main() { uint64_t first_code = 20151125LL; int row = 1; int col = 1; while (row != 2947 || col != 3029) { first_code = next_code(first_code); if (row == 1) { row = col + 1; col = 1; } else { row--; col++; } } printf("%d %d %llu\n", row, col, first_code); }
/* * Copyright (C) 2006 Isabel Dietrich <isabel.dietrich@informatik.uni-erlangen.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MOBILITY_STATICGRIDMOBILITY_H #define MOBILITY_STATICGRIDMOBILITY_H // SYSTEM INCLUDES #include <omnetpp.h> #include "BasicMobility.h" /** * @brief Mobility model which places all hosts at constant distances * within the simulation area (resulting in a regular grid). * * @ingroup mobility * @author Isabel Dietrich */ class INET_API StaticGridMobility : public BasicMobility { public: // LIFECYCLE virtual void initialize(int); virtual void finish(); /** @brief Called upon arrival of a self messages */ virtual void handleSelfMsg(cMessage *msg) {} private: // MEMBER VARIABLES double marginX; double marginY; int mNumHosts; }; #endif
/************************************************************************ * FILE NAME: iaibase.h * * DESCRIPTION: iAIBase interface Class ************************************************************************/ #ifndef __i_ai_base_h__ #define __i_ai_base_h__ // Forward declaration(s) union SDL_Event; class iAIBase { public: // Constructor iAIBase(){}; // Destructor virtual ~iAIBase(){}; // Do any initializing virtual void init(){}; // Handle player related messages virtual void handleEvent( const SDL_Event & rEvent ){}; // Update animations, move sprites, etc. virtual void update(){}; // Update the physics virtual void physicsUpdate(){}; }; #endif // __i_ai_base_h__
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ /* link this file in with the server and any clients */ /* File created by MIDL compiler version 8.00.0595 */ /* at Tue Jun 04 18:11:01 2013 */ /* Compiler settings for BUSMASTER.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ /* @@MIDL_FILE_HEADING( ) */ #pragma warning( disable: 4049 ) /* more than 64k source lines */ #ifdef __cplusplus extern "C"{ #endif #include <rpc.h> #include <rpcndr.h> #ifdef _MIDL_USE_GUIDDEF_ #ifndef INITGUID #define INITGUID #include <guiddef.h> #undef INITGUID #else #include <guiddef.h> #endif #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) #else // !_MIDL_USE_GUIDDEF_ #ifndef __IID_DEFINED__ #define __IID_DEFINED__ typedef struct _IID { unsigned long x; unsigned short s1; unsigned short s2; unsigned char c[8]; } IID; #endif // __IID_DEFINED__ #ifndef CLSID_DEFINED #define CLSID_DEFINED typedef IID CLSID; #endif // CLSID_DEFINED #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} #endif !_MIDL_USE_GUIDDEF_ MIDL_DEFINE_GUID(IID, LIBID_CAN_MonitorApp,0xC3F9B41A,0xD3AD,0x4b36,0xBA,0x65,0xC5,0xC2,0xF1,0xA3,0x14,0xD9); MIDL_DEFINE_GUID(IID, IID__IAppEvents,0x12324088,0x748E,0x4017,0xBA,0x5A,0x3B,0x7F,0x61,0xCE,0x8F,0xBF); MIDL_DEFINE_GUID(IID, IID_IApplication,0xB3DBF7E2,0x93DD,0x4c0c,0xA2,0x37,0x0E,0x8E,0x46,0xD3,0x54,0xC6); MIDL_DEFINE_GUID(CLSID, CLSID_Application,0x92D435C1,0xA552,0x4435,0xAD,0x1E,0x46,0x8B,0x4C,0x17,0xBD,0xC7); #undef MIDL_DEFINE_GUID #ifdef __cplusplus } #endif
#pragma once #include <SDL2/SDL.h> #include <array> // Simple bitmap font with alphabet loaded from "one-line" image class BitmapFont { public: BitmapFont(SDL_Renderer* rend, const std::string& path, int charWidth, const std::string& alphabet); BitmapFont(const BitmapFont&) = delete; BitmapFont(BitmapFont&&) = delete; BitmapFont& operator=(const BitmapFont&) = delete; BitmapFont& operator=(BitmapFont&&) = delete; virtual ~BitmapFont(); SDL_Renderer* GetRenderer() { return m_renderer; } void DrawText(const std::string& line, int x, int y, int fontSize = 14) const; private: static constexpr auto VISIBLE_ALPHABET_START = ' '; static constexpr auto VISIBLE_ALPHABET_END = '~'; static constexpr auto VISIBLE_ALPHABET_SIZE = VISIBLE_ALPHABET_END - VISIBLE_ALPHABET_START + 1u; std::array<int, VISIBLE_ALPHABET_SIZE> m_alphabet; SDL_Renderer* m_renderer; SDL_Texture* m_bitmap; // int due to SDL2 int m_bitmapHeight; int m_bitmapCharWidth; bool InsideVisibleAlphabet(char c) const { return c >= VISIBLE_ALPHABET_START && c <= VISIBLE_ALPHABET_END; } };
/* * This file is part of RawTherapee. * * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com> * * RawTherapee 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. * * RawTherapee 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 RawTherapee. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _EDITENUMS_ #define _EDITENUMS_ enum ImgEditState {SNormal, SCropMove, SHandMove, SResizeW1, SResizeW2, SResizeH1, SResizeH2, SResizeTL, SResizeTR, SResizeBL, SResizeBR, SCropSelecting, SRotateSelecting, SCropWinMove, SCropFrameMove, SCropImgMove, SCropWinResize, SObservedMove, SEditDrag}; enum CursorArea {CropWinButtons, CropToolBar, CropImage, CropBorder, CropTop, CropTopLeft, CropTopRight, CropBottom, CropBottomLeft, CropBottomRight, CropLeft, CropRight, CropInside, CropResize, CropObserved}; #endif
/** * @file _hac_vec_it.h * @brief Iterators. Yes. * Macros: * HAC_IT_T() * HAC_ARR_IT_INIT() * HAC_ARR_IT() * HAC_VEC_IT_INIT() * HAC_VEC_IT() * HAC_SEQ_IT_INIT() * HAC_SEQ_IT() * HAC_CUSTOM_IT() * Forward: * HAC_IT_COPY() * HAC_IT_NEXT() * HAC_IT_V() * HAC_IT_EQ() * Bidirectional: * HAC_IT_PREV() * Random Access: * HAC_IT_NEXT_BY() * HAC_IT_PREV_BY() * HAC_IT_COMP() * HAC_IT_GET() */ /** * @brief expands to the iterator type for a vector with base type base_t, of the form __HAC_VEC_##base_t##_T##I. * This identifier should be typedefed by HAC_VEC_IT_INIT(). This might be * used like HAC_VEC_IT_T(int), which is in fact equivalent to HAC_IT_T(HAC_VEC_T(int)). * @param base_t the base type. */ #define HAC_VEC_IT_T(base_t) HAC_IT_T(HAC_VEC_T(base_t)) /** * @brief set up the proper typedefs and function definitions for a vector iterator of base type base_t. * The names __HAC_VEC_##base_t##_T##I, __HAC_VEC_##base_t##_T##I##_nextBy, and __HAC_VEC_##base_t##_T##I##_get * are defined. * @param base_t the base type. */ #define HAC_VEC_IT_INIT(base_t) \ typedef struct HAC_VEC_IT_T(base_t) HAC_VEC_IT_T(base_t); \ struct HAC_VEC_IT_T(base_t){ \ HAC_IT_INTERFACE intr; \ base_t *v; \ HAC_VEC_T(base_t) *ctnr; \ size_t pos; \ base_t *(*nextBy)(HAC_VEC_IT_T(base_t)*, ptrdiff_t n); \ base_t *(*get)(HAC_VEC_IT_T(base_t)*, ptrdiff_t n); \ }; \ base_t *HAC_PASTE(HAC_VEC_IT_T(base_t), _nextBy)(HAC_VEC_IT_T(base_t) *self, ptrdiff_t n){\ self->pos += n; \ return self->v = self->ctnr->a + self->pos; \ } \ base_t *HAC_PASTE(HAC_VEC_IT_T(base_t), _get)(HAC_VEC_IT_T(base_t) *self, ptrdiff_t n){\ return self->ctnr->a + self->pos + n; \ } /** * @brief creates a random access iterator for a vector. */ #define HAC_VEC_IT(base_t, vec) ({ \ HAC_AUTO_T(vec) _vec = (vec); \ (HAC_VEC_IT_T(base_t)){ \ .intr = HAC_IT_RANDOM_ACCESS, \ .v = _vec->a, \ .ctnr = _vec, \ .pos = 0, \ .nextBy = HAC_PASTE(HAC_VEC_IT_T(base_t), _nextBy), \ .get = HAC_PASTE(HAC_VEC_IT_T(base_t), _get) \ }; \ })//END HAC_VEC_IT
/*===================================================================== QGroundControl Open Source Ground Control Station (c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> This file is part of the QGROUNDCONTROL project QGROUNDCONTROL 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. QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. ======================================================================*/ /** * @file * @brief Definition of the class Imagery. * * @author Lionel Heng <hengli@student.ethz.ch> * */ #ifndef IMAGERY_H #define IMAGERY_H #include <osg/Geode> #include <QScopedPointer> #include <QString> #include "TextureCache.h" class Imagery : public osg::Geode { public: enum ImageryType { BLANK_MAP = 0, GOOGLE_MAP = 1, GOOGLE_SATELLITE = 2, SWISSTOPO_SATELLITE = 3 }; Imagery(); ImageryType getImageryType(void) const; void setImageryType(ImageryType type); void setOffset(double xOffset, double yOffset); void prefetch2D(double windowWidth, double windowHeight, double zoom, double xOrigin, double yOrigin, const QString& utmZone); void draw2D(double windowWidth, double windowHeight, double zoom, double xOrigin, double yOrigin, double xOffset, double yOffset, double zOffset, const QString& utmZone); void prefetch3D(double radius, double tileResolution, double xOrigin, double yOrigin, const QString& utmZone); void draw3D(double radius, double tileResolution, double xOrigin, double yOrigin, double xOffset, double yOffset, double zOffset, const QString& utmZone); bool update(void); static void LLtoUTM(double latitude, double longitude, double& utmNorthing, double& utmEasting, QString& utmZone); static void UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone, double& latitude, double& longitude); private: void imageBounds(int tileX, int tileY, double tileResolution, double& x1, double& y1, double& x2, double& y2, double& x3, double& y3, double& x4, double& y4) const; void tileBounds(double tileResolution, double minUtmX, double minUtmY, double maxUtmX, double maxUtmY, const QString& utmZone, int& minTileX, int& minTileY, int& maxTileX, int& maxTileY, int& zoomLevel) const; double tileXToLongitude(int tileX, int numTiles) const; double tileYToLatitude(int tileY, int numTiles) const; int longitudeToTileX(double longitude, int numTiles) const; int latitudeToTileY(double latitude, int numTiles) const; void UTMtoTile(double northing, double easting, const QString& utmZone, double tileResolution, int& tileX, int& tileY, int& zoomLevel) const; static QChar UTMLetterDesignator(double latitude); QString getTileLocation(int tileX, int tileY, int zoomLevel, double tileResolution) const; QScopedPointer<TextureCache> textureCache; ImageryType currentImageryType; double xOffset; double yOffset; }; #endif // IMAGERY_H
#include <stdlib.h> #include <string.h> #include <stdio.h> #include "pdu_session_1.h" OpenAPI_pdu_session_1_t *OpenAPI_pdu_session_1_create( char *dnn, char *smf_instance_id, OpenAPI_plmn_id_1_t *plmn_id, OpenAPI_snssai_t *single_nssai ) { OpenAPI_pdu_session_1_t *pdu_session_1_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_1_t)); if (!pdu_session_1_local_var) { return NULL; } pdu_session_1_local_var->dnn = dnn; pdu_session_1_local_var->smf_instance_id = smf_instance_id; pdu_session_1_local_var->plmn_id = plmn_id; pdu_session_1_local_var->single_nssai = single_nssai; return pdu_session_1_local_var; } void OpenAPI_pdu_session_1_free(OpenAPI_pdu_session_1_t *pdu_session_1) { if (NULL == pdu_session_1) { return; } OpenAPI_lnode_t *node; ogs_free(pdu_session_1->dnn); ogs_free(pdu_session_1->smf_instance_id); OpenAPI_plmn_id_1_free(pdu_session_1->plmn_id); OpenAPI_snssai_free(pdu_session_1->single_nssai); ogs_free(pdu_session_1); } cJSON *OpenAPI_pdu_session_1_convertToJSON(OpenAPI_pdu_session_1_t *pdu_session_1) { cJSON *item = NULL; if (pdu_session_1 == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [PduSession_1]"); return NULL; } item = cJSON_CreateObject(); if (cJSON_AddStringToObject(item, "dnn", pdu_session_1->dnn) == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [dnn]"); goto end; } if (cJSON_AddStringToObject(item, "smfInstanceId", pdu_session_1->smf_instance_id) == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [smf_instance_id]"); goto end; } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(pdu_session_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [plmn_id]"); goto end; } cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); if (item->child == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [plmn_id]"); goto end; } if (pdu_session_1->single_nssai) { cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(pdu_session_1->single_nssai); if (single_nssai_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [single_nssai]"); goto end; } cJSON_AddItemToObject(item, "singleNssai", single_nssai_local_JSON); if (item->child == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [single_nssai]"); goto end; } } end: return item; } OpenAPI_pdu_session_1_t *OpenAPI_pdu_session_1_parseFromJSON(cJSON *pdu_session_1JSON) { OpenAPI_pdu_session_1_t *pdu_session_1_local_var = NULL; cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [dnn]"); goto end; } if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [dnn]"); goto end; } cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "smfInstanceId"); if (!smf_instance_id) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [smf_instance_id]"); goto end; } if (!cJSON_IsString(smf_instance_id)) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [smf_instance_id]"); goto end; } cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [plmn_id]"); goto end; } OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "singleNssai"); OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; if (single_nssai) { single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); } pdu_session_1_local_var = OpenAPI_pdu_session_1_create ( ogs_strdup_or_assert(dnn->valuestring), ogs_strdup_or_assert(smf_instance_id->valuestring), plmn_id_local_nonprim, single_nssai ? single_nssai_local_nonprim : NULL ); return pdu_session_1_local_var; end: return NULL; } OpenAPI_pdu_session_1_t *OpenAPI_pdu_session_1_copy(OpenAPI_pdu_session_1_t *dst, OpenAPI_pdu_session_1_t *src) { cJSON *item = NULL; char *content = NULL; ogs_assert(src); item = OpenAPI_pdu_session_1_convertToJSON(src); if (!item) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed"); return NULL; } content = cJSON_Print(item); cJSON_Delete(item); if (!content) { ogs_error("cJSON_Print() failed"); return NULL; } item = cJSON_Parse(content); ogs_free(content); if (!item) { ogs_error("cJSON_Parse() failed"); return NULL; } OpenAPI_pdu_session_1_free(dst); dst = OpenAPI_pdu_session_1_parseFromJSON(item); cJSON_Delete(item); return dst; }
/* * (c) Copyright Ascensio System SIA 2010-2014 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, * EU, LV-1021. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #ifndef OOX_WORKBOOK_FILE_INCLUDE_H_ #define OOX_WORKBOOK_FILE_INCLUDE_H_ #include "../../Base/Nullable.h" #include "FileTypes.h" namespace OOX { namespace Spreadsheet { class CWorkbook : public OOX::File, public IFileContainer { public: CWorkbook() { } CWorkbook(const CPath& oPath) { } virtual ~CWorkbook() { } public: virtual void read(const CPath& oPath) { } virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const { } virtual const OOX::FileType type() const { return OOX::Spreadsheet::FileTypes::Workbook; } virtual const CPath DefaultDirectory() const { return type().DefaultDirectory(); } virtual const CPath DefaultFileName() const { return type().DefaultFileName(); } const CPath& GetReadPath() { return m_oReadPath; } public: void ClearItems() { } private: CPath m_oReadPath; void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { WritingElement_ReadAttributes_Start( oReader ) WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:conformance"), m_oConformance ) WritingElement_ReadAttributes_End( oReader ) } public: CSimpleArray<WritingElement *> m_arrItems; }; } } #endif // OOX_WORKBOOK_FILE_INCLUDE_H_
#ifndef _HYDRA_MOD_H #define _HYDRA_MOD_H #include "hydra.h" extern char quiet; extern void hydra_child_exit(int code); extern void hydra_register_socket(int s); extern char *hydra_get_next_pair(); extern char *hydra_get_next_login(); extern char *hydra_get_next_password(); extern void hydra_completed_pair(); extern void hydra_completed_pair_found(); extern void hydra_completed_pair_skip(); extern void hydra_report_found(int port, char *svc, FILE * fp); extern void hydra_report_pass_found(int port, char *ip, char *svc, FILE * fp); extern void hydra_report_found_host(int port, char *ip, char *svc, FILE * fp); extern void hydra_report_found_host_msg(int port, char *ip, char *svc, FILE * fp, char *msg); extern void hydra_report_debug(FILE *st, char *format, ...); extern int hydra_connect_to_ssl(int socket, char *hostname); extern int hydra_connect_ssl(char *host, int port, char *hostname); extern int hydra_connect_tcp(char *host, int port); extern int hydra_connect_udp(char *host, int port); extern int hydra_disconnect(int socket); extern int hydra_data_ready(int socket); extern int hydra_recv(int socket, char *buf, int length); extern int hydra_recv_nb(int socket, char *buf, int length); extern char *hydra_receive_line(int socket); extern int hydra_send(int socket, char *buf, int size, int options); extern int make_to_lower(char *buf); extern unsigned char hydra_conv64(unsigned char in); extern void hydra_tobase64(unsigned char *buf, int buflen, int bufsize); extern void hydra_dump_asciihex(unsigned char *string, int length); extern void hydra_set_srcport(int port); extern char *hydra_address2string(char *address); extern char *hydra_strcasestr(const char *haystack, const char *needle); extern void hydra_dump_data(unsigned char *buf, int len, char *text); extern int hydra_memsearch(char *haystack, int hlen, char *needle, int nlen); extern char *hydra_strrep(char *string, char *oldpiece, char *newpiece); #ifdef HAVE_PCRE int hydra_string_match(char *str, const char *regex); #endif char *hydra_string_replace(const char *string, const char *substr, const char *replacement); int debug; int verbose; int waittime; int port; int found; int proxy_count; int use_proxy; int selected_proxy; char proxy_string_ip[MAX_PROXY_COUNT][36]; int proxy_string_port[MAX_PROXY_COUNT]; char proxy_string_type[MAX_PROXY_COUNT][10]; char *proxy_authentication[MAX_PROXY_COUNT]; char *cmdlinetarget; typedef int BOOL; #define hydra_report fprintf #endif
/******************************************************************************* Copyright 2013-2015 Ben Wojtowicz 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/>. ******************************************************************************* File: LTE_fdd_enb_pdcp.h Description: Contains all the definitions for the LTE FDD eNodeB packet data convergence protocol layer. Revision History ---------- ------------- -------------------------------------------- 11/09/2013 Ben Wojtowicz Created file 05/04/2014 Ben Wojtowicz Added communication to RLC and RRC. 11/29/2014 Ben Wojtowicz Added communication to IP gateway. 12/16/2014 Ben Wojtowicz Added ol extension to message queues. 02/15/2015 Ben Wojtowicz Moved to new message queue. *******************************************************************************/ #ifndef __LTE_FDD_ENB_PDCP_H__ #define __LTE_FDD_ENB_PDCP_H__ /******************************************************************************* INCLUDES *******************************************************************************/ #include "LTE_fdd_enb_cnfg_db.h" #include "LTE_fdd_enb_msgq.h" #include <boost/thread/mutex.hpp> #include <boost/interprocess/ipc/message_queue.hpp> /******************************************************************************* DEFINES *******************************************************************************/ /******************************************************************************* FORWARD DECLARATIONS *******************************************************************************/ /******************************************************************************* TYPEDEFS *******************************************************************************/ /******************************************************************************* CLASS DECLARATIONS *******************************************************************************/ class LTE_fdd_enb_pdcp { public: // Singleton static LTE_fdd_enb_pdcp* get_instance(void); static void cleanup(void); // Start/Stop void start(LTE_fdd_enb_msgq *from_rlc, LTE_fdd_enb_msgq *from_rrc, LTE_fdd_enb_msgq *from_gw, LTE_fdd_enb_msgq *to_rlc, LTE_fdd_enb_msgq *to_rrc, LTE_fdd_enb_msgq *to_gw, LTE_fdd_enb_interface *iface); void stop(void); // External interface void update_sys_info(void); private: // Singleton static LTE_fdd_enb_pdcp *instance; LTE_fdd_enb_pdcp(); ~LTE_fdd_enb_pdcp(); // Start/Stop LTE_fdd_enb_interface *interface; boost::mutex start_mutex; bool started; // Communication void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg); void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg); void handle_gw_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg); LTE_fdd_enb_msgq *msgq_from_rlc; LTE_fdd_enb_msgq *msgq_from_rrc; LTE_fdd_enb_msgq *msgq_from_gw; LTE_fdd_enb_msgq *msgq_to_rlc; LTE_fdd_enb_msgq *msgq_to_rrc; LTE_fdd_enb_msgq *msgq_to_gw; // RLC Message Handlers void handle_pdu_ready(LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT *pdu_ready); // RRC Message Handlers void handle_sdu_ready(LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT *sdu_ready); // GW Message Handlers void handle_data_sdu_ready(LTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT *data_sdu_ready); // Parameters boost::mutex sys_info_mutex; LTE_FDD_ENB_SYS_INFO_STRUCT sys_info; }; #endif /* __LTE_FDD_ENB_PDCP_H__ */
/* $Id: histogram_ex.c,v 1.11 2012/03/21 23:05:11 tom Exp $ */ #include <cdk_test.h> #ifdef HAVE_XCURSES char *XCursesProgramName = "histogram_ex"; #endif #if !defined (HAVE_SLEEP) && defined (_WIN32) /* Mingw */ #define sleep(x) _sleep(x*1000) #endif int main (int argc, char **argv) { /* *INDENT-EQLS* */ CDKSCREEN *cdkscreen = 0; CDKHISTOGRAM *volume = 0; CDKHISTOGRAM *bass = 0; CDKHISTOGRAM *treble = 0; WINDOW *cursesWin = 0; const char *volumeTitle = "<C></5>Volume<!5>"; const char *bassTitle = "<C></5>Bass <!5>"; const char *trebleTitle = "<C></5>Treble<!5>"; CDK_PARAMS params; boolean Box; CDKparseParams (argc, argv, &params, CDK_CLI_PARAMS); Box = CDKparamValue (&params, 'N', TRUE); /* Set up CDK. */ cursesWin = initscr (); cdkscreen = initCDKScreen (cursesWin); /* Start CDK Color. */ initCDKColor (); /* Create the histogram objects. */ volume = newCDKHistogram (cdkscreen, CDKparamValue (&params, 'X', 10), CDKparamValue (&params, 'Y', 10), CDKparamValue (&params, 'H', 1), CDKparamValue (&params, 'W', -2), HORIZONTAL, volumeTitle, Box, CDKparamValue (&params, 'S', FALSE)); if (volume == 0) { /* Exit CDK. */ destroyCDKScreen (cdkscreen); endCDK (); printf ("Cannot make volume histogram. Is the window big enough??\n"); ExitProgram (EXIT_FAILURE); } bass = newCDKHistogram (cdkscreen, CDKparamValue (&params, 'X', 10), CDKparamValue (&params, 'Y', 14), CDKparamValue (&params, 'H', 1), CDKparamValue (&params, 'W', -2), HORIZONTAL, bassTitle, Box, CDKparamValue (&params, 'S', FALSE)); if (bass == 0) { /* Exit CDK. */ destroyCDKHistogram (volume); destroyCDKScreen (cdkscreen); endCDK (); printf ("Cannot make bass histogram. Is the window big enough??\n"); ExitProgram (EXIT_FAILURE); } treble = newCDKHistogram (cdkscreen, CDKparamValue (&params, 'X', 10), CDKparamValue (&params, 'Y', 18), CDKparamValue (&params, 'H', 1), CDKparamValue (&params, 'W', -2), HORIZONTAL, trebleTitle, Box, CDKparamValue (&params, 'S', FALSE)); if (treble == 0) { /* Exit CDK. */ destroyCDKHistogram (volume); destroyCDKHistogram (bass); destroyCDKScreen (cdkscreen); endCDK (); printf ("Cannot make treble histogram. Is the window big enough??\n"); ExitProgram (EXIT_FAILURE); } #define BAR(a,b,c) A_BOLD, a, b, c, ' '|A_REVERSE|COLOR_PAIR(3), Box /* Set the histogram values. */ setCDKHistogram (volume, vPERCENT, CENTER, BAR (0, 10, 6)); setCDKHistogram (bass, vPERCENT, CENTER, BAR (0, 10, 3)); setCDKHistogram (treble, vPERCENT, CENTER, BAR (0, 10, 7)); refreshCDKScreen (cdkscreen); sleep (4); /* Set the histogram values. */ setCDKHistogram (volume, vPERCENT, CENTER, BAR (0, 10, 8)); setCDKHistogram (bass, vPERCENT, CENTER, BAR (0, 10, 1)); setCDKHistogram (treble, vPERCENT, CENTER, BAR (0, 10, 9)); refreshCDKScreen (cdkscreen); sleep (4); /* Set the histogram values. */ setCDKHistogram (volume, vPERCENT, CENTER, BAR (0, 10, 10)); setCDKHistogram (bass, vPERCENT, CENTER, BAR (0, 10, 7)); setCDKHistogram (treble, vPERCENT, CENTER, BAR (0, 10, 10)); refreshCDKScreen (cdkscreen); sleep (4); /* Set the histogram values. */ setCDKHistogram (volume, vPERCENT, CENTER, BAR (0, 10, 1)); setCDKHistogram (bass, vPERCENT, CENTER, BAR (0, 10, 8)); setCDKHistogram (treble, vPERCENT, CENTER, BAR (0, 10, 3)); refreshCDKScreen (cdkscreen); sleep (4); /* Set the histogram values. */ setCDKHistogram (volume, vPERCENT, CENTER, BAR (0, 10, 3)); setCDKHistogram (bass, vPERCENT, CENTER, BAR (0, 10, 3)); setCDKHistogram (treble, vPERCENT, CENTER, BAR (0, 10, 3)); refreshCDKScreen (cdkscreen); sleep (4); /* Set the histogram values. */ setCDKHistogram (volume, vPERCENT, CENTER, BAR (0, 10, 10)); setCDKHistogram (bass, vPERCENT, CENTER, BAR (0, 10, 10)); setCDKHistogram (treble, vPERCENT, CENTER, BAR (0, 10, 10)); refreshCDKScreen (cdkscreen); sleep (4); /* Clean up. */ destroyCDKHistogram (volume); destroyCDKHistogram (bass); destroyCDKHistogram (treble); destroyCDKScreen (cdkscreen); endCDK (); ExitProgram (EXIT_SUCCESS); }
/* * Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Essentia * * Essentia 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 (FSF), 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 Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ #ifndef ESSENTIA_GAIATRANSFORM_H #define ESSENTIA_GAIATRANSFORM_H #include <gaia2/transformation.h> #include "algorithm.h" #include "pool.h" namespace essentia { namespace standard { class GaiaTransform : public Algorithm { protected: Input<Pool> _inputPool; Output<Pool> _outputPool; // the history of the applied transformations in Gaia gaia2::TransfoChain _history; bool _configured; public: GaiaTransform() : _configured(false) { declareInput(_inputPool, "pool", "aggregated pool of extracted values"); declareOutput(_outputPool, "pool", "pool resulting from the transformation of the gaia point"); // call it from here, the place where it's gonna called less often gaia2::init(); } ~GaiaTransform(); void declareParameters() { declareParameter("history", "gaia2 history filename", "", Parameter::STRING); } void compute(); void configure(); void reset() {} static const char* name; static const char* description; }; } // namespace standard } // namespace essentia #endif // ESSENTIA_GAIATRANSFORM_H
/* * Copyright (c) 2008-2010 University of Utah and the Flux Group. * * {{{EMULAB-LICENSE * * This file is part of the Emulab network testbed software. * * This file 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 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 Affero General Public * License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this file. If not, see <http://www.gnu.org/licenses/>. * * }}} */ #include <stdio.h> #include <string.h> #include <err.h> #include <tss/tspi.h> #include <tss/platform.h> #include <tss/tss_typedef.h> #include <tss/tss_structs.h> #define TSS_ERROR_CODE(x) (x & 0xFFF) #define FATAL(x) do{printf("**\t");printf(x);printf("\n");}while(0); //#define FATAL(x) do{printf(x);printf("\n");exit(1);}while(0); void check(char *msg, int cin){ int in = TSS_ERROR_CODE(cin); printf("%s: ", msg); if(in == TSS_SUCCESS) printf("TSS_SUCCESS\n"); else if(in == TSS_E_INVALID_HANDLE) printf("TSS_E_INVALID_HANDLE\n"); else if(in == TSS_E_INTERNAL_ERROR) printf("TSS_E_INTERNAL_ERROR\n"); else if(in == TSS_E_BAD_PARAMETER) printf("TSS_E_BAD_PARAMETER\n"); else if(in == TSS_E_HASH_INVALID_LENGTH) printf("TSS_E_HASH_INVALID_LENGTH\n"); else if(in == TSS_E_HASH_NO_DATA) printf("TSS_E_HASH_NO_DATA\n"); else if(in == TSS_E_INVALID_SIGSCHEME) printf("TSS_E_INVALID_SIGSCHEME\n"); else if(in == TSS_E_HASH_NO_IDENTIFIER) printf("TSS_E_HASH_NO_IDENTIFIER\n"); else if(in == TSS_E_PS_KEY_NOTFOUND) printf("TSS_E_PS_KEY_NOTFOUND\n"); else if(in == TSS_E_BAD_PARAMETER) printf("TSS_E_BAD_PARAMETER\n"); else if(in == TSS_E_PS_KEY_NOTFOUND) printf("TSS_E_P_KEY_NOTFOUND\n"); else printf("Not here: 0x%x\n", in); return; } int main(void) { TSS_HCONTEXT hContext; TSS_HKEY hKey, hSRK; TSS_HPOLICY hPolicy; TSS_UUID srkUUID = TSS_UUID_SRK; TSS_UUID myuuid = {1,1,1,1,1,{1,1,1,1,1,1}}; TSS_HPOLICY srkpol; BYTE wellknown[20] = TSS_WELL_KNOWN_SECRET; int ret,i, blobos; BYTE *blobo; /* create context and connect */ ret = Tspi_Context_Create(&hContext); check("context create", ret); ret = Tspi_Context_Connect(hContext, NULL); check("context connect", ret); ret = Tspi_Context_LoadKeyByUUID(hContext, TSS_PS_TYPE_SYSTEM, srkUUID, &hSRK); check("loadkeybyuuid", ret); ret = Tspi_GetPolicyObject(hSRK, TSS_POLICY_USAGE, &srkpol); check("get policy object", ret); ret = Tspi_Policy_SetSecret(srkpol, TSS_SECRET_MODE_SHA1, 20, wellknown); check("policy set secret", ret); ret = Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_RSAKEY, //TSS_KEY_TYPE_STORAGE TSS_KEY_TYPE_IDENTITY //TSS_KEY_TYPE_SIGNING | TSS_KEY_SIZE_2048 | TSS_KEY_NO_AUTHORIZATION | TSS_KEY_NOT_MIGRATABLE , &hKey); check("create object - key", ret); ret = Tspi_Key_CreateKey(hKey, hSRK, 0); check("create key", ret); blobo = NULL; ret = Tspi_GetAttribData(hKey, TSS_TSPATTRIB_KEY_BLOB, TSS_TSPATTRIB_KEYBLOB_PUBLIC_KEY, &blobos, &blobo); check("get blob", ret); if (!blobo) FATAL("mexican"); printf("size: %d\n", blobos); for (i = 0;i < blobos; i++) { printf("\\x%x", blobo[i]); } printf("\n"); /* ret = Tspi_Context_RegisterKey(hContext, hKey, TSS_PS_TYPE_SYSTEM, myuuid, TSS_PS_TYPE_SYSTEM, srkUUID); check("register key", ret); */ Tspi_Context_FreeMemory(hContext, NULL); Tspi_Context_Close(hContext); return 0; }
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "NGAP-IEs" * found in "../support/ngap-r16.4.0/38413-g40.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER` */ #ifndef _NGAP_PDUSessionResourceSuspendItemSUSReq_H_ #define _NGAP_PDUSessionResourceSuspendItemSUSReq_H_ #include <asn_application.h> /* Including external dependencies */ #include "NGAP_PDUSessionID.h" #include <OCTET_STRING.h> #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct NGAP_ProtocolExtensionContainer; /* NGAP_PDUSessionResourceSuspendItemSUSReq */ typedef struct NGAP_PDUSessionResourceSuspendItemSUSReq { NGAP_PDUSessionID_t pDUSessionID; OCTET_STRING_t uEContextSuspendRequestTransfer; struct NGAP_ProtocolExtensionContainer *iE_Extensions; /* OPTIONAL */ /* * This type is extensible, * possible extensions are below. */ /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } NGAP_PDUSessionResourceSuspendItemSUSReq_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_NGAP_PDUSessionResourceSuspendItemSUSReq; extern asn_SEQUENCE_specifics_t asn_SPC_NGAP_PDUSessionResourceSuspendItemSUSReq_specs_1; extern asn_TYPE_member_t asn_MBR_NGAP_PDUSessionResourceSuspendItemSUSReq_1[3]; #ifdef __cplusplus } #endif #endif /* _NGAP_PDUSessionResourceSuspendItemSUSReq_H_ */ #include <asn_internal.h>
/******************************************************************************* GPU OPTIMIZED MONTE CARLO (GOMC) 2.70 Copyright (C) 2018 GOMC Group A copy of the GNU General Public License can be found in the COPYRIGHT.txt along with this program, also can be found at <http://www.gnu.org/licenses/>. ********************************************************************************/ #ifndef FORCEFIELD_H #define FORCEFIELD_H //Member classes #include "FFParticle.h" #include "FFBonds.h" #include "FFAngles.h" #include "FFDihedrals.h" namespace config_setup { //class FFValues; struct FFKind; //class Temperature; struct SystemVals; } class FFSetup; class Setup; class FFPrintout; struct FFParticle; class Forcefield { public: friend class FFPrintout; Forcefield(); ~Forcefield(); //Initialize contained FFxxxx structs from setup data void Init(const Setup& set); FFParticle * particles; //!<For LJ/Mie energy between unbonded atoms // for LJ, shift and switch type FFBonds bonds; //!<For bond stretching energy FFAngles * angles; //!<For 3-atom bending energy FFDihedrals dihedrals; //!<For 4-atom torsional rotation energy bool useLRC; //!<Use long-range tail corrections if true double T_in_K; //!<System temp in Kelvin double beta; //!<Thermodynamic beta = 1/(T) K^-1) double rCut, rCutSq; //!<Cutoff radius for LJ/Mie potential (angstroms) double rCutLow, rCutLowSq; //!<Cutoff min for Electrostatic (angstroms) double rCutCoulomb[BOX_TOTAL]; //!<Cutoff Coulomb interaction(angstroms) double rCutCoulombSq[BOX_TOTAL]; //!<Cutoff Coulomb interaction(angstroms) double alpha[BOX_TOTAL]; //Ewald sum terms double alphaSq[BOX_TOTAL]; //Ewald sum terms double recip_rcut[BOX_TOTAL]; //Ewald sum terms double recip_rcut_Sq[BOX_TOTAL]; //Ewald sum terms double tolerance; //Ewald sum terms double rswitch; //Switch distance double dielectric; //dielectric for martini double scaling_14; //!<Scaling factor for 1-4 pairs' ewald interactions double sc_alpha; // Free energy parameter double sc_sigma, sc_sigma_6; // Free energy parameter bool OneThree, OneFour, OneN; //To include 1-3, 1-4 and more interaction bool electrostatic, ewald; //To consider columb interaction bool vdwGeometricSigma; //For sigma combining rule bool isMartini; bool exp6; bool freeEnergy, sc_coul; // Free energy parameter uint vdwKind; //To define VdW type, standard, shift or switch uint exckind; //To define exclude kind, 1-2, 1-3, 1-4 uint sc_power; // Free energy parameter #if ENSEMBLE == GCMC bool isFugacity; //To check if we are using fugacity instead of chemical potential #endif private: //Initialize primitive member variables from setup data void InitBasicVals(config_setup::SystemVals const& val, config_setup::FFKind const& ffKind); }; #endif /*FORCEFIELD_H*/
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "../support/s1ap-r16.4.0/36413-g40.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER` */ #include "S1AP_Cdma2000SectorID.h" /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ static const ber_tlv_tag_t asn_DEF_S1AP_Cdma2000SectorID_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_S1AP_Cdma2000SectorID = { "Cdma2000SectorID", "Cdma2000SectorID", &asn_OP_OCTET_STRING, asn_DEF_S1AP_Cdma2000SectorID_tags_1, sizeof(asn_DEF_S1AP_Cdma2000SectorID_tags_1) /sizeof(asn_DEF_S1AP_Cdma2000SectorID_tags_1[0]), /* 1 */ asn_DEF_S1AP_Cdma2000SectorID_tags_1, /* Same as above */ sizeof(asn_DEF_S1AP_Cdma2000SectorID_tags_1) /sizeof(asn_DEF_S1AP_Cdma2000SectorID_tags_1[0]), /* 1 */ { #if !defined(ASN_DISABLE_OER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ OCTET_STRING_constraint }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ };
namespace vpvl2 { class MockICamera : public ICamera { public: MOCK_METHOD1(addEventListenerRef, void(PropertyEventListener *value)); MOCK_METHOD1(removeEventListenerRef, void(PropertyEventListener *value)); MOCK_METHOD1(getEventListenerRefs, void(Array<PropertyEventListener *> &value)); MOCK_CONST_METHOD0(modelViewTransform, Transform()); MOCK_CONST_METHOD0(lookAt, Vector3()); MOCK_CONST_METHOD0(position, Vector3()); MOCK_CONST_METHOD0(angle, Vector3()); MOCK_CONST_METHOD0(fov, Scalar()); MOCK_CONST_METHOD0(distance, Scalar()); MOCK_CONST_METHOD0(znear, Scalar()); MOCK_CONST_METHOD0(zfar, Scalar()); MOCK_CONST_METHOD0(motion, IMotion*()); MOCK_METHOD1(setLookAt, void(const Vector3 &value)); MOCK_METHOD1(setAngle, void(const Vector3 &value)); MOCK_METHOD1(setFov, void(Scalar value)); MOCK_METHOD1(setDistance, void(Scalar value)); MOCK_METHOD1(setZNear, void(Scalar value)); MOCK_METHOD1(setZFar, void(Scalar value)); MOCK_METHOD1(setMotion, void(IMotion *value)); MOCK_METHOD1(copyFrom, void(const ICamera *value)); MOCK_METHOD0(resetDefault, void()); }; } // namespace vpvl2
/* * Copyright (C) 1994-2016 Altair Engineering, Inc. * For more information, contact Altair at www.altair.com. * * This file is part of the PBS Professional ("PBS Pro") software. * * Open Source License Information: * * PBS Pro 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. * * PBS Pro 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/>. * * Commercial License Information: * * The PBS Pro software is licensed under the terms of the GNU Affero General * Public License agreement ("AGPL"), except where a separate commercial license * agreement for PBS Pro version 14 or later has been executed in writing with Altair. * * Altair’s dual-license business model allows companies, individuals, and * organizations to create proprietary derivative works of PBS Pro and distribute * them - whether embedded or bundled with other software - under a commercial * license agreement. * * Use of Altair’s trademarks, including but not limited to "PBS™", * "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's * trademark licensing policies. * */ #include <pbs_config.h> /* the master config generated by configure */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> #include <netdb.h> #include "portability.h" #include "list_link.h" #include "attribute.h" #include "server_limits.h" #include "job.h" #include "pbs_nodes.h" #include "reservation.h" #include "queue.h" #include "log.h" #include "pbs_ifl.h" #include "svrfunc.h" /* to resolve cvrt_fqn_to_name */ /* Global Data Items */ extern char *pbs_o_host; extern char server_host[]; extern char *msg_orighost; /* error message: no PBS_O_HOST */ /** * @brief * site_check_user_map - site_check_user_map() * This routine determines if the specified "luser" is authorized * on this host to serve as a kind of "proxy" for the object's owner. * Uses the object's "User_List" attribute. * * As provided, this routine uses ruserok(3N). If this is a problem, * It's replacement is "left as an exercise for the reader." * * @param[in] pjob - job info * @param[in] objtype - type of object * @param[in] luser - username * * @return int * @retval 0 success * @retval >0 error * */ int site_check_user_map(void *pobj, int objtype, char *luser) { char *orighost; char owner[PBS_MAXUSER+1]; char *p1; char *objid; int event_type, event_class; int rc; /* set pointer variables etc based on object's type */ if (objtype == JOB_OBJECT) { p1 = ((job *)pobj)->ji_wattr[JOB_ATR_job_owner].at_val.at_str; objid = ((job *)pobj)->ji_qs.ji_jobid; event_type = PBSEVENT_JOB; event_class = PBS_EVENTCLASS_JOB; } else { p1 = ((resc_resv *)pobj)->ri_wattr[RESV_ATR_resv_owner].at_val.at_str; objid = ((resc_resv *)pobj)->ri_qs.ri_resvID; event_type = PBSEVENT_JOB; event_class = PBS_EVENTCLASS_JOB; } /* the owner name, without the "@host" */ cvrt_fqn_to_name(p1, owner); orighost = strchr(p1, '@'); if ((orighost == (char *)0) || (*++orighost == '\0')) { log_event(event_type, event_class, LOG_INFO, objid, msg_orighost); return (-1); } if (!strcasecmp(orighost, server_host) && !strcmp(owner, luser)) return (0); #ifdef WIN32 rc = ruserok(orighost, isAdminPrivilege(luser), owner, luser); if (rc == -2) { sprintf(log_buffer, "User %s does not exist!", luser); log_err(0, "site_check_user_map", log_buffer); rc = -1; } else if (rc == -3) { sprintf(log_buffer, "User %s's [HOMEDIR]/.rhosts is unreadable! Needs SYSTEM or Everyone access", luser); log_err(0, "site_check_user_map", log_buffer); rc = -1; } #else rc = ruserok(orighost, 0, owner, luser); #endif #ifdef sun /* broken Sun ruserok() sets process so it appears to be owned */ /* by the luser, change it back for cosmetic reasons */ if (setuid(0) == -1) { log_err(errno, "site_check_user_map", "cannot go back to root"); exit(1); } #endif /* sun */ return (rc); } /** * @brief * site_check_u - site_acl_check() * This routine is a place holder for sites that wish to implement * access controls that differ from the standard PBS user, group, host * access controls. It does NOT replace their functionality. * * @param[in] pjob - job pointer * @param[in] pqueue - pointer to queue defn * * @return int * @retval 0 ok * @retval -1 access denied * */ int site_acl_check(job *pjob, pbs_queue *pque) { return (0); }
/*************************************************************************** modifyconstraintsubjectpreferredroomsform.h - description ------------------- begin : April 8, 2005 copyright : (C) 2005 by Lalescu Liviu email : Please see https://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address) ***************************************************************************/ /*************************************************************************** * * * 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 MODIFYCONSTRAINTSUBJECTPREFERREDROOMSFORM_H #define MODIFYCONSTRAINTSUBJECTPREFERREDROOMSFORM_H #include "ui_modifyconstraintsubjectpreferredroomsform_template.h" #include "timetable_defs.h" #include "timetable.h" #include "fet.h" class ModifyConstraintSubjectPreferredRoomsForm : public QDialog, Ui::ModifyConstraintSubjectPreferredRoomsForm_template { Q_OBJECT public: ModifyConstraintSubjectPreferredRoomsForm(QWidget* parent, ConstraintSubjectPreferredRooms* ctr); ~ModifyConstraintSubjectPreferredRoomsForm(); void updateRoomsListWidget(); public slots: void addRoom(); void removeRoom(); void ok(); void cancel(); void clear(); private: ConstraintSubjectPreferredRooms* _ctr; }; #endif
/* * Copyright (C) 1994-2016 Altair Engineering, Inc. * For more information, contact Altair at www.altair.com. * * This file is part of the PBS Professional ("PBS Pro") software. * * Open Source License Information: * * PBS Pro 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. * * PBS Pro 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/>. * * Commercial License Information: * * The PBS Pro software is licensed under the terms of the GNU Affero General * Public License agreement ("AGPL"), except where a separate commercial license * agreement for PBS Pro version 14 or later has been executed in writing with Altair. * * Altair’s dual-license business model allows companies, individuals, and * organizations to create proprietary derivative works of PBS Pro and distribute * them - whether embedded or bundled with other software - under a commercial * license agreement. * * Use of Altair’s trademarks, including but not limited to "PBS™", * "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's * trademark licensing policies. * */ /* * Place holder for site supplied additions to the array of site * server attribute definitions, see svr_attr_def.c * * Array elements must be of the form: * { "name", * decode_Func, * encode_Func, * set_Func, * comp_Func, * free_Func, * action_routine, * permissions, * ATR_TYPE_*, * PARENT_TYPE_SERVER * }, * * Matching entry must be added in site_sv_attr_enum.h */
///////////////////////////////////////////////////////////////////////////// // Name: nativdlg.h // Purpose: Native Windows dialog sample // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // Define a new application class MyApp: public wxApp { public: MyApp(void){}; bool OnInit(void); }; class MyFrame: public wxFrame { public: wxWindow *panel; MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size); void OnQuit(wxCommandEvent& event); void OnTest1(wxCommandEvent& event); DECLARE_EVENT_TABLE() }; class MyDialog : public wxDialog { public: void OnOk(wxCommandEvent& event); void OnCancel(wxCommandEvent& event); DECLARE_EVENT_TABLE() }; #define RESOURCE_QUIT 4 #define RESOURCE_TEST1 2
/* * Copyright (C) 2018 Richard Hughes <richard@hughsie.com> * * SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include <stdlib.h> #include <string.h> #include "fu-common.h" #include "fu-test.h" #include "fu-wac-common.h" #include "fu-wac-firmware.h" #include "fwupd-error.h" static void fu_wac_firmware_parse_func (void) { DfuElement *element; DfuImage *image; gboolean ret; g_autofree gchar *fn = NULL; g_autoptr(DfuFirmware) firmware = dfu_firmware_new (); g_autoptr(GBytes) blob_block = NULL; g_autoptr(GBytes) bytes = NULL; g_autoptr(GError) error = NULL; /* parse the test file */ fn = fu_test_get_filename (TESTDATADIR, "test.wac"); if (fn == NULL) { g_test_skip ("no data file found"); return; } bytes = fu_common_get_contents_bytes (fn, &error); g_assert_no_error (error); g_assert_nonnull (bytes); ret = fu_wac_firmware_parse_data (firmware, bytes, DFU_FIRMWARE_PARSE_FLAG_NONE, &error); g_assert_no_error (error); g_assert_true (ret); /* get image data */ image = dfu_firmware_get_image (firmware, 0); g_assert_nonnull (image); element = dfu_image_get_element_default (image); g_assert_nonnull (element); /* get block */ blob_block = dfu_element_get_contents_chunk (element, 0x8008000, 1024, &error); g_assert_no_error (error); g_assert_nonnull (blob_block); fu_wac_buffer_dump ("IMG", FU_WAC_REPORT_ID_MODULE, g_bytes_get_data (blob_block, NULL), g_bytes_get_size (blob_block)); } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); /* only critical and error are fatal */ g_log_set_fatal_mask (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL); /* log everything */ g_setenv ("G_MESSAGES_DEBUG", "all", FALSE); /* tests go here */ g_test_add_func ("/wac/firmware{parse}", fu_wac_firmware_parse_func); return g_test_run (); }
/* The Battle Grounds 3 - A Source modification Copyright (C) 2017, The Battle Grounds 3 Team and Contributors The Battle Grounds 3 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 Battle Grounds 3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Contact information: Chel "Awesome" Trunk mail, in reverse: com . gmail @ latrunkster You may also contact the (future) team via the Battle Grounds website and/or forum at: battlegrounds3.com Note that because of the sheer volume of files in the Source SDK this notice cannot be put in all of them, but merely the ones that have any changes from the original SDK. In order to facilitate easy searching, all changes are and must be commented on the following form: //BG3 - <name of contributer>[ - <small description>] */ class CHL2MP_Player; //Namespace controlling who has LB officer protection and who doesn't namespace { bool ProtectOfficerFromHit(CHL2MP_Player* pVictim, CHL2MP_Player* pAttacker); //Passes officer protections to this player, potentially removing it from others void AddPlayerAsOfficer(CHL2MP_Player* pPlayer); void RemoveAllOfficerProtections(); }
#ifndef TRIMVACENERGYCOUNT_H #define TRIMVACENERGYCOUNT_H #include "ThreadedTrimBase.h" using namespace MyTRIM_NS; class TrimVacEnergyCount : public ThreadedTrimBase { public: TrimVacEnergyCount(SimconfType * simconf, SampleBase * sample); protected: virtual void vacancyCreation(); virtual void threadJoin(const ThreadedTrimBase & ttb); virtual void writeOutput(); private: /// histogram of vacancies created per log10 Energy and unit depth (Ang) std::vector<std::vector<unsigned int>> _evac_bin; }; #endif // TRIMVACENERGYCOUNT_H
#include <pulsecore/pulsecore-config.h> #include <pulse/def.h> #include <pulsecore/module.h> #include "module-ext.h" #include "context.h" #define HASH_INDEX_BITS 8 #define HASH_INDEX_GAP 2 #define HASH_INDEX_MAX (1 << HASH_INDEX_BITS) #define HASH_INDEX_MASK (HASH_INDEX_MAX - 1) #define HASH_TABLE_SIZE (HASH_INDEX_MAX << HASH_INDEX_GAP) #define HASH_TABLE_MASK (HASH_TABLE_SIZE - 1) #define HASH_SEARCH_MAX HASH_INDEX_MAX #define HASH_INDEX(i) (((i) & HASH_INDEX_MASK) << HASH_INDEX_GAP) #define HASH_INDEX_NEXT(i) (((i) + 1) & HASH_TABLE_MASK) struct hash_entry { unsigned long index; struct pa_module *module; }; struct hash_entry hash_table[HASH_TABLE_SIZE]; static void handle_module_events(pa_core *, pa_subscription_event_type_t, uint32_t, void *); static void handle_new_module(struct userdata *, struct pa_module *); static void handle_removed_module(struct userdata *, unsigned long); static int hash_add(struct pa_module *); static int hash_delete(unsigned long); struct pa_module_evsubscr *pa_module_ext_subscription(struct userdata *u) { struct pa_module_evsubscr *subscr; pa_assert(u); pa_assert(u->core); subscr = pa_xnew0(struct pa_module_evsubscr, 1); subscr->ev = pa_subscription_new(u->core, 1<<PA_SUBSCRIPTION_EVENT_MODULE, handle_module_events, (void *)u); return subscr; } void pa_module_ext_subscription_free(struct pa_module_evsubscr *subscr) { pa_assert(subscr); pa_subscription_free(subscr->ev); } void pa_module_ext_discover(struct userdata *u) { void *state = NULL; pa_idxset *idxset; struct pa_module *module; pa_assert(u); pa_assert(u->core); pa_assert_se((idxset = u->core->modules)); while ((module = pa_idxset_iterate(idxset, &state, NULL)) != NULL) { hash_add(module); handle_new_module(u, module); } } char *pa_module_ext_get_name(struct pa_module *module) { return module->name ? module->name : (char *)"<unknown>"; } static void handle_module_events(pa_core *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata) { struct userdata *u = userdata; uint32_t et = t & PA_SUBSCRIPTION_EVENT_TYPE_MASK; struct pa_module *module; char *name; pa_assert(u); switch (et) { case PA_SUBSCRIPTION_EVENT_NEW: if ((module = pa_idxset_get_by_index(c->modules, idx)) != NULL) { name = pa_module_ext_get_name(module); if (hash_add(module)) { pa_log_debug("new module #%d '%s'", idx, name); handle_new_module(u, module); } } break; case PA_SUBSCRIPTION_EVENT_REMOVE: if (hash_delete(idx)) { pa_log_debug("remove module #%d", idx); handle_removed_module(u, idx); } break; default: break; } } static void handle_new_module(struct userdata *u, struct pa_module *module) { char *name; uint32_t idx; if (module && u) { name = pa_module_ext_get_name(module); idx = module->index; pa_policy_context_register(u, pa_policy_object_module, name, module); } } static void handle_removed_module(struct userdata *u, unsigned long idx) { char name[256]; if (u) { snprintf(name, sizeof(name), "module #%lu", idx); pa_policy_context_unregister(u, pa_policy_object_module, name, NULL, idx); } } static int hash_add(struct pa_module *module) { int hidx = HASH_INDEX(module->index); int i; for (i = 0; i < HASH_SEARCH_MAX; i++) { if (hash_table[hidx].module == NULL) { hash_table[hidx].index = module->index; hash_table[hidx].module = module; return TRUE; } if (hash_table[hidx].module == module) break; } return FALSE; } static int hash_delete(unsigned long index) { int hidx = HASH_INDEX(index); int i; for (i = 0; i < HASH_SEARCH_MAX; i++) { if (hash_table[hidx].index == index) { hash_table[hidx].index = 0; hash_table[hidx].module = NULL; return TRUE; } hidx = HASH_INDEX_NEXT(hidx); } return FALSE; } /* * Local Variables: * c-basic-offset: 4 * indent-tabs-mode: nil * End: * */
/* * Copyright © 2014 Intel Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef __CL_GBE_LOADER_H__ #define __CL_GBE_LOADER_H__ #include "program.h" #ifdef __cplusplus extern "C" { #endif extern gbe_program_new_from_source_cb *compiler_program_new_from_source; extern gbe_program_new_from_llvm_file_cb *compiler_program_new_from_llvm_file; extern gbe_program_compile_from_source_cb *compiler_program_compile_from_source; extern gbe_program_new_gen_program_cb *compiler_program_new_gen_program; extern gbe_program_link_program_cb *compiler_program_link_program; extern gbe_program_check_opt_cb *compiler_program_check_opt; extern gbe_program_build_from_llvm_cb *compiler_program_build_from_llvm; extern gbe_program_new_from_llvm_binary_cb *compiler_program_new_from_llvm_binary; extern gbe_program_serialize_to_binary_cb *compiler_program_serialize_to_binary; extern gbe_program_new_from_llvm_cb *compiler_program_new_from_llvm; extern gbe_program_clean_llvm_resource_cb *compiler_program_clean_llvm_resource; extern gbe_program_new_from_binary_cb *interp_program_new_from_binary; extern gbe_program_get_global_constant_size_cb *interp_program_get_global_constant_size; extern gbe_program_get_global_constant_data_cb *interp_program_get_global_constant_data; extern gbe_program_get_global_reloc_count_cb *interp_program_get_global_reloc_count; extern gbe_program_get_global_reloc_table_cb *interp_program_get_global_reloc_table; extern gbe_program_delete_cb *interp_program_delete; extern gbe_program_get_kernel_num_cb *interp_program_get_kernel_num; extern gbe_program_get_kernel_by_name_cb *interp_program_get_kernel_by_name; extern gbe_program_get_kernel_cb *interp_program_get_kernel; extern gbe_program_get_device_enqueue_kernel_name_cb *interp_program_get_device_enqueue_kernel_name; extern gbe_kernel_get_name_cb *interp_kernel_get_name; extern gbe_kernel_get_attributes_cb *interp_kernel_get_attributes; extern gbe_kernel_get_code_cb *interp_kernel_get_code; extern gbe_kernel_get_code_size_cb *interp_kernel_get_code_size; extern gbe_kernel_get_arg_num_cb *interp_kernel_get_arg_num; extern gbe_kernel_get_arg_size_cb *interp_kernel_get_arg_size; extern gbe_kernel_get_arg_bti_cb *interp_kernel_get_arg_bti; extern gbe_kernel_get_arg_type_cb *interp_kernel_get_arg_type; extern gbe_kernel_get_arg_align_cb *interp_kernel_get_arg_align; extern gbe_kernel_get_simd_width_cb *interp_kernel_get_simd_width; extern gbe_kernel_get_curbe_offset_cb *interp_kernel_get_curbe_offset; extern gbe_kernel_get_curbe_size_cb *interp_kernel_get_curbe_size; extern gbe_kernel_get_stack_size_cb *interp_kernel_get_stack_size; extern gbe_kernel_get_scratch_size_cb *interp_kernel_get_scratch_size; extern gbe_kernel_get_required_work_group_size_cb *interp_kernel_get_required_work_group_size; extern gbe_kernel_use_slm_cb *interp_kernel_use_slm; extern gbe_kernel_get_slm_size_cb *interp_kernel_get_slm_size; extern gbe_kernel_get_sampler_size_cb *interp_kernel_get_sampler_size; extern gbe_kernel_get_sampler_data_cb *interp_kernel_get_sampler_data; extern gbe_kernel_get_compile_wg_size_cb *interp_kernel_get_compile_wg_size; extern gbe_kernel_get_image_size_cb *interp_kernel_get_image_size; extern gbe_kernel_get_image_data_cb *interp_kernel_get_image_data; extern gbe_kernel_get_ocl_version_cb *interp_kernel_get_ocl_version; extern gbe_output_profiling_cb* interp_output_profiling; extern gbe_get_profiling_bti_cb* interp_get_profiling_bti; extern gbe_dup_profiling_cb* interp_dup_profiling; extern gbe_get_printf_num_cb* interp_get_printf_num; extern gbe_get_printf_buf_bti_cb* interp_get_printf_buf_bti; extern gbe_dup_printfset_cb* interp_dup_printfset; extern gbe_release_printf_info_cb* interp_release_printf_info; extern gbe_output_printf_cb* interp_output_printf; extern gbe_kernel_get_arg_info_cb *interp_kernel_get_arg_info; extern gbe_kernel_use_device_enqueue_cb * interp_kernel_use_device_enqueue; int CompilerSupported(); #ifdef __cplusplus } #endif #endif /* __CL_GBE_LOADER_H__ */
/* * global.h * * Copyright (c) 1999, 2000, 2001 * Lu-chuan Kung and Kang-pen Chen. * All rights reserved. * * Copyright (c) 2004, 2005, 2006, 2008, 2011 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ /* *INDENT-OFF* */ #ifndef _CHEWING_GLOBAL_H #define _CHEWING_GLOBAL_H /* *INDENT-ON* */ /*! \file global.h * \brief Chewing Global Definitions * \author libchewing Core Team */ #define CHINESE_MODE 1 #define ENGLISH_MODE 2 #define SYMBOL_MODE 0 #define FULLSHAPE_MODE 1 #define HALFSHAPE_MODE 0 /* specified to Chewing API */ #if defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE) # define CHEWING_DLL_IMPORT __declspec(dllimport) # define CHEWING_DLL_EXPORT __declspec(dllexport) # ifdef CHEWINGDLL_EXPORTS # define CHEWING_API CHEWING_DLL_EXPORT # define CHEWING_PRIVATE # elif CHEWINGDLL_IMPORTS # define CHEWING_API CHEWING_DLL_IMPORT # define CHEWING_PRIVATE # else # define CHEWING_API # define CHEWING_PRIVATE # endif #elif (__GNUC__ > 3) && (defined(__ELF__) || defined(__PIC__)) # define CHEWING_API __attribute__((__visibility__("default"))) # define CHEWING_PRIVATE __attribute__((__visibility__("hidden"))) #else # define CHEWING_API # define CHEWING_PRIVATE #endif #ifndef UNUSED # if defined(__GNUC__) /* gcc specific */ # define UNUSED __attribute__((unused)) # else # define UNUSED # endif #endif #ifndef DEPRECATED # if defined(__GNUC__) && __GNUC__ > 3 || \ (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) /* gcc specific */ # define DEPRECATED __attribute__((deprecated)) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) # define DEPRECATED_FOR(f) \ __attribute__((deprecated("Use " #f " instead"))) # else # define DEPRECATED_FOR(f) DEPRECATED # endif # else # define DEPRECATED # define DEPRECATED_FOR(f) # endif #endif /* The following macros are modified from GLIB. * from GNU cpp Manual: * C99 introduces the _Pragma operator. This feature addresses a major problem * with `#pragma': being a directive, it cannot be produced as the result of * macro expansion. _Pragma is an operator, much like sizeof or defined, and * can be embedded in a macro. */ #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) # define BEGIN_IGNORE_DEPRECATIONS \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") # define END_IGNORE_DEPRECATIONS \ _Pragma ("GCC diagnostic pop") #elif defined (_MSC_VER) && (_MSC_VER >= 1500) # define BEGIN_IGNORE_DEPRECATIONS \ __pragma (warning (push)) \ __pragma (warning (disable : 4996)) # define END_IGNORE_DEPRECATIONS \ __pragma (warning (pop)) #else # define BEGIN_IGNORE_DEPRECATIONS # define END_IGNORE_DEPRECATIONS #endif #define MIN_SELKEY 1 #define MAX_SELKEY 10 #define CHEWING_LOG_VERBOSE 1 #define CHEWING_LOG_DEBUG 2 #define CHEWING_LOG_INFO 3 #define CHEWING_LOG_WARN 4 #define CHEWING_LOG_ERROR 5 /** * @deprecated Use taigi_set_ series of functions to set parameters instead. */ typedef struct ChewingConfigData { int candPerPage; int maxChiSymbolLen; int selKey[MAX_SELKEY]; int bAddPhraseForward; int bSpaceAsSelection; int bEscCleanAllBuf; int bAutoShiftCur; int bEasySymbolInput; int bPhraseChoiceRearward; int hsuSelKeyType; // Deprecated. } ChewingConfigData; typedef struct IntervalType { /*@{ */ int from; /**< starting position of certain interval */ int to; /**< ending position of certain interval */ int type; /*@} */ } IntervalType; /** @brief context handle used for Chewing IM APIs */ typedef struct ChewingContext ChewingContext; /** @brief use "asdfjkl789" as selection key */ #define HSU_SELKEY_TYPE1 1 /** @brief use "asdfzxcv89" as selection key */ #define HSU_SELKEY_TYPE2 2 /* *INDENT-OFF* */ #endif /* *INDENT-ON* */
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** 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 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. ** ****************************************************************************/ #ifndef GLSLFILEWIZARD_H #define GLSLFILEWIZARD_H #include <coreplugin/basefilewizard.h> namespace GLSLEditor { class GLSLFileWizard: public Core::BaseFileWizard { Q_OBJECT public: enum ShaderType { VertexShaderES, FragmentShaderES, VertexShaderDesktop, FragmentShaderDesktop }; explicit GLSLFileWizard(ShaderType shaderType); private: QString fileContents(const QString &baseName, ShaderType shaderType) const; QWizard *createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const; Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const; QString preferredSuffix(ShaderType shaderType) const; private: ShaderType m_shaderType; }; } // namespace GLSLEditor #endif // GLSLFILEWIZARD_H
#ifndef UNDEFINEDDETECTION_H #define UNDEFINEDDETECTION_H // #include "Survec_dll.h" #include "DetectionType.h" // #include <QColor> // class SURVECLIB_EXPORT UndefinedDetection: public DetectionType { public: /** * Constructor */ UndefinedDetection(); /** * Destructor */ ~UndefinedDetection(); /** * @brief: virtual method of DetectionType * starts the process of detection */ void process(cv::Mat &image); }; #endif
/* Copyright (C) 2012 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_mat.h" int main(void) { slong iter; flint_rand_t state; flint_printf("charpoly...."); fflush(stdout); flint_randinit(state); for (iter = 0; iter < 1000 * arb_test_multiplier(); iter++) { acb_mat_t A, B, C, D; acb_poly_t f, g; slong m, n; m = n_randint(state, 8); n = m; acb_mat_init(A, m, n); acb_mat_init(B, m, n); acb_mat_init(C, m, m); acb_mat_init(D, n, n); acb_poly_init(f); acb_poly_init(g); acb_mat_randtest(A, state, 1 + n_randint(state, 1000), 10); acb_mat_randtest(B, state, 1 + n_randint(state, 1000), 10); acb_mat_mul(C, A, B, 2 + n_randint(state, 1000)); acb_mat_mul(D, B, A, 2 + n_randint(state, 1000)); acb_mat_charpoly(f, C, 2 + n_randint(state, 1000)); acb_mat_charpoly(g, D, 2 + n_randint(state, 1000)); if (!acb_poly_overlaps(f, g)) { flint_printf("FAIL: charpoly(AB) != charpoly(BA).\n"); flint_printf("Matrix A:\n"), acb_mat_printd(A, 15), flint_printf("\n"); flint_printf("Matrix B:\n"), acb_mat_printd(B, 15), flint_printf("\n"); flint_printf("cp(AB) = "), acb_poly_printd(f, 15), flint_printf("\n"); flint_printf("cp(BA) = "), acb_poly_printd(g, 15), flint_printf("\n"); abort(); } acb_mat_clear(A); acb_mat_clear(B); acb_mat_clear(C); acb_mat_clear(D); acb_poly_clear(f); acb_poly_clear(g); } flint_randclear(state); flint_cleanup(); flint_printf("PASS\n"); return 0; }
#include "../../include/stringptr.h" #include "../../include/strlib.h" #include "../../include/format.h" #include <stdarg.h> stringptr* stringptr_format(char* fmt, ...) { const size_t BUF_SIZE = 1000; stringptr* result = stringptr_new(BUF_SIZE); if(!result || !fmt) return NULL; va_list ap; va_start(ap, fmt); result->size = ulz_vsnprintf(result->ptr, BUF_SIZE, fmt, ap); va_end(ap); return result; }
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing ** ** This file is part of the Qt Build Suite. ** ** 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 http://www.qt.io/terms-conditions. For further information ** use the contact form at http://www.qt.io/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 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QBS_QUALIFIEDID_H #define QBS_QUALIFIEDID_H #include <QStringList> namespace qbs { namespace Internal { class QualifiedId : public QStringList { public: QualifiedId(); QualifiedId(const QString &singlePartName); QualifiedId(const QStringList &nameParts); static QualifiedId fromString(const QString &str); QString toString() const; }; bool operator<(const QualifiedId &a, const QualifiedId &b); } // namespace Internal } // namespace qbs #endif // QBS_QUALIFIEDID_H
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with ** the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QGEOROUTINGMANAGER_H #define QGEOROUTINGMANAGER_H #include "qgeorouterequest.h" #include "qgeoroutereply.h" #include <QObject> #include <QMap> class QLocale; QTM_BEGIN_NAMESPACE class QGeoRoutingManagerEngine; class QGeoRoutingManagerPrivate; class Q_LOCATION_EXPORT QGeoRoutingManager : public QObject { Q_OBJECT public: ~QGeoRoutingManager(); QString managerName() const; int managerVersion() const; QGeoRouteReply* calculateRoute(const QGeoRouteRequest& request); QGeoRouteReply* updateRoute(const QGeoRoute &route, const QGeoCoordinate &position); bool supportsRouteUpdates() const; bool supportsAlternativeRoutes() const; bool supportsExcludeAreas() const; QGeoRouteRequest::TravelModes supportedTravelModes() const; QGeoRouteRequest::FeatureTypes supportedFeatureTypes() const; QGeoRouteRequest::FeatureWeights supportedFeatureWeights() const; QGeoRouteRequest::RouteOptimizations supportedRouteOptimizations() const; QGeoRouteRequest::SegmentDetails supportedSegmentDetails() const; QGeoRouteRequest::ManeuverDetails supportedManeuverDetails() const; void setLocale(const QLocale &locale); QLocale locale() const; Q_SIGNALS: void finished(QGeoRouteReply* reply); void error(QGeoRouteReply* reply, QGeoRouteReply::Error error, QString errorString = QString()); private: QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject *parent = 0); QGeoRoutingManagerPrivate *d_ptr; Q_DISABLE_COPY(QGeoRoutingManager) friend class QGeoServiceProvider; }; QTM_END_NAMESPACE #endif
/* Emacs style mode select -*- C++ -*- *----------------------------------------------------------------------------- * * * PrBoom: a Doom port merged with LxDoom and LSDLDoom * based on BOOM, a modified and improved DOOM engine * Copyright (C) 1999 by * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman * Copyright (C) 1999-2006 by * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze * Copyright 2005, 2006 by * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * DESCRIPTION: * Simple basic typedefs, isolated here to make it easier * separating modules. * *-----------------------------------------------------------------------------*/ #ifndef __DOOMTYPE__ #define __DOOMTYPE__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef __BYTEBOOL__ #define __BYTEBOOL__ /* Fixed to use builtin bool type with C++. */ #ifdef __cplusplus typedef bool dboolean; #else typedef enum {false, true} dboolean; #endif typedef unsigned char byte; #endif //e6y #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef BETWEEN #define BETWEEN(l,u,x) ((l)>(x)?(l):(x)>(u)?(u):(x)) #endif /* cph - Wrapper for the long long type, as Win32 used a different name. * Except I don't know what to test as it's compiler specific * Proff - I fixed it */ #ifndef _MSC_VER typedef signed long long int_64_t; typedef unsigned long long uint_64_t; // define compiled-specific long-long contstant notation here #define LONGLONG(num) (uint_64_t)num ## ll #else typedef __int64 int_64_t; typedef unsigned __int64 uint_64_t; // define compiled-specific long-long contstant notation here #define LONGLONG(num) (uint_64_t)num #undef PATH_MAX #define PATH_MAX 1024 #define strcasecmp _stricmp #define strncasecmp _strnicmp #define S_ISDIR(x) (((sbuf.st_mode & S_IFDIR)==S_IFDIR)?1:0) #endif #ifdef __GNUC__ #define CONSTFUNC __attribute__((const)) #define PUREFUNC __attribute__((pure)) #define NORETURN __attribute__ ((noreturn)) #else #define CONSTFUNC #define PUREFUNC #define NORETURN #endif #ifdef WIN32 #define C_DECL __cdecl #else #define C_DECL #endif /* CPhipps - use limits.h instead of depreciated values.h */ #include <limits.h> /* cph - move compatibility levels here so we can use them in d_server.c */ typedef enum { doom_12_compatibility, /* Doom v1.2 */ doom_1666_compatibility, /* Doom v1.666 */ doom2_19_compatibility, /* Doom & Doom 2 v1.9 */ ultdoom_compatibility, /* Ultimate Doom and Doom95 */ finaldoom_compatibility, /* Final Doom */ dosdoom_compatibility, /* DosDoom 0.47 */ tasdoom_compatibility, /* TASDoom */ boom_compatibility_compatibility, /* Boom's compatibility mode */ boom_201_compatibility, /* Boom v2.01 */ boom_202_compatibility, /* Boom v2.02 */ lxdoom_1_compatibility, /* LxDoom v1.3.2+ */ mbf_compatibility, /* MBF */ prboom_1_compatibility, /* PrBoom 2.03beta? */ prboom_2_compatibility, /* PrBoom 2.1.0-2.1.1 */ prboom_3_compatibility, /* PrBoom 2.2.x */ prboom_4_compatibility, /* PrBoom 2.3.x */ prboom_5_compatibility, /* PrBoom 2.4.0 */ prboom_6_compatibility, /* Latest PrBoom */ MAX_COMPATIBILITY_LEVEL, /* Must be last entry */ /* Aliases follow */ boom_compatibility = boom_201_compatibility, /* Alias used by G_Compatibility */ best_compatibility = prboom_6_compatibility, } complevel_t; /* cph - from v_video.h, needed by gl_struct.h */ #define VPT_ALIGN_MASK 0xf #define VPT_STRETCH_MASK 0x1f enum patch_translation_e { // e6y: wide-res VPT_ALIGN_LEFT = 1, VPT_ALIGN_RIGHT = 2, VPT_ALIGN_TOP = 3, VPT_ALIGN_LEFT_TOP = 4, VPT_ALIGN_RIGHT_TOP = 5, VPT_ALIGN_BOTTOM = 6, VPT_ALIGN_WIDE = 7, VPT_ALIGN_LEFT_BOTTOM = 8, VPT_ALIGN_RIGHT_BOTTOM = 9, VPT_ALIGN_MAX = 10, VPT_STRETCH = 16, // Stretch to compensate for high-res VPT_NONE = 128, // Normal VPT_FLIP = 256, // Flip image horizontally VPT_TRANS = 512, // Translate image via a translation table }; #endif
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/wait.h> #include <sys/socket.h> #include <sys/time.h> #include <time.h> #include <signal.h> #include <arpa/inet.h> #include "libgadu.h" #include "userconfig.h" volatile int disconnect_flag; void sigint(int sig) { disconnect_flag = 1; } void usage(const char *argv0) { printf("usage: %s [OPTIONS] [uin [password]]\n" "\n" " -s ADRES[:PORT] direct server connection\n" " -p ADRES:PORT use proxy server\n" " -H use proxy server only for HTTP\n" " -D disable debugging\n" " -S synchronous connection\n" " -l NUMBER last system message received\n" " -L use SSL connection\n" " -y hide system message\n" " -h print this message\n" "\n", argv0); } void parse_address(const char *arg, char **host, int *port) { const char *colon; colon = strchr(arg, ':'); if (colon == NULL) { *host = strdup(arg); *port = 0; } else { int len; len = colon - arg; *host = malloc(len + 1); if (*host != NULL) { memcpy(*host, arg, len); (*host)[len] = 0; } *port = atoi(colon + 1); } } int main(int argc, char **argv) { struct gg_login_params glp; struct gg_session *gs; time_t last = 0; int hide_sysmsg = 0; int ch; gg_debug_level = 255; memset(&glp, 0, sizeof(glp)); glp.async = 1; config_read(); while ((ch = getopt(argc, argv, "DShHLs:p:l:y")) != -1) { switch (ch) { case 'D': gg_debug_level = 0; break; case 'S': glp.async = 0; break; case 'L': glp.tls = 1; break; case 's': free(config_server); config_server = strdup(optarg); break; case 'p': free(config_proxy); config_proxy = strdup(optarg); break; case 'H': gg_proxy_http_only = 1; break; case 'l': glp.last_sysmsg = atoi(optarg); break; case 'h': usage(argv[0]); return 0; case 'y': hide_sysmsg = 1; break; default: usage(argv[0]); return 1; } } if (argc - optind >= 1) { config_uin = atoi(argv[optind]); optind++; if (argc - optind >= 1) { free(config_password); config_password = strdup(argv[optind]); } } if (config_uin == 0 || config_password == NULL) { usage(argv[0]); return 1; } if (config_server != NULL) { char *host; int port; parse_address(config_server, &host, &port); glp.server_addr = inet_addr(host); glp.server_port = port; free(host); } if (config_proxy != NULL) { char *host; int port; parse_address(optarg, &host, &port); gg_proxy_enabled = 1; gg_proxy_host = host; gg_proxy_port = port; free(config_proxy); } glp.uin = config_uin; glp.password = config_password; signal(SIGINT, sigint); gs = gg_login(&glp); if (gs == NULL) { perror("gg_login"); free(gg_proxy_host); return 1; } for (;;) { struct timeval tv; fd_set rd, wd; int ret, fd, check; time_t now; if (disconnect_flag) { gg_change_status(gs, GG_STATUS_NOT_AVAIL); disconnect_flag = 0; } FD_ZERO(&rd); FD_ZERO(&wd); fd = gs->fd; check = gs->check; if ((check & GG_CHECK_READ)) FD_SET(fd, &rd); if ((check & GG_CHECK_WRITE)) FD_SET(fd, &wd); tv.tv_sec = 1; tv.tv_usec = 0; ret = select(fd + 1, &rd, &wd, NULL, &tv); if (ret == -1) { if (errno == EINTR) continue; perror("select"); break; } now = time(NULL); if (now != last) { if (gs->timeout != -1 && gs->timeout-- == 0 && !gs->soft_timeout) { printf("Timeout!\n"); break; } } if (gs != NULL && (FD_ISSET(fd, &rd) || FD_ISSET(fd, &wd) || (gs->timeout == 0 && gs->soft_timeout))) { struct gg_event *ge; ge = gg_watch_fd(gs); if (ge == NULL) { printf("Connection broken!\n"); break; } if (ge->type == GG_EVENT_CONN_SUCCESS) { printf("Connected (press Ctrl-C to disconnect)\n"); gg_notify(gs, NULL, 0); } if (ge->type == GG_EVENT_CONN_FAILED) { printf("Connection failed!\n"); gg_event_free(ge); break; } if (ge->type == GG_EVENT_DISCONNECT_ACK) { printf("Connection closed\n"); gg_event_free(ge); break; } if (ge->type == GG_EVENT_MSG) { if (ge->event.msg.sender != 0 || !hide_sysmsg) printf("Received message from %d:\n- plain text: %s\n- html: %s\n", ge->event.msg.sender, ge->event.msg.message, ge->event.msg.xhtml_message); } gg_event_free(ge); } } free(gg_proxy_host); gg_free_session(gs); config_free(); return 0; }
/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * 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. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTMETHOD_H #define CXXTOOLS_UNIT_TESTMETHOD_H #include <cxxtools/unit/test.h> #include <stdexcept> #include <cstddef> namespace cxxtools { class SerializationInfo; namespace unit { class TestMethod : public cxxtools::unit::Test { public: TestMethod(const std::string& name) : cxxtools::unit::Test(name) {} virtual ~TestMethod() {} virtual void run() {} virtual void exec(const SerializationInfo* si, unsigned argCount) = 0; }; //! @cond internal template < class C, typename A1 = cxxtools::Void, typename A2 = cxxtools::Void, typename A3 = cxxtools::Void, typename A4 = cxxtools::Void, typename A5 = cxxtools::Void, typename A6 = cxxtools::Void, typename A7 = cxxtools::Void, typename A8 = cxxtools::Void > class BasicTestMethod : public cxxtools::Method<void, C, A1, A2, A3, A4, A5, A6, A7, A8> , public TestMethod { public: typedef C ClassT; typedef void (C::*MemFuncT)(A1, A2, A3, A4, A5, A6, A7, A8); public: BasicTestMethod(const std::string& name, C& object, MemFuncT ptr) : cxxtools::Method<void, C, A1, A2, A3, A4, A5, A6, A7, A8>(object, ptr) , TestMethod(name) {} void exec(const SerializationInfo* args, unsigned argCount) { throw std::logic_error("SerializationInfo not implemented"); } virtual void run() {} }; template < class C > class BasicTestMethod<C, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public cxxtools::Method<void, C> , public TestMethod { public: typedef C ClassT; typedef void (C::*MemFuncT)(); public: BasicTestMethod(const std::string& name, C& object, MemFuncT ptr) : cxxtools::Method<void, C>(object, ptr) , TestMethod(name) {} void exec(const SerializationInfo* /*si*/, unsigned /*argCount*/) { cxxtools::Method<void, C>::call(); } virtual void run() {} }; //! @endcond internal } // namespace unit } // namespace cxxtools #endif // for header
/* -*- OpenSAF -*- * * (C) Copyright 2008 The OpenSAF Foundation * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed * under the GNU Lesser General Public License Version 2.1, February 1999. * The complete license can be accessed from the following location: * http://opensource.org/licenses/lgpl-license.php * See the Copying file included with the OpenSAF distribution for full * licensing terms. * * Author(s): Emerson Network Power * */ /***************************************************************************** .............................................................................. .............................................................................. DESCRIPTION: This include file contains the event definitions for GLA. That will be used by GLND for communication with GLA. ****************************************************************************** */ #ifndef GLA_EVT_H #define GLA_EVT_H typedef enum glsv_gla_evt_type { GLSV_GLA_CALLBK_EVT, GLSV_GLA_API_RESP_EVT, GLSV_GLA_EVT_MAX } GLSV_GLA_EVT_TYPE; typedef enum glsv_gla_api_resp_evt_type_tag { GLSV_GLA_LOCK_INITIALIZE = 1, GLSV_GLA_LOCK_FINALIZE, GLSV_GLA_LOCK_RES_OPEN, GLSV_GLA_LOCK_RES_CLOSE, GLSV_GLA_LOCK_SYNC_LOCK, GLSV_GLA_LOCK_SYNC_UNLOCK, GLSV_GLA_NODE_OPERATIONAL, GLSV_GLA_LOCK_PURGE } GLSV_GLA_API_RESP_EVT_TYPE; typedef struct glsv_gla_evt_lock_initialise_param_tag { uns32 dummy; } GLSV_GLA_EVT_LOCK_INITIALISE_PARAM; typedef struct glsv_gla_evt_lock_finalize_param_tag { uns32 dummy; } GLSV_GLA_EVT_LOCK_FINALIZE_PARAM; typedef struct glsv_gla_evt_lock_res_open_param_tag { SaLckResourceIdT resourceId; } GLSV_GLA_EVT_LOCK_RES_OPEN_PARAM; typedef struct glsv_gla_evt_lock_res_close_param_tag { uns32 dummy; } GLSV_GLA_EVT_LOCK_RES_CLOSE_PARAM; typedef struct glsv_gla_evt_lock_sync_lock_param_tag { SaLckLockIdT lockId; SaLckLockStatusT lockStatus; } GLSV_GLA_EVT_LOCK_SYNC_LOCK_PARAM; typedef struct glsv_gla_evt_lock_sync_unlock_param_tag { uns32 dummy; } GLSV_GLA_EVT_LOCK_SYNC_UNLOCK_PARAM; /* API Resp param definition */ typedef struct glsv_gla_api_resp_info { uns32 prc_id; /* process id */ GLSV_GLA_API_RESP_EVT_TYPE type; /* api type */ union { GLSV_GLA_EVT_LOCK_INITIALISE_PARAM lck_init; GLSV_GLA_EVT_LOCK_FINALIZE_PARAM lck_fin; GLSV_GLA_EVT_LOCK_RES_OPEN_PARAM res_open; GLSV_GLA_EVT_LOCK_RES_CLOSE_PARAM res_close; GLSV_GLA_EVT_LOCK_SYNC_LOCK_PARAM sync_lock; GLSV_GLA_EVT_LOCK_SYNC_UNLOCK_PARAM sync_unlock; } param; } GLSV_GLA_API_RESP_INFO; /* For GLND to GLA communication */ typedef struct glsv_gla_evt { SaLckHandleT handle; SaAisErrorT error; GLSV_GLA_EVT_TYPE type; /* message type */ union { GLSV_GLA_CALLBACK_INFO gla_clbk_info; /* callbk info */ GLSV_GLA_API_RESP_INFO gla_resp_info; /* api response info */ } info; } GLSV_GLA_EVT; #endif /* GLA_EVT */
/* * AT-SPI - Assistive Technology Service Provider Interface * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) * * Copyright 2001, 2002 Sun Microsystems Inc., * Copyright 2001, 2002 Ximian, Inc. * * 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; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* selection.c : implements the Selection interface */ #include <config.h> #include <stdio.h> #include <libspi/accessible.h> #include <libspi/selection.h> SpiSelection * spi_selection_interface_new (AtkObject *obj) { SpiSelection *new_selection = g_object_new (SPI_SELECTION_TYPE, NULL); spi_base_construct (SPI_BASE (new_selection), G_OBJECT(obj)); return new_selection; } static AtkSelection * get_selection_from_servant (PortableServer_Servant servant) { SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); g_return_val_if_fail (object, NULL); g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL); return ATK_SELECTION (object->gobj); } static CORBA_long impl__get_nSelectedChildren (PortableServer_Servant servant, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, 0); return atk_selection_get_selection_count (selection); } static Accessibility_Accessible impl_getSelectedChild (PortableServer_Servant servant, const CORBA_long selectedChildIndex, CORBA_Environment *ev) { AtkObject *atk_object; AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, CORBA_OBJECT_NIL); #ifdef SPI_DEBUG fprintf (stderr, "calling impl_getSelectedChild\n"); #endif atk_object = atk_selection_ref_selection (selection, selectedChildIndex); g_return_val_if_fail (ATK_IS_OBJECT (atk_object), CORBA_OBJECT_NIL); #ifdef SPI_DEBUG fprintf (stderr, "child type is %s\n", g_type_name (G_OBJECT_TYPE (atk_object))); #endif return spi_accessible_new_return (atk_object, TRUE, ev); } static CORBA_boolean impl_selectChild (PortableServer_Servant servant, const CORBA_long childIndex, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, FALSE); return atk_selection_add_selection (selection, childIndex); } static CORBA_boolean impl_deselectSelectedChild (PortableServer_Servant servant, const CORBA_long selectedChildIndex, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, FALSE); return atk_selection_remove_selection (selection, selectedChildIndex); } static CORBA_boolean impl_deselectChild (PortableServer_Servant servant, const CORBA_long selectedChildIndex, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); gint i, nselected; g_return_val_if_fail (selection != NULL, FALSE); nselected = atk_selection_get_selection_count (selection); for (i=0; i<nselected; ++i) { AtkObject *selected_obj = atk_selection_ref_selection (selection, i); if (atk_object_get_index_in_parent (selected_obj) == selectedChildIndex) { g_object_unref (G_OBJECT (selected_obj)); return atk_selection_remove_selection (selection, i); } g_object_unref (G_OBJECT (selected_obj)); } return FALSE; } static CORBA_boolean impl_isChildSelected (PortableServer_Servant servant, const CORBA_long childIndex, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, FALSE); return atk_selection_is_child_selected (selection, childIndex); } static CORBA_boolean impl_selectAll (PortableServer_Servant servant, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, FALSE); return atk_selection_select_all_selection (selection); } static CORBA_boolean impl_clearSelection (PortableServer_Servant servant, CORBA_Environment *ev) { AtkSelection *selection = get_selection_from_servant (servant); g_return_val_if_fail (selection != NULL, FALSE); return atk_selection_clear_selection (selection); } static void spi_selection_class_init (SpiSelectionClass *klass) { POA_Accessibility_Selection__epv *epv = &klass->epv; /* Initialize epv table */ epv->_get_nSelectedChildren = impl__get_nSelectedChildren; epv->getSelectedChild = impl_getSelectedChild; epv->selectChild = impl_selectChild; epv->deselectSelectedChild = impl_deselectSelectedChild; epv->deselectChild = impl_deselectChild; epv->isChildSelected = impl_isChildSelected; epv->selectAll = impl_selectAll; epv->clearSelection = impl_clearSelection; } static void spi_selection_init (SpiSelection *selection) { } BONOBO_TYPE_FUNC_FULL (SpiSelection, Accessibility_Selection, SPI_TYPE_BASE, spi_selection)
// Copyright (c) 2008-2010, Regents of the University of Colorado. // This work was supported by NASA contracts NNJ05HE10G, NNC06CB40C, and // NNC07CB47C. #include <errno.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/socket.h> #include "cal-client.h" extern cal_client_t cal_client; static int cal_shutdown = 0; void cal_callback(void * cal_handle, const cal_event_t *event) { switch (event->type) { case CAL_EVENT_JOIN: { char *msg; printf("Join event from '%s'\n", event->peer_name); if (strcmp(event->peer_name, "time-publisher") != 0) { break; } msg = strdup("hey there!"); if (msg == NULL) { printf("out of memory!\n"); break; } printf("found a time-publisher, sending it a message\n"); // the 'msg' buffer becomes the property of .sendto(), it's no longer ours to free or modify cal_client.sendto(cal_handle, event->peer_name, msg, strlen(msg)); break; } case CAL_EVENT_LEAVE: { printf("Leave event from '%s'\n", event->peer_name); break; } case CAL_EVENT_MESSAGE: { int i; printf("Message event from '%s'\n", event->peer_name); for (i = 0; i < event->msg.size; i ++) { if ((i % 8) == 0) printf(" "); printf("%02X ", event->msg.buffer[i]); if ((i % 8) == 7) printf("\n"); } if ((i % 8) != 7) printf("\n"); break; } case CAL_EVENT_PUBLISH: { printf("%s\n", event->msg.buffer); break; } case CAL_EVENT_SUBSCRIBE: { printf("Subscription to topic '%s' sent to peer '%s'\n", event->topic, event->peer_name); break; } default: { printf("unknown event type %d\n", event->type); break; } } } static void exit_signal_handler(int signal_number) { exit(0); } static void exit_handler() { cal_shutdown = 1; } void make_shutdowns_clean(void) { struct sigaction sa; atexit(exit_handler); // handle exit signals sa.sa_handler = exit_signal_handler; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; if (sigaction(SIGINT, &sa, NULL) < 0) { fprintf(stderr, "sigaction(SIGINT, ...): %s", strerror(errno)); exit(1); } if (sigaction(SIGTERM, &sa, NULL) < 0) { fprintf(stderr, "sigaction(SIGTERM, ...): %s", strerror(errno)); exit(1); } // // If a network connection is lost somehow, writes will cause the // process to receive SIGPIPE, and the default SIGPIPE handler // terminates the process. Not so good. So we change the handler to // ignore the signal, and we explicitly check for the error when we // need to. // sa.sa_handler = SIG_IGN; if (sigaction(SIGPIPE, &sa, NULL) < 0) { fprintf(stderr, "error setting SIGPIPE sigaction to SIG_IGN: %s", strerror(errno)); exit(1); } } int main(int argc, char *argv[]) { void * cal_handle; int cal_fd; make_shutdowns_clean(); cal_handle = cal_client.init("time", cal_callback, NULL, NULL, 0); if (cal_handle == NULL) exit(1); cal_client.subscribe(cal_handle, "time-publisher", "time"); cal_fd = cal_client.get_fd(cal_handle); if (0 > cal_fd) { printf("error getting CAL fd."); cal_client.shutdown(cal_handle); return 0; } while (1) { int r; fd_set readers; if (cal_shutdown) { cal_client.shutdown(cal_handle); } FD_ZERO(&readers); FD_SET(cal_fd, &readers); // CSA in LLVM 2.7 says there is a bug here. This should be fixed in LLVM v2.8 r = select(cal_fd + 1, &readers, NULL, NULL, NULL); if (r == -1) { printf("select fails: %s\n", strerror(errno)); cal_client.shutdown(cal_handle); cal_fd = -1; continue; } if (FD_ISSET(cal_fd, &readers)) { if (!cal_client.read(cal_handle, NULL, 1)) { printf("error reading CAL event!\n"); cal_client.shutdown(cal_handle); exit(1); } } } // NOT REACHED exit(0); }
/******************************************************************************* * CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps * * Copyright (C) 2015, IGG Group, ICube, University of Strasbourg, France * * * * This library is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by the * * Free Software Foundation; either version 2.1 of the License, or (at your * * option) any later version. * * * * This library is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this library; if not, write to the Free Software Foundation, * * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * * * Web site: http://cgogn.unistra.fr/ * * Contact information: cgogn@unistra.fr * * * *******************************************************************************/ #ifndef CGOGN_GEOMETRY_ALGOS_ANGLE_H_ #define CGOGN_GEOMETRY_ALGOS_ANGLE_H_ #include <cmath> #include <cgogn/geometry/types/geometry_traits.h> #include <cgogn/geometry/functions/basics.h> #include <cgogn/geometry/algos/normal.h> #include <cgogn/core/utils/masks.h> #include <cgogn/core/cmap/cmap2.h> namespace cgogn { namespace geometry { /** * compute and return the angle formed by the normals of the two faces incident to the given edge */ template <typename VEC3, typename MAP> inline typename vector_traits<VEC3>::Scalar angle_between_face_normals( const MAP& map, const Cell<Orbit::PHI2> e, const typename MAP::template VertexAttribute<VEC3>& position ) { using Scalar = typename vector_traits<VEC3>::Scalar; using Vertex2 = Cell<Orbit::PHI21>; using Face2 = Cell<Orbit::PHI1>; if (map.is_incident_to_boundary(e)) return Scalar(0); const Dart d = e.dart; const Dart d2 = map.phi2(d); const VEC3 n1 = normal<VEC3>(map, Face2(d), position); const VEC3 n2 = normal<VEC3>(map, Face2(d2), position); VEC3 edge = position[Vertex2(d2)] - position[Vertex2(d)]; edge.normalize(); Scalar s = edge.dot(n1.cross(n2)); Scalar c = n1.dot(n2); Scalar a(0); // the following trick is useful to avoid NaNs (due to floating point errors) if (c > Scalar(0.5)) a = std::asin(s); else { if(c < -1) c = -1; if (s >= 0) a = std::acos(c); else a = -std::acos(c); } if(a != a) cgogn_log_warning("angle_between_face_normals") << "NaN computed"; return a; } template <typename VEC3, typename MAP, typename MASK> inline void compute_angle_between_face_normals( const MAP& map, const MASK& mask, const typename MAP::template VertexAttribute<VEC3>& position, Attribute<typename vector_traits<VEC3>::Scalar, Orbit::PHI2>& edge_angle ) { map.parallel_foreach_cell([&] (Cell<Orbit::PHI2> e) { edge_angle[e] = angle_between_face_normals<VEC3>(map, e, position); }, mask); } template <typename VEC3, typename MAP> inline void compute_angle_between_face_normals( const MAP& map, const typename MAP::template VertexAttribute<VEC3>& position, Attribute<typename vector_traits<VEC3>::Scalar, Orbit::PHI2>& edge_angle ) { compute_angle_between_face_normals<VEC3>(map, AllCellsFilter(), position, edge_angle); } #if defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(CGOGN_GEOMETRY_ALGOS_ANGLE_CPP_)) extern template CGOGN_GEOMETRY_API float32 angle_between_face_normals<Eigen::Vector3f, CMap2>(const CMap2&, const Cell<Orbit::PHI2>, const CMap2::VertexAttribute<Eigen::Vector3f>&); extern template CGOGN_GEOMETRY_API float64 angle_between_face_normals<Eigen::Vector3d, CMap2>(const CMap2&, const Cell<Orbit::PHI2>, const CMap2::VertexAttribute<Eigen::Vector3d>&); extern template CGOGN_GEOMETRY_API void compute_angle_between_face_normals<Eigen::Vector3f, CMap2>(const CMap2&, const CMap2::VertexAttribute<Eigen::Vector3f>&, Attribute<float32, Orbit::PHI2>&); extern template CGOGN_GEOMETRY_API void compute_angle_between_face_normals<Eigen::Vector3d, CMap2>(const CMap2&, const CMap2::VertexAttribute<Eigen::Vector3d>&, Attribute<float64, Orbit::PHI2>&); #endif // defined(CGOGN_USE_EXTERNAL_TEMPLATES) && (!defined(CGOGN_GEOMETRY_ALGOS_ANGLE_CPP_)) } // namespace geometry } // namespace cgogn #endif // CGOGN_GEOMETRY_ALGOS_ANGLE_H_
/* * 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: * * * 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. */ #ifndef RenderSVGModelObject_h #define RenderSVGModelObject_h #if ENABLE(SVG) #include "RenderObject.h" #include "SVGRenderSupport.h" namespace WebCore { // Most renderers in the SVG rendering tree will inherit from this class // but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock) thus methods // required by SVG renders need to be declared on RenderObject, but shared // logic can go in this class or in SVGRenderSupport. class SVGStyledElement; class RenderSVGModelObject : public RenderObject { public: explicit RenderSVGModelObject(SVGStyledElement*); virtual bool requiresLayer() const { return false; } virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false); virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const; virtual void absoluteRects(Vector<IntRect>&, int tx, int ty); virtual void absoluteQuads(Vector<FloatQuad>&); virtual void destroy(); virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip) const; virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateFromElement(); private: // This method should never be called, SVG uses a different nodeAtPoint method bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int xInContainer, int yInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction); }; } #endif // ENABLE(SVG) #endif
/* -*- mode: C; c-basic-offset: 4 -*- * pyorbit - a Python language mapping for the ORBit2 CORBA ORB * Copyright (C) 2002-2003 James Henstridge <james@daa.com.au> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef PYORBIT_PRIVATE_H #define PYORBIT_PRIVATE_H #ifdef PYORBIT_H # error "don't include pyorbit.h and pyorbit-private.h together" #endif #define _INSIDE_PYORBIT_ #include "pyorbit.h" #undef _INSIDE_PYORBIT_ #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #endif /* public API */ extern PyTypeObject PyCORBA_Object_Type; extern PyTypeObject PyCORBA_ORB_Type; extern PyTypeObject PyCORBA_TypeCode_Type; extern PyTypeObject PyCORBA_Any_Type; PyObject *pycorba_object_new(CORBA_Object objref); PyObject *pycorba_object_new_with_type(CORBA_Object objref, CORBA_TypeCode tc); PyObject *pycorba_orb_new(CORBA_ORB orb); PyObject *pycorba_typecode_new(CORBA_TypeCode tc); PyObject *pycorba_any_new(CORBA_any *any); /* private API */ typedef struct { PyObject_VAR_HEAD CORBA_fixed_d_s fixed; } PyCORBA_fixed; extern PyTypeObject PyCORBA_fixed_Type; void pyorbit_register_stub(CORBA_TypeCode tc, PyObject *stub); CORBA_TypeCode pyorbit_lookup_typecode(const gchar *repo_id); PyObject *pyorbit_get_stub(CORBA_TypeCode tc); PyObject *pyorbit_get_stub_from_repo_id(const gchar *repo_id); PyObject *pyorbit_get_stub_from_objref(CORBA_Object objref); void pyorbit_generate_typecode_stubs(CORBA_TypeCode tc); void pyorbit_generate_iinterface_stubs(ORBit_IInterface *iface); extern PyTypeObject PyCORBA_Method_Type; extern PyTypeObject PyCORBA_BoundMethod_Type; void pyorbit_add_imethods_to_stub(PyObject *stub, ORBit_IMethods *imethods); gboolean pyorbit_marshal_any(CORBA_any *any, PyObject *value); PyObject *pyorbit_demarshal_any(CORBA_any *any); extern PyObject *pyorbit_exception; extern PyObject *pyorbit_system_exception; extern PyObject *pyorbit_user_exception; gboolean pyorbit_check_ex(CORBA_Environment *ev); gboolean pyorbit_check_python_ex(CORBA_Environment *ev); void pyorbit_register_exceptions(PyObject *corbamod); extern PyTypeObject PyCORBA_Struct_Type; extern PyTypeObject PyCORBA_Union_Type; extern PyTypeObject PyCORBA_UnionMember_Type; void pyorbit_add_union_members_to_stub(PyObject *stub, CORBA_TypeCode tc); extern PyTypeObject PyCORBA_Enum_Type; PyObject *_pyorbit_generate_enum(CORBA_TypeCode tc, PyObject **values_p); PyObject *pycorba_enum_from_long(CORBA_TypeCode tc, long value); /* utils */ gchar *_pyorbit_escape_name(const gchar *name); PyObject *_pyorbit_get_container(const gchar *repo_id, gboolean is_poa); /* skels */ typedef struct _PyORBitInterfaceInfo PyORBitInterfaceInfo; typedef struct { PyObject_HEAD PortableServer_ServantBase servant; PyORBitInterfaceInfo *info; PyObject *delegate; PyObject *this; PortableServer_POA activator_poa; /* the POA that activated this * servant, or CORBA_OBJECT_NIL */ } PyPortableServer_Servant; /* simple macros to go back and forth between Python object and servant */ #define PYSERVANT_TO_SERVANT(pyservant) (&(pyservant)->servant) #define SERVANT_TO_PYSERVANT(servant) ((PyPortableServer_Servant *)((guchar *)(servant) - offsetof(PyPortableServer_Servant, servant))) extern PyTypeObject PyPortableServer_Servant_Type; void _pyorbit_register_skel(ORBit_IInterface *iinterface); extern PyTypeObject PyORBit_ObjectAdaptor_Type; extern PyTypeObject PyPortableServer_POA_Type; extern PyTypeObject PyPortableServer_POAManager_Type; PyObject *pyorbit_poa_new(PortableServer_POA poa); PyObject *pyorbit_poamanager_new(PortableServer_POAManager poamanager); extern PortableServer_POA _pyorbit_poa; #define pyorbit_gil_state_ensure() (PyEval_ThreadsInitialized()? (PyGILState_Ensure()) : 0) #define pyorbit_gil_state_release(state) G_STMT_START { \ if (PyEval_ThreadsInitialized()) \ PyGILState_Release(state); \ } G_STMT_END #define pyorbit_begin_allow_threads \ G_STMT_START { \ PyThreadState *_save = NULL; \ if (PyEval_ThreadsInitialized()) \ _save = PyEval_SaveThread(); #define pyorbit_end_allow_threads \ if (PyEval_ThreadsInitialized()) \ PyEval_RestoreThread(_save); \ } G_STMT_END /* pycorba-policy.c */ typedef struct { PyObject_VAR_HEAD CORBA_Object objref; } PyCORBA_Policy; extern PyTypeObject PyCORBA_Policy_Type; PyObject * pycorba_policy_new(CORBA_Object policy); #endif
/* (c) Code Red Technologies. dTR */ #if !defined(__CR2_C___4_6_2_ARM_NONE_EABI_ARMV7_M_BITS_CXXABI_TWEAKS_H__) # define __CR2_C___4_6_2_ARM_NONE_EABI_ARMV7_M_BITS_CXXABI_TWEAKS_H__ # if defined(__REDLIB__) # include_next <c++/4.6.2/arm-none-eabi/armv7-m/bits/cxxabi_tweaks.h> # else # include <newlib_inc/c++/4.6.2/arm-none-eabi/armv7-m/bits/cxxabi_tweaks.h> # if !defined (__NEWLIB__) && !defined(__LIBRARY_WARNING_MESSAGE__) # warning "Either __NEWLIB__ or __REDLIB__ should be defined when using the C library. Defaulting to __NEWLIB__" # define __LIBRARY_WARNING_MESSAGE__ # endif # endif #endif
/* * mp-binomial.h * * High-precison factorials and binomials, using the * Gnu Multiple-precision library. * * Copyright (C) 2005,2006 Linas Vepstas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ #include <gmp.h> #include <mp-complex.h> #ifdef __cplusplus extern "C" { #endif /* i_poch_rising * Rising pochhammer symbol, for integer values. * * Brute force, simple. */ void i_poch_rising (mpz_t poch, unsigned int k, unsigned int n); /** * i_factorial -- the factorial */ // #define USE_LOCAL_FACTORIAL #ifdef USE_LOCAL_FACTORIAL void i_factorial (mpz_t fact, unsigned int n); #else #define i_factorial mpz_fac_ui #endif /* USE_LOCAL_FACTORIAL */ /** * fp_inv_factorial -- Return 1/n! * Returns a cached value to improve performance. */ void fp_inv_factorial (mpf_t invfac, unsigned int n, unsigned int prec); /* i_binomial * Binomial coefficient (n k) $ {n \choose k} $ */ // #define USE_LOCAL_BINOMIAL #ifdef USE_LOCAL_BINOMIAL void i_binomial (mpz_t bin, unsigned int n, unsigned int k); #else #define i_binomial mpz_bin_uiui #endif /* USE_LOCAL_BINOMIAL */ /** * i_binomial_sequence -- returns binomial, assumes purely sequential access. * * Returns $ {n \choose k} $ * * This routine assumes that the binomial coefficients will be * accessed in an utterly sequential mode, with k running from * zero to n, and n running from zero to infinity. For sequential access, * this routine is very, very fast. If the access is not sequential, * the correct answer is still returned; just that a random access * compute method is used, which is considerably slower. */ void i_binomial_sequence (mpz_t bin, unsigned int n, unsigned int k); /** * stirling_first - Stirling Numbers of the First kind, * normalized so that they are all positive. * Uses dynamically-sized cache. */ void i_stirling_first (mpz_t s, unsigned int n, unsigned int k); /* A funny off-by-one sum of stirling and binomial */ void i_stirbin_sum (mpz_t s, unsigned int n, unsigned int m); /** * stirling_second - Stirling Numbers of the Second kind, * Uses dynamically-sized cache. */ void i_stirling_second (mpz_t s, unsigned int n, unsigned int k); /* binomial transform of power sum */ void fp_bin_xform_pow (mpf_t bxp, unsigned int n, unsigned int s); /** * fp_harmonic -- The harmonic number, H_n = sum_k=1^n 1/k * Caches values, for speed. */ void fp_harmonic (mpf_t harm, unsigned int n, unsigned int prec); /** * fp_poch_rising * Rising pochhammer symbol (x)_n, for real values of x and integer n. * p = x(x+1)(x+2)...(x+n-1) = Gamma(x+n)/Gamma(x) * * Brute force, simple. */ void fp_poch_rising (mpf_t poch, mpf_t x, unsigned int n); void fp_poch_rising_d (mpf_t poch, double x, unsigned int n); /** * cpx_poch_rising * Rising pochhammer symbol (s)_n, for complex s and integer n. * * Brute force, simple. */ void cpx_poch_rising_d (cpx_t poch, double re_s, double im_s, unsigned int n); /** * cpx_poch_rising * Rising pochhammer symbol (s)_n, for complex s and integer n. * * Brute force, simple. */ void cpx_poch_rising (cpx_t poch, const cpx_t s, unsigned int n); /** * fp_binomial_d * Binomial coefficient, for double-precision s. */ void fp_binomial_d (mpf_t bin, double s, unsigned int k); /** * cpx_binomial-- Complex binomial coefficient * Compute the binomial coefficient (s k) for complex s. * That is, $ {s \choose k} $ */ void cpx_binomial_d (cpx_t bin, double re_s, double im_s, unsigned int k); void cpx_binomial (cpx_t bin, const cpx_t s, unsigned int k); /** * cpx_binomial_sum_cache-- Complex binomial coefficient * Compute the binomial coefficient for (s+k, k) * This routine caches computed values, and thus can be considerably * faster if called again with the same k and s values. */ void cpx_binomial_sum_cache (cpx_t bin, const cpx_t s, unsigned int k); #ifdef __cplusplus }; #endif
/* * This file is part of the SSH Library * * Copyright (c) 2009 by Aris Adamantiadis * * The SSH 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 SSH Library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the SSH Library; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifndef WRAPPER_H_ #define WRAPPER_H_ #include "config.h" #include "libssh/libcrypto.h" #include "libssh/libgcrypt.h" #include "libssh/crypto.h" enum ssh_mac_e { SSH_MAC_SHA1=1, SSH_MAC_SHA256, SSH_MAC_SHA384, SSH_MAC_SHA512 }; enum ssh_hmac_e { SSH_HMAC_SHA1 = 1, SSH_HMAC_MD5 }; typedef struct ssh_mac_ctx_struct *ssh_mac_ctx; MD5CTX md5_init(void); void md5_update(MD5CTX c, const void *data, unsigned long len); void md5_final(unsigned char *md,MD5CTX c); SHACTX sha1_init(void); void sha1_update(SHACTX c, const void *data, unsigned long len); void sha1_final(unsigned char *md,SHACTX c); void sha1(unsigned char *digest,int len,unsigned char *hash); void sha256(unsigned char *digest, int len, unsigned char *hash); ssh_mac_ctx ssh_mac_ctx_init(enum ssh_mac_e type); void ssh_mac_update(ssh_mac_ctx ctx, const void *data, unsigned long len); void ssh_mac_final(unsigned char *md, ssh_mac_ctx ctx); HMACCTX hmac_init(const void *key,int len, enum ssh_hmac_e type); void hmac_update(HMACCTX c, const void *data, unsigned long len); void hmac_final(HMACCTX ctx,unsigned char *hashmacbuf,unsigned int *len); int crypt_set_algorithms(ssh_session ); int crypt_set_algorithms_server(ssh_session session); struct ssh_crypto_struct *crypto_new(void); void crypto_free(struct ssh_crypto_struct *crypto); #endif /* WRAPPER_H_ */
/* * This file is part of LookAlike * * Copyright (C) 2012 Igalia S.L. * * Contact: agomez@igalia.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef FACETRACKERPROVIDER_H #define FACETRACKERPROVIDER_H #include <QObject> class QAbstractItemModel; class QSparqlConnection; class TrackerLiveQuery; class FaceTrackerProxy; class FaceTrackerProvider : public QObject { Q_OBJECT public: explicit FaceTrackerProvider(QSparqlConnection *connection, QObject *parent = 0); ~FaceTrackerProvider(); QAbstractItemModel* model(); QSparqlConnection* connection(); private: void updateEverybodyCount(); QSparqlConnection *m_sparqlConnection; TrackerLiveQuery *m_liveQuery; FaceTrackerProxy *m_proxy; }; #endif // FACETRACKERPROVIDER_H
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : LightApp_LightApp_WgViewModel.h // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) #ifndef LIGHTAPP_WGVIEWMODEL_H #define LIGHTAPP_WGVIEWMODEL_H #include "SUIT_ViewModel.h" #include "SUIT_ViewManager.h" class LightApp_WgViewModel : public SUIT_ViewModel { Q_OBJECT public: LightApp_WgViewModel( const QString& type, QWidget* w ); virtual ~LightApp_WgViewModel(); virtual SUIT_ViewWindow* createView( SUIT_Desktop* d ); virtual QString getType() const; private: QString myType; QWidget* myWidget; bool myCreated; }; #endif // LIGHTAPP_WGVIEWMODEL_H
/* * Copyright (C) 2006 Apple Computer, Inc. * Copyright (C) 2009 Google, Inc. * * 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 RenderSVGForeignObject_h #define RenderSVGForeignObject_h #if ENABLE(SVG) #include "AffineTransform.h" #include "FloatPoint.h" #include "FloatRect.h" #include "RenderSVGBlock.h" namespace WebCore { class SVGForeignObjectElement; class RenderSVGForeignObject : public RenderSVGBlock { public: explicit RenderSVGForeignObject(SVGForeignObjectElement*); virtual ~RenderSVGForeignObject(); virtual const char* renderName() const { return "RenderSVGForeignObject"; } virtual void paint(PaintInfo&, const LayoutPoint&); virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect&, bool fixed = false) const; virtual bool requiresLayer() const { return false; } virtual void layout(); virtual FloatRect objectBoundingBox() const { return FloatRect(FloatPoint(), m_viewport.size()); } virtual FloatRect strokeBoundingBox() const { return FloatRect(FloatPoint(), m_viewport.size()); } virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(FloatPoint(), m_viewport.size()); } virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE; virtual bool isSVGForeignObject() const { return true; } virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; virtual const RenderObject* pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap&) const; virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; } private: virtual void computeLogicalWidth(); virtual void computeLogicalHeight(); virtual const AffineTransform& localToParentTransform() const; virtual AffineTransform localTransform() const { return m_localTransform; } bool m_needsTransformUpdate : 1; FloatRect m_viewport; AffineTransform m_localTransform; mutable AffineTransform m_localToParentTransform; }; } #endif #endif
#include <fcntl.h> #include <unistd.h> #include <stdarg.h> #include "syscall.h" #include "libc.h" int openat(int fd, const char *filename, int flags, ...) { int r; mode_t mode; va_list ap; va_start(ap, flags); mode = va_arg(ap, mode_t); va_end(ap); CANCELPT_BEGIN; r = syscall(SYS_openat, fd, filename, flags|O_LARGEFILE, mode); CANCELPT_END; return r; } LFS64(openat);
/* PLIB - A Suite of Portable Game Libraries Copyright (C) 1998,2002 Steve Baker 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; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: puFLTK.h 1857 2004-02-16 13:49:03Z stromberg $ */ #ifndef _PU_FLTK_H_ #define _PU_FLTK_H_ #ifndef PU_USE_FLTK # define PU_USE_FLTK #endif #include "pu.h" #include <FL/Fl_Gl_Window.H> inline int puGetWindowFLTK () { return (int) Fl_Window::current () ; } inline void puSetWindowFLTK ( int window ) { ((Fl_Gl_Window *) window) -> make_current () ; } inline void puGetWindowSizeFLTK ( int *width, int *height ) { Fl_Window * window = Fl_Window::current () ; *width = window->w() ; *height = window->h() ; } inline void puSetWindowSizeFLTK ( int width, int height ) { Fl_Window * window = Fl_Window::current () ; window -> resize ( window->x(), window->y(), width, height ) ; } inline void puInitFLTK () { puSetWindowFuncs ( puGetWindowFLTK, puSetWindowFLTK, puGetWindowSizeFLTK, puSetWindowSizeFLTK ) ; puRealInit () ; } #endif
#ifndef LOG_H_INCLUDED #define LOG_H_INCLUDED ///////////////////////////////////////////////////////////////////////////// // ƒfƒoƒbƒOƒƒOŠÖŒW ///////////////////////////////////////////////////////////////////////////// // ƒƒO‚ðŽæ‚éê‡1‚É‚·‚é #define KEY_LOG 0 // ƒL[“ü—ÍŠÖŒW #define MEM_LOG 0 // ƒƒ‚ƒŠŠÖŒW #define TAPE_LOG 0 // TAPEŠÖŒW #define P6T2_LOG 0 // P6T2ŠÖŒW #define DISK_LOG 0 // DISKŠÖŒW #define FDC_LOG 0 // FDCŠÖŒW #define D88_LOG 0 // D88ŠÖŒW #define PSG_LOG 0 // PSG/OPNŠÖŒW #define INTR_LOG 0 // Š„ž‚ÝŠÖŒW #define CPU_LOG 0 // CPUŠÖŒW #define SUB_LOG 0 // ƒTƒuCPUŠÖŒW #define PPI_LOG 0 // 8255ŠÖŒW #define SND_LOG 0 // SoundŠÖŒW #define GRP_LOG 0 // •`‰æŠÖŒW #define VDG_LOG 0 // VDGŠÖŒW #define OSD_LOG 0 // OSˆË‘¶ŠÖŒW #define TIC_LOG 0 // ƒXƒPƒWƒ…[ƒ‰ŠÖŒW #define INI_LOG 0 // INIŠÖŒW #define CON_LOG 0 // ƒRƒ“ƒXƒgƒ‰ƒNƒ^ŠÖŒW #define IO_LOG 0 // I/OŠÖŒW #define WIN_LOG 0 // ƒEƒBƒ“ƒhƒEŠÖŒW #define CONST_LOG 0 // ƒRƒ“ƒXƒgƒ‰ƒNƒ^EƒfƒXƒgƒ‰ƒNƒ^ŠÖŒW #define VOI_LOG 0 // ‰¹º‡¬ŠÖŒW #define VM_LOG 0 // ‰¼‘zƒ}ƒVƒ“ƒRƒAŠÖŒW #if KEY_LOG || MEM_LOG || TAPE_LOG || P6T2_LOG || DISK_LOG || D88_LOG || FDC_LOG || PSG_LOG || INTR_LOG || CPU_LOG || SUB_LOG || PPI_LOG || SND_LOG || GRP_LOG || VDG_LOG || OSD_LOG || TIC_LOG || INI_LOG || CON_LOG || IO_LOG || WIN_LOG || CONST_LOG || VOI_LOG || VM_LOG #include <stdio.h> #define PRINTD(m,...) { if( m ){ fprintf( stdout, __VA_ARGS__ ); fflush( stdout ); } } #else #define PRINTD(m,...) #endif #endif // LOG_H_INCLUDED
#pragma once #include <assert.h> #ifdef __cplusplus extern "C" { #endif /* codepoint_info hold information about the text to be displayed */ struct codepoint_info_s { // unicode int32_t codepoint; int32_t real_codepoint; // screen info uint32_t split_flag; uint32_t split_count; uint64_t cp_index; // style bool is_selected; bool used; bool italic; bool bold; bool underline; // position in buffer uint64_t offset; uint64_t size; // rect2i(vec2i, vec2i) (pos,dim) ? // vec2f // (x, y) float x; float y; // vec2i dim; // (w, h) ? int32_t w; int32_t h; // color4f fg; float r; float g; float b; float a; // font info : the rendering must sort by texture id }; typedef struct codepoint_info_s codepoint_info_t; inline void codepoint_info_reset(codepoint_info_t * info) { // unicode info->codepoint = ' '; // the codepoint to display info->real_codepoint = ' '; // the codepoint before filtering '\n' -> ' ' , '\t' -> ' -> ', simple enough info->split_flag = 0; info->split_count = 0; info->cp_index = uint64_t(-1); // style info->is_selected = false; info->used = false; info->italic = false; info->bold = false; info->underline = false; info->offset = 0; // offset in raw buffer info->size = 0; // next offset, ie fold etc... // vec2f // (x, y) info->x = 0.0f; info->y = 0.0f; // vec2i dim; // (w, h) ? info->w = 0; info->h = 0; // rect2i(vec2i, vec2i) (pos,dim) ? // color4f fg; info->r = 0.25f; info->g = 0.25f; info->b = 0.25f; info->a = 1.0f; // color4f bg; // font info : the rendering must sort by texture id } #ifdef __cplusplus } #endif
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "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 Digia Plc and its Subsidiary(-ies) 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." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef TORRENTSERVER_H #define TORRENTSERVER_H #include <QList> #include <QTcpServer> class TorrentClient; class TorrentServer : public QTcpServer { Q_OBJECT public: inline TorrentServer() {} static TorrentServer *instance(); void addClient(TorrentClient *client); void removeClient(TorrentClient *client); protected: void incomingConnection(int socketDescriptor); private slots: void removeClient(); void processInfoHash(const QByteArray &infoHash); private: QList<TorrentClient *> clients; }; #endif
/* ////////////////////////////////////////////////////////////////////////////////////// * includes */ #include "../demo.h" /* ////////////////////////////////////////////////////////////////////////////////////// * main */ tb_int_t tb_demo_string_static_string_main(tb_int_t argc, tb_char_t** argv) { tb_static_string_t s; tb_char_t b[4096]; tb_static_string_init(&s, b, 4096); tb_static_string_cstrcpy(&s, "hello"); tb_static_string_chrcat(&s, ' '); tb_static_string_cstrfcat(&s, "%s", "world"); tb_trace_i("%s", tb_static_string_cstr(&s)); tb_static_string_exit(&s); return 0; }
/* * This file is part of nanocoop * * Copyright (C) 2014 - Nenad Radulovic * * nanocoop is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * nanocoop 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 Lesser General Public License * along with eSolid. If not, see <http://www.gnu.org/licenses/>. * * web site: http://github.com/nradulovic * e-mail : nenad.b.radulovic@gmail.com *//***********************************************************************//** * @file * @author Nenad Radulovic * @brief Configuration *********************************************************************//** @{ */ #ifndef NC_CONFIG_H #define NC_CONFIG_H /*========================================================= INCLUDE FILES ==*/ /*=============================================================== MACRO's ==*/ #define CONFIG_NC_NUM_OF_THREADS 10 #define CONFIG_NC_NUM_OF_PRIO_LEVELS 32 /*================================*//** @cond *//*== CONFIGURATION ERRORS ==*/ /** @endcond *//** @} *//****************************************************** * END of nc_config.h ******************************************************************************/ #endif /* NC_CONFIG_H */
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTRULESREQUEST_P_H #define QTAWS_LISTRULESREQUEST_P_H #include "wafrequest_p.h" #include "listrulesrequest.h" namespace QtAws { namespace WAF { class ListRulesRequest; class ListRulesRequestPrivate : public WafRequestPrivate { public: ListRulesRequestPrivate(const WafRequest::Action action, ListRulesRequest * const q); ListRulesRequestPrivate(const ListRulesRequestPrivate &other, ListRulesRequest * const q); private: Q_DECLARE_PUBLIC(ListRulesRequest) }; } // namespace WAF } // namespace QtAws #endif
/* libgeltan - Qt based payment service library * Copyright (C) 2016 Buschtrommel / Matthias Fehring * Contact: https://www.buschmann23.de * * Geltan/PP/Objects/fmfdetails_p.h * * 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 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef FMFDETAILS_P_H #define FMFDETAILS_P_H #include "fmfdetails.h" #ifdef QT_DEBUG #include <QtDebug> #endif namespace Geltan { namespace PP { class FMFDetailsPrivate { public: FMFDetailsPrivate(FMFDetails *parent) : q_ptr(parent), filterType(FMFDetails::NO_FILTER_TYP), filterId(FMFDetails::NO_FILTER_IDENTIFIER) {} ~FMFDetailsPrivate() {} void setFilterType(const QString &ft) { if (ft == QLatin1String("ACCEPT")) { setFilterType(FMFDetails::ACCEPT); } else if (ft == QLatin1String("PENDING")) { setFilterType(FMFDetails::PENDING); } else if (ft == QLatin1String("DENY")) { setFilterType(FMFDetails::DENY); } else if (ft == QLatin1String("REPORT")) { setFilterType(FMFDetails::REPORT); } else { setFilterType(FMFDetails::NO_FILTER_TYP); } } void setFilterType(FMFDetails::FilterType nFilterType) { if (filterType != nFilterType) { Q_Q(FMFDetails); filterType = nFilterType; #ifdef QT_DEBUG qDebug() << "Changed filterType to" << filterType; #endif Q_EMIT q->filterTypeChanged(filterType); } } void setFilterId(const QString &fi) { if (fi == QLatin1String("AVS_NO_MATCH")) { setFilterId(FMFDetails::AVS_NO_MATCH); } else if (fi == QLatin1String("AVS_PARTIAL_MATCH")) { setFilterId(FMFDetails::AVS_PARTIAL_MATCH); } else if (fi == QLatin1String("AVS_UNAVAILABLE_OR_UNSUPPORTED")) { setFilterId(FMFDetails::AVS_UNAVAILABLE_OR_UNSUPPORTED); } else if (fi == QLatin1String("CARD_SECURITY_CODE_MISMATCH")) { setFilterId(FMFDetails::CARD_SECURITY_CODE_MISMATCH); } else if (fi == QLatin1String("MAXIMUM_TRANSACTION_AMOUNT")) { setFilterId(FMFDetails::MAXIMUM_TRANSACTION_AMOUNT); } else if (fi == QLatin1String("UNCONFIRMED_ADDRESS")) { setFilterId(FMFDetails::UNCONFIRMED_ADDRESS); } else if (fi == QLatin1String("COUNTRY_MONITOR")) { setFilterId(FMFDetails::COUNTRY_MONITOR); } else if (fi == QLatin1String("LARGE_ORDER_NUMBER")) { setFilterId(FMFDetails::LARGE_ORDER_NUMBER); } else if (fi == QLatin1String("BILLING_OR_SHIPPING_ADDRESS_MISMATCH")) { setFilterId(FMFDetails::BILLING_OR_SHIPPING_ADDRESS_MISMATCH); } else if (fi == QLatin1String("RISKY_ZIP_CODE")) { setFilterId(FMFDetails::RISKY_ZIP_CODE); } else if (fi == QLatin1String("SUSPECTED_FREIGHT_FORWARDER_CHECK")) { setFilterId(FMFDetails::SUSPECTED_FREIGHT_FORWARDER_CHECK); } else if (fi == QLatin1String("TOTAL_PURCHASE_PRICE_MINIMUM")) { setFilterId(FMFDetails::TOTAL_PURCHASE_PRICE_MINIMUM); } else if (fi == QLatin1String("IP_ADDRESS_VELOCITY")) { setFilterId(FMFDetails::IP_ADDRESS_VELOCITY); } else if (fi == QLatin1String("RISKY_EMAIL_ADDRESS_DOMAIN_CHECK")) { setFilterId(FMFDetails::RISKY_EMAIL_ADDRESS_DOMAIN_CHECK); } else if (fi == QLatin1String("RISKY_BANK_IDENTIFICATION_NUMBER_CHECK")) { setFilterId(FMFDetails::RISKY_BANK_IDENTIFICATION_NUMBER_CHECK); } else if (fi == QLatin1String("RISKY_IP_ADDRESS_RANGE")) { setFilterId(FMFDetails::RISKY_IP_ADDRESS_RANGE); } else if (fi == QLatin1String("PAYPAL_FRAUD_MODEL")) { setFilterId(FMFDetails::PAYPAL_FRAUD_MODEL); } else { setFilterId(FMFDetails::NO_FILTER_IDENTIFIER); } } void setFilterId(FMFDetails::FilterIdentifier nFilterId) { if (filterId != nFilterId) { Q_Q(FMFDetails); filterId = nFilterId; #ifdef QT_DEBUG qDebug() << "Changed filterId to" << filterId; #endif Q_EMIT q->filterIdChanged(filterId); } } void setName(const QString &nName) { if (name != nName) { Q_Q(FMFDetails); name = nName; #ifdef QT_DEBUG qDebug() << "Changed name to" << name; #endif Q_EMIT q->nameChanged(name); } } void setDescription(const QString &nDescription) { if (description != nDescription) { Q_Q(FMFDetails); description = nDescription; #ifdef QT_DEBUG qDebug() << "Changed description to" << description; #endif Q_EMIT q->descriptionChanged(description); } } FMFDetails * const q_ptr; Q_DECLARE_PUBLIC(FMFDetails) FMFDetails::FilterType filterType; FMFDetails::FilterIdentifier filterId; QString name; QString description; }; } } #endif // FMFDETAILS_P_H
/* ========================================================================= * This file is part of sys-c++ * ========================================================================= * * (C) Copyright 2004 - 2009, General Dynamics - Advanced Information Systems * * sys-c++ 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 __SYS_TIME_STAMP_H__ #define __SYS_TIME_STAMP_H__ #include <string> #include "str/Format.h" #include "Conf.h" #include "LocalDateTime.h" #include "UTCDateTime.h" #include "Export.h" /*! * \file TimeStamp.h * \brief Get a timestamp in a system-independent manner * * Provide the API for timestamps */ namespace sys { /*! * \class TimeStamp * \brief Class for timestamping * */ class DLL_PUBLIC_CLASS TimeStamp { public: //! The maximum length of a timestamp enum { MAX_TIME_STAMP = 64 }; /*! * Default constructor. * \param is24HourTime Optional specifier for military time */ TimeStamp(bool is24HourTime = false) : m24HourTime(is24HourTime) {} //! Destructor ~TimeStamp() {} /*! * Produces a local-time string timestamp * \return local-time */ std::string local() const { sys::LocalDateTime dt; return dt.format(getFormat()); } /*! * Produces a gmt string timestamp * \return gmt */ std::string gmt() const { sys::UTCDateTime dt; return dt.format(getFormat()); } private: /*! * Sets up string in desired format * \return The string format for printing */ const char* getFormat() const { if (m24HourTime) { return "%m/%d/%Y, %H:%M:%S"; } return "%m/%d/%Y, %I:%M:%S%p"; } //! Military time??? bool m24HourTime; }; } #endif
#include <check.h> #include "../../src/core/iterate.h" #include "../../src/utils/structs.h" #include "../../src/utils/print_node.h" #include <stdlib.h> substring* create_substr(void) { substring* new = malloc(sizeof(substring)); interval normal = *((interval*) malloc(sizeof(interval))); interval reverse = *((interval*) malloc(sizeof(interval))); new->normal = normal; new->reverse = reverse; return new; } START_TEST(test_print) { iterator_state* state = initialize_iterator(0, 0); substring* new = create_substr(); new->normal.i = 5; new->normal.j = 8; new->reverse.i = 6; new->reverse.j = 9; new->length = 3; state->current = new; print_node(state,0); } END_TEST TCase * create_print_node_test_case(void){ TCase * tc_stack = tcase_create("print_node_test"); tcase_add_test(tc_stack, test_print); return tc_stack; } Suite * test_suite(void) { Suite *s = suite_create("testi"); TCase *tc_stack = create_print_node_test_case(); suite_add_tcase(s, tc_stack); return s; } int main(){ int number_failed; Suite *s = test_suite(); SRunner *sr = srunner_create(s); srunner_run_all(sr, CK_VERBOSE); number_failed = srunner_ntests_failed(sr); srunner_free(sr); if(number_failed == 0){ return 0; } else{ return 1; } }
// Created file "Lib\src\Uuid\i_mshtml" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_ISegment, 0x3050f683, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
// Created file "Lib\src\Uuid\X64\uiautomationcore_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c, 0x90, 0x25, 0x17, 0x99, 0x93, 0x49, 0xcd);
#pragma once #include <main/entity/building/building.h> namespace fns { namespace entity { class TreeBuilding : public Building { friend class DataStore; protected: TreeBuilding(); virtual Tasks generateTasks() override; public: static QString entityId() { return QStringLiteral("tree_building"); } }; } // entity } // fns
// Created file "Lib\src\strmiids\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CODECAPI_AVDecVideoSWPowerLevel, 0xfb5d2347, 0x4dd8, 0x4509, 0xae, 0xd0, 0xdb, 0x5f, 0xa9, 0xaa, 0x93, 0xf4);
#include <asf.h> #include "ra915.h" #include "pca9557.h" #include "drv8832.h" /* asr[0] = ADCA0 = PA0 = J3-1 = AD7705_RESET asr[1] = ADCA1 = PA1 = J3-2 = X11_6 asr[2] = ADCA2 = PA2 = J3-3 = X11_5 asr[3] = ADCA3 = PA3 = J3-4 = DISPLAY_RESET asr[4] = ADCA4 = PA4 == ADC4 = J2-5 = VACUUM asr[5] = ADCA5 = PA5 == ADC5 = J2-6 = DILUTION asr[6] = ADCA6 = PA6 == ADC6 = J2-7 = BYPASS_PRESSURE asr[7] = ADCA7 = PA7 == ADC7 = J2-8 = P4 asr[8] = ADCB0 = PB0 = ADC0 = J2-1 = PMT_CURR asr[9] = ADCB1 = PB1 = ADC1 = J2-2 = PMT_V asr[10] = ADCB2 = PB2 = ADC2 = J2-3 = FLOW asr[11] = ADCB3 = PB3 = ADC3 = J2-4 = T_S_C asr[12] = ADCB4 = PB4 = J3-5 = X11_4 asr[13] = ADCB5 = PB5 = J3-6 = X11_3 asr[14] = ADCB6 = PB6 = J3-7 = X11_2 asr[15] = ADCB7 = PB7 = J3-8 = X11_1 */ struct drv8832 cell = { .left_out = { .address = 0x18, .pin_number = 7 }, .right_out = { .address = 0x18, .pin_number = 6 }, .left_in = { .address = 0x18, .pin_number = 5 }, .right_in = { .address = 0x18, .pin_number = 4 } }; struct pca9557_pin elemental = { .address = 0x1a, .pin_number = 0 }; struct pca9557_pin calibration = { .address = 0x1a, .pin_number = 1 }; struct pca9557_pin zero = { .address = 0x1a, .pin_number = 2 }; struct pca9557_pin ignition = { .address = 0x1a, .pin_number = 3 }; struct pca9557_pin watlow1 = { .address = 0x18, .pin_number = 7 }; struct pca9557_pin watlow2 = { .address = 0x18, .pin_number = 7 }; struct pca9557_pin watlow3 = { .address = 0x18, .pin_number = 7 }; struct pca9557_pin watlow4 = { .address = 0x18, .pin_number = 7 }; struct pca9557_pin watlow5 = { .address = 0x18, .pin_number = 7 }; void ra915init(void) { drv8832_init(cell); pca9557_set_pin_dir(elemental.address, elemental.pin_number, PCA9557_DIR_OUTPUT); pca9557_set_pin_dir(calibration.address, calibration.pin_number, PCA9557_DIR_OUTPUT); pca9557_set_pin_dir(zero.address, zero.pin_number, PCA9557_DIR_OUTPUT); pca9557_set_pin_dir(ignition.address, ignition.pin_number, PCA9557_DIR_OUTPUT); pca9557_set_pin_dir(watlow1.address, watlow1.pin_number, PCA9557_DIR_INPUT); pca9557_set_pin_dir(watlow2.address, watlow2.pin_number, PCA9557_DIR_INPUT); pca9557_set_pin_dir(watlow3.address, watlow3.pin_number, PCA9557_DIR_INPUT); pca9557_set_pin_dir(watlow4.address, watlow4.pin_number, PCA9557_DIR_INPUT); pca9557_set_pin_dir(watlow5.address, watlow5.pin_number, PCA9557_DIR_INPUT); } void process_ra915_request(int marker,uint8_t *buffer,int fillbuffer) { switch (marker) { case 0xB5: // if (fillbuffer == 4) // { // if (buffer[3] == genchecksum(buffer,4)) // { processcontrolbyte(buffer[0]); // } // } break; case 0xCA: // ?\_(?)_/? break; default: break; } } void processcontrolbyte(uint8_t controlbyte) { pca9557_set_pin_level(ignition.address,ignition.pin_number,controlbyte & _BV(1)); // ign pca9557_set_pin_level(zero.address,zero.pin_number, controlbyte & _BV(2)); //zero drv8832_turn(cell,controlbyte & _BV(3)); pca9557_set_pin_level(calibration.address,calibration.pin_number, controlbyte & _BV(4)); //cal pca9557_set_pin_level(elemental.address,elemental.pin_number, controlbyte & _BV(5)); //elemental } uint8_t generatestatusbyte(void) { uint8_t statusbyte = 0; if (pca9557_get_pin_level(watlow1.address,watlow1.pin_number)) statusbyte |= _BV(1);//watlow1//internal if (pca9557_get_pin_level(cell.left_in.address,cell.left_in.pin_number)) statusbyte |= _BV(2);//cellon if (pca9557_get_pin_level(cell.right_in.address,cell.right_in.pin_number)) statusbyte |= _BV(3);//celloff if (pca9557_get_pin_level(watlow2.address,watlow2.pin_number)) statusbyte |= _BV(4);//watlow2//sample if (pca9557_get_pin_level(watlow3.address,watlow3.pin_number)) statusbyte |= _BV(5);//watlow3//probe if (pca9557_get_pin_level(watlow4.address,watlow4.pin_number)) statusbyte |= _BV(6);//watlow4//filter if (pca9557_get_pin_level(watlow5.address,watlow5.pin_number)) statusbyte |= _BV(7);//watlow5//converter return statusbyte; } uint8_t genchecksum(uint8_t *massive, int sizeofmassive) { uint8_t checksum = 0; for (int i=0;i<sizeofmassive;i++) checksum = checksum + massive[i]; return checksum; }
/* * mdaRingModProcessor.h * mda-vst3 * * Created by Arne Scheffler on 6/14/08. * * mda VST Plug-ins * * Copyright (c) 2008 Paul Kellett * * 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 once #include "mdaBaseProcessor.h" namespace Steinberg { namespace Vst { namespace mda { //----------------------------------------------------------------------------- class RingModProcessor : public BaseProcessor { public: RingModProcessor (); ~RingModProcessor (); tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE; tresult PLUGIN_API terminate () SMTG_OVERRIDE; tresult PLUGIN_API setActive (TBool state) SMTG_OVERRIDE; void doProcessing (ProcessData& data) SMTG_OVERRIDE; //----------------------------------------------------------------------------- static FUnknown* createInstance (void*) { return (IAudioProcessor*)new RingModProcessor; } static FUID uid; //----------------------------------------------------------------------------- protected: void recalculate () SMTG_OVERRIDE; float fPhi; float fdPhi; float nul; float twoPi; float ffb, fprev; }; }}} // namespaces
#pragma once #include "export.h" #include "FileOutput.h" #include "LmdFile.h" #define IMAGE_SCREENSHOT 0 #define IMAGE_CLICK_VISUALIZATION 1 #define IMAGE_CLICK_AREA_SNAPSHOT 2 #define SLIDE_HEIGHT 847 #define SLIDE_WIDTH 450 #define HEADER_HEIGHT 91 #define FOOTER_HEIGHT 91 #define CHAPTER_TEXT_HEIGHT 34 #define CALLOUT_TEXT_HEIGHT 20 #define SNAPSHOT_HEIGHT 35 class CManualConfiguration; class FILESDK_EXPORT CWordSlideObject { public: CWordSlideObject(void); ~CWordSlideObject(void); public: void AddImage(DrawSdk::Image *pImage); void AddText(DrawSdk::Text *pText); DrawSdk::Image *GetImage() {return m_pImage;} void GetTexts(CArray<DrawSdk::Text *, DrawSdk::Text *> &aText) {aText.Append(m_aText);} void SetChapterTitle(CString csTitle) {m_csChapterTitle = csTitle;} CString GetChapterTitle() {return m_csChapterTitle;} void SetClickObjectBounds(CRect rcClickBounds) {m_rcClickBounds = rcClickBounds;} CRect GetClickObjectBounds() {return m_rcClickBounds;} void SetClickPoint(CPoint ptClick) {m_ptClick = ptClick;} CPoint GetClickPoint() {return m_ptClick;} private: DrawSdk::Image *m_pImage; CArray<DrawSdk::Text *, DrawSdk::Text *> m_aText; CString m_csChapterTitle; CRect m_rcClickBounds; CPoint m_ptClick; }; class FILESDK_EXPORT CWordXml { public: CWordXml(CManualConfiguration *pManualConfiguration, LPCTSTR tszDocumentTitle); ~CWordXml(void); public: HRESULT Write(CString csFilename, CMetaInformation &metainfo, CArray<CWordSlideObject *, CWordSlideObject *> &aPage); private: LPBYTE GetDataFromResource(int iTextResourceID, DWORD &dwSize); HRESULT GetCStringFromResource(int iTextResourceID, CString &csResource); HRESULT Replace(CString &csText, LPCTSTR tszTemplateVar, LPCTSTR tszReplaceText); HRESULT Write(CFileOutput &wordOutput, int iTextResourceID); HRESULT WriteProperties(CFileOutput &wordOutput, CMetaInformation &metainfo); /** * Writes Cover sheet, Table of content, all click information, page header and footer. */ HRESULT WriteDocumentContent(CFileOutput &wordOutput, CArray<CWordSlideObject *, CWordSlideObject *> &aSlide, CMetaInformation &metainfo); HRESULT CWordXml::GenerateImageData(Gdiplus::Bitmap *bmpImage, CFileOutput &wordOutput, bool bFromFile, CString csImageName); HRESULT CWordXml::GenerateImages(CFileOutput &wordOutput, int &iImageId, int &iShapeId, DrawSdk::Image *pImage, int iImageType, CRect rcClickBounds, CString csClickNumber = _T(""), CString csCalloutText = _T(""), CPoint ptClick = CPoint(0,0)); HRESULT WriteTableOfContent(CFileOutput &wordOutput, CArray<CWordSlideObject *, CWordSlideObject *> &aSlide, CMetaInformation &metainfo); HRESULT WriteCoverSheet(CFileOutput &wordOutput, CMetaInformation &metainfo); int GetEncoderClsid(const WCHAR* format, CLSID* pClsid); void ReplaceAuthorAndDate(CString& csDest, CMetaInformation &metainfo); HRESULT GenerateThumbnail(CString csFilename, CArray<CWordSlideObject *, CWordSlideObject *> &aSlide, CMetaInformation &metainfo); void CalculateClickNumberPosition(CRect rcScreen, CRect rcClick, Gdiplus::RectF& rcEllipse, Gdiplus::PointF &p1, Gdiplus::PointF &p2); private: // pointer to the CEditorProject's manual configuration attribute CManualConfiguration *m_pManualConfiguration; LOGFONT m_logFont; CString m_csDocumentTitle; };
#include "../../../../src/utils/shvjournalfilereader.h"
#ifndef BANKSIMULATION_H_ #define BANKSIMULATION_H_ #include "linkList.h" #include "linkQueue.h" typedef linkList EventList; Event en; //ʼþ linkQueue q[5]; //4¸ö¿Í»§¶ÓÁÐ QElemType customer; //¿Í»§¼Í¼ EventList ev = NULL; //ʱ¼ä±í int totalTime = 0; //Àۼƿͻ§¶ºÁôʱ¼ä int customerNum = 0; //¿Í»§Êý int cmp(const Event &a, const Event &b) { if(a.occurTime < b.occurTime) { return -1; } else if(a.occurTime > b.occurTime) { return 1; } else { return 0; } } void bank_simulation(int closeTime); #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_REMOVEROLEFROMDBCLUSTERRESPONSE_H #define QTAWS_REMOVEROLEFROMDBCLUSTERRESPONSE_H #include "rdsresponse.h" #include "removerolefromdbclusterrequest.h" namespace QtAws { namespace RDS { class RemoveRoleFromDBClusterResponsePrivate; class QTAWSRDS_EXPORT RemoveRoleFromDBClusterResponse : public RdsResponse { Q_OBJECT public: RemoveRoleFromDBClusterResponse(const RemoveRoleFromDBClusterRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const RemoveRoleFromDBClusterRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(RemoveRoleFromDBClusterResponse) Q_DISABLE_COPY(RemoveRoleFromDBClusterResponse) }; } // namespace RDS } // namespace QtAws #endif
// Created file "Lib\src\Uuid\X64\cguid_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_DEVCLASS_FSFILTER_PHYSICALQUOTAMANAGEMENT, 0x6a0a8e78, 0xbba6, 0x4fc4, 0xa7, 0x09, 0x1e, 0x33, 0xcd, 0x09, 0xd6, 0x7e);
// Created file "Lib\src\PortableDeviceGuids\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_APPOINTMENT_RESOURCES, 0xf99efd03, 0x431d, 0x40d8, 0xa1, 0xc9, 0x4e, 0x22, 0x0d, 0x9c, 0x88, 0xd3);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_GETINSIGHTRESULTSREQUEST_P_H #define QTAWS_GETINSIGHTRESULTSREQUEST_P_H #include "securityhubrequest_p.h" #include "getinsightresultsrequest.h" namespace QtAws { namespace SecurityHub { class GetInsightResultsRequest; class GetInsightResultsRequestPrivate : public SecurityHubRequestPrivate { public: GetInsightResultsRequestPrivate(const SecurityHubRequest::Action action, GetInsightResultsRequest * const q); GetInsightResultsRequestPrivate(const GetInsightResultsRequestPrivate &other, GetInsightResultsRequest * const q); private: Q_DECLARE_PUBLIC(GetInsightResultsRequest) }; } // namespace SecurityHub } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DELETEACCESSPOINTRESPONSE_H #define QTAWS_DELETEACCESSPOINTRESPONSE_H #include "efsresponse.h" #include "deleteaccesspointrequest.h" namespace QtAws { namespace EFS { class DeleteAccessPointResponsePrivate; class QTAWSEFS_EXPORT DeleteAccessPointResponse : public EfsResponse { Q_OBJECT public: DeleteAccessPointResponse(const DeleteAccessPointRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const DeleteAccessPointRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DeleteAccessPointResponse) Q_DISABLE_COPY(DeleteAccessPointResponse) }; } // namespace EFS } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATECOLLECTIONREQUEST_H #define QTAWS_CREATECOLLECTIONREQUEST_H #include "rekognitionrequest.h" namespace QtAws { namespace Rekognition { class CreateCollectionRequestPrivate; class QTAWSREKOGNITION_EXPORT CreateCollectionRequest : public RekognitionRequest { public: CreateCollectionRequest(const CreateCollectionRequest &other); CreateCollectionRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(CreateCollectionRequest) }; } // namespace Rekognition } // namespace QtAws #endif
/* radare - LGPL - Copyright 2009-2012 pancake<nopcode.org> */ #include <r_lang.h> #include <r_util.h> #include "p/vala.c" // hardcoded RLang *__lang = NULL; R_API void r_lang_plugin_free (RLangPlugin *p) { if (p && p->fini) p->fini (__lang); } R_API RLang *r_lang_new() { RLang *lang = R_NEW (RLang); if (lang) { lang->user = NULL; lang->langs = r_list_new (); lang->langs->free = (RListFree)r_lang_plugin_free; lang->defs = r_list_new (); lang->defs->free = (RListFree)r_lang_def_free; r_lang_add (lang, &r_lang_plugin_vala); } return lang; } R_API void *r_lang_free(RLang *lang) { if (!lang) return NULL; __lang = NULL; r_lang_undef (lang, NULL); r_list_free (lang->langs); r_list_free (lang->defs); // TODO: remove langs plugins free (lang); return NULL; } // XXX: This is only used actually to pass 'core' structure // TODO: when language bindings are done we will need an api to // define symbols from C to the language namespace // XXX: Depcreate!! R_API void r_lang_set_user_ptr(RLang *lang, void *user) { lang->user = user; } R_API int r_lang_define(RLang *lang, const char *type, const char *name, void *value) { RLangDef *def; RListIter *iter; r_list_foreach (lang->defs, iter, def) { if (!strcmp (name, def->name)) { def->value = value; return R_TRUE; } } def = R_NEW (RLangDef); if (def != NULL) { def->type = strdup (type); def->name = strdup (name); def->value = value; r_list_append (lang->defs, def); return R_TRUE; } return R_FALSE; } R_API void r_lang_def_free (RLangDef *def) { free (def->name); free (def->type); free (def); } R_API void r_lang_undef(RLang *lang, const char *name) { if (name != NULL && *name) { RLangDef *def; RListIter *iter; /* No _safe loop necessary because we return immediately after the delete. */ r_list_foreach (lang->defs, iter, def) { if (!strcmp (name, def->name)) { r_list_delete (lang->defs, iter); break; } } } else r_list_destroy (lang->defs); } R_API int r_lang_setup(RLang *lang) { if (lang->cur && lang->cur->setup) return lang->cur->setup (lang); return R_FALSE; } R_API int r_lang_add(RLang *lang, RLangPlugin *foo) { if (foo && (!r_lang_get (lang, foo->name))) { if (foo->init) foo->init (lang); r_list_append (lang->langs, foo); } return R_TRUE; } /* TODO: deprecate all list methods */ R_API int r_lang_list(RLang *lang) { RListIter *iter; RLangPlugin *h; r_list_foreach (lang->langs, iter, h) { printf (" %s: %s\n", h->name, h->desc); } return R_FALSE; } R_API RLangPlugin *r_lang_get (RLang *lang, const char *name) { RListIter *iter; RLangPlugin *h; r_list_foreach (lang->langs, iter, h) { if (!strcmp (h->name, name)) return h; } return NULL; } R_API int r_lang_use(RLang *lang, const char *name) { RLangPlugin *h = r_lang_get (lang, name); if (h) { lang->cur = h; return R_TRUE; } return R_FALSE; } // TODO: store in r_lang and use it from the plugin? R_API int r_lang_set_argv(RLang *lang, int argc, char **argv) { if (lang->cur && lang->cur->set_argv) return lang->cur->set_argv (lang, argc, argv); return R_FALSE; } R_API int r_lang_run(RLang *lang, const char *code, int len) { if (lang->cur && lang->cur->run) return lang->cur->run (lang, code, len); return R_FALSE; } R_API int r_lang_run_string(RLang *lang, const char *code) { return r_lang_run (lang, code, strlen (code)); } R_API int r_lang_run_file(RLang *lang, const char *file) { int len, ret = R_FALSE; if (lang->cur) { if (lang->cur->run_file == NULL) { if (lang->cur->run != NULL) { char *code = r_file_slurp (file, &len); ret = lang->cur->run (lang, code, len); free (code); } } else ret = lang->cur->run_file (lang, file); } return ret; } /* TODO: deprecate or make it more modular .. reading from stdin in a lib?!? wtf */ R_API int r_lang_prompt(RLang *lang) { char buf[1024]; if (lang->cur == NULL) return R_FALSE; if (lang->cur->prompt) if (lang->cur->prompt (lang) == R_TRUE) return R_TRUE; /* init line */ RLine *line = r_line_singleton (); RLineHistory hist = line->history; RLineHistory histnull = {0}; RLineCompletion oc = line->completion; RLineCompletion ocnull = {0}; char *prompt = strdup (line->prompt); line->completion = ocnull; line->history = histnull; /* foo */ for (;;) { snprintf (buf, sizeof (buf)-1, "%s> ", lang->cur->name); r_line_set_prompt (buf); #if 0 printf ("%s> ", lang->cur->name); fflush (stdout); fgets (buf, sizeof (buf)-1, stdin); if (feof (stdin)) break; if (*buf) buf[strlen (buf)-1]='\0'; #endif char *p = r_line_readline (); if (!p) break; r_line_hist_add (p); strcpy (buf, p); if (!strcmp (buf, "q")) return R_TRUE; if (!strcmp (buf, "?")) { RLangDef *def; RListIter *iter; eprintf(" ? - show this help message\n" " q - quit\n"); if (lang->cur) { eprintf ("%s example:\n", lang->cur->name); if (lang->cur->help) eprintf ("%s", *lang->cur->help); } else eprintf ("no selected r_lang plugin\n"); if (!r_list_empty (lang->defs)) eprintf ("variables:\n"); r_list_foreach (lang->defs, iter, def) { eprintf (" %s %s\n", def->type, def->name); } } else r_lang_run (lang, buf, strlen (buf)); } // XXX: leaking history r_line_set_prompt (prompt); line->completion = oc; line->history = hist; clearerr (stdin); printf ("\n"); return R_TRUE; }
/* * heap.c */ #include "include/heap.h" #include <malloc.h> uint32_t system_get_free_heap_size(void) { // These are set by linker extern char __end__; extern char __StackLimit; uint32_t maxHeap = (uint32_t)&__StackLimit - (uint32_t)&__end__; struct mallinfo m = mallinfo(); return maxHeap - m.uordblks; }
// -*- Mode:C++ -*- /************************************************************************\ * * * This file is part of AVANGO. * * * * Copyright 1997 - 2010 Fraunhofer-Gesellschaft zur Foerderung der * * angewandten Forschung (FhG), Munich, Germany. * * * * Avango is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, version 3. * * * * Avango 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 Lesser General Public * * License along with Avango. If not, see <http://www.gnu.org/licenses/>. * * * * AVANGO is a trademark owned by FhG. * * * \************************************************************************/ #ifndef AV_PYTHON_OSG_BOUNDINGBOXCALCULATOR #define AV_PYTHON_OSG_BOUNDINGBOXCALCULATOR void init_OSGBoundingBoxCalculator(void); #endif
/* Projet: TuxFisher Licence: GPLv2 Version: BETA Author: Xavier Monin Date: 03/06/2010 Site: http://www.tuxfisher.net Mail: tuxfisher@free.fr Description: Jeu d'arcade/reflexion 2D mettant en scène le personnage Tux Copyright 2010 - Xavier Monin - Tous droits réservés This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _GAME_WIDGET_H_ #define _GAME_WIDGET_H_ #include <QGLWidget> //#include <QWidget>// #include "SoundManager.h" class QSound; class QImage; class GameEngine; class GameWidget : public QGLWidget // public QWidget// { Q_OBJECT public: GameWidget(QWidget *parent=0); ~GameWidget(); inline virtual QSize sizeHint() const { return bufferimage.size(); }; bool loadMap(int, int, QByteArray); void loadGraphism(QString); void loadSound(QString); protected: virtual void paintEvent(QPaintEvent *); virtual void keyPressEvent(QKeyEvent *); private: void generateImage(bool forcer_affichage=false); QImage generateWelcomeImage(); QImage avalanche, fish, tuxfisher, tuxfisher_mort, tuxfisher_vivant, tuxfisher_gagne, neige, montagne, vide; sound son_montagne, son_fish, son_mort, son_avalanche, son_victoire; GameEngine *moteur; SoundManager *audio; QImage bufferimage; QTimer *timer_animation; int nbcase_width; // Namebre de Cases (height) dans le widget int nbcase_height; int case_width; // Namebre de pixel d'une case int case_height; bool animation_en_cours; bool avalancheTombant; bool afficher_accueil; // true: Affiche l'accueil (une simple image) signals: void gameOver(); void levelCompleted(); void addMove(bool); private slots: void animation(); }; #endif // !_WIDGET_TUXFISHER_H
/* example4.c --- Example ToUnicode() code showing how to use Libidn. * Copyright (C) 2002-2015 Simon Josefsson * * This file is part of GNU Libidn. * * 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 <stdlib.h> #include <string.h> #include <locale.h> /* setlocale() */ #include <stringprep.h> /* stringprep_locale_charset() */ #include <idna.h> /* idna_to_unicode_lzlz() */ /* * Compiling using libtool and pkg-config is recommended: * * $ libtool cc -o example4 example4.c `pkg-config --cflags --libs libidn` * $ ./example4 * Input domain encoded as `ISO-8859-1': www.xn--rksmrgsa-0zap8p.example * Read string (length 33): 77 77 77 2e 78 6e 2d 2d 72 6b 73 6d 72 67 73 61 2d 30 7a 61 70 38 70 2e 65 78 61 6d 70 6c 65 * ACE label (length 23): 'www.räksmörgåsa.example' * 77 77 77 2e 72 e4 6b 73 6d f6 72 67 e5 73 61 2e 65 78 61 6d 70 6c 65 * $ * */ int main (void) { char buf[BUFSIZ]; char *p; int rc; size_t i; setlocale (LC_ALL, ""); printf ("Input domain encoded as `%s': ", stringprep_locale_charset ()); fflush (stdout); if (!fgets (buf, BUFSIZ, stdin)) perror ("fgets"); buf[strlen (buf) - 1] = '\0'; printf ("Read string (length %ld): ", (long int) strlen (buf)); for (i = 0; i < strlen (buf); i++) printf ("%02x ", buf[i] & 0xFF); printf ("\n"); rc = idna_to_unicode_lzlz (buf, &p, 0); if (rc != IDNA_SUCCESS) { printf ("ToUnicode() failed (%d): %s\n", rc, idna_strerror (rc)); return EXIT_FAILURE; } printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p); for (i = 0; i < strlen (p); i++) printf ("%02x ", p[i] & 0xFF); printf ("\n"); free (p); return 0; }
/* * */ #ifndef _vcgReadFileFty #define _vcgReadFileFty #include <polyModifier/polyModifierFty.h> // General Includes #include <maya/MObject.h> #include <maya/MIntArray.h> #include <maya/MString.h> #include <maya/MPoint.h> #include <maya/MPointArray.h> #include <maya/MMatrixArray.h> class MFnMesh; class vcgReadFileFty : public polyModifierFty { public: vcgReadFileFty(); virtual ~vcgReadFileFty(); void setMesh(MObject &mesh); void setFilePath(MString &value); MStatus doIt(); private: MObject fMesh; MString fFilePath; }; #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTPROVISIONINGTEMPLATESREQUEST_P_H #define QTAWS_LISTPROVISIONINGTEMPLATESREQUEST_P_H #include "iotrequest_p.h" #include "listprovisioningtemplatesrequest.h" namespace QtAws { namespace IoT { class ListProvisioningTemplatesRequest; class ListProvisioningTemplatesRequestPrivate : public IoTRequestPrivate { public: ListProvisioningTemplatesRequestPrivate(const IoTRequest::Action action, ListProvisioningTemplatesRequest * const q); ListProvisioningTemplatesRequestPrivate(const ListProvisioningTemplatesRequestPrivate &other, ListProvisioningTemplatesRequest * const q); private: Q_DECLARE_PUBLIC(ListProvisioningTemplatesRequest) }; } // namespace IoT } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATEUSERPOOLDOMAINREQUEST_P_H #define QTAWS_CREATEUSERPOOLDOMAINREQUEST_P_H #include "cognitoidentityproviderrequest_p.h" #include "createuserpooldomainrequest.h" namespace QtAws { namespace CognitoIdentityProvider { class CreateUserPoolDomainRequest; class CreateUserPoolDomainRequestPrivate : public CognitoIdentityProviderRequestPrivate { public: CreateUserPoolDomainRequestPrivate(const CognitoIdentityProviderRequest::Action action, CreateUserPoolDomainRequest * const q); CreateUserPoolDomainRequestPrivate(const CreateUserPoolDomainRequestPrivate &other, CreateUserPoolDomainRequest * const q); private: Q_DECLARE_PUBLIC(CreateUserPoolDomainRequest) }; } // namespace CognitoIdentityProvider } // namespace QtAws #endif
#include "OISConfig.h" #ifdef OIS_WIN32_WIIMOTE_SUPPORT /* The zlib/libpng License Copyright (c) 2018 Arthur Brainville Copyright (c) 2015 Andrew Fenn Copyright (c) 2005-2010 Phillip Castaneda (pjcast -- www.wreckedgames.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef OIS_WiiMoteFactoryCreator_H #define OIS_WiiMoteFactoryCreator_H #include "OISPrereqs.h" #include "OISFactoryCreator.h" #include <deque> //Forward declare boost classes used namespace boost { class thread; class mutex; } namespace OIS { //Forward declare local classes class WiiMote; //! Max amount of Wiis we will attempt to find #define OIS_cWiiMote_MAX_WIIS 4 /** WiiMote Factory Creator Class */ class _OISExport WiiMoteFactoryCreator : public FactoryCreator { public: WiiMoteFactoryCreator(); ~WiiMoteFactoryCreator(); //FactoryCreator Overrides /** @copydoc FactoryCreator::deviceList */ DeviceList freeDeviceList(); /** @copydoc FactoryCreator::totalDevices */ int totalDevices(Type iType); /** @copydoc FactoryCreator::freeDevices */ int freeDevices(Type iType); /** @copydoc FactoryCreator::vendorExist */ bool vendorExist(Type iType, const std::string& vendor); /** @copydoc FactoryCreator::createObject */ Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string& vendor = ""); /** @copydoc FactoryCreator::destroyObject */ void destroyObject(Object* obj); //! Local method used to return controller to pool void _returnWiiMote(int id); protected: //! Internal - threaded method bool _updateWiiMotesThread(); //! String name of this vendor std::string mVendorName; //! queue of open wiimotes (int represents index into hid device) std::deque<int> mFreeWiis; //! Number of total wiimotes int mCount; //! Boost thread execution object (only alive when at least 1 wiimote is alive) boost::thread* mtThreadHandler; //! Gaurds access to the Active WiiMote List boost::mutex* mtWiiMoteListMutex; //! List of created (active) WiiMotes std::vector<WiiMote*> mtInUseWiiMotes; //! Used to signal thread running or not volatile bool mtThreadRunning; }; } #endif //OIS_WiiMoteFactoryCreator_H #endif
/**************************************************************************** ** ** Copyright (C) 2013-2014 Andrey Bogdanov ** ** This file is part of the TeXSampleCore module of the TeXSample library. ** ** TeXSample 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. ** ** TeXSample 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 TeXSample. If not, see <http://www.gnu.org/licenses/>. ** ****************************************************************************/ #ifndef TGETINVITEINFOLISTREQUESTDATA_H #define TGETINVITEINFOLISTREQUESTDATA_H class TGetInviteInfoListRequestDataPrivate; class QDataStream; class QDebug; class QVariant; #include "tglobal.h" #include <BBase> #include <QMetaType> /*============================================================================ ================================ TGetInviteInfoListRequestData =============== ============================================================================*/ class T_CORE_EXPORT TGetInviteInfoListRequestData : public BBase { B_DECLARE_PRIVATE(TGetInviteInfoListRequestData) public: explicit TGetInviteInfoListRequestData(); TGetInviteInfoListRequestData(const TGetInviteInfoListRequestData &other); ~TGetInviteInfoListRequestData(); public: TGetInviteInfoListRequestData &operator =(const TGetInviteInfoListRequestData &other); bool operator ==(const TGetInviteInfoListRequestData &other) const; bool operator !=(const TGetInviteInfoListRequestData &other) const; operator QVariant() const; public: T_CORE_EXPORT friend QDataStream &operator <<(QDataStream &stream, const TGetInviteInfoListRequestData &data); T_CORE_EXPORT friend QDataStream &operator >>(QDataStream &stream, TGetInviteInfoListRequestData &data); T_CORE_EXPORT friend QDebug operator <<(QDebug dbg, const TGetInviteInfoListRequestData &data); }; Q_DECLARE_METATYPE(TGetInviteInfoListRequestData) #endif // TGETINVITEINFOLISTREQUESTDATA_H
#define errorlog(...) { fprintf(stderr, ## __VA_ARGS__); /*fflush(stderr);*/ } #ifdef DEBUG #define debuglog(...) { fprintf(stderr, ## __VA_ARGS__); /*fflush(stderr);*/ } #else #define debuglog(...) #endif extern int in, out, tty; void buffer_submit(); void end(); void speed(long s); void hangup(); void parse_file(FILE *fd); void final(int i, char str[]);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTINPUTROUTINGSREQUEST_H #define QTAWS_LISTINPUTROUTINGSREQUEST_H #include "ioteventsrequest.h" namespace QtAws { namespace IoTEvents { class ListInputRoutingsRequestPrivate; class QTAWSIOTEVENTS_EXPORT ListInputRoutingsRequest : public IoTEventsRequest { public: ListInputRoutingsRequest(const ListInputRoutingsRequest &other); ListInputRoutingsRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(ListInputRoutingsRequest) }; } // namespace IoTEvents } // namespace QtAws #endif