text
stringlengths
4
6.14k
/*************** <auto-copyright.pl BEGIN do not edit this line> ************** * * VR Juggler is (C) Copyright 1998-2011 by Iowa State University * * Original Authors: * Allen Bierbaum, Christopher Just, * Patrick Hartling, Kevin Meinert, * Carolina Cruz-Neira, Albert Baker * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * *************** <auto-copyright.pl END do not edit this line> ***************/ #ifndef _GADGET_DIGITAL_PROXY_H_ #define _GADGET_DIGITAL_PROXY_H_ #include <gadget/gadgetConfig.h> #include <gadget/Type/Digital.h> #include <gadget/Type/Proxy.h> #include <gadget/Type/DigitalProxyPtr.h> #include <vpr/Util/Assert.h> namespace gadget { /** \class DigitalProxy DigitalProxy.h gadget/Type/DigitalProxy.h * * A proxy class to digital devices, used by the Input Manager. * * A digital proxy always points to a digital device and unit number within * that device. The Input Manager can therefore keep an array of these * around and treat them as digital devices that only return a single * sub-device's amount of data (one int). * * @see gagdet::Digital */ class GADGET_API DigitalProxy : public TypedProxy<Digital> { public: /** @since 2.1.1 */ typedef DigitalProxy::typed_proxy_ base_type; protected: DigitalProxy(const std::string& deviceName = "UnknownDigital", const int unitNum = -1); public: /** @name Construction/Destruction */ //@{ /** * Creates a DigitalProxy instance and returns it wrapped in a * DigitalProxyPtr object. * * @since 1.3.7 */ static DigitalProxyPtr create(const std::string& deviceName = "UnknownDigital", const int unitNum = -1); virtual ~DigitalProxy(); //@} virtual void updateData(); static DigitalState::State getNextState(const DigitalState::State prevState, const DigitalState::State curState); static std::string getElementType(); }; } // End of gadget namespace #endif
/* ********************************************************** * Copyright (c) 2014 Google, Inc. All rights reserved. * Copyright (c) 2003 VMware, 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 VMware, 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 VMWARE, 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. */ #include <windows.h> #include <assert.h> #include <stdio.h> int main() { void *p; BOOL res; int size = 0x04000; p = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE); assert(p); res = VirtualFree(p, 0, MEM_RELEASE); assert(res); printf("Successful\n"); }
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ #ifndef _JMSOFFICECOMM_STRINGUTILS_H_ #define _JMSOFFICECOMM_STRINGUTILS_H_ #include <tchar.h> #include <windows.h> class StringUtils { public: static LPWSTR MultiByteToWideChar(LPCSTR str); static LPSTR WideCharToMultiByte(LPCWSTR wstr); }; #endif /* #ifndef _JMSOFFICECOMM_STRINGUTILS_H_ */
/*------------------------------------------------------------------*- 2_01_12h.C (v1.00) ------------------------------------------------------------------ *** THIS IS A *HYBRID* SCHEDULER FOR STANDARD 8051 / 8052 *** *** Uses T2 for timing, 16-bit auto reload *** *** 12 MHz oscillator -> 1 ms (precise) tick interval *** COPYRIGHT --------- This code is from the book: PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont [Pearson Education, 2001; ISBN: 0-201-33138-1]. This code is copyright (c) 2001 by Michael J. Pont. See book for copyright details and other information. -*------------------------------------------------------------------*/ #include "2_01_12h.h" // ------ Public variable declarations ----------------------------- // The array of tasks (see Sch51.C) extern sTaskH hSCH_tasks_G[hSCH_MAX_TASKS]; // Used to display the error code // See Main.H for details of error codes // See Port.H for details of the error port extern tByte Error_code_G; /*------------------------------------------------------------------*- hSCH_Init_T2() Scheduler initialisation function. Prepares scheduler data structures and sets up timer interrupts at required rate. You must call this function before using the scheduler. -*------------------------------------------------------------------*/ void hSCH_Init_T2(void) { tByte i; for (i = 0; i < hSCH_MAX_TASKS; i++) { hSCH_Delete_Task(i); } // Reset the global error variable // - hSCH_Delete_Task() will generate an error code, // (because the task array is empty) Error_code_G = 0; // Now set up Timer 2 // 16-bit timer function with automatic reload // Crystal is assumed to be 12 MHz // The Timer 2 resolution is 0.000001 seconds (1 µs) // The required Timer 2 overflow is 0.001 seconds (1 ms) // - this takes 1000 timer ticks // Reload value is 65536 - 1000 = 64536 (dec) = 0xFC18 T2CON = 0x04; // load Timer 2 control register T2MOD = 0x00; // load Timer 2 mode register TH2 = 0xFC; // load timer 2 high byte RCAP2H = 0xFC; // load timer 2 reload capture reg, high byte TL2 = 0x18; // load timer 2 low byte RCAP2L = 0x18; // load timer 2 reload capture reg, low byte ET2 = 1; // Timer 2 interrupt is enabled TR2 = 1; // Start Timer 2 } /*------------------------------------------------------------------*- hSCH_Start() Starts the scheduler, by enabling interrupts. NOTE: Usually called after all regular tasks are added, to keep the tasks synchronised. NOTE: ONLY THE SCHEDULER INTERRUPT SHOULD BE ENABLED!!! -*------------------------------------------------------------------*/ void hSCH_Start(void) { EA = 1; } /*------------------------------------------------------------------*- hSCH_Update This is the scheduler ISR. It is called at a rate determined by the timer settings in hSCH_Init(). This version is triggered by Timer 2 interrupts: timer is automatically reloaded. -*------------------------------------------------------------------*/ void hSCH_Update(void) interrupt INTERRUPT_Timer_2_Overflow { tByte Index; TF2 = 0; // Have to manually clear this. // NOTE: calculations are in *TICKS* (not milliseconds) for (Index = 0; Index < hSCH_MAX_TASKS; Index++) { // Check if there is a task at this location if (hSCH_tasks_G[Index].pTask) { if (hSCH_tasks_G[Index].Delay == 0) { // The task is due to run // if (hSCH_tasks_G[Index].Co_op) { // If it is a co-operative task, increment the RunMe flag hSCH_tasks_G[Index].RunMe += 1; } else { // If it is a pre-emptive task, run it IMMEDIATELY (*hSCH_tasks_G[Index].pTask)(); // Run the task hSCH_tasks_G[Index].RunMe -= 1; // Reset / reduce RunMe flag // Periodic tasks will be run again (see below) // - if this is a 'one shot' task, remove it from the array if (hSCH_tasks_G[Index].Period == 0) { hSCH_tasks_G[Index].pTask = 0; } } if (hSCH_tasks_G[Index].Period) { // Schedule periodic tasks to run again hSCH_tasks_G[Index].Delay = hSCH_tasks_G[Index].Period; } } else { // Not yet ready to run: just decrement the delay hSCH_tasks_G[Index].Delay -= 1; } } } } /*------------------------------------------------------------------*- ---- END OF FILE ------------------------------------------------- -*------------------------------------------------------------------*/
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import <Foundation/Foundation.h> #import "TiCore.h" #import "TiBase.h" #import "TiContextRefPrivate.h" @class KrollContext; @class KrollCallback; @protocol KrollDelegate <NSObject> @required -(id)require:(KrollContext*)kroll path:(NSString*)path; -(BOOL)shouldDebugContext; @optional -(void)willStartNewContext:(KrollContext*)kroll; -(void)didStartNewContext:(KrollContext*)kroll; -(void)willStopNewContext:(KrollContext*)kroll; -(void)didStopNewContext:(KrollContext*)kroll; @end @interface KrollContext : NSObject { @private id<KrollDelegate> delegate; NSString *contextId; NSRecursiveLock *lock; NSCondition *condition; NSMutableArray *queue; BOOL stopped; //Garbage collection variables. BOOL gcrequest; unsigned int loopCount; BOOL destroyed; BOOL suspended; TiGlobalContextRef context; NSMutableDictionary *timers; NSRecursiveLock *timerLock; void *debugger; } @property(nonatomic,readwrite,assign) id<KrollDelegate> delegate; -(NSString*)contextId; -(void)start; -(void)stop; -(BOOL)running; -(void)gc; -(TiGlobalContextRef)context; -(void*)debugger; -(BOOL)isKJSThread; #ifdef DEBUG // used during debugging only -(int)queueCount; #endif -(void)invokeOnThread:(id)callback_ method:(SEL)method_ withObject:(id)obj condition:(NSCondition*)condition_; -(void)invokeOnThread:(id)callback_ method:(SEL)method_ withObject:(id)obj callback:(id)callback selector:(SEL)selector_; -(void)evalJS:(NSString*)code; -(id)evalJSAndWait:(NSString*)code; -(void)enqueue:(id)obj; -(void)registerTimer:(id)timer timerId:(double)timerId; -(void)unregisterTimer:(double)timerId; -(int)forceGarbageCollectNow; @end //==================================================================================================================== @interface KrollUnprotectOperation : NSOperation { TiContextRef jsContext; TiObjectRef firstObject; TiObjectRef secondObject; } -(id)initWithContext: (TiContextRef)newContext withJsobject: (TiObjectRef) newFirst; -(id)initWithContext: (TiContextRef)newContext withJsobject: (TiObjectRef) newFirst andJsobject: (TiObjectRef) newSecond; @end @interface KrollInvocation : NSObject { @private id target; SEL method; id obj; NSCondition *condition; id notify; SEL notifySelector; } -(id)initWithTarget:(id)target_ method:(SEL)method_ withObject:(id)obj_ condition:(NSCondition*)condition_; -(id)initWithTarget:(id)target_ method:(SEL)method_ withObject:(id)obj_ callback:(id)callback_ selector:(SEL)selector_; -(void)invoke:(KrollContext*)context; @end @interface KrollEval : NSObject { @private NSString *code; } -(id)initWithCode:(NSString*)code; -(void)invoke:(KrollContext*)context; -(id)invokeWithResult:(KrollContext*)context; @end @class KrollObject; @interface KrollEvent : NSObject { @private KrollCallback * callback; NSString * type; KrollObject * callbackObject; NSDictionary *eventObject; id thisObject; } -(id)initWithType:(NSString *)newType ForKrollObject:(KrollObject*)newCallbackObject eventObject:(NSDictionary*)newEventObject thisObject:(id)newThisObject; -(id)initWithCallback:(KrollCallback*)newCallback eventObject:(NSDictionary*)newEventObject thisObject:(id)newThisObject; -(void)invoke:(KrollContext*)context; @end @protocol KrollTargetable @required -(void)setExecutionContext:(id<KrollDelegate>)delegate; @end TI_INLINE KrollContext* GetKrollContext(TiContextRef context) { static const char *krollNS = "Kroll"; TiGlobalContextRef globalContext = TiContextGetGlobalContext(context); TiObjectRef global = TiContextGetGlobalObject(globalContext); TiStringRef string = TiStringCreateWithUTF8CString(krollNS); TiValueRef value = TiObjectGetProperty(globalContext, global, string, NULL); KrollContext *ctx = (KrollContext*)TiObjectGetPrivate(TiValueToObject(globalContext, value, NULL)); TiStringRelease(string); return ctx; } //TODO: After 1.7, move to individual file and convert KrollInvocation and Callbacks to ExpandedInvocationOperation. @interface ExpandedInvocationOperation : NSOperation { @private id invocationTarget; SEL invocationSelector; id invocationArg1; id invocationArg2; id invocationArg3; id invocationArg4; } - (id)initWithTarget:(id)target selector:(SEL)sel object:(id)arg1 object:(id)arg2; - (id)initWithTarget:(id)target selector:(SEL)sel object:(id)arg1 object:(id)arg2 object:(id)arg3; - (id)initWithTarget:(id)target selector:(SEL)sel object:(id)arg1 object:(id)arg2 object:(id)arg3 object:(id)arg4; @property(nonatomic,readwrite,retain) id invocationTarget; @property(nonatomic,readwrite,assign) SEL invocationSelector; @property(nonatomic,readwrite,retain) id invocationArg1; @property(nonatomic,readwrite,retain) id invocationArg2; @property(nonatomic,readwrite,retain) id invocationArg3; @property(nonatomic,readwrite,retain) id invocationArg4; @end
/*========================================================================= * * Copyright NumFOCUS * * 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.txt * * 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 itkYenThresholdImageFilter_h #define itkYenThresholdImageFilter_h #include "itkHistogramThresholdImageFilter.h" #include "itkYenThresholdCalculator.h" namespace itk { /** *\class YenThresholdImageFilter * \brief Threshold an image using the Yen Threshold * * This filter creates a binary thresholded image that separates an * image into foreground and background components. The filter * computes the threshold using the YenThresholdCalculator and * applies that threshold to the input image using the * BinaryThresholdImageFilter. * * \author Richard Beare * \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France. * * This implementation was taken from the Insight Journal paper: * https://www.insight-journal.org/browse/publication/811 * * \sa HistogramThresholdImageFilter * * \ingroup Multithreaded * \ingroup ITKThresholding */ template <typename TInputImage, typename TOutputImage, typename TMaskImage = TOutputImage> class ITK_TEMPLATE_EXPORT YenThresholdImageFilter : public HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage> { public: ITK_DISALLOW_COPY_AND_MOVE(YenThresholdImageFilter); /** Standard Self type alias */ using Self = YenThresholdImageFilter; using Superclass = HistogramThresholdImageFilter<TInputImage, TOutputImage, TMaskImage>; using Pointer = SmartPointer<Self>; using ConstPointer = SmartPointer<const Self>; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(YenThresholdImageFilter, HistogramThresholdImageFilter); using InputImageType = TInputImage; using OutputImageType = TOutputImage; using MaskImageType = TMaskImage; /** Image pixel value type alias. */ using InputPixelType = typename InputImageType::PixelType; using OutputPixelType = typename OutputImageType::PixelType; using MaskPixelType = typename MaskImageType::PixelType; /** Image related type alias. */ using InputImagePointer = typename InputImageType::Pointer; using OutputImagePointer = typename OutputImageType::Pointer; using InputSizeType = typename InputImageType::SizeType; using InputIndexType = typename InputImageType::IndexType; using InputImageRegionType = typename InputImageType::RegionType; using OutputSizeType = typename OutputImageType::SizeType; using OutputIndexType = typename OutputImageType::IndexType; using OutputImageRegionType = typename OutputImageType::RegionType; using MaskSizeType = typename MaskImageType::SizeType; using MaskIndexType = typename MaskImageType::IndexType; using MaskImageRegionType = typename MaskImageType::RegionType; using typename Superclass::HistogramType; using CalculatorType = YenThresholdCalculator<HistogramType, InputPixelType>; /** Image related type alias. */ static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension; static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension; protected: YenThresholdImageFilter() { this->SetCalculator(CalculatorType::New()); } ~YenThresholdImageFilter() override = default; }; } // end namespace itk #endif
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // 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 Google 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. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__ #define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__ #include <string> #include <map> #include <google/protobuf/compiler/java/java_field.h> namespace google { namespace protobuf { namespace compiler { namespace java { class Context; // context.h class ClassNameResolver; // name_resolver.h } } namespace io { class Printer; // printer.h } } namespace protobuf { namespace compiler { namespace java { class MessageGenerator { public: explicit MessageGenerator(const Descriptor* descriptor); virtual ~MessageGenerator(); // All static variables have to be declared at the top-level of the file // so that we can control initialization order, which is important for // DescriptorProto bootstrapping to work. virtual void GenerateStaticVariables(io::Printer* printer) = 0; // Output code which initializes the static variables generated by // GenerateStaticVariables(). Returns an estimate of bytecode size. virtual int GenerateStaticVariableInitializers(io::Printer* printer) = 0; // Generate the class itself. virtual void Generate(io::Printer* printer) = 0; // Generates the base interface that both the class and its builder implement virtual void GenerateInterface(io::Printer* printer) = 0; // Generate code to register all contained extensions with an // ExtensionRegistry. virtual void GenerateExtensionRegistrationCode(io::Printer* printer) = 0; protected: const Descriptor* descriptor_; private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageGenerator); }; class ImmutableMessageGenerator : public MessageGenerator { public: explicit ImmutableMessageGenerator(const Descriptor* descriptor, Context* context); virtual ~ImmutableMessageGenerator(); virtual void Generate(io::Printer* printer); virtual void GenerateInterface(io::Printer* printer); virtual void GenerateExtensionRegistrationCode(io::Printer* printer); virtual void GenerateStaticVariables(io::Printer* printer); // Returns an estimate of the number of bytes the printed code will compile to virtual int GenerateStaticVariableInitializers(io::Printer* printer); private: void GenerateFieldAccessorTable(io::Printer* printer); // Returns an estimate of the number of bytes the printed code will compile to int GenerateFieldAccessorTableInitializer(io::Printer* printer); void GenerateMessageSerializationMethods(io::Printer* printer); void GenerateParseFromMethods(io::Printer* printer); void GenerateSerializeOneField(io::Printer* printer, const FieldDescriptor* field); void GenerateSerializeOneExtensionRange( io::Printer* printer, const Descriptor::ExtensionRange* range); void GenerateBuilder(io::Printer* printer); void GenerateIsInitialized(io::Printer* printer); void GenerateDescriptorMethods(io::Printer* printer); void GenerateInitializers(io::Printer* printer); void GenerateEqualsAndHashCode(io::Printer* printer); void GenerateParser(io::Printer* printer); void GenerateParsingConstructor(io::Printer* printer); Context* context_; ClassNameResolver* name_resolver_; FieldGeneratorMap<ImmutableFieldGenerator> field_generators_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageGenerator); }; } // namespace java } // namespace compiler } // namespace protobuf } // namespace google #endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__
/** ****************************************************************************** * File Name : main.h * Description : This file contains the common defines of the application ****************************************************************************** ** This notice applies to any and all portions of this file * that are not between comment pairs USER CODE BEGIN and * USER CODE END. Other portions of this file, whether * inserted by the user or by software development tools * are owned by their respective copyright owners. * * COPYRIGHT(c) 2017 STMicroelectronics * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ void _Error_Handler(char *, int); #define Error_Handler() _Error_Handler(__FILE__, __LINE__) /** * @} */ /** * @} */ #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
//===--- MutexWin32.h - -----------------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // Mutex, ConditionVariable, Read/Write lock, and Scoped lock implementations // using Windows Slim Reader/Writer Locks and Conditional Variables. // //===----------------------------------------------------------------------===// #ifndef SWIFT_RUNTIME_MUTEX_WIN32_H #define SWIFT_RUNTIME_MUTEX_WIN32_H #define WIN32_LEAN_AND_MEAN #define NOMINMAX #include <windows.h> namespace swift { typedef CONDITION_VARIABLE ConditionHandle; typedef SRWLOCK ConditionMutexHandle; typedef SRWLOCK MutexHandle; typedef SRWLOCK ReadWriteLockHandle; #define SWIFT_CONDITION_SUPPORTS_CONSTEXPR 1 #define SWIFT_MUTEX_SUPPORTS_CONSTEXPR 1 #define SWIFT_READWRITELOCK_SUPPORTS_CONSTEXPR 1 struct ConditionPlatformHelper { static constexpr ConditionHandle staticInit() { return CONDITION_VARIABLE_INIT; }; static void init(ConditionHandle &condition) { InitializeConditionVariable(&condition); } static void destroy(ConditionHandle &condition) {} static void notifyOne(ConditionHandle &condition) { WakeConditionVariable(&condition); } static void notifyAll(ConditionHandle &condition) { WakeAllConditionVariable(&condition); } static void wait(ConditionHandle &condition, MutexHandle &mutex); }; struct MutexPlatformHelper { static constexpr MutexHandle staticInit() { return SRWLOCK_INIT; } static constexpr ConditionMutexHandle conditionStaticInit() { return SRWLOCK_INIT; } static void init(MutexHandle &mutex, bool checked = false) { InitializeSRWLock(&mutex); } static void destroy(MutexHandle &mutex) {} static void lock(MutexHandle &mutex) { AcquireSRWLockExclusive(&mutex); } static void unlock(MutexHandle &mutex) { ReleaseSRWLockExclusive(&mutex); } static bool try_lock(MutexHandle &mutex) { return TryAcquireSRWLockExclusive(&mutex) != 0; } // The unsafe versions don't do error checking. static void unsafeLock(MutexHandle &mutex) { AcquireSRWLockExclusive(&mutex); } static void unsafeUnlock(MutexHandle &mutex) { ReleaseSRWLockExclusive(&mutex); } }; struct ReadWriteLockPlatformHelper { static constexpr ReadWriteLockHandle staticInit() { return SRWLOCK_INIT; } static void init(ReadWriteLockHandle &rwlock) { InitializeSRWLock(&rwlock); } static void destroy(ReadWriteLockHandle &rwlock) {} static void readLock(ReadWriteLockHandle &rwlock) { AcquireSRWLockShared(&rwlock); } static bool try_readLock(ReadWriteLockHandle &rwlock) { return TryAcquireSRWLockShared(&rwlock) != 0; } static void readUnlock(ReadWriteLockHandle &rwlock) { ReleaseSRWLockShared(&rwlock); } static void writeLock(ReadWriteLockHandle &rwlock) { AcquireSRWLockExclusive(&rwlock); } static bool try_writeLock(ReadWriteLockHandle &rwlock) { return TryAcquireSRWLockExclusive(&rwlock) != 0; } static void writeUnlock(ReadWriteLockHandle &rwlock) { ReleaseSRWLockExclusive(&rwlock); } }; } #endif
/***************************************************************************//** * @file em_prs.c * @brief Peripheral Reflex System (PRS) Peripheral API * @version 5.1.2 ******************************************************************************* * @section License * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b> ******************************************************************************* * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no * obligation to support this Software. Silicon Labs is providing the * Software "AS IS", with no express or implied warranties of any kind, * including, but not limited to, any implied warranties of merchantability * or fitness for any particular purpose or warranties against infringement * of any proprietary rights of a third party. * * Silicon Labs will not be liable for any consequential, incidental, or * special damages, or any other relief, or for any claim by any third party, * arising from your use of this Software. * ******************************************************************************/ #include "em_prs.h" #if defined(PRS_COUNT) && (PRS_COUNT > 0) #include "em_assert.h" /***************************************************************************//** * @addtogroup emlib * @{ ******************************************************************************/ /***************************************************************************//** * @addtogroup PRS * @brief Peripheral Reflex System (PRS) Peripheral API * @details * This module contains functions to control the PRS peripheral of Silicon * Labs 32-bit MCUs and SoCs. The PRS allows configurable, fast and autonomous * communication between peripherals on the MCU or SoC. * @{ ******************************************************************************/ /******************************************************************************* ************************** GLOBAL FUNCTIONS ******************************* ******************************************************************************/ /***************************************************************************//** * @brief * Set source and signal to be used for a channel. * * @param[in] ch * Channel to define signal and source for. * * @param[in] source * Source to select for channel. Use one of PRS_CH_CTRL_SOURCESEL_x defines. * * @param[in] signal * Signal (for selected @p source) to use. Use one of PRS_CH_CTRL_SIGSEL_x * defines. * * @param[in] edge * Edge (for selected source/signal) to generate pulse for. ******************************************************************************/ void PRS_SourceSignalSet(unsigned int ch, uint32_t source, uint32_t signal, PRS_Edge_TypeDef edge) { EFM_ASSERT(ch < PRS_CHAN_COUNT); PRS->CH[ch].CTRL = (source & _PRS_CH_CTRL_SOURCESEL_MASK) | (signal & _PRS_CH_CTRL_SIGSEL_MASK) | (uint32_t)edge; } #if defined( PRS_CH_CTRL_ASYNC ) /***************************************************************************//** * @brief * Set source and asynchronous signal to be used for a channel. * * @details * Asynchronous reflexes are not clocked on HFPERCLK, and can be used even in * EM2/EM3. * There is a limitation to reflexes operating in asynchronous mode: they can * only be used by a subset of the reflex consumers. Please refer to PRS * chapter in the reference manual for the complete list of supported * asynchronous signals and consumers. * * @note * This function is not supported on EFM32GxxxFyyy parts. * In asynchronous mode, the edge detector only works in EM0, hence it shall * not be used. The EDSEL parameter in PRS_CHx_CTRL register is set to 0 (OFF) * by default. * * @param[in] ch * Channel to define source and asynchronous signal for. * * @param[in] source * Source to select for channel. Use one of PRS_CH_CTRL_SOURCESEL_x defines. * * @param[in] signal * Asynchronous signal (for selected @p source) to use. Use one of the * PRS_CH_CTRL_SIGSEL_x defines that support asynchronous operation. ******************************************************************************/ void PRS_SourceAsyncSignalSet(unsigned int ch, uint32_t source, uint32_t signal) { EFM_ASSERT(ch < PRS_CHAN_COUNT); PRS->CH[ch].CTRL = PRS_CH_CTRL_ASYNC | (source & _PRS_CH_CTRL_SOURCESEL_MASK) | (signal & _PRS_CH_CTRL_SIGSEL_MASK) | PRS_CH_CTRL_EDSEL_OFF; } #endif /** @} (end addtogroup PRS) */ /** @} (end addtogroup emlib) */ #endif /* defined(PRS_COUNT) && (PRS_COUNT > 0) */
// // MPAdWebViewAgent.h // MoPub // // Copyright (c) 2013 MoPub. All rights reserved. // #import <Foundation/Foundation.h> #import "MPAdDestinationDisplayAgent.h" enum { MPAdWebViewEventAdDidAppear = 0, MPAdWebViewEventAdDidDisappear = 1 }; typedef NSUInteger MPAdWebViewEvent; @protocol MPAdWebViewAgentDelegate; @class MPAdConfiguration; @class MPAdWebView; @class CLLocation; @interface MPAdWebViewAgent : NSObject <UIWebViewDelegate, MPAdDestinationDisplayAgentDelegate> @property (nonatomic, weak) id customMethodDelegate; @property (nonatomic, strong) MPAdWebView *view; @property (nonatomic, weak) id<MPAdWebViewAgentDelegate> delegate; - (id)initWithAdWebViewFrame:(CGRect)frame delegate:(id<MPAdWebViewAgentDelegate>)delegate customMethodDelegate:(id)customMethodDelegate; - (void)loadConfiguration:(MPAdConfiguration *)configuration; - (void)rotateToOrientation:(UIInterfaceOrientation)orientation; - (void)invokeJavaScriptForEvent:(MPAdWebViewEvent)event; - (void)forceRedraw; - (void)enableRequestHandling; - (void)disableRequestHandling; @end @class MPAdWebView; @protocol MPAdWebViewAgentDelegate <NSObject> - (NSString *)adUnitId; - (CLLocation *)location; - (UIViewController *)viewControllerForPresentingModalView; - (void)adDidClose:(MPAdWebView *)ad; - (void)adDidFinishLoadingAd:(MPAdWebView *)ad; - (void)adDidFailToLoadAd:(MPAdWebView *)ad; - (void)adActionWillBegin:(MPAdWebView *)ad; - (void)adActionWillLeaveApplication:(MPAdWebView *)ad; - (void)adActionDidFinish:(MPAdWebView *)ad; @end
// // NSDataDetector+TFEasyCoder.h // TFEasyCoder // // Created by ztf on 16/10/26. // Copyright © 2016年 ztf. All rights reserved. // #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "TFEasyCoderConst.h" typedef void(^NSDataDetectorEasyCoderBlock) (NSDataDetector * ins); @interface NSDataDetector (TFEasyCoder) +( NSDataDetector *)easyCoder:(NSDataDetectorEasyCoderBlock)block; -(NSDataDetector *)easyCoder:(NSDataDetectorEasyCoderBlock)block; //superclass pros NSRegularExpression //superclass pros NSObject -(NSDataDetector *(^)(NSArray * accessibilityElements))set_accessibilityElements; -(NSDataDetector *(^)(NSArray * accessibilityCustomActions))set_accessibilityCustomActions; -(NSDataDetector *(^)(BOOL isAccessibilityElement))set_isAccessibilityElement; -(NSDataDetector *(^)(NSString * accessibilityLabel))set_accessibilityLabel; -(NSDataDetector *(^)(NSString * accessibilityHint))set_accessibilityHint; -(NSDataDetector *(^)(NSString * accessibilityValue))set_accessibilityValue; -(NSDataDetector *(^)(unsigned long long accessibilityTraits))set_accessibilityTraits; -(NSDataDetector *(^)(UIBezierPath * accessibilityPath))set_accessibilityPath; -(NSDataDetector *(^)(CGPoint accessibilityActivationPoint))set_accessibilityActivationPoint; -(NSDataDetector *(^)(NSString * accessibilityLanguage))set_accessibilityLanguage; -(NSDataDetector *(^)(BOOL accessibilityElementsHidden))set_accessibilityElementsHidden; -(NSDataDetector *(^)(BOOL accessibilityViewIsModal))set_accessibilityViewIsModal; -(NSDataDetector *(^)(BOOL shouldGroupAccessibilityChildren))set_shouldGroupAccessibilityChildren; -(NSDataDetector *(^)(long long accessibilityNavigationStyle))set_accessibilityNavigationStyle; -(NSDataDetector *(^)(id value,NSString *key))set_ValueKey; @end
/**************************************************************************//** * @file efm32lg_usb_diep.h * @brief EFM32LG_USB_DIEP register and bit field definitions * @version 5.0.0 ****************************************************************************** * @section License * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b> ****************************************************************************** * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software.@n * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software.@n * 3. This notice may not be removed or altered from any source distribution. * * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc. * has no obligation to support this Software. Silicon Laboratories, Inc. is * providing the Software "AS IS", with no express or implied warranties of any * kind, including, but not limited to, any implied warranties of * merchantability or fitness for any particular purpose or warranties against * infringement of any proprietary rights of a third party. * * Silicon Laboratories, Inc. will not be liable for any consequential, * incidental, or special damages, or any other relief, or for any claim by * any third party, arising from your use of this Software. * *****************************************************************************/ /**************************************************************************//** * @addtogroup Parts * @{ ******************************************************************************/ /**************************************************************************//** * @brief USB_DIEP EFM32LG USB DIEP *****************************************************************************/ typedef struct { __IOM uint32_t CTL; /**< Device IN Endpoint x+1 Control Register */ uint32_t RESERVED0[1]; /**< Reserved for future use **/ __IOM uint32_t INT; /**< Device IN Endpoint x+1 Interrupt Register */ uint32_t RESERVED1[1]; /**< Reserved for future use **/ __IOM uint32_t TSIZ; /**< Device IN Endpoint x+1 Transfer Size Register */ __IOM uint32_t DMAADDR; /**< Device IN Endpoint x+1 DMA Address Register */ __IM uint32_t TXFSTS; /**< Device IN Endpoint x+1 Transmit FIFO Status Register */ uint32_t RESERVED2[1]; /**< Reserved future */ } USB_DIEP_TypeDef; /** @} End of group Parts */
/* * * Copyright 2018 gRPC authors. * * 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 GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_UTIL_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_UTIL_H #include <grpc/support/port_platform.h> #include "third_party/nanopb/pb_decode.h" #include "third_party/nanopb/pb_encode.h" #include <grpc/slice.h> #include <grpc/slice_buffer.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include "src/core/tsi/alts/handshaker/handshaker.pb.h" /** * An implementation of utility functions used to serialize/ * de-serialize ALTS handshake requests/responses. All APIs in the header * are thread-compatible. */ /* Renaming of message/field structs generated by nanopb compiler. */ typedef grpc_gcp_HandshakeProtocol grpc_gcp_handshake_protocol; typedef grpc_gcp_NetworkProtocol grpc_gcp_network_protocol; typedef grpc_gcp_Identity grpc_gcp_identity; typedef grpc_gcp_NextHandshakeMessageReq grpc_gcp_next_handshake_message_req; typedef grpc_gcp_ServerHandshakeParameters grpc_gcp_server_handshake_parameters; typedef grpc_gcp_Endpoint grpc_gcp_endpoint; typedef grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry grpc_gcp_handshake_parameters_entry; typedef grpc_gcp_StartClientHandshakeReq grpc_gcp_start_client_handshake_req; typedef grpc_gcp_StartServerHandshakeReq grpc_gcp_start_server_handshake_req; typedef grpc_gcp_HandshakerReq grpc_gcp_handshaker_req; typedef grpc_gcp_HandshakerResult grpc_gcp_handshaker_result; typedef grpc_gcp_HandshakerStatus grpc_gcp_handshaker_status; typedef grpc_gcp_HandshakerResp grpc_gcp_handshaker_resp; typedef enum { CLIENT_START_REQ = 0, /* StartClientHandshakeReq. */ SERVER_START_REQ = 1, /* StartServerHandshakeReq. */ NEXT_REQ = 2, /* NextHandshakeMessageReq. */ } grpc_gcp_handshaker_req_type; /** * A struct representing a repeated field. The struct is used to organize all * instances of a specific repeated field into a linked list, which then will * be used at encode/decode phase. For instance at the encode phase, the encode * function will iterate through the list, encode each field, and then output * the result to the stream. */ typedef struct repeated_field_ { struct repeated_field_* next; const void* data; } repeated_field; /** * This method adds a repeated field to the head of repeated field list. * * - head: a head of repeated field list. * - field: a repeated field to be added to the list. */ void add_repeated_field(repeated_field** head, const void* field); /** * This method destroys a repeated field list that consists of string type * fields. * * - head: a head of repeated field list. */ void destroy_repeated_field_list_string(repeated_field* head); /** * This method destroys a repeated field list that consists of * grpc_gcp_identity type fields. * * - head: a head of repeated field list. */ void destroy_repeated_field_list_identity(repeated_field* head); /** * This method creates a grpc_slice instance by copying a data buffer. It is * similar to grpc_slice_from_copied_buffer() except that it returns an instance * allocated from the heap. * * - data: a data buffer to be copied to grpc_slice instance. * - size: size of data buffer. */ grpc_slice* create_slice(const char* data, size_t size); /* This method destroys a grpc_slice instance. */ void destroy_slice(grpc_slice* slice); /** * The following encode/decode functions will be assigned to encode/decode * function pointers of pb_callback_t struct (defined in * //third_party/nanopb/pb.h), that represent a repeated field with a dynamic * length (e.g., a string type or repeated field). */ /* This method is an encode callback function for a string or byte array. */ bool encode_string_or_bytes_cb(pb_ostream_t* stream, const pb_field_t* field, void* const* arg); /** * This method is an encode callback function for a repeated grpc_gcp_identity * field. */ bool encode_repeated_identity_cb(pb_ostream_t* stream, const pb_field_t* field, void* const* arg); /* This method is an encode callback function for a repeated string field. */ bool encode_repeated_string_cb(pb_ostream_t* stream, const pb_field_t* field, void* const* arg); /** * This method is a decode callback function for a string or byte array field. */ bool decode_string_or_bytes_cb(pb_istream_t* stream, const pb_field_t* field, void** arg); /** * This method is a decode callback function for a repeated grpc_gcp_identity * field. */ bool decode_repeated_identity_cb(pb_istream_t* stream, const pb_field_t* field, void** arg); /* This method is a decode callback function for a repeated string field. */ bool decode_repeated_string_cb(pb_istream_t* stream, const pb_field_t* field, void** arg); #endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_UTIL_H */
/**************************************************************************//** * @file efm32lg_calibrate.h * @brief EFM32LG_CALIBRATE register and bit field definitions * @version 5.0.0 ****************************************************************************** * @section License * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b> ****************************************************************************** * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software.@n * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software.@n * 3. This notice may not be removed or altered from any source distribution. * * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Laboratories, Inc. * has no obligation to support this Software. Silicon Laboratories, Inc. is * providing the Software "AS IS", with no express or implied warranties of any * kind, including, but not limited to, any implied warranties of * merchantability or fitness for any particular purpose or warranties against * infringement of any proprietary rights of a third party. * * Silicon Laboratories, Inc. will not be liable for any consequential, * incidental, or special damages, or any other relief, or for any claim by * any third party, arising from your use of this Software. * *****************************************************************************/ /**************************************************************************//** * @addtogroup Parts * @{ ******************************************************************************/ /**************************************************************************//** * @defgroup EFM32LG_CALIBRATE * @{ *****************************************************************************/ #define CALIBRATE_MAX_REGISTERS 50 /**< Max number of address/value pairs for calibration */ typedef struct { __IM uint32_t ADDRESS; /**< Address of calibration register */ __IM uint32_t VALUE; /**< Default value for calibration register */ } CALIBRATE_TypeDef; /** @} */ /** @} End of group Parts */
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_ #include <stdint.h> #include <map> #include <memory> #include <string> #include <vector> #include "base/files/file.h" #include "base/macros.h" #include "base/observer_list.h" #include "dbus/object_path.h" #include "device/bluetooth/bluetooth_export.h" #include "device/bluetooth/dbus/bluetooth_media_transport_client.h" namespace bluez { class FakeBluetoothMediaEndpointServiceProvider; class DEVICE_BLUETOOTH_EXPORT FakeBluetoothMediaTransportClient : public BluetoothMediaTransportClient { public: struct Properties : public BluetoothMediaTransportClient::Properties { explicit Properties(const PropertyChangedCallback& callback); ~Properties() override; void Get(dbus::PropertyBase* property, dbus::PropertySet::GetCallback callback) override; void GetAll() override; void Set(dbus::PropertyBase* property, dbus::PropertySet::SetCallback callback) override; }; // The default path of the transport object. static const char kTransportPath[]; // The default properties including device, codec, configuration, state, delay // and volume, owned by a fake media transport object we emulate. static const char kTransportDevicePath[]; static const uint8_t kTransportCodec; static const uint8_t kTransportConfiguration[]; static const uint8_t kTransportConfigurationLength; static const uint16_t kTransportDelay; static const uint16_t kTransportVolume; // The default MTUs for read and write. static const uint16_t kDefaultReadMtu; static const uint16_t kDefaultWriteMtu; FakeBluetoothMediaTransportClient(); ~FakeBluetoothMediaTransportClient() override; // DBusClient override. void Init(dbus::Bus* bus) override; // BluetoothMediaTransportClient override. void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; Properties* GetProperties(const dbus::ObjectPath& object_path) override; void Acquire(const dbus::ObjectPath& object_path, const AcquireCallback& callback, const ErrorCallback& error_callback) override; void TryAcquire(const dbus::ObjectPath& object_path, const AcquireCallback& callback, const ErrorCallback& error_callback) override; void Release(const dbus::ObjectPath& object_path, const base::Closure& callback, const ErrorCallback& error_callback) override; // Makes the transport valid/invalid for a given media endpoint. The transport // object is assigned to the given endpoint if valid is true, false // otherwise. void SetValid(FakeBluetoothMediaEndpointServiceProvider* endpoint, bool valid); // Set state/volume property to a certain value. void SetState(const dbus::ObjectPath& endpoint_path, const std::string& state); void SetVolume(const dbus::ObjectPath& endpoint_path, const uint16_t& volume); // Writes bytes to the input file descriptor, |input_fd|, associated with a // transport object which is bound to |endpoint_path|. void WriteData(const dbus::ObjectPath& endpoint_path, const std::vector<char>& bytes); // Retrieves the transport object path bound to |endpoint_path|. dbus::ObjectPath GetTransportPath(const dbus::ObjectPath& endpoint_path); private: // This class is used for simulating the scenario where each media endpoint // has a corresponding transport path and properties. Once an endpoint is // assigned with a transport path, an object of Transport is created. struct Transport { Transport(const dbus::ObjectPath& transport_path, std::unique_ptr<Properties> transport_properties); ~Transport(); // An unique transport path. dbus::ObjectPath path; // The property set bound with |path|. std::unique_ptr<Properties> properties; // This is the internal end of socketpair created for simulation purposes. // |input_fd| will be initialized when Acquire/TryAcquire is called. std::unique_ptr<base::File> input_fd; }; // Property callback passed while a Properties structure is created. void OnPropertyChanged(const std::string& property_name); // Gets the endpoint path associated with the given transport_path. dbus::ObjectPath GetEndpointPath(const dbus::ObjectPath& transport_path); // Retrieves the transport structure bound to |endpoint_path|. Transport* GetTransport(const dbus::ObjectPath& endpoint_path); // Retrieves the transport structure with |transport_path|. Transport* GetTransportByPath(const dbus::ObjectPath& transport_path); // Helper function used by Acquire and TryAcquire to set up the sockpair and // invoke callback/error_callback. void AcquireInternal(bool try_flag, const dbus::ObjectPath& object_path, const AcquireCallback& callback, const ErrorCallback& error_callback); // Map of endpoints with valid transport. Each pair is composed of an endpoint // path and a Transport structure containing a transport path and its // properties. std::map<dbus::ObjectPath, std::unique_ptr<Transport>> endpoint_to_transport_map_; // Map of valid transports. Each pair is composed of a transport path as the // key and an endpoint path as the value. This map is used to get the // corresponding endpoint path when GetProperties() is called. std::map<dbus::ObjectPath, dbus::ObjectPath> transport_to_endpoint_map_; base::ObserverList<BluetoothMediaTransportClient::Observer> observers_; DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaTransportClient); }; } // namespace bluez #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_
// // Copyright (C) 2003-2016 Sereina Riniker, Paolo Tosco // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #include <RDGeneral/export.h> #ifndef RD_TRAJECTORY_H #define RD_TRAJECTORY_H #include <vector> #include "Snapshot.h" namespace RDKit { class ROMol; class RDKIT_TRAJECTORY_EXPORT Trajectory { public: /*! \brief Constructor \param dimension represents the dimensionality of this Trajectory's coordinate tuples; this is normally 2 (2D coordinates) or 3 (3D coordinates) \param numPoints is the number of coordinate tuples associated to each Snapshot \param snapshotVect (optional, defaults to NULL) is a pointer to a SnapshotVect used to initialize the Trajectory; if not NULL, the Trajectory takes ownership of the SnapshotVect */ Trajectory(unsigned int dimension, unsigned int numPoints, SnapshotVect *snapshotVect = nullptr); /*! \brief Copy constructor */ Trajectory(const Trajectory &other); /*! \return the dimensionality of this Trajectory's coordinate tuples */ unsigned int dimension() const { return d_dimension; } /*! \return the number of coordinate tuples associated to each Snapshot */ unsigned int numPoints() const { return d_numPoints; } /*! \return the number of Snapshots associated to this Trajectory */ size_t size() const { return d_snapshotVect->size(); } /*! \brief Appends a Snapshot to this Trajectory \param s is the Snapshot to be added; the Trajectory takes ownership of the snapshot coordinates \return the zero-based index position of the added Snapshot */ unsigned int addSnapshot(const Snapshot &s); /*! \param snapshotNum is the zero-based index of the retrieved Snapshot \return a const reference to the relevant Snapshot in the Trajectory */ const Snapshot &getSnapshot(unsigned int snapshotNum) const; /*! \brief Inserts a Snapshot into this Trajectory \param snapshotNum is the zero-based index of the Trajectory's Snapshot before which the Snapshot s will be inserted \param s is the Snapshot to be inserted; the Trajectory takes ownership of the snapshot coordinates \return the zero-based index position of the inserted Snapshot */ unsigned int insertSnapshot(unsigned int snapshotNum, Snapshot s); /*! \brief Removes a Snapshot from this Trajectory \param snapshotNum is the zero-based index of Snapshot to be removed \return the zero-based index position of the Snapshot after the removed one; if the last Snapshot was removed, it returns the size of the trajectory */ unsigned int removeSnapshot(unsigned int snapshotNum); //! Clear all Snapshots from a Trajectory void clear() { d_snapshotVect->clear(); } //! Add conformations from the Trajectory to a molecule /*! \param mol - ROMol to which Conformers with coordinates from the Trajectory will be added; the Trajectory must have numPoints() == mol.getNumAtoms() \param from - the first Snapshot that will be added as a Conformer; defaults to -1 (first available) \param to - the last Snapshot that will be added as a Conformer; defaults to -1 (all) \return the number of conformations added */ unsigned int addConformersToMol(ROMol &mol, int from = -1, int to = -1); private: // dimensionality of this Trajectory's coordinates; // this is normally 2 (2D coordinates) or 3 (3D coordinates) const unsigned int d_dimension; // number of coordinate tuples associated to each Snapshot const unsigned int d_numPoints; // smart_ptr to vector holding the Snapshots for this Trajectory boost::shared_ptr<SnapshotVect> d_snapshotVect; }; /*! \brief Reads coordinates from an AMBER trajectory file into the traj Trajectory object \return the number of Snapshot objects read in */ RDKIT_TRAJECTORY_EXPORT unsigned int readAmberTrajectory( const std::string &fName, Trajectory &traj); /*! \brief Reads coordinates from a GROMOS trajectory file into the traj Trajectory object \return the number of Snapshot objects read in */ RDKIT_TRAJECTORY_EXPORT unsigned int readGromosTrajectory( const std::string &fName, Trajectory &traj); } // namespace RDKit #endif
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ #pragma once #if defined(STM32PLUS_F4) // device base include #include "config/usb/device/device.h" // HID device includes #include "usb/device/hid/HidClassRequestType.h" #include "usb/device/hid/HidClassDescriptor.h" #include "usb/device/hid/HidSubClass.h" #include "usb/device/hid/HidProtocol.h" #include "usb/device/hid/events/HidKeyboardLedStateEvent.h" #include "usb/device/hid/HidDevice.h" #include "usb/device/hid/MouseReportDescriptor.h" #include "usb/device/hid/KeyboardReportDescriptor.h" #include "usb/device/hid/MouseHidDevice.h" #include "usb/device/hid/KeyboardHidDevice.h" #endif
/* * Driver for 12-bit DAC MCP4725 * * Part of esp-open-rtos * Copyright (C) 2016 Ruslan V. Uss <unclerus@gmail.com> * BSD Licensed as described in the file LICENSE */ #ifndef _EXTRAS_MCP4725_H_ #define _EXTRAS_MCP4725_H_ #include <stdint.h> #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif #define MCP4725A0_ADDR0 0x60 #define MCP4725A0_ADDR1 0x61 #define MCP4725A1_ADDR0 0x62 #define MCP4725A1_ADDR1 0x63 #define MCP4725A2_ADDR0 0x64 #define MCP4725A2_ADDR1 0x65 #define MCP4725_MAX_VALUE 0x0fff /** * Power mode, see datasheet */ typedef enum { MCP4725_PM_NORMAL = 0, //!< Normal mode MCP4725_PM_PD_1K, //!< Power down, 1kOhm resistor to ground MCP4725_PM_PD_100K, //!< Power down, 100kOhm resistor to ground MCP4725_PM_PD_500K, //!< Power down, 500kOhm resistor to ground } mcp4725_power_mode_t; /** * Get device EEPROM status * @param addr Device address * @return true when EEPROM is busy */ bool mcp4725_eeprom_busy(uint8_t addr); /** * Get power mode * @param addr Device address * @param eeprom Read power mode from EEPROM if true * @return Power mode */ mcp4725_power_mode_t mcp4725_get_power_mode(uint8_t addr, bool eeprom); /** * Set power mode * @param addr Device address * @param mode Power mode * @param eeprom Store mode to device EEPROM if true */ void mcp4725_set_power_mode(uint8_t addr, mcp4725_power_mode_t mode, bool eeprom); /** * Get current DAC value * @param addr Device address * @param eeprom Read value from device EEPROM if true * @return Raw output value, 0..4095 */ uint16_t mcp4725_get_raw_output(uint8_t addr, bool eeprom); /** * Set DAC output value * @param addr Device address * @param value Raw output value, 0..4095 * @param eeprom Store value to device EEPROM if true */ void mcp4725_set_raw_output(uint8_t addr, uint16_t value, bool eeprom); /** * Get current DAC output voltage * @param addr Device address * @param vdd Device operating voltage, volts * @param eeprom Read voltage from device EEPROM if true * @return Current output voltage, volts */ inline float mcp4725_get_voltage(uint8_t addr, float vdd, bool eeprom) { return vdd / MCP4725_MAX_VALUE * mcp4725_get_raw_output(addr, eeprom); } /** * Set DAC output voltage * @param addr Device address * @param vdd Device operating voltage, volts * @param value Output value, volts * @param eeprom Store value to device EEPROM if true */ inline void mcp4725_set_voltage(uint8_t addr, float vdd, float value, bool eeprom) { mcp4725_set_raw_output(addr, MCP4725_MAX_VALUE / vdd * value, eeprom); } #ifdef __cplusplus } #endif #endif /* _EXTRAS_MCP4725_H_ */
/* * cblas_ctbmv.c * The program is a C interface to ctbmv. * * Keita Teranishi 5/20/98 * */ #include "cblas.h" #include "cblas_f77.h" void cblas_ctbmv(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE TransA, const CBLAS_DIAG Diag, const int N, const int K, const void *A, const int lda, void *X, const int incX) { char TA; char UL; char DI; #ifdef F77_CHAR F77_CHAR F77_TA, F77_UL, F77_DI; #else #define F77_TA &TA #define F77_UL &UL #define F77_DI &DI #endif #ifdef F77_INT F77_INT F77_N=N, F77_lda=lda, F77_K=K, F77_incX=incX; #else #define F77_N N #define F77_K K #define F77_lda lda #define F77_incX incX #endif int n, i=0, tincX; float *st=0, *x=(float *)X; extern int CBLAS_CallFromC; extern int RowMajorStrg; RowMajorStrg = 0; CBLAS_CallFromC = 1; if (layout == CblasColMajor) { if (Uplo == CblasUpper) UL = 'U'; else if (Uplo == CblasLower) UL = 'L'; else { cblas_xerbla(2, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if (TransA == CblasNoTrans) TA = 'N'; else if (TransA == CblasTrans) TA = 'T'; else if (TransA == CblasConjTrans) TA = 'C'; else { cblas_xerbla(3, "cblas_ctbmv","Illegal TransA setting, %d\n", TransA); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if (Diag == CblasUnit) DI = 'U'; else if (Diag == CblasNonUnit) DI = 'N'; else { cblas_xerbla(4, "cblas_ctbmv","Illegal Diag setting, %d\n", Diag); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } #ifdef F77_CHAR F77_UL = C2F_CHAR(&UL); F77_TA = C2F_CHAR(&TA); F77_DI = C2F_CHAR(&DI); #endif F77_ctbmv( F77_UL, F77_TA, F77_DI, &F77_N, &F77_K, A, &F77_lda, X, &F77_incX); } else if (layout == CblasRowMajor) { RowMajorStrg = 1; if (Uplo == CblasUpper) UL = 'L'; else if (Uplo == CblasLower) UL = 'U'; else { cblas_xerbla(2, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if (TransA == CblasNoTrans) TA = 'T'; else if (TransA == CblasTrans) TA = 'N'; else if (TransA == CblasConjTrans) { TA = 'N'; if ( N > 0) { if(incX > 0) tincX = incX; else tincX = -incX; i = tincX << 1; n = i * N; x++; st = x + n; do { *x = -(*x); x+= i; } while (x != st); x -= n; } } else { cblas_xerbla(3, "cblas_ctbmv","Illegal TransA setting, %d\n", TransA); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if (Diag == CblasUnit) DI = 'U'; else if (Diag == CblasNonUnit) DI = 'N'; else { cblas_xerbla(4, "cblas_ctbmv","Illegal Uplo setting, %d\n", Uplo); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } #ifdef F77_CHAR F77_UL = C2F_CHAR(&UL); F77_TA = C2F_CHAR(&TA); F77_DI = C2F_CHAR(&DI); #endif F77_ctbmv( F77_UL, F77_TA, F77_DI, &F77_N, &F77_K, A, &F77_lda, X, &F77_incX); if (TransA == CblasConjTrans) { if (N > 0) { do { *x = -(*x); x += i; } while (x != st); } } } else cblas_xerbla(1, "cblas_ctbmv", "Illegal layout setting, %d\n", layout); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; }
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_OMNIBOX_BROWSER_VOICE_SUGGEST_PROVIDER_H_ #define COMPONENTS_OMNIBOX_BROWSER_VOICE_SUGGEST_PROVIDER_H_ #include <memory> #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/omnibox/browser/autocomplete_input.h" #include "components/omnibox/browser/autocomplete_provider_client.h" #include "components/omnibox/browser/autocomplete_provider_listener.h" #include "components/omnibox/browser/base_search_provider.h" #include "third_party/metrics_proto/omnibox_event.pb.h" // Autocomplete provider serving Voice suggestions on Android. class VoiceSuggestProvider : public BaseSearchProvider { public: VoiceSuggestProvider(AutocompleteProviderClient* client, AutocompleteProviderListener* listener); void Start(const AutocompleteInput& input, bool minimal_changes) override; void Stop(bool clear_cached_results, bool due_to_user_inactivity) override; // Adds voice suggestion to the list of reported AutocompleteMatches. // The voice suggestion is next converted to a proper Search suggestion // associated with user-selected search engine, with a relevance score // computed from the match_score. void AddVoiceSuggestion(std::u16string match_text, float match_score); // Clear all cached voice matches. void ClearCache(); private: // BaseSearchProvider: ~VoiceSuggestProvider() override; const TemplateURL* GetTemplateURL(bool is_keyword) const override; const AutocompleteInput GetInput(bool is_keyword) const override; bool ShouldAppendExtraParams( const SearchSuggestionParser::SuggestResult& result) const override; void RecordDeletionResult(bool success) override; // A list of voice matches and their confidence scores. The first element // indicates how confident the voice recognition system is about the accuracy // of the match, whereas the second element of the pair holds the match text // itself. // Multiple matches may hold the same confidence score and/or match text - // the score will next be used to filter out low-quality matches, and compute // the relevance score for matches. // Duplicate voice matches will be deduplicated automatically to the higher // ranked match. std::vector<std::pair<float, std::u16string>> voice_matches_; // A pointer to the current AutocompleteInput, retained during the active // stage of operation only. Used by the BaseSearchProvider to construct the // final AutocompleteMatch objects. raw_ptr<const AutocompleteInput> autocomplete_input_{}; }; #endif // COMPONENTS_OMNIBOX_BROWSER_VOICE_SUGGEST_PROVIDER_H_
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SERVICES_SHAPE_DETECTION_BARCODE_DETECTION_PROVIDER_MAC_H_ #define SERVICES_SHAPE_DETECTION_BARCODE_DETECTION_PROVIDER_MAC_H_ #include <memory> #include <vector> #include "mojo/public/cpp/bindings/pending_receiver.h" #include "services/shape_detection/barcode_detection_impl_mac_vision_api.h" #include "services/shape_detection/public/mojom/barcodedetection.mojom.h" #include "services/shape_detection/public/mojom/barcodedetection_provider.mojom.h" class VisionAPIInterface; namespace shape_detection { // The BarcodeDetectionProviderMac class is a provider that binds an // implementation of mojom::BarcodeDetection with Core Image or Vision // Framework. class BarcodeDetectionProviderMac : public shape_detection::mojom::BarcodeDetectionProvider { public: BarcodeDetectionProviderMac(); explicit BarcodeDetectionProviderMac(std::unique_ptr<VisionAPIInterface>); BarcodeDetectionProviderMac(const BarcodeDetectionProviderMac&) = delete; BarcodeDetectionProviderMac& operator=(const BarcodeDetectionProviderMac&) = delete; ~BarcodeDetectionProviderMac() override; // Binds BarcodeDetection provider receiver to the implementation of // mojom::BarcodeDetectionProvider. static void Create( mojo::PendingReceiver<mojom::BarcodeDetectionProvider> receiver); void CreateBarcodeDetection( mojo::PendingReceiver<mojom::BarcodeDetection> receiver, mojom::BarcodeDetectorOptionsPtr options) override; void EnumerateSupportedFormats( EnumerateSupportedFormatsCallback callback) override; absl::optional<std::vector<mojom::BarcodeFormat>> supported_formats_; std::unique_ptr<VisionAPIInterface> vision_api_; }; } // namespace shape_detection #endif // SERVICES_SHAPE_DETECTION_BARCODE_DETECTION_PROVIDER_MAC_H_
// This file comes from the original BCD implementation, // with minor changes to remove dependencies, unused code // and re-formatting. Original license follows: // This file is part of the reference implementation for the paper // Bayesian Collaborative Denoising for Monte-Carlo Rendering // Malik Boughida and Tamy Boubekeur. // Computer Graphics Forum (Proc. EGSR 2017), vol. 36, no. 4, p. 137-153, 2017 // // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE.txt file. #ifndef COVARIANCE_MATRIX_H #define COVARIANCE_MATRIX_H // Standard headers. #include <array> #include <vector> namespace bcd { enum class ESymmetricMatrix3x3Data { e_xx, e_yy, e_zz, e_yz, e_xz, e_xy, e_nb }; typedef ESymmetricMatrix3x3Data ESymMatData; // Class to represent a 3x3 symmetric matrix struct SymmetricMatrix3x3 { SymmetricMatrix3x3() {} SymmetricMatrix3x3& operator+=(const SymmetricMatrix3x3& i_rSymMat); SymmetricMatrix3x3& operator*=(float i_factor); void copyFrom(const float* i_pData); typedef std::array<float, static_cast<std::size_t>(ESymMatData::e_nb)>::const_iterator const_iterator; std::array<float, static_cast<std::size_t>(ESymMatData::e_nb)> m_data; }; typedef SymmetricMatrix3x3 CovMat3x3; // Class to represent a symmetric block-diagonal matrix, with blocks of size 3x3 struct Block3x3DiagonalSymmetricMatrix { Block3x3DiagonalSymmetricMatrix() { } explicit Block3x3DiagonalSymmetricMatrix(std::size_t i_size) : m_blocks(i_size) { } Block3x3DiagonalSymmetricMatrix& operator+=(const Block3x3DiagonalSymmetricMatrix& i_rMat); Block3x3DiagonalSymmetricMatrix& operator*=(float i_factor); typedef std::vector<SymmetricMatrix3x3>::const_iterator const_iterator; std::vector<SymmetricMatrix3x3> m_blocks; }; typedef Block3x3DiagonalSymmetricMatrix CovMatPatch; } // namespace bcd #endif // COVARIANCE_MATRIX_H
#ifndef __COMPATIBLECLASSES_H__ #define __COMPATIBLECLASSES_H__ #include "cocos2d.h" #include "../../BaseClasses/UIWidget.h" #include "../UIButton.h" #include "../UICheckBox.h" #include "../UIImageView.h" #include "../UILabel.h" #include "../UILabelAtlas.h" #include "../UILabelBMFont.h" #include "../UILoadingBar.h" #include "../UISlider.h" #include "../UITextField.h" #include "../../Layouts/UILayout.h" #include "../ScrollWidget/UIListView.h" #include "../ScrollWidget/UIPageView.h" #include "../ScrollWidget/UIScrollView.h" //class type define NS_CC_BEGIN // namespace ui { typedef cocos2d::ui::Layout UIPanel; typedef cocos2d::ui::Layout UILayout; typedef cocos2d::ui::Widget UIWidget; typedef cocos2d::ui::LayoutParameter UILayoutParameter; typedef cocos2d::ui::Margin UIMargin; typedef cocos2d::ui::ListView UIListView; typedef cocos2d::ui::PageView UIPageView; typedef cocos2d::ui::ScrollView UIDragPanel; typedef cocos2d::ui::ScrollView UIScrollView; typedef cocos2d::ui::Button UIButton; typedef cocos2d::ui::Button UITextButton; typedef cocos2d::ui::CheckBox UICheckBox; typedef cocos2d::ui::ImageView UIImageView; typedef cocos2d::ui::Label UILabel; typedef cocos2d::ui::LabelAtlas UILabelAtlas; typedef cocos2d::ui::LabelBMFont UILabelBMFont; typedef cocos2d::ui::LoadingBar UILoadingBar; typedef cocos2d::ui::Slider UISlider; typedef cocos2d::ui::TextField UITextField; typedef cocos2d::ui::TouchGroup UILayer; typedef cocos2d::ui::LinearGravity UILinearGravity; typedef cocos2d::ui::RelativeAlign UIRelativeAlign; typedef cocos2d::ui::LayoutParameter UILayoutParameter; typedef cocos2d::ui::LinearLayoutParameter UILinearLayoutParameter; typedef cocos2d::ui::RelativeLayoutParameter UIRelativeLayoutParameter; } NS_CC_END #endif /* defined(__CompatibleClasses__) */
/* Copyright (c) 2009 Christopher J. W. Lloyd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <AppKit/NSView.h> #import <AppKit/NSCollectionViewItem.h> @interface NSCollectionView : NSView { NSArray *_content; NSCollectionViewItem *_itemPrototype; BOOL _isSelectable; NSSize _minItemSize; NSSize _maxItemSize; NSUInteger _maxNumberOfRows; NSUInteger _maxNumberOfColumns; NSArray *_backgroundColors; BOOL _allowsMultipleSelection; NSIndexSet *_selectionIndexes; } -(NSArray *)content; -(NSCollectionViewItem *)itemPrototype; -(BOOL)isSelectable; -(NSSize)minItemSize; -(NSSize)maxItemSize; -(NSUInteger)maxNumberOfRows; -(NSUInteger)maxNumberOfColumns; -(NSArray *)backgroundColors; -(BOOL)allowsMultipleSelection; -(NSIndexSet *)selectionIndexes; -(void)setContent:(NSArray *)value; -(void)setItemPrototype:(NSCollectionViewItem *)value; -(void)setSelectable:(BOOL)value; -(void)setMinItemSize:(NSSize)value; -(void)setMaxItemSize:(NSSize)value; -(void)setMaxNumberOfRows:(NSUInteger)value; -(void)setMaxNumberOfColumns:(NSUInteger)value; -(void)setBackgroundColors:(NSArray *)value; -(void)setAllowsMultipleSelection:(BOOL)value; -(void)setSelectionIndexes:(NSIndexSet *)value; -(BOOL)isFirstResponder; -(NSCollectionViewItem *)newItemForRepresentedObject:object; @end
/* * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * 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 PYBUART_H_ #define PYBUART_H_ typedef enum { PYB_UART_0 = 0, PYB_UART_1 = 1, PYB_NUM_UARTS } pyb_uart_id_t; typedef struct _pyb_uart_obj_t pyb_uart_obj_t; extern const mp_obj_type_t pyb_uart_type; void uart_init0(void); uint32_t uart_rx_any(pyb_uart_obj_t *uart_obj); int uart_rx_char(pyb_uart_obj_t *uart_obj); bool uart_tx_char(pyb_uart_obj_t *self, int c); bool uart_tx_strn(pyb_uart_obj_t *uart_obj, const char *str, uint len); void uart_tx_strn_cooked(pyb_uart_obj_t *uart_obj, const char *str, uint len); mp_obj_t uart_callback_new (pyb_uart_obj_t *self, mp_obj_t handler, mp_int_t priority, byte trigger); #endif // PYBUART_H_
/* * Copyright (C) 2011-2014 MediaTek Inc. * * This program is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program. * If not, see <http://www.gnu.org/licenses/>. */ /*! \file \brief Declaration of library functions Any definitions in this file will be shared among GLUE Layer and internal Driver Stack. */ #ifndef _BTM_CORE_H #define _BTM_CORE_H #include "osal_typedef.h" #include "osal.h" #include "stp_wmt.h" #include "wmt_plat.h" #include "wmt_idc.h" /******************************************************************************* * C O M P I L E R F L A G S ******************************************************************************** */ /******************************************************************************* * M A C R O S ******************************************************************************** */ #define STP_BTM_OPERATION_FAIL (-1) #define STP_BTM_OPERATION_SUCCESS (0) #define STP_BTM_OP_BUF_SIZE (64) #define BTM_THREAD_NAME "mtk_stp_btm" #define STP_PAGED_DUMP_TIME_LIMIT 3500 #define STP_FULL_DUMP_TIME 3 /******************************************************************************* * E X T E R N A L R E F E R E N C E S ******************************************************************************** */ /******************************************************************************* * C O N S T A N T S ******************************************************************************** */ /******************************************************************************* * D A T A T Y P E S ******************************************************************************** */ typedef enum _ENUM_STP_BTM_OPID_T { STP_OPID_BTM_RETRY = 0x0, STP_OPID_BTM_RST = 0x1, STP_OPID_BTM_DBG_DUMP = 0x2, STP_OPID_BTM_DUMP_TIMEOUT = 0x3, STP_OPID_BTM_POLL_CPUPCR = 0x4, STP_OPID_BTM_PAGED_DUMP = 0x5, STP_OPID_BTM_FULL_DUMP = 0x6, STP_OPID_BTM_PAGED_TRACE = 0x7, STP_OPID_BTM_FORCE_FW_ASSERT = 0x8, #if CFG_WMT_LTE_COEX_HANDLING STP_OPID_BTM_WMT_LTE_COEX = 0x9, #endif STP_OPID_BTM_EXIT, STP_OPID_BTM_NUM } ENUM_STP_BTM_OPID_T, *P_ENUM_STP_BTM_OPID_T; typedef OSAL_OP_DAT STP_BTM_OP; typedef P_OSAL_OP_DAT P_STP_BTM_OP; typedef struct mtk_stp_btm { OSAL_THREAD BTMd; /* main thread (wmtd) handle */ OSAL_EVENT STPd_event; OSAL_UNSLEEPABLE_LOCK wq_spinlock; OSAL_OP_Q rFreeOpQ; /* free op queue */ OSAL_OP_Q rActiveOpQ; /* active op queue */ OSAL_OP arQue[STP_BTM_OP_BUF_SIZE]; /* real op instances */ /*wmt_notify */ INT32(*wmt_notify) (MTKSTP_BTM_WMT_OP_T); } MTKSTP_BTM_T; /******************************************************************************* * P U B L I C D A T A ******************************************************************************** */ /******************************************************************************* * P R I V A T E D A T A ******************************************************************************** */ /******************************************************************************* * F U N C T I O N D E C L A R A T I O N S ******************************************************************************** */ INT32 stp_btm_notify_wmt_rst_wq(MTKSTP_BTM_T *stp_btm); INT32 stp_btm_notify_stp_retry_wq(MTKSTP_BTM_T *stp_btm); INT32 stp_btm_notify_coredump_timeout_wq(MTKSTP_BTM_T *stp_btm); INT32 stp_btm_notify_wmt_dmp_wq(MTKSTP_BTM_T *stp_btm); INT32 stp_btm_deinit(MTKSTP_BTM_T *stp_btm); INT32 stp_btm_reset_btm_wq(MTKSTP_BTM_T *stp_btm); INT32 stp_notify_btm_poll_cpupcr(MTKSTP_BTM_T *stp_btm, UINT32 times, UINT32 sleep); INT32 stp_notify_btm_poll_cpupcr_ctrl(UINT32 en); INT32 stp_btm_notify_wmt_trace_wq(MTKSTP_BTM_T *stp_btm); INT32 stp_notify_btm_do_fw_assert_via_emi(MTKSTP_BTM_T *stp_btm); INT32 stp_notify_btm_handle_wmt_lte_coex(MTKSTP_BTM_T *stp_btm); INT32 wcn_psm_flag_trigger_collect_ftrace(void); MTKSTP_BTM_T *stp_btm_init(void); /******************************************************************************* * F U N C T I O N S ******************************************************************************** */ #endif
/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once /* A structure for specifying (possibly repetitive) points in calendar * time, a la cron */ #include <stdbool.h> #include "time-util.h" #include "util.h" typedef struct CalendarComponent { int start; int stop; int repeat; struct CalendarComponent *next; } CalendarComponent; typedef struct CalendarSpec { int weekdays_bits; bool end_of_month:1; bool utc:1; signed int dst:2; char *timezone; CalendarComponent *year; CalendarComponent *month; CalendarComponent *day; CalendarComponent *hour; CalendarComponent *minute; CalendarComponent *microsecond; } CalendarSpec; CalendarSpec* calendar_spec_free(CalendarSpec *c); int calendar_spec_normalize(CalendarSpec *spec); bool calendar_spec_valid(CalendarSpec *spec); int calendar_spec_to_string(const CalendarSpec *spec, char **p); int calendar_spec_from_string(const char *p, CalendarSpec **spec); int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *next); DEFINE_TRIVIAL_CLEANUP_FUNC(CalendarSpec*, calendar_spec_free);
/* * This file is part of the coreboot project. * * Copyright (C) 2005 AMD * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD. * * 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 <console/console.h> #include <device/device.h> #include <device/pci.h> #include <device/pnp.h> #include <device/pci_ids.h> #include <device/pci_ops.h> #include <pc80/mc146818rtc.h> #include <pc80/isa-dma.h> #include <arch/io.h> #include <device/smbus.h> #include "bcm5785.h" #include "smbus.h" #define NMI_OFF 0 static void sb_init(device_t dev) { uint8_t byte; uint8_t byte_old; int nmi_option; /* Set up NMI on errors */ byte = inb(0x70); // RTC70 byte_old = byte; nmi_option = NMI_OFF; get_option(&nmi_option, "nmi"); if (nmi_option) { byte &= ~(1 << 7); /* set NMI */ } else { byte |= ( 1 << 7); // Can not mask NMI from PCI-E and NMI_NOW } if ( byte != byte_old) { outb(byte, 0x70); } } static void bcm5785_sb_read_resources(device_t dev) { struct resource *res; /* Get the normal pci resources of this device */ pci_dev_read_resources(dev); /* Get Resource for SMBUS */ pci_get_resource(dev, 0x90); compact_resources(dev); /* Add an extra subtractive resource for both memory and I/O */ res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0)); res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED; res = new_resource(dev, IOINDEX_SUBTRACTIVE(1, 0)); res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED; } static int lsmbus_recv_byte(device_t dev) { unsigned device; struct resource *res; struct bus *pbus; device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); res = find_resource(pbus->dev, 0x90); return do_smbus_recv_byte(res->base, device); } static int lsmbus_send_byte(device_t dev, uint8_t val) { unsigned device; struct resource *res; struct bus *pbus; device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); res = find_resource(pbus->dev, 0x90); return do_smbus_send_byte(res->base, device, val); } static int lsmbus_read_byte(device_t dev, uint8_t address) { unsigned device; struct resource *res; struct bus *pbus; device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); res = find_resource(pbus->dev, 0x90); return do_smbus_read_byte(res->base, device, address); } static int lsmbus_write_byte(device_t dev, uint8_t address, uint8_t val) { unsigned device; struct resource *res; struct bus *pbus; device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); res = find_resource(pbus->dev, 0x90); return do_smbus_write_byte(res->base, device, address, val); } static struct smbus_bus_operations lops_smbus_bus = { .recv_byte = lsmbus_recv_byte, .send_byte = lsmbus_send_byte, .read_byte = lsmbus_read_byte, .write_byte = lsmbus_write_byte, }; static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) { pci_write_config32(dev, 0x2c, ((device & 0xffff) << 16) | (vendor & 0xffff)); } static struct pci_operations lops_pci = { .set_subsystem = lpci_set_subsystem, }; static struct device_operations sb_ops = { .read_resources = bcm5785_sb_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = sb_init, .scan_bus = scan_smbus, // .enable = bcm5785_enable, .ops_pci = &lops_pci, .ops_smbus_bus = &lops_smbus_bus, }; static const struct pci_driver sb_driver __pci_driver = { .ops = &sb_ops, .vendor = PCI_VENDOR_ID_SERVERWORKS, .device = PCI_DEVICE_ID_SERVERWORKS_BCM5785_SB_PCI_MAIN, };
/* Machine-specific pthread type layouts. MIPS version. Copyright (C) 2005-2012 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/>. */ #ifndef _BITS_PTHREADTYPES_H #define _BITS_PTHREADTYPES_H 1 #include <endian.h> #if _MIPS_SIM == _ABI64 # define __SIZEOF_PTHREAD_ATTR_T 56 # define __SIZEOF_PTHREAD_MUTEX_T 40 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 56 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 32 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 #else # define __SIZEOF_PTHREAD_ATTR_T 36 # define __SIZEOF_PTHREAD_MUTEX_T 24 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4 # define __SIZEOF_PTHREAD_COND_T 48 # define __SIZEOF_PTHREAD_CONDATTR_T 4 # define __SIZEOF_PTHREAD_RWLOCK_T 32 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 # define __SIZEOF_PTHREAD_BARRIER_T 20 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4 #endif /* Thread identifiers. The structure of the attribute type is deliberately not exposed. */ typedef unsigned long int pthread_t; union pthread_attr_t { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; }; #ifndef __have_pthread_attr_t typedef union pthread_attr_t pthread_attr_t; # define __have_pthread_attr_t 1 #endif #if _MIPS_SIM == _ABI64 typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; #else typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; #endif /* Data structures for mutex handling. The structure of the attribute type is deliberately not exposed. */ typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; #if _MIPS_SIM == _ABI64 unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain binary compatibility. */ int __kind; #if _MIPS_SIM == _ABI64 int __spins; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else unsigned int __nusers; __extension__ union { int __spins; __pthread_slist_t __list; }; #endif } __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; } pthread_mutex_t; typedef union { char __size[__SIZEOF_PTHREAD_MUTEXATTR_T]; int __align; } pthread_mutexattr_t; /* Data structure for conditional variable handling. The structure of the attribute type is deliberately not exposed. */ typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[__SIZEOF_PTHREAD_COND_T]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[__SIZEOF_PTHREAD_CONDATTR_T]; int __align; } pthread_condattr_t; /* Keys for thread-specific data */ typedef unsigned int pthread_key_t; /* Once-only execution */ typedef int pthread_once_t; #if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Data structure for read-write lock variable handling. The structure of the attribute type is deliberately not exposed. */ typedef union { # if _MIPS_SIM == _ABI64 struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; int __writer; int __shared; unsigned long int __pad1; unsigned long int __pad2; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; } __data; # else struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; #if __BYTE_ORDER == __BIG_ENDIAN unsigned char __pad1; unsigned char __pad2; unsigned char __shared; /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; #else /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned char __flags; unsigned char __shared; unsigned char __pad1; unsigned char __pad2; #endif int __writer; } __data; # endif char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; typedef union { char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T]; long int __align; } pthread_rwlockattr_t; #endif #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ typedef volatile int pthread_spinlock_t; /* POSIX barriers data type. The structure of the type is deliberately not exposed. */ typedef union { char __size[__SIZEOF_PTHREAD_BARRIER_T]; long int __align; } pthread_barrier_t; typedef union { char __size[__SIZEOF_PTHREAD_BARRIERATTR_T]; int __align; } pthread_barrierattr_t; #endif #endif /* bits/pthreadtypes.h */
/* linux/arch/arm/mach-s3c6400/include/mach/gpio-core.h * * Copyright 2008 Openmoko, Inc. * Copyright 2008 Simtec Electronics * Ben Dooks <ben@simtec.co.uk> * http://armlinux.simtec.co.uk/ * * S3C64XX - GPIO core support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_ARCH_GPIO_CORE_H #define __ASM_ARCH_GPIO_CORE_H __FILE__ /* currently we just include the platform support */ #include <plat/gpio-core.h> #endif /* __ASM_ARCH_GPIO_CORE_H */
/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of GCC. GCC 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. GCC 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 GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header 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. */ /* * ISO C Standard: 7.9 Alternative spellings <iso646.h> */ #ifndef _ISO646_H #define _ISO646_H #ifndef __cplusplus #define and && #define and_eq &= #define bitand & #define bitor | #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= #define xor ^ #define xor_eq ^= #endif #endif
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_X86_CPU_ENTRY_AREA_H #define _ASM_X86_CPU_ENTRY_AREA_H #include <linux/percpu-defs.h> #include <asm/processor.h> #include <asm/intel_ds.h> #ifdef CONFIG_X86_64 /* Macro to enforce the same ordering and stack sizes */ #define ESTACKS_MEMBERS(guardsize, db2_holesize)\ char DF_stack_guard[guardsize]; \ char DF_stack[EXCEPTION_STKSZ]; \ char NMI_stack_guard[guardsize]; \ char NMI_stack[EXCEPTION_STKSZ]; \ char DB2_stack_guard[guardsize]; \ char DB2_stack[db2_holesize]; \ char DB1_stack_guard[guardsize]; \ char DB1_stack[EXCEPTION_STKSZ]; \ char DB_stack_guard[guardsize]; \ char DB_stack[EXCEPTION_STKSZ]; \ char MCE_stack_guard[guardsize]; \ char MCE_stack[EXCEPTION_STKSZ]; \ char IST_top_guard[guardsize]; \ /* The exception stacks' physical storage. No guard pages required */ struct exception_stacks { ESTACKS_MEMBERS(0, 0) }; /* The effective cpu entry area mapping with guard pages. */ struct cea_exception_stacks { ESTACKS_MEMBERS(PAGE_SIZE, EXCEPTION_STKSZ) }; /* * The exception stack ordering in [cea_]exception_stacks */ enum exception_stack_ordering { ESTACK_DF, ESTACK_NMI, ESTACK_DB2, ESTACK_DB1, ESTACK_DB, ESTACK_MCE, N_EXCEPTION_STACKS }; #define CEA_ESTACK_SIZE(st) \ sizeof(((struct cea_exception_stacks *)0)->st## _stack) #define CEA_ESTACK_BOT(ceastp, st) \ ((unsigned long)&(ceastp)->st## _stack) #define CEA_ESTACK_TOP(ceastp, st) \ (CEA_ESTACK_BOT(ceastp, st) + CEA_ESTACK_SIZE(st)) #define CEA_ESTACK_OFFS(st) \ offsetof(struct cea_exception_stacks, st## _stack) #define CEA_ESTACK_PAGES \ (sizeof(struct cea_exception_stacks) / PAGE_SIZE) #endif /* * cpu_entry_area is a percpu region that contains things needed by the CPU * and early entry/exit code. Real types aren't used for all fields here * to avoid circular header dependencies. * * Every field is a virtual alias of some other allocated backing store. * There is no direct allocation of a struct cpu_entry_area. */ struct cpu_entry_area { char gdt[PAGE_SIZE]; /* * The GDT is just below entry_stack and thus serves (on x86_64) as * a a read-only guard page. */ struct entry_stack_page entry_stack_page; /* * On x86_64, the TSS is mapped RO. On x86_32, it's mapped RW because * we need task switches to work, and task switches write to the TSS. */ struct tss_struct tss; #ifdef CONFIG_X86_64 /* * Exception stacks used for IST entries with guard pages. */ struct cea_exception_stacks estacks; #endif #ifdef CONFIG_CPU_SUP_INTEL /* * Per CPU debug store for Intel performance monitoring. Wastes a * full page at the moment. */ struct debug_store cpu_debug_store; /* * The actual PEBS/BTS buffers must be mapped to user space * Reserve enough fixmap PTEs. */ struct debug_store_buffers cpu_debug_buffers; #endif }; #define CPU_ENTRY_AREA_SIZE (sizeof(struct cpu_entry_area)) #define CPU_ENTRY_AREA_TOT_SIZE (CPU_ENTRY_AREA_SIZE * NR_CPUS) DECLARE_PER_CPU(struct cpu_entry_area *, cpu_entry_area); DECLARE_PER_CPU(struct cea_exception_stacks *, cea_exception_stacks); extern void setup_cpu_entry_areas(void); extern void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags); #define CPU_ENTRY_AREA_RO_IDT CPU_ENTRY_AREA_BASE #define CPU_ENTRY_AREA_PER_CPU (CPU_ENTRY_AREA_RO_IDT + PAGE_SIZE) #define CPU_ENTRY_AREA_RO_IDT_VADDR ((void *)CPU_ENTRY_AREA_RO_IDT) #define CPU_ENTRY_AREA_MAP_SIZE \ (CPU_ENTRY_AREA_PER_CPU + CPU_ENTRY_AREA_TOT_SIZE - CPU_ENTRY_AREA_BASE) extern struct cpu_entry_area *get_cpu_entry_area(int cpu); static inline struct entry_stack *cpu_entry_stack(int cpu) { return &get_cpu_entry_area(cpu)->entry_stack_page.stack; } #define __this_cpu_ist_top_va(name) \ CEA_ESTACK_TOP(__this_cpu_read(cea_exception_stacks), name) #endif
/* * Copyright (c) by Jaroslav Kysela <perex@suse.cz> * * Misc memory accessors * * * 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/config.h> #include <linux/module.h> #include <asm/io.h> #include <asm/uaccess.h> /** * copy_to_user_fromio - copy data from mmio-space to user-space * @dst: the destination pointer on user-space * @src: the source pointer on mmio * @count: the data size to copy in bytes * * Copies the data from mmio-space to user-space. * * Returns zero if successful, or non-zero on failure. */ int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count) { #if defined(__i386__) || defined(CONFIG_SPARC32) return copy_to_user(dst, (const void __force*)src, count) ? -EFAULT : 0; #else char buf[256]; while (count) { size_t c = count; if (c > sizeof(buf)) c = sizeof(buf); memcpy_fromio(buf, (void __iomem *)src, c); if (copy_to_user(dst, buf, c)) return -EFAULT; count -= c; dst += c; src += c; } return 0; #endif } EXPORT_SYMBOL(copy_to_user_fromio); /** * copy_from_user_toio - copy data from user-space to mmio-space * @dst: the destination pointer on mmio-space * @src: the source pointer on user-space * @count: the data size to copy in bytes * * Copies the data from user-space to mmio-space. * * Returns zero if successful, or non-zero on failure. */ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count) { #if defined(__i386__) || defined(CONFIG_SPARC32) return copy_from_user((void __force *)dst, src, count) ? -EFAULT : 0; #else char buf[256]; while (count) { size_t c = count; if (c > sizeof(buf)) c = sizeof(buf); if (copy_from_user(buf, src, c)) return -EFAULT; memcpy_toio(dst, buf, c); count -= c; dst += c; src += c; } return 0; #endif } EXPORT_SYMBOL(copy_from_user_toio);
/* bug-136564.c0 loop induction */ #include <testfwk.h> void testBackPatchLabel(void) { volatile unsigned char c0 = 0, c1 = 1; unsigned char r; if ( (c0 == 0)) r = 1; else r = 0; ASSERT(r == 1); if ( !(c0 == 0)) r = 1; else r = 0; ASSERT(r == 0); if ( !!(c0 == 0)) r = 1; else r = 0; ASSERT(r == 1); if ( !!!(c0 == 0)) r = 1; else r = 0; ASSERT(r == 0); if ( !!!!(c0 == 0)) r = 1; else r = 0; ASSERT(r == 1); if (!!!!!(c0 == 0)) r = 1; else r = 0; ASSERT(r == 0); if ( ((c0 == 0) && (c1 == 1))) r = 1; else r = 0; ASSERT(r == 1); if ( !((c0 == 0) && (c1 == 1))) r = 1; else r = 0; ASSERT(r == 0); if ( !!((c0 == 0) && (c1 == 1))) r = 1; else r = 0; ASSERT(r == 1); if ( ( (c0 == 0) && (c1 == 1))) r = 1; else r = 0; ASSERT(r == 1); if ( !( !(c0 == 1) && !(c1 == 0))) r = 1; else r = 0; ASSERT(r == 0); if ( !!(!!(c0 == 0) && !!(c1 == 1))) r = 1; else r = 0; ASSERT(r == 1); }
/* * Copyright (C) 2007 Martin Willi * Hochschule fuer Technik Rapperswil * * 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. See <http://www.fsf.org/copyleft/gpl.txt>. * * 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. */ /** * @defgroup context context * @{ @ingroup libfast */ #ifndef CONTEXT_H_ #define CONTEXT_H_ typedef struct context_t context_t; /** * Constructor function for a user specific context. */ typedef context_t *(*context_constructor_t)(void *param); /** * User specific session context, to extend. */ struct context_t { /** * Destroy the context_t. */ void (*destroy) (context_t *this); }; #endif /** CONTEXT_H_ @}*/
/* * xen/drivers/char/dt-uart.c * * Generic uart retrieved via the device tree * * Julien Grall <julien.grall@linaro.org> * Copyright (c) 2013 Linaro Limited. * * 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. */ #include <asm/device.h> #include <asm/early_printk.h> #include <asm/types.h> #include <xen/console.h> #include <xen/device_tree.h> #include <xen/serial.h> /* * Configure UART port with a string: * path,options * * @path: full path used in the device tree for the UART. If the path * doesn't start with '/', we assuming that it's an alias. * @options: UART speficic options (see in each UART driver) */ static char __initdata opt_dtuart[30] = ""; string_param("dtuart", opt_dtuart); void __init dt_uart_init(void) { struct dt_device_node *dev; int ret; const char *devpath = opt_dtuart; char *options; if ( !console_has("dtuart") || !strcmp(opt_dtuart, "") ) { early_printk("No console\n"); return; } options = strchr(opt_dtuart, ','); if ( options != NULL ) *(options++) = '\0'; else options = ""; early_printk("Looking for UART console %s\n", devpath); if ( *devpath == '/' ) dev = dt_find_node_by_path(devpath); else dev = dt_find_node_by_alias(devpath); if ( !dev ) { early_printk("Unable to find device \"%s\"\n", devpath); return; } ret = device_init(dev, DEVICE_SERIAL, options); if ( ret ) early_printk("Unable to initialize serial: %d\n", ret); }
/** ****************************************************************************** * @file usbd_req.h * @author MCD Application Team * @version V1.1.0 * @date 19-March-2012 * @brief header file for the usbd_req.c file ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2012 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USB_REQUEST_H_ #define __USB_REQUEST_H_ /* Includes ------------------------------------------------------------------*/ #include "usbd_def.h" #include "usbd_core.h" #include "usbd_conf.h" /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY * @{ */ /** @defgroup USBD_REQ * @brief header file for the usbd_ioreq.c file * @{ */ /** @defgroup USBD_REQ_Exported_Defines * @{ */ /** * @} */ /** @defgroup USBD_REQ_Exported_Types * @{ */ /** * @} */ /** @defgroup USBD_REQ_Exported_Macros * @{ */ /** * @} */ /** @defgroup USBD_REQ_Exported_Variables * @{ */ /** * @} */ /** @defgroup USBD_REQ_Exported_FunctionsPrototype * @{ */ USBD_Status USBD_StdDevReq (USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req); USBD_Status USBD_StdItfReq (USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req); USBD_Status USBD_StdEPReq (USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req); void USBD_ParseSetupRequest( USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req); void USBD_CtlError( USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req); void USBD_GetString(const uint8_t *desc, uint8_t *unicode, uint16_t *len); /** * @} */ #endif /* __USB_REQUEST_H_ */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#pragma once #include "Common.h" #include "Player.h" #include "AllPlayers.h" #include "UCTSearch.h" #include "UCTMemoryPool.hpp" namespace SparCraft { class Player_UCT : public Player { UCTSearchParameters _params; UCTSearchResults _prevResults; public: Player_UCT (const IDType & playerID, const UCTSearchParameters & params); void getMoves(GameState & state, const MoveArray & moves, std::vector<UnitAction> & moveVec); IDType getType() { return PlayerModels::UCT; } UCTSearchParameters & getParams(); UCTSearchResults & getResults(); }; }
/** ****************************************************************************** * @file FLASH_Program/stm32f4xx_conf.h * @author MCD Application Team * @version V1.0.0 * @date 19-September-2011 * @brief Library configuration file. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_CONF_H #define __STM32F4xx_CONF_H #if defined (HSE_VALUE) /* Redefine the HSE value; it's equal to 8 MHz on the STM32F4-DISCOVERY Kit */ #undef HSE_VALUE #define HSE_VALUE ((uint32_t)8000000) #endif /* HSE_VALUE */ /* Includes ------------------------------------------------------------------*/ /* Uncomment the line below to enable peripheral header file inclusion */ #include "stm32f4xx_adc.h" #include "stm32f4xx_can.h" #include "stm32f4xx_crc.h" #include "stm32f4xx_cryp.h" #include "stm32f4xx_dac.h" #include "stm32f4xx_dbgmcu.h" #include "stm32f4xx_dcmi.h" #include "stm32f4xx_dma.h" #include "stm32f4xx_exti.h" #include "stm32f4xx_flash.h" #include "stm32f4xx_fsmc.h" #include "stm32f4xx_hash.h" #include "stm32f4xx_gpio.h" #include "stm32f4xx_i2c.h" #include "stm32f4xx_iwdg.h" #include "stm32f4xx_pwr.h" #include "stm32f4xx_rcc.h" #include "stm32f4xx_rng.h" #include "stm32f4xx_rtc.h" #include "stm32f4xx_sdio.h" #include "stm32f4xx_spi.h" #include "stm32f4xx_syscfg.h" #include "stm32f4xx_tim.h" #include "stm32f4xx_usart.h" #include "stm32f4xx_wwdg.h" #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* If an external clock source is used, then the value of the following define should be set to the value of the external clock source, else, if no external clock is used, keep this define commented */ /*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */ /* Uncomment the line below to expanse the "assert_param" macro in the Standard Peripheral Library drivers code */ /* #define USE_FULL_ASSERT 1 */ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0) #endif /* USE_FULL_ASSERT */ #endif /* __STM32F4xx_CONF_H */ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
#ifndef __AP_HAL_LINUX_NAMESPACE_H__ #define __AP_HAL_LINUX_NAMESPACE_H__ /* While not strictly required, names inside the Linux namespace are prefixed * with Linux for clarity. (Some of our users aren't familiar with all of the * C++ namespace rules.) */ namespace Linux { class LinuxUARTDriver; class LinuxSPIUARTDriver; class LinuxI2CDriver; class LinuxSPIDeviceManager; class LinuxSPIDeviceDriver; class LinuxAnalogSource; class LinuxAnalogIn; class LinuxStorage; class LinuxGPIO_BBB; class LinuxGPIO_RPI; class LinuxStorage; class LinuxStorage_FRAM; class LinuxDigitalSource; class LinuxRCInput; class LinuxRCInput_PRU; class LinuxRCInput_AioPRU; class LinuxRCInput_Navio; class LinuxRCInput_ZYNQ; class LinuxRCInput_UDP; class LinuxRCOutput_PRU; class LinuxRCOutput_AioPRU; class LinuxRCOutput_PCA9685; class LinuxRCOutput_ZYNQ; class LinuxRCOutput_Bebop; class LinuxSemaphore; class LinuxScheduler; class LinuxUtil; class ToneAlarm; //limit the scope of ToneAlarm driver to Linux_HAL only } #endif // __AP_HAL_LINUX_NAMESPACE_H__
/**************************************************************************** ** ** Copyright (C) 2016 Jochen Becher ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once namespace qmt { class MDiagram; class DiagramSceneModel; class DiagramsViewInterface { public: virtual ~DiagramsViewInterface() { } virtual void openDiagram(MDiagram *) = 0; virtual void closeDiagram(const MDiagram *) = 0; virtual void closeAllDiagrams() = 0; virtual void onDiagramRenamed(const MDiagram *) = 0; }; } // namespace qmt
/* * Mesa 3-D graphics library * * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ /* * Matrix/vertex/vector transformation stuff * * * NOTES: * 1. 4x4 transformation matrices are stored in memory in column major order. * 2. Points/vertices are to be thought of as column vectors. * 3. Transformation of a point p by a matrix M is: p' = M * p */ #include "c99_math.h" #include "main/glheader.h" #include "main/macros.h" #include "m_eval.h" #include "m_matrix.h" #include "m_translate.h" #include "m_xform.h" #ifdef DEBUG_MATH #include "m_debug.h" #endif #ifdef USE_X86_ASM #include "x86/common_x86_asm.h" #endif #ifdef USE_X86_64_ASM #include "x86-64/x86-64.h" #endif #ifdef USE_SPARC_ASM #include "sparc/sparc.h" #endif clip_func _mesa_clip_tab[5]; clip_func _mesa_clip_np_tab[5]; dotprod_func _mesa_dotprod_tab[5]; vec_copy_func _mesa_copy_tab[0x10]; normal_func _mesa_normal_tab[0xf]; transform_func *_mesa_transform_tab[5]; /* Raw data format used for: * - Object-to-eye transform prior to culling, although this too * could be culled under some circumstances. * - Eye-to-clip transform (via the function above). * - Cliptesting * - And everything else too, if culling happens to be disabled. * * GH: It's used for everything now, as clipping/culling is done * elsewhere (most often by the driver itself). */ #define TAG(x) x #define TAG2(x,y) x##y #define STRIDE_LOOP for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) ) #define LOOP for ( i = 0 ; i < n ; i++ ) #define ARGS #include "m_xform_tmp.h" #include "m_clip_tmp.h" #include "m_norm_tmp.h" #include "m_dotprod_tmp.h" #include "m_copy_tmp.h" #undef TAG #undef TAG2 #undef LOOP #undef ARGS /* * This is called only once. It initializes several tables with pointers * to optimized transformation functions. This is where we can test for * AMD 3Dnow! capability, Intel SSE, etc. and hook in the right code. */ void _math_init_transformation( void ) { init_c_transformations(); init_c_norm_transform(); init_c_cliptest(); init_copy0(); init_dotprod(); #ifdef DEBUG_MATH _math_test_all_transform_functions( "default" ); _math_test_all_normal_transform_functions( "default" ); _math_test_all_cliptest_functions( "default" ); #endif #ifdef USE_X86_ASM _mesa_init_all_x86_transform_asm(); #elif defined( USE_SPARC_ASM ) _mesa_init_all_sparc_transform_asm(); #elif defined( USE_X86_64_ASM ) _mesa_init_all_x86_64_transform_asm(); #endif }
// queue.h - written and placed in the public domain by Wei Dai //! \file //! \headerfile queue.h //! \brief Classes for an unlimited queue to store bytes #ifndef CRYPTOPP_QUEUE_H #define CRYPTOPP_QUEUE_H #include "cryptlib.h" #include "simple.h" NAMESPACE_BEGIN(CryptoPP) class ByteQueueNode; //! \class ByteQueue //! \brief Data structure used to store byte strings //! \details The queue is implemented as a linked list of byte arrays class CRYPTOPP_DLL ByteQueue : public Bufferless<BufferedTransformation> { public: //! \brief Construct a ByteQueue //! \param nodeSize the initial node size //! \details Internally, ByteQueue uses a ByteQueueNode to store bytes, and \p nodeSize determines the //! size of the ByteQueueNode. A value of 0 indicates the ByteQueueNode should be automatically sized, //! which means a value of 256 is used. ByteQueue(size_t nodeSize=0); //! \brief Copy construct a ByteQueue //! \param copy the other ByteQueue ByteQueue(const ByteQueue &copy); ~ByteQueue(); lword MaxRetrievable() const {return CurrentSize();} bool AnyRetrievable() const {return !IsEmpty();} void IsolatedInitialize(const NameValuePairs &parameters); byte * CreatePutSpace(size_t &size); size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking); size_t Get(byte &outByte); size_t Get(byte *outString, size_t getMax); size_t Peek(byte &outByte) const; size_t Peek(byte *outString, size_t peekMax) const; size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; // these member functions are not inherited void SetNodeSize(size_t nodeSize); lword CurrentSize() const; bool IsEmpty() const; void Clear(); void Unget(byte inByte); void Unget(const byte *inString, size_t length); const byte * Spy(size_t &contiguousSize) const; void LazyPut(const byte *inString, size_t size); void LazyPutModifiable(byte *inString, size_t size); void UndoLazyPut(size_t size); void FinalizeLazyPut(); ByteQueue & operator=(const ByteQueue &rhs); bool operator==(const ByteQueue &rhs) const; bool operator!=(const ByteQueue &rhs) const {return !operator==(rhs);} byte operator[](lword i) const; void swap(ByteQueue &rhs); //! \class Walker //! \brief A ByteQueue iterator class Walker : public InputRejecting<BufferedTransformation> { public: //! \brief Construct a ByteQueue Walker //! \param queue a ByteQueue Walker(const ByteQueue &queue) : m_queue(queue), m_node(NULL), m_position(0), m_offset(0), m_lazyString(NULL), m_lazyLength(0) {Initialize();} lword GetCurrentPosition() {return m_position;} lword MaxRetrievable() const {return m_queue.CurrentSize() - m_position;} void IsolatedInitialize(const NameValuePairs &parameters); size_t Get(byte &outByte); size_t Get(byte *outString, size_t getMax); size_t Peek(byte &outByte) const; size_t Peek(byte *outString, size_t peekMax) const; size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true); size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const; private: const ByteQueue &m_queue; const ByteQueueNode *m_node; lword m_position; size_t m_offset; const byte *m_lazyString; size_t m_lazyLength; }; friend class Walker; private: void CleanupUsedNodes(); void CopyFrom(const ByteQueue &copy); void Destroy(); bool m_autoNodeSize; size_t m_nodeSize; ByteQueueNode *m_head, *m_tail; byte *m_lazyString; size_t m_lazyLength; bool m_lazyStringModifiable; }; //! use this to make sure LazyPut is finalized in event of exception class CRYPTOPP_DLL LazyPutter { public: LazyPutter(ByteQueue &bq, const byte *inString, size_t size) : m_bq(bq) {bq.LazyPut(inString, size);} ~LazyPutter() {try {m_bq.FinalizeLazyPut();} catch(const Exception&) {CRYPTOPP_ASSERT(0);}} protected: LazyPutter(ByteQueue &bq) : m_bq(bq) {} private: ByteQueue &m_bq; }; //! like LazyPutter, but does a LazyPutModifiable instead class LazyPutterModifiable : public LazyPutter { public: LazyPutterModifiable(ByteQueue &bq, byte *inString, size_t size) : LazyPutter(bq) {bq.LazyPutModifiable(inString, size);} }; NAMESPACE_END #ifndef __BORLANDC__ NAMESPACE_BEGIN(std) template<> inline void swap(CryptoPP::ByteQueue &a, CryptoPP::ByteQueue &b) { a.swap(b); } NAMESPACE_END #endif #endif
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD // // 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. #pragma once #ifdef ESP_PLATFORM #include "sdkconfig.h" /* Configuration macros for multi-heap */ #ifdef CONFIG_HEAP_POISONING_LIGHT #define MULTI_HEAP_POISONING #endif #ifdef CONFIG_HEAP_POISONING_COMPREHENSIVE #define MULTI_HEAP_POISONING #define MULTI_HEAP_POISONING_SLOW #endif #else /* !ESP_PLATFORM */ /* Host-side tests, enable full poisoning */ #define MULTI_HEAP_POISONING #define MULTI_HEAP_POISONING_SLOW #endif
/*========================================================================= * * Copyright NumFOCUS * * 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.txt * * 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 itkVideoFileWriter_h #define itkVideoFileWriter_h #include "itkTemporalProcessObject.h" #include "itkVideoIOFactory.h" namespace itk { /** *\class VideoFileWriter * \brief Writer that takes in a VideoStream and writes the frames to a file * * This class is a subclass of TemporalProcessObject which specifically takes a * single VideoStream as input and writes the frames out to a file in sequence. * A call to Update() will write the entire requested temporal region to the * file. If no temporal region is requested, the largest possible will be used. * * \ingroup ITKVideoIO */ template <typename TInputVideoStream> class ITK_TEMPLATE_EXPORT VideoFileWriter : public TemporalProcessObject { public: ITK_DISALLOW_COPY_AND_MOVE(VideoFileWriter); /** Standard class type aliases. */ using Self = VideoFileWriter<TInputVideoStream>; using Superclass = TemporalProcessObject; using Pointer = SmartPointer<Self>; using IOBaseType = VideoIOBase; using IOBasePointer = typename VideoIOBase::Pointer; using SizeValueType = typename IOBaseType::SizeValueType; using TemporalRatioType = typename IOBaseType::TemporalRatioType; using VideoStreamType = TInputVideoStream; using VideoStreamPointer = typename VideoStreamType::Pointer; using FrameType = typename VideoStreamType::FrameType; using PixelType = typename FrameType::PixelType; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(VideoFileWriter, TemporalProcessObject); /** Specify the file to read. This is forwarded to the IO instance. */ itkSetStringMacro(FileName); itkGetStringMacro(FileName); /** Specify the output FpS. */ itkSetMacro(FramesPerSecond, TemporalRatioType); itkGetMacro(FramesPerSecond, TemporalRatioType); /** Specify the FourCC to use for video encoding. FourCC, or four character * code, is commonly used to denote the codec to be used to encode video by * many libraries. See http://en.wikipedia.org/wiki/FourCC for more * information. */ itkSetStringMacro(FourCC); itkGetStringMacro(FourCC); /** Get/Set the OutputTemporalRegion */ itkSetMacro(OutputTemporalRegion, TemporalRegion); itkGetMacro(OutputTemporalRegion, TemporalRegion); /** Set/Get the input video pointer */ using Superclass::SetInput; void SetInput(const VideoStreamType * input); const VideoStreamType * GetInput(); /** Manually set the VideoIO to use */ void SetVideoIO(IOBasePointer videoIO); /** Write the requested temporal region to a file. If no OutputTemporalRegion * has been set, the largest possible temporal region of the input will be * used. */ void Write(); /** Finish writing the video and close the file */ void FinishWriting(); /** Aliased to the Write() method to be consistent with the rest of the * pipeline. */ void Update() override; /** Write the entire video to a file, if possible. This is the same as * calling write or update without setting an output temporal region. */ void UpdateLargestPossibleRegion() override; protected: VideoFileWriter(); ~VideoFileWriter() override; void PrintSelf(std::ostream & os, Indent indent) const override; /** Initialize output parameters. */ bool InitializeOutputParameters(); /** Set up the VideoIO using VideoIOFactory. Returns true if successful, false * otherwise. * Warning: this will overwrite any currently set VideoIO */ bool InitializeVideoIO(); /** Override TemporalStreamingGenerateData to do the actual writing. */ void TemporalStreamingGenerateData() override; private: /** The file to write. */ std::string m_FileName; /** The VideoIO used for writing. */ IOBasePointer m_VideoIO; /** TemporalRegion to write out. */ TemporalRegion m_OutputTemporalRegion; /** Parameters for writing. */ TemporalRatioType m_FramesPerSecond{ 24 }; std::string m_FourCC; std::vector<SizeValueType> m_Dimensions; SizeValueType m_NumberOfComponents{ 0 }; IOComponentEnum m_ComponentType; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION # include "itkVideoFileWriter.hxx" #endif #endif
/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2021-08-23 lianzhian first implementation. */ #ifndef __DRV_I2C__ #define __DRV_I2C__ #endif
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 __EXPRESSION_LANGUAGE_DRIVER_H__ #define __EXPRESSION_LANGUAGE_DRIVER_H__ #include <string> #include <map> #include <sstream> #include <expression/Expression.h> #undef yyFlexLexer #include <FlexLexer.h> #include "Parser.hpp" #undef YY_DECL #define YY_DECL int org::apache::nifi::minifi::expression::Driver::lex(org::apache::nifi::minifi::expression::Parser::semantic_type* yylval, \ org::apache::nifi::minifi::expression::Parser::location_type* yylloc) namespace org { namespace apache { namespace nifi { namespace minifi { namespace expression { class Driver : public yyFlexLexer { public: explicit Driver(std::istream *input = nullptr, std::ostream *output = nullptr) : yyFlexLexer(input, output), result(Value()) { } ~Driver() override = default; int lex(Parser::semantic_type *yylval, Parser::location_type *yylloc); std::map<std::string, int> variables; Expression result; }; } /* namespace expression */ } /* namespace minifi */ } /* namespace nifi */ } /* namespace apache */ } /* namespace org */ #endif /* __EXPRESSION_LANGUAGE_DRIVER_H__ */
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 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 TENSORFLOW_LITE_PROFILING_NOOP_PROFILER_H_ #define TENSORFLOW_LITE_PROFILING_NOOP_PROFILER_H_ #include <vector> #include "tensorflow/lite/core/api/profiler.h" #include "tensorflow/lite/profiling/profile_buffer.h" namespace tflite { namespace profiling { // A noop version of profiler when profiling is disabled. class NoopProfiler : public tflite::Profiler { public: NoopProfiler() {} explicit NoopProfiler(int max_profiling_buffer_entries) {} uint32_t BeginEvent(const char*, EventType, uint32_t, uint32_t) override { return 0; } void EndEvent(uint32_t) override {} void StartProfiling() {} void StopProfiling() {} void Reset() {} std::vector<const ProfileEvent*> GetProfileEvents() { return {}; } }; } // namespace profiling } // namespace tflite #endif // TENSORFLOW_LITE_PROFILING_NOOP_PROFILER_H_
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_COMMON_WM_WINDOW_TRACKER_H_ #define ASH_COMMON_WM_WINDOW_TRACKER_H_ #include "ash/common/wm_window.h" #include "ash/common/wm_window_observer.h" #include "ui/base/window_tracker_template.h" namespace ash { using WmWindowTracker = ui::WindowTrackerTemplate<WmWindow, WmWindowObserver>; } // namespace ash #endif // ASH_COMMON_WM_WINDOW_TRACKER_H_
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file eglGraphicsWindow.h * @author rdb * @date 2009-05-21 */ #ifndef EGLGRAPHICSWINDOW_H #define EGLGRAPHICSWINDOW_H #include "pandabase.h" #include "eglGraphicsPipe.h" #include "x11GraphicsWindow.h" /** * An interface to the egl system for managing GLES windows under X. */ class eglGraphicsWindow : public x11GraphicsWindow { public: eglGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const std::string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~eglGraphicsWindow(); virtual bool begin_frame(FrameMode mode, Thread *current_thread); virtual void end_frame(FrameMode mode, Thread *current_thread); virtual void end_flip(); protected: virtual void close_window(); virtual bool open_window(); private: EGLDisplay _egl_display; EGLSurface _egl_surface; public: static TypeHandle get_class_type() { return _type_handle; } static void init_type() { x11GraphicsWindow::init_type(); register_type(_type_handle, "eglGraphicsWindow", x11GraphicsWindow::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} private: static TypeHandle _type_handle; }; #include "eglGraphicsWindow.I" #endif
/************************************************************************************ * configs/stm3240g-eval/src/up_adc.c * arch/arm/src/board/up_adc.c * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX 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. * ************************************************************************************/ /************************************************************************************ * Included Files ************************************************************************************/ #include <nuttx/config.h> #include <errno.h> #include <debug.h> #include <nuttx/analog/adc.h> #include <arch/board/board.h> #include "chip.h" #include "up_arch.h" #include "stm32_pwm.h" #include "stm3240g-internal.h" #ifdef CONFIG_ADC /************************************************************************************ * Definitions ************************************************************************************/ /* Configuration ************************************************************/ /* Up to 3 ADC interfaces are supported */ #if STM32_NADC < 3 # undef CONFIG_STM32_ADC3 #endif #if STM32_NADC < 2 # undef CONFIG_STM32_ADC2 #endif #if STM32_NADC < 1 # undef CONFIG_STM32_ADC1 #endif #if defined(CONFIG_STM32_ADC1) || defined(CONFIG_STM32_ADC2) || defined(CONFIG_STM32_ADC3) #ifndef CONFIG_STM32_ADC3 # warning "Channel information only available for ADC3" #endif /* The number of ADC channels in the conversion list */ #define ADC3_NCHANNELS 1 /************************************************************************************ * Private Data ************************************************************************************/ /* The STM3240G-EVAL has a 10 Kohm potentiometer RV1 connected to PF9 of * STM32F407IGH6 on the board: TIM14_CH1/FSMC_CD/ADC3_IN7 */ /* Identifying number of each ADC channel: Variable Resistor. */ #ifdef CONFIG_STM32_ADC3 static const uint8_t g_chanlist[ADC3_NCHANNELS] = {7}; /* Configurations of pins used byte each ADC channels */ static const uint32_t g_pinlist[ADC3_NCHANNELS] = {GPIO_ADC3_IN7}; #endif /************************************************************************************ * Private Functions ************************************************************************************/ /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ * Name: adc_devinit * * Description: * All STM32 architectures must provide the following interface to work with * examples/adc. * ************************************************************************************/ int adc_devinit(void) { #ifdef CONFIG_STM32_ADC3 static bool initialized = false; struct adc_dev_s *adc; int ret; int i; /* Check if we have already initialized */ if (!initialized) { /* Configure the pins as analog inputs for the selected channels */ for (i = 0; i < ADC3_NCHANNELS; i++) { stm32_configgpio(g_pinlist[i]); } /* Call stm32_adcinitialize() to get an instance of the ADC interface */ adc = stm32_adcinitialize(3, g_chanlist, ADC3_NCHANNELS); if (adc == NULL) { adbg("ERROR: Failed to get ADC interface\n"); return -ENODEV; } /* Register the ADC driver at "/dev/adc0" */ ret = adc_register("/dev/adc0", adc); if (ret < 0) { adbg("adc_register failed: %d\n", ret); return ret; } /* Now we are initialized */ initialized = true; } return OK; #else return -ENOSYS; #endif } #endif /* CONFIG_STM32_ADC1 || CONFIG_STM32_ADC2 || CONFIG_STM32_ADC3 */ #endif /* CONFIG_ADC */
/* * arch/arm64/include/asm/arch_timer.h * * Copyright (C) 2012 ARM Ltd. * Author: Marc Zyngier <marc.zyngier@arm.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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __ASM_ARCH_TIMER_H #define __ASM_ARCH_TIMER_H #include <asm/barrier.h> #include <linux/init.h> #include <linux/types.h> #include <clocksource/arm_arch_timer.h> /* * These register accessors are marked inline so the compiler can * nicely work out which register we want, and chuck away the rest of * the code. */ static __always_inline void arch_timer_reg_write_cp15(int access, enum arch_timer_reg reg, u32 val) { if (access == ARCH_TIMER_PHYS_ACCESS) { switch (reg) { case ARCH_TIMER_REG_CTRL: asm volatile("msr cntp_ctl_el0, %0" : : "r" ((u64)val)); break; case ARCH_TIMER_REG_TVAL: asm volatile("msr cntp_tval_el0, %0" : : "r" ((u64)val)); break; } } else if (access == ARCH_TIMER_VIRT_ACCESS) { switch (reg) { case ARCH_TIMER_REG_CTRL: asm volatile("msr cntv_ctl_el0, %0" : : "r" ((u64)val)); break; case ARCH_TIMER_REG_TVAL: asm volatile("msr cntv_tval_el0, %0" : : "r" ((u64)val)); break; } } isb(); } static __always_inline u32 arch_timer_reg_read_cp15(int access, enum arch_timer_reg reg) { u64 val; if (access == ARCH_TIMER_PHYS_ACCESS) { switch (reg) { case ARCH_TIMER_REG_CTRL: asm volatile("mrs %0, cntp_ctl_el0" : "=r" (val)); break; case ARCH_TIMER_REG_TVAL: asm volatile("mrs %0, cntp_tval_el0" : "=r" (val)); break; } } else if (access == ARCH_TIMER_VIRT_ACCESS) { switch (reg) { case ARCH_TIMER_REG_CTRL: asm volatile("mrs %0, cntv_ctl_el0" : "=r" (val)); break; case ARCH_TIMER_REG_TVAL: asm volatile("mrs %0, cntv_tval_el0" : "=r" (val)); break; } } return (u32)val; } static inline u32 arch_timer_get_cntfrq(void) { u32 val; asm volatile("mrs %0, cntfrq_el0" : "=r" (val)); return val; } static inline u32 arch_timer_get_cntkctl(void) { u32 cntkctl; asm volatile("mrs %0, cntkctl_el1" : "=r" (cntkctl)); return cntkctl; } static inline void arch_timer_set_cntkctl(u32 cntkctl) { asm volatile("msr cntkctl_el1, %0" : : "r" (cntkctl)); } static inline void arch_counter_set_user_access(void) { u32 cntkctl = arch_timer_get_cntkctl(); /* Disable user access to the timers and the physical counter */ /* Also disable virtual event stream */ cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN | ARCH_TIMER_USR_VT_ACCESS_EN | ARCH_TIMER_VIRT_EVT_EN | ARCH_TIMER_USR_PCT_ACCESS_EN); /* Enable user access to the virtual counter */ cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN; arch_timer_set_cntkctl(cntkctl); } static inline void arch_timer_evtstrm_enable(int divider) { u32 cntkctl = arch_timer_get_cntkctl(); cntkctl &= ~ARCH_TIMER_EVT_TRIGGER_MASK; /* Set the divider and enable virtual event stream */ cntkctl |= (divider << ARCH_TIMER_EVT_TRIGGER_SHIFT) | ARCH_TIMER_VIRT_EVT_EN; arch_timer_set_cntkctl(cntkctl); elf_hwcap |= HWCAP_EVTSTRM; #ifdef CONFIG_COMPAT compat_elf_hwcap |= COMPAT_HWCAP_EVTSTRM; #endif } static inline u64 arch_counter_get_cntvct(void) { u64 cval; isb(); asm volatile("mrs %0, cntvct_el0" : "=r" (cval)); return cval; } static inline int arch_timer_arch_init(void) { return 0; } #endif
/** * @file usbKbdInit.c */ /* Embedded Xinu, Copyright (C) 2013. All rights reserved. */ #include <usb_core_driver.h> #include <usbkbd.h> /** Table of USB keyboard control blocks */ struct usbkbd usbkbds[NUSBKBD]; /** USB device driver structure for the usbkbd driver */ static struct usb_device_driver usbkbd_driver = { .name = "USB keyboard driver (HID boot protocol)", .bind_device = usbKbdBindDevice, .unbind_device = usbKbdUnbindDevice, }; /** * Initializes the specified USB keyboard. * * This actually only prepares the corresponding keyboard structure for use and * does not depend on a physical keyboard being attached. The physical keyboard * is recognized only when it is attached, and any read requests to the device * will block until that point. */ devcall usbKbdInit(device *devptr) { usb_status_t status; struct usbkbd *kbd; kbd = &usbkbds[devptr->minor]; /* Already initialized? */ if (kbd->initialized) { goto err; } /* Initialize input queue. */ kbd->isema = semcreate(0); if (SYSERR == kbd->isema) { goto err; } /* Allocate USB transfer request for keyboard data. */ kbd->intr = usb_alloc_xfer_request(8); if (NULL == kbd->intr) { goto err_semfree; } kbd->initialized = TRUE; /* Register the keyboard USB device driver with the USB subsystem. * (no-op if already registered). */ status = usb_register_device_driver(&usbkbd_driver); if (status != USB_STATUS_SUCCESS) { goto err_free_req; } return OK; err_free_req: kbd->initialized = FALSE; usb_free_xfer_request(kbd->intr); err_semfree: semfree(kbd->isema); err: return SYSERR; }
/* Copyright (c) 2008-2015, Avian Contributors Permission to use, copy, modify, and/or 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. There is NO WARRANTY for this software. See license.txt for details. */ #ifndef JNIENV_H #define JNIENV_H #include "avian/machine.h" #define BOOTSTRAP_PROPERTY "avian.bootstrap" #define JAVA_COMMAND_PROPERTY "sun.java.command" #define JAVA_LAUNCHER_PROPERTY "sun.java.launcher" #define CRASHDIR_PROPERTY "avian.crash.dir" #define EMBED_PREFIX_PROPERTY "avian.embed.prefix" #define CLASSPATH_PROPERTY "java.class.path" #define JAVA_HOME_PROPERTY "java.home" #define REENTRANT_PROPERTY "avian.reentrant" #define BOOTCLASSPATH_PREPEND_OPTION "bootclasspath/p" #define BOOTCLASSPATH_OPTION "bootclasspath" #define BOOTCLASSPATH_APPEND_OPTION "bootclasspath/a" namespace vm { void populateJNITables(JavaVMVTable* vmTable, JNIEnvVTable* envTable); } // namespace vm #endif // JNIENV_H
// // WAAppRouteHandler.h // WAAppRouter // // Created by Marian Paul on 18/08/2015. // Copyright (c) 2015 Wasappli. All rights reserved. // #import "WAAppRouteHandlerProtocol.h" @class WAAppRouteRegistrar; /** @brief. An implementation of the `WAAppRouteHandlerProtocol` protocol which only deals with navigation controllers and handle a stack */ @interface WAAppRouteHandler : NSObject <WAAppRouteHandlerProtocol> /** * Init with a route registrar. The registrar contains all the `WAAppRouteEntity` and is necessary for retrieving the entity stack. * * @param registrar the registrar containing all the entities * * @return a route handler to feed the router */ - (instancetype)initWithRouteRegistrar:(WAAppRouteRegistrar *)registrar NS_DESIGNATED_INITIALIZER; /** * @see `initWithRouteRegistrar:` */ + (instancetype)routeHandlerWithRouteRegistrar:(WAAppRouteRegistrar *)registrar; @property (nonatomic, strong, readonly) WAAppRouteRegistrar *registrar; @end /** * This key helps to force an animation instead of letting the route handler guess it. Use it on last shot ^^ */ FOUNDATION_EXTERN NSString * const kWAAppRoutingForceAnimationKey;
/*************************************************************************/ /* step_2d_sw.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* 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 STEP_2D_SW_H #define STEP_2D_SW_H #include "space_2d_sw.h" class Step2DSW { uint64_t _step; void _populate_island(Body2DSW *p_body, Body2DSW **p_island, Constraint2DSW **p_constraint_island); bool _setup_island(Constraint2DSW *p_island, real_t p_delta); void _solve_island(Constraint2DSW *p_island, int p_iterations, real_t p_delta); void _check_suspend(Body2DSW *p_island, real_t p_delta); public: void step(Space2DSW *p_space, real_t p_delta, int p_iterations); Step2DSW(); }; #endif // STEP_2D_SW_H
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; 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 */ #ifdef __GNUC__ #pragma interface /* gcc class implementation */ #endif /* class for the the myisam handler */ #include <myisam.h> #include <ft_global.h> #define HA_RECOVER_NONE 0 /* No automatic recover */ #define HA_RECOVER_DEFAULT 1 /* Automatic recover active */ #define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */ #define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */ #define HA_RECOVER_QUICK 8 /* Don't check rows in data file */ extern ulong myisam_sort_buffer_size; extern TYPELIB myisam_recover_typelib; extern ulong myisam_recover_options; class ha_myisam: public handler { MI_INFO *file; uint int_table_flags; char *data_file_name, *index_file_name; bool enable_activate_all_index; int repair(THD *thd, MI_CHECK &param, bool optimize); public: ha_myisam(TABLE *table): handler(table), file(0), int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER | HA_NULL_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY), enable_activate_all_index(1) {} ~ha_myisam() {} const char *table_type() const { return "MyISAM"; } const char *index_type(uint key_number); const char **bas_ext() const; ulong table_flags() const { return int_table_flags; } ulong index_flags(uint inx) const { ulong flags=(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER); return (flags | ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? 0 : HA_KEY_READ_ONLY)); } uint max_record_length() const { return HA_MAX_REC_LENGTH; } uint max_keys() const { return MI_MAX_KEY; } uint max_key_parts() const { return MAX_REF_PARTS; } uint max_key_length() const { return MI_MAX_KEY_LENGTH; } int open(const char *name, int mode, uint test_if_locked); int close(void); int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); int index_read(byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag); int index_read_idx(byte * buf, uint idx, const byte * key, uint key_len, enum ha_rkey_function find_flag); int index_read_last(byte * buf, const byte * key, uint key_len); int index_next(byte * buf); int index_prev(byte * buf); int index_first(byte * buf); int index_last(byte * buf); int index_next_same(byte *buf, const byte *key, uint keylen); int index_end() { ft_handler=NULL; return 0; } int ft_init() { if (!ft_handler) return 1; ft_handler->please->reinit_search(ft_handler); return 0; } FT_INFO *ft_init_ext(uint mode, uint inx,const byte *key, uint keylen, bool presort) { return ft_init_search(mode, file,inx,(byte*) key,keylen,presort); } int ft_read(byte *buf); int rnd_init(bool scan=1); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); int restart_rnd_next(byte *buf, byte *pos); void position(const byte *record); my_off_t row_position() { return mi_position(file); } void info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); int reset(void); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); void deactivate_non_unique_index(ha_rows rows); bool activate_all_index(THD *thd); ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len, enum ha_rkey_function start_search_flag, const byte *end_key,uint end_key_len, enum ha_rkey_function end_search_flag); void update_create_info(HA_CREATE_INFO *create_info); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); longlong get_auto_increment(); int rename_table(const char * from, const char * to); int delete_table(const char *name); int check(THD* thd, HA_CHECK_OPT* check_opt); int analyze(THD* thd,HA_CHECK_OPT* check_opt); int repair(THD* thd, HA_CHECK_OPT* check_opt); bool check_and_repair(THD *thd); bool is_crashed() const; bool auto_repair() const { return myisam_recover_options != 0; } int optimize(THD* thd, HA_CHECK_OPT* check_opt); int restore(THD* thd, HA_CHECK_OPT* check_opt); int backup(THD* thd, HA_CHECK_OPT* check_opt); int dump(THD* thd, int fd); int net_read_dump(NET* net); };
/* * panel data for picodlp panel * * Copyright (C) 2011 Texas Instruments * * Author: Mayuresh Janorkar <mayur@ti.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. */ #ifndef __PANEL_PICODLP_H #define __PANEL_PICODLP_H /* */ struct picodlp_panel_data { int picodlp_adapter_id; int emu_done_gpio; int pwrgood_gpio; }; #endif /* */
/* * parport.h: platform-specific PC-style parport initialisation * * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> * * This file should only be included by drivers/parport/parport_pc.c. */ #ifndef _ASM_IA64_PARPORT_H #define _ASM_IA64_PARPORT_H 1 static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) { return parport_pc_find_isa_ports(autoirq, autodma); } #endif /* */
/* * drivers/gpu/ion/ion_chunk_heap.c * * Copyright (C) 2012 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ //#include <linux/spinlock.h> #include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/genalloc.h> #include <linux/io.h> #include <linux/ion.h> #include <linux/mm.h> #include <linux/scatterlist.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include "ion_priv.h" #include <asm/mach/map.h> struct ion_chunk_heap { struct ion_heap heap; struct gen_pool *pool; ion_phys_addr_t base; unsigned long chunk_size; unsigned long size; unsigned long allocated; }; static int ion_chunk_heap_allocate(struct ion_heap *heap, struct ion_buffer *buffer, unsigned long size, unsigned long align, unsigned long flags) { struct ion_chunk_heap *chunk_heap = container_of(heap, struct ion_chunk_heap, heap); struct sg_table *table; struct scatterlist *sg; int ret, i; unsigned long num_chunks; if (ion_buffer_fault_user_mappings(buffer)) return -ENOMEM; num_chunks = ALIGN(size, chunk_heap->chunk_size) / chunk_heap->chunk_size; buffer->size = num_chunks * chunk_heap->chunk_size; if (buffer->size > chunk_heap->size - chunk_heap->allocated) return -ENOMEM; table = kzalloc(sizeof(struct sg_table), GFP_KERNEL); if (!table) return -ENOMEM; ret = sg_alloc_table(table, num_chunks, GFP_KERNEL); if (ret) { kfree(table); return ret; } sg = table->sgl; for (i = 0; i < num_chunks; i++) { unsigned long paddr = gen_pool_alloc(chunk_heap->pool, chunk_heap->chunk_size); if (!paddr) goto err; sg_set_page(sg, phys_to_page(paddr), chunk_heap->chunk_size, 0); sg = sg_next(sg); } buffer->priv_virt = table; chunk_heap->allocated += buffer->size; return 0; err: sg = table->sgl; for (i -= 1; i >= 0; i--) { gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), sg_dma_len(sg)); sg = sg_next(sg); } sg_free_table(table); kfree(table); return -ENOMEM; } static void ion_chunk_heap_free(struct ion_buffer *buffer) { struct ion_heap *heap = buffer->heap; struct ion_chunk_heap *chunk_heap = container_of(heap, struct ion_chunk_heap, heap); struct sg_table *table = buffer->priv_virt; struct scatterlist *sg; int i; ion_heap_buffer_zero(buffer); for_each_sg(table->sgl, sg, table->nents, i) { if (ion_buffer_cached(buffer)) __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), DMA_BIDIRECTIONAL); gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), sg_dma_len(sg)); } chunk_heap->allocated -= buffer->size; sg_free_table(table); kfree(table); } struct sg_table *ion_chunk_heap_map_dma(struct ion_heap *heap, struct ion_buffer *buffer) { return buffer->priv_virt; } void ion_chunk_heap_unmap_dma(struct ion_heap *heap, struct ion_buffer *buffer) { return; } static struct ion_heap_ops chunk_heap_ops = { .allocate = ion_chunk_heap_allocate, .free = ion_chunk_heap_free, .map_dma = ion_chunk_heap_map_dma, .unmap_dma = ion_chunk_heap_unmap_dma, .map_user = ion_heap_map_user, .map_kernel = ion_heap_map_kernel, .unmap_kernel = ion_heap_unmap_kernel, }; struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) { struct ion_chunk_heap *chunk_heap; chunk_heap = kzalloc(sizeof(struct ion_chunk_heap), GFP_KERNEL); if (!chunk_heap) return ERR_PTR(-ENOMEM); chunk_heap->chunk_size = (unsigned long)heap_data->priv; chunk_heap->pool = gen_pool_create(get_order(chunk_heap->chunk_size) + PAGE_SHIFT, -1); if (!chunk_heap->pool) { kfree(chunk_heap); return ERR_PTR(-ENOMEM); } chunk_heap->base = heap_data->base; chunk_heap->size = heap_data->size; chunk_heap->allocated = 0; __dma_page_cpu_to_dev(phys_to_page(heap_data->base), 0, heap_data->size, DMA_BIDIRECTIONAL); gen_pool_add(chunk_heap->pool, chunk_heap->base, heap_data->size, -1); chunk_heap->heap.ops = &chunk_heap_ops; chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE; pr_info("%s: base %lu size %u align %ld\n", __func__, chunk_heap->base, heap_data->size, heap_data->align); return &chunk_heap->heap; } void ion_chunk_heap_destroy(struct ion_heap *heap) { struct ion_chunk_heap *chunk_heap = container_of(heap, struct ion_chunk_heap, heap); gen_pool_destroy(chunk_heap->pool); kfree(chunk_heap); chunk_heap = NULL; }
#ifndef GTIA_H_ #define GTIA_H_ #include "atari.h" #include "screen.h" #define GTIA_OFFSET_HPOSP0 0x00 #define GTIA_OFFSET_M0PF 0x00 #define GTIA_OFFSET_HPOSP1 0x01 #define GTIA_OFFSET_M1PF 0x01 #define GTIA_OFFSET_HPOSP2 0x02 #define GTIA_OFFSET_M2PF 0x02 #define GTIA_OFFSET_HPOSP3 0x03 #define GTIA_OFFSET_M3PF 0x03 #define GTIA_OFFSET_HPOSM0 0x04 #define GTIA_OFFSET_P0PF 0x04 #define GTIA_OFFSET_HPOSM1 0x05 #define GTIA_OFFSET_P1PF 0x05 #define GTIA_OFFSET_HPOSM2 0x06 #define GTIA_OFFSET_P2PF 0x06 #define GTIA_OFFSET_HPOSM3 0x07 #define GTIA_OFFSET_P3PF 0x07 #define GTIA_OFFSET_SIZEP0 0x08 #define GTIA_OFFSET_M0PL 0x08 #define GTIA_OFFSET_SIZEP1 0x09 #define GTIA_OFFSET_M1PL 0x09 #define GTIA_OFFSET_SIZEP2 0x0a #define GTIA_OFFSET_M2PL 0x0a #define GTIA_OFFSET_SIZEP3 0x0b #define GTIA_OFFSET_M3PL 0x0b #define GTIA_OFFSET_SIZEM 0x0c #define GTIA_OFFSET_P0PL 0x0c #define GTIA_OFFSET_GRAFP0 0x0d #define GTIA_OFFSET_P1PL 0x0d #define GTIA_OFFSET_GRAFP1 0x0e #define GTIA_OFFSET_P2PL 0x0e #define GTIA_OFFSET_GRAFP2 0x0f #define GTIA_OFFSET_P3PL 0x0f #define GTIA_OFFSET_GRAFP3 0x10 #define GTIA_OFFSET_TRIG0 0x10 #define GTIA_OFFSET_GRAFM 0x11 #define GTIA_OFFSET_TRIG1 0x11 #define GTIA_OFFSET_COLPM0 0x12 #define GTIA_OFFSET_TRIG2 0x12 #define GTIA_OFFSET_COLPM1 0x13 #define GTIA_OFFSET_TRIG3 0x13 #define GTIA_OFFSET_COLPM2 0x14 #define GTIA_OFFSET_PAL 0x14 #define GTIA_OFFSET_COLPM3 0x15 #define GTIA_OFFSET_COLPF0 0x16 #define GTIA_OFFSET_COLPF1 0x17 #define GTIA_OFFSET_COLPF2 0x18 #define GTIA_OFFSET_COLPF3 0x19 #define GTIA_OFFSET_COLBK 0x1a #define GTIA_OFFSET_PRIOR 0x1b #define GTIA_OFFSET_VDELAY 0x1c #define GTIA_OFFSET_GRACTL 0x1d #define GTIA_OFFSET_HITCLR 0x1e #define GTIA_OFFSET_CONSOL 0x1f extern UBYTE GTIA_GRAFM; extern UBYTE GTIA_GRAFP0; extern UBYTE GTIA_GRAFP1; extern UBYTE GTIA_GRAFP2; extern UBYTE GTIA_GRAFP3; extern UBYTE GTIA_HPOSP0; extern UBYTE GTIA_HPOSP1; extern UBYTE GTIA_HPOSP2; extern UBYTE GTIA_HPOSP3; extern UBYTE GTIA_HPOSM0; extern UBYTE GTIA_HPOSM1; extern UBYTE GTIA_HPOSM2; extern UBYTE GTIA_HPOSM3; extern UBYTE GTIA_SIZEP0; extern UBYTE GTIA_SIZEP1; extern UBYTE GTIA_SIZEP2; extern UBYTE GTIA_SIZEP3; extern UBYTE GTIA_SIZEM; extern UBYTE GTIA_COLPM0; extern UBYTE GTIA_COLPM1; extern UBYTE GTIA_COLPM2; extern UBYTE GTIA_COLPM3; extern UBYTE GTIA_COLPF0; extern UBYTE GTIA_COLPF1; extern UBYTE GTIA_COLPF2; extern UBYTE GTIA_COLPF3; extern UBYTE GTIA_COLBK; extern UBYTE GTIA_GRACTL; extern UBYTE GTIA_M0PL; extern UBYTE GTIA_M1PL; extern UBYTE GTIA_M2PL; extern UBYTE GTIA_M3PL; extern UBYTE GTIA_P0PL; extern UBYTE GTIA_P1PL; extern UBYTE GTIA_P2PL; extern UBYTE GTIA_P3PL; extern UBYTE GTIA_PRIOR; extern UBYTE GTIA_VDELAY; #ifdef USE_COLOUR_TRANSLATION_TABLE extern UWORD GTIA_colour_translation_table[256]; #define GTIA_COLOUR_BLACK GTIA_colour_translation_table[0] #define GTIA_COLOUR_TO_WORD(dest,src) dest = GTIA_colour_translation_table[src]; #else #define GTIA_COLOUR_BLACK 0 #define GTIA_COLOUR_TO_WORD(dest,src) dest = (((UWORD) (src)) << 8) | (src); #endif /* USE_COLOUR_TRANSLATION_TABLE */ extern UBYTE GTIA_pm_scanline[Screen_WIDTH / 2 + 8]; /* there's a byte for every *pair* of pixels */ extern int GTIA_pm_dirty; extern UBYTE GTIA_collisions_mask_missile_playfield; extern UBYTE GTIA_collisions_mask_player_playfield; extern UBYTE GTIA_collisions_mask_missile_player; extern UBYTE GTIA_collisions_mask_player_player; extern UBYTE GTIA_TRIG[4]; extern UBYTE GTIA_TRIG_latch[4]; extern int GTIA_consol_override; extern int GTIA_speaker; int GTIA_Initialise(int *argc, char *argv[]); void GTIA_Frame(void); void GTIA_NewPmScanline(void); UBYTE GTIA_GetByte(UWORD addr, int no_side_effects); void GTIA_PutByte(UWORD addr, UBYTE byte); void GTIA_StateSave(void); void GTIA_StateRead(UBYTE version); #ifdef NEW_CYCLE_EXACT void GTIA_UpdatePmplColls(void); #endif #endif /* GTIA_H_ */
/* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only 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. * */ #include "../../../drivers/video/msm/msm_fb.h" #include "../../../drivers/video/msm/mipi_dsi.h" #include "lcd_mipi_sharp.h" static struct msm_panel_info pinfo; #define DSI_BIT_CLK_366MHZ static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = { #ifdef DSI_BIT_CLK_490MHZ {0x03, 0x01, 0x01, 0x00}, /* regulator */ /* timing DSIPHY_TIMING_CTRL_0 ~ 10 3 is ommited*/ {0x66, 0x26, 0x1f, 0x00, 0x23, 0x97, 0x1E, 0x90, 0x23, 0x03, 0x04}, {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */ {0xee, 0x03, 0x86, 0x03}, /* strength 0*/ /* pll control 1~19*/ {0x41, 0xe6, 0xb2, 0xf5, 0x00, 0x50, 0x48, 0x63, 0x31, 0x0f, 0x07, 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 }, #elif defined(DSI_BIT_CLK_460MHZ) {0x03, 0x01, 0x01, 0x00}, /* regulator */ /* timing DSIPHY_TIMING_CTRL_0 ~ 10 3 is ommited*/ {0x66, 0x26, 0x1d, 0x00, 0x21, 0x95, 0x1E, 0x8f, 0x21, 0x03, 0x04}, {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */ {0xee, 0x03, 0x86, 0x03}, /* strength 0*/ /* pll control 1~19*/ {0x41, 0xcc, 0xb2, 0xf5, 0x00, 0x50, 0x48, 0x63, 0x31, 0x0f, 0x07, 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 }, #elif defined(DSI_BIT_CLK_366MHZ) {0x03, 0x01, 0x01, 0x00}, /* regulator */ /* timing DSIPHY_TIMING_CTRL_0 ~ 10 3 is ommited*/ {0x66, 0x26, 0x17, 0x00, 0x1A, 0x8E, 0x1E, 0x8C, 0x1A, 0x03, 0x04}, {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */ {0xee, 0x03, 0x86, 0x03}, /* strength 0*/ /* pll control 1~19*/ {0x41, 0x6C, 0xb2, 0xf5, 0x00, 0x50, 0x48, 0x63, 0x31, 0x0f, 0x07, 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04, 0x03 }, #else {0x03, 0x01, 0x01, 0x00}, /* regulator */ /* timing DSIPHY_TIMING_CTRL_0 ~ 10 3 is ommited*/ {0x50, 0x0f, 0x14, 0x00, 0x19, 0x23, 0x0e, 0x12, 0x16, 0x1b, 0x1c }, {0x7f, 0x00, 0x00, 0x00}, /* phy ctrl */ {0xee, 0x86}, /* strength 0*/ /* pll control 1~19*/ {0x41, 0x8f, 0xb1, 0xda, 0x00, 0x50, 0x48, 0x63, 0x33, 0x1f, 0x0f, 0x05, 0x14, 0x03, 0x03, 0x03, 0x54, 0x06, 0x10, 0x04}, #endif }; static int __init mipi_video_sharp_wvga_pt_init(void) { int ret; #ifdef CONFIG_FB_MSM_MIPI_PANEL_DETECT if (msm_fb_detect_client("mipi_video_sharp_wvga")) return 0; #endif pinfo.xres = 480; pinfo.yres = 800; pinfo.type = MIPI_VIDEO_PANEL; pinfo.pdest = DISPLAY_1; pinfo.wait_cycle = 0; pinfo.bpp = 24; pinfo.lcdc.h_back_porch = 64;//16; pinfo.lcdc.h_front_porch = 64;//16; pinfo.lcdc.h_pulse_width = 10;//10; pinfo.lcdc.v_back_porch = 8; pinfo.lcdc.v_front_porch = 8; pinfo.lcdc.v_pulse_width = 5; pinfo.lcdc.border_clr = 0; /* blk */ pinfo.lcdc.underflow_clr = 0xff; /* blue */ pinfo.lcdc.hsync_skew = 0; pinfo.bl_max = 22; pinfo.bl_min = 1; pinfo.fb_num = 2; pinfo.mipi.mode = DSI_VIDEO_MODE; pinfo.mipi.pulse_mode_hsa_he = TRUE; pinfo.mipi.hfp_power_stop = TRUE; pinfo.mipi.hbp_power_stop = TRUE; pinfo.mipi.hsa_power_stop = TRUE; pinfo.mipi.eof_bllp_power_stop = TRUE; pinfo.mipi.bllp_power_stop = TRUE; pinfo.mipi.traffic_mode = DSI_NON_BURST_SYNCH_PULSE; pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888; pinfo.mipi.vc = 0; pinfo.mipi.rgb_swap = DSI_RGB_SWAP_BGR; pinfo.mipi.data_lane0 = TRUE; pinfo.mipi.data_lane1 = TRUE; pinfo.mipi.t_clk_post = 0x02; #if defined(DSI_BIT_CLK_392MHZ) pinfo.mipi.t_clk_pre = 0x15; pinfo.clk_rate = 392000000; #elif defined(DSI_BIT_CLK_400MHZ) pinfo.mipi.t_clk_pre = 0x14; pinfo.clk_rate = 400000000; #elif defined(DSI_BIT_CLK_450MHZ) pinfo.mipi.t_clk_pre = 0x17; pinfo.clk_rate = 450000000; #elif defined(DSI_BIT_CLK_460MHZ) pinfo.mipi.t_clk_pre = 0x17; pinfo.clk_rate = 460000000; #endif pinfo.mipi.stream = 0; /* dma_p */ pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_SW; pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW; pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db; ret = mipi_sharp_device_register(&pinfo, MIPI_DSI_PRIM, MIPI_DSI_PANEL_WVGA_PT); if (ret) printk(KERN_ERR "%s: failed to register device!\n", __func__); return ret; } module_init(mipi_video_sharp_wvga_pt_init);
//# MSDopplerEnums.h: Defs for the MS DOPPLER table //# Copyright (C) 1999,2000 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# //# $Id$ #ifndef MS_MSDOPPLERENUMS_H #define MS_MSDOPPLERENUMS_H #include <casacore/casa/aips.h> namespace casacore { //# NAMESPACE CASACORE - BEGIN // <use visibility=export> // <summary> Enums for the MeasurementSet DOPPLER table </summary> // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos=""> // </reviewed> // <etymology> // This class contains the enums for the MeasurementSet DOPPLER table // </etymology> // <synopsis> // This class does nothing. It is merely a container for the enumerations // used by the MSDoppler class. These enumerations define the // standard columns, keywords. // </synopsis> // <example> // See the documentation for MeasurementSet for examples on the use of these // enumerations. // </example> // <todo asof="1999/01/13"> // All the todo items which may be related to this class are // grouped with the todo items for MeasurementSet // </todo> // class MSDopplerEnums { public: // The DOPPLER table colums with predefined meaning. enum PredefinedColumns { // "True" columns are defined.<BR> // TYPE - UNIT - MEASURE UNDEFINED_COLUMN=0, // doppler tracking id, used in SPECTRAL_WINDOW table <BR> // Int. DOPPLER_ID, // Source id, pointer to SOURCE table <BR> // Int. SOURCE_ID, // Transition id, index into list of transitions in SOURCE table<BR> // Int TRANSITION_ID, // Velocity definition for Doppler shift // Double - m/s - DOPPLER VELDEF, // Number of required columns NUMBER_REQUIRED_COLUMNS=VELDEF, // Not a column, but just a final enum specifying the number of enums. NUMBER_PREDEFINED_COLUMNS=NUMBER_REQUIRED_COLUMNS }; // Keywords with a predefined meaning enum PredefinedKeywords { // // "True" keywords are defined. UNDEFINED_KEYWORD=0, // // Not a keyword, but just a final enum specifying the number of enums. NUMBER_PREDEFINED_KEYWORDS=0 }; }; } //# NAMESPACE CASACORE - END #endif
#ifndef _ASM_GENERIC_BITOPS_FLS64_H_ #define _ASM_GENERIC_BITOPS_FLS64_H_ #include <asm/types.h> /* */ #if BITS_PER_LONG == 32 static __always_inline int fls64(__u64 x) { __u32 h = x >> 32; if (h) return fls(h) + 32; return fls(x); } #elif BITS_PER_LONG == 64 static __always_inline int fls64(__u64 x) { if (x == 0) return 0; return __fls(x) + 1; } #else #error BITS_PER_LONG not 32 or 64 #endif #endif /* */
/* * U-boot - Configuration file for BF561 EZKIT board */ #ifndef __CONFIG_BF561_EZKIT_H__ #define __CONFIG_BF561_EZKIT_H__ #include <asm/config-pre.h> /* * Processor Settings */ #define CONFIG_BFIN_CPU bf561-0.3 #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS /* * Clock Settings * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV */ /* CONFIG_CLKIN_HZ is any value in Hz */ #define CONFIG_CLKIN_HZ 30000000 /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */ /* 1 = CLKIN / 2 */ #define CONFIG_CLKIN_HALF 0 /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */ /* 1 = bypass PLL */ #define CONFIG_PLL_BYPASS 0 /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */ /* Values can range from 0-63 (where 0 means 64) */ #define CONFIG_VCO_MULT 20 /* CCLK_DIV controls the core clock divider */ /* Values can be 1, 2, 4, or 8 ONLY */ #define CONFIG_CCLK_DIV 1 /* SCLK_DIV controls the system clock divider */ /* Values can range from 1-15 */ #define CONFIG_SCLK_DIV 6 /* * Memory Settings */ #define CONFIG_MEM_ADD_WDTH 9 #define CONFIG_MEM_SIZE 64 #define CONFIG_EBIU_SDRRC_VAL 0x306 #define CONFIG_EBIU_SDGCTL_VAL 0x91114d #define CONFIG_EBIU_AMGCTL_VAL 0x3F #define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0 #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0 #define CONFIG_SYS_MONITOR_LEN (256 * 1024) #define CONFIG_SYS_MALLOC_LEN (128 * 1024) /* * Network Settings */ #define ADI_CMDS_NETWORK 1 #define CONFIG_NET_MULTI #define CONFIG_SMC91111 1 #define CONFIG_SMC91111_BASE 0x2C010300 #define CONFIG_SMC_USE_32_BIT 1 #define CONFIG_HOSTNAME bf561-ezkit /* Uncomment next line to use fixed MAC address */ /* #define CONFIG_ETHADDR 02:80:ad:20:31:e8 */ /* * Flash Settings */ #define CONFIG_SYS_FLASH_CFI #define CONFIG_FLASH_CFI_DRIVER #define CONFIG_SYS_FLASH_CFI_AMD_RESET #define CONFIG_SYS_FLASH_BASE 0x20000000 #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 135 /* The BF561-EZKIT uses a top boot flash */ #define CONFIG_ENV_IS_IN_FLASH 1 #define CONFIG_ENV_ADDR 0x20004000 #define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE) #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_ENV_SECT_SIZE 0x10000 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS) #define ENV_IS_EMBEDDED #else #define CONFIG_ENV_IS_EMBEDDED_IN_LDR #endif #ifdef ENV_IS_EMBEDDED /* WARNING - the following is hand-optimized to fit within * the sector before the environment sector. If it throws * an error during compilation remove an object here to get * it linked after the configuration sector. */ # define LDS_BOARD_TEXT \ arch/blackfin/cpu/traps.o (.text .text.*); \ arch/blackfin/cpu/interrupt.o (.text .text.*); \ arch/blackfin/cpu/serial.o (.text .text.*); \ common/dlmalloc.o (.text .text.*); \ lib/crc32.o (.text .text.*); \ lib/zlib.o (.text .text.*); \ board/bf561-ezkit/bf561-ezkit.o (.text .text.*); \ . = DEFINED(env_offset) ? env_offset : .; \ common/env_embedded.o (.text .text.*); #endif /* * I2C Settings */ #define CONFIG_SOFT_I2C #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF0 #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF1 /* * Misc Settings */ #define CONFIG_UART_CONSOLE 0 /* * Pull in common ADI header for remaining command/environment setup */ #include <configs/bfin_adi_common.h> #endif
/* * linux/include/linux/mmc/pm.h * * Author: Nicolas Pitre * Copyright: (C) 2009 Marvell Technology Group 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. */ #ifndef LINUX_MMC_PM_H #define LINUX_MMC_PM_H /* * These flags are used to describe power management features that * some cards (typically SDIO cards) might wish to benefit from when * the host system is being suspended. There are several layers of * abstractions involved, from the host controller driver, to the MMC core * code, to the SDIO core code, to finally get to the actual SDIO function * driver. This file is therefore used for common definitions shared across * all those layers. */ typedef unsigned int mmc_pm_flag_t; #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ #define MMC_PM_IGNORE_PM_NOTIFY (1 << 2) /* ignore mmc pm notify */ #define MMC_PM_DISABLE_TIMEOUT_IRQ (1 << 3) /* disable irq timeout bit */ #endif
/* COVERAGE: sendfile */ #include <fcntl.h> #include <stdlib.h> #include <stdio.h> #include <sys/sendfile.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <string.h> int main () { int fd, read_fd; int write_fd; struct stat stat_buf; off_t offset = 0; char buff[22]; // Note below 22 == EINVAL int ret; memset(buff, 5, sizeof(buff)); /* create a file with something in it */ fd = creat("foobar",S_IREAD|S_IWRITE); write(fd, buff, sizeof(buff)); fsync(fd); close(fd); read_fd = open ("foobar", O_RDONLY); if (read_fd < 0) return 1; fstat (read_fd, &stat_buf); /* Open the output file for writing */ write_fd = creat("foobar2",S_IREAD|S_IWRITE|S_IRWXO); /* * For 2.6 the write_fd had to be a socket otherwise * sendfile would fail. So we also test for failure here. */ ret = sendfile (write_fd, read_fd, &offset, stat_buf.st_size); //staptest// sendfile (NNNN, NNNN, XXXX, 22) = -?22 close (read_fd); close (write_fd); unlink("foobar"); unlink("foobar2"); return 0; }
/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. 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 <assert.h> #include <errno.h> #include <limits.h> #include <stdlib.h> #include <string.h> #include <pthreadP.h> #include <shlib-compat.h> /* Defined in pthread_setaffinity.c. */ extern size_t __kernel_cpumask_size attribute_hidden; extern int __determine_cpumask_size (pid_t tid); int __pthread_attr_setaffinity_new (pthread_attr_t *attr, size_t cpusetsize, const cpu_set_t *cpuset) { struct pthread_attr *iattr; assert (sizeof (*attr) >= sizeof (struct pthread_attr)); iattr = (struct pthread_attr *) attr; if (cpuset == NULL || cpusetsize == 0) { free (iattr->cpuset); iattr->cpuset = NULL; iattr->cpusetsize = 0; } else { if (__kernel_cpumask_size == 0) { int res = __determine_cpumask_size (THREAD_SELF->tid); if (res != 0) /* Some serious problem. */ return res; } /* Check whether the new bitmask has any bit set beyond the last one the kernel accepts. */ for (size_t cnt = __kernel_cpumask_size; cnt < cpusetsize; ++cnt) if (((char *) cpuset)[cnt] != '\0') /* Found a nonzero byte. This means the user request cannot be fulfilled. */ return EINVAL; if (iattr->cpusetsize != cpusetsize) { void *newp = (cpu_set_t *) realloc (iattr->cpuset, cpusetsize); if (newp == NULL) return ENOMEM; iattr->cpuset = newp; iattr->cpusetsize = cpusetsize; } memcpy (iattr->cpuset, cpuset, cpusetsize); } return 0; } versioned_symbol (libpthread, __pthread_attr_setaffinity_new, pthread_attr_setaffinity_np, GLIBC_2_3_4); #if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) int __pthread_attr_setaffinity_old (pthread_attr_t *attr, cpu_set_t *cpuset) { /* The old interface by default assumed a 1024 processor bitmap. */ return __pthread_attr_setaffinity_new (attr, 128, cpuset); } compat_symbol (libpthread, __pthread_attr_setaffinity_old, pthread_attr_setaffinity_np, GLIBC_2_3_3); #endif
/**************************************************************************** ** ** This file is part of the Qt Extended Opensource Package. ** ** Copyright (C) 2009 Trolltech ASA. ** ** Contact: Qt Extended Information (info@qtextended.org) ** ** This file may be used under the terms of the GNU General Public License ** version 2.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 GNU General Public ** Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html. ** ** ****************************************************************************/ #ifndef PENSETTINGSWIDGET_H #define PENSETTINGSWIDGET_H #include <qwidget.h> #include <qlist.h> #include <char.h> class QIMPenSettingsWidget : public QWidget { Q_OBJECT public: QIMPenSettingsWidget( QWidget *parent, const char *name = 0 ); ~QIMPenSettingsWidget(); void clear(); void greyStroke(); void setReadOnly( bool r ) { readOnly = r; } void insertCharSet( QIMPenCharSet *cs, int stretch=1, int pos=-1 ); void removeCharSet( int ); void changeCharSet( QIMPenCharSet *cs, int pos ); void clearCharSets(); void showCharacter( QIMPenChar *, int speed = 10 ); virtual QSize sizeHint() const; public slots: void removeStroke(); signals: void changeCharSet( QIMPenCharSet *cs ); void changeCharSet( int ); void beginStroke(); void stroke( QIMPenStroke *ch ); protected slots: void timeout(); protected: enum Mode { Waiting, Input, Output }; bool selectSet( QPoint ); virtual void mousePressEvent( QMouseEvent *e ); virtual void mouseReleaseEvent( QMouseEvent *e ); virtual void mouseMoveEvent( QMouseEvent *e ); virtual void paintEvent( QPaintEvent *e ); virtual void resizeEvent( QResizeEvent *e ); struct CharSetEntry { QIMPenCharSet *cs; int stretch; }; typedef QList<CharSetEntry *> CharSetEntryList; typedef QList<CharSetEntry *>::iterator CharSetEntryIterator; typedef QList<CharSetEntry *>::const_iterator CharSetEntryConstIterator; protected: Mode mode; bool autoHide; bool readOnly; QPoint lastPoint; int pointIndex; int strokeIndex; int currCharSet; QTimer *timer; QColor strokeColor; QRect dirtyRect; QIMPenChar *outputChar; QIMPenStroke *outputStroke; QIMPenStroke *inputStroke; QIMPenStrokeList strokes; CharSetEntryList charSets; int totalStretch; QList<QRect> penMoves; }; #endif
#ifndef _HW_COMDLINE_PARSE_H #define _HW_COMDLINE_PARSE_H /* Format of hex string: 0x12345678 */ #define HEX_STRING_MAX (10) #define TRANSFER_BASE (16) #define RUNMODE_FLAG_NORMAL 0 #define RUNMODE_FLAG_FACTORY 1 extern int get_logctl_value(void); extern unsigned int runmode_is_factory(void); extern int get_uart0_config(void); #endif
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _INSTANCE_H_ #define _INSTANCE_H_ #define MAX_MAP_PER_INSTANCE 10 #define MAX_INSTANCE 500 typedef enum instance_state { INSTANCE_FREE, INSTANCE_IDLE, INSTANCE_BUSSY } instance_state; struct s_instance { char name[61]; // Instance Name - required for clif functions. instance_state state; short instance_id; int party_id; int map[MAX_MAP_PER_INSTANCE]; int num_map; int users; struct linkdb_node *ivar, *svar; // Instance Variable for scripts int progress_timer; time_t progress_timeout, progress_timeoutval; int idle_timer; time_t idle_timeout, idle_timeoutval; }; extern int instance_start; extern struct s_instance instance[MAX_INSTANCE]; int instance_create(int party_id, const char *name); int instance_add_map(const char *name, int instance_id, bool usebasename); void instance_del_map(int m); int instance_map2imap(int m, int instance_id); int instance_mapid2imapid(int m, int instance_id); void instance_destroy(int instance_id); void instance_init(int instance_id); void instance_check_idle(int instance_id); void instance_check_kick(struct map_session_data *sd); void instance_set_timeout(int instance_id, unsigned int progress_timeout, unsigned int idle_timeout); void do_init_instance(); #endif
/* * Copyright 2020 Free Software Foundation, Inc. * * This file is part of GNU Radio * * SPDX-License-Identifier: GPL-3.0-or-later * */ #include "pydoc_macros.h" #define D(...) DOC(gr, vocoder, __VA_ARGS__) /* This file contains placeholders for docstrings for the Python bindings. Do not edit! These were automatically extracted during the binding process and will be overwritten during the build process */ static const char* __doc_gr_vocoder_ulaw_encode_sb = R"doc()doc"; static const char* __doc_gr_vocoder_ulaw_encode_sb_ulaw_encode_sb = R"doc()doc"; static const char* __doc_gr_vocoder_ulaw_encode_sb_make = R"doc()doc";
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _INTIF_H_ #define _INFIF_H_ //#include "../common/mmo.h" struct party_member; struct guild_member; struct guild_position; struct s_pet; struct s_homunculus; struct s_mercenary; struct mail_message; struct auction_data; int intif_parse(int fd); int intif_broadcast(const char* mes, int len, int type); int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY); int intif_wis_message(struct map_session_data *sd,char *nick,char *mes,int mes_len); int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes); int intif_saveregistry(struct map_session_data *sd, int type); int intif_request_registry(struct map_session_data *sd, int flag); int intif_request_guild_storage(int account_id, int guild_id); int intif_send_guild_storage(int account_id, struct guild_storage *gstor); int intif_create_party(struct party_member *member,char *name,int item,int item2); int intif_request_partyinfo(int party_id, int char_id); int intif_party_addmember(int party_id,struct party_member *member); int intif_party_changeoption(int party_id, int account_id, int exp, int item); int intif_party_leave(int party_id,int account_id, int char_id); int intif_party_changemap(struct map_session_data *sd, int online); int intif_break_party(int party_id); int intif_party_message(int party_id, int account_id, const char *mes,int len); int intif_party_leaderchange(int party_id,int account_id,int char_id); int intif_guild_create(const char *name, const struct guild_member *master); int intif_guild_request_info(int guild_id); int intif_guild_addmember(int guild_id, struct guild_member *m); int intif_guild_leave(int guild_id, int account_id, int char_id, int flag, const char *mes); int intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int class_); int intif_guild_break(int guild_id); int intif_guild_message(int guild_id, int account_id, const char *mes, int len); int intif_guild_change_gm(int guild_id, const char* name, int len); int intif_guild_change_basicinfo(int guild_id, int type, const void *data, int len); int intif_guild_change_memberinfo(int guild_id, int account_id, int char_id, int type, const void *data, int len); int intif_guild_position(int guild_id, int idx, struct guild_position *p); int intif_guild_skillup(int guild_id, int skill_num, int account_id, int max); int intif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int account_id2, int flag); int intif_guild_notice(int guild_id, const char *mes1, const char *mes2); int intif_guild_emblem(int guild_id, int len, const char *data); int intif_guild_castle_dataload(int castle_id, int index); int intif_guild_castle_datasave(int castle_id, int index, int value); int intif_create_pet(int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incuvate, char *pet_name); int intif_request_petdata(int account_id, int char_id, int pet_id); int intif_save_petdata(int account_id, struct s_pet *p); int intif_delete_petdata(int pet_id); int intif_rename(struct map_session_data *sd, int type, char *name); #define intif_rename_pc(sd, name) intif_rename(sd, 0, name) #define intif_rename_pet(sd, name) intif_rename(sd, 1, name) #define intif_rename_hom(sd, name) intif_rename(sd, 2, name) int intif_homunculus_create(int account_id, struct s_homunculus *sh); int intif_homunculus_requestload(int account_id, int homun_id); int intif_homunculus_requestsave(int account_id, struct s_homunculus* sh); int intif_homunculus_requestdelete(int homun_id); /******QUEST SYTEM*******/ int intif_request_questlog(struct map_session_data * sd); int intif_quest_save(struct map_session_data * sd); // MERCENARY SYSTEM int intif_mercenary_create(struct s_mercenary *merc); int intif_mercenary_request(int merc_id, int char_id); int intif_mercenary_delete(int merc_id); int intif_mercenary_save(struct s_mercenary *merc); #ifndef TXT_ONLY // MAIL SYSTEM int intif_Mail_requestinbox(int char_id, unsigned char flag); int intif_Mail_read(int mail_id); int intif_Mail_getattach(int char_id, int mail_id); int intif_Mail_delete(int char_id, int mail_id); int intif_Mail_return(int char_id, int mail_id); int intif_Mail_send(int account_id, struct mail_message *msg); // AUCTION SYSTEM int intif_Auction_requestlist(int char_id, short type, int price, const char* searchtext, short page); int intif_Auction_register(struct auction_data *auction); int intif_Auction_cancel(int char_id, unsigned int auction_id); int intif_Auction_close(int char_id, unsigned int auction_id); int intif_Auction_bid(int char_id, const char* name, unsigned int auction_id, int bid); #endif int CheckForCharServer(void); #endif /* _INTIF_H_ */
/* * Copyright 2008-2013 NVIDIA Corporation * * 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. */ #pragma once #include <thrust/detail/config.h> // the purpose of this header is to #include the sort.h header // of the sequential, host, and device systems. It should be #included in any // code which uses adl to dispatch sort #include <thrust/system/detail/sequential/sort.h> // SCons can't see through the #defines below to figure out what this header // includes, so we fake it out by specifying all possible files we might end up // including inside an #if 0. #if 0 #include <thrust/system/cpp/detail/sort.h> #include <thrust/system/cuda/detail/sort.h> #include <thrust/system/omp/detail/sort.h> #include <thrust/system/tbb/detail/sort.h> #endif #define __THRUST_HOST_SYSTEM_SORT_HEADER <__THRUST_HOST_SYSTEM_ROOT/detail/sort.h> #include __THRUST_HOST_SYSTEM_SORT_HEADER #undef __THRUST_HOST_SYSTEM_SORT_HEADER #define __THRUST_DEVICE_SYSTEM_SORT_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/detail/sort.h> #include __THRUST_DEVICE_SYSTEM_SORT_HEADER #undef __THRUST_DEVICE_SYSTEM_SORT_HEADER
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ namespace stm32plus { /** * Helper class to read from an STL string using the InputStream interface */ class StlStringInputStream : public InputStream { public: enum { E_INVALID_SEEK_POSITION = 1 }; protected: const std::string *_string; bool _delete; std::string::size_type _pos; public: StlStringInputStream(const std::string *str,bool takeOwnership); virtual ~StlStringInputStream(); // overrides from InputStream virtual int16_t read() override; virtual bool read(void *buffer,uint32_t size,uint32_t& actuallyRead) override; virtual bool skip(uint32_t howMuch) override; virtual bool available() override; virtual bool reset() override; // overrides from StreamBase virtual bool close() override; }; /** * Constructor * @param str The string pointer * @param takeOwnership true if we must delete on destruction */ inline StlStringInputStream::StlStringInputStream(const std::string *str,bool takeOwnership) : _string(str), _delete(takeOwnership), _pos(0) { } /** * Destructor */ inline StlStringInputStream::~StlStringInputStream() { if(_delete) delete _string; } /** * Read a single byte * @return the byte or E_END_OF_STREAM */ inline int16_t StlStringInputStream::read() { if(_pos==_string->length()) return E_END_OF_STREAM; return (*_string)[_pos++]; } /** * Read many characters * @param buffer Where to read out to * @param size Number requested * @param actuallyRead Number actually read out * @return true, always. zero actually read indicates EOF */ inline bool StlStringInputStream::read(void *buffer,uint32_t size,uint32_t& actuallyRead) { actuallyRead=std::min(size,static_cast<uint32_t>(_string->length()-_pos)); if(actuallyRead) { memcpy(buffer,_string->c_str()+_pos,actuallyRead); _pos+=actuallyRead; } return true; } /** * Seek forward in the stream * @param howMuch amount to seek * @return true if OK, false if tried to seek past end */ inline bool StlStringInputStream::skip(uint32_t howMuch) { // check validity of how much if(howMuch>_string->length()-_pos) return errorProvider.set(ErrorProvider::ERROR_PROVIDER_STL_STRING_INPUT_STREAM,E_INVALID_SEEK_POSITION); // move forward _pos+=howMuch; return true; } /** * Return true if some data is available for reading * @return true if data is available */ inline bool StlStringInputStream::available() { return _string->length()!=_pos; } /** * Reset to the start of the stream * @return Always true */ inline bool StlStringInputStream::reset() { _pos=0; return true; } /** * Do nothing close * @return true always */ inline bool StlStringInputStream::close() { return true; } }
reg_t v = MMU.load_int32(RS1); MMU.store_uint32(RS1, RS2 ^ v); WRITE_RD(v);
/* C Includes */ #include <stdio.h> #include <stdlib.h> /* HyperDex Includes */ #include <hyperdex/datastructures.h> int main(int argc, const char* argv[]) { int64_t num; const char* value = "\x01\x00\x00\x00\x00\x00\x00\x00" "\xff\xff\xff\xff\xff\xff\xff\xff" "\xef\xbe\xad\xde\x00\x00\x00\x00"; size_t value_sz = 24; int status = 0; hyperdex_ds_iterator iter; hyperdex_ds_iterator_init(&iter, HYPERDATATYPE_LIST_INT64, value, value_sz); while ((status = hyperdex_ds_iterate_list_int_next(&iter, &num)) > 0) { printf("%ld\n", num); } if (status < 0) { printf("error: corrupt list\n"); } return EXIT_SUCCESS; }
/* * * Copyright 2015, 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: * * * 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 Google 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 GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H #define GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H #include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/pollset_set.h" #include "src/core/iomgr/sockaddr.h" #include <grpc/support/time.h> /* Asynchronously connect to an address (specified as (addr, len)), and call cb with arg and the completed connection when done (or call cb with arg and NULL on failure). interested_parties points to a set of pollsets that would be interested in this connection being established (in order to continue their work) */ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp), void *arg, grpc_pollset_set *interested_parties, const struct sockaddr *addr, int addr_len, gpr_timespec deadline); #endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H */
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_ #define CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_ #include "chrome/browser/vr/vr_base_export.h" #include "components/security_state/core/security_state.h" #include "url/gurl.h" namespace gfx { struct VectorIcon; } namespace vr { // Passes information obtained from LocationBarModel to the VR UI framework. struct VR_BASE_EXPORT LocationBarState { public: LocationBarState(); LocationBarState(const GURL& url, security_state::SecurityLevel level, const gfx::VectorIcon* icon, bool display_url, bool offline); LocationBarState(const LocationBarState& other); LocationBarState& operator=(const LocationBarState& other); bool operator==(const LocationBarState& other) const; bool operator!=(const LocationBarState& other) const; GURL gurl; security_state::SecurityLevel security_level; const gfx::VectorIcon* vector_icon; bool should_display_url; bool offline_page; }; } // namespace vr #endif // CHROME_BROWSER_VR_MODEL_LOCATION_BAR_STATE_H_
/* * Phusion Passenger - http://www.modrails.com/ * Copyright (c) 2010 Phusion * * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui. * * 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 _PASSENGER_CACHED_FILE_STAT_H_ #define _PASSENGER_CACHED_FILE_STAT_H_ #include <sys/stat.h> #ifdef __cplusplus extern "C" { #endif /** C bindings for Passenger::CachedFileStat. */ typedef void PassengerCachedFileStat; PassengerCachedFileStat *cached_file_stat_new(unsigned int max_size); void cached_file_stat_free(PassengerCachedFileStat *cstat); int cached_file_stat_perform(PassengerCachedFileStat *cstat, const char *filename, struct stat *buf, unsigned int throttle_rate); #ifdef __cplusplus } #endif #endif /* _PASSENGER_CACHED_FILE_STAT_H_ */
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include <string.h> #include "py/obj.h" #include "py/runtime.h" typedef struct _mp_obj_closure_t { mp_obj_base_t base; mp_obj_t fun; size_t n_closed; mp_obj_t closed[]; } mp_obj_closure_t; STATIC mp_obj_t closure_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_obj_closure_t *self = MP_OBJ_TO_PTR(self_in); // need to concatenate closed-over-vars and args size_t n_total = self->n_closed + n_args + 2 * n_kw; if (n_total <= 5) { // use stack to allocate temporary args array mp_obj_t args2[5]; memcpy(args2, self->closed, self->n_closed * sizeof(mp_obj_t)); memcpy(args2 + self->n_closed, args, (n_args + 2 * n_kw) * sizeof(mp_obj_t)); return mp_call_function_n_kw(self->fun, self->n_closed + n_args, n_kw, args2); } else { // use heap to allocate temporary args array mp_obj_t *args2 = m_new(mp_obj_t, n_total); memcpy(args2, self->closed, self->n_closed * sizeof(mp_obj_t)); memcpy(args2 + self->n_closed, args, (n_args + 2 * n_kw) * sizeof(mp_obj_t)); mp_obj_t res = mp_call_function_n_kw(self->fun, self->n_closed + n_args, n_kw, args2); m_del(mp_obj_t, args2, n_total); return res; } } #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED STATIC void closure_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_closure_t *o = MP_OBJ_TO_PTR(o_in); mp_print_str(print, "<closure "); mp_obj_print_helper(print, o->fun, PRINT_REPR); mp_printf(print, " at %p, n_closed=%u ", o, (int)o->n_closed); for (size_t i = 0; i < o->n_closed; i++) { if (o->closed[i] == MP_OBJ_NULL) { mp_print_str(print, "(nil)"); } else { mp_obj_print_helper(print, o->closed[i], PRINT_REPR); } mp_print_str(print, " "); } mp_print_str(print, ">"); } #endif const mp_obj_type_t mp_type_closure = { { &mp_type_type }, .flags = MP_TYPE_FLAG_BINDS_SELF, .name = MP_QSTR_closure, #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED .print = closure_print, #endif .call = closure_call, }; mp_obj_t mp_obj_new_closure(mp_obj_t fun, size_t n_closed_over, const mp_obj_t *closed) { mp_obj_closure_t *o = m_new_obj_var(mp_obj_closure_t, mp_obj_t, n_closed_over); o->base.type = &mp_type_closure; o->fun = fun; o->n_closed = n_closed_over; memcpy(o->closed, closed, n_closed_over * sizeof(mp_obj_t)); return MP_OBJ_FROM_PTR(o); }
/* Copyright (c) 2012-2014, The Linux Foundation. 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 Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * 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 _TARGET_COPPER_DISPLAY_H #define _TARGET_COPPER_DISPLAY_H /*---------------------------------------------------------------------------*/ /* HEADER files */ /*---------------------------------------------------------------------------*/ #include <display_resource.h> /*---------------------------------------------------------------------------*/ /* GPIO configuration */ /*---------------------------------------------------------------------------*/ static struct gpio_pin reset_gpio = { "pm8941_gpios", 19, 2, 1, 0, 1 }; static struct gpio_pin enable_gpio = { "msmgpio", 58, 3, 1, 0, 1 }; static struct gpio_pin pwm_gpio = { "pm8941_gpios", 36, 3, 1, 0, 1 }; /*---------------------------------------------------------------------------*/ /* LDO configuration */ /*---------------------------------------------------------------------------*/ static struct ldo_entry ldo_entry_array[] = { { "vdd", 22, 0, 3000000, 100000, 100, 0, 20, 0, 0}, { "vddio", 12, 0, 1800000, 100000, 100, 0, 20, 0, 0}, { "vdda", 2, 1, 1200000, 100000, 100, 0, 0, 0, 0}, }; #define TOTAL_LDO_DEFINED 3 /*---------------------------------------------------------------------------*/ /* Target Physical configuration */ /*---------------------------------------------------------------------------*/ static const uint32_t panel_strength_ctrl[] = { 0xff, 0x06 }; static const char panel_bist_ctrl[] = { 0x00, 0x00, 0xb1, 0xff, 0x00, 0x00 }; static const uint32_t panel_regulator_settings[] = { 0x07, 0x09, 0x03, 0x00, 0x20, 0x00, 0x01 }; static const char panel_lane_config[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x97, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x97, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x97, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x97, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbb }; static const uint32_t panel_physical_ctrl[] = { 0x5f, 0x00, 0x00, 0x10 }; /*---------------------------------------------------------------------------*/ /* Other Configuration */ /*---------------------------------------------------------------------------*/ #define MIPI_FB_ADDR 0x03200000 #define EDP_FB_ADDR MIPI_FB_ADDR #define MIPI_HSYNC_PULSE_WIDTH 12 #define MIPI_HSYNC_BACK_PORCH_DCLK 32 #define MIPI_HSYNC_FRONT_PORCH_DCLK 144 #define MIPI_VSYNC_PULSE_WIDTH 4 #define MIPI_VSYNC_BACK_PORCH_LINES 3 #define MIPI_VSYNC_FRONT_PORCH_LINES 9 #define PWM_BL_LPG_CHAN_ID 8 extern int mdss_dsi_phy_init(struct mipi_dsi_panel_config *, uint32_t ctl_base); #endif
// Copyright (c) 2010 Satoshi Nakamoto // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_RPC_H #define BITCOIN_RPC_H #include "json/json_spirit.h" void ThreadRPCServer(void* parg); json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams); void RPCConvertValues(const std::string &strMethod, json_spirit::Array &params); int CommandLineRPC(int argc, char *argv[]); json_spirit::Value ExecuteRPC(const std::string &strMethod, const std::vector<std::string> &vParams); json_spirit::Value ExecuteRPC(const std::string &strMethod, const json_spirit::Array &params); /* Type-check arguments; throws JSONRPCError if wrong type given. Does not check that the right number of arguments are passed, just that any passed are the correct type. Use like: RPCTypeCheck(params, boost::assign::list_of(str_type)(int_type)(obj_type)); */ void RPCTypeCheck(const json_spirit::Array& params, const std::list<json_spirit::Value_type>& typesExpected, bool fAllowNull=false); /* Check for expected keys/value types in an Object. Use like: RPCTypeCheck(object, boost::assign::map_list_of("name", str_type)("value", int_type)); */ void RPCTypeCheck(const json_spirit::Object& o, const std::map<std::string, json_spirit::Value_type>& typesExpected, bool fAllowNull=false); extern std::string HelpRequiringPassphrase(); extern void EnsureWalletIsUnlocked(); // Bitcoin RPC error codes enum RPCErrorCode { // Standard JSON-RPC 2.0 errors RPC_INVALID_REQUEST = -32600, RPC_METHOD_NOT_FOUND = -32601, RPC_INVALID_PARAMS = -32602, RPC_INTERNAL_ERROR = -32603, RPC_PARSE_ERROR = -32700, // General application defined errors RPC_MISC_ERROR = -1, // std::exception thrown in command handling RPC_FORBIDDEN_BY_SAFE_MODE = -2, // Server is in safe mode, and command is not allowed in safe mode RPC_TYPE_ERROR = -3, // Unexpected type was passed as parameter RPC_INVALID_ADDRESS_OR_KEY = -5, // Invalid address or key RPC_OUT_OF_MEMORY = -7, // Ran out of memory during operation RPC_INVALID_PARAMETER = -8, // Invalid, missing or duplicate parameter RPC_DATABASE_ERROR = -20, // Database error RPC_DESERIALIZATION_ERROR = -22, // Error parsing or validating structure in raw format // P2P client errors RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, // Still downloading initial blocks // Wallet errors RPC_WALLET_ERROR = -4, // Unspecified problem with wallet (key not found etc.) RPC_WALLET_INSUFFICIENT_FUNDS = -6, // Not enough funds in wallet or account RPC_WALLET_INVALID_ACCOUNT_NAME = -11, // Invalid account name RPC_WALLET_KEYPOOL_RAN_OUT = -12, // Keypool ran out, call keypoolrefill first RPC_WALLET_UNLOCK_NEEDED = -13, // Enter the wallet passphrase with walletpassphrase first RPC_WALLET_PASSPHRASE_INCORRECT = -14, // The wallet passphrase entered was incorrect RPC_WALLET_WRONG_ENC_STATE = -15, // Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.) RPC_WALLET_ENCRYPTION_FAILED = -16, // Failed to encrypt the wallet RPC_WALLET_ALREADY_UNLOCKED = -17, // Wallet is already unlocked }; #endif
/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2018 NXP */ #ifndef _SNVS_SECURITY_SC_H #define _SNVS_SECURITY_SC_H int snvs_security_sc_init(void); #endif /* _SNVS_SECURITY_SC_H */
/********************************************************************\ * 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, contact: * * * * Free Software Foundation Voice: +1-617-542-5942 * * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ /** @addtogroup Import_Export @{ */ /**@internal @file gncmod-csv-export.c @brief module definition/initialization for the csv exporter @author Copyright (c) 2012 Robert Fewell */ #include "config.h" #include <gmodule.h> #include "gnc-module.h" #include "gnc-module-api.h" #include "gnc-plugin-csv-export.h" GNC_MODULE_API_DECL(libgncmod_csv_export) /* version of the gnc module system interface we require */ int libgncmod_csv_export_gnc_module_system_interface = 0; /* module versioning uses libtool semantics. */ int libgncmod_csv_export_gnc_module_current = 0; int libgncmod_csv_export_gnc_module_revision = 0; int libgncmod_csv_export_gnc_module_age = 0; //static GNCModule bus_core; //static GNCModule file; char * libgncmod_csv_export_gnc_module_path(void) { return g_strdup("gnucash/import-export/csv-export"); } char * libgncmod_csv_export_gnc_module_description(void) { return g_strdup("Gnome GUI and C code for CSV exporter."); } int libgncmod_csv_export_gnc_module_init(int refcount) { if (!gnc_module_load("gnucash/engine", 0)) { return FALSE; } if (!gnc_module_load("gnucash/app-utils", 0)) { return FALSE; } if (!gnc_module_load("gnucash/gnome-utils", 0)) { return FALSE; } if (!gnc_module_load("gnucash/import-export", 0)) { return FALSE; } /* Add menu items with C callbacks */ gnc_plugin_csv_export_create_plugin(); return TRUE; } int libgncmod_csv_export_gnc_module_end(int refcount) { return TRUE; } /** @}*/
#ifndef __LINUX_UIO_H #define __LINUX_UIO_H #include <linux/compiler.h> #include <linux/types.h> /* * Berkeley style UIO structures - Alan Cox 1994. * * 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. */ struct iovec { void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ }; /* * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) */ #define UIO_FASTIOV 8 #define UIO_MAXIOV 1024 #ifdef __KERNEL__ struct kvec { void *iov_base; /* and that should *never* hold a userland pointer */ size_t iov_len; }; /* * Total number of bytes covered by an iovec. * * NOTE that it is not safe to use this function until all the iovec's * segment lengths have been validated. Because the individual lengths can * overflow a size_t when added together. */ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs) { unsigned long seg; size_t ret = 0; for (seg = 0; seg < nr_segs; seg++) ret += iov[seg].iov_len; return ret; } unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); #endif #endif
/* * Copyright (C) 2005-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include <utility> #include <vector> #include "RenderInfo.h" #include "utils/Geometry.h" #include "VideoShaders/ShaderFormats.h" #include "cores/IPlayer.h" #include "cores/VideoPlayer/Process/VideoBuffer.h" #define MAX_FIELDS 3 #define NUM_BUFFERS 6 class CSetting; enum EFIELDSYNC { FS_NONE, FS_TOP, FS_BOT }; // Render Methods enum RenderMethods { RENDER_METHOD_AUTO = 0, RENDER_METHOD_GLSL, RENDER_METHOD_SOFTWARE, RENDER_METHOD_D3D_PS, RENDER_METHOD_DXVA, RENDER_OVERLAYS = 99 // to retain compatibility }; struct VideoPicture; class CRenderCapture; class CBaseRenderer { public: CBaseRenderer(); virtual ~CBaseRenderer(); // Player functions virtual bool Configure(const VideoPicture &picture, float fps, unsigned int orientation) = 0; virtual bool IsConfigured() = 0; virtual void AddVideoPicture(const VideoPicture &picture, int index) = 0; virtual bool IsPictureHW(const VideoPicture &picture) { return false; }; virtual void UnInit() = 0; virtual bool Flush(bool saveBuffers) { return false; }; virtual void SetBufferSize(int numBuffers) { } virtual void ReleaseBuffer(int idx) { } virtual bool NeedBuffer(int idx) { return false; } virtual bool IsGuiLayer() { return true; } // Render info, can be called before configure virtual CRenderInfo GetRenderInfo() { return CRenderInfo(); } virtual void Update() = 0; virtual void RenderUpdate(int index, int index2, bool clear, unsigned int flags, unsigned int alpha) = 0; virtual bool RenderCapture(CRenderCapture* capture) = 0; virtual bool ConfigChanged(const VideoPicture &picture) = 0; // Feature support virtual bool SupportsMultiPassRendering() = 0; virtual bool Supports(ERENDERFEATURE feature) { return false; }; virtual bool Supports(ESCALINGMETHOD method) = 0; virtual bool WantsDoublePass() { return false; }; void SetViewMode(int viewMode); /*! \brief Get video rectangle and view window \param source is original size of the video \param dest is the target rendering area honoring aspect ratio of source \param view is the entire target rendering area for the video (including black bars) */ void GetVideoRect(CRect &source, CRect &dest, CRect &view); float GetAspectRatio() const; static void SettingOptionsRenderMethodsFiller(std::shared_ptr<const CSetting> setting, std::vector< std::pair<std::string, int> > &list, int &current, void *data); void SetVideoSettings(const CVideoSettings &settings); protected: void CalcNormalRenderRect(float offsetX, float offsetY, float width, float height, float inputFrameRatio, float zoomAmount, float verticalShift); void CalculateFrameAspectRatio(unsigned int desired_width, unsigned int desired_height); virtual void ManageRenderArea(); virtual void ReorderDrawPoints(); virtual EShaderFormat GetShaderFormat(); void MarkDirty(); //@todo drop those void saveRotatedCoords();//saves the current state of m_rotatedDestCoords void syncDestRectToRotatedPoints();//sync any changes of m_destRect to m_rotatedDestCoords void restoreRotatedCoords();//restore the current state of m_rotatedDestCoords from saveRotatedCoords unsigned int m_sourceWidth = 720; unsigned int m_sourceHeight = 480; float m_sourceFrameRatio = 1.0f; float m_fps = 0.0f; unsigned int m_renderOrientation = 0; // orientation of the video in degrees counter clockwise // for drawing the texture with glVertex4f (holds all 4 corner points of the destination rect // with correct orientation based on m_renderOrientation // 0 - top left, 1 - top right, 2 - bottom right, 3 - bottom left CPoint m_rotatedDestCoords[4]; CPoint m_savedRotatedDestCoords[4];//saved points from saveRotatedCoords call CRect m_destRect; CRect m_sourceRect; CRect m_viewRect; // rendering flags unsigned m_iFlags = 0; AVPixelFormat m_format = AV_PIX_FMT_NONE; CVideoSettings m_videoSettings; };
#ifndef _XEN_EVENTS_H #define _XEN_EVENTS_H #include <linux/interrupt.h> #include <xen/interface/event_channel.h> #include <asm/xen/hypercall.h> #include <asm/xen/events.h> unsigned xen_evtchn_nr_channels(void); int bind_evtchn_to_irq(unsigned int evtchn); int bind_evtchn_to_irqhandler(unsigned int evtchn, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); int bind_virq_to_irq(unsigned int virq, unsigned int cpu); int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); int bind_ipi_to_irqhandler(enum ipi_vector ipi, unsigned int cpu, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain, unsigned int remote_port, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); /* * Common unbind function for all event sources. Takes IRQ to unbind from. * Automatically closes the underlying event channel (even for bindings * made with bind_evtchn_to_irqhandler()). */ void unbind_from_irqhandler(unsigned int irq, void *dev_id); #define XEN_IRQ_PRIORITY_MAX EVTCHN_FIFO_PRIORITY_MAX #define XEN_IRQ_PRIORITY_DEFAULT EVTCHN_FIFO_PRIORITY_DEFAULT #define XEN_IRQ_PRIORITY_MIN EVTCHN_FIFO_PRIORITY_MIN int xen_set_irq_priority(unsigned irq, unsigned priority); /* * Allow extra references to event channels exposed to userspace by evtchn */ int evtchn_make_refcounted(unsigned int evtchn); int evtchn_get(unsigned int evtchn); void evtchn_put(unsigned int evtchn); void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector); int resend_irq_on_evtchn(unsigned int irq); void rebind_evtchn_irq(int evtchn, int irq); int xen_get_cpu_from_irq(unsigned int irq); static inline void notify_remote_via_evtchn(int port) { struct evtchn_send send = { .port = port }; (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send); } void notify_remote_via_irq(int irq); void xen_irq_resume(void); /* Clear an irq's pending state, in preparation for polling on it */ void xen_clear_irq_pending(int irq); void xen_set_irq_pending(int irq); bool xen_test_irq_pending(int irq); /* Poll waiting for an irq to become pending. In the usual case, the irq will be disabled so it won't deliver an interrupt. */ void xen_poll_irq(int irq); /* Poll waiting for an irq to become pending with a timeout. In the usual case, * the irq will be disabled so it won't deliver an interrupt. */ void xen_poll_irq_timeout(int irq, u64 timeout); /* Determine the IRQ which is bound to an event channel */ unsigned irq_from_evtchn(unsigned int evtchn); int irq_from_virq(unsigned int cpu, unsigned int virq); unsigned int evtchn_from_irq(unsigned irq); /* Xen HVM evtchn vector callback */ void xen_hvm_callback_vector(void); #ifdef CONFIG_TRACING #define trace_xen_hvm_callback_vector xen_hvm_callback_vector #endif extern int xen_have_vector_callback; int xen_set_callback_via(uint64_t via); void xen_evtchn_do_upcall(struct pt_regs *regs); void xen_hvm_evtchn_do_upcall(void); /* Bind a pirq for a physical interrupt to an irq. */ int xen_bind_pirq_gsi_to_irq(unsigned gsi, unsigned pirq, int shareable, char *name); #ifdef CONFIG_PCI_MSI /* Allocate a pirq for a MSI style physical interrupt. */ int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc); /* Bind an PSI pirq to an irq. */ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, int pirq, const char *name, domid_t domid); #endif /* De-allocates the above mentioned physical interrupt. */ int xen_destroy_irq(int irq); /* Return irq from pirq */ int xen_irq_from_pirq(unsigned pirq); /* Return the pirq allocated to the irq. */ int xen_pirq_from_irq(unsigned irq); /* Return the irq allocated to the gsi */ int xen_irq_from_gsi(unsigned gsi); /* Determine whether to ignore this IRQ if it is passed to a guest. */ int xen_test_irq_shared(int irq); /* initialize Xen IRQ subsystem */ void xen_init_IRQ(void); #endif /* _XEN_EVENTS_H */
/* Copyright (c) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997. 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 <stdio.h> #include <stdlib.h> #include <string.h> #include <rpcsvc/nis.h> #include "nis_xdr.h" typedef bool_t (*iofct_t) (XDR *, void *); typedef void (*freefct_t) (void *); static void * read_nis_obj (const char *name, iofct_t readfct, freefct_t freefct, size_t objsize) { FILE *in = fopen (name, "rce"); if (in == NULL) return NULL; void *obj = calloc (1, objsize); if (obj != NULL) { XDR xdrs; xdrstdio_create (&xdrs, in, XDR_DECODE); bool_t status = readfct (&xdrs, obj); xdr_destroy (&xdrs); if (!status) { freefct (obj); obj = NULL; } } fclose (in); return obj; } static bool_t write_nis_obj (const char *name, const void *obj, iofct_t writefct) { FILE *out = fopen (name, "wce"); if (out == NULL) return FALSE; XDR xdrs; xdrstdio_create (&xdrs, out, XDR_ENCODE); bool_t status = writefct (&xdrs, (void *) obj); xdr_destroy (&xdrs); fclose (out); return status; } static const char cold_start_file[] = "/var/nis/NIS_COLD_START"; directory_obj * readColdStartFile (void) { return read_nis_obj (cold_start_file, (iofct_t) _xdr_directory_obj, (freefct_t) nis_free_directory, sizeof (directory_obj)); } libnsl_hidden_def (readColdStartFile) bool_t writeColdStartFile (const directory_obj *obj) { return write_nis_obj (cold_start_file, obj, (iofct_t) _xdr_directory_obj); } nis_object * nis_read_obj (const char *name) { return read_nis_obj (name, (iofct_t) _xdr_nis_object, (freefct_t) nis_free_object, sizeof (nis_object)); } bool_t nis_write_obj (const char *name, const nis_object *obj) { return write_nis_obj (name, obj, (iofct_t) _xdr_nis_object); }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef SHERLOCK_TATTOO_INVENTORY_H #define SHERLOCK_TATTOO_INVENTORY_H #include "sherlock/inventory.h" namespace Sherlock { namespace Tattoo { class TattooInventory : public Inventory { public: TattooInventory(SherlockEngine *vm); ~TattooInventory(); /** * Load the list of names the inventory items correspond to, if not already loaded, * and then calls loadGraphics to load the associated graphics */ virtual void loadInv(); }; } // End of namespace Tattoo } // End of namespace Sherlock #endif
/* Declarations for handling faults in the signal thread. Copyright (C) 1994-2013 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/>. */ #ifndef _HURD_FAULT_H #define _HURD_FAULT_H #include <hurd/sigpreempt.h> #include <setjmp.h> /* Call this before code that might fault in the signal thread; SIGNO is the signal expected to possibly arrive. This behaves like setjmp: it returns zero the first time, and returns again nonzero if the signal does arrive. */ #define _hurdsig_catch_fault(sigset, firstcode, lastcode) \ (_hurdsig_fault_preemptor.signals = (sigset), \ _hurdsig_fault_preemptor.first = (long int) (firstcode), \ _hurdsig_fault_preemptor.last = (long int) (lastcode), \ setjmp (_hurdsig_fault_env)) /* Call this at the end of a section protected by _hurdsig_catch_fault. */ #define _hurdsig_end_catch_fault() \ (_hurdsig_fault_preemptor.signals = 0) extern jmp_buf _hurdsig_fault_env; extern struct hurd_signal_preemptor _hurdsig_fault_preemptor; #define _hurdsig_catch_memory_fault(object) \ _hurdsig_catch_fault (sigmask (SIGSEGV) | sigmask (SIGBUS), \ (object), (object) + 1) #endif /* hurdfault.h */
/* Compare strings while treating digits characters numerically. Copyright (C) 1997, 2002, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997. 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 <stdint.h> #include <string.h> #include <ctype.h> /* states: S_N: normal, S_I: comparing integral part, S_F: comparing fractionnal parts, S_Z: idem but with leading Zeroes only */ #define S_N 0x0 #define S_I 0x3 #define S_F 0x6 #define S_Z 0x9 /* result_type: CMP: return diff; LEN: compare using len_diff/diff */ #define CMP 2 #define LEN 3 /* Compare S1 and S2 as strings holding indices/version numbers, returning less than, equal to or greater than zero if S1 is less than, equal to or greater than S2 (for more info, see the texinfo doc). */ int __strverscmp (s1, s2) const char *s1; const char *s2; { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; /* Symbol(s) 0 [1-9] others Transition (10) 0 (01) d (00) x */ static const uint8_t next_state[] = { /* state x d 0 */ /* S_N */ S_N, S_I, S_Z, /* S_I */ S_N, S_I, S_I, /* S_F */ S_N, S_F, S_F, /* S_Z */ S_N, S_F, S_Z }; static const int8_t result_type[] = { /* state x/x x/d x/0 d/x d/d d/0 0/x 0/d 0/0 */ /* S_N */ CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP, /* S_I */ CMP, -1, -1, +1, LEN, LEN, +1, LEN, LEN, /* S_F */ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, /* S_Z */ CMP, +1, +1, -1, CMP, CMP, -1, CMP, CMP }; if (p1 == p2) return 0; unsigned char c1 = *p1++; unsigned char c2 = *p2++; /* Hint: '0' is a digit too. */ int state = S_N + ((c1 == '0') + (isdigit (c1) != 0)); int diff; while ((diff = c1 - c2) == 0) { if (c1 == '\0') return diff; state = next_state[state]; c1 = *p1++; c2 = *p2++; state += (c1 == '0') + (isdigit (c1) != 0); } state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))]; switch (state) { case CMP: return diff; case LEN: while (isdigit (*p1++)) if (!isdigit (*p2++)) return 1; return isdigit (*p2) ? -1 : diff; default: return state; } } libc_hidden_def (__strverscmp) weak_alias (__strverscmp, strverscmp)
/* mbed Microcontroller Library - DigitalIn * Copyright (c) 2007-2009 ARM Limited. All rights reserved. * sford, rmeyer */ #ifndef MBED_BUSIN_H #define MBED_BUSIN_H #include "platform.h" #include "PinNames.h" #include "PeripheralNames.h" #include "Base.h" #include "DigitalIn.h" namespace mbed { /* Class: BusIn * A digital input bus, used for reading the state of a collection of pins */ class BusIn : public Base { public: /* Group: Configuration Methods */ /* Constructor: BusIn * Create an BusIn, connected to the specified pins * * Variables: * p<n> - DigitalIn pin to connect to bus bit <n> (p5-p30, NC) * * Note: * It is only required to specify as many pin variables as is required * for the bus; the rest will default to NC (not connected) */ BusIn(PinName p0, PinName p1 = NC, PinName p2 = NC, PinName p3 = NC, PinName p4 = NC, PinName p5 = NC, PinName p6 = NC, PinName p7 = NC, PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC, PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC, const char *name = NULL); BusIn(PinName pins[16], const char *name = NULL); virtual ~BusIn(); /* Group: Access Methods */ /* Function: read * Read the value of the input bus * * Variables: * returns - An integer with each bit corresponding to the value read from the associated DigitalIn pin */ int read(); #ifdef MBED_OPERATORS /* Group: Access Method Shorthand */ /* Function: operator int() * A shorthand for <read> */ operator int(); #endif #ifdef MBED_RPC virtual const struct rpc_method *get_rpc_methods(); static struct rpc_class *get_rpc_class(); #endif protected: DigitalIn* _pin[16]; #ifdef MBED_RPC static void construct(const char *arguments, char *res); #endif }; } // namespace mbed #endif
/* ----------------------------------------------------------------------- * * * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * ----------------------------------------------------------------------- */ /* * fileclose.c * * Close an ordinary file */ #include <errno.h> #include <com32.h> #include <string.h> #include "file.h" int __file_close(struct file_info *fp) { if (fp->i.fd.handle) __com32.cs_pm->close_file(fp->i.fd.handle); return 0; }
#ifndef PREFS_KB_H__ #define PREFS_KB_H__ #ifdef ENABLE_SAVE_KB void prefs_dialog_kb_get_prefs(struct arglist*); void prefs_dialog_kb_set_prefs(struct arglist *, struct arglist *); struct arglist * prefs_dialog_kb(); #endif #endif
/* * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier@gmail.com> * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define TEST 1 #include "libavutil/random_seed.c" #undef printf #define N 256 #define F 2 #include <stdio.h> typedef uint32_t (*random_seed_ptr_t)(void); int main(void) { int i, j, rsf, retry; uint32_t seeds[N]; random_seed_ptr_t random_seed[F] = {av_get_random_seed, get_generic_seed}; for (rsf=0; rsf<F; ++rsf){ for (retry=0; retry<3; retry++){ for (i=0; i<N; i++){ seeds[i] = random_seed[rsf](); for (j=0; j<i; j++) if (seeds[j] == seeds[i]) goto retry; } printf("seeds OK\n"); break; retry:; } if (retry >= 3) { printf("rsf %d: FAIL at %d with %X\n", rsf, j, seeds[j]); return 1; } } return 0; }
/******************************************************************************/ #ifdef JEMALLOC_H_TYPES #endif /* JEMALLOC_H_TYPES */ /******************************************************************************/ #ifdef JEMALLOC_H_STRUCTS #endif /* JEMALLOC_H_STRUCTS */ /******************************************************************************/ #ifdef JEMALLOC_H_EXTERNS void *huge_malloc(arena_t *arena, size_t size, bool zero); void *huge_palloc(arena_t *arena, size_t size, size_t alignment, bool zero); bool huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra); void *huge_ralloc(arena_t *arena, void *ptr, size_t oldsize, size_t size, size_t extra, size_t alignment, bool zero, bool try_tcache_dalloc); #ifdef JEMALLOC_JET typedef void (huge_dalloc_junk_t)(void *, size_t); extern huge_dalloc_junk_t *huge_dalloc_junk; #endif void huge_dalloc(void *ptr); size_t huge_salloc(const void *ptr); prof_ctx_t *huge_prof_ctx_get(const void *ptr); void huge_prof_ctx_set(const void *ptr, prof_ctx_t *ctx); bool huge_boot(void); void huge_prefork(void); void huge_postfork_parent(void); void huge_postfork_child(void); #endif /* JEMALLOC_H_EXTERNS */ /******************************************************************************/ #ifdef JEMALLOC_H_INLINES #endif /* JEMALLOC_H_INLINES */ /******************************************************************************/
#include "tommath.h" #ifdef BN_MP_ABS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = |a| * * Simple function copies the input and fixes the sign to positive */ int mp_abs (mp_int * a, mp_int * b) { int res; /* copy a to b */ if (a != b) { if ((res = mp_copy (a, b)) != MP_OKAY) { return res; } } /* force the sign of b to positive */ b->sign = MP_ZPOS; return MP_OKAY; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #ifndef MAKEFILECREATOR_H #define MAKEFILECREATOR_H #ifdef _WIN32 #pragma once #endif #include "utlvector.h" #include "utlsymbol.h" #include "utldict.h" #include "utlmap.h" #include "vcprojconvert.h" #include "filesystem.h" class CMakefileCreator { public: CMakefileCreator(); ~CMakefileCreator(); void CreateMakefiles( CVCProjConvert & proj ); private: void CleanupFileName( char *name ); void OutputDirs( FileHandle_t f ); void OutputBuildTarget( FileHandle_t f ); void OutputObjLists( CVCProjConvert::CConfiguration & config, FileHandle_t f ); void OutputIncludes( CVCProjConvert::CConfiguration & config, FileHandle_t f ); void OutputMainBuilder( FileHandle_t f ); void CreateBaseDirs( CVCProjConvert::CConfiguration & config ); void CreateMakefileName( const char *projectName, CVCProjConvert::CConfiguration & config ); void CreateDirectoryFriendlyName( const char *dirName, char *friendlyDirName, int friendlyDirNameSize ); void CreateObjDirectoryFriendlyName ( char *name ); void FileWrite( FileHandle_t f, const char *fmt, ... ); CUtlDict<CUtlSymbol, int> m_BaseDirs; CUtlMap<int, int> m_FileToBaseDirMapping; struct OutputDirMapping_t { CUtlSymbol m_SrcDir; CUtlSymbol m_ObjDir; CUtlSymbol m_ObjName; CUtlSymbol m_ObjOutputDir; int m_iBaseDirIndex; }; CUtlVector<struct OutputDirMapping_t> m_BuildDirectories; CUtlSymbol m_MakefileName; CUtlSymbol m_ProjName; CUtlSymbol m_BaseDir; }; #endif // MAKEFILECREATOR_H