text
stringlengths
4
6.14k
# /* ******************************************************************** # * * # * (C) Copyright Paul Mensonides 2003-2005. * # * * # * Distributed under the Boost Software License, Version 1.0. * # * (See accompanying file LICENSE). * # * * # * See http://chaos-pp.sourceforge.net for most recent version. * # * * # ******************************************************************** */ # # ifndef CHAOS_PREPROCESSOR_COMPARISON_LESS_EQUAL_H # define CHAOS_PREPROCESSOR_COMPARISON_LESS_EQUAL_H # # include <chaos/preprocessor/comparison/less.h> # include <chaos/preprocessor/config.h> # include <chaos/preprocessor/lambda/ops.h> # include <chaos/preprocessor/logical/compl.h> # # /* CHAOS_PP_LESS_EQUAL */ # # define CHAOS_PP_LESS_EQUAL(x, y) CHAOS_PP_COMPL(CHAOS_PP_LESS(y, x)) # define CHAOS_PP_LESS_EQUAL_ID() CHAOS_PP_LESS_EQUAL # # if CHAOS_PP_VARIADICS # define CHAOS_PP_LESS_EQUAL_ CHAOS_PP_LAMBDA(CHAOS_PP_LESS_EQUAL) # endif # # endif
// // ViewController.h // ThemeManagerExample // // Created by sosobtc on 15/5/28. // Copyright (c) 2015年 yinnieryou. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
/* Copyright (c) 2015 Orson Peters <orsonpeters@gmail.com> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "ed25519.h" #include "sha512.h" #include "ge.h" void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed) { ge_p3 A; sha512(seed, 32, private_key); private_key[0] &= 248; private_key[31] &= 63; private_key[31] |= 64; ge_scalarmult_base(&A, private_key); ge_p3_tobytes(public_key, &A); }
// // yas_type_traits.h // #pragma once #include <array> #include <type_traits> #include <vector> namespace yas { template <typename T> class has_operator_bool { private: template <typename U> static auto confirm(U v) -> decltype(v.operator bool(), std::true_type()); static auto confirm(...) -> decltype(std::false_type()); public: static bool constexpr value = decltype(confirm(std::declval<T>()))::value; }; template <typename T, typename U = void> using enable_if_integral_t = typename std::enable_if_t<std::is_integral<T>::value, U>; template <typename T, typename U = void> using enable_if_pointer_t = typename std::enable_if_t<std::is_pointer<T>::value, U>; template <typename> struct is_array : std::false_type {}; template <typename T, std::size_t N> struct is_array<std::array<T, N>> : std::true_type {}; template <typename T, typename U = void> using enable_if_array_t = typename std::enable_if_t<is_array<T>::value, U>; template <typename T, typename U = void> using disable_if_array_t = typename std::enable_if_t<!is_array<T>::value, U>; template <typename> struct is_vector : std::false_type {}; template <typename T> struct is_vector<std::vector<T>> : std::true_type {}; template <typename T, typename U = void> using enable_if_vector_t = typename std::enable_if_t<is_vector<T>::value, U>; template <typename T, typename U = void> using disable_if_vector_t = typename std::enable_if_t<!is_vector<T>::value, U>; template <typename> struct is_pair : std::false_type {}; template <typename T, typename U> struct is_pair<std::pair<T, U>> : std::true_type {}; template <typename T, typename V = void> using enable_if_pair_t = typename std::enable_if_t<is_pair<T>::value, V>; template <typename T, typename V = void> using disable_if_pair_t = typename std::enable_if_t<!is_pair<T>::value, V>; template <typename> struct is_tuple : std::false_type {}; template <typename... T> struct is_tuple<std::tuple<T...>> : std::true_type {}; template <typename T, typename U = void> using enable_if_tuple_t = typename std::enable_if_t<is_tuple<T>::value, U>; template <typename T, typename U = void> using disable_if_tuple_t = typename std::enable_if_t<!is_tuple<T>::value, U>; template <typename> struct is_shared_ptr : std::false_type {}; template <typename T> struct is_shared_ptr<std::shared_ptr<T>> : std::true_type {}; template <typename T, typename U = void> using enable_if_shared_ptr_t = typename std::enable_if_t<is_shared_ptr<T>::value, U>; template <typename T, typename U = void> using disable_if_shared_ptr_t = typename std::enable_if_t<!is_shared_ptr<T>::value, U>; template <typename F, typename R, typename... Args> R __return_type__(R (F::*)(Args...)); template <typename F, typename R, typename... Args> R __return_type__(R (F::*)(Args...) const); template <typename F> using return_t = decltype(__return_type__(&F::operator())); } // namespace yas
#include "ctype0.h" #include <stddef.h> size_t detab(char *dest, const char *src) { int len = 0; for (int j = 0; *(src + j); ++j) { if (*(src + j) == '\t') { for (int i = 0; i < 4; ++i) { *dest = ' '; ++dest; ++len; } } else { *dest = *(src + j); ++dest; ++len; } } return len; }
// // Image.h // Dribbble Shots // // Created by IEvgen Verkush on 11/22/15. // Copyright © 2015 IEvgen Verkush. All rights reserved. // #import <Foundation/Foundation.h> @interface Image : NSObject @property (nonatomic, strong) NSString *hidpi; @property (nonatomic, strong) NSString *normal; @property (nonatomic, strong) NSString *teaser; - (instancetype)initWithLinkToImage:(NSString *)linkToImage; //Please do not rely to this method we added this method only in the very begining for creating stubs @end
#ifndef __VR_CAMERA_H #define __VR_CAMERA_H #include <memory> #include <glm/glm.hpp> namespace vr { class SceneObject; enum class CameraTrackingMode { none, point, object }; class Camera { public: inline auto getPosition() const noexcept { return position; } inline void setPosition(const glm::vec3& value) noexcept { position = value; } inline auto getNearPlane() const noexcept { return nearPlane; } inline void setNearPlane(float value) noexcept { nearPlane = value; } inline auto getFarPlane() const noexcept { return farPlane; } void setFarPlane(float value) noexcept { farPlane = value; } inline auto getViewAngle() const noexcept { return viewAngle; } void setViewAngle(float value) noexcept { viewAngle = value; } inline auto getTrackingMode() const noexcept { return trackingMode; } void setTrackingMode(CameraTrackingMode value) noexcept { trackingMode = value; } inline auto& getPointTarget() const noexcept { return pointTarget; } void setPointTarget(const glm::vec3& value) noexcept { pointTarget = value; } inline auto& getObjTarget() const noexcept { return objTarget; } void setObjTarget(const std::weak_ptr<SceneObject>& value) noexcept { objTarget = value; } inline auto& getViewTransform() const noexcept { return viewTransform; } inline auto& getProjectionTransform() const { return projectionTransform; } inline auto& getUpDirection() const noexcept { return upDirection; } inline auto& getViewDirection() const noexcept { return viewDirection; } virtual void update(float aspect, float deltaTime); private: float nearPlane{ 0.1f }; float farPlane{ 100.0f }; float viewAngle{ 30.0f }; glm::vec3 position; glm::vec3 upDirection{ 0.0f, 1.0f, 0.0f }; glm::vec3 viewDirection{ 0.0f, 0.0f, 1.0f }; glm::vec3 pointTarget; std::weak_ptr<SceneObject> objTarget; glm::mat4 viewTransform; glm::mat4 projectionTransform; CameraTrackingMode trackingMode{ CameraTrackingMode::none }; void lookAtTarget(const glm::vec3& target); }; } #endif
// // SettingViewController.h // CoreDataCache-Demo // // Created by Jakey on 15/1/30. // Copyright (c) 2015年 www.skyfox.org. All rights reserved. // #import "BaseViewController.h" @interface SettingViewController : BaseViewController @end
// // GRMBrewery.h // GM Taplist // // Created by Daniel Miedema on 11/2/14. // Copyright (c) 2014 Growl Movement. All rights reserved. // #import "GRMBaseObject.h" #import "GRMBeer.h" @interface GRMBrewery : GRMBaseObject @property NSInteger brewery_id; @property NSString * city; @property NSString *logo_url; @property NSString *name; @property NSString *state; @property RLMArray<GRMBeer> *beers; @end
#pragma once #include "Enum.h" #include "Value.h" #include "Macro.h" #include "Struct.h" #include "../../../../server/2017 server/serverBoostModel/serverBoostModel/protocol.h" //Àü¿ªº¯¼ö extern HWND g_hWnd; extern HINSTANCE g_hInst; extern DWORD g_dwLightIndex; extern D3DXVECTOR3 g_vLightDir; extern bool g_bLogin; extern bool g_bChatMode; extern bool g_bChatEnd; extern float g_fChatCool; class CStringCompare { public: explicit CStringCompare(const TCHAR* pKey) : m_pString(pKey) {} ~CStringCompare() {} public: template <typename T> bool operator () (T Data) { return !lstrcmp(Data.first, m_pString); } private: const TCHAR* m_pString; };
// // FlyingCubes.c // GLESCompute // // Created by Michael Kwasnicki on 06.12.13. // // #include "playgrounds/playground.h" #include "Math3D.h" #include "OpenGLES2Core.h" #include <assert.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #define DEBUG 1 #define free_s( X ) free( X ); X = NULL #define error() assert( glGetError() == GL_NO_ERROR ); #define BUFFER_OFFSET(i) ((char *)NULL + (i)) static GLfloat gCubeVertexData[216] = { // Data layout for each line below is: // positionX, positionY, positionZ, normalX, normalY, normalZ, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f }; static Shader_t s_activeShader; static GLuint _vertexBuffer; static GLfloat _rotation; static mat4 _modelViewProjectionMatrix; static mat3 _normalMatrix; static void loadShaders(void); static void unloadShaders(void); static void setupGL() { loadShaders(); glEnable(GL_DEPTH_TEST); glGenBuffers(1, &_vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(gCubeVertexData), gCubeVertexData, GL_STATIC_DRAW); glEnableVertexAttribArray(s_activeShader.attribLocations[ATTRIB_POSITION]); glEnableVertexAttribArray(s_activeShader.attribLocations[ATTRIB_NORMAL]); glVertexAttribPointer(s_activeShader.attribLocations[ATTRIB_POSITION], 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(0)); glVertexAttribPointer(s_activeShader.attribLocations[ATTRIB_NORMAL], 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12)); error(); } static void update() { float aspect = fabsf(1920.f / 1200.f); mat4 projectionMatrix = mat4MakePerspective(65.0f * M_PI / 180.f, aspect, 0.1f, 100.0f); mat4 baseModelViewMatrix = mat4MakeTranslate(VEC3(0.0f, 0.0f, -4.0f)); mat4 rotationMatrix = mat4MakeRotateY(_rotation); baseModelViewMatrix = mulm4m4(baseModelViewMatrix, rotationMatrix); // Compute the model view matrix for the object rendered with ES2 mat4 modelViewMatrix = mat4MakeTranslate(VEC3(0.0f, 0.0f, 1.5f)); rotationMatrix = mat4MakeRotate(_rotation, VEC3(1.0f, 1.0f, 1.0f)); modelViewMatrix = mulm4m4(modelViewMatrix, rotationMatrix); modelViewMatrix = mulm4m4(baseModelViewMatrix, modelViewMatrix); _normalMatrix = mat3InverseTranspose(mat3FromMat4(modelViewMatrix)); _modelViewProjectionMatrix = mulm4m4(projectionMatrix, modelViewMatrix); _rotation += 0.01f; } static void draw() { glClearColor(0.65f, 0.65f, 0.65f, 0.65f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Render the object with ES2 glUseProgram(s_activeShader.programObject); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glEnableVertexAttribArray(s_activeShader.attribLocations[ATTRIB_POSITION]); glEnableVertexAttribArray(s_activeShader.attribLocations[ATTRIB_NORMAL]); glVertexAttribPointer(s_activeShader.attribLocations[ATTRIB_POSITION], 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(0)); glVertexAttribPointer(s_activeShader.attribLocations[ATTRIB_NORMAL], 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12)); glUniformMatrix4fv(s_activeShader.uniformLocations[UNIFORM_PROJECTION_MATRIX], 1, 0, _modelViewProjectionMatrix.m); glUniformMatrix3fv(s_activeShader.uniformLocations[UNIFORM_NORMAL_MATRIX], 1, 0, _normalMatrix.m); glDrawArrays(GL_TRIANGLES, 0, 36); error(); } static void tearDownGL() { glDeleteBuffers(1, &_vertexBuffer); unloadShaders(); error(); } #pragma mark - Shader void loadShaders() { GLuint vertShaderObject = createShaderObject("playgrounds/FlyingCubes/Assets/Shaders/FlyingCubes.vsh", GL_VERTEX_SHADER); GLuint fragShaderObject = createShaderObject("playgrounds/FlyingCubes/Assets/Shaders/FlyingCubes.fsh", GL_FRAGMENT_SHADER); glReleaseShaderCompiler(); s_activeShader = createProgramObject(vertShaderObject, fragShaderObject); glDeleteShader(vertShaderObject); glDeleteShader(fragShaderObject); } void unloadShaders() { glDeleteProgram(s_activeShader.programObject); s_activeShader.programObject = 0; } GLES2Playground_t e_playgroundFlyingCubes = { .name = "FlyingCubes", .init = setupGL, .deinit = tearDownGL, .update = update, .draw = draw };
#ifndef __Flashes_H__ #define __Flashes_H__ #include "Effect.h" class WhiteFlash : public Effect { public: void Init(); void Do(float timer, int pos = 0, int row = 0); }; class BlackFade : public Effect { public: void Init(); void Do(float timer, int pos = 0, int row = 0); }; #endif
#ifndef __DS_TYPES_H__ #define __DS_TYPES_H__ #include <stddef.h> #include <stdint.h> /** * typedefs */ typedef int64_t s64; typedef int32_t s32; typedef int16_t s16; typedef int8_t s8; typedef uint64_t u64; typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; struct list_head { struct list_head *next, *prev; }; struct hlist_head { struct hlist_node *first; }; struct hlist_node { struct hlist_node *next, **pprev; }; #endif // __DS_TYPES_H__
// // SDHomegameCollectionViewCell.h // SDDouYu // // Created by shendong on 16/5/17. // Copyright © 2016年 com.sybercare.enterprise. All rights reserved. // #import <UIKit/UIKit.h> #import "SDGameCategoryModel.h" @interface SDHomegameCollectionViewCell : UICollectionViewCell - (void)configureHomegameCollectionViewCell:(SDGameCategoryModel *)model; @end
#pragma once #if defined(__WIN32__) && !defined(GLEW_STATIC) #define GLEW_STATIC #endif #include <GL/glew.h> #include <GLFW/glfw3.h> #ifdef __cplusplus extern "C" { #endif int setupGLFW(); int setupGLEW(); void setupCoreGL(); #define TRI_RECT_SIZE (108 * sizeof(float)) #define TRI_RECT_VERTS 36 GLchar* shaderError(GLuint shader); GLchar* programError(GLuint program); GLuint getProgram(const char* vs, const char* fs); GLuint getProgramFromFiles(const char* vsFileName, const char* fsFileName); GLuint loadBMP(const char* fileName); int loadWavefront1(const char* fileName, float** vertexBuffer, int* length); float* getTriangulatedRect(float width, float height, float depth); #ifdef __cplusplus } #endif
// 20100301 Port from *USG_BLK.h, consolidate, WB_USG_BLK.h and USG_BLK.h #pragma once #include "USG_BLK_DEF.h" // 20100301 void init_wb_usg_blk_seg(); void wb_usg_blk_set_segment(unsigned int uiBlk, unsigned int uiSeg, USG_UNIT_SEG *stpUSG_Seg); void wb_usg_blk_get_segment(unsigned int uiBlk, unsigned int uiSeg, USG_UNIT_SEG *stpUSG_Seg); void wb_usg_blk_set_trigger_address(unsigned int uiBlk, int iAddr); int wb_usg_blk_get_trigger_address(unsigned int uiBlk); void wb_usg_blk_set_nextblk_index(unsigned int uiBlk, unsigned int uiNextBlk); unsigned int wb_usg_blk_get_nextblk_index(unsigned int uiBlk); void wb_usg_blk_set_max_count_wait_trig_prot(unsigned int uiBlk, unsigned int uiWaitCnt); unsigned int wb_usg_blk_get_max_count_wait_trig_prot(unsigned int uiBlk); char *wb_usg_blk_get_text_error_flag(int iErrorFlag); char *wb_usg_blk_get_text_status(int iStatusUSG); char *wb_usg_blk_get_text_cmd(int iCmdUSG); char wb_usg_fsm_get_flag_hardware_path(); void wb_usg_fsm_set_flag_via_1739u(); void wb_usg_fsm_set_flag_via_lpt1();
// // Copyright (c) 2008-2016 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 "Sample.h" namespace Urho3D { class Node; class Scene; class RibbonTrail; } /// Ribbon trail demo. /// This sample demonstrates how to use both trail types of RibbonTrail component. class RibbonTrailDemo : public Sample { URHO3D_OBJECT(RibbonTrailDemo, Sample); public: /// Construct. RibbonTrailDemo(Context* context); /// Setup after engine initialization and before running the main loop. virtual void Start(); protected: /// Trail that emitted from sword. SharedPtr<RibbonTrail> swordTrail_; /// Animation controller of the ninja. SharedPtr<AnimationController> ninjaAnimCtrl_; /// The time sword start emitting trail. float swordTrailStartTime_; /// The time sword stop emitting trail. float swordTrailEndTime_; /// Box node 1. SharedPtr<Node> boxNode1_; /// Box node 2. SharedPtr<Node> boxNode2_; /// Sum of timestep. float timeStepSum_; private: /// Construct the scene content. void CreateScene(); /// Construct an instruction text to the UI. void CreateInstructions(); /// Set up a viewport for displaying the scene. void SetupViewport(); /// Read input and moves the camera. void MoveCamera(float timeStep); /// Subscribe to application-wide logic update events. void SubscribeToEvents(); /// Handle the logic update event. void HandleUpdate(StringHash eventType, VariantMap& eventData); };
/* liblightmodbus - a lightweight, multiplatform Modbus library Copyright (C) 2017 Jacek Wieczorek <mrjjot@gmail.com> This file is part of liblightmodbus. Liblightmodbus 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. Liblightmodbus 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 LIGHTMODBUS_EXAMINE #define LIGHTMODBUS_EXAMINE #include <inttypes.h> #include "../lightmodbus.h" #include "../libconf.h" //Create macro aliases so they can be more easily connected to the modbusExamine call #define MODBUS_EXAMINE_COIL MODBUS_COIL #define MODBUS_EXAMINE_DISCRETE_INPUT MODBUS_DISCRETE_INPUT #define MODBUS_EXAMINE_HOLDING_REGISTER MODBUS_HOLDING_REGISTER #define MODBUS_EXAMINE_INPUT_REGISTER MODBUS_INPUT_REGISTER #define MODBUS_EXAMINE_REQUEST 1 #define MODBUS_EXAMINE_RESPONSE 2 #define MODBUS_EXAMINE_READ 1 #define MODBUS_EXAMINE_WRITE 2 #define MODBUS_EXAMINE_UNDEFINED (-1) typedef struct modbusFrameInfo { uint8_t direction; //Just a friendly reminder (MODBUS_EXAMINE_REQUEST/MODBUS_EXAMINE_RESPONSE) uint8_t address; //Slave address uint8_t function; //Function uint8_t exception; //Exception number uint8_t type; //Data type (MODBUS_EXAMINE_COIL/MODBUS_EXAMINE_HOLDING_REGISTER etc.) uint16_t index; //Register index uint16_t count; //Data unit count uint8_t access; //Access type (MODBUS_EXAMINE_READ/MODBUS_EXAMINE_WRITE) uint16_t crc; //CRC //In case of request 22 uint16_t andmask, ormask; //Binary data - pointer and length in bytes //Important: Endianness of this data remains unchanged since this pointer points to the frame itself void *data; uint8_t length; } ModbusFrameInfo; extern ModbusError modbusExamine( ModbusFrameInfo *info, uint8_t dir, const uint8_t *frame, uint8_t length ); #endif
/***************************************************************************/ /* */ /* psnamerr.h */ /* */ /* PS names module error codes (specification only). */ /* */ /* Copyright 2001-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file is used to define the PS names module error enumeration */ /* constants. */ /* */ /*************************************************************************/ #ifndef PSNAMERR_H_ #define PSNAMERR_H_ #include FT_MODULE_ERRORS_H #undef FTERRORS_H_ #undef FT_ERR_PREFIX #define FT_ERR_PREFIX PSnames_Err_ #define FT_ERR_BASE FT_Mod_Err_PSnames #include FT_ERRORS_H #endif /* PSNAMERR_H_ */ /* END */
// // MLHomeController.h // MiaoLive // // Created by 王鑫 on 16/12/1. // Copyright © 2016年 王鑫. All rights reserved. // #import <UIKit/UIKit.h> @interface MLHomeController : UIViewController @end
// // BSUINavigationController.h // ZombieTanks // // Created by Corey Schaf on 1/15/13. // // #import <UIKit/UIKit.h> @interface BSUINavigationController : UINavigationController -(UIInterfaceOrientation) getCurrentOrientation; @end
/******************************************************************************* * FILE: rwsync.h * TITLE: Header file for reader-writer synchronization * application with pthreads. * Date: October 25, 2012. * Author: Rohit Sinha * Email: sinha049@umn.edu * Assignment: CSCI 5103: Operating Systems - Assignment 4 * Due Date: October 29, 2012 * * Problem Statement: implement Reader-Writer synchronization through POSIX * threads. Complete problem statement: http://www-users.cselabs.umn.edu/classes/Fall-2012/csci5103/Assignments/Assignment4-POSIX.pdf ********************************************************************************/ #ifndef _rwsync_h #define _rwsync_h /* Including Standard libraries */ #include <stdio.h> #include <sched.h> #include <pthread.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/time.h> /* Defining constants */ #define FALSE 0 #define TRUE 1 #define READER 0 #define WRITER 1 #define MAX_BUF_SIZE 1024 #define MAX_ITERATIONS 20 #define DECIMAL 10 #define WRITER_MAX_ITEMS 100 /* Defining global variable */ int g_reader_id; int g_writer_id; // ID generating counter for reader and writer struct timeval start; // Starting time FILE *out_file; // pointer to writer output file /* Structure of monitor variable which is shared by reader and writer */ struct monitor_struct { int writing; // flag to determing that the resource is being written int r_count; // reader count int r_waiting; // waiting reader count int w_waiting; // waiting writer count int total_readers; // total number of reader given from command line int total_writers; // total number of writers given from command line int queue [5000]; // a large queue to store waiting order of max threads int queue_head; // head of the queue int queue_tail; // tail of the queue pthread_mutex_t *mutex_lock; // mutex lock variable pthread_cond_t *can_read, *can_write; // condition variables }; /* Structure of reader thread */ struct reader_struct { struct monitor_struct* monitor; // pointer to monitor variable int r_id; // ID of the reader int r_item; // no of item read long int r_in_seek; // read position }; /* Structure of write thread */ struct writer_struct { struct monitor_struct* monitor; // pointer to monitor variable int w_id; // ID of the writer int w_item; // no of item written }; /* Defining prototypes */ long timeElapsed(void); char* myItoa(int val, int base); struct monitor_struct* initMonitor(int tot_readers, int tot_writers); void initReader(struct reader_struct* writer, struct monitor_struct* mon, int id); void *readerHandler (void *args); void startReading (struct monitor_struct *monitor, int r_id); void readData (int r_id, int *r_item, long int *r_in_seek); void finishReading (struct monitor_struct *monitor); void initWriter(struct writer_struct* writer, struct monitor_struct* mon, int id); void *writerHandler (void *args); void startWriting (struct monitor_struct *monitor, int w_id); void writeData (int w_id, int *w_item); void finishWriting (struct monitor_struct *monitor); #endif
// // CreateSubviewViewController.h // CreateSubview // // Created by Sean Reed on 9/12/14. // Copyright (c) 2014 seanreed.test. All rights reserved. // #import <UIKit/UIKit.h> #import "BNRHypnosisView.h" @interface CreateSubviewViewController : UIViewController @property (strong, nonatomic) BNRHypnosisView *view; @end
/*************************************************************** KinOS - Microkernel for ARM Evaluator 7-T Seniors project - Computer Engineering Escola Politecnica da USP, 2009 Felipe Giunte Yoshida Mariana Ramos Franco Vinicius Tosta Ribeiro */ /* The program was based on the mutex program by ARM - Strategic Support Group, contained on the ARM Evaluator 7-T example CD, under the folder /Evaluator7-T/ source/examples/mutex/ *****************************************************************/ /**************************************************************** * IMPORT ****************************************************************/ #include "swi.h" /**************************************************************** * ROUTINES ****************************************************************/ /* Calls the fork system call and return the child id or zero */ int fork(){ int pid = 0; pid = syscall(0, 0, 0, 0); return pid; } /* Calls the exec system call */ void exec(int process_id, pt2Task process_addr, int arg1){ syscall(1, process_id, process_addr, arg1); } /* Calls the exit system call */ void exit(int process_id){ syscall(2, process_id, 0, 0); } /* Calls the print system call */ void print(char *str) { syscall_print(3, 0, str, 0); } /* Calls the switch_thread system call */ void switch_thread (void) { syscall(4, 0, 0, 0); }
/** * Copyright (c) 2021 Darius Rückert * Licensed under the MIT License. * See LICENSE file for more information. */ #pragma once #include "saiga/core/imgui/imgui.h" #include "saiga/core/imgui/imgui_renderer.h" #include "saiga/core/imgui/imgui_timer_system.h" #include "saiga/opengl/indexedVertexBuffer.h" #include "saiga/opengl/opengl.h" #include "saiga/opengl/query/gpuTimer.h" #include "saiga/opengl/shader/all.h" #include "saiga/opengl/texture/Texture.h" namespace Saiga { class SAIGA_OPENGL_API ImGui_GL_Renderer : public ImGuiRenderer { public: ImGui_GL_Renderer(const ImGuiParameters& params); virtual ~ImGui_GL_Renderer(); void render(); protected: std::shared_ptr<Shader> shader; std::shared_ptr<Texture> texture; IndexedVertexBuffer<ImDrawVert, ImDrawIdx> buffer; virtual void renderDrawLists(ImDrawData* draw_data); }; // A system which tracks OpenGL time on a per frame basis. // The GLRenderer has one object which should be used by every subprocess. class GLTimerSystem : public TimerSystem { public: GLTimerSystem() : TimerSystem("OpenGL Timer") {} protected: virtual std::unique_ptr<TimestampTimer> CreateTimer() override { auto timer = std::make_unique<MultiFrameOpenGLTimer>(); timer->create(); return timer; } }; } // namespace Saiga namespace ImGui { SAIGA_OPENGL_API void Texture(Saiga::TextureBase* texture, const ImVec2& size, bool flip_y, const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0)); }
// Автор: Алексей Журавлев // Описание: Класс CNotepadWindow. Cильно упрощённый текстовый редактор. #pragma once #include <Windows.h> #include "EditControlWindow.h" class CNotepadWindow { public: CNotepadWindow(); ~CNotepadWindow(); // Зарегистрировать класс окна static bool RegisterClass(); // Cоздать экземпляр окна bool Create(); // Показать окно void Show(int cmdShow); protected: // Функция, вызываемая при Cоздании контекCта окна (приход Cообщения WM_NCCREATE) void OnNCCreate(HWND handle); // Функция, вызываемая при Cоздании окна (приход Cообщени WM_CREATE) void OnCreate(); // Функция, вызываемая при изменении размера окна (приход Cообщения WM_SIZE) void OnSize(); // Функция, вызываемая при изменении закрытии окна (приход Cообщения WM_CLOSE) bool OnClose(); // Функция, вызываемая при приходе Cообщения от Cына (приход Cообщения WM_COMMAND) void OnCommand(WPARAM wParam, LPARAM lParam); // Функция, вызываемая при уничтожении окна (приход Cообщения WM_DESTROY) void OnDestroy(); private: HWND handle; // Хэндл окна CEditControlWindow editControl; // Дочерний edit-control окна bool changed; // Флаг, показывающий, производилCя ли ввод в окно. void saveText(); static const int maxFileNameSize = 256; static LRESULT __stdcall windowProc(HWND handle, UINT message, WPARAM wParam, LPARAM lParam); };
#pragma once #include "provider.h" #include "../base/key.h" #include <mini/common.h> #include <windows.h> #include <wincrypt.h> namespace mini::crypto::capi { // // MS CryptoAPI key. // class key : public base::key { public: ~key( void ) override { destroy(); } void destroy( void ) override { if (_key_handle) { CryptDestroyKey(_key_handle); _key_handle = 0; } } HCRYPTKEY get_handle( void ) const { return _key_handle; } operator bool( void ) const { return _key_handle != 0; } protected: key( void ) = default; void swap( key& other ) { mini::swap(_key_handle, other._key_handle); } template < typename BLOB_TYPE > void import_from_blob( const BLOB_TYPE& key_blob ) { // // destroy previous key. // destroy(); // // ayy lmao. // auto key_blob_ptr = reinterpret_cast<const BYTE*>(&key_blob); auto key_blob_size = static_cast<DWORD>(sizeof(key_blob)); auto provider_handle = (provider_factory.*BLOB_TYPE::provider_type::get_handle)(); import_from_blob( key_blob_ptr, key_blob_size, provider_handle); } template < typename BLOB_TYPE > void export_to_blob( BLOB_TYPE& key_blob, DWORD blob_type ) const { auto key_blob_ptr = reinterpret_cast<BYTE*>(&key_blob); auto key_blob_size = static_cast<DWORD>(sizeof(key_blob)); CryptExportKey( _key_handle, 0, blob_type, 0, key_blob_ptr, &key_blob_size); } HCRYPTKEY _key_handle = 0; private: void import_from_blob( const BYTE* key_blob, DWORD key_blob_size, HCRYPTPROV provider_handle ) { CryptImportKey( provider_handle, key_blob, key_blob_size, 0, CRYPT_EXPORTABLE, &_key_handle); } }; }
/* MIT LICENSE Copyright 2014-2019 Inertial Sense, Inc. - http://inertialsense.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <asf.h> #include "d_time.h" #include "conf_interrupts.h" static volatile uint32_t g_rollover = 0; static volatile uint32_t g_timer = 0; void RTT_Handler(void) { uint32_t status = rtt_get_status(RTT); // time has changed if (status & RTT_SR_RTTINC) { g_timer = rtt_read_timer_value(RTT); } // alarm if (status & RTT_SR_ALMS) { g_rollover++; } } void time_init(void) { static int initialized = 0; if (initialized) { return; } initialized = 1; // configure RTT to increment as frequently as possible rtt_sel_source(RTT, false); rtt_init(RTT, RTPRES); NVIC_DisableIRQ(RTT_IRQn); NVIC_ClearPendingIRQ(RTT_IRQn); NVIC_SetPriority(RTT_IRQn, INT_PRIORITY_RTT); NVIC_EnableIRQ(RTT_IRQn); #ifdef NDEBUG // interrupt for each tick - release mode only, makes debugging impossible rtt_enable_interrupt(RTT, RTT_MR_RTTINCIEN); #endif // notify us when we rollover rtt_write_alarm_time(RTT, 0); } inline volatile uint64_t time_ticks(void) { #ifndef NDEBUG // in debug no timer interrupt so read directly from timer register, unsafe as this can cause corrupt time // but is the only way to debug and step code g_timer = rtt_read_timer_value(RTT); #endif // this assumes little endian volatile ticks_t ticks; ticks.u32[1] = g_rollover; ticks.u32[0] = g_timer; return ticks.u64; } void time_delay(uint32_t ms) { if (ms != 0) { volatile uint64_t start = time_ticks(); volatile uint64_t ms64 = (uint64_t)ms * TIME_TICKS_PER_MS; while (time_ticks() - start < ms64); } } inline uint32_t time_msec(void) { #ifndef NDEBUG // in debug no timer interrupt so read directly from timer register, unsafe as this can cause corrupt time // but is the only way to debug and step code g_timer = rtt_read_timer_value(RTT); #endif return (uint32_t)((uint64_t)((double)g_timer * TIME_MS_PER_TICK_LF) & 0x00000000FFFFFFFF); } inline uint32_t time_usec(void) { #ifndef NDEBUG // in debug no timer interrupt so read directly from timer register, unsafe as this can cause corrupt time // but is the only way to debug and step code g_timer = rtt_read_timer_value(RTT); #endif return (uint32_t)((uint64_t)((double)g_timer * TIME_US_PER_TICK_LF) & 0x00000000FFFFFFFF); } inline float time_secf(void) { return TIME_SECS_PER_TICK_F * (float)time_ticks(); } inline float time_msecf(void) { return TIME_MS_PER_TICK_F * (float)time_ticks(); } inline float time_usecf(void) { return TIME_US_PER_TICK_F * (float)time_ticks(); } inline double time_seclf(void) { return TIME_SECS_PER_TICK_LF * (double)time_ticks(); } inline double time_mseclf(void) { return TIME_MS_PER_TICK_LF * (double)time_ticks(); } inline double time_useclf(void) { return TIME_US_PER_TICK_LF * (double)time_ticks(); }
#ifndef __LUALAYER #define __LUALAYER #include "LuaCpp.h" #ifdef __cplusplus extern "C" { #endif int luaLayer(lua_State *L); #ifdef __cplusplus } #endif #endif
/////////////////////////////////////////////////////////////////////////////// // Name: wx/ownerdrw.h // Purpose: interface for owner-drawn GUI elements // Author: Vadim Zeitlin // Modified by: Marcin Malich // Created: 11.11.97 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_OWNERDRW_H_BASE # define _WX_OWNERDRW_H_BASE # include "wx/defs.h" # if wxUSE_OWNER_DRAWN # include "wx/font.h" # include "wx/colour.h" class WXDLLIMPEXP_FWD_CORE wxDC; // ---------------------------------------------------------------------------- // wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn // behaviour // // wxOwnerDrawn supports drawing of an item with non standard font, color and // also supports 3 bitmaps: either a checked/unchecked bitmap for a checkable // element or one unchangeable bitmap otherwise. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxOwnerDrawnBase { public: wxOwnerDrawnBase() { m_ownerDrawn = false; m_margin = ms_defaultMargin; } virtual ~wxOwnerDrawnBase() { } void SetFont(const wxFont& font) { m_font = font; m_ownerDrawn = true; } wxFont& GetFont() { return m_font; } const wxFont& GetFont() const { return m_font; } void SetTextColour(const wxColour& colText) { m_colText = colText; m_ownerDrawn = true; } wxColour& GetTextColour() { return m_colText; } const wxColour& GetTextColour() const { return m_colText; } void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; m_ownerDrawn = true; } wxColour& GetBackgroundColour() { return m_colBack; } const wxColour& GetBackgroundColour() const { return m_colBack; } void SetMarginWidth(int width) { m_margin = width; } int GetMarginWidth() const { return m_margin; } static int GetDefaultMarginWidth() { return ms_defaultMargin; } // get item name (with mnemonics if exist) virtual wxString GetName() const = 0; // this function might seem strange, but if it returns false it means that // no non-standard attribute are set, so there is no need for this control // to be owner-drawn. Moreover, you can force owner-drawn to false if you // want to change, say, the color for the item but only if it is owner-drawn // (see wxMenuItem::wxMenuItem for example) bool IsOwnerDrawn() const { return m_ownerDrawn; } // switch on/off owner-drawing the item void SetOwnerDrawn(bool ownerDrawn = true) { m_ownerDrawn = ownerDrawn; } // constants used in OnDrawItem // (they have the same values as corresponding Win32 constants) enum wxODAction { wxODDrawAll = 0x0001, // redraw entire control wxODSelectChanged = 0x0002, // selection changed (see Status.Select) wxODFocusChanged = 0x0004 // keyboard focus changed (see Status.Focus) }; enum wxODStatus { wxODSelected = 0x0001, // control is currently selected wxODGrayed = 0x0002, // item is to be grayed wxODDisabled = 0x0004, // item is to be drawn as disabled wxODChecked = 0x0008, // item is to be checked wxODHasFocus = 0x0010, // item has the keyboard focus wxODDefault = 0x0020, // item is the default item wxODHidePrefix= 0x0100 // hide keyboard cues (w2k and xp only) }; // virtual functions to implement drawing (return true if processed) virtual bool OnMeasureItem(size_t* width, size_t* height); virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat) = 0; protected: // get the font and colour to use, whether it is set or not virtual void GetFontToUse(wxFont& font) const; virtual void GetColourToUse(wxODStatus stat, wxColour& colText, wxColour& colBack) const; private: bool m_ownerDrawn; wxFont m_font; wxColour m_colText, m_colBack; int m_margin; static int ms_defaultMargin; }; // ---------------------------------------------------------------------------- // include the platform-specific class declaration // ---------------------------------------------------------------------------- # if defined(__WXMSW__) # include "wx/msw/ownerdrw.h" # endif # endif #endif
/* Bulllord Game Engine Copyright (C) 2010-2017 Trix 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 __layer_h_ #define __layer_h_ #include "tmxparser.h" #ifdef __cplusplus extern "C" { #endif /** This module is ported from cocos2dx 3.17.2 CCTMXLayer */ typedef struct _TMXLayer { //! name of the layer char* _layerName; //! TMX Layer supports opacity unsigned char _opacity; //! Only used when vertexZ is used int _vertexZvalue; bool _useAutomaticVertexZ; // used for retina display float _contentScaleFactor; /** size of the layer in tiles */ Size _layerSize; /** size of the map's tile (could be different from the tile's size) */ Size _mapTileSize; /** pointer to the map of tiles */ unsigned int* _tiles; /** Tileset information for the layer */ TMXTilesetInfo* _tileSet; /** Layer orientation, which is the same as the map orientation */ int _layerOrientation; /** Stagger Axis */ int _staggerAxis; /** Stagger Index */ int _staggerIndex; /** Hex side length*/ int _hexSideLength; /** properties from the layer. They can be added using Tiled */ BLDictionary* _properties; Vec2 _position; Size _contentSize; bool _vis; int index; } TMXLayer; TMXLayer* createLayer(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo, int layer); void destroyLayer(TMXLayer* layer); bool initWithTilesetInfo(TMXLayer* layer, TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); Vec2 calculateLayerOffset(TMXLayer* layer, Vec2 pos); bool getTileAt(TMXLayer* layer, Vec2 pos); unsigned int getTileGIDAt(TMXLayer* layer, Vec2 tileCoordinate, TMXTileFlags* flags); void setTileGID(TMXLayer* layer, BLU32 gid, Vec2 tileCoordinate, TMXTileFlags flags); void removeTileAt(TMXLayer* layer, Vec2 tileCoordinate); void setupTiles(TMXLayer* layer); void appendTileForGID(TMXLayer* layer, BLU32 gid, Vec2 pos); void insertTileForGID(TMXLayer* layer, BLU32 gid, Vec2 pos); void updateTileForGID(TMXLayer* layer, BLU32 gid, Vec2 pos); int getZForPos(TMXLayer* layer, Vec2 pos); void setupTileSprite(TMXLayer* layer, Vec2 pos, Rect sz, BLU32 gid); Vec2 getPositionAt(TMXLayer* layer, Vec2 pos); Vec2 getPositionForIsoAt(TMXLayer* layer, Vec2 pos); Vec2 getPositionForOrthoAt(TMXLayer* layer, Vec2 pos); Vec2 getPositionForHexAt(TMXLayer* layer, Vec2 pos); Vec2 getPositionForStaggeredAt(TMXLayer* layer, Vec2 pos); #ifdef __cplusplus } #endif #endif/* __layer_h_ */
// // Plane.h // RCTARKit // // Created by Zehao Li on 7/10/17. // Copyright © 2017 HippoAR. All rights reserved. // #import <SceneKit/SceneKit.h> #import <ARKit/ARKit.h> @interface Plane : SCNNode - (instancetype)initWithAnchor:(ARPlaneAnchor *)anchor isHidden:(BOOL)hidden; - (void)update:(ARPlaneAnchor *)anchor; - (void)setTextureScale; - (void)hide; @property (nonatomic, retain) ARPlaneAnchor *anchor; @property (nonatomic, retain) SCNBox *planeGeometry; @end
#import "RuleMatcher.h" #define STATUS_ITEM_VIEW_WIDTH 24.0 #pragma mark - @class StatusItemView; @interface MenubarController : NSObject { @private StatusItemView *_statusItemView; } @property (nonatomic) BOOL hasActiveIcon; @property (nonatomic, strong, readonly) NSStatusItem *statusItem; @property (nonatomic, strong, readonly) StatusItemView *statusItemView; @end
// **************************************************************** // Copyright (c) 2013 by Francisco Javier Paz Menendez // // This content is licensed under the MIT License. See LICENSE.txt // in the top directory of this distribution for more information // **************************************************************** #ifndef PLAYERENTITY_H #define PLAYERENTITY_H #include "DynamicEntity.h" class QString; class PlayerEntity : public DynamicEntity { public: PlayerEntity(QAbstractGraphicsShapeItem *item, b2Body *body); void accelerate(); void impulse(); void rotateLeft(); void rotateRight(); void select(); void unselect(); void setTexture(const QString &texture); }; #endif // PLAYERENTITY_H
// // UIAlertController+DDRotate.h // DDCategoryDemo // // Created by 李林刚 on 2017/10/25. // Copyright © 2017年 huami. All rights reserved. // #import <UIKit/UIKit.h> @interface UIAlertController (DDRotate) @end
#ifndef DISPLAYLIST_H #define DISPLAYLIST_H #include <GL/gl.h> #include <stdbool.h> #include <stdint.h> #include "types.h" extern displaylist_t *dl_alloc(); extern void dl_append(displaylist_t *dl, packed_call_t *call); extern void dl_append_block(displaylist_t *dl, block_t *block); extern void dl_call(displaylist_t *dl); extern void dl_close(displaylist_t *dl); extern void dl_extend(displaylist_t *dl, displaylist_t *append); extern void dl_free(displaylist_t *dl); extern void *dl_retain(displaylist_t *dl, const void *ptr, size_t size); #endif
#include <unistd.h> #include <stdio.h> #include "circa/circa.h" // This script will constantly write a script to a file, and will constantly // refresh and run that module, to make sure that block reloading works correctly. void write_script_to_file(int key) { FILE* file = fopen("file_to_reload.ca", "w"); fprintf(file, "def f() -> int\n"); fprintf(file, " return %d\n", key); fclose(file); } int main(int argc, char** argv) { const int iteratations = 100; caWorld* world = circa_initialize(); Stack* stack = circa_create_stack(world); // Write initial version write_script_to_file(0); caBlock* module = circa_load_module_from_file(world, "file_to_reload", "file_to_reload.ca"); int currentKey = 0; for (int i=0; i < iteratations; i++) { // Update file on every other iteration if ((i % 2) == 1) { printf("writing to file: %d\n", i); currentKey = i; write_script_to_file(i); sleep(2); } circa_refresh_module(module); circa_push_function_by_name(stack, "f"); circa_run(stack); if (circa_has_error(stack)) { circa_print_error_to_stdout(stack); break; } int readValue = circa_int(circa_output(stack, 0)); if (currentKey != readValue) { printf("Failed, currentKey (%d) != readValue (%d)\n", currentKey, readValue); break; } circa_pop(stack); } circa_shutdown(world); }
// // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #ifndef ANTERU_D3D12_SAMPLE_IMAGEIO_H_ #define ANTERU_D3D12_SAMPLE_IMAGEIO_H_ #include <vector> #include <cstdint> #ifdef LoadImage #undef LoadImage #endif std::vector<std::uint8_t> LoadImageFromFile (const char* path, const int rowAlignment, int* width, int* height); std::vector<std::uint8_t> LoadImageFromMemory(const void* data, const std::size_t size, const int rowAlignment, int* width, int* height); #endif
#include <stdio.h> #include <stdlib.h> struct doubly_linked_list { int val; struct doubly_linked_list* prev; struct doubly_linked_list* next; }; typedef struct doubly_linked_list d_link; d_link* create(){ d_link* link = (d_link*)malloc(sizeof(d_link)); link->val = 0; link->prev=NULL; link->next=NULL; return link; } int main(int argc, char const *argv[]) { return 0; }
#ifndef __STACK_H__ #define __STACK_H__ typedef enum SR { STACK_OK = 0, STACK_ERROR = -1 } STACK_RETURN; typedef int StackItem; struct StackStruct { int capacity; int top; StackItem* stack; }; typedef struct StackStruct StackType; STACK_RETURN init_stack(StackType* sp, int max_size); STACK_RETURN destroy_stack(StackType* sp); STACK_RETURN push(StackType* sp, StackItem si); StackItem pop(StackType* sp); #endif
#ifndef SkSize_DEFINED #define SkSize_DEFINED template <typename T> struct SkTSize { T fWidth; T fHeight; void set(T w, T h) { fWidth = w; fHeight = h; } /** Returns true iff fWidth == 0 && fHeight == 0 */ bool isZero() const { return 0 == fWidth && 0 == fHeight; } /** Returns true if either widht or height are <= 0 */ bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; } /** Set the width and height to 0 */ void setEmpty() { fWidth = fHeight = 0; } T width() const { return fWidth; } T height() const { return fHeight; } /** If width or height is < 0, it is set to 0 */ void clampNegToZero() { if (fWidth < 0) { fWidth = 0; } if (fHeight < 0) { fHeight = 0; } } bool equals(T w, T h) const { return fWidth == w && fHeight == h; } }; template <typename T> static inline bool operator==(const SkTSize<T>& a, const SkTSize<T>& b) { return a.fWidth == b.fWidth && a.fHeight == b.fHeight; } template <typename T> static inline bool operator!=(const SkTSize<T>& a, const SkTSize<T>& b) { return !(a == b); } /////////////////////////////////////////////////////////////////////////////// struct SkISize : public SkTSize<int32_t> {}; #include "SkScalar.h" struct SkSize : public SkTSize<SkScalar> { SkSize& operator=(const SkISize& src) { this->set(SkIntToScalar(src.fWidth), SkIntToScalar(src.fHeight)); return *this; } SkISize round() const { SkISize s; s.set(SkScalarRound(fWidth), SkScalarRound(fHeight)); return s; } SkISize ceil() const { SkISize s; s.set(SkScalarCeil(fWidth), SkScalarCeil(fHeight)); return s; } SkISize floor() const { SkISize s; s.set(SkScalarFloor(fWidth), SkScalarFloor(fHeight)); return s; } }; #endif
/* Copyright (c) 2010-2013 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "array.h" #include "str.h" #include "env-util.h" #include "execv-const.h" #include "write-full.h" #include "restrict-access.h" #include "master-interface.h" #include "master-service.h" #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/socket.h> #define SCRIPT_MAJOR_VERSION 3 #define SCRIPT_READ_TIMEOUT_SECS 10 static ARRAY_TYPE(const_string) exec_args; static void script_verify_version(const char *line) { if (line == NULL || !version_string_verify(line, "script", SCRIPT_MAJOR_VERSION)) { i_fatal("Client not compatible with this binary " "(connecting to wrong socket?)"); } } static void exec_child(struct master_service_connection *conn, const char *const *args) { unsigned int i, socket_count; if (dup2(conn->fd, STDIN_FILENO) < 0) i_fatal("dup2() failed: %m"); if (dup2(conn->fd, STDOUT_FILENO) < 0) i_fatal("dup2() failed: %m"); /* close all fds */ socket_count = master_service_get_socket_count(master_service); for (i = 0; i < socket_count; i++) { if (close(MASTER_LISTEN_FD_FIRST + i) < 0) i_error("close(listener) failed: %m"); } if (close(MASTER_STATUS_FD) < 0) i_error("close(status) failed: %m"); if (close(conn->fd) < 0) i_error("close(conn->fd) failed: %m"); for (; *args != NULL; args++) array_append(&exec_args, args, 1); array_append_zero(&exec_args); env_clean(); args = array_idx(&exec_args, 0); execvp_const(args[0], args); } static bool client_exec_script(struct master_service_connection *conn) { const char *const *args; string_t *input; void *buf; size_t prev_size, scanpos; bool header_complete = FALSE; ssize_t ret; int status; pid_t pid; net_set_nonblock(conn->fd, FALSE); input = buffer_create_dynamic(pool_datastack_create(), IO_BLOCK_SIZE); /* Input contains: VERSION .. <lf> [timeout=<timeout>] <noreply> | "-" <lf> arg 1 <lf> arg 2 <lf> ... <lf> DATA */ alarm(SCRIPT_READ_TIMEOUT_SECS); scanpos = 1; while (!header_complete) { const unsigned char *pos, *end; prev_size = input->used; buf = buffer_append_space_unsafe(input, IO_BLOCK_SIZE); /* peek in socket input buffer */ ret = recv(conn->fd, buf, IO_BLOCK_SIZE, MSG_PEEK); if (ret <= 0) { buffer_set_used_size(input, prev_size); if (strchr(str_c(input), '\n') != NULL) script_verify_version(t_strcut(str_c(input), '\n')); if (ret < 0) i_fatal("recv(MSG_PEEK) failed: %m"); i_fatal("recv(MSG_PEEK) failed: disconnected"); } /* scan for final \n\n */ pos = CONST_PTR_OFFSET(input->data, scanpos); end = CONST_PTR_OFFSET(input->data, prev_size + ret); for (; pos < end; pos++) { if (pos[-1] == '\n' && pos[0] == '\n') { header_complete = TRUE; pos++; break; } } scanpos = pos - (const unsigned char *)input->data; /* read data for real (up to and including \n\n) */ ret = recv(conn->fd, buf, scanpos-prev_size, 0); if (prev_size+ret != scanpos) { if (ret < 0) i_fatal("recv() failed: %m"); if (ret == 0) i_fatal("recv() failed: disconnected"); i_fatal("recv() failed: size of definitive recv() differs from peek"); } buffer_set_used_size(input, scanpos); } alarm(0); /* drop the last two LFs */ buffer_set_used_size(input, scanpos-2); args = t_strsplit(str_c(input), "\n"); script_verify_version(*args); args++; if (*args != NULL) { if (strncmp(*args, "alarm=", 6) == 0) { alarm(atoi(*args + 6)); args++; } if (strcmp(*args, "noreply") == 0) { /* no need to fork and check exit status */ exec_child(conn, args + 1); i_unreached(); } if (**args == '\0') i_fatal("empty options"); args++; } if ((pid = fork()) == (pid_t)-1) { i_error("fork() failed: %m"); return FALSE; } if (pid == 0) { /* child */ exec_child(conn, args); i_unreached(); } /* parent */ /* check script exit status */ if (waitpid(pid, &status, 0) < 0) { i_error("waitpid() failed: %m"); return FALSE; } else if (WIFEXITED(status)) { ret = WEXITSTATUS(status); if (ret != 0) { i_error("Script terminated abnormally, exit status %d", (int)ret); return FALSE; } } else if (WIFSIGNALED(status)) { i_error("Script terminated abnormally, signal %d", WTERMSIG(status)); return FALSE; } else if (WIFSTOPPED(status)) { i_fatal("Script stopped, signal %d", WSTOPSIG(status)); return FALSE; } else { i_fatal("Script terminated abnormally, return status %d", status); return FALSE; } return TRUE; } static void client_connected(struct master_service_connection *conn) { char response[2]; response[0] = client_exec_script(conn) ? '+' : '-'; response[1] = '\n'; if (write_full(conn->fd, &response, 2) < 0) i_error("write(response) failed: %m"); } int main(int argc, char *argv[]) { const char *binary; int i; master_service = master_service_init("script", 0, &argc, &argv, "+"); if (master_getopt(master_service) > 0) return FATAL_DEFAULT; argc -= optind; argv += optind; master_service_init_log(master_service, "script: "); restrict_access_by_env(NULL, FALSE); restrict_access_allow_coredumps(TRUE); master_service_init_finish(master_service); master_service_set_service_count(master_service, 1); if (argv[0] == NULL) i_fatal("Missing script path"); if (argv[0][0] == '/') binary = argv[0]; else binary = t_strconcat(PKG_LIBEXECDIR"/", argv[0], NULL); i_array_init(&exec_args, argc + 16); array_append(&exec_args, &binary, 1); for (i = 1; i < argc; i++) { const char *arg = argv[i]; array_append(&exec_args, &arg, 1); } master_service_run(master_service, client_connected); master_service_deinit(&master_service); return 0; }
#ifndef CommandTree_h #define CommandTree_h #include "unordered_map" #include "functional" class CommandNode{ public: CommandNode* parrent=0; std::string info; std::function<void(void)> func; std::unordered_map<std::string,CommandNode*> leafs; CommandNode() = default; CommandNode( CommandNode* parrent_, std::string info_, std::function<void(void)> func_=[](){} ):parrent(parrent_),info(info_),func(func_){}; CommandNode* addLeaf( std::string s, std::string info_, std::function<void(void)> func_=[](){} ){ CommandNode* leaf = new CommandNode( this, info_, func_ ); leafs[s] = leaf; return leaf; } char* leafsToStr(char* s){ for( const auto& it : leafs ){ s+=sprintf( s, "[%s] : %s \n", it.first.c_str(), it.second->info.c_str() ); } return s; } }; class CommandTree{ public: CommandNode root; CommandNode* cur =&root; void eval(std::string s){ //printf( "DEBUG CommandTree::eval(%s)\n", s.c_str() ); auto it = cur->leafs.find( s ); if(it != cur->leafs.end()){ cur = it->second; cur->func(); // call the lambda-function } } void goBack(){ if(cur->parrent==0) return; cur=cur->parrent; } char* curInfo(char* s){ return cur->leafsToStr(s); } }; #endif
#ifndef ATOM_H #define ATOM_H #include "term.h" #include "variable.h" class Atom : public Term { public: Atom (std::string s); bool match(Term &term); std::string symbol() const; private: std::string _symbol; }; #endif
#pragma once class INIReader { public: INIReader(string mediakey); float getf(string key); int geti(string key); string gets(string key); ~INIReader(); private: unordered_map<string, string> data; void readString(string str); };
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSExpression.h" #import "IBDocumentArchiving.h" @class NSString; @interface NSExpression (IBDocumentArchiving) <IBDocumentArchiving> + (id)instantiateWithDocumentUnarchiver:(id)arg1; - (void)unarchiveWithDocumentUnarchiver:(id)arg1; - (void)archiveWithDocumentArchiver:(id)arg1; - (Class)classForDocumentArchiver:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
// // JLAlertView.h // JLAlertView // // Created by skyline on 16/4/6. // Copyright © 2016年 skyline. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for JLAlertView. FOUNDATION_EXPORT double JLAlertViewVersionNumber; //! Project version string for JLAlertView. FOUNDATION_EXPORT const unsigned char JLAlertViewVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <JLAlertView/PublicHeader.h>
/* * _math_manip.c * * Created on: Jan 30, 2016 * Author: enerccio */ #define __INCLUDED_FROM_CLIB #include <math.h> #include "intinc/math.h"
// // The MIT License (MIT) // // // Copyright (c) 2014 Broad Institute // // // 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. // // // Created by turner on 3/16/12. // // To change the template use AppCode | Preferences | File Templates. // #import <Foundation/Foundation.h> @class FeatureList; @class FeatureInterval; @class TrackView; @interface Renderer : NSObject - (void)renderInRect:(CGRect)rect featureList:(FeatureList *)featureList trackProperties:(NSDictionary *)trackProperties track:(TrackView *)track; - (void)renderInRect:(CGRect)rect sampleRows:(NSDictionary *)sampleRows sampleNames:(NSArray *)sampleNames; + (void)calculateStartIndex:(NSInteger *)startIndex endIndex:(NSInteger *)endIndex featureList:(FeatureList *)featureList currentFeatureInterval:(FeatureInterval *)currentFeatureInterval; @end
// Copyright 2015 Las Venturas Playground. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. #ifndef PLAYGROUND_BINDINGS_MODULES_MYSQL_CONNECTION_MESSAGES_H_ #define PLAYGROUND_BINDINGS_MODULES_MYSQL_CONNECTION_MESSAGES_H_ #include <memory> #include <string> namespace mysql { class QueryResult; class ConnectionMessages { public: // Definitions for the messages we can pass between the host and client threads. struct ConnectionInformation { ConnectionInformation() : id(0), port(0) {} unsigned int id; std::string hostname, username, password, database; unsigned int port; }; struct QueryInformation { QueryInformation() : id(0) {} unsigned int id; std::string query; }; struct ConnectionAttemptResult { ConnectionAttemptResult() : id(0), succeeded(false), error_number(0) {} unsigned int id; bool succeeded; int error_number; std::string error_message; }; struct FailedQueryResult { FailedQueryResult() : id(0), error_number(0) {} unsigned int id; int error_number; std::string error_message; }; struct SucceededQueryResult { SucceededQueryResult() : id(0) {} unsigned int id; std::shared_ptr<QueryResult> result; }; }; } // namespace mysql #endif // PLAYGROUND_BINDINGS_MODULES_MYSQL_CONNECTION_MESSAGES_H_
/* * Software License Agreement (BSD License) * * Copyright (c) 2009, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $Id$ * */ /** \author Marius Muja **/ #ifndef TYPES_H_ #define TYPES_H_ #include <string> #include <stdexcept> #include <opencv2/core/core.hpp> namespace recognition_pipeline { /* struct Object { int id; std::string name; }; struct Detection { Object object; cv::Rect bounding_box; std::string detector; float score; }; struct Mask { cv::Rect roi; cv::Mat mask; }; */ class Exception : public std::runtime_error { public: Exception(const char* message) : std::runtime_error(message) {}; Exception(const std::string& message) : std::runtime_error(message) {}; }; } #endif /* TYPES_H_ */
#import <UIKit/UIKit.h> @interface KPBMoreInfoViewController : UIViewController @end
// // XMBasePayloadModel.h // XMMobileConfig // // Created by chi on 15/6/4. // Copyright (c) 2015年 chi. All rights reserved. // //The MIT License (MIT) // //Copyright (c) 2015 devcxm <devcxm@qq.com> // //Permission is hereby granted, free of charge, to any person obtaining a copy //of this software and associated documentation files (the "Software"), to deal //in the Software without restriction, including without limitation the rights //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //copies of the Software, and to permit persons to whom the Software is //furnished to do so, subject to the following conditions: // //The above copyright notice and this permission notice shall be included in all //copies or substantial portions of the Software. // //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //SOFTWARE. #import <Foundation/Foundation.h> #define kAppAccessPayloadType (@"com.apple.applicationaccess") #define kWebClipPayloadType (@"com.apple.webClip.managed") #define kWiFiPayloadType (@"com.apple.wifi.managed") @interface XMBasePayloadModel : NSObject /** * 描述 */ @property (nonatomic, copy) NSString *PayloadDescription; /** * 机构 */ @property (nonatomic, copy) NSString *PayloadOrganization; /** * 显示名称 */ @property (nonatomic, copy) NSString *PayloadDisplayName; /** * 标识 */ @property (nonatomic, copy) NSString *PayloadIdentifier; /** * 唯一标识符 */ @property (nonatomic, copy) NSString *PayloadUUID; /** * 版本 */ @property (nonatomic, strong) NSNumber *PayloadVersion; /** * 类型 */ @property (nonatomic, copy) NSString *PayloadType; #pragma mark - /** * 获取实例 */ + (instancetype)xmModelInstance; /** * 转换为字典 */ - (NSDictionary*)toDictionary; /** * 从字典实例化 */ + (instancetype)XMModelWithDictionary:(NSDictionary*)dict; /** * 是否有效的模型 */ - (BOOL)isValid; #pragma mark - /** * 获取UUID * * @return UUID */ + (NSString*)getUniqueStrByUUID; @end
// Copyright (c) 2014, ultramailman // This file is licensed under the MIT License. #include <assert.h> #include <stdio.h> #include <time.h> #include "rhtable.h" #include "rhtable_safe.h" typedef struct{ uint32_t n; } Key; typedef struct{ uint64_t index; } Val; int KeyEq(Key const * a, Key const * b) { return a->n == b->n; } uint32_t KeyHash(Key const * a) { return a->n * 65537; } RHTABLE_DEFINE_SAFE(hashtable, Key, Val, KeyEq, KeyHash) #define LENGTH 30000 // random data static inline unsigned random(unsigned x) { return (x * 16807) % ((2 << 31) - 1); } Key data [LENGTH]; unsigned membership[LENGTH]; void init(void) { unsigned seed = 10; for(int i = 0; i < LENGTH; i++) { seed = random(seed); data[i].n = seed; membership[i] = 0; } } static void testRemoval(hashtable * t, unsigned begin, unsigned end) { for(unsigned i = begin; i < end; i++) { int found = hashtable_get(t, data + i, 0, 0); if(membership[i]) { assert(found); hashtable_del(t, data + i); found = hashtable_get(t, data + i, 0, 0); assert(!found); membership[i] = 0; } } } static void testFind(hashtable * t) { for(int i = 0; i < LENGTH; i++) { Key rkey; Val rval; int found = hashtable_get(t, data + i, &rkey, &rval); if(membership[i]) { assert(found); assert(data[rval.index].n == rkey.n); assert(data[rval.index].n == data[i].n); } else { assert(!found); } } } static void testInsert(hashtable * t, unsigned begin, unsigned end) { for(int i = 0; i < LENGTH; i++) { Key key = data[i]; Val val = {i}; int good = hashtable_set(t, &key, &val); if(good) { Key rkey; Val rval; int found = hashtable_get(t, data + i, &rkey, &rval); assert(found); assert(rkey.n == key.n); assert(rval.index == val.index); assert(data[rval.index].n == rkey.n); assert(data[rval.index].n == data[i].n); membership[i] = 1; } else { printf("table full %d\n", i); } } printf("items in: %d\n", hashtable_count(t)); printf("total number of items: %d\n", LENGTH); printf("table capacity: %d\n", hashtable_slots(t)); float count = hashtable_count(t); float slots = hashtable_slots(t); float load = count / slots; float averageDib = hashtable_average_dib(t); fprintf(stdout, "load: %f\n", load); fprintf(stdout, "average dib: %f\n\n", averageDib); } static void testIterator(hashtable * t) { rh_for_safe(hashtable, t, iter) { Key rkey; Val rval; assert(hashtable_get(t, iter.key, &rkey, &rval)); assert(rkey.n == data[rval.index].n); assert(membership[rval.index]); } } int main(int argc, char ** argv) { init(); unsigned size = 45001; if(argc == 2) { sscanf(argv[1], "%ud", &size); } hashtable t = hashtable_create(size); clock_t t1 = clock(); testInsert(&t, 0, LENGTH); testFind(&t); testIterator(&t); testRemoval(&t, 0, LENGTH); clock_t t2 = clock(); printf("time: %lu\n", t2 - t1); }
// // FTESettingsViewController.h // FreeTamilEbook // // Created by Kishore on 23/1/14. // Copyright (c) 2014 KishoreK. All rights reserved. // #import <UIKit/UIKit.h> @interface FTESettingsViewController : FTEBaseViewController - (IBAction)nightModeTapped:(id)sender; - (IBAction)resetTapped:(id)sender; - (IBAction)closeTapped:(id)sender; @property (weak, nonatomic) IBOutlet UISwitch *nightModeSwitch; @property (weak, nonatomic) IBOutlet UITextView *aboutTV; @property (weak, nonatomic) IBOutlet UILabel *lblVersion; @property (nonatomic, assign) BOOL hideResetOption; @end
// // IYWPushService.h // // // Created by huanglei on 14/12/16. // Copyright (c) 2014年 taobao. All rights reserved. // #import <Foundation/Foundation.h> @protocol IYWMessage; @class YWPerson; /// Push服务错误域 FOUNDATION_EXTERN NSString *const YWPushServiceDomain; /** Push服务 */ @protocol IYWPushService <NSObject> /** * 获取转换后的deviceToken字符串 */ @property (nonatomic, readonly) NSString *deviceTokenString; #pragma mark - V3 /** * Push处理回调 * @param aIsLaunching 是否是用户划开push启动app(app原先处于未启动状态) * @param aState app当前状态,您可以判断是否是由于用户划开push,导致app从后台进入前台 * @param aAPS APS消息本身 * @param aConversationId 会话Id * @param aConversationClass 会话类型,返回值可能是:[YWP2PConversation class]、[YWTribeConversation class] * @param aToPerson 供调试使用,你一般不需要关心这个参数;消息是发送给哪个帐号 */ typedef void(^YWPushHandleResultBlockV3)(BOOL aIsLaunching, UIApplicationState aState, NSDictionary *aAPS, NSString *aConversationId, Class aConversationClass, YWPerson *aToPerson); @property (nonatomic, copy, readonly) YWPushHandleResultBlockV3 handlePushBlockV3; /** * 现在IMSDK可以自己监听到Push事件,您只需要在-[AppDelegate application:didFinishLaunchingWithOptions:]中设置下面这个回调,做对应的处理。 * @note 您不需要再调用V2或者V1版本中的handleXXX函数,在 application:didFinishLaunchingWithOptions 中实现 setHandlePushBlockV3: 回调即可 */ - (void)setHandlePushBlockV3:(YWPushHandleResultBlockV3)handlePushBlockV3; #pragma mark - deprecated /** * 现在当你的app获取到DeviceToken时,IMSDK会截获到该DeviceToken,自动使用该DeviceToken,您不需要调用此接口设置。 */ @property (nonatomic, copy, readwrite) NSData *deviceToken; #pragma mark - V1 /** * Push处理回调 * @param aAPS APS消息本身 * @param aConversationId 会话Id */ typedef void(^YWPushHandleResultBlock)(NSDictionary *aAPS, NSString *aConversationId); /** * 处理启动参数 * @param aLaunchOptions 启动参数 * @param aCompletionBlock 如果OpenIM接受处理该启动参数,在处理完毕后通过此回调返回结果 * @return OpenIM是否接受处理该启动参数 */ - (BOOL)handleLaunchOptions:(NSDictionary *)aLaunchOptions completionBlock:(YWPushHandleResultBlock)aCompletionBlock __attribute__((deprecated("您不需要再调用V2或者V1版本中的handleXXX函数,在 application:didFinishLaunchingWithOptions 中实现 setHandlePushBlockV3: 回调即可"))); /** * 处理Push消息 * @param aPushUserInfo * @param aCompletionBlock * @return OpenIM是否接受处理该Push */ - (BOOL)handlePushUserInfo:(NSDictionary *)aPushUserInfo completionBlock:(YWPushHandleResultBlock)aCompletionBlock __attribute__((deprecated("您不需要再调用V2或者V1版本中的handleXXX函数,在 application:didFinishLaunchingWithOptions 中实现 setHandlePushBlockV3: 回调即可"))); #pragma mark - V2 /** * Push处理回调 * @param aAPS APS消息本身 * @param aConversationId 会话Id * @param aConversationClass 会话类型,返回值可能是:[YWP2PConversation class]、[YWTribeConversation class] */ typedef void(^YWPushHandleResultBlockV2)(NSDictionary *aAPS, NSString *aConversationId, Class aConversationClass); /** * 处理启动参数 * @param aLaunchOptions 启动参数 * @param aCompletionBlock 如果OpenIM接受处理该启动参数,在处理完毕后通过此回调返回结果 * @return OpenIM是否接受处理该启动参数 */ - (BOOL)handleLaunchOptionsV2:(NSDictionary *)aLaunchOptions completionBlock:(YWPushHandleResultBlockV2)aCompletionBlock __attribute__((deprecated("您不需要再调用V2或者V1版本中的handleXXX函数,在 application:didFinishLaunchingWithOptions 中实现 setHandlePushBlockV3: 回调即可"))); /** * 处理Push消息 * @param aPushUserInfo * @param aCompletionBlock * @return OpenIM是否接受处理该Push */ - (BOOL)handlePushUserInfoV2:(NSDictionary *)aPushUserInfo completionBlock:(YWPushHandleResultBlockV2)aCompletionBlock __attribute__((deprecated("您不需要再调用V2或者V1版本中的handleXXX函数,在 application:didFinishLaunchingWithOptions 中实现 setHandlePushBlockV3: 回调即可"))); @end
// // XMDatePicker.h // XMDatePicker // // Created by guoran on 2017/3/6. // Copyright © 2017年 hanna. All rights reserved. // #import <UIKit/UIKit.h> #import "XMDateEnum.h" typedef enum{ PickerViewTypeLongSperator = 1,//Default PickerViewTypeDynamicSperator, PickerViewTypeStaticSperator } PickerViewType; @class XMDatePicker; @protocol XMDatePickerDelegate <NSObject> @optional //- (NSInteger)numberOfComponentsInPickerView:(XMDatePicker *)pickerView; //- (NSString *)dateStringFromPickerView:(XMDatePicker *)pickerView; - (void)pickerView:(XMDatePicker *)pickerView didSelectedDateString:(NSString *)dateString; - (void)pickerView:(XMDatePicker *)pickerView didClickOkButtonWithDateString:(NSString *)dateString; //- (void)picker:(XMDatePicker *)picker @end @interface XMDatePicker : UIView /***/ @property(nonatomic, strong)UILabel *dateLabel; @property(nonatomic, assign)BOOL defaultType; @property(nonatomic, assign)PickerViewType pickerViewType; @property(nonatomic, assign)DateShowingType dateShowType; /**hide the top static sperate line*/ @property(nonatomic, assign)BOOL hideTopStaticSperateLine; /**hide the bottom static sperate line*/ @property(nonatomic, assign)BOOL hideBottomStaticSperateLine; /** sperate line color 分割线颜色*/ @property(nonatomic, strong)UIColor *seperateLineColor; @property(nonatomic, assign)CGFloat seperatorWidth; /** start time.It is 1970 default if is not setted*/ @property(nonatomic, assign)int fromYear __attribute__((deprecated("请用maximumDate替换,否则程序可能会崩溃"))); /** end time*/ @property(nonatomic, assign)int toYear __attribute__((deprecated("请用minimumDate替换,否则程序可能会崩溃"))); @property(nonatomic, weak)id<XMDatePickerDelegate>delegate; @property(nonatomic, assign)CGFloat componentWidth; @property(nonatomic, assign)CGFloat rowHeight; @property(nonatomic, strong)UIFont *selectedTextFont; @property(nonatomic, strong)UIColor *selectedTextColor; @property(nonatomic, strong)UIColor *selectedLabelColor; @property(nonatomic, strong)UIFont *otherTextFont; @property(nonatomic, strong)UIColor *otherTextColor; @property(nonatomic, strong)UIColor *otherLabelColor; /*** Time unit (单位)*/ @property(nonatomic, copy)NSString *yearUnit; @property(nonatomic, copy)NSString *monthUnit; @property(nonatomic, copy)NSString *dayUnit; @property(nonatomic, copy)NSString *hourUnit; @property(nonatomic, copy)NSString *miniteUnit; @property(nonatomic, copy)NSString *secondUnit; @property(nonatomic, assign)CGFloat topMargin; @property(nonatomic, assign)CGFloat bottomMargin; /** 最大时间*/ @property (nullable, nonatomic, strong) NSDate *maximumDate; /** 最小时间*/ @property (nullable, nonatomic, strong) NSDate *minimumDate; - (void)showPickerView; @end
#include "figure.h" #define FIGURE_LENGTH 4 /* 0 1 2 3 0 1 1 4 5 6 7 5 6 4 5 8 9 A B 8 C D E F */ /* ------------------------------------------------------------------------ */ static unsigned int get_figure(int fig, int angle) { static const unsigned short c_figures[] = { 0x0156, 0x1458, 0x0156, 0x1458, // z 0x1245, 0x0459, 0x1245, 0x0459, // s 0x2456, 0x159A, 0x0124, 0x0159, // L 0x0126, 0x1589, 0x0456, 0x1259, // j 0x1459, 0x1456, 0x1569, 0x0125, // T 0x4567, 0x159d, 0x4567, 0x159d, // | 0x1256, 0x1256, 0x1256, 0x1256 // o }; //assert(fig >= 0 && fig < 7); return c_figures[fig * 4 + (angle & 3)]; } /* ------------------------------------------------------------------------ */ void figure_init(figure_t *self, int id) { self->x = self->y = self->angle = 0; self->id = id; } /* ------------------------------------------------------------------------ */ int figure_top(int id) { unsigned int fig = get_figure(id, 0); unsigned int top = 10; for (int i = 0; i < FIGURE_LENGTH && top; ++i, fig >>= 4) { unsigned int y = ((fig >> 2) & 3); if (y < top) top = y; } return (signed)top; } /* ------------------------------------------------------------------------ */ void figure_draw(figure_t *self, field_t *field, int show) { int id = self->id; if (id < 0) return; unsigned char fill = (unsigned char)(id + 1); if (!show) fill = 0; unsigned int fig = get_figure(id, self->angle); int x = self->x, y = self->y; for (int i = 0; i < FIGURE_LENGTH; ++i, fig >>= 4) field_set_cell(field, x + (signed)(fig & 3), y + (signed)((fig >> 2) & 3), fill); } /* ------------------------------------------------------------------------ */ int figure_test(figure_t *self, field_t *field) { int id = self->id; if (id < 0) return 1; unsigned int fig = get_figure(id, self->angle); int x = self->x, y = self->y; for (int i = 0; i < FIGURE_LENGTH; ++i, fig >>= 4) if (field_get_cell(field, x + (signed)(fig & 3), y + (signed)((fig >> 2) & 3))) return 1; return 0; }
// // AOJ0074.c // // // Created by n_knuu on 2014/03/03. // // #include <stdio.h> int main(void) { int hour,minute,second,rest,rh,rm,rs; while (1) { scanf("%d %d %d\n",&hour,&minute,&second); if (hour==-1&&minute==-1&&second==-1) break; rest=7200-(hour*3600+minute*60+second); rh=rest/3600; rest%=3600; rm=rest/60; rs=rest%60; printf("%02d:%02d:%02d\n",rh,rm,rs); rest=(7200-(hour*3600+minute*60+second))*3; rh=rest/3600; rest%=3600; rm=rest/60; rs=rest%60; printf("%02d:%02d:%02d\n",rh,rm,rs); } return 0; }
// // Created by Bartel on 16.07.15. // #import <Foundation/Foundation.h> #import "IVISPERWireframePresentationType.h" @protocol IVISPERWireframePresentationTypeModal <IVISPERWireframePresentationType> -(UIModalPresentationStyle)presentationStyle; -(void)setPresentationStyle:(UIModalPresentationStyle)presentationStyle; @end
/* Author: Steve Wood <swood@cromulence.com> Copyright (c) 2016 Cromulence LLC 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 FILE_S_H #define FILE_S_H #define MAX_FILENAME_LEN 40 #define MAX_OPEN_FILES 10 #define ROOT_ID 1 typedef int securityIdType; typedef unsigned char otherPermsType; enum fileTypes { DIRECTORY = 0x1, REGULAR = 0x2, RW_MEMORY = 0x3, RO_MEMORY = 0x4 }; enum errorCodes { NO_ERROR = 0x0, ERROR_NOT_FOUND = -1, ERROR_BAD_TYPE = -2, ERROR_BAD_GEOMETRY = -3, ERROR_BAD_SIZE = -4, ERROR_NO_BLOCKS = -5, ERROR_BAD_VALUE = -6, ERROR_EOF = -7, ERROR_READ_ERROR = -8, ERROR_INIT = -9, ERROR_MAX_EXCEEDED = -10, ERROR_BAD_HANDLE = -11, ERROR_FILE_EXISTS = -12, ERROR_FILE_OPEN = -13, ERROR_NO_PERMISSION = -14 }; typedef struct { unsigned int inUse; unsigned int totalSize; unsigned int blockSize; unsigned int totalBlocks; unsigned int rootDirBlock; unsigned int freeListBlock; unsigned int dirEntriesPerBlock; unsigned int blockEntriesPerCatalog; unsigned int checkValue; } MasterBlockType; typedef struct { unsigned int totalSize; unsigned int blockSize; unsigned int totalBlocks; unsigned int freeBlocks; unsigned int maxEntriesPerDirectory; unsigned int maxBlocksPerFile; } fileSystemInfoType; typedef struct { MasterBlockType mblock0; MasterBlockType mblock1; MasterBlockType mblock3; } mbStructType; typedef struct { unsigned int RESERVED; securityIdType securityID; otherPermsType othersPermissions; unsigned int fileSize; enum fileTypes fileType; unsigned int firstCatalogBlock; char name[MAX_FILENAME_LEN]; } directoryEntryType; typedef struct { unsigned short maxEntries; unsigned short numEntries; directoryEntryType entry[]; } rootDirType; typedef struct { enum fileTypes type; unsigned int size; } fileInfoType; typedef struct { directoryEntryType *currentFile; enum fileTypes; char filespec[MAX_FILENAME_LEN]; } findFileHandleType; typedef char fileHandleType; typedef struct { unsigned int inUse; unsigned int dirEntryNum; unsigned int readBlockNum; unsigned int readPos; unsigned int writeBlockNum; unsigned int writePos; unsigned int fileSize; securityIdType securityID; otherPermsType othersPermissions; enum fileTypes fileType; } fileCursorType; int initFileSystem( unsigned int sectorSize, unsigned int blockSize, unsigned int totalSize ); int createFile( char *name, enum fileTypes type, securityIdType); int deleteFile( fileHandleType fh, securityIdType ); int truncateFile ( fileHandleType fh, securityIdType ); int findFiles( char *filespec, findFileHandleType **currentFile ); int findNextFile( findFileHandleType *currentFile); int statusFile( char *name, fileInfoType *info ); fileHandleType openFile( char *name, securityIdType ); int writeFile( fileHandleType fh, char *buffer, unsigned int size, securityIdType ); int readFile(fileHandleType fh, char *buffer, unsigned int size, int relPosition, unsigned int *numRead, securityIdType); int closeFile( fileHandleType fh ); int flushFile( fileHandleType fh ); int fileReadPosition( fileHandleType fh, unsigned int offset ); int fileReadPosRelative( fileHandleType fh, int offset ); int fileWritePosition( fileHandleType fh, unsigned int offset ); int fileWritePosRelative( fileHandleType fh, int offset ); int getFileSystemInfo(fileSystemInfoType *fsInfo); int createDirectory( char *name, securityIdType ); int setPerms(fileHandleType fh, otherPermsType othersPermissions, securityIdType securityID); int makeMemoryFile(char *name, unsigned int address, unsigned int length, char accessType, securityIdType ); #endif
//Author// //Miroslav Vitkov 2013 //sir.vorac(at)gmail(dot)com //License// //Beerware #include "OnOffController.h" #include <stdlib.h> #include <string.h> error_t ONOFFcreate(ONOFF_o **obj, const ONOFFconfig_s *const config){ if(!config) return ERROR_NULL_POINTER; *obj = (ONOFF_o*)malloc(sizeof(ONOFF_o)); if(*obj == NULL) return ERROR_ALLOCATION_FAILURE; memcpy((void*)&(**obj).config, (void*)config, sizeof(ONOFFconfig_s)); (**obj).report.memFootprint = sizeof(ONOFF_o); (**obj).data.previousOutput = 0; return SUCCESS; }
#ifndef _onewire_h_ #define _onewire_h_ unsigned char onewire_reset(void); void onewire_bit_write(unsigned char b); unsigned char onewire_bit_read(void); void onewire_byte_write(unsigned char b); unsigned char onewire_byte_read(void); unsigned char onewire_read(unsigned char bits); #endif
#include <sys/inotify.h> #include <unistd.h> #include <limits.h> #include <cups/cups.h> #define BUF_LEN (sizeof(struct inotify_event) + NAME_MAX + 1) #define WATCHPATH "/home/ian/.PRINT" int main(int argc, char *argv[]) { cups_dest_t *dest; char *printer; int notify = inotify_init(); if (inotify_add_watch(notify, WATCHPATH, IN_CLOSE_WRITE) == -1) return 1; if (chdir(WATCHPATH) != 0) return 1; // Get default printer if ((dest = cupsGetNamedDest(NULL, NULL, NULL)) == NULL) return 1; printer = strdup(dest->name); free(dest); while (1) { char buf[BUF_LEN]; struct inotify_event *event; char *filename; int job_id; read(notify, buf, BUF_LEN); event = (struct inotify_event *)&buf[0]; filename = event->name; if (filename[0] == '.') continue; job_id = cupsPrintFile(printer, filename, filename, 0, NULL); cupsStartDocument(CUPS_HTTP_DEFAULT, printer, job_id, NULL, CUPS_FORMAT_AUTO, 1); unlink(filename); } }
/** #******************************************************************************* # Projet : VOR-005 # Sous projet : calibrateur de servo moteurs # Auteurs: Gille De Bussy # # Classe potar: fichier d'entete Classe qui s'utilise avec un timer Elle filtre les faibles variations jusqu'a ce qu'elles soient suffisement significatives #******************************************************************************* J.Soranzo 13/10/2016: commentaire */ #ifndef potar_h #define potar_h #include <Arduino.h> class potar { public: potar(byte pin); void init(); //parce que dans le constructeur lire la pin anlogique //ne marche pas (=0sytématiquement) void refresh(); bool hasBeenMovedALot(); void acquit(); //remet les etat a zero (moved) int getValue();//retourne valeur reel du potar private: byte _pin; //numero de Pin pour le potar int _value; // Valeur reelle int _valueRef; // valeure de reference pour voir s'il bouge bool _movedALot; // si a bouge beaucoups }; #endif
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\UX\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #ifndef __APP_UNO_U_X_VALUE_CHANGED_ARGS__FUSE_FONT_H__ #define __APP_UNO_U_X_VALUE_CHANGED_ARGS__FUSE_FONT_H__ #include <app/Uno.EventArgs.h> #include <Uno.h> namespace app { namespace Fuse { struct Font; } } namespace app { namespace Uno { namespace UX { struct ValueChangedArgs__Fuse_Font; struct ValueChangedArgs__Fuse_Font__uType : ::app::Uno::EventArgs__uType { }; ValueChangedArgs__Fuse_Font__uType* ValueChangedArgs__Fuse_Font__typeof(); void ValueChangedArgs__Fuse_Font___ObjInit_1(ValueChangedArgs__Fuse_Font* __this, ::app::Fuse::Font* value, ::uObject* origin); ::uObject* ValueChangedArgs__Fuse_Font__get_Origin(ValueChangedArgs__Fuse_Font* __this); ::app::Fuse::Font* ValueChangedArgs__Fuse_Font__get_Value(ValueChangedArgs__Fuse_Font* __this); ValueChangedArgs__Fuse_Font* ValueChangedArgs__Fuse_Font__New_2(::uStatic* __this, ::app::Fuse::Font* value, ::uObject* origin); void ValueChangedArgs__Fuse_Font__set_Origin(ValueChangedArgs__Fuse_Font* __this, ::uObject* value); void ValueChangedArgs__Fuse_Font__set_Value(ValueChangedArgs__Fuse_Font* __this, ::app::Fuse::Font* value); struct ValueChangedArgs__Fuse_Font : ::app::Uno::EventArgs { ::uStrong< ::app::Fuse::Font*> _Value; ::uStrong< ::uObject*> _Origin; void _ObjInit_1(::app::Fuse::Font* value, ::uObject* origin) { ValueChangedArgs__Fuse_Font___ObjInit_1(this, value, origin); } ::uObject* Origin() { return ValueChangedArgs__Fuse_Font__get_Origin(this); } ::app::Fuse::Font* Value() { return ValueChangedArgs__Fuse_Font__get_Value(this); } void Origin(::uObject* value) { ValueChangedArgs__Fuse_Font__set_Origin(this, value); } void Value(::app::Fuse::Font* value) { ValueChangedArgs__Fuse_Font__set_Value(this, value); } }; }}} #endif
/* * adxl345.h * * Created: 9/7/2015 3:53:35 PM * Author: Chip */ #ifndef MOD_ADXL345_H_ #define MOD_ADXL345_H_ #define MADX_I2C_ADRS 0x53 void mod_adxl_init(); void mod_adxl_sendCmd( uint8_t reg, uint8_t val ); void mod_adxl_readReg( uint8_t reg, uint8_t* val ); void mod_adxl_readData( uint8_t reg, uint8_t* val ); void mod_adxl_setRange( uint8_t val ); #endif /* MOD_ADXL345_H_ */
#include "main_inc.h" int mainIwdg(void) { /*系统延时定时器初始化*/ SysTickDelay_DriverRegister(SysTickDelayF103_Init, SysTickDelayF103_DelayMs, SysTickDelayF103_DelayUs); SysTickDelay_Init(); /*系统LED初始化*/ DeviceLed_DriverRegister(BOARD_LED_RED, DeviceLedF103_RedInit, DeviceLedF103_RedSet, DeviceLedF103_RedGet, DeviceLedF103_RedReversal); DeviceLed_DriverRegister(BOARD_LED_GREEN, DeviceLedF103_GreenInit, DeviceLedF103_GreenSet, DeviceLedF103_GreenGet, DeviceLedF103_GreenReversal); DeviceLed_Init(BOARD_LED_RED, BOARD_LED_EXTINGUISH); DeviceLed_Init(BOARD_LED_GREEN, BOARD_LED_EXTINGUISH); /*串口初始化*/ /*注册驱动函数*/ DeviceUsart1_DriverRegister(DeviceUsart1F103_Init, DeviceUsart1F103_SendChar, DeviceUsart1F103_SendBuffer, DeviceUsart1F103_SendString, DeviceUsart1F103_ReadRecv, DeviceUsart1F103_ClearRecv); /*初始化*/ DeviceUsart1_Init(115200); printf("UASRT1 Init\r\n"); /*独立看门狗初始化*/ DeviceIWDG_DriverRegister(DeviceIWDGF103_Init, DeviceIWDGF103_Feed); DeviceIWDG_Init(IWDG_PRESCALER_64, 625); while (1) { /*流水灯闪烁*/ DeviceLed_Set(BOARD_LED_RED, BOARD_LED_LIGHTEN); SysTickDelay_DelayMs(50); DeviceLed_Set(BOARD_LED_RED, BOARD_LED_EXTINGUISH); SysTickDelay_DelayMs(50); DeviceLed_Set(BOARD_LED_GREEN, BOARD_LED_LIGHTEN); SysTickDelay_DelayMs(50); DeviceLed_Set(BOARD_LED_GREEN, BOARD_LED_EXTINGUISH); SysTickDelay_DelayMs(50); /*独立看门狗喂狗,不喂狗1S复位*/ //DeviceIWDG_Feed(); } }
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWIDGETWINDOW_QPA_P_H #define QWIDGETWINDOW_QPA_P_H #include <QtGui/qwindow.h> #include <QtCore/private/qobject_p.h> #include <QtGui/private/qevent_p.h> QT_BEGIN_NAMESPACE class QCloseEvent; class QMoveEvent; class QWidgetWindow : public QWindow { Q_OBJECT public: QWidgetWindow(QWidget *widget); QWidget *widget() const { return m_widget; } #ifndef QT_NO_ACCESSIBILITY QAccessibleInterface *accessibleRoot() const; #endif QObject *focusObject() const; protected: bool event(QEvent *); void handleCloseEvent(QCloseEvent *); void handleEnterLeaveEvent(QEvent *); void handleFocusInEvent(QFocusEvent *); void handleKeyEvent(QKeyEvent *); void handleMouseEvent(QMouseEvent *); void handleNonClientAreaMouseEvent(QMouseEvent *); void handleTouchEvent(QTouchEvent *); void handleMoveEvent(QMoveEvent *); void handleResizeEvent(QResizeEvent *); #ifndef QT_NO_WHEELEVENT void handleWheelEvent(QWheelEvent *); #endif #ifndef QT_NO_DRAGANDDROP void handleDragEnterMoveEvent(QDragMoveEvent *); void handleDragLeaveEvent(QDragLeaveEvent *); void handleDropEvent(QDropEvent *); #endif void handleExposeEvent(QExposeEvent *); void handleWindowStateChangedEvent(QWindowStateChangeEvent *event); bool nativeEvent(const QByteArray &eventType, void *message, long *result); #ifndef QT_NO_TABLETEVENT void handleTabletEvent(QTabletEvent *); #endif #ifndef QT_NO_CONTEXTMENU void handleContextMenuEvent(QContextMenuEvent *); #endif private slots: void updateObjectName(); private: void updateGeometry(); enum FocusWidgets { FirstFocusWidget, LastFocusWidget }; QWidget *getFocusWidget(FocusWidgets fw); QWidget *m_widget; QPointer<QWidget> m_implicit_mouse_grabber; #ifndef QT_NO_DRAGANDDROP QPointer<QWidget> m_dragTarget; #endif }; QT_END_NAMESPACE #endif // QWIDGETWINDOW_QPA_P_H
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22a.c Label Definition File: CWE78_OS_Command_Injection.strings.label.xml Template File: sources-sink-22a.tmpl.c */ /* * @description * CWE: 78 OS Command Injection * BadSource: environment Read input from an environment variable * GoodSource: Fixed string * Sink: w32_spawnvp * BadSink : execute command with wspawnvp * Flow Variant: 22 Control flow: Flow controlled by value of a global variable. Sink functions are in a separate file from sources. * * */ #include "std_testcase.h" #include <wchar.h> #ifdef _WIN32 #define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe" #define COMMAND_INT L"cmd.exe" #define COMMAND_ARG1 L"/c" #define COMMAND_ARG2 L"dir" #define COMMAND_ARG3 data #else /* NOT _WIN32 */ #include <unistd.h> #define COMMAND_INT_PATH L"/bin/sh" #define COMMAND_INT L"sh" #define COMMAND_ARG1 L"ls" #define COMMAND_ARG2 L"-la" #define COMMAND_ARG3 data #endif #include <process.h> #ifndef OMITBAD /* The global variable below is used to drive control flow in the source function */ int CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_badGlobal = 0; wchar_t * CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_badSource(wchar_t * data); void CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_badGlobal = 1; /* true */ data = CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_badSource(data); { wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL}; /* wspawnvp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ _wspawnvp(_P_WAIT, COMMAND_INT, args); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* The global variables below are used to drive control flow in the source functions. */ int CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B1Global = 0; int CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B2Global = 0; /* goodG2B1() - use goodsource and badsink by setting the static variable to false instead of true */ wchar_t * CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B1Source(wchar_t * data); static void goodG2B1() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B1Global = 0; /* false */ data = CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B1Source(data); { wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL}; /* wspawnvp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ _wspawnvp(_P_WAIT, COMMAND_INT, args); } } /* goodG2B2() - use goodsource and badsink by reversing the blocks in the if in the source function */ wchar_t * CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B2Source(wchar_t * data); static void goodG2B2() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B2Global = 1; /* true */ data = CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_goodG2B2Source(data); { wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL}; /* wspawnvp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ _wspawnvp(_P_WAIT, COMMAND_INT, args); } } void CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_good() { goodG2B1(); goodG2B2(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE78_OS_Command_Injection__wchar_t_environment_w32_spawnvp_22_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
// // NCSV.h // NNRObC // // Created by Karl-Johan Alm on 20/11/14. // Copyright (c) 2014 Me. All rights reserved. // #ifndef included_NCSV_h #define included_NCSV_h #include <stdio.h> #include "N.h" N_in(); struct NCSV { int entries; ///< Number of entries int properties;///< Number of properties per entry char **headers; ///< Headers, i.e. property names, or NULL if not included NMatRef matrix; ///< Matrix containing data }; /** * Create an NCSV object with the given stream. * * @param stream FILE stream to CSV data * @param includesHeader If true, the first line is a comma-separated list of headers * * @return New NCSV object */ NCSVRef NCSVCreateWithStream(FILE * stream, bool includesHeader); /** * Destroy the NCSV object. * * @note The matrix object is destroyed with the NCSV object, and can thus not be used after destroying the NCSV. To keep the matrix, copy it first. * * @param csv NCSV instance */ void NCSVDestroy(NCSVRef csv); /** * Get the matrix for the given NCSV object. * * @param csv NCSV instance * * @return NMatRef for the CSV data */ NMatRef NCSVGetMatrix(NCSVRef csv); /** * Get the headers for the given NCSV object. * * @param csv NCSV instance * * @return Char array. The length is given by NCSVGetPropertyCount() */ char **NCSVGetHeaders(NCSVRef csv); /** * Get the number of entries in the given CSV file. * * @param csv NCSV instance * * @return Number of entries */ int NCSVGetEntryCount(NCSVRef csv); /** * Get the number of properties in the given CSV file. * * @param csv NCSV instance * * @return Number of properties */ int NCSVGetPropertyCount(NCSVRef csv); N_out(); #endif
// // TTContentViewController.h // WeiXinHot // // Created by Eason on 06/04/2015. // Copyright (c) 2015 www.xyzs.com. All rights reserved. // #import "TTBaseViewController.h" @interface TTContentViewController : TTBaseViewController @end
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_SpaceBunnyTestsVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_SpaceBunnyTestsVersionString[];
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <IDEFoundation/IDELocalizationStream.h> @class NSMutableArray; @interface _IDELocalizationStreamReturn : IDELocalizationStream { NSMutableArray *_remainingDataToPublish; } + (id)withArray:(id)arg1; @property(retain) NSMutableArray *remainingDataToPublish; // @synthesize remainingDataToPublish=_remainingDataToPublish; - (void).cxx_destruct; - (void)onCompleted; - (void)onNext:(id)arg1; - (void)_next; - (id)subscribe:(id)arg1; @end
#ifndef KEYPADLINCDEVICE_H #define KEYPADLINCDEVICE_H #include "InsteonDevice.h" class KeypadLinc: public InsteonDevice{ private: // unsigned char mButtonGroups[8]; public: KeypadLinc(std::string name, InsteonID id, InsteonModem *p); ~KeypadLinc(); virtual void turnOnOrOff(bool on, unsigned char level, unsigned char subdev); virtual void setGroup(unsigned char group, unsigned char data1,unsigned char data2,unsigned char data3); virtual InsteonDeviceType getDeviceType(); virtual void processEvent(Dumais::JSON::JSON& json,unsigned char* buf); virtual void toJSON(Dumais::JSON::JSON& json); }; #endif
#if __has_include("RCTBridgeModule.h") #import "RCTBridgeModule.h" #else #import <React/RCTBridgeModule.h> #endif @interface RNAppMetadata : NSObject <RCTBridgeModule> @end
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int64_t_fscanf_square_64b.c Label Definition File: CWE190_Integer_Overflow.label.xml Template File: sources-sinks-64b.tmpl.c */ /* * @description * CWE: 190 Integer Overflow * BadSource: fscanf Read data from the console using fscanf() * GoodSource: Set data to a small, non-zero number (two) * Sinks: square * GoodSink: Ensure there will not be an overflow before squaring data * BadSink : Square data, which can lead to overflow * Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files * * */ #include "std_testcase.h" #include <math.h> #ifndef OMITBAD void CWE190_Integer_Overflow__int64_t_fscanf_square_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int64_t * dataPtr = (int64_t *)dataVoidPtr; /* dereference dataPtr into data */ int64_t data = (*dataPtr); { /* POTENTIAL FLAW: if (data*data) > LLONG_MAX, this will overflow */ int64_t result = data * data; printLongLongLine(result); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE190_Integer_Overflow__int64_t_fscanf_square_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int64_t * dataPtr = (int64_t *)dataVoidPtr; /* dereference dataPtr into data */ int64_t data = (*dataPtr); { /* POTENTIAL FLAW: if (data*data) > LLONG_MAX, this will overflow */ int64_t result = data * data; printLongLongLine(result); } } /* goodB2G uses the BadSource with the GoodSink */ void CWE190_Integer_Overflow__int64_t_fscanf_square_64b_goodB2GSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int64_t * dataPtr = (int64_t *)dataVoidPtr; /* dereference dataPtr into data */ int64_t data = (*dataPtr); /* FIX: Add a check to prevent an overflow from occurring */ if (abs((long)data) <= (long)sqrt((double)LLONG_MAX)) { int64_t result = data * data; printLongLongLine(result); } else { printLine("data value is too large to perform arithmetic safely."); } } #endif /* OMITGOOD */
/* * variable_store.h * * Created on: Apr 22, 2016 */ #ifndef INCLUDES_MCC_TAC_VARIABLE_STORE_H_ #define INCLUDES_MCC_TAC_VARIABLE_STORE_H_ #include <map> #include <memory> #include <set> #include <string> #include <utility> #include <vector> #include "mcc/tac/scope_manager.h" #include "mcc/tac/scope.h" #include "mcc/tac/variable.h" namespace mcc { namespace tac { class VariableStore : public ScopeManager { typedef Variable::ptr_t const const_shared_ptr; typedef std::map<Variable::ptr_t, std::vector<Variable::set_t::iterator>, Variable::less> VariableMap; typedef std::vector<Variable::set_t::iterator>::size_type size_type; typedef VariableMap::const_iterator const_iterator; typedef Variable::set_t::const_iterator set_const_iterator; public: typedef std::shared_ptr<VariableStore> ptr_t; const_shared_ptr operator[](size_type const pos) const; size_type size() const; set_const_iterator begin() const; set_const_iterator end() const; Variable::ptr_t findAccordingVariable(std::string const name); Variable::ptr_t findVariable(std::string const name); void addVariable(Variable::ptr_t variable); bool removeVariable(Variable::ptr_t const variable); Variable::ptr_t renameVariable(Variable::ptr_t const variable); private: const_iterator find(Variable::ptr_t const variable) const; Variable::set_t::iterator insertVariable(Variable::ptr_t variable); Variable::set_t store; std::vector<Variable::set_t::iterator> variableTable; VariableMap renameMap; }; } } #endif /* INCLUDES_MCC_TAC_VARIABLE_STORE_H_ */
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena 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 2 of the License, or (at your option) any later version. Quake III Arena source code 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 Quake III Arena source code; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ // #ifndef __KEYCODES_H__ #define __KEYCODES_H__ // // these are the key numbers that should be passed to KeyEvent // // normal keys should be passed as lowercased ascii typedef enum { K_TAB = 9, K_ENTER = 13, K_ESCAPE = 27, K_SPACE = 32, K_BACKSPACE = 127, K_COMMAND = 128, K_CAPSLOCK, K_POWER, K_PAUSE, K_UPARROW, K_DOWNARROW, K_LEFTARROW, K_RIGHTARROW, K_ALT, K_CTRL, K_SHIFT, K_INS, K_DEL, K_PGDN, K_PGUP, K_HOME, K_END, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_F13, K_F14, K_F15, K_KP_HOME, K_KP_UPARROW, K_KP_PGUP, K_KP_LEFTARROW, K_KP_5, K_KP_RIGHTARROW, K_KP_END, K_KP_DOWNARROW, K_KP_PGDN, K_KP_ENTER, K_KP_INS, K_KP_DEL, K_KP_SLASH, K_KP_MINUS, K_KP_PLUS, K_KP_NUMLOCK, K_KP_STAR, K_KP_EQUALS, K_MOUSE1, K_MOUSE2, K_MOUSE3, K_MOUSE4, K_MOUSE5, K_MWHEELDOWN, K_MWHEELUP, K_JOY1, // BUTTON X K_JOY2, // BUTTON O K_JOY3, // BUTTON SQUARE K_JOY4, // BUTTON TRIANGLE K_JOY5, K_JOY6, K_JOY7, K_JOY8, K_JOY9, K_JOY10, K_JOY11, K_JOY12, K_JOY13, K_JOY14, K_JOY15, K_JOY16, K_JOY17, K_JOY18, K_JOY19, K_JOY20, K_JOY21, K_JOY22, K_JOY23, K_JOY24, K_JOY25, K_JOY26, K_JOY27, K_JOY28, K_JOY29, // DPAD UP K_JOY30, // DPAD RIGHT K_JOY31, // DPAD DOWN K_JOY32, // DPAD LEFT K_AUX1, K_AUX2, K_AUX3, K_AUX4, K_AUX5, K_AUX6, K_AUX7, K_AUX8, K_AUX9, K_AUX10, K_AUX11, K_AUX12, K_AUX13, K_AUX14, K_AUX15, K_AUX16, K_WORLD_0, K_WORLD_1, K_WORLD_2, K_WORLD_3, K_WORLD_4, K_WORLD_5, K_WORLD_6, K_WORLD_7, K_WORLD_8, K_WORLD_9, K_WORLD_10, K_WORLD_11, K_WORLD_12, K_WORLD_13, K_WORLD_14, K_WORLD_15, K_WORLD_16, K_WORLD_17, K_WORLD_18, K_WORLD_19, K_WORLD_20, K_WORLD_21, K_WORLD_22, K_WORLD_23, K_WORLD_24, K_WORLD_25, K_WORLD_26, K_WORLD_27, K_WORLD_28, K_WORLD_29, K_WORLD_30, K_WORLD_31, K_WORLD_32, K_WORLD_33, K_WORLD_34, K_WORLD_35, K_WORLD_36, K_WORLD_37, K_WORLD_38, K_WORLD_39, K_WORLD_40, K_WORLD_41, K_WORLD_42, K_WORLD_43, K_WORLD_44, K_WORLD_45, K_WORLD_46, K_WORLD_47, K_WORLD_48, K_WORLD_49, K_WORLD_50, K_WORLD_51, K_WORLD_52, K_WORLD_53, K_WORLD_54, K_WORLD_55, K_WORLD_56, K_WORLD_57, K_WORLD_58, K_WORLD_59, K_WORLD_60, K_WORLD_61, K_WORLD_62, K_WORLD_63, K_WORLD_64, K_WORLD_65, K_WORLD_66, K_WORLD_67, K_WORLD_68, K_WORLD_69, K_WORLD_70, K_WORLD_71, K_WORLD_72, K_WORLD_73, K_WORLD_74, K_WORLD_75, K_WORLD_76, K_WORLD_77, K_WORLD_78, K_WORLD_79, K_WORLD_80, K_WORLD_81, K_WORLD_82, K_WORLD_83, K_WORLD_84, K_WORLD_85, K_WORLD_86, K_WORLD_87, K_WORLD_88, K_WORLD_89, K_WORLD_90, K_WORLD_91, K_WORLD_92, K_WORLD_93, K_WORLD_94, K_WORLD_95, K_SUPER, K_COMPOSE, K_MODE, K_HELP, K_PRINT, K_SYSREQ, K_SCROLLOCK, K_BREAK, K_MENU, K_EURO, K_UNDO, MAX_KEYS } keyNum_t; // MAX_KEYS replaces K_LAST_KEY, however some mods may have used K_LAST_KEY // in detecting binds, so we leave it defined to the old hardcoded value // of maxiumum keys to prevent mods from crashing older versions of the engine #define K_LAST_KEY 256 // The menu code needs to get both key and char events, but // to avoid duplicating the paths, the char events are just // distinguished by or'ing in K_CHAR_FLAG (ugly) #define K_CHAR_FLAG 1024 #endif
#include "http.h" struct http_message_s { unsigned short http_version_major, http_version_minor; enum http_message_type type; }; int http_message_get_type(http_message* msg) { return msg->type; }
// // Extensions.h // RadialLayer // // Created by Soheil Yasrebi on 11/15/15. // Copyright © 2015 Soheil Yasrebi. All rights reserved. // #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> @interface UITableViewCell (Animation) @end @interface UIImageView (Animation) @end @interface UIButton (Animation) @end #ifndef RadialLayer_Swift_h #define RadialLayer_Swift_h #pragma clang diagnostic push #if defined(__has_include) && __has_include(<swift/objc-prologue.h>) # include <swift/objc-prologue.h> #endif #pragma clang diagnostic ignored "-Wauto-import" #include <objc/NSObject.h> #include <stdint.h> #include <stddef.h> #include <stdbool.h> #if defined(__has_include) && __has_include(<uchar.h>) # include <uchar.h> #elif !defined(__cplusplus) || __cplusplus < 201103L typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; #endif typedef struct _NSZone NSZone; #if !defined(SWIFT_PASTE) # define SWIFT_PASTE_HELPER(x, y) x##y # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) # define SWIFT_METATYPE(X) Class #endif #if defined(__has_attribute) && __has_attribute(objc_runtime_name) # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else # define SWIFT_RUNTIME_NAME(X) #endif #if defined(__has_attribute) && __has_attribute(swift_name) # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else # define SWIFT_COMPILE_NAME(X) #endif #if !defined(SWIFT_CLASS_EXTRA) # define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) # define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) # define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # else # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # endif #endif #if !defined(SWIFT_PROTOCOL) # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else # define OBJC_DESIGNATED_INITIALIZER # endif #endif #if !defined(SWIFT_ENUM) # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type #endif typedef float swift_float2 __attribute__((__ext_vector_type__(2))); typedef float swift_float3 __attribute__((__ext_vector_type__(3))); typedef float swift_float4 __attribute__((__ext_vector_type__(4))); typedef double swift_double2 __attribute__((__ext_vector_type__(2))); typedef double swift_double3 __attribute__((__ext_vector_type__(3))); typedef double swift_double4 __attribute__((__ext_vector_type__(4))); typedef int swift_int2 __attribute__((__ext_vector_type__(2))); typedef int swift_int3 __attribute__((__ext_vector_type__(3))); typedef int swift_int4 __attribute__((__ext_vector_type__(4))); #if defined(__has_feature) && __has_feature(modules) @import UIKit; @import CoreGraphics; @import ObjectiveC; #endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" @class UIWindow; @class UIApplication; @class NSObject; SWIFT_CLASS("_TtC11RadialLayer15UIViewAnimation") @interface UIViewAnimation : NSObject + (void)initWithView:(UIView * __nonnull)view; - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; @end SWIFT_CLASS("_TtC11RadialLayer7Configs") @interface Configs : NSObject + (BOOL)isLoaded; + (void)setIsLoaded:(BOOL)value; + (NSMutableDictionary * __nonnull)props; + (void)setProps:(NSMutableDictionary * __nonnull)value; + (BOOL)isActive:(NSString * __nonnull)className; - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; @end #pragma clang diagnostic pop #endif /* RadialLayer_Swift_h */
// // AppDelegate.h // CusNavigationAnimation // // Created by JianRongCao on 15/7/24. // Copyright (c) 2015年 JianRongCao. All rights reserved. // #import <UIKit/UIKit.h> #import "SNNavigationController.h" @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) SNNavigationController *rootNavigationController; @end
/****************************************************************************/ /* Copyright (c) 2013, Trevin Liberty * * 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. /****************************************************************************/ /* * @author Trevin Liberty * @file DeferredLight_Ambient.h * @brief * /****************************************************************************/ #ifndef DEFERREDLIGHT_AMBIENT_H_CL #define DEFERREDLIGHT_AMBIENT_H_CL #include "Light.h" #include "DeferredLight.h" namespace CaptainLucha { class GLProgram; class GLTexture; class DeferredLight_Ambient : public Light { public: DeferredLight_Ambient(); ~DeferredLight_Ambient(); void ApplyLight( const Vector3Df& cameraPos, GLTexture* renderTarget0, GLTexture* renderTarget1, GLTexture* renderTarget2); protected: private: static GLProgram* m_glProgram; }; } #endif
#pragma once #include "CommandList.h" namespace cmd { class Parallel : public CommandList { // ---------------------------------------- // // MEMBER // // ---------------------------------------- public: protected: private: int completeCount; // ---------------------------------------- // // METHOD // // ---------------------------------------- public: Parallel(); Parallel(const vector<Command*>& commands); ~Parallel(); virtual void insert(const vector<Command*>& commands); int getCompleteCount() const; virtual void _notifyBreak(); virtual void _notifyReturn(); protected: virtual void runFunction(Command* command); virtual void interruptFunction(Command* command); virtual void resetFunction(Command* command); private: void next(); void currentCommandCompleteHandler(Command& command); }; }
#pragma once #include <BF/Application/Scene.h> #include <BF/System/Log.h> class AndroidTestScene : public BF::Application::Scene { public: AndroidTestScene(); ~AndroidTestScene(); private: void Initialize() override; void Load() override; void Update() override; void FixedUpdate() override; void Render() override; };
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: ./suggest/src/java/org/apache/lucene/search/spell/StringDistance.java // #include "J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_OrgApacheLuceneSearchSpellStringDistance") #ifdef RESTRICT_OrgApacheLuceneSearchSpellStringDistance #define INCLUDE_ALL_OrgApacheLuceneSearchSpellStringDistance 0 #else #define INCLUDE_ALL_OrgApacheLuceneSearchSpellStringDistance 1 #endif #undef RESTRICT_OrgApacheLuceneSearchSpellStringDistance #if __has_feature(nullability) #pragma clang diagnostic push #pragma GCC diagnostic ignored "-Wnullability" #pragma GCC diagnostic ignored "-Wnullability-completeness" #endif #if !defined (OrgApacheLuceneSearchSpellStringDistance_) && (INCLUDE_ALL_OrgApacheLuceneSearchSpellStringDistance || defined(INCLUDE_OrgApacheLuceneSearchSpellStringDistance)) #define OrgApacheLuceneSearchSpellStringDistance_ /*! @brief Interface for string distances. */ @protocol OrgApacheLuceneSearchSpellStringDistance < JavaObject > /*! @brief Returns a float between 0 and 1 based on how similar the specified strings are to one another. Returning a value of 1 means the specified strings are identical and 0 means the string are maximally different. @param s1 The first string. @param s2 The second string. @return a float between 0 and 1 based on how similar the specified strings are to one another. */ - (jfloat)getDistanceWithNSString:(NSString *)s1 withNSString:(NSString *)s2; @end J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchSpellStringDistance) J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchSpellStringDistance) #endif #if __has_feature(nullability) #pragma clang diagnostic pop #endif #pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneSearchSpellStringDistance")
#pragma once #include "../base.h" namespace scene { using namespace object; typedef vector<obj_ptr_t> objects_t; typedef objects_t::iterator scene_iter_t; class scene_t { public: scene_t (); ~scene_t(); // push back one object void push( obj_ptr_t const & new_object ); // push back few objects void push( objects_t const & scene_part ); // pop one object from end of scene void pop( size_t count = 1 ); // erase part of scene void erase_scene( scene_iter_t const & from, scene_iter_t const & to ); // clear scene void clear(); size_t size() const; // draw all objects void draw( env_ptr_t const & env ); obj_ptr_t get_object( size_t id ); /* * operators */ obj_ptr_t operator [] ( size_t id ); void operator << ( obj_ptr_t const & new_object ); private: objects_t objects_; }; }
// // SYMLMarkdownParser-Internals.h // Syml // // Created by Harry Jordan on 17/01/2013. // Copyright (c) 2013 Harry Jordan. All rights reserved. // // Released under the MIT license: http://opensource.org/licenses/mit-license.php // #import "SYMLMarkdownParserAttributes.h" #import "SYMLAttributedObjectCollection.h" typedef NS_ENUM(NSInteger, SYMLMarkdownParserLineType) { SYMLMarkdownParserLineTypeNormal, SYMLMarkdownParserLineTypeBlockquote, SYMLMarkdownParserLineTypeBlockcode, SYMLMarkdownParserLineTypeList, SYMLMarkdownParserLineTypeLink }; struct SYMLMarkdownParserState { // Parse options NSInteger maximumRecursionDepth; BOOL shouldParseMarkdown; // Block elements BOOL shouldParseHeadings; BOOL shouldParseBlockquotes; BOOL shouldParseBlockcode; BOOL shouldParseHorizontalRule; BOOL shouldParseLists; // Inline elements BOOL shouldParseLinks; BOOL shouldParseEmphasisAndStrongTags; BOOL shouldParseHTMLTags; // Used internally to keep track of the parsing NSInteger textLength; NSRange searchRange; NSInteger currentRecursionDepth; // Cache respondToSelector: queries BOOL hasHeadingAttributes; BOOL hasHorizontalRuleAttributes; BOOL hasBlockquoteAttributes; BOOL hasListElementAttributes; BOOL hasListLineAttributes; BOOL hasEmphasisAttributes; BOOL hasStrongAttributes; BOOL hasLinkAttributes; BOOL hasLinkTitleAttributes; BOOL hasLinkTagAttributes; BOOL hasLinkURLAttributes; BOOL hasInvalidLinkAttributes; // The state that is passed on from state to state SYMLMarkdownParserLineType previousLineType; }; typedef struct SYMLMarkdownParserState SYMLMarkdownParserState; SYMLMarkdownParserState SYMLDefaultMarkdownParserState(); BOOL SYMLMarkdownParserStateInitialConditionsAreEqual(SYMLMarkdownParserState firstState, SYMLMarkdownParserState secondState); // Returns the state after parsing has completed SYMLMarkdownParserState SYMLParseMarkdown(NSString *inputString, id <SYMLAttributedObjectCollection> *result, SYMLMarkdownParserState parseState, id <SYMLMarkdownParserAttributes> attributes);
#pragma once #include <QObject> #include <QString> #include <qmltoolbox/AbstractMessageReceiver.h> namespace qmltoolbox { /** * @brief * Message receiver to forward output messages to a QML item */ class QMLTOOLBOX_API QmlMessageForwarder : public QObject, public AbstractMessageReceiver { Q_OBJECT signals: /** * @brief * Emitted whenever a message was received * * @param[in] type * Message type * @param[in] timestamp * Timestamp when message was received * @param[in] message * Message string */ void messageReceived(int type, const QDateTime & timestamp, const QString & context, const QString & message); public: /** * @brief * Constructor */ QmlMessageForwarder(); /** * @brief * Destructor */ virtual ~QmlMessageForwarder(); /** * @brief * Attach to message handler */ Q_INVOKABLE void attach(); /** * @brief * Detach from message handler */ Q_INVOKABLE void detach(); // Virtual AbstractMessageReceiver interface virtual void print(MessageHandler::MessageType type, const QDateTime & timestamp, const QString & context, const QString & message) override; }; } // namespace qmltoolbox
#pragma once #include <memory> #include <Wt/WInteractWidget.h> namespace sparc { class ThreeWidget; namespace Three { /// Represents a generic scene node in a Three scene. class Object3D { public: /// Fully qualified reference access to this instance in Js. std::string jsRef() const; /// Pending client-side JS code stream. std::ostringstream & js() { return js_; } /// Flushes full JS code into string, resolves references. std::string fullRender(); std::string incrementalRender(); /// Creates a new child node. Object3D* createObject3D(); /// Adds a child node. Object3D* addObject3D(std::unique_ptr<Object3D> obj); explicit Object3D(ThreeWidget* owner = nullptr, std::string jsRef = ""); virtual ~Object3D() = default; protected: friend class ThreeWidget; void setJsRef(std::string ref) { jsRef_ = std::move(ref); } virtual void fullRenderOverride(); void syncToClient(); /// Replaces internal references by Js reference. std::string resolveJsRef(const std::string jsCode) const; ThreeWidget* owner_ = nullptr; /// Pending client-side JS code. std::ostringstream js_; std::ostringstream incrementalJs_; std::vector<std::unique_ptr<Object3D>> children_; private: Object3D(const Object3D&) = delete; void operator=(const Object3D&) = delete; mutable std::string jsRef_; }; /// Root Three scene node. class Scene : public Object3D { public: protected: virtual void fullRenderOverride() override; //private: public: friend class ThreeWidget; Scene(ThreeWidget* owner, const std::string& ref); }; // https://threejs.org/docs/index.html#api/objects/Mesh class Mesh : public Object3D { public: Mesh() = default; virtual void fullRenderOverride() override; }; /// Simple teapot for testing. class Teapot : public Mesh { public: Teapot() = default; virtual void fullRenderOverride() override; }; } /** Attempts to create a simple wrapper around client-side Three.js library. **/ class ThreeWidget : public Wt::WInteractWidget { public: ThreeWidget(); ~ThreeWidget() = default; /** Client-side initializers and updaters. ** ** Override to define and update scene. **/ virtual void initializeScene() {} virtual void updateScene() {} void addOrbitControl(); void addTeapot(); /// Creates a new fully qualified Js reference. std::string createJsRef(); /// Pending client-side JS code stream. std::ostringstream & js() { return js_; } virtual Wt::DomElementType domElementType() const override; void resize(const Wt::WLength &width, const Wt::WLength &height) override; protected: virtual Wt::DomElement *createDomElement(Wt::WApplication *app) override; virtual void render(Wt::WFlags<Wt::RenderFlag> flags) override; virtual void layoutSizeChanged(int width, int height) override; std::set<std::string> jsRefs_; Wt::JSlot resizeSlot_; /// Default scene root container. Three::Scene scene_; std::ostringstream js_; }; }
/* Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_SURFACE_H #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_SURFACE_H #include <hip/hcc_detail/hip_surface_types.h> struct hipSurface { hipArray* array; hipResourceDesc resDesc; }; #endif
#ifndef LYNX_LEPUS_CODE_GENERATOR_H_ #define LYNX_LEPUS_CODE_GENERATOR_H_ #include "lepus/visitor.h" #include "lepus/op_code.h" #include "lepus/value.h" #include "lepus/function.h" #include "lepus/vm_context.h" #include <vector> #include <unordered_map> namespace lepus { struct VariableNameInfo { int register_id_; int block_beigin_pc_; explicit VariableNameInfo(int register_id = 0, int begin_pc = 0) : register_id_(register_id), block_beigin_pc_(begin_pc){ } }; enum LoopJmpType { LoopJmp_Head, LoopJmp_Tail, }; struct LoopInfo { LoopJmpType type_; long op_index_; LoopInfo(LoopJmpType type, long index) :type_(type), op_index_(index){} }; struct LoopGenerate { Function* function_; base::ScopedPtr<LoopGenerate> parent_; std::vector<LoopInfo> loop_infos_; //jmp head or jmp tail, loop controller op index in function size_t loop_start_index_; LoopGenerate():function_(nullptr),parent_(),loop_infos_(), loop_start_index_(0){} }; struct BlockGenerate { Function* function_; std::unordered_map<String*, long> variables_map_; base::ScopedPtr<BlockGenerate> parent_; int register_id_; BlockGenerate():function_(nullptr), variables_map_(), parent_(), register_id_(0){} }; struct FunctionGenerate { base::ScopedPtr<FunctionGenerate> parent_; base::ScopedPtr<BlockGenerate> current_block_; base::ScopedPtr<LoopGenerate> current_loop_; Function* function_; long register_id_; FunctionGenerate():parent_(), current_block_(), current_loop_(), function_(nullptr), register_id_(0){} }; class CodeGenerator : public Visitor{ public: CodeGenerator(VMContext* context) :context_(context), register_id_(-1), current_function_name_(nullptr), current_function_(){ } virtual ~CodeGenerator(){} virtual void Visit(ChunkAST* ast, void* data); virtual void Visit(BlockAST* ast, void* data); virtual void Visit(ReturnStatementAST* ast, void* data); virtual void Visit(LiteralAST* ast, void* data); virtual void Visit(NamesAST* ast, void* data); virtual void Visit(BinaryExprAST* ast, void* data); virtual void Visit(UnaryExpression* ast, void* data); virtual void Visit(ExpressionListAST* ast, void* data); virtual void Visit(VariableAST* ast, void* data); virtual void Visit(VariableListAST* ast, void* data); virtual void Visit(FunctionStatementAST* ast, void* data); virtual void Visit(ForStatementAST* ast, void* data); virtual void Visit(DoWhileStatementAST* ast, void* data); virtual void Visit(BreakStatementAST* ast, void* data); virtual void Visit(WhileStatementAST* ast, void* data); virtual void Visit(IfStatementAST* ast, void* data); virtual void Visit(ElseStatementAST* ast, void* data); virtual void Visit(SwitchStatementAST* ast, void* data); virtual void Visit(CaseStatementAST* ast, void* data); virtual void Visit(AssignStatement* ast, void* data); virtual void Visit(MemberAccessorAST* ast, void* data); virtual void Visit(FunctionCallAST* ast, void* data); virtual void Visit(TernaryStatementAST* ast, void* data); private: void EnterFunction(); void LeaveFunction(); void EnterBlock(); void LeaveBlock(); void EnterLoop(); void LeaveLoop(); void EnterRegister(); void LeaveRegister(); void InsertVariable(String* name, long register_id); long SearchVariable(String* name); long SearchVariable(String* name, FunctionGenerate* current); long SearchGlobal(String* name); long ManageUpvalues(String* name); void WriteLocalValue(LexicalOp op, long dst, long src); void WriteUpValue(LexicalOp op, long dst, long src); void AutomaticLocalValue(AutomaticType type, long dst, long src); void AutomaticUpValue(AutomaticType type, long dst, long src); long GenerateRegisiterId() { long register_id = current_function_->register_id_++; return register_id; } long CurrentRegisiterId() { return current_function_->register_id_; } void ResetRegisiterId(long register_id) { current_function_->register_id_ = register_id; } VMContext* context_; long register_id_; String* current_function_name_; base::ScopedPtr<FunctionGenerate> current_function_; }; } #endif
// // StubFileUtil.h // Radars // // Created by Toni on 07/10/15. // Copyright © 2015 Toni. All rights reserved. // #import <Foundation/Foundation.h> @interface StubFileUtil : NSObject + (NSDictionary *)dictionaryWithJSONStubFileNamed:(NSString *)stubFilename; @end
// NOTE - eventually this file will be automatically updated using a Perl script that understand // the naming of test case files, functions, and namespaces. #ifndef _TESTCASES_H #define _TESTCASES_H #ifdef __cplusplus extern "C" { #endif // declare C good and bad functions #ifndef OMITGOOD /* BEGIN-AUTOGENERATED-C-GOOD-FUNCTION-DECLARATIONS */ void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_01_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_02_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_03_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_04_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_05_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_06_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_07_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_08_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_09_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_10_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_11_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_12_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_13_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_14_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_15_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_16_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_17_good(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_18_good(); void CWE468_Incorrect_Pointer_Scaling__int_01_good(); void CWE468_Incorrect_Pointer_Scaling__int_02_good(); void CWE468_Incorrect_Pointer_Scaling__int_03_good(); void CWE468_Incorrect_Pointer_Scaling__int_04_good(); void CWE468_Incorrect_Pointer_Scaling__int_05_good(); void CWE468_Incorrect_Pointer_Scaling__int_06_good(); void CWE468_Incorrect_Pointer_Scaling__int_07_good(); void CWE468_Incorrect_Pointer_Scaling__int_08_good(); void CWE468_Incorrect_Pointer_Scaling__int_09_good(); void CWE468_Incorrect_Pointer_Scaling__int_10_good(); void CWE468_Incorrect_Pointer_Scaling__int_11_good(); void CWE468_Incorrect_Pointer_Scaling__int_12_good(); void CWE468_Incorrect_Pointer_Scaling__int_13_good(); void CWE468_Incorrect_Pointer_Scaling__int_14_good(); void CWE468_Incorrect_Pointer_Scaling__int_15_good(); void CWE468_Incorrect_Pointer_Scaling__int_16_good(); void CWE468_Incorrect_Pointer_Scaling__int_17_good(); void CWE468_Incorrect_Pointer_Scaling__int_18_good(); /* END-AUTOGENERATED-C-GOOD-FUNCTION-DECLARATIONS */ #endif // OMITGOOD #ifndef OMITBAD /* BEGIN-AUTOGENERATED-C-BAD-FUNCTION-DECLARATIONS */ void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_01_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_02_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_03_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_04_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_05_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_06_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_07_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_08_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_09_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_10_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_11_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_12_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_13_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_14_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_15_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_16_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_17_bad(); void CWE468_Incorrect_Pointer_Scaling__char_ptr_to_int_18_bad(); void CWE468_Incorrect_Pointer_Scaling__int_01_bad(); void CWE468_Incorrect_Pointer_Scaling__int_02_bad(); void CWE468_Incorrect_Pointer_Scaling__int_03_bad(); void CWE468_Incorrect_Pointer_Scaling__int_04_bad(); void CWE468_Incorrect_Pointer_Scaling__int_05_bad(); void CWE468_Incorrect_Pointer_Scaling__int_06_bad(); void CWE468_Incorrect_Pointer_Scaling__int_07_bad(); void CWE468_Incorrect_Pointer_Scaling__int_08_bad(); void CWE468_Incorrect_Pointer_Scaling__int_09_bad(); void CWE468_Incorrect_Pointer_Scaling__int_10_bad(); void CWE468_Incorrect_Pointer_Scaling__int_11_bad(); void CWE468_Incorrect_Pointer_Scaling__int_12_bad(); void CWE468_Incorrect_Pointer_Scaling__int_13_bad(); void CWE468_Incorrect_Pointer_Scaling__int_14_bad(); void CWE468_Incorrect_Pointer_Scaling__int_15_bad(); void CWE468_Incorrect_Pointer_Scaling__int_16_bad(); void CWE468_Incorrect_Pointer_Scaling__int_17_bad(); void CWE468_Incorrect_Pointer_Scaling__int_18_bad(); /* END-AUTOGENERATED-C-BAD-FUNCTION-DECLARATIONS */ #endif // OMITBAD #ifdef __cplusplus } // end extern "C" #endif #ifdef __cplusplus // declare C++ namespaces and good and bad functions #ifndef OMITGOOD /* BEGIN-AUTOGENERATED-CPP-GOOD-FUNCTION-DECLARATIONS */ namespace CWE468_Incorrect_Pointer_Scaling__class_01 { void good();} /* END-AUTOGENERATED-CPP-GOOD-FUNCTION-DECLARATIONS */ #endif // OMITGOOD #ifndef OMITBAD /* BEGIN-AUTOGENERATED-CPP-BAD-FUNCTION-DECLARATIONS */ namespace CWE468_Incorrect_Pointer_Scaling__class_01 { void bad();} /* END-AUTOGENERATED-CPP-BAD-FUNCTION-DECLARATIONS */ #endif // OMITBAD #endif // __cplusplus #endif // _TESTCASES_H
/* 100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl <dominik.reichl@t-online.de> Web: http://www.dominik-reichl.de/ Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches) - You can set the endianness in your files, no need to modify the header file of the CSHA1 class any more - Aligned data support - Made support/compilation of the utility functions (ReportHash and HashFile) optional (useful, if bytes count, for example in embedded environments) Version 1.5 - 2005-01-01 - 64-bit compiler compatibility added - Made variable wiping optional (define SHA1_WIPE_VARIABLES) - Removed unnecessary variable initializations - ROL32 improvement for the Microsoft compiler (using _rotl) ======== Test Vectors (from FIPS PUB 180-1) ======== SHA1("abc") = A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 SHA1(A million repetitions of "a") = 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ #ifndef ___SHA1_HDR___ #define ___SHA1_HDR___ #if !defined(SHA1_UTILITY_FUNCTIONS) && !defined(SHA1_NO_UTILITY_FUNCTIONS) #define SHA1_UTILITY_FUNCTIONS #endif #include <memory.h> // Needed for memset and memcpy #ifdef SHA1_UTILITY_FUNCTIONS #include <stdio.h> // Needed for file access and sprintf #include <string.h> // Needed for strcat and strcpy #endif #ifdef _MSC_VER #include <stdlib.h> #endif // You can define the endian mode in your files, without modifying the SHA1 // source files. Just #define SHA1_LITTLE_ENDIAN or #define SHA1_BIG_ENDIAN // in your files, before including the SHA1.h header file. If you don't // define anything, the class defaults to little endian. #if !defined(SHA1_LITTLE_ENDIAN) && !defined(SHA1_BIG_ENDIAN) #define SHA1_LITTLE_ENDIAN #endif // Same here. If you want variable wiping, #define SHA1_WIPE_VARIABLES, if // not, #define SHA1_NO_WIPE_VARIABLES. If you don't define anything, it // defaults to wiping. #if !defined(SHA1_WIPE_VARIABLES) && !defined(SHA1_NO_WIPE_VARIABLES) #define SHA1_WIPE_VARIABLES #endif ///////////////////////////////////////////////////////////////////////////// // Define 8- and 32-bit variables #ifndef UINT_32 #ifdef _MSC_VER #define UINT_8 unsigned __int8 #define UINT_32 unsigned __int32 #else #define UINT_8 unsigned char #if (ULONG_MAX == 0xFFFFFFFF) #define UINT_32 unsigned long #else #define UINT_32 unsigned int #endif #endif #endif ///////////////////////////////////////////////////////////////////////////// // Declare SHA1 workspace // typedef union // { // UINT_8 c[64]; // UINT_32 l[16]; // } SHA1_WORKSPACE_BLOCK; class CSHA1 { public: #ifdef SHA1_UTILITY_FUNCTIONS // Two different formats for ReportHash(...) enum { REPORT_HEX = 0, REPORT_DIGIT = 1 }; #endif // Constructor and Destructor CSHA1(); ~CSHA1(); UINT_32 m_state[5]; UINT_32 m_count[2]; UINT_32 __reserved1[1]; UINT_8 m_buffer[64]; UINT_8 m_digest[20]; UINT_32 __reserved2[3]; void Reset(); // Update the hash value void Update(UINT_8 *data, UINT_32 len); #ifdef SHA1_UTILITY_FUNCTIONS bool HashFile(char *szFileName); #endif // Finalize hash and report void Final(); // Report functions: as pre-formatted and raw data #ifdef SHA1_UTILITY_FUNCTIONS void ReportHash(char *szReport, unsigned char uReportType = REPORT_HEX); #endif void GetHash(UINT_8 *puDest); private: // Private SHA-1 transformation void Transform(UINT_32 *state, UINT_8 *buffer); // Member variables UINT_8 m_workspace[64]; SHA1_WORKSPACE_BLOCK *m_block; // SHA1 pointer to the byte array above }; #endif
#pragma once // Helper functions for error handling // 2.5.6 Error handling // 3.6 Error handling #include "SYCL/detail/common.h" #include "SYCL/detail/debug.h" #include "SYCL/detail/error_code.h" #include "SYCL/exception.h" namespace cl { namespace sycl { // Forward declaration class context; namespace detail { /** * 3.6.1, paragraph 4 * If an asynchronous error occurs in a queue * that has no user-supplied asynchronous error handler object, * then no exception is thrown * and the error is not available to the user in any specified way. * Implementations may provide extra debugging information to users * to trap and handle asynchronous errors. */ static const async_handler default_async_handler = [](cl::sycl::exception_list list) { debug() << "Number of asynchronous errors during queue execution:" << list.size(); for (auto& e : list) { debug("SYCL_ERROR::", e.what()); } }; namespace error { struct thrower { static unique_ptr_class<exception> get(::cl_int error_code, context* thrower) { return unique_ptr_class<exception>(new cl_exception(error_code, thrower)); } static unique_ptr_class<exception> get(code::value_t error_code, context* thrower) { return unique_ptr_class<exception>( new exception((*error::codes.find(error_code)).second, thrower)); } static void report(exception& error) { debug displayError("SYCL_ERROR::", error.what()); throw error; } static void report_async(context* thrower, exception_list& list); }; /** Synchronous error reporting */ static void report(::cl_int error_code, context* thrower = nullptr) { if (error_code != CL_SUCCESS) { auto e = thrower::get(error_code, thrower); thrower::report(*e); } } /** Synchronous error reporting */ static void report(code::value_t error_code, context* thrower = nullptr) { auto e = thrower::get(error_code, thrower); thrower::report(*e); } } // namespace error } // namespace detail } // namespace sycl } // namespace cl
// // HRTabbar.h // TabarDefined // // Created by sincere on 15/12/9. // Copyright © 2015年 sincere. All rights reserved. // #import <UIKit/UIKit.h> @class HRTabbar; @protocol TabBarDelegate <NSObject> @optional - (void)tabbarDidClickMiddleButon : (HRTabbar *)tabbar; @end @interface HRTabbar : UITabBar @property (nonatomic,strong) UIButton *middleBtn; @property(nonatomic,weak) id<TabBarDelegate>hrdelegate; @end
/** * See Copyright Notice in picrin.h */ #include "picrin.h" static void setup_default_env(pic_state *pic, struct pic_env *env) { pic_put_variable(pic, env, pic_obj_value(pic->sDEFINE_LIBRARY), pic->uDEFINE_LIBRARY); pic_put_variable(pic, env, pic_obj_value(pic->sIMPORT), pic->uIMPORT); pic_put_variable(pic, env, pic_obj_value(pic->sEXPORT), pic->uEXPORT); pic_put_variable(pic, env, pic_obj_value(pic->sCOND_EXPAND), pic->uCOND_EXPAND); } struct pic_lib * pic_make_library(pic_state *pic, pic_value name) { struct pic_lib *lib; struct pic_env *env; struct pic_dict *exports; if ((lib = pic_find_library(pic, name)) != NULL) { pic_errorf(pic, "library name already in use: ~s", name); } env = pic_make_env(pic, NULL); exports = pic_make_dict(pic); setup_default_env(pic, env); lib = (struct pic_lib *)pic_obj_alloc(pic, sizeof(struct pic_lib), PIC_TT_LIB); lib->name = name; lib->env = env; lib->exports = exports; /* register! */ pic->libs = pic_acons(pic, name, pic_obj_value(lib), pic->libs); return lib; } struct pic_lib * pic_find_library(pic_state *pic, pic_value spec) { pic_value v; v = pic_assoc(pic, spec, pic->libs, NULL); if (pic_false_p(v)) { return NULL; } return pic_lib_ptr(pic_cdr(pic, v)); } void pic_import(pic_state *pic, struct pic_lib *lib) { pic_sym *name, *realname, *uid; khiter_t it; pic_dict_for_each (name, lib->exports, it) { realname = pic_sym_ptr(pic_dict_ref(pic, lib->exports, name)); if ((uid = pic_find_variable(pic, lib->env, pic_obj_value(realname))) == NULL) { pic_errorf(pic, "attempted to export undefined variable '~s'", pic_obj_value(realname)); } pic_put_variable(pic, pic->lib->env, pic_obj_value(name), uid); } } void pic_export(pic_state *pic, pic_sym *name) { pic_dict_set(pic, pic->lib->exports, name, pic_obj_value(name)); } static pic_value pic_lib_make_library(pic_state *pic) { pic_value name; pic_get_args(pic, "o", &name); return pic_obj_value(pic_make_library(pic, name)); } static pic_value pic_lib_find_library(pic_state *pic) { pic_value name; struct pic_lib *lib; pic_get_args(pic, "o", &name); if ((lib = pic_find_library(pic, name)) == NULL) { return pic_false_value(); } return pic_obj_value(lib); } static pic_value pic_lib_current_library(pic_state *pic) { pic_value lib; int n; n = pic_get_args(pic, "|o", &lib); if (n == 0) { return pic_obj_value(pic->lib); } else { pic_assert_type(pic, lib, lib); pic->lib = pic_lib_ptr(lib); return pic_undef_value(); } } static pic_value pic_lib_library_import(pic_state *pic) { pic_value lib_opt; pic_sym *name, *realname, *uid, *alias = NULL; struct pic_lib *lib; pic_get_args(pic, "om|m", &lib_opt, &name, &alias); pic_assert_type(pic, lib_opt, lib); if (alias == NULL) { alias = name; } lib = pic_lib_ptr(lib_opt); if (! pic_dict_has(pic, lib->exports, name)) { pic_errorf(pic, "attempted to import undefined variable '~s'", pic_obj_value(name)); } else { realname = pic_sym_ptr(pic_dict_ref(pic, lib->exports, name)); } if ((uid = pic_find_variable(pic, lib->env, pic_obj_value(realname))) == NULL) { pic_errorf(pic, "attempted to export undefined variable '~s'", pic_obj_value(realname)); } else { pic_put_variable(pic, pic->lib->env, pic_obj_value(alias), uid); } return pic_undef_value(); } static pic_value pic_lib_library_export(pic_state *pic) { pic_sym *name, *alias = NULL; pic_get_args(pic, "m|m", &name, &alias); if (alias == NULL) { alias = name; } pic_dict_set(pic, pic->lib->exports, alias, pic_obj_value(name)); return pic_undef_value(); } static pic_value pic_lib_library_exports(pic_state *pic) { pic_value lib, exports = pic_nil_value(); pic_sym *sym; khiter_t it; pic_get_args(pic, "o", &lib); pic_assert_type(pic, lib, lib); pic_dict_for_each (sym, pic_lib_ptr(lib)->exports, it) { pic_push(pic, pic_obj_value(sym), exports); } return exports; } static pic_value pic_lib_library_environment(pic_state *pic) { pic_value lib; pic_get_args(pic, "o", &lib); pic_assert_type(pic, lib, lib); return pic_obj_value(pic_lib_ptr(lib)->env); } void pic_init_lib(pic_state *pic) { pic_defun(pic, "make-library", pic_lib_make_library); pic_defun(pic, "find-library", pic_lib_find_library); pic_defun(pic, "library-exports", pic_lib_library_exports); pic_defun(pic, "library-environment", pic_lib_library_environment); pic_defun(pic, "current-library", pic_lib_current_library); pic_defun(pic, "library-import", pic_lib_library_import); pic_defun(pic, "library-export", pic_lib_library_export); }
// Copyright (c) 2011-2013 The Testcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef Testcoin_QT_PEERTABLEMODEL_H #define Testcoin_QT_PEERTABLEMODEL_H #include "main.h" #include "net.h" #include <QAbstractTableModel> #include <QStringList> class ClientModel; class PeerTablePriv; QT_BEGIN_NAMESPACE class QTimer; QT_END_NAMESPACE struct CNodeCombinedStats { CNodeStats nodeStats; CNodeStateStats nodeStateStats; bool fNodeStateStatsAvailable; }; class NodeLessThan { public: NodeLessThan(int nColumn, Qt::SortOrder fOrder) : column(nColumn), order(fOrder) {} bool operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const; private: int column; Qt::SortOrder order; }; /** Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call. Used by the rpc console UI. */ class PeerTableModel : public QAbstractTableModel { Q_OBJECT public: explicit PeerTableModel(ClientModel *parent = 0); const CNodeCombinedStats *getNodeStats(int idx); int getRowByNodeId(NodeId nodeid); void startAutoRefresh(); void stopAutoRefresh(); enum ColumnIndex { Address = 0, Subversion = 1, Ping = 2 }; /** @name Methods overridden from QAbstractTableModel @{*/ int rowCount(const QModelIndex &parent) const; int columnCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; QModelIndex index(int row, int column, const QModelIndex &parent) const; Qt::ItemFlags flags(const QModelIndex &index) const; void sort(int column, Qt::SortOrder order); /*@}*/ public slots: void refresh(); private: ClientModel *clientModel; QStringList columns; PeerTablePriv *priv; QTimer *timer; }; #endif // Testcoin_QT_PEERTABLEMODEL_H
#ifndef SOUNDMANAGER_H #define SOUNDMANAGER_H #include "portaudio.h" #include "sndfile.h" #include <vector> #include <string> #define SAMPLE_RATE 44100 #define NUM_MUSICS 32 #define PAUSE_FADE_RATE (0.996f) #define PAUSE_FADE_LIMIT (0.01f) #define UPDATE_GAIN_RATE (0.00005f) #define UPDATE_BALANCE_RATE (0.0001f) #define PI_4 0.78539816339 // PI/4 #define SQRT2_2 0.70710678118 // SQRT(2)/2 #define E_minus1 1.718281828459045235360287471352662497757247093699959574966 // (e-1) struct DeviceInfo { int device_id; std::string name; std::string api; int maxInputChannels; int maxOutputChannels; double defaultLowInputLatency; double defaultLowOutputLatency; double defaultHighInputLatency; double defaultHighOutputLatency; double defaultSampleRate; bool is_default; }; bool SoundManager_Initialize(); bool SoundManager_Terminate(); std::vector<DeviceInfo> SoundManager_GetDevicesInfo(); int SoundManager_callback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData); void SoundManager_OpenStream(DeviceInfo dev); void SoundManager_OpenDefaultStream(); void SoundManager_CloseStream(); float SoundManager_getGlobalGain(); void SoundManager_setGlobalGain(float gain); // Music functions void SoundManager_Music_load(int music_id, std::string filename); bool SoundManager_Music_isLoaded(int music_id); void SoundManager_Music_unload(int music_id); void SoundManager_Music_loadInfiniteLooper(int music_id, std::string filename); bool SoundManager_Music_isLoadedInfiniteLooper(int music_id); void SoundManager_Music_unloadInfiniteLooper(int music_id); void SoundManager_Music_play(int music_id); bool SoundManager_Music_isPlaying(int music_id); void SoundManager_Music_stop(int music_id, bool wait=false); bool SoundManager_Music_isStopped(int music_id); void SoundManager_Music_pause(int music_id); bool SoundManager_Music_isPaused(int music_id); bool SoundManager_Music_getRepeat(int music_id); void SoundManager_Music_setRepeat(int music_id, bool repeat); float SoundManager_Music_getGain(int music_id); float SoundManager_Music_getGainLog(int music_id); void SoundManager_Music_setGain(int music_id, float gain); float SoundManager_Music_getBalance(int music_id); void SoundManager_Music_setBalance(int music_id, float balance); unsigned long long SoundManager_Music_getPositionFrame(int music_id); unsigned long long SoundManager_Music_getPositionBisFrame(int music_id); unsigned long long SoundManager_Music_getStoppedPositionFrame(int music_id); unsigned long long SoundManager_Music_getLengthFrame(int music_id); unsigned long long SoundManager_Music_getLengthSample(int music_id); unsigned long SoundManager_Music_getSampleRate(int music_id); void SoundManager_Music_seekFrame(int music_id, unsigned long long frame, bool wait=false); //float* SoundManager_Music_getData(int music_id); //float* SoundManager_Music_getVisualData(int music_id, int width); // @todo struct SoundManager_Music; struct _SoundManager_data; void SoundManager_Music_writeAudio(float* out, unsigned long frameCount, _SoundManager_data* userData, SoundManager_Music* m); #endif