text
stringlengths
4
6.14k
#include <stdio.h> #define _gc() getchar_unlocked() #define _pc(x) putchar_unlocked(x) #define NL() putchar_unlocked('\n') #define SS(x) scanf("%s",&x) #define PS(x) printf("%s",x) #define SC(x) scanf("%c",&x) #define PC(x) scanf("%c",x) typedef long long int I; inline I getint(){I x=0,c=_gc();while(!(c>='0'&&c<='9')){c=_gc();}while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+(c-'0');c=_gc();}return x;} inline void putint(I n){I N=n,r=n,c=0;if(N==0){_pc('0');return;}while(r%10==0){c++;r/=10;}r=0;while(N!=0){r=(r<<3)+(r<<1)+N%10;N/=10;}while(r!=0){_pc(r%10+'0');r/=10;}while(c--){_pc('0');}} int main(){ return 0; }
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2020 Scientific Computing and Imaging Institute, University of Utah. 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 MODULES_LEGACY_FIELDS_INTERFACEWITHTETGENIMPL_H__ #define MODULES_LEGACY_FIELDS_INTERFACEWITHTETGENIMPL_H__ #include <Dataflow/Network/Module.h> #include <deque> #include <Modules/Legacy/Fields/share.h> namespace SCIRun { namespace Modules { namespace Fields { //TODO: convert to proper algo class struct SCISHARE InterfaceWithTetGenInput { InterfaceWithTetGenInput(); bool piecewiseFlag_; // -p bool assignFlag_; // -A bool setNonzeroAttributeFlag_; // -AA bool suppressSplitFlag_; // -Y bool setSplitFlag_; // -YY bool qualityFlag_; // -q bool setRatioFlag_; // -q bool volConstraintFlag_; // -a bool setMaxVolConstraintFlag_; // -a double minRadius_; double maxVolConstraint_; bool detectIntersectionsFlag_; // -d std::string moreSwitches_; // additional flags std::string fillCommandOptions(bool addPoints) const; }; namespace detail { class InterfaceWithTetGenImplImpl; } class SCISHARE InterfaceWithTetGenImpl { public: InterfaceWithTetGenImpl(Dataflow::Networks::Module* mod, const InterfaceWithTetGenInput& input); FieldHandle runImpl(const std::deque<FieldHandle>& surfaces, FieldHandle points, FieldHandle region_attribs) const; private: SharedPointer<detail::InterfaceWithTetGenImplImpl> impl_; InterfaceWithTetGenInput inputFlags_; }; } } } #endif
#if defined(PEGASUS_OS_HPUX) # include "UNIX_StorageRedundancySetPrivate_HPUX.h" #elif defined(PEGASUS_OS_LINUX) # include "UNIX_StorageRedundancySetPrivate_LINUX.h" #elif defined(PEGASUS_OS_DARWIN) # include "UNIX_StorageRedundancySetPrivate_DARWIN.h" #elif defined(PEGASUS_OS_AIX) # include "UNIX_StorageRedundancySetPrivate_AIX.h" #elif defined(PEGASUS_OS_FREEBSD) # include "UNIX_StorageRedundancySetPrivate_FREEBSD.h" #elif defined(PEGASUS_OS_SOLARIS) # include "UNIX_StorageRedundancySetPrivate_SOLARIS.h" #elif defined(PEGASUS_OS_ZOS) # include "UNIX_StorageRedundancySetPrivate_ZOS.h" #elif defined(PEGASUS_OS_VMS) # include "UNIX_StorageRedundancySetPrivate_VMS.h" #elif defined(PEGASUS_OS_TRU64) # include "UNIX_StorageRedundancySetPrivate_TRU64.h" #else # include "UNIX_StorageRedundancySetPrivate_STUB.h" #endif
// // Created by Konstantin Kukin on 26/12/16. // #ifndef TGBOT_INPUTLOCATIONMESSAGECONTENT_H #define TGBOT_INPUTLOCATIONMESSAGECONTENT_H #include <memory> namespace TgBot { /** * Represents the content of a location message to be sent as the result of an inline query. * @ingroup types */ class InputLocationMessageContent : public InputMessageContent { public: typedef std::shared_ptr<InputLocationMessageContent> Ptr; InputLocationMessageContent() : InputMessageContent("InputLocationMessageContent") {} /** * Latitude of the location in degrees */ float latitude; /** * Longitude of the location in degrees */ float longitude; virtual ~InputLocationMessageContent() { } }; } #endif //TGBOT_INPUTLOCATIONMESSAGECONTENT_H
#ifndef BMI_STORM_H_INCLUDED #define BMI_STORM_H_INCLUDED #if defined(__cplusplus) extern "C" { #endif #include "bmi.h" BMI_Model* register_bmi_storm(BMI_Model *model); #if defined(__cplusplus) } #endif #endif
// // The orbs // #ifndef _ORB_ #define _ORB_ // // The size of the arena the orbs are contained in. // #define ORB_ARENA (32.0F) // // The orbs // #define ORB_FLAG_USED (1 << 0) #define ORB_FLAG_COLLIDED (1 << 1) // Collided with the landscape last process typedef struct { ULONG flag; float x; float y; float mass; float radius; float dx; float dy; } ORB_Orb; #define ORB_MAX_ORBS 16 extern ORB_Orb ORB_orb[ORB_MAX_ORBS]; // // Init the orbs. // void ORB_init(void); // // Create a new orb. Returns NULL on failure. // ORB_Orb *ORB_create(float x, float y, float radius); // // Processes one gameturn of all the orbs. // void ORB_process_all(void); // // Draws all the orbs. // void ORB_draw_all(float mid_x, float mid_y, float zoom); #endif
/*============================================================================== Copyright (c) 2012 QUALCOMM Austria Research Center GmbH. All Rights Reserved. Qualcomm Confidential and Proprietary @file VideoBackgroundConfig.h @brief Header file for VideoBackgroundConfig struct. ==============================================================================*/ #ifndef _QCAR_VIDEOBACKGROUNDCONFIG_H_ #define _QCAR_VIDEOBACKGROUNDCONFIG_H_ // Include files #include <QCAR/Vectors.h> namespace QCAR { /// Video background configuration struct VideoBackgroundConfig { /// Enables/disables rendering of the video background. bool mEnabled; /// Enables/disables synchronization of video background and tracking data. /** * Depending on the video background rendering mode this may not always be * possible. If deactivated the video background always shows the latest * camera image. */ bool mSynchronous; /// Relative position of the video background in the render target in /// pixels. /** * Describes the offset of the center of video background to the * center of the screen (viewport) in pixels. A value of (0,0) centers the * video background, whereas a value of (-10,15) moves the video background * 10 pixels to the left and 15 pixels upwards. */ Vec2I mPosition; /// Width and height of the video background in pixels /** * Using the device's screen size for this parameter scales the image to * fullscreen. Notice that if the camera's aspect ratio is different than * the screen's aspect ratio this will create a non-uniform stretched * image. */ Vec2I mSize; }; } // namespace QCAR #endif //_QCAR_RENDERER_H_
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef AV_AUDIOOUTPUT_H #define AV_AUDIOOUTPUT_H #include <phonon/audiooutputinterface.h> #include <QtCore/QObject> class AVAudioOutput : public QObject, public Phonon::AudioOutputInterface { Q_OBJECT Q_INTERFACES(Phonon::AudioOutputInterface) public: AVAudioOutput(QObject *parent); ~AVAudioOutput(); qreal volume() const; void setVolume(qreal value); int outputDevice() const; bool setOutputDevice(int newDevice); Q_SIGNALS: void audioDeviceFailed(); void volumeChanged(qreal); private: qreal m_volume; }; #endif // AV_AUDIOOUTPUT_H
#import <React/RCTBridgeModule.h> #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, RNImagePickerTarget) { camera = 1, library }; @interface ImagePickerManager : NSObject <RCTBridgeModule> @end
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #ifndef GLOBALSTATE_H #define GLOBALSTATE_H #ifdef _WIN32 #pragma once #endif typedef enum { GLOBAL_OFF = 0, GLOBAL_ON = 1, GLOBAL_DEAD = 2 } GLOBALESTATE; void GlobalEntity_SetState( int globalIndex, GLOBALESTATE state ); void GlobalEntity_SetMap( int globalIndex, string_t mapname ); int GlobalEntity_Add( const char *pGlobalname, const char *pMapName, GLOBALESTATE state ); int GlobalEntity_GetIndex( const char *pGlobalname ); GLOBALESTATE GlobalEntity_GetState( int globalIndex ); const char *GlobalEntity_GetMap( int globalIndex ); const char *GlobalEntity_GetName( int globalIndex ); int GlobalEntity_GetNumGlobals( void ); void GlobalEntity_EnableStateUpdates( bool bEnable ); inline int GlobalEntity_Add( string_t globalname, string_t mapName, GLOBALESTATE state ) { return GlobalEntity_Add( STRING(globalname), STRING(mapName), state ); } inline int GlobalEntity_GetIndex( string_t globalname ) { return GlobalEntity_GetIndex( STRING(globalname) ); } inline int GlobalEntity_IsInTable( string_t globalname ) { return GlobalEntity_GetIndex( STRING(globalname) ) >= 0 ? true : false; } inline int GlobalEntity_IsInTable( const char *pGlobalname ) { return GlobalEntity_GetIndex( pGlobalname ) >= 0 ? true : false; } inline void GlobalEntity_SetState( string_t globalname, GLOBALESTATE state ) { GlobalEntity_SetState( GlobalEntity_GetIndex( globalname ), state ); } inline void GlobalEntity_SetMap( string_t globalname, string_t mapname ) { GlobalEntity_SetMap( GlobalEntity_GetIndex( globalname ), mapname ); } inline GLOBALESTATE GlobalEntity_GetState( string_t globalname ) { return GlobalEntity_GetState( GlobalEntity_GetIndex( globalname ) ); } inline GLOBALESTATE GlobalEntity_GetState( const char *pGlobalName ) { return GlobalEntity_GetState( GlobalEntity_GetIndex( pGlobalName ) ); } inline GLOBALESTATE GlobalEntity_GetStateByIndex( int iIndex ) { return GlobalEntity_GetState( iIndex ); } void ResetGlobalState( void ); #endif // GLOBALSTATE_H
/* * Auto generated Run-Time-Environment Component Configuration File * *** Do not modify ! *** * * Project: 'App' * Target: 'App_Stand' */ #ifndef RTE_COMPONENTS_H #define RTE_COMPONENTS_H #endif /* RTE_COMPONENTS_H */
#include <stdio.h> #define TABSTOP 4 main(int argc, char *argv[]) { int i,c,tab; int tabstop=TABSTOP; while(--argc > 0 && (*++argv)[0]=='-') while(c=*++argv[0]) switch(c){ case 't': break; default: argc=0; break; } if(argc > 0) tabstop=atoi(*argv); tab=0; while ((c=getchar())!=EOF){ if(c == ' ') ++tab; else{ for(i = 0; i < tab ; ++i) putchar(' '); putchar(c); tab=0; } if(tab==tabstop){ putchar('\t'); tab=0; } } return 0; }
#include "substdio.h" #include "subfd.h" #include "stralloc.h" #include "dns.h" #include "dnsdoe.h" #include "ip.h" #include "ipalloc.h" #include "exit.h" stralloc sa = {0}; ipalloc ia = {0}; void main(argc,argv) int argc; char **argv; { if (!argv[1]) _exit(100); if (!stralloc_copys(&sa,argv[1])) { substdio_putsflush(subfderr,"out of memory\n"); _exit(111); } dns_init(1); dnsdoe(dns_ip(&ia,&sa)); if (ia.len <= 0) { substdio_putsflush(subfderr,"no IP addresses\n"); _exit(100); } dnsdoe(dns_ptr(&sa,&ia.ix[0].ip)); substdio_putflush(subfdout,sa.s,sa.len); substdio_putsflush(subfdout,"\n"); _exit(0); }
30 mtime=1384256622.573415309 29 atime=1394144033.82212979 30 ctime=1384256622.573415309
/* * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include BOSS_OPENSSL_V_openssl__opensslconf_h //original-code:<openssl/opensslconf.h> #if OPENSSL_API_COMPAT >= 0x00908000L NON_EMPTY_TRANSLATION_UNIT #else # include BOSS_OPENSSL_V_openssl__evp_h //original-code:<openssl/evp.h> /* * Define some deprecated functions, so older programs don't crash and burn * too quickly. On Windows and VMS, these will never be used, since * functions and variables in shared libraries are selected by entry point * location, not by name. */ # ifndef OPENSSL_NO_BF # undef EVP_bf_cfb const EVP_CIPHER *EVP_bf_cfb(void); const EVP_CIPHER *EVP_bf_cfb(void) { return EVP_bf_cfb64(); } # endif # ifndef OPENSSL_NO_DES # undef EVP_des_cfb const EVP_CIPHER *EVP_des_cfb(void); const EVP_CIPHER *EVP_des_cfb(void) { return EVP_des_cfb64(); } # undef EVP_des_ede3_cfb const EVP_CIPHER *EVP_des_ede3_cfb(void); const EVP_CIPHER *EVP_des_ede3_cfb(void) { return EVP_des_ede3_cfb64(); } # undef EVP_des_ede_cfb const EVP_CIPHER *EVP_des_ede_cfb(void); const EVP_CIPHER *EVP_des_ede_cfb(void) { return EVP_des_ede_cfb64(); } # endif # ifndef OPENSSL_NO_IDEA # undef EVP_idea_cfb const EVP_CIPHER *EVP_idea_cfb(void); const EVP_CIPHER *EVP_idea_cfb(void) { return EVP_idea_cfb64(); } # endif # ifndef OPENSSL_NO_RC2 # undef EVP_rc2_cfb const EVP_CIPHER *EVP_rc2_cfb(void); const EVP_CIPHER *EVP_rc2_cfb(void) { return EVP_rc2_cfb64(); } # endif # ifndef OPENSSL_NO_CAST # undef EVP_cast5_cfb const EVP_CIPHER *EVP_cast5_cfb(void); const EVP_CIPHER *EVP_cast5_cfb(void) { return EVP_cast5_cfb64(); } # endif # ifndef OPENSSL_NO_RC5 # undef EVP_rc5_32_12_16_cfb const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) { return EVP_rc5_32_12_16_cfb64(); } # endif # undef EVP_aes_128_cfb const EVP_CIPHER *EVP_aes_128_cfb(void); const EVP_CIPHER *EVP_aes_128_cfb(void) { return EVP_aes_128_cfb128(); } # undef EVP_aes_192_cfb const EVP_CIPHER *EVP_aes_192_cfb(void); const EVP_CIPHER *EVP_aes_192_cfb(void) { return EVP_aes_192_cfb128(); } # undef EVP_aes_256_cfb const EVP_CIPHER *EVP_aes_256_cfb(void); const EVP_CIPHER *EVP_aes_256_cfb(void) { return EVP_aes_256_cfb128(); } #endif
/** ****************************************************************************** * @file CortexM/BitBand/stm32f4xx_it.c * @author MCD Application Team * @version V1.3.0 * @date 13-November-2013 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_it.h" /** @addtogroup STM32F4xx_StdPeriph_Examples * @{ */ /** @addtogroup CortexM4_BitBand * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f40xx.s/startup_stm32f427x.s). */ /******************************************************************************/ /** * @brief This function handles PPP interrupt request. * @param None * @retval None */ /*void PPP_IRQHandler(void) { }*/ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* u8x8_message.c Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) Copyright (c) 2016, olikraus@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "u8x8.h" uint8_t u8x8_draw_button_line(u8x8_t *u8x8, uint8_t y, uint8_t w, uint8_t cursor, const char *s) { uint8_t i; uint8_t cnt; uint8_t total; uint8_t d; uint8_t x; cnt = u8x8_GetStringLineCnt(s); /* calculate the width of the button */ total = 0; for( i = 0; i < cnt; i++ ) { total += u8x8_GetUTF8Len(u8x8, u8x8_GetStringLineStart(i, s)); } total += (cnt-1); /* had one space between the buttons */ /* calculate the left offset */ d = 0; if ( total < w ) { d = w; d -= total; d /= 2; } /* draw the buttons */ x = d; u8x8_SetInverseFont(u8x8, 0); for( i = 0; i < cnt; i++ ) { if ( i == cursor ) u8x8_SetInverseFont(u8x8, 1); x+=u8x8_DrawUTF8(u8x8, x, y, u8x8_GetStringLineStart(i, s)); u8x8_SetInverseFont(u8x8, 0); x+=u8x8_DrawUTF8(u8x8, x, y, " "); } /* return the number of buttons */ return cnt; } /* title1: Multiple lines,separated by '\n' title2: A single line/string which is terminated by '\0' or '\n' . "title2" accepts the return value from u8x8_GetStringLineStart() title3: Multiple lines,separated by '\n' buttons: one more more buttons separated by '\n' and terminated with '\0' */ uint8_t u8x8_UserInterfaceMessage(u8x8_t *u8x8, const char *title1, const char *title2, const char *title3, const char *buttons) { uint8_t height; uint8_t y; uint8_t cursor = 0; uint8_t button_cnt; uint8_t event; u8x8_SetInverseFont(u8x8, 0); /* calculate overall height of the message box */ height = 1; /* button line */ height += u8x8_GetStringLineCnt(title1); if ( title2 != NULL ) height ++; height += u8x8_GetStringLineCnt(title3); /* calculate offset from top */ y = 0; if ( height < u8x8_GetRows(u8x8) ) { y = u8x8_GetRows(u8x8); y -= height; y /= 2; } /* draw message box */ u8x8_ClearDisplay(u8x8); /* required, because not everything is filled */ y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title1); if ( title2 != NULL ) { u8x8_DrawUTF8Line(u8x8, 0, y, u8x8_GetCols(u8x8), title2); y++; } y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title3); button_cnt = u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons); for(;;) { event = u8x8_GetMenuEvent(u8x8); if ( event == U8X8_MSG_GPIO_MENU_SELECT ) return cursor+1; else if ( event == U8X8_MSG_GPIO_MENU_HOME ) break; else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP ) { cursor++; if ( cursor >= button_cnt ) cursor = 0; u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons); } else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN ) { if ( cursor == 0 ) cursor = button_cnt; cursor--; u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons); } } return 0; }
#ifndef __adc_h__ #define __adc_h__ extern uint16_t analog_read(uint8_t); extern void adc_init(void); #endif
#include <string> #ifndef _Person_H #define _Person_H class Person { protected: std::string firstname; std::string lastname; public: Person(std::string first, std::string last); ~Person(); std::string GetName(); void SetFirstName(std::string name); //copy constructor Person(const Person& p); }; #endif
/// \file /// \brief \b [Internal] Generates a huffman encoding tree, used for string and global compression. /// /// This file is part of RakNet Copyright 2003 Kevin Jenkins. /// /// Usage of RakNet is subject to the appropriate license agreement. /// Creative Commons Licensees are subject to the /// license found at /// http://creativecommons.org/licenses/by-nc/2.5/ /// Single application licensees are subject to the license found at /// http://www.jenkinssoftware.com/SingleApplicationLicense.html /// Custom license users are subject to the terms therein. /// GPL license users are subject to 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 __HUFFMAN_ENCODING_TREE #define __HUFFMAN_ENCODING_TREE #include "RakMemoryOverride.h" #include "DS_HuffmanEncodingTreeNode.h" #include "BitStream.h" #include "Export.h" #include "DS_LinkedList.h" /// This generates special cases of the huffman encoding tree using 8 bit keys with the additional condition that unused combinations of 8 bits are treated as a frequency of 1 class RAK_DLL_EXPORT HuffmanEncodingTree : public RakNet::RakMemoryOverride { public: HuffmanEncodingTree(); ~HuffmanEncodingTree(); /// Pass an array of bytes to array and a preallocated BitStream to receive the output /// \param [in] input Array of bytes to encode /// \param [in] sizeInBytes size of \a input /// \param [out] output The bitstream to write to void EncodeArray( unsigned char *input, size_t sizeInBytes, RakNet::BitStream * output ); // Decodes an array encoded by EncodeArray() unsigned DecodeArray( RakNet::BitStream * input, BitSize_t sizeInBits, size_t maxCharsToWrite, unsigned char *output ); void DecodeArray( unsigned char *input, BitSize_t sizeInBits, RakNet::BitStream * output ); /// Given a frequency table of 256 elements, all with a frequency of 1 or more, generate the tree void GenerateFromFrequencyTable( unsigned int frequencyTable[ 256 ] ); /// Free the memory used by the tree void FreeMemory( void ); private: /// The root node of the tree HuffmanEncodingTreeNode *root; /// Used to hold bit encoding for one character struct CharacterEncoding { unsigned char* encoding; unsigned short bitLength; }; CharacterEncoding encodingTable[ 256 ]; void InsertNodeIntoSortedList( HuffmanEncodingTreeNode * node, DataStructures::LinkedList<HuffmanEncodingTreeNode *> *huffmanEncodingTreeNodeList ) const; }; #endif
// // KeyboardLetterLayer.h // SoundBoard // // Created by Klein, Greg on 1/23/15. // Copyright (c) 2015 Pure Virtual Studios, LLC. All rights reserved. // #import <QuartzCore/QuartzCore.h> #import "KeyboardTypedefs.h" @import UIKit; @interface KeyboardKeyLayer : CATextLayer + (instancetype)layerWithText:(NSString*)text keyType:(KeyboardKeyType)type; - (void)makeTextBold; - (void)makeTextRegular; - (void)makeTextUnderlined; - (void)removeTextUnderline; - (void)makeTextUppercase; - (void)makeTextLowercase; - (void)applyHighlight; - (void)removeHighlight; - (void)updateText:(NSString*)text; @end
// // This source file is part of appleseed. // Visit http://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited // Copyright (c) 2014-2017 Francois Beaune, The appleseedhq Organization // // 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 APPLESEED_RENDERER_MODELING_ENVIRONMENTEDF_CONSTANTHEMISPHEREENVIRONMENTEDF_H #define APPLESEED_RENDERER_MODELING_ENVIRONMENTEDF_CONSTANTHEMISPHEREENVIRONMENTEDF_H // appleseed.renderer headers. #include "renderer/modeling/environmentedf/ienvironmentedffactory.h" // appleseed.foundation headers. #include "foundation/platform/compiler.h" #include "foundation/utility/autoreleaseptr.h" // appleseed.main headers. #include "main/dllsymbol.h" // Forward declarations. namespace foundation { class Dictionary; } namespace foundation { class DictionaryArray; } namespace renderer { class EnvironmentEDF; } namespace renderer { class ParamArray; } namespace renderer { // // Per-hemisphere constant-emittance environment EDF factory. // class APPLESEED_DLLSYMBOL ConstantHemisphereEnvironmentEDFFactory : public IEnvironmentEDFFactory { public: // Delete this instance. void release() override; // Return a string identifying this environment EDF model. const char* get_model() const override; // Return metadata for this environment EDF model. foundation::Dictionary get_model_metadata() const override; // Return metadata for the inputs of this environment EDF model. foundation::DictionaryArray get_input_metadata() const override; // Create a new environment EDF instance. foundation::auto_release_ptr<EnvironmentEDF> create( const char* name, const ParamArray& params) const override; }; } // namespace renderer #endif // !APPLESEED_RENDERER_MODELING_ENVIRONMENTEDF_CONSTANTHEMISPHEREENVIRONMENTEDF_H
#include "mlvalues.h" #include "memory.h" #include "callback.h" value mycallback1(value fun, value arg) { value res; res = callback(fun, arg); return res; } value mycallback2(value fun, value arg1, value arg2) { value res; res = callback2(fun, arg1, arg2); return res; } value mycallback3(value fun, value arg1, value arg2, value arg3) { value res; res = callback3(fun, arg1, arg2, arg3); return res; } value mycallback4(value fun, value arg1, value arg2, value arg3, value arg4) { value args[4]; value res; args[0] = arg1; args[1] = arg2; args[2] = arg3; args[3] = arg4; res = callbackN(fun, 4, args); return res; } value mypushroot(value v, value fun, value arg) { Begin_root(v) callback(fun, arg); End_roots(); return v; } value mycamlparam (value v, value fun, value arg) { CAMLparam3 (v, fun, arg); CAMLlocal2 (x, y); x = v; y = callback (fun, arg); v = x; CAMLreturn (v); }
/******************************************************************************* *//** * @mainpage * @section section1 Introduction: * Having studied this LAB you will able to: \n * - Understand the advanced Timer functions \n * - Study the programs related to the Advanced timer * * @section section2 Example14 : * Objective: Write a program to generate complimentary PWM output in Edge align mode with deadtime(Timer1) * * @section section3 Program Description: * This program demonstrates generation of complimentary PWM signal using advanced timer in edge align mode with deadtime. * * @section section4 Included Files: * * | Header Files | Source Files | * | :------------------------------:| :----------------------------: | * | @ref stm32f4xx_hal_conf.h | @ref stm32f4xx_hal_msp.c | * | @ref stm32f4xx_it.h | @ref stm32f4xx_it.c | * | @ref stm32f4_discovery.h | @ref stm32f4_discovery.c | * | @ref stm32f4_discovery_timer.h | @ref stm32f4_discovery_timer.c | * | | @ref main.c | * * \n * @section section5 Pin Assignments * * | STM32F407 Reference | On board | * | :------------------:|-----------:| * | GPIOC.06 | TIM8_CH1 | * | GPIOA.05N | TIM8_CH1N | * * * @section section6 Program Folder Location * <Eg14> * * * @section section7 Part List * - STM32F4Discovery Board \n * - USB cable \n * - Eclipse IDE \n * - PC \n * * * @section section8 Hardware Configuration * - Connect the board using USB port of PC using USB cable. * - Apply Reset condition by pressing the Reset switch to ensure proper communication. * - Using download tool (STM ST-LINK Utility) download the .hex file developed using available tools. * - Reset the board. * - Observe the Output. * * @section section9 Output: * 20KHZ complimentary PWM signal will be generated on the Timer8 channel1N port pin in edge align mode with deadtime. *\n *\n *******************************************************************************/
#ifndef __al_included_allegro5_gl_ext_h #define __al_included_allegro5_gl_ext_h /* * MSVC declares the following extensions and MinGW doesn't. In order to * export the same symbols on both platforms we removed the extensions from * MSVC. */ #ifdef ALLEGRO_MSVC #undef GL_EXT_vertex_array #undef GL_EXT_paletted_texture #undef GL_WIN_swap_hint #undef GL_WIN_draw_range_elements #endif /* GL extension definitions. */ /* For example: * * #define GL_BGRA 0x80E1 * */ #if !defined(ALLEGRO_GP2XWIZ) && !defined(ALLEGRO_IPHONE) #include "allegro5/opengl/GLext/gl_ext_defs.h" #endif #if defined ALLEGRO_WINDOWS && !defined ALLEGRO_EXCLUDE_WGL #include "allegro5/opengl/GLext/wgl_ext_defs.h" #elif defined ALLEGRO_UNIX && !defined ALLEGRO_EXCLUDE_GLX #include "allegro5/opengl/GLext/glx_ext_defs.h" #endif /* GL extension types */ /* For example: * * typedef void (APIENTRY * _ALLEGRO_glBlendEquation_t (GLenum); * */ #ifndef APIENTRY #define APIENTRY #define APIENTRY_defined #endif #define AGL_API(type, name, args) typedef type (APIENTRY * _ALLEGRO_gl##name##_t) args; # include "allegro5/opengl/GLext/gl_ext_api.h" #undef AGL_API #ifdef ALLEGRO_WINDOWS #define AGL_API(type, name, args) typedef type (APIENTRY * _ALLEGRO_wgl##name##_t) args; # include "allegro5/opengl/GLext/wgl_ext_api.h" #undef AGL_API #elif defined ALLEGRO_UNIX #define AGL_API(type, name, args) typedef type (APIENTRY * _ALLEGRO_glX##name##_t) args; # include "allegro5/opengl/GLext/glx_ext_api.h" #undef AGL_API #endif #ifdef APIENTRY_defined #undef APIENTRY #undef APIENTRY_defined #endif /* GL extension declarations */ /* For example: * * #define glBlendEquation _al_glBlendEquation * extern _ALLEGRO_glBlendEquation_t _al_glBlendEquation; * */ #define AGL_API(type, name, args) AL_VAR(_ALLEGRO_gl##name##_t, _al_gl##name); # include "allegro5/opengl/GLext/gl_ext_alias.h" # include "allegro5/opengl/GLext/gl_ext_api.h" #undef AGL_API #ifdef ALLEGRO_WINDOWS #define AGL_API(type, name, args) AL_VAR(_ALLEGRO_wgl##name##_t, _al_wgl##name); # include "allegro5/opengl/GLext/wgl_ext_alias.h" # include "allegro5/opengl/GLext/wgl_ext_api.h" #undef AGL_API #elif defined ALLEGRO_UNIX #define AGL_API(type, name, args) extern _ALLEGRO_glX##name##_t _al_glX##name; # include "allegro5/opengl/GLext/glx_ext_alias.h" # include "allegro5/opengl/GLext/glx_ext_api.h" #undef AGL_API #endif /* A list of all supported extensions. * * For example: * int ALLEGRO_GL_ARB_imaging; * */ typedef struct ALLEGRO_OGL_EXT_LIST { # define AGL_EXT(name, ver) int ALLEGRO_GL_##name; # include "allegro5/opengl/GLext/gl_ext_list.h" # undef AGL_EXT #ifdef ALLEGRO_UNIX # define AGL_EXT(name, ver) int ALLEGRO_GLX_##name; # include "allegro5/opengl/GLext/glx_ext_list.h" # undef AGL_EXT #elif defined ALLEGRO_WINDOWS # define AGL_EXT(name, ver) int ALLEGRO_WGL_##name; # include "allegro5/opengl/GLext/wgl_ext_list.h" # undef AGL_EXT #endif } ALLEGRO_OGL_EXT_LIST; /* GL extension Structure. Holds the pointers to all the functions * of all extensions, for a single context. * * Example: * ALLEGRO_BlendEquation_t BlendEquation; */ typedef struct ALLEGRO_OGL_EXT_API { #define AGL_API(type, name, args) _ALLEGRO_gl##name##_t name; # include "allegro5/opengl/GLext/gl_ext_api.h" #undef AGL_API #ifdef ALLEGRO_WINDOWS #define AGL_API(type, name, args) _ALLEGRO_wgl##name##_t name; # include "allegro5/opengl/GLext/wgl_ext_api.h" #undef AGL_API #elif defined ALLEGRO_UNIX #define AGL_API(type, name, args) _ALLEGRO_glX##name##_t name; # include "allegro5/opengl/GLext/glx_ext_api.h" #undef AGL_API #endif } ALLEGRO_OGL_EXT_API; #endif
// // Lockbox.h // // Created by Mark H. Granoff on 4/19/12. // Copyright (c) 2012 Hawk iMedia. All rights reserved. // @interface Lockbox : NSObject +(BOOL)setString:(NSString *)value forKey:(NSString *)key; +(NSString *)stringForKey:(NSString *)key; +(BOOL)setArray:(NSArray *)value forKey:(NSString *)key; +(NSArray *)arrayForKey:(NSString *)key; +(BOOL)setDictionary:(NSDictionary *)value forKey:(NSString *)key; +(NSDictionary *)dictionaryForKey:(NSString *)key; +(NSDictionary *)dictionaryForKey:(NSString *)key sync:(BOOL)sync; @end
/* recipf4 - for each of four float slots, compute reciprocal. Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Sony Computer Entertainment Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ___SIMD_MATH_RECIPF4_H___ #define ___SIMD_MATH_RECIPF4_H___ #include <simdmath.h> #include <spu_intrinsics.h> static inline vector float _recipf4 (vector float x) { // Reciprocal estimate and 1 Newton-Raphson iteration. // A constant of 1.0 + 1 ulp in the Newton-Raphson step results in exact // answers for powers of 2, and a slightly smaller relative error bound. vec_float4 y0; vec_float4 oneish = (vec_float4)spu_splats(0x3f800001); y0 = spu_re( x ); return spu_madd( spu_nmsub( x, y0, oneish ), y0, y0 ); } #endif
/* Package: dyncall Library: dyncallback File: dyncallback/dyncall_args_x86.c Description: Callback's Arguments VM - Implementation for x86 License: Copyright (c) 2007-2009 Daniel Adler <dadler@uni-goettingen.de>, Tassilo Philipp <tphilipp@potion-studios.com> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "dyncall_args_x86.h" /* ---------------------------------------------------------------------------- */ /* C API implementation: */ /* base operations */ DCint dcbArgInt (DCArgs* p) { return p->vt->i32(p); } DClonglong dcbArgLongLong(DCArgs* p) { return p->vt->i64(p); } DCfloat dcbArgFloat (DCArgs* p) { return p->vt->f32(p); } DCdouble dcbArgDouble (DCArgs* p) { return p->vt->f64(p); } /* promote to integer: bool, char, short, long and pointer */ DCbool dcbArgBool (DCArgs* p) { return ( dcbArgInt(p) == 0 ) ? 0 : 1; } DCchar dcbArgChar (DCArgs* p) { return (char) dcbArgInt(p); } DCshort dcbArgShort (DCArgs* p) { return (short) dcbArgInt(p); } DClong dcbArgLong (DCArgs* p) { return (long) dcbArgInt(p); } DCpointer dcbArgPointer (DCArgs* p) { return (DCpointer) dcbArgInt(p); } /* unsigned types */ DCuint dcbArgUInt (DCArgs* p) { return (DCuint) dcbArgInt(p); } DCuchar dcbArgUChar (DCArgs* p) { return (DCuchar) dcbArgChar(p); } DCushort dcbArgUShort (DCArgs* p) { return (DCushort) dcbArgShort(p); } DCulong dcbArgULong (DCArgs* p) { return (DCulong) dcbArgLong(p); } DCulonglong dcbArgULongLong(DCArgs* p) { return (DCulonglong) dcbArgLongLong(p); } /* ---------------------------------------------------------------------------- */ /* virtual tables: */ /* cdecl calling convention */ static int default_i32(DCArgs* args) { return *args->stack_ptr++; } static long long default_i64(DCArgs* args) { long long result = * (long long*) args->stack_ptr; args->stack_ptr += 2; return result; } static float default_f32(DCArgs* args) { float result = * ( (float*) args->stack_ptr ); args->stack_ptr++; return result; } static double default_f64(DCArgs* args) { double result = * ( (double*) args->stack_ptr ); args->stack_ptr += 2; return result; } DCArgsVT dcArgsVT_default = { default_i32, default_i64, default_f32, default_f64 }; /* thiscall (microsoft) calling convention */ static int this_i32(DCArgs* args) { if(args->fast_data[0]) { /* ecx register = this pointer */ int thisArg = args->fast_data[0]; args->fast_data[0] = 0; return thisArg; } return *args->stack_ptr++; } DCArgsVT dcArgsVT_this_ms = { this_i32, default_i64, default_f32, default_f64 }; /* fastcall (microsoft) calling convention */ static int fast_i32(DCArgs* args) { if(args->fast_count < 2) return args->fast_data[args->fast_count++]; else return default_i32(args); } DCArgsVT dcArgsVT_fast_ms = { fast_i32, default_i64, default_f32, default_f64 }; /* fastcall (gnu) calling convention */ static long long fast_gnu_i64(DCArgs* args) { args->fast_count += 2; return default_i64(args); } DCArgsVT dcArgsVT_fast_gnu = { fast_i32, fast_gnu_i64, default_f32, default_f64 };
// // ViewController.h // UINavigationBarTest01 // // Created by bob on 16/11/25. // Copyright © 2016年 bob. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
// // UIView+SDExtension.h // SDRefreshView // // ##################################################################################### // 为了满足您的个性化需求,该库属性基本上都是暴露的,只要一层一层往下看,应该就可以找到你需要的属性进行修改。:) // 如有问题请加qq:619023485 // 也可以发送邮件到619023485@qq.com,mingyi_126.com或shionIsMyName@gmail.com. // ##################################################################################### // Created by shiyong on 16/6/30. // Copyright © 2016年 sy. All rights reserved. #import <UIKit/UIKit.h> #define SDColorCreater(r, g, b, a) [UIColor colorWithRed:(r / 255.0) green:(g / 255.0) blue:(b / 255.0) alpha:a] @interface UIView (SDExtension) @property (nonatomic, assign) CGFloat sd_height; @property (nonatomic, assign) CGFloat sd_width; @property (nonatomic, assign) CGFloat sd_y; @property (nonatomic, assign) CGFloat sd_x; @end
/***************************************************************************/ /* */ /* smooth.c */ /* */ /* FreeType anti-aliasing rasterer module component (body only). */ /* */ /* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #define FT_MAKE_OPTION_SINGLE_OBJECT #include <ft2build.h> #include "ftspic.c" #include "ftgrays.c" #include "ftsmooth.c" /* END */
// Copyright (c) 2017 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef ATOM_RENDERER_ATOM_AUTOFILL_AGENT_H_ #define ATOM_RENDERER_ATOM_AUTOFILL_AGENT_H_ #include <vector> #include "base/memory/weak_ptr.h" #include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_view_observer.h" #include "third_party/WebKit/public/web/WebAutofillClient.h" #include "third_party/WebKit/public/web/WebFormControlElement.h" #include "third_party/WebKit/public/web/WebInputElement.h" #include "third_party/WebKit/public/web/WebNode.h" namespace atom { class AutofillAgent : public content::RenderFrameObserver, public blink::WebAutofillClient { public: explicit AutofillAgent(content::RenderFrame* frame); // content::RenderFrameObserver: void OnDestruct() override; void DidChangeScrollOffset() override; void FocusedNodeChanged(const blink::WebNode&) override; void DidCompleteFocusChangeInFrame() override; void DidReceiveLeftMouseDownOrGestureTapInNode( const blink::WebNode&) override; private: struct ShowSuggestionsOptions { ShowSuggestionsOptions(); bool autofill_on_empty_values; bool requires_caret_at_end; }; bool OnMessageReceived(const IPC::Message& message) override; // blink::WebAutofillClient: void TextFieldDidEndEditing(const blink::WebInputElement&) override; void TextFieldDidChange(const blink::WebFormControlElement&) override; void TextFieldDidChangeImpl(const blink::WebFormControlElement&); void TextFieldDidReceiveKeyDown(const blink::WebInputElement&, const blink::WebKeyboardEvent&) override; void OpenTextDataListChooser(const blink::WebInputElement&) override; void DataListOptionsChanged(const blink::WebInputElement&) override; bool IsUserGesture() const; void HidePopup(); void ShowPopup(const blink::WebFormControlElement&, const std::vector<base::string16>&, const std::vector<base::string16>&); void ShowSuggestions(const blink::WebFormControlElement& element, const ShowSuggestionsOptions& options); void OnAcceptSuggestion(base::string16 suggestion); void DoFocusChangeComplete(); // True when the last click was on the focused node. bool focused_node_was_last_clicked_; // This is set to false when the focus changes, then set back to true soon // afterwards. This helps track whether an event happened after a node was // already focused, or if it caused the focus to change. bool was_focused_before_now_; base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(AutofillAgent); }; } // namespace atom #endif // ATOM_RENDERER_ATOM_AUTOFILL_AGENT_H_
const char *ps_txt[] = { "%%BeginProlog", "/DotDict 200 dict def", "DotDict begin", "", "/setupLatin1 {", "mark", "/EncodingVector 256 array def", " EncodingVector 0", "", "ISOLatin1Encoding 0 255 getinterval putinterval", "EncodingVector 45 /hyphen put", "", "% Set up ISO Latin 1 character encoding", "/starnetISO {", " dup dup findfont dup length dict begin", " { 1 index /FID ne { def }{ pop pop } ifelse", " } forall", " /Encoding EncodingVector def", " currentdict end definefont", "} def", "/Times-Roman starnetISO def", "/Times-Italic starnetISO def", "/Times-Bold starnetISO def", "/Times-BoldItalic starnetISO def", "/Helvetica starnetISO def", "/Helvetica-Oblique starnetISO def", "/Helvetica-Bold starnetISO def", "/Helvetica-BoldOblique starnetISO def", "/Courier starnetISO def", "/Courier-Oblique starnetISO def", "/Courier-Bold starnetISO def", "/Courier-BoldOblique starnetISO def", "cleartomark", "} bind def", "", "%%BeginResource: procset graphviz 0 0", "/coord-font-family /Times-Roman def", "/default-font-family /Times-Roman def", "/coordfont coord-font-family findfont 8 scalefont def", "", "/InvScaleFactor 1.0 def", "/set_scale {", " dup 1 exch div /InvScaleFactor exch def", " scale", "} bind def", "", "% styles", "/solid { [] 0 setdash } bind def", "/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def", "/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def", "/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def", "/bold { 2 setlinewidth } bind def", "/filled { } bind def", "/unfilled { } bind def", "/rounded { } bind def", "/diagonals { } bind def", "", "% hooks for setting color ", "/nodecolor { sethsbcolor } bind def", "/edgecolor { sethsbcolor } bind def", "/graphcolor { sethsbcolor } bind def", "/nopcolor {pop pop pop} bind def", "", "/beginpage { % i j npages", " /npages exch def", " /j exch def", " /i exch def", " /str 10 string def", " npages 1 gt {", " gsave", " coordfont setfont", " 0 0 moveto", " (\\() show i str cvs show (,) show j str cvs show (\\)) show", " grestore", " } if", "} bind def", "", "/set_font {", " findfont exch", " scalefont setfont", "} def", "", "% draw text fitted to its expected width", "/alignedtext { % width text", " /text exch def", " /width exch def", " gsave", " width 0 gt {", " [] 0 setdash", " text stringwidth pop width exch sub text length div 0 text ashow", " } if", " grestore", "} def", "", "/boxprim { % xcorner ycorner xsize ysize", " 4 2 roll", " moveto", " 2 copy", " exch 0 rlineto", " 0 exch rlineto", " pop neg 0 rlineto", " closepath", "} bind def", "", "/ellipse_path {", " /ry exch def", " /rx exch def", " /y exch def", " /x exch def", " matrix currentmatrix", " newpath", " x y translate", " rx ry scale", " 0 0 1 0 360 arc", " setmatrix", "} bind def", "", "/endpage { showpage } bind def", "/showpage { } def", "", "/layercolorseq", " [ % layer color sequence - darkest to lightest", " [0 0 0]", " [.2 .8 .8]", " [.4 .8 .8]", " [.6 .8 .8]", " [.8 .8 .8]", " ]", "def", "", "/layerlen layercolorseq length def", "", "/setlayer {/maxlayer exch def /curlayer exch def", " layercolorseq curlayer 1 sub layerlen mod get", " aload pop sethsbcolor", " /nodecolor {nopcolor} def", " /edgecolor {nopcolor} def", " /graphcolor {nopcolor} def", "} bind def", "", "/onlayer { curlayer ne {invis} if } def", "", "/onlayers {", " /myupper exch def", " /mylower exch def", " curlayer mylower lt", " curlayer myupper gt", " or", " {invis} if", "} def", "", "/curlayer 0 def", "", "%%EndResource", "%%EndProlog", "%%BeginSetup", "14 default-font-family set_font", "1 setmiterlimit", "% /arrowlength 10 def", "% /arrowwidth 5 def", "", "% make sure pdfmark is harmless for PS-interpreters other than Distiller", "/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse", "% make '<<' and '>>' safe on PS Level 1 devices", "/languagelevel where {pop languagelevel}{1} ifelse", "2 lt {", " userdict (<<) cvn ([) cvn load put", " userdict (>>) cvn ([) cvn load put", "} if", "", "%%EndSetup", (char*)0 };
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /************************************************************************* * Copyright (c) 2011 AT&T Intellectual Property * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ #ifdef __cplusplus extern "C" { #endif #ifndef EDGES_H #define EDGES_H #include "site.h" typedef struct Edge { double a, b, c; /* edge on line ax + by = c */ Site *ep[2]; /* endpoints (vertices) of edge; initially NULL */ Site *reg[2]; /* sites forming edge */ int edgenbr; } Edge; #define le 0 #define re 1 extern double pxmin, pxmax, pymin, pymax; /* clipping window */ extern void edgeinit(void); extern void endpoint(Edge *, int, Site *); extern void clip_line(Edge * e); extern Edge *gvbisect(Site *, Site *); #endif #ifdef __cplusplus } #endif
#ifndef LANGREFCOUNT_H #define LANGREFCOUNT_H #include <vector> #include <map> #include <set> #include <QString> class QFileInfo; /** * @brief Loads and reference counts language information. */ class LangRegistry { static const QString DIR; public: struct LangEntry { LangEntry() : refs{0}, buildsys(""), name("") {} size_t refs; QString buildsys; QString name; }; struct FileEntry { LangEntry* lang; QString interpreter; bool operator<(const FileEntry& b) const {return lang<b.lang || interpreter<b.interpreter;} //WARNING: Voodoo. FileEntry(LangEntry* language, const QString& interp = "") : lang{language}, interpreter(interp) {} }; using LangID = size_t; static constexpr LangID ID_UNKNOWN = static_cast<LangID>(-1); private: using FileMap = std::map<QString,const FileEntry*>; std::set<FileEntry> cache_fileentries; std::vector<LangEntry> cache_langentries; FileMap fileexts; FileMap filenames; std::map<QString,LangEntry*> langs; inline FileMap& getBindMap (bool isext) {return isext?fileexts:filenames;} inline const FileMap& getBindMapConst(bool isext) const {return isext?fileexts:filenames;} public: static QString getFileExt(const QString& filename); LangRegistry(); //Tests for known mappings. inline bool knowsFile(const QString& name, bool isext = true) const {return getBindMapConst(isext).count(name);} inline bool knowsLang(const QString& lang) const {return langs.count(lang);} /** * @brief Gets a human-friendly untranslated language name. * Returns a language name if specified in the language's properties.conf. Otherwise, defaults to the programmer name. * This name is meant to be human-friendlier, and should be used in GUI elements or messages. * It should also be passed through tr() first. */ QString getHumanName(LangID id) const; /** * @brief Get the corresponding language for a file. */ LangID getLang(const QFileInfo& file) const; /** * @brief Get the corresponding language for a file extension or name */ LangID getLang(const QString& name, bool isext = true) const; //Default true for teenagers. /** * @brief Check if an interpreter exists for a given language. */ bool hasInterpreter(const QString& name, bool isext = true) const; bool hasInterpreter(const QFileInfo& fi) const; /** * @brief Test if the registry has loaded a language for a certain file type. */ bool ready(const QString& name, bool isext = true) const; /** * @brief Return whether or not a language describes files for a build system. */ bool isBuildSys(LangID id) const; /** * @brief Get the name build system invocation script in %tools/build/<lang> */ QString getBuildSys(LangID id) const; /** * @brief Gets the set of build systems that LangRegistry recognizes. */ std::set<LangID> makeBuildSysSet() const; /** * @brief getInterpreter Get the interpreter for a certain language. * @return A name or path to an executable that can interpret the file, or an empty string if none is known. */ QString getInterpreter(const QString& name, bool isext = true) const; QString getInterpreter(const QFileInfo& fi) const; //Reference counting, to be incremented per PROJECT, not PER FILE! bool add(const QStringList& langs); bool rem(const QStringList& langs); inline size_t countRefs(LangID lang) const {return cache_langentries.at(lang).refs;} inline size_t countLanguages() const {return langs.size();} inline size_t countBindings() const {return fileexts.size() + filenames.size();} }; #endif // LANGREFCOUNT_H
/* * Copyright (C) 2005-2016 Junjiro R. Okajima * * This program, aufs 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/>. */ /* * support for loopback block device as a branch */ #include "aufs.h" /* added into drivers/block/loop.c */ static struct file *(*backing_file_func)(struct super_block *sb); /* * test if two lower dentries have overlapping branches. */ int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding) { struct super_block *h_sb; struct file *backing_file; if (unlikely(!backing_file_func)) { /* don't load "loop" module here */ backing_file_func = symbol_get(loop_backing_file); if (unlikely(!backing_file_func)) /* "loop" module is not loaded */ return 0; } h_sb = h_adding->d_sb; backing_file = backing_file_func(h_sb); if (!backing_file) return 0; h_adding = backing_file->f_path.dentry; /* * h_adding can be local NFS. * in this case aufs cannot detect the loop. */ if (unlikely(h_adding->d_sb == sb)) return 1; return !!au_test_subdir(h_adding, sb->s_root); } /* true if a kernel thread named 'loop[0-9].*' accesses a file */ int au_test_loopback_kthread(void) { int ret; struct task_struct *tsk = current; char c, comm[sizeof(tsk->comm)]; ret = 0; if (tsk->flags & PF_KTHREAD) { get_task_comm(comm, tsk); c = comm[4]; ret = ('0' <= c && c <= '9' && !strncmp(comm, "loop", 4)); } return ret; } /* ---------------------------------------------------------------------- */ #define au_warn_loopback_step 16 static int au_warn_loopback_nelem = au_warn_loopback_step; static unsigned long *au_warn_loopback_array; void au_warn_loopback(struct super_block *h_sb) { int i, new_nelem; unsigned long *a, magic; static DEFINE_SPINLOCK(spin); magic = h_sb->s_magic; spin_lock(&spin); a = au_warn_loopback_array; for (i = 0; i < au_warn_loopback_nelem && *a; i++) if (a[i] == magic) { spin_unlock(&spin); return; } /* h_sb is new to us, print it */ if (i < au_warn_loopback_nelem) { a[i] = magic; goto pr; } /* expand the array */ new_nelem = au_warn_loopback_nelem + au_warn_loopback_step; a = au_kzrealloc(au_warn_loopback_array, au_warn_loopback_nelem * sizeof(unsigned long), new_nelem * sizeof(unsigned long), GFP_ATOMIC, /*may_shrink*/0); if (a) { au_warn_loopback_nelem = new_nelem; au_warn_loopback_array = a; a[i] = magic; goto pr; } spin_unlock(&spin); AuWarn1("realloc failed, ignored\n"); return; pr: spin_unlock(&spin); pr_warn("you may want to try another patch for loopback file " "on %s(0x%lx) branch\n", au_sbtype(h_sb), magic); } int au_loopback_init(void) { int err; struct super_block *sb __maybe_unused; BUILD_BUG_ON(sizeof(sb->s_magic) != sizeof(unsigned long)); err = 0; au_warn_loopback_array = kcalloc(au_warn_loopback_step, sizeof(unsigned long), GFP_NOFS); if (unlikely(!au_warn_loopback_array)) err = -ENOMEM; return err; } void au_loopback_fin(void) { if (backing_file_func) symbol_put(loop_backing_file); au_delayed_kfree(au_warn_loopback_array); } /* ---------------------------------------------------------------------- */ /* support the loopback block device insude aufs */ struct file *aufs_real_loop(struct file *file) { struct file *f; BUG_ON(!au_test_aufs(file->f_path.dentry->d_sb)); fi_read_lock(file); f = au_hf_top(file); fi_read_unlock(file); AuDebugOn(!f); return f; }
/* Hey EMACS -*- linux-c -*- */ /* $Id: detect.c 663 2004-04-28 16:25:13Z tijl $ */ /* libticables - link cable library, a part of the TiLP project * Copyright (C) 1999-2004 Romain Lievin * * 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 */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #if defined(__LINUX__) #include "linux/ioports.c" #elif defined(__BSD__) #include "linux/ioports.c" #elif defined(__WIN32__) #include "win32/ioports.c" #else #include "none.c" #endif
/* type_util.h * Types utility definitions * * $Id: type_util.h 47938 2013-02-28 14:09:46Z rbalint $ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * 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 __TYPE_UTIL_H__ #define __TYPE_UTIL_H__ #include "ws_symbol_export.h" /* * guint64 to gdouble conversions taken from gstutils.h of GStreamer project * * GStreamer * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> * 2000 Wim Taymans <wtay@chello.be> * 2002 Thomas Vander Stichele <thomas@apestaart.org> * * gstutils.h: Header for various utility functions * * GNU GPL v2 * */ WS_DLL_PUBLIC guint64 type_util_gdouble_to_guint64(gdouble value); WS_DLL_PUBLIC gdouble type_util_guint64_to_gdouble(guint64 value); #ifdef _WIN32 #define gdouble_to_guint64(value) type_util_gdouble_to_guint64(value) #define guint64_to_gdouble(value) type_util_guint64_to_gdouble(value) #else #define gdouble_to_guint64(value) ((guint64)(value)) #define guint64_to_gdouble(value) ((gdouble)(value)) #endif #endif /* __TYPE_UTIL_H__ */
/* The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@atosc.org 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 */ #include <stdlib.h> #include <stdio.h> #include <osipparser2/osip_port.h> #include <osipparser2/osip_message.h> #include <osipparser2/osip_parser.h> #include "parser.h" #ifndef MINISIZE int osip_message_set_accept_language (osip_message_t * sip, const char *hvalue) { osip_accept_language_t *accept_language; int i; if (hvalue == NULL || hvalue[0] == '\0') return 0; i = osip_accept_language_init (&accept_language); if (i != 0) return -1; i = osip_accept_language_parse (accept_language, hvalue); if (i != 0) { osip_accept_language_free (accept_language); return -1; } sip->message_property = 2; osip_list_add (&sip->accept_languages, accept_language, -1); return 0; } int osip_message_get_accept_language (const osip_message_t * sip, int pos, osip_accept_language_t ** dest) { osip_accept_language_t *accept_language; *dest = NULL; if (osip_list_size (&sip->accept_languages) <= pos) return -1; /* does not exist */ accept_language = (osip_accept_language_t *) osip_list_get (&sip->accept_languages, pos); *dest = accept_language; return pos; } #endif
/* Get calling thread's ID. Copyright (C) 2000, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C 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. The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <pthread.h> #include <pt-internal.h> /* Return the thread ID of the calling thread. */ pthread_t __pthread_self (void) { struct __pthread *self = _pthread_self (); assert (self); return self->thread; } strong_alias (__pthread_self, pthread_self);
/* * Copyright (C) 2012 Samsung Electronics. * huangshr<huangshr@allwinnertech.com> * * 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. */ #include <linux/kernel.h> #include <linux/io.h> #include <linux/init.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/mm.h> #include <linux/slab.h> #include <asm/firmware.h> #include <linux/secure/te_protocol.h> #include <mach/hardware.h> #include <mach/sunxi-smc.h> #include <linux/spinlock_types.h> #include "./pm/mem_hwspinlock.h" DEFINE_SPINLOCK(smc_lock); uint32_t sunxi_do_smc(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3) { struct smc_param param; spin_lock(&smc_lock); param.a0 = arg0; param.a1 = arg1; param.a2 = arg2; param.a3 = arg3; sunxi_smc_call(&param); spin_unlock(&smc_lock); return param.a0; } static u32 sunxi_sec_read_reg(void __iomem *reg) { u32 value; u32 phys_addr; phys_addr = (u32)reg > (u32)IO_ADDRESS(0) ? ((u32)reg - (u32)IO_ADDRESS(0)) : (u32)reg; value = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_READ_REG,phys_addr, 0); return value; } static u32 sunxi_sec_write_reg(u32 value, void __iomem *reg) { u32 ret; u32 phys_addr; phys_addr = (u32)reg > (u32)IO_ADDRESS(0) ? ((u32)reg - (u32)IO_ADDRESS(0)) : (u32)reg; ret = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_WRITE_REG, phys_addr, value); return ret; } static u32 sunxi_sec_send_command(u32 arg0, u32 arg1, u32 arg2, u32 arg3) { u32 ret; ret = sunxi_do_smc(arg0, arg1, arg2, arg3); return ret; } static u32 sunxi_load_arisc(void *image, u32 image_size, void *para, u32 para_size, u32 para_offset) { u32 ret; struct tee_load_arisc_param *param; if ((image == NULL) || (image_size == 0) || (para == NULL) || (para_size == 0)) { return -EINVAL; } /* allocte param buffer */ param = kzalloc(sizeof(struct tee_load_arisc_param), GFP_KERNEL); if (param == NULL) { pr_err("%s: allocate param buffer failed\n", __func__); return -ENOMEM; } /* initialize params */ if ((u32)image > (u32)IO_ADDRESS(0)) { /* sram memory */ param->image_phys = (u32)image - (u32)IO_ADDRESS(0); } else { /* dram memory */ param->image_phys = (u32)virt_to_phys(image); } param->image_size = image_size; if ((u32)para > (u32)IO_ADDRESS(0)) { /* sram memory */ param->para_phys = (u32)para - (u32)IO_ADDRESS(0); } else { /* dram memory */ param->para_phys = (u32)virt_to_phys(para); } param->para_size = para_size; param->para_offset = para_offset; /* do smc call */ ret = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_LOAD_ARISC, (u32)virt_to_phys(param), 0); kfree(param); return ret; } static u32 sunxi_sec_set_secondary_entry(void *entry) { u32 ret; ret = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_SET_SMP_BOOTENTRY, (u32)entry, 0); return ret; } static u32 sunxi_sec_suspend(void) { u32 ret; ret = sunxi_do_smc(TEE_SMC_PM_SUSPEND, 0, 0, 0); return ret; } /* * note: the function main to get monitor vector to save for resume */ static u32 sunxi_sec_suspend_prepare(void) { u32 ret; ret = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_SUSPEND_PAREPER, 0, 0); return ret; } /* brief * arg0: command type as TEE_SMC_PLAFORM_OPERATION * arg1: set standby status mode.(clear or get or set) * arg2: standby reg physical address. * arg3: value to set when set. */ static u32 sunxi_sec_set_standby_status(u32 command_type, u32 setting_type, u32 addr, u32 val) { u32 ret_val = 0; u32 phys_addr; phys_addr = (u32)addr > (u32)IO_ADDRESS(0) ? ((u32)addr - (u32)IO_ADDRESS(0)) : (u32)addr; switch(setting_type){ case TE_SMC_STANDBY_STATUS_CLEAR: ret_val = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_READ_REG, phys_addr, 0); #ifndef CONFIG_ARCH_SUN8IW7P1 if (!hwspin_lock_timeout(MEM_RTC_REG_HWSPINLOCK, 20000)) { #endif ret_val = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_STANDBY_STATUS_CLEAR, phys_addr, ret_val); #ifndef CONFIG_ARCH_SUN8IW7P1 hwspin_unlock(MEM_RTC_REG_HWSPINLOCK); } #endif break; case TE_SMC_STANDBY_STATUS_SET: #ifndef CONFIG_ARCH_SUN8IW7P1 if (!hwspin_lock_timeout(MEM_RTC_REG_HWSPINLOCK, 20000)) { #endif ret_val = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_STANDBY_STATUS_SET, phys_addr, val); #ifndef CONFIG_ARCH_SUN8IW7P1 hwspin_unlock(MEM_RTC_REG_HWSPINLOCK); } #endif asm volatile ("dsb"); asm volatile ("isb"); break; case TE_SMC_STANDBY_STATUS_GET: #ifndef CONFIG_ARCH_SUN8IW7P1 if (!hwspin_lock_timeout(MEM_RTC_REG_HWSPINLOCK, 20000)) { #endif ret_val = sunxi_do_smc(TEE_SMC_PLAFORM_OPERATION, TE_SMC_STANDBY_STATUS_GET, phys_addr, val); #ifndef CONFIG_ARCH_SUN8IW7P1 hwspin_unlock(MEM_RTC_REG_HWSPINLOCK); } #endif break; default: break; } return ret_val; } static const struct firmware_ops sunxi_firmware_ops = { .read_reg = sunxi_sec_read_reg, .write_reg = sunxi_sec_write_reg, .send_command = sunxi_sec_send_command, .load_arisc = sunxi_load_arisc, .set_secondary_entry = sunxi_sec_set_secondary_entry, .suspend_prepare = sunxi_sec_suspend_prepare, .suspend = sunxi_sec_suspend, .set_standby_status = sunxi_sec_set_standby_status, }; void __init sunxi_firmware_init(void) { register_firmware_ops(&sunxi_firmware_ops); }
/* ============================================================ * * This file is a part of digiKam project * http://www.digikam.org * * Date : 2000-12-05 * Description : base class for sidebar widgets * * Copyright (C) 2009 by Johannes Wienke <languitar at semipol dot 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, 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. * * ============================================================ */ #ifndef SIDEBARWIDGET_H #define SIDEBARWIDGET_H // QT includes #include <QPixmap> #include <QWidget> // KDE includes #include <kconfiggroup.h> #include <kiconloader.h> // Local includes #include "album.h" #include "imageinfo.h" #include "statesavingobject.h" namespace Digikam { /** * Abstract base class for widgets that are use in one of digikams's sidebars. * * @author jwienke */ class SidebarWidget : public QWidget, public StateSavingObject { Q_OBJECT public: /** * Constructor. * * @param parent parent of this widget, may be null */ explicit SidebarWidget(QWidget* parent); /** * Destructor. */ virtual ~SidebarWidget(); /** * This method is called if the visible sidebar widget is changed. * * @param if true, this widget is the new active widget, if false another * widget is active */ virtual void setActive(bool active) = 0; /** * This method is invoked when the application settings should be (re-) * applied to this widget. */ virtual void applySettings() = 0; /** * This is called on this widget when the history requires to move back to * the specified album */ virtual void changeAlbumFromHistory(QList<Album*> album) = 0; /** * Must be implemented and return the icon that shall be visible for this * sidebar widget. * * @return pixmap icon */ virtual QPixmap getIcon() = 0; /** * Must be implemented to return the title of this sidebar's tab. * * @return localized title string */ virtual QString getCaption() = 0; Q_SIGNALS: /** * This signal can be emitted if this sidebar widget wants to be the one * that is active. */ void requestActiveTab(SidebarWidget*); }; } // namespace Digikam #endif /* SIDEBARWIDGET_H */
/***************************************************************************** * speex.c : libspeex DSP resampler ***************************************************************************** * Copyright © 2011 Rémi Denis-Courmont * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <vlc_common.h> #include <vlc_aout.h> #include <vlc_filter.h> #include <vlc_plugin.h> #include <speex/speex_resampler.h> #define QUALITY_TEXT N_("Resampling quality") #define QUALITY_LONGTEXT N_( \ "Resampling quality (0 = worst and fastest, 10 = best and slowest).") static int Open (vlc_object_t *); static void Close (vlc_object_t *); vlc_module_begin () set_shortname (N_("Speex resampler")) set_description (N_("Speex resampler") ) set_category (CAT_AUDIO) set_subcategory (SUBCAT_AUDIO_MISC) add_integer ("speex-resampler-quality", 4, QUALITY_TEXT, QUALITY_LONGTEXT, true) change_integer_range (0, 10) set_capability ("audio filter", 50) set_callbacks (Open, Close) vlc_module_end () static block_t *Resample (filter_t *, block_t *); static int Open (vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; /* Will change rate */ if (filter->fmt_in.audio.i_rate == filter->fmt_out.audio.i_rate /* Cannot convert format */ || filter->fmt_in.audio.i_format != filter->fmt_out.audio.i_format /* Cannot remix */ || filter->fmt_in.audio.i_physical_channels != filter->fmt_out.audio.i_physical_channels || filter->fmt_in.audio.i_original_channels != filter->fmt_out.audio.i_original_channels) return VLC_EGENERIC; switch (filter->fmt_in.audio.i_format) { case VLC_CODEC_FL32: break; case VLC_CODEC_S16N: break; default: return VLC_EGENERIC; } SpeexResamplerState *st; unsigned channels = aout_FormatNbChannels (&filter->fmt_in.audio); unsigned q = var_InheritInteger (obj, "speex-resampler-quality"); if (unlikely(q > 10)) q = 3; int err; st = speex_resampler_init(channels, filter->fmt_in.audio.i_rate, filter->fmt_out.audio.i_rate, q, &err); if (unlikely(st == NULL)) { msg_Err (obj, "cannot initialize resampler: %s", speex_resampler_strerror (err)); return VLC_ENOMEM; } filter->p_sys = (filter_sys_t *)st; filter->pf_audio_filter = Resample; return VLC_SUCCESS; } static void Close (vlc_object_t *obj) { filter_t *filter = (filter_t *)obj; SpeexResamplerState *st = (SpeexResamplerState *)filter->p_sys; speex_resampler_destroy (st); } static block_t *Resample (filter_t *filter, block_t *in) { SpeexResamplerState *st = (SpeexResamplerState *)filter->p_sys; const size_t framesize = filter->fmt_out.audio.i_bytes_per_frame; const unsigned irate = filter->fmt_in.audio.i_rate; const unsigned orate = filter->fmt_out.audio.i_rate; spx_uint32_t ilen = in->i_nb_samples; spx_uint32_t olen = ((ilen + 2) * orate * 11) / (irate * 10); block_t *out = block_Alloc (olen * framesize); if (unlikely(out == NULL)) goto error; speex_resampler_set_rate (st, irate, orate); int err; if (filter->fmt_in.audio.i_format == VLC_CODEC_FL32) err = speex_resampler_process_interleaved_float (st, (float *)in->p_buffer, &ilen, (float *)out->p_buffer, &olen); else err = speex_resampler_process_interleaved_int (st, (int16_t *)in->p_buffer, &ilen, (int16_t *)out->p_buffer, &olen); if (err != 0) { msg_Err (filter, "cannot resample: %s", speex_resampler_strerror (err)); block_Release (out); out = NULL; goto error; } if (ilen < in->i_nb_samples) msg_Err (filter, "lost %"PRIu32" of %u input frames", in->i_nb_samples - ilen, in->i_nb_samples); out->i_buffer = olen * framesize; out->i_nb_samples = olen; out->i_pts = in->i_pts; out->i_length = olen * CLOCK_FREQ / filter->fmt_out.audio.i_rate; error: block_Release (in); return out; }
/* Memory handling for libdw. Copyright (C) 2003, 2004 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as published by the Open Source Initiative. You should have received a copy of the Open Software License along with this program; if not, you may obtain a copy of the Open Software License version 1.0 from http://www.opensource.org/licenses/osl.php or by writing the Open Source Initiative c/o Lawrence Rosen, Esq., 3001 King Ranch Road, Ukiah, CA 95482. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <error.h> #include <errno.h> #include <stdlib.h> #include <sys/param.h> #include "libdwP.h" void * __libdw_allocate (Dwarf *dbg, size_t minsize) { size_t size = MAX (dbg->mem_default_size, 2 * minsize + offsetof (struct libdw_memblock, mem)); struct libdw_memblock *newp = malloc (size); if (newp == NULL) dbg->oom_handler (); newp->size = newp->remaining = size - offsetof (struct libdw_memblock, mem); newp->prev = dbg->mem_tail; dbg->mem_tail = newp; return newp->mem; } Dwarf_OOM dwarf_new_oom_handler (Dwarf *dbg, Dwarf_OOM handler) { Dwarf_OOM old = dbg->oom_handler; dbg->oom_handler = handler; return old; } void __attribute ((noreturn, visibility ("hidden"))) __libdw_oom (void) { while (1) error (EXIT_FAILURE, ENOMEM, "libdw"); }
/* iobuf.h - I/O buffer * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. * * This file is part of GNUPG. * * GNUPG 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. * * GNUPG 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 G10_IOBUF_H #define G10_IOBUF_H #include "types.h" #define DBG_IOBUF iobuf_debug_mode #define IOBUFCTRL_INIT 1 #define IOBUFCTRL_FREE 2 #define IOBUFCTRL_UNDERFLOW 3 #define IOBUFCTRL_FLUSH 4 #define IOBUFCTRL_DESC 5 #define IOBUFCTRL_CANCEL 6 #define IOBUFCTRL_USER 16 typedef struct iobuf_struct *IOBUF; /* fixme: we should hide most of this stuff */ struct iobuf_struct { int use; /* 1 input , 2 output, 3 temp */ off_t nlimit; off_t nbytes; /* used together with nlimit */ off_t ntotal; /* total bytes read (position of stream) */ int nofast; /* used by the iobuf_get() */ void *directfp; struct { size_t size; /* allocated size */ size_t start; /* number of invalid bytes at the begin of the buffer */ size_t len; /* currently filled to this size */ byte *buf; } d; int filter_eof; int error; int (*filter)( void *opaque, int control, IOBUF chain, byte *buf, size_t *len); void *filter_ov; /* value for opaque */ int filter_ov_owner; char *real_fname; IOBUF chain; /* next iobuf used for i/o if any (passed to filter) */ int no, subno; const char *desc; void *opaque; /* can be used to hold any information */ /* this value is copied to all instances */ struct { size_t size; /* allocated size */ size_t start; /* number of invalid bytes at the begin of the buffer */ size_t len; /* currently filled to this size */ byte *buf; } unget; }; int iobuf_debug_mode; void iobuf_enable_special_filenames ( int yes ); IOBUF iobuf_alloc(int use, size_t bufsize); IOBUF iobuf_temp(void); IOBUF iobuf_temp_with_content( const char *buffer, size_t length ); IOBUF iobuf_open( const char *fname ); IOBUF iobuf_fdopen( int fd, const char *mode ); IOBUF iobuf_sockopen( int fd, const char *mode ); IOBUF iobuf_create( const char *fname ); IOBUF iobuf_append( const char *fname ); IOBUF iobuf_openrw( const char *fname ); int iobuf_ioctl ( IOBUF a, int cmd, int intval, void *ptrval ); int iobuf_close( IOBUF iobuf ); int iobuf_cancel( IOBUF iobuf ); int iobuf_push_filter( IOBUF a, int (*f)(void *opaque, int control, IOBUF chain, byte *buf, size_t *len), void *ov ); int iobuf_push_filter2( IOBUF a, int (*f)(void *opaque, int control, IOBUF chain, byte *buf, size_t *len), void *ov, int rel_ov ); int iobuf_flush(IOBUF a); void iobuf_clear_eof(IOBUF a); #define iobuf_set_error(a) do { (a)->error = 1; } while(0) #define iobuf_error(a) ((a)->error) void iobuf_set_limit( IOBUF a, off_t nlimit ); off_t iobuf_tell( IOBUF a ); int iobuf_seek( IOBUF a, off_t newpos ); int iobuf_readbyte(IOBUF a); int iobuf_read(IOBUF a, byte *buf, unsigned buflen ); unsigned iobuf_read_line( IOBUF a, byte **addr_of_buffer, unsigned *length_of_buffer, unsigned *max_length ); int iobuf_peek(IOBUF a, byte *buf, unsigned buflen ); int iobuf_writebyte(IOBUF a, unsigned c); int iobuf_write(IOBUF a, byte *buf, unsigned buflen ); int iobuf_writestr(IOBUF a, const char *buf ); void iobuf_flush_temp( IOBUF temp ); int iobuf_write_temp( IOBUF a, IOBUF temp ); size_t iobuf_temp_to_buffer( IOBUF a, byte *buffer, size_t buflen ); void iobuf_unget_and_close_temp( IOBUF a, IOBUF temp ); off_t iobuf_get_filelength( IOBUF a ); #define IOBUF_FILELENGTH_LIMIT 0xffffffff const char *iobuf_get_real_fname( IOBUF a ); const char *iobuf_get_fname( IOBUF a ); void iobuf_set_block_mode( IOBUF a, size_t n ); void iobuf_set_partial_block_mode( IOBUF a, size_t len ); int iobuf_in_block_mode( IOBUF a ); int iobuf_translate_file_handle ( int fd, int for_write ); /* get a byte form the iobuf; must check for eof prior to this function * this function returns values in the range 0 .. 255 or -1 to indicate EOF * iobuf_get_noeof() does not return -1 to indicate EOF, but masks the * returned value to be in the range 0 ..255. */ #define iobuf_get(a) \ ( ((a)->nofast || (a)->d.start >= (a)->d.len )? \ iobuf_readbyte((a)) : ( (a)->nbytes++, (a)->d.buf[(a)->d.start++] ) ) #define iobuf_get_noeof(a) (iobuf_get((a))&0xff) /* write a byte to the iobuf and return true on write error * This macro does only write the low order byte */ #define iobuf_put(a,c) iobuf_writebyte(a,c) #define iobuf_where(a) "[don't know]" #define iobuf_id(a) ((a)->no) #define iobuf_get_temp_buffer(a) ( (a)->d.buf ) #define iobuf_get_temp_length(a) ( (a)->d.len ) #define iobuf_is_temp(a) ( (a)->use == 3 ) #endif /*G10_IOBUF_H*/
/**************************************************************************** ** $Id: .emacs,v 1.3 2006/02/20 15:06:53 gis Exp $ ** ** Created : 2006 ** ** Copyright (C) 2006 Carsten Pfeiffer <pfeiffer@kde.org> ** ****************************************************************************/ #ifndef FILECACHE_H #define FILECACHE_H #include <qcache.h> #include "kuickfile.h" class KTempDir; class FileCache { public: static FileCache * self(); static void shutdown(); KuickFile * getFile( const KURL& url ); void setLimit( int numFiles ); int getLimit() const { return m_limit; } /** * @return the temporary directory or QString::null if none available */ QString tempDir(); private: static FileCache *s_self; FileCache(); ~FileCache(); KTempDir * createTempDir(); QCache<KuickFile> m_files; int m_limit; KTempDir *m_tempDir; }; #endif // FILECACHE_H
/*************************************************************************** * Copyright (C) 2007 by * * Lisandro Damián Nicanor Pérez Meyer - perezmeyer en/at 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., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef ENCARD_H #define ENCARD_H #include "genericcard.h" #include <QString> /** * \brief EN card: end of run - No parameters. */ class ENCard : public GenericCard { public: ENCard(); QString getCard(); }; #endif // ENCARD_H
/* Copyright (C) 2015-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <sys/socket.h> #include <sysdep-cancel.h> #include <socketcall.h> int __libc_accept (int fd, __SOCKADDR_ARG addr, socklen_t *len) { #ifdef __ASSUME_ACCEPT_SYSCALL return SYSCALL_CANCEL (accept, fd, addr.__sockaddr__, len); #elif defined __ASSUME_ACCEPT4_SYSCALL return SYSCALL_CANCEL (accept4, fd, addr.__sockaddr__, len, 0); #else return SOCKETCALL_CANCEL (accept, fd, addr.__sockaddr__, len); #endif } weak_alias (__libc_accept, accept) libc_hidden_def (accept)
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager Wireless Applet -- Display wireless access points and allow user control * * Dan Williams <dcbw@redhat.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. * * (C) Copyright 2007 - 2010 Red Hat, Inc. */ #ifndef WS_WPA_EAP_H #define WS_WPA_EAP_H #include <nm-connection.h> typedef struct _WirelessSecurityWPAEAP WirelessSecurityWPAEAP; WirelessSecurityWPAEAP * ws_wpa_eap_new (NMConnection *connection, gboolean is_editor, gboolean secrets_only); #endif /* WS_WPA_EAP_H */
/*************************************************************************** * MDP: IPS Patcher. * * * * Copyright (c) 1999-2002 by Stéphane Dallongeville * * Copyright (c) 2003-2004 by Stéphane Akhoun * * Copyright (c) 2008-2009 by David Korth * * * * 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. * ***************************************************************************/ // C includes. #include <string.h> #include <stdio.h> #include "ips.h" #include "ips_plugin.h" #include "ips_file.hpp" // libgsft includes. #include "libgsft/gsft_szprintf.h" #include "libgsft/gsft_strlcpy.h" #ifdef _WIN32 // Win32 includes. #include "libgsft/w32u/w32u_windows.h" #endif // MDP includes. #include "mdp/mdp_stdint.h" #include "mdp/mdp_cpuflags.h" #include "mdp/mdp_error.h" #include "mdp/mdp_event.h" #include "mdp/mdp_constants.h" // MDP Host Services. const mdp_host_t *ips_host_srv = NULL; static int MDP_FNCALL ips_event_handler(int event_id, void *event_info); // Directory registration. static int ips_dir_id = -1; static char ips_save_path[1024]; static int MDP_FNCALL ips_dir_get(int dir_id, char *out_buf, unsigned int size); static int MDP_FNCALL ips_dir_set(int dir_id, const char *buf); /** * ips_init(): Initialize the IPS Patcher plugin. * @return MDP error code. */ int MDP_FNCALL ips_init(const mdp_host_t *host_srv) { if (!host_srv) return -MDP_ERR_INVALID_PARAMETERS; // Save the MDP Host Services pointer. ips_host_srv = host_srv; // Set the Game Genie directory to the default save path initially. ips_host_srv->dir_get_default_save_path(ips_save_path, sizeof(ips_save_path)); // Attempt to register a directory. // If this fails, gg_dir_id will be less than 0. ips_dir_id = ips_host_srv->dir_register(&mdp, "IPS Patches", ips_dir_get, ips_dir_set); #ifdef _WIN32 // Initialize the Win32 Unicode Translation Layer. w32u_init(); #endif // Register the event handlers. ips_host_srv->event_register(&mdp, MDP_EVENT_OPEN_ROM, ips_event_handler); ips_host_srv->event_register(&mdp, MDP_EVENT_CLOSE_ROM, ips_event_handler); // Initialized. return MDP_ERR_OK; } /** * ips_end(): Shut down the IPS Patcher plugin. * @return MDP error code. */ int MDP_FNCALL ips_end(void) { if (!ips_host_srv) return MDP_ERR_OK; // If a directory was registered, unregister it. if (ips_dir_id >= 0) { ips_host_srv->dir_unregister(&mdp, ips_dir_id); ips_dir_id = -1; } #ifdef _WIN32 // Shut down the Win32 Unicode Translation Layer. w32u_end(); #endif // Unregister the event handlers. ips_host_srv->event_unregister(&mdp, MDP_EVENT_OPEN_ROM, ips_event_handler); ips_host_srv->event_unregister(&mdp, MDP_EVENT_CLOSE_ROM, ips_event_handler); // Plugin is shut down. return MDP_ERR_OK; } static int MDP_FNCALL ips_event_handler(int event_id, void *event_info) { if (event_id == MDP_EVENT_OPEN_ROM) { mdp_event_open_rom_t *openROM = (mdp_event_open_rom_t*)(event_info); if (!openROM->rom_name) return MDP_ERR_OK; // IPS patch file is [save directory]/ROM_name.ips. char patch_filename[1024]; szprintf(patch_filename, sizeof(patch_filename), "%s/%s.ips", ips_save_path, openROM->rom_name); // Attempt to load the patch. // TODO: Make autoloading based on filename user-configurable. ips_file_load(patch_filename); } // TODO return MDP_ERR_OK; } /** * ips_dir_get(): Get the IPS Patcher directory. * @param dir_id Directory ID. * @param out_buf Buffer to store the IPS Patcher directory in. * @param size Size of the buffer. * @return MDP error code. */ static int MDP_FNCALL ips_dir_get(int dir_id, char *out_buf, unsigned int size) { if (dir_id != ips_dir_id) return -MDP_ERR_DIR_INVALID_DIRID; strlcpy(out_buf, ips_save_path, size); return MDP_ERR_OK; } /** * ips_dir_set(): Set the IPS Patcher directory. * @param dir_id Directory ID. * @param buf New directory. * @return MDP error code. */ static int MDP_FNCALL ips_dir_set(int dir_id, const char *buf) { if (dir_id != ips_dir_id) return -MDP_ERR_DIR_INVALID_DIRID; strlcpy(ips_save_path, buf, sizeof(ips_save_path)); return MDP_ERR_OK; }
/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2014-2018 Broadcom * All rights reserved. */ #ifndef _BNXT_IRQ_H_ #define _BNXT_IRQ_H_ struct bnxt_irq { rte_intr_callback_fn handler; unsigned int vector; uint8_t requested; char name[RTE_ETH_NAME_MAX_LEN + 2]; }; struct bnxt; int bnxt_free_int(struct bnxt *bp); void bnxt_disable_int(struct bnxt *bp); void bnxt_enable_int(struct bnxt *bp); int bnxt_setup_int(struct bnxt *bp); int bnxt_request_int(struct bnxt *bp); void bnxt_int_handler(void *param); #endif
/* Copyright 2005-2016 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks 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. Threading Building Blocks 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 Threading Building Blocks; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* The original source for this example is Copyright (c) 1994-2008 John E. Stone All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * box.h - This file contains the defines for boxes etc. * * $Id: box.h,v 1.2 2007-02-22 17:54:15 Exp $ */ typedef struct { unsigned int id; /* Unique Object serial number */ void * nextobj; /* pointer to next object in list */ object_methods * methods; /* this object's methods */ texture * tex; /* object texture */ vector min; vector max; } box; box * newbox(void * tex, vector min, vector max); void box_intersect(box *, ray *); void box_normal(box *, vector *, ray * incident, vector *);
#include "font_data.h" #include <stdint.h> #include <sys/types.h> #include <unistd.h> #include "picture_t.h" void osd_print(struct picture_t *pic, const char *str) { int i; for(i=0; i<16; i++){ int j = 0; const char *p = str; while(*p){ uint8_t tmp = ASCII[*p-32][i]; int k; for(k=0; k<8; k++){ uint8_t *px = &(pic->buffer[i*pic->width + j]); *px = (tmp & 1) ? 255 : *px*3ul/4; tmp >>= 1; j++; } p++; } } }
/*********************************************************************** Geoid - Class to represent geoids, actually reference ellipsoids, to support coordinate system transformations between several spherical or ellipsoidal coordinate systems commonly used in geodesy. Copyright (c) 2009-2010 Oliver Kreylos This file is part of the Templatized Geometry Library (TGL). The Templatized Geometry 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 2 of the License, or (at your option) any later version. The Templatized Geometry Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Templatized Geometry Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #ifndef GEOMETRY_GEOID_INCLUDED #define GEOMETRY_GEOID_INCLUDED #include <Math/Math.h> #include <Math/Constants.h> #include <Geometry/Point.h> #include <Geometry/Matrix.h> #include <Geometry/Rotation.h> #include <Geometry/OrthonormalTransformation.h> namespace Geometry { template <class ScalarParam> class Geoid { /* Embedded classes: */ public: typedef ScalarParam Scalar; // Scalar type for input/output geometry objects static const int dimension=3; // Geoids are always three-dimensional typedef Geometry::Point<Scalar,dimension> Point; // Type for points typedef Geometry::Matrix<Scalar,dimension,dimension> Derivative; // Type for transformation derivatives typedef Geometry::Rotation<Scalar,dimension> Orientation; // Type for coordinate orientations typedef Geometry::OrthonormalTransformation<Scalar,dimension> Frame; // Type for coordinate frames /* Elements: */ public: double radius; // Geoid's radius (semi-major axis) in whatever unit is convenient double flatteningFactor; // Geoid's flattening factor double b; // Geoid's semi-minor axis double e2; // Geoid's squared eccentricity, derived from flattening factor double ep2; // Geoid's squared second eccentricity /* Constructors and destructors: */ public: Geoid(void); // Creates a default geoid (WGS84) Geoid(double sRadius,double sFlatteningFactor); // Creates a geoid with the given parameters /* Methods: */ double getRadius(void) const // Returns the geoid's radius (semi-major axis) { return radius; } double getFlatteningFactor(void) const // Returns the geoid's flattening factor { return flatteningFactor; } /********************************************************************* Conversions between Geoid-centered Geoid-fixed Cartesian and geodetic (longitude/latitude/elevation) coordinates: Geodetic points are in (longitude, latitude, elevation) in radians and whatever unit was used for the Geoid's radius. Cartesian points are (x, y, z) where (0, 0, 0) is the Geoid's centroid, the north pole is at (0, 0, +b), and the 0 meridian is in the y=0 plane. Cartesian frames have their z axes normal to the ellipsoid pointing to the outside (away from the centroid), and their y axes pointing north along a meridian. *********************************************************************/ Point geodeticToCartesian(const Point& geodetic) const // Transforms a point { double sLon=Math::sin(double(geodetic[0])); double cLon=Math::cos(double(geodetic[0])); double sLat=Math::sin(double(geodetic[1])); double cLat=Math::cos(double(geodetic[1])); double elev=double(geodetic[2]); double chi=Math::sqrt(1.0-e2*sLat*sLat); return Point(Scalar((radius/chi+elev)*cLat*cLon),Scalar((radius/chi+elev)*cLat*sLon),Scalar((radius*(1.0-e2)/chi+elev)*sLat)); } Derivative geodeticToCartesianDerivative(const Point& geodeticBase) const; // Returns the derivative of the point transformation at the given base point in geodetic coordinates Orientation geodeticToCartesianOrientation(const Point& geodeticBase) const // Returns a geoid-tangential coordinate orientation at the given base point in geodetic coordinates { Orientation o=Orientation::rotateZ(Scalar(0.5*Math::Constants<double>::pi+double(geodeticBase[0]))); o*=Orientation::rotateX(Scalar(0.5*Math::Constants<double>::pi-double(geodeticBase[1]))); return o; } Frame geodeticToCartesianFrame(const Point& geodeticBase) const; // Returns a geoid-tangential coordinate frame at the given base point in geodetic coordinates Point cartesianToGeodetic(const Point& cartesian) const; // Transforms a point }; #if defined(GEOMETRY_NONSTANDARD_TEMPLATES) && !defined(GEOMETRY_GEOID_IMPLEMENTATION) #include <Geometry/Geoid.icpp> #endif } #endif
#pragma once /* * Copyright (C) 2005-2017 Team KODI * http://kodi.tv * * 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 KODI; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "../../AddonBase.h" #include "../Window.h" namespace kodi { namespace gui { namespace controls { //============================================================================ /// /// \defgroup cpp_kodi_gui_controls_CImage Control Image /// \ingroup cpp_kodi_gui /// @brief \cpp_class{ kodi::gui::controls::CImage } /// **Window control used to show an image.** /// /// The image control is used for displaying images in Kodi. You can choose /// the position, size, transparency and contents of the image to be displayed. /// /// It has the header \ref Image.h "#include <kodi/gui/controls/Image.h>" /// be included to enjoy it. /// /// Here you find the needed skin part for a \ref Image_Control "image control" /// /// @note The call of the control is only possible from the corresponding /// window as its class and identification number is required. /// class CImage : public CAddonGUIControlBase { public: //========================================================================== /// /// \ingroup cpp_kodi_gui_controls_CImage /// @brief Construct a new control /// /// @param[in] window related window control class /// @param[in] controlId Used skin xml control id /// CImage(CWindow* window, int controlId) : CAddonGUIControlBase(window) { m_controlHandle = m_interface->kodi_gui->window->get_control_image(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); if (!m_controlHandle) kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CImage can't create control class from Kodi !!!"); } //-------------------------------------------------------------------------- //========================================================================== /// /// \ingroup cpp_kodi_gui_controls_CImage /// @brief Destructor /// virtual ~CImage() = default; //-------------------------------------------------------------------------- //========================================================================== /// /// \ingroup cpp_kodi_gui_controls_CImage /// @brief Set the control on window to visible /// /// @param[in] visible If true visible, otherwise hidden /// void SetVisible(bool visible) { m_interface->kodi_gui->control_image->set_visible(m_interface->kodiBase, m_controlHandle, visible); } //-------------------------------------------------------------------------- //========================================================================== /// /// \ingroup cpp_kodi_gui_controls_CImage /// @brief To set the filename used on image control. /// /// @param[in] filename Image file to use /// @param[in] useCache To define storage of image, default is /// in cache, if false becomes it loaded /// always on changes again /// void SetFileName(const std::string& filename, bool useCache = true) { m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, filename.c_str(), useCache); } //-------------------------------------------------------------------------- //========================================================================== /// /// \ingroup cpp_kodi_gui_controls_CImage /// @brief To set set the diffuse color on image. /// /// @param[in] colorDiffuse Color to use for diffuse /// void SetColorDiffuse(uint32_t colorDiffuse) { m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, colorDiffuse); } //-------------------------------------------------------------------------- }; } /* namespace controls */ } /* namespace gui */ } /* namespace kodi */
// license:BSD-3-Clause // copyright-holders:Nicola Salmoria, Andreas Naive, Charles MacDonald /*************************************************************************** Hitachi FD1089A/FD1089B encryption emulation **************************************************************************** Copyright Nicola Salmoria, Andreas Naive, and Charles MacDonald. All rights reserved. ***************************************************************************/ #ifndef __FD1089_H__ #define __FD1089_H__ #include "cpu/m68000/m68000.h" //************************************************************************** // CONSTANTS //************************************************************************** // device type definition extern const device_type FD1089A; extern const device_type FD1089B; //************************************************************************** // TYPE DEFINITIONS //************************************************************************** // ======================> fd1089_base_device // base device, shared implementation between A and B variants class fd1089_base_device : public m68000_device { public: // construction/destruction fd1089_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); // explicit decryption helpers void decrypt(offs_t baseaddr, UINT32 size, offs_t regionoffs, UINT16 *opcodesptr, UINT16 *dataptr) { decrypt(baseaddr, size, &m_plaintext[regionoffs/2], opcodesptr, dataptr); } protected: // device overrides virtual void device_start() override; // internal helpers UINT8 rearrange_key(UINT8 table, bool opcode); virtual UINT8 decode(UINT8 val, UINT8 key, bool opcode) = 0; UINT16 decrypt_one(offs_t addr, UINT16 val, const UINT8 *key, bool opcode); void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT16 *dataptr); // internal state const UINT8 * m_key; std::vector<UINT16> m_plaintext; required_shared_ptr<UINT16> m_decrypted_opcodes; // internal types struct decrypt_parameters { UINT8 xorval; UINT8 s7,s6,s5,s4,s3,s2,s1,s0; }; // static tables static const UINT8 s_basetable_fd1089[0x100]; static const decrypt_parameters s_addr_params[16]; static const decrypt_parameters s_data_params_a[16]; }; // ======================> fd1089a_device // FD1089A variant class fd1089a_device : public fd1089_base_device { public: // construction/destruction fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: virtual UINT8 decode(UINT8 val, UINT8 key, bool opcode) override; }; // ======================> fd1089b_device // FD1089B variant class fd1089b_device : public fd1089_base_device { public: // construction/destruction fd1089b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: virtual UINT8 decode(UINT8 val, UINT8 key, bool opcode) override; }; #endif
/* Copyright (C) 2005, 2010 - Cryptic Sea This file is part of Gish. Gish 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. */ void checkkeyboard(void); unsigned char keyboard[323]; unsigned char prevkeyboard[323]; #define SCAN_ESC 27 #define SCAN_0 48 #define SCAN_1 49 #define SCAN_2 50 #define SCAN_3 51 #define SCAN_4 52 #define SCAN_5 53 #define SCAN_6 54 #define SCAN_7 55 #define SCAN_8 56 #define SCAN_9 57 #define SCAN_MINUS 45 #define SCAN_EQUALS 61 #define SCAN_BKSP 8 #define SCAN_TAB 9 #define SCAN_LFT_BRACKET 91 #define SCAN_RGT_BRACKET 93 #define SCAN_ENTER 13 #define SCAN_CTRL 306 #define SCAN_RCTRL 305 #define SCAN_SEMI 59 #define SCAN_APOS 39 #define SCAN_TILDE 96 #define SCAN_SHIFT 304 #define SCAN_BACK_SLASH 92 #define SCAN_COMMA 44 #define SCAN_PERIOD 46 #define SCAN_FOWARD_SLASH 47 #define SCAN_RSHIFT 303 #define SCAN_PRT_SCRN 316 #define SCAN_ALT 308 #define SCAN_SPACE 32 #define SCAN_CAPS_LOCK 301 #define SCAN_F1 282 #define SCAN_F2 283 #define SCAN_F3 284 #define SCAN_F4 285 #define SCAN_F5 286 #define SCAN_F6 287 #define SCAN_F7 288 #define SCAN_F8 289 #define SCAN_F9 290 #define SCAN_F10 291 #define SCAN_F11 292 #define SCAN_F12 293 #define SCAN_NUM_LOCK 300 #define SCAN_SCROLL_LOCK 302 #define SCAN_NUMHOME 263 #define SCAN_UP 273 #define SCAN_NUMPGUP 265 #define SCAN_NUM_MINUS 269 #define SCAN_LEFT 276 #define SCAN_CENTER 261 #define SCAN_RIGHT 275 #define SCAN_NUMPLUS 270 #define SCAN_NUMEND 257 #define SCAN_DOWN 274 #define SCAN_NUMPGDWN 259 #define SCAN_NUMINS 256 #define SCAN_NUMDEL 266 #define SCAN_LWIN 311 #define SCAN_RWIN 312 #define SCAN_APPS 313 #define SCAN_NUMENTER 271 #define SCAN_NUMLEFT 260 #define SCAN_NUMRIGHT 262 #define SCAN_NUMUP 264 #define SCAN_NUMDOWN 258 #define SCAN_LEFTARROW 276 #define SCAN_RIGHTARROW 275 #define SCAN_UPARROW 273 #define SCAN_DOWNARROW 274 #define SCAN_INSERT 277 #define SCAN_DELETE 127 #define SCAN_HOME 278 #define SCAN_END 279 #define SCAN_PAGEUP 280 #define SCAN_PAGEDOWN 281 #define SCAN_A 97 #define SCAN_B 98 #define SCAN_C 99 #define SCAN_D 100 #define SCAN_E 101 #define SCAN_F 102 #define SCAN_G 103 #define SCAN_H 104 #define SCAN_I 105 #define SCAN_J 106 #define SCAN_K 107 #define SCAN_L 108 #define SCAN_M 109 #define SCAN_N 110 #define SCAN_O 111 #define SCAN_P 112 #define SCAN_Q 113 #define SCAN_R 114 #define SCAN_S 115 #define SCAN_T 116 #define SCAN_U 117 #define SCAN_V 118 #define SCAN_W 119 #define SCAN_X 120 #define SCAN_Y 121 #define SCAN_Z 122
/* * (C) Copyright 2012, 2013 * Emcraft Systems, <www.emcraft.com> * Alexander Potashev <aspotashev@emcraft.com> * Vladimir Khusianov <vlad@emcraft.com> * * See file CREDITS for list of people who contributed to this * project. * * 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 */ #include <linux/init.h> #include <asm/mach-types.h> #include <asm/hardware/nvic.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> #include <mach/clock.h> #include <mach/iomux.h> #include <mach/platform.h> #include <mach/timer.h> #include <mach/uart.h> #include <mach/eth.h> #include <mach/spi.h> #include <mach/nor-flash.h> #include <mach/i2c.h> /* * Prototypes */ static void __init lpc18xx_map_io(void); static void __init lpc18xx_init_irq(void); static void __init lpc18xx_init(void); /* * Define a particular platform (board) */ static int lpc18xx_platform = PLATFORM_LPC18XX_HITEX_LPC4350_EVAL; /* * Data structure for the timer system. */ static struct sys_timer lpc18xx_timer = { .init = lpc18xx_timer_init, }; /* * Interface to get the platform */ EXPORT_SYMBOL(lpc18xx_platform_get); int lpc18xx_platform_get(void) { return lpc18xx_platform; } /* * Interface to get the SmartFusion device */ EXPORT_SYMBOL(lpc18xx_device_get); int lpc18xx_device_get(void) { int r; switch (lpc18xx_platform) { case PLATFORM_LPC18XX_HITEX_LPC4350_EVAL: r = DEVICE_LPC4350; break; case PLATFORM_LPC18XX_HITEX_LPC1850_EVAL: r = DEVICE_LPC1850; break; default: r = DEVICE_LPC4350; break; } return r; } /* * User can (and should) define the platform from U-Boot */ static int __init lpc18xx_platform_parse(char *s) { if (!strcmp(s, "hitex-lpc4350")) lpc18xx_platform = PLATFORM_LPC18XX_HITEX_LPC4350_EVAL; else if (!strcmp(s, "hitex-lpc1850")) lpc18xx_platform = PLATFORM_LPC18XX_HITEX_LPC1850_EVAL; return 1; } __setup("lpc18xx_platform=", lpc18xx_platform_parse); /* * LPC18xx plaform machine description. */ MACHINE_START(LPC18XX, "NXP LPC18xx") /* * Physical address of the serial port used for the early * kernel debugging (CONFIG_DEBUG_LL=y). * This address is actually never used in the MMU-less kernel * (since no mapping is needed to access this port), * but let's keep these fields filled out for consistency. */ .phys_io = 0 /* TBD */, .io_pg_offst = 0 /* TBD */, .map_io = lpc18xx_map_io, .init_irq = lpc18xx_init_irq, .timer = &lpc18xx_timer, .init_machine = lpc18xx_init, MACHINE_END /* * Map required regions. * This being the no-MMU Linux, I am not mapping anything * since all I/O registers are available at their physical addresses. */ static void __init lpc18xx_map_io(void) { } /* * Initialize the interrupt processing subsystem. */ static void __init lpc18xx_init_irq(void) { /* * Initialize NVIC. All interrupts are masked initially. */ nvic_init(); } /* * LPC18xx platform initialization. */ static void __init lpc18xx_init(void) { /* * Configure the IOMUXes of LPC18xx */ lpc18xx_iomux_init(); #if defined(CONFIG_SERIAL_8250) /* * Configure the UART devices */ lpc18xx_uart_init(); #endif #if defined(CONFIG_STM32_ETHER) /* * Configure the LPC18xx MAC */ lpc18xx_eth_init(); #endif #if defined(CONFIG_SPI_PL022) /* * Configure the SSP/SPI */ lpc18xx_spi_init(); #endif #if defined(CONFIG_MTD_PHYSMAP) /* * Configure external NOR flash */ lpc18xx_nor_flash_init(); #endif #if defined(CONFIG_I2C_LPC2K) /* * Configure the I2C bus */ lpc18xx_i2c_init(); #endif }
/* * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2009 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "WebGLProgram.h" #include <wtf/RefCounted.h> namespace WebCore { class WebGLUniformLocation final : public RefCounted<WebGLUniformLocation> { public: ~WebGLUniformLocation() { } static Ref<WebGLUniformLocation> create(WebGLProgram*, GC3Dint location, GC3Denum type); WebGLProgram* program() const; GC3Dint location() const; GC3Denum type() const; protected: WebGLUniformLocation(WebGLProgram*, GC3Dint location, GC3Denum type); private: RefPtr<WebGLProgram> m_program; GC3Dint m_location; unsigned m_linkCount; GC3Denum m_type; }; } // namespace WebCore
/* iqc.h This file is part of a program that implements a Software-Defined Radio. Copyright (C) 2013 Warren Pratt, NR0V 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. The author can be reached by email at warren@wpratt.com */ #ifndef _iqc_h #define _iqc_h typedef struct _iqc { volatile long run; volatile long busy; int size; double* in; double* out; double rate; int ints; double* t; int cset; double* cm[2]; double* cc[2]; double* cs[2]; double tup; double* cup; int count; int ntup; int state; struct { int spi; int* cpi; int full_ints; int count; CRITICAL_SECTION cs; } dog; } iqc, *IQC; extern IQC create_iqc (int run, int size, double* in, double* out, double rate, int ints, double tup, int spi); extern void destroy_iqc (IQC a); extern void flush_iqc (IQC a); extern void xiqc (IQC a); extern void setBuffers_iqc (IQC a, double* in, double* out); extern void setSamplerate_iqc (IQC a, int rate); extern void setSize_iqc (IQC a, int size); extern void size_iqc (IQC a); extern void desize_iqc (IQC a); // TXA Properties extern __declspec (dllexport) void GetTXAiqcValues (int channel, double* cm, double* cc, double* cs); extern __declspec (dllexport) void SetTXAiqcValues (int channel, double* cm, double* cc, double* cs); extern __declspec (dllexport) void SetTXAiqcSwap (int channel, double* cm, double* cc, double* cs); extern __declspec (dllexport) void SetTXAiqcStart (int channel, double* cm, double* cc, double* cs); extern __declspec (dllexport) void SetTXAiqcEnd (int channel); void GetTXAiqcDogCount (int channel, int* count); void SetTXAiqcDogCount (int channel, int count); #endif
// // Visopsys // Copyright (C) 1998-2015 J. Andrew McLaughlin // // 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. // // cmdwin.c // // This command will create a new command window /* This is the text that appears when a user requests help about this program <help> -- cmdwin -- Open a new command window. Usage: cmdwin (Only available in graphics mode) This command will open a new text window running a new instance of the 'vsh' command shell. </help> */ #include <errno.h> #include <libintl.h> #include <locale.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/api.h> #include <sys/env.h> #include <sys/font.h> #include <sys/paths.h> #include <sys/window.h> #define _(string) gettext(string) #define WINDOW_TITLE _("Command Window") static int shellProcessId = 0; objectKey window = NULL; static void refreshWindow(void) { // We got a 'window refresh' event (probably because of a language switch), // so we need to update things // Re-get the language setting setlocale(LC_ALL, getenv(ENV_LANG)); textdomain("cmdwin"); // Refresh the window title windowSetTitle(window, WINDOW_TITLE); } static void eventHandler(objectKey key, windowEvent *event) { // Check for window events. if (key == window) { // Check for window refresh if (event->type == EVENT_WINDOW_REFRESH) refreshWindow(); // Check for the window being closed else if (event->type == EVENT_WINDOW_CLOSE) // The window is being closed by a GUI event. Just kill our shell // process -- the main process will stop blocking and do the rest // of the shutdown. multitaskerKillProcess(shellProcessId, 0 /* no force */); } } int main(int argc, char *argv[]) { int status = 0; int myProcessId = 0; int myPrivilege = 0; componentParameters params; int rows = 25; objectKey textArea = NULL; setlocale(LC_ALL, getenv(ENV_LANG)); textdomain("cmdwin"); // Only work in graphics mode if (!graphicsAreEnabled()) { printf(_("\nThe \"%s\" command only works in graphics mode\n"), (argc? argv[0] : "")); errno = ERR_NOTINITIALIZED; return (status = errno); } myProcessId = multitaskerGetCurrentProcessId(); myPrivilege = multitaskerGetProcessPrivilege(myProcessId); // Load a shell process shellProcessId = loaderLoadProgram(PATH_PROGRAMS "/vsh", myPrivilege); if (shellProcessId < 0) { printf("%s", _("Unable to load shell\n")); errno = shellProcessId; return (status = shellProcessId); } // Create a new window window = windowNew(myProcessId, WINDOW_TITLE); // Put a text area in the window memset(&params, 0, sizeof(componentParameters)); params.gridWidth = 1; params.gridHeight = 1; params.padLeft = 1; params.padRight = 1; params.padTop = 1; params.padBottom = 1; params.orientationX = orient_center; params.orientationY = orient_middle; params.flags |= WINDOW_COMPFLAG_STICKYFOCUS; status = fileFind(PATH_SYSTEM_FONTS "/xterm-normal-10.vbf", NULL); if (status >= 0) status = fontLoadSystem("xterm-normal-10.vbf", "xterm-normal-10", &(params.font), 1); if (status < 0) { params.font = NULL; // The system font can comfortably show more rows rows = 40; } textArea = windowNewTextArea(window, 80, rows, 200, &params); windowComponentFocus(textArea); // Use the text area for all our input and output windowSetTextOutput(textArea); // Go live. windowSetVisible(window, 1); // Register an event handler to catch window close events windowRegisterEventHandler(window, &eventHandler); // Run the GUI as a thread windowGuiThread(); // Execute the shell status = loaderExecProgram(shellProcessId, 1 /* block */); // If we get to here, the shell has exited. // Stop our GUI thread windowGuiStop(); // Destroy the window windowDestroy(window); // Done return (status); }
#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> // Mono.Security.X509.X509Certificate struct X509Certificate_t850; // System.Byte[] struct ByteU5BU5D_t104; // System.Security.Cryptography.DSA struct DSA_t565; // System.String struct String_t; // Mono.Security.ASN1 struct ASN1_t845; // System.Runtime.Serialization.SerializationInfo struct SerializationInfo_t312; #include "codegen/il2cpp-codegen.h" #include "mscorlib_System_DateTime.h" #include "mscorlib_System_Runtime_Serialization_StreamingContext.h" // System.Void Mono.Security.X509.X509Certificate::.ctor(System.Byte[]) extern "C" void X509Certificate__ctor_m4599 (X509Certificate_t850 * __this, ByteU5BU5D_t104* ___data, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void Mono.Security.X509.X509Certificate::.cctor() extern "C" void X509Certificate__cctor_m4600 (Object_t * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void Mono.Security.X509.X509Certificate::Parse(System.Byte[]) extern "C" void X509Certificate_Parse_m4601 (X509Certificate_t850 * __this, ByteU5BU5D_t104* ___data, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Byte[] Mono.Security.X509.X509Certificate::GetUnsignedBigInteger(System.Byte[]) extern "C" ByteU5BU5D_t104* X509Certificate_GetUnsignedBigInteger_m4602 (X509Certificate_t850 * __this, ByteU5BU5D_t104* ___integer, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Security.Cryptography.DSA Mono.Security.X509.X509Certificate::get_DSA() extern "C" DSA_t565 * X509Certificate_get_DSA_m4603 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String Mono.Security.X509.X509Certificate::get_IssuerName() extern "C" String_t* X509Certificate_get_IssuerName_m4604 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Byte[] Mono.Security.X509.X509Certificate::get_KeyAlgorithmParameters() extern "C" ByteU5BU5D_t104* X509Certificate_get_KeyAlgorithmParameters_m4605 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Byte[] Mono.Security.X509.X509Certificate::get_PublicKey() extern "C" ByteU5BU5D_t104* X509Certificate_get_PublicKey_m4606 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Byte[] Mono.Security.X509.X509Certificate::get_RawData() extern "C" ByteU5BU5D_t104* X509Certificate_get_RawData_m4607 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String Mono.Security.X509.X509Certificate::get_SubjectName() extern "C" String_t* X509Certificate_get_SubjectName_m4608 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.DateTime Mono.Security.X509.X509Certificate::get_ValidFrom() extern "C" DateTime_t52 X509Certificate_get_ValidFrom_m4609 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.DateTime Mono.Security.X509.X509Certificate::get_ValidUntil() extern "C" DateTime_t52 X509Certificate_get_ValidUntil_m4610 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // Mono.Security.ASN1 Mono.Security.X509.X509Certificate::GetIssuerName() extern "C" ASN1_t845 * X509Certificate_GetIssuerName_m4611 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // Mono.Security.ASN1 Mono.Security.X509.X509Certificate::GetSubjectName() extern "C" ASN1_t845 * X509Certificate_GetSubjectName_m4612 (X509Certificate_t850 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void Mono.Security.X509.X509Certificate::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void X509Certificate_GetObjectData_m4613 (X509Certificate_t850 * __this, SerializationInfo_t312 * ___info, StreamingContext_t313 ___context, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Byte[] Mono.Security.X509.X509Certificate::PEM(System.String,System.Byte[]) extern "C" ByteU5BU5D_t104* X509Certificate_PEM_m4614 (Object_t * __this /* static, unused */, String_t* ___type, ByteU5BU5D_t104* ___data, const MethodInfo* method) IL2CPP_METHOD_ATTR;
#ifndef _XT_SERVICE_H #define _XT_SERVICE_H /* * Copyright (C) 2006-2012, BalaBit IT Ltd. * This program/include file 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/include file is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU 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 */ enum { IPT_SERVICE_TYPE_ANY = 0, IPT_SERVICE_TYPE_PROXY, IPT_SERVICE_TYPE_FORWARD, }; enum { IPT_SERVICE_NAME_ANY = 0, IPT_SERVICE_NAME_WILDCARD, IPT_SERVICE_NAME_MATCH, }; #define IPT_SERVICE_NAME_LENGTH 117 struct ipt_service_info { u_int8_t type; u_int8_t name_match; unsigned char name[IPT_SERVICE_NAME_LENGTH + 1]; unsigned int generation; unsigned int service_id; }; #endif
/* * mptsd input handling header file * Copyright (C) 2010-2011 Unix Solutions Ltd. * * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. */ #ifndef INPUT_H #define INPUT_H void * input_stream(void *); #endif
/** * @file XMLHandler.h * @brief XMLHandler interface * @author Ben Bornstein * * <!-------------------------------------------------------------------------- * This file is part of libSBML. Please visit http://sbml.org for more * information about SBML, and the latest version of libSBML. * * Copyright (C) 2009-2013 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK * * Copyright (C) 2006-2008 by the California Institute of Technology, * Pasadena, CA, USA * * Copyright (C) 2002-2005 jointly by the following organizations: * 1. California Institute of Technology, Pasadena, CA, USA * 2. Japan Science and Technology Agency, Japan * * 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. A copy of the license agreement is provided * in the file named "LICENSE.txt" included with this software distribution and * also available online as http://sbml.org/software/libsbml/license.html * ---------------------------------------------------------------------- --> * * @class XMLHandler * @sbmlbrief{core} Class providing a unified interface to different XML * parsers. * * @if notclike @internal @endif@~ */ #ifndef XMLHandler_h #define XMLHandler_h #ifdef __cplusplus #include <string> #include <sbml/xml/XMLExtern.h> LIBSBML_CPP_NAMESPACE_BEGIN /** @cond doxygenLibsbmlInternal */ class XMLToken; class LIBLAX_EXTERN XMLHandler { public: /** * Creates a new XMLHandler. */ XMLHandler (); /** @cond doxygenLibsbmlInternal */ /** * Copy Constructor */ XMLHandler (const XMLHandler& other); /** @endcond */ /** * Destroys this XMLHandler. */ virtual ~XMLHandler (); /** * Receive notification of the beginning of the document. * * By default, do nothing. Application writers may override this method * in a subclass to take specific actions at the start of the document. */ virtual void startDocument (); /** * Receive notification of the XML declaration, i.e. * <?xml version="1.0" encoding="UTF-8"?> * * By default, do nothing. Application writers may override this method * in a subclass to take specific actions at the declaration. */ virtual void XML (const std::string& version, const std::string& encoding); /** * Receive notification of the start of an element. * * By default, do nothing. Application writers may override this method * in a subclass to take specific actions at the start of each element. */ virtual void startElement (const XMLToken& element); /** * Receive notification of the end of the document. * * By default, do nothing. Application writers may override this method * in a subclass to take specific actions at the end of the document. */ virtual void endDocument (); /** * Receive notification of the end of an element. * * By default, do nothing. Application writers may override this method * in a subclass to take specific actions at the end of each element. */ virtual void endElement (const XMLToken& element); /** * Receive notification of character data inside an element. * * By default, do nothing. Application writers may override this method * to take specific actions for each chunk of character data. */ virtual void characters (const XMLToken& data); }; /** @endcond */ LIBSBML_CPP_NAMESPACE_END #endif /* __cplusplus */ #endif /* XMLHandler_h */
#include "config.h" #include <sys/types.h> #include <sys/quota.h> #include <errno.h> #include <stdio.h> #include "pot.h" static int copy_user_quota_limits(const char *block_device, uid_t from, uid_t to) { struct dqblk dq; if (quotactl(QCMD(Q_GETQUOTA, USRQUOTA), block_device, from, (caddr_t) & dq) == 0) { if (quotactl(QCMD(Q_SETQLIM, USRQUOTA), block_device, to, (caddr_t) & dq) == 0) { return (0); } else { errstr( _("copy_user_quota_limits: Failed to set userquota for uid %ld : %s\n"), to, strerror(errno)); return (1); } } else { errstr( _("copy_user_quota_limits: Failed to get userquota for uid %ld : %s\n"), from, strerror(errno)); return (1); } } tatic int copy_group_quota_limits(const char *block_device, gid_t from, gid_t to) { struct dqblk dq; if (quotactl(QCMD(Q_GETQUOTA, GRPQUOTA), block_device, from, (caddr_t) & dq) == 0) { if (quotactl(QCMD(Q_SETQLIM, GRPQUOTA), block_device, to, (caddr_t) & dq) == 0) { return (0); } else { errstr( _("copy_group_quota_limits: Failed to set groupquota for gid %ld : %s\n"), to, strerror(errno)); return (1); } } else { errstr( _("copy_group_quota_limits: Failed to get groupquota for gid %ld : %s\n"), from, strerror(errno)); return (1); } } main(int argc, char **argv) { gettexton(); copy_user_quota_limits("/dev/hda8", 152, 151); }
/* Target-dependent code for the GNU Hurd. Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "defs.h" #include "osabi.h" #include "solib-svr4.h" #include "i386-tdep.h" /* From <sys/ucontext.h>. */ static int i386gnu_gregset_reg_offset[] = { 11 * 4, /* %eax */ 10 * 4, /* %ecx */ 9 * 4, /* %edx */ 8 * 4, /* %ebx */ 17 * 4, /* %uesp */ 6 * 4, /* %ebp */ 5 * 4, /* %esi */ 4 * 4, /* %edi */ 14 * 4, /* %eip */ 16 * 4, /* %efl */ 15 * 4, /* %cs */ 18 * 4, /* %ss */ 3 * 4, /* %ds */ 2 * 4, /* %es */ 1 * 4, /* %fs */ 0 * 4, /* %gs */ }; static void i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* GNU uses ELF. */ i386_elf_init_abi (info, gdbarch); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); tdep->gregset_reg_offset = i386gnu_gregset_reg_offset; tdep->gregset_num_regs = ARRAY_SIZE (i386gnu_gregset_reg_offset); tdep->sizeof_gregset = 19 * 4; tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */ } /* Provide a prototype to silence -Wmissing-prototypes. */ extern void _initialize_i386gnu_tdep (void); void _initialize_i386gnu_tdep (void) { gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_HURD, i386gnu_init_abi); }
// Aseprite Base Library // Copyright (c) 2001-2013 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #include <stdexcept> #include <windows.h> #include <shlobj.h> #include <sys/stat.h> #include "base/path.h" #include "base/string.h" #include "base/win32_exception.h" namespace base { bool is_file(const std::string& path) { DWORD attr = ::GetFileAttributes(from_utf8(path).c_str()); // GetFileAttributes returns INVALID_FILE_ATTRIBUTES in case of // fail. return ((attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_DIRECTORY)); } bool is_directory(const std::string& path) { DWORD attr = ::GetFileAttributes(from_utf8(path).c_str()); return ((attr != INVALID_FILE_ATTRIBUTES) && ((attr & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)); } size_t file_size(const std::string& path) { struct _stat sts; return (_wstat(from_utf8(path).c_str(), &sts) == 0) ? sts.st_size: 0; } void move_file(const std::string& src, const std::string& dst) { BOOL result = ::MoveFile(from_utf8(src).c_str(), from_utf8(dst).c_str()); if (result == 0) throw Win32Exception("Error moving file"); } void delete_file(const std::string& path) { BOOL result = ::DeleteFile(from_utf8(path).c_str()); if (result == 0) throw Win32Exception("Error deleting file"); } bool has_readonly_attr(const std::string& path) { std::wstring fn = from_utf8(path); DWORD attr = ::GetFileAttributes(fn.c_str()); return ((attr & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY); } void remove_readonly_attr(const std::string& path) { std::wstring fn = from_utf8(path); DWORD attr = ::GetFileAttributes(fn.c_str()); if ((attr & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY) ::SetFileAttributes(fn.c_str(), attr & ~FILE_ATTRIBUTE_READONLY); } void make_directory(const std::string& path) { BOOL result = ::CreateDirectory(from_utf8(path).c_str(), NULL); if (result == 0) throw Win32Exception("Error creating directory"); } void remove_directory(const std::string& path) { BOOL result = ::RemoveDirectory(from_utf8(path).c_str()); if (result == 0) throw Win32Exception("Error removing directory"); } std::string get_app_path() { TCHAR buffer[MAX_PATH+1]; if (::GetModuleFileName(NULL, buffer, sizeof(buffer)/sizeof(TCHAR))) return to_utf8(buffer); else return ""; } std::string get_temp_path() { TCHAR buffer[MAX_PATH+1]; DWORD result = ::GetTempPath(sizeof(buffer)/sizeof(TCHAR), buffer); return to_utf8(buffer); } }
/* * This file is part of the coreboot project. * * Copyright (C) 2013 Google 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <string.h> #include <vendorcode/google/chromeos/chromeos.h> #include <arch/io.h> #include <device/device.h> #include <device/pci.h> #include <soc/gpio.h> #if CONFIG_EC_GOOGLE_CHROMEEC #include "ec.h" #include <ec/google/chromeec/ec.h> #endif /* The WP status pin lives on GPIO_SSUS_6 which is pad 36 in the SUS well. */ #define WP_STATUS_PAD 36 #ifndef __PRE_RAM__ #include <boot/coreboot_tables.h> #define ACTIVE_LOW 0 #define ACTIVE_HIGH 1 int get_lid_switch(void) { #if CONFIG_EC_GOOGLE_CHROMEEC u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES); return !!(ec_switches & EC_SWITCH_LID_OPEN); #else /* Default to force open. */ return 1; #endif } void fill_lb_gpios(struct lb_gpios *gpios) { struct lb_gpio chromeos_gpios[] = { {ssus_get_gpio(WP_STATUS_PAD), ACTIVE_HIGH, 0, "write protect"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, {-1, ACTIVE_HIGH, get_developer_mode_switch(), "developer"}, {-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, {-1, ACTIVE_HIGH, 0, "power"}, {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, }; lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); } #endif int get_developer_mode_switch(void) { return 0; } int get_recovery_mode_switch(void) { #if CONFIG_EC_GOOGLE_CHROMEEC u8 ec_switches = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SWITCHES); u32 ec_events; /* If a switch is set, we don't need to look at events. */ if (ec_switches & (EC_SWITCH_DEDICATED_RECOVERY)) return 1; /* Else check if the EC has posted the keyboard recovery event. */ ec_events = google_chromeec_get_events_b(); return !!(ec_events & EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY)); #else return 0; #endif } int get_write_protect_state(void) { /* * The vboot loader queries this function in romstage. The GPIOs have * not been set up yet as that configuration is done in ramstage. The * hardware defaults to an input but there is a 20K pulldown. Externally * there is a 10K pullup. Disable the internal pull in romstage so that * there isn't any ambiguity in the reading. */ #if defined(__PRE_RAM__) ssus_disable_internal_pull(WP_STATUS_PAD); #endif /* WP is enabled when the pin is reading high. */ return ssus_get_gpio(WP_STATUS_PAD); } static const struct cros_gpio cros_gpios[] = { CROS_GPIO_REC_AL(0x2008, CROS_GPIO_DEVICE_NAME), CROS_GPIO_WP_AH(0x2006, CROS_GPIO_DEVICE_NAME), }; void mainboard_chromeos_acpi_generate(void) { chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); }
/* * 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 */ /* * Diagnostics support */ #include <common.h> #include <command.h> #include <post.h> #include "slt.h" #if ((CFG_CMD_SLT & CFG_CMD_REGTEST) && defined(CONFIG_SLT)) #include "regtest.h" int do_regtest (void) { _SOCRegTestInfo *pjSOCRegInfo; _SOCRegTestTbl *pjRegTable; unsigned long ulRegBase; unsigned long ulIndex, ulBack, ulAND, ulMask, ulData, ulTemp; unsigned long Flags = 0; /* unlock reg */ *(unsigned long *) (0x1e600000) = 0xaeed1a03; /* AHBC */ *(unsigned long *) (0x1e6e0000) = 0xfc600309; /* MMC */ *(unsigned long *) (0x1e6e2000) = 0x1688a8a8; /* SCU */ /* SCU */ /* do test */ pjSOCRegInfo = SOCRegTestInfo; while (strcmp(pjSOCRegInfo->jName, "END")) { /* Reg. Test Start */ ulRegBase = pjSOCRegInfo->ulRegOffset; pjRegTable = pjSOCRegInfo->pjTblIndex; while (pjRegTable->ulIndex != 0xFFFFFFFF) { ulIndex = ulRegBase + pjRegTable->ulIndex; ulBack = *(unsigned long *) (ulIndex); ulMask = pjRegTable->ulMask; ulAND = ~pjRegTable->ulMask; ulData = 0xFFFFFFFF & pjRegTable->ulMask; *(unsigned long *) (ulIndex) = ulData; ulTemp = *(volatile unsigned long *) (ulIndex) & pjRegTable->ulMask; if (ulData != ulTemp) { Flags |= pjSOCRegInfo->ulFlags; printf("[DBG] RegTest: Failed Index:%x, Data:%x, Temp:%x \n", ulIndex, ulData, ulTemp); } ulData = 0x00000000 & pjRegTable->ulMask; *(unsigned long *) (ulIndex) = ulData; ulTemp = *(volatile unsigned long *) (ulIndex) & pjRegTable->ulMask; if (ulData != ulTemp) { Flags |= pjSOCRegInfo->ulFlags; printf("[DBG] RegTest: Failed Index:%x, Data:%x, Temp:%x \n", ulIndex, ulData, ulTemp); } *(unsigned long *) (ulIndex) = ulBack; pjRegTable++; } /* Individual Reg. Test */ if (Flags & pjSOCRegInfo->ulFlags) printf("[INFO] RegTest: %s Failed \n", pjSOCRegInfo->jName); pjSOCRegInfo++; } /* Reg. Test */ return Flags; } #endif /* CONFIG_SLT */
/* type_util.h * Types utility definitions * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * 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 __TYPE_UTIL_H__ #define __TYPE_UTIL_H__ /* * guint64 to gdouble conversions taken from gstutils.h of GStreamer project * * GStreamer * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> * 2000 Wim Taymans <wtay@chello.be> * 2002 Thomas Vander Stichele <thomas@apestaart.org> * * gstutils.h: Header for various utility functions * * GNU GPL v2 * */ guint64 type_util_gdouble_to_guint64(gdouble value); gdouble type_util_guint64_to_gdouble(guint64 value); #ifdef _WIN32 #define gdouble_to_guint64(value) type_util_gdouble_to_guint64(value) #define guint64_to_gdouble(value) type_util_guint64_to_gdouble(value) #else #define gdouble_to_guint64(value) ((guint64)(value)) #define guint64_to_gdouble(value) ((gdouble)(value)) #endif #endif /* __TYPE_UTIL_H__ */
/* * intelmid.h - Intel Sound card driver for MID * * Copyright (C) 2008-10 Intel Corp * Authors: Harsha Priya <priya.harsha@intel.com> * Vinod Koul <vinod.koul@intel.com> * Dharageswari R <dharageswari.r@intel.com> * KP Jeeja <jeeja.kp@intel.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 version 2 of the License. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ALSA driver header for Intel MAD chipset */ #ifndef __INTELMID_H #define __INTELMID_H #include <linux/time.h> #define DRIVER_NAME_MFLD "msic_audio" #define DRIVER_NAME_MRST "pmic_audio" #define DRIVER_NAME "intelmid_audio" #define PMIC_SOUND_IRQ_TYPE_MASK (1 << 15) #define AUDINT_BASE (0xFFFFEFF8 + (6 * sizeof(u8))) #define REG_IRQ /* values #defined */ /* will differ for different hw - to be taken from config */ #define MAX_DEVICES 1 #define MIN_RATE 8000 #define MAX_RATE 48000 #define MAX_BUFFER (800*1024) /* for PCM */ #define MIN_BUFFER (800*1024) #define MAX_PERIODS (1024*2) #define MIN_PERIODS 1 #define MAX_PERIOD_BYTES MAX_BUFFER #define MIN_PERIOD_BYTES 32 /*#define MIN_PERIOD_BYTES 160*/ #define MAX_MUTE 1 #define MIN_MUTE 0 #define MONO_CNTL 1 #define STEREO_CNTL 2 #define MIN_CHANNEL 1 #define MAX_CHANNEL_AMIC 2 #define MAX_CHANNEL_DMIC 4 #define FIFO_SIZE 0 /* fifo not being used */ #define INTEL_MAD "Intel MAD" #define MAX_CTRL_MRST 7 #define MAX_CTRL_MFLD 2 #define MAX_CTRL 7 #define MAX_VENDORS 4 /* TODO +6 db */ #define MAX_VOL 64 /* TODO -57 db */ #define MIN_VOL 0 #define PLAYBACK_COUNT 1 #define CAPTURE_COUNT 1 extern int sst_card_vendor_id; struct mad_jack { struct snd_jack jack; int jack_status; struct timeval buttonpressed; struct timeval buttonreleased; }; struct mad_jack_msg_wq { u8 intsts; struct snd_intelmad *intelmaddata; struct work_struct wq; }; /** * struct snd_intelmad - intelmad driver structure * * @card: ptr to the card details * @card_index: sound card index * @card_id: sound card id detected * @sstdrv_ops: ptr to sst driver ops * @pdev: ptr to platfrom device * @irq: interrupt number detected * @pmic_status: Device status of sound card * @int_base: ptr to MMIO interrupt region * @output_sel: device selected as o/p * @input_sel: device selected as i/p * @master_mute: master mute status * @jack: jack status * @playback_cnt: active pb streams * @capture_cnt: active cp streams * @mad_jack_msg: wq struct for jack interrupt processing * @mad_jack_wq: wq for jack interrupt processing * @jack_prev_state: Previos state of jack detected * @cpu_id: current cpu id loaded for */ struct snd_intelmad { struct snd_card *card; /* ptr to the card details */ int card_index;/* card index */ char *card_id; /* card id */ struct intel_sst_card_ops *sstdrv_ops;/* ptr to sst driver ops */ struct platform_device *pdev; int irq; int pmic_status; void __iomem *int_base; int output_sel; int input_sel; int master_mute; struct mad_jack jack[4]; int playback_cnt; int capture_cnt; struct mad_jack_msg_wq mad_jack_msg; struct workqueue_struct *mad_jack_wq; u8 jack_prev_state; unsigned int cpu_id; }; struct snd_control_val { int playback_vol_max; int playback_vol_min; int capture_vol_max; int capture_vol_min; }; struct mad_stream_pvt { int stream_status; int stream_ops; struct snd_pcm_substream *substream; struct pcm_stream_info stream_info; ssize_t dbg_cum_bytes; enum snd_sst_device_type device; }; enum mad_drv_status { INIT = 1, STARTED, RUNNING, PAUSED, DROPPED, }; enum mad_pmic_status { PMIC_UNINIT = 1, PMIC_INIT, }; enum _widget_ctrl { OUTPUT_SEL = 1, INPUT_SEL, PLAYBACK_VOL, PLAYBACK_MUTE, CAPTURE_VOL, CAPTURE_MUTE, MASTER_MUTE }; void period_elapsed(void *mad_substream); int snd_intelmad_alloc_stream(struct snd_pcm_substream *substream); int snd_intelmad_init_stream(struct snd_pcm_substream *substream); int sst_sc_reg_access(struct sc_reg_access *sc_access, int type, int num_val); #define CPU_CHIP_LINCROFT 1 /* System running lincroft */ #define CPU_CHIP_PENWELL 2 /* System running penwell */ extern struct snd_control_val intelmad_ctrl_val[]; extern struct snd_kcontrol_new snd_intelmad_controls_mrst[]; extern struct snd_kcontrol_new snd_intelmad_controls_mfld[]; extern struct snd_pmic_ops *intelmad_vendor_ops[]; #endif /* __INTELMID_H */
#ifndef __MAIN_MENU_GUI_LAYER_H__ #define __MAIN_MENU_GUI_LAYER_H__ #include "cocos2d.h" #include "MainMenuScene.h" class MainMenuGUILayer : public cocos2d::Layer { public: virtual bool init(); CREATE_FUNC(MainMenuGUILayer); // eventy void menuPlayCallback(Ref* pSender); void menuOptionsCallback(Ref* pSender); void menuCloseCallback(cocos2d::Ref* pSender); private: //MainMenuScene* _parent; }; #endif // __MAIN_MENU_GUI_LAYER_H__
/* packet-q931.h * Declarations of exported routines and tables for Q.931 and Q.2931 frame * disassembly * Guy Harris <guy@alum.mit.edu> * * $Id$ * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __PACKET_Q931_H__ #define __PACKET_Q931_H__ extern void dissect_q931_bearer_capability_ie(tvbuff_t *, int, int, proto_tree *); extern void dissect_q931_cause_ie(tvbuff_t *, int, int, proto_tree *, int, guint8 *,const value_string *); extern void dissect_q931_progress_indicator_ie(tvbuff_t *, int, int, proto_tree *); extern void dissect_q931_high_layer_compat_ie(tvbuff_t *, int, int, proto_tree *); extern void dissect_q931_user_user_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len, proto_tree *tree); extern value_string_ext q931_cause_location_vals_ext; typedef struct _q931_packet_info { gchar *calling_number; gchar *called_number; guint8 cause_value; gint32 crv; guint8 message_type; } q931_packet_info; /* * the following allows TAP code access to the messages * without having to duplicate it. With MSVC and a * libwireshark.dll, we need a special declaration. */ WS_VAR_IMPORT value_string_ext q931_cause_code_vals_ext; WS_VAR_IMPORT const value_string q931_message_type_vals[]; extern value_string_ext q931_protocol_discriminator_vals_ext; extern value_string_ext q931_progress_description_vals_ext; extern value_string_ext q931_call_state_vals_ext; /* * Q.931 message types. */ #define Q931_ESCAPE 0x00 #define Q931_ALERTING 0x01 #define Q931_CALL_PROCEEDING 0x02 #define Q931_PROGRESS 0x03 #define Q931_SETUP 0x05 #define Q931_GROUIP_SERVICE 0x06 #define Q931_CONNECT 0x07 #define Q931_RESYNC_REQ 0x08 #define Q931_RESYNC_RESP 0x09 #define Q931_VERSION 0x0A #define Q931_GROUIP_SERVICE_ACK 0x0B #define Q931_SETUP_ACK 0x0D #define Q931_CONNECT_ACK 0x0F #define Q931_USER_INFORMATION 0x20 #define Q931_SUSPEND_REJECT 0x21 #define Q931_RESUME_REJECT 0x22 #define Q931_HOLD 0x24 #define Q931_SUSPEND 0x25 #define Q931_RESUME 0x26 #define Q931_HOLD_ACK 0x28 #define Q931_SUSPEND_ACK 0x2D #define Q931_RESUME_ACK 0x2E #define Q931_HOLD_REJECT 0x30 #define Q931_RETRIEVE 0x31 #define Q931_RETRIEVE_ACK 0x33 #define Q931_RETRIEVE_REJECT 0x37 #define Q931_DETACH 0x40 #define Q931_DISCONNECT 0x45 #define Q931_RESTART 0x46 #define Q931_DETACH_ACKNOWLEDGE 0x48 #define Q931_RELEASE 0x4D #define Q931_RESTART_ACK 0x4E #define Q931_RELEASE_COMPLETE 0x5A #define Q931_SEGMENT 0x60 #define Q931_FACILITY 0x62 #define Q931_REGISTER 0x64 #define Q931_FACILITY_ACKNOWLEDGE 0x6A #define Q931_NOTIFY 0x6E #define Q931_FACILITY_REJECT 0x72 #define Q931_STATUS_ENQUIRY 0x75 #define Q931_CONGESTION_CONTROL 0x79 #define Q931_INFORMATION 0x7B #define Q931_STATUS 0x7D /* * Maintenance message types. * AT&T TR41459, Nortel NIS A211-1, Telcordia SR-4994, ... */ #define DMS_SERVICE_ACKNOWLEDGE 0x07 #define DMS_SERVICE 0x0F #endif
/* * Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved. * * Author: Tuomo Penttinen <tp@herqq.org> * * This file is part of Herqq UPnP (HUPnP) library. * * Herqq UPnP is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Herqq UPnP 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 Herqq UPnP. If not, see <http://www.gnu.org/licenses/>. */ #ifndef HHTTP_MESSAGINGINFO_P_H_ #define HHTTP_MESSAGINGINFO_P_H_ #include <HUpnpCore/HUpnp> #include <QtCore/QPair> #include <QtCore/QString> #include <QtCore/QPointer> #include <QtNetwork/QTcpSocket> class QUrl; // // !! Warning !! // // This file is not part of public API and it should // never be included in client code. The contents of this file may // change or the file may be removed without of notice. // namespace Herqq { namespace Upnp { // // // class H_UPNP_CORE_EXPORT HChunkedInfo { private: volatile int m_maxChunkSize; // if this is non-zero, it means that chunked-encoding should be used // if the data to be sent is larger than that of the specified max chunk size // and that the max chunk size is this volatile int m_minChunkSize; // if this is non-zero, it means that when the size of the data to be sent // is not known in advance, how big _at least_ each chunk must be in size. public: inline HChunkedInfo(int max = 0) : m_maxChunkSize(max), m_minChunkSize(0) { } inline HChunkedInfo(int min, int max) : m_maxChunkSize(max), m_minChunkSize(min) { } inline int max() const { return m_maxChunkSize; } inline int min() const { return m_minChunkSize; } inline void setMax(int arg) { m_maxChunkSize = arg; } inline void setMin(int arg) { m_minChunkSize = arg; } }; // // // class H_UPNP_CORE_EXPORT HMessagingInfo { H_DISABLE_COPY(HMessagingInfo) private: QPair<QPointer<QTcpSocket>, bool> m_sock; bool m_keepAlive; qint32 m_receiveTimeoutForNoData; HChunkedInfo m_chunkedInfo; QString m_hostInfo; QString m_lastErrorDescription; qint32 m_msecsToWaitOnSend; public: // // The default timeout in milliseconds that is waited before a read operation // is terminated unless _some_ data is received (not necessarily the desired amount). // static inline qint32 defaultReceiveTimeoutForNoData() { const qint32 retVal = 5000; return retVal; } explicit HMessagingInfo( QPair<QTcpSocket*, bool> sock, qint32 receiveTimeoutForNoData = defaultReceiveTimeoutForNoData()); explicit HMessagingInfo( QTcpSocket& sock, qint32 receiveTimeoutForNoData = defaultReceiveTimeoutForNoData()); HMessagingInfo( QPair<QTcpSocket*, bool>, bool keepAlive, qint32 receiveTimeoutForNoData = defaultReceiveTimeoutForNoData()); HMessagingInfo( QTcpSocket&, bool keepAlive, qint32 receiveTimeoutForNoData = defaultReceiveTimeoutForNoData()); ~HMessagingInfo(); inline QTcpSocket& socket() const { Q_ASSERT(!m_sock.first.isNull()); return *m_sock.first; } inline void setKeepAlive(bool arg) { m_keepAlive = arg; } inline bool keepAlive() const { return m_keepAlive; } void setHostInfo(const QUrl& hostInfo); inline void setHostInfo(const QString& hostInfo) { m_hostInfo = hostInfo.trimmed(); } QString hostInfo() const; inline void setReceiveTimeoutForNoData(qint32 arg) { m_receiveTimeoutForNoData = arg; } inline qint32 receiveTimeoutForNoData() const { return m_receiveTimeoutForNoData; } inline const HChunkedInfo& chunkedInfo() const { return m_chunkedInfo; } inline void setChunkedInfo(const HChunkedInfo& arg) { m_chunkedInfo = arg; } inline void setLastErrorDescription(const QString& errDescr) { m_lastErrorDescription = errDescr; } inline void setSendWait(qint32 msecsToWait) { m_msecsToWaitOnSend = msecsToWait; } inline qint32 sendWait() const { return m_msecsToWaitOnSend; } QString lastErrorDescription() const; }; } } #endif /* HHTTP_MESSAGINGINFO_P_H_ */
/* * Asus MyPal A716 GPO Register driver * * 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. * * Copyright (C) 2005-2007 Pawel Kolodziejski */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/major.h> #include <linux/fs.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/lcd.h> #include <linux/backlight.h> #include <linux/fb.h> #include <linux/platform_device.h> #include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> #include <asm/hardware.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irda.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/udc.h> #include <../drivers/pcmcia/soc_common.h> #include <asm/arch/pxafb.h> #include <asm/arch/mmc.h> #include <asm/arch/asus716-gpio.h> #include "../generic.h" static volatile u_int32_t *gpo; static u_int32_t gpo_local; static spinlock_t gpo_lock; #define GPO_DEFAULT 0x62808000 | GPO_A716_SD_POWER_N | GPO_A716_IRDA_POWER_N | \ GPO_A716_CPU_MODE_SEL0 | GPO_A716_CPU_MODE_SEL1; void a716_gpo_set(unsigned long bits) { unsigned long flags; if (machine_is_a716()) { spin_lock_irqsave(&gpo_lock, flags); gpo_local |= bits; *gpo = gpo_local; spin_unlock_irqrestore(&gpo_lock, flags); } } EXPORT_SYMBOL(a716_gpo_set); void a716_gpo_clear(unsigned long bits) { unsigned long flags; if (machine_is_a716()) { spin_lock_irqsave(&gpo_lock, flags); gpo_local &= ~bits; *gpo = gpo_local; spin_unlock_irqrestore(&gpo_lock, flags); } } EXPORT_SYMBOL(a716_gpo_clear); unsigned long a716_gpo_get(void) { unsigned long flags, ret = 0; if (machine_is_a716()) { spin_lock_irqsave(&gpo_lock, flags); ret = gpo_local; spin_unlock_irqrestore(&gpo_lock, flags); } return ret; } EXPORT_SYMBOL(a716_gpo_get); static int a716_gpo_resume(struct platform_device *pdev) { unsigned long flags; spin_lock_irqsave(&gpo_lock, flags); gpo_local = GPO_DEFAULT; *gpo = gpo_local; spin_unlock_irqrestore(&gpo_lock, flags); return 0; } static int a716_gpo_probe(struct platform_device *pdev) { if (!machine_is_a716()) return -ENODEV; spin_lock_init(&gpo_lock); gpo = (volatile u_int32_t *)ioremap(0x10000000, sizeof *gpo); if (!gpo) return -ENOMEM; *gpo = gpo_local; return 0; } static int a716_gpo_remove(struct platform_device *pdev) { iounmap((void __iomem *)gpo); return 0; } static struct platform_driver a716_gpo_driver = { .driver = { .name = "a716-gpo", }, .probe = a716_gpo_probe, .remove = a716_gpo_remove, .resume = a716_gpo_resume, }; static int a716_gpo_init(void) { if (!machine_is_a716()) return -ENODEV; return platform_driver_register(&a716_gpo_driver); } static void a716_gpo_exit(void) { platform_driver_unregister(&a716_gpo_driver); } module_init(a716_gpo_init); module_exit(a716_gpo_exit); MODULE_AUTHOR("Pawel Kolodziejski"); MODULE_DESCRIPTION("Asus MyPal A716 GPO Register driver"); MODULE_LICENSE("GPL");
/* -*- C++ -*- */ //============================================================================= /** * @file FILE.h * * FILE.h,v 4.24 2004/06/20 14:37:36 jwillemsen Exp * * @author Gerhard Lenzer */ //============================================================================= #ifndef ACE_FILE_H #define ACE_FILE_H #include /**/ "ace/pre.h" #include "ace/IO_SAP.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/FILE_Addr.h" // The following is necessary since many C++ compilers don't support // typedef'd types inside of classes used as formal template // arguments... ;-(. Luckily, using the C++ preprocessor I can hide // most of this nastiness! #if defined (ACE_HAS_TEMPLATE_TYPEDEFS) #define ACE_FILE_CONNECTOR ACE_FILE_Connector #define ACE_FILE_STREAM ACE_FILE_IO #else /* TEMPLATES are broken (must be a cfront-based compiler...) */ #define ACE_FILE_CONNECTOR ACE_FILE_Connector, ACE_FILE_Addr #define ACE_FILE_STREAM ACE_FILE_IO, ACE_FILE_Addr #endif /* ACE_TEMPLATE_TYPEDEFS */ /** * @class ACE_FILE_Info * * @brief Abstracts basic OS FILE information. */ class ACE_Export ACE_FILE_Info { public: /// Mode of file mode_t mode_; /// No of links nlink_t nlink_; /// Size of file off_t size_; }; /** * @class ACE_FILE * * @brief Defines the core methods of the ACE_FILE abstraction. */ class ACE_Export ACE_FILE : public ACE_IO_SAP { public: /// Close the ACE_FILE handle without removing the ACE_FILE from /// the file system. int close (void); /// Close and remove the ACE_FILE from the file system. int remove (void); /// Remove the ACE_FILE from the file system without closing the /// ACE_FILE handle. int unlink (void); /// Get information on this ACE_FILE. int get_info (ACE_FILE_Info *finfo); /// Get information on this <ACE_FILE>. int get_info (ACE_FILE_Info &finfo); /// Set filesize to length byte. int truncate (off_t length); /** * Sets the file pointer as follows: * o If <whence> is <SEEK_SET>, the pointer is set to <offset> * bytes. * * o If <whence> is <SEEK_CUR>, the pointer is set to its * current location plus <offset>. * * o If <whence> is <SEEK_END>, the pointer is set to the size * of the file plus offset. */ off_t seek (off_t offset, int whence = SEEK_CUR); /// Return an offset for the file handle. off_t tell (void); /** * Disable signal @a signum * This is here to prevent Win32 from * disabling SPIPE using socket calls */ int disable (int signum) const ; /// Return the local endpoint address in the referenced ACE_Addr. /// Returns 0 if successful, else -1. int get_local_addr (ACE_Addr &) const; /// Return the same thing as get_local_addr(). int get_remote_addr (ACE_Addr &) const; /// Dump the state of an object. void dump (void) const; /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; protected: /// Ensure that this class is only created by the /// ACE_FILE_Connector. ACE_FILE (void); /// File we are "connected" with... ACE_FILE_Addr addr_; }; #if defined (__ACE_INLINE__) #include "ace/FILE.inl" #endif /* __ACE_INLINE__ */ #include /**/ "ace/post.h" #endif /* ACE_FILE_H */
/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. * */ #ifndef MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ #define MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ // Everything declared in this header is only required when WebRTC is // build with H264 support, please do not move anything out of the // #ifdef unless needed and tested. #ifdef WEBRTC_USE_H264 #include <memory> #include "modules/video_coding/codecs/h264/include/h264.h" // CAVEAT: According to ffmpeg docs for avcodec_send_packet, ffmpeg requires a // few extra padding bytes after the end of input. And in addition, docs for // AV_INPUT_BUFFER_PADDING_SIZE says "If the first 23 bits of the additional // bytes are not 0, then damaged MPEG bitstreams could cause overread and // segfault." // // WebRTC doesn't ensure any such padding, and REQUIRES ffmpeg to be compiled // with CONFIG_SAFE_BITSTREAM_READER, which is intended to eliminate // out-of-bounds reads. ffmpeg docs doesn't say explicitly what effects this // flag has on the h.264 decoder or avcodec_send_packet, though, so this is in // some way depending on undocumented behavior. If any problems turn up, we may // have to add an extra copy operation, to enforce padding before buffers are // passed to ffmpeg. extern "C" { #include "third_party/ffmpeg/libavcodec/avcodec.h" } // extern "C" #include "common_video/h264/h264_bitstream_parser.h" #include "common_video/include/video_frame_buffer_pool.h" namespace webrtc { struct AVCodecContextDeleter { void operator()(AVCodecContext* ptr) const { avcodec_free_context(&ptr); } }; struct AVFrameDeleter { void operator()(AVFrame* ptr) const { av_frame_free(&ptr); } }; class H264DecoderImpl : public H264Decoder { public: H264DecoderImpl(); ~H264DecoderImpl() override; // If |codec_settings| is NULL it is ignored. If it is not NULL, // |codec_settings->codecType| must be |kVideoCodecH264|. int32_t InitDecode(const VideoCodec* codec_settings, int32_t number_of_cores) override; int32_t Release() override; int32_t RegisterDecodeCompleteCallback( DecodedImageCallback* callback) override; // |missing_frames|, |fragmentation| and |render_time_ms| are ignored. int32_t Decode(const EncodedImage& input_image, bool /*missing_frames*/, int64_t render_time_ms = -1) override; const char* ImplementationName() const override; private: // Called by FFmpeg when it needs a frame buffer to store decoded frames in. // The |VideoFrame| returned by FFmpeg at |Decode| originate from here. Their // buffers are reference counted and freed by FFmpeg using |AVFreeBuffer2|. static int AVGetBuffer2(AVCodecContext* context, AVFrame* av_frame, int flags); // Called by FFmpeg when it is done with a video frame, see |AVGetBuffer2|. static void AVFreeBuffer2(void* opaque, uint8_t* data); bool IsInitialized() const; // Reports statistics with histograms. void ReportInit(); void ReportError(); // Used by ffmpeg via |AVGetBuffer2()| to allocate I420 images. VideoFrameBufferPool ffmpeg_buffer_pool_; // Used to allocate NV12 images if NV12 output is preferred. VideoFrameBufferPool output_buffer_pool_; std::unique_ptr<AVCodecContext, AVCodecContextDeleter> av_context_; std::unique_ptr<AVFrame, AVFrameDeleter> av_frame_; DecodedImageCallback* decoded_image_callback_; bool has_reported_init_; bool has_reported_error_; webrtc::H264BitstreamParser h264_bitstream_parser_; // Decoder should produce this format if possible. const VideoFrameBuffer::Type preferred_output_format_; }; } // namespace webrtc #endif // WEBRTC_USE_H264 #endif // MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_
/* SPDX-License-Identifier: GPL-2.0-only */ #include <soc/cnl_memcfg_init.h> #include <soc/romstage.h> #include <variant/romstage.h> static const struct cnl_mb_cfg memcfg = { .spd[0] = { .read_type = READ_SMBUS, .spd_spec = {.spd_smbus_address = 0xa0}, }, .spd[2] = { .read_type = READ_SMBUS, .spd_spec = {.spd_smbus_address = 0xa4}, }, .rcomp_resistor = { 121, 75, 100 }, .rcomp_targets = { 50, 25, 20, 20, 26 }, .dq_pins_interleaved = 1, .vref_ca_config = 2, }; void mainboard_memory_init_params(FSPM_UPD *memupd) { variant_configure_fspm(memupd); cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg); }
/*产生随机字符串*/ unsigned int hrand(unsigned char *enc,unsigned char m){ unsigned char estr[]="gpwn5BtuiPGAT]=68ZFScKbNvQyO9I0XDE1hzkYRm2UJj[rqlL3Wos7aexfHV4CdM"; unsigned int i=0,k=0,c=0,t=0,j=0,n=m; srand((unsigned int)time(0)); /*随机因子*/ while(i<n){k=rand()%64; for(c=0;c<i;c++){if(enc[c+t]==estr[k]){break;}} if(c==i){enc[i]=estr[k];i++;j++;if(j>=32){t+=32;j=0;}}} return n; } /*Base64 编码: hstr=>要编码的数据,n=>数据长度,bstr=>编码后的数据存储区,Bs64=>base64编码串*/ unsigned int BaseEncode(unsigned char *hstr,unsigned int n,unsigned char *bstr,unsigned char *Bs64){ unsigned int i,m,c=0,w=0; unsigned char bas; m=(n/3); for(i=0;i<m;i++){bas=(hstr[c]>>2);bstr[w]=Bs64[bas];w++; bas=(hstr[c]<<6)|(hstr[c+1]>>2);bas>>=2;c++;bstr[w]=Bs64[bas];w++; bas=(hstr[c]<<4)|(hstr[c+1]>>4);bas>>=2;c++;bstr[w]=Bs64[bas];w++; bas=(hstr[c]<<2);bas>>=2; c++; bstr[w]=Bs64[bas]; w++;} switch(n-(m*3)){ case 1:bas=(hstr[n-1]>>2);bstr[w]=Bs64[bas];w++; bas=(hstr[n-1]<<6);bas>>=2;bstr[w]=Bs64[bas];w++;break; case 2:bas=(hstr[n-2]>>2);bstr[w]=Bs64[bas];w++; bas=(hstr[n-2]<<6)|(hstr[n-1]>>2);bas>>=2;bstr[w]=Bs64[bas];w++; bas=(hstr[n-1]<<4);bas>>=2;bstr[w]=Bs64[bas];w++; break; } return w; } /*base64 解码: hstr=>要解码的数据,bstr=>解码后的数据存储区,Bs64=>base64编码串*/ unsigned int BaseDecode(unsigned char *hstr,unsigned char *bstr,unsigned char *Bs64){ unsigned int i,n,c=0; unsigned char m; n=strlen(hstr);for(i=0;i<n;i++){for(m=0;m<65;m++){if(Bs64[m]==hstr[i]){bstr[i]=(m<<2);break;}}}n=(strlen(hstr)/4); for(i=0;i<n;i++){bstr[c]=bstr[i*4]|(bstr[(i*4)+1]>>6);c++;bstr[c]=(bstr[(i*4)+1]<<2)|(bstr[(i*4)+2]>>4);c++;bstr[c]=(bstr[(i*4)+2]<<4)|(bstr[(i*4)+3]>>2);c++;} switch(strlen(hstr)-(n*4)){ case 2:bstr[c]=bstr[i*4]|(bstr[(i*4)+1]>>6);c++;break; case 3:bstr[c]=bstr[i*4]|(bstr[(i*4)+1]>>6);c++;bstr[c]=(bstr[(i*4)+1]<<2)|(bstr[(i*4)+2]>>4);c++;break; } return c; } /*Tea 解码过程*/ void encrypt (uint32_t v[], uint32_t k[]) { uint32_t v0=v[0], v1=v[1], sum=0, i; /* set up */ uint32_t delta=0x9e3779b9; /* a key schedule constant */ uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i < 32; i++) { /* basic cycle start */ sum += delta; v0 += ((v1<<4) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1); v1 += ((v0<<4) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); } /* end cycle */ v[0]=v0; v[1]=v1; } /*Tea 编码过程*/ void decrypt (uint32_t v[], uint32_t k[]) { uint32_t v0=v[0], v1=v[1], sum=0xC6EF3720, i; /* set up */ uint32_t delta=0x9e3779b9; /* a key schedule constant */ uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */ for (i=0; i<32; i++) { /* basic cycle start */ v1 -= ((v0<<4) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); v0 -= ((v1<<4) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1); sum -= delta; } /* end cycle */ v[0]=v0; v[1]=v1; } /*Tea 编码+解码*/ int Hcrypt(unsigned char act,unsigned char *key,unsigned char *dat,unsigned int c){ int i=0,n=0,m=0,t=0; uint32_t v[2]={0x00,0x00}, k[4]={0x00,0x00,0x00,0x00}; if(16!=strlen(key)){return -1;} for(n=0;n<4;n++){i=0;for(i=0;i<4;i++){k[n]=k[n]<<8|key[m]; m++;}} /*Key*/ // printf("[%08x%08x%08x%08x]\n",k[0],k[1],k[2],k[3]); if(0!=(c%8)){return -2;} //c=strlen(dat)-(strlen(dat)%8); i=0;n=0;m=0; while(m<c){ for(n=0;n<2;n++){i=0;for(i=0;i<4;i++){v[n]=v[n]<<8|dat[m]; m++;}} // printf("%08x%08x\n",v[0],v[1]); if(act>0){decrypt(v,k);/*解码*/}else{encrypt(v,k);/*编码*/} dat[t]=v[0]>>24; dat[t+1]=(v[0]>>16)&0x000000ff; dat[t+2]=(v[0]>>8)&0x000000ff; dat[t+3]=v[0]&0x000000ff; dat[t+4]=v[1]>>24; dat[t+5]=(v[1]>>16)&0x000000ff; dat[t+6]=(v[1]>>8)&0x000000ff; dat[t+7]=v[1]&0x000000ff; t+=8; n=0; //printf("%08x%08x\n",v[0],v[1]); } dat[t]=0; return t; } //编码解码 int HwCrypt(unsigned char act,unsigned char *dats){ unsigned char *HwDat,HwTmp[64]={0}; int i=0,b=0,n=0; b=strlen(dats); n=b*2; HwDat=(unsigned char *)malloc(n); memset(HwDat,0,n); if(0==act){ memcpy(HwDat,dats,b); i=b%8; if(0!=i){i=8-i; hrand(HwTmp,i); memcpy(HwDat+b,HwTmp,i); HwDat[b]=0x00; b+=i;} b=Hcrypt(0,HwKey,HwDat,b); //编码 i=BaseEncode(HwDat,b,dats,BaseStr); dats[i]=0x00; return i; }else{ //解码 b=BaseDecode(dats,HwDat,BaseStr); i=b%8; if(0!=i){b=b-i;} b=Hcrypt(1,HwKey,HwDat,b); //解码 memset(dats,0,strlen(dats)); memcpy(dats,HwDat,b); dats[b]=0x00; return b; } /* unsigned char HwDat[1025]={0}; unsigned char HwTmp[2048]={0}; int i=0,b=0; if(0==act){ b=strlen(dats); if(b>1024){b=1024;} memcpy(HwDat,dats,b); i=b%8; if(0!=i){i=8-i; hrand(HwTmp,i); memcpy(HwDat+b,HwTmp,i); HwDat[b]=0x00; b+=i;} b=Hcrypt(0,HwKey,HwDat,b); //编码 memset(HwTmp,0,2048); i=BaseEncode(HwDat,b,HwTmp,BaseStr); memset(dats,0,strlen(dats)); memcpy(dats,HwTmp,i); // printf("\n编码后: %s\n\n",HwTmp); return i; }else{ //解码 b=BaseDecode(dats,HwDat,BaseStr); i=b%8; if(0!=i){b=b-i;} b=Hcrypt(1,HwKey,HwDat,b); //解码 // printf("\n%s\n\n",HwDat); memset(dats,0,strlen(dats)); memcpy(dats,HwDat,b); return b; } printf("\nend\n"); */ // return 0; }
#ifndef __cact_cclosure_marshal_MARSHAL_H__ #define __cact_cclosure_marshal_MARSHAL_H__ #include <glib-object.h> G_BEGIN_DECLS /* VOID:BOOLEAN,INT,INT,INT (/home/pierre/data/eclipse/caja-actions/src/cact/cact-marshal.def:2) */ extern void cact_cclosure_marshal_VOID__BOOLEAN_INT_INT_INT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:POINTER,UINT (/home/pierre/data/eclipse/caja-actions/src/cact/cact-marshal.def:6) */ extern void cact_cclosure_marshal_VOID__POINTER_UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:POINTER,STRING (/home/pierre/data/eclipse/caja-actions/src/cact/cact-marshal.def:9) */ extern void cact_cclosure_marshal_VOID__POINTER_STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __cact_cclosure_marshal_MARSHAL_H__ */
// // iTermStatusBarTextComponent.h // iTerm2SharedARC // // Created by George Nachman on 6/29/18. // #import <Foundation/Foundation.h> #import "iTermStatusBarBaseComponent.h" NS_ASSUME_NONNULL_BEGIN // A base class for components that show text. // This class only knows how to show static text. Subclasses may choose to configure it by overriding // stringValue, attributedStringValue, statusBarComponentUpdateCadence, and statusBarComponentUpdate. @interface iTermStatusBarTextComponent : iTermStatusBarBaseComponent @property (nonatomic, readonly, nullable) NSArray<NSString *> *stringVariants; @property (nonatomic, readonly) NSTextField *textField; - (CGFloat)widthForString:(NSString *)string; - (void)updateTextFieldIfNeeded; - (NSTextField *)newTextField; - (nullable NSString *)stringValueForCurrentWidth; @end NS_ASSUME_NONNULL_END
/* * Arizona-i2c.c -- Arizona I2C bus interface * * Copyright 2012 Wolfson Microelectronics plc * * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> * * 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. */ #include <linux/err.h> #include <linux/i2c.h> #include <linux/module.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/mfd/arizona/core.h> #include "arizona.h" static __devinit int arizona_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct arizona *arizona; const struct regmap_config *regmap_config; int ret; switch (id->driver_data) { #ifdef CONFIG_MFD_WM5102 case WM5102: regmap_config = &wm5102_i2c_regmap; break; #endif #ifdef CONFIG_MFD_WM5110 case WM5110: regmap_config = &wm5110_i2c_regmap; break; #endif default: dev_err(&i2c->dev, "Unknown device type %ld\n", id->driver_data); return -EINVAL; } arizona = devm_kzalloc(&i2c->dev, sizeof(*arizona), GFP_KERNEL); if (arizona == NULL) return -ENOMEM; arizona->regmap = devm_regmap_init_i2c(i2c, regmap_config); if (IS_ERR(arizona->regmap)) { ret = PTR_ERR(arizona->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", ret); return ret; } arizona->type = id->driver_data; arizona->dev = &i2c->dev; arizona->irq = i2c->irq; return arizona_dev_init(arizona); } static int __devexit arizona_i2c_remove(struct i2c_client *i2c) { struct arizona *arizona = dev_get_drvdata(&i2c->dev); arizona_dev_exit(arizona); return 0; } static const struct i2c_device_id arizona_i2c_id[] = { { "wm5102", WM5102 }, { "wm5110", WM5110 }, { } }; MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); static struct i2c_driver arizona_i2c_driver = { .driver = { .name = "arizona", .owner = THIS_MODULE, .pm = &arizona_pm_ops, }, .probe = arizona_i2c_probe, .remove = __devexit_p(arizona_i2c_remove), .id_table = arizona_i2c_id, }; static __init int arizona_i2c_init(void) { return i2c_register_driver(THIS_MODULE, &arizona_i2c_driver); } module_init(arizona_i2c_init); static __exit void arizona_i2c_exit(void) { return i2c_del_driver(&arizona_i2c_driver); } module_exit(arizona_i2c_exit); MODULE_DESCRIPTION("Arizona I2C bus interface"); MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); MODULE_LICENSE("GPL");
/**************************************************************************** * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * 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, distribute with modifications, 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 ABOVE 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. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ /* * lib_slktouch.c * Soft key routines. * Force the code to believe that the soft keys have been changed. */ #include <curses.priv.h> MODULE_ID("$Id$") NCURSES_EXPORT(int) slk_touch(void) { T((T_CALLED("slk_touch()"))); if (SP == NULL || SP->_slk == NULL) returnCode(ERR); SP->_slk->dirty = TRUE; returnCode(OK); }
/* * This file 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. * * In addition to the permissions in the GNU General Public License, * the authors give you unlimited permission to link the compiled * version of this file into combinations with other programs, * and to distribute those combinations without any restriction * coming from the use of this file. (The General Public License * restrictions do apply in other respects; for example, they cover * modification of the file, and distribution when not linked into * a combined executable.) * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "git/odb.h" struct git_odb { /** Path to the "objects" directory. */ char *path; /** Alternate databases to search. */ git_odb **alternates; }; static int open_alternates(git_odb *db) { unsigned n = 0; db->alternates = malloc(sizeof(*db->alternates) * (n + 1)); if (!db->alternates) return GIT_ERROR; db->alternates[n] = NULL; return GIT_SUCCESS; } int git_odb_open(git_odb **out, const char *objects_dir) { git_odb *db = malloc(sizeof(*db)); if (!db) return GIT_ERROR; db->path = strdup(objects_dir); if (!db->path) { free(db); return GIT_ERROR; } db->alternates = NULL; *out = db; return GIT_SUCCESS; } void git_odb_close(git_odb *db) { if (!db) return; if (db->alternates) { git_odb **alt; for (alt = db->alternates; *alt; alt++) git_odb_close(*alt); free(db->alternates); } free(db->path); free(db); } int git_odb_read( git_obj *out, git_odb *db, const git_oid *id) { attempt: if (!git_odb__read_packed(out, db, id)) return GIT_SUCCESS; if (!git_odb__read_loose(out, db, id)) return GIT_SUCCESS; if (!db->alternates && !open_alternates(db)) goto attempt; out->data = NULL; return GIT_ENOTFOUND; }
/* Copyright 2004,2007,2010 ENSEIRB, INRIA & CNRS ** ** This file is part of the Scotch software package for static mapping, ** graph partitioning and sparse matrix ordering. ** ** This software is governed by the CeCILL-C license under French law ** and abiding by the rules of distribution of free software. You can ** use, modify and/or redistribute the software under the terms of the ** CeCILL-C license as circulated by CEA, CNRS and INRIA at the following ** URL: "http://www.cecill.info". ** ** As a counterpart to the access to the source code and rights to copy, ** modify and redistribute granted by the license, users are provided ** only with a limited warranty and the software's author, the holder of ** the economic rights, and the successive licensors have only limited ** liability. ** ** In this respect, the user's attention is drawn to the risks associated ** with loading, using, modifying and/or developing or reproducing the ** software by the user in light of its specific status of free software, ** that may mean that it is complicated to manipulate, and that also ** therefore means that it is reserved for developers and experienced ** professionals having in-depth computer knowledge. Users are therefore ** encouraged to load and test the software's suitability as regards ** their requirements in conditions enabling the security of their ** systems and/or data to be ensured and, more generally, to use and ** operate it in the same conditions as regards security. ** ** The fact that you are presently reading this means that you have had ** knowledge of the CeCILL-C license and that you accept its terms. */ /************************************************************/ /** **/ /** NAME : bgraph_bipart_ml.h **/ /** **/ /** AUTHOR : Francois PELLEGRINI **/ /** Luca SCARANO (v3.1) **/ /** **/ /** FUNCTION : These lines are the data declarations **/ /** for the multi-level graph bipartitio- **/ /** ning routines. **/ /** **/ /** DATES : # Version 3.1 : from : 24 oct 1995 **/ /** to 03 jul 1996 **/ /** # Version 3.2 : from : 20 sep 1996 **/ /** to 13 sep 1998 **/ /** # Version 3.3 : from : 01 oct 1998 **/ /** to 01 oct 1998 **/ /** # Version 4.0 : from : 12 dec 2003 **/ /** to 20 mar 2005 **/ /** # Version 5.1 : from : 13 jul 2010 **/ /** to 13 jul 2010 **/ /** **/ /************************************************************/ /* ** The type and structure definitions. */ /*+ This structure holds the method parameters. +*/ typedef struct BgraphBipartMlParam_ { INT coarnbr; /*+ Minimum number of vertices +*/ double coarrat; /*+ Coarsening ratio +*/ GraphCoarsenType coartype; /*+ Edge matching function type +*/ Strat * stratlow; /*+ Strategy at lowest level +*/ Strat * stratasc; /*+ Strategy at ascending levels +*/ } BgraphBipartMlParam; /* ** The function prototypes. */ #ifndef BGRAPH_BIPART_ML #define static #endif static int bgraphBipartMlCoarsen (const Bgraph * const, Bgraph * restrict const, GraphCoarsenMulti * restrict * const, const BgraphBipartMlParam * const); static int bgraphBipartMlUncoarsen (Bgraph * restrict const, const Bgraph * restrict const, const GraphCoarsenMulti * const); int bgraphBipartMl (Bgraph * restrict const, const BgraphBipartMlParam * const); static int bgraphBipartMl2 (Bgraph * restrict const, const BgraphBipartMlParam * const); #undef static
/* Copyright 2005-2007 Virtutech AB This file is part of the Virtutech Simics, which is distributed under the Virtutech Simics Software License Agreement. */ #include <simics/arch/mips.h>
/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ #include <u.h> #include <libc.h> char output[4096]; void add(char*, ...); void error(char*); void notifyf(void*, char*); void main(int argc, char *argv[]) { int i; Waitmsg *w; long l; char *p; char err[ERRMAX]; if(argc <= 1){ fprint(2, "usage: time command\n"); exits("usage"); } switch(fork()){ case -1: error("fork"); case 0: exec(argv[1], &argv[1]); if(argv[1][0] != '/' && strncmp(argv[1], "./", 2) && strncmp(argv[1], "../", 3)){ sprint(output, "/bin/%s", argv[1]); exec(output, &argv[1]); } error(argv[1]); } notify(notifyf); loop: w = wait(); if(w == nil){ errstr(err, sizeof err); if(strcmp(err, "interrupted") == 0) goto loop; error("wait"); } l = w->time[0]; add("%ld.%.2ldu", l/1000, (l%1000)/10); l = w->time[1]; add("%ld.%.2lds", l/1000, (l%1000)/10); l = w->time[2]; add("%ld.%.2ldr", l/1000, (l%1000)/10); add("\t"); for(i=1; i<argc; i++){ add("%s", argv[i], 0); if(i>4){ add("..."); break; } } if(w->msg[0]){ p = utfrune(w->msg, ':'); if(p && p[1]) p++; else p = w->msg; add(" # status=%s", p); } fprint(2, "%s\n", output); exits(w->msg); } void add(char *a, ...) { static beenhere=0; va_list arg; if(beenhere) strcat(output, " "); va_start(arg, a); vseprint(output+strlen(output), output+sizeof(output), a, arg); va_end(arg); beenhere++; } void error(char *s) { fprint(2, "time: %s: %r\n", s); exits(s); } void notifyf(void *a, char *s) { USED(a); if(strcmp(s, "interrupt") == 0) noted(NCONT); noted(NDFLT); }
/* * console.h * * Copyright 2001-2010 Texas Instruments, Inc. - http://www.ti.com/ * * 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. */ /** \file console.h * \brief Console (CLI) API * * \see console.c, ticon.c */ #ifndef _CONSOLE_H_ #define _CONSOLE_H_ /* defines */ /***********/ /* parameter flags */ #define CON_PARM_OPTIONAL 0x01 /* Parameter is optional */ #define CON_PARM_DEFVAL 0x02 /* Default value is set */ #define CON_PARM_RANGE 0x04 /* Range is set */ #define CON_PARM_STRING 0x08 /* String parm */ #define CON_PARM_LINE 0x10 /* String from the current parser position till EOL */ #define CON_PARM_SIGN 0x20 /* Signed param */ #define CON_PARM_NOVAL 0x80 /* Internal flag: parameter is anassigned */ #define CON_LAST_PARM { NULL, 0, 0, 0, 0 } #define CONSOLE_TERMINAL_MODULE_ID (0) #define CONSOLE_LOGGER_MODULE_ID (1) #define CONSOLE_WIPP_MODULE_ID (2) #define CONSOLE_G_TESTER_MODULE_ID (3) #define CONSOLE_NUMBER_OF_MODULES (4) /* types */ /*********/ typedef enum { E_OK = 0, E_BADPARM, E_TOOMANY, E_NOMEMORY, E_NOT_FOUND, E_EXISTS, E_DUMMY, E_ERROR } consoleErr; typedef struct ConParm_t { PS8 name; /* Parameter name. Shouldn't be allocated on stack! */ U8 flags; /* Combination of CON_PARM_??? flags */ U32 low_val; /* Low val for range checking */ U32 hi_val; /* Hi val for range checking/max length of string */ U32 value; /* Value/address of string parameter */ } ConParm_t; typedef void (*FuncToken_t)(THandle hCuCmd, ConParm_t parm[], U16 nParms); /* functions */ /*************/ THandle Console_Create(const PS8 device_name, S32 BypassSupplicant, PS8 pSupplIfFile); VOID Console_Destroy(THandle hConsole); VOID Console_GetDeviceStatus(THandle hConsole); VOID Console_Start(THandle hConsole); VOID Console_Stop(THandle hConsole); THandle Console_AddDirExt( THandle hConsole, THandle hRoot, const PS8 name, const PS8 desc ); consoleErr Console_AddToken( THandle hConsole, THandle hDir, const PS8 name, const PS8 help, FuncToken_t p_func, ConParm_t p_parms[] ); #endif /* _CONSOLE_H_ */
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering */ #include <common.h> #include <asm/io.h> #include "vct.h" static u32 ebi_read(u32 addr) { addr &= ~0xFC000000; reg_write(EBI_CPU_IO_ACCS(EBI_BASE), EXT_DEVICE_CHANNEL_2 | addr); ebi_wait(); return reg_read(EBI_IO_ACCS_DATA(EBI_BASE)); } static int ebi_write_u16(u32 addr, u32 data, int fetchIO) { u32 val = (data << 16); addr &= ~0xFC000000; ebi_wait(); reg_write(EBI_IO_ACCS_DATA(EBI_BASE), val); reg_write(EBI_CPU_IO_ACCS(EBI_BASE), EXT_DEVICE_CHANNEL_2 | EBI_CPU_WRITE | addr); ebi_wait(); if (fetchIO) { u32 counter = 0; while (!(reg_read(EBI_SIG_LEVEL(EBI_BASE)) & EXT_CPU_IORDY_SL)) { if (counter++ > 0xFFFFFF) return 1; } } return 0; } static u16 ebi_read_u16(u32 addr) { return ((ebi_read(addr) >> 16) & 0xFFFF); } static u8 ebi_read_u8(u32 addr) { u32 val = ebi_read(addr) >> 16; if (addr & 0x1) return val & 0xff; else return (val >> 8) & 0xff; } /* * EBI initialization for NOR FLASH access */ int ebi_init_nor_flash(void) { reg_write(EBI_DEV1_CONFIG1(EBI_BASE), 0x83000); reg_write(EBI_DEV2_CONFIG1(EBI_BASE), 0x400002); reg_write(EBI_DEV2_CONFIG2(EBI_BASE), 0x50); reg_write(EBI_DEV2_TIM1_RD1(EBI_BASE), 0x409113); reg_write(EBI_DEV2_TIM1_RD2(EBI_BASE), 0xFF01000); reg_write(EBI_DEV2_TIM1_WR1(EBI_BASE), 0x04003113); reg_write(EBI_DEV2_TIM1_WR2(EBI_BASE), 0x3FC12011); reg_write(EBI_DEV2_TIM_EXT(EBI_BASE), 0xFFF00000); return 0; } /* * Accessor functions replacing the "weak" functions in * drivers/mtd/cfi_flash.c */ void flash_write8(u8 value, void *addr) { ebi_write_u16((u32)addr, value, 0); } void flash_write16(u16 value, void *addr) { ebi_write_u16((u32)addr, value, 0); } u8 flash_read8(void *addr) { return ebi_read_u8((u32)addr); } u16 flash_read16(void *addr) { return ebi_read_u16((u32)addr); } u32 flash_read32(void *addr) { return ((u32)ebi_read_u16((u32)addr) << 16) | ebi_read_u16((u32)addr + 2); } void *board_flash_read_memcpy(void *dest, const void *src, size_t count) { u16 *tmp = (u16 *)dest, *s = (u16 *)src; int i; for (i = 0; i < count; i += 2) *tmp++ = flash_read16(s++); return dest; }
/* * This file describes the structure passed from the BootX application * (for MacOS) when it is used to boot Linux. * * Written by Benjamin Herrenschmidt. */ #ifndef __ASM_BOOTX_H__ #define __ASM_BOOTX_H__ #ifdef macintosh #include <Types.h> #endif #ifdef macintosh /* All this requires PowerPC alignment */ #pragma options align=power #endif #define BOOT_INFO_VERSION 1 #define BOOT_INFO_COMPATIBLE_VERSION 1 /* Here are the boot informations that are passed to the bootstrap * Note that the kernel arguments and the device tree are appended * at the end of this structure. */ typedef struct boot_infos { /* Version of this structure */ unsigned long version; /* backward compatible down to version: */ unsigned long compatible_version; /* Set to 0 by current BootX */ unsigned long unused[3]; /* The device tree (internal addresses relative to the beginning of the tree, * device tree offset relative to the beginning of this structure). */ unsigned long deviceTreeOffset; /* Device tree offset */ unsigned long deviceTreeSize; /* Size of the device tree */ /* Some infos about the current MacOS display */ unsigned long dispDeviceRect[4]; /* left,top,right,bottom */ unsigned long dispDeviceDepth; /* (8, 16 or 32) */ unsigned char* dispDeviceBase; /* base address (physical) */ unsigned long dispDeviceRowBytes; /* rowbytes (in bytes) */ unsigned long dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */ /* Optional offset in the registry to the current * MacOS display. (Can be 0 when not detected) */ unsigned long dispDeviceRegEntryOffset; /* Optional pointer to boot ramdisk (offset from this structure) */ unsigned long ramDisk; unsigned long ramDiskSize; /* size of ramdisk image */ /* Kernel command line arguments (offset from this structure) */ unsigned long kernelParamsOffset; } boot_infos_t; /* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index is represented * by 3 short words containing a 16 bits (unsigned) color component. * Later versions may contain the gamma table for direct-color devices here. */ #define BOOTX_COLORTABLE_SIZE (256UL*3UL*2UL); #ifdef macintosh #pragma options align=reset #endif #endif
#ifndef _ZFTAPE_H #define _ZFTAPE_H /* * Copyright (C) 1996, 1997 Claus-Justus Heine. 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; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * $Source$ * $Revision$ * $Date$ * * Special ioctl and other global info for the zftape VFS * interface for the QIC-40/80/3010/3020 floppy-tape driver for * Linux. */ #define ZFTAPE_VERSION "zftape for " FTAPE_VERSION #include <linux/ftape.h> #define ZFTAPE_LABEL "Ftape - The Linux Floppy Tape Project!" /* Bits of the minor device number that control the operation mode */ #define ZFT_Q80_MODE (1 << 3) #define ZFT_ZIP_MODE (1 << 4) #define ZFT_RAW_MODE (1 << 5) #define ZFT_MINOR_OP_MASK (ZFT_Q80_MODE | \ ZFT_ZIP_MODE | \ ZFT_RAW_MODE) #define ZFT_MINOR_MASK (FTAPE_SEL_MASK | \ ZFT_MINOR_OP_MASK | \ FTAPE_NO_REWIND) #ifdef ZFT_OBSOLETE struct mtblksz { unsigned int mt_blksz; }; #define MTIOC_ZFTAPE_GETBLKSZ _IOR('m', 104, struct mtblksz) #endif #ifdef __KERNEL__ extern int zft_init(void); static inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz) { if (blk_sz == 1) { return value; } else { return (__s64)(((__u32)(value >> 10) + (blk_sz >> 10) - 1) / (blk_sz >> 10)); } } static inline __s64 zft_mul_blksz(__s64 value, __u32 blk_sz) { if (blk_sz == 1) { return value; } else { /* if blk_sz != 1, then it is a multiple of 1024. In * this case, `value' will also fit into 32 bits. * * Actually, this limits the capacity to 42 * bits. This is (2^32)*1024, roughly a thousand * times 2GB, or 3 Terabytes. Hopefully this is enough */ return(__s64)(((__u32)(value)*(blk_sz>>10))<<10); } } #endif #endif
/* Portions Copyright (c) 2015-Present, Facebook, Inc. Portions Copyright (c) 2012,2013 Monty Program Ab 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. 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 */ #pragma once /* C++ standard header files */ #include <atomic> #include <cstdint> #include <string> /* MySQL header files */ #include "./handler.h" #include <my_global.h> namespace myrocks { enum { PC_USER_KEY_COMPARISON_COUNT = 0, PC_BLOCK_CACHE_HIT_COUNT, PC_BLOCK_READ_COUNT, PC_BLOCK_READ_BYTE, PC_BLOCK_READ_TIME, PC_BLOCK_CHECKSUM_TIME, PC_BLOCK_DECOMPRESS_TIME, PC_GET_READ_BYTES, PC_MULTIGET_READ_BYTES, PC_ITER_READ_BYTES, PC_KEY_SKIPPED, PC_DELETE_SKIPPED, PC_RECENT_SKIPPED, PC_MERGE, PC_GET_SNAPSHOT_TIME, PC_GET_FROM_MEMTABLE_TIME, PC_GET_FROM_MEMTABLE_COUNT, PC_GET_POST_PROCESS_TIME, PC_GET_FROM_OUTPUT_FILES_TIME, PC_SEEK_ON_MEMTABLE_TIME, PC_SEEK_ON_MEMTABLE_COUNT, PC_NEXT_ON_MEMTABLE_COUNT, PC_PREV_ON_MEMTABLE_COUNT, PC_SEEK_CHILD_SEEK_TIME, PC_SEEK_CHILD_SEEK_COUNT, PC_SEEK_MIN_HEAP_TIME, PC_SEEK_MAX_HEAP_TIME, PC_SEEK_INTERNAL_SEEK_TIME, PC_FIND_NEXT_USER_ENTRY_TIME, PC_WRITE_WAL_TIME, PC_WRITE_MEMTABLE_TIME, PC_WRITE_DELAY_TIME, PC_WRITE_PRE_AND_POST_PROCESSS_TIME, PC_DB_MUTEX_LOCK_NANOS, PC_DB_CONDITION_WAIT_NANOS, PC_MERGE_OPERATOR_TIME_NANOS, PC_READ_INDEX_BLOCK_NANOS, PC_READ_FILTER_BLOCK_NANOS, PC_NEW_TABLE_BLOCK_ITER_NANOS, PC_NEW_TABLE_ITERATOR_NANOS, PC_BLOCK_SEEK_NANOS, PC_FIND_TABLE_NANOS, PC_BLOOM_MEMTABLE_HIT_COUNT, PC_BLOOM_MEMTABLE_MISS_COUNT, PC_BLOOM_SST_HIT_COUNT, PC_BLOOM_SST_MISS_COUNT, PC_KEY_LOCK_WAIT_TIME, PC_KEY_LOCK_WAIT_COUNT, PC_IO_THREAD_POOL_ID, PC_IO_BYTES_WRITTEN, PC_IO_BYTES_READ, PC_IO_OPEN_NANOS, PC_IO_ALLOCATE_NANOS, PC_IO_WRITE_NANOS, PC_IO_READ_NANOS, PC_IO_RANGE_SYNC_NANOS, PC_IO_LOGGER_NANOS, PC_MAX_IDX }; class Rdb_perf_counters; /* A collection of performance counters that can be safely incremented by multiple threads since it stores atomic datapoints. */ struct Rdb_atomic_perf_counters { std::atomic_ullong m_value[PC_MAX_IDX]; }; /* A collection of performance counters that is meant to be incremented by a single thread. */ class Rdb_perf_counters { Rdb_perf_counters(const Rdb_perf_counters &) = delete; Rdb_perf_counters &operator=(const Rdb_perf_counters &) = delete; public: Rdb_perf_counters() = default; uint64_t m_value[PC_MAX_IDX]; void load(const Rdb_atomic_perf_counters &atomic_counters); }; extern std::string rdb_pc_stat_types[PC_MAX_IDX]; /* Perf timers for data reads */ class Rdb_io_perf { // Context management Rdb_atomic_perf_counters *m_atomic_counters = nullptr; my_io_perf_atomic_t *m_shared_io_perf_read = nullptr; my_io_perf_atomic_t *m_shared_io_perf_write = nullptr; ha_statistics *m_stats = nullptr; uint64_t io_write_bytes; uint64_t io_write_requests; public: Rdb_io_perf(const Rdb_io_perf &) = delete; Rdb_io_perf &operator=(const Rdb_io_perf &) = delete; void init(Rdb_atomic_perf_counters *const atomic_counters, my_io_perf_atomic_t *const shared_io_perf_read, my_io_perf_atomic_t *const shared_io_perf_write, ha_statistics *const stats) { DBUG_ASSERT(atomic_counters != nullptr); DBUG_ASSERT(shared_io_perf_read != nullptr); DBUG_ASSERT(shared_io_perf_write != nullptr); DBUG_ASSERT(stats != nullptr); m_atomic_counters = atomic_counters; m_shared_io_perf_read = shared_io_perf_read; m_shared_io_perf_write = shared_io_perf_write; m_stats = stats; io_write_bytes = 0; io_write_requests = 0; } bool start(const uint32_t perf_context_level); void update_bytes_written(const uint32_t perf_context_level, ulonglong bytes_written); void end_and_record(const uint32_t perf_context_level); explicit Rdb_io_perf() : m_atomic_counters(nullptr), m_shared_io_perf_read(nullptr), m_stats(nullptr), io_write_bytes(0), io_write_requests(0) {} }; } // namespace myrocks
/* .LVT tape images */ #include "lviv_lvt.h" #define WAVEENTRY_LOW -32768 #define WAVEENTRY_HIGH 32767 #define LVIV_LVT_BIT_SAMPLES 60 #define LVIV_LVT_HEADER_PILOT_SAMPLES 5190*60 #define LVIV_LVT_HEADER_DATA_SAMPLES 16*11*60 #define LVIV_LVT_PAUSE_SAMPLES 69370 #define LVIV_LVT_BLOCK_PILOT_SAMPLES 1298*60 #define LVIV_LVT_HEADER_PILOT_LENGTH 5190 #define LVIV_LVT_BLOCK_PILOT_LENGTH 1298 static INT16 *lviv_emit_level(INT16 *p, int count, int level) { int i; for (i=0; i<count; i++) { *(p++) = level; } return p; } static INT16* lviv_output_bit(INT16 *p, UINT8 b) { if (b) { p = lviv_emit_level (p, 15, WAVEENTRY_HIGH); p = lviv_emit_level (p, 15, WAVEENTRY_LOW); p = lviv_emit_level (p, 15, WAVEENTRY_HIGH); p = lviv_emit_level (p, 15, WAVEENTRY_LOW); } else { p = lviv_emit_level (p, 30, WAVEENTRY_HIGH); p = lviv_emit_level (p, 30, WAVEENTRY_LOW); } return p; } static INT16* lviv_output_byte(INT16 *p, UINT8 byte) { int i; p = lviv_output_bit (p, 0); for (i=0; i<8; i++) p = lviv_output_bit(p,(byte>>i) & 0x01); p = lviv_output_bit (p, 1); p = lviv_output_bit (p, 1); return p; } /*************************************************************************************/ static int lviv_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) { int size; size = LVIV_LVT_HEADER_PILOT_SAMPLES + LVIV_LVT_HEADER_DATA_SAMPLES + LVIV_LVT_PAUSE_SAMPLES + LVIV_LVT_BLOCK_PILOT_SAMPLES + (length-0x10)*11*LVIV_LVT_BIT_SAMPLES; return size; } /*************************************************************************************/ static int lviv_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) { int i; INT16 * p = buffer; int data_size; for (i=0; i<LVIV_LVT_HEADER_PILOT_LENGTH; i++) p = lviv_output_bit (p, 1); for (i=0; i<10; i++) p = lviv_output_byte (p, bytes[0x09]); for (i=0; i<6; i++) p = lviv_output_byte (p, bytes[0x0a+i]); p = lviv_emit_level (p, LVIV_LVT_PAUSE_SAMPLES, WAVEENTRY_HIGH); for (i=0; i<LVIV_LVT_BLOCK_PILOT_LENGTH; i++) p = lviv_output_bit (p, 1); data_size = length - ( LVIV_LVT_HEADER_PILOT_SAMPLES + LVIV_LVT_HEADER_DATA_SAMPLES + LVIV_LVT_PAUSE_SAMPLES + LVIV_LVT_BLOCK_PILOT_SAMPLES ); data_size/=660; for (i=0; i<data_size; i++) p = lviv_output_byte (p, bytes[0x10+i]); return p - buffer; } static struct CassetteLegacyWaveFiller lviv_legacy_fill_wave = { lviv_cassette_fill_wave, /* fill_wave */ -1, /* chunk_size */ 0, /* chunk_samples */ lviv_cassette_calculate_size_in_samples, /* chunk_sample_calc */ 44100, /* sample_frequency */ 0, /* header_samples */ 0 /* trailer_samples */ }; static casserr_t lviv_lvt_identify(cassette_image *cassette, struct CassetteOptions *opts) { return cassette_legacy_identify(cassette, opts, &lviv_legacy_fill_wave); } static casserr_t lviv_lvt_load(cassette_image *cassette) { return cassette_legacy_construct(cassette, &lviv_legacy_fill_wave); } struct CassetteFormat lviv_lvt_image_format = { "lvt\0", lviv_lvt_identify, lviv_lvt_load, NULL }; CASSETTE_FORMATLIST_START(lviv_lvt_format) CASSETTE_FORMAT(lviv_lvt_image_format) CASSETTE_FORMATLIST_END
/* * For declaring structures shared with assembly routines * * $Id$ */ #ifdef ASSEMBLER # define MO(t,a) (a) # define VMO(t,a) (a) # define BEGIN_STRUCT(x) _Off=0 # define S1A(t,x,n) _Off=(_Off+0)&~0; x=_Off; _Off=_Off+(1*n) # define S2A(t,x,n) _Off=(_Off+1)&~1; x=_Off; _Off=_Off+(2*n) # define S4A(t,x,n) _Off=(_Off+3)&~3; x=_Off; _Off=_Off+(4*n) # define WORD(x) _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4 # define WORDA(x,n) _Off=(_Off+3)&~3; x=_Off; _Off=_Off+(4*n) # define VWORD(x) _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4 # define S1(t,x) _Off=(_Off+0)&~0; x=_Off; _Off=_Off+1 # define S2(t,x) _Off=(_Off+1)&~1; x=_Off; _Off=_Off+2 # define S4(t,x) _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4 # define END_STRUCT(x) _Off=(_Off+3)&~3; x=_Off #else /* C */ #define VMO(t,a) (*(volatile t *)(a)) # define BEGIN_STRUCT(x) struct x { # define S1(t,x) t x ; # define S1A(t,x,n) t x[n] ; # define S2(t,x) t x ; # define S2A(t,x,n) t x[n] ; # define S4(t,x) t x ; # define S4A(t,x,n) t x[n] ; # define END_STRUCT(x) } ; #endif
// Copyright 2014 Citra Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #pragma once #include <array> #include <glad/glad.h> #include "common/common_types.h" #include "common/math_util.h" #include "core/hw/gpu.h" #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_state.h" class EmuWindow; /// Structure used for storing information about the textures for each 3DS screen struct TextureInfo { OGLTexture resource; GLsizei width; GLsizei height; GPU::Regs::PixelFormat format; GLenum gl_format; GLenum gl_type; }; /// Structure used for storing information about the display target for each 3DS screen struct ScreenInfo { GLuint display_texture; MathUtil::Rectangle<float> display_texcoords; TextureInfo texture; }; class RendererOpenGL : public RendererBase { public: RendererOpenGL(); ~RendererOpenGL() override; /// Swap buffers (render frame) void SwapBuffers() override; /** * Set the emulator window to use for renderer * @param window EmuWindow handle to emulator window to use for rendering */ void SetWindow(EmuWindow* window) override; /// Initialize the renderer bool Init() override; /// Shutdown the renderer void ShutDown() override; private: void InitOpenGLObjects(); void ConfigureFramebufferTexture(TextureInfo& texture, const GPU::Regs::FramebufferConfig& framebuffer); void DrawScreens(); void DrawSingleScreenRotated(const ScreenInfo& screen_info, float x, float y, float w, float h); void UpdateFramerate(); // Loads framebuffer from emulated memory into the display information structure void LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& framebuffer, ScreenInfo& screen_info, bool right_eye); // Fills active OpenGL texture with the given RGB color. void LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, const TextureInfo& texture); EmuWindow* render_window; ///< Handle to render window OpenGLState state; // OpenGL object IDs OGLVertexArray vertex_array; OGLBuffer vertex_buffer; OGLProgram shader; /// Display information for top and bottom screens respectively std::array<ScreenInfo, 3> screen_infos; // Shader uniform location indices GLuint uniform_modelview_matrix; GLuint uniform_color_texture; // Shader attribute input indices GLuint attrib_position; GLuint attrib_tex_coord; };
/* * Author: MontaVista Software, Inc. <source@mvista.com> * * 2005 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #include <linux/init.h> #include <linux/mvl_patch.h> static __init int regpatch(void) { return mvl_register_patch(223); } module_init(regpatch);
#ifndef LVPA_COMPILE_CONFIG #define LVPA_COMPILE_CONFIG // choose a namespace name, or comment out this define to disable namespacing (not recommended) #define LVPA_NAMESPACE lvpa // if not configuring via CMake or setting these externally, // use these to enable a set of compression algorithms to use. //#define LVPA_SUPPORT_ZLIB //#define LVPA_SUPPORT_LZMA //#define LVPA_SUPPORT_LZO //#define LVPA_SUPPORT_LZF //#define LVPA_SUPPORT_LZHAM // ------ End of config ------ #if !(defined(LVPA_SUPPORT_ZLIB) || defined(LVPA_SUPPORT_LZMA) || defined(LVPA_SUPPORT_LZO) \ || defined(LVPA_SUPPORT_LZF) || defined(LVPA_SUPPORT_LZHAM)) #error No compression support enabled; if this is the intent, comment out this warning and go ahead #endif #ifdef LVPA_NAMESPACE # define LVPA_NAMESPACE_START namespace LVPA_NAMESPACE { # define LVPA_NAMESPACE_END } # define LVPA_NAMESPACE_IMPL LVPA_NAMESPACE:: namespace LVPA_NAMESPACE {} // predeclare namespace to make compilers happy #else # define LVPA_NAMESPACE_START # define LVPA_NAMESPACE_END # define LVPA_NAMESPACE_IMPL #endif #define BYTEBUFFER_NO_EXCEPTIONS #endif
/* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MBED_SERIAL_API_H #define MBED_SERIAL_API_H #include "device.h" #if DEVICE_SERIAL #ifdef __cplusplus extern "C" { #endif typedef enum { ParityNone = 0, ParityOdd = 1, ParityEven = 2, ParityForced1 = 3, ParityForced0 = 4 } SerialParity; typedef enum { RxIrq, TxIrq } SerialIrq; typedef enum { FlowControlNone, FlowControlRTS, FlowControlCTS, FlowControlRTSCTS } FlowControl; typedef void (*uart_irq_handler)(uint32_t id, SerialIrq event); typedef struct serial_s serial_t; void serial_init (serial_t* obj, PinName tx, PinName rx); void serial_free (serial_t* obj); void serial_baud (serial_t* obj, int baudrate); void serial_format (serial_t* obj, int data_bits, SerialParity parity, int stop_bits); void serial_irq_handler(serial_t* obj, uart_irq_handler handler, uint32_t id); void serial_irq_set (serial_t* obj, SerialIrq irq, uint32_t enable); int serial_getc (serial_t* obj); void serial_putc (serial_t* obj, int c); int serial_readable (serial_t* obj); int serial_writable (serial_t* obj); void serial_clear (serial_t* obj); void serial_break_set (serial_t* obj); void serial_break_clear(serial_t* obj); void serial_pinout_tx(PinName tx); void serial_set_flow_control(serial_t* obj, FlowControl type, PinName rxflow, PinName txflow); #ifdef __cplusplus } #endif #endif #endif
#ifndef PUBLICFUNCS #define PUBLICFUNCS #define LINUX #ifdef LINUX #include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> #else #include <GLUT/glut.h> #endif #include "interface.h" #define FUNCPOINT_N 1000 extern GLPoint funcpoints[FUNCPOINT_N]; typedef float (*FUNC)(float x); void initWindow(void); void drawDot(GLfloat x, GLfloat y); void setWindow(GLdouble left, GLdouble bottom, GLdouble width, GLdouble height); void setViewport(GLdouble left, GLdouble bottom, GLdouble width, GLdouble height); void createFuncPoints(FUNC func, float startx, float endx); void drawPolyLineFile(const char * fileName); GLPoint calViewportXYWantScreenCentre(GLdouble wl, GLdouble wb, GLdouble ww, GLdouble wh, GLdouble vw, GLdouble vh, GLdouble gw, GLdouble gh); #define WHEEL_BUTTOM_UP 4 #define WHEEL_BUTTOM_DOWN 3 #endif