text
stringlengths
4
6.14k
// default_allocator.h // The default allocator is a simple wrapper for the new and delete functions. #ifndef DEMO_DEFAULT_ALLOCATOR_H #define DEMO_DEFAULT_ALLOCATOR_H #include <assert.h> #include "demo/memory/iallocator.h" namespace demo { namespace mem { template <typename T> class DefaultAllocator : public IAllocator<T> { public: // CONSTRUCTORS /** * Constructs the allocator. */ DefaultAllocator(); /** * Constructs a copy of an allocator. */ DefaultAllocator( const DefaultAllocator<T>& copy ); /** * Destructs the allocator. */ virtual ~DefaultAllocator(); //OPERATORS /** * Assigns a copy of an allocator. */ DefaultAllocator<T>& operator =( const DefaultAllocator<T>& assign ); // MEMBER FUNCTIONS /** * Allocates the given number of instances. * * Behavior is undefined when: * T is void * count is less than or equal to zero * out of memory */ virtual T* get( uint32 count ); /** * Releases the allocation with the given number of instances. * * Behavior is undefined when: * T is void * pointer is invalid * count is less than or equal to zero * out of memory */ virtual void release( T* pointer, uint32 count ); }; //CONSTRUCTORS template <typename T> inline DefaultAllocator<T>::DefaultAllocator() { } template <typename T> inline DefaultAllocator<T>::DefaultAllocator( const mem::DefaultAllocator<T>& copy ) { } template<typename T> inline DefaultAllocator<T>::~DefaultAllocator() { } //OPERATORS template<typename T> inline DefaultAllocator<T>& DefaultAllocator<T>::operator =( const DefaultAllocator<T>& assign ) { return *this; } // MEMBER FUNCTIONS template<typename T> inline T* DefaultAllocator<T>::get( uint32 count ) { assert( count > 0 ); return new T[count]; } template<typename T> inline void DefaultAllocator<T>::release( T* pointer, uint32 count ) { assert( count > 0 ); assert( pointer != nullptr ); delete[] pointer; } } // End nspc mem } // End nspc demo #endif // DEMO_DEFAULT_ALLOCATOR_H
#ifndef JEU_H_ #define JEU_H_ #include <vector> #include <iostream> #include <cstdlib> #include "Joueur.h" #include "Grille.h" #include "Coordonnee.h" class Jeu { public: Jeu(int nombreJoueurs); void start(); private: std::vector<Joueur*> joueurs; Joueur* gagnant; Grille *grille; bool jeuFini(); bool checkGagnant(Coordonnee* coordonnee, int valeur); bool checkColonne(Coordonnee* coordonnee, int valeur); bool checkLigne(Coordonnee* coordonnee, int valeur); bool checkDiagonaleGauche(int valeur); bool checkDiagonaleDroite(int valeur); }; #endif /* JEU_H_ */
#include <stdio.h> #include <stdlib.h> /* For exit() function */ #include <time.h> char *rand_string(char*, size_t); int main(int argc, char* argv[]) { if (argc < 2) return 1; char* c=argv[1];//[25]="glrpvpkxdvhisgkmudwyknbai"; FILE *rfile, *wfile; wfile=fopen("program.txt","w"); if(wfile==NULL){ printf("Error!"); exit(1); } // printf("Enter a sentence:\n"); // gets(c); time_t t; srand((unsigned) time(&t)); // rand_string(c, 25); fprintf(wfile,"%s",c); fclose(wfile); // Now read the content again. Yes, I know. :) rfile = fopen("program.txt","r"); if(rfile==NULL){ printf("Error!"); exit(1); } char ch; while((ch = fgetc(rfile))!=EOF){ printf("%c", ch); } printf("\n"); fclose(rfile); return 0; } char *rand_string(char *str, size_t size) { const char charset[] = "abcdefghijklmnopqrstuvwxyz1234567890"; if (size) { --size; for (size_t n = 0; n < size; n++) { int key = rand() % (int) (sizeof charset - 1); str[n] = charset[key]; } str[size] = '\0'; } return str; }
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // 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 __UNIX_PROCESSSTATISTICALINFORMATION_H #define __UNIX_PROCESSSTATISTICALINFORMATION_H #include "CIM_StatisticalInformation.h" #include "UNIX_ProcessStatisticalInformationDeps.h" #define PROPERTY_CS_CREATION_CLASS_NAME "CSCreationClassName" #define PROPERTY_CS_NAME "CSName" #define PROPERTY_OS_CREATION_CLASS_NAME "OSCreationClassName" #define PROPERTY_OS_NAME "OSName" #define PROPERTY_HANDLE "Handle" #define PROPERTY_PROCESS_CREATION_CLASS_NAME "ProcessCreationClassName" #define PROPERTY_C_P_U_TIME "CPUTime" #define PROPERTY_REAL_TEXT "RealText" #define PROPERTY_REAL_DATA "RealData" #define PROPERTY_REAL_STACK "RealStack" #define PROPERTY_VIRTUAL_TEXT "VirtualText" #define PROPERTY_VIRTUAL_DATA "VirtualData" #define PROPERTY_VIRTUAL_STACK "VirtualStack" #define PROPERTY_VIRTUAL_MEMORY_MAPPED_FILE_SIZE "VirtualMemoryMappedFileSize" #define PROPERTY_VIRTUAL_SHARED_MEMORY "VirtualSharedMemory" #define PROPERTY_CPU_TIME_DEAD_CHILDREN "CpuTimeDeadChildren" #define PROPERTY_SYSTEM_TIME_DEAD_CHILDREN "SystemTimeDeadChildren" class UNIX_ProcessStatisticalInformation : public CIM_StatisticalInformation { public: UNIX_ProcessStatisticalInformation(); ~UNIX_ProcessStatisticalInformation(); virtual Boolean initialize(); virtual Boolean load(int&); virtual Boolean finalize(); virtual Boolean find(Array<CIMKeyBinding>&); virtual Boolean validateKey(CIMKeyBinding&) const; virtual void setScope(CIMName); virtual Boolean getInstanceID(CIMProperty&) const; virtual String getInstanceID() const; virtual Boolean getCaption(CIMProperty&) const; virtual String getCaption() const; virtual Boolean getDescription(CIMProperty&) const; virtual String getDescription() const; virtual Boolean getElementName(CIMProperty&) const; virtual String getElementName() const; virtual Boolean getName(CIMProperty&) const; virtual String getName() const; virtual Boolean getCSCreationClassName(CIMProperty&) const; virtual String getCSCreationClassName() const; virtual Boolean getCSName(CIMProperty&) const; virtual String getCSName() const; virtual Boolean getOSCreationClassName(CIMProperty&) const; virtual String getOSCreationClassName() const; virtual Boolean getOSName(CIMProperty&) const; virtual String getOSName() const; virtual Boolean getHandle(CIMProperty&) const; virtual String getHandle() const; virtual Boolean getProcessCreationClassName(CIMProperty&) const; virtual String getProcessCreationClassName() const; virtual Boolean getCPUTime(CIMProperty&) const; virtual Uint32 getCPUTime() const; virtual Boolean getRealText(CIMProperty&) const; virtual Uint64 getRealText() const; virtual Boolean getRealData(CIMProperty&) const; virtual Uint64 getRealData() const; virtual Boolean getRealStack(CIMProperty&) const; virtual Uint64 getRealStack() const; virtual Boolean getVirtualText(CIMProperty&) const; virtual Uint64 getVirtualText() const; virtual Boolean getVirtualData(CIMProperty&) const; virtual Uint64 getVirtualData() const; virtual Boolean getVirtualStack(CIMProperty&) const; virtual Uint64 getVirtualStack() const; virtual Boolean getVirtualMemoryMappedFileSize(CIMProperty&) const; virtual Uint64 getVirtualMemoryMappedFileSize() const; virtual Boolean getVirtualSharedMemory(CIMProperty&) const; virtual Uint64 getVirtualSharedMemory() const; virtual Boolean getCpuTimeDeadChildren(CIMProperty&) const; virtual Uint64 getCpuTimeDeadChildren() const; virtual Boolean getSystemTimeDeadChildren(CIMProperty&) const; virtual Uint64 getSystemTimeDeadChildren() const; private: CIMName currentScope; # include "UNIX_ProcessStatisticalInformationPrivate.h" }; #endif /* UNIX_PROCESSSTATISTICALINFORMATION */
// RUN: %tool "%s" > "%t" // RUN: %diff %INCORRECT "%t" int main() { int m; int n; int i; int j; /* calculate m times n times 2 */ assume(m >= 1000); assume(m <= 1024); assume(n >= 0); assume(n <= 64); i=m; // incorrect j=0; while(j < m) //invariant (i == 2*j*n) //invariant (j >= 0) //invariant (j <= m) { j = j + 1; i = i + 2 * n; } assert(i == 2*m*n); return 0; }
#if defined(PEGASUS_OS_HPUX) # include "UNIX_PolicyRuleInSystemPrivate_HPUX.h" #elif defined(PEGASUS_OS_LINUX) # include "UNIX_PolicyRuleInSystemPrivate_LINUX.h" #elif defined(PEGASUS_OS_DARWIN) # include "UNIX_PolicyRuleInSystemPrivate_DARWIN.h" #elif defined(PEGASUS_OS_AIX) # include "UNIX_PolicyRuleInSystemPrivate_AIX.h" #elif defined(PEGASUS_OS_FREEBSD) # include "UNIX_PolicyRuleInSystemPrivate_FREEBSD.h" #elif defined(PEGASUS_OS_SOLARIS) # include "UNIX_PolicyRuleInSystemPrivate_SOLARIS.h" #elif defined(PEGASUS_OS_ZOS) # include "UNIX_PolicyRuleInSystemPrivate_ZOS.h" #elif defined(PEGASUS_OS_VMS) # include "UNIX_PolicyRuleInSystemPrivate_VMS.h" #elif defined(PEGASUS_OS_TRU64) # include "UNIX_PolicyRuleInSystemPrivate_TRU64.h" #else # include "UNIX_PolicyRuleInSystemPrivate_STUB.h" #endif
// Copyright (c) 2019 The Gulden developers // Authored by: Malcolm MacLeod (mmacleod@gmx.com) // Distributed under the GULDEN software license, see the accompanying file COPYING // This file is a thin wrapper around the actual 'echo256_aesni_opt', along with various other similarly named files. // The build system compiles each file with slightly different optimisation flags so that we have optimised implementations for a wide spread of processors. #ifndef HASH_ECHO_256_ARM_CORTEX_A57_H #define HASH_ECHO_256_ARM_CORTEX_A57_H #define echo256_opt_Init echo256_opt_arm_cortex_a57_Init #define echo256_opt_Update echo256_opt_arm_cortex_a57_Update #define echo256_opt_Final echo256_opt_arm_cortex_a57_Final #define echo256_opt_UpdateFinal echo256_opt_arm_cortex_a57_UpdateFinal #define ECHO256_OPT_IMPL #include "../echo256_opt.h" #undef ECHO256_OPT_IMPL #undef echo256_opt_Init #undef echo256_opt_Update #undef echo256_opt_Final #undef echo256_opt_UpdateFinal #endif
/** file stdlib.h 'Standard library' functions, for whatever that means. */ #ifndef STDLIB_INCLUDE #define STDLIB_INCLUDE #include <types.h> /** Causes normal program termination and the value of status is returned to the parent. All open streams are flushed and closed. */ void exit(int status) NONBANKED; #if 0 /** Compatibility function. Not implemented. */ int getkey(void); #endif /** Returns the absolute value of a int. If i is negative, returns -i; else returns i. */ int abs(int i); /** Returns the absolute value of a long. */ long labs(long num); /** Converts an ASCII string to an int. The string may be of the format [\s]*[+-][\d]+[\D]* i.e. any number of spaces, an optional + or -, then an arbitrary number of digits. The result is undefined if the number doesnt fit in an int. */ int atoi(const char *s); /** Converts an ASCII string to a long. */ long atol(const char *s); /** Converts an int into a base 10 ASCII string. */ char *itoa(int n, char *s); /** Converts a long into a base 10 ASCII string. */ char *ltoa(long n, char *s); #endif
#ifndef MCLIB_COMMON_DATA_BUFFER_H_ #define MCLIB_COMMON_DATA_BUFFER_H_ #include <mclib/common/Common.h> #include <vector> #include <algorithm> #include <cstring> #include <cassert> namespace mc { class MCString; class VarInt; class DataBuffer { private: typedef std::vector<u8> Data; Data m_Buffer; std::size_t m_ReadOffset = 0; public: typedef Data::iterator iterator; typedef Data::const_iterator const_iterator; typedef Data::reference reference; typedef Data::const_reference const_reference; MCLIB_API DataBuffer(); MCLIB_API DataBuffer(const DataBuffer& other); MCLIB_API DataBuffer(const DataBuffer& other, std::size_t offset); MCLIB_API DataBuffer(DataBuffer&& other); MCLIB_API DataBuffer(const std::string& str); MCLIB_API DataBuffer& operator=(const DataBuffer& other); MCLIB_API DataBuffer& operator=(DataBuffer&& other); template <typename T> void Append(T data) { std::size_t size = sizeof(data); std::size_t end_pos = m_Buffer.size(); m_Buffer.resize(m_Buffer.size() + size); memcpy(&m_Buffer[end_pos], &data, size); } template <typename T> DataBuffer& operator<<(T data) { // Switch to big endian std::reverse((u8*)&data, (u8*)&data + sizeof(T)); Append(data); return *this; } DataBuffer& operator<<(std::string data) { m_Buffer.insert(m_Buffer.end(), data.begin(), data.end()); return *this; } DataBuffer& operator<<(DataBuffer& data) { m_Buffer.insert(m_Buffer.end(), data.begin(), data.end()); return *this; } DataBuffer& operator<<(const DataBuffer& data) { m_Buffer.insert(m_Buffer.end(), data.begin(), data.end()); return *this; } template <typename T> DataBuffer& operator>>(T& data) { assert(m_ReadOffset + sizeof(T) <= GetSize()); data = *(T *)&m_Buffer[m_ReadOffset]; std::reverse((u8*)&data, (u8*)&data + sizeof(T)); m_ReadOffset += sizeof(T); return *this; } DataBuffer& operator>>(DataBuffer& data) { data.Resize(GetSize() - m_ReadOffset); std::copy(m_Buffer.begin() + m_ReadOffset, m_Buffer.end(), data.begin()); m_ReadOffset = m_Buffer.size(); return *this; } DataBuffer& operator>>(std::string& data) { data.resize(GetSize() - m_ReadOffset); std::copy(m_Buffer.begin() + m_ReadOffset, m_Buffer.end(), data.begin()); m_ReadOffset = m_Buffer.size(); return *this; } void ReadSome(char* buffer, std::size_t amount) { assert(m_ReadOffset + amount <= GetSize()); std::copy_n(m_Buffer.begin() + m_ReadOffset, amount, buffer); m_ReadOffset += amount; } void ReadSome(u8* buffer, std::size_t amount) { assert(m_ReadOffset + amount <= GetSize()); std::copy_n(m_Buffer.begin() + m_ReadOffset, amount, buffer); m_ReadOffset += amount; } void ReadSome(DataBuffer& buffer, std::size_t amount) { assert(m_ReadOffset + amount <= GetSize()); buffer.Resize(amount); std::copy_n(m_Buffer.begin() + m_ReadOffset, amount, buffer.begin()); m_ReadOffset += amount; } void ReadSome(std::string& buffer, std::size_t amount) { assert(m_ReadOffset + amount <= GetSize()); buffer.resize(amount); std::copy_n(m_Buffer.begin() + m_ReadOffset, amount, buffer.begin()); m_ReadOffset += amount; } void Resize(std::size_t size) { m_Buffer.resize(size); } void Reserve(std::size_t amount) { m_Buffer.reserve(amount); } void erase(iterator it) { m_Buffer.erase(it); } void Clear() { m_Buffer.clear(); m_ReadOffset = 0; } bool IsFinished() const { return m_ReadOffset >= m_Buffer.size(); } std::size_t GetReadOffset() const { return m_ReadOffset; } void MCLIB_API SetReadOffset(std::size_t pos); std::string MCLIB_API ToString() const; std::size_t MCLIB_API GetSize() const; bool MCLIB_API IsEmpty() const; std::size_t MCLIB_API GetRemaining() const; iterator MCLIB_API begin(); iterator MCLIB_API end(); const_iterator MCLIB_API begin() const; const_iterator MCLIB_API end() const; reference operator[](Data::size_type i) { return m_Buffer[i]; } const_reference operator[](Data::size_type i) const { return m_Buffer[i]; } }; MCLIB_API std::ostream& operator<<(std::ostream& os, const DataBuffer& buffer); } // ns mc #endif
/* * Auto generated Run-Time-Environment Component Configuration File * *** Do not modify ! *** * * Project: 'arm_nnexamples_gru' * Target: 'ARMCM3' */ #ifndef RTE_COMPONENTS_H #define RTE_COMPONENTS_H /* * Define the Device Header File: */ #define CMSIS_device_header "ARMCM3.h" #define RTE_Compiler_IO_STDOUT /* Compiler I/O: STDOUT */ #define RTE_Compiler_IO_STDOUT_ITM /* Compiler I/O: STDOUT ITM */ #endif /* RTE_COMPONENTS_H */
#pragma once #include "BarUIControl.h" class OxygenUI : public BarUIControl { public: OxygenUI(); virtual ~OxygenUI(); void init(); };
// // UIView+CornerRadius.h // JMJUtilities // // Created by J.J. Jackson on 2/27/13. // #import <UIKit/UIKit.h> @interface UIView (CornerRadius) /** * A corner radius used to round the corners. Setting this removes any corner specific radii. * If specific radii are set, this will return -1.0. */ @property (assign,nonatomic) CGFloat cornerRadius; /** * A corner radius used to round the top left corner. */ @property (assign,nonatomic) CGFloat topLeftCornerRadius; /** * A corner radius used to round the top right corner */ @property (assign,nonatomic) CGFloat topRightCornerRadius; /** * A corner radius used to round the bottom left corner */ @property (assign,nonatomic) CGFloat bottomLeftCornerRadius; /** * A corner radius used to round the bottom right corner */ @property (assign,nonatomic) CGFloat bottomRightCornerRadius; @end
/** * \file * \brief echoserver local interface */ /* * Copyright (c) 2008, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #ifndef ECHOSERVER_H #define ECHOSERVER_H //void startlwip(char *card_name, uint64_t queueid); int udp_echo_server_init(void); int tcp_echo_server_init(void); #endif // ECHOSERVER_H
/** * Copyright (c) 2018 The cxkernel Authors. All rights reserved. * Use of this source code is governed by a MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT * * @file bitmap.h * @author Kevin Dai \<kevindai02@outlook.com\> * @date Created on December 22 2018, 10:55 PM */ #pragma once #include "common.h" __BEGIN_CDECLS typedef struct bitmap { size_t length; //!< Array size of bitmap, not total bit count size_t bit_count; //!< Bit count unsigned int* bitmap; //!< Bitmap array } bitmap_t; /** * Sets a bit in the bitmap * @param A The bitmap array * @param k The kth bit to set */ #define bitmap_setbit(A, k) (A[((k) / (sizeof(unsigned int) * 8))] |= (1 << ((k) % (sizeof(unsigned int) * 8)))) /** * Clears a bit in the bitmap * @param A The bitmap array * @param k The kth bit to clear */ #define bitmap_clrbit(A, k) (A[((k) / (sizeof(unsigned int) * 8))] &= ~(1 << ((k) % (sizeof(unsigned int) * 8)))) /** * Tests a bit in the bitmap * @param A A bitmap array * @param k The kth bit to test * @return 1 if set and 0 if not set */ #define bitmap_tstbit(A, k) (A[((k) / (sizeof(unsigned int) * 8))] & (1 << ((k) % (sizeof(unsigned int) * 8)))) /** * Get's the number of entries that should be in the bitmap * @param L The number of bits the bitmap has * @return The number of entries that should be in the bitmap */ #define bitmap_getlength(L) ((L) / (sizeof(unsigned int) * 8) + 1) /** * Get's the number of bits within the bitmap * @param L The number of entries the bitmap has * @return The number of bits that should be in the bitmap */ #define bitmap_getbits(L) ((L) * sizeof(unsigned int) * 8) // 8 bits per char /** * Get's the first occurence of a zeroth bit * @param b The bitmap to search * @return The index of the bit. If none was found, returns -1 */ static inline int bitmap_firstz(bitmap_t* b) { int _ptr = 0; for(size_t i = 0; i < b -> length; i++) { if(b -> bitmap[i] != ~0U) { _ptr = 0; while(_ptr < 32 && bitmap_tstbit(b -> bitmap, _ptr + bitmap_getbits(i))) _ptr++; _ptr += (int) bitmap_getbits(i); return _ptr; } } return -1; } /** * Gets the last occurence of a zeroth bit * @param b The bitmap to search * @return The index of the bit. If none was found, returns -1 */ static inline int bitmap_lastz(bitmap_t* b) { int _ptr = 0; for(size_t i = b -> length; i > 0; i--) { if(b -> bitmap[i - 1] != ~0U) { while(_ptr > 0 && bitmap_tstbit(b -> bitmap, (_ptr - 1) + bitmap_getbits(i - 1))) _ptr--; _ptr += (int) bitmap_getbits(i - 1); return _ptr; } } return -1; } __END_CDECLS
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <stdio.h> #include <curl/curl.h> /* <DESC> * Get a single file from an FTP server. * </DESC> */ struct FtpFile { const char *filename; FILE *stream; }; static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out=(struct FtpFile *)stream; if(out && !out->stream) { /* open file for writing */ out->stream=fopen(out->filename, "wb"); if(!out->stream) return -1; /* failure, can't open file to write */ } return fwrite(buffer, size, nmemb, out->stream); } int main(void) { CURL *curl; CURLcode res; struct FtpFile ftpfile={ "curl.tar.gz", /* name to store the file as if successful */ NULL }; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { /* * You better replace the URL with one that works! */ curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz"); /* Define our callback to get called when there's data to be written */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); /* Set a pointer to our struct to pass to the callback */ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile); /* Switch on full protocol/debug output */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); if(CURLE_OK != res) { /* we failed */ fprintf(stderr, "curl told us %d\n", res); } } if(ftpfile.stream) fclose(ftpfile.stream); /* close the local file */ curl_global_cleanup(); return 0; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// /// Copyright 2009 Aurora Feint, Inc. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #import "OFTableSequenceControllerHelper.h" #import "OFCustomBottomView.h" @class OFChatRoomMessageBoxController; @class OFChatRoomInstance; @interface OFChatRoomController : OFTableSequenceControllerHelper<UIAlertViewDelegate, UITextFieldDelegate, OFCustomBottomView> { @private OFChatRoomMessageBoxController* mChatRoomMessageBoxController; bool mIsKeyboardShown; bool mHasAppearedBefore; bool mRoomIsFull; bool mIsChangingName; OFChatRoomInstance* roomInstance; UIView* mDashboardNotificationView; } @property (nonatomic, retain) OFChatRoomInstance* roomInstance; - (UIView*)getBottomView; @end
// // PeripheralDetailsViewController.h // UHNBLEController // // Created by Nathaniel Hamming on 2015-02-10. // Copyright (c) 2015 University Health Network. // // 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 <UIKit/UIKit.h> #define kPeripheralDeviceName @"PeripheralDeviceName" #define kPeripheralAdvertisedServices @"PeripheralAdvertisedServices" #define kPeripheralServices @"PeripheralServices" #define kPeripheralServicesUUID @"PeripheralServicesUUID" #define kPeripheralServiceCharacteristics @"PeripheralServiceCharacteristics" @interface PeripheralDetailsViewController : UIViewController - (instancetype)initWithPeripheralDetails: (NSDictionary*)peripheralDetails; @end
#include "soundpipe.h" #include "md5.h" #include "tap.h" #include "test.h" typedef struct { sp_expon *line; sp_osc *osc; sp_ftbl *ft; } UserData; int t_expon(sp_test *tst, sp_data *sp, const char *hash) { sp_srand(sp, 1234567); uint32_t n; int fail = 0; SPFLOAT osc = 0, line = 0; SPFLOAT tick = 0; UserData ud; sp_expon_create(&ud.line); sp_osc_create(&ud.osc); sp_ftbl_create(sp, &ud.ft, 2048); sp_expon_init(sp, ud.line); ud.line->a = 100; ud.line->dur = 3; ud.line->b = 400; sp_gen_sine(sp, ud.ft); sp_osc_init(sp, ud.osc, ud.ft, 0); sp->len = 44100 * 5; for(n = 0; n < tst->size; n++) { if(n == 0) tick = 1; else tick = 0; sp_expon_compute(sp, ud.line, &tick, &line); ud.osc->freq = line; sp_osc_compute(sp, ud.osc, NULL, &osc); sp->out[0] = osc; sp_test_add_sample(tst, sp->out[0]); } fail = sp_test_verify(tst, hash); sp_expon_destroy(&ud.line); sp_ftbl_destroy(&ud.ft); sp_osc_destroy(&ud.osc); if(fail) return SP_NOT_OK; else return SP_OK; }
// // STEmoji.h // STEmojiKeyboard // // Created by zhenlintie on 15/5/29. // Copyright (c) 2015年 sTeven. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSUInteger, STEmojiType) { // emoji show type STEmojiTypePeople = 0, STEmojiTypeFlower, STEmojiTypeBell, STEmojiTypeVehicle, STEmojiTypeNumber, }; @interface STEmoji : NSObject @property (assign, nonatomic) STEmojiType type; @property (strong, nonatomic) NSString *title; @property (strong, nonatomic) NSArray *emojis; @end @interface STEmoji (Generate) + (NSArray *)allEmojis; @end
/*====================================================================================================*/ /*====================================================================================================*/ #include "stm32f1_system.h" #include "stm32f1_spi.h" #include "module_w25qxx.h" /*====================================================================================================*/ /*====================================================================================================*/ #define W25Q_SPIx SPI2 #define W25Q_SPIx_CLK RCC_APB1Periph_SPI2 #define W25Q_WP_PIN GPIO_Pin_10 #define W25Q_WP_GPIO_PORT GPIOB #define W25Q_WP_GPIO_CLK RCC_APB2Periph_GPIOB #define W25Q_WP_H GPIO_SetBits(W25Q_WP_GPIO_PORT, W25Q_WP_PIN) #define W25Q_WP_L GPIO_ResetBits(W25Q_WP_GPIO_PORT, W25Q_WP_PIN) #define W25Q_HOL_PIN GPIO_Pin_11 #define W25Q_HOL_GPIO_PORT GPIOB #define W25Q_HOL_GPIO_CLK RCC_APB2Periph_GPIOB #define W25Q_HOL_H GPIO_SetBits(W25Q_HOL_GPIO_PORT, W25Q_HOL_PIN) #define W25Q_HOL_L GPIO_ResetBits(W25Q_HOL_GPIO_PORT, W25Q_HOL_PIN) #define W25Q_CS_PIN GPIO_Pin_12 #define W25Q_CS_GPIO_PORT GPIOB #define W25Q_CS_GPIO_CLK RCC_APB2Periph_GPIOB #define W25Q_CS_H GPIO_SetBits(W25Q_CS_GPIO_PORT, W25Q_CS_PIN) #define W25Q_CS_L GPIO_ResetBits(W25Q_CS_GPIO_PORT, W25Q_CS_PIN) #define W25Q_SCK_PIN GPIO_Pin_13 #define W25Q_SCK_GPIO_PORT GPIOB #define W25Q_SCK_GPIO_CLK RCC_APB2Periph_GPIOB #define W25Q_SDO_PIN GPIO_Pin_14 #define W25Q_SDO_GPIO_PORT GPIOB #define W25Q_SDO_GPIO_CLK RCC_APB2Periph_GPIOB #define W25Q_SDI_PIN GPIO_Pin_15 #define W25Q_SDI_GPIO_PORT GPIOB #define W25Q_SDI_GPIO_CLK RCC_APB2Periph_GPIOB /*====================================================================================================*/ /*====================================================================================================* **函數 : W25Q_Config **功能 : 配置 IO **輸入 : None **輸出 : None **使用 : W25Q_Config(); **====================================================================================================*/ /*====================================================================================================*/ void W25Q_Config( void ) { GPIO_InitTypeDef GPIO_InitStruct; SPI_InitTypeDef SPI_InitStruct; /* SPI Clk Init *************************************************************/ RCC_APB1PeriphClockCmd(W25Q_SPIx_CLK, ENABLE); RCC_APB2PeriphClockCmd(W25Q_CS_GPIO_CLK | W25Q_SCK_GPIO_CLK | W25Q_SDO_GPIO_CLK | W25Q_SDI_GPIO_CLK | W25Q_WP_GPIO_CLK | W25Q_HOL_GPIO_CLK | RCC_APB2Periph_AFIO, ENABLE); /* CS */ GPIO_InitStruct.GPIO_Pin = W25Q_CS_PIN; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(W25Q_CS_GPIO_PORT, &GPIO_InitStruct); /* SCK */ GPIO_InitStruct.GPIO_Pin = W25Q_SCK_PIN; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init(W25Q_SCK_GPIO_PORT, &GPIO_InitStruct); /* SDO */ GPIO_InitStruct.GPIO_Pin = W25Q_SDO_PIN; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init(W25Q_SDO_GPIO_PORT, &GPIO_InitStruct); /* SDI */ GPIO_InitStruct.GPIO_Pin = W25Q_SDI_PIN; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_Init(W25Q_SDI_GPIO_PORT, &GPIO_InitStruct); W25Q_CS_H; // 低電位有效 /* SPI Init ****************************************************************/ SPI_InitStruct.SPI_Direction = SPI_Direction_2Lines_FullDuplex; // Full Duplex SPI_InitStruct.SPI_Mode = SPI_Mode_Master; // Master Mode SPI_InitStruct.SPI_DataSize = SPI_DataSize_8b; // Data Size 16 bit SPI_InitStruct.SPI_CPOL = SPI_CPOL_Low; // Transitioned On The Falling Edge SPI_InitStruct.SPI_CPHA = SPI_CPHA_1Edge; // Latched On the Rising Edge SPI_InitStruct.SPI_NSS = SPI_NSS_Soft; // Software NSS Signal SPI_InitStruct.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64; // fsck = APB1 36MHz / 2 = 18MHz SPI_InitStruct.SPI_FirstBit = SPI_FirstBit_MSB; // MSB First SPI_InitStruct.SPI_CRCPolynomial = 7; SPI_Init(W25Q_SPIx, &SPI_InitStruct); SPI_Cmd(W25Q_SPIx, ENABLE); } /*====================================================================================================*/ /*====================================================================================================* **函數 : W25Q_ReadDeviceID **功能 : Read Device ID **輸入 : None **輸出 : DeviceID **使用 : DeviceID = W25Q_ReadDeviceID(); **====================================================================================================*/ /*====================================================================================================*/ uint16_t W25Q_ReadDeviceID( void ) { uint16_t DeviceID = 0; W25Q_CS_L; SPI_RW(W25Q_SPIx, 0x90); SPI_RW(W25Q_SPIx, 0x00); SPI_RW(W25Q_SPIx, 0x00); SPI_RW(W25Q_SPIx, 0x00); DeviceID = SPI_RW(W25Q_SPIx, 0xFF) << 8; DeviceID |= SPI_RW(W25Q_SPIx, 0xFF); W25Q_CS_H; return DeviceID; } /*====================================================================================================*/ /*====================================================================================================*/
/* Copyright (c) 2012 Tyrone Trevorrow 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> @interface RoundedRectUtility : NSObject { UIColor *fillColor; UIColor *borderColor; NSNumber *insetX; NSNumber *insetY; NSInteger cornerRadius; CGFloat borderInset; CGFloat borderWidth; } typedef enum { RectCornerNone = 0, RectCornerTopLeft = 1, RectCornerTopRight = RectCornerTopLeft << 1, RectCornerBottomRight = RectCornerTopLeft << 2, RectCornerBottomLeft = RectCornerTopLeft << 3, RectCornerTop = RectCornerTopLeft | RectCornerTopRight, RectCornerBottom = RectCornerBottomLeft | RectCornerBottomRight, RectCornerLeft = RectCornerTopLeft | RectCornerBottomLeft, RectCornerRight = RectCornerTopRight | RectCornerBottomRight, RectCornerAll = RectCornerTopLeft | RectCornerTopRight | RectCornerBottomRight | RectCornerBottomLeft } RectCorner; typedef enum { RectSizeNone = 0, RectSideLeft = 1, RectSideTop = RectSideLeft << 1, RectSideRight = RectSideLeft << 2, RectSideBottom = RectSideLeft << 3, RectSideAll = RectSideLeft | RectSideTop | RectSideRight | RectSideBottom } RectSide; @property (nonatomic, strong) UIColor *fillColor; @property (nonatomic, strong) UIColor *borderColor; @property (nonatomic, strong) NSNumber *insetX; @property (nonatomic, strong) NSNumber *insetY; @property (nonatomic, assign) NSInteger insetXValue; @property (nonatomic, assign) NSInteger insetYValue; @property (nonatomic, assign) NSInteger cornerRadius; @property (nonatomic, assign) CGFloat borderInset; @property (nonatomic, assign) CGFloat borderWidth; @property (nonatomic, assign) CGSize size; @property (nonatomic, assign) RectCorner roundedCorners; @property (nonatomic, assign) RectSide rectSides; @property (nonatomic, assign) BOOL useMinimumSizeImage; - (void) configure; + (RoundedRectUtility *)roundedRectWithHeight:(CGFloat)height; + (RoundedRectUtility *)roundedRectWithHeight:(CGFloat)height width:(CGFloat)width; - (void)setHeight:(CGFloat)height; - (UIImage*) roundedRectImage; @end
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_DoITT_BookSelectorVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_DoITT_BookSelectorVersionString[];
// Copyright (c) 2014 The Unpay developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _KEEPASS_H_ #define _KEEPASS_H_ #define KEEPASS_CRYPTO_KEY_SIZE 32 #define KEEPASS_CRYPTO_BLOCK_SIZE 16 #define KEEPASS_KEEPASSHTTP_HOST "localhost" #define KEEPASS_KEEPASSHTTP_PORT 19455 #include <string> #include <vector> #include <map> #include "json/json_spirit_value.h" #include "crypter.h" #include "allocators.h" class CKeePassIntegrator { bool bIsActive; unsigned int nPort; SecureString sKeyBase64; SecureString sKey; SecureString sUrl; //SecureString sSubmitUrl; std::string sKeePassId; std::string sKeePassEntryName; class CKeePassRequest { json_spirit::Object requestObj; std::string sType; std::string sIV; SecureString sKey; void init(); public: void addStrParameter(std::string sName, std::string sValue); // Regular void addStrParameter(std::string sName, SecureString sValue); // Encrypt std::string getJson(); CKeePassRequest(SecureString sKey, std::string sType) { this->sKey = sKey; this->sType = sType; init(); }; }; class CKeePassEntry { SecureString uuid; SecureString name; SecureString login; SecureString password; public: CKeePassEntry(SecureString uuid, SecureString name, SecureString login, SecureString password) : uuid(uuid), name(name), login(login), password(password) { } SecureString getUuid() { return uuid; } SecureString getName() { return name; } SecureString getLogin() { return login; } SecureString getPassword() { return password; } }; class CKeePassResponse { bool bSuccess; std::string sType; std::string sIV; SecureString sKey; void parseResponse(std::string sResponse); public: json_spirit::Object responseObj; CKeePassResponse(SecureString sKey, std::string sResponse) { this->sKey = sKey; parseResponse(sResponse); } bool getSuccess() { return bSuccess; } SecureString getSecureStr(std::string sName); std::string getStr(std::string sName); std::vector<CKeePassEntry> getEntries(); SecureString decrypt(std::string sValue); // DecodeBase64 and decrypt arbitrary string value }; static SecureString generateRandomKey(size_t nSize); static std::string constructHTTPPost(const std::string& strMsg, const std::map<std::string,std::string>& mapRequestHeaders); void doHTTPPost(const std::string& sRequest, int& nStatus, std::string& sResponse); void rpcTestAssociation(bool bTriggerUnlock); std::vector<CKeePassEntry> rpcGetLogins(); void rpcSetLogin(const SecureString& strWalletPass, const SecureString& sEntryId); public: CKeePassIntegrator(); void init(); static SecureString generateKeePassKey(); void rpcAssociate(std::string& sId, SecureString& sKeyBase64); SecureString retrievePassphrase(); void updatePassphrase(const SecureString& sWalletPassphrase); }; extern CKeePassIntegrator keePassInt; #endif
/*++ /* NAME /* cleanup_map11 3 /* SUMMARY /* one-to-one mapping /* SYNOPSIS /* #include <cleanup.h> /* /* int cleanup_map11_external(state, addr, maps, propagate) /* CLEANUP_STATE *state; /* VSTRING *addr; /* MAPS *maps; /* int propagate; /* /* int cleanup_map11_internal(state, addr, maps, propagate) /* CLEANUP_STATE *state; /* VSTRING *addr; /* MAPS *maps; /* int propagate; /* /* int cleanup_map11_tree(state, tree, maps, propagate) /* CLEANUP_STATE *state; /* TOK822 *tree; /* MAPS *maps; /* int propagate; /* DESCRIPTION /* This module performs one-to-one map lookups. /* /* If an address has a mapping, the lookup result is /* subjected to another iteration of rewriting and mapping. /* Recursion continues until an address maps onto itself, /* or until an unreasonable recursion level is reached. /* An unmatched address extension is propagated when /* \fIpropagate\fR is non-zero. /* These functions return non-zero when the address was changed. /* /* cleanup_map11_external() looks up the external (quoted) string /* form of an address in the maps specified via the \fImaps\fR argument. /* /* cleanup_map11_internal() is a wrapper around the /* cleanup_map11_external() routine that transforms from /* internal (quoted) string form to external form and back. /* /* cleanup_map11_tree() is a wrapper around the /* cleanup_map11_external() routine that transforms from /* internal parse tree form to external form and back. /* DIAGNOSTICS /* Recoverable errors: the global \fIcleanup_errs\fR flag is updated. /* SEE ALSO /* mail_addr_find(3) address lookups /* mail_addr_map(3) address mappings /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /*--*/ /* System library. */ #include <sys_defs.h> #include <string.h> #ifdef STRCASECMP_IN_STRINGS_H #include <strings.h> #endif /* Utility library. */ #include <msg.h> #include <vstring.h> #include <dict.h> #include <mymalloc.h> /* Global library. */ #include <cleanup_user.h> #include <mail_addr_map.h> #include <quote_822_local.h> /* Application-specific. */ #include "cleanup.h" #define STR vstring_str #define MAX_RECURSION 10 /* cleanup_map11_external - one-to-one table lookups */ int cleanup_map11_external(CLEANUP_STATE *state, VSTRING *addr, MAPS *maps, int propagate) { int count; int expand_to_self; ARGV *new_addr; char *saved_addr; int did_rewrite = 0; /* * Produce sensible output even in the face of a recoverable error. This * simplifies error recovery considerably because we can do delayed error * checking in one place, instead of having error handling code all over * the place. */ for (count = 0; count < MAX_RECURSION; count++) { if ((new_addr = mail_addr_map(maps, STR(addr), propagate)) != 0) { if (new_addr->argc > 1) msg_warn("%s: multi-valued %s entry for %s", state->queue_id, maps->title, STR(addr)); saved_addr = mystrdup(STR(addr)); did_rewrite |= strcmp(new_addr->argv[0], STR(addr)); vstring_strcpy(addr, new_addr->argv[0]); expand_to_self = !strcasecmp(saved_addr, STR(addr)); myfree(saved_addr); argv_free(new_addr); if (expand_to_self) return (did_rewrite); } else if (maps->error != 0) { msg_warn("%s: %s map lookup problem for %s -- " "message not accepted, try again later", state->queue_id, maps->title, STR(addr)); state->errs |= CLEANUP_STAT_WRITE; return (did_rewrite); } else { return (did_rewrite); } } msg_warn("%s: unreasonable %s map nesting for %s -- " "message not accepted, try again later", state->queue_id, maps->title, STR(addr)); return (did_rewrite); } /* cleanup_map11_tree - rewrite address node */ int cleanup_map11_tree(CLEANUP_STATE *state, TOK822 *tree, MAPS *maps, int propagate) { VSTRING *temp = vstring_alloc(100); int did_rewrite; /* * Produce sensible output even in the face of a recoverable error. This * simplifies error recovery considerably because we can do delayed error * checking in one place, instead of having error handling code all over * the place. */ tok822_externalize(temp, tree->head, TOK822_STR_DEFL); did_rewrite = cleanup_map11_external(state, temp, maps, propagate); tok822_free_tree(tree->head); tree->head = tok822_scan(STR(temp), &tree->tail); vstring_free(temp); return (did_rewrite); } /* cleanup_map11_internal - rewrite address internal form */ int cleanup_map11_internal(CLEANUP_STATE *state, VSTRING *addr, MAPS *maps, int propagate) { VSTRING *temp = vstring_alloc(100); int did_rewrite; /* * Produce sensible output even in the face of a recoverable error. This * simplifies error recovery considerably because we can do delayed error * checking in one place, instead of having error handling code all over * the place. */ quote_822_local(temp, STR(addr)); did_rewrite = cleanup_map11_external(state, temp, maps, propagate); unquote_822_local(addr, STR(temp)); vstring_free(temp); return (did_rewrite); }
/****************************************************************************** * Wormux is a convivial mass murder game. * Copyright (C) 2001-2004 Lawrence Azzoug. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ****************************************************************************** * Colors. ******************************************************************************/ #ifndef COLORS_H #define COLORS_H #include <SDL_video.h> #include "color.h" // Greyscale const Color white_color (255, 255, 255, SDL_ALPHA_OPAQUE); const Color lightgray_color (169, 169, 169, SDL_ALPHA_OPAQUE); const Color gray_color (128, 128, 128, SDL_ALPHA_OPAQUE); const Color dark_gray_color (64, 64, 64, SDL_ALPHA_OPAQUE); const Color black_color (0, 0, 0, SDL_ALPHA_OPAQUE); const Color c_white (0xFF, 0xFF, 0xFF, 0x70); const Color c_black (0x00, 0x00, 0x00, 0x70); const Color c_red (0xFF, 0x00, 0x00, 0x70); const Color c_yellow (0x00, 0xFF, 0xFF, 0x70); const Color c_grey (0xF0, 0xF0, 0xF0, 0x70); // Green const Color green_color (68, 120, 51, SDL_ALPHA_OPAQUE); const Color primary_red_color(255, 0, 0, SDL_ALPHA_OPAQUE); // Default colors: const Color defaultColorBox(80, 80, 159, 206); const Color defaultColorRect(49, 32, 122, 255); const Color defaultOptionColorBox(255,255,255,160); //const Color defaultOptionColorBox(34, 133, 175, 206); const Color highlightOptionColorBox(200, 100, 100, 206); //const Color defaultOptionColorBox(34, 133, 175, 206); const Color defaultDisabledColorBox(0,0,0,127); const Color defaultOptionColorRect(59,88,129,206); //const Color defaultListColor1(255, 255, 255, 255*3/10); const Color defaultListColor1(75, 163, 200, 255*3/10); const Color defaultListColor2(0, 0, 255*6/10, 255*8/10); const Color defaultListColor3(0, 0, 255*6/10, 255*4/10); #endif /* COLORS_H */
/* * upgraded-guacamole - A Terraria server written in C for POSIX operating systems * Copyright (C) 2016 Tyler Watson <tyler@tw.id.au> * * This file is part of upgraded-guacamole. * * upgraded-guacamole 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. * upgraded-guacamole 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 upgraded-guacamole. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <stdint.h> #ifdef __cplusplus extern "C" { #endif struct rect { int32_t x; int32_t y; int16_t w; int16_t h; }; static inline struct rect rect_new(int x, int y, int w, int h) { struct rect r; r.h = h; r.w = w; r.x = x; r.y = y; return r; } #ifdef __cplusplus } #endif
/* Cabal - Legacy Game Implementations * * Cabal is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ // Based on the ScummVM (GPLv2+) file of the same name #ifndef SCUMM_PLAYERS_PLAYER_MOD_H #define SCUMM_PLAYERS_PLAYER_MOD_H #include "scumm/scumm.h" #include "audio/audiostream.h" #include "audio/mixer.h" namespace Audio { class RateConverter; } namespace Scumm { /** * Generic Amiga MOD mixer - provides a 60Hz 'update' routine. */ class Player_MOD : public Audio::AudioStream { public: Player_MOD(Audio::Mixer *mixer); virtual ~Player_MOD(); virtual void setMusicVolume(int vol); virtual void startChannel(int id, void *data, int size, int rate, uint8 vol, int loopStart = 0, int loopEnd = 0, int8 pan = 0); virtual void stopChannel(int id); virtual void setChannelVol(int id, uint8 vol); virtual void setChannelPan(int id, int8 pan); virtual void setChannelFreq(int id, int freq); typedef void ModUpdateProc(void *param); virtual void setUpdateProc(ModUpdateProc *proc, void *param, int freq); virtual void clearUpdateProc(); // AudioStream API int readBuffer(int16 *buffer, const int numSamples) { do_mix(buffer, numSamples / 2); return numSamples; } uint getChannels() const { return 2; } bool endOfData() const { return false; } int getRate() const { return _sampleRate; } private: enum { MOD_MAXCHANS = 24 }; struct soundChan { int id; uint8 vol; int8 pan; uint16 freq; uint32 ctr; int16 pos; Audio::AudioStream *input; }; Audio::Mixer *_mixer; Audio::SoundHandle _soundHandle; uint32 _mixamt; uint32 _mixpos; const int _sampleRate; soundChan _channels[MOD_MAXCHANS]; uint8 _maxvol; virtual void do_mix(int16 *buf, uint len); ModUpdateProc *_playproc; void *_playparam; }; } // End of namespace Scumm #endif
#ifndef KFB_GENERAL_H #define KFB_GENERAL_H struct kfb_point general_print_char(char c, unsigned int i, unsigned int j, struct kfb_color fore_color, struct kfb_color bg_color, struct kfb_handle* handle); struct kfb_point general_print_str(const char* str, unsigned int x1, unsigned int x2, unsigned int y, struct kfb_color fore_color, struct kfb_color bg_color, int wrap_text, unsigned int wrap_start_x, struct kfb_handle* handle); void general_draw_rect(unsigned int x1, unsigned int y1, unsigned int x2,unsigned int y2, struct kfb_color border_color, unsigned int border_width, struct kfb_color fill_color, struct kfb_handle* handle); void general_fill_rect(unsigned int x1, unsigned int y1, unsigned int x2,unsigned int y2, struct kfb_color fill_color, struct kfb_handle* handle); void general_draw_hline(unsigned int x1, unsigned int x2, unsigned int y, struct kfb_color line_color, unsigned int width, struct kfb_handle* handle); void general_draw_vline(unsigned int x, unsigned int y1, unsigned int y2, struct kfb_color line_color, unsigned int width, struct kfb_handle* handle); #endif
/********************************************************************** * $Id$ * * PostGIS - Spatial Types for PostgreSQL * Copyright 2009 Paul Ramsey <pramsey@cleverelephant.ca> * * This is free software; you can redistribute and/or modify it under * the terms of the GNU General Public Licence. See the COPYING file. * **********************************************************************/ #include "liblwgeom_internal.h" extern int gbox_geocentric_slow; #define POW2(x) ((x)*(x)) /** * Point in spherical coordinates on the world. Units of radians. */ typedef struct { double lon; double lat; } GEOGRAPHIC_POINT; /** * Two-point great circle segment from a to b. */ typedef struct { GEOGRAPHIC_POINT start; GEOGRAPHIC_POINT end; } GEOGRAPHIC_EDGE; /** * Holder for sorting points in distance algorithm */ typedef struct { double measure; uint32_t index; } DISTANCE_ORDER; /** * Conversion functions */ #define deg2rad(d) (PI * (d) / 180.0) #define rad2deg(r) (180.0 * (r) / PI) /** * Ape a java function */ #define signum(a) ((a) < 0 ? -1 : ((a) > 0 ? 1 : (a))) /* * Geodetic calculations */ void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p); void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g); void robust_cross_product(const GEOGRAPHIC_POINT *p, const GEOGRAPHIC_POINT *q, POINT3D *a); void x_to_z(POINT3D *p); void y_to_z(POINT3D *p); int edge_point_on_plane(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p); int edge_point_in_cone(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p); int edge_contains_coplanar_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p); int edge_contains_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p); double z_to_latitude(double z, int top); int clairaut_cartesian(const POINT3D *start, const POINT3D *end, GEOGRAPHIC_POINT *g_top, GEOGRAPHIC_POINT *g_bottom); int clairaut_geographic(const GEOGRAPHIC_POINT *start, const GEOGRAPHIC_POINT *end, GEOGRAPHIC_POINT *g_top, GEOGRAPHIC_POINT *g_bottom); double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e); double sphere_distance_cartesian(const POINT3D *s, const POINT3D *e); int sphere_project(const GEOGRAPHIC_POINT *r, double distance, double azimuth, GEOGRAPHIC_POINT *n); int edge_calculate_gbox(const GEOGRAPHIC_EDGE *e, GBOX *gbox); int edge_calculate_gbox_slow(const GEOGRAPHIC_EDGE *e, GBOX *gbox); int edge_intersection(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *g); double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest); double edge_distance_to_edge(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *closest1, GEOGRAPHIC_POINT *closest2); void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g); int ptarray_point_in_ring_winding(const POINTARRAY *pa, const POINT2D *pt_to_test); int lwpoly_covers_point2d(const LWPOLY *poly, const POINT2D *pt_to_test); int ptarray_point_in_ring(const POINTARRAY *pa, const POINT2D *pt_outside, const POINT2D *pt_to_test); double ptarray_area_sphere(const POINTARRAY *pa, const POINT2D *pt_outside); double latitude_degrees_normalize(double lat); double longitude_degrees_normalize(double lon); double ptarray_length_spheroid(const POINTARRAY *pa, const SPHEROID *s); int geographic_point_equals(const GEOGRAPHIC_POINT *g1, const GEOGRAPHIC_POINT *g2); int crosses_dateline(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e); void point_shift(GEOGRAPHIC_POINT *p, double shift); double longitude_radians_normalize(double lon); double latitude_radians_normalize(double lat); /* ** Prototypes for spheroid functions. */ double spheroid_distance(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid); double spheroid_direction(const GEOGRAPHIC_POINT *r, const GEOGRAPHIC_POINT *s, const SPHEROID *spheroid); int spheroid_project(const GEOGRAPHIC_POINT *r, const SPHEROID *spheroid, double distance, double azimuth, GEOGRAPHIC_POINT *g);
#ifndef _MMC_CORE_SD_H #define _MMC_CORE_SD_H #include <linux/mmc/card.h> extern struct device_type sd_type; int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr); int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card); void mmc_decode_cid(struct mmc_card *card); int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card, bool reinit); unsigned mmc_sd_get_max_clock(struct mmc_card *card); int mmc_sd_switch_hs(struct mmc_card *card); void mmc_sd_go_highspeed(struct mmc_card *card); #endif
/* * This file is part of the syndication library * * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef TEST_TESTSYNDICATION_H #define TEST_TESTSYNDICATION_H #include "loader.h" #include <QtCore/QObject> class TestLibSyndication : public QObject { Q_OBJECT public: TestLibSyndication(const QString& url); public Q_SLOTS: void slotLoadingComplete(Syndication::Loader* loader, Syndication::FeedPtr feed, Syndication::ErrorCode error); }; #endif // TEST_TESTSYNDICATION_H
/* * This file is part of the coreboot project. * * Copyright (C) 2007 Advanced Micro Devices, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <stdint.h> #include <stdlib.h> #include <spd.h> #include <device/pci_def.h> #include <arch/io.h> #include <device/pnp_def.h> #include <console/console.h> #include <lib.h> #include <cpu/x86/bist.h> #include <cpu/x86/msr.h> #include <cpu/amd/lxdef.h> #include <cpu/amd/car.h> #include <southbridge/amd/cs5536/cs5536.h> #include <northbridge/amd/lx/raminit.h> #define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1) /* The ALIX1.C has no SMBus; the setup is hard-wired. */ static void cs5536_enable_smbus(void) { } #include "southbridge/amd/cs5536/early_setup.c" #include <superio/winbond/common/winbond.h> #include <superio/winbond/w83627hf/w83627hf.h> /* The part is a Hynix hy5du121622ctp-d43. * * HY 5D U 12 16 2 2 C <blank> T <blank> P D43 * Hynix * DDR SDRAM (5D) * VDD 2.5 VDDQ 2.5 (U) * 512M 8K REFRESH (12) * x16 (16) * 4banks (2) * SSTL_2 (2) * 4th GEN die (C) * Normal Power Consumption (<blank> ) * TSOP (T) * Single Die (<blank>) * Lead Free (P) * DDR400 3-3-3 (D43) */ /* SPD array */ static const u8 spdbytes[] = { [SPD_ACCEPTABLE_CAS_LATENCIES] = 0x10, [SPD_BANK_DENSITY] = 0x40, [SPD_DEVICE_ATTRIBUTES_GENERAL] = 0xff, [SPD_MEMORY_TYPE] = 7, [SPD_MIN_CYCLE_TIME_AT_CAS_MAX] = 10, /* A guess for the tRAC value */ [SPD_MODULE_ATTRIBUTES] = 0xff, /* FIXME later when we figure out. */ [SPD_NUM_BANKS_PER_SDRAM] = 4, [SPD_PRIMARY_SDRAM_WIDTH] = 8, [SPD_NUM_DIMM_BANKS] = 1, /* ALIX1.C is 1 bank. */ [SPD_NUM_COLUMNS] = 0xa, [SPD_NUM_ROWS] = 3, [SPD_REFRESH] = 0x3a, [SPD_SDRAM_CYCLE_TIME_2ND] = 60, [SPD_SDRAM_CYCLE_TIME_3RD] = 75, [SPD_tRAS] = 40, [SPD_tRCD] = 15, [SPD_tRFC] = 70, [SPD_tRP] = 15, [SPD_tRRD] = 10, }; int spd_read_byte(unsigned int device, unsigned int address) { printk(BIOS_DEBUG, "spd_read_byte dev %02x", device); if (device != DIMM0) { printk(BIOS_DEBUG, " returns 0xff\n"); return 0xff; } printk(BIOS_DEBUG, " addr %02x returns %02x\n", address, spdbytes[address]); return spdbytes[address]; } #include "northbridge/amd/lx/pll_reset.c" #include "lib/generic_sdram.c" #include "cpu/amd/geode_lx/cpureginit.c" #include "cpu/amd/geode_lx/syspreinit.c" #include "cpu/amd/geode_lx/msrinit.c" #include <cpu/intel/romstage.h> void main(unsigned long bist) { static const struct mem_controller memctrl[] = { {.channel0 = {DIMM0}}, }; SystemPreInit(); msr_init(); cs5536_early_setup(); /* NOTE: Must do this AFTER cs5536_early_setup()! * It is counting on some early MSR setup for the CS5536. */ cs5536_disable_internal_uart(); winbond_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); console_init(); /* Halt if there was a built in self test failure */ report_bist_failure(bist); pll_reset(); cpuRegInit(0, DIMM0, DIMM1, DRAM_TERMINATED); sdram_initialize(1, memctrl); /* Switch from Cache as RAM to real RAM. * * There are two ways we could think about this. * * 1. If we are using the romstage.inc ROMCC way, the stack is * going to be re-setup in the code following this code. Just * wbinvd the stack to clear the cache tags. We don't care * where the stack used to be. * * 2. This file is built as a normal .c -> .o and linked in * etc. The stack might be used to return etc. That means we * care about what is in the stack. If we are smart we set * the CAR stack to the same location as the rest of * coreboot. If that is the case we can just do a wbinvd. * The stack will be written into real RAM that is now setup * and we continue like nothing happened. If the stack is * located somewhere other than where LB would like it, you * need to write some code to do a copy from cache to RAM * * We use method 1 on Norwich and on this board too. */ post_code(0x02); printk(BIOS_ERR, "POST 02\n"); __asm__("wbinvd\n"); printk(BIOS_ERR, "Past wbinvd\n"); /* We are finding the return does not work on this board. Explicitly * call the label that is after the call to us. This is gross, but * sometimes at this level it is the only way out. */ done_cache_as_ram_main(); }
/* * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de> * economic rights: Technische Universität Dresden (Germany) * * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. * Please see the COPYING-GPL-2 file for details. */ #ifndef L4_CXX_UART_DUMMY_H__ #define L4_CXX_UART_DUMMY_H__ #include "uart_base.h" namespace L4 { class Uart_dummy : public Uart { public: bool startup(Io_register_block const *); void shutdown(); bool change_mode(Transfer_mode m, Baud_rate r); int get_char(bool blocking = true) const; int char_avail() const; inline void out_char(char c) const; int write(char const *s, unsigned long count) const; }; }; #endif
/* * WILL BE CHANGE TO VERSION2 LIBRARY * * * Redifei: E02_1 MPU6050 Library Example ****************************************************************************** * This file is part of Redifei Library. * * Redifei Library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Redifei Library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Redifei Library. If not, see <http://www.gnu.org/licenses/>. ****************************************************************************** */ #include <stdlib.h> #include <stm32f10x_conf.h> #include "systickTimer.h" #include "serialUart.h" #include "i2c.h" #include "timerPwm.h" #include "vcom.h" #include "mpu6050.h" serialUartPort_t* redSerial; void assert_failed(uint8_t* file, uint32_t line) { if(redSerial != NULL) redSerial->printf(redSerial, "Assert fail at File %s Line %d\r\n", file, (uint16_t)line); while(1); } int main(void) { systickTimerConfig(); // Init SerialPort red_serialUart_userSetting_t redSerialUserSetting = { .serialMode = RED_SERIAL_POLLING_MODE, .baudrate = 115200, .parity = USART_Parity_No, .stopbit = USART_StopBits_1, }; redSerial = redSerialUartInit(RED_SERIAL_UART_PORT_3, &redSerialUserSetting); // Config MPU6050 red_mpu6050_userSetting_t mpu6050UserSetting = { .i2cPortNum = RED_I2C_PORT_1, .i2cMode = RED_I2C_INTERRPUT_MODE, .i2cClockSpeed = 400000, .i2cTimeout = I2C_DEFAULT_TIMEOUT, }; red_mpu6050Port_t* redMpu6050 = redMpu6050Init(RED_MPU6050_1, &mpu6050UserSetting); redSerial->printf(redSerial, "Detected : 0x%x\r\n", myMPU->deviceAddr); delay(1000); while (1) { int16_t buf[3]; // Read Mpu6050 Acc 3 axis bool err = redMpu6050->accRead(redMpu6050, buf); redSerial->printf(redSerial, "%d, %d, %d | %d\r\n", buf[0], buf[1], buf[2], err); delay(100); } }
/* * Copyright (C) by Olivier Goffart <ogoffart@woboq.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ #pragma once #include <QObject> #include <QElapsedTimer> #include <QStringList> #include <csync.h> namespace Mirall { /** * The Discovery Phase was once called "update" phase in csync therms. * Its goal is to look at the files in one of the remote and check comared to the db * if the files are new, or changed. */ class DiscoveryJob : public QObject { Q_OBJECT CSYNC *_csync_ctx; csync_log_callback _log_callback; int _log_level; void* _log_userdata; QElapsedTimer lastUpdateProgressCallbackCall; /** * return true if the given path should be synced, * false if the path should be ignored */ bool isInBlackList(const QString &path) const; static int isInWhiteListCallBack(void *, const char *); static void update_job_update_callback (bool local, const char *dirname, void *userdata); public: explicit DiscoveryJob(CSYNC *ctx, QObject* parent = 0) : QObject(parent), _csync_ctx(ctx) { // We need to forward the log property as csync uses thread local // and updates run in another thread _log_callback = csync_get_log_callback(); _log_level = csync_get_log_level(); _log_userdata = csync_get_log_userdata(); } QStringList _selectiveSyncBlackList; Q_INVOKABLE void start(); signals: void finished(int result); void folderDiscovered(bool local, QString folderUrl); }; }
/** * @file * * @brief POSIX Key Private Support * * This include file contains all the private support information for * POSIX key. */ /* * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #ifndef _RTEMS_POSIX_KEY_H #define _RTEMS_POSIX_KEY_H #include <rtems/score/object.h> /** * @defgroup POSIX_KEY POSIX Key * * @ingroup POSIXAPI * */ /**@{**/ #ifdef __cplusplus extern "C" { #endif /** * This is the data Structure used to manage a POSIX key. * * NOTE: The Values is a table indexed by the index portion of the * ID of the currently executing thread. */ typedef struct { /** This field is the Object control structure. */ Objects_Control Object; /** This field points to the optional destructor method. */ void (*destructor)( void * ); /** This field points to the values per thread. */ void **Values[ OBJECTS_APIS_LAST + 1 ]; } POSIX_Keys_Control; /** * The following defines the information control block used to manage * this class of objects. */ POSIX_EXTERN Objects_Information _POSIX_Keys_Information; /** * @brief POSIX keys manager initialization. * * This routine performs the initialization necessary for this manager. */ void _POSIX_Key_Manager_initialization(void); /** * @brief Create thread-specific data POSIX key. * * This function executes all the destructors associated with the thread's * keys. This function will execute until all values have been set to NULL. * * @param[in] thread is a pointer to the thread whose keys should have * all their destructors run. * * NOTE: This is the routine executed when a thread exits to * run through all the keys and do the destructor action. */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ); /** * @brief Free a POSIX key table memory. * * This memory frees the key table memory associated with @a the_key. * * @param[in] the_key is a pointer to the POSIX key to free * the table memory of. */ void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ); /** * @brief Free a POSIX keys control block. * * This routine frees a keys control block to the * inactive chain of free keys control blocks. * * @param[in] the_key is a pointer to the POSIX key to free. */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ); #include <rtems/posix/key.inl> /** @} */ #ifdef __cplusplus } #endif #endif /* end of include file */
/* * NVRAM definitions and access functions. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _ASM_POWERPC_NVRAM_H #define _ASM_POWERPC_NVRAM_H #define NVRW_CNT 0x20 #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */ #define NVRAM_BLOCK_LEN 16 #define NVRAM_MAX_REQ (2080/NVRAM_BLOCK_LEN) #define NVRAM_MIN_REQ (1056/NVRAM_BLOCK_LEN) #define NVRAM_AS0 0x74 #define NVRAM_AS1 0x75 #define NVRAM_DATA 0x77 /* RTC Offsets */ #define MOTO_RTC_SECONDS 0x1FF9 #define MOTO_RTC_MINUTES 0x1FFA #define MOTO_RTC_HOURS 0x1FFB #define MOTO_RTC_DAY_OF_WEEK 0x1FFC #define MOTO_RTC_DAY_OF_MONTH 0x1FFD #define MOTO_RTC_MONTH 0x1FFE #define MOTO_RTC_YEAR 0x1FFF #define MOTO_RTC_CONTROLA 0x1FF8 #define MOTO_RTC_CONTROLB 0x1FF9 #define NVRAM_SIG_SP 0x02 /* support processor */ #define NVRAM_SIG_OF 0x50 /* open firmware config */ #define NVRAM_SIG_FW 0x51 /* general firmware */ #define NVRAM_SIG_HW 0x52 /* hardware (VPD) */ #define NVRAM_SIG_FLIP 0x5a /* Apple flip/flop header */ #define NVRAM_SIG_APPL 0x5f /* Apple "system" (???) */ #define NVRAM_SIG_SYS 0x70 /* system env vars */ #define NVRAM_SIG_CFG 0x71 /* config data */ #define NVRAM_SIG_ELOG 0x72 /* error log */ #define NVRAM_SIG_VEND 0x7e /* vendor defined */ #define NVRAM_SIG_FREE 0x7f /* Free space */ #define NVRAM_SIG_OS 0xa0 /* OS defined */ #define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */ /* If change this size, then change the size of NVNAME_LEN */ struct nvram_header { unsigned char signature; unsigned char checksum; unsigned short length; char name[12]; }; struct nvram_partition { struct list_head partition; struct nvram_header header; unsigned int index; }; extern int nvram_write_error_log(char * buff, int length, unsigned int err_type); extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type); extern int nvram_clear_error_log(void); extern struct nvram_partition *nvram_find_partition(int sig, const char *name); extern int pSeries_nvram_init(void); extern int mmio_nvram_init(void); /* PowerMac specific nvram stuffs */ enum { pmac_nvram_OF, /* Open Firmware partition */ pmac_nvram_XPRAM, /* MacOS XPRAM partition */ pmac_nvram_NR /* MacOS Name Registry partition */ }; /* Return partition offset in nvram */ extern int pmac_get_partition(int partition); /* Direct access to XPRAM on PowerMacs */ extern u8 pmac_xpram_read(int xpaddr); extern void pmac_xpram_write(int xpaddr, u8 data); /* Synchronize NVRAM */ extern void nvram_sync(void); /* Normal access to NVRAM */ extern unsigned char nvram_read_byte(int i); extern void nvram_write_byte(unsigned char c, int i); /* Some offsets in XPRAM */ #define PMAC_XPRAM_MACHINE_LOC 0xe4 #define PMAC_XPRAM_SOUND_VOLUME 0x08 /* Machine location structure in PowerMac XPRAM */ struct pmac_machine_location { unsigned int latitude; /* 2+30 bit Fractional number */ unsigned int longitude; /* 2+30 bit Fractional number */ unsigned int delta; /* mix of GMT delta and DLS */ }; /* * /dev/nvram ioctls * * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is * definitely obsolete. Do not use it if you can avoid it */ #define OBSOLETE_PMAC_NVRAM_GET_OFFSET \ _IOWR('p', 0x40, int) #define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */ #define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */ #endif /* _ASM_POWERPC_NVRAM_H */
/* * FIPS 200 support. * * Copyright (c) 2008 Neil Horman <nhorman@tuxdriver.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */ #include "internal.h" #include <crypto/sha.h> // in FIPS kernel build mode, we have sensible default settings #ifdef CONFIG_CRYPTO_FIPS int fips_enabled = 0; int fips_panic = 0; int fips_allow_others = 1; static u8 fips_ic[SHA1_DIGEST_SIZE]; #else int fips_enabled; int fips_panic; int fips_allow_others; static u8 *fips_ic = NULL; #endif EXPORT_SYMBOL_GPL(fips_enabled); EXPORT_SYMBOL_GPL(fips_panic); EXPORT_SYMBOL_GPL(fips_allow_others); // note: CC mode and FIPS mode are the same thing here; this exists // solely for legacy reasons, as does the handling of the cc_mode // parameter, which also turns FIPS mode on int get_cc_mode_state(void) { return fips_enabled; } EXPORT_SYMBOL_GPL(get_cc_mode_state); /* conversion routine to handle command line HMAC argument */ void hextobin(const char *str, u8 *bytes, size_t blen) { u8 pos; u8 idx0; u8 idx1; // mapping of ASCII characters to hex values const uint8_t hashmap[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // !"#$%&' 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ()*+,-./ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, // 01234567 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89:;<=>? 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, // @ABCDEFG 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // HIJKLMNO 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PQRSTUVW 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // XYZ[\]^_ 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, // `abcdefg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // hijklmno 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pqrstuvw 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // xyz{|}~. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // ........ }; memset(bytes, 0, blen); for (pos = 0; ((pos < (blen * 2)) && (pos < strlen(str))); pos += 2) { idx0 = (u8) str[pos + 0]; idx1 = (u8) str[pos + 1]; bytes[pos/2] = (u8) (hashmap[idx0] << 4) | hashmap[idx1]; }; } /* Process kernel command-line parameter at boot time. fips=0 or fips=1 */ static int fips_enable(char *str) { fips_enabled = !!simple_strtol(str, NULL, 0); printk(KERN_INFO "FIPS: FIPS capability %s\n", fips_enabled ? "enabled" : "disabled"); return 1; } static int cc_mode_enable(char *str) { return fips_enable(str); } static int fips_panic_enable(char *str) { fips_panic = !!simple_strtol(str, NULL, 0); printk(KERN_INFO "FIPS: panic on test fail %s\n", fips_panic ? "enabled" : "disabled"); return 1; } static int fips_allow_others_enable(char *str) { fips_allow_others = !!simple_strtol(str, NULL, 0); printk(KERN_INFO "FIPS: non-FIPS algorithms in FIPS mode %s\n", fips_allow_others ? "allowed" : "prohibited"); return 1; } #ifdef CONFIG_CRYPTO_FIPS static int fips_ic_set(char *str) { int i; if (strlen(str) != 2 * SHA1_DIGEST_SIZE) { printk(KERN_ERR "FIPS: invalid integrity check HMAC parameter %s" " (must be %d characters long)\n", str, 2 * SHA1_DIGEST_SIZE); memset(fips_ic, 0, SHA1_DIGEST_SIZE); } else { hextobin(str, fips_ic, SHA1_DIGEST_SIZE); printk(KERN_INFO "FIPS: FIPS expected integrity check HMAC = "); for (i = 0; i < SHA1_DIGEST_SIZE; i++) { printk(KERN_CONT "%02x", fips_ic[i]); } } return 1; } #else static int fips_ic_set(char *str) { printk(KERN_INFO "FIPS: integrity check argument ignored in non-FIPS kernel\n"); return 1; } #endif u8 *fips_ic_expected(void) { return (u8 *) fips_ic; } EXPORT_SYMBOL_GPL(fips_ic_expected); __setup("fips=", fips_enable); __setup("cc_mode=", cc_mode_enable); __setup("fips_panic=", fips_panic_enable); __setup("fips_allow_others=", fips_allow_others_enable); __setup("fips_ic=", fips_ic_set);
//============================================================================= // MuseScore // Music Composition & Notation // $Id: tempo.h 5574 2012-04-23 18:54:54Z wschweer $ // // Copyright (C) 2002-2011 Werner Schweer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 // as published by the Free Software Foundation and appearing in // the file LICENCE.GPL //============================================================================= #ifndef __AL_TEMPO_H__ #define __AL_TEMPO_H__ class Xml; enum TempoType { TEMPO_INVALID, TEMPO_FIX, TEMPO_RAMP }; //--------------------------------------------------------- // Tempo Event //--------------------------------------------------------- struct TEvent { TempoType type; qreal tempo; // beats per second qreal pause; // pause in seconds qreal time; // precomputed time for tick in sec TEvent(); TEvent(const TEvent& e); TEvent(qreal bps, qreal seconds, TempoType t); bool valid() const { return type != TEMPO_INVALID; } }; //--------------------------------------------------------- // Tempomap //--------------------------------------------------------- typedef std::map<int, TEvent>::iterator iTEvent; typedef std::map<int, TEvent>::const_iterator ciTEvent; typedef std::map<int, TEvent>::reverse_iterator riTEvent; typedef std::map<int, TEvent>::const_reverse_iterator criTEvent; class TempoMap : public std::map<int, TEvent> { int _tempoSN; // serial no to track tempo changes qreal _tempo; // tempo if not using tempo list (beats per second) qreal _relTempo; // rel. tempo void normalize(); void del(int tick); public: TempoMap(); void clear(); void dump() const; qreal tempo(int tick) const; qreal tick2time(int tick, int* sn = 0) const; qreal tick2timeLC(int tick, int* sn) const; qreal tick2time(int tick, qreal time, int* sn) const; int time2tick(qreal time, int* sn = 0) const; int time2tick(qreal time, int tick, int* sn) const; int tempoSN() const { return _tempoSN; } void setTempo(int t, qreal); void setPause(int t, qreal); void delTempo(int tick); void setRelTempo(qreal val); qreal relTempo() const { return _relTempo; } }; #endif
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2005,2006,2007 INRIA * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> */ #ifndef WIFI_REMOTE_STATION_INFO_H #define WIFI_REMOTE_STATION_INFO_H #include "ns3/nstime.h" #include "ns3/uinteger.h" namespace ns3 { /** * \brief Tid independent remote station statistics * * Structure is similar to struct sta_info in Linux kernel (see * net/mac80211/sta_info.h) */ class WifiRemoteStationInfo { public: WifiRemoteStationInfo (); virtual ~WifiRemoteStationInfo (); /** * \brief Updates average frame error rate when data or RTS was transmitted successfully. * * \param retryCounter is slrc or ssrc value at the moment of success transmission. */ void NotifyTxSuccess (uint32_t retryCounter); /// Updates average frame error rate when final data or RTS has failed. void NotifyTxFailed (); /** * Return frame error rate (probability that frame is corrupted due to transmission error). * \returns the frame error rate */ double GetFrameErrorRate () const; private: /** * \brief Calculate averaging coefficient for frame error rate. Depends on time of the last update. * * \attention Calling this method twice gives different results, * because it resets time of last update. * * \return average coefficient for frame error rate */ double CalculateAveragingCoefficient (); /// averaging coefficient depends on the memory time Time m_memoryTime; /// when last update has occurred Time m_lastUpdate; /// moving percentage of failed frames double m_failAvg; }; } //namespace ns3 #endif /* WIFI_REMOTE_STATION_INFO_H */
/* * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* * Definitions for VL6180 sensor chip. */ #ifndef __VL6180_H__ #define __VL6180_H__ #include <linux/ioctl.h> #define VL6180_SUCCESS (0) #define VL6180_ERR_I2C (-1) #define VL6180_ERR_STATUS (-3) #define VL6180_ERR_SETUP_FAILURE (-4) #define VL6180_ERR_GETGSENSORDATA (-5) #define VL6180_ERR_IDENTIFICATION (-6) #define VL6180_ERR (-1) #define IRAF_I2C_BUS_NUM (1) #define VL6180_REG_ID 0x000 #define VL6180_REG_MODE 0x0018 #define VL6180_REG_PART_TO_PART 0x0024 #define VL6180_REG_IGNORE_THRESHOLD 0x0026 #define VL6180_REG_BLOCK_THRESHOLD 0x0028 #define VL6180_REG_RANGE_AMB_HIGH 0x00DA #define VL6180_REG_RANGE_AMB_LOW 0x00DC #define VL6180_CHIP_ID 0x00B4 #define VL6180_REG_RANGE_VALUE 0x0062 #define VL6180_REG_RAW_VALUE 0x0064 #define VL6180_REG_RETURN_RATE 0x0066 #define IRAFMAGIC 'i' #define KDIRAFIOC_T_OPEN _IOWR(IRAFMAGIC, 0, int) #define KDIRAFIOC_T_CLOSE _IOWR(IRAFMAGIC, 5, int) #define KDIRAFIOC_T_ENABLE _IOWR(IRAFMAGIC, 10, int) #define KDIRAFIOC_T_GET_RANGE _IOWR(IRAFMAGIC, 15, int) #define KDIRAFIOC_T_RESET _IOWR(IRAFMAGIC, 20, int) #define KDIRAFIOC_T_CALIBRATION _IOWR(IRAFMAGIC, 25, int) #define KDIRAFIOC_T_FACTORY_TEST _IOWR(IRAFMAGIC, 30, int) #endif
/** * @file dnssrv.h */ /* purple * * Copyright (C) 2005, Thomas Butter <butter@uni-mannheim.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #ifndef _PURPLE_DNSSRV_H #define _PURPLE_DNSSRV_H #ifdef __cplusplus extern "C" { #endif typedef struct _PurpleSrvQueryData PurpleSrvQueryData; typedef struct _PurpleSrvResponse PurpleSrvResponse; typedef struct _PurpleTxtResponse PurpleTxtResponse; #include <glib.h> struct _PurpleSrvResponse { char hostname[256]; int port; int weight; int pref; }; /** * @param resp An array of PurpleSrvResponse of size results. The array * is sorted based on the order described in the DNS SRV RFC. * Users of this API should try each record in resp in order, * starting at the beginning. */ typedef void (*PurpleSrvCallback)(PurpleSrvResponse *resp, int results, gpointer data); /** * Callback that returns the data retrieved from a DNS TXT lookup. * * @param responses A GList of PurpleTxtResponse objects. * @param data The extra data passed to purple_txt_resolve. */ typedef void (*PurpleTxtCallback)(GList *responses, gpointer data); /** * Queries an SRV record. * * @param protocol Name of the protocol (e.g. "sip") * @param transport Name of the transport ("tcp" or "udp") * @param domain Domain name to query (e.g. "blubb.com") * @param cb A callback which will be called with the results * @param extradata Extra data to be passed to the callback */ PurpleSrvQueryData *purple_srv_resolve(const char *protocol, const char *transport, const char *domain, PurpleSrvCallback cb, gpointer extradata); /** * Cancel an SRV DNS query. * * @param query_data The request to cancel. */ void purple_srv_cancel(PurpleSrvQueryData *query_data); /** * Queries an TXT record. * * @param owner Name of the protocol (e.g. "_xmppconnect") * @param domain Domain name to query (e.g. "blubb.com") * @param cb A callback which will be called with the results * @param extradata Extra data to be passed to the callback * * @since 2.6.0 */ PurpleSrvQueryData *purple_txt_resolve(const char *owner, const char *domain, PurpleTxtCallback cb, gpointer extradata); /** * Cancel an TXT DNS query. * * @param query_data The request to cancel. * @since 2.6.0 */ void purple_txt_cancel(PurpleSrvQueryData *query_data); /** * Get the value of the current TXT record. * * @param response The TXT response record * @returns The value of the current TXT record. * @since 2.6.0 */ const gchar *purple_txt_response_get_content(PurpleTxtResponse *response); /** * Destroy a TXT DNS response object. * * @param response The PurpleTxtResponse to destroy. * @since 2.6.0 */ void purple_txt_response_destroy(PurpleTxtResponse *response); #ifdef __cplusplus } #endif #endif /* _PURPLE_DNSSRV_H */
/* * Human Monitor Interface * * Copyright IBM, Corp. 2011 * * Authors: * Anthony Liguori <aliguori@us.ibm.com> * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. * */ #ifndef HMP_H #define HMP_H #include "qemu-common.h" #include "qapi-types.h" #include "qapi/qmp/qdict.h" void hmp_info_name(Monitor *mon, const QDict *qdict); void hmp_info_version(Monitor *mon, const QDict *qdict); void hmp_info_kvm(Monitor *mon, const QDict *qdict); void hmp_info_status(Monitor *mon, const QDict *qdict); void hmp_info_uuid(Monitor *mon, const QDict *qdict); void hmp_info_chardev(Monitor *mon, const QDict *qdict); void hmp_info_mice(Monitor *mon, const QDict *qdict); void hmp_info_migrate(Monitor *mon, const QDict *qdict); void hmp_info_migrate_capabilities(Monitor *mon, const QDict *qdict); void hmp_info_migrate_cache_size(Monitor *mon, const QDict *qdict); void hmp_info_cpus(Monitor *mon, const QDict *qdict); void hmp_info_block(Monitor *mon, const QDict *qdict); void hmp_info_blockstats(Monitor *mon, const QDict *qdict); void hmp_info_vnc(Monitor *mon, const QDict *qdict); void hmp_info_spice(Monitor *mon, const QDict *qdict); void hmp_info_balloon(Monitor *mon, const QDict *qdict); void hmp_info_pci(Monitor *mon, const QDict *qdict); void hmp_info_block_jobs(Monitor *mon, const QDict *qdict); void hmp_quit(Monitor *mon, const QDict *qdict); void hmp_stop(Monitor *mon, const QDict *qdict); void hmp_system_reset(Monitor *mon, const QDict *qdict); void hmp_system_powerdown(Monitor *mon, const QDict *qdict); void hmp_cpu(Monitor *mon, const QDict *qdict); void hmp_memsave(Monitor *mon, const QDict *qdict); void hmp_pmemsave(Monitor *mon, const QDict *qdict); void hmp_cont(Monitor *mon, const QDict *qdict); void hmp_system_wakeup(Monitor *mon, const QDict *qdict); void hmp_inject_nmi(Monitor *mon, const QDict *qdict); void hmp_set_link(Monitor *mon, const QDict *qdict); void hmp_block_passwd(Monitor *mon, const QDict *qdict); void hmp_balloon(Monitor *mon, const QDict *qdict); void hmp_block_resize(Monitor *mon, const QDict *qdict); void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict); void hmp_drive_mirror(Monitor *mon, const QDict *qdict); void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict); void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict); void hmp_set_password(Monitor *mon, const QDict *qdict); void hmp_expire_password(Monitor *mon, const QDict *qdict); void hmp_eject(Monitor *mon, const QDict *qdict); void hmp_change(Monitor *mon, const QDict *qdict); void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict); void hmp_block_stream(Monitor *mon, const QDict *qdict); void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict); void hmp_block_job_cancel(Monitor *mon, const QDict *qdict); void hmp_block_job_pause(Monitor *mon, const QDict *qdict); void hmp_block_job_resume(Monitor *mon, const QDict *qdict); void hmp_block_job_complete(Monitor *mon, const QDict *qdict); void hmp_migrate(Monitor *mon, const QDict *qdict); void hmp_device_del(Monitor *mon, const QDict *qdict); void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict); void hmp_netdev_add(Monitor *mon, const QDict *qdict); void hmp_netdev_del(Monitor *mon, const QDict *qdict); void hmp_getfd(Monitor *mon, const QDict *qdict); void hmp_closefd(Monitor *mon, const QDict *qdict); void hmp_send_key(Monitor *mon, const QDict *qdict); void hmp_screen_dump(Monitor *mon, const QDict *qdict); void hmp_nbd_server_start(Monitor *mon, const QDict *qdict); void hmp_nbd_server_add(Monitor *mon, const QDict *qdict); void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict); void hmp_chardev_add(Monitor *mon, const QDict *qdict); void hmp_chardev_remove(Monitor *mon, const QDict *qdict); #endif
/* flexNES - Flexible NAT Emulation Software Copyright (C) 2008, Jeremy Beker <gothmog@confusticate.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef FN_STRUCTURES_H // one-time include #define FN_STRUCTURES_H #include <string> typedef struct _udp_packet_tuple { uint32_t src_ip; uint16_t src_port; uint32_t dest_ip; uint16_t dest_port; } udp_packet_tuple; typedef struct _tcp_packet_tuple { uint32_t src_ip; uint16_t src_port; uint32_t dest_ip; uint16_t dest_port; } tcp_packet_tuple; typedef struct _icmp_packet_tuple { uint32_t src_ip; uint32_t dest_ip; } icmp_packet_tuple; typedef struct _nat_map_entry { // char entry_id[64]; std::string in_interface; std::string out_interface; uint16_t protocol; time_t activity; union { udp_packet_tuple inside_udp; tcp_packet_tuple inside_tcp; icmp_packet_tuple inside_icmp; }; union { udp_packet_tuple outside_udp; tcp_packet_tuple outside_tcp; icmp_packet_tuple outside_icmp; }; // expiration timestamp } nat_map_entry; #endif
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include "sd-bus.h" #include "hashmap.h" enum bus_match_node_type { BUS_MATCH_ROOT, BUS_MATCH_VALUE, BUS_MATCH_LEAF, /* The following are all different kinds of compare nodes */ BUS_MATCH_SENDER, BUS_MATCH_MESSAGE_TYPE, BUS_MATCH_DESTINATION, BUS_MATCH_INTERFACE, BUS_MATCH_MEMBER, BUS_MATCH_PATH, BUS_MATCH_PATH_NAMESPACE, BUS_MATCH_ARG, BUS_MATCH_ARG_LAST = BUS_MATCH_ARG + 63, BUS_MATCH_ARG_PATH, BUS_MATCH_ARG_PATH_LAST = BUS_MATCH_ARG_PATH + 63, BUS_MATCH_ARG_NAMESPACE, BUS_MATCH_ARG_NAMESPACE_LAST = BUS_MATCH_ARG_NAMESPACE + 63, BUS_MATCH_ARG_HAS, BUS_MATCH_ARG_HAS_LAST = BUS_MATCH_ARG_HAS + 63, _BUS_MATCH_NODE_TYPE_MAX, _BUS_MATCH_NODE_TYPE_INVALID = -1 }; struct bus_match_node { enum bus_match_node_type type; struct bus_match_node *parent, *next, *prev, *child; union { struct { char *str; uint8_t u8; } value; struct { struct match_callback *callback; } leaf; struct { /* If this is set, then the child is NULL */ Hashmap *children; } compare; }; }; struct bus_match_component { enum bus_match_node_type type; uint8_t value_u8; char *value_str; }; enum bus_match_scope { BUS_MATCH_GENERIC, BUS_MATCH_LOCAL, BUS_MATCH_DRIVER, }; int bus_match_run(sd_bus *bus, struct bus_match_node *root, sd_bus_message *m); int bus_match_add(struct bus_match_node *root, struct bus_match_component *components, unsigned n_components, struct match_callback *callback); int bus_match_remove(struct bus_match_node *root, struct match_callback *callback); void bus_match_free(struct bus_match_node *node); void bus_match_dump(struct bus_match_node *node, unsigned level); const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[], size_t l); enum bus_match_node_type bus_match_node_type_from_string(const char *k, size_t n); int bus_match_parse(const char *match, struct bus_match_component **_components, unsigned *_n_components); void bus_match_parse_free(struct bus_match_component *components, unsigned n_components); char *bus_match_to_string(struct bus_match_component *components, unsigned n_components); enum bus_match_scope bus_match_get_scope(const struct bus_match_component *components, unsigned n_components);
/* mersenne.h Mersenne Twister PRNG Copyright (C) 2013 Bill Currie <bill@taniwha.org> Author: Bill Currie <bill@taniwha.org> Date: 2013/01/21 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to: Free Software Foundation, Inc. 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA */ #ifndef __QF_mersenne_h #define __QF_mersenne_h #include "QF/qtypes.h" #define MT_STATE_SIZE 624 typedef struct { uint32_t state[MT_STATE_SIZE]; int index; } mtstate_t; void mtwist_seed (mtstate_t *state, uint32_t seed); uint32_t mtwist_rand (mtstate_t *state); #endif//__QF_mersenne_h
#ifndef INCLUDE_FILES_H #define INCLUDE_FILES_H #include<hashedstring.h> typedef HashedStringSet IncludeFiles; class PathFileSearch { public: private: }; #endif
/* * Copyright (c) 2002, 2012 Jens Keiner, Stefan Kunis, Daniel Potts * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* $Id: doxygen.c 3100 2009-03-12 08:42:48Z keiner $ */ /** * \defgroup applications_mri2d 2D transforms * \ingroup applications_mri */
/* * This is the source code of Telegram for iOS v. 1.1 * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Peter Iakovlev, 2013. */ #import "TGActor.h" #import "ASWatcher.h" #import "TGTelegraphProtocols.h" #import "TLMetaScheme.h" @interface TGTimelineUploadPhotoRequestBuilder : TGActor <ASWatcher> @property (nonatomic, strong) ASHandle *actionHandle; @property (nonatomic, strong) id currentPhoto; @property (nonatomic, strong) id currentLoginBigPhoto; - (void)timelineUploadPhotoSuccess:(TLphotos_Photo *)photo; - (void)timelineUploadPhotoFailed; @end
// // BFInfoSettingsItemsTableViewCellExtension.h // OpenShop // // Created by Jirka Apps // Copyright (c) 2015 Business Factory. All rights reserved. // #import "BFBaseTableViewCellExtension.h" #import "BFInfoPage.h" NS_ASSUME_NONNULL_BEGIN /** * `BFInfoSettingsItemsTableViewCellExtension` manages info settings items displaying in a table view. */ @interface BFInfoSettingsItemsTableViewCellExtension : BFBaseTableViewCellExtension /** * Info pages data source. */ @property (nonatomic, strong) NSArray<BFInfoPage *> *infoPages; /** * Refreshes extension's data source. */ - (void)refreshDataSource; @end NS_ASSUME_NONNULL_END
/* * Copyright (c) 2014 Dmitry Kazakov <dimula73@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __KIS_BSPLINES_TEST_H #define __KIS_BSPLINES_TEST_H #include <QtTest> class KisBSplinesTest : public QObject { Q_OBJECT private Q_SLOTS: void test1D(); void testEmpty1D(); void test2D(); void testEmpty2D(); void testNU2D(); }; #endif /* __KIS_BSPLINES_TEST_H */
/* * Caja-Actions * A Caja extension which offers configurable context menu actions. * * Copyright (C) 2005 The GNOME Foundation * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS) * Copyright (C) 2009-2012 Pierre Wieser and others (see AUTHORS) * * Caja-Actions 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. * * Caja-Actions 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 Caja-Actions; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * * Authors: * Frederic Ruaudel <grumz@grumz.net> * Rodrigo Moya <rodrigo@mate-db.org> * Pierre Wieser <pwieser@trychlos.org> * ... and many others (see AUTHORS) */ #ifndef __CORE_NA_IPREFS_H__ #define __CORE_NA_IPREFS_H__ /* * Starting with 3.1.0, NAIPrefs interface is deprecated. * * Instead, this module is used as an intermediate level between actual * settings and the application; it so implements all maps needed to * transform an enum used in the code to and from a string stored in * preferences. */ #include "na-pivot.h" G_BEGIN_DECLS /* sort mode of the items in the file manager context menu */ enum { IPREFS_ORDER_ALPHA_ASCENDING = 1, /* default */ IPREFS_ORDER_ALPHA_DESCENDING, IPREFS_ORDER_MANUAL }; guint na_iprefs_get_order_mode ( gboolean *mandatory ); guint na_iprefs_get_order_mode_by_label( const gchar *label ); void na_iprefs_set_order_mode ( guint mode ); guint na_iprefs_get_tabs_pos ( gboolean *mandatory ); void na_iprefs_set_tabs_pos ( guint pos ); gboolean na_iprefs_write_level_zero ( const GList *items, GSList **messages ); G_END_DECLS #endif /* __CORE_NA_IPREFS_H__ */
#pragma once /* * Copyright (C) 2012-2013 Team XBMC * http://xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include <map> #include <utility> #include <vector> #include "input/Key.h" #include "interfaces/IActionListener.h" #include "settings/lib/ISettingCallback.h" #include "threads/CriticalSection.h" #include "utils/Stopwatch.h" enum SeekType { SEEK_TYPE_VIDEO = 0, SEEK_TYPE_MUSIC = 1 }; class CSeekHandler : public ISettingCallback, public IActionListener { public: static CSeekHandler& GetInstance(); static void SettingOptionsSeekStepsFiller(std::shared_ptr<const CSetting> setting, std::vector< std::pair<std::string, int> > &list, int &current, void *data); virtual void OnSettingChanged(std::shared_ptr<const CSetting> setting) override; virtual bool OnAction(const CAction &action) override; void Seek(bool forward, float amount, float duration = 0, bool analogSeek = false, SeekType type = SEEK_TYPE_VIDEO); void SeekSeconds(int seconds); void FrameMove(); void Reset(); void Configure(); int GetSeekSize() const; bool InProgress() const; bool HasTimeCode() const { return m_timeCodePosition > 0; } int GetTimeCodeSeconds() const; protected: CSeekHandler(); CSeekHandler(const CSeekHandler&); CSeekHandler& operator=(CSeekHandler const&); virtual ~CSeekHandler(); bool SeekTimeCode(const CAction &action); void ChangeTimeCode(int remote); private: static const int analogSeekDelay = 500; int GetSeekStepSize(SeekType type, int step); int m_seekDelay; std::map<SeekType, int > m_seekDelays; bool m_requireSeek; bool m_seekChanged = false; bool m_analogSeek; double m_seekSize; int m_seekStep; std::map<SeekType, std::vector<int> > m_forwardSeekSteps; std::map<SeekType, std::vector<int> > m_backwardSeekSteps; CStopWatch m_timer; CStopWatch m_timerTimeCode; int m_timeCodeStamp[6]; int m_timeCodePosition; CCriticalSection m_critSection; };
#ifndef MUI_TEXT_H #define MUI_TEXT_H enum { UI_comp1 = UI_last_mame_entry, UI_comp2, UI_keyb1, UI_keyb2, UI_keyb3, UI_keyb4, UI_keyb5, UI_keyb6, UI_keyb7, UI_imageinfo, UI_filemanager, UI_tapecontrol, UI_notapeimageloaded, UI_recording, UI_playing, UI_recording_inhibited, UI_playing_inhibited, UI_stopped, UI_pauseorstop, UI_record, UI_play, UI_rewind, UI_fastforward, UI_mount, UI_create, UI_unmount, UI_emptyslot, UI_configuration, UI_categories, UI_quitfileselector, UI_filespecification, /* IMPORTANT: be careful to ensure that the following */ UI_cartridge, /* device list matches the order found in device.h */ UI_floppydisk, /* and is ALWAYS placed after UI_filespecification */ UI_harddisk, UI_cylinder, UI_cassette, UI_punchcard, UI_punchtape, UI_printer, UI_serial, UI_parallel, UI_snapshot, UI_quickload, UI_memcard, UI_cdrom }; #endif /* MUI_TEXT_H */
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <assert.h> #include <exception> // System.Runtime.Remoting.ChannelData struct ChannelData_t1145; // System.Collections.ArrayList struct ArrayList_t399; // System.Collections.Hashtable struct Hashtable_t390; #include "codegen/il2cpp-codegen.h" // System.Void System.Runtime.Remoting.ChannelData::.ctor() extern "C" void ChannelData__ctor_m6497 (ChannelData_t1145 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.ArrayList System.Runtime.Remoting.ChannelData::get_ServerProviders() extern "C" ArrayList_t399 * ChannelData_get_ServerProviders_m6498 (ChannelData_t1145 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.ArrayList System.Runtime.Remoting.ChannelData::get_ClientProviders() extern "C" ArrayList_t399 * ChannelData_get_ClientProviders_m6499 (ChannelData_t1145 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.Hashtable System.Runtime.Remoting.ChannelData::get_CustomProperties() extern "C" Hashtable_t390 * ChannelData_get_CustomProperties_m6500 (ChannelData_t1145 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Remoting.ChannelData::CopyFrom(System.Runtime.Remoting.ChannelData) extern "C" void ChannelData_CopyFrom_m6501 (ChannelData_t1145 * __this, ChannelData_t1145 * ___other, const MethodInfo* method) IL2CPP_METHOD_ATTR;
/* * (C) Copyright 2015 Google, Inc * Written by Simon Glass <sjg@chromium.org> * * SPDX-License-Identifier: GPL-2.0+ * * Helper functions for Rockchip images */ #include "imagetool.h" #include <image.h> #include <rc4.h> #include "mkimage.h" #include "rkcommon.h" enum { RK_SIGNATURE = 0x0ff0aa55, }; /** * struct header0_info - header block for boot ROM * * This is stored at SD card block 64 (where each block is 512 bytes, or at * the start of SPI flash. It is encoded with RC4. * * @signature: Signature (must be RKSD_SIGNATURE) * @disable_rc4: 0 to use rc4 for boot image, 1 to use plain binary * @code1_offset: Offset in blocks of the SPL code from this header * block. E.g. 4 means 2KB after the start of this header. * Other fields are not used by U-Boot */ struct header0_info { uint32_t signature; uint8_t reserved[4]; uint32_t disable_rc4; uint16_t code1_offset; uint16_t code2_offset; uint8_t reserved1[490]; uint16_t usflashdatasize; uint16_t ucflashbootsize; uint8_t reserved2[2]; }; static unsigned char rc4_key[16] = { 124, 78, 3, 4, 85, 5, 9, 7, 45, 44, 123, 56, 23, 13, 23, 17 }; int rkcommon_set_header(void *buf, uint file_size) { struct header0_info *hdr; if (file_size > RK_MAX_CODE1_SIZE) return -ENOSPC; memset(buf, '\0', RK_CODE1_OFFSET * RK_BLK_SIZE); hdr = (struct header0_info *)buf; hdr->signature = RK_SIGNATURE; hdr->disable_rc4 = 1; hdr->code1_offset = RK_CODE1_OFFSET; hdr->code2_offset = 8; hdr->usflashdatasize = (file_size + RK_BLK_SIZE - 1) / RK_BLK_SIZE; hdr->usflashdatasize = (hdr->usflashdatasize + 3) & ~3; hdr->ucflashbootsize = hdr->usflashdatasize; debug("size=%x, %x\n", params->file_size, hdr->usflashdatasize); rc4_encode(buf, RK_BLK_SIZE, rc4_key); return 0; }
/********************************************************************** * * PostGIS - Spatial Types for PostgreSQL * http://postgis.net * * Copyright 2011 Sandro Santilli <strk@keybit.net> * Copyright 2008 Paul Ramsey <pramsey@cleverelephant.ca> * Copyright 2007-2008 Mark Cave-Ayland * Copyright 2001-2006 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU General Public Licence. See the COPYING file. * ********************************************************************** * * Internal logging routines * **********************************************************************/ #ifndef LWGEOM_LOG_H #define LWGEOM_LOG_H 1 #include <stdarg.h> /* * Debug macros */ #if POSTGIS_DEBUG_LEVEL > 0 /* Display a notice at the given debug level */ #define LWDEBUG(level, msg) \ do { \ if (POSTGIS_DEBUG_LEVEL >= level) \ lwnotice("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__); \ } while (0); /* Display a formatted notice at the given debug level * (like printf, with variadic arguments) */ #define LWDEBUGF(level, msg, ...) \ do { \ if (POSTGIS_DEBUG_LEVEL >= level) \ lwnotice("[%s:%s:%d] " msg, \ __FILE__, __func__, __LINE__, __VA_ARGS__); \ } while (0); #else /* POSTGIS_DEBUG_LEVEL <= 0 */ /* Empty prototype that can be optimised away by the compiler * for non-debug builds */ #define LWDEBUG(level, msg) \ ((void) 0) /* Empty prototype that can be optimised away by the compiler * for non-debug builds */ #define LWDEBUGF(level, msg, ...) \ ((void) 0) #endif /* POSTGIS_DEBUG_LEVEL <= 0 */ #endif /* LWGEOM_LOG_H */
#pragma once /* * MinizipExtensions.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #ifdef USE_SYSTEM_MINIZIP #include <minizip/unzip.h> #include <minizip/zip.h> #include <minizip/ioapi.h> #else #include "../minizip/unzip.h" #include "../minizip/zip.h" #include "../minizip/ioapi.h" #endif class CInputStream; class CInputOutputStream; class CMemoryBuffer; class DLL_LINKAGE CIOApi { public: virtual ~CIOApi(){}; virtual zlib_filefunc64_def getApiStructure() = 0; }; ///redirects back to minizip ioapi //todo: replace with Virtual FileSystem interface class DLL_LINKAGE CDefaultIOApi: public CIOApi { public: CDefaultIOApi(); ~CDefaultIOApi(); zlib_filefunc64_def getApiStructure() override; }; ///redirects all file IO to single stream class DLL_LINKAGE CProxyIOApi: public CIOApi { public: CProxyIOApi(CInputOutputStream * buffer); ~CProxyIOApi(); zlib_filefunc64_def getApiStructure() override; private: CInputOutputStream * openFile(const boost::filesystem::path & filename, int mode); CInputOutputStream * data; static voidpf ZCALLBACK openFileProxy(voidpf opaque, const void * filename, int mode); static uLong ZCALLBACK readFileProxy(voidpf opaque, voidpf stream, void * buf, uLong size); static uLong ZCALLBACK writeFileProxy(voidpf opaque, voidpf stream, const void * buf, uLong size); static ZPOS64_T ZCALLBACK tellFileProxy(voidpf opaque, voidpf stream); static long ZCALLBACK seekFileProxy(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin); static int ZCALLBACK closeFileProxy(voidpf opaque, voidpf stream); static int ZCALLBACK errorFileProxy(voidpf opaque, voidpf stream); }; ///redirects all file IO to single stream read-only class DLL_LINKAGE CProxyROIOApi: public CIOApi { public: CProxyROIOApi(CInputStream * buffer); ~CProxyROIOApi(); zlib_filefunc64_def getApiStructure() override; private: CInputStream * openFile(const boost::filesystem::path & filename, int mode); CInputStream * data; static voidpf ZCALLBACK openFileProxy(voidpf opaque, const void * filename, int mode); static uLong ZCALLBACK readFileProxy(voidpf opaque, voidpf stream, void * buf, uLong size); static uLong ZCALLBACK writeFileProxy(voidpf opaque, voidpf stream, const void * buf, uLong size); static ZPOS64_T ZCALLBACK tellFileProxy(voidpf opaque, voidpf stream); static long ZCALLBACK seekFileProxy(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin); static int ZCALLBACK closeFileProxy(voidpf opaque, voidpf stream); static int ZCALLBACK errorFileProxy(voidpf opaque, voidpf stream); };
/* Wand Project - Ethernet Over UDP * $Id: daemons.h,v 1.4 2002/11/30 10:07:50 jimmyish Exp $ * Licensed under the GPL, see file COPYING in the top level for more * details. */ #ifndef DAEMONS_H #define DAEMONS_H #ifdef __cplusplus extern "C" { #endif void put_pid( char *fname ); void daemonise( char *name ) ; extern int daemonised; #ifdef __cplusplus } #endif #endif /* DEAMONS_H */
/* testIO.c */ #include "../Coords.h" #include "../../timings.h" /*--------------------------------------------------------------------*/ int main ( int argc, char *argv[] ) /* -------------------------------------------------- test Coords_readFromFile and Coords_writeToFile, useful for translating between formatted *.coordsf and binary *.coordsb files. created -- 95dec17, cca -------------------------------------------------- */ { int msglvl, rc ; Coords coords ; FILE *msgFile ; if ( argc != 5 ) { fprintf(stdout, "\n\n usage : testIO msglvl msgFile inFile outFile" "\n msglvl -- message level" "\n msgFile -- message file" "\n inFile -- input file, must be *.coordsf or *.coordsb" "\n outFile -- output file, must be *.coordsf or *.coordsb" "\n") ; return(0) ; } msglvl = atoi(argv[1]) ; if ( strcmp(argv[2], "stdout") == 0 ) { msgFile = stdout ; } else if ( (msgFile = fopen(argv[2], "a")) == NULL ) { fprintf(stderr, "\n fatal error in %s" "\n unable to open file %s\n", argv[0], argv[2]) ; return(-1) ; } fprintf(msgFile, "\n testIO " "\n msglvl -- %d" "\n msgFile -- %s" "\n inFile -- %s" "\n outFile -- %s" "\n", msglvl, argv[2], argv[3], argv[4]) ; fflush(msgFile) ; /* ---------------------- set the default fields ---------------------- */ Coords_setDefaultFields(&coords) ; if ( msglvl > 1 ) { fprintf(msgFile, "\n\n after setting default fields") ; Coords_writeForHumanEye(&coords, msgFile) ; fflush(msgFile) ; } /* ------------------------- read in the Coords object ------------------------- */ if ( strcmp(argv[3], "none") == 0 ) { fprintf(msgFile, "\n no file to read from\n") ; exit(0) ; } rc = Coords_readFromFile(&coords, argv[3]) ; fprintf(msgFile, "\n return value %d from Coords_readFromFile(%p,%s)", rc, &coords, argv[3]) ; if ( rc != 1 ) { exit(-1) ; } if ( msglvl > 1 ) { fprintf(msgFile, "\n\n after reading Coords object from file %s", argv[3]) ; Coords_writeForHumanEye(&coords, msgFile) ; fflush(msgFile) ; } /* --------------------------- write out the Coords object --------------------------- */ if ( strcmp(argv[4], "none") != 0 ) { rc = Coords_writeToFile(&coords, argv[4]) ; fprintf(msgFile, "\n return value %d from Coords_writeToFile(%p,%s)", rc, &coords, argv[4]) ; } fprintf(msgFile, "\n") ; fclose(msgFile) ; return(1) ; } /*--------------------------------------------------------------------*/
/* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2013 Company 100, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CoordinatedLayerTreeHostProxy_h #define CoordinatedLayerTreeHostProxy_h #if USE(COORDINATED_GRAPHICS) #include "CoordinatedGraphicsArgumentCoders.h" #include "CoordinatedGraphicsScene.h" #include "MessageReceiver.h" #include <functional> namespace WebCore { struct CoordinatedGraphicsState; class IntSize; } namespace WebKit { class CoordinatedDrawingAreaProxy; class CoordinatedLayerTreeHostProxy : public CoordinatedGraphicsSceneClient, public IPC::MessageReceiver { WTF_MAKE_NONCOPYABLE(CoordinatedLayerTreeHostProxy); WTF_MAKE_FAST_ALLOCATED; public: explicit CoordinatedLayerTreeHostProxy(CoordinatedDrawingAreaProxy*); virtual ~CoordinatedLayerTreeHostProxy(); void commitCoordinatedGraphicsState(const WebCore::CoordinatedGraphicsState&); void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint& trajectoryVector); CoordinatedGraphicsScene* coordinatedGraphicsScene() const { return m_scene.get(); } virtual void updateViewport() override; virtual void renderNextFrame() override; virtual void purgeBackingStores() override; virtual void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset) override; protected: void dispatchUpdate(std::function<void()>); // IPC::MessageReceiver virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override; CoordinatedDrawingAreaProxy* m_drawingAreaProxy; RefPtr<CoordinatedGraphicsScene> m_scene; WebCore::FloatRect m_lastSentVisibleRect; WebCore::FloatPoint m_lastSentTrajectoryVector; }; } // namespace WebKit #endif // USE(COORDINATED_GRAPHICS) #endif // CoordinatedLayerTreeHostProxy_h
#include <linux/kernel.h> #include <linux/module.h> #include <mach/param.h> static void get_param_value(int idx, void *value); static void set_param_value(int idx, void *value); static int switch_sel = 5; /* USB_SAMSUNG_KIES_MASK | USB_SEL_MASK */ static int debug_level = 0; static int reboot_mode = REBOOT_MODE_NONE; static int __init param_init(void) { sec_get_param_value = get_param_value; sec_set_param_value = set_param_value; return 0; } static void get_param_value(int idx, void *value) { switch (idx) { case __SWITCH_SEL: *(int *)value = switch_sel; break; case __PHONE_DEBUG_ON: *(int *)value = debug_level; break; case __REBOOT_MODE: *(int *)value = reboot_mode; break; default: pr_warning("param:%s: Unknown idx: %d.\n", __func__, idx); break; } } static void set_param_value(int idx, void *value) { switch (idx) { case __SWITCH_SEL: switch_sel = *(int *)value; break; case __PHONE_DEBUG_ON: debug_level = *(int *)value; break; case __REBOOT_MODE: reboot_mode = *(int *)value; break; default: pr_warning("param:%s: Unknown idx: %d.\n", __func__, idx); break; } } module_init(param_init); MODULE_LICENSE("GPL");
#include <algorithm> #include <assert.h> #include <fstream> #include <iomanip> #include <set> #include <string> #include <sstream> #include <time.h> #include <typeinfo> #include <vector> #include "../IAgent/IAgentLib.h" #include "../IExperiment/IExperimentLib.h" #include "../IMDP/IMDPLib.h" #include "../IMDPDistribution/IMDPDistributionLib.h" #include "../RLUtils/RLUtilsLib.h" #include "../Utils/UtilsLib.h"
#include "plugin_renderer_gl/events.h" #include "plugin_renderer_gl/window.h" #include "framework/log.h" #include "util/pstdint.h" #include "glfw3.h" /* ------------------------------------------------------------------------- */ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { uint32_t k = (uint32_t)key; if(action == GLFW_PRESS) { EVENT_FIRE1(evt_key_press, k); } if(action == GLFW_RELEASE) { EVENT_FIRE1(evt_key_release, k); } } /* ------------------------------------------------------------------------- */ void mouse_position_callback(GLFWwindow* window, double xpos, double ypos) { /* convert to GL screen space, then fire */ double norm_x, norm_y; norm_x = (xpos * 2.0 / (double)window_width()) - 1.0; norm_y = 1.0 - (ypos * 2.0 / (double)window_height()); EVENT_FIRE2(evt_mouse_move, norm_x, norm_y); } /* ------------------------------------------------------------------------- */ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) { uint32_t button_cast = (uint32_t)button; if(action == GLFW_PRESS) { EVENT_FIRE1(evt_mouse_button_press, button_cast); } if(action == GLFW_RELEASE) { EVENT_FIRE1(evt_mouse_button_release, button_cast); } } /* ------------------------------------------------------------------------- */ void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { uint32_t xoffset_cast = (uint32_t)xoffset; uint32_t yoffset_cast = (uint32_t)yoffset; EVENT_FIRE2(evt_mouse_scroll, xoffset_cast, yoffset_cast); }
/* * * Shell Command Set Management * * Author: * WORK: fernando.ruiz@ctv.es * HOME: correo@fernando-ruiz.com * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id: shell_cmdset.c,v 1.6 2009/11/29 12:12:39 ralf Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <time.h> #include <termios.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <sys/stat.h> #include <unistd.h> #include <errno.h> #include <rtems.h> #include <rtems/shell.h> #include <rtems/shellconfig.h> #include "internal.h" /* * Common linked list of shell commands. * * Because the help report is very long, there is a topic for each command. * * Help list the topics * help [topic] list the commands for the topic * help [command] help for the command * */ rtems_shell_cmd_t * rtems_shell_first_cmd; rtems_shell_topic_t * rtems_shell_first_topic; /* * Find the topic from the set of topics registered. */ rtems_shell_topic_t * rtems_shell_lookup_topic(const char * topic) { rtems_shell_topic_t * shell_topic; shell_topic=rtems_shell_first_topic; while (shell_topic) { if (!strcmp(shell_topic->topic,topic)) return shell_topic; shell_topic=shell_topic->next; } return (rtems_shell_topic_t *) NULL; } /* * Add a new topic to the list of topics */ rtems_shell_topic_t * rtems_shell_add_topic(const char * topic) { rtems_shell_topic_t * current,*aux; if (!rtems_shell_first_topic) { aux = malloc(sizeof(rtems_shell_topic_t)); aux->topic = topic; aux->next = (rtems_shell_topic_t*)NULL; return rtems_shell_first_topic = aux; } current=rtems_shell_first_topic; if (!strcmp(topic,current->topic)) return current; while (current->next) { if (!strcmp(topic,current->next->topic)) return current->next; current=current->next; } aux = malloc(sizeof(rtems_shell_topic_t)); aux->topic = topic; aux->next = (rtems_shell_topic_t*)NULL; current->next = aux; return aux; } /* * Find the command in the set */ rtems_shell_cmd_t * rtems_shell_lookup_cmd(const char * cmd) { rtems_shell_cmd_t * shell_cmd; shell_cmd=rtems_shell_first_cmd; while (shell_cmd) { if (!strcmp(shell_cmd->name,cmd)) return shell_cmd; shell_cmd=shell_cmd->next; }; return (rtems_shell_cmd_t *) NULL; } /* * Add a command structure to the set of known commands */ rtems_shell_cmd_t *rtems_shell_add_cmd_struct( rtems_shell_cmd_t *shell_cmd ) { rtems_shell_cmd_t *shell_pvt; shell_pvt = rtems_shell_first_cmd; while (shell_pvt) { if (strcmp(shell_pvt->name, shell_cmd->name) == 0) return NULL; shell_pvt = shell_pvt->next; } if ( !rtems_shell_first_cmd ) { rtems_shell_first_cmd = shell_cmd; } else { shell_pvt = rtems_shell_first_cmd; while (shell_pvt->next) shell_pvt = shell_pvt->next; shell_pvt->next = shell_cmd; } rtems_shell_add_topic( shell_cmd->topic ); return shell_cmd; } /* * Add a command as a set of arguments to the set and * allocate the command structure on the fly. */ rtems_shell_cmd_t * rtems_shell_add_cmd( const char *name, const char *topic, const char *usage, rtems_shell_command_t command ) { rtems_shell_cmd_t *shell_cmd = NULL; char *my_name = NULL; char *my_topic = NULL; char *my_usage = NULL; /* Reject empty commands */ if (name == NULL || command == NULL) { return NULL; } /* Allocate command stucture */ shell_cmd = (rtems_shell_cmd_t *) malloc(sizeof(rtems_shell_cmd_t)); if (shell_cmd == NULL) { return NULL; } /* Allocate strings */ my_name = strdup(name); my_topic = strdup(topic); my_usage = strdup(usage); /* Assign values */ shell_cmd->name = my_name; shell_cmd->topic = my_topic; shell_cmd->usage = my_usage; shell_cmd->command = command; shell_cmd->alias = NULL; shell_cmd->next = NULL; if (rtems_shell_add_cmd_struct(shell_cmd) == NULL) { /* Something is wrong, free allocated resources */ free(my_usage); free(my_topic); free(my_name); free(shell_cmd); return NULL; } return shell_cmd; } void rtems_shell_initialize_command_set(void) { rtems_shell_cmd_t **c; rtems_shell_alias_t **a; for ( c = rtems_shell_Initial_commands ; *c ; c++ ) { rtems_shell_add_cmd_struct( *c ); } for ( a = rtems_shell_Initial_aliases ; *a ; a++ ) { rtems_shell_alias_cmd( (*a)->name, (*a)->alias ); } rtems_shell_register_monitor_commands(); } /* ----------------------------------------------- * * you can make an alias for every command. * ----------------------------------------------- */ rtems_shell_cmd_t *rtems_shell_alias_cmd( const char *cmd, const char *alias ) { rtems_shell_cmd_t *shell_cmd, *shell_aux; shell_aux = (rtems_shell_cmd_t *) NULL; if (alias) { shell_aux = rtems_shell_lookup_cmd(alias); if (shell_aux != NULL) { return NULL; } shell_cmd = rtems_shell_lookup_cmd(cmd); if (shell_cmd != NULL) { shell_aux = rtems_shell_add_cmd( alias, shell_cmd->topic, shell_cmd->usage, shell_cmd->command ); if (shell_aux) shell_aux->alias = shell_cmd; } } return shell_aux; }
#ifndef __WM_H__ #define __WM_H__ void scan_wakeup_irq(unsigned int irq_num); #endif
/* * platform_msic_thermal.c: msic_thermal platform data initilization file * * (C) Copyright 2008 Intel Corporation * Author: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. */ #include <linux/input.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/gpio.h> #include <linux/platform_device.h> #include <linux/ipc_device.h> #include <linux/lnw_gpio.h> #include <asm/intel-mid.h> #include "platform_msic_thermal.h" static int __init intel_msic_thermal_init(void) { int ret; struct ipc_board_info board_info; memset(&board_info, 0, sizeof(board_info)); strncpy(board_info.name, MSIC_THERM_DEV_NAME, 16); board_info.bus_id = IPC_SCU; board_info.id = -1; ret = ipc_new_device(&board_info); if (ret) { pr_err("failed to create ipc device: msic_thermal\n"); return -1; } return 0; } fs_initcall(intel_msic_thermal_init);
/****************************************************************************** * Warmux is a convivial mass murder game. * Copyright (C) 2001-2010 Warmux Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ****************************************************************************** * Particle Engine *****************************************************************************/ #ifndef GROUND_PARTICLES_H #define GROUND_PARTICLES_H #include "particles/particle.h" class GroundParticle : public Particle { public: GroundParticle(const Point2i& size, const Point2i& position); void Refresh(); }; #endif /* GROUND_PARTICLES_H */
#ifndef RAMWATCH_H #define RAMWATCH_H bool ResetWatches(); void OpenRWRecentFile(int memwRFileNumber); extern bool AutoRWLoad; extern bool RWSaveWindowPos; #define MAX_RECENT_WATCHES 5 extern char rw_recent_files[MAX_RECENT_WATCHES][1024]; extern bool AskSave(); extern int ramw_x; extern int ramw_y; extern bool RWfileChanged; //Constants #define AUTORWLOAD "RamWatchAutoLoad" #define RWSAVEPOS "RamWatchSaveWindowPos" #define RAMWX "RamwX" #define RAMWY "RamwY" // AddressWatcher is self-contained now struct AddressWatcher { unsigned int Address; // hardware address char Size; //'d' = 4 bytes, 'w' = 2 bytes, 'b' = 1 byte, and 'S' means it's a separator. char Type;//'s' = signed integer, 'u' = unsigned, 'h' = hex, 'S' = separator char* comment; // NULL means no comment, non-NULL means allocated comment bool WrongEndian; unsigned int CurValue; }; #define MAX_WATCH_COUNT 256 extern AddressWatcher rswatches[MAX_WATCH_COUNT]; extern int WatchCount; // number of valid items in rswatches extern char Watch_Dir[1024]; extern HWND RamWatchHWnd; extern HACCEL RamWatchAccels; bool InsertWatch(const AddressWatcher& Watch, char *Comment); bool InsertWatch(const AddressWatcher& Watch, HWND parent=NULL); // asks user for comment void Update_RAM_Watch(); bool Load_Watches(bool clear, const char* filename); void RWAddRecentFile(const char *filename); LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); extern HWND RamWatchHWnd; #endif
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */ /* * Copyright (C) 2004 Red Hat, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id$ */ #if !defined (__EV_XREADER_DOCUMENT_H_INSIDE__) && !defined (XREADER_COMPILATION) #error "Only <xreader-document.h> can be included directly." #endif #ifndef EV_DOCUMENT_FIND_H #define EV_DOCUMENT_FIND_H #include <glib-object.h> #include <glib.h> #include "ev-document.h" G_BEGIN_DECLS #define EV_TYPE_DOCUMENT_FIND (ev_document_find_get_type ()) #define EV_DOCUMENT_FIND(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_FIND, EvDocumentFind)) #define EV_DOCUMENT_FIND_IFACE(k) (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_FIND, EvDocumentFindInterface)) #define EV_IS_DOCUMENT_FIND(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT_FIND)) #define EV_IS_DOCUMENT_FIND_IFACE(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_FIND)) #define EV_DOCUMENT_FIND_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_FIND, EvDocumentFindInterface)) typedef struct _EvDocumentFind EvDocumentFind; typedef struct _EvDocumentFindInterface EvDocumentFindInterface; struct _EvDocumentFindInterface { GTypeInterface base_iface; /* Methods */ GList *(* find_text) (EvDocumentFind *document_find, EvPage *page, const gchar *text, gboolean case_sensitive); guint (* check_for_hits) (EvDocumentFind *document_find, EvPage *page, const gchar *text, gboolean case_sensitive); }; GType ev_document_find_get_type (void) G_GNUC_CONST; GList *ev_document_find_find_text (EvDocumentFind *document_find, EvPage *page, const gchar *text, gboolean case_sensitive); guint ev_document_find_check_for_hits (EvDocumentFind *document_find, EvPage *page, const gchar *text, gboolean case_sensitive); G_END_DECLS #endif /* EV_DOCUMENT_FIND_H */
/* * libdpkg - Debian packaging suite library routines * t-pkginfo.c - test pkginfo handling * * Copyright © 2009 Guillem Jover <guillem@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include <compat.h> #include <dpkg/test.h> #include <dpkg/dpkg-db.h> static void test_pkginfo_informative(void) { struct pkginfo pkg; blankpackage(&pkg); test_fail(informative(&pkg, &pkg.installed)); pkg.want = want_purge; test_pass(informative(&pkg, &pkg.installed)); blankpackage(&pkg); pkg.installed.description = "test description"; test_pass(informative(&pkg, &pkg.installed)); /* FIXME: Complete. */ } static void test(void) { test_pkginfo_informative(); /* FIXME: Complete. */ }
extern cl_enginefunc_t gEngfuncs; int Initialize(struct cl_enginefuncs_s *pEnginefuncs, int iVersion);
/* * Copyright (C) James R. Leu 2002 * jleu@mindspring.com * * This software is covered under the LGPL, for more * info check out http://www.gnu.org/copyleft/lgpl.html */ #ifndef _MPLS_MM_IMPL_H_ #define _MPLS_MM_IMPL_H_ #include "mpls_struct.h" /* * in: size * return: void* */ extern void *mpls_malloc(const mpls_size_type size); /* * in: mem */ extern void mpls_free(void *mem); #endif
// (C) Copyright 2005-2008 Benjamin Godon and contributors. // // This file is part of Cellule. // // Cellule 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. // // Cellule 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 Cellule; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef __NWgroup_h__ #define __NWgroup_h__ #include "NWnode.h" #include "NWnodeTypes.h" //! \brief A group constitute the sub-graph made of all children nodes //! \author bEngo //! \date 2008 May 05 //! class NWgroup : public NWnode { public: virtual CFtype type ( void ) const { return NWgroupType; } protected: }; #endif //__NWgroup_h__
/* * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2011-2015 ArkCORE <http://www.arkania.net/> * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _WARDEN_BASE_H #define _WARDEN_BASE_H #include <map> #include "Cryptography/ARC4.h" #include "Cryptography/BigNumber.h" #include "ByteBuffer.h" #include "WardenCheckMgr.h" enum WardenOpcodes { // Client->Server WARDEN_CMSG_MODULE_MISSING = 0, WARDEN_CMSG_MODULE_OK = 1, WARDEN_CMSG_CHEAT_CHECKS_RESULT = 2, WARDEN_CMSG_MEM_CHECKS_RESULT = 3, // only sent if MEM_CHECK bytes doesn't match WARDEN_CMSG_HASH_RESULT = 4, WARDEN_CMSG_MODULE_FAILED = 5, // this is sent when client failed to load uploaded module due to cache fail // Server->Client WARDEN_SMSG_MODULE_USE = 0, WARDEN_SMSG_MODULE_CACHE = 1, WARDEN_SMSG_CHEAT_CHECKS_REQUEST = 2, WARDEN_SMSG_MODULE_INITIALIZE = 3, WARDEN_SMSG_MEM_CHECKS_REQUEST = 4, // byte len; while (!EOF) { byte unk(1); byte index(++); string module(can be 0); int offset; byte len; byte[] bytes_to_compare[len]; } WARDEN_SMSG_HASH_REQUEST = 5 }; enum WardenCheckType { MEM_CHECK = 0xF3, // 243: byte moduleNameIndex + uint Offset + byte Len (check to ensure memory isn't modified) PAGE_CHECK_A = 0xB2, // 178: uint Seed + byte[20] SHA1 + uint Addr + byte Len (scans all pages for specified hash) PAGE_CHECK_B = 0xBF, // 191: uint Seed + byte[20] SHA1 + uint Addr + byte Len (scans only pages starts with MZ+PE headers for specified hash) MPQ_CHECK = 0x98, // 152: byte fileNameIndex (check to ensure MPQ file isn't modified) LUA_STR_CHECK = 0x8B, // 139: byte luaNameIndex (check to ensure LUA string isn't used) DRIVER_CHECK = 0x71, // 113: uint Seed + byte[20] SHA1 + byte driverNameIndex (check to ensure driver isn't loaded) TIMING_CHECK = 0x57, // 87: empty (check to ensure GetTickCount() isn't detoured) PROC_CHECK = 0x7E, // 126: uint Seed + byte[20] SHA1 + byte moluleNameIndex + byte procNameIndex + uint Offset + byte Len (check to ensure proc isn't detoured) MODULE_CHECK = 0xD9 // 217: uint Seed + byte[20] SHA1 (check to ensure module isn't injected) }; #if defined(__GNUC__) #pragma pack(1) #else #pragma pack(push, 1) #endif struct WardenModuleUse { uint8 Command; uint8 ModuleId[16]; uint8 ModuleKey[16]; uint32 Size; }; struct WardenModuleTransfer { uint8 Command; uint16 DataSize; uint8 Data[500]; }; struct WardenHashRequest { uint8 Command; uint8 Seed[16]; }; #if defined(__GNUC__) #pragma pack() #else #pragma pack(pop) #endif struct ClientWardenModule { uint8 Id[16]; uint8 Key[16]; uint32 CompressedSize; uint8* CompressedData; }; class WorldSession; class Warden { friend class WardenWin; friend class WardenMac; public: Warden(); virtual ~Warden(); virtual void Init(WorldSession* session, BigNumber* k) = 0; virtual ClientWardenModule* GetModuleForClient() = 0; virtual void InitializeModule() = 0; virtual void RequestHash() = 0; virtual void HandleHashResult(ByteBuffer &buff) = 0; virtual void RequestData() = 0; virtual void HandleData(ByteBuffer &buff) = 0; void SendModuleToClient(); void RequestModule(); void Update(); void DecryptData(uint8* buffer, uint32 length); void EncryptData(uint8* buffer, uint32 length); static bool IsValidCheckSum(uint32 checksum, const uint8 *data, const uint16 length); static uint32 BuildChecksum(const uint8 *data, uint32 length); // If no check is passed, the default action from config is executed std::string Penalty(WardenCheck* check = NULL); private: WorldSession* _session; uint8 _inputKey[16]; uint8 _outputKey[16]; uint8 _seed[16]; ARC4 _inputCrypto; ARC4 _outputCrypto; uint32 _checkTimer; // Timer for sending check requests uint32 _clientResponseTimer; // Timer for client response delay bool _dataSent; uint32 _previousTimestamp; ClientWardenModule* _module; bool _initialized; }; #endif
/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkstemp' function. */ /* #undef HAVE_MKSTEMP */ /* Define to 1 if you have the `mktemp' function. */ #define HAVE_MKTEMP 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* "sys/utime.h" is present instead of "utime.h" */ /* #undef HAVE_SYS_UTIME_H */ /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `utime' function. */ #define HAVE_UTIME 1 /* "utime.h" is present instead of "sys/utime.h" */ #define HAVE_UTIME_H 1 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ /* #undef YYTEXT_POINTER */
/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp <dok@directfb.org>, Andreas Hundt <andi@fischlustig.de>, Sven Neumann <neo@directfb.org>, Ville Syrjälä <syrjala@sci.fi> and Claudio Ciccani <klan@users.sf.net>. This file is subject to the terms and conditions of the MIT License: 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 <config.h> #include <directfb.h> #include <direct/debug.h> #include <direct/interface.h> #include <direct/mem.h> #include <direct/messages.h> #include <voodoo/server.h> /*****************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ); static DFBResult server_run(); /*****************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Run the server. */ return server_run(); } /*****************************************************************************/ static DirectResult ConstructDispatcher( VoodooServer *server, VoodooManager *manager, const char *name, void *ctx, VoodooInstanceID *ret_instance ) { DirectResult ret; DirectInterfaceFuncs *funcs; void *interface; VoodooInstanceID instance; D_ASSERT( server != NULL ); D_ASSERT( manager != NULL ); D_ASSERT( name != NULL ); D_ASSERT( ret_instance != NULL ); ret = DirectGetInterface( &funcs, name, "Dispatcher", NULL, NULL ); if (ret) return ret; ret = funcs->Allocate( &interface ); if (ret) return ret; ret = funcs->Construct( interface, manager, &instance ); if (ret) return ret; *ret_instance = instance; return DFB_OK; } /*****************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ) { return DFB_TRUE; } static DFBResult server_run() { DFBResult ret; VoodooServer *server; ret = voodoo_server_create( &server ); if (ret) { D_ERROR( "Voodoo/Proxy: Could not create the server (%s)!\n", DirectFBErrorString(ret) ); return ret; } ret = voodoo_server_register( server, "IDirectFB", ConstructDispatcher, NULL ); if (ret) { D_ERROR( "Voodoo/Proxy: Could not register super interface 'IDirectFB'!\n" ); voodoo_server_destroy( server ); return ret; } ret = voodoo_server_run( server ); if (ret) D_ERROR( "Voodoo/Proxy: Server exiting with error (%s)!\n", DirectFBErrorString(ret) ); voodoo_server_destroy( server ); return DFB_OK; }
/* -*- linux-c -*- --------------------------------------------------------- * * * linux/fs/devpts/inode.c * * Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved * * This file is part of the Linux kernel and is made available under * the terms of the GNU General Public License, version 2, or at your * option, any later version, incorporated herein by reference. * * ------------------------------------------------------------------------- */ #include <linux/module.h> #include <linux/init.h> #include <linux/fs.h> #include <linux/sched.h> #include <linux/namei.h> #include <linux/mount.h> #include <linux/tty.h> #include <linux/devpts_fs.h> #include <linux/parser.h> #define DEVPTS_SUPER_MAGIC 0x1cd1 static struct vfsmount *devpts_mnt; static struct dentry *devpts_root; static struct { int setuid; int setgid; uid_t uid; gid_t gid; umode_t mode; } config = {.mode = 0600}; enum { Opt_uid, Opt_gid, Opt_mode, Opt_err }; static match_table_t tokens = { {Opt_uid, "uid=%u"}, {Opt_gid, "gid=%u"}, {Opt_mode, "mode=%o"}, {Opt_err, NULL} }; static int devpts_remount(struct super_block *sb, int *flags, char *data) { char *p; config.setuid = 0; config.setgid = 0; config.uid = 0; config.gid = 0; config.mode = 0600; while ((p = strsep(&data, ",")) != NULL) { substring_t args[MAX_OPT_ARGS]; int token; int option; if (!*p) continue; token = match_token(p, tokens, args); switch (token) { case Opt_uid: if (match_int(&args[0], &option)) return -EINVAL; config.uid = option; config.setuid = 1; break; case Opt_gid: if (match_int(&args[0], &option)) return -EINVAL; config.gid = option; config.setgid = 1; break; case Opt_mode: if (match_octal(&args[0], &option)) return -EINVAL; config.mode = option & ~S_IFMT; break; default: printk(KERN_ERR "devpts: called with bogus options\n"); return -EINVAL; } } return 0; } static struct super_operations devpts_sops = { .statfs = simple_statfs, .remount_fs = devpts_remount, }; static int devpts_fill_super(struct super_block *s, void *data, int silent) { struct inode * inode; s->s_blocksize = 1024; s->s_blocksize_bits = 10; s->s_magic = DEVPTS_SUPER_MAGIC; s->s_op = &devpts_sops; s->s_time_gran = 1; inode = new_inode(s); if (!inode) goto fail; inode->i_ino = 1; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->i_blocks = 0; inode->i_blksize = 1024; inode->i_uid = inode->i_gid = 0; inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; inode->i_nlink = 2; devpts_root = s->s_root = d_alloc_root(inode); if (s->s_root) return 0; printk("devpts: get root dentry failed\n"); iput(inode); fail: return -ENOMEM; } static struct super_block *devpts_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, devpts_fill_super); } static struct file_system_type devpts_fs_type = { .owner = THIS_MODULE, .name = "devpts", .get_sb = devpts_get_sb, .kill_sb = kill_anon_super, }; /* * The normal naming convention is simply /dev/pts/<number>; this conforms * to the System V naming convention */ static struct dentry *get_node(int num) { char s[12]; struct dentry *root = devpts_root; mutex_lock(&root->d_inode->i_mutex); return lookup_one_len(s, root, sprintf(s, "%d", num)); } int devpts_pty_new(struct tty_struct *tty) { int number = tty->index; struct tty_driver *driver = tty->driver; dev_t device = MKDEV(driver->major, driver->minor_start+number); struct dentry *dentry; struct inode *inode = new_inode(devpts_mnt->mnt_sb); /* We're supposed to be given the slave end of a pty */ BUG_ON(driver->type != TTY_DRIVER_TYPE_PTY); BUG_ON(driver->subtype != PTY_TYPE_SLAVE); if (!inode) return -ENOMEM; inode->i_ino = number+2; inode->i_blksize = 1024; inode->i_uid = config.setuid ? config.uid : current->fsuid; inode->i_gid = config.setgid ? config.gid : current->fsgid; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; init_special_inode(inode, S_IFCHR|config.mode, device); inode->u.generic_ip = tty; dentry = get_node(number); if (!IS_ERR(dentry) && !dentry->d_inode) d_instantiate(dentry, inode); mutex_unlock(&devpts_root->d_inode->i_mutex); return 0; } struct tty_struct *devpts_get_tty(int number) { struct dentry *dentry = get_node(number); struct tty_struct *tty; tty = NULL; if (!IS_ERR(dentry)) { if (dentry->d_inode) tty = dentry->d_inode->u.generic_ip; dput(dentry); } mutex_unlock(&devpts_root->d_inode->i_mutex); return tty; } void devpts_pty_kill(int number) { struct dentry *dentry = get_node(number); if (!IS_ERR(dentry)) { struct inode *inode = dentry->d_inode; if (inode) { inode->i_nlink--; d_delete(dentry); dput(dentry); } dput(dentry); } mutex_unlock(&devpts_root->d_inode->i_mutex); } static int __init init_devpts_fs(void) { int err = register_filesystem(&devpts_fs_type); if (!err) { devpts_mnt = kern_mount(&devpts_fs_type); if (IS_ERR(devpts_mnt)) err = PTR_ERR(devpts_mnt); } return err; } static void __exit exit_devpts_fs(void) { unregister_filesystem(&devpts_fs_type); mntput(devpts_mnt); } module_init(init_devpts_fs) module_exit(exit_devpts_fs) MODULE_LICENSE("GPL");
/* * file.c - NILFS regular file handling primitives including fsync(). * * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Written by Amagai Yoshiji <amagai@osrg.net>, * Ryusuke Konishi <ryusuke@osrg.net> */ #include <linux/fs.h> #include <linux/mm.h> #include <linux/writeback.h> #include "nilfs.h" #include "segment.h" int nilfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) { /* * Called from fsync() system call * This is the only entry point that can catch write and synch * timing for both data blocks and intermediate blocks. * * This function should be implemented when the writeback function * will be implemented. */ struct inode *inode = file->f_mapping->host; int err; err = filemap_write_and_wait_range(inode->i_mapping, start, end); if (err) return err; mutex_lock(&inode->i_mutex); if (!nilfs_inode_dirty(inode)) { mutex_unlock(&inode->i_mutex); return 0; } if (datasync) err = nilfs_construct_dsync_segment(inode->i_sb, inode, 0, LLONG_MAX); else err = nilfs_construct_segment(inode->i_sb); mutex_unlock(&inode->i_mutex); return err; } static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) { struct page *page = vmf->page; struct inode *inode = vma->vm_file->f_dentry->d_inode; struct nilfs_transaction_info ti; int ret; if (unlikely(nilfs_near_disk_full(inode->i_sb->s_fs_info))) return VM_FAULT_SIGBUS; /* -ENOSPC */ lock_page(page); if (page->mapping != inode->i_mapping || page_offset(page) >= i_size_read(inode) || !PageUptodate(page)) { unlock_page(page); return VM_FAULT_NOPAGE; /* make the VM retry the fault */ } /* * check to see if the page is mapped already (no holes) */ if (PageMappedToDisk(page)) goto mapped; if (page_has_buffers(page)) { struct buffer_head *bh, *head; int fully_mapped = 1; bh = head = page_buffers(page); do { if (!buffer_mapped(bh)) { fully_mapped = 0; break; } } while (bh = bh->b_this_page, bh != head); if (fully_mapped) { SetPageMappedToDisk(page); goto mapped; } } unlock_page(page); /* * fill hole blocks */ ret = nilfs_transaction_begin(inode->i_sb, &ti, 1); /* never returns -ENOMEM, but may return -ENOSPC */ if (unlikely(ret)) return VM_FAULT_SIGBUS; file_update_time(vma->vm_file); ret = block_page_mkwrite(vma, vmf, nilfs_get_block); if (ret != VM_FAULT_LOCKED) { nilfs_transaction_abort(inode->i_sb); return ret; } nilfs_set_file_dirty(inode, 1 << (PAGE_SHIFT - inode->i_blkbits)); nilfs_transaction_commit(inode->i_sb); mapped: wait_on_page_writeback(page); return VM_FAULT_LOCKED; } static const struct vm_operations_struct nilfs_file_vm_ops = { .fault = filemap_fault, .page_mkwrite = nilfs_page_mkwrite, }; static int nilfs_file_mmap(struct file *file, struct vm_area_struct *vma) { file_accessed(file); vma->vm_ops = &nilfs_file_vm_ops; vma->vm_flags |= VM_CAN_NONLINEAR; return 0; } /* * We have mostly NULL's here: the current defaults are ok for * the nilfs filesystem. */ const struct file_operations nilfs_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, .read_iter = generic_file_read_iter, .write_iter = generic_file_write_iter, .unlocked_ioctl = nilfs_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = nilfs_compat_ioctl, #endif /* CONFIG_COMPAT */ .mmap = nilfs_file_mmap, .open = generic_file_open, /* .release = nilfs_release_file, */ .fsync = nilfs_sync_file, .splice_read = generic_file_splice_read, }; const struct inode_operations nilfs_file_inode_operations = { .truncate = nilfs_truncate, .setattr = nilfs_setattr, .permission = nilfs_permission, .fiemap = nilfs_fiemap, }; /* end of file */
/* * gedit-theatrics-utils.h * This file is part of gedit * * Copyright (C) 2010 - Ignacio Casal Quinteiro * * Based on Mike Krüger <mkrueger@novell.com> work. * * gedit 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. * * gedit 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 gedit; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef __GEDIT_THEATRICS_UTILS_H__ #define __GEDIT_THEATRICS_UTILS_H__ #include <glib.h> #include <gtk/gtk.h> G_BEGIN_DECLS void gedit_theatrics_utils_draw_round_rectangle (cairo_t *cr, gboolean top_left_round, gboolean top_right_round, gboolean bottom_left_round, gboolean bottom_right_round, gdouble x, gdouble y, gdouble r, gdouble w, gdouble h); G_END_DECLS #endif /* __GEDIT_THEATRICS_UTILS_H__ */ /* ex:set ts=8 noet: */
/* packet-v5ef.c * Routines for V5 envelope function frame disassembly * Rolf Fiedler <rolf.fiedler@innoventif.de> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * V5 bitstream over HDLC handling * * V5 references: * * ETS 300 324-1 * ETS 300 347-1 */ #include "config.h" #include <epan/packet.h> #include <wiretap/wtap.h> void proto_register_v5ef(void); static int proto_v5ef = -1; static int hf_v5ef_direction = -1; static int hf_v5ef_address = -1; static int hf_v5ef_eah = -1; static int hf_v5ef_ea1 = -1; static int hf_v5ef_eal = -1; static int hf_v5ef_ea2 = -1; static gint ett_v5ef = -1; static gint ett_v5ef_address = -1; static dissector_handle_t v5dl_handle, lapd_handle; /* * Bits in the address field. */ #define V5EF_EAH 0xfc00 /* Service Access Point Identifier */ #define V5EF_EAH_SHIFT 10 #define V5EF_EA1 0x0100 /* First Address Extension bit */ #define V5EF_EAL 0x00fe /* Terminal Endpoint Identifier */ #define V5EF_EAL_SHIFT 1 #define V5EF_EA2 0x0001 /* Second Address Extension bit */ static const value_string v5ef_direction_vals[] = { { 0, "AN->LE"}, { 1, "LE->AN"}, { 0, NULL } }; #define MAX_V5EF_PACKET_LEN 1024 static int dissect_v5ef(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *v5ef_tree, *addr_tree; proto_item *v5ef_ti, *addr_ti; int direction; int v5ef_header_len; guint16 addr, eah, eal, efaddr; tvbuff_t *next_tvb; const char *srcname = "src"; const char *dstname = "dst"; col_set_str(pinfo->cinfo, COL_PROTOCOL, "V5-EF"); col_clear(pinfo->cinfo, COL_INFO); addr = tvb_get_ntohs(tvb, 0); eah = (addr & V5EF_EAH) >> V5EF_EAH_SHIFT; eal = (addr & V5EF_EAL) >> V5EF_EAL_SHIFT; efaddr = (eah << 7) + eal; v5ef_header_len = 2; /* addr */ direction = pinfo->pseudo_header->isdn.uton; if (direction==0) { srcname = "LE"; dstname = "AN"; } else if (direction > 0) { srcname = "AN"; dstname = "LE"; } col_set_str(pinfo->cinfo, COL_RES_DL_SRC, srcname); col_set_str(pinfo->cinfo, COL_RES_DL_DST, dstname); if (tree) { proto_item *direction_ti; v5ef_ti = proto_tree_add_item(tree, proto_v5ef, tvb, 0, -1, ENC_NA); v5ef_tree = proto_item_add_subtree(v5ef_ti, ett_v5ef); /* * Don't show the direction if we don't know it. */ if (direction != P2P_DIR_UNKNOWN) { direction_ti = proto_tree_add_uint(v5ef_tree, hf_v5ef_direction, tvb, 0, 0, direction); PROTO_ITEM_SET_GENERATED(direction_ti); } addr_ti = proto_tree_add_uint(v5ef_tree, hf_v5ef_address, tvb, 0, 2, addr); addr_tree = proto_item_add_subtree(addr_ti, ett_v5ef_address); proto_tree_add_uint(addr_tree, hf_v5ef_eah, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5ef_ea1, tvb, 0, 1, addr); proto_tree_add_uint(addr_tree, hf_v5ef_eal, tvb, 1, 1, addr); proto_tree_add_uint(addr_tree, hf_v5ef_ea2, tvb, 1, 1, addr); } else { v5ef_ti = NULL; v5ef_tree = NULL; } if (tree) proto_item_set_len(v5ef_ti, v5ef_header_len); next_tvb = tvb_new_subset_remaining(tvb, v5ef_header_len); if (efaddr>8175) call_dissector(v5dl_handle,next_tvb, pinfo, tree); else call_dissector(lapd_handle,next_tvb, pinfo, tree); return tvb_captured_length(tvb); } void proto_reg_handoff_v5ef(void); void proto_register_v5ef(void) { static hf_register_info hf[] = { { &hf_v5ef_direction, { "Direction", "v5ef.direction", FT_UINT8, BASE_DEC, VALS(v5ef_direction_vals), 0x0, NULL, HFILL }}, { &hf_v5ef_address, { "Address Field", "v5ef.address", FT_UINT16, BASE_HEX, NULL, 0x0, "Address", HFILL }}, { &hf_v5ef_eah, { "EAH", "v5ef.eah", FT_UINT16, BASE_DEC, NULL, V5EF_EAH, "Envelope Address High Part", HFILL }}, { &hf_v5ef_ea1, { "EA1", "v5ef.ea1", FT_UINT16, BASE_DEC, NULL, V5EF_EA1, "First Address Extension bit", HFILL }}, { &hf_v5ef_eal, { "EAL", "v5ef.eal", FT_UINT16, BASE_DEC, NULL, V5EF_EAL, "Envelope Address Low Part", HFILL }}, { &hf_v5ef_ea2, { "EA2", "v5ef.ea2", FT_UINT16, BASE_DEC, NULL, V5EF_EA2, "Second Address Extension bit", HFILL }}, }; static gint *ett[] = { &ett_v5ef, &ett_v5ef_address, }; proto_v5ef = proto_register_protocol("V5 Envelope Function (v5ef)", "v5ef", "v5ef"); proto_register_field_array (proto_v5ef, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("v5ef", dissect_v5ef, proto_v5ef); } void proto_reg_handoff_v5ef(void) { dissector_handle_t v5ef_handle; v5ef_handle = find_dissector("v5ef"); dissector_add_uint("wtap_encap", WTAP_ENCAP_V5_EF, v5ef_handle); lapd_handle = find_dissector("lapd"); v5dl_handle = find_dissector("v5dl"); } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
/*************************************************************************** opssupernovae.h - K Desktop Planetarium ------------------- begin : Thu, 25 Aug 2011 copyright : (C) 2011 by Samikshan Bairagya email : samikshan@gmail.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef OPSSUPERNOVAE_H_ #define OPSSUPERNOVAE_H_ #include "ui_opssupernovae.h" #include <kconfigdialog.h> class KStars; /** @class OpsSupernovae *The Supernovae Tab of the Options window. In this Tab the user can configure *supernovae options and select if supernovae should be drawn on the skymap. *Also the user is given the option to check for updates on startup. And whether *to be alerted on startup. *@author Samikshan Bairagya *@version 1.0 */ class OpsSupernovae : public QFrame, public Ui::OpsSupernovae { Q_OBJECT public: /** * Constructor */ explicit OpsSupernovae(); /** * Destructor */ ~OpsSupernovae() {} }; #endif //OPSSUPERNOVAE_H_
#pragma once #ifndef CURVE25519_DONNA_H #define CURVE25519_DONNA_H extern int curve25519_donna(uint8_t *, const uint8_t *, const uint8_t *); #endif
/* * Copyright (C) 2016 Stuart Howarth <showarth@marxoft.co.uk> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 3, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef NETWORKACCESSMANAGERFACTORY_H #define NETWORKACCESSMANAGERFACTORY_H #include <QDeclarativeNetworkAccessManagerFactory> class QNetworkCookieJar; class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory { public: explicit NetworkAccessManagerFactory(); ~NetworkAccessManagerFactory(); QNetworkCookieJar *cookieJar() const; QNetworkAccessManager* create(QObject *parent); private: QNetworkCookieJar *m_cookieJar; }; #endif // NETWORKACCESSMANAGERFACTORY_H
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Wiring project - http://wiring.uniandes.edu.co Copyright (c) 2004-05 Hernando Barragan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Modified 24 November 2006 by David A. Mellis Modified 28-08-2009 for attiny84 R.Wiersma Modified 09-10-2009 for attiny45 A.Saporetti Modified 20-11-2010 - B.Cook - Correct a minor bug in attachInterrupt */ #include <inttypes.h> #include <avr/io.h> #include <avr/interrupt.h> #include <avr/pgmspace.h> #include <stdio.h> #include "wiring_private.h" static volatile voidFuncPtr intFunc[NUMBER_EXTERNAL_INTERRUPTS]; #if defined( MCUCR ) && ! defined( EICRA ) #define EICRA MCUCR #endif #if defined( GIMSK ) && ! defined( EIMSK ) #define EIMSK GIMSK #endif void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) { if ( interruptNum < NUMBER_EXTERNAL_INTERRUPTS ) { /* If attachInterrupt is called in succession for the same interruptNum but a different userFunc then the following line is not safe. Changing intFunc is not atomic. intFunc[interruptNum] = userFunc; */ { // save interrupt flag uint8_t SaveSREG = SREG; // disable interrupts cli(); // access the shared data intFunc[interruptNum] = userFunc; // restore the interrupt flag SREG = SaveSREG; } // Configure the interrupt mode (trigger on low input, any change, rising // edge, or falling edge). The mode constants were chosen to correspond // to the configuration bits in the hardware register, so we simply shift // the mode into place. // Enable the interrupt. switch ( interruptNum ) { #if NUMBER_EXTERNAL_INTERRUPTS >= 1 case EXTERNAL_INTERRUPT_0: EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00); EIMSK |= (1 << INT0); break; #endif #if NUMBER_EXTERNAL_INTERRUPTS >= 2 && !defined(ISC11) //For ATtiny861, but interrupts share the same vector. case EXTERNAL_INTERRUPT_1: EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00); EIMSK |= (1 << INT1); break; #endif #if NUMBER_EXTERNAL_INTERRUPTS >= 2 && defined(ISC11) case EXTERNAL_INTERRUPT_1: EICRA = (EICRA & ~((1 << ISC10) | (1 << ISC11))) | (mode << ISC10); EIMSK |= (1 << INT1); break; #endif #if NUMBER_EXTERNAL_INTERRUPTS > 2 #error Add handlers for the additional interrupts. #endif } } } void detachInterrupt(uint8_t interruptNum) { if ( interruptNum < NUMBER_EXTERNAL_INTERRUPTS ) { // Disable the interrupt. (We can't assume that interruptNum is equal // to the number of the EIMSK bit to clear, as this isn't true on the // ATmega8. There, INT0 is 6 and INT1 is 7.) switch (interruptNum) { #if NUMBER_EXTERNAL_INTERRUPTS >= 1 case EXTERNAL_INTERRUPT_0: EIMSK &= ~(1 << INT0); break;; #endif #if NUMBER_EXTERNAL_INTERRUPTS >= 2 case EXTERNAL_INTERRUPT_1: EIMSK &= ~(1 << INT1); break;; #endif #if NUMBER_EXTERNAL_INTERRUPTS > 2 #error Add handlers for the additional interrupts. #endif } intFunc[interruptNum] = 0; } } #if NUMBER_EXTERNAL_INTERRUPTS >= 1 ISR(EXTERNAL_INTERRUPT_0_vect) { if(intFunc[EXTERNAL_INTERRUPT_0]) intFunc[EXTERNAL_INTERRUPT_0](); } #endif #if NUMBER_EXTERNAL_INTERRUPTS >= 2 ISR(EXTERNAL_INTERRUPT_1_vect) { if(intFunc[EXTERNAL_INTERRUPT_1]) intFunc[EXTERNAL_INTERRUPT_1](); } #endif #if NUMBER_EXTERNAL_INTERRUPTS > 2 #error Add handlers for the additional interrupts. #endif
/* * This file is part of the libsigrok project. * * Copyright (C) 2013 Bert Vermeulen <bert@biot.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LIBSIGROK_HARDWARE_UNI_T_UT32X_PROTOCOL_H #define LIBSIGROK_HARDWARE_UNI_T_UT32X_PROTOCOL_H #include <stdint.h> #include <glib.h> #include "libsigrok.h" #include "libsigrok-internal.h" /* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "uni-t-ut32x: " #define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) #define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) #define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) #define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) #define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) #define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) #define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE #define USB_CONN "1a86.e008" #define VENDOR "UNI-T" #define MODEL "UT32x" #define USB_INTERFACE 0 #define USB_CONFIGURATION 1 #define EP_IN 0x80 | 2 #define EP_OUT 2 enum { DATA_SOURCE_LIVE, DATA_SOURCE_MEMORY, }; enum { CMD_GET_LIVE = 1, CMD_STOP = 2, CMD_GET_STORED = 7, }; /** Private, per-device-instance driver context. */ struct dev_context { /* Acquisition settings */ uint64_t limit_samples; gboolean data_source; /* Operational state */ uint64_t num_samples; int usbfd[10]; unsigned char buf[8]; struct libusb_transfer *xfer; void *cb_data; /* Temporary state across callbacks */ unsigned char packet[32]; int packet_len; }; SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data); SR_PRIV void uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer); #endif
/* --------------------------------------------------------------------------------------- This source file is part of SWG:ANH (Star Wars Galaxies - A New Hope - Server Emulator) For more information, visit http://www.swganh.com Copyright (c) 2006 - 2014 The SWG:ANH Team --------------------------------------------------------------------------------------- Use of this source code is governed by the GPL v3 license that can be found in the COPYING file or at http://www.gnu.org/licenses/gpl-3.0.html This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --------------------------------------------------------------------------------------- */ #ifndef ANH_CHATSERVER_PLAYER_H #define ANH_CHATSERVER_PLAYER_H #include <map> #include "Utils/typedefs.h" #include "Utils/bstring.h" class DispatchClient; //====================================================================================================================== typedef std::map<uint32,BString> ContactMap; //====================================================================================================================== struct Bazaar { uint64 ownerid; uint64 id; uint32 regionid; uint32 planetid; int8 string[128]; int8 planet[32]; int8 region[48]; }; struct PlayerData { BString name; BString last_name; }; class Player { public: Player(uint64 charId,DispatchClient* client,uint32 planetId) : mBazaar(nullptr) , mClient(client) , mCharId(charId) , mGroupId(0) , mKey(0) , mPlanetId(planetId) , mX(0) , mZ(0) , mGroupMemberIndex(0) , mAddPending(true) {} ~Player() {} uint64 getCharId() { return mCharId; } void setCharId(uint64 charId) { mCharId = charId; } BString& getName() { return mPlayerData.name; } void setName(const BString name) { mPlayerData.name = name; } PlayerData* getPlayerData() { return &mPlayerData; } BString& getLastName() { return mPlayerData.last_name; } void setLastName(const BString lastName) { mPlayerData.last_name = lastName; } DispatchClient* getClient() { return mClient; } void setClient(DispatchClient* client) { mClient = client; } uint32 getPlanetId() { return mPlanetId; } void setPlanetId(uint32 planetId) { mPlanetId = planetId; } bool getAddPending() { return mAddPending; } void setAddPending(bool b) { mAddPending = b; } uint32 getKey() { return mKey; } void setKey() { BString name = getName(); name.toLower(); mKey = name.getCrc(); } ContactMap* getFriendsList() { return &mFriendsList; } void addFriend(BString name) { mFriendsList.insert(std::make_pair(name.getCrc(),name.getAnsi())); } void removeFriend(uint32 nameCrc); bool checkFriend(uint32 nameCrc); ContactMap* getIgnoreList() { return &mIgnoreList; } void addIgnore(BString name) { mIgnoreList.insert(std::make_pair(name.getCrc(),name.getAnsi())); } void removeIgnore(uint32 nameCrc); bool checkIgnore(uint32 nameCrc); uint16 getGroupMemberIndex() { return mGroupMemberIndex; } void setGroupMemberIndex(uint16 index) { mGroupMemberIndex = index; } uint64 getGroupId() { return mGroupId; } void setGroupId(uint64 groupId) { mGroupId = groupId; } void setPositionX(float position) { mX = position; } float getPositionX() { return mX; } void setBazaar(Bazaar* bazaar) { mBazaar = bazaar; } Bazaar* getBazaar() { return mBazaar; } void setPositionZ(float position) { mZ = position; } float getPositionZ() { return mZ; } private: ContactMap mFriendsList,mIgnoreList; PlayerData mPlayerData; Bazaar* mBazaar; DispatchClient* mClient; uint64 mCharId; uint64 mGroupId; uint32 mKey; uint32 mPlanetId; float mX; float mZ; uint16 mGroupMemberIndex; bool mAddPending; }; #endif
/* =========================================================================== Doom 3 GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?). Doom 3 Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Doom 3 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 Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #if !defined(AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_) #define AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // DialogInfo.h : header file // ///////////////////////////////////////////////////////////////////////////// // CDialogInfo dialog void HideInfoDialog(); void ShowInfoDialog(const char *pText); class CDialogInfo : public CDialog { // Construction public: CDialogInfo(CWnd *pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDialogInfo) enum { IDD = IDD_DLG_INFORMATION }; CEdit m_wndInfo; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDialogInfo) protected: virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CDialogInfo) virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DIALOGINFO_H__81DF2A33_A552_11D1_B58E_00AA00A410FC__INCLUDED_)
/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*- ******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * THIS IS UNPUBLISHED SOURCE CODE OF create3000. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 1999, 2016 Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the Titania Project. * * Titania is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * Titania 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with Titania. If not, see <http://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ #ifndef __TITANIA_INPUT_OUTPUT_NUMBER_H__ #define __TITANIA_INPUT_OUTPUT_NUMBER_H__ #include <istream> #include <string> #include "../LOG.h" namespace titania { namespace io { /** * Template to represent a number match agains a std::basic_istream. * * Extern instantiations for char and wchar are part of the * library. Results with any other type are not guaranteed. * * @param CharT Type of characters. * @param Traits Character traits */ template <class Type, class CharT, class Traits = std::char_traits <CharT>> class basic_number { public: /// @name Construction /// Constructs the io::basic_number. A std::basic_istream can then be tested against the number type. constexpr basic_number (); /// @name Operations /// Test whether the next characters in @a istream are a number. Returns true on success and changes /// @a istreams position to the next character after the matched characters otherwise it returns false and doesn't /// changes the streams current position. bool operator () (std::basic_istream <CharT, Traits> & istream, Type & value) const; }; template <class Type, class CharT, class Traits> inline constexpr basic_number <Type, CharT, Traits>::basic_number () { } template <class Type, class CharT, class Traits> bool basic_number <Type, CharT, Traits>::operator () (std::basic_istream <CharT, Traits> & istream, Type & value) const { const auto state = istream .rdstate (); const auto pos = istream .tellg (); Type v; if (istream >> std::dec >> v) { value = v; return true; } istream .clear (state); for (size_t i = 0, size = istream .tellg () - pos; i < size; ++ i) istream .unget (); return false; } template <class Type> using number = basic_number <Type, char>; template <class Type> using wnumber = basic_number <Type, wchar_t>; } // io } // titania #endif
/*************************************************************************** $RCSfile$ ------------------- begin : Mon Jan 07 2008 copyright : (C) 2008 by Martin Preuss email : martin@libchipcard.de *************************************************************************** * Please see toplevel file COPYING for license details * ***************************************************************************/ #ifndef AIO_OFX_G_INVPOSLIST_L_H #define AIO_OFX_G_INVPOSLIST_L_H #include "ofxgroup_l.h" AIO_OFX_GROUP *AIO_OfxGroup_INVPOSLIST_new(const char *groupName, AIO_OFX_GROUP *parent, GWEN_XML_CONTEXT *ctx); #endif
#ifndef _HDD_ #define _HDD_ #pragma pack (push, 1) typedef struct _hdd_inf { u8 flags; u8 max_head; u8 max_sect; } hdd_inf; #define HDD_OK 0x01 #define HDD_LBA 0x02 typedef struct _partition { u8 hdd_n; /* HDD number */ u8 flags; /* partition flags */ u64 begin; /* partition offset */ u64 size; /* partition length */ } partition; #define PT_ACTIVE 0x01 #define PT_EXTENDED 0x02 #pragma pack (pop) #define SECT_SHIFT 9 #define HDD_MAX 16 /* maximum number of HDD's */ #define PART_MAX 64 /* maximum number of partitions */ #define dos2hdd(_x) ((((_x) >= 0x80) && ((_x) <= 0x8F)) ? (_x) - 0x80 : -1) #define hdd2dos(_x) ( (_x) + 0x80 ) #endif
/*! @file @verbatim $Id: AVIXOffsetData.h 52604 2008-04-23 05:33:29Z jbraness $ Copyright (c) 2006-2007 DivX, Inc. All rights reserved. This software is the confidential and proprietary information of DivX, Inc. and may be used only in accordance with the terms of your license from DivX, Inc. @endverbatim */ #ifndef _AVIXOFFSETDATA_H_ #define _AVIXOFFSETDATA_H_ typedef struct _AVIXOffsetData_t { uint64_t avixOffset; uint64_t moviOffset; uint32_t moviSize; uint64_t idx1Offset; uint64_t numIdx1Entries; uint64_t avixIdx; } AVIXOffsetData_t; #endif /* _AVIXOFFSETDATA_H_ */
#ifndef KEP_TOOL_CONFIG_H #define KEP_TOOL_CONFIG_H /// The following lines define the behaviour of the symbols that will be included in libraries. These are, by default, /// made visible in unix systems, otherwise they need to be made visible explicitely in windows systems #ifdef _WIN32 #ifdef KEP_TOOL_DLL_EXPORT_API #define __KEP_TOOL_VISIBLE __declspec(dllexport) #elif defined ( KEP_TOOL_DLL_IMPORT_API ) #define __KEP_TOOL_VISIBLE __declspec(dllimport) #else #define __KEP_TOOL_VISIBLE #endif #define __KEP_TOOL_VISIBLE_FUNC __KEP_TOOL_VISIBLE #else #define __KEP_TOOL_VISIBLE __attribute__ ((visibility("default"))) #define __KEP_TOOL_VISIBLE_FUNC #endif #endif
#pragma once #include <vector> #include "Entity.h" #include "Map.h" struct EntityRenderer { void renderPolygon( std::vector<SVector2Df>& listPoints, Map<char>& map, char character); void renderCircle( SVector2Df point, float ratio, Map<char>& map, char character); void renderPoints ( std::vector<SVector2Df>& listPoints, Map<char>& map, char character); void renderLines ( std::vector<SVector2Df>& listPoints, Map<char>& map, char character); void render( std::vector<Entity*>& listEntity, Map<char>& map); };
/* Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG */ #if !defined(AFX_VMSAPPUTIL_H__E0C0FA99_0E90_4A12_9D11_213C6C368ADB__INCLUDED_) #define AFX_VMSAPPUTIL_H__E0C0FA99_0E90_4A12_9D11_213C6C368ADB__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif class vmsAppUtil { public: static fsInternetResult UrlDownloadToFile (LPCSTR pszUrl, LPCSTR pszFileName); vmsAppUtil(); virtual ~vmsAppUtil(); }; #endif
/** @file Image1.h @maintainer Morgan McGuire, http://graphics.cs.williams.edu @created 2007-01-31 @edited 2007-01-31 */ #ifndef G3D_IMAGE1_H #define G3D_IMAGE1_H #include "G3D/platform.h" #include "G3D/Map2D.h" #include "G3D/Color1.h" #include "G3D/GImage.h" namespace G3D { typedef ReferenceCountedPointer<class Image1> Image1Ref; /** Luminance image with 32-bit floating point storage. See also G3D::Image1uint8, G3D::GImage. */ class Image1 : public Map2D<Color1, Color1> { public: typedef Image1 Type; typedef ReferenceCountedPointer<class Image1> Ref; typedef Color1 Storage; typedef Color1 Compute; protected: Image1(int w, int h, WrapMode wrap); void copyGImage(const class GImage& im); void copyArray(const Color1* src, int w, int h); void copyArray(const Color3* src, int w, int h); void copyArray(const Color4* src, int w, int h); void copyArray(const Color1uint8* src, int w, int h); void copyArray(const Color3uint8* src, int w, int h); void copyArray(const Color4uint8* src, int w, int h); public: const class ImageFormat* format() const; /** Creates an all-zero width x height image. */ static Ref createEmpty(int width, int height, WrapMode wrap = WrapMode::ERROR); /** Creates a 0 x 0 image. */ static Ref createEmpty(WrapMode wrap = WrapMode::ERROR); static Ref fromFile(const std::string& filename, WrapMode wrap = WrapMode::ERROR, GImage::Format fmt = GImage::AUTODETECT); static Ref fromArray(const class Color1uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); static Ref fromArray(const class Color3uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); static Ref fromArray(const class Color4uint8* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); static Ref fromArray(const class Color1* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); static Ref fromArray(const class Color3* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); static Ref fromArray(const class Color4* ptr, int width, int height, WrapMode wrap = WrapMode::ERROR); static Ref fromImage1uint8(const ReferenceCountedPointer<class Image1uint8>& im); static Ref fromGImage(const class GImage& im, WrapMode wrap = WrapMode::ERROR); /** Loads from any of the file formats supported by G3D::GImage. If there is an alpha channel on the input, it is stripped. */ void load(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); /** Saves in any of the formats supported by G3D::GImage. */ void save(const std::string& filename, GImage::Format fmt = GImage::AUTODETECT); }; } // G3D #endif
/******************************************************************************/ /*Files to Include */ /******************************************************************************/ #include <xc.h> /* HiTech General Includes */ #include <stdint.h> /* For uint8_t definition */ #include <stdbool.h> /* For true/false definition */ #include "system.h" /******************************************************************************/ /* Interrupt Routines */ /******************************************************************************/ void interrupt isr(void) { if (RABIF){ /* PORTA/B interrupt */ RABIF = 0; __delay_ms(20); if(ENC_SW == 0){ /* Set appropriate system flag */ system_flags = (system_flags | ENCODER_BUTTON_PRESSED); } if (EXT_LID == 0){ system_flags = (system_flags | LID_OPEN); } } if (TMR1IF) { /* Timer1 interrupt */ TMR1IF = 0; system_flags = (system_flags | TIMER1_OVERFLOW); } }
typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; typedef char int8; typedef short int16; typedef int int32;
/*************************************************************************************** * Genesis Plus * Virtual System Emulation * * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald (original code) * Eke-Eke (2007-2011), additional code & fixes for the GCN/Wii port * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************************/ #ifndef _SYSTEM_H_ #define _SYSTEM_H_ #include "genplus-config.h" #ifndef NO_SYSTEM_PBC #define SYSTEM_PBC 0x00 #endif #define SYSTEM_GENESIS 0x01 #define SYSTEM_MEGADRIVE 0x02 #define SYSTEM_PICO 0x03 #define MCYCLES_PER_LINE 3420 /* Horizontal timing offsets when running in Z80 mode */ #define SMS_CYCLE_OFFSET 520 #define PBC_CYCLE_OFFSET 550 struct t_bitmap { uint8 *data; /* Bitmap data */ int height; /* Bitmap height */ int pitch; /* Width of bitmap in bytes */ struct { int x; /* X offset of viewport within bitmap */ int y; /* Y offset of viewport within bitmap */ int w; /* Width of viewport */ int h; /* Height of viewport */ int ow; /* Previous width of viewport */ int oh; /* Previous height of viewport */ int changed; /* 1= Viewport width or height have changed */ } viewport; }; typedef struct { int sample_rate; /* Output Sample rate (8000-48000) */ float frame_rate; /* Output Frame rate (usually 50 or 60 frames per second) */ float cddaRatio; int enabled; /* 1= sound emulation is enabled */ int buffer_size; /* Size of sound buffer (in bytes) */ struct { FMSampleType *pos; FMSampleType *buffer; } fm; struct { int16 *pos; int16 *buffer; } psg; } t_snd; /* Global variables */ extern t_bitmap bitmap; extern t_snd snd; //extern uint32 mcycles_z80; //extern uint32 mcycles_68k; extern uint32 mcycles_vdp; extern uint8 system_hw; /* Function prototypes */ extern int audio_init(int samplerate,float framerate); extern void audio_reset(void); extern void audio_shutdown(void); extern int audio_update(int16 *sb); extern void audio_set_equalizer(void); extern void system_init(void); extern void system_reset(void); extern void system_shutdown(void); extern void (*system_frame)(int do_skip, uint renderGfx); static bool emuSystemIs16Bit() { return system_hw != SYSTEM_PBC; } #endif /* _SYSTEM_H_ */
#pragma once #include "Constants.h" #include "Entity.h" CLASS(Enemy) { Entity* entity; }; Enemy* Enemy_createWhiteKnight(struct Scene* scene, SDL_Point tilePos); void Enemy_draw(void* context, SDL_Renderer* renderer, Camera* camera); void Enemy_update(void* context, RawTime dt); void Enemy_update(void* context, RawTime dt); void Enemy_destroy(void* context);