text
stringlengths
4
6.14k
#include <stdlib.h> #include <stdio.h> #include "array_heap.h" int array_init(array* arr, int size) { arr->data = realloc(NULL, sizeof(void*) * size); if (0 == (size_t)arr->data) { return -1; } arr->length = size; arr->index = 0; return 0; } int array_push(array* arr, void* data) { ((size_t*)arr->data)[arr->index] = (size_t)data; arr->index += 1; if (arr->index >= arr->length) { if (-1 == array_grow(arr, arr->length * 2)) { return -1; } } return arr->index - 1; } int array_grow(array* arr, int size) { if (size <= arr->length) { return -1; } arr->data = realloc(arr->data, sizeof(void*) * size); if (-1 == (size_t)arr->data) { return -1; } arr->length = size; return 0; } void array_free(array* arr, void (*free_element)(void*)) { int i; for (i = 0; i < arr->index; i += 1) { free_element((void*)((size_t*)arr->data)[i]); } free(arr->data); arr->index = -1; arr->length = 0; arr->data = NULL; }
/* Fomalhaut Copyright (C) 2014 mtgto 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/>. */ #import <RoutingHTTPServer/RoutingConnection.h> @interface RoutingConnection (Secure) @end
// Copyright (c) 2018 - 2020, Marcin Drob // Kainote 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. // Kainote 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 Kainote. If not, see <http://www.gnu.org/licenses/>. #pragma once #include <wx/window.h> #include <wx/thread.h> //#define Get_Log LogHandler::Get() class LogWindow; class LogHandler { friend class LogWindow; private: LogHandler(wxWindow *parent); ~LogHandler(); static LogHandler *sthis; wxString logToAppend; wxString lastLog; LogWindow *lWindow = NULL; wxMutex mutex; wxWindow *parent; public: static void Create(wxWindow *parent); static LogHandler *Get(){ return sthis; } static void Destroy(); void LogMessage(const wxString &format, bool showMessage = true); static void ShowLogWindow(); //void LogMessage1(const wxString &format, ...); }; static void KaiLog(const wxString &text){ LogHandler * handler = LogHandler::Get(); if (handler) handler->LogMessage(text); } static void KaiLogSilent(const wxString &text) { LogHandler * handler = LogHandler::Get(); if (handler) handler->LogMessage(text, false); } static void KaiLogDebug(const wxString &text){ #if _DEBUG LogHandler * handler = LogHandler::Get(); if (handler) handler->LogMessage(text); #endif }
/* * Copyright 2011 Mect s.r.l * * This file is part of FarosPLC. * * FarosPLC 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. * * FarosPLC 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 * FarosPLC. If not, see http://www.gnu.org/licenses/. */ /* * Filename: BuildNr.h */ /* application build number: */ #define PRODUCT_BUILD 4001 /* EOF */
// // DetailViewController.h // ScrollView+PaperFold+PageControl // // Created by Jun Seki on 13/06/2014. // Copyright (c) 2014 Poq Studio. All rights reserved. // #import <UIKit/UIKit.h> #import "PaperFoldView.h" #import "SwipeView.h" @interface DetailViewController : UIViewController <UISplitViewControllerDelegate,PaperFoldViewDelegate,SwipeViewDataSource, SwipeViewDelegate> @property (strong, nonatomic) id detailItem; @property (nonatomic, strong) IBOutlet PaperFoldView *paperFoldView; @property (nonatomic, strong) UIView *topView; @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; @property (nonatomic, strong) IBOutlet SwipeView *swipeView; @property (nonatomic, strong) NSMutableArray *items; @end
/* * This file is part of gap. * * gap is free software: you can redistribute it and/or modify * under the terms of the GNU General Public License as published by * Free Software Foundation, either version 3 of the License, or * your option) any later version. * * gap is distributed in the hope that it will be useful, * WITHOUT ANY WARRANTY; without even the implied warranty of * CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with gap. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _OPT_H #define _OPT_H #include <assert.h> #define OPT_RELAX_CAPACITY 0 #define OPT_RELAX_CAPACITY_NAME "capacity" #define OPT_RELAX_QUANTITY 1 #define OPT_RELAX_QUANTITY_NAME "quantity" typedef struct { double alpha; char *file; int relax; int verbose; } Options; void opt_free (Options * opt); static inline double opt_get_alpha (Options * opt) { return opt->alpha; } static inline char * opt_get_file (Options * opt) { return opt->file; } static inline int opt_get_relax (Options * opt) { return opt->relax; } static inline int opt_get_verbose (Options * opt) { return opt->verbose; } Options *opt_new (); static inline void opt_set_alpha (Options * opt, double alpha) { opt->alpha = alpha; } static inline void opt_set_file (Options * opt, char *file) { opt->file = file; } static inline void opt_set_relax (Options * opt, int relax) { opt->relax = relax; } static inline void opt_set_verbose (Options * opt, int verbose) { opt->verbose = verbose; } #endif
// Copyright 2020 ETH Zurich. All Rights Reserved. #pragma once #include "real.h" #include <mirheo/core/mesh/membrane.h> #include <mirheo/core/pvs/object_vector.h> #include <mirheo/core/pvs/views/ov.h> #include <mirheo/core/utils/cpu_gpu_defines.h> #include <mirheo/core/utils/cuda_common.h> #include <mirheo/core/utils/cuda_rng.h> namespace mirheo { /** Compute triangle area \param [in] v0 Vertex coordinates \param [in] v1 Vertex coordinates \param [in] v2 Vertex coordinates \return The triangle area */ __D__ inline mReal triangleArea(mReal3 v0, mReal3 v1, mReal3 v2) { return 0.5_mr * length(cross(v1 - v0, v2 - v0)); } /** Compute the volume of the tetrahedron spanned by the origin and the three input coordinates. The result is negative if the normal of the triangle points inside the tetrahedron. \param [in] v0 Vertex coordinates \param [in] v1 Vertex coordinates \param [in] v2 Vertex coordinates \return The signed volume of the tetrahedron */ __D__ inline mReal triangleSignedVolume(mReal3 v0, mReal3 v1, mReal3 v2) { return 0.1666666667_mr * (- v0.z*v1.y*v2.x + v0.z*v1.x*v2.y + v0.y*v1.z*v2.x - v0.x*v1.z*v2.y - v0.y*v1.x*v2.z + v0.x*v1.y*v2.z); } /** Compute the angle between two adjacent triangles. It is the positive angle between the two normals. \param [in] v0 Vertex coordinates \param [in] v1 Vertex coordinates \param [in] v2 Vertex coordinates \param [in] v3 Vertex coordinates \return The supplementary dihedral angle */ __D__ inline mReal supplementaryDihedralAngle(mReal3 v0, mReal3 v1, mReal3 v2, mReal3 v3) { /* v3 / \ v2 --- v0 \ / V v1 dihedral: 0123 */ mReal3 n, k, nk; n = cross(v1 - v0, v2 - v0); k = cross(v2 - v0, v3 - v0); nk = cross(n, k); mReal theta = atan2(length(nk), dot(n, k)); theta = dot(v2-v0, nk) < 0 ? theta : -theta; return theta; } } // namespace mirheo
/* * Copyright (C) 2006-2009 Daniel Prevost <[email protected]> * * This file is part of Photon (photonsoftware.org). * * This file may be distributed and/or modified under the terms of the * GNU General Public License version 2 or version 3 as published by the * Free Software Foundation and appearing in the file COPYING.GPL2 and * COPYING.GPL3 included in the packaging of this software. * * Licensees holding a valid Photon Commercial license can use this file * in accordance with the terms of their license. * * 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. */ /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ #include "Common/Options.h" #include "Tests/PrintError.h" const bool expectedToPass = false; /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ int main() { #if defined(USE_DBC) int errcode = 0; char dummyArgs[100]; char *dummyPtrs[10]; psocOptionHandle handle; bool ok; struct psocOptStruct opts[5] = { { '3', "three", 1, "", "repeat the loop three times" }, { 'a', "address", 0, "QUASAR_ADDRESS", "tcp/ip port number of the server" }, { 'x', "", 1, "DISPLAY", "X display to use" }, { 'v', "verbose", 1, "", "try to explain what is going on" }, { 'z', "zzz", 1, "", "go to sleep..." } }; ok = psocSetSupportedOptions( 5, opts, &handle ); if ( ok != true ) { ERROR_EXIT( expectedToPass, NULL, ; ); } strcpy( dummyArgs, "OptionTest2 --address 12345 -v --zzz" ); /* 012345678901234567890123456789012345 */ dummyPtrs[0] = dummyArgs; dummyPtrs[1] = &dummyArgs[12]; dummyPtrs[2] = &dummyArgs[22]; dummyPtrs[3] = &dummyArgs[28]; dummyPtrs[4] = &dummyArgs[31]; dummyArgs[11] = 0; dummyArgs[21] = 0; dummyArgs[27] = 0; dummyArgs[30] = 0; errcode = psocValidateUserOptions( handle, 5, dummyPtrs, 1 ); if ( errcode != 0 ) { ERROR_EXIT( expectedToPass, NULL, ; ); } psocIsShortOptPresent( NULL, 'a' ); ERROR_EXIT( expectedToPass, NULL, ; ); #else return 1; #endif } /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
/* ============================================================ * QupZilla - WebKit based browser * Copyright (C) 2010-2014 David Rosca <[email protected]> * * 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 ADBLOCKICON_H #define ADBLOCKICON_H #include "qzcommon.h" #include "clickablelabel.h" #include "adblockrule.h" class QMenu; class QUrl; class BrowserWindow; class QUPZILLA_EXPORT AdBlockIcon : public ClickableLabel { Q_OBJECT public: explicit AdBlockIcon(BrowserWindow* window, QWidget* parent = 0); ~AdBlockIcon(); void popupBlocked(const QString &ruleString, const QUrl &url); QAction* menuAction(); public slots: void setEnabled(bool enabled); void createMenu(QMenu* menu = 0); private slots: void showMenu(const QPoint &pos); void toggleCustomFilter(); void animateIcon(); void stopAnimation(); private: BrowserWindow* m_window; QAction* m_menuAction; QVector<QPair<AdBlockRule*, QUrl> > m_blockedPopups; QTimer* m_flashTimer; int m_timerTicks; bool m_enabled; }; #endif // ADBLOCKICON_H
/* -*- c++ -*- */ /* * Copyright 2019-2020 Daniel Estevez <[email protected]> * * This file is part of gr-satellites * * SPDX-License-Identifier: GPL-3.0-or-later * */ #ifndef INCLUDED_SATELLITES_DISTRIBUTED_SYNCFRAME_SOFT_IMPL_H #define INCLUDED_SATELLITES_DISTRIBUTED_SYNCFRAME_SOFT_IMPL_H #include <satellites/distributed_syncframe_soft.h> #include <vector> namespace gr { namespace satellites { class distributed_syncframe_soft_impl : public distributed_syncframe_soft { private: const size_t d_threshold; const size_t d_step; std::vector<uint8_t> d_syncword; public: distributed_syncframe_soft_impl(int threshold, const std::string& syncword, int step); ~distributed_syncframe_soft_impl(); // Where all the action really happens int work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); }; } // namespace satellites } // namespace gr #endif /* INCLUDED_SATELLITES_DISTRIBUTED_SYNCFRAME_SOFT_IMPL_H */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* This file is part of the program and library */ /* SCIP --- Solving Constraint Integer Programs */ /* */ /* Copyright (C) 2002-2018 Konrad-Zuse-Zentrum */ /* fuer Informationstechnik Berlin */ /* */ /* SCIP is distributed under the terms of the ZIB Academic License. */ /* */ /* You should have received a copy of the ZIB Academic License */ /* along with SCIP; see the file COPYING. If not email to [email protected]. */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /**@file struct_concsolver.h * @ingroup INTERNALAPI * @brief datastructures for concurrent solvers * @author Robert Lion Gottwald */ /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ #ifndef __SCIP_STRUCT_CONCSOLVER_H__ #define __SCIP_STRUCT_CONCSOLVER_H__ #include "scip/def.h" #include "scip/type_concsolver.h" #include "scip/type_clock.h" #ifdef __cplusplus extern "C" { #endif /** concurrent solver data structure */ struct SCIP_ConcSolverType { int ninstances; /**< number of instances created from this concurrent solver type */ SCIP_Real prefprio; /**< the weight of the concurrent */ char* name; /**< name of concurrent solver */ SCIP_CONCSOLVERTYPEDATA* data; /**< user data of concurrent solver type */ SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)); /**< creates an instance of the concurrent solver */ SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)); /**< destroys an instance of the concurrent solver */ SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)); /**< initialize random seeds of concurrent solver */ SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)); /**< execution method of concurrent solver */ SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata));/**< copies the solving data */ SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)); /**< terminate solving in concurrent solver */ SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)); /**< synchronization method of concurrent solver for sharing it's data */ SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)); /**< synchronization method of concurrent solver for reading shared data */ SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata));/**< frees user data of concurrent solver type */ }; /** concurrent solver data structure */ struct SCIP_ConcSolver { SCIP_CONCSOLVERTYPE* type; /**< type of this concurrent solver */ int idx; /**< index of initialized exernal solver */ char* name; /**< name of concurrent solver */ SCIP_CONCSOLVERDATA* data; /**< user data of concurrent solver */ SCIP_SYNCDATA* syncdata; /**< most recent synchronization data that has been read */ SCIP_Longint nsyncs; /**< total number of synchronizations */ SCIP_Real timesincelastsync; /**< time since the last synchronization */ SCIP_Real syncdelay; /**< current delay of synchronization data */ SCIP_Real syncfreq; /**< current synchronization frequency of the concurrent solver */ SCIP_Real solvingtime; /**< solving time with wall clock */ SCIP_Bool stopped; /**< flag to store if the concurrent solver has been stopped * through the SCIPconcsolverStop function */ SCIP_Longint nlpiterations; /**< number of lp iterations the concurrent solver used */ SCIP_Longint nnodes; /**< number of nodes the concurrent solver used */ SCIP_Longint nsolsrecvd; /**< number of solutions the concurrent solver received */ SCIP_Longint nsolsshared; /**< number of solutions the concurrent solver found */ SCIP_Longint ntighterbnds; /**< number of tighter global variable bounds the concurrent solver received */ SCIP_Longint ntighterintbnds; /**< number of tighter global variable bounds the concurrent solver received * on integer variables */ SCIP_CLOCK* totalsynctime; /**< total time used for synchronization, including idle time */ }; #ifdef __cplusplus } #endif #endif
#pragma once #include "storm/storage/memorystructure/NondeterministicMemoryStructure.h" namespace storm { namespace storage { enum class NondeterministicMemoryStructurePattern { Trivial, FixedCounter, SelectiveCounter, FixedRing, SelectiveRing, SettableBits, Full }; std::string toString(NondeterministicMemoryStructurePattern const& pattern); class NondeterministicMemoryStructureBuilder { public: // Builds a memory structure with the given pattern and the given number of states. NondeterministicMemoryStructure build(NondeterministicMemoryStructurePattern pattern, uint64_t numStates) const; // Builds a memory structure that consists of just a single memory state NondeterministicMemoryStructure buildTrivialMemory() const; // Builds a memory structure that consists of a chain of the given number of states. // Every state has exactly one transition to the next state. The last state has just a selfloop. NondeterministicMemoryStructure buildFixedCountingMemory(uint64_t numStates) const; // Builds a memory structure that consists of a chain of the given number of states. // Every state has a selfloop and a transition to the next state. The last state just has a selfloop. NondeterministicMemoryStructure buildSelectiveCountingMemory(uint64_t numStates) const; // Builds a memory structure that consists of a ring of the given number of states. // Every state has a transition to the successor state NondeterministicMemoryStructure buildFixedRingMemory(uint64_t numStates) const; // Builds a memory structure that consists of a ring of the given number of states. // Every state has a transition to the successor state and a selfloop NondeterministicMemoryStructure buildSelectiveRingMemory(uint64_t numStates) const; // Builds a memory structure that represents floor(log(numStates)) bits that can only be set from zero to one or from zero to zero. NondeterministicMemoryStructure buildSettableBitsMemory(uint64_t numStates) const; // Builds a memory structure that consists of the given number of states which are fully connected. NondeterministicMemoryStructure buildFullyConnectedMemory(uint64_t numStates) const; }; } // namespace storage } // namespace storm
/***************************************************************************** The Dark Mod GPL Source Code This file is part of the The Dark Mod Source Code, originally based on the Doom 3 GPL Source Code as published in 2011. The Dark Mod Source Code 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. For details, see LICENSE.TXT. Project: The Dark Mod (http://www.thedarkmod.com/) $Revision: 6569 $ (Revision of last commit) $Date: 2016-01-10 23:52:55 +0000 (Sun, 10 Jan 2016) $ (Date of last commit) $Author: grayman $ (Author of last commit) ******************************************************************************/ #ifndef _HTTP_REQUEST_H_ #define _HTTP_REQUEST_H_ #include <fstream> #include <boost/shared_ptr.hpp> class CHttpConnection; #include "../pugixml/pugixml.hpp" typedef void CURL; // Shared_ptr typedef typedef boost::shared_ptr<pugi::xml_document> XmlDocumentPtr; /** * greebo: An object representing a single HttpRequest, holding * the result (string) and status information. * * Use the Perform() method to execute the request. */ class CHttpRequest { public: enum RequestStatus { NOT_PERFORMED_YET, OK, // successful IN_PROGRESS, FAILED, ABORTED, }; private: // The connection we're working with CHttpConnection& _conn; // The URL we're supposed to query std::string _url; std::vector<char> _buffer; // The curl handle CURL* _handle; // The current state RequestStatus _status; std::string _destFilename; std::ofstream _destStream; // True if we should cancel the download bool _cancelFlag; double _progress; public: CHttpRequest(CHttpConnection& conn, const std::string& url); CHttpRequest(CHttpConnection& conn, const std::string& url, const std::string& destFilename); // Callbacks for CURL static size_t WriteMemoryCallback(void* ptr, size_t size, size_t nmemb, CHttpRequest* self); static size_t WriteFileCallback(void* ptr, size_t size, size_t nmemb, CHttpRequest* self); static int CHttpRequest::TDMHttpProgressFunc(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); RequestStatus GetStatus(); // Perform the request void Perform(); void Cancel(); // Between 0.0 and 1.0 double GetProgressFraction(); // Returns the result string std::string GetResultString(); // Returns the result as XML document XmlDocumentPtr GetResultXml(); private: void InitRequest(); void UpdateProgress(); }; typedef boost::shared_ptr<CHttpRequest> CHttpRequestPtr; #endif /* _HTTP_REQUEST_H_ */
#pragma once #ifndef ENGINE_MESH_SKELETON_H #define ENGINE_MESH_SKELETON_H class Mesh; class SMSH_File; struct MeshCPUData; struct MeshNodeData; struct MeshRequest; namespace Engine::priv { class PublicMesh; class MeshImportedData; class MeshLoader; class ModelInstanceAnimation; class ModelInstanceAnimationContainer; }; #include <serenity/resources/mesh/animation/AnimationData.h> #include <serenity/system/Macros.h> #include <serenity/utils/Utils.h> namespace Engine::priv { class MeshSkeleton final { friend class ::Mesh; friend struct ::MeshCPUData; friend class ::SMSH_File; friend class Engine::priv::MeshLoader; friend class Engine::priv::AnimationData; friend class Engine::priv::PublicMesh; friend class Engine::priv::ModelInstanceAnimation; friend class Engine::priv::ModelInstanceAnimationContainer; public: using AnimationDataMap = Engine::unordered_string_map<std::string, uint16_t>; private: AnimationDataMap m_AnimationMapping; //maps an animation name to its data glm::mat4 m_GlobalInverseTransform = glm::mat4{ 1.0f }; std::vector<BoneInfo> m_BoneInfo; std::vector<AnimationData> m_AnimationData; void clear() noexcept { m_GlobalInverseTransform = glm::mat4{ 1.0f }; } template<typename ... ARGS> int internal_add_animation_impl(std::string_view animName, ARGS&&... args) { if (hasAnimation(animName)) { return -1; } const uint16_t index = static_cast<uint16_t>(m_AnimationData.size()); m_AnimationMapping.emplace(std::piecewise_construct, std::forward_as_tuple(animName), std::forward_as_tuple(index)); m_AnimationData.emplace_back(std::forward<ARGS>(args)...); ENGINE_PRODUCTION_LOG("Added animation: " << animName); return index; } public: MeshSkeleton() = default; MeshSkeleton(const aiMesh&, const aiScene&, MeshRequest&, Engine::priv::MeshImportedData&); MeshSkeleton(const MeshSkeleton&) = delete; MeshSkeleton& operator=(const MeshSkeleton&) = delete; MeshSkeleton(MeshSkeleton&&) noexcept = default; MeshSkeleton& operator=(MeshSkeleton&&) = default; [[nodiscard]] inline AnimationDataMap& getAnimationData() noexcept { return m_AnimationMapping; } [[nodiscard]] inline uint16_t numBones() const noexcept { return (uint16_t)m_BoneInfo.size(); } [[nodiscard]] inline uint32_t numAnimations() const noexcept { return (uint32_t)m_AnimationData.size(); } [[nodiscard]] inline bool hasAnimation(std::string_view animName) const noexcept { return m_AnimationMapping.contains(animName); } inline void setBoneOffsetMatrix(uint16_t boneIdx, glm::mat4&& matrix) noexcept { m_BoneInfo[boneIdx].BoneOffset = std::move(matrix); } inline uint16_t getAnimationIndex(std::string_view animName) const noexcept { return m_AnimationMapping.find(animName)->second; } int addAnimation(std::string_view animName, const aiAnimation& anim, MeshRequest& request) { return internal_add_animation_impl(animName, anim, request); } int addAnimation(std::string_view animName, AnimationData&& animationData) { return internal_add_animation_impl(animName, std::move(animationData)); } }; }; #endif
/* dx2vtk: OpenDX to VTK file format converter * Copyright (C) 2015 David J. Warne * * 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/>. */ /** * @file vtkFileWriter.h * @brief Writes a vtk data file using the legacy format * * @details This library implements a light weight legacy vtk * format writer. This is intended to be used as a part of the * dx2vtk program. * * @author David J. Warne ([email protected]) * @author High Performance Computing and Research Support * @author Queensland University of Technology * */ #ifndef __VTKFILEWRITER_H #define __VTKFILEWRITER_H #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <endian.h> /*data types*/ #define VTK_ASCII 0 #define VTK_BINARY 1 #define H2BE32(buf,size) \ { \ int iii; \ uint32_t * buf32; \ buf32 = (uint32_t *)(buf); \ for(iii=0;iii<(size);iii++) \ { \ buf32[iii] = htobe32(buf32[iii]); \ } \ } \ #define BE2H32(buf,size) \ { \ int iii; \ uint32_t * buf32; \ buf32 = (uint32_t *)(buf); \ for(iii=0;iii<(size);iii++) \ { \ buf32[iii] = be32toh(buf32[iii]); \ } \ } \ /*geometry*/ #define VTK_STRUCTURED_POINTS 0 #define VTK_STRUCTURED_GRID 1 #define VTK_UNSTRUCTURED_GRID 2 #define VTK_POLYDATA 3 #define VTK_RECTILINEAR_GRID 4 #define VTK_FIELD 5 #define VTK_VERTEX 1 #define VTK_POLY_VERTEX 2 #define VTK_LINE 3 #define VTK_POLY_LINE 4 #define VTK_TRIANGLE 5 #define VTK_TRIANGLE_STRIP 6 #define VTK_POLYGON 7 #define VTK_PIXEL 8 #define VTK_QUAD 9 #define VTK_TETRA 10 #define VTK_VOXEL 11 #define VTK_HEXAHEDRON 12 #define VTK_WEDGE 13 #define VTK_PYRAMID 14 #define VTK_QUADRATIC_EDGE 21 #define VTK_QUADRATIC_TRIANGLE 22 #define VTK_QUADRATIC_QUAD 23 #define VTK_QUADRATIC_TETRA 24 #define VTK_QUADRATIC_HEXAHEDRON 25 #define VTK_VERSION "4.2" #define VTK_TITLE_LENGTH 256 #define VTK_DIM 3 #define VTK_INT 0 #define VTK_FLOAT 1 #define VTK_SUCCESS 1 #define VTK_MEMORY_ERROR 0 #define VTK_FILE_NOT_FOUND_ERROR -1 #define VTK_INVALID_FILE_ERROR -2 #define VTK_NOT_SUPPORTED_ERROR -3 #define VTK_INVALID_USAGE_ERROR -4 #define VTK_NOT_IMPLEMENTED_YET_ERROR -5 #define VTK_FILE_ERROR -6 #ifndef VTK_TYPE_DEFAULT #define VTK_TYPE_DEFAULT VTK_ASCII #endif typedef struct vtkDataFile_struct vtkDataFile; typedef struct unstructuredGrid_struct unstructuredGrid; typedef struct structuredPoints_struct structuredPoints; typedef struct polydata_struct polydata; typedef struct vtkData_struct vtkData; typedef struct scalar_struct scalar; typedef struct vector_struct vector; struct scalar_struct { char name[32]; int type; void * data; }; struct vector_struct { char name[32]; int type; void *data; }; struct vtkData_struct { int numScalars; int numColorScalars; int numLookupTables; int numVectors; int numNormals; int numTextureCoords; int numTensors; int numFields; int size; /** @todo for now only support scalars and vectors */ scalar *scalar_data; vector *vector_data; }; struct vtkDataFile_struct { FILE *fp; char vtkVersion[4]; /*header version*/ char title[VTK_TITLE_LENGTH]; /**/ unsigned char dataType; unsigned char geometry; void * dataset; vtkData * pointdata; vtkData * celldata; }; struct structuredPoints_struct { int dimensions[VTK_DIM]; float origin[VTK_DIM]; float spacing[VTK_DIM]; }; struct structuredGrid_struct { int dimensions[VTK_DIM]; int numPoints; float *points; // numpoints*3; }; struct polydata_struct{ int numPoints; float * points; int numPolygons; int *numVerts; int *polygons; }; struct rectilinearGrid_struct{ int dimensions[VTK_DIM]; int numX; int numY; int numZ; float *X_coordinates; float *Y_coordinates; float *Z_coordinates; }; struct unstructuredGrid_struct{ int numPoints; float * points; int numCells; int cellSize; int *cells; int *numVerts; int *cellTypes; }; /*function prototypes */ int VTK_Open(vtkDataFile *file, char * filename); int VTK_Write(vtkDataFile *file); int VTK_WriteUnstructuredGrid(FILE *fp,unstructuredGrid *ug,char type); int VTK_WritePolydata(FILE *fp,polydata *pd,char type); int VTK_WriteStructuredPoints(FILE *fp,structuredPoints *sp,char type); int VTK_WriteData(FILE *fp,vtkData *data,char type); int VTK_Close(vtkDataFile*file); #endif
/* * Copyright (C) ST-Ericsson SA 2010 * * License Terms: GNU General Public License v2 * Author: Naveen Kumar Gaddipati <[email protected]> * * ux500 Scroll key and Keypad Encoder (SKE) header */ #ifndef __SKE_H #define __SKE_H #include <linux/input/matrix_keypad.h> /* register definitions for SKE peripheral */ #define SKE_CR 0x00 #define SKE_VAL0 0x04 #define SKE_VAL1 0x08 #define SKE_DBCR 0x0C #define SKE_IMSC 0x10 #define SKE_RIS 0x14 #define SKE_MIS 0x18 #define SKE_ICR 0x1C /* * Keypad module */ /** * struct keypad_platform_data - structure for platform specific data * @init: pointer to keypad init function * @exit: pointer to keypad deinitialisation function * @keymap_data: matrix scan code table for keycodes * @krow: maximum number of rows * @kcol: maximum number of columns * @debounce_ms: platform specific debounce time * @no_autorepeat: flag for auto repetition * @wakeup_enable: allow waking up the system */ struct ske_keypad_platform_data { int (*init)(void); int (*exit)(void); const struct matrix_keymap_data *keymap_data; u8 krow; u8 kcol; u8 debounce_ms; bool no_autorepeat; bool wakeup_enable; }; #endif /*__SKE_KPD_H*/
// // MSGRTickConnection.h // wehuibao // // Created by Ke Zeng on 13-6-20. // Copyright (c) 2013年 Zeng Ke. All rights reserved. // #import <Foundation/Foundation.h> typedef enum { MSGRTickConnectionStateNotConnected=0, MSGRTickConnectionStateConnecting, MSGRTickConnectionStateConnected, MSGRTickConnectionStateClosed, MSGRTickConnectionStateError } MSGRTickConnectionState; @class MSGRTickConnection; @protocol MSGRTickConnectionDelegate <NSObject> @optional - (void)connectionLost:(MSGRTickConnection *)connection; - (void)connection:(MSGRTickConnection *)connection error:(NSError *)error; @required - (void)connectionEstablished:(MSGRTickConnection *)connection; - (void)connection:(MSGRTickConnection *)connection receivedPacket:(id)packet withDirective:(NSString *)directive; @end @interface MSGRTickConnection: NSObject<NSStreamDelegate> @property (nonatomic) MSGRTickConnectionState state; @property (nonatomic) BOOL loginOK; @property (nonatomic, weak) id<MSGRTickConnectionDelegate> delegate; - (void)connect; - (void)close; - (void)sendPacket:(id)packet directive:(NSString *)directive; @end
#include "report_mib_feature.h" #include "mib_feature_definition.h" #include "report_manager.h" #include "protocol.h" #include "bus_slave.h" #include "momo_config.h" #include "report_log.h" #include "report_comm_stream.h" #include "system_log.h" #include <string.h> #define BASE64_REPORT_MAX_LENGTH 160 //( 4 * ( ( RAW_REPORT_MAX_LENGTH + 2 ) / 3) ) extern char base64_report_buffer[BASE64_REPORT_MAX_LENGTH+1]; static void start_scheduled_reporting(void) { set_momo_state_flag( kStateFlagReportingEnabled, true ); start_report_scheduling(); } static void stop_scheduled_reporting(void) { set_momo_state_flag( kStateFlagReportingEnabled, false ); stop_report_scheduling(); } static void get_scheduled_reporting(void) { bus_slave_return_int16( get_momo_state_flag( kStateFlagReportingEnabled ) ); } static void send_report(void) { taskloop_add( post_report, NULL ); } static void set_reporting_interval(void) { set_report_scheduling_interval( plist_get_int16(0) ); } static void get_reporting_interval(void) { bus_slave_return_int16( current_momo_state.report_config.report_interval ); } static void set_reporting_route(void) { update_report_route( (plist_get_int16(0) >> 8) & 0xFF , plist_get_int16(0) & 0xFF , (const char*)plist_get_buffer(1) , plist_get_buffer_length() ); } static void get_reporting_route(void) { const char* route = get_report_route( ( plist_get_int16(0) >> 8 ) & 0xFF ); if ( !route ) { bus_slave_seterror( kUnknownError ); return; } uint8 start = plist_get_int16(0) & 0xFF; uint8 len = strlen( route ) - start; if ( len < 0 ) { bus_slave_seterror( kCallbackError ); return; } if ( len > kBusMaxMessageSize ) len = kBusMaxMessageSize; bus_slave_return_buffer( route + start, len ); } static void set_reporting_apn(void) { set_gprs_apn( (const char*)plist_get_buffer(0), plist_get_buffer_length() ); } static void get_reporting_apn(void) { bus_slave_return_buffer( current_momo_state.report_config.gprs_apn, strlen(current_momo_state.report_config.gprs_apn) ); } static void set_reporting_flags(void) { current_momo_state.report_config.report_flags = plist_get_int16(0); } static void get_reporting_flags(void) { bus_slave_return_int16( current_momo_state.report_config.report_flags ); } static void set_reporting_aggregates(void) { current_momo_state.report_config.bulk_aggregates = plist_get_int16(0); current_momo_state.report_config.interval_aggregates = plist_get_int16(1); } static void get_reporting_aggregates(void) { plist_set_int16( 0, current_momo_state.report_config.bulk_aggregates ); plist_set_int16( 1, current_momo_state.report_config.interval_aggregates ); bus_slave_setreturn( pack_return_status( kNoMIBError, 4 ) ); } static void build_report() { construct_report(); } static void get_report() { uint16 offset = plist_get_int16(0); memcpy(plist_get_buffer(0), base64_report_buffer+offset, 20); bus_slave_setreturn( pack_return_status(kNoMIBError, 20 )); } static void get_reporting_sequence(void) { bus_slave_return_int16( current_momo_state.report_config.transmit_sequence ); } static BYTE report_buffer[RAW_REPORT_MAX_LENGTH]; static void read_report_log_mib(void) { uint16 index = plist_get_int16(0); uint16 offset = plist_get_int16(1); if ( offset >= RAW_REPORT_MAX_LENGTH ) { bus_slave_seterror( kCallbackError ); return; } uint8 length = RAW_REPORT_MAX_LENGTH - offset; if ( length > kBusMaxMessageSize ) length = kBusMaxMessageSize; if ( report_log_read( index, (void*)&report_buffer, 1 ) == 0 ) { // No more entries bus_slave_seterror( kCallbackError ); return; } bus_slave_return_buffer( report_buffer+offset, length ); } static void count_report_log_mib(void) { bus_slave_return_int16( report_log_count() ); } static void clear_report_log_mib(void) { report_log_clear(); } static void handle_report_stream_success(void) { notify_report_success(); } static void handle_report_stream_failure(void) { notify_report_failure(); } DEFINE_MIB_FEATURE_COMMANDS(reporting) { { 0x00, send_report, plist_spec_empty() }, { 0x01, start_scheduled_reporting, plist_spec_empty() }, { 0x02, stop_scheduled_reporting, plist_spec_empty() }, { 0x03, set_reporting_interval, plist_spec(1, false) }, { 0x04, get_reporting_interval, plist_spec_empty() }, { 0x05, set_reporting_route, plist_spec(1, true) }, { 0x06, get_reporting_route, plist_spec(1, false) }, { 0x07, set_reporting_flags, plist_spec(1, false) }, { 0x08, get_reporting_flags, plist_spec_empty() }, { 0x09, set_reporting_aggregates, plist_spec(2, false) }, { 0x0A, get_reporting_aggregates, plist_spec_empty() }, { 0x0B, get_reporting_sequence, plist_spec_empty() }, { 0x0C, build_report, plist_spec_empty() }, { 0x0D, get_report, plist_spec(1, false) }, { 0x0E, get_scheduled_reporting, plist_spec_empty() }, { 0x0F, read_report_log_mib, plist_spec(2, false) }, { 0x10, count_report_log_mib, plist_spec_empty() }, { 0x11, clear_report_log_mib, plist_spec_empty() }, { 0x12, init_report_config, plist_spec_empty() }, { 0x13, set_reporting_apn, plist_spec(0,true) }, { 0x14, get_reporting_apn, plist_spec_empty() }, { 0xF0, handle_report_stream_success, plist_spec_empty() }, { 0xF1, handle_report_stream_failure, plist_spec_empty() } }; DEFINE_MIB_FEATURE(reporting);
/* -*- c++ -*- */ /* * Copyright 2014 Felix Wunsch, Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT). * * 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, 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 software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_DRM_GENERATE_FAC_VB_IMPL_H #define INCLUDED_DRM_GENERATE_FAC_VB_IMPL_H #include <drm/generate_fac_vb.h> #include "drm_util.h" namespace gr { namespace drm { class generate_fac_vb_impl : public generate_fac_vb { private: transm_params* d_tp; unsigned short d_tf_ctr; // transmission frame counter public: generate_fac_vb_impl(transm_params* tp); ~generate_fac_vb_impl(); void init_data(unsigned char* data); // set FAC bitstream according to config parameters (see DRM standard chapter 6.3) void increment_tf_ctr(); // increments tf_ctr and takes account of wraparound; // Where all the action really happens int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; } // namespace drm } // namespace gr #endif /* INCLUDED_DRM_GENERATE_FAC_VB_IMPL_H */
/* * Copyright (c) 2010 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _SYS_CONTENT_PROTECTION_H_ #define _SYS_CONTENT_PROTECTION_H_ #ifdef PRIVATE /* * Protection classes vary in their restrictions on read/writability. A is generally * the strictest, and D is effectively no restriction. */ /* * dir_none forces new items created in the directory to pick up the mount point default * protection level. it is only allowed for directories. */ #define PROTECTION_CLASS_DIR_NONE 0 #define PROTECTION_CLASS_A 1 #define PROTECTION_CLASS_B 2 #define PROTECTION_CLASS_C 3 #define PROTECTION_CLASS_D 4 #define PROTECTION_CLASS_E 5 #define PROTECTION_CLASS_F 6 /* * This forces open_dprotected_np to behave as though the file were created with * the traditional open(2) semantics. */ #define PROTECTION_CLASS_DEFAULT (-1) #endif /* PRIVATE */ #endif /* _SYS_CONTENT_PROTECTION_H_ */
/** ****************************************************************************** * @file LibJPEG/LibJPEG_Encoding/Src/encode.c * @author MCD Application Team * @version V1.1.0 * @date 17-February-2017 * @brief This file contain the compress method. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics International N.V. * All rights reserved.</center></h2> * * Redistribution and use in source and binary forms, with or without * modification, are permitted, provided that the following conditions are met: * * 1. Redistribution 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 other * contributors to this software may be used to endorse or promote products * derived from this software without specific written permission. * 4. This software, including modifications and/or derivative works of this * software, must execute solely and exclusively on microcontroller or * microprocessor devices manufactured by or for STMicroelectronics. * 5. Redistribution and use of this software other than as permitted under * this license is void and will automatically terminate your rights under * this license. * * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT * SHALL STMICROELECTRONICS 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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "encode.h" /* Private typedef -----------------------------------------------------------*/ /* This struct contains the JPEG compression parameters */ static struct jpeg_compress_struct cinfo; /* This struct represents a JPEG error handler */ static struct jpeg_error_mgr jerr; /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ extern RGB_typedef *RGB_matrix; /** * @brief Jpeg Encode * @param file: pointer to the bmp file * @param file1: pointer to the jpg file * @param width: image width * @param height: image height * @param image_quality: image quality * @param buff: pointer to the image line * @retval None */ void jpeg_encode(JFILE *file, JFILE *file1, uint32_t width, uint32_t height, uint32_t image_quality, uint8_t * buff) { /* Encode BMP Image to JPEG */ JSAMPROW row_pointer; /* Pointer to a single row */ uint32_t bytesread; /* Step 1: allocate and initialize JPEG compression object */ /* Set up the error handler */ cinfo.err = jpeg_std_error(&jerr); /* Initialize the JPEG compression object */ jpeg_create_compress(&cinfo); /* Step 2: specify data destination */ jpeg_stdio_dest(&cinfo, file1); /* Step 3: set parameters for compression */ cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = 3; cinfo.in_color_space = JCS_RGB; /* Set default compression parameters */ jpeg_set_defaults(&cinfo); cinfo.dct_method = JDCT_FLOAT; jpeg_set_quality(&cinfo, image_quality, TRUE); /* Step 4: start compressor */ jpeg_start_compress(&cinfo, TRUE); /* Bypass the header bmp file */ f_read(file, buff, 54, (UINT*)&bytesread); while (cinfo.next_scanline < cinfo.image_height) { /* In this application, the input file is a BMP, which first encodes the bottom of the picture */ /* JPEG encodes the highest part of the picture first. We need to read the lines upside down */ /* Move the read pointer to 'last line of the picture - next_scanline' */ f_lseek(file, ((cinfo.image_height-1-cinfo.next_scanline)*width*3)+54); if(f_read(file, buff, width*3, (UINT*)&bytesread) == FR_OK) { row_pointer = (JSAMPROW)buff; jpeg_write_scanlines(&cinfo, &row_pointer, 1); } } /* Step 5: finish compression */ jpeg_finish_compress(&cinfo); /* Step 6: release JPEG compression object */ jpeg_destroy_compress(&cinfo); } /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) Copyright (C) 2008-2014 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish 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. Stockfish 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 THREAD_H_INCLUDED #define THREAD_H_INCLUDED #include <bitset> #include <condition_variable> #include <mutex> #include <thread> #include <vector> #include "material.h" #include "movepick.h" #include "pawns.h" #include "position.h" #include "search.h" const int MAX_THREADS = 128; const int MAX_SPLITPOINTS_PER_THREAD = 8; struct Thread; struct SplitPoint { // Const data after split point has been setup const Position* pos; const Search::Stack* ss; Thread* masterThread; Depth depth; Value beta; int nodeType; bool cutNode; // Const pointers to shared data MovePicker* movePicker; SplitPoint* parentSplitPoint; // Shared data std::mutex mutex; std::bitset<MAX_THREADS> slavesMask; volatile bool allSlavesSearching; volatile uint64_t nodes; volatile Value alpha; volatile Value bestValue; volatile Move bestMove; volatile int moveCount; volatile bool cutoff; }; /// ThreadBase struct is the base of the hierarchy from where we derive all the /// specialized thread classes. struct ThreadBase { ThreadBase() : exit(false) {} virtual ~ThreadBase() {} virtual void idle_loop() = 0; void notify_one(); void wait_for(volatile const bool& b); std::thread nativeThread; std::mutex mutex; std::condition_variable sleepCondition; volatile bool exit; }; /// Thread struct keeps together all the thread related stuff like locks, state /// and especially split points. We also use per-thread pawn and material hash /// tables so that once we get a pointer to an entry its life time is unlimited /// and we don't have to care about someone changing the entry under our feet. struct Thread : public ThreadBase { Thread(); virtual void idle_loop(); bool cutoff_occurred() const; bool available_to(const Thread* master) const; template <bool Fake> void split(Position& pos, const Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove, Depth depth, int moveCount, MovePicker* movePicker, int nodeType, bool cutNode); SplitPoint splitPoints[MAX_SPLITPOINTS_PER_THREAD]; Material::Table materialTable; Endgames endgames; Pawns::Table pawnsTable; Position* activePosition; size_t idx; int maxPly; SplitPoint* volatile activeSplitPoint; volatile int splitPointsSize; volatile bool searching; }; /// MainThread and TimerThread are derived classes used to characterize the two /// special threads: the main one and the recurring timer. struct MainThread : public Thread { MainThread() : thinking(true) {} // Avoid a race with start_thinking() virtual void idle_loop(); volatile bool thinking; }; struct TimerThread : public ThreadBase { TimerThread() : run(false) {} virtual void idle_loop(); bool run; static const int Resolution = 5; // msec between two check_time() calls }; /// ThreadPool struct handles all the threads related stuff like init, starting, /// parking and, most importantly, launching a slave thread at a split point. /// All the access to shared thread data is done through this class. struct ThreadPool : public std::vector<Thread*> { void init(); // No c'tor and d'tor, threads rely on globals that should void exit(); // be initialized and are valid during the whole thread lifetime. MainThread* main() { return static_cast<MainThread*>((*this)[0]); } void read_uci_options(); Thread* available_slave(const Thread* master) const; void wait_for_think_finished(); void start_thinking(const Position&, const Search::LimitsType&, Search::StateStackPtr&); Depth minimumSplitDepth; std::mutex mutex; std::condition_variable sleepCondition; TimerThread* timer; }; extern ThreadPool Threads; #endif // #ifndef THREAD_H_INCLUDED
/* ptinit.c - ptinit */ #include <xinu.h> struct ptnode *ptfree; /* list of free message nodes */ struct ptentry porttab[NPORTS]; /* port table */ int32 ptnextid; /* next table entry to try */ /*------------------------------------------------------------------------ * ptinit -- initialize all ports *------------------------------------------------------------------------ */ syscall ptinit( int32 maxmsgs /* total messages in all ports */ ) { int32 i; /* runs through port table */ struct ptnode *next, *prev; /* used to build free list */ ptfree = (struct ptnode *)getmem(maxmsgs*sizeof(struct ptnode)); if (ptfree == (struct ptnode *)SYSERR) { panic("pinit - insufficient memory"); } /* Initialize all port table entries to free */ for (i=0 ; i<NPORTS ; i++) { porttab[i].ptstate = PT_FREE; porttab[i].ptseq = 0; } ptnextid = 0; /* Create free list of message pointer nodes */ for ( prev=next=ptfree ; --maxmsgs > 0 ; prev=next ) prev->ptnext = ++next; prev->ptnext = NULL; return(OK); }
// // Created by Christian Ehrig on 31/01/16. // #ifndef FILETOAST_WORKER_H #define FILETOAST_WORKER_H void * worker(void *); char * readfile(t_job *); int senddata(t_job * job); #endif //FILETOAST_WORKER_H
#ifndef TNUICOLORSTREAMEFFECT_H #define TNUICOLORSTREAMEFFECT_H #include <QObject> class TNuiColorStream; class TNuiColorStreamEffect : public QObject { Q_OBJECT public: TNuiColorStreamEffect(TNuiColorStream *stream); void setEnabled(bool enabled); bool isEnabled() const { return m_enabled; } void draw(uchar *data, uint length); signals: void enabledChanged(bool enabled); protected: virtual void updateFrameData(uchar *data, uint length) = 0; TNuiColorStream *m_colorStream; bool m_enabled; }; #endif // TNUICOLORSTREAMEFFECT_H
/******************************************************************************************************************************************************* * Copyright ¨Ï 2016 <WIZnet Co.,Ltd.> * 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. *********************************************************************************************************************************************************/ /** ****************************************************************************** * @file ADC/Illumination_RGBLED/W7500x_it.h * @author IOP Team * @version V1.0.0 * @date 26-AUG-2015 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, WIZnet SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2015 WIZnet Co.,Ltd.</center></h2> ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __W7500X_IT_H #define __W7500X_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "W7500x.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void SVC_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void SSP0_Handler(void); void SSP1_Handler(void); void UART0_Handler(void); void UART0_Handler(void); void UART1_Handler(void); void UART2_Handler(void); void I2C0_Handler(void); void I2C1_Handler(void); void PORT0_Handler(void); void PORT1_Handler(void); void PORT2_Handler(void); void DMA_Handler(void); void DUALTIMER0_Handler(void); void DUALTIMER1_Handler(void); void PWM0_Handler(void); void PWM1_Handler(void); void PWM2_Handler(void); void PWM3_Handler(void); void PWM4_Handler(void); void PWM5_Handler(void); void PWM6_Handler(void); void PWM7_Handler(void); void ADC_Handler(void); void WZTOE_Handler(void); void EXTI_Handler(void); #endif /* __W7500X_IT_H */ /******************* (C) COPYRIGHT 2015 WIZnet Co.,Ltd. *****END OF FILE****/
/* * Moondust, a free game engine for platform game making * Copyright (c) 2014-2019 Vitaly Novichkov <[email protected]> * * 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 OBJ_NPC_H #define OBJ_NPC_H #include <string> #include <common_features/size.h> #include <ConfigPackManager/level/config_npc.h> #include "../graphics/graphics.h" #include "spawn_effect_def.h" // //Defines:// // // obj_npc // // npc_Markers // // //////////// // struct obj_npc { /* OpenGL */ bool isInit; PGE_Texture *image; GLuint textureID; int textureArrayId; int animator_ID; PGE_Size image_size; /* OpenGL */ //! Generic NPC settings and parameters NpcSetup setup; SpawnEffectDef effect_1_def; SpawnEffectDef effect_2_def; enum blockSpawn { spawn_warp = 0, spawn_bump }; //!Type of NPC spawn from block unsigned int block_spawn_type; //!NPC's initial Y Velocity after spawn from block double block_spawn_speed; //!Play sound on spawn from block (if false - spawn without 'radish' sound) bool block_spawn_sound; }; struct NPC_GlobalSetup { // ;Defines for SMBX64 uint64_t bubble; // bubble=283 ; NPC-Container for packed in bubble uint64_t egg; // egg=96 ; NPC-Container for packed in egg uint64_t lakitu; // lakitu=284 ; NPC-Container for spawn by lakitu uint64_t buried; // burred=91 ; NPC-Container for packed in herb uint64_t ice_cube; // icecube=263 ; NPC-Container for frozen NPCs // ;markers uint64_t iceball; // iceball=265 uint64_t fireball; // fireball=13 uint64_t hammer; // hammer=171 uint64_t boomerang;// boomerang=292 uint64_t coin_in_block; // coin-in-block=10 // some physics settings double phs_gravity_accel; double phs_max_fall_speed; //effects uint64_t eff_lava_burn; //Lava burn effect [Effect to spawn on contact with lava] //projectile properties SpawnEffectDef projectile_effect; uint64_t projectile_sound_id; double projectile_speed; //Talking NPC's properties std::string talking_sign_img; }; #endif // OBJ_NPC_H
/*! \file st.h \brief Class representing FPU's ST register. */ #ifdef ST_H #error Already included #else #define ST_H class st: public reg { public: st(); st(std::string const &name); ~st(); st &operator()(size_t i); std::string name() const override; private: std::string const m_name; public: st(const st &instance) = default; st(st &&instance) = default; st &operator=(const st &instance) = delete; st &operator=(const st &&instance) = delete; }; #endif
#include "gremlin.h" void cs_kroneckerIupdate(const cs *A, int nI, const cs *C){ int i, j, k, cnt, an, am; double *Ax; an = A->n; am = A->m; Ax = A->x; cnt = 0; for(i = 0; i < an; i++){ for(j = 0 ; j < nI ; j++){ for(k = 0; k < am; k++){ C->x[cnt] = Ax[i*an+k]; cnt++; } } } }
// // Copyright (c) 2008-2018 the Urho3D project. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #pragma once #include "../../Graphics/ShaderProgram.h" #include "../../Graphics/VertexDeclaration.h" #include "../../Math/Color.h" #include <d3d9.h> namespace Urho3D { #define URHO3D_SAFE_RELEASE(p) if (p) { ((IUnknown*)p)->Release(); p = 0; } #define URHO3D_LOGD3DERROR(msg, hr) URHO3D_LOGERRORF("%s (HRESULT %x)", msg, (unsigned)hr) using ShaderProgramMap = HashMap<Pair<ShaderVariation*, ShaderVariation*>, SharedPtr<ShaderProgram> >; using VertexDeclarationMap = HashMap<unsigned long long, SharedPtr<VertexDeclaration> >; /// %Graphics implementation. Holds API-specific objects. class URHO3D_API GraphicsImpl { friend class Graphics; public: /// Construct. GraphicsImpl(); /// Return Direct3D device. IDirect3DDevice9* GetDevice() const { return device_; } /// Return device capabilities. const D3DCAPS9& GetDeviceCaps() const { return deviceCaps_; } /// Return adapter identifier. const D3DADAPTER_IDENTIFIER9& GetAdapterIdentifier() const { return adapterIdentifier_; } /// Return whether a texture format and usage is supported. bool CheckFormatSupport(D3DFORMAT format, DWORD usage, D3DRESOURCETYPE type); /// Return whether a multisample level is supported. bool CheckMultiSampleSupport(D3DFORMAT format, int level); private: /// Direct3D interface. IDirect3D9* interface_; /// Direct3D device. IDirect3DDevice9* device_; /// Default color surface. IDirect3DSurface9* defaultColorSurface_; /// Default depth-stencil surface. IDirect3DSurface9* defaultDepthStencilSurface_; /// Frame query for flushing the GPU command queue. IDirect3DQuery9* frameQuery_; /// Adapter number. DWORD adapter_; /// Device type. D3DDEVTYPE deviceType_; /// Device capabilities. D3DCAPS9 deviceCaps_; /// Adapter identifier. D3DADAPTER_IDENTIFIER9 adapterIdentifier_; /// Direct3D presentation parameters. D3DPRESENT_PARAMETERS presentParams_; /// Texture min filter modes in use. D3DTEXTUREFILTERTYPE minFilters_[MAX_TEXTURE_UNITS]; /// Texture mag filter modes in use. D3DTEXTUREFILTERTYPE magFilters_[MAX_TEXTURE_UNITS]; /// Texture mip filter modes in use. D3DTEXTUREFILTERTYPE mipFilters_[MAX_TEXTURE_UNITS]; /// Texture U coordinate addressing modes in use. D3DTEXTUREADDRESS uAddressModes_[MAX_TEXTURE_UNITS]; /// Texture V coordinate addressing modes in use. D3DTEXTUREADDRESS vAddressModes_[MAX_TEXTURE_UNITS]; /// Texture W coordinate addressing modes in use. D3DTEXTUREADDRESS wAddressModes_[MAX_TEXTURE_UNITS]; /// Texture anisotropy setting in use. unsigned maxAnisotropy_[MAX_TEXTURE_UNITS]; /// Texture border colors in use. Color borderColors_[MAX_TEXTURE_UNITS]; /// Device lost flag. bool deviceLost_; /// Frame query issued flag. bool queryIssued_; /// sRGB mode in use. bool sRGBModes_[MAX_TEXTURE_UNITS]; /// sRGB write flag. bool sRGBWrite_; /// Color surfaces in use. IDirect3DSurface9* colorSurfaces_[MAX_RENDERTARGETS]; /// Depth-stencil surface in use. IDirect3DSurface9* depthStencilSurface_; /// Blending enabled flag. DWORD blendEnable_; /// Source blend mode. D3DBLEND srcBlend_; /// Destination blend mode. D3DBLEND destBlend_; /// Blend operation. D3DBLENDOP blendOp_; /// Vertex declarations. VertexDeclarationMap vertexDeclarations_; /// Stream frequencies by vertex buffer. unsigned streamFrequencies_[MAX_VERTEX_STREAMS]; /// Stream offsets by vertex buffer. unsigned streamOffsets_[MAX_VERTEX_STREAMS]; /// Vertex declaration in use. VertexDeclaration* vertexDeclaration_; /// Shader programs. ShaderProgramMap shaderPrograms_; /// Shader program in use. ShaderProgram* shaderProgram_; }; }
#ifndef DATASOURCE_H #define DATASOURCE_H #include <QArray> #include <QVector3D> #include <QColor4ub> #include <QObject> #include <QVector2D> #include <QGLVertexBundle> #include <iostream> #include "databundle.h" using std::cerr; using std::endl; class DataSource : public QObject { Q_OBJECT public: DataSource(QObject *parent = 0); virtual QArray<DataBundle*> *dataBundles() { cerr << "Returning from abstract DataSource." "This should not happen." << endl; return 0; } }; #endif
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <volk_fft/volk_fft_prefs.h> //#if defined(_WIN32) //#include <Windows.h> //#endif void volk_fft_get_config_path(char *path) { if (!path) return; const char *suffix = "/.volk_fft/volk_fft_config"; char *home = NULL; if (home == NULL) home = getenv("HOME"); if (home == NULL) home = getenv("APPDATA"); if (home == NULL){ path[0] = 0; return; } strcpy(path, home); strcat(path, suffix); } size_t volk_fft_load_preferences(volk_fft_arch_pref_t **prefs_res) { FILE *config_file; char path[512], line[512]; size_t n_arch_prefs = 0; volk_fft_arch_pref_t *prefs = NULL; //get the config path volk_fft_get_config_path(path); if (!path[0]) return n_arch_prefs; //no prefs found config_file = fopen(path, "r"); if(!config_file) return n_arch_prefs; //no prefs found //reset the file pointer and write the prefs into volk_fft_arch_prefs while(fgets(line, sizeof(line), config_file) != NULL) { prefs = (volk_fft_arch_pref_t *) realloc(prefs, (n_arch_prefs+1) * sizeof(*prefs)); volk_fft_arch_pref_t *p = prefs + n_arch_prefs; if(sscanf(line, "%s %s %s", p->name, p->impl_a, p->impl_u) == 3 && !strncmp(p->name, "volk_fft_", 5)) { n_arch_prefs++; } } fclose(config_file); *prefs_res = prefs; return n_arch_prefs; }
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "serial.h" #include "inputprocessor.h" #include "commandsender.h" #include "plothelper.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); void verticalSlider(); void sendmotor(); public slots: void refreshDevices(); private slots: void on_openButton_pressed(); void on_closeButton_pressed(); void on_clearButton_pressed(); void on_Send_pressed(); void rollPIDPressed(); void pitchPIDPressed(); void yawPIDPressed(); void rollRatePIDPressed(); void pitchRatePIDPressed(); void yawRatePIDPressed(); void rollSliderChanged(); void pitchSliderChanged(); void yawSliderChanged(); void rollRateSliderChanged(); void pitchRateSliderChanged(); void yawRateSliderChanged(); void sendRollPIDParam(); void sendPitchPIDParam(); void sendYawPIDParam(); void sendRollRatePIDParam(); void sendPitchRatePIDParam(); void sendYawRatePIDParam(); void on_pushButton_pressed(); void on_pushButton_4_pressed(); void on_pushButton_3_pressed(); void on_pushButton_2_pressed(); void on_lineEdit_2_returnPressed(); void on_lineEdit_5_returnPressed(); void on_lineEdit_4_returnPressed(); void on_lineEdit_3_returnPressed(); signals: void rollPIDReleased(); void pitchPIDReleased(); void yawPIDReleased(); void rollRatePIDReleased(); void pitchRatePIDReleased(); void yawRatePIDReleased(); private: void sendSetPoints(); Ui::MainWindow *ui; Serial serial; InputProcessor *ip; CommandSender *cs; QTimer *timer; PlotHelper controllerLine1, controllerLine2, controllerLine3; PlotHelper grawLine1, grawLine2, grawLine3; PlotHelper arawLine1, arawLine2, arawLine3; PlotHelper filterLine1, filterLine2, filterLine3; }; #endif // MAINWINDOW_H
/****************************************************************************** * * MantaFlow fluid solver framework * Copyright 2011 Tobias Pfaff, Nils Thuerey * * This program is free software, distributed under the terms of the * GNU General Public License (GPL) * http://www.gnu.org/licenses * * Plugin timing * ******************************************************************************/ #ifndef _TIMING_H #define _TIMING_H #include "manta.h" #include <map> namespace Manta { class TimingData { private: TimingData(); public: static TimingData& instance() { static TimingData a; return a; } void print(); void saveMean(const std::string& filename); void start(FluidSolver* parent, const std::string& name); void stop(FluidSolver* parent, const std::string& name); protected: void step(); struct TimingSet { TimingSet() : num(0),updated(false) { cur.clear(); total.clear(); } MuTime cur, total; int num; bool updated; std::string solver; }; bool updated; int num; MuTime mPluginTimer; std::string mLastPlugin; std::map<std::string, std::vector<TimingSet> > mData; }; // Python interface PYTHON() class Timings : public PbClass { public: PYTHON() Timings() : PbClass(0) {} PYTHON() void display() { TimingData::instance().print(); } PYTHON() void saveMean(std::string file) { TimingData::instance().saveMean(file); } }; } #endif
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <[email protected]> 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 <tap/basic.h> #include <string.h> #include <stdlib.h> #include "libknot/internal/mempattern.h" #include "libknot/internal/mempool.h" #include "libknot/errcode.h" #include "knot/nameserver/query_module.h" #include "libknot/packet/pkt.h" /* Universal processing stage. */ int state_visit(int state, knot_pkt_t *pkt, struct query_data *qdata, void *ctx) { /* Visit current state */ bool *state_map = ctx; state_map[state] = true; return state + 1; } int main(int argc, char *argv[]) { plan(4); /* Create processing context. */ mm_ctx_t mm; mm_ctx_mempool(&mm, MM_DEFAULT_BLKSIZE); /* Create a map of expected steps. */ bool state_map[QUERY_PLAN_STAGES] = { false }; /* Prepare query plan. */ struct query_plan *plan = query_plan_create(&mm); ok(plan != NULL, "query_plan: create"); /* Register all stage visits. */ int ret = KNOT_EOK; for (unsigned stage = QPLAN_BEGIN; stage < QUERY_PLAN_STAGES; ++stage) { ret = query_plan_step(plan, stage, state_visit, state_map); if (ret != KNOT_EOK) { break; } } ok(ret == KNOT_EOK, "query_plan: planned all steps"); /* Execute the plan. */ int state = 0, next_state = 0; for (unsigned stage = QPLAN_BEGIN; stage < QUERY_PLAN_STAGES; ++stage) { struct query_step *step = NULL; WALK_LIST(step, plan->stage[stage]) { next_state = step->process(state, NULL, NULL, step->ctx); if (next_state != state + 1) { break; } state = next_state; } } ok(state == QUERY_PLAN_STAGES, "query_plan: executed all steps"); /* Verify if all steps executed their callback. */ for (state = 0; state < QUERY_PLAN_STAGES; ++state) { if (state_map[state] == false) { break; } } ok(state == QUERY_PLAN_STAGES, "query_plan: executed all callbacks"); /* Free the query plan. */ query_plan_free(plan); /* Cleanup. */ mp_delete((struct mempool *)mm.ctx); return 0; }
/* * gtpm-mgr * * Version 1.00 * Copyright (C) 2012-2014 Nicolas Provost dev AT doronic DOT fr * * 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 */ #include <gtk/gtk.h> #include "llib_tpm.h" #include "llib_opt.h" #include "llib_print.h" #include "llib_gtk.h" #include "gtpm_mgr.h" #include "gtpm_ui.h" #include "gtpm_tpm.h" #include "gtpm_uio.h" static void gtpm_mgr_reset_vars(gtpm_config_t* gmgr) { llib_data_free(&gmgr->args.output); llib_data_free(&gmgr->args.data); llib_data_free(&gmgr->args.data2); llib_data_free(&gmgr->args.encdata); gmgr->args.set = 0; llib_tpm_keystore_release_one_shot_key(gmgr->args.keystore); } /* run a command from the label of the clicked item */ void gtpm_mgr_run (gtpm_config_t* gmgr, const char* label) { lbool res; const struct gtpm_menu_action_t* entry = &gtpm_tpm_menu_entries[0]; /* find the command from the label */ while (entry && entry->label && entry->job) { if (llib_str_equ(entry->label, label,0)) break; entry++; } if (!entry || !entry->label || !entry->job) { gmgr->tpm.last_error = LLIB_TPM_ERROR_UNIMPLEMENTED; llib_tpm_uio_error (&gmgr->args, "Unable to run command"); llib_print_f(2, "[gtpm-mgr] unknown command label '%s'\n", label); return; } /* get descriptor */ gmgr->args.desc = llib_tpm_find_descriptor (entry->job); if (!gmgr->args.desc) { gmgr->tpm.last_error = LLIB_TPM_ERROR_UNIMPLEMENTED; llib_tpm_uio_error (&gmgr->args, "Unable to run command"); llib_print_f(2, "[gtpm-mgr] unknown descriptor '%s'\n", gmgr->args.desc); return; } /* set standard output if no other choice */ if ((gmgr->args.desc->in & LLIB_TPM_FOUTPUT) && !gmgr->args.cargs->output && !(gmgr->args.desc->sin & LLIB_TPM_FSOUTPUTNODEF)) { gmgr->args.output = llib_data_create_text_buffer(); if (!gmgr->args.output) { llib_tpm_uio_printf (&gmgr->args, LLIB_TPM_UIO_ERR, "unable to open standard output\n"); return; } gmgr->args.set |= LLIB_TPM_FOUTPUT; } /* run the command */ llib_gtku_set_cursor (GTK_WIDGET(gmgr->ui.gWindow), GDK_CIRCLE); llib_gtku_process_signals (); if (llib_tpm_run (&gmgr->tpm, entry->job, &gmgr->args, &res) && res) { llib_gtku_set_cursor (GTK_WIDGET(gmgr->ui.gWindow), GDK_ARROW); llib_tpm_keystore_add_one_shot_key (gmgr->args.keystore); if (gmgr->args.output && (gmgr->args.output->type == LLIB_DATA_TYPE_BUFFER) && (llib_buffer_type(&gmgr->args.output->data.buffer) == LLIB_BUFFER_TEXT)) { gtpmuio_output_text (&gmgr->args, "command result", &gmgr->args.output->data.buffer); } } else { llib_gtku_set_cursor (GTK_WIDGET(gmgr->ui.gWindow), GDK_ARROW); llib_tpm_uio_error (&gmgr->args, "Unable to run command"); } gtpm_mgr_reset_vars(gmgr); llib_gtku_set_cursor(GTK_WIDGET(gmgr->ui.gWindow), GDK_ARROW); } static void gtpm_mgr_clean(gtpm_config_t* gmgr) { llib_tpm_free(&gmgr->tpm); llib_tpm_store_free(gmgr->args.store); llib_tpm_keystore_free(gmgr->args.keystore); llib_tpm_uio_free(&gmgr->uio); } int main(int argc, char* argv[]) { gtpm_config_t gmgr; int retcode = EXIT_FAILURE; char c; char* arg = NULL; char* devpath = NULL; llib_mem_zero(&gmgr, sizeof(gtpm_config_t)); gmgr.args.cargs = &gmgr.cargs; gmgr.args.store = gmgr.cargs.store = &gmgr.cargs.st.store; llib_tpm_key_init(&gmgr.cargs.st.store_key); llib_tpm_store_init(gmgr.args.store, &gmgr.tpm, NULL); gmgr.cargs.st.store.key = &gmgr.cargs.st.store_key; gmgr.args.uio = &gmgr.uio; gmgr.cargs.st.ui = &gmgr.ui; gmgr.args.tpm = &gmgr.tpm; gmgr.args.keystore = &gmgr.cargs.st.keystore; gmgr.args.o = gmgr.cargs.o = &gmgr.cargs.st.o; llib_tpm_store_object_init(gmgr.args.o, NULL, NULL); gtpmuio_init(&gmgr.uio, &gmgr.args); llib_tpm_keystore_init(gmgr.args.keystore); llib_print_f(1, "gtpm-mgr v" VERSION "\n"); llib_print_f(1, "usage: [-dtpm|store|all (debug)] [-v (verbose)] " "[-tTPM_DEV_PATH (default is /dev/tpm0)]\n"); while ((c = llib_opt_get_short(argc, argv, "vd::t::", &arg)) != -1) { switch (c) { case 'v': gmgr.args.verbose = TRUE; break; case 'd': if (llib_str_equ(arg, "all", 0) || llib_str_equ(arg, "store", 0)) { gmgr.args.debug = TRUE; gmgr.args.store->debug = TRUE; } if (llib_str_equ(arg, "all", 0) || llib_str_equ(arg, "tpm",0)) gmgr.tpm.debug = TRUE; break; case 't': if (!arg) { llib_print_f(2, "[gtpm-mgr] FATAL: missing TPM device path\n"); return EXIT_FAILURE; } devpath = llib_str_dup(arg); llib_print_f(2, "[gtpm-mgr] using TPM at %s\n", arg); break; } llib_str_release(&arg); } gtk_init(&argc, &argv); if (!gtpm_ui_build(&gmgr)) { llib_print_f(2, "[gtpm-mgr] FATAL: unable to build graphical " "interface, aborting\n"); } else { if (!llib_tpm_init(&gmgr.tpm, devpath, 30, gmgr.tpm.debug)) llib_tpm_uio_error(&gmgr.args, "TPM initialization error"); else { gtk_widget_show_all(GTK_WIDGET(gmgr.ui.gWindow)); gtk_main(); retcode = EXIT_SUCCESS; } } llib_mem_free(devpath); gtpm_mgr_clean(&gmgr); return retcode; }
/* Template filled out by CMake */ /* * *** THIS HEADER IS INCLUDED BY PdfCompilerCompat.h *** * *** DO NOT INCLUDE DIRECTLY *** */ #ifndef _PDF_COMPILERCOMPAT_H #error Please include PdfDefines.h instead #endif #define PODOFO_VERSION_MAJOR 0 #define PODOFO_VERSION_MINOR 9 #define PODOFO_VERSION_PATCH 0 /* PoDoFo configuration options */ #define PODOFO_MULTI_THREAD /* somewhat platform-specific headers */ #define PODOFO_HAVE_STRINGS_H 1 #define PODOFO_HAVE_ARPA_INET_H 1 /* #undef PODOFO_HAVE_WINSOCK2_H */ /* #undef PODOFO_HAVE_MEM_H */ /* #undef PODOFO_HAVE_CTYPE_H */ /* Integer types - headers */ #define PODOFO_HAVE_STDINT_H 1 /* #undef PODOFO_HAVE_BASETSD_H */ #define PODOFO_HAVE_SYS_TYPES_H 1 /* Integer types - type names */ #define PDF_INT8_TYPENAME int8_t #define PDF_INT16_TYPENAME int16_t #define PDF_INT32_TYPENAME int32_t #define PDF_INT64_TYPENAME int64_t #define PDF_UINT8_TYPENAME uint8_t #define PDF_UINT16_TYPENAME uint16_t #define PDF_UINT32_TYPENAME uint32_t #define PDF_UINT64_TYPENAME uint64_t /* Endianness */ /* #undef TEST_BIG */ /* Libraries */ #define PODOFO_HAVE_JPEG_LIB #define PODOFO_HAVE_PNG_LIB #define PODOFO_HAVE_TIFF_LIB #define PODOFO_HAVE_FONTCONFIG #define PODOFO_HAVE_LUA /* #undef PODOFO_HAVE_BOOST */ #define PODOFO_HAVE_CPPUNIT /* Platform quirks */ #define PODOFO_JPEG_RUNTIME_COMPATIBLE
#ifndef UNIFORMVARIABLEEDITOR_H #define UNIFORMVARIABLEEDITOR_H #include <QDialog> #include <QDebug> #include <QComboBox> #include <QLineEdit> #include <QVBoxLayout> #include <QHBoxLayout> #include <QScrollBar> #include <QWidget> #include "setvariablewidget.h" namespace Ui { class UniformVariableEditor; } class UniformVariableEditor : public QDialog { Q_OBJECT public: struct UniformAttachment { QString uniformName; QString programName; QString variableName; }; public: explicit UniformVariableEditor(QWidget *parent = 0); ~UniformVariableEditor(); void setUniformSettings(QList<UniformAttachment> list); QList<UniformAttachment> getUniformSettings(); QList<UniformAttachment> getRemovedSettings(); private: void customConnect(); private: Ui::UniformVariableEditor *ui; const int layerIncY; int layerY; QVBoxLayout* vbox; QList<SetVariableWidget*> lines; QList<UniformAttachment> removed; private slots: void addNewUniformWidgetLine(); void removeUniformWidgetLine(QWidget* widget); }; #endif // UNIFORMVARIABLEEDITOR_H
/* * Copyright (c) 2018 Siloft * * 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 BUNDLE_H_ #define BUNDLE_H_ int bundle(int argc, char *argv[], int command_index); #endif // BUNDLE_H_
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MINIKIN_CMAP_COVERAGE_H #define MINIKIN_CMAP_COVERAGE_H #include <minikin/SparseBitSet.h> namespace android { class CmapCoverage { public: static bool getCoverage(SparseBitSet &coverage, const uint8_t* cmap_data, size_t cmap_size); }; } // namespace android #endif // MINIKIN_CMAP_COVERAGE_H
/* radare - LGPL - Copyright 2008-2014 - pancake */ // TODO: implement a more inteligent way to store cached memory // TODO: define limit of max mem to cache #include "r_io.h" static void cache_item_free(RIOCache *cache) { if (!cache) return; if (cache->data) free (cache->data); free (cache); } R_API void r_io_cache_init(RIO *io) { io->cache = r_list_new (); io->cache->free = (RListFree)cache_item_free; io->cached = R_FALSE; // cache write ops io->cached_read = R_FALSE; // cached read ops } R_API void r_io_cache_enable(RIO *io, int read, int write) { io->cached = read | write; io->cached_read = read; } R_API void r_io_cache_commit(RIO *io) { RListIter *iter; RIOCache *c; if (io->cached) { io->cached = R_FALSE; r_list_foreach (io->cache, iter, c) { if (!r_io_write_at (io, c->from, c->data, c->size)) eprintf ("Error writing change at 0x%08"PFMT64x"\n", c->from); } io->cached = R_TRUE; r_io_cache_reset (io, io->cached); } } R_API void r_io_cache_reset(RIO *io, int set) { io->cached = set; r_list_purge (io->cache); } R_API int r_io_cache_invalidate(RIO *io, ut64 from, ut64 to) { RListIter *iter, *iter_tmp; RIOCache *c; if (from>=to) return R_FALSE; r_list_foreach_safe (io->cache, iter, iter_tmp, c) { if (c->from >= from && c->to <= to) { r_list_delete (io->cache, iter); } } return R_FALSE; } R_API int r_io_cache_list(RIO *io, int rad) { int i, j = 0; RListIter *iter; RIOCache *c; r_list_foreach (io->cache, iter, c) { if (rad) { io->printf ("wx "); for (i=0; i<c->size; i++) io->printf ("%02x", c->data[i]); io->printf (" @ 0x%08"PFMT64x"\n", c->from); } else { io->printf ("idx=%d addr=0x%08"PFMT64x" size=%d ", j, c->from, c->size); for (i=0; i<c->size; i++) io->printf ("%02x", c->data[i]); io->printf ("\n"); } j++; } return R_FALSE; } R_API int r_io_cache_write(RIO *io, ut64 addr, const ut8 *buf, int len) { RIOCache *ch = R_NEW (RIOCache); ch->from = addr; ch->to = addr + len; ch->size = len; ch->data = (ut8*)malloc (len); memcpy (ch->data, buf, len); r_list_append (io->cache, ch); return len; } R_API int r_io_cache_read(RIO *io, ut64 addr, ut8 *buf, int len) { int l, ret, da, db; RListIter *iter; RIOCache *c; r_list_foreach (io->cache, iter, c) { if (r_range_overlap (addr, addr+len-1, c->from, c->to, &ret)) { if (ret>0) { da = ret; db = 0; l = c->size-da; } else if (ret<0) { da = 0; db = -ret; l = c->size-db; } else { da = 0; db = 0; l = c->size; } if (l>len) l = len; if (l<1) l = 1; // XXX: fail else memcpy (buf+da, c->data+db, l); } } return len; }
// you can call this function to create a window to tweak a float value // if it is called multiple times, it will add more tweakable bars to that window void tweak(float *var);
/*- * Copyright (c) 2003-2017 Lev Walkin <[email protected]>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #ifndef ASN_TYPE_NULL_H #define ASN_TYPE_NULL_H #include <asn_application.h> #ifdef __cplusplus extern "C" { #endif /* * The value of the NULL type is meaningless. * Use the BOOLEAN type if you need to carry true/false semantics. */ typedef int NULL_t; extern asn_TYPE_descriptor_t asn_DEF_NULL; extern asn_TYPE_operation_t asn_OP_NULL; asn_struct_free_f NULL_free; asn_struct_print_f NULL_print; asn_struct_compare_f NULL_compare; ber_type_decoder_f NULL_decode_ber; der_type_encoder_f NULL_encode_der; xer_type_decoder_f NULL_decode_xer; xer_type_encoder_f NULL_encode_xer; oer_type_decoder_f NULL_decode_oer; oer_type_encoder_f NULL_encode_oer; per_type_decoder_f NULL_decode_uper; per_type_encoder_f NULL_encode_uper; per_type_decoder_f NULL_decode_aper; per_type_encoder_f NULL_encode_aper; asn_random_fill_f NULL_random_fill; #define NULL_constraint asn_generic_no_constraint #ifdef __cplusplus } #endif #endif /* NULL_H */
#ifndef __TARGET_CORE_USER_H #define __TARGET_CORE_USER_H /* This header will be used by application too */ #include <linux/types.h> #include <linux/uio.h> #define TCMU_VERSION "2.0" /* * Ring Design * ----------- * * The mmaped area is divided into three parts: * 1) The mailbox (struct tcmu_mailbox, below) * 2) The command ring * 3) Everything beyond the command ring (data) * * The mailbox tells userspace the offset of the command ring from the * start of the shared memory region, and how big the command ring is. * * The kernel passes SCSI commands to userspace by putting a struct * tcmu_cmd_entry in the ring, updating mailbox->cmd_head, and poking * userspace via uio's interrupt mechanism. * * tcmu_cmd_entry contains a header. If the header type is PAD, * userspace should skip hdr->length bytes (mod cmdr_size) to find the * next cmd_entry. * * Otherwise, the entry will contain offsets into the mmaped area that * contain the cdb and data buffers -- the latter accessible via the * iov array. iov addresses are also offsets into the shared area. * * When userspace is completed handling the command, set * entry->rsp.scsi_status, fill in rsp.sense_buffer if appropriate, * and also set mailbox->cmd_tail equal to the old cmd_tail plus * hdr->length, mod cmdr_size. If cmd_tail doesn't equal cmd_head, it * should process the next packet the same way, and so on. */ #define TCMU_MAILBOX_VERSION 2 #define ALIGN_SIZE 64 /* Should be enough for most CPUs */ #define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */ struct tcmu_mailbox { __u16 version; __u16 flags; __u32 cmdr_off; __u32 cmdr_size; __u32 cmd_head; /* Updated by user. On its own cacheline */ __u32 cmd_tail __attribute__((__aligned__(ALIGN_SIZE))); } __packed; enum tcmu_opcode { TCMU_OP_PAD = 0, TCMU_OP_CMD, }; /* * Only a few opcodes, and length is 8-byte aligned, so use low bits for opcode. */ struct tcmu_cmd_entry_hdr { __u32 len_op; __u16 cmd_id; __u8 kflags; #define TCMU_UFLAG_UNKNOWN_OP 0x1 __u8 uflags; } __packed; #define TCMU_OP_MASK 0x7 static inline enum tcmu_opcode tcmu_hdr_get_op(__u32 len_op) { return len_op & TCMU_OP_MASK; } static inline void tcmu_hdr_set_op(__u32 *len_op, enum tcmu_opcode op) { *len_op &= ~TCMU_OP_MASK; *len_op |= (op & TCMU_OP_MASK); } static inline __u32 tcmu_hdr_get_len(__u32 len_op) { return len_op & ~TCMU_OP_MASK; } static inline void tcmu_hdr_set_len(__u32 *len_op, __u32 len) { *len_op &= TCMU_OP_MASK; *len_op |= len; } /* Currently the same as SCSI_SENSE_BUFFERSIZE */ #define TCMU_SENSE_BUFFERSIZE 96 struct tcmu_cmd_entry { struct tcmu_cmd_entry_hdr hdr; union { struct { uint32_t iov_cnt; uint32_t iov_bidi_cnt; uint32_t iov_dif_cnt; uint64_t cdb_off; uint64_t __pad1; uint64_t __pad2; struct iovec iov[0]; } req; struct { uint8_t scsi_status; uint8_t __pad1; uint16_t __pad2; uint32_t __pad3; char sense_buffer[TCMU_SENSE_BUFFERSIZE]; } rsp; }; } __packed; #define TCMU_OP_ALIGN_SIZE sizeof(uint64_t) enum tcmu_genl_cmd { TCMU_CMD_UNSPEC, TCMU_CMD_ADDED_DEVICE, TCMU_CMD_REMOVED_DEVICE, __TCMU_CMD_MAX, }; #define TCMU_CMD_MAX (__TCMU_CMD_MAX - 1) enum tcmu_genl_attr { TCMU_ATTR_UNSPEC, TCMU_ATTR_DEVICE, TCMU_ATTR_MINOR, __TCMU_ATTR_MAX, }; #define TCMU_ATTR_MAX (__TCMU_ATTR_MAX - 1) #endif
../../../linux-headers-3.0.0-12/include/linux/ide.h
// // CHNOrderedCollection.h // // Auther: // ned rihine <[email protected]> // // Copyright (c) 2012 rihine All rights reserved. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef coreHezelnut_classes_CHNOrderedCollection_h #define coreHezelnut_classes_CHNOrderedCollection_h #include "coreHezelnut/classes/CHNSequenceableCollection.h" CHN_EXTERN_C_BEGIN CHN_EXTERN_C_END #endif /* coreHezelnut_classes_CHNOrderedCollection_h */ // Local Variables: // coding: utf-8 // End:
#include "config.h" #include "syshead.h" #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <setjmp.h> #include <cmocka.h> #include <assert.h> #include "argv.h" #include "buffer.h" /* Defines for use in the tests and the mock parse_line() */ #define PATH1 "/s p a c e" #define PATH2 "/foo bar/baz" #define PARAM1 "param1" #define PARAM2 "param two" #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\"" int __wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num, int msglevel, struct gc_arena *gc) { p[0] = PATH1 PATH2; p[1] = PARAM1; p[2] = PARAM2; return 3; } static void argv_printf__multiple_spaces_in_format__parsed_as_one(void **state) { struct argv a = argv_new(); argv_printf(&a, " %s %s %d ", PATH1, PATH2, 42); assert_int_equal(a.argc, 3); argv_reset(&a); } static void argv_printf_cat__multiple_spaces_in_format__parsed_as_one(void **state) { struct argv a = argv_new(); argv_printf(&a, "%s ", PATH1); argv_printf_cat(&a, " %s %s", PATH2, PARAM1); assert_int_equal(a.argc, 3); argv_reset(&a); } static void argv_printf__combined_path_with_spaces__argc_correct(void **state) { struct argv a = argv_new(); argv_printf(&a, "%s%sc", PATH1, PATH2); assert_int_equal(a.argc, 1); argv_printf(&a, "%s%sc %d", PATH1, PATH2, 42); assert_int_equal(a.argc, 2); argv_printf(&a, "foo %s%sc %s x y", PATH2, PATH1, "foo"); assert_int_equal(a.argc, 5); argv_reset(&a); } static void argv_parse_cmd__command_string__argc_correct(void **state) { struct argv a = argv_new(); argv_parse_cmd(&a, SCRIPT_CMD); assert_int_equal(a.argc, 3); argv_reset(&a); } static void argv_parse_cmd__command_and_extra_options__argc_correct(void **state) { struct argv a = argv_new(); argv_parse_cmd(&a, SCRIPT_CMD); argv_printf_cat(&a, "bar baz %d %s", 42, PATH1); assert_int_equal(a.argc, 7); argv_reset(&a); } static void argv_printf_cat__used_twice__argc_correct(void **state) { struct argv a = argv_new(); argv_printf(&a, "%s %s %s", PATH1, PATH2, PARAM1); argv_printf_cat(&a, "%s", PARAM2); argv_printf_cat(&a, "foo"); assert_int_equal(a.argc, 5); argv_reset(&a); } static void argv_str__multiple_argv__correct_output(void **state) { struct argv a = argv_new(); struct gc_arena gc = gc_new(); const char *output; argv_printf(&a, "%s%sc", PATH1, PATH2); argv_printf_cat(&a, "%s", PARAM1); argv_printf_cat(&a, "%s", PARAM2); output = argv_str(&a, &gc, PA_BRACKET); assert_string_equal(output, "[" PATH1 PATH2 "] [" PARAM1 "] [" PARAM2 "]"); argv_reset(&a); gc_free(&gc); } static void argv_insert_head__empty_argv__head_only(void **state) { struct argv a = argv_new(); struct argv b; b = argv_insert_head(&a, PATH1); assert_int_equal(b.argc, 1); assert_string_equal(b.argv[0], PATH1); argv_reset(&b); argv_reset(&a); } static void argv_insert_head__non_empty_argv__head_added(void **state) { struct argv a = argv_new(); struct argv b; int i; argv_printf(&a, "%s", PATH2); b = argv_insert_head(&a, PATH1); assert_int_equal(b.argc, a.argc + 1); for (i = 0; i < b.argc; i++) { if (i == 0) { assert_string_equal(b.argv[i], PATH1); } else { assert_string_equal(b.argv[i], a.argv[i - 1]); } } argv_reset(&b); argv_reset(&a); } int main(void) { const struct CMUnitTest tests[] = { cmocka_unit_test(argv_printf__multiple_spaces_in_format__parsed_as_one), cmocka_unit_test(argv_printf_cat__multiple_spaces_in_format__parsed_as_one), cmocka_unit_test(argv_printf__combined_path_with_spaces__argc_correct), cmocka_unit_test(argv_parse_cmd__command_string__argc_correct), cmocka_unit_test(argv_parse_cmd__command_and_extra_options__argc_correct), cmocka_unit_test(argv_printf_cat__used_twice__argc_correct), cmocka_unit_test(argv_str__multiple_argv__correct_output), cmocka_unit_test(argv_insert_head__non_empty_argv__head_added), }; return cmocka_run_group_tests_name("argv", tests, NULL, NULL); }
// Copyright (c) 2016 GeometryFactory Sarl (France) // // This file is part of CGAL (www.cgal.org); 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. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0+ // // // Author : Andreas Fabri #ifndef CGAL_LICENSE_CHECK_H #define CGAL_LICENSE_CHECK_H //#define CGAL_LICENSE_WARNING 1 // in order to get a warning during compilation //#define CGAL_LICENSE_ERROR 1 // in order to get an error during compilation // if no such define exists, the package is used under the GPL or LGPL // Otherwise the number encodes the date year/month/day // Any release made b...... // e.g. //#define CGAL_AABB_TREE_COMMERCIAL_LICENSE 20140101 #endif // CGAL_LICENSE_CHECK_H
#ifndef FONTDIALOG_H #define FONTDIALOG_H #include "DialogBox.h" class FontSelector; // Font selection widget class FXAPI FontSelector : public FXPacker { FXDECLARE(FontSelector) protected: FXTextField *family; FXList *familylist; FXTextField *weight; FXList *weightlist; FXTextField *style; FXList *stylelist; FXTextField *size; FXList *sizelist; FXComboBox *charset; FXComboBox *setwidth; FXComboBox *pitch; FXCheckButton *scalable; FXCheckButton *allfonts; FXButton *accept; FXButton *cancel; FXLabel *preview; FXFont *previewfont; FXFontDesc selected; protected: FontSelector() {} void listFontFaces(); void listWeights(); void listSlants(); void listFontSizes(); void previewFont(); private: FontSelector(const FontSelector&); FontSelector &operator=(const FontSelector&); public: long onCmdFamily(FXObject*,FXSelector,void*); long onCmdWeight(FXObject*,FXSelector,void*); long onCmdStyle(FXObject*,FXSelector,void*); long onCmdStyleText(FXObject*,FXSelector,void*); long onCmdSize(FXObject*,FXSelector,void*); long onCmdSizeText(FXObject*,FXSelector,void*); long onCmdCharset(FXObject*,FXSelector,void*); long onUpdCharset(FXObject*,FXSelector,void*); long onCmdSetWidth(FXObject*,FXSelector,void*); long onUpdSetWidth(FXObject*,FXSelector,void*); long onCmdPitch(FXObject*,FXSelector,void*); long onUpdPitch(FXObject*,FXSelector,void*); long onCmdScalable(FXObject*,FXSelector,void*); long onUpdScalable(FXObject*,FXSelector,void*); long onCmdAllFonts(FXObject*,FXSelector,void*); long onUpdAllFonts(FXObject*,FXSelector,void*); public: enum{ ID_FAMILY=FXPacker::ID_LAST, ID_WEIGHT, ID_STYLE, ID_STYLE_TEXT, ID_SIZE, ID_SIZE_TEXT, ID_CHARSET, ID_SETWIDTH, ID_PITCH, ID_SCALABLE, ID_ALLFONTS, ID_LAST }; public: // Constructor FontSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,unsigned int opts=0,int x=0,int y=0,int w=0,int h=0); // Create server-side resources virtual void create(); // Return a pointer to the "Accept" button FXButton *acceptButton() const { return accept; } // Return a pointer to the "Cancel" button FXButton *cancelButton() const { return cancel; } // Set font selection void setFontSelection(const FXFontDesc& fontdesc); // Get font selection void getFontSelection(FXFontDesc& fontdesc) const; // Save to a stream virtual void save(FXStream& store) const; // Load from a stream virtual void load(FXStream& store); // Destructor virtual ~FontSelector(); }; // Font selection dialog class FXAPI FontDialog : public DialogBox { FXDECLARE(FontDialog) protected: FontSelector *fontbox; protected: FontDialog() {} private: FontDialog(const FontDialog&); FontDialog &operator=(const FontDialog&); public: // Constructor FontDialog(FXWindow* owner,const FXString& name,unsigned int opts=0,int x=0,int y=0,int w=750,int h=480); // Save dialog to a stream virtual void save(FXStream& store) const; // Load dialog from a stream virtual void load(FXStream& store); // Set the current font selection void setFontSelection(const FXFontDesc& fontdesc); // Get the current font selection void getFontSelection(FXFontDesc& fontdesc) const; // Destructor virtual ~FontDialog(); }; #endif
#ifndef __BUF_H #define __BUF_H #include <const.h> struct buf { uint flag; struct buf *prev; struct buf *next; struct buf *io_prev; struct buf *io_next; uint dev; uint sector; uchar data[BLK_SIZE]; }; struct dev { uint active; struct buf *prev; struct buf *next; struct buf *io_prev; struct buf *io_next; }; #define B_BUSY 0b1 #define B_VALID 0b10 #define B_DIRTY 0b100 #define B_ERROR 0b1000 extern struct buf buffer[NBUF]; extern struct buf bfreelist; extern struct dev hd_dev; void buf_init(); struct buf* buf_get(uint dev, uint sector); int buf_relse(struct buf* bp); struct buf* buf_read(uint dev, uint sector); int buf_write(struct buf* b); void dump_buf(struct buf* buf); void hexdump_buf(struct buf* buf); void dump_buffer_freelist(); #endif
/* This file is part of the hkl library. * * The hkl library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The hkl library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with the hkl library. If not, see <http://www.gnu.org/licenses/>. * * Copyright (C) 2003-2015 Synchrotron SOLEIL * L'Orme des Merisiers Saint-Aubin * BP 48 91192 GIF-sur-YVETTE CEDEX * * Authors: Picca Frédéric-Emmanuel <[email protected]> */ #include "hkl.h" #include <tap/basic.h> #include <tap/float.h> #include "hkl-vector-private.h" #include "hkl-matrix-private.h" /* we will check also the private API */ static void init(void) { HklMatrix m; hkl_matrix_init(&m, 1, 1, 0, 0, 1, 0, 0, 0, 1); is_double(1., m.data[0][0], HKL_EPSILON, __func__); is_double(1., m.data[0][1], HKL_EPSILON, __func__); is_double(0., m.data[0][2], HKL_EPSILON, __func__); is_double(0., m.data[1][0], HKL_EPSILON, __func__); is_double(1., m.data[1][1], HKL_EPSILON, __func__); is_double(0., m.data[1][2], HKL_EPSILON, __func__); is_double(0., m.data[2][0], HKL_EPSILON, __func__); is_double(0., m.data[2][1], HKL_EPSILON, __func__); is_double(1., m.data[2][2], HKL_EPSILON, __func__); } static void cmp(void) { HklMatrix m1 = {{{0.0, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}}}; HklMatrix m2 = {{{1.0, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}}}; ok(TRUE == hkl_matrix_cmp(&m1, &m1), __func__); ok(FALSE == hkl_matrix_cmp(&m1, &m2), __func__); } static void assignement(void) { HklMatrix m1 = {{{0.0, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}}}; HklMatrix m; m = m1; ok(TRUE == hkl_matrix_cmp(&m1, &m), __func__); } static void init_from_euler(void) { HklMatrix m_ref = {{{ 1./2., -1./2., sqrt(2)/2.}, { sqrt(2.)/4.+1./2., -sqrt(2.)/4.+1./2., -1./2.}, {-sqrt(2.)/4.+1./2., sqrt(2.)/4.+1./2., 1./2.}}}; HklMatrix m; hkl_matrix_init_from_euler(&m, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } static void init_from_two_vector(void) { HklVector v1 = {{0.0, 1.0, 2.0}}; HklVector v2 = {{1.0, 2.0, 3.0}}; HklMatrix m_ref = {{{0.0, 5.0 / sqrt(30.0), -1.0 / sqrt(6.0)}, {1.0 / sqrt(5.0), 2.0 / sqrt(30.0), 2.0 / sqrt(6.0)}, {2.0 / sqrt(5.0),-1.0 / sqrt(30.0), -1.0 / sqrt(6.0)}} }; HklMatrix m; hkl_matrix_init_from_two_vector(&m, &v1, &v2); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } static void times_vector(void) { HklMatrix m = {{{ 1.0, 3.0,-2.0}, {10.0, 5.0, 5.0}, {-3.0, 2.0, 0.0}} }; HklVector v = {{1, 2, 3}}; HklVector v_ref = {{1, 35, 1}}; hkl_matrix_times_vector(&m, &v); ok(0 == hkl_vector_cmp(&v_ref, &v), __func__); } static void times_matrix(void) { HklMatrix m_ref = {{{37., 14., 13.}, {45., 65., 5.}, {17., 1., 16.}} }; HklMatrix m = {{{ 1., 3.,-2.}, {10., 5., 5.}, {-3., 2., 0.}} }; hkl_matrix_times_matrix(&m, &m); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } static void transpose(void) { HklMatrix m_ref = {{{37., 14., 13.}, {45., 65., 5.}, {17., 1., 16.}} }; HklMatrix m = {{{37., 45., 17.}, {14., 65., 1.}, {13., 5., 16.}} }; hkl_matrix_transpose(&m); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } int main(void) { plan(17); init(); cmp(); assignement(); init_from_euler(); init_from_two_vector(); times_vector(); times_matrix(); transpose(); return 0; }
#ifndef PLUGINMANAGER_H #define PLUGINMANAGER_H #include <QDialog> #include <QIcon> #include <QString> #include <QHash> #include <QList> #include <SPlugin> #include "spluginengine.h" #include "perconf.h" namespace Ui { class LoadedPlugins; } class PluginManager : public QObject { Q_OBJECT public: PluginManager( PerConf *conf , const QString & pluginsDirectory , QWidget *parent = 0 ); ~PluginManager(); void refreshUI(); void detect(); void setStyleSheet( const QString & style ); public slots: void show(); void hide(); void pluginStarted( SPlugin *plugin ); void pluginStopped( SPlugin *plugin ); private slots: void currentCellChanged( int row , int col ); void stop_start_CurrentItem(); private: void save(); void loadSaved(); bool defaultActived( const QString & name ) const; private: Ui::LoadedPlugins *ui; QDialog *dialog; QList<SPlugin *> startedPlugins; QHash<QString,SPlugin *> loadedPlugins; QHash<QString,SPluginEngine *> plugins_hash; QString plugin_dir_str; PerConf *prc; QString style_sheet; }; #endif // PLUGINMANAGER_H
/* * SMDataSignature.h * * Copyright 2019 Avérous Julien-Pierre * * This file is part of SMFoundation. * * SMFoundation 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. * * SMFoundation 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 SMFoundation. If not, see <http://www.gnu.org/licenses/>. * */ #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /* ** SMDataSignature */ #pragma mark - SMDataSignature @interface SMDataSignature : NSObject + (BOOL)validateSignature:(NSData *)signature data:(NSData *)data publicKey:(NSData *)publicKey; @end NS_ASSUME_NONNULL_END
//============================================================================ // Name : BoxyLady // Author : Darren Green // Copyright : (C) Darren Green 2011-2020 // Description : Music sequencer // // License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> // This is free software; you are free to change and redistribute it. // There is NO WARRANTY, to the extent permitted by law. // Contact: [email protected] http://www.pinkmongoose.co.uk //============================================================================ #ifndef DICTIONARY_H_ #define DICTIONARY_H_ #include <unordered_map> #include "Global.h" #include "Sequence.h" #include "Blob.h" namespace BoxyLady { enum class dic_item_protection { temp, normal, locked, system, active }; enum class dic_item_type { null, patch, macro }; class DictionaryItem; class Dictionary; class DictionaryMutex; class DictionaryItem { friend class DictionaryMutex; friend class Dictionary; private: int semaphor_; dic_item_type type_; dic_item_protection protection_level_; Blob macro_; Sequence sequence_; public: DictionaryItem(dic_item_type type = dic_item_type::null) : semaphor_(0), type_(type), protection_level_( dic_item_protection::normal) { } dic_item_protection ProtectionLevel() const { return protection_level_; } void Protect(dic_item_protection level) { protection_level_ = level; } bool isMacro() const { return type_ == dic_item_type::macro; } bool isPatch() const { return type_ == dic_item_type::patch; } bool isNull() const { return type_ == dic_item_type::null; } dic_item_type getType() const { return type_; } Blob& getMacro() { return macro_; } Sequence& getSequence() { return sequence_; } static bool ValidName(std::string); }; typedef std::unordered_map<std::string, DictionaryItem> DictionaryType; typedef DictionaryType::iterator DictionaryIterator; typedef std::list<DictionaryIterator> DictionaryIteratorList; class DictionaryMutex { private: DictionaryItem &item_; public: DictionaryMutex(DictionaryItem &item) : item_(item) { item_.semaphor_++; } ~DictionaryMutex() { item_.semaphor_--; } }; class Dictionary { private: DictionaryType dictionary_; DictionaryItem invalid_item_; public: DictionaryIterator begin() { return dictionary_.begin(); } DictionaryIterator end() { return dictionary_.end(); } bool Exists(std::string name) const { auto item = dictionary_.find(name); return item != dictionary_.end(); } DictionaryItem& Find(std::string name) { auto item = dictionary_.find(name); if (item != dictionary_.end()) return item->second; else return invalid_item_; } Sequence& FindSequence(std::string name) { return Find(name).sequence_; } Sequence& FindSequence(Blob &Q) { const std::string name = Q["@"].atom(); return FindSequence(name); } DictionaryItem& Insert(DictionaryItem item, std::string name) { if (!item.ValidName(name)) throw EDictionary().msg(name + ": Illegal character in name."); if (Exists(name)) throw EDictionary().msg(name + ": Name already used."); dictionary_.insert( { { name, item } }); return Find(name); } Sequence& InsertSequence(std::string name) { DictionaryItem item; item.type_ = dic_item_type::patch; return Insert(item, name).sequence_; } bool Delete(std::string name, bool protect = false) { auto item = dictionary_.find(name); if (item != dictionary_.end()) { if (item->second.semaphor_) return false; if (protect && (item->second.protection_level_ > dic_item_protection::normal)) return false; else { dictionary_.erase(item); return true; } } else return false; } void Clear(bool protect = false) { DictionaryIteratorList list; for (auto item = dictionary_.begin(); item != dictionary_.end(); item++) { if (!item->second.semaphor_) if ((!protect) || (item->second.protection_level_ <= dic_item_protection::normal)) list.push_back(item); } for (auto it : list) dictionary_.erase(it); } void Rename(std::string old_name, std::string new_name) { auto node = dictionary_.extract(old_name); //@suppress("Method cannot be resolved") node.key() = new_name; //@suppress("Method cannot be resolved") dictionary_.insert(move(node)); //@suppress("Invalid arguments") @suppress("Function cannot be resolved") } void ListEntries(Blob &Q); static void WriteSlotProtection(std::string&, dic_item_protection); template<class T> static void SWrite(std::string&, T, int); }; } #endif /* DICTIONARY_H_ */
/* * Generated by class-dump 3.1.2. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard. */ #import "_ABCreateStringWithAddressDictionary.h" @interface _ABCreateStringWithAddressDictionary (RMStore) - (id)rm_transaction; - (id)rm_storeError; - (id)rm_storeDownload; - (id)rm_products; - (id)rm_productIdentifier; - (id)rm_invalidProductIdentifiers; - (float)rm_downloadProgress; @end
#ifndef VALUE_H_ #define VALUE_H_ // Cost parameters #define CARCOST 100 #define TICKETCOST 300 #define CENTSPERLITRE 130 #define METERSPERLITRE 15000 // Headers #include <limits.h> #include <immintrin.h> #include "instance.h" #include "random.h" #include "macros.h" #include "types.h" #define COST(I, DR, L) ((DR)[(I)] ? (PATHCOST((L)[I]) + CARCOST) : TICKETCOST) #define PATHCOST(p) ROUND(value, (float)(p) / METERSPERLITRE * CENTSPERLITRE) #define EURO(i) ((float)(i) / 100) #define R5 2520 #define R4 90 #define R3 6 meter minpath(agent *c, agent n, agent dr, const meter *sp); #endif /* VALUE_H_ */
/* «Camelion» - Perl storable/C struct back-and-forth translator * * Copyright (C) Alexey Shishkin 2016 * * This file is part of Project «Camelion». * * Project «Camelion» 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. * * Project «Camelion» 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 Project «Camelion». If not, see <http://www.gnu.org/licenses/>. */ #include "../serials/sread.h" CML_Error CML_SerialsReadINT8(CML_Bytes * bytes, uint32_t * bpos, int8_t * result) { if (*bpos + sizeof(int8_t) > bytes->size) return CML_ERROR_USER_BADDATA; *result = bytes->data[*bpos]; *bpos += 1; /* Need to reverse signed char */ /* It's a perl thing */ *result ^= 1 << 7; return CML_ERROR_SUCCESS; } CML_Error CML_SerialsReadUINT8(CML_Bytes * bytes, uint32_t * bpos, uint8_t * result) { if (*bpos + sizeof(uint8_t) > bytes->size) return CML_ERROR_USER_BADDATA; *result = bytes->data[*bpos]; *bpos += 1; return CML_ERROR_SUCCESS; } CML_Error CML_SerialsReadINT32(CML_Bytes * bytes, uint32_t * bpos, int32_t * result) { if (*bpos + sizeof(int32_t) > bytes->size) return CML_ERROR_USER_BADDATA; union { int32_t res; uint8_t bytes[sizeof(int32_t)]; } conv; uint32_t i; for (i = 0; i < sizeof(int32_t); i++, *bpos += 1) conv.bytes[3 - i] = bytes->data[*bpos]; *result = conv.res; return CML_ERROR_SUCCESS; } CML_Error CML_SerialsReadUINT32(CML_Bytes * bytes, uint32_t * bpos, uint32_t * result) { if (*bpos + sizeof(uint32_t) > bytes->size) return CML_ERROR_USER_BADDATA; union { uint32_t res; uint8_t bytes[sizeof(uint32_t)]; } conv; uint32_t i; for (i = 0; i < sizeof(uint32_t); i++, *bpos += 1) conv.bytes[3 - i] = bytes->data[*bpos]; *result = conv.res; return CML_ERROR_SUCCESS; } CML_Error CML_SerialsReadDATA(CML_Bytes * bytes, uint32_t * bpos, uint8_t * result, uint32_t length) { if (*bpos + length > bytes->size) return CML_ERROR_USER_BADDATA; uint32_t i; for (i = 0; i < length; i++, *bpos += 1) result[i] = bytes->data[*bpos]; result[i] = '\0'; return CML_ERROR_SUCCESS; }
/** * Copyright (c) 2006-2014 LOVE Development Team * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. **/ #ifndef LOVE_JOYSTICK_WRAP_JOYSTICK_H #define LOVE_JOYSTICK_WRAP_JOYSTICK_H // LOVE #include "common/config.h" #include "Joystick.h" #include "common/runtime.h" namespace love { namespace joystick { Joystick *luax_checkjoystick(lua_State *L, int idx); int w_Joystick_isConnected(lua_State *L); int w_Joystick_getName(lua_State *L); int w_Joystick_getID(lua_State *L); int w_Joystick_getGUID(lua_State *L); int w_Joystick_getAxisCount(lua_State *L); int w_Joystick_getButtonCount(lua_State *L); int w_Joystick_getHatCount(lua_State *L); int w_Joystick_getAxis(lua_State *L); int w_Joystick_getAxes(lua_State *L); int w_Joystick_getHat(lua_State *L); int w_Joystick_isDown(lua_State *L); int w_Joystick_isGamepad(lua_State *L); int w_Joystick_getGamepadAxis(lua_State *L); int w_Joystick_isGamepadDown(lua_State *L); int w_Joystick_isVibrationSupported(lua_State *L); int w_Joystick_setVibration(lua_State *L); int w_Joystick_getVibration(lua_State *L); extern "C" int luaopen_joystick(lua_State *L); } // joystick } // love #endif // LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H
/* Copyright (C) 2011 Srivats P. This file is part of "Ostinato" 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 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 _ETH2_PDML_H #define _ETH2_PDML_H #include "pdmlprotocol.h" class PdmlEthProtocol : public PdmlProtocol { public: static PdmlProtocol* createInstance(); virtual void unknownFieldHandler(QString name, int pos, int size, const QXmlStreamAttributes &attributes, OstProto::Protocol *pbProto, OstProto::Stream *stream); virtual void postProtocolHandler(OstProto::Protocol *pbProto, OstProto::Stream *stream); protected: PdmlEthProtocol(); }; #endif
/* * Copyright 2013, winocm. <[email protected]> * 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. * * If you are going to use this software in any form that does not involve * releasing the source to this project or improving it, let me know beforehand. * * 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. */ /* * Compatibility support to bridge old pe_arm_xxx api and new * AWESOME SOC DISPATCH STUFF. */ #include <mach/mach_types.h> #include <pexpert/pexpert.h> #include <pexpert/arm/protos.h> #include <pexpert/arm/boot.h> #include <machine/machine_routines.h> #include <kern/debug.h> /** * pe_arm_init_interrupts * * Initialize the SoC dependent interrrupt controller. */ uint32_t pe_arm_init_interrupts(__unused void *args) { if (gPESocDispatch.interrupt_init == NULL) panic("gPESocDispatch.interrupt_init was null, did you forget to set up the table?"); gPESocDispatch.interrupt_init(); return 0; } /** * pe_arm_init_timebase * * Initialize the SoC dependent timebase. */ uint32_t pe_arm_init_timebase(__unused void *args) { if (gPESocDispatch.timebase_init == NULL) panic("gPESocDispatch.timebase_init was null, did you forget to set up the table?"); gPESocDispatch.timebase_init(); return 0; } /** * pe_arm_dispatch_interrupt * * Dispatch IRQ requests to the SoC specific handler. */ boolean_t pe_arm_dispatch_interrupt(void *context) { if (gPESocDispatch.handle_interrupt == NULL) panic("gPESocDispatch.handle_interrupt was null, did you forget to set up the table?"); gPESocDispatch.handle_interrupt(context); return TRUE; } /** * pe_arm_get_timebase * * Get current system timebase from the SoC handler. */ uint64_t pe_arm_get_timebase(__unused void *args) { if (gPESocDispatch.get_timebase == NULL) panic("gPESocDispatch.get_timebase was null, did you forget to set up the table?"); return gPESocDispatch.get_timebase(); } /** * pe_arm_set_timer_enabled * * Set platform timer enabled status. */ void pe_arm_set_timer_enabled(boolean_t enable) { if (gPESocDispatch.timer_enabled == NULL) panic("gPESocDispatch.timer_enabled was null, did you forget to set up the table?"); gPESocDispatch.timer_enabled(enable); } /* * iOS like functionality. */ uint32_t debug_enabled = 1; uint32_t PE_i_can_has_debugger(uint32_t * pe_debug) { if (pe_debug) { if (debug_enabled) *pe_debug = 1; else *pe_debug = 0; } return debug_enabled; } uint32_t PE_get_security_epoch(void) { return 0; }
/* * AverMedia RM-KS remote controller keytable * * Copyright (C) 2010 Antti Palosaari <[email protected]> * * 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. */ #include <media/rc-map.h> #include <linux/module.h> /* Initial keytable is from Jose Alberto Reguero <[email protected]> and Felipe Morales Moreno <[email protected]> */ /* Keytable fixed by Philippe Valembois <[email protected]> */ static struct rc_map_table avermedia_rm_ks[] = { { 0x0501, KEY_POWER2 }, /* Power (RED POWER BUTTON) */ { 0x0502, KEY_CHANNELUP }, /* Channel+ */ { 0x0503, KEY_CHANNELDOWN }, /* Channel- */ { 0x0504, KEY_VOLUMEUP }, /* Volume+ */ { 0x0505, KEY_VOLUMEDOWN }, /* Volume- */ { 0x0506, KEY_MUTE }, /* Mute */ { 0x0507, KEY_AGAIN }, /* Recall */ { 0x0508, KEY_VIDEO }, /* Source */ { 0x0509, KEY_1 }, /* 1 */ { 0x050a, KEY_2 }, /* 2 */ { 0x050b, KEY_3 }, /* 3 */ { 0x050c, KEY_4 }, /* 4 */ { 0x050d, KEY_5 }, /* 5 */ { 0x050e, KEY_6 }, /* 6 */ { 0x050f, KEY_7 }, /* 7 */ { 0x0510, KEY_8 }, /* 8 */ { 0x0511, KEY_9 }, /* 9 */ { 0x0512, KEY_0 }, /* 0 */ { 0x0513, KEY_AUDIO }, /* Audio */ { 0x0515, KEY_EPG }, /* EPG */ { 0x0516, KEY_PLAYPAUSE }, /* Play/Pause */ { 0x0517, KEY_RECORD }, /* Record */ { 0x0518, KEY_STOP }, /* Stop */ { 0x051c, KEY_BACK }, /* << */ { 0x051d, KEY_FORWARD }, /* >> */ { 0x054d, KEY_INFO }, /* Display information */ { 0x0556, KEY_ZOOM }, /* Fullscreen */ }; static struct rc_map_list avermedia_rm_ks_map = { .map = { .scan = avermedia_rm_ks, .size = ARRAY_SIZE(avermedia_rm_ks), .rc_type = RC_TYPE_NEC, .name = RC_MAP_AVERMEDIA_RM_KS, } }; static int __init init_rc_map_avermedia_rm_ks(void) { return rc_map_register(&avermedia_rm_ks_map); } static void __exit exit_rc_map_avermedia_rm_ks(void) { rc_map_unregister(&avermedia_rm_ks_map); } module_init(init_rc_map_avermedia_rm_ks) module_exit(exit_rc_map_avermedia_rm_ks) MODULE_LICENSE("GPL"); MODULE_AUTHOR("Antti Palosaari <[email protected]>");
#ifndef _TREENODE_H #define _TREENODE_H #include <stdio.h> #include <stdbool.h> #include <wptypes.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _wp_treenode wp_tree_node_t; typedef enum _rb_wp_tree_node_cloor { RB_TREE_RED = 0, RB_TREE_BLACK, } wp_rb_tree_node_color_t; wp_tree_node_t *wp_tree_node_new (void); wp_tree_node_t *wp_tree_node_new_full (void *content, wp_tree_node_t *parent, wp_tree_node_t *left, wp_tree_node_t *right); void wp_tree_node_copy (wp_tree_node_t *dest, const wp_tree_node_t *src); void wp_tree_node_free (wp_tree_node_t *node); void wp_tree_node_set_content (wp_tree_node_t *node, void *data); void wp_tree_node_set_parent (wp_tree_node_t *node, wp_tree_node_t *parent); void wp_tree_node_set_left (wp_tree_node_t *node, wp_tree_node_t *left); void wp_tree_node_set_right (wp_tree_node_t *node, wp_tree_node_t *right); void *wp_tree_node_get_content (const wp_tree_node_t *node); wp_tree_node_t *wp_tree_node_get_parent (const wp_tree_node_t *node); wp_tree_node_t *wp_tree_node_get_left (const wp_tree_node_t *node); wp_tree_node_t *wp_tree_node_get_right (const wp_tree_node_t *node); int wp_tree_node_is_leaf (const wp_tree_node_t *node); int wp_tree_node_is_root (const wp_tree_node_t *node); void wp_tree_node_dump (const wp_tree_node_t *node, FILE *file, wp_write_func_t f, void *data); /* For Red-Black Tree */ void wp_tree_node_set_red (wp_tree_node_t *node); void wp_tree_node_set_black (wp_tree_node_t *node); int wp_tree_node_is_red (const wp_tree_node_t *node); int wp_tree_node_is_black (const wp_tree_node_t *node); wp_rb_tree_node_color_t wp_tree_node_get_color (const wp_tree_node_t *node); void wp_tree_node_set_color (wp_tree_node_t *node, wp_rb_tree_node_color_t color); void wp_tree_node_copy_color (wp_tree_node_t *dest, const wp_tree_node_t *src); void rb_wp_tree_node_dump (const wp_tree_node_t *node, FILE *file, wp_write_func_t f, void *data); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _TREENODE_H */
/****************************************************************************** * * Copyright 2010, Dream Chip Technologies GmbH. All rights reserved. * No part of this work may be reproduced, modified, distributed, transmitted, * transcribed, or translated into any language or computer format, in any form * or by any means without written permission of: * Dream Chip Technologies GmbH, Steinriede 10, 30827 Garbsen / Berenbostel, * Germany * *****************************************************************************/ /** * @file impexinfo.h * * @brief * Image info for import/export C++ API. * *****************************************************************************/ /** * * @mainpage Module Documentation * * * Doc-Id: xx-xxx-xxx-xxx (NAME Implementation Specification)\n * Author: NAME * * DESCRIBE_HERE * * * The manual is divided into the following sections: * * -@subpage module_name_api_page \n * -@subpage module_name_page \n * * @page module_name_api_page Module Name API * This module is the API for the NAME. DESCRIBE IN DETAIL / ADD USECASES... * * for a detailed list of api functions refer to: * - @ref module_name_api * * @defgroup module_name_api Module Name API * @{ */ #ifndef __IMPEXINFO_H__ #define __IMPEXINFO_H__ #include <string> #include <list> #include <map> class Tag { public: enum Type { TYPE_INVALID = 0, TYPE_BOOL = 1, TYPE_INT = 2, TYPE_UINT32 = 3, TYPE_FLOAT = 4, TYPE_STRING = 5 }; protected: Tag( Type type, const std::string& id ) : m_type (type), m_id (id) { } virtual ~Tag() { } public: Type type() const { return m_type; }; std::string id() const { return m_id; }; template<class T> bool getValue( T& value ) const; template<class T> bool setValue( const T& value ); virtual std::string toString() const= 0; virtual void fromString( const std::string& str ) = 0; private: friend class TagMap; Type m_type; std::string m_id; }; class TagMap { public: typedef std::list<Tag *>::const_iterator const_tag_iterator; typedef std::map<std::string, std::list<Tag *> >::const_iterator const_category_iterator; public: TagMap(); ~TagMap(); private: TagMap (const TagMap& other); TagMap& operator = (const TagMap& other); public: void clear(); bool containes( const std::string& id, const std::string& category = std::string() ) const; template<class T> void insert( const T& value, const std::string& id, const std::string& category = std::string() ); void remove( const std::string& id, const std::string& category = std::string() ); Tag *tag( const std::string& id, const std::string& category = std::string() ) const; const_category_iterator begin() const ; const_category_iterator end() const ; const_tag_iterator begin( const_category_iterator iter ) const ; const_tag_iterator end( const_category_iterator iter ) const ; private: typedef std::list<Tag *>::iterator tag_iterator; typedef std::map<std::string, std::list<Tag *> >::iterator category_iterator; std::map<std::string, std::list<Tag *> > m_data; }; /** * @brief ImageExportInfo class declaration. */ class ImageExportInfo : public TagMap { public: ImageExportInfo( const char *fileName ); ~ImageExportInfo(); public: const char *fileName() const; void write() const; private: std::string m_fileName; }; /* @} module_name_api*/ #endif /*__IMPEXINFO_H__*/
#include "buttons.c"
/* * Beautiful Capi generates beautiful C API wrappers for your C++ classes * Copyright (C) 2015 Petr Petrovich Petrov * * This file is part of Beautiful Capi. * * Beautiful Capi 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. * * Beautiful Capi 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 Beautiful Capi. If not, see <http://www.gnu.org/licenses/>. * */ /* * WARNING: This file was automatically generated by Beautiful Capi! * Do not edit this file! Please edit the source API description. */ #ifndef POINTSET_POINTS_DEFINITION_INCLUDED #define POINTSET_POINTS_DEFINITION_INCLUDED #include "PointSet/PointsDecl.h" #include "PointSet/Position.h" #ifdef __cplusplus inline PointSet::PointsPtr::PointsPtr() { SetObject(PointSet::PointsPtr(PointSet::PointsPtr::force_creating_from_raw_pointer, point_set_points_default(), false).Detach()); } inline size_t PointSet::PointsPtr::Size() const { return point_set_points_size_const(GetRawPointer()); } inline void PointSet::PointsPtr::Reserve(size_t capacity) { point_set_points_reserve(GetRawPointer(), capacity); } inline void PointSet::PointsPtr::Resize(size_t size, const PointSet::Position& default_value) { point_set_points_resize(GetRawPointer(), size, default_value.GetRawPointer()); } inline PointSet::Position PointSet::PointsPtr::GetElement(size_t index) const { return PointSet::Position(PointSet::Position::force_creating_from_raw_pointer, point_set_points_get_element_const(GetRawPointer(), index), false); } inline void PointSet::PointsPtr::SetElement(size_t index, const PointSet::Position& value) { point_set_points_set_element(GetRawPointer(), index, value.GetRawPointer()); } inline void PointSet::PointsPtr::PushBack(const PointSet::Position& value) { point_set_points_push_back(GetRawPointer(), value.GetRawPointer()); } inline void PointSet::PointsPtr::Clear() { point_set_points_clear(GetRawPointer()); } inline PointSet::PointsPtr::PointsPtr(const PointsPtr& other) { SetObject(other.GetRawPointer()); if (other.GetRawPointer()) { point_set_points_add_ref(other.GetRawPointer()); } } #ifdef POINTSET_CPP_COMPILER_HAS_RVALUE_REFERENCES inline PointSet::PointsPtr::PointsPtr(PointsPtr&& other) { mObject = other.mObject; other.mObject = 0; } #endif /* POINTSET_CPP_COMPILER_HAS_RVALUE_REFERENCES */ inline PointSet::PointsPtr::PointsPtr(PointSet::PointsPtr::ECreateFromRawPointer, void *object_pointer, bool add_ref_object) { SetObject(object_pointer); if (add_ref_object && object_pointer) { point_set_points_add_ref(object_pointer); } } inline PointSet::PointsPtr::~PointsPtr() { if (GetRawPointer()) { point_set_points_release(GetRawPointer()); SetObject(0); } } inline PointSet::PointsPtr& PointSet::PointsPtr::operator=(const PointSet::PointsPtr& other) { if (GetRawPointer() != other.GetRawPointer()) { if (GetRawPointer()) { point_set_points_release(GetRawPointer()); SetObject(0); } SetObject(other.GetRawPointer()); if (other.GetRawPointer()) { point_set_points_add_ref(other.GetRawPointer()); } } return *this; } #ifdef POINTSET_CPP_COMPILER_HAS_RVALUE_REFERENCES inline PointSet::PointsPtr& PointSet::PointsPtr::operator=(PointSet::PointsPtr&& other) { if (GetRawPointer() != other.GetRawPointer()) { if (GetRawPointer()) { point_set_points_release(GetRawPointer()); SetObject(0); } mObject = other.mObject; other.mObject = 0; } return *this; } #endif /* POINTSET_CPP_COMPILER_HAS_RVALUE_REFERENCES */ inline PointSet::PointsPtr PointSet::PointsPtr::Null() { return PointSet::PointsPtr(PointSet::PointsPtr::force_creating_from_raw_pointer, static_cast<void*>(0), false); } inline bool PointSet::PointsPtr::IsNull() const { return !GetRawPointer(); } inline bool PointSet::PointsPtr::IsNotNull() const { return GetRawPointer() != 0; } inline bool PointSet::PointsPtr::operator!() const { return !GetRawPointer(); } inline void* PointSet::PointsPtr::Detach() { void* result = GetRawPointer(); SetObject(0); return result; } inline void* PointSet::PointsPtr::GetRawPointer() const { return PointSet::PointsPtr::mObject ? mObject: 0; } inline PointSet::PointsPtr* PointSet::PointsPtr::operator->() { return this; } inline const PointSet::PointsPtr* PointSet::PointsPtr::operator->() const { return this; } inline void PointSet::PointsPtr::SetObject(void* object_pointer) { mObject = object_pointer; } #endif /* __cplusplus */ #endif /* POINTSET_POINTS_DEFINITION_INCLUDED */
/*========================================================================= Program: ParaView Module: $RCSfile$ Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkPVKeyFrameAnimationCue // .SECTION Description // vtkPVKeyFrameAnimationCue is a specialization of vtkPVAnimationCue that uses // the vtkPVKeyFrameCueManipulator as the manipulator. #ifndef vtkPVKeyFrameAnimationCue_h #define vtkPVKeyFrameAnimationCue_h #include "vtkPVAnimationCue.h" class vtkPVKeyFrame; class vtkPVKeyFrameCueManipulator; class VTKPVANIMATION_EXPORT vtkPVKeyFrameAnimationCue : public vtkPVAnimationCue { public: vtkTypeMacro(vtkPVKeyFrameAnimationCue, vtkPVAnimationCue); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Forwarded to the internal vtkPVKeyFrameCueManipulator. int AddKeyFrame (vtkPVKeyFrame* keyframe); int GetLastAddedKeyFrameIndex(); void RemoveKeyFrame(vtkPVKeyFrame*); void RemoveAllKeyFrames(); //BTX protected: vtkPVKeyFrameAnimationCue(); ~vtkPVKeyFrameAnimationCue(); vtkPVKeyFrameCueManipulator* GetKeyFrameManipulator(); private: vtkPVKeyFrameAnimationCue(const vtkPVKeyFrameAnimationCue&); // Not implemented void operator=(const vtkPVKeyFrameAnimationCue&); // Not implemented //ETX }; #endif
// <osiris_sps_source_header> // This file is part of Osiris Serverless Portal System. // Copyright (C)2005-2012 Osiris Team ([email protected]) / http://www.osiris-sps.org ) // // Osiris Serverless Portal System 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. // // Osiris Serverless Portal System 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 Osiris Serverless Portal System. If not, see <http://www.gnu.org/licenses/>. // </osiris_sps_source_header> #ifndef _OS_ENGINE_IDEPICKERCOMPONENT_H #define _OS_ENGINE_IDEPICKERCOMPONENT_H #include "ideportalcontrol.h" #include "idepickerselect.h" #include "entitiesentities.h" ////////////////////////////////////////////////////////////////////// OS_NAMESPACE_BEGIN() ////////////////////////////////////////////////////////////////////// class IExtensionsComponent; ////////////////////////////////////////////////////////////////////// class EngineExport IdePickerComponent : public IdePickerSelect { typedef IdePickerSelect ControlBase; // Construction public: IdePickerComponent(); virtual ~IdePickerComponent(); // Attributes public: // Events private: // Operations private: void addComponent(shared_ptr<IExtensionsComponent> component); // IControl interface public: virtual void onLoad(); virtual void onPreRender(); protected: }; ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// OS_NAMESPACE_END() ////////////////////////////////////////////////////////////////////// #endif // _OS_ENGINE_IDEPICKERCOMPONENT_H
/* This file is part of sudoku_systemc Copyright (C) 2012 Julien Thevenon ( julien_thevenon at yahoo.fr ) 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 SUDOKU_INTERNAL_STATE_H #define SUDOKU_INTERNAL_STATE_H #include "sudoku_types.h" #include "cell_listener_if.h" namespace sudoku_systemc { template<unsigned int SIZE> class sudoku_internal_state { public: sudoku_internal_state(const unsigned int & p_sub_x,const unsigned int & p_sub_y,const unsigned int & p_initial_value, cell_listener_if & p_listener); sudoku_internal_state(const sudoku_internal_state<SIZE> & p_initial_state,const unsigned int & p_hypothesis_level); unsigned int get_real_value(const typename sudoku_types<SIZE>::t_data_type & p_value)const; void remove_vertical_candidate(const typename sudoku_types<SIZE>::t_data_type & p_value); void remove_horizontal_candidate(const typename sudoku_types<SIZE>::t_data_type & p_value); void remove_square_candidate(const typename sudoku_types<SIZE>::t_data_type & p_value); void remove_available_value(const typename sudoku_types<SIZE>::t_data_type & p_value); const typename sudoku_types<SIZE>::t_nb_available_values & get_nb_available_values(void)const; const typename sudoku_types<SIZE>::t_data_type make_hypothesis(void); const typename sudoku_types<SIZE>::t_available_values & get_values_to_release(void)const; const typename sudoku_types<SIZE>::t_data_type get_remaining_value(void); // Value management inline const typename sudoku_types<SIZE>::t_data_type & get_value(void)const; inline const bool is_value_set(void)const; void set_value(const typename sudoku_types<SIZE>::t_data_type & p_value); const unsigned int & get_hypothesis_level(void)const; bool is_modified(void)const ; void notify_listener(void); private: void set_horizontal_candidate(const unsigned int & p_index, const typename sudoku_types<SIZE>::t_group_candidate & p_value); void set_vertical_candidate(const unsigned int & p_index, const typename sudoku_types<SIZE>::t_group_candidate & p_value); void set_square_candidate(const unsigned int & p_index, const typename sudoku_types<SIZE>::t_group_candidate & p_value); void set_available_value(const unsigned int & p_index, bool p_value); void set_release_value(const unsigned int & p_index, bool p_value); cell_listener_if & m_listener; typename sudoku_types<SIZE>::t_group_candidate m_vertical_candidates[sudoku_configuration<SIZE>::m_nb_value]; typename sudoku_types<SIZE>::t_group_candidate m_horizontal_candidates[sudoku_configuration<SIZE>::m_nb_value]; typename sudoku_types<SIZE>::t_group_candidate m_square_candidates[sudoku_configuration<SIZE>::m_nb_value]; typename sudoku_types<SIZE>::t_available_values m_available_values; typename sudoku_types<SIZE>::t_nb_available_values m_nb_available_values; typename sudoku_types<SIZE>::t_available_values m_values_to_release; typename sudoku_types<SIZE>::t_data_type m_value; bool m_value_set; unsigned int m_hypothesis_level; bool m_modified; }; } #include "sudoku_internal_state.hpp" #endif // SUDOKU_INTERNAL_STATE_H //EOF
/* * tca6416 keypad platform support * * Copyright (C) 2010 Texas Instruments * * Author: Sriramakrishnan <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _TCA6416_KEYS_H #define _TCA6416_KEYS_H #include <linux/types.h> struct tca6416_button { /* Configuration parameters */ int code; /* input event code (KEY_*, SW_*) */ int active_low; int type; /* input event type (EV_KEY, EV_SW) */ }; struct tca6416_keys_platform_data { struct tca6416_button *buttons; int nbuttons; unsigned int rep: 1; /* enable input subsystem auto repeat */ uint16_t pinmask; uint16_t invert; int irq_is_gpio; int use_polling; /* use polling if Interrupt is not connected*/ }; #endif
/** ****************************************************************************** * @file EEPROM/EEPROM_Emulation/Inc/stm32f4xx_it.h * @author MCD Application Team * @version V1.3.6 * @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 ------------------------------------------------------------------*/ #include "main.h" /* 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); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _DUEL_H_ #define _DUEL_H_ struct duel { int members_count; int invites_count; int max_players_limit; }; #define MAX_DUEL 1024 extern struct duel duel_list[MAX_DUEL]; extern int duel_count; //Duel functions // [LuzZza] int duel_create (struct map_session_data *sd, const unsigned int maxpl); int duel_invite (const unsigned int did, struct map_session_data *sd, struct map_session_data *target_sd); int duel_accept (const unsigned int did, struct map_session_data *sd); int duel_reject (const unsigned int did, struct map_session_data *sd); int duel_leave (const unsigned int did, struct map_session_data *sd); int duel_showinfo (const unsigned int did, struct map_session_data *sd); int duel_checktime (struct map_session_data *sd); int do_init_duel (void); void do_final_duel (void); #endif /* _DUEL_H_ */
/** * Copyright (c) 2012-2015 Piotr Sipika; see the AUTHORS file for more. * * 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. * * See the COPYRIGHT file for more information. */ /* Defines the layout of the location structure */ #ifndef LXWEATHER_LOCATION_HEADER #define LXWEATHER_LOCATION_HEADER #include <glib.h> #include <string.h> /* */ #define LOCATIONINFO_GROUP_NAME "Location" #define LOCATIONINFO_GROUP_NAME_LENGTH strlen(LOCATIONINFO_GROUP_NAME) /* LocationInfo struct definition */ typedef struct { gchar * alias_; gchar * city_; gchar * state_; gchar * country_; gchar * woeid_; gchar units_; guint interval_; gboolean enabled_; } LocationInfo; /* Configuration helpers */ typedef enum { ALIAS = 0, CITY, STATE, COUNTRY, WOEID, UNITS, INTERVAL, ENABLED, LOCATIONINFO_FIELD_COUNT } LocationInfoField; /* Defined in the .c file - specifies the array of field names */ extern const gchar * LocationInfoFieldNames[]; /** * Provides the mechanism to free any data associated with * the LocationInfo structure * * @param location Location entry to free. * */ void location_free(gpointer location); /** * Prints the contents of the supplied entry to stdout * * @param locatrion Location entry contents of which to print. * */ void location_print(gpointer location); /** * Sets the given property for the location * * @param location Pointer to the location to modify. * @param property Name of the property to set. * @param value Value to assign to the property. * @param len Length of the value to assign to the property (think strlen()) */ void location_property_set(gpointer location, const gchar * property, const gchar * value, gsize len); /** * Copies a location entry. * * @param dst Address of the pointer to the location to set. * @param src Pointer to the location to use/copy. * * @note Destination is first freed, if non-NULL, otherwise a new allocation * is made. Both source and destination locations must be released by * the caller. */ void location_copy(gpointer * dst, gpointer src); #endif
/* Copyright (C) 2016 Sergo Pasoevi. This pragram 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/>. Written by Sergo Pasoevi <[email protected]> */ #include "util.h" #include <math.h> /* Geometry helper functions */ double distance(int x1, int y1, int x2, int y2) { int dx = x1 - x2; int dy = y1 - y2; return sqrt(dx * dx + dy * dy); } void each_actor(struct engine *engine, TCOD_list_t lst, void (*action)(struct engine *engine, struct actor *actor)) { struct actor **iterator; for (iterator = (struct actor **) TCOD_list_begin(engine->actors); iterator != (struct actor **) TCOD_list_end(engine->actors); iterator++) action(engine, *iterator); } const char *generate_name(const char *filename) { TCOD_namegen_parse(filename, TCOD_random_get_instance()); return TCOD_namegen_generate("Celtic male", false); } void free_name_generator(void) { TCOD_namegen_destroy(); }
#ifndef GLOBALS_H #define GLOBALS_H #include <stdio.h> #include <allegro.h> #include "resource.h" //#define LOG_COMMS // Uncomment this line to enable serial comm logging // system_of_measurements #define METRIC 0 #define IMPERIAL 1 // Display mode flags #define FULL_SCREEN_MODE 0 #define WINDOWED_MODE 1 #define FULLSCREEN_MODE_SUPPORTED 2 #define WINDOWED_MODE_SUPPORTED 4 #define WINDOWED_MODE_SET 8 // Password for Datafiles (Tr. Code Definitions and Resources) #define PASSWORD NULL // Colors in the main palette #define C_TRANSP -1 #define C_BLACK 0 #define C_WHITE 1 #define C_RED 255 #define C_BLUE 254 #define C_GREEN 99 #define C_DARK_YELLOW 54 #define C_PURPLE 9 #define C_DARK_GRAY 126 #define C_GRAY 50 #define C_LIGHT_GRAY 55 // int is_not_genuine_scan_tool; // Options int system_of_measurements; int display_mode; // File names char options_file_name[20]; char data_file_name[20]; char code_defs_file_name[20]; char log_file_name[20]; #ifdef LOG_COMMS char comm_log_file_name[20]; #endif void write_log(const char *log_string); #ifdef LOG_COMMS void write_comm_log(const char *marker, const char *data); #endif DATAFILE *datafile; #endif
#ifndef AssimpSceneLoader_H #define AssimpSceneLoader_H #include <string> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <assimp/Importer.hpp> #include "Common/Singleton.h" #include "Mesh/Mesh.h" #include "Shader/ShaderProgram.h" #include "Scene/Material.h" using std::string; class AssimpSceneLoader : public Singleton<AssimpSceneLoader> { public: vector<Mesh*> meshes; const aiScene* assimpScene; vector<Material*> materials; AssimpSceneLoader(); void load(string file); Mesh * initMesh(aiMesh * assMesh); void initNode(aiNode * parent); void printColor(const string &name, const aiColor4D & color); }; #endif // AssimpSceneLoader_H
/**************************************************************************** ** ** 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 RUBBERBANDSELECTIONMANIPULATOR_H #define RUBBERBANDSELECTIONMANIPULATOR_H #include "liveselectionrectangle.h" #include <QPointF> QT_FORWARD_DECLARE_CLASS(QGraphicsItem) namespace QmlJSDebugger { class QDeclarativeViewInspector; class LiveRubberBandSelectionManipulator { public: enum SelectionType { ReplaceSelection, AddToSelection, RemoveFromSelection }; LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, QDeclarativeViewInspector *editorView); void setItems(const QList<QGraphicsItem*> &itemList); void begin(const QPointF& beginPoint); void update(const QPointF& updatePoint); void end(); void clear(); void select(SelectionType selectionType); QPointF beginPoint() const; bool isActive() const; protected: QGraphicsItem *topFormEditorItem(const QList<QGraphicsItem*> &itemList); private: QList<QGraphicsItem*> m_itemList; QList<QGraphicsItem*> m_oldSelectionList; LiveSelectionRectangle m_selectionRectangleElement; QPointF m_beginPoint; QDeclarativeViewInspector *m_editorView; QGraphicsItem *m_beginFormEditorItem; bool m_isActive; }; } #endif // RUBBERBANDSELECTIONMANIPULATOR_H
#pragma once #include <nstd/Base.h> class DataProtocol { public: enum MessageType { errorResponse, subscribeRequest, subscribeResponse, unsubscribeRequest, unsubscribeResponse, tradeRequest, tradeResponse, registerSourceRequest, registerSourceResponse, registerSinkRequest, registerSinkResponse, registeredSinkMessage, tradeMessage, channelRequest, channelResponse, timeRequest, timeResponse, timeMessage, tickerMessage, }; enum TradeFlag { replayedFlag = 0x01, syncFlag = 0x02, }; //enum ChannelType //{ // tradeType, // orderBookType, //}; // //enum ChannelFlag //{ // onlineFlag = 0x01, //}; #pragma pack(push, 4) struct Header { uint32_t size; // including header uint64_t source; // client id uint64_t destination; // client id uint16_t messageType; // MessageType }; struct ErrorResponse { uint16_t messageType; uint64_t channelId; char_t errorMessage[128]; }; struct SubscribeRequest { char_t channel[33]; uint64_t maxAge; uint64_t sinceId; }; struct SubscribeResponse { char_t channel[33]; uint64_t channelId; uint32_t flags; }; struct UnsubscribeRequest { char_t channel[33]; }; struct UnsubscribeResponse { char_t channel[33]; uint64_t channelId; }; struct RegisterSourceRequest { char_t channel[33]; }; struct RegisterSourceResponse { char_t channel[33]; uint64_t channelId; }; struct RegisterSinkRequest { char_t channel[33]; }; struct RegisterSinkResponse { char_t channel[33]; uint64_t channelId; }; struct TradeRequest { uint64_t maxAge; uint64_t sinceId; }; struct Trade { uint64_t id; uint64_t time; double price; double amount; uint32_t flags; }; struct TradeMessage { uint64_t channelId; Trade trade; }; struct TimeMessage { uint64_t channelId; uint64_t time; }; struct TradeResponse { uint64_t channelId; }; struct Channel { char_t channel[33]; //uint8_t type; //uint32_t flags; }; struct TimeResponse { uint64_t time; }; struct Ticker { uint64_t time; double bid; double ask; }; struct TickerMessage { uint64_t channelId; Ticker ticker; }; #pragma pack(pop) };
/*! * \file db_mysql_list_entities_report_sql.c * \brief Returns MYSQL SQL query to create list entities report. * \author Paul Griffiths * \copyright Copyright 2014 Paul Griffiths. Distributed under the terms * of the GNU General Public License. <http://www.gnu.org/licenses/> */ const char * db_list_entities_report_sql(void) { static const char * query = "SELECT" " id AS 'ID'," " shortname AS 'Short'," " name AS 'Entity Name'," " currency AS 'Curr.'," " parent AS 'Parent'" " FROM entities" " ORDER BY id"; return query; }
/*--[litinternal.h]------------------------------------------------------------ | Copyright (C) 2002 Dan A. Jackson | | This file is part of the "openclit" library for processing .LIT files. | | "Openclit" is free software; you can redistribute it and/or modify | it under the terms of the GNU General Public License as published by | the Free Software Foundation; either version 2 of the License, or | (at your option) any later version. | | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License | along with this program; if not, write to the Free Software | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | | The GNU General Public License may also be available at the following | URL: http://www.gnu.org/licenses/gpl.html */ /* | This file contains definitions for internal routines and structures which | the LIT library doesn't wish to expose to the world at large */ #ifndef LITINTERNAL_H #define LITINTERNAL_H typedef struct dir_type { U8 * entry_ptr; U32 entry_size; U32 entry_last_chunk; U8 * count_ptr; U32 count_size; U32 count_last_chunk; int num_entries; int num_counts; U32 entry_aoli_idx; U32 total_content_size; } dir_type; int lit_i_read_directory(lit_file * litfile, U8 * piece, int piece_size); int lit_i_make_directories(lit_file * litfile, dir_type * dirtype); int lit_i_read_headers(lit_file * litfile); int lit_i_write_headers(lit_file * litfile); int lit_i_read_secondary_header(lit_file * litfile, U8 * hdr, int size); int lit_i_cache_section(lit_file * litfile, section_type * pSection ); int lit_i_read_sections(lit_file * litfile ); void lit_i_free_dir_type(dir_type * dirtype); int lit_i_encrypt_section(lit_file *,char *, U8 * new_key); int lit_i_encrypt(U8 * ptr, int size, U8 * new_key); /* | This routine will check for the presence of DRM and initialize | the DRM level and bookkey */ extern int lit_i_read_drm(lit_file *); /* | This routine will do the decryption with the bookkey, kept off here | to get the non-DRM path pure */ extern int lit_i_decrypt(lit_file *, U8 * data_pointer, int size); /* | Utility routines... */ char * lit_i_strmerge(const char * first, ...); U8 * lit_i_read_utf8_string(U8 * p, int remaining, int * size); int lit_i_utf8_len_to_bytes(U8 * src, int lenSrc, int sizeSrc); #endif
/***************************************************************************** The Dark Mod GPL Source Code This file is part of the The Dark Mod Source Code, originally based on the Doom 3 GPL Source Code as published in 2011. The Dark Mod Source Code 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. For details, see LICENSE.TXT. Project: The Dark Mod (http://www.thedarkmod.com/) $Revision: 6618 $ (Revision of last commit) $Date: 2016-09-06 15:39:46 +0000 (Tue, 06 Sep 2016) $ (Date of last commit) $Author: grayman $ (Author of last commit) ******************************************************************************/ #ifndef _MULTI_STATE_MOVER_H_ #define _MULTI_STATE_MOVER_H_ #include "MultiStateMoverPosition.h" #include "MultiStateMoverButton.h" /** * greebo: A MultiState mover is an extension to the vanilla D3 movers. * * In contrast to the idElevator class, this multistate mover draws the floor * information from the MultiStateMoverPosition entities which are targetted * by this class. * * The MultiStateMover will start moving when it's triggered (e.g. by buttons), * where the information where to go is contained on the triggering button. * * Furthermore, the MultiStateMover provides a public interface for AI to * help them figuring out which buttons to use, where to go, etc. */ class CMultiStateMover : public idMover { idList<MoverPositionInfo> positionInfo; idVec3 forwardDirection; // The lists of buttons, AI entities need them to get the elevator moving idList< idEntityPtr<CMultiStateMoverButton> > fetchButtons; idList< idEntityPtr<CMultiStateMoverButton> > rideButtons; // grayman #3050 - to help reduce jostling on the elevator bool masterAtRideButton; // is the master in position to push the ride button? UserManager riderManager; // manage a list of riders (which is different than users) public: CLASS_PROTOTYPE( CMultiStateMover ); CMultiStateMover(); void Spawn(); void Save(idSaveGame *savefile) const; void Restore(idRestoreGame *savefile); void Activate(idEntity* activator); // Returns the list of position infos, populates the list if none are assigned yet. const idList<MoverPositionInfo>& GetPositionInfoList(); /** * greebo: Returns TRUE if this mover is at the given position. * Note: NULL arguments always return false. */ bool IsAtPosition(CMultiStateMoverPosition* position); /** * greebo: This is called by the MultiStateMoverButton class exclusively to * register the button with this Mover, so that the mover knows which buttons * can be used to get it moving. * * @button: The button entity * @type: The "use type" of the entity, e.g. "fetch" or "ride" */ void RegisterButton(CMultiStateMoverButton* button, EMMButtonType type); /** * greebo: Returns the closest button entity for the given position and the given "use type". * * @toPosition: the position the elevator needs to go to (to be "fetched" to, to "ride" to). * @fromPosition: the position the button needs to be accessed from (can be NULL for type == RIDE). * @type: the desired type of button (fetch or ride) * @riderOrg: the origin of the AI using the button (grayman #3029) * * @returns: NULL if nothing found. */ CMultiStateMoverButton* GetButton(CMultiStateMoverPosition* toPosition, CMultiStateMoverPosition* fromPosition, EMMButtonType type, idVec3 riderOrg); // grayman #3029 // grayman #3050 - for ride management bool IsMasterAtRideButton(); void SetMasterAtRideButton(bool atButton); inline UserManager& GetRiderManager() { return riderManager; } protected: // override idMover's DoneMoving() to trigger targets virtual void DoneMoving(); private: // greebo: Controls the direction of targetted rotaters, depending on the given moveTargetPosition void SetGearDirection(const idVec3& targetPos); // Returns the index of the named position info or -1 if not found int GetPositionInfoIndex(const idStr& name) const; // Returns the index of the position info at the given position (using epsilon comparison) int GetPositionInfoIndex(const idVec3& pos) const; // Returns the positioninfo entity of the given location or NULL if no suitable position found CMultiStateMoverPosition* GetPositionEntity(const idVec3& pos) const; // Extracts all position entities from the targets void FindPositionEntities(); void Event_Activate(idEntity* activator); void Event_PostSpawn(); /** * grayman #4370: "Override" the TeamBlocked event to detect collisions with the player. */ virtual void OnTeamBlocked(idEntity* blockedEntity, idEntity* blockingEntity); }; #endif /* _MULTI_STATE_MOVER_H_ */
/* This file is part of Darling. Copyright (C) 2019 Lubos Dolezel Darling is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Darling is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface MDLMemoryMappedData : NSObject @end
/* * Copyright © 2004 Noah Levitt * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* MucharmapSearchDialog handles all aspects of searching */ #ifndef MUCHARMAP_SEARCH_DIALOG_H #define MUCHARMAP_SEARCH_DIALOG_H #include <gtk/gtk.h> #include <mucharmap/mucharmap.h> #include "mucharmap-window.h" G_BEGIN_DECLS //class MucharmapSearchDialog //{ #define MUCHARMAP_TYPE_SEARCH_DIALOG (mucharmap_search_dialog_get_type ()) #define MUCHARMAP_SEARCH_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MUCHARMAP_TYPE_SEARCH_DIALOG, MucharmapSearchDialog)) #define MUCHARMAP_SEARCH_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MUCHARMAP_TYPE_SEARCH_DIALOG, MucharmapSearchDialogClass)) #define MUCHARMAP_IS_SEARCH_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MUCHARMAP_TYPE_SEARCH_DIALOG)) #define MUCHARMAP_IS_SEARCH_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MUCHARMAP_TYPE_SEARCH_DIALOG)) #define MUCHARMAP_SEARCH_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MUCHARMAP_TYPE_SEARCH_DIALOG, MucharmapSearchDialogClass)) typedef struct _MucharmapSearchDialog MucharmapSearchDialog; typedef struct _MucharmapSearchDialogClass MucharmapSearchDialogClass; struct _MucharmapSearchDialog { GtkDialog parent; }; struct _MucharmapSearchDialogClass { GtkDialogClass parent_class; /* signals */ void (* search_start) (void); void (* search_finish) (gunichar found_char); }; typedef enum { MUCHARMAP_DIRECTION_BACKWARD = -1, MUCHARMAP_DIRECTION_FORWARD = 1 } MucharmapDirection; GType mucharmap_search_dialog_get_type (void); GtkWidget * mucharmap_search_dialog_new (MucharmapWindow *parent); void mucharmap_search_dialog_present (MucharmapSearchDialog *search_dialog); void mucharmap_search_dialog_start_search (MucharmapSearchDialog *search_dialog, MucharmapDirection direction); gdouble mucharmap_search_dialog_get_completed (MucharmapSearchDialog *search_dialog); //} G_END_DECLS #endif /* #ifndef MUCHARMAP_SEARCH_DIALOG_H */
/* * Copyright (C) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OUTDOOR_PVP_HP_ #define OUTDOOR_PVP_HP_ #include "OutdoorPvP.h" #define OutdoorPvPHPBuffZonesNum 6 // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 }; enum OutdoorPvPHPSpells { AlliancePlayerKillReward = 32155, HordePlayerKillReward = 32158, AllianceBuff = 32071, HordeBuff = 32049 }; enum OutdoorPvPHPTowerType { HP_TOWER_BROKEN_HILL = 0, HP_TOWER_OVERLOOK = 1, HP_TOWER_STADIUM = 2, HP_TOWER_NUM = 3 }; const uint32 HP_CREDITMARKER[HP_TOWER_NUM] = {19032, 19028, 19029}; const uint32 HP_CapturePointEvent_Enter[HP_TOWER_NUM] = {11404, 11396, 11388}; const uint32 HP_CapturePointEvent_Leave[HP_TOWER_NUM] = {11403, 11395, 11387}; enum OutdoorPvPHPWorldStates { HP_UI_TOWER_DISPLAY_A = 0x9ba, HP_UI_TOWER_DISPLAY_H = 0x9b9, HP_UI_TOWER_COUNT_H = 0x9ae, HP_UI_TOWER_COUNT_A = 0x9ac, HP_UI_TOWER_SLIDER_N = 2475, HP_UI_TOWER_SLIDER_POS = 2474, HP_UI_TOWER_SLIDER_DISPLAY = 2473 }; const uint32 HP_MAP_N[HP_TOWER_NUM] = {0x9b5, 0x9b2, 0x9a8}; const uint32 HP_MAP_A[HP_TOWER_NUM] = {0x9b3, 0x9b0, 0x9a7}; const uint32 HP_MAP_H[HP_TOWER_NUM] = {0x9b4, 0x9b1, 0x9a6}; const uint32 HP_TowerArtKit_A[HP_TOWER_NUM] = {65, 62, 67}; const uint32 HP_TowerArtKit_H[HP_TOWER_NUM] = {64, 61, 68}; const uint32 HP_TowerArtKit_N[HP_TOWER_NUM] = {66, 63, 69}; const go_type HPCapturePoints[HP_TOWER_NUM] = { {182175, 530, -471.462f, 3451.09f, 34.6432f, 0.174533f, 0.0f, 0.0f, 0.087156f, 0.996195f}, // 0 - Broken Hill {182174, 530, -184.889f, 3476.93f, 38.205f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f}, // 1 - Overlook {182173, 530, -290.016f, 3702.42f, 56.6729f, 0.034907f, 0.0f, 0.0f, 0.017452f, 0.999848f} // 2 - Stadium }; const go_type HPTowerFlags[HP_TOWER_NUM] = { {183514, 530, -467.078f, 3528.17f, 64.7121f, 3.14159f, 0.0f, 0.0f, 1.0f, 0.0f}, // 0 broken hill {182525, 530, -187.887f, 3459.38f, 60.0403f, -3.12414f, 0.0f, 0.0f, 0.999962f, -0.008727f}, // 1 overlook {183515, 530, -289.610f, 3696.83f, 75.9447f, 3.12414f, 0.0f, 0.0f, 0.999962f, 0.008727f} // 2 stadium }; class OPvPCapturePointHP : public OPvPCapturePoint { public: OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType type); void ChangeState(); void SendChangePhase(); void FillInitialWorldStates(WorldPacket & data); // used when player is activated/inactivated in the area bool HandlePlayerEnter(Player* player); void HandlePlayerLeave(Player* player); private: OutdoorPvPHPTowerType m_TowerType; }; class OutdoorPvPHP : public OutdoorPvP { public: OutdoorPvPHP(); bool SetupOutdoorPvP(); void HandlePlayerEnterZone(Player* player, uint32 zone); void HandlePlayerLeaveZone(Player* player, uint32 zone); bool Update(uint32 diff); void FillInitialWorldStates(WorldPacket &data); void SendRemoveWorldStates(Player* player); void HandleKillImpl(Player* player, Unit* killed); uint32 GetAllianceTowersControlled() const; void SetAllianceTowersControlled(uint32 count); uint32 GetHordeTowersControlled() const; void SetHordeTowersControlled(uint32 count); private: // how many towers are controlled uint32 m_AllianceTowersControlled; uint32 m_HordeTowersControlled; }; #endif
/* Rocrail - Model Railroad Software Copyright (C) 2002-2014 Rob Versluis, Rocrail.net This program is free software; you can redistribute it and/or as published by the Free Software Foundation; either version 2 modify it under the terms of the GNU General Public License of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __bidibidentdlg__ #define __bidibidentdlg__ /** @file Subclass of BidibIdentDlgGen, which is generated by wxFormBuilder. */ #include "bidibidendlggen.h" #include "rocs/public/node.h" #include "rocs/public/list.h" #include "rocs/public/map.h" #include "rocs/public/mutex.h" //// end generated include /** Implementing BidibIdentDlgGen */ class BidibIdentDlg : public BidibIdentDlgGen { iONode node; iONode bidibnode; iOList nodeList; iOMap nodeMap; iOMap nodePathMap; iONode m_SelectedBidibNode; iONode m_ProductsNode; iOMap m_ProductsMap; int macro; int macroline; int macrosize; int macrolevel; int macroparam; bool macrosave; bool macroapply; int configL; int configR; int configV; int configS; int uid; char* www; iOMutex servoSetMutex; bool eventUpdate; wxTreeItemId findTreeItem( const wxTreeItemId& root, const wxString& text); int getLevel(const char* path, int* n, int* o, int* p, char** key, char** parentkey); wxTreeItemId addTreeChild( const wxTreeItemId& root, iONode bidibnode); void handleFeature(iONode node); void clearFeatureList(); void handleMacro(iONode node); void handleAccessory(iONode node); iONode findNodeByUID( const char* uid); protected: // Handlers for BidibIdentDlgGen events. void onClose( wxCloseEvent& event ); void onCancel( wxCommandEvent& event ); void onOK( wxCommandEvent& event ); void onHelp( wxCommandEvent& event ); void onTreeSelChanged( wxTreeEvent& event ); void onBeginDrag( wxTreeEvent& event ); void onItemActivated( wxTreeEvent& event ); void onItemRightClick( wxTreeEvent& event ); void onMenu( wxCommandEvent& event ); void onFeatureSelect( wxCommandEvent& event ); void onFeaturesGet( wxCommandEvent& event ); void onFeatureSet( wxCommandEvent& event ); void onServoLeft( wxScrollEvent& event ); void onServoRight( wxScrollEvent& event ); void onServoSpeed( wxScrollEvent& event ); void onServoPort( wxSpinEvent& event ); void onServoLeftTest( wxCommandEvent& event ); void onServoRightTest( wxCommandEvent& event ); void onServoGet( wxCommandEvent& event ); void onPortSet( wxCommandEvent& event ); void onConfigL( wxSpinEvent& event ); void onConfigR( wxSpinEvent& event ); void onConfigV( wxSpinEvent& event ); void onConfigS( wxSpinEvent& event ); void onServoReserved( wxScrollEvent& event ); void onPortType( wxCommandEvent& event ); void onConfigLtxt( wxCommandEvent& event ); void onConfigRtxt( wxCommandEvent& event ); void onConfigVtxt( wxCommandEvent& event ); void onConfigStxt( wxCommandEvent& event ); void onSelectUpdateFile( wxCommandEvent& event ); void onUpdateStart( wxCommandEvent& event ); void onServoSet(bool overwrite=false); void onPageChanged( wxNotebookEvent& event ); void onMacroList( wxCommandEvent& event ); void onMacroLineSelected( wxGridEvent& event ); void onMacroApply( wxCommandEvent& event ); void onMacroReload( wxCommandEvent& event ); void onMacroSave( wxCommandEvent& event ); void onMacroEveryMinute( wxCommandEvent& event ); void onMacroExport( wxCommandEvent& event ); void onMacroImport( wxCommandEvent& event ); void onMacroSaveMacro( wxCommandEvent& event ); void onMacroDeleteMacro( wxCommandEvent& event ); void onMacroRestoreMacro( wxCommandEvent& event ); void onMacroTest( wxCommandEvent& event ); void onVendorCVEnable( wxCommandEvent& event ); void onVendorCVDisable( wxCommandEvent& event ); void onVendorCVGet( wxCommandEvent& event ); void onVendorCVSet( wxCommandEvent& event ); void onAccessoryOnTest( wxCommandEvent& event ); void onAccessoryOffTest( wxCommandEvent& event ); void onAccessoryReadOptions( wxCommandEvent& event ); void onAccessoryWriteOptions( wxCommandEvent& event ); void onAccessoryReadMacroMap( wxCommandEvent& event ); void onAccessoryWriteMacroMap( wxCommandEvent& event ); void onLeftLogo( wxMouseEvent& event ); void onProductName( wxMouseEvent& event ); int getProductID(int uid); void onReport( wxCommandEvent& event ); void onUsernameSet( wxCommandEvent& event ); public: /** Constructor */ BidibIdentDlg( wxWindow* parent ); //// end generated class members BidibIdentDlg( wxWindow* parent, iONode node ); ~BidibIdentDlg(); void event(iONode node); void initLabels(); void initValues(); void initProducts(); const char* GetProductName(int vid, int pid, char** www); }; #endif // __bidibidentdlg__
/*++ Copyright (c) 2008 Microsoft Corporation Module Name: ast_smt_pp.h Abstract: Pretty printer of AST formulas as SMT benchmarks. Author: Nikolaj Bjorner 2008-04-09. Revision History: --*/ #ifndef _AST_SMT_PP_H_ #define _AST_SMT_PP_H_ #include"ast.h" #include<string> #include"map.h" class smt_renaming { typedef map<symbol, symbol, symbol_hash_proc, symbol_eq_proc> symbol2symbol; symbol2symbol m_translate; symbol2symbol m_rev_translate; symbol fix_symbol(symbol s, int k); bool is_legal(char c); bool is_special(char const* s); bool is_numerical(char const* s); bool all_is_legal(char const* s); public: smt_renaming(); symbol get_symbol(symbol s0); symbol operator()(symbol const & s) { return get_symbol(s); } }; class ast_smt_pp { public: class is_declared { public: virtual bool operator()(func_decl* d) const { return false; } virtual bool operator()(sort* s) const { return false; } }; private: ast_manager& m_manager; expr_ref_vector m_assumptions; expr_ref_vector m_assumptions_star; symbol m_benchmark_name; symbol m_source_info; symbol m_status; symbol m_category; symbol m_logic; std::string m_attributes; family_id m_dt_fid; is_declared m_is_declared_default; is_declared* m_is_declared; bool m_simplify_implies; public: ast_smt_pp(ast_manager& m); void set_benchmark_name(const char* bn) { if (bn) m_benchmark_name = bn; } void set_source_info(const char* si) { if (si) m_source_info = si; } void set_status(const char* s) { if (s) m_status = s; } void set_category(const char* c) { if (c) m_category = c; } void set_logic(const char* l) { if (l) m_logic = l; } void add_attributes(const char* s) { if (s) m_attributes += s; } void add_assumption(expr* n) { m_assumptions.push_back(n); } void add_assumption_star(expr* n) { m_assumptions_star.push_back(n); } void set_simplify_implies(bool f) { m_simplify_implies = f; } void set_is_declared(is_declared* id) { m_is_declared = id; } void display(std::ostream& strm, expr* n); void display_smt2(std::ostream& strm, expr* n); void display_expr(std::ostream& strm, expr* n); void display_expr_smt2(std::ostream& strm, expr* n, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0); }; struct mk_smt_pp { expr * m_expr; ast_manager& m_manager; unsigned m_indent; unsigned m_num_var_names; char const* const* m_var_names; mk_smt_pp(expr* e, ast_manager & m, unsigned indent = 0, unsigned num_var_names = 0, char const* const* var_names = 0) : m_expr(e), m_manager(m), m_indent(indent), m_num_var_names(num_var_names), m_var_names(var_names) {} }; inline std::ostream& operator<<(std::ostream& out, const mk_smt_pp & p) { ast_smt_pp pp(p.m_manager); pp.display_expr_smt2(out, p.m_expr, p.m_indent, p.m_num_var_names, p.m_var_names); return out; } #endif
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: ../pdfreporter-core/src/org/oss/pdfreporter/crosstabs/fill/calculation/BucketingServiceContext.java // #include "J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext") #ifdef RESTRICT_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext #define INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext 0 #else #define INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext 1 #endif #undef RESTRICT_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext #if !defined (OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext_) && (INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext || defined(INCLUDE_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext)) #define OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext_ @class IOSObjectArray; @protocol OrgOssPdfreporterEngineFillJRFillExpressionEvaluator; @protocol OrgOssPdfreporterEngineJRExpression; @protocol OrgOssPdfreporterEngineJasperReportsContext; @protocol OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext < NSObject, JavaObject > - (id<OrgOssPdfreporterEngineJasperReportsContext>)getJasperReportsContext; - (id<OrgOssPdfreporterEngineFillJRFillExpressionEvaluator>)getExpressionEvaluator; - (id)evaluateMeasuresExpressionWithOrgOssPdfreporterEngineJRExpression:(id<OrgOssPdfreporterEngineJRExpression>)expression withOrgOssPdfreporterCrosstabsFillCalculationMeasureDefinition_MeasureValueArray:(IOSObjectArray *)measureValues; @end J2OBJC_EMPTY_STATIC_INIT(OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext) J2OBJC_TYPE_LITERAL_HEADER(OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext) #endif #pragma pop_macro("INCLUDE_ALL_OrgOssPdfreporterCrosstabsFillCalculationBucketingServiceContext")
/******************************************************************** * a A * AM\/MA * (MA:MMD * :: VD * :: º * :: * :: ** .A$MMMMND AMMMD AMMM6 MMMM MMMM6 + 6::Z. TMMM MMMMMMMMMDA VMMMD AMMM6 MMMMMMMMM6 * 6M:AMMJMMOD V MMMA VMMMD AMMM6 MMMMMMM6 * :: TMMTMC ___MMMM VMMMMMMM6 MMMM * MMM TMMMTTM, AMMMMMMMM VMMMMM6 MMMM * :: MM TMMTMMMD MMMMMMMMMM MMMMMM MMMM * :: MMMTTMMM6 MMMMMMMMMMM AMMMMMMD MMMM * :. MMMMMM6 MMMM MMMM AMMMMMMMMD MMMM * TTMMT MMMM MMMM AMMM6 MMMMD MMMM * TMMMM8 MMMMMMMMMMM AMMM6 MMMMD MMMM * TMMMMMM$ MMMM6 MMMM AMMM6 MMMMD MMMM * TMMM MMMM * TMMM .MMM * TMM .MMD ARBITRARY·······XML········RENDERING * TMM MMA ==================================== * TMN MM * MN ZM * MM, * * * AUTHORS: see AUTHORS file * * COPYRIGHT: ©2019 - All Rights Reserved * * LICENSE: see LICENSE file * * WEB: http://axrproject.org * * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR * FITNESS FOR A PARTICULAR PURPOSE. * ********************************************************************/ #ifndef HSSEVENTSELECTOR_H #define HSSEVENTSELECTOR_H #include "HSSNameSelector.h" namespace AXR { /** * @brief The special object \@event in HSS. * * Used in selector chains, returns a special object that contains * information about an event. */ class AXR_API HSSEventSelector : public HSSNameSelector { public: /** * Creates a new instance of a event selector. */ HSSEventSelector(AXRController * controller); /** * Clones an instance of HSSEventSelector and gives a shared pointer of the * newly instanciated object. * @return A shared pointer to the new HSSEventSelector */ QSharedPointer<HSSEventSelector> clone() const; //see HSSNameSelector.h for the documentation of this method AXRString getElementName(); //see HSSParserNode.h for the documentation of this method virtual AXRString toString(); //see HSSParserNode.h for the documentation of this method AXRString stringRep(); QSharedPointer<HSSSelection> filterSelection(QSharedPointer<HSSSelection> scope, QSharedPointer<HSSDisplayObject> thisObj, bool processing, bool subscribingToNotifications); private: virtual QSharedPointer<HSSClonable> cloneImpl() const; }; } #endif
#ifndef TOKENS_H #define TOKENS_H #define NUMBER 256 #define SYMBOL 257 #endif
#ifndef SQLCONNECTDIALOG_H #define SQLCONNECTDIALOG_H #include <QDialog> #include <QtSql> namespace Ui { class SQLConnectDialog; } class SQLConnectDialog : public QDialog { Q_OBJECT public: explicit SQLConnectDialog(QWidget *parent = 0); ~SQLConnectDialog(); QSqlDatabase connect(QSqlDatabase db); private slots: void on_ConnectButton_clicked(); private: Ui::SQLConnectDialog *ui; QSqlDatabase tmp; }; #endif // SQLCONNECTDIALOG_H
/* Copyright (C) 2011-2017 Michael Goffioul This file is part of Octave. Octave 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. Octave 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 Octave; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */ #if ! defined (octave_PushButtonControl_h) #define octave_PushButtonControl_h 1 #include "ButtonControl.h" class QPushButton; namespace QtHandles { class PushButtonControl : public ButtonControl { public: PushButtonControl (const graphics_object& go, QPushButton* btn); ~PushButtonControl (void); static PushButtonControl* create (const graphics_object& go); protected: void update (int pId); }; } #endif
/* This project 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. Deviation 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 Deviation. If not, see <http://www.gnu.org/licenses/>. */ #define OVERRIDE_PLACEMENT #include "common.h" #include "pages.h" #include "gui/gui.h" #include "config/model.h" #include "config/ini.h" #include <stdlib.h> enum { LABELNUM_X = 0, LABELNUM_WIDTH = 16, LABEL_X = 17, LABEL_WIDTH = 0, }; #include "../128x64x1/model_loadsave.c"
// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // // BSRunKeeperLoginSegue.h // BeSport Mobile // // Created by François-Xavier Thomas on 5/18/12. // Copyright (c) 2012 BeSport. All rights reserved. // #import "BSLoginSegue.h" @interface BSRunKeeperLoginSegue : BSLoginSegue @end
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "p12plcy.h" #include "secoid.h" #include "secport.h" #include "secpkcs5.h" #define PKCS12_NULL 0x0000 typedef struct pkcs12SuiteMapStr { SECOidTag algTag; unsigned int keyLengthBits; /* in bits */ unsigned long suite; PRBool allowed; PRBool preferred; } pkcs12SuiteMap; static pkcs12SuiteMap pkcs12SuiteMaps[] = { { SEC_OID_RC4, 40, PKCS12_RC4_40, PR_FALSE, PR_FALSE }, { SEC_OID_RC4, 128, PKCS12_RC4_128, PR_FALSE, PR_FALSE }, { SEC_OID_RC2_CBC, 40, PKCS12_RC2_CBC_40, PR_FALSE, PR_TRUE }, { SEC_OID_RC2_CBC, 128, PKCS12_RC2_CBC_128, PR_FALSE, PR_FALSE }, { SEC_OID_DES_CBC, 64, PKCS12_DES_56, PR_FALSE, PR_FALSE }, { SEC_OID_DES_EDE3_CBC, 192, PKCS12_DES_EDE3_168, PR_FALSE, PR_FALSE }, { SEC_OID_UNKNOWN, 0, PKCS12_NULL, PR_FALSE, PR_FALSE }, { SEC_OID_UNKNOWN, 0, 0L, PR_FALSE, PR_FALSE } }; /* determine if algid is an algorithm which is allowed */ PRBool SEC_PKCS12DecryptionAllowed(SECAlgorithmID *algid) { unsigned int keyLengthBits; SECOidTag algId; int i; algId = SEC_PKCS5GetCryptoAlgorithm(algid); if (algId == SEC_OID_UNKNOWN) { return PR_FALSE; } keyLengthBits = (unsigned int)(SEC_PKCS5GetKeyLength(algid) * 8); i = 0; while (pkcs12SuiteMaps[i].algTag != SEC_OID_UNKNOWN) { if ((pkcs12SuiteMaps[i].algTag == algId) && (pkcs12SuiteMaps[i].keyLengthBits == keyLengthBits)) { return pkcs12SuiteMaps[i].allowed; } i++; } return PR_FALSE; } /* is any encryption allowed? */ PRBool SEC_PKCS12IsEncryptionAllowed(void) { int i; i = 0; while (pkcs12SuiteMaps[i].algTag != SEC_OID_UNKNOWN) { if (pkcs12SuiteMaps[i].allowed == PR_TRUE) { return PR_TRUE; } i++; } return PR_FALSE; } SECStatus SEC_PKCS12EnableCipher(long which, int on) { int i; i = 0; while (pkcs12SuiteMaps[i].suite != 0L) { if (pkcs12SuiteMaps[i].suite == (unsigned long)which) { if (on) { pkcs12SuiteMaps[i].allowed = PR_TRUE; } else { pkcs12SuiteMaps[i].allowed = PR_FALSE; } return SECSuccess; } i++; } return SECFailure; } SECStatus SEC_PKCS12SetPreferredCipher(long which, int on) { int i; PRBool turnedOff = PR_FALSE; PRBool turnedOn = PR_FALSE; i = 0; while (pkcs12SuiteMaps[i].suite != 0L) { if (pkcs12SuiteMaps[i].preferred == PR_TRUE) { pkcs12SuiteMaps[i].preferred = PR_FALSE; turnedOff = PR_TRUE; } if (pkcs12SuiteMaps[i].suite == (unsigned long)which) { pkcs12SuiteMaps[i].preferred = PR_TRUE; turnedOn = PR_TRUE; } i++; } if ((turnedOn) && (turnedOff)) { return SECSuccess; } return SECFailure; }
#ifndef METHOD_ARGUMENT_H_VCZAR2ZT #define METHOD_ARGUMENT_H_VCZAR2ZT #include "ast_node.h" #include "ast_node_visitor.h" #include <string> namespace fparser { namespace ast { class MethodArgument : public ast::ASTNode { public: virtual void accept(ASTNodeVisitor& visitor) override; public: MethodArgument(); virtual ~MethodArgument(); }; } // namespace ast } // namespace fparser #endif /* end of include guard: METHOD_ARGUMENT_H_VCZAR2ZT */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef MOZILLA_MEDIASOURCEUTILS_H_ #define MOZILLA_MEDIASOURCEUTILS_H_ #include "nsString.h" #include "TimeUnits.h" namespace mozilla { nsCString DumpTimeRanges(const media::TimeIntervals& aRanges); } // namespace mozilla #endif /* MOZILLA_MEDIASOURCEUTILS_H_ */
#include <stdio.h> int main(int argc, char const *argv[]) { //COQ=customer order quantity, COQV=COQ value, SV= Stock value int COQ,COQV,Credit,SV; if ((COQ<SV)&&(Credit>=COQV)) { printf("Supply successfull\n"); } else if ((COQ<SV)&&(Credit<COQV)) { /* code */ printf("Amount given is less than value of stock supplied."); } else if((COQ>SV)&&(Credit>=COQV)){ printf("Whatever in stock is given. Remaining balance would be returned in two days.\n"); } }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla JavaScript Shell project. * * The Initial Developer of the Original Code is * Alex Fritze. * Portions created by the Initial Developer are Copyright (C) 2003 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Alex Fritze <[email protected]> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef __NS_JSSHSERVER_H__ #define __NS_JSSHSERVER_H__ #include "nsIJSShServer.h" #include "nsCOMPtr.h" #include "nsIServerSocket.h" #include "nsStringAPI.h" class nsJSShServer : public nsIJSShServer { public: NS_DECL_ISUPPORTS NS_DECL_NSIJSSHSERVER nsJSShServer(); ~nsJSShServer(); private: nsCOMPtr<nsIServerSocket> mServerSocket; PRUint32 mServerPort; nsCString mServerStartupURI; PRBool mServerLoopbackOnly; }; #endif // __NS_JSSHSERVER_H__
#ifndef PLASTIQQACCESSIBLESTATECHANGEEVENT_H #define PLASTIQQACCESSIBLESTATECHANGEEVENT_H #include "plastiqobject.h" class PlastiQQAccessibleStateChangeEvent : public PlastiQObject { PLASTIQ_OBJECT(IsQEvent,QAccessibleStateChangeEvent,QAccessibleEvent) PLASTIQ_INHERITS(QAccessibleEvent) public: ~PlastiQQAccessibleStateChangeEvent(); }; #endif // PLASTIQQACCESSIBLESTATECHANGEEVENT_H
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_a11y_TextLeafAccessibleWrap_h__ #define mozilla_a11y_TextLeafAccessibleWrap_h__ #include "TextLeafAccessible.h" namespace mozilla { namespace a11y { typedef class TextLeafAccessible TextLeafAccessibleWrap; } // namespace a11y } // namespace mozilla #endif
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsPrintOptionsGTK_h__ #define nsPrintOptionsGTK_h__ #include "nsPrintOptionsImpl.h" namespace mozilla { namespace embedding { class PrintData; } // namespace embedding } // namespace mozilla //***************************************************************************** //*** nsPrintOptions //***************************************************************************** class nsPrintOptionsGTK : public nsPrintOptions { public: nsPrintOptionsGTK(); virtual ~nsPrintOptionsGTK(); NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings, nsIWebBrowserPrint* aWBP, mozilla::embedding::PrintData* data); NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data, nsIPrintSettings* settings); virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval); }; #endif /* nsPrintOptions_h__ */