text
stringlengths
4
6.14k
// 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 COMPONENTS_KEYED_SERVICE_IOS_REFCOUNTED_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ #define COMPONENTS_KEYED_SERVICE_IOS_REFCOUNTED_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "components/keyed_service/core/keyed_service_export.h" #include "components/keyed_service/core/refcounted_keyed_service_factory.h" class BrowserStateDependencyManager; class RefcountedKeyedService; namespace web { class BrowserState; } // A specialized BrowserStateKeyedServiceFactory that manages a // RefcountedThreadSafe<>. // // While the factory returns RefcountedThreadSafe<>s, the factory itself is a // base::NotThreadSafe. Only call methods on this object on the UI thread. // // Implementers of RefcountedKeyedService should note that we guarantee that // ShutdownOnUIThread() is called on the UI thread, but actual object // destruction can happen anywhere. class KEYED_SERVICE_EXPORT RefcountedBrowserStateKeyedServiceFactory : public RefcountedKeyedServiceFactory { public: // A callback that supplies the instance of a KeyedService for a given // BrowserState. This is used primarily for testing, where we want to feed // a specific mock into the BSKSF system. using TestingFactory = base::RepeatingCallback<scoped_refptr<RefcountedKeyedService>( web::BrowserState* context)>; // Associates |testing_factory| with |context| so that |testing_factory| is // used to create the KeyedService when requested. |testing_factory| can be // empty to signal that KeyedService should be null. Multiple calls to // SetTestingFactory() are allowed; previous services will be shut down. void SetTestingFactory(web::BrowserState* context, TestingFactory testing_factory); // Associates |testing_factory| with |context| and immediately returns the // created KeyedService. Since the factory will be used immediately, it may // not be empty. scoped_refptr<RefcountedKeyedService> SetTestingFactoryAndUse( web::BrowserState* context, TestingFactory testing_factory); protected: // RefcountedBrowserStateKeyedServiceFactories must communicate with a // BrowserStateDependencyManager. For all non-test code, write your subclass // constructors like this: // // MyServiceFactory::MyServiceFactory() // : RefcountedBrowserStateKeyedServiceFactory( // "MyService", // BrowserStateDependencyManager::GetInstance()) { // } RefcountedBrowserStateKeyedServiceFactory( const char* name, BrowserStateDependencyManager* manager); ~RefcountedBrowserStateKeyedServiceFactory() override; // Common implementation that maps |context| to some service object. Deals // with incognito and testing contexts per subclass instructions. If |create| // is true, the service will be created using BuildServiceInstanceFor() if it // doesn't already exist. scoped_refptr<RefcountedKeyedService> GetServiceForBrowserState( web::BrowserState* context, bool create); // Interface for people building a concrete FooServiceFactory: -------------- // Finds which browser state (if any) to use. virtual web::BrowserState* GetBrowserStateToUse( web::BrowserState* context) const; // By default, we create instances of a service lazily and wait until // GetForBrowserState() is called on our subclass. Some services need to be // created as soon as the BrowserState has been brought up. virtual bool ServiceIsCreatedWithBrowserState() const; // By default, TestingBrowserStates will be treated like normal contexts. // You can override this so that by default, the service associated with the // TestingBrowserState is NULL. (This is just a shortcut around // SetTestingFactory() to make sure our contexts don't directly refer to the // services they use.) bool ServiceIsNULLWhileTesting() const override; // Interface for people building a type of BrowserStateKeyedFactory: ------- // All subclasses of BrowserStateKeyedServiceFactory must return a // KeyedService instead of just a BrowserStateKeyedBase. virtual scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( web::BrowserState* context) const = 0; // A helper object actually listens for notifications about BrowserState // destruction, calculates the order in which things are destroyed and then // does a two pass shutdown. // // First, BrowserStateShutdown() is called on every ServiceFactory and will // usually call KeyedService::Shutdown(), which gives each // KeyedService a chance to remove dependencies on other // services that it may be holding. // // Secondly, BrowserStateDestroyed() is called on every ServiceFactory // and the default implementation removes it from |mapping_| and deletes // the pointer. virtual void BrowserStateShutdown(web::BrowserState* context); virtual void BrowserStateDestroyed(web::BrowserState* context); private: // Registers any user preferences on this service. This should be overriden by // any service that wants to register profile-specific preferences. virtual void RegisterBrowserStatePrefs( user_prefs::PrefRegistrySyncable* registry) {} // RefcountedKeyedServiceFactory: scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( void* context) const final; bool IsOffTheRecord(void* context) const final; // KeyedServiceBaseFactory: void* GetContextToUse(void* context) const final; bool ServiceIsCreatedWithContext() const final; void ContextShutdown(void* context) final; void ContextDestroyed(void* context) final; void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final; DISALLOW_COPY_AND_ASSIGN(RefcountedBrowserStateKeyedServiceFactory); }; #endif // COMPONENTS_KEYED_SERVICE_IOS_REFCOUNTED_BROWSER_STATE_KEYED_SERVICE_FACTORY_H_
// 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 CHROME_BROWSER_CHROMEOS_POWER_ML_SMART_DIM_BUILTIN_WORKER_H_ #define CHROME_BROWSER_CHROMEOS_POWER_ML_SMART_DIM_BUILTIN_WORKER_H_ #include <memory> #include "base/containers/flat_map.h" #include "chrome/browser/chromeos/power/ml/smart_dim/smart_dim_worker.h" #include "chromeos/services/machine_learning/public/mojom/graph_executor.mojom.h" #include "chromeos/services/machine_learning/public/mojom/model.mojom.h" #include "mojo/public/cpp/bindings/remote.h" namespace chromeos { namespace power { namespace ml { // SmartDimWorker that uses a built-in preprocessor config and ML service model // file. class BuiltinWorker : public SmartDimWorker { public: BuiltinWorker(); ~BuiltinWorker() override; // SmartDimWorker overrides: const assist_ranker::ExamplePreprocessorConfig* GetPreprocessorConfig() override; const mojo::Remote<chromeos::machine_learning::mojom::GraphExecutor>& GetExecutor() override; private: // Loads the built-in preprocessor config if not loaded yet. Also // initializes the model_ and executor_ with built-in model. void LazyInitialize(); DISALLOW_COPY_AND_ASSIGN(BuiltinWorker); }; } // namespace ml } // namespace power } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_POWER_ML_SMART_DIM_BUILTIN_WORKER_H_
/**************************************************************************/ /*! @file sysdefs.h @author K. Townsend (microBuilder.eu) @section LICENSE Software License Agreement (BSD License) Copyright (c) 2013, K. Townsend (microBuilder.eu) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holders 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 ''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 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 _SYSDEFS_H_ #define _SYSDEFS_H_ #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdint.h> #include <stdbool.h> typedef unsigned char byte_t; /* Stay compatible with ugly "windows" style for bool */ #define BOOL bool #ifndef TRUE #define TRUE true #endif #ifndef FALSE #define FALSE false #endif /* ASM and inline function placeholders */ #ifndef ASM #define ASM __asm volatile #endif #ifndef INLINE #if __GNUC__ && !__GNUC_STDC_INLINE__ #define INLINE extern inline #else #define INLINE inline #endif #endif /* GCC does not inline any functions when not optimizing unless you specify the 'always_inline' attribute for the function */ #ifndef INLINE_POST #define INLINE_POST __attribute__((always_inline)) #endif /* SRAM placement for critical functions depends on the linker script */ #ifdef __GNUC__ #ifdef __CROSSWORKS_ARM #define RAMFUNC __attribute__ ((long_call, section (".fast"))) #else /* ToDo: Throws 'ignoring changed section attributes for .data' */ // #define RAMFUNC __attribute__ ((long_call, section (".data"))) /* Hmm ... not working from the makefile ... need to debug! */ /* Leave it blank for now unless we're in Crossworks */ #define RAMFUNC #endif #else #error "No section defined for RAMFUNC in sysdefs.h" #endif /* NULL placeholder */ #ifndef NULL #define NULL ((void *) 0) #endif #ifdef __cplusplus } #endif #endif
/* Copyright (c) 2014. The YARA Authors. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder 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. */ #ifndef YR_ERROR_H #define YR_ERROR_H #include <string.h> #if defined(_WIN32) || defined(__CYGWIN__) #include <windows.h> #endif #ifndef ERROR_SUCCESS #define ERROR_SUCCESS 0 #endif #define ERROR_INSUFFICIENT_MEMORY 1 #define ERROR_COULD_NOT_ATTACH_TO_PROCESS 2 #define ERROR_COULD_NOT_OPEN_FILE 3 #define ERROR_COULD_NOT_MAP_FILE 4 #define ERROR_INVALID_FILE 6 #define ERROR_CORRUPT_FILE 7 #define ERROR_UNSUPPORTED_FILE_VERSION 8 #define ERROR_INVALID_REGULAR_EXPRESSION 9 #define ERROR_INVALID_HEX_STRING 10 #define ERROR_SYNTAX_ERROR 11 #define ERROR_LOOP_NESTING_LIMIT_EXCEEDED 12 #define ERROR_DUPLICATED_LOOP_IDENTIFIER 13 #define ERROR_DUPLICATED_IDENTIFIER 14 #define ERROR_DUPLICATED_TAG_IDENTIFIER 15 #define ERROR_DUPLICATED_META_IDENTIFIER 16 #define ERROR_DUPLICATED_STRING_IDENTIFIER 17 #define ERROR_UNREFERENCED_STRING 18 #define ERROR_UNDEFINED_STRING 19 #define ERROR_UNDEFINED_IDENTIFIER 20 #define ERROR_MISPLACED_ANONYMOUS_STRING 21 #define ERROR_INCLUDES_CIRCULAR_REFERENCE 22 #define ERROR_INCLUDE_DEPTH_EXCEEDED 23 #define ERROR_WRONG_TYPE 24 #define ERROR_EXEC_STACK_OVERFLOW 25 #define ERROR_SCAN_TIMEOUT 26 #define ERROR_TOO_MANY_SCAN_THREADS 27 #define ERROR_CALLBACK_ERROR 28 #define ERROR_INVALID_ARGUMENT 29 #define ERROR_TOO_MANY_MATCHES 30 #define ERROR_INTERNAL_FATAL_ERROR 31 #define ERROR_NESTED_FOR_OF_LOOP 32 #define ERROR_INVALID_FIELD_NAME 33 #define ERROR_UNKNOWN_MODULE 34 #define ERROR_NOT_A_STRUCTURE 35 #define ERROR_NOT_INDEXABLE 36 #define ERROR_NOT_A_FUNCTION 37 #define ERROR_INVALID_FORMAT 38 #define ERROR_TOO_MANY_ARGUMENTS 39 #define ERROR_WRONG_ARGUMENTS 40 #define ERROR_WRONG_RETURN_TYPE 41 #define ERROR_DUPLICATED_STRUCTURE_MEMBER 42 #define ERROR_EMPTY_STRING 43 #define ERROR_DIVISION_BY_ZERO 44 #define ERROR_REGULAR_EXPRESSION_TOO_LARGE 45 #define ERROR_TOO_MANY_RE_FIBERS 46 #define ERROR_COULD_NOT_READ_PROCESS_MEMORY 47 #define ERROR_INVALID_EXTERNAL_VARIABLE_TYPE 48 #define ERROR_REGULAR_EXPRESSION_TOO_COMPLEX 49 #define ERROR_INVALID_MODULE_NAME 50 #define FAIL_ON_ERROR(x) { \ int result = (x); \ if (result != ERROR_SUCCESS) \ return result; \ } #define FAIL_ON_ERROR_WITH_CLEANUP(x, cleanup) { \ int result = (x); \ if (result != ERROR_SUCCESS) { \ cleanup; \ return result; \ } \ } #define FAIL_ON_COMPILER_ERROR(x) { \ compiler->last_result = (x); \ if (compiler->last_result != ERROR_SUCCESS) \ return compiler->last_result; \ } #ifdef NDEBUG #define assertf(expr, msg, ...) ((void)0) #else #define assertf(expr, msg, ...) \ if(!(expr)) { \ fprintf(stderr, "%s:%d: " msg "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ abort(); \ } #endif #endif
#pragma once #include "Control.h" #include "InputHelper.h" class Control; class InputManager; class XInputFetcher; // ======================================================================================= // AnalogueControl // ======================================================================================= ///--------------------------------------------------------------------------------------- /// \brief Implementation of Control for Analogue controls (sticks, triggers) on the /// xbox360 controller. /// /// This class fetches the latest input data from the first connected 360-controller. the /// raw input data (0-255 for triggers, 0-65k for sticks) is normalized to 0.0 - 1.0. /// Negative values will turn positive if the NEGATIVE SubAxes is used. The raw data will /// be 0 - 255 for triggers and -32k - 32k for sticks. /// Created on: 4-12-2012 /// \author Mattias Liljeson ///--------------------------------------------------------------------------------------- class AnalogueControl : public Control { public: AnalogueControl( InputHelper::Xbox360Analogs p_axis); ~AnalogueControl(); virtual void update( float p_dt, InputManager* p_manager ); virtual int getControlEnum(); private: InputHelper::Xbox360Analogs m_axis; InputHelper::SubAxes m_subAxis; };
/** * Copyright (c) 2015-present, Parse, LLC. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import <Foundation/Foundation.h> #import <Parse/PFConstants.h> #import <Parse/PFAuthenticationProvider.h> NS_ASSUME_NONNULL_BEGIN @class BFTask; @class PFUser; @interface PFUserAuthenticationController : NSObject ///-------------------------------------- /// @name Authentication Providers ///-------------------------------------- - (void)registerAuthenticationProvider:(id<PFAuthenticationProvider>)provider; - (void)unregisterAuthenticationProvider:(id<PFAuthenticationProvider>)provider; - (id<PFAuthenticationProvider>)authenticationProviderForAuthType:(NSString *)authType; ///-------------------------------------- /// @name Authentication ///-------------------------------------- - (BFTask *)deauthenticateAsyncWithProviderForAuthType:(NSString *)authType; - (BFTask *)restoreAuthenticationAsyncWithAuthData:(nullable NSDictionary *)authData forProviderWithAuthType:(NSString *)authType; ///-------------------------------------- /// @name Log In ///-------------------------------------- - (BFTask *)logInUserAsyncWithAuthType:(NSString *)authType authData:(NSDictionary *)authData; @end NS_ASSUME_NONNULL_END
/*- * Copyright (c) 2001 Jake Burkholder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ #ifndef LOCORE struct trapframe; #define PCB_LR 30 struct pcb { uint64_t pcb_x[31]; uint64_t pcb_pc; /* These two need to be in order as we access them together */ uint64_t pcb_sp; uint64_t pcb_tpidr_el0; vm_offset_t pcb_l0addr; /* Fault handler, the error value is passed in x0 */ vm_offset_t pcb_onfault; u_int pcb_flags; #define PCB_SINGLE_STEP_SHIFT 0 #define PCB_SINGLE_STEP (1 << PCB_SINGLE_STEP_SHIFT) /* Place last to simplify the asm to access the rest if the struct */ __uint128_t pcb_vfp[32]; uint32_t pcb_fpcr; uint32_t pcb_fpsr; int pcb_fpflags; #define PCB_FP_STARTED 0x01 u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */ }; #ifdef _KERNEL void makectx(struct trapframe *tf, struct pcb *pcb); int savectx(struct pcb *pcb) __returns_twice; #endif #endif /* !LOCORE */ #endif /* !_MACHINE_PCB_H_ */
/** * \kernelgroup{SceStat} * \usage{psp2kern/io/stat.h,SceIofilemgrForDriver_stub} */ #ifndef _PSP2_IO_STAT_H_ #define _PSP2_IO_STAT_H_ #include <psp2kern/types.h> #ifdef __cplusplus extern "C" { #endif /** Access modes for st_mode in ::SceIoStat. */ typedef enum SceIoAccessMode { SCE_S_IXUSR = 0x0001, //!< User execute permission SCE_S_IWUSR = 0x0002, //!< User write permission SCE_S_IRUSR = 0x0004, //!< User read permission SCE_S_IRWXU = 0x0007, //!< User access rights mask SCE_S_IXGRP = 0x0008, //!< Group execute permission SCE_S_IWGRP = 0x0010, //!< Group write permission SCE_S_IRGRP = 0x0020, //!< Group read permission SCE_S_IRWXG = 0x0038, //!< Group access rights mask SCE_S_IXOTH = 0x0040, //!< Others execute permission SCE_S_IWOTH = 0x0080, //!< Others write permission SCE_S_IROTH = 0x0100, //!< Others read permission SCE_S_IRWXO = 0x01C0, //!< Others access rights mask SCE_S_ISVTX = 0x0200, //!< Sticky SCE_S_ISGID = 0x0400, //!< Set GID SCE_S_ISUID = 0x0800, //!< Set UID SCE_S_IFDIR = 0x1000, //!< Directory SCE_S_IFREG = 0x2000, //!< Regular file SCE_S_IFLNK = 0x4000, //!< Symbolic link SCE_S_IFMT = 0xF000, //!< Format bits mask } SceIoAccessMode; // File mode checking macros #define SCE_S_ISLNK(m) (((m) & SCE_S_IFMT) == SCE_S_IFLNK) #define SCE_S_ISREG(m) (((m) & SCE_S_IFMT) == SCE_S_IFREG) #define SCE_S_ISDIR(m) (((m) & SCE_S_IFMT) == SCE_S_IFDIR) /** File modes, used for the st_attr parameter in SceIoStat (confirm?). */ typedef enum SceIoFileMode { SCE_SO_IXOTH = 0x0001, //!< Hidden execute permission SCE_SO_IWOTH = 0x0002, //!< Hidden write permission SCE_SO_IROTH = 0x0004, //!< Hidden read permission SCE_SO_IFLNK = 0x0008, //!< Symbolic link SCE_SO_IFDIR = 0x0010, //!< Directory SCE_SO_IFREG = 0x0020, //!< Regular file SCE_SO_IFMT = 0x0038, //!< Format mask } SceIoFileMode; // File mode checking macros #define SCE_SO_ISLNK(m) (((m) & SCE_SO_IFMT) == SCE_SO_IFLNK) #define SCE_SO_ISREG(m) (((m) & SCE_SO_IFMT) == SCE_SO_IFREG) #define SCE_SO_ISDIR(m) (((m) & SCE_SO_IFMT) == SCE_SO_IFDIR) /** Structure to hold the status information about a file */ typedef struct SceIoStat { SceMode st_mode; //!< One or more ::SceIoAccessMode unsigned int st_attr; //!< One or more ::SceIoFileMode SceOff st_size; //!< Size of the file in bytes SceDateTime st_ctime; //!< Creation time SceDateTime st_atime; //!< Last access time SceDateTime st_mtime; //!< Last modification time unsigned int st_private[6]; //!< Device-specific data } SceIoStat; /** * Make a directory file * * @param dir - The path to the directory * @param mode - Access mode (One or more ::SceIoAccessMode). * @return Returns the value 0 if it's successful, otherwise -1 */ int ksceIoMkdir(const char *dir, SceMode mode); /** * Remove a directory file * * @param path - Removes a directory file pointed by the string path * @return Returns the value 0 if it's successful, otherwise -1 */ int ksceIoRmdir(const char *path); /** * Get the status of a file. * * @param file - The path to the file. * @param stat - A pointer to a ::SceIoStat structure. * * @return < 0 on error. */ int ksceIoGetstat(const char *file, SceIoStat *stat); /** * Get the status of a file descriptor. * * @param fd - The file descriptor. * @param stat - A pointer to a ::SceIoStat structure. * * @return < 0 on error. */ int ksceIoGetstatByFd(SceUID fd, SceIoStat *stat); /** * Change the status of a file. * * @param file - The path to the file. * @param stat - A pointer to a ::SceIoStat structure. * @param bits - Bitmask defining which bits to change. * * @return < 0 on error. */ int ksceIoChstat(const char *file, SceIoStat *stat, int bits); /** * Change the status of a file descriptor. * * @param fd - The file descriptor. * @param stat - A pointer to an io_stat_t structure. * @param bits - Bitmask defining which bits to change. * * @return < 0 on error. */ int ksceIoChstatByFd(SceUID fd, SceIoStat *stat, int bits); #ifdef __cplusplus } #endif #endif /* _PSP2_IO_STAT_H_ */
/* TestFilePath:testdata/data_structure/Graph/Graph_DFSTraverse/ */ /* 测试文件所在路径,必须放在第一行,相对于Makefile所在路径 */ /* 包含的库函数,会自动展开引号中的文件,相对于Grunfile所在路径 */ #include <stdio.h> #include "clib/types/x64.h" #include "clib/data_structure/Graph/Graph.h" #include "clib/data_structure/Graph/Graph_DFSTraverse.h" int visit(int v){ printf("%d ",v); return 1; } int main(int argc,char * argv[]) { int n,i,v,w; scanf("%d\n",&n); Graph g = newGraph(n); scanf("%d\n",&n); for(i=0; i<n; i++){ scanf("%d %d\n",&v,&w); Graph_addEdge(g,v,w); } int in; Graph_DFSTraverse(g,visit); return 0; }
// RUN: %check -e %s -Wno-implicit -Werror=implicit // make sure -Werror=xyz turns on warning 'xyz' main() // CHECK: error: defaulting type to int { }
// // MGCTimedEventsViewLayout.h // Graphical Calendars Library for iOS // // Distributed under the MIT License // Get the latest version from here: // // https://github.com/jumartin/Calendar // // Copyright (c) 2014-2015 Julien Martin // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // #import <UIKit/UIKit.h> static NSString* const DimmingViewKind = @"DimmingViewKind"; @protocol MGCTimedEventsViewLayoutDelegate; // Custom invalidation context for MGCTimedEventsViewLayout @interface MGCTimedEventsViewLayoutInvalidationContext: UICollectionViewLayoutInvalidationContext @property (nonatomic) BOOL invalidateDimmingViews; // set to true if layout attributes of dimming views must be recomputed @property (nonatomic) BOOL invalidateEventCells; // set to true if layout attributes of event cells must be recomputed @property (nonatomic) NSMutableIndexSet *invalidatedSections; // sections whose layout attributes (dimming views or event cells) must be recomputed - if nil, recompute everything @end // This collection view layout is responsible for the layout of event views in the timed-events part // of the day planner view. @interface MGCTimedEventsViewLayout : UICollectionViewLayout @property (nonatomic, weak) id<MGCTimedEventsViewLayoutDelegate> delegate; @property (nonatomic) CGSize dayColumnSize; @property (nonatomic) CGFloat minimumVisibleHeight; // if 2 cells overlap, and the height of the uncovered part of the upper cell is less than this value, the column is split @property (nonatomic) BOOL ignoreNextInvalidation; // for some reason, UICollectionView reloadSections: messes up with scrolling and animations so we have to stick with using reloadData even when only individual sections need to be invalidated. As a workaroud, we explicitly invalidate them with custom context, and set this flag to YES before calling reloadData @end @protocol MGCTimedEventsViewLayoutDelegate <UICollectionViewDelegate> // x and width of returned rect are ignored - (CGRect)collectionView:(UICollectionView*)collectionView layout:(MGCTimedEventsViewLayout*)layout rectForEventAtIndexPath:(NSIndexPath*)indexPath; - (NSArray*)collectionView:(UICollectionView*)collectionView layout:(MGCTimedEventsViewLayout*)layout dimmingRectsForSection:(NSUInteger)section; @end
/* * Invalid calls to chdir() */ #include <unistd.h> #include <errno.h> #include <err.h> #include "test.h" static void chdir_empty(void) { int rv; /* * This is actually valid by some interpretations. */ rv = chdir(""); report_test2(rv, errno, EINVAL, 0, "chdir to empty string"); } void test_chdir(void) { test_chdir_path(); chdir_empty(); }
/** * This header is generated by class-dump-z 0.1-11o. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. */ #import "UIKit-Structs.h" #import "UIAnimation.h" @interface UITransformAnimation : UIAnimation { CGAffineTransform _startTransform; CGAffineTransform _endTransform; } -(void)setStartTransform:(CGAffineTransform)transform; -(void)setEndTransform:(CGAffineTransform)transform; -(CGAffineTransform)_transformWithMultiplier:(float)multiplier; -(void)setProgress:(float)progress; -(CGAffineTransform)transformForFraction:(float)fraction; @end
// // Copyright (c) 2008-2014 the Urho3D project. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #pragma once #include <cstddef> namespace Urho3D { /// Pointer hash function. template <class T> unsigned MakeHash(T* value) { return ((unsigned)(size_t)value) / sizeof(T); } /// Const pointer hash function. template <class T> unsigned MakeHash(const T* value) { return ((unsigned)(size_t)value) / sizeof(T); } /// Generic hash function. template <class T> unsigned MakeHash(const T& value) { return value.ToHash(); } /// Void pointer hash function. template<> inline unsigned MakeHash(void* value) { return (unsigned)(size_t)value; } /// Const void pointer hash function. template<> inline unsigned MakeHash(const void* value) { return (unsigned)(size_t)value; } /// Long long hash function. template<> inline unsigned MakeHash(const long long& value) { return (value >> 32) | (value & 0xffffffff); } /// Unsigned long long hash function. template<> inline unsigned MakeHash(const unsigned long long& value) { return (value >> 32) | (value & 0xffffffff); } /// Int hash function. template<> inline unsigned MakeHash(const int& value) { return value; } /// Unsigned hash function. template<> inline unsigned MakeHash(const unsigned& value) { return value; } /// Short hash function. template<> inline unsigned MakeHash(const short& value) { return value; } /// Unsigned short hash function. template<> inline unsigned MakeHash(const unsigned short& value) { return value; } /// Char hash function. template<> inline unsigned MakeHash(const char& value) { return value; } /// Unsigned char hash function. template<> inline unsigned MakeHash(const unsigned char& value) { return value; } }
/* * public domain strtok_r() by Charlie Gordon * * from comp.lang.c 9/14/2007 * * http://groups.google.com/group/comp.lang.c/msg/2ab1ecbb86646684 * * (Declaration that it's public domain): * http://groups.google.com/group/comp.lang.c/msg/7c7b39328fefab9c */ /* This file is only included since MINGW doesn't have strtok_r, so I can't compile for Windows without this */ /* Also, fixed by Fletcher T. Penney --- added the "return NULL" when *nextp == NULL */ /* This fix is also in the public domain */ #include "strtok.h" char* strtok_r( char *str, const char *delim, char **nextp) { char *ret; if (str == NULL) { str = *nextp; } if (str == NULL) { return NULL; } str += strspn(str, delim); if (*str == '\0') { return NULL; } ret = str; str += strcspn(str, delim); if (*str) { *str++ = '\0'; } *nextp = str; return ret; }
// // FFGeoLocation.h // FF-IOS-Framework // // Copyright (c) 2012, 2013 FatFractal, Inc. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> #import "FatFractal.h" /** \brief The model class for working with location information and the FatFractal Platform. */ /*! The FFGeoLocation object model includes all of the parameters that can * be specified regarding location information with the FatFractal Platform. */ @interface FFGeoLocation : NSObject <NSCoding> /*! A double value representing the latitude of the location. */ @property (nonatomic) double latitude; /*! A double value representing the longitude of the location. */ @property (nonatomic) double longitude; /*! A double value representing the altitude of the location. */ @property (nonatomic) double altitude; /*! A double value representing the accuracy of the location. */ @property (nonatomic) double accuracy; /*! A double value representing the altitudeAccuracy of the location. */ @property (nonatomic) double altitudeAccuracy; /*! A double value representing the heading of the location. */ @property (nonatomic) double heading; /*! A double value representing the speed of the location. */ @property (nonatomic) double speed; /*! Initializer that accepts a standard CLLocation parameter. * @param CLLocation - the user value of the location object */ - (id) initWithCLLocation:(CLLocation *) clLocation; /*! Initializer that accepts latitude and longitude as parameters. * @param double - the latitude value of the location object * @param double - the longitude value of the location object */ - (id) initWithLatitude:(double)theLatitude longitude:(double)theLongitude; /*! Initializer that accepts latitude, longitude and altitude as parameters. * @param double - the latitude value of the location object * @param double - the longitude value of the location object * @param double - the altitude value of the location object */ - (id) initWithLatitude:(double)theLatitude longitude:(double)theLongitude altitude:(double)theAltitude; /*! Initializer that accepts latitude, longitude, altitude, accuracy, altitudeAccuracy, heading and speed as parameters. * @param double - the latitude value of the location object * @param double - the longitude value of the location object * @param double - the altitude value of the location object * @param double - the accuracy value of the location object * @param double - the altitudeAccuracy value of the location object * @param double - the heading value of the location object * @param double - the speed value of the location object */ - (id) initWithLatitude:(double)theLatitude longitude:(double)theLongitude altitude:(double)theAltitude accuracy:(double)theAccuracy altitudeAccuracy:(double)theAltitudeAccuracy heading:(double)theHeading speed:(double)theSpeed; /*! Initializer that accepts a dictionary from which we will extract latitude, longitude, altitude, accuracy, altitudeAccuracy, heading and speed. */ - (id) initWithDictionary:(NSDictionary *)dict; @end
#pragma once #include "Scene.h" #include "EnumSet.h" class SceneResult: public Scene { public: SceneResult(); virtual ~SceneResult( ); virtual void Create(); virtual void Destroy(); virtual void Update(); virtual void Render() const; private: SceneType m_SceneType = SCENE_RESULT; D3DXVECTOR3 m_Position = { 0, 0, 0 }; };
/**************************************************************************//** * @file efr32fg12p_rtcc_ret.h * @brief EFR32FG12P_RTCC_RET register and bit field definitions * @version 5.4.0 ****************************************************************************** * # License * <b>Copyright 2017 Silicon Laboratories, Inc. 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. * *****************************************************************************/ #ifdef __cplusplus extern "C" { #endif #if defined(__ICCARM__) #pragma system_include /* Treat file as system include file. */ #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) #pragma clang system_header /* Treat file as system include file. */ #endif /**************************************************************************//** * @addtogroup Parts * @{ ******************************************************************************/ /**************************************************************************//** * @brief RTCC_RET RTCC RET Register * @ingroup EFR32FG12P_RTCC *****************************************************************************/ typedef struct { __IOM uint32_t REG; /**< Retention Register */ } RTCC_RET_TypeDef; /** @} End of group Parts */ #ifdef __cplusplus } #endif
/********************************************************************* * * Power API definitions * ********************************************************************* * FileName: power.h * Dependencies: * Processor: PIC32 * * * Compiler: MPLAB XC32 * MPLAB IDE * Company: Microchip Technology Inc. * * Software License Agreement * * The software supplied herewith by Microchip Technology Incorporated * (the “Company”) for its PIC Microcontroller is intended * and supplied to you, the Company’s customer, for use solely and * exclusively on Microchip PIC Microcontroller products. * The software is owned by the Company and/or its supplier, and is * protected under applicable copyright laws. All rights are reserved. * Any use in violation of the foregoing restrictions may subject the * user to criminal sanctions under applicable laws, as well as to * civil liability for the breach of the terms and conditions of this * license. * * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. * * * $Id: OSC.h,v 1.6 2006/10/13 21:24:31 C12532 Exp $ * * $Name: $ ********************************************************************/ #ifndef _POWER_HEADER_FILE #define _POWER_HEADER_FILE #include <xc.h> /********************************************************************* * Function: PowerSaveSleep() * * Description: Sets Powersave mode to Sleep and enters Sleep mode * * PreCondition: None * * Inputs: None * * Output: None * * Example: PowerSaveSleep() * ********************************************************************/ void __attribute__((nomips16)) PowerSaveSleep(void); /********************************************************************* * Function: PowerSaveIdle() * * Description: Sets Powersave mode to Idle and enters Idle mode * * PreCondition: None * * Inputs: None * * Output: None * * Example: PowerSaveIdle() * ********************************************************************/ void __attribute__((nomips16)) PowerSaveIdle(void); #endif
int strend(char *s, char *t) { char *bs = s; char *bt = t; for ( ; *s; s++) ; for ( ; *t; t++) ; for (; *s == *t; s--, t--) if (t = bt || s == bs) break; if (*s == *t && t == bt && *s != '\0') return 1; else return 0; }
/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- Copyright (c) 2006-2020, assimp team All rights reserved. Redistribution and use of this software 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 assimp team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of the assimp team. 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 OBJFILEMTLIMPORTER_H_INC #define OBJFILEMTLIMPORTER_H_INC #include <vector> #include <string> #include <assimp/defs.h> struct aiColor3D; struct aiString; namespace Assimp { namespace ObjFile { struct Model; struct Material; } /** * @class ObjFileMtlImporter * @brief Loads the material description from a mtl file. */ class ObjFileMtlImporter { public: static const size_t BUFFERSIZE = 2048; typedef std::vector<char> DataArray; typedef std::vector<char>::iterator DataArrayIt; typedef std::vector<char>::const_iterator ConstDataArrayIt; public: //! \brief Default constructor ObjFileMtlImporter( std::vector<char> &buffer, const std::string &strAbsPath, ObjFile::Model *pModel ); //! \brief DEstructor ~ObjFileMtlImporter(); private: /// Copy constructor, empty. ObjFileMtlImporter(const ObjFileMtlImporter &rOther); /// \brief Assignment operator, returns only a reference of this instance. ObjFileMtlImporter &operator = (const ObjFileMtlImporter &rOther); /// Load the whole material description void load(); /// Get color data. void getColorRGBA( aiColor3D *pColor); /// Get illumination model from loaded data void getIlluminationModel( int &illum_model ); /// Gets a float value from data. void getFloatValue( ai_real &value ); /// Creates a new material from loaded data. void createMaterial(); /// Get texture name from loaded data. void getTexture(); void getTextureOption(bool &clamp, int &clampIndex, aiString *&out); private: //! Absolute pathname std::string m_strAbsPath; //! Data iterator showing to the current position in data buffer DataArrayIt m_DataIt; //! Data iterator to end of buffer DataArrayIt m_DataItEnd; //! USed model instance ObjFile::Model *m_pModel; //! Current line in file unsigned int m_uiLine; //! Helper buffer char m_buffer[BUFFERSIZE]; }; // ------------------------------------------------------------------------------------------------ } // Namespace Assimp #endif // OBJFILEMTLIMPORTER_H_INC
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main(int argc,char **argv) { int fd; if(argc < 2) { fprintf(stderr,"Usage...\n"); exit(1); } fd = open(argv[1],O_WRONLY|O_CREAT|O_TRUNC,0600); if(fd < 0) { perror("open()"); exit(1); } lseek(fd,5LL*1024LL*1024LL*1024LL-1LL,SEEK_SET); write(fd,"",1); close(fd); exit(0); }
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2020 Scientific Computing and Imaging Institute, University of Utah. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef INTERFACE_MODULES_GeneratePointSamplesFromFieldOrWidgetDialog_H #define INTERFACE_MODULES_GeneratePointSamplesFromFieldOrWidgetDialog_H #include "Interface/Modules/Fields/ui_GeneratePointSamplesFromFieldOrWidget.h" #include <Interface/Modules/Base/ModuleDialogGeneric.h> #include <Interface/Modules/Fields/share.h> namespace SCIRun { namespace Gui { class SCISHARE GeneratePointSamplesFromFieldOrWidgetDialog : public ModuleDialogGeneric, public Ui::GeneratePointSamplesFromFieldOrWidget { Q_OBJECT public: GeneratePointSamplesFromFieldOrWidgetDialog(const std::string& name, SCIRun::Dataflow::Networks::ModuleStateHandle state, QWidget* parent = nullptr); }; } } #endif
// // SentryCrashStackCursor_MachineContext.c // // Copyright (c) 2016 Karl Stenerud. 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 remain in place // in this source code. // // 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 "SentryCrashStackCursor_MachineContext.h" #include "SentryCrashCPU.h" #include "SentryCrashMemory.h" #include <stdlib.h> #define SentryCrashLogger_LocalLevel TRACE #include "SentryCrashLogger.h" /** Represents an entry in a frame list. * This is modeled after the various i386/x64 frame walkers in the xnu source, * and seems to work fine in ARM as well. I haven't included the args pointer * since it's not needed in this context. */ typedef struct FrameEntry { /** The previous frame in the list. */ struct FrameEntry* previous; /** The instruction address. */ uintptr_t return_address; } FrameEntry; typedef struct { const struct SentryCrashMachineContext* machineContext; int maxStackDepth; FrameEntry currentFrame; uintptr_t instructionAddress; uintptr_t linkRegister; bool isPastFramePointer; } MachineContextCursor; static bool advanceCursor(SentryCrashStackCursor *cursor) { MachineContextCursor* context = (MachineContextCursor*)cursor->context; uintptr_t nextAddress = 0; if(cursor->state.currentDepth >= context->maxStackDepth) { cursor->state.hasGivenUp = true; return false; } if(context->instructionAddress == 0) { context->instructionAddress = sentrycrashcpu_instructionAddress(context->machineContext); if(context->instructionAddress == 0) { return false; } nextAddress = context->instructionAddress; goto successfulExit; } if(context->linkRegister == 0 && !context->isPastFramePointer) { // Link register, if available, is the second address in the trace. context->linkRegister = sentrycrashcpu_linkRegister(context->machineContext); if(context->linkRegister != 0) { nextAddress = context->linkRegister; goto successfulExit; } } if(context->currentFrame.previous == NULL) { if(context->isPastFramePointer) { return false; } context->currentFrame.previous = (struct FrameEntry*)sentrycrashcpu_framePointer(context->machineContext); context->isPastFramePointer = true; } if(!sentrycrashmem_copySafely(context->currentFrame.previous, &context->currentFrame, sizeof(context->currentFrame))) { return false; } if(context->currentFrame.previous == 0 || context->currentFrame.return_address == 0) { return false; } nextAddress = context->currentFrame.return_address; successfulExit: cursor->stackEntry.address = sentrycrashcpu_normaliseInstructionPointer(nextAddress); cursor->state.currentDepth++; return true; } static void resetCursor(SentryCrashStackCursor* cursor) { sentrycrashsc_resetCursor(cursor); MachineContextCursor* context = (MachineContextCursor*)cursor->context; context->currentFrame.previous = 0; context->currentFrame.return_address = 0; context->instructionAddress = 0; context->linkRegister = 0; context->isPastFramePointer = 0; } void sentrycrashsc_initWithMachineContext(SentryCrashStackCursor *cursor, int maxStackDepth, const struct SentryCrashMachineContext* machineContext) { sentrycrashsc_initCursor(cursor, resetCursor, advanceCursor); MachineContextCursor* context = (MachineContextCursor*)cursor->context; context->machineContext = machineContext; context->maxStackDepth = maxStackDepth; context->instructionAddress = cursor->stackEntry.address; }
/* * Description: * History: yang@haipo.me, 2016/03/20, create */ # include "nw_timer.h" static void on_timer(struct ev_loop *loop, ev_timer *ev, int events) { struct nw_timer *timer = (struct nw_timer *)ev; timer->callback(timer, timer->privdata); } void nw_timer_set(nw_timer *timer, double interval, bool repeated, nw_timer_callback callback, void *privdata) { nw_loop_init(); if (repeated) { ev_timer_init(&timer->ev, on_timer, interval, interval); } else { ev_timer_init(&timer->ev, on_timer, interval, 0); } timer->loop = nw_default_loop; timer->interval = interval; timer->callback = callback; timer->privdata = privdata; } void nw_timer_start(nw_timer *timer) { if (!ev_is_active(&timer->ev)) { ev_timer_start(timer->loop, &timer->ev); } } void nw_timer_stop(nw_timer *timer) { if (ev_is_active(&timer->ev)) { ev_timer_stop(timer->loop, &timer->ev); } } bool nw_timer_active(nw_timer *timer) { if (ev_is_active(&timer->ev)) { return true; } return false; } double nw_timer_remaining(nw_timer *timer) { return ev_timer_remaining(timer->loop, &timer->ev); }
struct sysdir { char name[64]; char path[64]; } sysdir; :int SetAddApplDir(dword tName, tPath) { int i; strcpy(#sysdir.name, tName); strcpy(#sysdir.path, tPath); debug(#sysdir.name); debug(#sysdir.path); $mov eax, 30 $mov ebx, 3 ECX = #sysdir; $int 0x40 }
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_GesturePacker_ExampleVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_GesturePacker_ExampleVersionString[];
/* * Copyright (c) 2003, 2007-14 Matteo Frigo * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology * * 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 * */ /* This file was automatically generated --- DO NOT EDIT */ /* Generated on Thu May 24 08:05:25 EDT 2018 */ #include "dft/codelet-dft.h" #if defined(ARCH_PREFERS_FMA) || defined(ISA_EXTENSION_PREFERS_FMA) /* Generated by: ../../../genfft/gen_twiddle_c.native -fma -simd -compact -variables 4 -pipeline-latency 8 -n 3 -name t1fuv_3 -include dft/simd/t1fu.h */ /* * This function contains 8 FP additions, 8 FP multiplications, * (or, 5 additions, 5 multiplications, 3 fused multiply/add), * 12 stack variables, 2 constants, and 6 memory accesses */ #include "dft/simd/t1fu.h" static void t1fuv_3(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) { DVK(KP866025403, +0.866025403784438646763723170752936183471402627); DVK(KP500000000, +0.500000000000000000000000000000000000000000000); { INT m; R *x; x = ri; for (m = mb, W = W + (mb * ((TWVL / VL) * 4)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 4), MAKE_VOLATILE_STRIDE(3, rs)) { V T1, T3, T5, T6, T2, T4, T7, T8; T1 = LD(&(x[0]), ms, &(x[0])); T2 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)])); T3 = BYTWJ(&(W[0]), T2); T4 = LD(&(x[WS(rs, 2)]), ms, &(x[0])); T5 = BYTWJ(&(W[TWVL * 2]), T4); T6 = VADD(T3, T5); ST(&(x[0]), VADD(T1, T6), ms, &(x[0])); T7 = VFNMS(LDK(KP500000000), T6, T1); T8 = VMUL(LDK(KP866025403), VSUB(T5, T3)); ST(&(x[WS(rs, 2)]), VFNMSI(T8, T7), ms, &(x[0])); ST(&(x[WS(rs, 1)]), VFMAI(T8, T7), ms, &(x[WS(rs, 1)])); } } VLEAVE(); } static const tw_instr twinstr[] = { VTW(0, 1), VTW(0, 2), {TW_NEXT, VL, 0} }; static const ct_desc desc = { 3, XSIMD_STRING("t1fuv_3"), twinstr, &GENUS, {5, 5, 3, 0}, 0, 0, 0 }; void XSIMD(codelet_t1fuv_3) (planner *p) { X(kdft_dit_register) (p, t1fuv_3, &desc); } #else /* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -n 3 -name t1fuv_3 -include dft/simd/t1fu.h */ /* * This function contains 8 FP additions, 6 FP multiplications, * (or, 7 additions, 5 multiplications, 1 fused multiply/add), * 12 stack variables, 2 constants, and 6 memory accesses */ #include "dft/simd/t1fu.h" static void t1fuv_3(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) { DVK(KP866025403, +0.866025403784438646763723170752936183471402627); DVK(KP500000000, +0.500000000000000000000000000000000000000000000); { INT m; R *x; x = ri; for (m = mb, W = W + (mb * ((TWVL / VL) * 4)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 4), MAKE_VOLATILE_STRIDE(3, rs)) { V T1, T3, T5, T6, T2, T4, T7, T8; T1 = LD(&(x[0]), ms, &(x[0])); T2 = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)])); T3 = BYTWJ(&(W[0]), T2); T4 = LD(&(x[WS(rs, 2)]), ms, &(x[0])); T5 = BYTWJ(&(W[TWVL * 2]), T4); T6 = VADD(T3, T5); ST(&(x[0]), VADD(T1, T6), ms, &(x[0])); T7 = VFNMS(LDK(KP500000000), T6, T1); T8 = VBYI(VMUL(LDK(KP866025403), VSUB(T5, T3))); ST(&(x[WS(rs, 2)]), VSUB(T7, T8), ms, &(x[0])); ST(&(x[WS(rs, 1)]), VADD(T7, T8), ms, &(x[WS(rs, 1)])); } } VLEAVE(); } static const tw_instr twinstr[] = { VTW(0, 1), VTW(0, 2), {TW_NEXT, VL, 0} }; static const ct_desc desc = { 3, XSIMD_STRING("t1fuv_3"), twinstr, &GENUS, {7, 5, 1, 0}, 0, 0, 0 }; void XSIMD(codelet_t1fuv_3) (planner *p) { X(kdft_dit_register) (p, t1fuv_3, &desc); } #endif
#ifndef ANDROIDHELPER_H #define ANDROIDHELPER_H class AndroidHelper { public: AndroidHelper(); void setScreenOrientation(int orientation); }; #endif // ANDROIDHELPER_H
/** * \file * * \brief Unit test configuration * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "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 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_TEST_H #define CONF_TEST_H //! \note USART0 on PORTC routed through board controller to USB #define CONF_TEST_USART &USARTC0 //! \note 38400 baud #define CONF_TEST_BAUDRATE 38400 //! \note 8-bit character length #define CONF_TEST_CHARLENGTH USART_CHSIZE_8BIT_gc //! \note No parity check #define CONF_TEST_PARITY USART_PMODE_DISABLED_gc //! \note No extra stop bit, i.e., use 1 #define CONF_TEST_STOPBITS false #endif
/* Copyright (c) 2009 Florian Loitsch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include "prettify.h" #include "fast_exponent.h" #define HUMAN_READABLE void grisu2(double v, char* buffer, int* length, int* K); void fill_double_init() {} bool fill_double(double v, char* buffer) { int length, K; grisu2(v, buffer, &length, &K); #ifndef HUMAN_READABLE buffer[length] = 'e'; fill_exponent(K, &buffer[length+1]); #else prettify_string(buffer, 0, length, K); #endif return 1; }
// // AppDelegate.h // CHXTabBarControllerTransitioning // // Created by Moch Xiao on 7/6/15. // Copyright (c) 2015 Moch Xiao. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// // YJZAppDelegate.h // YJZAlbumCollectionView // // Created by YU JOHNNY ZHOU on 18/08/2014. // Copyright (c) 2014 YU JOHNNY ZHOU. All rights reserved. // #import <UIKit/UIKit.h> @interface YJZAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* ClassList.h Written by Matthew Fisher Forward declarations for classes/structures */ //Graphics objects struct RGBColor; class PointSet; class KDTree3; //Math objects struct Vec3f; struct Vec3f; struct Vec4f; struct Plane; struct Line3D; //Mesh objects struct MeshVertex; class BaseMesh; class D3D9Mesh; class D3D10Mesh; class Mesh; //D3D objects class D3D9Font; //Subdivision objects class HalfEdge; class FullEdge; class Triangle; class Vertex; class ComplexMesh; //Application/Windows objects class InputManager; class FrameTimer; class ApplicationWindow; //Graphics devices/API objects class GraphicsDevice; class OpenGLGraphicsDevice; class D3D9GraphicsDevice; class D3D10GraphicsDevice; class SoftwareGraphicsDevice; //Other objects class String; class UnicodeString; //template <class type> class Vector; //Texture objects class D3D10Texture;
#ifndef HTMLWRITER_H #define HTMLWRITER_H #include "DocWriter.h" class HTMLWriter : public DocWriter{ public: HTMLWriter(); ~HTMLWriter(); void Write(); void SetFont(const string& fontName, int fontSize, const string& fontColor); protected: string mFontName; int mFontSize; string mFontColor; }; #endif
/** * \file * \brief Kernel logging infrastructure headers. * * All C source in the kernel should include this file first. * This file should contain only definitions and prototypes that are * required for the majority of kernel code. */ /* * Copyright (c) 2016, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #ifndef __KERNEL_LOGGING_H #define __KERNEL_LOGGING_H #include <assert.h> #include <stddef.h> #include <stdio.h> // printf for debug #include <stdint.h> #include <inttypes.h> #include <stdbool.h> #include <barrelfish_kpi/types.h> #include <barrelfish_kpi/cpu.h> #include <barrelfish_kpi/registers_arch.h> #include <errors/errno.h> #include <bitmacros.h> #include <debug.h> #include <offsets.h> /* XXX */ #include <schedule.h> #define DEFAULT_LOGLEVEL LOG_NOTE #define DEFAULT_SUBSYSTEM_MASK (~0L) /** * Kernel subsystems. */ enum KERNEL_SUBSYSTEM { SUBSYS_STARTUP = (1 << 0), ///< Startup SUBSYS_GDB = (1 << 1), ///< GDB stub SUBSYS_APIC = (1 << 2), ///< APIC driver SUBSYS_ELF = (1 << 3), ///< ELF64 loader SUBSYS_PAGING = (1 << 4), ///< Paging SUBSYS_SYSCALL = (1 << 5), ///< System calls SUBSYS_CAPS = (1 << 6), ///< Capabilities SUBSYS_DISPATCH = (1 << 7), ///< Scheduling and dispatch SUBSYS_IO = (1 << 8), ///< Low-level IO operations }; /** * Kernel message loglevels. */ enum KERNEL_LOG_LEVEL { LOG_PANIC = 0, ///< Panic LOG_ERR = 1, ///< Error LOG_WARN = 2, ///< Warning LOG_NOTE = 3, ///< Notice LOG_DEBUG = 4, ///< Debug }; void panic(const char *, ...) __attribute__((noreturn, format(printf, 1, 2))); void printk(int level, const char *msg, ...) __attribute__ ((format(printf, 2, 3))); int printf_nolog(const char * fmt, ...) __attribute__ ((format(printf, 1, 2))); /** * Command-line variable to set kernel logging level. */ extern int kernel_loglevel; /** * Command-line variable to control which subsystems log. Bits defined * SUBSYS_* definitions in this file. */ extern int kernel_log_subsystem_mask; /** * \brief Log a kernel debug message. * * Logs printf()-style debug message 'fmt' from subsystem 'subs' * to the default kernel console(s). Additional arguments are like * printf(). Whether the message is put out depends on the current * kernel log level, as well as on the current kernel subsystem log * mask. 'debug' is a macro so that the cost of marshalling the * arguments is avoided if the relevant debugging is disabled. * * \param _subs Subsystem this message stems from. * \param _fmt The message (printf() format string) */ #define debug(_subs, _fmt, ...) \ do { \ if (((_subs) & kernel_log_subsystem_mask) && (kernel_loglevel >= LOG_DEBUG)) \ printk(LOG_DEBUG, _fmt, ## __VA_ARGS__); \ } while(0) #endif // __KERNEL_LOGGING_H
// // SYScanCodeViewController.h // // // Created by bcmac3 on 14/12/2016. // Copyright © 2016 ShenYang. All rights reserved. // /* 由于要使用相册+相机权限,所以请先在info.plist 配置以下参数 Privacy - Photo Library Usage Description Or NSPhotoLibraryUsageDescription Privacy - Camera Usage Description Or NSCameraUsageDescription */ #import <UIKit/UIKit.h> typedef void(^successBlock)(NSString *codeInfo); @interface SYScanCodeViewController : UIViewController /// 扫码成功回调 @property (nonatomic, copy) successBlock successBlock; /// 导航栏标题 @property (nonatomic, copy) NSString *navTitle; /// 是否显示相册按钮 @property (nonatomic, assign) BOOL showAlbum; /// 返回按钮图片 @property (nonatomic, copy) NSString *backImageName; /// 矩形框图片 @property (nonatomic, copy) NSString *bgImageName; /// 扫描线图片 @property (nonatomic, copy) NSString *scanLineImageName; /// 提示信息 @property (nonatomic, copy) NSString *tipTitle; /// 快速初始化 - (instancetype)initWithSuccessBlock:(successBlock)successBlock; @end
/* * Copyright (c) 2014 ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #ifndef DMA_INTERNAL_H #define DMA_INTERNAL_H #include <dma/dma.h> #define DMA_BENCH_ENABLED 1 #endif /* DMA_INTERNAL_H */
/* ** my_unsetenv.c for 42sh in /u/all/jorge_d/cu/svn/42shsvn/trunk/srcs/builtins ** ** Made by dimitri jorge ** Login <jorge_d@epitech.net> ** ** Started on Fri May 7 17:46:04 2010 dimitri jorge ** Last update Fri May 21 13:40:19 2010 dimitri jorge */ #include <sys/types.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include "42sh.h" static void _unset_head(t_env **begin, t_env *parse) { t_env *new_begin; new_begin = parse->next; xfree(parse->var); xfree(parse); if (new_begin) new_begin->prev = NULL; *begin = new_begin; } static void _unset_tail(t_env *parse) { t_env *tmp; tmp = parse->prev; xfree(parse->var); xfree(parse); tmp->next = NULL; } static void _unset_basic(t_env *parse) { t_env *tmp1; t_env *tmp2; tmp1 = parse->prev; tmp2 = parse->next; xfree(parse->var); xfree(parse); tmp1->next = tmp2; tmp2->prev = tmp1; } static void _unset_elem(t_env **begin, t_env *parse) { if (parse->prev == NULL) _unset_head(begin, parse); else if (parse->next == NULL) _unset_tail(parse); else _unset_basic(parse); } int my_unsetenv(char **args) { t_env *parse; t_env *begin; int count; begin = gl_st.st_env; count = 1; if (my_tablen(args) < 2) { fprintf(stderr, "unsetenv: Too few arguments.\n"); return (EXIT_FAILURE); } else if (begin) while ((begin) && (args[count])) { parse = begin; while ((parse) && my_strcmp(parse->var, args[count]) != '=') parse = parse->next; if (parse) _unset_elem(&begin, parse); count++; } gl_st.st_env = begin; return (EXIT_SUCCESS); }
// // NSArray+Filtering.h // xkcd // // Created by Josh Bleecher Snyder on 6/19/12. // // #import <Foundation/Foundation.h> typedef BOOL (^ObjectTestBlock)(id obj); @interface NSArray (Filtering) - (BOOL)containsObjectPassingTest:(ObjectTestBlock)test; - (NSArray *)objectsPassingTest:(ObjectTestBlock)test; - (BOOL)containsObjectOfKindOfClass:(Class)cls; - (NSArray *)objectsOfKindOfClass:(Class)cls; @end
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2014 Torus Knot Software Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- */ #ifndef __GLSLExtSupport_H__ #define __GLSLExtSupport_H__ #include "OgreGLPrerequisites.h" // // OpenGL Shading Language entry points // namespace Ogre { namespace GLSL { // forward declarations class GLSLProgram; class GLSLGpuProgram; class GLSLLinkProgram; class GLSLLinkProgramManager; class GLSLProgramFactory; /** Check for GL errors and report them in the Ogre Log. */ void reportGLSLError(GLenum glErr, const String& ogreMethod, const String& errorTextPrefix, const uint obj, const bool forceInfoLog = false, const bool forceException = false); /** if there is a message in GL info log then post it in the Ogre Log @param msg the info log message string is appended to this string @param obj the GL object that is used to retrieve the info log */ String logObjectInfo(const String& msg, uint obj); /// just return the info without logging it String getObjectInfo(GLuint obj); } } // namespace Ogre #endif // __GLSLExtSupport_H__
// // RBIBeacon.h // RBIBeacon // // Created by Yifei Chen on 12/30/14. // #import <Foundation/Foundation.h> @interface RBIBeacon : NSObject @property (readonly, nonatomic, strong) NSUUID *proximityUUID; @property (readonly, nonatomic, strong) NSNumber *major; @property (readonly, nonatomic, strong) NSNumber *minor; @property (readonly, nonatomic, strong) NSString *key; @property (nonatomic) double accuracy; - (instancetype)initWithUUID:(NSUUID *)UUID major:(NSNumber *)major minor:(NSNumber *)minor accuracy:(double)accuracy; @end
// // DConnectSpecErrorFactory.h // DConnectSDK // // Copyright (c) 2016 NTT DOCOMO,INC. // Released under the MIT license // http://opensource.org/licenses/mit-license.php // #import <Foundation/Foundation.h> @interface DConnectSpecErrorFactory : NSObject + (NSError *) createError: (NSString *) errorMessage; @end
/* $Id: gquery.c,v 1.2 2005/04/08 20:45:34 erg Exp $ $Revision: 1.2 $ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ /* Lefteris Koutsofios - AT&T Labs Research */ #include "common.h" #include "g.h" #include "gcommon.h" int GQcreatewidget ( Gwidget_t *parent, Gwidget_t *widget, int attrn, Gwattr_t *attrp ) { return -1; } int GQsetwidgetattr (Gwidget_t *widget, int attrn, Gwattr_t *attrp) { return 0; } int GQgetwidgetattr (Gwidget_t *widget, int attrn, Gwattr_t *attrp) { return 0; } int GQdestroywidget (Gwidget_t *widget) { return 0; } int GQqueryask ( Gwidget_t *widget, char *prompt, char *args, char *responsep, int responsen ) { return 0; }
/* $NoKeywords:$ */ /** * @file * * Advanced API Interface for HT, Memory and CPU * * Contains additional declarations need to use HT, Memory and CPU Advanced interface, such as * would be required by the basic interface implementations. * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: Include * @e \$Revision: 34897 $ @e \$Date: 2010-07-14 10:07:10 +0800 (Wed, 14 Jul 2010) $ */ /* ***************************************************************************** * * Copyright (c) 2011, Advanced Micro Devices, 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 Advanced Micro Devices, 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 ADVANCED MICRO DEVICES, INC. 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 _ADVANCED_API_H_ #define _ADVANCED_API_H_ /*---------------------------------------------------------------------------- * HT FUNCTIONS PROTOTYPE * *---------------------------------------------------------------------------- */ /** * A constructor for the HyperTransport input structure. * * Sets inputs to valid, basic level, defaults. * * @param[in] StdHeader Opaque handle to standard config header * @param[in] AmdHtInterface HT Interface structure to initialize. * * @retval AGESA_SUCCESS Constructors are not allowed to fail */ AGESA_STATUS AmdHtInterfaceConstructor ( IN AMD_CONFIG_PARAMS *StdHeader, IN AMD_HT_INTERFACE *AmdHtInterface ); /** * The top level external interface for Hypertransport Initialization. * * Create our initial internal state, initialize the coherent fabric, * initialize the non-coherent chains, and perform any required fabric tuning or * optimization. * * @param[in] StdHeader Opaque handle to standard config header * @param[in] PlatformConfiguration The platform configuration options. * @param[in] AmdHtInterface HT Interface structure. * * @retval AGESA_SUCCESS Only information events logged. * @retval AGESA_ALERT Sync Flood or CRC error logged. * @retval AGESA_WARNING Example: expected capability not found * @retval AGESA_ERROR logged events indicating some devices may not be available * @retval AGESA_FATAL Mixed Family or MP capability mismatch * */ AGESA_STATUS AmdHtInitialize ( IN AMD_CONFIG_PARAMS *StdHeader, IN PLATFORM_CONFIGURATION *PlatformConfiguration, IN AMD_HT_INTERFACE *AmdHtInterface ); /*---------------------------------------------------------------------------- * HT Recovery FUNCTIONS PROTOTYPE * *---------------------------------------------------------------------------- */ /** * A constructor for the HyperTransport input structure. * */ AGESA_STATUS AmdHtResetConstructor ( IN AMD_CONFIG_PARAMS *StdHeader, IN AMD_HT_RESET_INTERFACE *AmdHtResetInterface ); /** * Initialize HT at Reset for both Normal and Recovery. * */ AGESA_STATUS AmdHtInitReset ( IN AMD_CONFIG_PARAMS *StdHeader, IN AMD_HT_RESET_INTERFACE *AmdHtResetInterface ); /** * Initialize the Node and Socket maps for an AP Core. * */ AGESA_STATUS AmdHtInitRecovery ( IN AMD_CONFIG_PARAMS *StdHeader ); ///---------------------------------------------------------------------------- /// MEMORY FUNCTIONS PROTOTYPE /// ///---------------------------------------------------------------------------- AGESA_STATUS AmdMemRecovery ( IN OUT MEM_DATA_STRUCT *MemPtr ); AGESA_STATUS AmdMemAuto ( IN OUT MEM_DATA_STRUCT *MemPtr ); VOID AmdMemInitDataStructDef ( IN OUT MEM_DATA_STRUCT *MemPtr, IN OUT PLATFORM_CONFIGURATION *PlatFormConfig ); VOID memDefRet ( VOID ); BOOLEAN memDefTrue ( VOID ); BOOLEAN memDefFalse ( VOID ); #endif // _ADVANCED_API_H_
/* -*- C++ -*- * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * Michael A.G. Aivazis * California Institute of Technology * (C) 1998-2005 All Rights Reserved * * <LicenseText> * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * */ #if !defined(journal_firewall_h) #define journal_firewall_h /* get definition of __HERE__ macros */ #include "macros.h" #ifdef __cplusplus extern "C" #endif void firewall_hit(__HERE_DECL__, const char * fmt, ...); #ifdef __cplusplus extern "C" #endif void firewall_affirm(int condition, __HERE_DECL__, const char * fmt, ...); #ifdef __cplusplus #include <string> #include <sstream> #include "Diagnostic.h" #include "SeverityFirewall.h" #include "manipulators.h" /* forward declarations */ namespace journal { typedef SeverityFirewall firewall_t; } #endif /* __cplusplus */ #endif /* journal_firewall_h */ /* version */ /* $Id: firewall.h,v 1.2 2005/06/04 01:07:26 cummings Exp $ */ /* End of file */
#ifndef _ASM_RISCV_UNALIGNED_H #define _ASM_RISCV_UNALIGNED_H /* * FIXME: this file is copy-n-pasted from sandbox's unaligned.h */ #include <linux/unaligned/access_ok.h> #include <linux/unaligned/generic.h> #if __BYTE_ORDER == __LITTLE_ENDIAN #define get_unaligned __get_unaligned_le #define put_unaligned __put_unaligned_le #else #define get_unaligned __get_unaligned_be #define put_unaligned __put_unaligned_be #endif #endif /* _ASM_RISCV_UNALIGNED_H */
/****************************************************************************************************** * (C) 2018 markummitchell@github.com. This file is part of Engauge Digitizer, which is released * * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file * * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. * ******************************************************************************************************/ #ifndef CREATE_STATUS_BAR_H #define CREATE_STATUS_BAR_H #include <QObject> class MainWindow; /// Class to create status bar for MainWindow class. We derive from QObject and /// use Q_OBJECT so translations work class CreateStatusBar : public QObject { Q_OBJECT public: /// Single constructor. CreateStatusBar(); /// Create QStatusBar void create (MainWindow &mw); }; #endif // CREATE_STATUS_BAR_H
int recursive_action(const char *fileName, unsigned flags, int (*fileAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), int (*dirAction)(const char *fileName, struct stat *statbuf, void* userData, int depth), void* userData, unsigned depth); //int replace_equal(const char* src_path, const char* dst_path); /* Some useful definitions */ #undef FALSE #define FALSE ((int) 0) #undef TRUE #define TRUE ((int) 1) #undef SKIP #define SKIP ((int) 2) #define LONE_DASH(s) ((s)[0] == '-' && !(s)[1]) #define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) #define LONE_CHAR(s,c) ((s)[0] == (c) && !(s)[1]) #define NOT_LONE_CHAR(s,c) ((s)[0] != (c) || (s)[1]) #define DOT_OR_DOTDOT(s) ((s)[0] == '.' && (!(s)[1] || ((s)[1] == '.' && !(s)[2]))) enum { ACTION_RECURSE = (1 << 0), ACTION_FOLLOWLINKS = (1 << 1), ACTION_FOLLOWLINKS_L0 = (1 << 2), ACTION_DEPTHFIRST = (1 << 3), /*ACTION_REVERSE = (1 << 4), - unused */ ACTION_QUIET = (1 << 5), };
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Event redirector is used to inject user events from a GL window * into the emulated program. */ #ifndef EVENT_INJECTOR_H #define EVENT_INJECTOR_H class EventInjectorPrivate; class EventInjector { public: EventInjector(int consolePort); virtual ~EventInjector(); void wait( int timeout_ms ); void poll( void ); void sendMouseDown( int x, int y ); void sendMouseUp( int x, int y ); void sendMouseMotion( int x, int y ); void sendKeyDown( int keycode ); void sendKeyUp( int keycode ); /* Keycode values expected by the Linux kernel, and the emulator */ enum { KEY_BACK = 158, KEY_HOME = 102, KEY_SOFT1 = 229, KEY_LEFT = 105, KEY_UP = 103, KEY_DOWN = 108, KEY_RIGHT = 106, KEY_VOLUMEUP = 115, KEY_VOLUMEDOWN = 114, KEY_SEND = 231, KEY_END = 107, KEY_ENTER = 28, }; private: EventInjectorPrivate* mPrivate; }; #endif /* EVENT_INJECTOR_H */
/* * Hamlib CI-V backend - description of IC-R72 * Copyright (c) 2000-2010 by Stephane Fillod * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include "hamlib/rig.h" #include "icom.h" #define ICR72_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY) #define ICR72_FUNC_ALL (RIG_FUNC_NONE) #define ICR72_LEVEL_ALL (RIG_LEVEL_NONE) #define ICR72_VFO_OPS (RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_MCL) #define ICR72_VFO_ALL (RIG_VFO_A|RIG_VFO_MEM) #define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL) #define ICR72_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|RIG_SCAN_PRIO) static const struct icom_priv_caps icr72_priv_caps = { 0x32, /* default address */ 0, /* 731 mode */ ic737_ts_sc_list }; const struct rig_caps icr72_caps = { .rig_model = RIG_MODEL_ICR72, .model_name = "IC-R72", .mfg_name = "Icom", .version = BACKEND_VER, .copyright = "LGPL", .status = RIG_STATUS_UNTESTED, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 300, .serial_rate_max = 9600, .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, .timeout = 200, .retry = 3, .has_get_func = ICR72_FUNC_ALL, .has_set_func = ICR72_FUNC_ALL, .has_get_level = ICR72_LEVEL_ALL, .has_set_level = RIG_LEVEL_SET(ICR72_LEVEL_ALL), .has_get_parm = RIG_PARM_ANN, .has_set_parm = RIG_PARM_ANN, .level_gran = {}, /* granularity */ .parm_gran = {}, .ctcss_list = NULL, .dcs_list = NULL, .preamp = { RIG_DBLST_END, }, .attenuator = { RIG_DBLST_END, }, .max_rit = Hz(0), .max_xit = Hz(0), .max_ifshift = Hz(0), .targetable_vfo = 0, .vfo_ops = ICR72_VFO_OPS, .scan_ops = ICR72_SCAN_OPS, .transceive = RIG_TRN_RIG, .bank_qty = 0, .chan_desc_sz = 0, .chan_list = { { 1, 99, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, RIG_CHAN_END, }, .rx_range_list1 = { {kHz(100),MHz(30),ICR72_MODES,-1,-1,ICR72_VFO_ALL}, RIG_FRNG_END, }, .tx_range_list1 = { RIG_FRNG_END, }, .rx_range_list2 = { {kHz(100),MHz(30),ICR72_MODES,-1,-1,ICR72_VFO_ALL}, RIG_FRNG_END, }, .tx_range_list2 = { RIG_FRNG_END, }, .tuning_steps = { {ICR72_MODES,Hz(10)}, {ICR72_MODES,kHz(1)}, {ICR72_MODES,kHz(2)}, {ICR72_MODES,kHz(3)}, {ICR72_MODES,kHz(4)}, {ICR72_MODES,kHz(5)}, {ICR72_MODES,kHz(6)}, {ICR72_MODES,kHz(7)}, {ICR72_MODES,kHz(8)}, {ICR72_MODES,kHz(9)}, {ICR72_MODES,kHz(10)}, RIG_TS_END, }, /* mode/filter list, remember: order matters! */ .filters = { {RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY, kHz(2.3)}, {RIG_MODE_AM, kHz(6)}, {RIG_MODE_FM, kHz(15)}, RIG_FLT_END, }, .cfgparams = icom_cfg_params, .set_conf = icom_set_conf, .get_conf = icom_get_conf, .priv = (void*)&icr72_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, .rig_open = NULL, .rig_close = NULL, .set_freq = icom_set_freq, .get_freq = icom_get_freq, .set_mode = icom_set_mode, .get_mode = icom_get_mode, .set_vfo = icom_set_vfo, .decode_event = icom_decode_event, .get_level = icom_get_level, .set_mem = icom_set_mem, .vfo_op = icom_vfo_op, .get_dcd = icom_get_dcd, .set_ts = icom_set_ts, .get_ts = icom_get_ts, .scan = icom_scan, };
/* Time-stamp: <2006-11-23 00:43:34 jcs> | | Copyright (C) 2002 Corey Donohoe <atmos at atmos.org> | Copyright (C) 2004-2005 Jorg Schuler <jcsjcs at users.sourceforge.net> | Part of the gtkpod project. | | URL: http://www.gtkpod.org/ | URL: http://gtkpod.sourceforge.net/ | | 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 | | iTunes and iPod are trademarks of Apple | | This product is not supported/written/published by Apple! | | $Id$ */ #ifndef _GTKPOD_SHA1_H_ #define _GTKPOD_SHA1_H_ #include "gp_itdb.h" void setup_sha1(); gchar *sha1_hash_on_filename (gchar *name, gboolean silent); /* Any calls to the following functions immediately return if sha1sums * is not on */ Track *sha1_file_exists (iTunesDB *itdb, gchar *file, gboolean silent); Track *sha1_sha1_exists (iTunesDB *itdb, gchar *sha1); Track *sha1_track_exists (iTunesDB *itdb, Track *s); Track *sha1_track_exists_insert (iTunesDB *itdb, Track *s); void sha1_track_remove (Track *s); void sha1_free (iTunesDB *itdb); void sha1_free_eitdb (ExtraiTunesDBData *eitdb); #endif
/* Copyright (C) 2007 xyster.net * * 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 __UIRT_RAW_H #define __UIRT_RAW_H #define RR_MAX_PULSES 128 typedef struct rr_ctx { int state; int done; UInt8 repeat_count; UInt32 interspace; // interspace in 50us UInt32 freq; // frequency (pulled from thin air) UInt32 nof_pulses; UInt32 pulse[RR_MAX_PULSES]; // pulse times in 50us UInt32 nof_spaces; UInt32 space[RR_MAX_PULSES]; // space times in 50us } rr_ctx; typedef struct rr_ret { int done; UInt32 n : 16; UInt32 m : 16; UInt8 d[2]; } rr_ret; UInt32 rr_init(rr_ctx *ctx, UInt32 len, UInt8 *d); rr_ret rr_parse(rr_ctx *ctx, UInt32 len, UInt8 *d); void rr_set_frequency(rr_ctx *ctx, UInt32 freq); UInt32 rr_output_pronto(rr_ctx *ctx, UInt8 *d); UInt32 rr_output(rr_ctx *ctx, UInt8 *d); #endif
/* * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FTLThunks_h #define FTLThunks_h #include <wtf/Platform.h> #if ENABLE(FTL_JIT) #include "FTLLocation.h" #include "FTLSlowPathCallKey.h" #include "MacroAssemblerCodeRef.h" #include <wtf/HashMap.h> namespace JSC { class VM; namespace FTL { MacroAssemblerCodeRef osrExitGenerationThunkGenerator(VM*); MacroAssemblerCodeRef slowPathCallThunkGenerator(VM&, const SlowPathCallKey&); template<typename KeyTypeArgument> struct ThunkMap { typedef KeyTypeArgument KeyType; typedef HashMap<KeyType, MacroAssemblerCodeRef> ToThunkMap; typedef HashMap<MacroAssemblerCodePtr, KeyType> FromThunkMap; ToThunkMap m_toThunk; FromThunkMap m_fromThunk; }; template<typename MapType, typename GeneratorType> MacroAssemblerCodeRef generateIfNecessary( VM& vm, MapType& map, const typename MapType::KeyType& key, GeneratorType generator) { typename MapType::ToThunkMap::iterator iter = map.m_toThunk.find(key); if (iter != map.m_toThunk.end()) return iter->value; MacroAssemblerCodeRef result = generator(vm, key); map.m_toThunk.add(key, result); map.m_fromThunk.add(result.code(), key); return result; } template<typename MapType> typename MapType::KeyType keyForThunk(MapType& map, MacroAssemblerCodePtr ptr) { typename MapType::FromThunkMap::iterator iter = map.m_fromThunk.find(ptr); RELEASE_ASSERT(iter != map.m_fromThunk.end()); return iter->value; } class Thunks { public: MacroAssemblerCodeRef getSlowPathCallThunk(VM& vm, const SlowPathCallKey& key) { return generateIfNecessary( vm, m_slowPathCallThunks, key, slowPathCallThunkGenerator); } SlowPathCallKey keyForSlowPathCallThunk(MacroAssemblerCodePtr ptr) { return keyForThunk(m_slowPathCallThunks, ptr); } private: ThunkMap<SlowPathCallKey> m_slowPathCallThunks; }; } } // namespace JSC::FTL #endif // ENABLE(FTL_JIT) #endif // FTLTHunks_h
/********************************************************************* Filename: util_menu.h Description: UART based one-key menu. *********************************************************************/ #ifndef UTIL_MENU_H #define UTIL_MENU_H #ifdef __cplusplus extern "C" { #endif /********************************************************************* * INCLUDES */ #include "hal_types.h" /********************************************************************* * CONSTANTS */ #define MENU_ID_APP 0 #define MENU_ID_ROOT 1 #define MENU_ID_NWK 2 #define MENU_ID_HAL 3 #define N_MAX_MENUES 4 /********************************************************************* * TYPEDEFS */ typedef struct { uint8 cmd; // Single key user command const char FAR *szDecsr;// Textual description void (*pfCmd)(void); // Function; 0 arguments } MenuItem; typedef struct _menuItem { struct _menuItem *pParent; const char FAR *szPrompt; MenuItem FAR *pFirst; } Menu; /********************************************************************* * PUBLIC FUNCTIONS */ void menuInit(void); void menuInstall(uint8 iMenuID, MenuItem FAR *pMenuHandle, const char FAR *szPr); uint8 menuCmdExec(uint8 *pBuf, uint8 nBytes); void menuPrint(void); void menuPrintPrompt(void); void menuPrintItem(MenuItem FAR *p); uint8 menuIsInstalled(uint8 iMenuID); void menuSelect(uint8 iMenuID); MenuItem FAR *menuFindItem(Menu *pMenu, uint8 cmd); #ifdef __cplusplus } #endif #endif
/* * synergy -- mouse and keyboard sharing utility * Copyright (C) 2012 Synergy Si Ltd. * Copyright (C) 2002 Chris Schoeneman * * This package is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * found in the file COPYING that should have accompanied this file. * * This package 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/>. */ #pragma once #include "server/ClientProxy1_0.h" //! Proxy for client implementing protocol version 1.1 class ClientProxy1_1 : public ClientProxy1_0 { public: ClientProxy1_1(const String& name, synergy::IStream* adoptedStream, IEventQueue* events); ~ClientProxy1_1(); // IClient overrides virtual void keyDown(KeyID, KeyModifierMask, KeyButton); virtual void keyRepeat(KeyID, KeyModifierMask, SInt32 count, KeyButton); virtual void keyUp(KeyID, KeyModifierMask, KeyButton); };
#ifndef __IVR_HELP_H__ #define __IVR_HELP_H__ #ifdef CONFIG_AUDIOCODES_VOIP // help ACMW to compile pass, but IVR WB function is not workable typedef enum { /* This can help to up/down sampling before/after encode/decode */ SAMPLE_NARROW_BAND, /* 8K sampling rate */ SAMPLE_WIDE_BAND, /* 16k sampling rate */ SAMPLE_IGNORE, /* Don't care sampling rate in silence codec */ } SampleRate_t; extern SampleRate_t VoipChannelSampleRate[]; //#ifdef CONFIG_VOIP_SDK #define MAX_NB_CHANNELS 1 typedef struct ResamplerState_ ResamplerState; typedef int (*resampler_basic_func)(ResamplerState *, uint32_t , const int16_t *, uint32_t *, int16_t *, uint32_t *); struct ResamplerState_ { uint32_t in_rate; uint32_t out_rate; uint32_t num_rate; uint32_t den_rate; int quality; uint32_t nb_channels; uint32_t filt_len; uint32_t mem_alloc_size; int int_advance; int frac_advance; //float cutoff; uint32_t oversample; int initialised; int started; /* These are per-channel */ int32_t last_sample[MAX_NB_CHANNELS]; uint32_t samp_frac_num[MAX_NB_CHANNELS]; uint32_t magic_samples[MAX_NB_CHANNELS]; #if SUPPORT_QUALITY_0_TO_3 int16_t mem[MAX_NB_CHANNELS*96];//support for max. rank 3 #endif #if SUPPORT_QUALITY_0_TO_10 int16_t mem[MAX_NB_CHANNELS*512]; //support for max. rank 10 #endif int16_t *sinc_table; uint32_t sinc_table_length; resampler_basic_func resampler_ptr; int in_stride; int out_stride; } ; #if 0 extern int resampler_process_int_ex( ResamplerState *st, uint32_t channel_index, const int16_t *in, uint32_t in_len_n, int16_t *out, uint32_t out_len_n, const char *err_format); #endif extern int resampler_process_int(ResamplerState *st, uint32_t channel_index, const int16_t *in, uint32_t *in_len, int16_t *out, uint32_t *out_len); //#endif #else #include "codec_descriptor.h" #endif #endif //__IVR_HELP_H__
/** * @file mstimer.c * * @author Andy Lindsay * * @copyright * Copyright (C) Parallax, Inc. 2013. All Rights MIT Licensed. * * @brief Code for tracking milliseconds elapsed in another cog. This is part of * a tutorial on adding a Simple Library to the project. */ #include "simpletools.h" // Include simpletools #include "mstimer.h" static volatile int t, dt, cog; // Global var for cogs to share static unsigned int stack[40 + 25]; // Stack vars for other cog void ms_timer(void *par); int mstime_start() { mstime_stop(); cog = 1 + cogstart(ms_timer, NULL, stack, sizeof(stack)); } void mstime_stop() { if(cog) { cogstop(cog -1); cog = 0; } } int mstime_get() { return t; } void mstime_reset() { t = 0; } void mstime_set(int newTime) { t = newTime; } // Function runs in another cog void ms_timer(void *par) { dt = CLKFREQ/1000; int ticks = CNT; while(1) { waitcnt(ticks+=dt); t++; } } /** * TERMS OF USE: MIT License * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */
/* * psirichtext.h - helper functions to handle Icons in QTextDocuments * Copyright (C) 2006 Michail Pishchagin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include <QTextDocument> #include <QTextCursor> class PsiRichText { public: static void install(QTextDocument *doc); static void ensureTextLayouted(QTextDocument *doc, int documentWidth, Qt::Alignment align = Qt::AlignLeft, Qt::LayoutDirection layoutDirection = Qt::LeftToRight, bool textWordWrap = true); static void setText(QTextDocument *doc, const QString &text); static void insertIcon(QTextCursor &cursor, const QString &iconName, const QString &iconText); static void appendText(QTextDocument *doc, QTextCursor &cursor, const QString &text); static QString convertToPlainText(const QTextDocument *doc); };
/* * charge_current.c -- charge current control interface for the sgs2/3 * * Copyright (C) 2011 Gokhan Moral * * GT-I9300/N7100 support by simone201 * * 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; * */ #include <linux/platform_device.h> #include <linux/miscdevice.h> #define MAX_CURRENT 2100 int charge_current_ac = 1700; int charge_current_cdp = 1000; int charge_current_usb = 475; int charge_current_dock = 1700; static ssize_t charge_current_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "AC: %d\nCDP: %d\nUSB: %d\nDock: %d\n", charge_current_ac, charge_current_cdp, charge_current_usb, charge_current_dock); } static ssize_t charge_current_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { unsigned int ret = -EINVAL; int temp[4]; ret = sscanf(buf, "%d %d %d %d", &temp[0], &temp[1], &temp[2], &temp[3]); if (ret != 4) { return -EINVAL; } else { charge_current_ac = (temp[0] < MAX_CURRENT) ? temp[0] : MAX_CURRENT; charge_current_cdp = (temp[1] < MAX_CURRENT) ? temp[1] : MAX_CURRENT; charge_current_usb = (temp[2] < MAX_CURRENT) ? temp[2] : MAX_CURRENT; charge_current_dock = (temp[3] < MAX_CURRENT) ? temp[3] : MAX_CURRENT; } return count; } static DEVICE_ATTR(charge_current, S_IRUGO | S_IWUGO, charge_current_show, charge_current_store); static struct attribute *charge_current_attributes[] = { &dev_attr_charge_current.attr, NULL }; static struct attribute_group charge_current_group = { .attrs = charge_current_attributes, }; static struct miscdevice charge_current_device = { .minor = MISC_DYNAMIC_MINOR, .name = "charge_current", }; void charge_current_start(void) { printk("Initializing charge current control interface\n"); misc_register(&charge_current_device); if (sysfs_create_group(&charge_current_device.this_device->kobj, &charge_current_group) < 0) { printk("%s sysfs_create_group failed\n", __FUNCTION__); pr_err("Unable to create group for %s\n", charge_current_device.name); } }
#ifndef LIBMD5WRAPPER_H #define LIBMD5WRAPPER_H #include <libmd5.h> //struct wrapper #define MD5Context LibMD5Context #define MD5_CTX LibMD5_CTX #define EVP_MD_CTX LibMD5_CTX //function wrapper #define MD5Init LibMD5Init #define MD5Update LibMD5Update #define MD5Final LibMD5Final //function wrapper #define MD5_Init LibMD5Init #define MD5_Update LibMD5Update #define MD5_Final LibMD5Final #endif /* !LIBMD5WRAPPER_H */
#include <pthread.h> #include <stdio.h> #include <stdlib.h> /* Simple test program, no race. Parent and child both modify x and use the hardware bus lock. */ #undef PLAT_x86_darwin #undef PLAT_amd64_darwin #undef PLAT_x86_freebsd #undef PLAT_amd64_freebsd #undef PLAT_x86_linux #undef PLAT_amd64_linux #undef PLAT_ppc32_linux #undef PLAT_ppc64_linux #undef PLAT_arm_linux #undef PLAT_s390x_linux #undef PLAT_mips32_linux #if defined(__APPLE__) && defined(__i386__) # define PLAT_x86_darwin 1 #elif defined(__APPLE__) && defined(__x86_64__) # define PLAT_amd64_darwin 1 #elif defined(__FreeBSD__) && defined(__i386__) # define PLAT_x86_freebsd 1 #elif defined(__FreeBSD__) && defined(__amd64__) # define PLAT_amd64_freebsd 1 #elif defined(__linux__) && defined(__i386__) # define PLAT_x86_linux 1 #elif defined(__linux__) && defined(__x86_64__) # define PLAT_amd64_linux 1 #elif defined(__linux__) && defined(__powerpc__) && !defined(__powerpc64__) # define PLAT_ppc32_linux 1 #elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) # define PLAT_ppc64_linux 1 #elif defined(__linux__) && defined(__arm__) # define PLAT_arm_linux 1 #elif defined(__linux__) && defined(__s390x__) # define PLAT_s390x_linux 1 #elif defined(__linux__) && defined(__mips__) # define PLAT_mips32_linux 1 #endif #if defined(PLAT_amd64_linux) || defined(PLAT_x86_linux) \ || defined(PLAT_amd64_darwin) || defined(PLAT_x86_darwin) \ || defined(PLAT_amd64_freebsd) || defined(PLAT_x86_freebsd) # define INC(_lval,_lqual) \ __asm__ __volatile__ ( \ "lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" ) #elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) # define INC(_lval,_lqual) \ __asm__ __volatile__( \ "1:\n" \ " lwarx 15,0,%0\n" \ " addi 15,15,1\n" \ " stwcx. 15,0,%0\n" \ " bne- 1b\n" \ : /*out*/ : /*in*/ "b"(&(_lval)) \ : /*trash*/ "r15", "cr0", "memory" \ ) #elif defined(PLAT_arm_linux) # define INC(_lval,_lqual) \ __asm__ __volatile__( \ "1:\n" \ " ldrex r8, [%0, #0]\n" \ " add r8, r8, #1\n" \ " strex r9, r8, [%0, #0]\n" \ " cmp r9, #0\n" \ " bne 1b\n" \ : /*out*/ : /*in*/ "r"(&(_lval)) \ : /*trash*/ "r8", "r9", "cc", "memory" \ ); #elif defined(PLAT_s390x_linux) # define INC(_lval,_lqual) \ __asm__ __volatile__( \ "1: l 0,%0\n" \ " lr 1,0\n" \ " ahi 1,1\n" \ " cs 0,1,%0\n" \ " jl 1b\n" \ : "+m" (_lval) :: "cc", "1","2" \ ) #elif defined(PLAT_mips32_linux) # define INC(_lval,_lqual) \ __asm__ __volatile__ ( \ "1:\n" \ " move $8, %0\n" \ " ll $9, 0($8)\n" \ " addiu $9, $9, 1\n" \ " sc $9, 0($8)\n" \ " li $10, 1\n" \ " bne $9, $10, 1b\n" \ " nop\n" \ : /*out*/ : /*in*/ "r"(&(_lval)) \ : /*trash*/ "$8", "$9", "$10", "cc", "memory" \ ) #else # error "Fix Me for this platform" #endif int x = 0; void* child_fn ( void* arg ) { INC(x, "childfn"); return NULL; } int main ( void ) { pthread_t child; if (pthread_create(&child, NULL, child_fn, NULL)) { perror("pthread_create"); exit(1); } INC(x, "main"); if (pthread_join(child, NULL)) { perror("pthread join"); exit(1); } printf("x = %d\n", x); return 0; }
/* * ================================================================= * * * Description: samsung display panel file * * Author: jb09.kim * Company: Samsung Electronics * * ================================================================ */ /* <one line to give the program's name and a brief idea of what it does.> Copyright (C) 2012, Samsung Electronics. 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. * */ #ifndef SS_DSI_PANEL_S6E3HA2_AMS801HK01_H #define SS_DSI_PANEL_S6E3HA2_AMS801HK01_H #include "../ss_dsi_panel_common.h" struct smartdim_conf *smart_get_conf_S6E3HA2_AMS801HK01(void); struct smartdim_conf *smart_get_conf_S6E3HA2_AMS801HK01_hmt(void); #endif
/* SPDX-License-Identifier: GPL-2.0-only */ #include <acpi/acpi.h> #include <acpi/acpi_gnvs.h> #include <acpi/acpigen.h> #include <arch/smp/mpspec.h> #include <console/console.h> #include <device/device.h> #include <device/mmio.h> #include <device/pci_ops.h> #include <intelblocks/acpi.h> #include <intelblocks/cpulib.h> #include <intelblocks/pmclib.h> #include <soc/cpu.h> #include <soc/iomap.h> #include <soc/nvs.h> #include <soc/pci_devs.h> #include <soc/pm.h> #include <soc/soc_chip.h> #include <soc/systemagent.h> /* * List of supported C-states in this processor. */ enum { C_STATE_C0, /* 0 */ C_STATE_C1, /* 1 */ C_STATE_C1E, /* 2 */ C_STATE_C6_SHORT_LAT, /* 3 */ C_STATE_C6_LONG_LAT, /* 4 */ C_STATE_C7_SHORT_LAT, /* 5 */ C_STATE_C7_LONG_LAT, /* 6 */ C_STATE_C7S_SHORT_LAT, /* 7 */ C_STATE_C7S_LONG_LAT, /* 8 */ C_STATE_C8, /* 9 */ C_STATE_C9, /* 10 */ C_STATE_C10, /* 11 */ NUM_C_STATES }; static const acpi_cstate_t cstate_map[NUM_C_STATES] = { [C_STATE_C0] = {}, [C_STATE_C1] = { .latency = C1_LATENCY, .power = C1_POWER, .resource = MWAIT_RES(0, 0), }, [C_STATE_C1E] = { .latency = C1_LATENCY, .power = C1_POWER, .resource = MWAIT_RES(0, 1), }, [C_STATE_C6_SHORT_LAT] = { .latency = C6_LATENCY, .power = C6_POWER, .resource = MWAIT_RES(2, 0), }, [C_STATE_C6_LONG_LAT] = { .latency = C6_LATENCY, .power = C6_POWER, .resource = MWAIT_RES(2, 1), }, [C_STATE_C7_SHORT_LAT] = { .latency = C7_LATENCY, .power = C7_POWER, .resource = MWAIT_RES(3, 0), }, [C_STATE_C7_LONG_LAT] = { .latency = C7_LATENCY, .power = C7_POWER, .resource = MWAIT_RES(3, 1), }, [C_STATE_C7S_SHORT_LAT] = { .latency = C7_LATENCY, .power = C7_POWER, .resource = MWAIT_RES(3, 2), }, [C_STATE_C7S_LONG_LAT] = { .latency = C7_LATENCY, .power = C7_POWER, .resource = MWAIT_RES(3, 3), }, [C_STATE_C8] = { .latency = C8_LATENCY, .power = C8_POWER, .resource = MWAIT_RES(4, 0), }, [C_STATE_C9] = { .latency = C9_LATENCY, .power = C9_POWER, .resource = MWAIT_RES(5, 0), }, [C_STATE_C10] = { .latency = C10_LATENCY, .power = C10_POWER, .resource = MWAIT_RES(6, 0), }, }; static int cstate_set_non_s0ix[] = { C_STATE_C1, C_STATE_C6_LONG_LAT, C_STATE_C7S_LONG_LAT }; static int cstate_set_s0ix[] = { C_STATE_C1, C_STATE_C7S_LONG_LAT, C_STATE_C10 }; const acpi_cstate_t *soc_get_cstate_map(size_t *entries) { static acpi_cstate_t map[MAX(ARRAY_SIZE(cstate_set_s0ix), ARRAY_SIZE(cstate_set_non_s0ix))]; int *set; int i; config_t *config = config_of_soc(); int is_s0ix_enable = config->s0ix_enable; if (is_s0ix_enable) { *entries = ARRAY_SIZE(cstate_set_s0ix); set = cstate_set_s0ix; } else { *entries = ARRAY_SIZE(cstate_set_non_s0ix); set = cstate_set_non_s0ix; } for (i = 0; i < *entries; i++) { map[i] = cstate_map[set[i]]; map[i].ctype = i + 1; } return map; } void soc_power_states_generation(int core_id, int cores_per_package) { config_t *config = config_of_soc(); if (config->eist_enable) /* Generate P-state tables */ generate_p_state_entries(core_id, cores_per_package); } void soc_fill_fadt(acpi_fadt_t *fadt) { const uint16_t pmbase = ACPI_BASE_ADDRESS; config_t *config = config_of_soc(); fadt->pm_tmr_blk = pmbase + PM1_TMR; fadt->pm_tmr_len = 4; fadt->x_pm_tmr_blk.space_id = ACPI_ADDRESS_SPACE_IO; fadt->x_pm_tmr_blk.bit_width = fadt->pm_tmr_len * 8; fadt->x_pm_tmr_blk.bit_offset = 0; fadt->x_pm_tmr_blk.access_size = ACPI_ACCESS_SIZE_DWORD_ACCESS; fadt->x_pm_tmr_blk.addrl = pmbase + PM1_TMR; fadt->x_pm_tmr_blk.addrh = 0x0; fadt->preferred_pm_profile = PM_MOBILE; if (config->s0ix_enable) fadt->flags |= ACPI_FADT_LOW_PWR_IDLE_S0; } uint32_t soc_read_sci_irq_select(void) { return read32p(soc_read_pmc_base() + IRQ_REG); } static unsigned long soc_fill_dmar(unsigned long current) { uint64_t gfxvtbar = MCHBAR64(GFXVTBAR) & VTBAR_MASK; bool gfxvten = MCHBAR32(GFXVTBAR) & VTBAR_ENABLED; if (is_devfn_enabled(SA_DEVFN_IGD) && gfxvtbar && gfxvten) { unsigned long tmp = current; current += acpi_create_dmar_drhd(current, 0, 0, gfxvtbar); current += acpi_create_dmar_ds_pci(current, 0, 2, 0); acpi_dmar_drhd_fixup(tmp, current); } uint64_t vtvc0bar = MCHBAR64(VTVC0BAR) & VTBAR_MASK; bool vtvc0en = MCHBAR32(VTVC0BAR) & VTBAR_ENABLED; if (vtvc0bar && vtvc0en) { const unsigned long tmp = current; current += acpi_create_dmar_drhd(current, DRHD_INCLUDE_PCI_ALL, 0, vtvc0bar); current += acpi_create_dmar_ds_ioapic(current, 2, V_P2SB_CFG_IBDF_BUS, V_P2SB_CFG_IBDF_DEV, V_P2SB_CFG_IBDF_FUNC); current += acpi_create_dmar_ds_msi_hpet(current, 0, V_P2SB_CFG_HBDF_BUS, V_P2SB_CFG_HBDF_DEV, V_P2SB_CFG_HBDF_FUNC); acpi_dmar_drhd_fixup(tmp, current); } /* Add RMRR entry */ const unsigned long tmp = current; current += acpi_create_dmar_rmrr(current, 0, sa_get_gsm_base(), sa_get_tolud_base() - 1); current += acpi_create_dmar_ds_pci(current, 0, 2, 0); acpi_dmar_rmrr_fixup(tmp, current); return current; } unsigned long sa_write_acpi_tables(const struct device *dev, unsigned long current, struct acpi_rsdp *rsdp) { acpi_dmar_t *const dmar = (acpi_dmar_t *)current; /* * Create DMAR table only if we have VT-d capability and FSP does not override its * feature. */ if ((pci_read_config32(dev, CAPID0_A) & VTD_DISABLE) || !(MCHBAR32(VTVC0BAR) & VTBAR_ENABLED)) return current; printk(BIOS_DEBUG, "ACPI: * DMAR\n"); acpi_create_dmar(dmar, DMAR_INTR_REMAP | DMA_CTRL_PLATFORM_OPT_IN_FLAG, soc_fill_dmar); current += dmar->header.length; current = acpi_align_current(current); acpi_add_table(rsdp, dmar); return current; } void soc_fill_gnvs(struct global_nvs *gnvs) { config_t *config = config_of_soc(); /* Enable DPTF based on mainboard configuration */ gnvs->dpte = config->dptf_enable; /* Set USB2/USB3 wake enable bitmaps. */ gnvs->u2we = config->usb2_wake_enable_bitmap; gnvs->u3we = config->usb3_wake_enable_bitmap; /* Fill in Above 4GB MMIO resource */ sa_fill_gnvs(gnvs); } int soc_madt_sci_irq_polarity(int sci) { return MP_IRQ_POLARITY_HIGH; }
/* FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. *************************************************************************** * * * FreeRTOS provides completely free yet professionally developed, * * robust, strictly quality controlled, supported, and cross * * platform software that has become a de facto standard. * * * * Help yourself get started quickly and support the FreeRTOS * * project by purchasing a FreeRTOS tutorial book, reference * * manual, or both from: http://www.FreeRTOS.org/Documentation * * * * Thank you! * * * *************************************************************************** This file is part of the FreeRTOS distribution. FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. >>! NOTE: The modification to the GPL is included to allow you to distribute >>! a combined work that includes FreeRTOS without being obliged to provide >>! the source code for proprietary components outside of the FreeRTOS >>! kernel. FreeRTOS 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. Full license text is available from the following link: http://www.freertos.org/a00114.html 1 tab == 4 spaces! *************************************************************************** * * * Having a problem? Start by reading the FAQ "My application does * * not run, what could be wrong?" * * * * http://www.FreeRTOS.org/FAQHelp.html * * * *************************************************************************** http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS compatible FAT file system, and our tiny thread aware UDP/IP stack. http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS licenses offer ticketed support, indemnification and middleware. http://www.SafeRTOS.com - High Integrity Systems also provide a safety engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. 1 tab == 4 spaces! */ /*----------------------------------------------------------- * Simple IO routines to control the LEDs. *-----------------------------------------------------------*/ /* Scheduler includes. */ #include "FreeRTOS.h" #include "task.h" /* Demo includes. */ #include "partest.h" /* Library includes. */ #include <board.h> #include <gpio.h> /* The number of LEDs available to the user on the evaluation kit. */ #define partestNUM_LEDS ( 3UL ) /* One of the LEDs is wired in the inverse to the others as it is also used as the power LED. */ #define partstsINVERTED_LED ( 0UL ) /* The index of the pins to which the LEDs are connected. The ordering of the LEDs in this array is intentional and matches the order they appear on the hardware. */ static const uint32_t ulLED[] = { LED2_GPIO, LED0_GPIO, LED1_GPIO }; /*-----------------------------------------------------------*/ void vParTestInitialise( void ) { unsigned long ul; for( ul = 0; ul < partestNUM_LEDS; ul++ ) { /* Configure the LED, before ensuring it starts in the off state. */ gpio_configure_pin( ulLED[ ul ], ( PIO_OUTPUT_1 | PIO_DEFAULT ) ); vParTestSetLED( ul, pdFALSE ); } } /*-----------------------------------------------------------*/ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) { if( uxLED < partestNUM_LEDS ) { if( uxLED == partstsINVERTED_LED ) { xValue = !xValue; } if( xValue != pdFALSE ) { /* Turn the LED on. */ taskENTER_CRITICAL(); { gpio_set_pin_low( ulLED[ uxLED ]); } taskEXIT_CRITICAL(); } else { /* Turn the LED off. */ taskENTER_CRITICAL(); { gpio_set_pin_high( ulLED[ uxLED ]); } taskEXIT_CRITICAL(); } } } /*-----------------------------------------------------------*/ void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) { if( uxLED < partestNUM_LEDS ) { taskENTER_CRITICAL(); { gpio_toggle_pin( ulLED[ uxLED ] ); } taskEXIT_CRITICAL(); } }
/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 only, * 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 version 2 for more details (a copy is included * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see http://www.gnu.org/licenses * * GPL HEADER END */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * Copyright (c) 2011, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Oracle Corporation, Inc. */ #ifndef _LIBCFS_FAIL_H #define _LIBCFS_FAIL_H extern unsigned long cfs_fail_loc; extern unsigned int cfs_fail_val; extern int cfs_fail_err; extern wait_queue_head_t cfs_race_waitq; extern int cfs_race_state; int __cfs_fail_check_set(__u32 id, __u32 value, int set); int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set); enum { CFS_FAIL_LOC_NOSET = 0, CFS_FAIL_LOC_ORSET = 1, CFS_FAIL_LOC_RESET = 2, CFS_FAIL_LOC_VALUE = 3 }; /* Failure injection control */ #define CFS_FAIL_MASK_SYS 0x0000FF00 #define CFS_FAIL_MASK_LOC (0x000000FF | CFS_FAIL_MASK_SYS) #define CFS_FAILED_BIT 30 /* CFS_FAILED is 0x40000000 */ #define CFS_FAILED (1 << CFS_FAILED_BIT) #define CFS_FAIL_ONCE_BIT 31 /* CFS_FAIL_ONCE is 0x80000000 */ #define CFS_FAIL_ONCE (1 << CFS_FAIL_ONCE_BIT) /* The following flags aren't made to be combined */ #define CFS_FAIL_SKIP 0x20000000 /* skip N times then fail */ #define CFS_FAIL_SOME 0x10000000 /* only fail N times */ #define CFS_FAIL_RAND 0x08000000 /* fail 1/N of the times */ #define CFS_FAIL_USR1 0x04000000 /* user flag */ /* CFS_FAULT may be combined with any one of the above flags. */ #define CFS_FAULT 0x02000000 /* match any CFS_FAULT_CHECK */ static inline bool CFS_FAIL_PRECHECK(__u32 id) { return cfs_fail_loc != 0 && ((cfs_fail_loc & CFS_FAIL_MASK_LOC) == (id & CFS_FAIL_MASK_LOC) || (cfs_fail_loc & id & CFS_FAULT)); } static inline int cfs_fail_check_set(__u32 id, __u32 value, int set, int quiet) { int ret = 0; if (unlikely(CFS_FAIL_PRECHECK(id) && (ret = __cfs_fail_check_set(id, value, set)))) { if (quiet) { CDEBUG(D_INFO, "*** cfs_fail_loc=%x, val=%u***\n", id, value); } else { LCONSOLE_INFO("*** cfs_fail_loc=%x, val=%u***\n", id, value); } } return ret; } /* If id hit cfs_fail_loc, return 1, otherwise return 0 */ #define CFS_FAIL_CHECK(id) \ cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET, 0) #define CFS_FAIL_CHECK_QUIET(id) \ cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET, 1) /* If id hit cfs_fail_loc and cfs_fail_val == (-1 or value) return 1, * otherwise return 0 */ #define CFS_FAIL_CHECK_VALUE(id, value) \ cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 0) #define CFS_FAIL_CHECK_VALUE_QUIET(id, value) \ cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 1) /* If id hit cfs_fail_loc, cfs_fail_loc |= value and return 1, * otherwise return 0 */ #define CFS_FAIL_CHECK_ORSET(id, value) \ cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 0) #define CFS_FAIL_CHECK_ORSET_QUIET(id, value) \ cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 1) /* If id hit cfs_fail_loc, cfs_fail_loc = value and return 1, * otherwise return 0 */ #define CFS_FAIL_CHECK_RESET(id, value) \ cfs_fail_check_set(id, value, CFS_FAIL_LOC_RESET, 0) #define CFS_FAIL_CHECK_RESET_QUIET(id, value) \ cfs_fail_check_set(id, value, CFS_FAIL_LOC_RESET, 1) static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) { if (unlikely(CFS_FAIL_PRECHECK(id))) return __cfs_fail_timeout_set(id, value, ms, set); else return 0; } /* If id hit cfs_fail_loc, sleep for seconds or milliseconds */ #define CFS_FAIL_TIMEOUT(id, secs) \ cfs_fail_timeout_set(id, 0, (secs) * 1000, CFS_FAIL_LOC_NOSET) #define CFS_FAIL_TIMEOUT_MS(id, ms) \ cfs_fail_timeout_set(id, 0, ms, CFS_FAIL_LOC_NOSET) /* If id hit cfs_fail_loc, cfs_fail_loc |= value and * sleep seconds or milliseconds */ #define CFS_FAIL_TIMEOUT_ORSET(id, value, secs) \ cfs_fail_timeout_set(id, value, (secs) * 1000, CFS_FAIL_LOC_ORSET) #define CFS_FAIL_TIMEOUT_RESET(id, value, secs) \ cfs_fail_timeout_set(id, value, secs * 1000, CFS_FAIL_LOC_RESET) #define CFS_FAIL_TIMEOUT_MS_ORSET(id, value, ms) \ cfs_fail_timeout_set(id, value, ms, CFS_FAIL_LOC_ORSET) #define CFS_FAULT_CHECK(id) \ CFS_FAIL_CHECK(CFS_FAULT | (id)) /* The idea here is to synchronise two threads to force a race. The * first thread that calls this with a matching fail_loc is put to * sleep. The next thread that calls with the same fail_loc wakes up * the first and continues. */ static inline void cfs_race(__u32 id) { if (CFS_FAIL_PRECHECK(id)) { if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) { int rc; cfs_race_state = 0; CERROR("cfs_race id %x sleeping\n", id); rc = wait_event_interruptible(cfs_race_waitq, cfs_race_state != 0); CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc); } else { CERROR("cfs_fail_race id %x waking\n", id); cfs_race_state = 1; wake_up(&cfs_race_waitq); } } } #define CFS_RACE(id) cfs_race(id) #endif /* _LIBCFS_FAIL_H */
/*************************************************************************** * Copyright (c) 1999-2010, Broadcom Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Module Description: * DO NOT EDIT THIS FILE DIRECTLY * * This module was generated magically with RDB from a source description * file. You must edit the source file for changes to be made to this file. * * * Date: Generated on Mon May 17 02:36:25 2010 * MD5 Checksum b742c675c94ab0a4246db427bf62a82c * * Compiled with: RDB Utility combo_header.pl * RDB Parser 3.0 * unknown unknown * Perl Interpreter 5.008008 * Operating System linux * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #ifndef BCHP_IRQ1_H__ #define BCHP_IRQ1_H__ /*************************************************************************** *IRQ1 - Level 2 PCI Interrupt Enable/Status ***************************************************************************/ #define BCHP_IRQ1_IRQEN 0x004062b8 /* Interrupt Enable */ #define BCHP_IRQ1_IRQSTAT 0x004062bc /* Interrupt Status */ #endif /* #ifndef BCHP_IRQ1_H__ */ /* End of File */
/* * profile.c * * Copyright (C) 2008-2011 Samsung Electronics * Sang-bum Suh <sbuk.suh@samsung.com> * JaeMin Ryu <jm77.ryu@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public version 2 of License as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <asm/profile.h> #include <asm/arch/regs.h> u32 profile_log_idx = 0; struct log_entry profile_data[MAX_LOG_ENTRIES]; void event_logging(u32 origin, u32 event) { profile_data[profile_log_idx].origin = origin; profile_data[profile_log_idx].event = event; profile_data[profile_log_idx].timestamp = OSCR; if (++profile_log_idx == MAX_LOG_ENTRIES) profile_log_idx = 0; }
// TABMAC.H Olivier Bertrand 2011-2012 // MAC: virtual table to Get Mac Addresses via GetAdaptersInfo #if defined(_WIN32) #include <windows.h> #include <iphlpapi.h> #else // !_WIN32 #error This is a WINDOWS only table TYPE #endif // !_WIN32 /***********************************************************************/ /* Definitions. */ /***********************************************************************/ typedef class MACDEF *PMACDEF; typedef class TDBMAC *PTDBMAC; typedef class MACCOL *PMACCOL; /* -------------------------- MAC classes ---------------------------- */ /***********************************************************************/ /* MAC: virtual table to get the list of MAC addresses. */ /***********************************************************************/ class DllExport MACDEF : public TABDEF { /* Logical table description */ friend class TDBMAC; public: // Constructor MACDEF(void) {Pseudo = 3;} // Implementation virtual const char *GetType(void) {return "MAC";} // Methods virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); virtual PTDB GetTable(PGLOBAL g, MODE m); //virtual bool DeleteTableFile(PGLOBAL g) {return true;} protected: // Members }; // end of MACDEF /***********************************************************************/ /* This is the class declaration for the MAC table. */ /***********************************************************************/ class TDBMAC : public TDBASE { friend class MACCOL; public: // Constructor TDBMAC(PMACDEF tdp); //TDBMAC(PGLOBAL g, PTDBMAC tdbp); // Implementation virtual AMT GetAmType(void) {return TYPE_AM_MAC;} //virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMAC(g, this);} // Methods //virtual PTDB Clone(PTABS t); virtual int GetRecpos(void) {return N;} virtual int RowNumber(PGLOBAL g, bool b = false) {return N;} // Database routines virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); virtual int Cardinality(PGLOBAL g) {return GetMaxSize(g);} virtual int GetMaxSize(PGLOBAL g); virtual bool OpenDB(PGLOBAL g); virtual int ReadDB(PGLOBAL g); virtual int WriteDB(PGLOBAL g); virtual int DeleteDB(PGLOBAL g, int irc); virtual void CloseDB(PGLOBAL g) {} protected: // Specific routines bool GetMacInfo(PGLOBAL g); bool GetFixedInfo(PGLOBAL g); void MakeErrorMsg(PGLOBAL g, DWORD drc); // Members FIXED_INFO *FixedInfo; // Points to fixed info structure PIP_ADAPTER_INFO Piaf; // Points on Adapter info array PIP_ADAPTER_INFO Curp; // Points on current Adapt info PIP_ADAPTER_INFO Next; // Points on next Adapt info ULONG Buflen; // Buffer length bool Fix; // true if FixedInfo is needed bool Adap; // true if Piaf is needed int N; // Row number }; // end of class TDBMAC /***********************************************************************/ /* Class MACCOL: MAC Address column. */ /***********************************************************************/ class MACCOL : public COLBLK { friend class TDBMAC; public: // Constructors MACCOL(PCOLDEF cdp, PTDB tdbp, int n); //MACCOL(MACCOL *colp, PTDB tdbp); // Constructor used in copy process // Implementation virtual int GetAmType(void) {return TYPE_AM_MAC;} // Methods virtual void ReadColumn(PGLOBAL g); protected: MACCOL(void) {} // Default constructor not to be used // Members PTDBMAC Tdbp; // Points to MAC table block int Flag; // Indicates what to display }; // end of class MACCOL
/* mkvmerge -- utility for splicing together matroska files from component media subtypes Distributed under the GPL v2 see the file COPYING for details or visit http://www.gnu.org/copyleft/gpl.html definitions and helper functions for BluRay playlist files (MPLS) Written by Moritz Bunkus <moritz@bunkus.org>. */ #ifndef MTX_COMMON_MPLS_COMMON_H #define MTX_COMMON_MPLS_COMMON_H #include "common/common_pch.h" #include <vector> #include "common/bit_cursor.h" #include "common/fourcc.h" #include "common/timestamp.h" #define MPLS_FILE_MAGIC fourcc_c("MPLS") #define MPLS_FILE_MAGIC2A fourcc_c("0100") #define MPLS_FILE_MAGIC2B fourcc_c("0200") namespace mtx { namespace mpls { class exception: public mtx::exception { protected: std::string m_message; public: explicit exception(std::string const &message) : m_message(message) { } explicit exception(boost::format const &message): m_message(message.str()) { } virtual ~exception() throw() { } virtual char const *what() const throw() { return m_message.c_str(); } }; struct header_t { fourcc_c type_indicator1, type_indicator2; unsigned int playlist_pos, chapter_pos, ext_pos; void dump() const; }; struct stream_t { unsigned int stream_type, sub_path_id, sub_clip_id, pid, coding_type, format, rate, char_code; std::string language; void dump(std::string const &type) const; }; struct stn_t { unsigned int num_video, num_audio, num_pg, num_ig, num_secondary_audio, num_secondary_video, num_pip_pg; std::vector<stream_t> audio_streams, video_streams, pg_streams; void dump() const; }; struct play_item_t { std::string clip_id, codec_id; unsigned int connection_condition, stc_id; timestamp_c in_time, out_time, relative_in_time; bool is_multi_angle; stn_t stn; void dump() const; }; struct playlist_t { unsigned int list_count, sub_count; std::vector<play_item_t> items; timestamp_c duration; void dump() const; }; class parser_c { protected: bool m_ok, m_drop_last_entry_if_at_end; debugging_option_c m_debug; header_t m_header; playlist_t m_playlist; std::vector<timestamp_c> m_chapters; bit_reader_cptr m_bc; public: parser_c(); virtual ~parser_c(); virtual bool parse(mm_io_c *in); virtual bool is_ok() const { return m_ok; } virtual void dump() const; virtual playlist_t const &get_playlist() const { return m_playlist; } std::vector<timestamp_c> const &get_chapters() const { return m_chapters; } void enable_dropping_last_entry_if_at_end(bool enable); protected: virtual void parse_header(); virtual void parse_playlist(); virtual play_item_t parse_play_item(); virtual stn_t parse_stn(); virtual stream_t parse_stream(); virtual void parse_chapters(); virtual std::string read_string(unsigned int length); }; using parser_cptr = std::shared_ptr<parser_c>; }} #endif // MTX_COMMON_MPLS_COMMON_H
/* Copyright (C) 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <sched.h> #include <errno.h> #include <sys/procset.h> #include <schedP.h> int __sched_getparam (pid_t pid, struct sched_param *param) { int errval = __sched_getparam_id (P_PID, pid, &param->sched_priority); if (errval != 0) { __set_errno (errval); return -1; } return 0; } weak_alias (__sched_getparam, sched_getparam)
/* Copyright (C) 2010 Brad Hards <bradh@frogmouth.net> This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef RTFREADER_HLINKBASEPCDATADESTINATION_H #define RTFREADER_HLINKBASEPCDATADESTINATION_H #include <QString> #include <QColor> #include "PcdataDestination.h" #include "rtfreader_export.h" namespace RtfReader { class Reader; class RTFREADER_EXPORT HLinkBasePcdataDestination: public PcdataDestination { public: HLinkBasePcdataDestination( Reader *reader, AbstractRtfOutput *output, const QString &name ); virtual ~HLinkBasePcdataDestination(); virtual void aboutToEndDestination(); }; } #endif
/* * linux/arch/arm/mach-s5pv310/charger-slp7.c * COPYRIGHT(C) 2011 * MyungJoo Ham <myungjoo.ham@samsung.com> * * SLP7(NURI) Board Charger Support with Charger-Manager Framework * */ #include <asm/io.h> #include <linux/err.h> #include <linux/gpio.h> #include <linux/platform_device.h> #include <linux/platform_data/ntc_thermistor.h> #include <linux/regulator/consumer.h> #include <linux/power/charger-manager.h> #include <linux/mfd/max8997.h> #include <linux/mfd/max8997-private.h> #include <mach/regs-pmu.h> #include <mach/irqs.h> #include <plat/gpio-core.h> #include <plat/pm.h> /* Returns true if the last wakeup was caused by the exynos rtc */ static bool s3c_wksrc_rtc_alarm(void) { u32 reg = __raw_readl(S5P_WAKEUP_STAT) & S5P_WAKEUP_STAT_WKSRC_MASK; if ((reg & S5P_WAKEUP_STAT_RTCALARM) && !(reg & ~S5P_WAKEUP_STAT_RTCALARM)) return true; /* yes, it is */ return false; } /* Convert an external interrupt number (0-31) to a Linux irq number */ static int eint_to_gpio(int eint) { if (eint < 8) return EXYNOS5_GPX0(eint & 7); else if (eint < 16) return EXYNOS5_GPX1(eint & 7); else if (eint < 24) return EXYNOS5_GPX2(eint & 7); else return EXYNOS5_GPX3(eint & 7); } /** * charger_check_wake_irq() - Check if the given irq caused the wakeup * @wake_irq to check * @return true if that irq (and only that irq) caused the most recent wakeup * false otherwise (not that irq, or multiple irqs) */ static bool charger_check_wake_irq(int wake_irq) { unsigned long bit = IRQ_EINT_BIT(wake_irq); bool s3c_rtc_wakeup; uint value = 0; uint mask; int i; /* Check which of the enabled wakeup souces are active */ for (i = 0, mask = 1; i < 32; i++, mask <<= 1) { int gpio; if (!(s3c_irqwake_eintmask & mask)) { gpio = eint_to_gpio(i); if (!gpio_get_value(gpio)) value |= mask; } } s3c_rtc_wakeup = s3c_wksrc_rtc_alarm(); pr_debug("%s: s3c_rtc_wakeup=%d, eint=%#x\n", __func__, s3c_rtc_wakeup, value); /* * If we are looking for the exynos rtc and it is the only wakeup * cause source, then we have a match */ if (wake_irq == EXYNOS5_IRQ_RTC_ALARM) { if (s3c_rtc_wakeup && !value) return true; /* * We also have a match if the exynos rtc did not cause the wakeup * and the select eint did */ } else if (!s3c_rtc_wakeup && value == (1U << bit)) { return true; } return false; } static char *nuri_charger_stats[] = { "max8997_pmic", "max8903_charger", NULL }; static struct regulator_bulk_data nuri_chargers[] = { { .supply = "vinchg1", }, { .supply = "vinchg2", }, }; static struct charger_desc nuri_charger_desc = { .psy_name = "battery", .polling_interval_ms = 30000, .polling_mode = CM_POLL_CHARGING_ONLY, .fullbatt_vchkdrop_ms = 30000, .fullbatt_vchkdrop_uV = 100000, .fullbatt_uV = 4200000, .battery_present = CM_FUEL_GAUGE, .psy_charger_stat = nuri_charger_stats, .charger_regulators = nuri_chargers, .num_charger_regulators = ARRAY_SIZE(nuri_chargers), .psy_fuel_gauge = "max17042_battery", .measure_battery_temp = false, .temperature_high = 60 * 1000, .temperature_high_recovery = 40 * 1000, .temperature_low = 0 * 1000, .temperature_low_recovery = 5 * 1000, }; struct charger_global_desc nuri_charger_g_desc = { .rtc_name = "rtc0", .rtc_only_wakeup = charger_check_wake_irq, .assume_timer_stops_in_suspend = true, }; struct platform_device nuri_charger_manager = { .name = "charger-manager", .dev = { .platform_data = &nuri_charger_desc, }, };
/* * Samsung S3C6410 SD/MMC Driver * Based on sdhci.c * Author: JingRi Email:jingr-1@163.com */ #include <common.h> #include <malloc.h> #include <sdhci.h> #include <asm/arch/s3c6410.h> #ifdef CONFIG_MMC_CHANNEL #define MMC_CHANNEL CONFIG_MMC_CHANNEL #else #define MMC_CHANNEL 0 #endif #define ELFIN_HSMMC_BASE 0x7c200000 #define MMC_REGS_BASE (ELFIN_HSMMC_BASE + MMC_CHANNEL*0x100000) static void sdhc_set_gpio() { u32 reg; #if(MMC_CHANNEL == 0) reg = readl(GPGCON) & 0xf0000000; writel(reg | 0x02222222, GPGCON); reg = readl(GPGPUD) & 0xfffff000; writel (reg, GPGPUD); #elif(MMC_CHANNEL == 1) writel(0x02222222, GPHCON0); writel(0x00000000, GPHCON1); reg = readl(GPHPUD) & 0xfffff000; writel (reg, GPHPUD); #else printf("#####error: SDMMC channel is not defined!\n"); #endif } int s3c_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks) { struct sdhci_host *host = NULL; host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host)); if(!host) { printf("#####error: sdhci_host malloc failed!\n"); return 1; } sdhc_set_gpio(); host->name = "Samsung Host Controller"; host->ioaddr = (void *)regbase; host->quirks = quirks; host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; if(quirks & SDHCI_QUIRK_REG32_RW) host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16; else host->version = sdhci_readw(host, SDHCI_HOST_VERSION); host->host_caps = MMC_MODE_HC; add_sdhci(host, max_clk, min_clk); return 0; } int board_mmc_init(bd_t *bis) { return s3c_sdhci_init(MMC_REGS_BASE, 52000000, 400000, 0); }
#ifndef FINITE_FACTORY_H_ #define FINITE_FACTORY_H_ #include <sampler/SingletonFactory.h> namespace base { /** * @short Factory object for finite samplers */ class FiniteFactory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; } #endif /* FINITE_FACTORY_H_ */
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _mysys_err_h #define _mysys_err_h #ifdef __cplusplus extern "C" { #endif #define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */ #define EE(X) (globerrs[(X) - EE_ERROR_FIRST]) extern const char *globerrs[]; /* my_error_messages is here */ /* Error message numbers in global map */ /* Do not add error numbers before EE_ERROR_FIRST. If necessary to add lower numbers, change EE_ERROR_FIRST accordingly. We start with error 1 to not confuse peoples with 'error 0' */ #define EE_ERROR_FIRST 1 /*Copy first error nr.*/ #define EE_CANTCREATEFILE 1 #define EE_READ 2 #define EE_WRITE 3 #define EE_BADCLOSE 4 #define EE_OUTOFMEMORY 5 #define EE_DELETE 6 #define EE_LINK 7 #define EE_EOFERR 9 #define EE_CANTLOCK 10 #define EE_CANTUNLOCK 11 #define EE_DIR 12 #define EE_STAT 13 #define EE_CANT_CHSIZE 14 #define EE_CANT_OPEN_STREAM 15 #define EE_GETWD 16 #define EE_SETWD 17 #define EE_LINK_WARNING 18 #define EE_OPEN_WARNING 19 #define EE_DISK_FULL 20 #define EE_CANT_MKDIR 21 #define EE_UNKNOWN_CHARSET 22 #define EE_OUT_OF_FILERESOURCES 23 #define EE_CANT_READLINK 24 #define EE_CANT_SYMLINK 25 #define EE_REALPATH 26 #define EE_SYNC 27 #define EE_UNKNOWN_COLLATION 28 #define EE_FILENOTFOUND 29 #define EE_FILE_NOT_CLOSED 30 #define EE_CHANGE_OWNERSHIP 31 #define EE_CHANGE_PERMISSIONS 32 #define EE_CANT_SEEK 33 #define EE_CAPACITY_EXCEEDED 34 #define EE_ERROR_LAST 34 /* Copy last error nr */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* exit codes for all MySQL programs */ #define EXIT_UNSPECIFIED_ERROR 1 #define EXIT_UNKNOWN_OPTION 2 #define EXIT_AMBIGUOUS_OPTION 3 #define EXIT_NO_ARGUMENT_ALLOWED 4 #define EXIT_ARGUMENT_REQUIRED 5 #define EXIT_VAR_PREFIX_NOT_UNIQUE 6 #define EXIT_UNKNOWN_VARIABLE 7 #define EXIT_OUT_OF_MEMORY 8 #define EXIT_UNKNOWN_SUFFIX 9 #define EXIT_NO_PTR_TO_VARIABLE 10 #define EXIT_CANNOT_CONNECT_TO_SERVICE 11 #define EXIT_OPTION_DISABLED 12 #define EXIT_ARGUMENT_INVALID 13 #ifdef __cplusplus } #endif #endif
/* crypto/asn1/a_enum.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <stdio.h> #include "cryptlib.h" #include <openssl/asn1.h> /* * Code for ENUMERATED type: identical to INTEGER apart from a different tag. * for comments on encoding see a_int.c */ int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) { int i,j,k; unsigned char buf[sizeof(long)+1]; long d; a->type=V_ASN1_ENUMERATED; if (a->length < (sizeof(long)+1)) { if (a->data != NULL) OPENSSL_free(a->data); if ((a->data=(unsigned char *)OPENSSL_malloc(sizeof(long)+1)) != NULL) memset((char *)a->data,0,sizeof(long)+1); } if (a->data == NULL) { ASN1err(ASN1_F_ASN1_ENUMERATED_SET,ERR_R_MALLOC_FAILURE); return(0); } d=v; if (d < 0) { d= -d; a->type=V_ASN1_NEG_ENUMERATED; } for (i=0; i<sizeof(long); i++) { if (d == 0) break; buf[i]=(int)d&0xff; d>>=8; } j=0; for (k=i-1; k >=0; k--) a->data[j++]=buf[k]; a->length=j; return(1); } long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) { int neg=0,i; long r=0; if (a == NULL) return(0L); i=a->type; if (i == V_ASN1_NEG_ENUMERATED) neg=1; else if (i != V_ASN1_ENUMERATED) return -1; if (a->length > sizeof(long)) { /* hmm... a bit ugly */ return(0xffffffffL); } if (a->data == NULL) return 0; for (i=0; i<a->length; i++) { r<<=8; r|=(unsigned char)a->data[i]; } if (neg) r= -r; return(r); } ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) { ASN1_ENUMERATED *ret; int len,j; if (ai == NULL) ret=M_ASN1_ENUMERATED_new(); else ret=ai; if (ret == NULL) { ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED,ERR_R_NESTED_ASN1_ERROR); goto err; } if(bn->neg) ret->type = V_ASN1_NEG_ENUMERATED; else ret->type=V_ASN1_ENUMERATED; j=BN_num_bits(bn); len=((j == 0)?0:((j/8)+1)); if (ret->length < len+4) { unsigned char *new_data=OPENSSL_realloc(ret->data, len+4); if (!new_data) { ASN1err(ASN1_F_BN_TO_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE); goto err; } ret->data=new_data; } ret->length=BN_bn2bin(bn,ret->data); return(ret); err: if (ret != ai) M_ASN1_ENUMERATED_free(ret); return(NULL); } BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) { BIGNUM *ret; if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB); else if(ai->type == V_ASN1_NEG_ENUMERATED) ret->neg = 1; return(ret); }
/* cpu_asm.c ===> cpu_asm.S or cpu_asm.s * * This file contains the basic algorithms for all assembly code used * in an specific CPU port of RTEMS. These algorithms must be implemented * in assembly language * * NOTE: This is supposed to be a .S or .s file NOT a C file. * * M32C does not yet have interrupt support. When this functionality * is written, this file should become obsolete. * * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id: cpu_asm.c,v 1.5 2010/03/27 15:01:57 joel Exp $ */ /* * This is supposed to be an assembly file. This means that system.h * and cpu.h should not be included in a "real" cpu_asm file. An * implementation in assembly should include "cpu_asm.h> */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <rtems/system.h> #include <rtems/score/cpu.h> /* void __ISR_Handler() * * This routine provides the RTEMS interrupt management. * * NO_CPU Specific Information: * * XXX document implementation including references if appropriate */ void _ISR_Handler(void) { /* * This discussion ignores a lot of the ugly details in a real * implementation such as saving enough registers/state to be * able to do something real. Keep in mind that the goal is * to invoke a user's ISR handler which is written in C and * uses a certain set of registers. * * Also note that the exact order is to a large extent flexible. * Hardware will dictate a sequence for a certain subset of * _ISR_Handler while requirements for setting */ /* * At entry to "common" _ISR_Handler, the vector number must be * available. On some CPUs the hardware puts either the vector * number or the offset into the vector table for this ISR in a * known place. If the hardware does not give us this information, * then the assembly portion of RTEMS for this port will contain * a set of distinct interrupt entry points which somehow place * the vector number in a known place (which is safe if another * interrupt nests this one) and branches to _ISR_Handler. * * save some or all context on stack * may need to save some special interrupt information for exit * * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE ) * if ( _ISR_Nest_level == 0 ) * switch to software interrupt stack * #endif * * _ISR_Nest_level++; * * _Thread_Dispatch_disable_level++; * * (*_ISR_Vector_table[ vector ])( vector ); * * _Thread_Dispatch_disable_level--; * * --_ISR_Nest_level; * * if ( _ISR_Nest_level ) * goto the label "exit interrupt (simple case)" * * if ( _Thread_Dispatch_disable_level ) * _ISR_Signals_to_thread_executing = FALSE; * goto the label "exit interrupt (simple case)" * * if ( _Context_Switch_necessary || _ISR_Signals_to_thread_executing ) { * _ISR_Signals_to_thread_executing = FALSE; * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch * prepare to get out of interrupt * return from interrupt (maybe to _ISR_Dispatch) * * LABEL "exit interrupt (simple case): * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE ) * if outermost interrupt * restore stack * #endif * prepare to get out of interrupt * return from interrupt */ }
#ifndef SireMove_PROPERTIES_H #define SireMove_PROPERTIES_H void register_SireMove_properties(); #endif
#ifndef __PIKE_RPC_H #define __PIKE_RPC_H #include "../../rpc.h" #include "../../rpc_lookup.h" extern rpc_export_t pike_rpc_methods[]; #endif
/* * Copyright (C) 2009 Juergen Beisert, Pengutronix * * 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 * */ /** * @file * @brief Generic PC support to let barebox acting as a boot loader */ #include <common.h> #include <types.h> #include <driver.h> #include <init.h> #include <asm/syslib.h> #include <ns16550.h> /* * These datas are from the MBR, created by the linker and filled by the * setup tool while installing barebox on the disk drive */ extern uint64_t pers_env_storage; extern uint16_t pers_env_size; extern uint8_t pers_env_drive; /** * Persistent environment "not used" marker. * Note: Must be in accordance to the value the tool "setup_mbr" writes. */ #define PATCH_AREA_PERS_SIZE_UNUSED 0x000 static int devices_init(void) { int rc; /* extended memory only */ add_mem_device("ram0", 0x0, bios_get_memsize() << 10, IORESOURCE_MEM_WRITEABLE); add_generic_device("biosdrive", -1, NULL, 0, 0, IORESOURCE_MEM, NULL); if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) { rc = devfs_add_partition("biosdisk0", pers_env_storage * 512, (unsigned)pers_env_size * 512, DEVFS_PARTITION_FIXED, "env0"); printf("Partition: %d\n", rc); } else printf("No persistent storage defined\n"); return 0; } device_initcall(devices_init); #ifdef CONFIG_DRIVER_SERIAL_NS16550 static struct NS16550_plat serial_plat = { .clock = 1843200, .reg_read = x86_uart_read, .reg_write = x86_uart_write, }; static int pc_console_init(void) { /* Register the serial port */ add_ns16550_device(-1, 0x3f8, 8, 0, &serial_plat); return 0; } console_initcall(pc_console_init); #endif /** @page generic_pc Generic PC based bootloader This platform acts as a generic PC based bootloader. It depends on at least one boot media that is connected locally (no network boot) and can be handled by the regular BIOS (any kind of hard disks for example). The created @a barebox image can be used to boot a standard x86 bzImage Linux kernel. Refer section @ref x86_bootloader_preparations how to do so. How to get the binary image: Using the default configuration: @code make ARCH=x86 generic_defconfig @endcode Build the binary image: @code make ARCH=x86 CROSS_COMPILE=x86compiler @endcode @note replace the 'x86compiler' with your x86 (cross) compiler. */
#ifndef __MACH_OMAP4_DEVICES_H #define __MACH_OMAP4_DEVICES_H #include <driver.h> #include <sizes.h> #include <mach/devices.h> #include <mach/omap4-silicon.h> #include <mach/mcspi.h> #include <mach/omap_hsmmc.h> static inline void omap44xx_add_sram0(void) { return omap_add_sram0(OMAP44XX_SRAM_BASE, 48 * SZ_1K); } static inline struct device_d *omap44xx_add_uart1(void) { return omap_add_uart(0, OMAP44XX_UART1_BASE); } static inline struct device_d *omap44xx_add_uart2(void) { return omap_add_uart(1, OMAP44XX_UART2_BASE); } static inline struct device_d *omap44xx_add_uart3(void) { return omap_add_uart(2, OMAP44XX_UART3_BASE); } static inline struct device_d *omap44xx_add_mmc1(struct omap_hsmmc_platform_data *pdata) { return add_generic_device("omap4-hsmmc", 0, NULL, OMAP44XX_MMC1_BASE, SZ_4K, IORESOURCE_MEM, pdata); } static inline struct device_d *omap44xx_add_mmc2(struct omap_hsmmc_platform_data *pdata) { return add_generic_device("omap4-hsmmc", 1, NULL, OMAP44XX_MMC2_BASE, SZ_4K, IORESOURCE_MEM, pdata); } static inline struct device_d *omap44xx_add_mmc3(struct omap_hsmmc_platform_data *pdata) { return add_generic_device("omap4-hsmmc", 2, NULL, OMAP44XX_MMC3_BASE, SZ_4K, IORESOURCE_MEM, pdata); } static inline struct device_d *omap44xx_add_mmc4(struct omap_hsmmc_platform_data *pdata) { return add_generic_device("omap4-hsmmc", 3, NULL, OMAP44XX_MMC4_BASE, SZ_4K, IORESOURCE_MEM, pdata); } static inline struct device_d *omap44xx_add_mmc5(struct omap_hsmmc_platform_data *pdata) { return add_generic_device("omap4-hsmmc", 4, NULL, OMAP44XX_MMC5_BASE, SZ_4K, IORESOURCE_MEM, pdata); } static inline struct device_d *omap44xx_add_i2c1(void *pdata) { return omap_add_i2c(0, OMAP44XX_I2C1_BASE, pdata); } static inline struct device_d *omap44xx_add_i2c2(void *pdata) { return omap_add_i2c(1, OMAP44XX_I2C2_BASE, pdata); } static inline struct device_d *omap44xx_add_i2c3(void *pdata) { return omap_add_i2c(2, OMAP44XX_I2C3_BASE, pdata); } static inline struct device_d *omap44xx_add_i2c4(void *pdata) { return omap_add_i2c(3, OMAP44XX_I2C4_BASE, pdata); } static inline struct device_d *omap44xx_add_ehci(void *pdata) { return add_usb_ehci_device(DEVICE_ID_DYNAMIC, OMAP44XX_EHCI_BASE, OMAP44XX_EHCI_BASE + 0x10, pdata); } #endif /* __MACH_OMAP4_DEVICES_H */
/* * Copyright (C) 2010 Nokia * Peter De Schrijver <peter.de-schrijver@nokia.com> * * Based on twl4030.c Copyright (C) 2010 Texas Instruments, 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. */ #ifdef CONFIG_TWL4030_POWER #include <linux/i2c/twl.h> #include <plat/cpu.h> /* * Sequence to control the TRITON Power resources, * when the system goes into sleep. * Executed upon P1_P2/P3 transition for sleep. */ static struct twl4030_ins __initdata sleep_on_seq[] = { /* Broadcast message to put res to sleep */ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, 0, RES_STATE_SLEEP), 2}, }; static struct twl4030_script sleep_on_script __initdata = { .script = sleep_on_seq, .size = ARRAY_SIZE(sleep_on_seq), .flags = TWL4030_SLEEP_SCRIPT, }; /* * Sequence to control the TRITON Power resources, * when the system wakeup from sleep. * Executed upon P1_P2 transition for wakeup. */ static struct twl4030_ins wakeup_p12_seq[] __initdata = { /* Broadcast message to put res to active */ {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, 0, RES_STATE_ACTIVE), 2}, }; static struct twl4030_script wakeup_p12_script __initdata = { .script = wakeup_p12_seq, .size = ARRAY_SIZE(wakeup_p12_seq), .flags = TWL4030_WAKEUP12_SCRIPT, }; /* * Sequence to control the TRITON Power resources, * when the system wakeup from sleep. * Executed upon P3 transition for wakeup. */ static struct twl4030_ins wakeup_p3_seq[] __initdata = { /* Broadcast message to put res to active */ {MSG_SINGULAR(DEV_GRP_NULL, RES_CLKEN, RES_STATE_ACTIVE), 0x37}, {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, 0, RES_STATE_ACTIVE), 2}, }; static struct twl4030_script wakeup_p3_script __initdata = { .script = wakeup_p3_seq, .size = ARRAY_SIZE(wakeup_p3_seq), .flags = TWL4030_WAKEUP3_SCRIPT, }; /* * Sequence to reset the TRITON Power resources, * when the system gets warm reset. * Executed upon warm reset signal. */ static struct twl4030_ins wrst_seq[] __initdata = { {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_OFF), 2}, {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 2, RES_STATE_WRST), 1}, {MSG_SINGULAR(DEV_GRP_NULL, RES_VPLL1, RES_STATE_WRST), 2}, {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD2, RES_STATE_WRST), 7}, {MSG_SINGULAR(DEV_GRP_NULL, RES_VDD1, RES_STATE_WRST), 7}, {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, 0, 1, RES_STATE_WRST), 1}, {MSG_SINGULAR(DEV_GRP_NULL, RES_RESET, RES_STATE_ACTIVE), 2}, }; static struct twl4030_script wrst_script __initdata = { .script = wrst_seq, .size = ARRAY_SIZE(wrst_seq), .flags = TWL4030_WRST_SCRIPT, }; /* TRITON script for sleep, wakeup & warm_reset */ static struct twl4030_script *twl4030_scripts[] __initdata = { &sleep_on_script, &wakeup_p12_script, &wakeup_p3_script, &wrst_script, }; static struct twl4030_power_data twl4030_nokia_script __initdata = { .scripts = twl4030_scripts, .num = ARRAY_SIZE(twl4030_scripts), }; static struct twl4030_resconfig twl4030_rconfig[] = { { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = 4, .type2 = 0, .remap_sleep = 0, }, { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = 3, .type2 = 0, .remap_sleep = 0, }, { .resource = RES_VPLL1, .devgroup = DEV_GRP_P1, .type = 3, .type2 = 0, .remap_sleep = 0, }, { .resource = RES_VPLL2, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VAUX1, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VAUX2, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VAUX3, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VAUX4, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VMMC1, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VMMC2, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VDAC, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VUSB_1V5, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VUSB_1V8, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VUSB_3V1, .devgroup = TWL4030_RESCONFIG_UNDEF, .type = 0, .type2 = 0, .remap_sleep = 0x09, }, { .resource = RES_VINTANA1, .devgroup = DEV_GRP_P1 | DEV_GRP_P2, .type = 1, .type2 = 2, .remap_sleep = 0x08, }, { .resource = RES_VINTANA2, .devgroup = DEV_GRP_P1 | DEV_GRP_P2, .type = 0, .type2 = 2, .remap_sleep = 0x08, }, { .resource = RES_VINTDIG, .devgroup = DEV_GRP_P1 | DEV_GRP_P2, .type = 1, .type2 = 2, .remap_sleep = 0x08, }, { .resource = RES_VIO, .devgroup = DEV_GRP_P1 | DEV_GRP_P2, .type = 2, .type2 = 2, .remap_sleep = 0x08, }, { .resource = RES_CLKEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P3, .type = 3, .type2 = 2, .remap_sleep = 0x8, }, { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = 0, .type2 = 1, .remap_sleep = 0x8, }, { .resource = RES_NRES_PWRON, .devgroup = DEV_GRP_P1 | DEV_GRP_P3, .type = 0, .type2 = 1, .remap_sleep = 8 }, { .resource = RES_REGEN, .devgroup = DEV_GRP_P1 | DEV_GRP_P2 | DEV_GRP_P3, .type = 2, .type2 = 0, .remap_sleep = 9 }, { .resource = 0, .devgroup = 0, .type = 0, .type2 = 0, .remap_sleep = 0 } }; void __init twl4030_get_nokia_powerdata(struct twl4030_power_data *power_data) { /* Work around OMAP 3630 erratum #1.75 by keeping VDD2 on */ if (omap_rev() == OMAP3630_REV_ES1_0) twl4030_rconfig[1].remap_sleep = 0x9; power_data->scripts = twl4030_nokia_script.scripts; power_data->num = twl4030_nokia_script.num; power_data->resource_config = twl4030_rconfig; } #endif
/****************************************************************************** Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : drv_win_buffer.h Version : Initial Draft Author : Hisilicon multimedia software group Created : 2012/12/30 Last Modified : Description : Function List : History : ******************************************************************************/ #ifndef __DRV_wIN_BUFFER_H__ #define __DRV_wIN_BUFFER_H__ #include "drv_disp_com.h" #include "hi_drv_win.h" #include "drv_disp_bufcore.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* __cplusplus */ #define WIN_BUF_MEM_SRC_SUPPLY 0 #define WIN_BUF_MEM_FB_SUPPLY 1 #define WIN_BUF_MEM_USER_SUPPLY 2 #define WIN_CHECK_NULL_RETURN(p) \ do{ if (!p) \ {WIN_FATAL("FUNC %s input NULL Pointer!\n", __FUNCTION__); return HI_FAILURE;} \ }while(0) #define WIN_CHECK_NULL_RETURN_NULL(p) \ do{ if (!p) \ {WIN_FATAL("FUNC %s input NULL Pointer!\n", __FUNCTION__); return HI_NULL;} \ }while(0) typedef struct tagWIN_BUF_ALLOC_PARA_S { HI_BOOL bFbAllocMem; HI_U32 u32BufWidth; HI_U32 u32BufHeight; HI_U32 u32BufStride; HI_DRV_PIX_FORMAT_E eDataFormat; // user supply mem }WIN_BUF_ALLOC_PARA_S; typedef struct tagWB_SOURCE_INFO_S { HI_HANDLE hSrc; PFN_GET_FRAME_CALLBACK pfAcqFrame; PFN_PUT_FRAME_CALLBACK pfRlsFrame; }WB_SOURCE_INFO_S; #define WB_BUFFER_DEBUG_FRAME_RECORD_NUMBER 32 typedef struct tagWB_DEBUG_INFO_S { HI_U32 u32RecordNumber; HI_U32 u32InputFrameID[WB_BUFFER_DEBUG_FRAME_RECORD_NUMBER]; HI_U32 u32InputPos; HI_U32 u32Input; HI_U32 u32CfgFrameID[WB_BUFFER_DEBUG_FRAME_RECORD_NUMBER]; HI_U32 u32CfgPos; HI_U32 u32Config; HI_U32 u32RlsFrameID[WB_BUFFER_DEBUG_FRAME_RECORD_NUMBER]; HI_U32 u32RlsPos; HI_U32 u32Release; HI_U32 u32TryQueueFrame; HI_U32 u32QueueFrame; HI_U32 u32Underload; HI_U32 u32Disacard; }WB_DEBUG_INFO_S; typedef struct tagWB_POOL_S { HI_U32 u32BufNumber; HI_U32 u32MemType; WIN_BUF_ALLOC_PARA_S stAlloc; DISP_BUF_S stBuffer; // source info WB_SOURCE_INFO_S stSrcInfo; /*lastest display and config.*/ DISP_BUF_NODE_S *pstDisplay; DISP_BUF_NODE_S *pstConfig; DISP_BUF_NODE_S *pstCapture; WB_DEBUG_INFO_S *pstDebugInfo; }WB_POOL_S; HI_S32 WinBuf_Create(HI_U32 u32BufNum, HI_U32 u32MemType, WIN_BUF_ALLOC_PARA_S *pstAlloc, WB_POOL_S *pstWinBP); HI_S32 WinBuf_Destroy(WB_POOL_S *pstWinBP); HI_S32 WinBuf_Reset(WB_POOL_S *pstWinBP); HI_S32 WinBuf_SetSource(WB_POOL_S *pstWinBP, WB_SOURCE_INFO_S *pstSrc); // put a new frame into buffer HI_S32 WinBuf_PutNewFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstFrame); // release frame that has been displayed and set configed frame as displayed frame. HI_S32 WinBuf_RlsAndUpdateUsingFrame(WB_POOL_S *pstWinBP); HI_S32 WinBuf_RepeatDisplayedFrame(WB_POOL_S *pstWinBP); HI_DRV_VIDEO_FRAME_S *WinBuf_GetDisplayedFrame(WB_POOL_S *pstWinBP); HI_DRV_VIDEO_FRAME_S *WinBuf_GetConfigedFrame(WB_POOL_S *pstWinBP); HI_DRV_VIDEO_FRAME_S *WinBuf_GetConfigFrame(WB_POOL_S *pstWinBP); HI_S32 WinBuf_SetCaptureFrame(WB_POOL_S *pstWinBP, HI_U32 u32InvalidFlag); HI_S32 WinBuf_ReleaseCaptureFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstFrame, HI_BOOL bForceFlag); HI_DRV_VIDEO_FRAME_S *WinBuf_GetCapturedFrame(WB_POOL_S *pstWinBP); HI_S32 WinBuf_ForceReleaseFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstFrame); HI_S32 WinBuf_ReleaseOneFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstPreFrame); HI_S32 WinBuf_FlushWaitingFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstPreFrame); HI_DRV_VIDEO_FRAME_S *WinBuf_GetFrameByMaxID(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstRefFrame,HI_U32 u32RefID, HI_DRV_FIELD_MODE_E enDstField); HI_DRV_VIDEO_FRAME_S * WinBuf_GetFrameByDstFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstDstFrame, HI_DRV_VIDEO_FRAME_S *pstRefFrame); HI_DRV_VIDEO_FRAME_S *WinBuf_GetFrameByDisplayInfo(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstRefFrame, HI_U32 u32RefRate, HI_DRV_FIELD_MODE_E enDstField); HI_DRV_VIDEO_FRAME_S * WinBuf_GetNewestFrame(WB_POOL_S *pstWinBP, HI_DRV_VIDEO_FRAME_S *pstRefFrame); HI_S32 WinBuf_GetFullBufNum(WB_POOL_S *pstBP, HI_U32 *pu32BufNum); // todo typedef struct tagWB_STATE_S { HI_U32 u32Number; HI_U32 u32EmptyRPtr; HI_U32 u32EmptyWPtr; HI_U32 u32FullRPtr; HI_U32 u32FullWPtr; struct { HI_U32 u32State; HI_U32 u32Empty; HI_U32 u32Full; HI_U32 u32FrameIndex; }stNode[DISP_BUF_NODE_MAX_NUMBER]; WB_DEBUG_INFO_S stRecord; HI_U32 u32EmptyArray[DISP_BUF_NODE_MAX_NUMBER]; HI_U32 u32FullArray[DISP_BUF_NODE_MAX_NUMBER]; HI_DRV_VIDEO_FRAME_S stCurrentFrame; }WB_STATE_S; HI_S32 WinBuf_GetStateInfo(WB_POOL_S *pstWinBP, WB_STATE_S *pstWinBufState); #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ #endif /* __DRV_wIN_BUFFER_H__ */
#ifndef IMAGEUTIL_H #define IMAGEUTIL_H #include <QTextCursor> #include <QWidget> #include <qiterator.h> class ImageUtil { public: ImageUtil(); static void extractImage(QWidget *window, QTextCursor cursor); static bool optimizeSize(QString &html, const QImage& original, QImage &optimized, int maxPixels = -1, int maxBytes = -1); private: static int checkSize(QString& embeddedImage, const QImage& img, int maxBytes = -1); static void quantization(const QImage& img, QVector<QRgb>& palette); static void quantization(QList<QRgb>::iterator begin, QList<QRgb>::iterator end, int depth, QVector<QRgb>& palette); static void avgbucket(QList<QRgb>::iterator begin, QList<QRgb>::iterator end, QVector<QRgb>& palette); }; #endif // IMAGEUTIL_H
/* * Copyright (C) 2009 Google Inc. All rights reserved. * Copyright (C) 2014 University of Washington. * * 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 TimelineRecordFactory_h #define TimelineRecordFactory_h #include <inspector/InspectorValues.h> #include <wtf/Forward.h> #include <wtf/text/WTFString.h> namespace JSC { class Profile; } namespace Inspector { struct ScriptBreakpointAction; } namespace WebCore { class Event; class FloatQuad; class TimelineRecordFactory { public: static Ref<Inspector::InspectorObject> createGenericRecord(double startTime, int maxCallStackDepth); static Ref<Inspector::InspectorObject> createFunctionCallData(const String& scriptName, int scriptLine); static Ref<Inspector::InspectorObject> createConsoleProfileData(const String& title); static Ref<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId); static Ref<Inspector::InspectorObject> createEventDispatchData(const Event&); static Ref<Inspector::InspectorObject> createGenericTimerData(int timerId); static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, int timeout, bool singleShot); static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber); static Ref<Inspector::InspectorObject> createTimeStampData(const String&); static Ref<Inspector::InspectorObject> createAnimationFrameData(int callbackId); static Ref<Inspector::InspectorObject> createPaintData(const FloatQuad&); static void appendLayoutRoot(Inspector::InspectorObject* data, const FloatQuad&); static void appendProfile(Inspector::InspectorObject*, RefPtr<JSC::Profile>&&); private: TimelineRecordFactory() { } }; } // namespace WebCore #endif // !defined(TimelineRecordFactory_h)
// license:BSD-3-Clause // copyright-holders:Aaron Giles /************************************************************************* Driver for Midway Zeus games **************************************************************************/ #define MIDZEUS_VIDEO_CLOCK XTAL_66_6667MHz #include "machine/timekpr.h" class midzeus_state : public driver_device { public: midzeus_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_nvram(*this, "nvram"), m_ram_base(*this, "ram_base"), m_linkram(*this, "linkram"), m_tms32031_control(*this, "tms32031_ctl"), m_zeusbase(*this, "zeusbase") , m_m48t35(*this, "m48t35"), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_palette(*this, "palette") { } required_shared_ptr<UINT32> m_nvram; required_shared_ptr<UINT32> m_ram_base; optional_shared_ptr<UINT32> m_linkram; required_shared_ptr<UINT32> m_tms32031_control; optional_shared_ptr<UINT32> m_zeusbase; optional_device<timekeeper_device> m_m48t35; required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; optional_device<palette_device> m_palette; DECLARE_WRITE32_MEMBER(cmos_w); DECLARE_READ32_MEMBER(cmos_r); DECLARE_WRITE32_MEMBER(cmos_protect_w); DECLARE_READ32_MEMBER(zpram_r); DECLARE_WRITE32_MEMBER(zpram_w); DECLARE_READ32_MEMBER(bitlatches_r); DECLARE_WRITE32_MEMBER(bitlatches_w); DECLARE_READ32_MEMBER(crusnexo_leds_r); DECLARE_WRITE32_MEMBER(crusnexo_leds_w); DECLARE_READ32_MEMBER(linkram_r); DECLARE_WRITE32_MEMBER(linkram_w); DECLARE_READ32_MEMBER(tms32031_control_r); DECLARE_WRITE32_MEMBER(tms32031_control_w); DECLARE_WRITE32_MEMBER(keypad_select_w); DECLARE_READ32_MEMBER(analog_r); DECLARE_WRITE32_MEMBER(analog_w); DECLARE_WRITE32_MEMBER(invasn_gun_w); DECLARE_READ32_MEMBER(invasn_gun_r); DECLARE_READ_LINE_MEMBER(PIC16C5X_T0_clk_r); DECLARE_READ32_MEMBER(zeus_r); DECLARE_WRITE32_MEMBER(zeus_w); DECLARE_CUSTOM_INPUT_MEMBER(custom_49way_r); DECLARE_CUSTOM_INPUT_MEMBER(keypad_r); DECLARE_READ32_MEMBER(zeus2_timekeeper_r); DECLARE_WRITE32_MEMBER(zeus2_timekeeper_w); DECLARE_DRIVER_INIT(invasn); DECLARE_DRIVER_INIT(mk4); DECLARE_DRIVER_INIT(thegrid); DECLARE_DRIVER_INIT(crusnexo); DECLARE_MACHINE_START(midzeus); DECLARE_MACHINE_RESET(midzeus); DECLARE_VIDEO_START(midzeus); UINT32 screen_update_midzeus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(display_irq); TIMER_CALLBACK_MEMBER(display_irq_off); TIMER_CALLBACK_MEMBER(invasn_gun_callback); private: void exit_handler(); void zeus_pointer_w(UINT32 which, UINT32 data, int logit); void zeus_register16_w(offs_t offset, UINT16 data, int logit); void zeus_register32_w(offs_t offset, UINT32 data, int logit); void zeus_register_update(offs_t offset); int zeus_fifo_process(const UINT32 *data, int numwords); void zeus_draw_model(UINT32 texdata, int logit); void log_fifo_command(const UINT32 *data, int numwords, const char *suffix); void log_waveram(UINT32 length_and_base); void update_gun_irq(); };
/* Annotation routines for GDB. Copyright (C) 1986, 1989, 1990, 1991, 1992, 1994, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "symtab.h" #include "gdbtypes.h" extern void breakpoints_changed (void); extern void annotate_ignore_count_change (void); extern void annotate_breakpoint (int); extern void annotate_catchpoint (int); extern void annotate_watchpoint (int); extern void annotate_starting (void); extern void annotate_stopped (void); extern void annotate_exited (int); extern void annotate_signalled (void); extern void annotate_signal_name (void); extern void annotate_signal_name_end (void); extern void annotate_signal_string (void); extern void annotate_signal_string_end (void); extern void annotate_signal (void); extern void annotate_breakpoints_headers (void); extern void annotate_field (int); extern void annotate_breakpoints_table (void); extern void annotate_record (void); extern void annotate_breakpoints_table_end (void); extern void annotate_frames_invalid (void); struct type; extern void annotate_field_begin (struct type *); extern void annotate_field_name_end (void); extern void annotate_field_value (void); extern void annotate_field_end (void); extern void annotate_quit (void); extern void annotate_error (void); extern void annotate_error_begin (void); extern void annotate_value_history_begin (int, struct type *); extern void annotate_value_begin (struct type *); extern void annotate_value_history_value (void); extern void annotate_value_history_end (void); extern void annotate_value_end (void); extern void annotate_display_begin (void); extern void annotate_display_number_end (void); extern void annotate_display_format (void); extern void annotate_display_expression (void); extern void annotate_display_expression_end (void); extern void annotate_display_value (void); extern void annotate_display_end (void); extern void annotate_arg_begin (void); extern void annotate_arg_name_end (void); extern void annotate_arg_value (struct type *); extern void annotate_arg_end (void); extern void annotate_source (char *, int, int, int, CORE_ADDR); extern void annotate_frame_begin (int, CORE_ADDR); extern void annotate_function_call (void); extern void annotate_signal_handler_caller (void); extern void annotate_frame_address (void); extern void annotate_frame_address_end (void); extern void annotate_frame_function_name (void); extern void annotate_frame_args (void); extern void annotate_frame_source_begin (void); extern void annotate_frame_source_file (void); extern void annotate_frame_source_file_end (void); extern void annotate_frame_source_line (void); extern void annotate_frame_source_end (void); extern void annotate_frame_where (void); extern void annotate_frame_end (void); extern void annotate_array_section_begin (int, struct type *); extern void annotate_elt_rep (unsigned int); extern void annotate_elt_rep_end (void); extern void annotate_elt (void); extern void annotate_array_section_end (void); extern void (*deprecated_annotate_starting_hook) (void); extern void (*deprecated_annotate_stopped_hook) (void); extern void (*deprecated_annotate_signalled_hook) (void); extern void (*deprecated_annotate_signal_hook) (void); extern void (*deprecated_annotate_exited_hook) (void);
/** * Copyright (C) 2012, 2014 Universidad Simón Bolívar * * @brief Common ancestors * Copying: GNU GENERAL PUBLIC LICENSE Version 2 * @author Guillermo Palma <gpalma@ldc.usb.ve> */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <assert.h> #include <limits.h> #include "dlist.h" #include "types.h" #include "util.h" #include "memory.h" #include "graph.h" #include "CA.h" VEC(long) *get_ancestors(const struct graph *gi, long node) { long i, n; VEC(long) *ancs; long *pred; long *discovered; long *finished; ancs = (VEC(long) *)xmalloc(sizeof(VEC(long))); n = gi->n_nodes; pred = (long *)xcalloc(n, sizeof(long)); discovered = (long *)xcalloc(n, sizeof(long)); finished = (long *)xcalloc(n, sizeof(long)); VEC_INIT(long, *ancs); VEC_PUSH(long, *ancs, node); dfs_search(gi, node, discovered, finished, pred); for (i = 0; i < n; i++) { if (pred[i] != -1) { VEC_PUSH(long, *ancs, i); } } free(pred); free(discovered); free(finished); return ancs; } VEC(long) **get_all_ancestors(const struct graph *g) { long i, j, n; VEC(long) **all_a; long *pred; long *discovered; long *finished; n = g->n_nodes; all_a = xmalloc(n*sizeof(VEC(long))); pred = (long *)xcalloc(n, sizeof(long)); discovered = (long *)xcalloc(n, sizeof(long)); finished = (long *)xcalloc(n, sizeof(long)); for (i = 0; i < n; i++) { all_a[i] = (VEC(long) *)xmalloc(sizeof(VEC(long))); VEC_INIT(long, *all_a[i]); VEC_PUSH(long, *all_a[i], i); } /* printf("** Start Search Ancestors ** \n\n");*/ for (i = 0; i < n; i++) { fprintf(stderr, "** Search in %ld ** \n", i); dfs_search(g, i, discovered, finished, pred); for (j = 0; j < n; j++) { if (pred[j] != -1) { VEC_PUSH(long, *all_a[j], i); } } } free(pred); free(discovered); free(finished); return all_a; } long LCA_CA(VEC(long) *lx, VEC(long) *ly, long *depth) { long i, j, nlx, nly, vx; long max, lca; max = -1; lca = -1; nlx = VEC_SIZE(*lx); nly = VEC_SIZE(*ly); for (i = 0; i < nlx; i++) { vx = VEC_GET(*lx, i); for (j = 0; j < nly; j++) { if ((vx == VEC_GET(*ly, j)) && (depth[vx] > max)) { max = depth[vx]; lca = vx; } } } if (lca == -1) fatal("Error with the lowest common ancestor"); return lca; } VEC(long) *LCA_CA_SET(VEC(long) *lx, VEC(long) *ly, long *depth) { long i, j, nlx, nly, vx, max, lcam; VEC(long) *lca; lca = (VEC(long) *)xmalloc(sizeof(VEC(long))); VEC_INIT(long, *lca); max = -1; lcam = -1; nlx = VEC_SIZE(*lx); nly = VEC_SIZE(*ly); for (i = 0; i < nlx; i++) { vx = VEC_GET(*lx, i); for (j = 0; j < nly; j++) { if ((vx == VEC_GET(*ly, j)) && (depth[vx] > max)) { max = depth[vx]; lcam = vx; } } } if (lcam == -1) fatal("Error with the lowest common ancestor"); for (i = 0; i < nlx; i++) { vx = VEC_GET(*lx, i); for (j = 0; j < nly; j++) { if ((vx == VEC_GET(*ly, j)) && (depth[vx] == max)) { VEC_PUSH(long, *lca, vx); } } } return lca; }
/* * Copyright (C) 2008 Michael Niedermayer * * This file is part of Libav. * * Libav 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. * * Libav 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 Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "parser.h" static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) { if(avctx->codec_id == CODEC_ID_THEORA) s->pict_type= (buf[0]&0x40) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; else s->pict_type= (buf[0]&0x80) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; *poutbuf = buf; *poutbuf_size = buf_size; return buf_size; } AVCodecParser ff_vp3_parser = { { CODEC_ID_THEORA, CODEC_ID_VP3, CODEC_ID_VP6, CODEC_ID_VP6F, CODEC_ID_VP6A }, 0, NULL, parse, };
/* Copyright 2013 David Axmark Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * \file TraceScope.h * \brief Defines a class for tracing and timing blocks. * \author Lars Ake Vinberg */ #ifndef TRACESCOPE_H_ #define TRACESCOPE_H_ // // Set to true to enable tracing // #define ENABLETRACESCOPE #include "conprint.h" #include "DebugPrintf.h" namespace MAP { /** * @brief Utility class for timing and marking the start and end of a block. * * Prints a debug trace on creation, and one on destruction. * Usage: * * ... * { * TraceScope scope( "MyFunc" ); * ... * } * ... * * Output: * * +++ MyFunc * --- 45 MyFunc */ class TraceScope { public: TraceScope( const char* s ) { m_s = s; DebugPrintf( "+++ %s\n", s ); m_startTime = maGetMilliSecondCount( ); } virtual ~TraceScope( ) { int time = maGetMilliSecondCount( ) - m_startTime; DebugPrintf( "--- %d %s\n", time, m_s ); } private: const char* m_s; int m_startTime; }; #ifdef ENABLETRACESCOPE #define trace( ) TraceScope tr = TraceScope( __FUNCTION__ ) #define traceline( ) DebugPrintf( "Line %d\n", __LINE__ ) #else #define trace( ) {} #define traceline( ) { } #endif } #endif // TRACESCOPE_H_
/* ============================================================ * * This file is a part of kipi-plugins project * http://www.digikam.org * * Date : 2011-05-23 * Description : a plugin to create panorama by fusion of several images. * Acknowledge : based on the expoblending plugin * * Copyright (C) 2011-2012 by Benjamin Girault <benjamin dot girault at gmail dot com> * Copyright (C) 2009-2011 by Gilles Caulier <caulier dot gilles at gmail dot com> * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef ACTIONS_H #define ACTIONS_H // Qt includes #include <QString> #include <QImage> #include <QMetaType> #include <QMap> // KDE includes #include <kurl.h> // LibKDcraw includes #include <libkdcraw/kdcraw.h> namespace KIPIPanoramaPlugin { enum Action { NONE = 0, PREPROCESS_INPUT, CREATEPTO, CPFIND, CPCLEAN, OPTIMIZE, AUTOCROP, CREATEPREVIEWPTO, CREATEMK, CREATEMKPREVIEW, CREATEFINALPTO, NONAFILE, NONAFILEPREVIEW, STITCH, STITCHPREVIEW, COPY }; typedef enum { JPEG, TIFF, HDR } PanoramaFileType; struct ItemPreprocessedUrls { ItemPreprocessedUrls() {} ItemPreprocessedUrls(const KUrl& preprocessed, const KUrl& preview) : preprocessedUrl(preprocessed), previewUrl(preview) {} virtual ~ItemPreprocessedUrls() {} KUrl preprocessedUrl; // Can be an original file or a converted version, depending on the original file type KUrl previewUrl; // The JPEG preview version, accordingly of preprocessedUrl constent. }; typedef QMap<KUrl, ItemPreprocessedUrls> ItemUrlsMap; // Map between original Url and processed temp Urls. // ---------------------------------------------------------------------------------------------------------- struct ActionData { ActionData() : starting(false), success(false), id(0), action(NONE) {} bool starting; bool success; QString message; // Usually, an error message int id; Action action; }; } // namespace KIPIExpoBlendingPlugin Q_DECLARE_METATYPE(KIPIPanoramaPlugin::ActionData) Q_DECLARE_METATYPE(KIPIPanoramaPlugin::ItemPreprocessedUrls) #endif /* ACTIONS_H */
/* Copyright 2006-2013 The QElectroTech Team This file is part of QElectroTech. QElectroTech 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. QElectroTech 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 QElectroTech. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CONDUCTOR_PROPERTIES_WIDGET_H #define CONDUCTOR_PROPERTIES_WIDGET_H #include "conductorproperties.h" #include "qtextorientationspinboxwidget.h" #include <QWidget> /** This widget enables users to change the properties of a particular conductor; these properties include singleline symbols, style, color, and conductor type but exclude the path it draws. */ class ConductorPropertiesWidget : public QWidget { Q_OBJECT // constructors, destructor public: ConductorPropertiesWidget(QWidget * = 0); ConductorPropertiesWidget(const ConductorProperties &, QWidget * = 0); virtual ~ConductorPropertiesWidget(); private: ConductorPropertiesWidget(const ConductorPropertiesWidget &); // methods public: void setConductorProperties(const ConductorProperties &); ConductorProperties conductorProperties() const; bool isReadOnly() const; void setReadOnly(bool); private: void setConductorType(ConductorProperties::ConductorType); void setColorButton(const QColor &); QColor colorButton() const; public slots: void updatePreview(); void updateConfig(); void updateDisplay(); void chooseColor(); protected: void focusInEvent(QFocusEvent *); // private attributes private: QButtonGroup *radio_buttons; QRadioButton *simple; QRadioButton *multiline; QLineEdit *text_field; QTextOrientationSpinBoxWidget *verti_select; QTextOrientationSpinBoxWidget *horiz_select; QRadioButton *singleline; QCheckBox *phase_checkbox; QSlider *phase_slider; QSpinBox *phase_spinbox; QCheckBox *ground_checkbox; QCheckBox *neutral_checkbox; QLabel *preview; QPushButton *color_button; QComboBox *line_style; QCheckBox *merge_checkbox; ConductorProperties properties_; // private methods void buildInterface(); void buildConnections(); void destroyConnections(); }; #endif
#include <stdio.h> #include "c99ppe.h" int _DEFUN (puts, (s), char _CONST * s) { /* The return value gets written over s */ send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_PUTS, &s); return (int)s; }
/* * Helpers for loads and stores * * Copyright (c) 2007 Jocelyn Mayer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "cpu.h" #include "helper.h" /* Softmmu support */ #ifndef CONFIG_USER_ONLY uint64_t helper_ldl_phys(uint64_t p) { return (int32_t)ldl_phys(p); } uint64_t helper_ldq_phys(uint64_t p) { return ldq_phys(p); } uint64_t helper_ldl_l_phys(CPUAlphaState *env, uint64_t p) { env->lock_addr = p; return env->lock_value = (int32_t)ldl_phys(p); } uint64_t helper_ldq_l_phys(CPUAlphaState *env, uint64_t p) { env->lock_addr = p; return env->lock_value = ldq_phys(p); } void helper_stl_phys(uint64_t p, uint64_t v) { stl_phys(p, v); } void helper_stq_phys(uint64_t p, uint64_t v) { stq_phys(p, v); } uint64_t helper_stl_c_phys(CPUAlphaState *env, uint64_t p, uint64_t v) { uint64_t ret = 0; if (p == env->lock_addr) { int32_t old = ldl_phys(p); if (old == (int32_t)env->lock_value) { stl_phys(p, v); ret = 1; } } env->lock_addr = -1; return ret; } uint64_t helper_stq_c_phys(CPUAlphaState *env, uint64_t p, uint64_t v) { uint64_t ret = 0; if (p == env->lock_addr) { uint64_t old = ldq_phys(p); if (old == env->lock_value) { stq_phys(p, v); ret = 1; } } env->lock_addr = -1; return ret; } static void do_unaligned_access(CPUAlphaState *env, target_ulong addr, int is_write, int is_user, uintptr_t retaddr) { uint64_t pc; uint32_t insn; if (retaddr) { cpu_restore_state(env, retaddr); } pc = env->pc; insn = cpu_ldl_code(env, pc); env->trap_arg0 = addr; env->trap_arg1 = insn >> 26; /* opcode */ env->trap_arg2 = (insn >> 21) & 31; /* dest regno */ env->exception_index = EXCP_UNALIGN; env->error_code = 0; cpu_loop_exit(env); } void cpu_unassigned_access(CPUAlphaState *env, hwaddr addr, int is_write, int is_exec, int unused, int size) { env->trap_arg0 = addr; env->trap_arg1 = is_write; dynamic_excp(env, 0, EXCP_MCHK, 0); } #include "softmmu_exec.h" #define MMUSUFFIX _mmu #define ALIGNED_ONLY #define SHIFT 0 #include "softmmu_template.h" #define SHIFT 1 #include "softmmu_template.h" #define SHIFT 2 #include "softmmu_template.h" #define SHIFT 3 #include "softmmu_template.h" /* try to fill the TLB and return an exception if error. If retaddr is NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ void tlb_fill(CPUAlphaState *env, target_ulong addr, int is_write, int mmu_idx, uintptr_t retaddr) { int ret; ret = cpu_alpha_handle_mmu_fault(env, addr, is_write, mmu_idx); if (unlikely(ret != 0)) { if (retaddr) { cpu_restore_state(env, retaddr); } /* Exception index and error code are already set */ cpu_loop_exit(env); } } #endif /* CONFIG_USER_ONLY */
/* * $Id$ * * * timer frequency and ticks conversions * * Copyright (C) 2005 iptelorg GmbH * * This file is part of SIP-router, a free SIP server. * * SIP-router 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 * * SIP-router 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 */ /* History: * -------- * 2005-07-27 complete re-design/re-implemnetation (andrei) * 2007-07-02 added ticks comparison macros (andrei) */ /** * @file * @brief SIP-router core :: timer frequency and ticks conversions * @ingroup core * Module: @ref core */ #ifndef _timer_ticks_h #define _timer_ticks_h /** @brief how many ticks per second (must >1 and < 100 (on linux x86)) * recomended values >=8, <=32 (a 2^k value is better/faster)*/ #define TIMER_TICKS_HZ 16U /** @brief how many ticks per m milliseconds? (rounded up) */ #define MS_TO_TICKS(m) (((m)*TIMER_TICKS_HZ+999U)/1000U) /** @brief how many ticks per s seconds? */ #define S_TO_TICKS(s) ((s)*TIMER_TICKS_HZ) /** @brief how many s pe per t ticks, integer value */ #define TICKS_TO_S(t) ((t)/TIMER_TICKS_HZ) /** @brief how many ms per t ticks, integer value */ #define TICKS_TO_MS(t) (((t)*1000U)/TIMER_TICKS_HZ) /** @brief ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */ #define TICKS_CMP_OP(t1, t2, OP) \ (((s_ticks_t)((ticks_t)(t1)-(ticks_t)(t2))) OP (s_ticks_t)0) /** @brief t1 < t2 */ #define TICKS_LT(t1, t2) TICKS_CMP_OP(t1, t2, <) /** @brief t1 <= t2 */ #define TICKS_LE(t1, t2) TICKS_CMP_OP(t1, t2, <=) /** @brief t1 > t2 */ #define TICKS_GT(t1, t2) TICKS_CMP_OP(t1, t2, >) /** @brief t1 >= t2 */ #define TICKS_GE(t1, t2) TICKS_CMP_OP(t1, t2, >=) typedef unsigned int ticks_t;/* type used to keep the ticks (must be 32 bits)*/ typedef signed int s_ticks_t; /* signed ticks type */ #endif
// _________ __ __ // / _____// |_____________ _/ |______ ____ __ __ ______ // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ | // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > // \/ \/ \//_____/ \/ // ______________________ ______________________ // T H E W A R B E G I N S // Stratagus - A free fantasy real time strategy game engine // /**@name editor.h - The editor file. */ // // (c) Copyright 2002-2006 by Lutz Sammer // // 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; only version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. // #ifndef __EDITOR_H__ #define __EDITOR_H__ //@{ #include <vector> #include <string> #include "icons.h" #ifndef __VEC2I_H__ #include "vec2i.h" #endif /*---------------------------------------------------------------------------- -- Declarations ----------------------------------------------------------------------------*/ class CUnitType; enum EditorRunningType { EditorNotRunning = 0, /// Not Running EditorStarted = 1, /// Editor Enabled at all EditorCommandLine = 2, /// Called from Command Line EditorEditing = 4 /// Editor is fully running }; enum EditorStateType { EditorSelecting, /// Select EditorEditTile, /// Edit tiles EditorEditUnit, /// Edit units EditorSetStartLocation /// Set the start location }; class CEditor { public: CEditor(); ~CEditor() {} void Init(); /// Make random map void CreateRandomMap() const; std::vector<std::string> UnitTypes; /// Sorted editor unit-type table. std::vector<const CUnitType *> ShownUnitTypes; /// Shown editor unit-type table. std::vector<unsigned int> ShownTileTypes; /// Shown editor tile-type table. bool TerrainEditable; /// Is the terrain editable ? IconConfig Select; /// Editor's select icon. IconConfig Units; /// Editor's units icon. std::string StartUnitName; /// name of the Unit used to display the start location. const CUnitType *StartUnit; /// Unit used to display the start location. int UnitIndex; /// Unit icon draw index. int CursorUnitIndex; /// Unit icon under cursor. int SelectedUnitIndex; /// Unit type to draw. int TileIndex; /// tile icon draw index. int CursorTileIndex; /// tile icon under cursor. int SelectedTileIndex; /// tile type to draw. int CursorPlayer; /// Player under the cursor. int SelectedPlayer; /// Player selected for draw. bool MapLoaded; /// Map loaded in editor bool WriteCompressedMaps; /// Use compression when saving EditorRunningType Running; /// Editor is running EditorStateType State; /// Current editor state int PopUpX; int PopUpY; }; /*---------------------------------------------------------------------------- -- Variables ----------------------------------------------------------------------------*/ extern CEditor Editor; extern char TileToolRandom; /*---------------------------------------------------------------------------- -- Functions ----------------------------------------------------------------------------*/ /// Start the editor extern void StartEditor(const char *filename); /// Editor main event loop extern void EditorMainLoop(); /// Update editor display extern void EditorUpdateDisplay(); /// Save a map from editor extern int EditorSaveMap(const std::string &file); /// Register ccl features extern void EditorCclRegister(); /// Update surroundings for tile changes extern void EditorTileChanged(const Vec2i &pos); extern void EditorChangeTile(const Vec2i &pos, int tileIndex, int d); //@} #endif // !__EDITOR_H__
/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ #define _POSIX_SOURCE #define _RESEARCH_SOURCE #include <error.h> #include <stdio.h> #include <libv.h> char *_progname; void _perror(char *s) { fprintf(stderr, "%s: ", _progname); perror(s); }
/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __UPDATEDATA_H #define __UPDATEDATA_H #include "Define.h" #include "ByteBuffer.h" #include "ObjectGuid.h" #include <set> class WorldPacket; enum OBJECT_UPDATE_TYPE { UPDATETYPE_VALUES = 0, UPDATETYPE_CREATE_OBJECT = 1, UPDATETYPE_CREATE_OBJECT2 = 2, UPDATETYPE_OUT_OF_RANGE_OBJECTS = 3, }; class UpdateData { public: UpdateData(uint32 map); UpdateData(UpdateData&& right) : m_map(right.m_map), m_blockCount(right.m_blockCount), m_outOfRangeGUIDs(std::move(right.m_outOfRangeGUIDs)), m_data(std::move(right.m_data)) { } void AddDestroyObject(ObjectGuid guid); void AddOutOfRangeGUID(GuidSet& guids); void AddOutOfRangeGUID(ObjectGuid guid); void AddUpdateBlock(ByteBuffer const& block); bool BuildPacket(WorldPacket* packet); bool HasData() const { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty() || !m_destroyGUIDs.empty(); } void Clear(); GuidSet const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; } protected: uint32 m_map; uint32 m_blockCount; GuidSet m_destroyGUIDs; GuidSet m_outOfRangeGUIDs; ByteBuffer m_data; UpdateData(UpdateData const& right) = delete; UpdateData& operator=(UpdateData const& right) = delete; }; #endif
/* * Seven Kingdoms 2: The Fryhtan War * * Copyright 1999 Enlight Software Ltd. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ // Filename : OANLINE.H // Description : header file for Animated Line, AnimLine // Ownership : Gilbert #ifndef __OANLINE_H #define __OANLINE_H class VgaBuf; class AnimLine { enum { ANIMLINE_PERIOD = 8, ANIMCOLOR_PERIOD = 6, ANIMCOLOR_INNER_PERIOD = 2, ANIMCOLOR_SERIES = 6, }; public: short bound_x1; short bound_y1; short bound_x2; short bound_y2; short phase; short color_phase; static unsigned char init_color_code[ANIMCOLOR_PERIOD][ANIMLINE_PERIOD]; static unsigned char series_color_code[ANIMCOLOR_SERIES][ANIMLINE_PERIOD]; public: void init( short x1, short y1, short x2, short y2); void draw_line( VgaBuf *, short x1, short y1, short x2, short y2, int animatedFlag=1, int effectFlag=0); void thick_line( VgaBuf *, short x1, short y1, short x2, short y2, int animatedFlag=1, int effectFlag=0); void inc_phase(); void basic_line( VgaBuf *, short x1, short y1, short x2, short y2, int animatedFlag, unsigned char* colorCode, int initPhase); void basic_hline( VgaBuf *, short x1, short x2, short y1, int animatedFlag, unsigned char* colorCode, int initPhase); void basic_vline( VgaBuf *, short x1, short y1, short y2, int animatedFlag, unsigned char* colorCode, int initPhase); unsigned char *get_series_color_array(int effectFlag); private: short top_intercept( short x1, short y1, short x2, short y2); short bottom_intercept( short x, short y, short x2, short y2); short left_intercept( short x, short y, short x2, short y2); short right_intercept( short x, short y, short x2, short y2); }; extern AnimLine anim_line; #endif