text
stringlengths
4
6.14k
/* * Copyright (C) 2003-2022 Sébastien Helleu <flashcode@flashtux.org> * * This file is part of WeeChat, the extensible chat client. * * WeeChat 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. * * WeeChat 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 WeeChat. If not, see <https://www.gnu.org/licenses/>. */ #ifndef WEECHAT_INPUT_H #define WEECHAT_INPUT_H struct t_gui_buffer; struct t_weechat_plugin; extern char **input_commands_allowed; extern int input_exec_command (struct t_gui_buffer *buffer, int any_plugin, struct t_weechat_plugin *plugin, const char *string, const char *commands_allowed); extern int input_data (struct t_gui_buffer *buffer, const char *data, const char *commands_allowed); extern int input_data_delayed (struct t_gui_buffer *buffer, const char *data, const char *commands_allowed, long delay); #endif /* WEECHAT_INPUT_H */
/** * Copyright 2013 Albert Vaca <albertvaka@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LINKPROVIDER_H #define LINKPROVIDER_H #include <QObject> #include <QVector> #include <QNetworkSession> #include "../networkpackage.h" class DeviceLink; class LinkProvider : public QObject { Q_OBJECT public: const static int PRIORITY_LOW = 0; //eg: 3g const static int PRIORITY_MEDIUM = 50; //eg: internet const static int PRIORITY_HIGH = 100; //eg: lan LinkProvider(QObject* parent = 0); virtual ~LinkProvider() { } virtual QString name() = 0; virtual int priority() = 0; public Q_SLOTS: virtual void onStart() = 0; virtual void onStop() = 0; virtual void onNetworkChange(QNetworkSession::State state) = 0; Q_SIGNALS: //NOTE: The provider will to destroy the DeviceLink when it's no longer accessible, // and every user should listen to the destroyed signal to remove its references. // That's the reason because there is no "onConnectionLost". void onConnectionReceived(const NetworkPackage& identityPackage, DeviceLink*) const; }; #endif
#include <writeScalarField.h> #include <basic.h> #include <math.h> #include <asciiRaw.h> #include <binaryRaw.h> #include <pvtu.h> #include <ensight.h> void writeScalarField( char* fname, scalar* field, latticeMesh* mesh ) { // First check for array sanity uint i; for( i = 0 ; i < mesh->mesh.nPoints ; i++) { if( isnan(field[i]) ) { errorMsg("Floating point exception. NaN solution"); } } switch( mesh->time.data ) { case asciiRaw: writeScalarToAsciiRaw( fname, field, mesh ); break; case binaryRaw: writeScalarToBinaryRaw( fname, field, mesh ); break; case pvtu: writeScalarToPvtu( fname, field, mesh ); break; case ensight: writeScalarToEnsight( fname, field, mesh ); } }
/**************************************************************************** ** ** Copyright (C) 2012 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 CUSTOMPROJECTWIZARD_H #define CUSTOMPROJECTWIZARD_H #include "../projectexplorer_export.h" #include <coreplugin/basefilewizard.h> #include <QSharedPointer> #include <QList> #include <QMap> QT_BEGIN_NAMESPACE class QDir; QT_END_NAMESPACE namespace Utils { class Wizard; } namespace ProjectExplorer { class CustomWizard; struct CustomWizardPrivate; class BaseProjectWizardDialog; namespace Internal { struct CustomWizardParameters; struct CustomWizardContext; } // Documentation inside. class ICustomWizardFactory { public: virtual CustomWizard *create(const Core::BaseFileWizardParameters& baseFileParameters, QObject *parent = 0) const = 0; virtual ~ICustomWizardFactory() {} }; // Convenience template to create wizard factory classes. template <class Wizard> class CustomWizardFactory : public ICustomWizardFactory { virtual CustomWizard *create(const Core::BaseFileWizardParameters& baseFileParameters, QObject *parent = 0) const { return new Wizard(baseFileParameters, parent); } }; // Documentation inside. class PROJECTEXPLORER_EXPORT CustomWizard : public Core::BaseFileWizard { Q_OBJECT public: typedef QMap<QString, QString> FieldReplacementMap; typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr; explicit CustomWizard(const Core::BaseFileWizardParameters& baseFileParameters, QObject *parent = 0); virtual ~CustomWizard(); // Can be reimplemented to create custom wizards. initWizardDialog() needs to be // called. virtual QWizard *createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const; virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const; virtual Core::FeatureSet requiredFeatures() const; // Register a factory for a derived custom widget static void registerFactory(const QString &name, const ICustomWizardFactoryPtr &f); template <class Wizard> static void registerFactory(const QString &name) { registerFactory(name, ICustomWizardFactoryPtr(new CustomWizardFactory<Wizard>)); } // Create all wizards. As other plugins might register factories for derived // classes, call it in extensionsInitialized(). static QList<CustomWizard*> createWizards(); static void setVerbose(int); static int verbose(); protected: typedef QSharedPointer<Internal::CustomWizardParameters> CustomWizardParametersPtr; typedef QSharedPointer<Internal::CustomWizardContext> CustomWizardContextPtr; void initWizardDialog(Utils::Wizard *w, const QString &defaultPath, const WizardPageList &extensionPages) const; // generate files in path Core::GeneratedFiles generateWizardFiles(QString *errorMessage) const; // Create replacement map as static base fields + QWizard fields FieldReplacementMap replacementMap(const QWizard *w) const; virtual bool writeFiles(const Core::GeneratedFiles &files, QString *errorMessage); CustomWizardParametersPtr parameters() const; CustomWizardContextPtr context() const; private: void setParameters(const CustomWizardParametersPtr &p); static CustomWizard *createWizard(const CustomWizardParametersPtr &p, const Core::BaseFileWizardParameters &b); CustomWizardPrivate *d; }; // Documentation inside. class PROJECTEXPLORER_EXPORT CustomProjectWizard : public CustomWizard { Q_OBJECT public: explicit CustomProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters, QObject *parent = 0); virtual QWizard *createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const; virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const; static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0); signals: void projectLocationChanged(const QString &path); protected: virtual bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage); void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath, const WizardPageList &extensionPages) const; private slots: void projectParametersChanged(const QString &project, const QString &path); }; } // namespace ProjectExplorer #endif // CUSTOMPROJECTWIZARD_H
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */ /* * knxhandler.h * * Copyright (C) 2012 - Michael Markstaller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "eibclient.h" void *knx_handler(void);
/* Simple DirectMedia Layer Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org> 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. */ /* A portable "32-bit Multiply with carry" random number generator. Used by the fuzzer component. Original source code contributed by A. Schiffler for GSOC project. */ #include "src/include/SDL_config.h" #include <stdlib.h> #include <stdio.h> #include <time.h> #include "src/include/SDL_test.h" /* Initialize random number generator with two integer variables */ void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, unsigned int ci) { if (rndContext==NULL) return; /* * Choose a value for 'a' from this list * 1791398085 1929682203 1683268614 1965537969 1675393560 * 1967773755 1517746329 1447497129 1655692410 1606218150 * 2051013963 1075433238 1557985959 1781943330 1893513180 * 1631296680 2131995753 2083801278 1873196400 1554115554 */ rndContext->a = 1655692410; rndContext->x = 30903; rndContext->c = 0; if (xi != 0) { rndContext->x = xi; } rndContext->c = ci; rndContext->ah = rndContext->a >> 16; rndContext->al = rndContext->a & 65535; } /* Initialize random number generator from system time */ void SDLTest_RandomInitTime(SDLTest_RandomContext * rndContext) { int a, b; if (rndContext==NULL) return; srand((unsigned int)time(NULL)); a=rand(); srand(clock()); b=rand(); SDLTest_RandomInit(rndContext, a, b); } /* Returns random numbers */ unsigned int SDLTest_Random(SDLTest_RandomContext * rndContext) { unsigned int xh, xl; if (rndContext==NULL) return -1; xh = rndContext->x >> 16, xl = rndContext->x & 65535; rndContext->x = rndContext->x * rndContext->a + rndContext->c; rndContext->c = xh * rndContext->ah + ((xh * rndContext->al) >> 16) + ((xl * rndContext->ah) >> 16); if (xl * rndContext->al >= (~rndContext->c + 1)) rndContext->c++; return (rndContext->x); } /* vi: set ts=4 sw=4 expandtab: */
/* Copyright 2009-2014, Marat Radchenko This file is part of cportage. cportage 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. cportage 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 cportage. If not, see <http://www.gnu.org/licenses/>. */ #include <cportage/strings.h> static void strv_check(char **strv, ...) { int i = 0; va_list list; g_assert(strv != NULL); va_start(list, strv); while (TRUE) { const char *str = va_arg(list, const char *); if (strv[i] == NULL) { g_assert(str == NULL); break; } else if (str == NULL) { break; } else { g_assert_cmpstr(str, ==, strv[i]); } i++; } va_end(list); g_strfreev(strv); } static void pysplit_test(void) { strv_check(cp_strings_pysplit(""), NULL); strv_check(cp_strings_pysplit(" "), NULL); strv_check(cp_strings_pysplit(" "), NULL); strv_check(cp_strings_pysplit("a"), "a", NULL); strv_check(cp_strings_pysplit("ab"), "ab", NULL); strv_check(cp_strings_pysplit("a b"), "a", "b", NULL); strv_check(cp_strings_pysplit("a "), "a", NULL); strv_check(cp_strings_pysplit(" a"), "a", NULL); strv_check(cp_strings_pysplit(" a "), "a", NULL); strv_check(cp_strings_pysplit("a b"), "a", "b", NULL); strv_check(cp_strings_pysplit(" a\tb\nc\r\nd e\n"), "a", "b", "c", "d", "e", NULL); } int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); g_test_add_func("/strings/pysplit", pysplit_test); return g_test_run(); }
/* u8g_arm.c u8g utility procedures for LPC122x Universal 8bit Graphics Library Copyright (c) 2013, olikraus@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following delay procedures must be implemented for u8glib. This is done in this file: void u8g_Delay(uint16_t val) Delay by "val" milliseconds void u8g_MicroDelay(void) Delay be one microsecond void u8g_10MicroDelay(void) Delay by 10 microseconds Additional requirements: SysTick must be enabled, but SysTick IRQ is not required. Any LOAD values are fine, it is prefered to have at least 1ms Example: SysTick->LOAD = (SystemCoreClock/1000UL*(unsigned long)SYS_TICK_PERIOD_IN_MS) - 1; SysTick->VAL = 0; SysTick->CTRL = 7; // enable, generate interrupt (SysTick_Handler), do not divide by 2 */ #include "u8g_arm.h" /*========================================================================*/ /* The following delay procedures must be implemented for u8glib void u8g_Delay(uint16_t val) Delay by "val" milliseconds void u8g_MicroDelay(void) Delay be one microsecond void u8g_10MicroDelay(void) Delay by 10 microseconds */ void u8g_Delay(uint16_t val) { HAL_Delay(val); } void u8g_MicroDelay(void) { int i; for (i = 0; i < 1000; i++); } void u8g_10MicroDelay(void) { int i; for (i = 0; i < 10000; i++); } /*========================================================================*/ uint8_t u8g_com_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { switch(msg) { case U8G_COM_MSG_STOP: break; case U8G_COM_MSG_INIT: u8g_MicroDelay(); HAL_Delay(100); break; case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ u8g_10MicroDelay(); HAL_GPIO_WritePin(PORT, DC, arg_val); u8g_10MicroDelay(); break; case U8G_COM_MSG_CHIP_SELECT: if ( arg_val == 0 ) { /* disable */ uint8_t i; /* this delay is required to avoid that the display is switched off too early --> DOGS102 with LPC1114 */ for( i = 0; i < 5; i++ ) u8g_10MicroDelay(); HAL_GPIO_WritePin(PORT, CS, GPIO_PIN_SET); } else { /* enable */ HAL_GPIO_WritePin(PORT, CS, GPIO_PIN_RESET); } u8g_MicroDelay(); break; case U8G_COM_MSG_RESET: break; case U8G_COM_MSG_WRITE_BYTE: HAL_SPI_Transmit(&SPI_HANDLER, &arg_val, 1, 10000); while(HAL_SPI_GetState(&SPI_HANDLER) != HAL_SPI_STATE_READY); u8g_MicroDelay(); break; case U8G_COM_MSG_WRITE_SEQ: case U8G_COM_MSG_WRITE_SEQ_P: { register uint8_t *ptr = arg_ptr; while( arg_val > 0 ) { HAL_SPI_Transmit(&SPI_HANDLER, ptr++, 1, 10000); while(HAL_SPI_GetState(&SPI_HANDLER) != HAL_SPI_STATE_READY); arg_val--; } } break; } return 1; }
//===- PDBSymbolTypeArray.h - array type information ------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEARRAY_H #define LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEARRAY_H #include "PDBSymbol.h" #include "PDBTypes.h" namespace llvm { class raw_ostream; class PDBSymbolTypeArray : public PDBSymbol { public: PDBSymbolTypeArray(const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> ArrayTypeSymbol); DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ArrayType) std::unique_ptr<PDBSymbol> getElementType() const; void dump(PDBSymDumper &Dumper) const override; FORWARD_SYMBOL_METHOD(getArrayIndexTypeId) FORWARD_SYMBOL_METHOD(isConstType) FORWARD_SYMBOL_METHOD(getCount) FORWARD_SYMBOL_METHOD(getLength) FORWARD_SYMBOL_METHOD(getLexicalParentId) FORWARD_SYMBOL_METHOD(getRank) FORWARD_SYMBOL_METHOD(getTypeId) FORWARD_SYMBOL_METHOD(isUnalignedType) FORWARD_SYMBOL_METHOD(isVolatileType) }; } // namespace llvm #endif // LLVM_DEBUGINFO_PDB_PDBSYMBOLTYPEARRAY_H
/* * Copyright (C) 2014, Max Planck Institut für Informatik, Saarbrücken. * Implementation: 2014, Gebhard Stopper [ gebhard.stopper@gmail.com ] * * If you perform any changes on this file, please append your name to * the List of people who worked on this file. * * If you add or modify functions or variable, please do not forget to * add/update the doxygen documentation. * * This file is part of FlowIllustrator. * * FlowIllustrator 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. * * FlowIllustrator 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 FlowIllustrator. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once #include "streamline.h" /** * This class is used to represent path lines. * It is derived from CStreamLine and extents the original functionality, * by allowing to specify a time step, which is used as the starting time * step for path line integration. */ class CPathLine : public CStreamLine { public: /** * Create a new CPathLine object. * * @param ptOrigin Reference to a CPointf, spcifying the spatial origin of the path line, in domain coordinates. * @param nNumIntegrationSteps Number of integration steps to perform for path line integration. * @param nStartFrame Frame (time step), in which path line integration is started. * @param fArrowLength Lenght of arrows, displayed along the path line. * @param color Main color of the path line. * @param fStepLength Step length used for path line integration. */ CPathLine(const CPointf &ptOrigin, unsigned int nNumIntegrationSteps, int nStartFrame, float fArrowLength, const floatColor& color, float fStepLength = 0.01f); /** * Destroy this CPathLine ofbejct and all of its data. */ virtual ~CPathLine(void); protected: CPathLine(const CPointf &ptOrigin, unsigned int nNumIntegrationSteps, int nStartFrame, float fArrowLength, const floatColor& color, DrawingObjectType type, float fStepLength = 0.01f); CPathLine(const CDrawingObjectParams &params); CPathLine(DrawingObjectType nType); protected: /** * Set one or more parameters to a CPathLine. * * @param params A reference to a CDrawingObjectParams object that holds the parameters to be set. * * @remarks This function must be implemented in derived classes to ensure that all parameters are * set correctly. */ virtual bool setParam(DrawinObjectParamName paramID, const CSimpleVariant &val); public: /** * Retrieve a deep copy of this CPathLine object. * * @return A new CPathLine object, identical to this. * * @remarks The used must delete this object, if it is no longer needed. */ virtual CDrawingObject* Duplicate() const; friend class CSVGConverter; };
/**************************************************************************** ** ** This file is part of a Qt Solutions component. ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Qt Software Information (qt-info@nokia.com) ** ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Solutions 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.0, 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. ** ** Please note Third Party Software included with Qt Solutions may impose ** additional restrictions and it is the user's responsibility to ensure ** that they have met the licensing requirements of the GPL, LGPL, or Qt ** Solutions Commercial license and the relevant license of the Third ** Party Software they are using. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** ****************************************************************************/ #include <QApplication> class QtLocalPeer; #if defined(Q_WS_WIN) # if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT) # define QT_QTSINGLEAPPLICATION_EXPORT # elif defined(QT_QTSINGLEAPPLICATION_IMPORT) # if defined(QT_QTSINGLEAPPLICATION_EXPORT) # undef QT_QTSINGLEAPPLICATION_EXPORT # endif # define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllimport) # elif defined(QT_QTSINGLEAPPLICATION_EXPORT) # undef QT_QTSINGLEAPPLICATION_EXPORT # define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllexport) # endif #else # define QT_QTSINGLEAPPLICATION_EXPORT #endif class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication { Q_OBJECT public: QtSingleApplication(int &argc, char **argv, bool GUIenabled = true); QtSingleApplication(const QString &id, int &argc, char **argv); #if defined(Q_WS_X11) QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); #endif bool isRunning(); QString id() const; void setActivationWindow(QWidget* aw, bool activateOnMessage = true); QWidget* activationWindow() const; // Obsolete: void initialize(bool dummy = true) { isRunning(); Q_UNUSED(dummy) } public Q_SLOTS: bool sendMessage(const QString &message, int timeout = 5000); void activateWindow(); Q_SIGNALS: void messageReceived(const QString &message); private: void sysInit(const QString &appId = QString()); QtLocalPeer *peer; QWidget *actWin; };
#include "../devo7e/target_defs.h" #define BUTTON_MAP { 'A', 'Q', 'D', 'E', 'S', 'W', 'F', 'R', FL_Left, FL_Right, FL_Down, FL_Up, 13/*FL_Enter*/, FL_Escape, 0 }
/* * Copyright (C) 2016 Stuart Howarth <showarth@marxoft.co.uk> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DBCONNECTION_H #define DBCONNECTION_H #include <QObject> #include <QSqlQuery> #include <QVariantMap> class QSqlDatabase; class QThread; class DBConnection : public QObject { Q_OBJECT Q_PROPERTY(bool asynchronous READ isAsynchronous CONSTANT) Q_PROPERTY(QString errorString READ errorString NOTIFY finished) Q_PROPERTY(int progress READ progress NOTIFY progressChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_ENUMS(Status) public: enum Status { Idle = 0, Active, Ready, Error }; explicit DBConnection(bool asynchronous = false); ~DBConnection(); bool isAsynchronous() const; QString errorString() const; int progress() const; Status status() const; Q_INVOKABLE static DBConnection* connection(); static DBConnection* connection(QObject *obj, const char *slot); static QThread* asynchronousThread(); static void setAsynchronousThread(QThread *thread); static const QString SUBSCRIPTION_FIELDS; static const QString ARTICLE_FIELDS; public Q_SLOTS: void addSubscription(const QVariantList &properties); void addSubscriptions(const QList<QVariantList> &subscriptions); void deleteSubscription(const QString &id); void updateSubscription(const QString &id, const QVariantMap &properties, bool fetchResult = false); void markSubscriptionRead(const QString &id, bool isRead = true, bool fetchResult = false); void markAllSubscriptionsRead(); void fetchSubscription(const QString &id); void fetchSubscriptions(int offset = 0, int limit = 0); void fetchSubscriptions(const QStringList &ids); void fetchSubscriptions(const QString &criteria); void addArticle(const QVariantList &properties, const QString &subscriptionId); void addArticles(const QList<QVariantList> &articles, const QString &subscriptionId); void deleteArticle(const QString &id); void deleteReadArticles(int expiryDate); void updateArticle(const QString &id, const QVariantMap &properties, bool fetchResult = false); void markArticleFavourite(const QString &id, bool isFavourite = true, bool fetchResult = false); void markArticleRead(const QString &id, bool isRead = true, bool fetchResult = false); void fetchArticle(const QString &id); void fetchArticles(int offset = 0, int limit = 0); void fetchArticles(const QStringList &ids); void fetchArticles(const QString &criteria); void fetchArticlesForSubscription(const QString &subscriptionId, int offset = 0, int limit = 0); void fetchFavouriteArticles(int offset = 0, int limit = 0); void fetchUnreadArticles(int offset = 0, int limit = 0); void searchArticles(const QString &query, int offset = 0, int limit = 0); void exec(const QString &statement); void clear(); void close(); bool nextRecord(); int numRowsAffected() const; int size() const; QVariant value(int index) const; QVariant value(const QString &name) const; private Q_SLOTS: void _p_addSubscription(const QVariantList &properties); void _p_addSubscriptions(const QList<QVariantList> &subscriptions); void _p_deleteSubscription(const QString &id); void _p_updateSubscription(const QString &id, const QVariantMap &properties, bool fetchResult); void _p_markSubscriptionRead(const QString &id, bool isRead, bool fetchResult); void _p_markAllSubscriptionsRead(); void _p_fetchSubscription(const QString &id); void _p_fetchSubscriptions(int offset, int limit); void _p_fetchSubscriptions(const QStringList &ids); void _p_fetchSubscriptions(const QString &criteria); void _p_addArticle(const QVariantList &properties, const QString &subscriptionId); void _p_addArticles(const QList<QVariantList> &articles, const QString &subscriptionId); void _p_deleteArticle(const QString &id); void _p_deleteReadArticles(int expiryDate); void _p_updateArticle(const QString &id, const QVariantMap &properties, bool fetchResult); void _p_markArticleFavourite(const QString &id, bool isFavourite, bool fetchResult); void _p_markArticleRead(const QString &id, bool isRead, bool fetchResult); void _p_fetchArticle(const QString &id); void _p_fetchArticles(int offset, int limit); void _p_fetchArticles(const QStringList &ids); void _p_fetchArticles(const QString &criteria); void _p_fetchArticlesForSubscription(const QString &subscriptionId, int offset, int limit); void _p_fetchFavouriteArticles(int offset, int limit); void _p_fetchUnreadArticles(int offset, int limit); void _p_searchArticles(const QString &query, int offset, int limit); void _p_exec(const QString &statement); Q_SIGNALS: void finished(DBConnection *conn); void progressChanged(int p); void statusChanged(DBConnection::Status s); private: void setErrorString(const QString &e); void setStatus(Status s); void setProgress(int p); QSqlDatabase database(); static QThread *asyncThread; bool m_asynchronous; QString m_errorString; int m_progress; Status m_status; QSqlQuery m_query; }; #endif // DBCONNECTION_H
/* This file is part of Clementine. Copyright 2012, John Maguire <john.maguire@gmail.com> Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com> Clementine 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. Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INTERNET_SKYDRIVE_SKYDRIVEURLHANDLER_H_ #define INTERNET_SKYDRIVE_SKYDRIVEURLHANDLER_H_ #include "core/urlhandler.h" #include "ui/iconloader.h" class SkydriveService; class SkydriveUrlHandler : public UrlHandler { Q_OBJECT public: explicit SkydriveUrlHandler(SkydriveService* service, QObject* parent = nullptr); QString scheme() const; QIcon icon() const { return IconLoader::Load("skydrive", IconLoader::Provider); } LoadResult StartLoading(const QUrl& url); private: SkydriveService* service_; }; #endif // INTERNET_SKYDRIVE_SKYDRIVEURLHANDLER_H_
/************************************* open_iA ************************************ * * ********** A tool for visual analysis and processing of 3D CT images ********** * * *********************************************************************************** * * Copyright (C) 2016-2021 C. Heinzl, M. Reiter, A. Reh, W. Li, M. Arikan, Ar. & Al. * * Amirkhanov, J. Weissenböck, B. Fröhler, M. Schiwarth, P. Weinberger * * *********************************************************************************** * * 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/ * * *********************************************************************************** * * Contact: FH OÖ Forschungs & Entwicklungs GmbH, Campus Wels, CT-Gruppe, * * Stelzhamerstraße 23, 4600 Wels / Austria, Email: c.heinzl@fh-wels.at * * ************************************************************************************/ #pragma once #include <cstddef> #include <iostream> #include <cmath> int simpleTesterTestsPassed = 0; int simpleTesterTestsFailed = 0; char const * TestPassed = "Test passed. "; char const * TestNotPassed = "Test NOT passed"; void PrivateTestAssert(bool expression, char const * expressionStr) { if (expression) { ++simpleTesterTestsPassed; if (expressionStr) { std::cout << TestPassed << expressionStr << " true as expected." << std::endl; } } else { ++simpleTesterTestsFailed; if (expressionStr) { std::cout << TestNotPassed << expressionStr << " NOT true!" << std::endl; } } } template <typename T> void PrivateTestEqual(T const & expected, T const & actual, char const * expectedStr, char const * actualStr) { bool equal = (expected == actual); if (equal) { std::cout << TestPassed << expectedStr << "(="<<expected<<") == " << actualStr << "(="<<actual<<")"<<std::endl; } else { std::cout << TestNotPassed << " (" << expectedStr << " = " << actualStr << ") " << " got " << expected << " != " << actual << " instead " << std::endl; } PrivateTestAssert(equal, 0); } const double MyEpsilon = 0.00001; template <typename T> void PrivateTestEqualFloatingPoint(T const & expected, T const & actual, char const * expectedStr, char const * actualStr) { double diff = static_cast<double>(expected) - actual; bool equal = std::abs(diff) < MyEpsilon;// std::numeric_limits<T>::epsilon(); if (equal) { std::cout << TestPassed << expectedStr << " == " << actualStr << std::endl; } else { std::cout << TestNotPassed << " (" << expectedStr << " = " << actualStr << ") " << " got " << expected << " != " << actual << " instead " << std::endl; } PrivateTestAssert(equal, 0); } #define TestAssert(expression) \ PrivateTestAssert(expression, #expression) #define TestEqual(expected, actual) \ PrivateTestEqual(expected, actual, #expected, #actual) #define TestEqualFloatingPoint(expected, actual) \ PrivateTestEqualFloatingPoint(expected, actual, #expected, #actual) #define BEGIN_TEST \ int main(int /*argCount*/, char** /*argValues*/) { #define END_TEST \ std::cout << "Passed " << simpleTesterTestsPassed << " of " << (simpleTesterTestsPassed+simpleTesterTestsFailed) << " tests." << std::endl; \ std::cout << "Overall: " << ((simpleTesterTestsFailed>0)? "FAILED" : "PASSED") << std::endl; \ return simpleTesterTestsFailed; \ }
#ifndef TRAYMENU_H #define TRAYMENU_H #include <QSystemTrayIcon> #include <QAction> #include "../controller.h" // cyclic reference class MainWindow; /** * @brief Main system tray icon */ class TrayIcon : public QSystemTrayIcon { Q_OBJECT private: Controller* m_ctrl; MainWindow* m_parent; QAction* m_actionHide; QAction* m_actionPause; QAction* m_actionLock; QAction* m_actionUnlock; QMenu* m_quickMenu; public: TrayIcon(MainWindow* _parent, Controller* _ctrl); private: void updateIcon(); public slots: void onListChanged(); private slots: void onStartPause(bool _start); void setLocked(bool _locked); void setLockEnabled(bool _lockEnabled); void onQuickClicked(); void onActivated(QSystemTrayIcon::ActivationReason _reason); void onWindowShown(bool _visible); }; #endif // TRAYMENU_H
// // JMSObjectPin.h // JMSProcessingNetwork // // Created by Matt Rankin on 31/03/2016. // // #import "JMSPin.h" @interface JMSObjectPin : JMSPin - (void)receiveSignal:(id)signal; - (id)readSignal; @end
// // SLiMDocumentController.h // SLiM // // Created by Ben Haller on 2/2/17. // Copyright (c) 2017-2022 Philipp Messer. All rights reserved. // A product of the Messer Lab, http://messerlab.org/slim/ // // This file is part of SLiM. // // SLiM 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. // // SLiM 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 SLiM. If not, see <http://www.gnu.org/licenses/>. #import <Cocoa/Cocoa.h> // This class provides some additional functionality to support transient documents. It is instantiated in MainMenu.xib, // and thus becomes the shared document controller for the app. @class SLiMDocument; @interface SLiMDocumentController : NSDocumentController { } @property (nonatomic) BOOL creatingNonWFDocument; // a flag set across newNonWFDocument: to signal that the new document is a nonWF document, not a WF document - (SLiMDocument *)transientDocumentToReplace; - (void)replaceTransientDocument:(NSArray *)documents; - (void)openRecipeWithFilename:(NSString *)filename; - (IBAction)newNonWFDocument:(id)sender; - (IBAction)findRecipe:(id)sender; - (IBAction)openRecipe:(id)sender; @end
/* automatically created by mc from /home/gaius/GM2/graft-5.2.0/gcc-5.2.0/gcc/gm2/gm2-libs/StrIO.def. */ #if !defined (_StrIO_H) # define _StrIO_H # ifdef __cplusplus extern "C" { # endif # if !defined (PROC_D) # define PROC_D typedef void (*PROC_t) (void); typedef struct { PROC_t proc; } PROC; # endif # if defined (_StrIO_C) # define EXTERN # else # define EXTERN extern # endif /* WriteLn - writes a carriage return and a newline character. */ EXTERN void StrIO_WriteLn (void); /* ReadString - reads a sequence of characters into a string. Line editing accepts Del, Ctrl H, Ctrl W and Ctrl U. */ EXTERN void StrIO_ReadString (char *a, unsigned int _a_high); /* WriteString - writes a string to the default output. */ EXTERN void StrIO_WriteString (char *a_, unsigned int _a_high); # ifdef __cplusplus } # endif # undef EXTERN #endif
#ifndef FINDAREADIALOG_H #define FINDAREADIALOG_H #include <QDialog> #include "ui_findareadialog.h" class FindAreaDialog : public QDialog, public Ui::FindAreaDialog { Q_OBJECT public: FindAreaDialog( QWidget *parent = 0 ); QString getDocumentDir(); private slots: void browseFilenameDialog(); public slots: void enableOKButton(); protected: void dragEnterEvent( QDragEnterEvent *event ); void dropEvent( QDropEvent *event ); }; #endif
@interface Dynamics : GSLMatrix { // rows : time points // cols : variables NSArray *labels; } + (id) dynamicsWithVars:(int)vars andTPoints:(int)tpoints; + (id) dynamicsWithVars:(int)vars andTPoints:(int)tpoints andLabels:(NSArray *)names; + (id) dynamicsFromFile:(NSString *) fname; - (id) init; // DO NOT USE - (id) initWithVars:(int)vars andTPoints:(int)tpoints; - (id) initWithVars:(int)vars andTPoints:(int)tpoints andLabels:(NSArray *)names; - (id) initFromFile:(NSString *)fname; - (id) copy; - (void) dealloc; // matrix access - (void) setValue:(double)val ofVar:(int)var atTPoint:(int)tpoint; - (double) valueOfVar:(int)var atTPoint:(int)tpoint; // getters/setters - (NSArray *) labels; - (void) setLabels:(NSArray *)names; - (int) vars; - (int) tpoints; // calculations - (double) calcMSEwith:(Dynamics *)other; - (double) calcMSEwith:(Dynamics *)other ofVar:(int)var; - (GSLVector *) calcMSEVector:(Dynamics *)other; @end
//FirebirdClient //Copyright (C) 2015 Sven Gijsen // //This file is part of BrainStim. //BrainStim 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 FIREBIRDCLIENT_H #define FIREBIRDCLIENT_H #include <QObject> #include <QString> #include <QtScript> #include <QScriptable> #include <QTableView> #include "DatabaseModel.h" //! The FirebirdClient class. /*! The Firebird Client provides an interface for working with Firebird databases (see http://www.firebirdsql.org/). */ class FirebirdClient : public QObject, protected QScriptable { Q_OBJECT //Q_CLASSINFO("ScriptAPIClassName", "FirebirdClient");//Can't use defines here!, moc doesn't handle defines, not needed here public: FirebirdClient(QObject *parent = 0); ~FirebirdClient(); FirebirdClient(const FirebirdClient& other ){Q_UNUSED(other);}//TODO fill in copy constructor, should be used for the Q_DECLARE_METATYPE macro static QScriptValue ctor_FirebirdClient(QScriptContext* context, QScriptEngine* engine); public slots: bool makeThisAvailableInScript(QString strObjectScriptName = "", QObject *engine = NULL);//To make the objects (e.g. defined in a *.exml file) available in the script //! \brief CreateDatabase slot. /*! This function creates a new Firebird database and automatically initializes it. * @param filePath the directory path to the new database file (\<Path\>/\<DBName\>.FDB). * @param userName the username of the database creator that gets the administrator rights. * @param password the password for the above administrator user. * @return a boolean value determining whether the database could be created. */ bool CreateDatabase(const QString& filePath, const QString& userName, const QString& password); //! \brief OpenDatabase slot. /*! This function opens an existing Firebird database and automatically initializes it. * @param filePath the directory path to the database file (\<Path\>/\<DBName\>.FDB) to open. * @param userName a username of the database with sufficient rights to open the Firebird database. * @param password the password for the above user. * @return a boolean value determining whether the database could be opened. */ bool OpenDatabase(const QString& filePath, const QString& userName, const QString& password); //! \brief InitializeDatabase slot. /*! This function initializes the last opened or created Firebird database. * This step is not necessary because the FirebirdClient::CreateDatabase and FirebirdClient::OpenDatabase automatically call this function when succesfully executed. * @return a boolean value determining whether the database could be initialized. */ bool InitializeDatabase(); //! \brief ExecuteDatabaseQuery slot. /*! This function executes a custom SQL Query. * @param sQuery the SQL Query to execute. * @return a boolean value determining whether the SQL Query could be executed. */ bool ExecuteDatabaseQuery(const QString& sQuery); //! \brief ExecuteReturnDatabaseQuery slot. /*! This function executes a custom SQL Query and returns the result from a specified column as an array. * @param sQuery the SQL Query to execute. * @param sColumnName a string containing the name of the columns that the result returns. * @return an array containing all the results from the executed SQL Query of the specified column. */ QStringList ExecuteReturnDatabaseQuery(const QString &sQuery, const QString sColumnName); //! \brief ExportDatabasetoExcel slot. /*! This function exports the result (table) of an SQL Select Query to an Sheet of an Excel document. * @param sPath the directory path to the (new or existing) Excel file (\<Path\>/\<ExcelName\>.XLS).. * @param sQuery the SQL Select Query to execute. * @param sSheetName the name of the Excel documents sheet to export the result to. * @return a boolean value determining whether the SQL Select Query could be exported to an Sheet of an Excel document. */ bool ExportDatabasetoExcel(const QString& sPath, const QString& sQuery, const QString& sSheetName = ""); //! \brief CloseDatabase slot. /*! This function closes the Firebird database. * @return a boolean value determining whether the database could be closed. */ bool CloseDatabase(); private: bool RetrieveSQLQuery(const QString &sQuery, QSqlQuery &query); QStringList getListOfPids(const QString &SProcessName = "", const QStringList &lExcludeList = QStringList()); bool KillPids(const QStringList &lPidList); QScriptEngine* currentScriptEngine; Model::FireBirdDatabase *fbDatabase; }; #endif // FIREBIRDCLIENT_H
// Alphalive 2 is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License, version 2, // as published by the Free Software Foundation. // // Alphalive 2 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 MAINCOMPONENT_H_INCLUDED #define MAINCOMPONENT_H_INCLUDED #include "../JuceLibraryCode/JuceHeader.h" #include "AppData.hpp" #include "Alphalive2Engine.hpp" #include "SphereView.hpp" #include "TempoView.hpp" #include "ScaleView.hpp" #include "PadInspector.hpp" #include "GUIStyle.h" #include "AlphaSphereConnectedButton.hpp" //============================================================================== /* This component lives inside our window, and this is where you should put all your controls and content. */ class MainContentComponent : public Component, public Button::Listener { public: //============================================================================== MainContentComponent(); ~MainContentComponent(); void paint (Graphics&) override; void resized() override; void buttonClicked (Button*) override; PadInspector* getPadInspector(); private: ScopedPointer<AppData> appData; ScopedPointer<Alphalive2Engine> alphalive2Engine; ScopedPointer<SphereView> sphereView; ScopedPointer<AlphaSphereConnectedButton> connectionStatus; ScopedPointer<TempoView> tempoView; ScopedPointer<ScaleView> scaleView; ScopedPointer<PadInspector> padInspector; ScopedPointer<TextButton> killButton; ScopedPointer<AudioMeterButton> audioMeter; ScopedPointer<TooltipWindow> tooltip; //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent) }; #endif // MAINCOMPONENT_H_INCLUDED
#ifndef SPUC_IIR_ALLPASS1_HALFBAND #define SPUC_IIR_ALLPASS1_HALFBAND // Copyright (c) 2014, Tony Kirke. License: MIT License (http://www.opensource.org/licenses/mit-license.php) // from directory: spuc_double_templates #include <spuc/spuc_types.h> #include <spuc/quant.h> #include <spuc/allpass_1.h> namespace SPUC { //! \file //! \brief Template Class for Allpass halfband IIR Filter // //! \brief Template Class for Allpass halfband IIR Filter // //! The filter is a combination of 2 Allpass sections of //! the form G(z) = (a*z*z + 1)/(z*z+a) //! so that the overall H(z) is //! H(z) = 1/z*G(z,a0) + G(z,a1) //! The combination of these two allpass functions result //! in a lowpass/highpass complementary pair. The class only //! uses the low pass filter. //! This is similar to allpass_iir, except since this is used //! as a halfband filter the output samples are decimated by 2. //! So that if the member function clock is called at the higher //! (input) sampling rate, the outputs are only valid even second //! sample. This is taken advantage off by running the individual //! sections effectively at the lower rate. //! The invalid samples are set to zero. //! This class needs the allpass_1 class //! \image html allpass_halfband.gif //! \image latex allpass_halfband.eps //! \author Tony Kirke //! \image html iir_allpass1_halfband.png //! \ingroup double_templates iir template <class Numeric, class Coeff = float_type> class iir_allpass1_halfband { public: char even; //! Keeps track of which filter to clock protected: //! The 2 1st order allpass filters allpass_1<Numeric, Coeff> A0, A1; //! Individual filter outputs Numeric out0, out1; public: iir_allpass1_halfband(Coeff c0, Coeff c1, long round_bits = 0) : A0(c0, 1, round_bits), A1(c1, 1, round_bits) { even = 0; } //! reset void reset() { A0.reset(); A1.reset(); out0 = out1 = (Numeric)0; } //! Shift inputs by one time sample and place new sample into array Numeric clock(Numeric input) { if (!even) { out0 = A0.clock(input); } else { out1 = A1.clock(input); } even = !even; if (even) return (round((out0 + out1), 1)); else return ((Numeric)0); // to indicate that this sample is not calculated // Complimentary filter return(0.5*(out0 - out1)); } char ready(void) { return (even); } }; // template_instantiations: long; complex<long>; float_type; complex<float_type> } // namespace SPUC #endif
#ifndef __UTIL_H #define __UTIL_H class Util { private: static std::array<GLenum, 7> oglDataType; public: static inline std::string bytesToHumanReadable(size_t bytes) { if (bytes < 1024L) { return boost::lexical_cast<std::string>(bytes) + " b"; } if (bytes < 1024L * 1024L) { return boost::str(boost::format("%.2f") % (static_cast<double>(bytes) / 1024.0)) + " kb"; } if (bytes < 1024L * 1024L * 1024L) { return boost::str(boost::format("%.2f") % (static_cast<double>(bytes) / (1024.0 * 1024.0))) + " MB"; } if (bytes < 1024L * 1024L * 1024L) { return boost::str(boost::format("%.2f") % (static_cast<double>(bytes) / (1024.0 * 1024.0 * 1024.0))) + " GB"; } return boost::str(boost::format("%.2f") % (static_cast<double>(bytes) / (1024.0 * 1024.0 * 1024.0 * 1024.0))) + " TB"; } static inline GLenum toOpenGL(DataType type) { return oglDataType[static_cast<int>(type)]; } static inline GLenum toOpenGL(const std::string &type) { if (boost::iequals(type, "LINEAR")) { return GL_LINEAR; } if (boost::iequals(type, "NEAREST")) { return GL_NEAREST; } // TODO: more types GL_NONE; } static void resizeImage(Image *image, int newWidth, int newHeight, int newDepth); }; #endif
/** * naken_asm assembler. * Author: Michael Kohn * Email: mike@mikekohn.net * Web: http://www.mikekohn.net/ * License: GPLv3 * * Copyright 2010-2019 by Michael Kohn * */ #ifndef NAKEN_ASM_TABLE_MSP430_H #define NAKEN_ASM_TABLE_MSP430_H #include <stdint.h> #include "common/assembler.h" enum { OP_NONE, OP_ONE_OPERAND, OP_ONE_OPERAND_W, OP_ONE_OPERAND_X, OP_JUMP, OP_TWO_OPERAND, OP_MOVA_AT_REG_REG, OP_MOVA_AT_REG_PLUS_REG, OP_MOVA_ABS20_REG, OP_MOVA_INDEXED_REG, OP_SHIFT20, OP_MOVA_REG_ABS, OP_MOVA_REG_INDEXED, OP_IMMEDIATE_REG, OP_REG_REG, OP_CALLA_SOURCE, OP_CALLA_ABS20, OP_CALLA_INDIRECT_PC, OP_CALLA_IMMEDIATE, OP_PUSH, OP_POP, OP_X_ONE_OPERAND, OP_X_ONE_OPERAND_W, OP_X_TWO_OPERAND, }; enum { VERSION_MSP430, VERSION_MSP430X, VERSION_MSP430X_EXT, }; struct _table_msp430 { char *instr; uint16_t opcode; uint16_t mask; uint8_t type; uint8_t version; }; extern struct _table_msp430 table_msp430[]; #endif
#ifndef CONFIG_H #define CONFIG_H // Comment out this line if your application has a QtGui #define USE_QTGUI #define PROGRAM_NAME "apriltagsAgentComp" #define SERVER_FULL_NAME "RoboCompapriltagsAgentComp::apriltagsAgentComp" #endif
#ifndef REBOOT_H #define REBOOT_H #include "Service.h" extern const char REBOOT_NAME[]; class Reboot : public Service<REBOOT_NAME> { public: Reboot(Device* const device); virtual ~Reboot(); void trigger(unsigned int deferMillis = 0); private: void onRebootRequestReceived(const String& message); }; #endif
#pragma once // Application #include "QTree.h" #include "CPIDController.h" #include "File/CRollingFiles.h" #include "CStreamFactory.h" #include "CSerialStream.h" #include "CSocketStream.h" #include "Image/CImageUtilities.h" #include "Web/CMJPEGServer.h" #include "Web/CMJPEGClient.h" #include "CGeoUtilities.h" #include "CSecureContext.h" #include "CTDMADevice.h" #include "Web/CHTTPServer.h" #include "Web/CDynamicHTTPServer.h" #include "Web/WebControls/CWebControl.h" #include "Web/WebControls/CWebPage.h" #include "QMLTree/QMLTreeContext.h" #include "QMLTree/QMLEntity.h" #include "QMLTree/QMLAnalyzer.h"
/* Adrenaline Copyright (C) 2016-2018, TheFloW 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 __VITA_POPS_H__ #define __VITA_POPS_H__ #define POPS_REGISTER 0x49FE0000 #define POPS_MAX_DISPLAYS 2 #define POPS_MAX_FRAME_BUFFERS 3 #define POPS_MAX_CONTROLLERS 8 #define POPS_SCREEN_WIDTH 320 #define POPS_SCREEN_HEIGHT 240 #define POPS_SCREEN_LINE_SIZE 640 #define POPS_VRAM 0x490C0000 #define POPS_VRAM_SIZE 0x140000 // 640 * 512 * 4 enum PopsGpuFlags { POPS_GPU_HEIGHT_240 = 0x00, POPS_GPU_HEIGHT_480 = 0x04, POPS_GPU_WIDTH_256 = 0x00, POPS_GPU_WIDTH_320 = 0x01, POPS_GPU_WIDTH_512 = 0x02, POPS_GPU_WIDTH_640 = 0x03, POPS_GPU_WIDTH_368 = 0x40, POPS_GPU_PAL = 0x08, POPS_GPU_RGB24 = 0x10, POPS_GPU_INTERLACED = 0x20, POPS_GPU_REVERSE = 0x80, }; typedef struct { short x; // 0x0 short y; // 0x2 short width; // 0x4 short height; // 0x6 char mode; // 0x8 char current_frame_buffer; // 0x9 } PopsDisplay; // 0xA typedef struct { u32 Buttons; // 0x0 u8 Lx; // 0x4 u8 Ly; // 0x5 u8 Rx; // 0x6 u8 Ry; // 0x7 u32 Reserved[2]; // 0x8 } PopsController; // 0x10 typedef struct { u8 disable_spu; // 0x0 u8 enable_screenshot; // 0x1 u8 disable_gpu; // 0x2 u8 disc_change; // 0x3 u8 disc_number; // 0x4 u8 disc_numbers; // 0x5 u8 value_6; // 0x6 // region? 0, 1, 2 u8 controller_port; // 0x7 // 0 or 1 on PS Vita, 2 on Vita TV u8 controller_mode; // 0x8 u8 no_vblank_wait; // 0x9 u8 disc_load_speed; // 0xA } PopsInformation; // 0xB typedef struct { PopsDisplay display[POPS_MAX_DISPLAYS]; // 0x0 u8 update_frame_buffer; // 0x14 u8 ctrl_modes[POPS_MAX_CONTROLLERS]; // 0x15 u8 padding_0[3]; // 0x1D PopsController ctrl[POPS_MAX_CONTROLLERS]; // 0x20 PopsInformation info; // 0xA0 u8 use_memory_card_utility; // 0xAB u16 screenshot_signature[120]; // 0xAC u8 signature_value_0; // 0x19C u8 signature_value_1; // 0x19D u8 reserved[2]; // 0x19E u8 unk; // 0x1A0 u8 padding_1[3]; // 0x1A1 void *savedata[2]; // 0x1A4 u32 error_code; // 0x1AC } PopsRegister; // 0x1B0 #endif
/*- * Copyright (c) 2003-2007 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" __FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_gz.c 191183 2009-04-17 01:06:31Z kientzle $"); static unsigned char archive[] = { 31,139,8,0,244,'M','p','C',0,3,';','^','(',202,178,177,242,173,227,11,230, 23,204,'L',12,12,12,5,206,'_','|','A','4',3,131,30,195,241,'B',6,'8','`', 132,210,220,'`','2','$',200,209,211,199,'5','H','Q','Q',145,'a',20,12,'i', 0,0,170,199,228,195,0,2,0,0}; DEFINE_TEST(test_read_format_cpio_bin_gz) { struct archive_entry *ae; struct archive *a; int r; assert((a = archive_read_new()) != NULL); assertEqualInt(ARCHIVE_OK, archive_read_support_filter_all(a)); r = archive_read_support_filter_gzip(a); if (r == ARCHIVE_WARN) { skipping("gzip reading not fully supported on this platform"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } failure("archive_read_support_filter_gzip"); assertEqualInt(ARCHIVE_OK, r); assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a)); assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); }
/** * This file is part of Drystal. * * Drystal 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. * * Drystal 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 Drystal. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <time.h> #include <sys/stat.h> #include <sys/types.h> #include <stdarg.h> #include <errno.h> #include <unistd.h> #include "util.h" #include "macro.h" #include "log.h" bool stderr_use_colors(void) { #ifdef EMSCRIPTEN return false; #else return on_tty(STDERR_FILENO); #endif } bool on_tty(int fd) { static int cached_on_tty[256]; if (fd >= 256) return isatty(fd) > 0; if (cached_on_tty[fd] == 0) cached_on_tty[fd] = isatty(fd) > 0 ? 2 : 1; return cached_on_tty[fd] == 2; } char *xstrdup(const char *s) { char *p; p = strdup(s); if (!p) { log_oom_and_exit(); } return p; } void *xcalloc(size_t nmemb, size_t size) { void *p; p = calloc(nmemb, size); if (!p) { log_oom_and_exit(); } return p; } void *xmalloc(size_t size) { void *p; p = malloc(size); if (!p) { log_oom_and_exit(); } return p; } int mkdir_p(const char *path) { char *p; char t[strlen(path) + 1]; assert(path); strcpy(t, path); for (p = strchr(t, '/'); p && *p; p = strchr(p + 1, '/')) { int r; *p = 0; r = mkdir(t, 0777); if (r < 0 && errno != EEXIST) return -errno; *p = '/'; } return 0; } char *strjoin(const char *s, ...) { va_list ap; size_t l = 0; char *join, *p; va_start(ap, s); l = strlen(s); for (;;) { const char *t; t = va_arg(ap, const char *); if (!t) { break; } l += strlen(t); } va_end(ap); join = new(char, l + 1); va_start(ap, s); p = stpcpy(join, s); for (;;) { const char *t; t = va_arg(ap, const char *); if (!t) { break; } p = stpcpy(p, t); } va_end(ap); return join; } void msleep(unsigned long milisec) { struct timespec ts; ts.tv_sec = milisec / MSEC_PER_SEC; ts.tv_nsec = (milisec % MSEC_PER_SEC) * USEC_PER_SEC; /* we sleep until the time requested has passed */ while (nanosleep(&ts, &ts) == -1); } bool endswith(const char *s, const char *postfix) { size_t s_length; size_t p_length; assert(s); assert(postfix); s_length = strlen(s); p_length = strlen(postfix); if (p_length == 0) return true; if (s_length < p_length) return false; if (memcmp(s + s_length - p_length, postfix, p_length) != 0) return false; return true; } bool is_directory(const char *directory) { struct stat s; assert(directory); if (stat(directory, &s) < 0) { return false; } if (S_ISDIR(s.st_mode)) { return true; } return false; } bool files_are_same(const char *filea, const char *fileb) { struct stat a, b; if (!strcmp(filea, fileb)) return true; if (stat(filea, &a) < 0) return false; if (stat(fileb, &b) < 0) return false; return a.st_dev == b.st_dev && a.st_ino == b.st_ino; } void *xrealloc(void **p, size_t *nmemb, size_t need, size_t size, unsigned min_nmemb) { size_t new_totalsize; size_t new_nmemb; void *q; assert(p); assert(nmemb); assert(size > 0); if (*nmemb >= need) return *p; new_nmemb = MAX(need * 2, min_nmemb); new_totalsize = new_nmemb * size; if (new_totalsize < size * need) log_oom_and_exit(); q = realloc(*p, new_totalsize); if (!q) { log_oom_and_exit(); } *p = q; *nmemb = new_nmemb; return q; }
// ResizableGrip.h: interface for the CResizableGrip class. // ///////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2000-2001 by Paolo Messina // (http://www.geocities.com/ppescher - ppescher@yahoo.com) // // The contents of this file are subject to the Artistic License (the "License"). // You may not use this file except in compliance with the License. // You may obtain a copy of the License at: // http://www.opensource.org/licenses/artistic-license.html // // If you find this code useful, credits would be nice! // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_RESIZABLEGRIP_H__INCLUDED_) #define AFX_RESIZABLEGRIP_H__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define WS_EX_LAYOUT_RTL 0x00400000 class CResizableGrip { private: SIZE m_sizeGrip; // holds grip size CScrollBar m_wndGrip; // grip control private: static BOOL IsRTL(HWND hwnd) { DWORD dwExStyle = ::GetWindowLong(hwnd, GWL_EXSTYLE); return (dwExStyle & WS_EX_LAYOUT_RTL); } static LRESULT CALLBACK GripWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); protected: BOOL InitGrip(); void UpdateGripPos(); void ShowSizeGrip(BOOL bShow = TRUE); // show or hide the size grip virtual CWnd* GetResizableWnd() = 0; public: CResizableGrip(); virtual ~CResizableGrip(); }; #endif // !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)
/* * OpenAL Helpers * * Copyright (c) 2011 by Chris Robinson <chris.kcat@gmail.com> * * 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. */ /* This file contains routines to help with some menial OpenAL-related tasks, * such as opening a device and setting up a context, closing the device and * destroying its context, converting between frame counts and byte lengths, * finding an appropriate buffer format, and getting readable strings for * channel configs and sample types. */ #include "common.h" #include "audio/alhelpers.h" /* InitAL opens the default device and sets up a context using default * attributes, making the program ready to call OpenAL functions. */ ALCcontext* InitAL(void) { ALCdevice *device; ALCcontext *ctx; /* Open and initialize a device with default settings */ device = alcOpenDevice(NULL); if(!device) { LOG("Could not open a device!"); return NULL; } ctx = alcCreateContext(device, NULL); if(ctx == NULL || alcMakeContextCurrent(ctx) == ALC_FALSE) { if(ctx != NULL) { alcDestroyContext(ctx); } alcCloseDevice(device); LOG("Could not set a context!"); return NULL; } LOG("Opened \"%s\"", alcGetString(device, ALC_DEVICE_SPECIFIER)); return ctx; } /* CloseAL closes the device belonging to the current context, and destroys the * context. */ void CloseAL(void) { ALCdevice *device; ALCcontext *ctx; ctx = alcGetCurrentContext(); if(ctx == NULL) { return; } device = alcGetContextsDevice(ctx); alcMakeContextCurrent(NULL); alcDestroyContext(ctx); alcCloseDevice(device); }
#pragma once #include "Script.h" using namespace System::Reflection; namespace GTA { public ref class ScriptInitializer abstract { public: virtual void OnGameStart() { } //virtual void OnScriptStart() { } }; public ref class ScriptPostInitializer abstract { public: virtual void OnGameStart() { } //virtual void OnScriptStart() { } }; public ref class ScriptLoader : public MarshalByRefObject { public: virtual Object^ InitializeLifetimeService() override { return nullptr; } internal: List<String^>^ _loadedAssemblies; List<Assembly^>^ loadedAssemblies; List<Assembly^>^ referenceAssemblies; String^ _rootDirectory; bool _gameInitialized; void LoadScripts(); void LoadReferences(); void UnloadScripts(); //void UnloadScripts(); void LoadAssemblies(String^ folder, String^ filter); void LoadScriptFiles(String^ folder, String^ filter); void Initialize(); void ProxyTick(DWORD timerDelta); #if GTA_SA const char* ProxyGetString(const char* string); #else const wchar_t* ProxyGetString(const char* string); #endif static Assembly^ ResolveAssembly(Object^ sender, ResolveEventArgs^ args); public: property bool GameInitialized { bool get(); void set(bool value); } void LoadAssembly(Assembly^ assembly); static void LoadScript(BaseScript^ script); }; }
#ifndef GROUPBUILDER_H_INCLUDED #define GROUPBUILDER_H_INCLUDED #include "GroupT.h" #include "GroupS.h" #include "GroupSTS.h" #include "GroupTSS.h" #include "GroupTST.h" #include "GroupTTS.h" #include "GroupTTT.h" /** @brief Êëàññ äëÿ óäîáíîãî ñîçäàíèÿ ãðóïï Àññóðà */ class GroupBuilder { public: // G1 /** @brief Ñîçäàåò ãðóïïó Àññóðà ïåðâîãî êëàññà @details Ñîçäàåò ãðóïïó Àññóðà ïåðâîãî êëàññà, ïðè ýòîì îïðåäåëÿåòñÿ òèï ïåðåäàííîé êèíåìåòè÷åñêîé ïàðû */ static Group * CreateGroup(string, KPair *, Segment *, Segment *); // S static Group * CreateGroup(KPSliding *, Segment *, Segment *); // T static Group * CreateGroup(KPTurn *, Segment *, Segment *); // G2 static Group * CreateGroup(string, KPair *, KPair *, KPair *, Segment *, Segment *); // STS static Group * CreateGroup(KPSliding *, KPTurn *, KPSliding *, Segment *, Segment *); // TSS, SST static Group * CreateGroup(KPTurn *, KPSliding *, KPSliding *, Segment *, Segment *); static Group * CreateGroup(KPSliding *, KPSliding *, KPTurn *, Segment *, Segment *); // TST static Group * CreateGroup(KPTurn *, KPSliding *, KPTurn *, Segment *, Segment *); // TTS, STT static Group * CreateGroup(KPTurn *, KPTurn *, KPSliding *, Segment *, Segment *); static Group * CreateGroup(KPSliding *, KPTurn *, KPTurn *, Segment *, Segment *); // TTT static Group * CreateGroup(KPTurn *, KPTurn *, KPTurn *, Segment *, Segment *); }; #endif // GROUPBUILDER_H_INCLUDED
/*Copyright 2016 Michael Osei This file is part of Cysboard. Cysbaord 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. Cysboard 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 Cysboard. If not, see <http://www.gnu.org/licenses/>.*/ #pragma once /** * @brief A warpper around cpuid instruction for intel based cpus * * Defined this because __get_cpuid() provided by GCC for some reason * returned the vendor name as model name on my machine. I was not sure why. */ #include <cstdint> class CCPUID { private: uint32_t registers[4]; // holds the registers returned by cpuid on x86 processors // EAX = registers[0], EBX = registers[1], // ECX = registers[2], EDX = registers[3] public: enum CPUID_INSRUCTION : long long { PROCESSOR_VENDOR = 0x0, PROCESSOR_SERIAL_NUMBER = 0x30000000, PROCESSOR_HIGHEST_FUNCTION = 0x80000000, PROCESSOR_FEATURE_BITS = 0x80000001, PROCESSOR_BRAND = 0x80000002 }; /** * @brief CCpuId constructor */ CCPUID(){} /** * @brief execute * @param i The instruction parameter */ void execute(long long i){ #ifdef _WIN32 // use win32 provided function __cpuid((int*)registers, i); #else // for linux and others asm volatile ( "cpuid": "=a" (registers[0]), "=b" (registers[1]), "=c" (registers[2]), "=d" (registers[3]) : "a" (i), "c" (0) ); #endif } const uint32_t& getEAX() const {return registers[0];} const uint32_t& getEBX() const {return registers[1];} const uint32_t& getECX() const {return registers[2];} const uint32_t& getEDX() const {return registers[3];} };
/** Copyright (C) 2012 Nils Weiss, Patrick Bruenn. This file is part of Wifly_Light. Wifly_Light 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. Wifly_Light 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 Wifly_Light. If not, see <http://www.gnu.org/licenses/>. */ #include "usart.h" #ifdef __CC8E__ //******* Initialisierungs-Funktion ************************************************* void UART_Init() { //USART TX Pin als Ausgang TRISC .6 = 0; BRGH1 = 1; // High Baudrate activated BRG16 = 1; SPBRG1 = 34; // 115200 Bps @ 64 MHz Clock SPBRGH1 = 0; SPEN1 = 1; // Set_Serial_Pins; SYNC1 = 0; // Set_Async_Mode; TX9_1 = 0; // Set_8bit_Tx; RX9_1 = 0; // Set_8bit_Rx; CREN1 = 1; // Enable_Rx; TXEN1 = 1; // Enable_Tx; RC1IE = 1; // Rx Interrupt aus ADDEN1 = 0; // Disable Adressdetection } //******* Sende-char-Funktion ************************************************* void UART_Send(const uns8 ch) { while(!TX1IF) ; TXREG1 = ch; } #endif /* #ifdef CC8E */ #if 0 /* NOT USED CODE ----- REMOVE IF WE DON'T NEED IT ANYMORE */ //******* Sende-String-Funktion ************************************************* void UART_SendString(const char *string) { uns8 ps; ps = (uns8) * string; while(ps > 0) { string++; UART_Send(ps); ps = *string; } } //******* Sende-Array-Funktion ************************************************* void UART_SendArray(const uns8 *array,const uns8 length) { if(array == 0) return; uns8 i; for(i = 0; i < length; i++) { UART_Send(*array); array++; } } void UART_SendHex_8(const uns8 input) { uns8 temp4 = input & 0xf0; temp4 = temp4 >> 4; if(temp4 > 9) { temp4 -= 10; UART_Send(temp4 + 'A'); } else { UART_Send(temp4 + '0'); } temp4 = input & 0x0f; if(temp4 > 9) { temp4 -= 10; UART_Send(temp4 + 'A'); } else { UART_Send(temp4 + '0'); } } void UART_SendHex_16(const uns16 input) { #ifdef __CC8E__ UART_SendHex_8(input.high8); UART_SendHex_8(input.low8); #else UART_SendHex_8((input & 0xff00) >> 8); UART_SendHex_8((unsigned char)(input & 0xff)); #endif } //******* Sende-Zahl-als-String-Funktion ************************************************* void UART_SendNumber(uns8 input,const uns8 sign) { uns8 temp; uns8 h,z,e; h = 0; z = 0; e = 0; if(input > 99) { h = input / 100; temp = 0; temp = 100 * h; input = input - temp; } if(input > 9) { z = input / 10; temp = 0; temp = z * 10; input = input - temp; } if(input <= 9) { e = input; } if(h != 0) UART_Send(h + 0x30); UART_Send(z + 0x30); UART_Send(e + 0x30); UART_Send(sign); //Zeichen senden } //SENDE BCD-Zahl als String void UART_SendTime(unsigned char input,unsigned char sign) { char temp; char z,e; e = input & 0x0f; input = swap(input); z = input & 0x0f; if(e > 9) { e -= 10; z++; } if(z > 5) z = 0; UART_Send(z + 0x30); UART_Send(e + 0x30); UART_Send(sign); } #endif
// camshift_wrapper.h - by Robin Hewitt, 2007 // http://www.cognotics.com/opencv/downloads/camshift_wrapper // This is free software. See License.txt, in the download // package, for details. // Copyright (c) 2007, Robin Hewitt (http://www.robin-hewitt.com). // Third party copyrights are property of their respective owners. // // Slight modifications by Ginevra Castellano, October 2009 // Public interface for the Simple Camshift Wrapper #ifndef __SIMPLE_CAMSHIFT_WRAPPER_H #define __SIMPLE_CAMSHIFT_WRAPPER_H // Main Control functions int createTracker(const IplImage * pImg); void releaseTracker(); void startTracking(IplImage * pImg, CvRect * pRect); CvRect track(IplImage *); //CvBox2D track(IplImage *); // Parameter settings void setVmin(int vmin); void setSmin(int smin); #endif
#pragma once /**************************************************************************** Data Analysis - tool for making a basic data analysis. Copyright(C) 2017 Michal Duda <github@vookimedlo.cz> https://github.com/vookimedlo/data-analysis 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 <memory> class QString; class ReportThumbnail { public: virtual ~ReportThumbnail() {}; virtual bool inlineThumbnail(QString& outInlinedData) = 0; virtual bool write(const QString& pathName) = 0; };
/* * Copyright 2013 Juha Lepola * * This file is part of M-Files for Sailfish. * * M-Files for Sailfish 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. * * M-Files for Sailfish 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 M-Files for Sailfish. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef PROPERTYDEFCACHE_H #define PROPERTYDEFCACHE_H #include "structurecachebase.h" // Forward declarations. class VaultCore; class PropertyDefCache : public StructureCacheBase { Q_OBJECT public: explicit PropertyDefCache( VaultCore* parent //!< Parent vault. ); signals: public slots: }; #endif // PROPERTYDEFCACHE_H
/* radare - LGPL - Copyright 2008-2014 - pancake */ #include <r_cons.h> #define I r_cons_singleton() /* TODO: remove global vars */ static char *path = NULL; static char prompt[32]; static int _n; static char *lines = NULL; static int nlines; static int bytes; static void setnewline(int old) { snprintf (prompt, sizeof (prompt), "%d: ", _n); r_line_set_prompt (prompt); strcpy (I->line->buffer.data, r_str_word_get0 (lines, _n)); I->line->buffer.index = I->line->buffer.length = strlen (I->line->buffer.data); I->line->contents = I->line->buffer.data; } static void saveline (int n, const char *str) { char *out; if (!str) return; out = r_str_word_get0set (lines, bytes, _n, str, &bytes); free (lines); lines = out; } static int up(void *n) { int old = _n; if (_n>0) _n--; setnewline (old); return -1; } static int down(void *n) { int old = _n; #if 0 if (_n<(nlines-1)) #endif _n++; setnewline (old); return -1; } static void filesave () { char buf[128]; int i; if (!path) { eprintf ("File: "); buf[0] = 0; fgets (buf, sizeof(buf), stdin); i = strlen (buf); if (i>0) { buf[i-1] = 0; free (path); path = strdup (buf); } } if (lines) { for (i=0; i<bytes; i++) { if (lines[i]=='\0') lines[i]='\n'; } } r_file_dump (path, (const ut8*)lines, bytes); eprintf ("File '%s' saved (%d bytes)\n", path, bytes); // restore back zeroes nlines = r_str_split (lines, '\n'); } R_API char *r_cons_editor (const char *file) { char *line; _n = 0; free (path); if (file) { path = strdup (file); lines = r_file_slurp (file, &bytes); nlines = r_str_split (lines, '\n'); eprintf ("Loaded %d lines on %d bytes\n", nlines-1, bytes); } else path = NULL; //r_cons_new (); I->line->hist_up = up; I->line->hist_down = down; I->line->contents = I->line->buffer.data; for (;;) { setnewline (_n); snprintf (prompt, sizeof (prompt), "%d: ", _n); r_line_set_prompt (prompt); line = r_line_readline (); saveline (_n, line); _n++; if (!line) break; } filesave (); I->line->hist_up = I->line->hist_down = NULL; I->line->contents = NULL; return NULL; }
/* =========================================================================== Copyright (c) 2010-2015 Darkstar Dev Teams 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/ This file is part of DarkStar-server source code. =========================================================================== */ #ifndef _CITEM_STATE_H #define _CITEM_STATE_H #include "state.h" class CBattleEntity; class CCharEntity; class CItemUsable; struct action_t; class CItemState : public CState { public: CItemState(CCharEntity* PEntity, uint16 targid, uint8 loc, uint8 slotid); virtual bool Update(time_point tick) override; virtual void Cleanup(time_point tick) override; virtual bool CanChangeState() override; virtual bool CanFollowPath() override { return false; } virtual bool CanInterrupt() override { return true; } virtual void TryInterrupt(CBattleEntity* PAttacker) override; CItemUsable* GetItem(); void InterruptItem(action_t& action); void FinishItem(action_t& action); protected: bool HasMoved(); CCharEntity* m_PEntity; CItemUsable* m_PItem; duration m_castTime; duration m_animationTime; position_t m_startPos; bool m_interrupted {false}; }; #endif
#ifndef LOGGING_H #define LOGGING_H #include <sstream> class Log { public: enum Level { TRACE, DEBUG, INFO, WARNING, ERROR, REPORT, SILENT }; Log(); ~Log(); static void setLevel(Level level); static Level getLevel(); std::ostringstream& info(); std::ostringstream& debug(); std::ostringstream& error(); std::ostringstream& report(); private: static Level loggingLevel; std::ostringstream stream; }; /** Use these macros to do the logging in code. For example, LOG_INFO << "Starting up."; LOG_DEBUG << "Step " << n; LOG_REPORT << "The result is " << answer; */ #define LOG_INFO if (Log::getLevel() > Log::INFO) { /* NOP */ } else Log().info() #define LOG_DEBUG if (Log::getLevel() > Log::DEBUG) { /* NOP */ } else Log().debug() #define LOG_ERROR if (Log::getLevel() > Log::ERROR) { /* NOP */ } else Log().error() #define LOG_REPORT if (Log::getLevel() > Log::REPORT) { /* NOP */ } else Log().report() #endif
/*---------------------------------------------------------------------- exx_vector.h Some simple geometrical calculations. Coded by M. Toyoda 07/JAN/2010 ----------------------------------------------------------------------*/ #ifndef EXX_VECTOR_H_INCLUDED #define EXX_VECTOR_H_INCLUDED double EXX_Vector_Distance(const double v[3], const double w[3]); void EXX_Vector_F2C( double v_c[3], /* (OUT) v in cartesian coord */ const double v[3], /* (IN) a vector in fractional coord */ const double pvec[9] /* (IN) primitive translational vectors */ ); void EXX_Vector_C2F( double v_f[3], /* (OUT) v in cartesian coord */ const double v[3], /* (IN) a vector in fractional coord */ const double pvec[9] /* (IN) primitive translational vectors */ ); void EXX_Vector_F2C_Offsite( double v_c[3], /* (OUT) v in cartesian coord */ const double v[3], /* (IN) a vector in fractional coord */ const double pvec[9], /* (IN) primitive translational vectors */ int icell, int nshell ); void EXX_Vector_C2S( const double v[3], /* (IN) a vector in cartesian */ double *r, /* (OUT) v in spherical coord */ double *theta, double *phi ); void EXX_Vector_PAO_Overlap( double rc1, /* (IN) cutoff of PAO 1 */ double rc2, /* (IN) cutoff of PAO 2 */ double d, /* (IN) displacement */ double *pair_rc, /* (OUT) cutoff of overlap */ double *pair_cx /* (OUT) dividing ratio of center of overlap */ ); #endif /* EXX_VECTOR_H_INCLUDED */
/* Copyright (C) 2012-2014 Jan Christian Rohde This file is part of MACE. MACE 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. MACE 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 MACE; if not, see http://www.gnu.org/licenses. */ #ifndef NUMREAL_H #define NUMREAL_H #include <QString> #include "math/kernel/datum.h" class numReal : public datum { private: double val; public: numReal(); numReal(double d) {val = d;} void set(double d) {val = d;} double get() const {return val;} virtual QString print (unsigned int precision); bool isZero () {return (val==0);} virtual void invCall() {val = 1.0/val;} friend numReal operator+( numReal v1, numReal v2 ) { numReal tmp; tmp.val = v1.val + v2.val; return tmp; } numReal operator-( numReal val2 ) const { numReal tmp(*this), res; res.val = tmp.val - val2.val; return res; } friend numReal operator*( numReal v1, numReal v2 ) { numReal tmp; tmp.val = v1.val * v2.val; return tmp; } numReal operator/( numReal val2 ) const { numReal tmp(*this), res; res.val = tmp.val / val2.val; return res; } bool operator<( numReal r1){ return (val < r1.val); } bool operator>( numReal r1){ return (val > r1.val); } bool operator<=( numReal r1){ return (val <= r1.val); } bool operator>=( numReal r1){ return (val >= r1.val); } bool operator==( numReal r1){ return (val == r1.val); } bool operator!=( numReal r1){ return (val != r1.val); } }; extern QString dblPrint(double d, int precision); #endif // NUMREAL_H
#ifndef NAMEDATABASE_H #define NAMEDATABASE_H #include <QObject> #include <QMap> #include <QSet> class MessageProcessor; class Database; class NameDatabase : public QObject { Q_OBJECT public: typedef QMap<qint64, qint64> UserList; typedef QPair<qint64, QString> GroupData; private: QMap<qint64, QString> data; QMap<qint64, UserList> ids; MessageProcessor *messageProcessor; Database *database; QMap<qint64, GroupData> monitoringGroups; qint64 lastGidSeen; qint64 lastUidSeen; bool gettingList; void refreshGroupNames(qint64 gid); void refreshGroup(qint64 gid); void refreshUser(qint64 uid); public: explicit NameDatabase(Database *db, MessageProcessor *mp, QObject *parent = 0); void loadData(); void input(const QString &str); void refreshDatabase(); const QMap<qint64, GroupData> &groups() const {return monitoringGroups;} const QMap<qint64, QString> &nameDatabase() const {return data;} UserList userList(qint64 gid) const {return ids[gid];} void groupDeleted(qint64 gid); }; #endif // NAMEDATABASE_H
#ifndef _NGOS_COMPORT_H_ #define _NGOS_COMPORT_H_ #include <stdint.h> class ComPort { private: const uint16_t mBaseIoPort; public: ComPort(); bool isSupported() const; uint16_t getBaseIoPort() const; bool write(char c); bool read(char *c); private: enum DataBits { DATA_BITS_5, DATA_BITS_6, DATA_BITS_7, DATA_BITS_8, }; enum StopBits { STOP_BITS_1, STOP_BITS_1_5, STOP_BITS_2, }; enum Parity { PARITY_NONE, PARITY_ODD, PARITY_EVEN, PARITY_MARK, PARITY_SPACE, }; const char INTERRUPT_DATA_AVAILABLE = 0x01; const char INTERRUPT_TRANSMITTER_EMPTY = 0x02; const char INTERRUPT_BREAK_ERROR = 0x4; const char INTERRUPT_STATUS_CHANGE = 0x8; bool regWrite(uint8_t reg, char value); bool regRead(uint8_t reg, char *value); bool setBaudRate(uint32_t baudRate); bool setLineControl(DataBits dataBits, StopBits stopBits, Parity parity); bool setEnabledInterrupts(char interrupts); bool waitForDataReceived(); }; #endif /* #ifndef _NGOS_COMPORT_H_ */
/* * converter: converts between different unit measurements * Copyright (C) 2009 Matthew A. Todd * * This file is part of Converter. * * Converter 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. * * Converter 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 Converter. If not, see <http://www.gnu.org/licenses/>. * * * convert.h * * Created on: Aug 18, 2009 * Author: Matthew A. Todd */ #ifndef CONVERT_H_ #define CONVERT_H_ #include <string> #include <map> #include <queue> #include <set> #include "localException.h" using namespace std; #define DEFAULT_CONVERT_FILE "convert_values" #define METER_TO_FOOT 3.2808399 struct Vertex { const string name; //!< name of this vertex bool visited; //!< whether this vertex visited in search for end unit (think Dijkstra's Algorithm and directed graphs) map<string, float> convertValue; //!< conversion values to adjacent vertexes // removed type b/c it wasn't doing anything, // mostly just a waste of space // const string type; //!< measurement type //! normal ctor Vertex(const string & gName) : name(gName), visited(false) { } //! copy ctor Vertex(const Vertex & b) : name(b.name), visited(b.visited), convertValue(b.convertValue) { } /** * get conversion value/factor from this to end * * @param end end conversion unit */ const float getConvertValue(const string & end) const { map<string, float>::const_iterator iter = convertValue.find(end); if (iter != convertValue.end()) return iter->second; return 0; } /** * whether next is adjacent to this vertex * * @param next vertex to check adjacency on */ inline const bool isAdjacent(const string & next) const { return getConvertValue(next) != 0; } /** * add a conversion value to a Vertex * * @param end end conversion unit * @param value conversion factor/value */ inline void add(const string & end, const float & value) { convertValue.insert(pair<string, float> (end, value)); } }; /** * class to convert units from one to another. Can be done through 3 funcitons, * operator (), ctor(start, end, value), or convert(...) */ class Convert { private: /** * comarison functor/functiod for Vertexs. Used in set listVertex. */ struct VertexComp { bool operator()(const Vertex& lhs, const Vertex& rhs) const { return lhs.name < rhs.name; } }; void initVertexs(ifstream &); void initVertexs(const string &); //! list of vertexs/units set<Vertex, VertexComp> listVertex; public: Convert(const string & file = DEFAULT_CONVERT_FILE) { initVertexs(file); } /** * @see convert() */ Convert(const string & start, const string & end, double & value, const string & file = DEFAULT_CONVERT_FILE) { initVertexs(file); convert(start, end, value); } /** * functoid/functor * @see convert() */ bool operator()(const string & start, const string & end, double & value) { return convert(start, end, value); } // @see convert() const bool convert(const string & start, const string & end, double & value) const { return convert(getVertex(start), end, value); } const bool convert(const Vertex&, const string&, double &) const; /** * returns a vertex for a given name * * @throws ERROR::could_not_find_vertex * * @param name name of vertex to find/return * @return Vertex */ Vertex & getVertex(const string & name) const { set<Vertex>::const_iterator iter = listVertex.find(Vertex(name)); if (iter != listVertex.end()) return (Vertex &) *iter; // else throw ERROR::COULD_NOT_FIND_VERTEX(name); } /** * print out all the known units * * @param stream stream to which to print * @return stream * * @author Matthew A. Todd * @date August 21, 2009 */ ostream & printList(ostream & stream) const { set<Vertex>::const_iterator iter; for (iter = listVertex.begin(); iter != listVertex.end(); iter++) { stream << iter->name << endl; } return stream; } }; #endif /* CONVERT_H_ */
/* * Copyright © Chris Wilson, 2008 * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of * Chris Wilson not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Chris Wilson makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * CHRIS WILSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: Chris Wilson <chris@chris-wilson.co.uk> */ #include "cairo-test.h" /* This is a test case for the following bug: * * crafted gif file will crash firefox * [XError: 'BadAlloc (insufficient resources for operation)'] * https://bugzilla.mozilla.org/show_bug.cgi?id=424333 * * The output is currently marked as XFAIL as pixman is still limited * to 16.16. */ static cairo_test_draw_function_t draw; static const cairo_test_t test = { "large-source", "Exercises mozilla bug 424333 - handling of massive images", 20, 20, draw }; #ifdef WORDS_BIGENDIAN #define RED_MASK 0xA0 #define GREEN_MASK 0xA #else #define RED_MASK 0x5 #define GREEN_MASK 0x50 #endif static cairo_test_status_t draw (cairo_t *cr, int width, int height) { cairo_surface_t *surface; unsigned char *data; cairo_set_source_rgb (cr, 0, 0, 1); /* blue */ cairo_paint (cr); surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 64000, 20); data = cairo_image_surface_get_data (surface); if (data != NULL) { int stride = cairo_image_surface_get_stride (surface); int width = cairo_image_surface_get_width (surface); int height = cairo_image_surface_get_height (surface); int x, y; for (y = 0; y < height; y++) { for (x = 0; x < (width + 7) / 8; x++) data[x] = RED_MASK; data += stride; } } cairo_set_source_rgb (cr, 1, 0, 0); /* red */ cairo_mask_surface (cr, surface, 0, 0); cairo_surface_destroy (surface); surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 20, 64000); data = cairo_image_surface_get_data (surface); if (data != NULL) { int stride = cairo_image_surface_get_stride (surface); int width = cairo_image_surface_get_width (surface); int height = cairo_image_surface_get_height (surface); int x, y; for (y = 0; y < height; y++) { for (x = 0; x < (width + 7) / 8; x++) data[x] = GREEN_MASK; data += stride; } } cairo_set_source_rgb (cr, 0, 1, 0); /* green */ cairo_mask_surface (cr, surface, 0, 0); cairo_surface_destroy (surface); return CAIRO_TEST_SUCCESS; } int main (void) { return cairo_test (&test); }
/* MATRIX.H Matrix implementation & definition header file (c) 2001 Avishek Sen Gupta ---created for automaton simulation visualisation--- */ #ifndef MATRIX4X4_H #define MATRIX4X4_H #include <iostream> #include <cmath> namespace Comrade { namespace Iris3D { #define MATRIX_X 4 #define MATRIX_Y 4 struct Point { double array[1][4]; void input(double a,double b,double c,double d); void show(); }; class Matrix4x4 { public: double matrix[4][4]; public: Matrix4x4(); void init(); void input(double arr[MATRIX_Y][MATRIX_X]); void show(); ~Matrix4x4(); }; Point multiply(Point coord, Matrix4x4 transform); } } #endif
#define PATCHLEVEL 2
/* Copyright (C) 2015 Felipe de Lima Peressim * 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/>. */ /* Exercise 1-21. Write a program entab that replaces strings of blanks by the minimum number of tabs and blanks * to achieve the same spacing. Use the same tab stops as for detab. When either a tab or a single blank would * suffice to reach a tab stop, which should be given preference? */ #include <stdio.h> #define TABSTOP 8 int main(void) { int c, spc, column; spc = column = 0; while (c = getchar(), c != EOF) { if (spc == 0 && c != '\n' && c != ' ') { column++; putchar(c); } if(spc > 0 && c != ' ' && spc >= TABSTOP) { while (spc >= TABSTOP) { putchar('\t'); spc-= TABSTOP; } while(column > 0) { putchar(' '); column--; } if (spc == 0) putchar(c); } if (spc > 0 && c != ' ' && spc < TABSTOP) { while (spc > 0 && spc < TABSTOP) { putchar(' '); spc--; } putchar(c); } if (c == ' ') spc++; if (column >= TABSTOP || c == '\n' || c == '\t') column = 0; } return 0; }
#include "../filesys.h" #include "../debug.h" #include "../native/filesys.h" #include <assert.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <sys/stat.h> bool native_create_dir(const uint8_t *filepath) { const int status = mkdir((char *)filepath, S_IRWXU); if (status == 0 || errno == EEXIST) { return true; } return false; } // TODO: DRY. This function exists in both posix/filesys.c and in android/main.c static void opts_to_sysmode(UTOX_FILE_OPTS opts, char *mode) { if (opts & UTOX_FILE_OPTS_READ) { mode[0] = 'r'; // Reading is first, don't clobber files. } else if (opts & UTOX_FILE_OPTS_APPEND) { mode[0] = 'a'; // Then appending, again, don't clobber files. } else if (opts & UTOX_FILE_OPTS_WRITE) { mode[0] = 'w'; // Writing is the final option we'll look at. } mode[1] = 'b'; // does nothing on posix >C89, but hey, why not? if ((opts & (UTOX_FILE_OPTS_WRITE | UTOX_FILE_OPTS_APPEND)) && (opts & UTOX_FILE_OPTS_READ)) { mode[2] = '+'; } mode[3] = 0; return; } FILE *native_get_file(const uint8_t *name, size_t *size, UTOX_FILE_OPTS opts, bool portable_mode) { uint8_t path[UTOX_FILE_NAME_LENGTH] = { 0 }; if (portable_mode) { snprintf((char *)path, UTOX_FILE_NAME_LENGTH, "./tox/"); } else { snprintf((char *)path, UTOX_FILE_NAME_LENGTH, "%s/.config/tox/", getenv("HOME")); } // native_get_file should never be called with DELETE in combination with other FILE_OPTS. assert(opts <= UTOX_FILE_OPTS_DELETE); // WRITE and APPEND are mutually exclusive. WRITE will serve you a blank file. APPEND will append (duh). assert((opts & UTOX_FILE_OPTS_WRITE && opts & UTOX_FILE_OPTS_APPEND) == false); if (opts & UTOX_FILE_OPTS_WRITE || opts & UTOX_FILE_OPTS_MKDIR) { if (!native_create_dir(path)) { return NULL; } } if (strlen((char *)path) + strlen((char *)name) >= UTOX_FILE_NAME_LENGTH) { LOG_ERR("Filesys", "Load directory name too long" ); return NULL; } else { snprintf((char *)path + strlen((char *)path), UTOX_FILE_NAME_LENGTH - strlen((char *)path), "%s", name); } if (opts == UTOX_FILE_OPTS_DELETE) { remove((char *)path); return NULL; } if (opts & UTOX_FILE_OPTS_MKDIR) { uint8_t push; uint8_t *p = path + strlen((char *)path); while (*--p != '/'); push = *++p; *p = 0; native_create_dir(path); *p = push; } char mode[4] = { 0 }; opts_to_sysmode(opts, mode); FILE *fp = fopen((char *)path, mode); if (!fp && opts & UTOX_FILE_OPTS_READ && opts & UTOX_FILE_OPTS_WRITE) { LOG_WARN("POSIX", "Unable to simple open, falling back to fd" ); // read wont create a file if it doesn't' already exist. If we're allowed to write, lets try // to create the file, then reopen it. int fd = open((char *)path, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); fp = fdopen(fd, mode); } if (fp == NULL) { LOG_TRACE("Filesys", "Could not open %s" , path); return NULL; } if (size != NULL) { fseek(fp, 0, SEEK_END); *size = ftell(fp); fseek(fp, 0, SEEK_SET); } return fp; } bool native_move_file(const uint8_t *current_name, const uint8_t *new_name) { if(!current_name || !new_name) { return false; } return rename((char *)current_name, (char *)new_name); }
/************************************************************************************************************************ ** ** Copyright 2015-2021 Daniel Nikpayuk, Inuit Nunangat, The Inuit Nation ** ** This file is part of nik. ** ** nik 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. ** ** nik 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 nik. If not, see ** <http://www.gnu.org/licenses/>. ** ************************************************************************************************************************/ #include nik_size_type(define) #define pnk_builtin_ss nik_module(patronum, natural, kernel, builtin, symbolic, semiotic) #define snk_unsigned_short_judgment_ss nik_module(straticum, natural, kernel, unsigned_short_judgment, symbolic, semiotic) #ifdef safe_name #define PREFIX snkusj_identity_ss_ #else #define PREFIX #endif // template < typename Exp, typename Continuation = typename pnk_builtin_ss::inductor:: ch_s_match_to_value, typename Kind = bool, template<Kind...> class ListKind = pnk_builtin_ss::inductor::template dependent_memoization<Kind>::template pattern_match_values > using nik_safe(PREFIX, s_is_unsigned_short_judgment) = typename snk_unsigned_short_judgment_ss::identity::template s_is_unsigned_short_judgment <Exp, Continuation, Kind, ListKind>; template < typename Exp, typename Continuation = typename pnk_builtin_ss::inductor:: ch_s_match_to_value, typename Kind = bool > using nik_safe(PREFIX, s_is_curried_unsigned_short_judgment) = typename snk_unsigned_short_judgment_ss::identity::template s_is_curried_unsigned_short_judgment <Exp, Continuation, Kind>; // template < typename Exp, typename Continuation = nik::ch_a_value, typename Image = bool > static constexpr Image nik_safe(PREFIX, a_is_unsigned_short_judgment) = snk_unsigned_short_judgment_ss::identity::template a_is_unsigned_short_judgment <Exp, Continuation, Image>; template < typename Exp, typename Continuation = nik::ch_a_value, typename Image = bool > static constexpr Image nik_safe(PREFIX, a_is_curried_unsigned_short_judgment) = snk_unsigned_short_judgment_ss::identity::template a_is_curried_unsigned_short_judgment <Exp, Continuation, Image>; // #undef PREFIX #undef snk_unsigned_short_judgment_ss #undef pnk_builtin_ss #include nik_size_type(undef)
/* * Copyright (C) 2016 Simon Fels <morphis@gravedo.de> * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranties of * MERCHANTABILITY, SATISFACTORY QUALITY, 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 ANBOX_WM_MULTI_WINDOW_MANAGER_H_ #define ANBOX_WM_MULTI_WINDOW_MANAGER_H_ #include "anbox/wm/manager.h" #include <map> #include <memory> #include <mutex> namespace anbox::application { class Database; } namespace anbox::bridge { class AndroidApiStub; } namespace anbox::platform { class BasePlatform; } namespace anbox::wm { class MultiWindowManager : public Manager { public: MultiWindowManager(const std::weak_ptr<platform::BasePlatform> &platform, const std::shared_ptr<bridge::AndroidApiStub> &android_api_stub, const std::shared_ptr<application::Database> &app_db); ~MultiWindowManager(); void apply_window_state_update(const WindowState::List &updated, const WindowState::List &removed) override; std::shared_ptr<Window> find_window_for_task(const Task::Id &task) override; void resize_task(const Task::Id &task, const anbox::graphics::Rect &rect, const std::int32_t &resize_mode) override; void set_focused_task(const Task::Id &task) override; void remove_task(const Task::Id &task) override; private: std::mutex mutex_; std::weak_ptr<platform::BasePlatform> platform_; std::shared_ptr<bridge::AndroidApiStub> android_api_stub_; std::shared_ptr<application::Database> app_db_; std::map<Task::Id, std::shared_ptr<Window>> windows_; }; } #endif
// This is copyrighted software. More information is at the end of this file. #pragma once extern "C" { #include "heheader.h" } /* * Handlers for Hugo callbacks from heqt.cc that we want executed in the main thread. The hugo * engine runs in a separate thread, so the heqt.cc callbacks will delegate some work here in order * to ensure it runs in the main thrad (like GUI operations.) */ namespace HugoHandlers { void calcFontDimensions(); void getfilename(char* a, char* b); void startGetline(char* p); void endGetline(); void clearfullscreen(); void clearwindow(); void settextmode(); void settextwindow(int left, int top, int right, int bottom); void printFatalError(char* a); void print(char* a); void font(int f); void settextcolor(int c); void setbackcolor(int c); void displaypicture(HUGO_FILE infile, long len, int* result); void playmusic(HUGO_FILE infile, long reslength, char loop_flag, int* result); void musicvolume(int vol); void stopmusic(); void playsample(HUGO_FILE infile, long reslength, char loop_flag, int* result); void samplevolume(int vol); void stopsample(); #ifndef DISABLE_VIDEO void stopvideo(); void playvideo(HUGO_FILE infile, long len, char loop, char bg, int vol, int* result); #endif }; // namespace HugoHandlers /* Copyright (C) 2011-2019 Nikos Chantziaras * * This file is part of Hugor. * * Hugor 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. * * Hugor 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 * Hugor. If not, see <http://www.gnu.org/licenses/>. */
#ifndef ProcessorMgr_h #define ProcessorMgr_h 1 #include "lcio.h" #include "Processor.h" #include "IO/LCRunListener.h" #include "IO/LCEventListener.h" #include "EVENT/LCEvent.h" #include "EVENT/LCRunHeader.h" #include "LogicalExpressions.h" #include <map> #include <set> #include <list> using namespace lcio ; class SkipEventException : public lcio::Exception { protected: SkipEventException() { /*no_op*/ ; } public: SkipEventException(const Processor* proc) { message = proc->name() ; } virtual ~SkipEventException() throw() { /*no_op*/; } }; typedef std::map< const std::string , Processor* > ProcessorMap ; typedef std::list< Processor* > ProcessorList ; typedef std::map< const std::string , int > SkippedEventMap ; /** Processor manager singleton class. Holds references to all registered Processors. * * Responsible for creating the instance of ProcessorEventSeeder and setting the Global::EVENTSEEDER variable. * * @author F. Gaede, DESY * @version $Id: ProcessorMgr.h,v 1.16 2007-08-13 10:38:39 gaede Exp $ */ class ProcessorMgr : public LCRunListener, public LCEventListener { friend class Processor ; public: /** Return the instance of this manager */ static ProcessorMgr* instance() ; /** destructor deletes ProcessorEventSeeder */ virtual ~ProcessorMgr() ; /** Add a processor of type processorType with name processorName to the list * of active processors including a condition for the execution of the processEvent() method. */ bool addActiveProcessor( const std::string& processorType , const std::string& processorName ,StringParameters* parameters , const std::string condition="true" ) ; /** Remove processor with name from list of active processors. */ void removeActiveProcessor( const std::string& name ) ; /** Return the active processor with the given name. * NULL if no processor exists. */ Processor* getActiveProcessor( const std::string& name ) ; /** Return the processor that has been registered with the given type. * NULL if no processor exists. */ Processor* getProcessor( const std::string& type ) ; virtual void init() ; virtual void processRunHeader( LCRunHeader* ) ; virtual void processEvent( LCEvent* ) ; virtual void end() ; virtual void modifyRunHeader( LCRunHeader*) ; virtual void modifyEvent( LCEvent *) ; /** Set the return value for the given processor */ virtual void setProcessorReturnValue( Processor* proc, bool val ) ; /** Set the named return value for the given processor */ virtual void setProcessorReturnValue( Processor* proc, bool val , const std::string& name) ; protected: /** Register a processor with the given name. */ void registerProcessor( Processor* processor ) ; /** Returns a list of all registered processors found */ std::set< std::string > getAvailableProcessorTypes() ; ProcessorMgr() ; private: static ProcessorMgr* _me ; ProcessorMap _map ; ProcessorMap _activeMap ; ProcessorList _list ; SkippedEventMap _skipMap ; ProcessorList _eventModifierList ; LogicalExpressions _conditions ; }; #endif
/*************************************************************************** * Copyright (C) 2007-2016 by David Bitseff * * bitsed@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 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 TRANSFORMABLEGRAPHICSGUIDE_H #define TRANSFORMABLEGRAPHICSGUIDE_H #include <QGraphicsObject> #include <QGraphicsRectItem> #include "xfedit.h" class GraphicsGuideScaleButton : public QGraphicsRectItem { public: enum { Type = UserType + 7 }; enum Location { TopRight, TopLeft, BottomRight, BottomLeft }; Location location; QPen std_pen; GraphicsGuideScaleButton(QGraphicsItem* =0); int type() const; protected: void hoverEnterEvent(QGraphicsSceneHoverEvent*); void hoverLeaveEvent(QGraphicsSceneHoverEvent*); }; class TransformableGraphicsGuide : public QGraphicsObject { Q_OBJECT FigureEditor* editor; QRectF outerRect; QPolygonF hFlipPoly; QPolygonF vFlipPoly; GraphicsGuideScaleButton topLeftRect; GraphicsGuideScaleButton topRightRect; GraphicsGuideScaleButton bottomLeftRect; GraphicsGuideScaleButton bottomRightRect; GraphicsGuideScaleButton bottomRect; GraphicsGuideScaleButton topRect; GraphicsGuideScaleButton leftRect; GraphicsGuideScaleButton rightRect; public: explicit TransformableGraphicsGuide(FigureEditor*, QGraphicsItem* =0); QRectF boundingRect() const; void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* =0); void setParentItem(QGraphicsItem*); void setVisible(bool); void update(); QPainterPath shape() const; }; #endif // TRANSFORMABLEGRAPHICSGUIDE_H
#include "ruby/digest.h" #include "digest_extensions_helper.h" static VALUE rb_mDigest; static VALUE rb_mDigest_Instance; #define hex(c) ((c>='a')?c-'a'+10:(c>='A')?c-'A'+10:c-'0') /* * Document-module: Digest::Instance * * This module provides instance methods for a digest implementation * object to calculate message digest values. */ /* * call-seq: * digest_obj.marshal_dump() -> byte sequence * * dumps the state as a byte sequence * */ static VALUE rb_digest_instance_marshal_dump(VALUE self) { rb_digest_metadata_t *algo; void *pctx; VALUE str; size_t i; char *p; static const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; algo = get_digest_base_metadata(rb_obj_class(self)); /* Data_Get_Struct(obj, rb_digest_metadata_t, algo); */ pctx = xmalloc(algo->ctx_size); Data_Get_Struct(self, void, pctx); /* // rb_digest_instance_method_unimpl(self, "update"); */ str = rb_str_new(0, algo->ctx_size * 2); for (i = 0, p = RSTRING_PTR(str); i < algo->ctx_size; ++i) { unsigned char byte = ((unsigned char*)pctx)[i]; p[i + i] = hex[byte >> 4]; p[i + i + 1] = hex[byte & 0x0f]; } return str; } /* * call-seq: * digest_obj.marshal_load(byte_sequence) -> * * loads the state as a byte sequence * */ static VALUE rb_digest_instance_marshal_load(VALUE self, VALUE byte_sequence) { rb_digest_metadata_t *algo; size_t byte_counter; void *pctx; unsigned char* from; algo = get_digest_base_metadata(rb_obj_class(self)); if((size_t)RSTRING_LEN(byte_sequence) != algo->ctx_size *2){ rb_raise(rb_eRuntimeError, "Digest::Base#marshal_load: length is incorrect."); } from = RSTRING_PTR(byte_sequence); Data_Get_Struct(self, void, pctx); for(byte_counter = 0; byte_counter < algo->ctx_size; ++byte_counter){ unsigned char hex_digit_1 = from[byte_counter *2]; unsigned char hex_digit_2 = from[byte_counter *2 + 1]; if(( ('a' <= hex_digit_1 && hex_digit_1 <= 'f' ) || ('0' <= hex_digit_1 && hex_digit_1 <= '9' )) &&(('a' <= hex_digit_2 && hex_digit_2 <= 'f' ) || ('0' <= hex_digit_2 && hex_digit_2 <= '9' ))){ ((unsigned char*)pctx)[byte_counter] = (hex(hex_digit_1)<<4) + hex(hex_digit_2); }else{ rb_raise(rb_eRuntimeError, "Digest::Base#marshal_load: Not a hexadecimal digit."); } } return Qnil; } void Init_digest_extensions(void) { id_metadata = rb_intern("metadata");//This is an initializer for the helper functions. /* * module Digest */ rb_mDigest = rb_define_module("Digest"); /* * module Digest::Instance */ rb_mDigest_Instance = rb_define_module_under(rb_mDigest, "Instance"); rb_define_method(rb_mDigest_Instance, "marshal_dump", rb_digest_instance_marshal_dump, 0); rb_define_method(rb_mDigest_Instance, "marshal_load", rb_digest_instance_marshal_load, 1); }
/* gasetools: a set of tools to manipulate SEGA games file formats Copyright (C) 2010 Loic Hoguin This file is part of gasetools. gasetools 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. gasetools 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 gasetools. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #include <stdio.h> #include "../nbl/nbl.h" /** * Expand the given file using nbl_decompress. */ int main(int argc, char** argv) { FILE* pFile; char* pstrCmp; char* pstrExp; char pstrFilename[FILENAME_MAX]; int iCmpSize, iExpSize, iRead; if (2 != argc) { fprintf(stderr, "Usage: %s file\n", argv[0]); return 2; } pFile = fopen(argv[1], "rb"); if (pFile == NULL) return -1; iRead = fread(&iExpSize, sizeof(unsigned int), 1, pFile); /* TODO: iRead */ iRead = fread(&iCmpSize, sizeof(unsigned int), 1, pFile); /* TODO: iRead */ pstrExp = malloc(iExpSize); /* TODO */ pstrCmp = malloc(iCmpSize); /* TODO */ fseek(pFile, 0x1C, SEEK_SET); iRead = fread(pstrCmp, 1, iCmpSize, pFile); /* TODO */ fclose(pFile); nbl_decompress(pstrCmp, iCmpSize, pstrExp, iExpSize); sprintf(pstrFilename, "%s.exp", argv[1]); pFile = fopen(pstrFilename, "wb"); fwrite(pstrExp, 1, iExpSize, pFile); /* TODO */ fclose(pFile); free(pstrCmp); free(pstrExp); return 0; }
/* The MIT License(MIT) Cayenne Arduino Client Library Copyright (c) 2016 myDevices Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _CAYENNEMQTTESP8266_h #define _CAYENNEMQTTESP8266_h #include <ESP8266WiFi.h> #include "CayenneUtils/CayenneDefines.h" #include "CayenneMQTTWiFiClient.h" #endif
#include "tree.h" atype_t balanced_tree(unsigned int p, unsigned long n1, atype_t values[n1], atype_t (*f)(atype_t x, atype_t y)) { #pragma omp parallel num_threads(p) { unsigned int n = (n1 + 1) / 2; for(unsigned long stride = n/2; stride > 0; stride /= 2) { #pragma omp for // schedule(guided) for(unsigned long i = 0; i < stride; i++) { values[stride - 1 + i] = (*f)(values[stride*2-1 + i],values[stride*2-1 + i + stride]); } } } return values[0]; }
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "EconomicBuilding.h" #include "MetalEconomicBuilding.generated.h" /** * */ UCLASS() class SINAH_API AMetalEconomicBuilding : public AEconomicBuilding { GENERATED_BODY() public: AMetalEconomicBuilding(); };
/** * Author: Stanislaw Findeisen <stf AT eisenbits.com> * * Changes history: * * 2010-08-23 (SF): initial version */ #ifndef _linuxmon_throwable_error_NotImplementedError_H_ #define _linuxmon_throwable_error_NotImplementedError_H_ #include "EBLogicError.h" namespace linuxmon { class NotImplementedError : public linuxmon::EBLogicError { public: NotImplementedError(); virtual ~NotImplementedError() throw(); virtual TString getName() const; }; inline TString NotImplementedError::getName() const { return "linuxmon::NotImplementedError"; } }; #endif
/* c = getch; Matlab MEX file tot ry to read character from keyboard asynchronously. Daniel D. Lee, 1/07. <ddlee@seas.upenn.edu> */ #include <unistd.h> #include <fcntl.h> #include "mex.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int n, dims[2]; char str[2]; if (fcntl(0, F_SETFL, O_NONBLOCK) == -1) mexErrMsgTxt("Could not set nonblocking input."); str[0] = 0; str[1] = 0; n = read(0, &str, 1); /* Create output arguments */ plhs[0] = mxCreateString(str); }
/** * Copyright (C) 2012 by INdT * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @author Rodrigo Goncalves de Oliveira <rodrigo.goncalves@openbossa.org> * @author Roger Felipe Zanoni da Silva <roger.zanoni@openbossa.org> */ #ifndef _BOX2DJOINT_H_ #define _BOX2DJOINT_H_ #include "box2dbase.h" #include "entity.h" class Entity; class b2Joint; class Box2DJoint : public Box2DBase { Q_OBJECT Q_PROPERTY(Entity *entityA READ entityA WRITE setEntityA NOTIFY entityAChanged) Q_PROPERTY(Entity *entityB READ entityB WRITE setEntityB NOTIFY entityBChanged) Q_PROPERTY(bool collideConnected READ collideConnected WRITE setCollideConnected NOTIFY collideConnectedChanged) Q_PROPERTY(QPointF anchorA READ anchorA WRITE setAnchorA NOTIFY anchorAChanged) Q_PROPERTY(QPointF anchorB READ anchorB WRITE setAnchorB NOTIFY anchorBChanged) public: Box2DJoint(Scene *parent = 0); virtual ~Box2DJoint() {} Entity *entityA() const; void setEntityA(Entity *entityA); Entity *entityB() const; void setEntityB(Entity *entityB); bool collideConnected() const; void setCollideConnected(const bool &collideConnected); QPointF anchorA() const { return m_anchorA; } void setAnchorA(const QPointF &anchorA); QPointF anchorB() const { return m_anchorB; } void setAnchorB(const QPointF &anchorB); signals: void entityAChanged(); void entityBChanged(); void collideConnectedChanged(); void anchorAChanged(); void anchorBChanged(); protected: Entity *m_entityA; Entity *m_entityB; bool m_collideConnected; b2Joint *m_joint; QPointF m_anchorA; QPointF m_anchorB; }; #endif /* _BOX2DJOINT_H_ */
#include "sae_par.h" #include "ary1.h" #include "dat_par.h" void ary1Inbnd( int ndim1, const hdsdim *lbnd1, const hdsdim *ubnd1, int ndim2, const hdsdim *lbnd2, const hdsdim *ubnd2, int *inside, int *status ) { /* *+ * Name: * ary1Inbnd * Purpose: * Test if the bounds of one array lie inside those of another. * Synopsis: * void ary1Inbnd( int ndim1, const hdsdim *lbnd1, const hdsdim *ubnd1, int ndim2, * const hdsdim *lbnd2, const hdsdim *ubnd2, int *inside, * int *status ) * Description: * The routine checks to see if the second set of array bounds * supplied lie inside the first set. For this purpose, "inside" * means that there are no pixels in the second array which are not * present in the first. If the arrays are of different * dimensionality, then the bounds of the array with lower * dimensionality are padded with 1's before testing them. The array * bounds information supplied is not checked for validity. * Parameters: * ndim1 * Number of dimensions for the first array. * lbnd1 * Lower bounds of the first array. * ubnd1 * Upper bounds of the first array. * ndim2 * Number of dimensions for the second array. * lbnd2 * Lower bounds of the second array. * ubnd2 * Upper bounds of the second array. * inside * Returned holding a flag indicating whether the second array * lies inside the first one. * status * The global status. * Copyright: * Copyright (C) 2017 East Asian Observatory * All rights reserved. * Licence: * 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 * Authors: * RFWS: R.F. Warren-Smith (STARLINK) * DSB: David S. Berry (EAO) * History: * 03-JUL-2017 (DSB): * Original version, based on equivalent Fortran routine by RFWS. *- */ /* Local variables: */ hdsdim l1; /* Lower bound of first array */ hdsdim l2; /* Lower bound of second array */ hdsdim u1; /* Upper bound of first array */ hdsdim u2; /* Upper bound of second array */ int i; /* Loop counter for dimensions */ int maxdim; /* Max of ndim1 and ndim2 */ /* Check inherited global status. */ if( *status != SAI__OK ) return; /* Initialise. */ *inside = 1; /* Loop to test each relevant dimension. */ maxdim = ( ndim1 > ndim2 ) ? ndim1 : ndim2; for( i = 0; i < maxdim; i++ ){ /* Obtain the bounds of the first array in each dimension, padding with 1's if necessary. */ if( i < ndim1 ){ l1 = lbnd1[ i ]; u1 = ubnd1[ i ]; } else { l1 = 1; u1 = 1; } /* Similarly, obtain the bounds of the second array. */ if( i < ndim2 ){ l2 = lbnd2[ i ]; u2 = ubnd2[ i ]; } else { l2 = 1; u2 = 1; } /* Test to see if the extent of the second array lies inside that of the first array. Return with *inside set to zero. if this is not true for any dimension. */ if( ( l1 > l2 ) || ( u1 < u2 ) ){ *inside = 0; break; } } /* Call error tracing routine and exit. */ if( *status != SAI__OK ) ary1Trace( "ary1Inbnd", status ); }
/** ****************************************************************************** * @file TIM/TIM_6Steps/Inc/stm32f4xx_it.h * @author MCD Application Team * @version V1.1.0 * @date 17-February-2017 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics 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 HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void TIM1_TRG_COM_TIM11_IRQHandler(void); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// File generated by cmake from cmake/config.h.cmake. #ifndef _EXV_CONF_H_ #define _EXV_CONF_H_ // Defined if you want to use libssh for SshIO. #define EXV_USE_SSH // Define to 1 if you want to use libcurl in httpIO. #define EXV_USE_CURL // Define if you require webready support. #define EXV_ENABLE_WEBREADY // Define if you require PNG support. #define EXIV2_ENABLE_PNG // Define if you have the `gmtime_r' function. /* #undef EXV_HAVE_GMTIME_R */ // Define if you have the <libintl.h> header file. /* #undef EXV_HAVE_LIBINTL_H */ // Define if you want translation of program messages to the user's native language #define EXV_ENABLE_NLS // Define if you want video support. #define EXV_ENABLE_VIDEO // Define if you have the strerror_r function. /* #undef EXV_HAVE_STRERROR_R */ // Define if the strerror_r function returns char*. /* #undef EXV_STRERROR_R_CHAR_P */ // Define to enable the Windows unicode path support. #define EXV_UNICODE_PATH /* Define to `const' or to empty, depending on the second argument of `iconv'. */ /* #define ICONV_ACCEPTS_CONST_INPUT */ #if defined(ICONV_ACCEPTS_CONST_INPUT) || defined(__NetBSD__) #define EXV_ICONV_CONST const #else #define EXV_ICONV_CONST #endif // Define if you have the <regex.h> header file. /* #undef EXV_HAVE_REGEX_H */ // Define if have the <memory.h> header file. #define EXV_HAVE_MEMORY_H // Define if stdbool.h conforms to C99. #define EXV_HAVE_STDBOOL_H // Define if you have the <stdint.h> header file. #define EXV_HAVE_STDINT_H // Define if you have the <strings.h> header file. /* #undef EXV_HAVE_STRINGS_H */ // Define if you have the mmap function. /* #undef EXV_HAVE_MMAP */ // Define if you have the munmap function. /* #undef EXV_HAVE_MUNMAP */ // Define if you have <sys/stat.h> header file. #define EXV_HAVE_SYS_STAT_H // Define if you have the <sys/types.h> header file. #define EXV_HAVE_SYS_TYPES_H /* Define if you have the <unistd.h> header file. */ /* #undef EXV_HAVE_UNISTD_H */ // Define if you have the <sys/mman.h> header file. /* #undef EXV_HAVE_SYS_MMAN_H */ // Define if you have are using the zlib library. #define EXV_HAVE_LIBZ // Define if you have the <process.h> header file. #define EXV_HAVE_PROCESS_H /* Define if you have (Exiv2/xmpsdk) Adobe XMP Toolkit. */ #define EXV_HAVE_XMP_TOOLKIT /* Define to the full name of this package. */ #define EXV_PACKAGE_NAME "exiv2" /* Define to the full name and version of this package. */ #define EXV_PACKAGE_STRING "exiv2 0.27.2" /* Define to the version of this package. */ #define EXV_PACKAGE_VERSION "0.27.2" #define EXIV2_MAJOR_VERSION (0) #define EXIV2_MINOR_VERSION (27) #define EXIV2_PATCH_VERSION (2) #define EXIV2_TWEAK_VERSION () // Definition to enable translation of Nikon lens names. #define EXV_HAVE_LENSDATA // Define if you have the iconv function. #define EXV_HAVE_ICONV // Definition to enable conversion of UCS2 encoded Windows tags to UTF-8. #define EXV_HAVE_PRINTUCS2 #endif /* !_EXV_CONF_H_ */
/* * cSexualAncestry.h * Avida * * Created by David on 7/7/10. * Copyright 2010-2011 Michigan State University. All rights reserved. * * * This file is part of Avida. * * Avida 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. * * Avida 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 Avida. * If not, see <http://www.gnu.org/licenses/>. * */ #ifndef cSexualAncestry_h #define cSexualAncestry_h #include <cassert> class cBioGroup; class cSexualAncestry { private: int m_id; int m_ancestor_ids[6]; cSexualAncestry(); // @not_implemented cSexualAncestry(const cSexualAncestry&); // @not_implemented cSexualAncestry& operator=(const cSexualAncestry&); // @not_implemented public: cSexualAncestry(cBioGroup* bg); int GetID() const { return m_id; } int GetAncestorID(int idx) const { assert(idx < 6); return m_ancestor_ids[idx]; } int GetPhyloDistance(cBioGroup* bg) const; }; #endif
#include <stdio.h> #include <stdlib.h> #include <unistd.h> /* geteuid */ #include <sys/types.h> /* uid_t */ #include "io/gpustat.h" #include "interfaces.h" void radeon_test(struct gpustat *gs); void nouveau_test(struct gpustat *gs); void intel_test(struct gpustat *gs); int main(int argc, char *argv[]) { struct gpustat *gs; int *gpulist; int size; int i; if (geteuid() != 0) { fprintf(stderr, "This program must be run as root.\n"); return 1; } printf("Running...\n"); /* test lsgpu */ gpulist = lsgpu(&size); printf("found %d cards\n", size); for (i=0; i<size; ++i) { printf("Found card %d.\n", gpulist[i]); if ((gs = gpustat_new(gpulist[i])) == NULL) { fprintf(stderr, "Could not create new gpustat.\n"); continue; } switch (gs->type) { case RADEON: radeon_test(gs); break; case NOUVEAU: nouveau_test(gs); break; case INTEL: intel_test(gs); break; default: fprintf(stderr, "Unknown GPU.\n"); break; } gpustat_destroy(gs); } free(gpulist); printf("done\n"); return 0; } void radeon_test(struct gpustat *gs) { struct radeon_stat *rs; rs = gs->ifc; printf("card %d: radeon\n" "\tfastfb=%d\n\tdpm=%d\n\trunpm=%d\n\tbapm=%d\n" "\tpcie_gen2=%d\n\taudio=%d\n\ttv=%d\n\tdeep_color=%d\n" "\tr600_debug=%s\n", gs->card, rs->flags.fastfb, rs->flags.dpm, rs->flags.runpm, rs->flags.bapm, rs->flags.pcie_gen2, rs->flags.audio, rs->flags.tv, rs->flags.deep_color, rs->flags.r600_debug); } void nouveau_test(struct gpustat *gs) { struct nouveau_stat *ns; ns = gs->ifc; printf("card %d: nouveau\n\trunpm=%d\n", gs->card, ns->flags.runpm); } void intel_test(struct gpustat *gs) { struct intel_stat *is; is = gs->ifc; printf("card %d: intel\n" "\tsemaphores=%d\n\tlvds_downclock=%d\n\tenable_ppgtt=%d\n" "\tenable_psr=%d\n\tfastboot=%d\n", gs->card, is->flags.semaphores, is->flags.lvds_downclock, is->flags.enable_ppgtt, is->flags.enable_psr, is->flags.fastboot); }
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * Copyright (C) 2011-2015 - Daniel De Matteis * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef __RARCH_FONTS_H #define __RARCH_FONTS_H #include <stdint.h> #include <boolean.h> #ifdef __cplusplus extern "C" { #endif /* All coordinates and offsets are top-left oriented. * * This is a texture-atlas approach which allows text to * be drawn in a single draw call. * * It is up to the code using this interface to actually * generate proper vertex buffers and upload the atlas texture to GPU. */ struct font_glyph { unsigned width; unsigned height; /* Texel coordinate offset for top-left pixel of this glyph. */ unsigned atlas_offset_x; unsigned atlas_offset_y; /* When drawing this glyph, apply an offset to * current X/Y draw coordinate. */ int draw_offset_x; int draw_offset_y; /* Advance X/Y draw coordinates after drawing this glyph. */ int advance_x; int advance_y; }; struct font_atlas { uint8_t *buffer; /* Alpha channel. */ unsigned width; unsigned height; }; typedef struct font_renderer { void *(*init)(void *data, const char *font_path, float font_size); void (*free)(void *data); void (*render_msg)(void *data, const char *msg, const void *params); const char *ident; const struct font_glyph *(*get_glyph)(void *data, uint32_t code); void (*bind_block)(void *data, void *block); void (*flush)(void *data); int (*get_message_width)(void *data, const char *msg, unsigned msg_len_full, float scale); } font_renderer_t; extern font_renderer_t gl_raster_font; extern font_renderer_t libdbg_font; extern font_renderer_t d3d_xbox360_font; extern font_renderer_t d3d_xdk1_font; extern font_renderer_t d3d_win32_font; typedef struct font_renderer_driver { void *(*init)(const char *font_path, float font_size); const struct font_atlas *(*get_atlas)(void *data); /* Returns NULL if no glyph for this code is found. */ const struct font_glyph *(*get_glyph)(void *data, uint32_t code); void (*free)(void *data); const char *(*get_default_font)(void); const char *ident; int (*get_line_height)(void* data); } font_renderer_driver_t; extern font_renderer_driver_t freetype_font_renderer; extern font_renderer_driver_t coretext_font_renderer; extern font_renderer_driver_t bitmap_font_renderer; /* font_path can be NULL for default font. */ bool font_renderer_create_default(const font_renderer_driver_t **driver, void **handle, const char *font_path, unsigned font_size); int font_renderer_get_message_width(const char *msg, float scale); #ifdef __cplusplus } #endif #endif
#ifndef __VMD_CONFDEFINITION_H__ #define __VMD_CONFDEFINITION_H__ #include <vgKernel/vgkForward.h> #define VGMO_DESC "vgModelDLL" #ifdef VGMO_DLL # ifdef VGMO_NONCLIENT_BUILD_DLL # define VGMO_EXPORT __declspec( dllexport ) # else # define VGMO_EXPORT __declspec( dllimport ) # endif #else # define VGMO_EXPORT VGK_EXPORT #endif # ifdef _DEBUG # define VGMO_DLL_NAME VGMO_DESC##"_Debug.dll" # define VGMO_LIB_NAME VGMO_DESC##"_Debug.lib" # else # define VGMO_DLL_NAME VGMO_DESC##"_Release.dll" # define VGMO_LIB_NAME VGMO_DESC##"_Release.lib" # endif //------------------------------------------ // Model namespace //------------------------------------------ #define VMD_RENDER_WAY 0 // ĬÈϵÄVBOäÖȾ //#define VMD_RENDER_WAY 1 // ʹÓÃVertex ArrayäÖȾ #define VMD_CONF_NAME "Model" #endif // end of __VMD_CONFDEFINITION_H__
#ifndef APT_PRIVATE_OUTPUT_H #define APT_PRIVATE_OUTPUT_H #include <apt-pkg/configuration.h> #include <apt-pkg/pkgcache.h> #include <apt-pkg/macros.h> #include <functional> #include <fstream> #include <string> #include <iostream> // forward declaration class pkgCacheFile; class CacheFile; class pkgDepCache; class pkgRecords; APT_PUBLIC extern std::ostream c0out; APT_PUBLIC extern std::ostream c1out; APT_PUBLIC extern std::ostream c2out; APT_PUBLIC extern std::ofstream devnull; APT_PUBLIC extern unsigned int ScreenWidth; APT_PUBLIC bool InitOutput(std::basic_streambuf<char> * const out = std::cout.rdbuf()); void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::VerIterator const &V, std::ostream &out, std::string const &format); // helper to describe global state APT_PUBLIC void ShowBroken(std::ostream &out, CacheFile &Cache, bool const Now); APT_PUBLIC void ShowBroken(std::ostream &out, pkgCacheFile &Cache, bool const Now); template<class Container, class PredicateC, class DisplayP, class DisplayV> bool ShowList(std::ostream &out, std::string const &Title, Container const &cont, PredicateC Predicate, DisplayP PkgDisplay, DisplayV VerboseDisplay) { size_t const ScreenWidth = (::ScreenWidth > 3) ? ::ScreenWidth - 3 : 0; int ScreenUsed = 0; bool const ShowVersions = _config->FindB("APT::Get::Show-Versions", false); bool printedTitle = false; for (auto const &Pkg: cont) { if (Predicate(Pkg) == false) continue; if (printedTitle == false) { out << Title; printedTitle = true; } if (ShowVersions == true) { out << std::endl << " " << PkgDisplay(Pkg); std::string const verbose = VerboseDisplay(Pkg); if (verbose.empty() == false) out << " (" << verbose << ")"; } else { std::string const PkgName = PkgDisplay(Pkg); if (ScreenUsed == 0 || (ScreenUsed + PkgName.length()) >= ScreenWidth) { out << std::endl << " "; ScreenUsed = 0; } else if (ScreenUsed != 0) { out << " "; ++ScreenUsed; } out << PkgName; ScreenUsed += PkgName.length(); } } if (printedTitle == true) { out << std::endl; return false; } return true; } void ShowNew(std::ostream &out,CacheFile &Cache); void ShowDel(std::ostream &out,CacheFile &Cache); void ShowKept(std::ostream &out,CacheFile &Cache); void ShowUpgraded(std::ostream &out,CacheFile &Cache); bool ShowDowngraded(std::ostream &out,CacheFile &Cache); bool ShowHold(std::ostream &out,CacheFile &Cache); bool ShowEssential(std::ostream &out,CacheFile &Cache); void Stats(std::ostream &out, pkgDepCache &Dep); // prompting bool YnPrompt(bool Default=true); bool AnalPrompt(const char *Text); std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); std::function<std::string(pkgCache::PkgIterator const &)> CandidateVersion(pkgCacheFile * const Cache); std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); std::function<std::string(pkgCache::PkgIterator const &)> CurrentToCandidateVersion(pkgCacheFile * const Cache); std::string EmptyString(pkgCache::PkgIterator const &); bool AlwaysTrue(pkgCache::PkgIterator const &); #endif
#include "CommandCalc.h" int myABS(int a) { if(a<0) a=-a; return a; } unsigned char CommandBuf[27]; void CommandCalc(int Thro,int Ptch ,int Roll) { int Pulse; if(Thro>10) Pulse=ThrottlePulseProp*Thro+ThrottlePulseOffset; else Pulse=ThrottlePulseOffset; if(Pulse>ThrottlePulseMAX) Pulse=ThrottlePulseMAX; sprintf(CommandBuf,"com%4d,,,",Pulse); if(Ptch<0) Ptch=0; Pulse=Flap1PulseOffset+PitchPulseProp*Ptch+RollPulseProp*Roll; if(Pulse>Flap1PulseMAX) Pulse=Flap1PulseMAX; if(Pulse<Flap1PulseOffset) Pulse=Flap1PulseOffset; sprintf((CommandBuf+10),"%4d,,,",Pulse); Pulse=Flap2PulseOffset+PitchPulseProp*Ptch-RollPulseProp*Roll; if(Pulse>Flap1PulseMAX) Pulse=Flap1PulseMAX; if(Pulse<Flap2PulseOffset) Pulse=Flap2PulseOffset; sprintf((CommandBuf+17),"%4dend%c%c%c",Pulse,'\0','\0','\0'); }
#ifndef ZCONTAINERWIDGET_H #define ZCONTAINERWIDGET_H #include <QString> #include <zui/zwidget.h> class ZContainerWidget : public ZWidget { public: ZContainerWidget(const ZConfig &el, QWidget *self); private: void parse(const ZConfig &el); }; #endif // ZCONTAINERWIDGET_H
#ifndef PTMODELGENERALSETTINGS_H #define PTMODELGENERALSETTINGS_H #include "PTModel.h" #include "attributes/PTPAttributeSprite.h" #include "attributes/PTPAttributeBoolean.h" #include "attributes/PTPAttributeEnum.h" typedef enum { PTObjectFrameEdgeStatePass = 0, PTObjectFrameEdgeStateBlock, PTObjectFrameEdgeStateKill, PTObjectFrameEdgeStateCount } PTObjectFrameEdgeState; typedef enum { PTPScreenOrientationLandscape = 0, PTPScreenOrientationPortrait, } PTPScreenOrientation; class PTModelGeneralSettings : public PTModel { public: PTModelGeneralSettings(); ~PTModelGeneralSettings(); static PTModelGeneralSettings* shared(); PTPScreenOrientation orientation(); float gameplayAngleDirection(); virtual void initWithDictionary( CCDictionary *dict ); virtual cocos2d::CCDictionary *getDictionary(); void assignGampePreset(CCDictionary* dict); unsigned int lastIdNumber; CCString *versionNumber; CCString *applicationName; CCString *nameOnDevice; CCString *bundleId; CCString *comments; float gameAngle; float gameSpeedMin; float gameSpeedMax; float gameSpeedCurrent; float gameSpeedIncrease; PTPAttributeSprite *iconAttribute; CCPoint moveSpeed() const; void setMoveSpeed(float x, float y); void setFixedRotation( bool fixedRotation ); bool isFixedRotation() const; void setFixedPosition( bool fixedPosition ); bool isFixedPosition() const; CCPoint upForce() const; void setUpForce( CCPoint value); float upForceDuration() const; void setUpForceDuration(float value); float upForceCounter() const; void setUpForceCounter(float value); float leftLeanForce() const; void setLeftLeanForce(float value); float rightLeanForce() const; void setRightLeanForce(float value); float simulationTimeScale(); void setSimulationTimeScale( float value); CCPoint characterFriction(); void setCharacterFriction( CCPoint value); float friction(); void setFriction( float value ); float velocityScale(); void setVelocityScale( float value ); void setRestitution( float ); float restitution() const; void setScoreMultiplier( float ); float scoreMultiplier() const; float platformFriction() const; bool autoImageDirection(); void setAutoImageDirection( bool autoImageDirection ); void setBounceForce( CCPoint value); CCPoint bounceForce(); bool isUpForceFromGround(); void setUpForceFromGround( bool upForceFromGround ); float rotationScale(); void setRotationScale( float rotationScale ); void setGravity( CCPoint value); CCPoint gravity(); void setObjectFrameRect( CCRect rect ); CCRect objectFrameRect(); PTObjectFrameEdgeState objectFrameEdgeState( int edgeIndex ); void setObjectFrameEdgeState(int edgeIndex, PTObjectFrameEdgeState state); static PTModel * create() { return new PTModelGeneralSettings(); } PTPAttributeString *gamePresetName; CCString *ibVersion() const; void setIbVersion(CCString *ibVersion); CCSize designResolution(); const char* platformValue(const std::string &platform, const std::string &key) const; void setPlatformValue(const std::string &platform, const std::string &key, const std::string &value); private: CCString *_ibVersion; PTPScreenOrientation _orientation; float _gameplayAngleDirection; CCSize _designResolution; PTPAttributePoint *_gravityAttribute; PTPAttributePoint *_moveSpeedAttribute; PTPAttributePoint *_bounceForceAttribute; PTPAttributePoint *_upForceAttribute; PTPAttributeFloat *_upForceDurationAttribute; PTPAttributeFloat *_upForceCounterAttribute; PTPAttributeFloat *_leftLeanForceAttribute; PTPAttributeFloat *_rightLeanForceAttribute; PTPAttributeFloat *_simulationTimeScaleAttribute; PTPAttributeFloat *_frictionAttribute; PTPAttributePoint *_characterFrictionAttribute; PTPAttributeFloat *_velocityScaleAttribute; PTPAttributeFloat *_rotationScaleAttribute; PTPAttributeFloat *_restitutionAttribute; PTPAttributeFloat *_platformFriction; PTPAttributeFloat *_scoreMultiplierAttribute; CCRect _objectFrameRect; PTObjectFrameEdgeState _objectFrameEdgeState[ 4 ]; PTPAttributeBoolean *_upForceFromGroundAttribute; PTPAttributeBoolean *_fixedRotationAttribute; PTPAttributeBoolean *_fixedPositionAttribute; PTPAttributeBoolean *_autoImageDirectionAttribute; CCDictionary* _platformSpecificValues; void dumpAttributes(); friend class PTPreferenceScreenGameplay; friend class PTPreferenceScreenProject; friend class PTPreferenceScreenFrame; }; #endif // PTMODELGENERALSETTINGS_H
/* * Moondust, a free game engine for platform game making * Copyright (c) 2014-2019 Vitaly Novichkov <admin@wohlnet.ru> * * This software is licensed under a dual license system (MIT or GPL version 3 or later). * This means you are free to choose with which of both licenses (MIT or GPL version 3 or later) * you want to use this software. * * 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. * * You can see text of MIT license in the LICENSE.mit file you can see in Engine folder, * or see https://mit-license.org/. * * You can see text of GPLv3 license in the LICENSE.gpl3 file you can see in Engine folder, * or see <http://www.gnu.org/licenses/>. */ #ifndef PGE_TextInputBox_H #define PGE_TextInputBox_H #include "pge_boxbase.h" #include "../scenes/scene.h" #include <graphics/gl_renderer.h> #include <graphics/gl_color.h> #include <common_features/rect.h> #include <common_features/point.h> #include <common_features/pointf.h> #include <common_features/size.h> #include <common_features/sizef.h> #include <controls/control_keys.h> #include <string> class Controller; class PGE_TextInputBox : public PGE_BoxBase { public: PGE_TextInputBox(); explicit PGE_TextInputBox(Scene * _parentScene = nullptr, std::string msg = "Message box is works!", msgType _type = msg_info, PGE_Point boxCenterPos = PGE_Point(-1,-1), double _padding = -1, std::string texture = std::string()); PGE_TextInputBox(const PGE_TextInputBox &mb); ~PGE_TextInputBox() override = default; void render() override; void restart() override; void processBox(double tickTime) override; void setInputText(std::string text); std::string inputText(); private: void construct(std::string msg = "Message box is works!", msgType _type = msg_info, PGE_Point pos = PGE_Point(-1,-1), double _padding = -1, std::string texture = ""); std::string m_inputTextSrc; std::string m_inputText; std::string m_inputTextPrintable; void updatePrintable(); Sint32 m_cursor = 0; Sint32 m_selectionLength = 0; int m_textInput_h_offset = 0; bool m_blinkShown = false; double m_blinkTimeout = 0; std::string message; }; #endif // PGE_TextInputBox_H
/* MandelUi_BigInt.view.h -- Experimental, WIP. Trying to get GMP rendering to be more efficient. Currently nonfunctional. :( My algebra needs work. Probably a lost cause anyway, but it's worth a try. */ #ifndef __FRACJACK_MandelUi_BigInt_view_H__ #define __FRACJACK_MandelUi_BigInt_view_H__ #include <gtkmm.h> #include "PropertyView.h" namespace Fracjack { class MandelUi_BigInt_View : public Gtk::Box, public PropertyView { public: MandelUi_BigInt_View(BaseObjectType* cobject, Glib::RefPtr<Gtk::Builder>& builder); virtual ~MandelUi_BigInt_View(); private: virtual void OnPropertyChange_Impl(PropertyChangeMessage const & message, bool undoing); }; } #endif /* __FRACJACK_MandelUi_BigInt_view_H__ */
/* * Copyright (C) 2013 Open Education Foundation * * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour * l'Education Numérique en Afrique (GIP ENA) * * This file is part of OpenBoard. * * OpenBoard is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License, * with a specific linking exception for the OpenSSL project's * "OpenSSL" library (or with modified versions of it that use the * same license as the "OpenSSL" library). * * OpenBoard 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 OpenBoard. If not, see <http://www.gnu.org/licenses/>. */ #ifndef UBDESKTOPPENPALETTE_H #define UBDESKTOPPENPALETTE_H #include <QtGui> #include <QResizeEvent> #include "gui/UBPropertyPalette.h" class UBRightPalette; class UBDesktopPropertyPalette : public UBPropertyPalette { Q_OBJECT public: UBDesktopPropertyPalette(QWidget *parent, UBRightPalette* _rightPalette); private: UBRightPalette* rightPalette; protected: virtual int getParentRightOffset(); }; class UBDesktopPenPalette : public UBDesktopPropertyPalette { Q_OBJECT public: UBDesktopPenPalette(QWidget *parent, UBRightPalette* rightPalette); virtual ~UBDesktopPenPalette(){} public slots: void onParentMinimized(); void onParentMaximized(); private slots: void onButtonReleased(); }; class UBDesktopEraserPalette : public UBDesktopPropertyPalette { public: UBDesktopEraserPalette(QWidget *parent, UBRightPalette* rightPalette); virtual ~UBDesktopEraserPalette(){} }; class UBDesktopMarkerPalette : public UBDesktopPropertyPalette { public: UBDesktopMarkerPalette(QWidget *parent, UBRightPalette* rightPalette); virtual ~UBDesktopMarkerPalette(){} }; #endif // UBDESKTOPPENPALETTE_H
#ifndef _LINUX_SNAPPY_H #define _LINUX_SNAPPY_H 1 #include <stddef.h> /* Only needed for compression. This preallocates the worst case */ struct snappy_env { unsigned short *hash_table; void *scratch; void *scratch_output; }; struct iovec; int snappy_init_env(struct snappy_env *env); int snappy_init_env_sg(struct snappy_env *env, int sg); void snappy_free_env(struct snappy_env *env); int snappy_uncompress_iov(struct iovec *iov_in, int iov_in_len, size_t input_len, char *uncompressed); int snappy_uncompress(const char *compressed, size_t n, char *uncompressed); int snappy_compress(struct snappy_env *env, const char *input, size_t input_length, char *compressed, size_t *compressed_length); int snappy_compress_iov(struct snappy_env *env, struct iovec *iov_in, int iov_in_len, size_t input_length, struct iovec *iov_out, int iov_out_len, size_t *compressed_length); int snappy_uncompressed_length(const char *buf, size_t len, size_t *result); size_t snappy_max_compressed_length(size_t source_len); #endif
//--------------------------------------------------------------------------- #ifndef bmpexportH #define bmpexportH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <Controls.hpp> #include <StdCtrls.hpp> #include <Forms.hpp> #include <ComCtrls.hpp> #include <Dialogs.hpp> //--------------------------------------------------------------------------- class TBmpParam : public TForm { __published: // IDE-managed Components TLabel *Label1; TEdit *FNameEdit; TLabel *Label2; TEdit *Edit2; TLabel *Label3; TEdit *Edit3; TLabel *Label4; TLabel *Label5; TLabel *Label6; TButton *Button1; TButton *Button2; TUpDown *MinKm; TUpDown *MaxKm; TLabel *Label7; TEdit *Edit7; TUpDown *PLen; TComboBox *ScaleL; TComboBox *ScaleX; TComboBox *Dpi; TCheckBox *AutoScale; TButton *Button3; TButton *Button4; TSaveDialog *SaveDialog1; TLabel *Label8; TEdit *Edit1; TUpDown *StartPage; void __fastcall Button3Click(TObject *Sender); void __fastcall ScaleLChange(TObject *Sender); void __fastcall Edit7Change(TObject *Sender); void __fastcall Button4Click(TObject *Sender); void __fastcall FNameEditExit(TObject *Sender); private: // User declarations String FFileName; void __fastcall SetFileName(String NewName); public: // User declarations __fastcall TBmpParam(TComponent* Owner); __property String FileName={read=FFileName}; }; //--------------------------------------------------------------------------- extern PACKAGE TBmpParam *BmpParam; //--------------------------------------------------------------------------- #endif
/* * (C) 2011 Varun Mittal <varunmittal91@gmail.com> * NeweraHPC program is distributed under the terms of the GNU General Public License v2 * * This file is part of NeweraHPC. * * NeweraHPC is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 2 of the License. * * NeweraHPC 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 NeweraHPC. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _ALLOC_H_ #define _ALLOC_H_ #include <errno.h> #ifdef linux #include <malloc.h> #endif #include <stdlib.h> #include "error.h" #include "strings_pool.h" using namespace neweraHPC; template <class T> T *alloc(size_t _size) { _size = sizeof(T) * _size; T *ptr; do{ ptr = (T *)malloc(_size); }while(ptr == NULL); return ptr; } #ifdef ENABLE_GARBAGE_COLLECTOR void *operator new(std::size_t size); void *operator new[](std::size_t size); void operator delete(void *ptr); void operator delete[](void *ptr); #endif #endif
/* mbed Microcontroller Library ******************************************************************************* * Copyright (c) 2014, Realtek Semiconductor Corp. * All rights reserved. * * This module is a confidential and proprietary property of RealTek and * possession or use of this module requires written permission of RealTek. ******************************************************************************* */ #include "device.h" #include "objects.h" #include "pinmap.h" //#include <rtl_lib.h> #if DEVICE_PWMOUT #ifdef CONFIG_PWM_EN #include "pwmout_api.h" static const PinMap PinMap_PWM[] = { {PB_4, RTL_PIN_PERI(PWM0, 0, S0), RTL_PIN_FUNC(PWM0, S0)}, {PB_5, RTL_PIN_PERI(PWM1, 1, S0), RTL_PIN_FUNC(PWM1, S0)}, {PB_6, RTL_PIN_PERI(PWM2, 2, S0), RTL_PIN_FUNC(PWM2, S0)}, {PB_7, RTL_PIN_PERI(PWM3, 3, S0), RTL_PIN_FUNC(PWM3, S0)}, {PC_0, RTL_PIN_PERI(PWM0, 0, S1), RTL_PIN_FUNC(PWM0, S1)}, {PC_1, RTL_PIN_PERI(PWM1, 1, S1), RTL_PIN_FUNC(PWM1, S1)}, {PC_2, RTL_PIN_PERI(PWM2, 2, S1), RTL_PIN_FUNC(PWM2, S1)}, {PC_3, RTL_PIN_PERI(PWM3, 3, S1), RTL_PIN_FUNC(PWM3, S1)}, {PD_3, RTL_PIN_PERI(PWM0, 0, S2), RTL_PIN_FUNC(PWM0, S2)}, {PD_4, RTL_PIN_PERI(PWM1, 1, S2), RTL_PIN_FUNC(PWM1, S2)}, {PD_5, RTL_PIN_PERI(PWM2, 2, S2), RTL_PIN_FUNC(PWM2, S2)}, {PD_6, RTL_PIN_PERI(PWM3, 3, S2), RTL_PIN_FUNC(PWM3, S2)}, {PE_0, RTL_PIN_PERI(PWM0, 0, S3), RTL_PIN_FUNC(PWM0, S3)}, {PE_1, RTL_PIN_PERI(PWM1, 1, S3), RTL_PIN_FUNC(PWM1, S3)}, {PE_2, RTL_PIN_PERI(PWM2, 2, S3), RTL_PIN_FUNC(PWM2, S3)}, {PE_3, RTL_PIN_PERI(PWM3, 3, S3), RTL_PIN_FUNC(PWM3, S3)}, {NC, NC, 0} }; void pwmout_init(pwmout_t* obj, PinName pin) { uint32_t peripheral; u32 pwm_idx; u32 pin_sel; DBG_PWM_INFO("%s: Init PWM for pin(0x%x)\n", __FUNCTION__, pin); // Get the peripheral name from the pin and assign it to the object peripheral = pinmap_peripheral(pin, PinMap_PWM); if (unlikely(peripheral == NC)) { DBG_PWM_ERR("%s: Cannot find matched pwm for this pin(0x%x)\n", __FUNCTION__, pin); return; } pwm_idx = RTL_GET_PERI_IDX(peripheral); pin_sel = RTL_GET_PERI_SEL(peripheral); obj->pwm_idx = pwm_idx; obj->pin_sel = pin_sel; obj->period = 0; obj->pulse = 0; _memset((void *)&obj->pwm_hal_adp, 0, sizeof(HAL_PWM_ADAPTER)); if (HAL_OK != HAL_Pwm_Init(&obj->pwm_hal_adp, pwm_idx, pin_sel)) { DBG_PWM_ERR("pwmout_init Err!\n"); return; } pwmout_period_us(obj, 20000); // 20 ms per default HAL_Pwm_Enable(&obj->pwm_hal_adp); } void pwmout_free(pwmout_t* obj) { HAL_Pwm_Disable(&obj->pwm_hal_adp); } void pwmout_write(pwmout_t* obj, float value) { if (value < (float)0.0) { value = 0.0; } else if (value > (float)1.0) { value = 1.0; } obj->pulse = (uint32_t)((float)obj->period * value); HAL_Pwm_SetDuty(&obj->pwm_hal_adp, obj->period, obj->pulse); } float pwmout_read(pwmout_t* obj) { float value = 0; if (obj->period > 0) { value = (float)(obj->pulse) / (float)(obj->period); } return ((value > (float)1.0) ? (float)(1.0) : (value)); } void pwmout_period(pwmout_t* obj, float seconds) { pwmout_period_us(obj, (int)(seconds * 1000000.0f)); } void pwmout_period_ms(pwmout_t* obj, int ms) { pwmout_period_us(obj, (int)(ms * 1000)); } void pwmout_period_us(pwmout_t* obj, int us) { float dc = pwmout_read(obj); obj->period = us; // Set duty cycle again pwmout_write(obj, dc); } void pwmout_pulsewidth(pwmout_t* obj, float seconds) { pwmout_pulsewidth_us(obj, (int)(seconds * 1000000.0f)); } void pwmout_pulsewidth_ms(pwmout_t* obj, int ms) { pwmout_pulsewidth_us(obj, ms * 1000); } void pwmout_pulsewidth_us(pwmout_t* obj, int us) { float value = (float)us / (float)obj->period; pwmout_write(obj, value); } #endif // #ifdef CONFIG_PWM_EN #endif
#include <linux/highmem.h> #include <linux/bootmem.h> #include <linux/crash_dump.h> #include <asm/uaccess.h> #include <linux/slab.h> static void *kdump_buf_page; /** * copy_oldmem_page - copy one page from "oldmem" * @pfn: page frame number to be copied * @buf: target memory address for the copy; this can be in kernel address * space or user address space (see @userbuf) * @csize: number of bytes to copy * @offset: offset in bytes into the page (based on pfn) to begin the copy * @userbuf: if set, @buf is in user address space, use copy_to_user(), * otherwise @buf is in kernel address space, use memcpy(). * * Copy a page from "oldmem". For this page, there is no pte mapped * in the current kernel. * * Calling copy_to_user() in atomic context is not desirable. Hence first * copying the data to a pre-allocated kernel page and then copying to user * space in non-atomic context. */ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) { void *vaddr; if (!csize) { return 0; } vaddr = kmap_atomic_pfn(pfn); if (!userbuf) { memcpy(buf, (vaddr + offset), csize); kunmap_atomic(vaddr); } else { if (!kdump_buf_page) { pr_warn("Kdump: Kdump buffer page not allocated\n"); return -EFAULT; } copy_page(kdump_buf_page, vaddr); kunmap_atomic(vaddr); if (copy_to_user(buf, (kdump_buf_page + offset), csize)) { return -EFAULT; } } return csize; } static int __init kdump_buf_page_init(void) { int ret = 0; kdump_buf_page = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!kdump_buf_page) { pr_warn("Kdump: Failed to allocate kdump buffer page\n"); ret = -ENOMEM; } return ret; } arch_initcall(kdump_buf_page_init);
/* === This file is part of Calamares - <https://calamares.io> === * * SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org> * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. * */ #ifndef PLASMALNF_THEMEINFO_H #define PLASMALNF_THEMEINFO_H #include <QAbstractListModel> #include <QList> #include <QString> class ThemeInfoList; class ThemesModel : public QAbstractListModel { Q_OBJECT public: enum { LabelRole = Qt::DisplayRole, KeyRole = Qt::UserRole, ShownRole, // Should theme be displayed SelectedRole, // Is theme selected DescriptionRole, ImageRole }; explicit ThemesModel( QObject* parent ); int rowCount( const QModelIndex& = QModelIndex() ) const override; QVariant data( const QModelIndex& index, int role ) const override; QHash< int, QByteArray > roleNames() const override; /// @brief Set the screenshot to go with the given @p id void setThemeImage( const QString& id, const QString& imagePath ); /// @brief Call setThemeImage( key, value ) for all keys in @p images void setThemeImage( const QMap< QString, QString >& images ); /// @brief Set whether to show the given theme @p id (or not) void showTheme( const QString& id, bool show = true ); /// @brief Shows the keys in the @p onlyThese map, and hides the rest void showOnlyThemes( const QMap< QString, QString >& onlyThese ); /** @brief Mark the @p themeId as current / selected * * One theme can be selected at a time; this will emit data * changed signals for any (one) theme already selected, and * the newly-selected theme. If @p themeId does not name any * theme, none are selected. */ void select( const QString& themeId ); /** @brief The size of theme Images * * The size is dependent on the font size used by Calamares, * and is constant within one run of Calamares, but may change * if the font settings do between runs. */ static QSize imageSize(); private: ThemeInfoList* m_themes; }; #endif
//****************************************************************************** //* File: RandomAccel2D.h //* Author: Jon Newman <jpnewman snail mit dot edu> //* //* Copyright (c) Jon Newman (jpnewman snail mit dot edu) //* All right reserved. //* This file is part of the Oat project. //* This 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 software 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 source code. If not, see <http://www.gnu.org/licenses/>. //***************************************************************************** #ifndef OAT_RANDOMACCEL2D_H #define OAT_RANDOMACCEL2D_H #include <chrono> #include <random> #include <string> #include <opencv2/core/mat.hpp> #include "../../lib/datatypes/Position2D.h" #include "PositionGenerator.h" namespace oat { class RandomAccel2D : public PositionGenerator { public: /** * A 2D Gaussian random acceleration generator. * Test positions are subject to random, uncorrelated 2D, Gaussian * accelerations. */ using PositionGenerator::PositionGenerator; private: // Configurable Interface po::options_description options() const override; void applyConfiguration(const po::variables_map &vm, const config::OptionTable &config_table) override; // Random number generator std::default_random_engine accel_generator_ {std::random_device{}()}; std::normal_distribution<double> accel_distribution_ {0.0, 100.0}; // Simulated position cv::Matx41d state_ {0.0, 0.0, 0.0, 0.0}; // Should be center of bounding region cv::Matx21d accel_vec_; // STM and input matrix cv::Matx44d state_transition_mat_; cv::Matx<double, 4, 2> input_mat_; bool generatePosition(oat::Position2D &position) override; void createStaticMatracies(void); void simulateMotion(void); }; } /* namespace oat */ #endif /* OAT_RANDOMACCEL2D_H */
#ifndef STRCONVS_H #define STRCONVS_H // Readers can ignore the implemnetations of to_string and stod // but can use these functions in their code. #include <iostream> #include <cstdlib> #include <cstddef> #include <string> // we use sprintf from stdio to implement to_string #include <cstdio> inline std::string to_string(int i) { char buf[100]; std::sprintf(buf, "%d", i); return buf; } inline double stod(const std::string &s, std::size_t * = 0) { char **buf = 0; return std::strtod(s.c_str(), buf); } /\r/\r/gendif
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef __RARCH_ZIP_SUPPORT_H #define __RARCH_ZIP_SUPPORT_H #ifdef __cplusplus extern "C" { #endif int read_zip_file(const char * archive_path, const char *relative_path, void **buf, const char* optional_outfile); struct string_list *compressed_zip_file_list_new(const char *path, const char* ext); #ifdef __cplusplus } #endif #endif
/****************************************************************************** * DAC Initialization for Kinetis K50 * * This application is using DAC0 ******************************************************************************/ #include "DAC.h" void DAC12_Vin_SWtrig(void) { SIM_SCGC2 |= SIM_SCGC2_DAC0_MASK; //Gives clock to DAC0 DAC0_DAT0H = 0x07; DAC0_DAT0L = 0xC1; /* DAC0_DAT0 = 0x07C1 for 1.6v according with the formula Vout = Vin*(1+DACDAT0[11:0])/4096 *!See Reference Manual for More information */ DAC0_C0 |= (DAC_C0_DACEN_MASK | DAC_C0_DACRFS_MASK); /* | | | ----------- VDDA as DAC Ref Voltaje (Vin) 3.3v -------------------------------- DAC0 is enabled *!See Reference Manual for more information */ }
#ifndef TQ_FADE_IN_ #define TQ_FADE_IN_ #include "tweaqapi.h" // time enum TimeType { Milliseconds = 0, Seconds, Samples, NumTimeTypes }; void to_samples(double& time, const TimeType timeType, const double samplerate); // curves typedef double (*CurveType)(const double); double curve_s(const double x); double curve_lin(const double x); double curve_log(const double x); double curve_exp(const double x); double curve_none(const double x); enum ParameterFields { kDuration, kTimeType, kCurveType, kNumParameters }; struct Input { CurveType fade; TimeType timeType; double fadeDuration; }; #ifdef __cplusplus extern "C" { #endif // def __cplusplus void fade_in_setup(const int fieldNumber, Parameter& p); void* fade_in_handleInput(int argc, const char* argv[]); bool fade_in_process(const char* pathin, const char* pathout, void* args); #ifdef __cplusplus } #endif // def __cplusplus #endif // TQ_FADE_IN_ defined
/*==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 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/>. Additional permissions under GNU GPL version 3 section 7 If you modify this Program, or any covered work, by linking or combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK (or a modified version of those libraries), containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL and IJG JPEG Library used as well as that of the covered work. You can contact Cyan Worlds, Inc. by email legal@cyan.com or by snail mail at: Cyan Worlds, Inc. 14617 N Newport Hwy Mead, WA 99021 *==LICENSE==*/ #ifndef plMsgForwarder_h_inc #define plMsgForwarder_h_inc #include "hsKeyedObject.h" #include "hsTemplates.h" #include "hsStlUtils.h" class plMessageWithCallbacks; class plForwardCallback; class plMsgForwarder : public hsKeyedObject { protected: hsTArray<plKey> fForwardKeys; typedef std::map<plMessage*, plForwardCallback*> CallbackMap; CallbackMap fCallbacks; void IForwardMsg(plMessage *msg); hsBool IForwardCallbackMsg(plMessage *msg); public: plMsgForwarder(); ~plMsgForwarder(); CLASSNAME_REGISTER(plMsgForwarder); GETINTERFACE_ANY(plMsgForwarder, hsKeyedObject); void Read(hsStream* s, hsResMgr* mgr); void Write(hsStream* s, hsResMgr* mgr); hsBool MsgReceive(plMessage* msg); void AddForwardKey(plKey key); }; #endif // plMsgForwarder_h_inc
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string> #include <unistd.h> #include <mysql.h> #include "Config.h" void InitDatabase(void); void WriteToDatabase(double T, double H, int L, int A);
//////////////////////////////////////////////////////////////////////////// // // DbaseInt.h // // Copyright (C) 2015 Brian M. Sutin, Skewray Research, LLC, www.skewray.com // Licensed under the GNU General Public License version 3: <http://www.gnu.org/licenses/gpl-3.0.html>. // // #include "dbase.h" #include "tree.h" #include <map> typedef std::map< TAG, DBDAT* > KeyTree ; typedef std::map< TAG, struct FOLDER* > Children ; struct FOLDER { TAG tag ; KeyTree keytree ; Children children ; TREE *kids ; int loaded ; // space here for disk info and time stamp... FOLDER() { tag = (TAG) 0 ; keytree = KeyTree() ; children = Children() ; kids = (TREE*) 0 ; loaded = 0 ; } // ~FOLDER() // { // keytree.~KeyTree() ; // double booking right now? // } void KeywordRead( const char* path ) ; // kwread.c bool EntryInsert( TAG tag, DBDAT* dbdat ) ; // entry.c DBDAT* EntryOverwrite( TAG tag, DBDAT* dbdat ) ; DBDAT* EntryFind( TAG tag ) ; } ; #define NULL_FOLDER ( (FOLDER*) 0 ) extern FOLDER DbaseRoot ; void DbaseLoadDir( char*, FOLDER* ) ; // from dir.c FOLDER* DbaseAddFolder( FOLDER*, TAG ) ; // dbase.c DBDAT* DbaseLookup( char*, TAG ) ; void PrintFolder( FOLDER* ) ;
#include "unpifi.h" int main(int argc, char **argv) { struct ifi_info *ifi, *ifihead; struct sockaddr *sa; u_char *ptr; int i, family, doaliases; if (argc != 3) err_quit("usage: prifinfo <inet4|inet6> <doaliases>"); if (strcmp(argv[1], "inet4") == 0) family = AF_INET; #ifdef IPV6 else if (strcmp(argv[1], "inet6") == 0) family = AF_INET6; #endif else err_quit("invalid <address-family>"); doaliases = atoi(argv[2]); for (ifihead = ifi = Get_ifi_info(family, doaliases); ifi != NULL; ifi = ifi->ifi_next) { printf("%s: <", ifi->ifi_name); /* *INDENT-OFF* */ if (ifi->ifi_flags & IFF_UP) printf("UP "); if (ifi->ifi_flags & IFF_BROADCAST) printf("BCAST "); if (ifi->ifi_flags & IFF_MULTICAST) printf("MCAST "); if (ifi->ifi_flags & IFF_LOOPBACK) printf("LOOP "); if (ifi->ifi_flags & IFF_POINTOPOINT) printf("P2P "); printf(">\n"); /* *INDENT-ON* */ if ( (i = ifi->ifi_hlen) > 0) { ptr = ifi->ifi_haddr; do { printf("%s%x", (i == ifi->ifi_hlen) ? " " : ":", *ptr++); } while (--i > 0); printf("\n"); } if ( (sa = ifi->ifi_addr) != NULL) printf(" IP addr: %s\n", Sock_ntop_host(sa, sizeof(*sa))); if ( (sa = ifi->ifi_brdaddr) != NULL) printf(" broadcast addr: %s\n", Sock_ntop_host(sa, sizeof(*sa))); if ( (sa = ifi->ifi_dstaddr) != NULL) printf(" destination addr: %s\n", Sock_ntop_host(sa, sizeof(*sa))); } free_ifi_info(ifihead); exit(0); }
static const char rcsid[]= "$Id: util.c,v 1.1.1.1 2005/08/09 19:13:37 rico Exp $"; #include <stdarg.h> #include "util.h" char *argv0; /* print_argv0 ---------------------------------------- print name of program */ void print_argv0(void) { if (argv0) { char *p = strrchr(argv0, '/'); (void)fprintf(stderr, "%s: ", p ? p+1 : argv0); } } /* fatal ---------------------------------------------- print message and die */ void fatal(const char *msg) { fatalf("%s", msg); } /* fatalf --------------------------------- format message, print it, and die */ void fatalf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); fflush(stdout); print_argv0(); (void)vfprintf(stderr, fmt, ap); (void)fputc('\n', stderr); va_end(ap); exit(1); } /* ckopen -------------------------------------- open file; check for success */ FILE *ckopen(const char *name, const char *mode) { FILE *fp; if ((fp = fopen(name, mode)) == NULL) fatalf("Cannot open %s.", name); return fp; } /* ckalloc -------------------------------- allocate space; check for success */ void *ckalloc(size_t amount) { void *p; if ((long)amount < 0) /* was "<= 0" -CR */ fatal("ckalloc: request for negative space."); if (amount == 0) amount = 1; /* ANSI portability hack */ if ((p = malloc(amount)) == NULL) fatalf("Ran out of memory trying to allocate %lu.", (unsigned long)amount); return p; } /* ckallocz -------------------- allocate space; zero fill; check for success */ void *ckallocz(size_t amount) { void *p = ckalloc(amount); memset(p, 0, amount); return p; } /* same_string ------------------ determine whether two strings are identical */ bool same_string(const char *s, const char *t) { return (strcmp(s, t) == 0); } /* starts ------------------------------ determine whether t is a prefix of s */ bool starts(const char *s, const char *t) { return (strncmp(s, t, strlen(t)) == 0); } /* skip_ws ------------------- find the first non-whitespace char in a string */ char *skip_ws(const char *s) { while (isspace(*s)) s++; return (char*)s; } /* copy_string ---------------------- save string s somewhere; return address */ char *copy_string(const char *s) { char *p = ckalloc(strlen(s)+1); /* +1 to hold '\0' */ return strcpy(p, s); } /* copy_substring ------------ save first n chars of string s; return address */ char *copy_substring(const char *s, int n) { char *p = ckalloc((size_t)n+1); /* +1 to hold '\0' */ memcpy(p, s, (size_t)n); p[n] = 0; return p; } void ckfree(void *p) { if (p) free(p); } unsigned int roundup(unsigned int n, unsigned int m) { return ((n+(m-1))/m) * m; } void fatalfr(const char *fmt, ...) { va_list ap; va_start(ap, fmt); fflush(stdout); print_argv0(); (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ": %s\n", strerror(errno)); va_end(ap); exit(1); } void *ckrealloc(void * p, size_t size) { p = p ? realloc(p, size) : malloc(size); if (!p) fatal("ckrealloc failed"); return p; } /* extract a one-word name from a FastA header line */ char *fasta_name(char *line) { char *buf, *s, *t; if (!line) return copy_string(""); if (strlen(line) == 0) return copy_string(""); if (line[0] != '>') fatal("missing FastA header line"); buf = copy_string(line); // find first token after '>' s = buf+1; while (strchr(" \t", *s)) ++s; while (!strchr(" \t\n\0", *s)) ++s; *s = '\0'; // trim trailing '|' while (s[-1] == '|') *--s = 0; // find last '|' delimited component while (!strchr(" \t>|", s[-1])) --s; t = copy_string(s); free(buf); return t; } void do_cmd(const char *fmt, ...) { char buf[10000]; va_list ap; va_start(ap, fmt); (void)vsprintf(buf, fmt, ap); (void)fprintf(stderr, "%s\n", buf); (void)fflush(stdout); if (system(buf) != 0) fatalf("Command '%s' failed", buf); va_end(ap); }
#ifndef _ASM_X86_STAT_H #define _ASM_X86_STAT_H #include <asm/posix_types.h> #define STAT_HAVE_NSEC 1 #ifdef __i386__ struct stat { unsigned long st_dev; unsigned long st_ino; unsigned short st_mode; unsigned short st_nlink; unsigned short st_uid; unsigned short st_gid; unsigned long st_rdev; unsigned long st_size; unsigned long st_blksize; unsigned long st_blocks; unsigned long st_atime; unsigned long st_atime_nsec; unsigned long st_mtime; unsigned long st_mtime_nsec; unsigned long st_ctime; unsigned long st_ctime_nsec; unsigned long __unused4; unsigned long __unused5; }; /* We don't need to memset the whole thing just to initialize the padding */ #define INIT_STRUCT_STAT_PADDING(st) do { \ st.__unused4 = 0; \ st.__unused5 = 0; \ } while (0) #define STAT64_HAS_BROKEN_ST_INO 1 /* This matches struct stat64 in glibc2.1, hence the absolutely * insane amounts of padding around dev_t's. */ struct stat64 { unsigned long long st_dev; unsigned char __pad0[4]; unsigned long __st_ino; unsigned int st_mode; unsigned int st_nlink; unsigned long st_uid; unsigned long st_gid; unsigned long long st_rdev; unsigned char __pad3[4]; long long st_size; unsigned long st_blksize; /* Number 512-byte blocks allocated. */ unsigned long long st_blocks; unsigned long st_atime; unsigned long st_atime_nsec; unsigned long st_mtime; unsigned int st_mtime_nsec; unsigned long st_ctime; unsigned long st_ctime_nsec; unsigned long long st_ino; }; /* We don't need to memset the whole thing just to initialize the padding */ #define INIT_STRUCT_STAT64_PADDING(st) do { \ memset(&st.__pad0, 0, sizeof(st.__pad0)); \ memset(&st.__pad3, 0, sizeof(st.__pad3)); \ } while (0) #else /* __i386__ */ struct stat { __kernel_ulong_t st_dev; __kernel_ulong_t st_ino; __kernel_ulong_t st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; unsigned int __pad0; __kernel_ulong_t st_rdev; __kernel_long_t st_size; __kernel_long_t st_blksize; __kernel_long_t st_blocks; /* Number 512-byte blocks allocated. */ __kernel_ulong_t st_atime; __kernel_ulong_t st_atime_nsec; __kernel_ulong_t st_mtime; __kernel_ulong_t st_mtime_nsec; __kernel_ulong_t st_ctime; __kernel_ulong_t st_ctime_nsec; __kernel_long_t __unused[3]; }; /* We don't need to memset the whole thing just to initialize the padding */ #define INIT_STRUCT_STAT_PADDING(st) do { \ st.__pad0 = 0; \ st.__unused[0] = 0; \ st.__unused[1] = 0; \ st.__unused[2] = 0; \ } while (0) #endif /* for 32bit emulation and 32 bit kernels */ struct __old_kernel_stat { unsigned short st_dev; unsigned short st_ino; unsigned short st_mode; unsigned short st_nlink; unsigned short st_uid; unsigned short st_gid; unsigned short st_rdev; #ifdef __i386__ unsigned long st_size; unsigned long st_atime; unsigned long st_mtime; unsigned long st_ctime; #else unsigned int st_size; unsigned int st_atime; unsigned int st_mtime; unsigned int st_ctime; #endif }; #endif /* _ASM_X86_STAT_H */
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <Foundation/Foundation.h> @class UIScrollView, UIView; @protocol UIScrollViewDelegate <NSObject> @optional - (void)scrollViewDidScrollToTop:(UIScrollView *)arg1; - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)arg1; - (void)scrollViewDidEndZooming:(UIScrollView *)arg1 withView:(UIView *)arg2 atScale:(float)arg3; - (void)scrollViewWillBeginZooming:(UIScrollView *)arg1 withView:(UIView *)arg2; - (UIView *)viewForZoomingInScrollView:(UIScrollView *)arg1; - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)arg1; - (void)scrollViewDidEndDecelerating:(UIScrollView *)arg1; - (void)scrollViewWillBeginDecelerating:(UIScrollView *)arg1; - (void)scrollViewDidEndDragging:(UIScrollView *)arg1 willDecelerate:(BOOL)arg2; - (void)scrollViewWillEndDragging:(UIScrollView *)arg1 withVelocity:(struct CGPoint)arg2 targetContentOffset:(inout struct CGPoint *)arg3; - (void)scrollViewWillBeginDragging:(UIScrollView *)arg1; - (void)scrollViewDidZoom:(UIScrollView *)arg1; - (void)scrollViewDidScroll:(UIScrollView *)arg1; @end
/****************************************************************************/ /// @file RORDLoader_TripDefs.h /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 /// @version $Id: RORDLoader_TripDefs.h 11671 2012-01-07 20:14:30Z behrisch $ /// // The basic class for loading trip definitions /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO 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. // /****************************************************************************/ #ifndef RORDLoader_TripDefs_h #define RORDLoader_TripDefs_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif #include <string> #include <utils/options/OptionsCont.h> #include <utils/common/IDSupplier.h> #include <utils/xml/SUMOXMLDefinitions.h> #include "ROTypedXMLRoutesLoader.h" #include "RONet.h" #include <utils/common/SUMOVehicleParameter.h> // =========================================================================== // class definitions // =========================================================================== /** * @class RORDLoader_TripDefs * A handler for route definitions which consists of the origin and the * destination edge only. Additionally, read vehicles may have information * about a certain position to leave from and a certain speed to leave with. */ class RORDLoader_TripDefs : public ROTypedXMLRoutesLoader { public: /// Constructor RORDLoader_TripDefs(RONet& net, SUMOTime begin, SUMOTime end, bool emptyDestinationsAllowed, bool withTaz, const std::string& file = "") ; /// Destructor ~RORDLoader_TripDefs() ; /// @name inherited from ROAbstractRouteDefLoader //@{ /** @brief Returns the time the current (last read) route starts at * * @return The least time step that was read by this reader */ SUMOTime getLastReadTimeStep() const { return myDepartureTime; } /// @} protected: /// @name inherited from GenericSAXHandler //@{ /** @brief Called on the opening of a tag; * * @param[in] element ID of the currently opened element * @param[in] attrs Attributes within the currently opened element * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ void myStartElement(int element, const SUMOSAXAttributes& attrs) ; /** @brief Called when a closing tag occurs * * @param[in] element ID of the currently opened element * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ void myEndElement(int element) ; //@} /// @name inherited from ROTypedXMLRoutesLoader /// @{ /** Returns the information whether a route was read * * @return Whether a further route was read * @see ROTypedXMLRoutesLoader::nextRouteRead */ bool nextRouteRead() { return myNextRouteRead; } /** @brief Returns Initialises the reading of a further route * * @todo recheck/refactor * @see ROTypedXMLRoutesLoader::beginNextRoute */ void beginNextRoute() ; //@} protected: /// Parses the vehicle id std::string getVehicleID(const SUMOSAXAttributes& attrs); /// Parses a named edge frm the attributes ROEdge* getEdge(const SUMOSAXAttributes& attrs, const std::string& purpose, SumoXMLAttr which, const std::string& id, bool emptyAllowed); protected: /// generates numerical ids IDSupplier myIdSupplier; /// The starting edge ROEdge* myBeginEdge; /// The end edge ROEdge* myEndEdge; /** @brief Information whether empty destinations are allowed This is a feature used for the handling of explicit routes within the jtrrouter where the destination is not necessary */ const bool myEmptyDestinationsAllowed; /// @brief Information whether zones (districts) are used as origins / destinations const bool myWithTaz; /// The information whether the next route was read bool myNextRouteRead; /// @brief The currently parsed vehicle type SUMOVTypeParameter* myCurrentVehicleType; SUMOVehicleParameter* myParameter; SUMOTime myDepartureTime; bool myHaveWarnedAboutDeprecatedTripDef; private: /// @brief Invalidated copy constructor RORDLoader_TripDefs(const RORDLoader_TripDefs& src); /// @brief Invalidated assignment operator RORDLoader_TripDefs& operator=(const RORDLoader_TripDefs& src); }; #endif /****************************************************************************/