text
stringlengths
4
6.14k
/******************************************************************************* * COPYRIGHT(c) 2015 STMicroelectronics * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************/ #ifndef BlueSTSDK_BlueSTSDKFeatureActivity_h #define BlueSTSDK_BlueSTSDKFeatureActivity_h #import "BlueSTSDKFeature.h" /** * Export the data from the activiy recognition algorithm * @author STMicroelectronics - Central Labs. */ @interface BlueSTSDKFeatureActivity : BlueSTSDKFeature /** * different type of activity recognized by the node */ typedef NS_ENUM(NSInteger, BlueSTSDKFeatureActivityType){ /** * we don't have enough data for select an activity */ BlueSTSDKFeatureActivityTypeNoActivity =0x00, /** * the person is standing */ BlueSTSDKFeatureActivityTypeStanding =0x01, /** * the person is walking */ BlueSTSDKFeatureActivityTypeWalking =0x02, /** * the person is fast walking */ BlueSTSDKFeatureActivityTypeFastWalking =0x03, /** * the person is jogging */ BlueSTSDKFeatureActivityTypeJogging =0x04, /** * the person is biking */ BlueSTSDKFeatureActivityTypeBiking =0x05, /** * the person is driving */ BlueSTSDKFeatureActivityTypeDriving =0x06, /** * unknown activity */ BlueSTSDKFeatureActivityTypeError =0xFF }; /** * extract the activity value * * @param sample sample read from the node * * @return activity value */ +(BlueSTSDKFeatureActivityType)getActivityType:(BlueSTSDKFeatureSample*)sample; /** * return the data when we receive the notification * * @param sample data read from the node * * @return data when we receive the data */ +(NSDate*)getActivityDate:(BlueSTSDKFeatureSample*)sample; @end #endif
// Copyright 2013 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 CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ #include "base/id_map.h" #include "base/memory/ref_counted.h" #include "base/strings/string16.h" #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h" #include "webkit/child/worker_task_runner.h" class GURL; namespace blink { class WebURL; } namespace IPC { class Message; } namespace content { class ServiceWorkerMessageFilter; class ThreadSafeSender; class WebServiceWorkerImpl; // This class manages communication with the browser process about // registration of the service worker, exposed to renderer and worker // scripts through methods like navigator.registerServiceWorker(). class ServiceWorkerDispatcher : public webkit_glue::WorkerTaskRunner::Observer { public: explicit ServiceWorkerDispatcher(ThreadSafeSender* thread_safe_sender); virtual ~ServiceWorkerDispatcher(); void OnMessageReceived(const IPC::Message& msg); bool Send(IPC::Message* msg); // Corresponds to navigator.registerServiceWorker() void RegisterServiceWorker( const GURL& pattern, const GURL& script_url, blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); // Corresponds to navigator.unregisterServiceWorker() void UnregisterServiceWorker( const GURL& pattern, blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks); // |thread_safe_sender| needs to be passed in because if the call leads to // construction it will be needed. static ServiceWorkerDispatcher* ThreadSpecificInstance( ThreadSafeSender* thread_safe_sender); private: // webkit_glue::WorkerTaskRunner::Observer implementation. virtual void OnWorkerRunLoopStopped() OVERRIDE; // The asynchronous success response to RegisterServiceWorker. void OnRegistered(int32 thread_id, int32 request_id, int64 service_worker_id); // The asynchronous success response to UregisterServiceWorker. void OnUnregistered(int32 thread_id, int32 request_id); void OnRegistrationError(int32 thread_id, int32 request_id, blink::WebServiceWorkerError::ErrorType error_type, const string16& message); IDMap<blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks, IDMapOwnPointer> pending_callbacks_; scoped_refptr<ThreadSafeSender> thread_safe_sender_; DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); }; } // namespace content #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_
/* * Copyright (c) 2016, CETIC. * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. */ /** * \file * 6LBR Project Configuration * \author * 6LBR Team <6lbr@cetic.be> */ #ifndef SIXLBR_CONF_CC26XX_H #define SIXLBR_CONF_CC26XX_H /*------------------------------------------------------------------*/ /* CC26XX 6LBR */ /*------------------------------------------------------------------*/ #define LOG6LBR_LEVEL_DEFAULT LOG6LBR_LEVEL_INFO #define LOG6LBR_SERVICE_DEFAULT LOG6LBR_SERVICE_ALL #if WEBSERVER #undef UIP_CONF_DS6_NBR_NBU #define UIP_CONF_DS6_NBR_NBU 25 #undef UIP_CONF_MAX_ROUTES #define UIP_CONF_MAX_ROUTES 25 #undef UIP_CONF_BUFFER_SIZE #define UIP_CONF_BUFFER_SIZE 600 #else #undef UIP_CONF_DS6_NBR_NBU #define UIP_CONF_DS6_NBR_NBU 100 #undef UIP_CONF_MAX_ROUTES #define UIP_CONF_MAX_ROUTES 100 #endif #define WEBSERVER_CONF_CFS_PATHLEN 600 #define WEBSERVER_CONF_CFS_URLCONV 1 #define WEBSERVER_CONF_CFS_CONNS 1 #undef IEEE802154_CONF_PANID #define IEEE802154_CONF_PANID 0xABCD #undef NETSTACK_CONF_MAC #define NETSTACK_CONF_MAC csma_driver #define CETIC_CSMA_STATS 0 #define CETIC_6LBR_LLSEC_WRAPPER 0 #undef CETIC_6LBR_IP64 #define CETIC_6LBR_IP64 0 /* Do not change lines below */ // IP packet must be 4 bytes aligned #undef UIP_CONF_LLH_LEN #define UIP_CONF_LLH_LEN 16 #define LOG6LBR_TIMESTAMP 0 #define LOG6LBR_STATIC 1 #undef NETSTACK_CONF_RDC #define NETSTACK_CONF_RDC nullrdc_driver #endif /* SIXLBR_CONF_CC26XX_H */
// Copyright (c) 2012 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_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_ #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h" #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" #include "chrome/browser/policy/configuration_policy_provider.h" namespace policy { // Policy provider for a device-local account. Pulls policy from // DeviceLocalAccountPolicyService. Note that this implementation keeps // functioning when the device-local account disappears from // DeviceLocalAccountPolicyService. The current policy will be kept in that case // and RefreshPolicies becomes a no-op. class DeviceLocalAccountPolicyProvider : public ConfigurationPolicyProvider, public DeviceLocalAccountPolicyService::Observer { public: DeviceLocalAccountPolicyProvider(const std::string& user_id, DeviceLocalAccountPolicyService* service); virtual ~DeviceLocalAccountPolicyProvider(); // ConfigurationPolicyProvider: virtual bool IsInitializationComplete(PolicyDomain domain) const OVERRIDE; virtual void RefreshPolicies() OVERRIDE; // DeviceLocalAccountPolicyService::Observer: virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE; virtual void OnDeviceLocalAccountsChanged() OVERRIDE; private: // Returns the broker for |user_id_| or NULL if not available. DeviceLocalAccountPolicyBroker* GetBroker(); // Handles completion of policy refreshes and triggers the update callback. // |success| is true if the policy refresh was successful. void ReportPolicyRefresh(bool success); // Unless |waiting_for_policy_refresh_|, calls UpdatePolicy(), using the // policy from the broker if available or keeping the current policy. void UpdateFromBroker(); const std::string user_id_; scoped_refptr<DeviceLocalAccountExternalDataManager> external_data_manager_; DeviceLocalAccountPolicyService* service_; bool store_initialized_; bool waiting_for_policy_refresh_; base::WeakPtrFactory<DeviceLocalAccountPolicyProvider> weak_factory_; DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProvider); }; } // namespace policy #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_POLICY_PROVIDER_H_
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SERVICES_DEVICE_SERIAL_SERIAL_PORT_MANAGER_IMPL_H_ #define SERVICES_DEVICE_SERIAL_SERIAL_PORT_MANAGER_IMPL_H_ #include <memory> #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/scoped_multi_source_observation.h" #include "base/sequence_checker.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote_set.h" #include "services/device/public/mojom/serial.mojom.h" #include "services/device/serial/bluetooth_serial_device_enumerator.h" #include "services/device/serial/bluetooth_serial_port_impl.h" #include "services/device/serial/serial_device_enumerator.h" namespace base { class SingleThreadTaskRunner; class UnguessableToken; } // namespace base namespace device { // TODO(leonhsl): Merge this class with SerialDeviceEnumerator if/once // SerialDeviceEnumerator is exposed only via the Device Service. // crbug.com/748505 // // Threading notes: // 1. Created on the UI thread. // 2. Used on the UI thread runner (macOS only), otherwise on a blocking task // runner. // 3. Deleted on the same runner on which it is used *except* sometimes // during shutdown when the runner threadpool is already shutdown. // See crbug.com/1263149#c20 for details. class SerialPortManagerImpl : public mojom::SerialPortManager, public SerialDeviceEnumerator::Observer { public: SerialPortManagerImpl( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); SerialPortManagerImpl(const SerialPortManagerImpl&) = delete; SerialPortManagerImpl& operator=(const SerialPortManagerImpl&) = delete; ~SerialPortManagerImpl() override; void Bind(mojo::PendingReceiver<mojom::SerialPortManager> receiver); void SetSerialEnumeratorForTesting( std::unique_ptr<SerialDeviceEnumerator> fake_enumerator); void SetBluetoothSerialEnumeratorForTesting( std::unique_ptr<BluetoothSerialDeviceEnumerator> fake_bluetooth_enumerator); private: // mojom::SerialPortManager methods: void SetClient( mojo::PendingRemote<mojom::SerialPortManagerClient> client) override; void GetDevices(GetDevicesCallback callback) override; void OpenPort(const base::UnguessableToken& token, bool use_alternate_path, device::mojom::SerialConnectionOptionsPtr options, mojo::PendingRemote<mojom::SerialPortClient> client, mojo::PendingRemote<mojom::SerialPortConnectionWatcher> watcher, OpenPortCallback callback) override; // SerialDeviceEnumerator::Observer methods: void OnPortAdded(const mojom::SerialPortInfo& port) override; void OnPortRemoved(const mojom::SerialPortInfo& port) override; void OpenBluetoothSerialPortOnUI( const std::string& address, mojom::SerialConnectionOptionsPtr options, mojo::PendingRemote<mojom::SerialPortClient> client, mojo::PendingRemote<mojom::SerialPortConnectionWatcher> watcher, BluetoothSerialPortImpl::OpenCallback callback); std::unique_ptr<SerialDeviceEnumerator> enumerator_; std::unique_ptr<BluetoothSerialDeviceEnumerator> bluetooth_enumerator_; base::ScopedMultiSourceObservation<SerialDeviceEnumerator, SerialDeviceEnumerator::Observer> observed_enumerator_{this}; scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; mojo::ReceiverSet<SerialPortManager> receivers_; mojo::RemoteSet<mojom::SerialPortManagerClient> clients_; // See threading notes above for guidelines for checking sequence. SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<SerialPortManagerImpl> weak_factory_{this}; }; } // namespace device #endif // SERVICES_DEVICE_SERIAL_SERIAL_PORT_MANAGER_IMPL_H_
/* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 * * from: @(#)auth.h 1.17 88/02/08 SMI * from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC * $FreeBSD$ * FreeBSD: src/include/rpc/auth.h,v 1.14.2.1 1999/08/29 14:39:02 peter Exp */ /* * auth.h, Authentication interface. * * Copyright (C) 1984, Sun Microsystems, Inc. * * The data structures are completely opaque to the client. The client * is required to pass a AUTH * to routines that create rpc * "sessions". */ /* * Status returned from authentication check */ enum sunrpc_auth_stat { SUNRPC_AUTH_OK=0, /* * failed at remote end */ SUNRPC_AUTH_BADCRED=1, /* bogus credentials (seal broken) */ SUNRPC_AUTH_REJECTEDCRED=2, /* client should begin new session */ SUNRPC_AUTH_BADVERF=3, /* bogus verifier (seal broken) */ SUNRPC_AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ SUNRPC_AUTH_TOOWEAK=5, /* rejected due to security reasons */ /* * failed locally */ SUNRPC_AUTH_INVALIDRESP=6, /* bogus response verifier */ SUNRPC_AUTH_FAILED=7 /* some unknown reason */ }; /* * Authentication info. Opaque to client. */ struct sunrpc_opaque_auth { uint32_t oa_flavor; /* flavor of auth */ uint32_t oa_len; /* length of opaque body */ /* zero or more bytes of body */ }; #define SUNRPC_AUTH_NONE 0 /* no authentication */ #define SUNRPC_AUTH_NULL 0 /* backward compatibility */ #define SUNRPC_AUTH_UNIX 1 /* unix style (uid, gids) */ #define SUNRPC_AUTH_SYS 1 /* forward compatibility */ #define SUNRPC_AUTH_SHORT 2 /* short hand unix style */ #define SUNRPC_AUTH_DES 3 /* des style (encrypted timestamps) */
/* ** $Id: llimits.h,v 1.125 2014/12/19 13:30:23 roberto Exp $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ #ifndef llimits_h #define llimits_h #include <limits.h> #include <stddef.h> #include "lua.h" /* ** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count ** the total memory used by Lua (in bytes). Usually, 'size_t' and ** 'ptrdiff_t' should work, but we use 'long' for 16-bit machines. */ #if defined(LUAI_MEM) /* { external definitions? */ typedef LUAI_UMEM lu_mem; typedef LUAI_MEM l_mem; #elif LUAI_BITSINT >= 32 /* }{ */ typedef size_t lu_mem; typedef ptrdiff_t l_mem; #else /* 16-bit ints */ /* }{ */ typedef unsigned long lu_mem; typedef long l_mem; #endif /* } */ /* chars used as small naturals (so that 'char' is reserved for characters) */ typedef unsigned char lu_byte; /* maximum value for size_t */ #define MAX_SIZET ((size_t)(~(size_t)0)) /* maximum size visible for Lua (must be representable in a lua_Integer */ #define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \ : (size_t)(LUA_MAXINTEGER)) #define MAX_LUMEM ((lu_mem)(~(lu_mem)0)) #define MAX_LMEM ((l_mem)(MAX_LUMEM >> 1)) #define MAX_INT INT_MAX /* maximum value of an int */ /* ** conversion of pointer to integer: ** this is for hashing only; there is no problem if the integer ** cannot hold the whole pointer value */ #define point2int(p) ((unsigned int)((size_t)(p) & UINT_MAX)) /* type to ensure maximum alignment */ #if defined(LUAI_USER_ALIGNMENT_T) typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; #else typedef union { double u; void *s; lua_Integer i; long l; } L_Umaxalign; #endif /* types of 'usual argument conversions' for lua_Number and lua_Integer */ typedef LUAI_UACNUMBER l_uacNumber; typedef LUAI_UACINT l_uacInt; /* internal assertions for in-house debugging */ #if defined(lua_assert) #define check_exp(c,e) (lua_assert(c), (e)) /* to avoid problems with conditions too long */ #define lua_longassert(c) { if (!(c)) lua_assert(0); } #else #define lua_assert(c) ((void)0) #define check_exp(c,e) (e) #define lua_longassert(c) ((void)0) #endif /* ** assertion for checking API calls */ #if defined(LUA_USE_APICHECK) #include <assert.h> #define luai_apicheck(e) assert(e) #else #define luai_apicheck(e) lua_assert(e) #endif #define api_check(e,msg) luai_apicheck((e) && msg) #if !defined(UNUSED) #define UNUSED(x) ((void)(x)) /* to avoid warnings */ #endif #define cast(t, exp) ((t)(exp)) #define cast_void(i) cast(void, (i)) #define cast_byte(i) cast(lu_byte, (i)) #define cast_num(i) cast(lua_Number, (i)) #define cast_int(i) cast(int, (i)) #define cast_uchar(i) cast(unsigned char, (i)) /* cast a signed lua_Integer to lua_Unsigned */ #if !defined(l_castS2U) #define l_castS2U(i) ((lua_Unsigned)(i)) #endif /* ** cast a lua_Unsigned to a signed lua_Integer; this cast is ** not strict ISO C, but two-complement architectures should ** work fine. */ #if !defined(l_castU2S) #define l_castU2S(i) ((lua_Integer)(i)) #endif /* ** non-return type */ #if defined(__GNUC__) #define l_noret void __attribute__((noreturn)) #elif defined(_MSC_VER) && _MSC_VER >= 1200 #define l_noret void __declspec(noreturn) #else #define l_noret void #endif /* ** maximum depth for nested C calls and syntactical nested non-terminals ** in a program. (Value must fit in an unsigned short int.) */ #if !defined(LUAI_MAXCCALLS) #define LUAI_MAXCCALLS 200 #endif /* ** maximum number of upvalues in a closure (both C and Lua). (Value ** must fit in an unsigned char.) */ #define MAXUPVAL UCHAR_MAX /* ** type for virtual-machine instructions; ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) */ #if LUAI_BITSINT >= 32 typedef unsigned int Instruction; #else typedef unsigned long Instruction; #endif /* minimum size for the string table (must be power of 2) */ #if !defined(MINSTRTABSIZE) #define MINSTRTABSIZE 64 /* minimum size for "predefined" strings */ #endif /* minimum size for string buffer */ #if !defined(LUA_MINBUFFER) #define LUA_MINBUFFER 32 #endif #if !defined(lua_lock) #define lua_lock(L) ((void) 0) #define lua_unlock(L) ((void) 0) #endif #if !defined(luai_threadyield) #define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} #endif /* ** these macros allow user-specific actions on threads when you defined ** LUAI_EXTRASPACE and need to do something extra when a thread is ** created/deleted/resumed/yielded. */ #if !defined(luai_userstateopen) #define luai_userstateopen(L) ((void)L) #endif #if !defined(luai_userstateclose) #define luai_userstateclose(L) ((void)L) #endif #if !defined(luai_userstatethread) #define luai_userstatethread(L,L1) ((void)L) #endif #if !defined(luai_userstatefree) #define luai_userstatefree(L,L1) ((void)L) #endif #if !defined(luai_userstateresume) #define luai_userstateresume(L,n) ((void)L) #endif #if !defined(luai_userstateyield) #define luai_userstateyield(L,n) ((void)L) #endif /* ** macro to control inclusion of some hard tests on stack reallocation */ #if !defined(HARDSTACKTESTS) #define condmovestack(L) ((void)0) #else /* realloc stack keeping its size */ #define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) #endif #if !defined(HARDMEMTESTS) #define condchangemem(L) condmovestack(L) #else #define condchangemem(L) \ ((void)(!(G(L)->gcrunning) || (luaC_fullgc(L, 0), 1))) #endif #endif
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////// #include "UNIX_FibrePortEventCounters.h" #define UNIX_PROVIDER UNIX_FibrePortEventCountersProvider #define CLASS_IMPLEMENTATION UNIX_FibrePortEventCounters #define CLASS_IMPLEMENTATION_NAME "UNIX_FibrePortEventCounters" #define BASE_CLASS_NAME "CIM_FibrePortEventCounters" #define NUMKEYS_CLASS_IMPLEMENTATION 0 #include "UNIXProviderBase.h" #undef UNIX_PROVIDER #undef CLASS_IMPLEMENTATION #undef CLASS_IMPLEMENTATION_NAME #undef BASE_CLASS_NAME #undef NUMKEYS_CLASS_IMPLEMENTATION
// // Stripe.h // Stripe // // Created by Saikat Chakrabarti on 10/30/12. // Copyright (c) 2012 Stripe. All rights reserved. // #import <Foundation/Foundation.h> #import "StripeError.h" #import "STPCard.h" #import "STPToken.h" FOUNDATION_EXPORT NSString *const kStripeiOSVersion; // Version of this library. typedef void (^STPCompletionBlock)(STPToken *token, NSError *error); // Stripe is a static class used to create and retrieve tokens. @interface Stripe : NSObject /* If you set a default publishable key, it will be used in any of the methods below that do not accept a publishable key parameter */ + (NSString *)defaultPublishableKey; + (void)setDefaultPublishableKey:(NSString *)publishableKey; + (void)createTokenWithCard:(STPCard *)card publishableKey:(NSString *)publishableKey operationQueue:(NSOperationQueue *)queue completion:(STPCompletionBlock)handler; + (void)createTokenWithCard:(STPCard *)card publishableKey:(NSString *)publishableKey completion:(STPCompletionBlock)handler; + (void)createTokenWithCard:(STPCard *)card operationQueue:(NSOperationQueue *)queue completion:(STPCompletionBlock)handler; + (void)createTokenWithCard:(STPCard *)card completion:(STPCompletionBlock)handler; + (void)requestTokenWithID:(NSString *)tokenId publishableKey:(NSString *)publishableKey operationQueue:(NSOperationQueue *)queue completion:(STPCompletionBlock)handler; + (void)requestTokenWithID:(NSString *)tokenId publishableKey:(NSString *)publishableKey completion:(STPCompletionBlock)handler; + (void)requestTokenWithID:(NSString *)tokenId operationQueue:(NSOperationQueue *)queue completion:(STPCompletionBlock)handler; + (void)requestTokenWithID:(NSString *)tokenId completion:(STPCompletionBlock)handler; + (NSDictionary *)stripeUserAgentDetails; + (NSURL *)apiURL; + (void)handleTokenResponse:(NSURLResponse *)response body:(NSData *)body error:(NSError *)requestError completion:(STPCompletionBlock)handler; @end
// // TRNBookCellConfigurator.h // metaBooks // // Created by Jose Manuel Sánchez Peñarroja on 08/05/14. // Copyright (c) 2014 Treenovum. All rights reserved. // #import <BMF/BMFSingleViewConfigurator.h> @interface TRNBookCellConfigurator : BMFSingleViewConfigurator @end
// // Created by Andrew Podkovyrin // Copyright © 2020 Dash Core Group. All rights reserved. // // Licensed under the MIT License (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://opensource.org/licenses/MIT // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import "DWBaseContactsContentViewController.h" #import "DWContactsSearchInfoHeaderView.h" #import "DWFilterHeaderView.h" #import "DWTitleActionHeaderView.h" NS_ASSUME_NONNULL_BEGIN @interface DWBaseContactsContentViewController () <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, DWTitleActionHeaderViewDelegate, DWFilterHeaderViewDelegate> @property (readonly, nonatomic, strong) id<DWPayModelProtocol> payModel; @property (readonly, nonatomic, strong) id<DWTransactionListDataProviderProtocol> dataProvider; @property (null_resettable, nonatomic, strong) UICollectionView *collectionView; @property (null_resettable, nonatomic, strong) DWContactsSearchInfoHeaderView *measuringSearchHeaderView; @property (null_resettable, nonatomic, strong) DWTitleActionHeaderView *measuringRequestsHeaderView; @property (null_resettable, nonatomic, strong) DWFilterHeaderView *measuringContactsHeaderView; @property (null_resettable, nonatomic, copy) NSAttributedString *searchHeaderTitle; @property (null_resettable, nonatomic, copy) NSString *requestsHeaderTitle; @property (null_resettable, nonatomic, copy) NSAttributedString *contactsHeaderFilterButtonTitle; @end NS_ASSUME_NONNULL_END
//----------------------------------------------------------------------------- // Verve // Copyright (C) - Violent Tulip //----------------------------------------------------------------------------- #ifndef _VT_VSPAWNSPHEREGROUP_H_ #define _VT_VSPAWNSPHEREGROUP_H_ #ifndef _VT_VSCENEOBJECTGROUP_H_ #include "Verve/Extension/SceneObject/VSceneObjectGroup.h" #endif //----------------------------------------------------------------------------- class VSpawnSphereGroup : public VSceneObjectGroup { typedef VSceneObjectGroup Parent; public: VSpawnSphereGroup( void ); // Console Declaration. DECLARE_CONOBJECT( VSpawnSphereGroup ); }; //----------------------------------------------------------------------------- #endif // _VT_VSPAWNSPHEREGROUP_H_
/* * VBO.h * * Created on: Feb 16, 2012 * Author: brachyonic */ #ifndef VBO_H_ #define VBO_H_ #include <list> #include <GL/glew.h> #include "VertexAttribute.h" class VBO { private: GLenum Target; GLuint Handle; std::list<VertexAttribute> Attributes; public: VBO(GLenum Target, GLenum Mode, GLsizei ElementSize, GLuint ElementCount, void* Elements); void Attach_VertexAttribute(VertexAttribute Attribute); void Emit_Bindings(); virtual ~VBO( ); }; #endif /* VBO_H_ */
/* * Generated by class-dump 3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. */ #import <IDEKit/IDEPeoplePickerContentViewController.h> @class ABPersonView; @interface IDEPeoplePickerEditPersonViewController : IDEPeoplePickerContentViewController { ABPersonView *_cardView; } + (id)defaultViewNibName; - (void).cxx_destruct; - (void)disableEditing; - (void)teardown; - (void)viewDidInstall; @end
/* * Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 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 MONITOR_SPAWN_H #define MONITOR_SPAWN_H errval_t spawn_all_domains(void); errval_t spawn_domain(char *name); errval_t spawn_domain_with_args(const char *name, char *const argv[], char *const envp[]); errval_t spawn_module_with_args(const char *name, struct mem_region *module, char *const argv[], char *const envp[]); errval_t span_domain(struct capref vroot, struct capref dispframe); errval_t spawn_spawnd(struct intermon_binding *b); #endif
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #import <Foundation/Foundation.h> #import "EC2UnmonitorInstancesResponse.h" #import "EC2ResponseUnmarshaller.h" #ifdef AWS_MULTI_FRAMEWORK #import <AWSRuntime/AmazonValueUnmarshaller.h> #import <AWSRuntime/AmazonBoolValueUnmarshaller.h> #else #import "../AmazonValueUnmarshaller.h" #import "../AmazonBoolValueUnmarshaller.h" #endif #ifdef AWS_MULTI_FRAMEWORK #import <AWSRuntime/AmazonListUnmarshaller.h> #else #import "../AmazonListUnmarshaller.h" #endif #import "EC2InstanceMonitoringUnmarshaller.h" /** * Unmonitor Instances Response Unmarshaller */ @interface EC2UnmonitorInstancesResponseUnmarshaller:EC2ResponseUnmarshaller { EC2UnmonitorInstancesResponse *response; } @property (nonatomic, readonly) EC2UnmonitorInstancesResponse *response; -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict; -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName; @end
// // TestWindow.h // test_jobQuestions // // Created by 张净南 on 2018/9/19. // Copyright © 2018年 Jingnan Zhang. All rights reserved. // #import <UIKit/UIKit.h> @interface TestWindow : UIWindow @end
#ifndef RESTITEM_H #define RESTITEM_H #include <QVariantMap> class RestItem { public: RestItem(); explicit RestItem(QVariantMap object, QString idField); QVariant value(QString key); QStringList keys(); QString id() const; bool isUpdated(); bool isValid() const; void update (QVariantMap value); bool operator==(const RestItem &other); private: QVariantMap m_object; QString m_idField; bool m_isUpdated; bool m_isValid; }; #endif // RESTITEM_H
// // PeopleProfileTeamView.h // People // // Created by Bruno Koga on 10/20/13. // Copyright (c) 2013 CI&T. All rights reserved. // #import <UIKit/UIKit.h> #import "PeopleOpenProfileProtocol.h" @interface PeopleProfileTeamView : UIView @property (weak, nonatomic) IBOutlet UIButton *viewAllButton; @property (weak, nonatomic) IBOutlet UILabel *teamLabel; @property (nonatomic, strong) NSArray *teamMembers; @property (weak) id<PeopleOpenProfileProtocol>delegate; - (NSInteger)maxCount; - (void)setTeamMemberPicture:(UIImage *)image forIndex:(NSInteger)index; @end
#ifndef _CURVE25519_DONNA_H_ #define _CURVE25519_DONNA_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef uint8_t u8; int curve25519_donna(u8 *, const u8 *, const u8 *); #ifdef __cplusplus } #endif // __cplusplus #endif // _CURVE25519_DONNA_H_
// // ______ _ _ _ _____ _____ _ __ // | ____| | | (_) | | / ____| __ \| |/ / // | |__ ___| |_ _ _ __ ___ ___ | |_ ___ | (___ | | | | ' / // | __| / __| __| | '_ ` _ \ / _ \| __/ _ \ \___ \| | | | < // | |____\__ \ |_| | | | | | | (_) | || __/ ____) | |__| | . \ // |______|___/\__|_|_| |_| |_|\___/ \__\___| |_____/|_____/|_|\_\ // // // Copyright © 2016 Estimote. All rights reserved. #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** * ESTTime is an object wrapper around seconds since midnight. * Represents given time of day, measuring seconds since midnight. * Useful for representing time relative to midnight. */ @interface ESTTime : NSObject <NSCopying> /** * Seconds since midnight. */ @property (nonatomic, assign, readonly) NSUInteger secondsSinceMidnight; /** * Designated initializer. * * @param seconds Seconds since midnight. * * @return Initialized object. */ - (instancetype)initWithSecondsSinceMidnight:(NSUInteger)seconds; /** * Convenience initializer. Creates object using clock time values. * * @param hours Integer hours since midnight for a given point in time. * @param minutes Integer minutes since midnight for a given point in time. * @param seconds Integer seconds since midnight for a given point in time. * * @return Initialized object. */ - (instancetype)initWithHours:(NSUInteger)hours minutes:(NSUInteger)minutes seconds:(NSUInteger)seconds; /** * Convenience initializer. Creates object using clock time values. * Assumes seconds are equal to 0. * * @param hours Integer hours since midnight for a given point in time. * @param minutes Integer minutes since midnight for a given point in time. * * @return Initialized object. */ - (instancetype)initWithHours:(NSUInteger)hours minutes:(NSUInteger)minutes; @end NS_ASSUME_NONNULL_END
/* * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org> * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket * * All rights reserved. * * uRedistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * uRedistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * uRedistributions 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 <organization> 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 <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. */ #include "gfx.h" #include <stdio.h> /* * This demo demonstrates two ways to talk to multiple displays. * * Method 1 is the preferred way however Method 2 would be useful * when quickly converting existing single display applications. * * Note you can combine the methods using method 2 for the first display * and method 1 for any extra displays. */ #define USE_METHOD_1 FALSE #if USE_METHOD_1 int main(void) { coord_t width, height; coord_t display, i, j, cnt; font_t f; GDisplay *g; char buf[16]; /* Initialize and clear the display */ gfxInit(); /* Get a font to write with */ f = gdispOpenFont("*"); /* Cycle through each display */ cnt = gdispGetDisplayCount(); for(display = 0; display < cnt; display++) { // Get the specified display g = gdispGetDisplay(display); // Get the screen size width = gdispGGetWidth(g); height = gdispGGetHeight(g); /* Draw draw draw */ sprintg(buf, "Display %u", display); if (width < 128) { gdispGDrawBox(g, 0, 0, width/2, height/2, Yellow); gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, Black, uBlue, justifyCenter); } else { gdispGDrawBox(g, 10, 10, width/2, height/2, Yellow); gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, White, uBlue, justifyCenter); } gdispGDrawLine(g, 5, 30, width-50, height-40, uRed); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) gdispGDrawPixel(g, i, j, White); } while(TRUE) { gfxSleepMilliseconds(500); } } #else int main(void) { coord_t width, height; coord_t display, i, j, cnt; font_t f; char buf[16]; /* Initialize and clear the display */ gfxInit(); /* Get a font to write with */ f = gdispOpenFont("*"); /* Cycle through each display */ cnt = gdispGetDisplayCount(); for(display = 0; display < cnt; display++) { // Set the default display to the specified display gdispSetDisplay(gdispGetDisplay(display)); // Get the screen size width = gdispGetWidth(); height = gdispGetHeight(); /* Draw draw draw */ sprintg(buf, "Display %u", display); if (width < 128) { gdispDrawBox(0, 0, width/2, height/2, Yellow); gdispFillStringBox(0, height/2, width, height/2, buf, f, Black, uBlue, justifyCenter); } else { gdispDrawBox(10, 10, width/2, height/2, Yellow); gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, White, uBlue, justifyCenter); } gdispDrawLine(5, 30, width-50, height-40, uRed); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) gdispDrawPixel(i, j, White); } while(TRUE) { gfxSleepMilliseconds(500); } } #endif
/* crypto/rc2/rc2cfb64.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 "rc2.h" #include "rc2_locl.h" /* * The input and output encrypted as though 64bit cfb mode is being used. * The extra state information to record how much of the 64bit block we have * used is contained in *num; */ void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, RC2_KEY *schedule, unsigned char *ivec, int *num, int encrypt) { register unsigned long v0, v1, t; register int n = *num; register long l = length; unsigned long ti[2]; unsigned char *iv, c, cc; iv = (unsigned char *)ivec; if (encrypt) { while (l--) { if (n == 0) { c2l(iv, v0); ti[0] = v0; c2l(iv, v1); ti[1] = v1; RC2_encrypt((unsigned long *)ti, schedule); iv = (unsigned char *)ivec; t = ti[0]; l2c(t, iv); t = ti[1]; l2c(t, iv); iv = (unsigned char *)ivec; } c = *(in++) ^ iv[n]; *(out++) = c; iv[n] = c; n = (n + 1) & 0x07; } } else { while (l--) { if (n == 0) { c2l(iv, v0); ti[0] = v0; c2l(iv, v1); ti[1] = v1; RC2_encrypt((unsigned long *)ti, schedule); iv = (unsigned char *)ivec; t = ti[0]; l2c(t, iv); t = ti[1]; l2c(t, iv); iv = (unsigned char *)ivec; } cc = *(in++); c = iv[n]; iv[n] = cc; *(out++) = c ^ cc; n = (n + 1) & 0x07; } } v0 = v1 = ti[0] = ti[1] = t = c = cc = 0; *num = n; }
#pragma once #include "ofMain.h" #include "particleSystem.h" class ofApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); void gotMessage(ofMessage msg); //Particle particle; vector<particleSystem> systems; ofVec2f gravity; };
// // RMCommonConstants.h // RescueMe // // Created by Ronak Shah on 5/10/14. // Copyright (c) 2014 DJ911. All rights reserved. // #ifndef RescueMe_RMCommonConstants_h #define RescueMe_RMCommonConstants_h #define RM_IS_USER_LOGGED_IN @"isUserLoggedIn" #define RM_DID_RECEIVE_PUSH_NOTIFICATION @"didReceivePushNotification" #define RM_EMERGENCY_CONTACTS @"emergencyContacts" #endif
/* Copyright (c) 2013-2018 Mahmoud Fayed <msfclipper@yahoo.com> */ #ifndef GGEOAREAMONITORSOURCE_H #define GGEOAREAMONITORSOURCE_H #include <QApplication> #include <QGeoAreaMonitorSource> extern "C" { #include "ring.h" } class GGeoAreaMonitorSource : public QGeoAreaMonitorSource { Q_OBJECT public: VM *pVM; List *pParaList; char cEvent[100]; char cEvent[100]; char cEvent[100]; char cEvent[100]; GGeoAreaMonitorSource(QObject *parent,VM *pVM ); ~GGeoAreaMonitorSource(); void geteventparameters(void) ; void setEvent(const char *cStr); void setEvent(const char *cStr); void setEvent(const char *cStr); void setEvent(const char *cStr); const char *getEvent(void); const char *getEvent(void); const char *getEvent(void); const char *getEvent(void); public slots: void Slot(); void Slot(); void Slot(); void Slot(); }; #endif
#pragma once #include "SPSCQueue.h" struct DatabaseJobContext ; class DatabaseJobManager { public: DatabaseJobManager() {} void ExecuteDatabaseJobs() ; bool PushDatabaseJobRequest(DatabaseJobContext* jobContext) ; bool PopDatabaseJobResult(DatabaseJobContext*& jobContext) ; private: enum { MAX_DB_JOB = 127 } ; SPSCQueue<DatabaseJobContext*, MAX_DB_JOB> mDbJobRequestQueue ; SPSCQueue<DatabaseJobContext*, MAX_DB_JOB> mDbJobResultQueue ; } ; extern DatabaseJobManager* GDatabaseJobManager ;
#import <Cocoa/Cocoa.h> #import "TKDTokaidoController.h" #import "TKDAppLogViewerController.h" #import "TKDApp.h" #import "TKDSelectableIcon.h" #import "TKDRailsAppTokenField.h" @interface TKDAppViewItem : NSCollectionViewItem <TKDRailsAppTokenFieldDelegate, TKDSelectableIconDelegate> @property (nonatomic, weak) IBOutlet TKDTokaidoController *tokaidoController; @property (nonatomic, strong) IBOutlet TKDAppLogViewerController *appLogViewerController; @property (nonatomic, strong) IBOutlet NSObjectController *appController; @property (nonatomic, strong) IBOutlet TKDSelectableIcon *appIcon; @property (nonatomic, strong) IBOutlet TKDRailsAppTokenField *tokenField; @property (nonatomic, strong) IBOutlet NSTextField *appNameTextField; @property (nonatomic, strong) IBOutlet NSMenu *appMenu; @property (nonatomic, strong) IBOutlet NSMenuItem *activatedMenuItem; @property (nonatomic, strong) IBOutlet NSMenuItem *shouldActivateOnLaunchMenuItem; @property (nonatomic, strong) IBOutlet NSMenuItem *showInFinderMenuItem; @property (nonatomic, strong) IBOutlet NSMenuItem *openInBrowserMenuItem; @property (nonatomic, strong) IBOutlet NSMenuItem *editMenuItem; @property (nonatomic, strong) IBOutlet NSMenuItem *removeMenuItem; - (IBAction)showLogs:(id)sender; - (IBAction)doubleClick:(id)sender; @property (nonatomic, readonly) TKDApp *app; @end
//****************************************************************************** // // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // 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 #import <stubincludes.h> #import <AddressBookUI/AddressBookUIFunctions.h> #import <AddressBookUI/ABNewPersonViewController.h> #import <AddressBookUI/ABNewPersonViewControllerDelegate.h> #import <AddressBookUI/ABPeoplePickerNavigationController.h> #import <AddressBookUI/ABPeoplePickerNavigationControllerDelegate.h> #import <AddressBookUI/ABPersonViewController.h> #import <AddressBookUI/ABPersonViewControllerDelegate.h> #import <AddressBookUI/ABUnknownPersonViewController.h> #import <AddressBookUI/ABUnknownPersonViewControllerDelegate.h> #import <AddressBookUI/AddressBookUI.h> #import <AddressBookUI/AddressBookUIExport.h>
/* * Copyright 2018 Google * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** * A Timestamp represents a point in time independent of any time zone or calendar, represented as * seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using * the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It * is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no * leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to * and from RFC 3339 date strings. * * @see https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto for the * reference timestamp definition. */ NS_SWIFT_NAME(Timestamp) @interface FIRTimestamp : NSObject <NSCopying> /** */ - (instancetype)init NS_UNAVAILABLE; /** * Creates a new timestamp. * * @param seconds the number of seconds since epoch. * @param nanoseconds the number of nanoseconds after the seconds. */ - (instancetype)initWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds NS_DESIGNATED_INITIALIZER; /** * Creates a new timestamp. * * @param seconds the number of seconds since epoch. * @param nanoseconds the number of nanoseconds after the seconds. */ + (instancetype)timestampWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds; /** Creates a new timestamp from the given date. */ + (instancetype)timestampWithDate:(NSDate *)date; /** Creates a new timestamp with the current date / time. */ + (instancetype)timestamp; /** Returns a new NSDate corresponding to this timestamp. This may lose precision. */ - (NSDate *)dateValue; - (NSComparisonResult)compare:(FIRTimestamp *)other; /** * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. * Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. */ @property(nonatomic, assign, readonly) int64_t seconds; /** * Non-negative fractions of a second at nanosecond resolution. Negative second values with * fractions must still have non-negative nanos values that count forward in time. * Must be from 0 to 999,999,999 inclusive. */ @property(nonatomic, assign, readonly) int32_t nanoseconds; @end NS_ASSUME_NONNULL_END
#if defined(PEGASUS_OS_HPUX) # include "UNIX_CollectionOfSensorsDeps_HPUX.h" #elif defined(PEGASUS_OS_LINUX) # include "UNIX_CollectionOfSensorsDeps_LINUX.h" #elif defined(PEGASUS_OS_DARWIN) # include "UNIX_CollectionOfSensorsDeps_DARWIN.h" #elif defined(PEGASUS_OS_AIX) # include "UNIX_CollectionOfSensorsDeps_AIX.h" #elif defined(PEGASUS_OS_FREEBSD) # include "UNIX_CollectionOfSensorsDeps_FREEBSD.h" #elif defined(PEGASUS_OS_SOLARIS) # include "UNIX_CollectionOfSensorsDeps_SOLARIS.h" #elif defined(PEGASUS_OS_ZOS) # include "UNIX_CollectionOfSensorsDeps_ZOS.h" #elif defined(PEGASUS_OS_VMS) # include "UNIX_CollectionOfSensorsDeps_VMS.h" #elif defined(PEGASUS_OS_TRU64) # include "UNIX_CollectionOfSensorsDeps_TRU64.h" #else # include "UNIX_CollectionOfSensorsDeps_STUB.h" #endif
/* ----------------------------------------------------------------------------- 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 _ShaderFFPFog_ #define _ShaderFFPFog_ #include "OgreShaderPrerequisites.h" #ifdef RTSHADER_SYSTEM_BUILD_CORE_SHADERS #include "OgreShaderSubRenderState.h" #include "OgreVector.h" namespace Ogre { namespace RTShader { /** \addtogroup Optional * @{ */ /** \addtogroup RTShader * @{ */ /** Fog sub render state implementation of the Fixed Function Pipeline. @see http://msdn.microsoft.com/en-us/library/bb173398.aspx Derives from SubRenderState class. */ class FFPFog : public SubRenderState { public: // Fog calculation mode enum. enum CalcMode { CM_PER_VERTEX = 1, // Per vertex fog calculations. (Default). CM_PER_PIXEL = 2 // Per pixel fog calculations. }; // Interface. public: /** Class default constructor */ FFPFog(); /** @see SubRenderState::getType. */ virtual const String& getType() const; /** @see SubRenderState::getType. */ virtual int getExecutionOrder() const; /** @see SubRenderState::copyFrom. */ virtual void copyFrom(const SubRenderState& rhs); /** @see SubRenderState::preAddToRenderState. */ virtual bool preAddToRenderState(const RenderState* renderState, Pass* srcPass, Pass* dstPass); /** Set the fog calculation mode. Either per vertex or per pixel. @param calcMode The calculation mode to set. */ void setCalcMode(CalcMode calcMode) { mCalcMode = calcMode; } bool setParameter(const String& name, const String& value) override; /** Return the current calculation mode. */ CalcMode getCalcMode() const { return mCalcMode; } static String Type; // Protected methods protected: /** @see SubRenderState::resolveParameters. */ virtual bool resolveParameters(ProgramSet* programSet); /** @see SubRenderState::resolveDependencies. */ virtual bool resolveDependencies(ProgramSet* programSet); /** @see SubRenderState::addFunctionInvocations. */ virtual bool addFunctionInvocations(ProgramSet* programSet); // Attributes. protected: // Fog calculation mode. CalcMode mCalcMode; // Fog formula. FogMode mFogMode; // Fog colour parameter. UniformParameterPtr mFogColour; // Fog parameters program parameter. UniformParameterPtr mFogParams; // Vertex shader output position parameter. ParameterPtr mVSOutPos; // Vertex shader output fog colour parameter. ParameterPtr mVSOutFogFactor; // Pixel shader input fog factor. ParameterPtr mPSInFogFactor; // Vertex shader output depth. ParameterPtr mVSOutDepth; // Pixel shader input depth. ParameterPtr mPSInDepth; // Pixel shader output diffuse colour. ParameterPtr mPSOutDiffuse; }; /** A factory that enables creation of FFPFog instances. @remarks Sub class of SubRenderStateFactory */ class FFPFogFactory : public SubRenderStateFactory { public: /** @see SubRenderStateFactory::getType. */ virtual const String& getType() const; /** @see SubRenderStateFactory::createInstance. */ virtual SubRenderState* createInstance(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator); /** @see SubRenderStateFactory::writeInstance. */ virtual void writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState, Pass* srcPass, Pass* dstPass); protected: /** @see SubRenderStateFactory::createInstanceImpl. */ virtual SubRenderState* createInstanceImpl(); }; /** @} */ /** @} */ } } #endif #endif
/******************************************************************************* * File Name: USBFS_1_vnd.c * Version 2.70 * * Description: * USB vendor request handler. * * Note: * ******************************************************************************** * Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved. * You may use this file only in accordance with the license, terms, conditions, * disclaimers, and limitations in the end user license agreement accompanying * the software package with which this file was provided. *******************************************************************************/ #include "USBFS_1.h" #include "USBFS_1_pvt.h" #if(USBFS_1_EXTERN_VND == USBFS_1_FALSE) /*************************************** * Vendor Specific Declarations ***************************************/ /* `#START VENDOR_SPECIFIC_DECLARATIONS` Place your declaration here */ /* `#END` */ /******************************************************************************* * Function Name: USBFS_1_HandleVendorRqst ******************************************************************************** * * Summary: * This routine provide users with a method to implement vendor specific * requests. * * To implement vendor specific requests, add your code in this function to * decode and disposition the request. If the request is handled, your code * must set the variable "requestHandled" to TRUE, indicating that the * request has been handled. * * Parameters: * None. * * Return: * requestHandled. * * Reentrant: * No. * *******************************************************************************/ uint8 USBFS_1_HandleVendorRqst(void) { uint8 requestHandled = USBFS_1_FALSE; if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == USBFS_1_RQST_DIR_D2H) { /* Control Read */ switch (CY_GET_REG8(USBFS_1_bRequest)) { case USBFS_1_GET_EXTENDED_CONFIG_DESCRIPTOR: #if defined(USBFS_1_ENABLE_MSOS_STRING) USBFS_1_currentTD.pData = (volatile uint8 *)&USBFS_1_MSOS_CONFIGURATION_DESCR[0u]; USBFS_1_currentTD.count = USBFS_1_MSOS_CONFIGURATION_DESCR[0u]; requestHandled = USBFS_1_InitControlRead(); #endif /* USBFS_1_ENABLE_MSOS_STRING */ break; default: break; } } /* `#START VENDOR_SPECIFIC_CODE` Place your vendor specific request here */ /* `#END` */ return(requestHandled); } /******************************************************************************* * Additional user functions supporting Vendor Specific Requests ********************************************************************************/ /* `#START VENDOR_SPECIFIC_FUNCTIONS` Place any additional functions here */ /* `#END` */ #endif /* USBFS_1_EXTERN_VND */ /* [] END OF FILE */
// // Comment.h // 闺秘 // // Created by floar on 14-7-11. // Copyright (c) 2014年 jonas. All rights reserved. // #import <Foundation/Foundation.h> #import "NSObjectExtention.h" #import "Package.h" @interface Comment : NSObjectExtention @property (nonatomic, assign) uint64_t DBUid;//区分数据库归属 @property (nonatomic, assign) uint64_t feedId; @property (nonatomic, assign) uint64_t commentId; @property (nonatomic, strong) NSString *comment; @property (nonatomic, assign) uint32_t avatarId; @property (nonatomic, assign) uint32_t createTime; @property (nonatomic, assign) uint32_t likeNum; @property (nonatomic, assign) uint32_t floorNum; @property (nonatomic, assign) uint32_t isOwnZanComment; -(void)analyzePackageForComment:(Package *)pack; -(void)analyzePackageForPublishComment:(Package *)pack; @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 _Ogre_NULLUavBufferPacked_H_ #define _Ogre_NULLUavBufferPacked_H_ #include "OgreNULLPrerequisites.h" #include "Vao/OgreUavBufferPacked.h" namespace Ogre { class NULLBufferInterface; class _OgreNULLExport NULLUavBufferPacked : public UavBufferPacked { protected: virtual TexBufferPacked* getAsTexBufferImpl( PixelFormat pixelFormat ); public: NULLUavBufferPacked( size_t internalBufStartBytes, size_t numElements, uint32 bytesPerElement, uint32 bindFlags, void *initialData, bool keepAsShadow, VaoManager *vaoManager, NULLBufferInterface *bufferInterface ); ~NULLUavBufferPacked(); // virtual void bindBufferVS( uint16 slot, size_t offset=0, size_t sizeBytes=0 ) {} // virtual void bindBufferPS( uint16 slot, size_t offset=0, size_t sizeBytes=0 ) {} // virtual void bindBufferGS( uint16 slot, size_t offset=0, size_t sizeBytes=0 ) {} // virtual void bindBufferDS( uint16 slot, size_t offset=0, size_t sizeBytes=0 ) {} // virtual void bindBufferHS( uint16 slot, size_t offset=0, size_t sizeBytes=0 ) {} virtual void bindBufferCS( uint16 slot, size_t offset=0, size_t sizeBytes=0 ) {} }; } #endif
// // UIView+Framing.h // AOLib // // Created by Olegas on 01/05/2013. // Copyright (c)2013 Olegas. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (Framing) @property (nonatomic) CGFloat height; @property (nonatomic) CGFloat width; @property (nonatomic) CGPoint origin; @property (nonatomic) CGSize size; @property (nonatomic, readonly) CGFloat bottomEdge; @property (nonatomic, readonly) CGFloat rightEdge; @property (nonatomic) CGFloat xOrigin; @property (nonatomic) CGFloat yOrigin; - (void)setSafeCenter:(CGPoint)center; - (CGPoint)getContentCenter; @end
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #ifndef OSSL_TEST_SHIM_TEST_CONFIG_H #define OSSL_TEST_SHIM_TEST_CONFIG_H #include <string> #include <vector> struct TestConfig { int port = 0; bool is_server = false; bool is_dtls = false; int resume_count = 0; bool fallback_scsv = false; std::string key_file; std::string cert_file; std::string expected_server_name; std::string expected_certificate_types; bool require_any_client_certificate = false; std::string advertise_npn; std::string expected_next_proto; std::string select_next_proto; bool async = false; bool write_different_record_sizes = false; bool partial_write = false; bool no_tls13 = false; bool no_tls12 = false; bool no_tls11 = false; bool no_tls1 = false; bool no_ssl3 = false; bool shim_writes_first = false; std::string host_name; std::string advertise_alpn; std::string expected_alpn; std::string expected_advertised_alpn; std::string select_alpn; bool decline_alpn = false; bool expect_session_miss = false; bool expect_extended_master_secret = false; std::string psk; std::string psk_identity; std::string srtp_profiles; int min_version = 0; int max_version = 0; int mtu = 0; bool implicit_handshake = false; std::string cipher; bool handshake_never_done = false; int export_keying_material = 0; std::string export_label; std::string export_context; bool use_export_context = false; bool expect_ticket_renewal = false; bool expect_no_session = false; bool use_ticket_callback = false; bool renew_ticket = false; bool enable_client_custom_extension = false; bool enable_server_custom_extension = false; bool custom_extension_skip = false; bool custom_extension_fail_add = false; bool check_close_notify = false; bool shim_shuts_down = false; bool verify_fail = false; bool verify_peer = false; bool expect_verify_result = false; int expect_total_renegotiations = 0; bool renegotiate_freely = false; bool p384_only = false; bool enable_all_curves = false; bool use_sparse_dh_prime = false; bool use_old_client_cert_callback = false; bool use_null_client_ca_list = false; bool peek_then_read = false; int max_cert_list = 0; }; bool ParseConfig(int argc, char **argv, TestConfig *out_config); #endif // OSSL_TEST_SHIM_TEST_CONFIG_H
#ifndef WAVEFRONT2GRAPHICS_H #define WAVEFRONT2GRAPHICS_H #include "../../ThirdPartyLibs/Wavefront/tiny_obj_loader.h" #include <vector> struct GLInstanceGraphicsShape* btgCreateGraphicsShapeFromWavefrontObj(const tinyobj::attrib_t& attribute, std::vector<tinyobj::shape_t>& shapes, bool flatShading = false); #endif //WAVEFRONT2GRAPHICS_H
/**************************************************************************** * * Copyright (C) 2012 PX4 Development Team. 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 PX4 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. * ****************************************************************************/ /** * @file px4fmu_usb.c * * Board-specific USB functions. */ /************************************************************************************ * Included Files ************************************************************************************/ #include <px4_config.h> #include <sys/types.h> #include <stdint.h> #include <stdbool.h> #include <debug.h> #include <nuttx/usb/usbdev.h> #include <nuttx/usb/usbdev_trace.h> #include <up_arch.h> #include <stm32.h> #include "board_config.h" /************************************************************************************ * Definitions ************************************************************************************/ /************************************************************************************ * Private Functions ************************************************************************************/ /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ * Name: stm32_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the PX4FMU board. * ************************************************************************************/ __EXPORT void stm32_usbinitialize(void) { /* The OTG FS has an internal soft pull-up */ /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ #ifdef CONFIG_STM32_OTGFS px4_arch_configgpio(GPIO_OTGFS_VBUS); /* XXX We only support device mode px4_arch_configgpio(GPIO_OTGFS_PWRON); px4_arch_configgpio(GPIO_OTGFS_OVER); */ #endif } /************************************************************************************ * Name: stm32_usbsuspend * * Description: * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is * used. This function is called whenever the USB enters or leaves suspend mode. * This is an opportunity for the board logic to shutdown clocks, power, etc. * while the USB is suspended. * ************************************************************************************/ __EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) { //ulldbg("resume: %d\n", resume); }
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////// #ifndef __UNIX_APPLICATIONSYSTEMDEPENDENCY_H #define __UNIX_APPLICATIONSYSTEMDEPENDENCY_H #include "CIM_Dependency.h" #include "UNIX_ApplicationSystemDependencyDeps.h" class UNIX_ApplicationSystemDependency : public CIM_Dependency { public: UNIX_ApplicationSystemDependency(); ~UNIX_ApplicationSystemDependency(); virtual Boolean initialize(); virtual Boolean load(int&); virtual Boolean finalize(); virtual Boolean find(Array<CIMKeyBinding>&); virtual Boolean validateKey(CIMKeyBinding&) const; virtual void setScope(CIMName); virtual Boolean getAntecedent(CIMProperty&) const; virtual CIMInstance getAntecedent() const; virtual Boolean getDependent(CIMProperty&) const; virtual CIMInstance getDependent() const; private: CIMName currentScope; # include "UNIX_ApplicationSystemDependencyPrivate.h" }; #endif /* UNIX_APPLICATIONSYSTEMDEPENDENCY */
// // This source file is part of appleseed. // Visit http://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited // Copyright (c) 2014-2017 Francois Beaune, The appleseedhq Organization // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #ifndef APPLESEED_RENDERER_MODELING_SURFACESHADER_AOSURFACESHADER_H #define APPLESEED_RENDERER_MODELING_SURFACESHADER_AOSURFACESHADER_H // appleseed.renderer headers. #include "renderer/modeling/surfaceshader/isurfaceshaderfactory.h" // appleseed.foundation headers. #include "foundation/platform/compiler.h" #include "foundation/utility/autoreleaseptr.h" // appleseed.main headers. #include "main/dllsymbol.h" // Forward declarations. namespace foundation { class Dictionary; } namespace foundation { class DictionaryArray; } namespace renderer { class SurfaceShader; } namespace renderer { // // Ambient occlusion surface shader factory. // class APPLESEED_DLLSYMBOL AOSurfaceShaderFactory : public ISurfaceShaderFactory { public: // Delete this instance. void release() override; // Return a string identifying this surface shader model. const char* get_model() const override; // Return metadata for this surface shader model. foundation::Dictionary get_model_metadata() const override; // Return metadata for the inputs of this surface shader model. foundation::DictionaryArray get_input_metadata() const override; // Create a new surface shader instance. foundation::auto_release_ptr<SurfaceShader> create( const char* name, const ParamArray& params) const override; }; } // namespace renderer #endif // !APPLESEED_RENDERER_MODELING_SURFACESHADER_AOSURFACESHADER_H
/****************************************************************************** QtAV: Media play library based on Qt and FFmpeg Copyright (C) 2014-2015 Wang Bin <wbsecg1@gmail.com> * This file is part of QtAV This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ******************************************************************************/ #ifndef QTAV_QUICKVIDEOPREVIEW_H #define QTAV_QUICKVIDEOPREVIEW_H #include <QtAV/VideoFrameExtractor.h> #define CONFIG_FBO_ITEM (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) #if CONFIG_FBO_ITEM #include <QmlAV/QuickFBORenderer.h> #else #include <QmlAV/QQuickItemRenderer.h> #endif namespace QtAV { class QuickVideoPreview #if CONFIG_FBO_ITEM : public QuickFBORenderer #else : public QQuickItemRenderer #endif { Q_OBJECT // position conflicts with QQuickItem.position Q_PROPERTY(int timestamp READ timestamp WRITE setTimestamp NOTIFY timestampChanged) // source is already in VideoOutput Q_PROPERTY(QUrl file READ file WRITE setFile NOTIFY fileChanged) public: explicit QuickVideoPreview(QQuickItem *parent = 0); void setTimestamp(int value); int timestamp() const; void setFile(const QUrl& value); QUrl file() const; signals: void timestampChanged(); void fileChanged(); private slots: void displayFrame(const QtAV::VideoFrame& frame); //parameter VideoFrame void displayNoFrame(); private: QUrl m_file; VideoFrameExtractor m_extractor; }; } //namespace QtAV #endif // QUICKVIDEOPREVIEW_H
#ifndef PEOPLE_LIST_H #define PEOPLE_LIST_H #include <View.h> #include <OutlineListView.h> #include <PopUpMenu.h> class PeepsListItem; class PeopleList : public BOutlineListView { public: PeopleList(BRect frame, const char *name, DataView *dv); void SelectionChanged(); int32 FindNextAlphabetical(char c, int32 index); void MessageReceived(BMessage *msg); void KeyDown(const char *bytes,int32 numbytes); void ScrollToItem(PeepsListItem *item); void MakeFocus(bool value=true); void MouseDown(BPoint pt); void SyncData(PersonItem *item); void SyncData(void); void SaveData(void); void SaveImageData(void); void ShowContextMenu(BPoint pt); private: GroupItem *lastgroup; DataView *fDataView; bool fDeleteDisabled; bool fGroupSelection; PersonItem *lastperson; BPopUpMenu *fPopupMenu; }; bool IsNameChar(char c); int charncmp(char c1, char c2); #endif
// // FLLogFile.h // FishLampCocoa // // Created by Mike Fullerton on 6/7/12. // Copyright (c) 2013 GreenTongue Software LLC, Mike Fullerton. // The FishLamp Framework is released under the MIT License: http://fishlamp.com/license // #import "FishLampCore.h" #import "FLFolderFile.h" @interface FLLogFile : NSObject { @private NSString* _filePath; NSFileHandle* _fileHandle; } @property (readwrite, strong, nonatomic) NSString* filePath; - (id) initWithPath:(NSString*) path; - (void) openLogFile; - (void) closeLogFile; - (void) logString:(NSString*) string; + (FLLogFile*) logFile:(NSString*) path; @end
#if !BIT_IDENTICAL_FLOATING_POINT #include "ieee754names.h" #include "../../third-party/fdlibm/s_ldexp.c" #endif
#pragma once #include "Util/CommonClasses.h" #include "Commands/CAssemblerCommand.h" #include "Core/Expression.h" class CDirectiveFill: public CAssemblerCommand { public: CDirectiveFill(); bool Load(ArgumentList& Args); virtual bool Validate(); virtual void Encode(); virtual void writeTempData(TempData& tempData); virtual void writeSymData(SymbolData& symData); private: Expression sizeExpression; Expression byteExpression; size_t Size; bool FillByte; u8 Byte; u64 RamPos; };
/* OpenCL runtime library: clCreateProgramWithBinary() Copyright (c) 2012 Pekka Jääskeläinen / Tampere University of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "pocl_cl.h" #include "pocl_util.h" #include <string.h> CL_API_ENTRY cl_program CL_API_CALL POname(clCreateProgramWithBinary)(cl_context context, cl_uint num_devices, const cl_device_id * device_list, const size_t * lengths, const unsigned char ** binaries, cl_int * binary_status, cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 { cl_program program; unsigned i,j; int errcode; POCL_GOTO_ERROR_COND((context == NULL), CL_INVALID_CONTEXT); POCL_GOTO_ERROR_COND((device_list == NULL), CL_INVALID_VALUE); POCL_GOTO_ERROR_COND((num_devices == 0), CL_INVALID_VALUE); POCL_GOTO_ERROR_COND((lengths == NULL), CL_INVALID_VALUE); for (i = 0; i < num_devices; ++i) { POCL_GOTO_ERROR_ON((lengths[i] == 0 || binaries[i] == NULL), CL_INVALID_VALUE, "%i-th binary is NULL or its length==0\n", i); } // check for invalid devices in device_list[]. for (i = 0; i < num_devices; i++) { int found = 0; for (j = 0; j < context->num_devices; j++) { found |= context->devices[j] == device_list[i]; } POCL_GOTO_ERROR_ON((!found), CL_INVALID_DEVICE, "device not found in the device list of the context\n"); } // check for duplicates in device_list[]. for (i = 0; i < context->num_devices; i++) { int count = 0; for (j = 0; j < num_devices; j++) { count += context->devices[i] == device_list[j]; } // duplicate devices POCL_GOTO_ERROR_ON((count > 1), CL_INVALID_DEVICE, "device %s specified multiple times\n", context->devices[i]->long_name); } if ((program = (cl_program) malloc (sizeof (struct _cl_program))) == NULL) { errcode = CL_OUT_OF_HOST_MEMORY; goto ERROR; } POCL_INIT_OBJECT(program); program->binary_sizes = NULL; program->binaries = NULL; program->compiler_options = NULL; program->llvm_irs = NULL; if ((program->binary_sizes = (size_t*) calloc (num_devices, sizeof(size_t))) == NULL || (program->binaries = (unsigned char**) calloc (num_devices, sizeof(unsigned char*))) == NULL || (program->build_log = (char**) calloc (num_devices, sizeof(char*))) == NULL || ((program->llvm_irs = (void**) calloc (num_devices, sizeof(void*))) == NULL) || ((program->build_hash = (SHA1_digest_t*) calloc (num_devices, sizeof(SHA1_digest_t))) == NULL)) { errcode = CL_OUT_OF_HOST_MEMORY; goto ERROR_CLEAN_PROGRAM_AND_BINARIES; } program->context = context; program->num_devices = num_devices; program->devices = (cl_device_id*) calloc (num_devices, sizeof(cl_device_id)); program->source = NULL; program->kernels = NULL; program->build_status = CL_BUILD_NONE; for (i = 0; i < num_devices; ++i) { program->devices[i] = device_list[i]; program->binary_sizes[i] = lengths[i]; program->binaries[i] = (unsigned char*) malloc (lengths[i]); memcpy (program->binaries[i], binaries[i], lengths[i]); if (binary_status != NULL) /* TODO: validate the binary */ binary_status[i] = CL_SUCCESS; } POCL_RETAIN_OBJECT(context); if (errcode_ret != NULL) *errcode_ret = CL_SUCCESS; return program; #if 0 ERROR_CLEAN_PROGRAM_BINARIES_AND_DEVICES: POCL_MEM_FREE(program->devices); #endif ERROR_CLEAN_PROGRAM_AND_BINARIES: if (program->binaries) for (i = 0; i < num_devices; ++i) POCL_MEM_FREE(program->binaries[i]); POCL_MEM_FREE(program->binaries); POCL_MEM_FREE(program->binary_sizes); /*ERROR_CLEAN_PROGRAM:*/ POCL_MEM_FREE(program); ERROR: if(errcode_ret != NULL) { *errcode_ret = errcode; } return NULL; } POsym(clCreateProgramWithBinary)
// Copyright 2014 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <GoogleCast/GCKDeviceManager.h> #import <UIKit/UIKit.h> @class GCKMediaInformation; /** * Additional metadata key for the poster image URL. */ extern NSString * const kCastComponentPosterURL; /** * A view that shows the media thumbnail and controls for media playing on the * Chromecast device. */ @interface CastViewController : UIViewController /** * The volume slider control. */ @property(strong, nonatomic) IBOutlet UISlider *volumeSlider; /** * The label in the volume control container. */ @property(weak, nonatomic) IBOutlet UILabel *volumeControlLabel; /** * The entire volume control container, including the label. */ @property(strong, nonatomic) IBOutlet UIView *volumeControls; /** * Show the slider for a few sections if touched. * * @param sender */ - (IBAction)showVolumeSlider:(id)sender; @end
// // XHLaunchAd.h // XHLaunchAdExample // // Created by zhuxiaohui on 2016/6/13. // Copyright © 2016年 it7090.com. All rights reserved. // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "XHLaunchAdConfiguration.h" NS_ASSUME_NONNULL_BEGIN @class XHLaunchAd; @protocol XHLaunchAdDelegate <NSObject> @optional /** * 广告点击 * * @param launchAd launchAd * @param openURLString 打开页面地址 */ - (void)xhLaunchAd:(XHLaunchAd *)launchAd clickAndOpenURLString:(NSString *)openURLString; /** * 图片本地读取/或下载完成回调 * * @param launchAd XHLaunchAd * @param image image */ -(void)xhLaunchAd:(XHLaunchAd *)launchAd imageDownLoadFinish:(UIImage *)image; /** * video本地读取/或下载完成回调 * * @param launchAd XHLaunchAd * @param pathURL 本地保存路径 */ -(void)xhLaunchAd:(XHLaunchAd *)launchAd videoDownLoadFinish:(NSURL *)pathURL; /** 视频下载进度回调 @param launchAd XHLaunchAd @param progress 下载进度 @param total 总大小 @param current 当前已下载大小 */ -(void)xhLaunchAd:(XHLaunchAd *)launchAd videoDownLoadProgress:(float)progress total:(unsigned long long)total current:(unsigned long long)current; /** * 广告显示完成 */ -(void)xhLaunchShowFinish:(XHLaunchAd *)launchAd; /** * 倒计时回调 * * @param launchAd XHLaunchAd * @param duration 倒计时时间 */ -(void)xhLaunchAd:(XHLaunchAd *)launchAd customSkipView:(UIView *)customSkipView duration:(NSInteger)duration; /** 如果你想用SDWebImage等框架加载网络广告图片,请实现此代理 @param launchAd XHLaunchAd @param launchAdImageView launchAdImageView @param url 图片url */ -(void)xhLaunchAd:(XHLaunchAd *)launchAd launchAdImageView:(UIImageView *)launchAdImageView URL:(NSURL *)url; @end @interface XHLaunchAd : NSObject @property(nonatomic,assign) id<XHLaunchAdDelegate> delegate; /** * 设置等待数据源时间(default 3) * * @param waitDataDuration waitDataDuration */ +(void)setWaitDataDuration:(NSInteger )waitDataDuration; /** * 图片开屏广告数据配置 * * @param imageAdconfiguration 数据配置 * * @return XHLaunchAd */ +(XHLaunchAd *)imageAdWithImageAdConfiguration:(XHLaunchImageAdConfiguration *)imageAdconfiguration; /** * 图片开屏广告数据配置 * * @param imageAdconfiguration 数据配置 * @param delegate delegate * * @return XHLaunchAd */ +(XHLaunchAd *)imageAdWithImageAdConfiguration:(XHLaunchImageAdConfiguration *)imageAdconfiguration delegate:(nullable id)delegate; /** * 视频开屏广告数据配置 * * @param videoAdconfiguration 数据配置 * * @return XHLaunchAd */ +(XHLaunchAd *)videoAdWithVideoAdConfiguration:(XHLaunchVideoAdConfiguration *)videoAdconfiguration; /** * 视频开屏广告数据配置 * * @param videoAdconfiguration 数据配置 * @param delegate delegate * * @return XHLaunchAd */ +(XHLaunchAd *)videoAdWithVideoAdConfiguration:(XHLaunchVideoAdConfiguration *)videoAdconfiguration delegate:(nullable id)delegate; #pragma mark - 如果你需要提前下载并缓存广告图片或视频 请调用下面方法 /** * 批量下载并缓存image(异步) * * @param urlArray image URL Array */ +(void)downLoadImageAndCacheWithURLArray:(NSArray <NSURL *> * )urlArray; /** * 批量下载并缓存视频(异步) * * @param urlArray 视频URL Array */ +(void)downLoadVideoAndCacheWithURLArray:(NSArray <NSURL *> * )urlArray; #pragma mark - skipAction /** * 跳过按钮事件 */ +(void)skipAction; #pragma mark - 是否已缓存 /** * 是否已缓存在该图片 * * @param url image url * * @return BOOL */ +(BOOL)checkImageInCacheWithURL:(NSURL *)url; /** * 是否已缓存该视频 * * @param url video url * * @return BOOL */ +(BOOL)checkVideoInCacheWithURL:(NSURL *)url; #pragma mark - 缓存清除及大小 /** * 清除XHLaunch本地缓存 */ +(void)clearDiskCache; /** * 获取XHLaunch本地缓存大小(M) */ +(float)diskCacheSize; /** * 缓存路径 */ +(NSString *)xhLaunchAdCachePath; @end NS_ASSUME_NONNULL_END
/******************************************************************************/ /* Mednafen Fast SNES Emulation Module */ /******************************************************************************/ /* cpu.h: ** Copyright (C) 2015-2016 Mednafen Team ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License ** as published by the Free Software Foundation; either version 2 ** of the License, or (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software Foundation, Inc., ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __MDFN_SNES_FAUST_CPU_H #define __MDFN_SNES_FAUST_CPU_H namespace MDFN_IEN_SNES_FAUST { class CPU65816; typedef uint8 (MDFN_FASTCALL *readfunc)(uint32 A); typedef void (MDFN_FASTCALL *writefunc)(uint32 A, uint8 V); struct CPU_Misc { uint32 timestamp; uint32 next_event_ts; uint32 running_mask; enum { HALTED_NOT = 0, HALTED_WAI = 1, HALTED_STP = 2, HALTED_DMA = 3 }; uint8 halted; uint8 mdr; uint8 CombinedNIState; bool NMILineState; bool PrevNMILineState; readfunc ReadFuncs[256]; // A and B bus read handlers writefunc WriteFuncs[256]; // A and B bus write handlers readfunc ReadFuncsA[256]; // A-bus only read handlers writefunc WriteFuncsA[256]; // A-bus only write handlers // Direct, not through RWIndex. readfunc DM_ReadFuncsB[256]; writefunc DM_WriteFuncsB[256]; // +1 so we can avoid a masking for 16-bit reads/writes(note that this // may result in the address passed to the read/write handlers being // 0x1000000 instead of 0x000000 in some cases, so code with that in mind. uint8 RWIndex[256 * 65536 + 1]; INLINE uint8 ReadA(uint32 A) { uint8 ret = ReadFuncsA[RWIndex[A]](A); mdr = ret; return ret; } INLINE void WriteA(uint32 A, uint8 V) { mdr = V; WriteFuncsA[RWIndex[A]](A, V); } INLINE uint8 ReadB(uint8 A) { uint8 ret = DM_ReadFuncsB[A](A); mdr = ret; return ret; } INLINE void WriteB(uint8 A, uint8 V) { mdr = V; DM_WriteFuncsB[A](A, V); } // // // void RunDMA(void); void EventHandler(void); }; extern CPU_Misc CPUM; INLINE uint8 CPU_Read(uint32 A) { uint8 ret = CPUM.ReadFuncs[CPUM.RWIndex[A]](A); CPUM.mdr = ret; return ret; } INLINE void CPU_Write(uint32 A, uint8 V) { CPUM.mdr = V; CPUM.WriteFuncs[CPUM.RWIndex[A]](A, V); } INLINE void CPU_IO(void) { CPUM.timestamp += 6; } INLINE void CPU_SetIRQ(bool active) { CPUM.CombinedNIState &= ~0x04; CPUM.CombinedNIState |= active ? 0x04 : 0x00; } INLINE void CPU_SetNMI(bool active) { if((CPUM.NMILineState ^ active) & active) CPUM.CombinedNIState |= 0x01; CPUM.NMILineState = active; } void CPU_Init(void); void CPU_Reset(bool powering_up); void CPU_StateAction(StateMem* sm, const unsigned load, const bool data_only); void CPU_Run(void); INLINE void CPU_Exit(void) { CPUM.running_mask = 0; CPUM.next_event_ts = 0; } } #endif
/* * linux/arch/arm/mach-meson/include/mach/i2c.h */ #ifndef AML_MACH_I2C #define AML_MACH_I2C #include <mach/pinmux.h> #include <mach/am_regs.h> //#include <mach/regs.h> #if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON3 //#include <mach/ao_regs.h> #endif #define MESON_I2C_MASTER_A_START CBUS_REG_ADDR(I2C_M_0_CONTROL_REG) #define MESON_I2C_MASTER_A_END (CBUS_REG_ADDR(I2C_M_0_RDATA_REG1+1)-1) #define MESON_I2C_MASTER_B_START CBUS_REG_ADDR(I2C_M_1_CONTROL_REG) #define MESON_I2C_MASTER_B_END (CBUS_REG_ADDR(I2C_M_1_RDATA_REG1+1)-1) #define MESON_I2C_SLAVE_START CBUS_REG_ADDR(I2C_S_CONTROL_REG) #define MESON_I2C_SLAVE_END (CBUS_REG_ADDR(I2C_S_CNTL1_REG+1)-1) #define MESON_I2C_MASTER_AO_START AOBUS_REG_ADDR(AO_I2C_M_0_CONTROL_REG) #define MESON_I2C_MASTER_AO_END (AOBUS_REG_ADDR(AO_I2C_M_0_RDATA_REG1+1)-1) #define AML_I2C_MASTER_AO 0 #define AML_I2C_MASTER_A 1 #define AML_I2C_MASTER_B 2 #define AML_I2C_MASTER_C 3 #define AML_I2C_MASTER_D 4 #define AML_I2C_SLAVE_ADDR 0x6c #if 0 /*M1 i2c pinmux * I/O I2C_MASTER_A I2C_MASTER_B I2C_SLAVE * GPIO_JTAG_TMS SCK_A REG1[12] SCK_A REG1[13] * GPIO_JTAG_TDI SDA_A REG1[12] SDA_A REG1[13] * GPIO_JTAG_TCK SCK_B REG1[16] SCK_A REG1[17] * GPIO_JTAG_TDO SDA_B REG1[20] SDA_A REG1[21] * GPIOB_0 SCK_B REG2[5] SCK_A REG2[6] * GPIOB_1 SDA_B REG2[2] SDA_A REG2[3] * GPIOB_2 SCK_A REGS[13] SCK_A REG2[14] * GPIOB_3 SDA_A REG2[9] SDA_A REG2[10] * GPIOC_13 SCK_B REG3[28] SCK_A REG3[29] * GPIOC_14 SDA_B REG3[25] SDA_A REG3[26] * GPIOC_21 SCK_A REG7[9] SCK_A REG7[10] * GPIOC_22 SDA_A REG7[6] SDA_A REG7[7] * GPIOE_16 SCK_B REG5[27] SCK_A REG5[28] * GPIOE_17 SDA_B REG5[25] SDA_A REG5[26] */ /*i2c master a*/ #define MESON_I2C_MASTER_GPIOX_26_REG CBUS_REG_ADDR(PERIPHS_PIN_MUX_5) #define MESON_I2C_MASTER_GPIOX_26_BIT (1<<26) #define MESON_I2C_MASTER_GPIOX_25_REG CBUS_REG_ADDR(PERIPHS_PIN_MUX_5) #define MESON_I2C_MASTER_GPIOX_25_BIT (1<<27) #define MESON_I2C_MASTER_GPIOX_28_REG CBUS_REG_ADDR(PERIPHS_PIN_MUX_5) #define MESON_I2C_MASTER_GPIOX_28_BIT (1<<30) #define MESON_I2C_MASTER_GPIOX_27_REG CBUS_REG_ADDR(PERIPHS_PIN_MUX_5) #define MESON_I2C_MASTER_GPIOX_27_BIT (1<<31) #define MESON_I2C_MASTER_GPIOAO_4_REG AOBUS_REG_ADDR(AO_RTI_PIN_MUX_REG) #define MESON_I2C_MASTER_GPIOAO_4_BIT (1<<6) #define MESON_I2C_MASTER_GPIOAO_5_REG AOBUS_REG_ADDR(AO_RTI_PIN_MUX_REG) #define MESON_I2C_MASTER_GPIOAO_5_BIT (1<<5) #endif #define AML_I2C_SPPED_50K 50000 #define AML_I2C_SPPED_100K 100000 #define AML_I2C_SPPED_200K 200000 #define AML_I2C_SPPED_300K 300000 #define AML_I2C_SPPED_400K 400000 #if 0 struct aml_pinmux_reg_bit { unsigned int scl_reg; unsigned int scl_bit; unsigned int sda_reg; unsigned int sda_bit; }; #endif struct aml_i2c_platform{ unsigned int slave_addr;/*7bit addr*/ unsigned int wait_count;/*i2c wait ack timeout = wait_count * wait_ack_interval */ unsigned int wait_ack_interval; unsigned int wait_read_interval; unsigned int wait_xfer_interval; unsigned int master_no; unsigned int master_i2c_speed; unsigned int master_i2c_speed2;/*the same adapter, different speed*/ /*reserved*/ unsigned int use_pio;/*0: hardware i2c, 1: manual pio i2c*/ #if 0 struct aml_pinmux_reg_bit master_a_pinmux; struct aml_pinmux_reg_bit master_b_pinmux; struct aml_pinmux_reg_bit master_pinmux; #endif pinmux_set_t master_pinmux; pinmux_set_t master_a_pinmux; pinmux_set_t master_b_pinmux; const char *master_state_name; struct list_head list; }; /**************i2c software gpio***************/ #define MESON_I2C_PREG_GPIOC_OE CBUS_REG_ADDR(PREG_FGPIO_EN_N) #define MESON_I2C_PREG_GPIOC_OUTLVL CBUS_REG_ADDR(PREG_FGPIO_O) #define MESON_I2C_PREG_GPIOC_INLVL CBUS_REG_ADDR(PREG_FGPIO_I) #define MESON_I2C_PREG_GPIOE_OE CBUS_REG_ADDR(PREG_HGPIO_EN_N) #define MESON_I2C_PREG_GPIOE_OUTLVL CBUS_REG_ADDR(PREG_HGPIO_O) #define MESON_I2C_PREG_GPIOE_INLVL CBUS_REG_ADDR(PREG_HGPIO_I) #define MESON_I2C_PREG_GPIOA_OE CBUS_REG_ADDR(PREG_EGPIO_EN_N) #define MESON_I2C_PREG_GPIOA_OUTLVL CBUS_REG_ADDR(PREG_EGPIO_O) #define MESON_I2C_PREG_GPIOA_INLVL CBUS_REG_ADDR(PREG_EGPIO_I) struct aml_sw_i2c_pins { unsigned int scl_reg_out; unsigned int scl_reg_in; unsigned int scl_bit; unsigned int scl_oe; unsigned int sda_reg_out; unsigned int sda_reg_in; unsigned int sda_bit; unsigned int sda_oe; }; struct aml_sw_i2c_platform { struct aml_sw_i2c_pins sw_pins; /* local settings */ int udelay; /* half clock cycle time in us, minimum 2 us for fast-mode I2C, minimum 5 us for standard-mode I2C and SMBus, maximum 50 us for SMBus */ int timeout; /* in jiffies */ }; #endif
/*--------------------------------------------------------------------*/ /*--- A mapping where the keys exactly cover the address space. ---*/ /*--- pub_tool_rangemap.h ---*/ /*--------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. Copyright (C) 2014-2014 Mozilla Foundation 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. The GNU General Public License is contained in the file COPYING. */ /* Contributed by Julian Seward <jseward@acm.org> */ #ifndef __PUB_TOOL_RANGEMAP_H #define __PUB_TOOL_RANGEMAP_H //-------------------------------------------------------------------- // PURPOSE: a mapping from the host machine word (UWord) ranges to // arbitrary other UWord values. The set of ranges exactly covers all // possible UWord values. // -------------------------------------------------------------------- /* It's an abstract type. */ typedef struct _RangeMap RangeMap; /* Create a new RangeMap, using given allocation and free functions. alloc_fn must not return NULL (that is, if it returns it must have succeeded.) The new array will contain a single range covering the entire key space, which will be bound to the value |initialVal|. This function never returns NULL. */ RangeMap* VG_(newRangeMap) ( void*(*alloc_fn)(const HChar*,SizeT), const HChar* cc, void(*free_fn)(void*), UWord initialVal ); /* Free all memory associated with a RangeMap. */ void VG_(deleteRangeMap) ( RangeMap* ); /* Bind the range [key_min, key_max] to val, overwriting any other bindings existing in the range. Asserts if key_min > key_max. If as a result of this addition, there come to be multiple adjacent ranges with the same value, these ranges are merged together. Note that this is slow: O(N) in the number of existing ranges. */ void VG_(bindRangeMap) ( RangeMap* rm, UWord key_min, UWord key_max, UWord val ); /* Looks up |key| in the array and returns the associated value and the key bounds. Can never fail since the RangeMap covers the entire key space. This is fast: O(log N) in the number of ranges. */ void VG_(lookupRangeMap) ( /*OUT*/UWord* key_min, /*OUT*/UWord* key_max, /*OUT*/UWord* val, const RangeMap* rm, UWord key ); /* How many elements are there in the map? */ UInt VG_(sizeRangeMap) ( const RangeMap* rm ); /* Get the i'th component */ void VG_(indexRangeMap) ( /*OUT*/UWord* key_min, /*OUT*/UWord* key_max, /*OUT*/UWord* val, const RangeMap* rm, Word ix ); #endif // __PUB_TOOL_RANGEMAP_H /*--------------------------------------------------------------------*/ /*--- end pub_tool_rangemap.h ---*/ /*--------------------------------------------------------------------*/
/* * Copyright (C) 2010 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 StylePendingImage_h #define StylePendingImage_h #include "CSSCursorImageValue.h" #include "CSSImageGeneratorValue.h" #include "CSSImageValue.h" #include "StyleImage.h" #if ENABLE(CSS_IMAGE_SET) #include "CSSImageSetValue.h" #endif namespace WebCore { // StylePendingImage is a placeholder StyleImage that is entered into the RenderStyle during // style resolution, in order to avoid loading images that are not referenced by the final style. // They should never exist in a RenderStyle after it has been returned from the style selector. class StylePendingImage final : public StyleImage { public: static Ref<StylePendingImage> create(CSSValue* value) { return adoptRef(*new StylePendingImage(value)); } CSSImageValue* cssImageValue() const { return is<CSSImageValue>(m_value) ? downcast<CSSImageValue>(m_value) : nullptr; } CSSImageGeneratorValue* cssImageGeneratorValue() const { return is<CSSImageGeneratorValue>(m_value) ? static_cast<CSSImageGeneratorValue*>(m_value) : nullptr; } CSSCursorImageValue* cssCursorImageValue() const { return is<CSSCursorImageValue>(m_value) ? downcast<CSSCursorImageValue>(m_value) : nullptr; } #if ENABLE(CSS_IMAGE_SET) CSSImageSetValue* cssImageSetValue() const { return is<CSSImageSetValue>(m_value) ? downcast<CSSImageSetValue>(m_value) : nullptr; } #endif void detachFromCSSValue() { m_value = nullptr; } private: virtual WrappedImagePtr data() const override { return const_cast<StylePendingImage*>(this); } virtual PassRefPtr<CSSValue> cssValue() const override { return m_value; } virtual FloatSize imageSize(const RenderElement*, float /*multiplier*/) const override { return FloatSize(); } virtual bool imageHasRelativeWidth() const override { return false; } virtual bool imageHasRelativeHeight() const override { return false; } virtual void computeIntrinsicDimensions(const RenderElement*, Length& /* intrinsicWidth */ , Length& /* intrinsicHeight */, FloatSize& /* intrinsicRatio */) override { } virtual bool usesImageContainerSize() const override { return false; } virtual void setContainerSizeForRenderer(const RenderElement*, const FloatSize&, float) override { } virtual void addClient(RenderElement*) override { } virtual void removeClient(RenderElement*) override { } virtual RefPtr<Image> image(RenderElement*, const FloatSize&) const override { ASSERT_NOT_REACHED(); return nullptr; } virtual bool knownToBeOpaque(const RenderElement*) const override { return false; } StylePendingImage(CSSValue* value) : m_value(value) { m_isPendingImage = true; } CSSValue* m_value; // Not retained; it owns us. }; } // namespace WebCore SPECIALIZE_TYPE_TRAITS_STYLE_IMAGE(StylePendingImage, isPendingImage) #endif // StylePendingImage_h
//http://www.nayuki.io/page/fast-fibonacci-algorithms //cc -o fibonacci2 fibonacci2.c #include <stdio.h> #include <stdlib.h> #include <time.h> #define TAM 40 int main(){ int fib[TAM]; fib[0]=0; fib[1]=1; int i; clock_t t; t = clock(); for(i = 2; i < TAM; i++) fib[i] = fib[i-1] + fib[i-2]; printf ("%f time \n",t,((float)t)/CLOCKS_PER_SEC); printf("%d\n",fib[TAM-1]); return 0; }
/* This file is part of the KDE project * Copyright (C) 2007-2008 Jan Hambrecht <jaham@gmx.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KARBONGRADIENTTOOL_H #define KARBONGRADIENTTOOL_H #include <KoToolBase.h> #include <KoSnapGuide.h> #include <QtGui/QGradient> #include <QtCore/QMultiMap> class GradientStrategy; class KarbonGradientEditWidget; class QUndoCommand; class KoShape; class QTableWidgetItem; class KoResource; /** * A tool for editing gradient backgrounds of shapes. * The gradients can be edited by moving gradient * handles directly on the canvas. */ class KarbonGradientTool : public KoToolBase { Q_OBJECT public: explicit KarbonGradientTool(KoCanvasBase *canvas); ~KarbonGradientTool(); virtual void paint(QPainter &painter, const KoViewConverter &converter); virtual void repaintDecorations(); virtual void mousePressEvent(KoPointerEvent *event) ; virtual void mouseMoveEvent(KoPointerEvent *event); virtual void mouseReleaseEvent(KoPointerEvent *event); virtual void mouseDoubleClickEvent(KoPointerEvent *event); virtual void keyPressEvent(QKeyEvent *event); virtual void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes); virtual void deactivate(); protected: /// reimplemented from KoToolBase virtual QWidget * createOptionWidget(); /// reimplemented from KoToolBase virtual QMap<QString, QWidget *> createOptionWidgets(); private Q_SLOTS: virtual void resourceChanged(int key, const QVariant & res); void initialize(); void gradientChanged(); void gradientSelected(KoResource*); private: QGradient * m_gradient; QMultiMap<KoShape*, GradientStrategy*> m_strategies; ///< the list of gradient strategies GradientStrategy * m_currentStrategy; ///< the current editing strategy GradientStrategy * m_hoverStrategy; ///< the strategy the mouse hovers over KarbonGradientEditWidget * m_gradientWidget; QUndoCommand * m_currentCmd; KoSnapGuide::Strategies m_oldSnapStrategies; ///< the previously enables snap strategies }; #endif // KARBONGRADIENTTOOL_H
/************************************************************************************************** Filename: ipd.h Revised: $Date: 2012-04-02 17:02:19 -0700 (Mon, 02 Apr 2012) $ Revision: $Revision: 29996 $ Description: Header file for the IPD functionality Copyright 2009-2011 Texas Instruments Incorporated. All rights reserved. IMPORTANT: Your use of this Software is limited to those specific rights granted under the terms of a software license agreement between the user who downloaded the software, his/her employer (which must be your employer) and Texas Instruments Incorporated (the "License"). You may not use this Software unless you agree to abide by the terms of the License. The License limits your use, and you acknowledge, that the Software may not be modified, copied or distributed unless embedded on a Texas Instruments microcontroller or used solely and exclusively in conjunction with a Texas Instruments radio frequency transceiver, which is integrated into your product. Other than for the foregoing purpose, you may not use, reproduce, copy, prepare derivative works of, modify, distribute, perform, display or sell this Software and/or its documentation for any purpose. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. Should you have any questions regarding your right to use this Software, contact Texas Instruments Incorporated at www.TI.com. **************************************************************************************************/ #ifndef IPD_H #define IPD_H #ifdef __cplusplus extern "C" { #endif /********************************************************************* * INCLUDES */ #include "zcl.h" /********************************************************************* * CONSTANTS */ #define IPD_ENDPOINT 0x09 #define IPD_MAX_ATTRIBUTES 13 #define IPD_MAX_OPTIONS 5 #define IPD_UPDATE_TIME_PERIOD 1000 // Update time event in msec #define IPD_GET_PRICING_INFO_PERIOD 5000 // Interval for get pricing info command #define SE_DEVICE_POLL_RATE 8000 // Poll rate for SE end device // Application Events #define IPD_IDENTIFY_TIMEOUT_EVT 0x0001 #define IPD_UPDATE_TIME_EVT 0x0002 #define IPD_KEY_ESTABLISHMENT_REQUEST_EVT 0x0004 #define IPD_GET_PRICING_INFO_EVT 0x0008 /********************************************************************* * MACROS */ /********************************************************************* * TYPEDEFS */ /********************************************************************* * VARIABLES */ extern SimpleDescriptionFormat_t ipdSimpleDesc; extern CONST zclAttrRec_t ipdAttrs[]; extern zclOptionRec_t ipdOptions[]; extern uint8 ipdDeviceEnabled; extern uint16 ipdTransitionTime; extern uint16 ipdIdentifyTime; extern uint32 ipdTime; /********************************************************************* * FUNCTIONS */ /* * Initialization for the task */ extern void ipd_Init( uint8 task_id ); /* * Event Process for the task */ extern uint16 ipd_event_loop( uint8 task_id, uint16 events ); /********************************************************************* *********************************************************************/ #ifdef __cplusplus } #endif #endif /* IPD_H */
/* * SL_LinAlgWarper.h * * Created on: 2010-11-15 * Author: Danping Zou * E-mail: dannis.zou@gmail.com */ #ifndef SL_LINALGWARPER_H_ #define SL_LINALGWARPER_H_ #include "math/SL_LinAlg.h" #include "math/SL_Matrix.h" inline void matScale(Mat_d& A, double scale) { matScale(A.rows, A.cols, A.data, scale, A.data); } inline void matAddScale(Mat_d& A, double val) { matAddScale(A.rows, A.cols, A.data, val); } inline void matTrans(const Mat_d& A, Mat_d& AT) { AT.resize(A.n, A.m); matTrans(A.m, A.n, A.data, AT.data); } inline void matAB(const Mat_d& A, const Mat_d& B, Mat_d& C) { C.resize(A.rows, B.cols); matAB(A.rows, A.cols, B.rows, B.cols, A.data, B.data, C.data); } inline void matATB(const Mat_d& A, const Mat_d& B, Mat_d& C) { C.resize(A.cols, B.cols); matATB(A.rows, A.cols, B.rows, B.cols, A.data, B.data, C.data); } inline void matAx(const Mat_d& A, const Mat_d& x, Mat_d& y) { assert(x.m == A.n && x.n == 1); y.resize(A.m, 1); matAxpy(A.m, A.n, 1.0, A.data, x.data, 0, 0, y.data); } inline void matAx(int m, int n, const double* A, const double* x, double* y) { matAxpy(m, n, 1.0, A, x, 0, 0, y); } inline void matQR(const Mat_d& A, Mat_d& Q, Mat_d& R) { assert(A.m > 0 && A.n > 0); Q.resize(A.m, A.m); Q.fill(0); R.resize(A.m, A.n); R.fill(0); dgeqrFor(A.m, A.n, A.data, Q.data, R.data); } #endif /* SL_LINALGWARPER_H_ */
/* * Copyright (c) 2014 Somsubhra Bairi <somsubhra.bairi@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software */ #ifndef PROPERTYREADER_H #define PROPERTYREADER_H // Qt includes #include <QObject> class PropertyReader : public QObject { Q_OBJECT public: explicit PropertyReader(QObject *parent = 0); void readProperties(QString propFile); QString appVersion(); QString appName(); QString appDesc(); QString authorName(); QString authorEmail(); int windowMaxWidth(); int windowMaxHeight(); int windowMinWidth(); int windowMinHeight(); int windowFixedWidth(); int windowFixedHeight(); bool windowMaximized(); bool windowHideTitleBar(); // Getters for the flags bool isAppVersionSet(); bool isAppNameSet(); bool isAppDescSet(); bool isAuthorNameSet(); bool isAuthorEmailSet(); bool isWindowMaxWidthSet(); bool isWindowMaxHeightSet(); bool isWindowMinWidthSet(); bool isWindowMinHeightSet(); bool isWindowFixedWidthSet(); bool isWindowFixedHeightSet(); bool isWindowMaximizedSet(); bool isWindowHideTitleBarSet(); private: QString _appVersion; QString _appName; QString _appDesc; QString _authorName; QString _authorEmail; int _winMaxWidth; int _winMaxHeight; int _winMinWidth; int _winMinHeight; int _winFixedWidth; int _winFixedHeight; bool _winMaximized; bool _winHideTitleBar; // Set/Unset Flags bool _isAppVersionSet; bool _isAppNameSet; bool _isAppDescSet; bool _isAuthorNameSet; bool _isAuthorEmailSet; bool _isWinMaxWidthSet; bool _isWinMaxHeightSet; bool _isWinMinWidthSet; bool _isWinMinHeightSet; bool _isWinFixedWidthSet; bool _isWinFixedHeightSet; bool _isWinMaximizedSet; bool _isWinHideTitleBarSet; signals: public slots: }; #endif // PROPERTYREADER_H
/*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * copyright (C) 2002-2008 * * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * ***************************************************************************/ #ifndef SELECTOPDLG_H #define SELECTOPDLG_H #include "classifier.h" #include <kdialog.h> class UMLView; class KComboBox; class KLineEdit; class QGroupBox; class QLabel; class QRadioButton; /** * A dialog used to select an operation. * * @short A dialog to select an operation. * @author Paul Hensgen <phensgen@techie.com> * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ class SelectOpDlg : public KDialog { Q_OBJECT public: /** * Constructs a SelectOpDlg instance. * * @param parent The parent to this instance. * @param c The concept to get the operations from. */ SelectOpDlg(UMLView * parent, UMLClassifier * c); /** * Standard deconstructor. */ ~SelectOpDlg(); QString getOpText(); bool isClassOp() const; QString getSeqNumber(); void setSeqNumber(const QString &num); void setCustomOp(const QString &op); bool setClassOp(const QString &op); protected: void insertOperation( const QString& type, int index = -1 ); private: static const int OP = 0; static const int CUSTOM = 1; QGroupBox * m_pOpGB; KComboBox * m_pOpCB; QLabel * m_pSeqL; KLineEdit * m_pOpLE, * m_pSeqLE; QRadioButton * m_pCustomRB, * m_pOpRB; QString m_Text; int m_nOpCount; int m_id; ///< takes on the value OP or CUSTOM according to what the user selected UMLView *m_pView; public slots: void slotSelectedOp(); void slotSelectedCustom(); }; #endif
/* * varcpuload: Simple tool to create reproducable artifical sustained load on * a machine. * * Copyright (C) 2008-2012 Red Hat, Inc. * Authors: Phil Knirsch * * 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. * * Usage: varcpuload [-t time] [-n numcpu] [LOAD | MINLOAD MAXLOAD INCREASE] * LOAD, MINLOAD and MAXLOAD need to be between 1 and 100. * * To compile: * gcc -Wall -Os varcpuload.c -o varcpuload -lpthread * * To measure load: * 1st terminal: * for i in `seq 1 2 100`; do ./varcpuload -t 55 -n `/usr/bin/getconf _NPROCESSORS_ONLN` $i; done * or better * ./varcpuload -t 60 -n `/usr/bin/getconf _NPROCESSORS_ONLN` 1 100 2; done * 2nd terminal: * rm -f results; for i in `seq 1 2 100`; do powertop -d -t 60 >> results; done * * make sure the machine is otherwise idle, so start the machine initlevel 3 or even 1 * and stop every unecessary service. * */ #include <getopt.h> #include <sys/time.h> #include <pthread.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <ctype.h> #define handle_error_en(en, msg) \ do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) #define handle_error(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) #define ARRSIZE 512 int sleeptime = 0; int duration = 60; int load = 100; void usage() { fprintf(stderr, "Usage: varload [-t time] [-n numcpu] [LOAD | MINLOAD MAXLOAD INCREASE]\n"); fprintf(stderr, "LOAD, MINLOAD and MAXLOAD need to be between 1 and 100.\n"); } int worker(void) { int i, j; float array[ARRSIZE][ARRSIZE]; for (i = 0; i < ARRSIZE; i++) { for (j = 0; j < ARRSIZE; j++) { array[i][j] = (float)(i + j) / (float)(i + 1); } } return (int)array[1][1]; } int timeDiff(struct timeval *tv1, struct timeval *tv2) { return (tv2->tv_sec - tv1->tv_sec) * 1000000 + tv2->tv_usec - tv1->tv_usec; } int getWorkerTime() { int cnt, i; struct timeval tv1, tv2; cnt = 0; gettimeofday(&tv1, NULL); gettimeofday(&tv2, NULL); // Warmup of 1 sec while (1000000 > timeDiff(&tv1, &tv2)) { i = worker(); usleep(1); gettimeofday(&tv2, NULL); } gettimeofday(&tv1, NULL); gettimeofday(&tv2, NULL); // Meassure for 4 sec while (4*1000000 > timeDiff(&tv1, &tv2)) { i = worker(); usleep(0); gettimeofday(&tv2, NULL); cnt++; } return timeDiff(&tv1, &tv2)/cnt; } static void * runWorker(void *arg) { int i; struct timeval tv1, tv2; gettimeofday(&tv1, NULL); gettimeofday(&tv2, NULL); while (duration > timeDiff(&tv1, &tv2)) { i = worker(); usleep(sleeptime); gettimeofday(&tv2, NULL); } return NULL; } int main(int argc, char *argv[]) { int wtime, numcpu, opt, s, i; int minload, maxload, loadinc; pthread_attr_t attr; pthread_t *tid; void *res; numcpu = 1; while ((opt = getopt(argc, argv, "t:n:")) != -1) { switch (opt) { case 't': duration = atoi(optarg); break; case 'n': numcpu = atoi(optarg); break; default: /* '?' */ usage(); exit(EXIT_FAILURE); } } loadinc = 1; switch (argc - optind) { case 0: minload = 100; maxload = 100; break; case 1: minload = atoi(argv[optind]); maxload = minload; break; case 3: minload = atoi(argv[optind]); maxload = atoi(argv[optind + 1]); loadinc = atoi(argv[optind + 2]); break; default: /* '?' */ usage(); exit(EXIT_FAILURE); } if (minload < 1 || maxload < 1 || minload > 100 || maxload > 100) { usage(); exit(EXIT_FAILURE); } wtime = getWorkerTime(); duration *= 1000000; for (load = minload; load <= maxload; load += loadinc) { sleeptime = wtime * 100 / load - wtime; printf("Starting %d sec run with\n", duration / 1000000); printf("Load: %d\n", load); printf("Worker time: %d\n", wtime); printf("Sleep time: %d\n", sleeptime); printf("Nr. of CPUs to run on: %d\n", numcpu); s = pthread_attr_init(&attr); if (s != 0) handle_error_en(s, "pthread_attr_init"); tid = malloc(sizeof(pthread_t) * numcpu); if (tid == NULL) handle_error("malloc"); for (i = 0; i<numcpu; i++) { s = pthread_create(&tid[i], &attr, &runWorker, NULL); if (s != 0) handle_error_en(s, "pthread_create"); } s = pthread_attr_destroy(&attr); if (s != 0) handle_error_en(s, "pthread_attr_destroy"); for (i = 0; i < numcpu; i++) { s = pthread_join(tid[i], &res); if (s != 0) handle_error_en(s, "pthread_join"); } free(tid); } exit(EXIT_SUCCESS); }
/* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org */ #include <tommath.h> /* this function is less generic than mp_n_root, simpler and faster */ int mp_sqrt(mp_int *arg, mp_int *ret) { int res; mp_int t1,t2; /* must be positive */ if (arg->sign == MP_NEG) { return MP_VAL; } /* easy out */ if (mp_iszero(arg) == MP_YES) { mp_zero(ret); return MP_OKAY; } if ((res = mp_init_copy(&t1, arg)) != MP_OKAY) { return res; } if ((res = mp_init(&t2)) != MP_OKAY) { goto E2; } /* First approx. (not very bad for large arg) */ mp_rshd (&t1,t1.used/2); /* t1 > 0 */ if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) { goto E1; } if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) { goto E1; } if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) { goto E1; } /* And now t1 > sqrt(arg) */ do { if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) { goto E1; } if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) { goto E1; } if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) { goto E1; } /* t1 >= sqrt(arg) >= t2 at this point */ } while (mp_cmp_mag(&t1,&t2) == MP_GT); mp_exch(&t1,ret); E1: mp_clear(&t2); E2: mp_clear(&t1); return res; }
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) Linux Test Project, 2003-2021 * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz> * Copyright (c) International Business Machines Corp., 2001 * 07/2001 Ported by Wayne Boyer */ /*\ * [Description] * * Verify that fchown(2) invoked by super-user: * - clears setuid and setgid bits set on an executable file * - preserves setgid bit set on a non-group-executable file */ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include "tst_test.h" #include "compat_tst_16.h" #include "tst_safe_macros.h" #define FILE_MODE (S_IFREG|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) #define NEW_PERMS1 (S_IFREG|S_IRWXU|S_IRWXG|S_ISUID|S_ISGID) #define NEW_PERMS2 (S_IFREG|S_IRWXU|S_ISGID) #define EXP_PERMS (S_IFREG|S_IRWXU|S_IRWXG) #define TESTFILE1 "testfile1" #define TESTFILE2 "testfile2" static int fd1, fd2; struct test_case_t { int *fd; const char *filename; mode_t set_mode; mode_t exp_mode; } tc[] = { {&fd1, TESTFILE1, NEW_PERMS1, EXP_PERMS}, {&fd2, TESTFILE2, NEW_PERMS2, NEW_PERMS2} }; static void run(unsigned int i) { struct stat stat_buf; uid_t uid; gid_t gid; UID16_CHECK((uid = geteuid()), "fchown"); GID16_CHECK((gid = getegid()), "fchown"); SAFE_CHMOD(tc[i].filename, tc[i].set_mode); TST_EXP_PASS(FCHOWN(*tc[i].fd, uid, gid), "fchown(%i, %i, %i)", *tc[i].fd, uid, gid); SAFE_STAT(tc[i].filename, &stat_buf); if (stat_buf.st_uid != uid || stat_buf.st_gid != gid) tst_res(TFAIL, "%s: owner set to (uid=%d, gid=%d), expected (uid=%d, gid=%d)", tc[i].filename, stat_buf.st_uid, stat_buf.st_gid, uid, gid); if (stat_buf.st_mode != tc[i].exp_mode) tst_res(TFAIL, "%s: wrong mode permissions %#o, expected %#o", tc[i].filename, stat_buf.st_mode, tc[i].exp_mode); } static void setup(void) { unsigned int i; for (i = 0; i < ARRAY_SIZE(tc); i++) *tc[i].fd = SAFE_OPEN(tc[i].filename, O_RDWR | O_CREAT, FILE_MODE); } static void cleanup(void) { unsigned int i; for (i = 0; i < ARRAY_SIZE(tc); i++) { if (*tc[i].fd > 0) SAFE_CLOSE(*tc[i].fd); } } static struct tst_test test = { .tcnt = ARRAY_SIZE(tc), .needs_root = 1, .needs_tmpdir = 1, .setup = setup, .cleanup = cleanup, .test = run, };
/* This file is part of Warzone 2100. Copyright (C) 1999-2004 Eidos Interactive Copyright (C) 2005-2009 Warzone Resurrection Project Warzone 2100 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. Warzone 2100 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 Warzone 2100; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * ScriptExtern.c * * All game variable access functions for the scripts * */ #include "lib/framework/frame.h" #include "map.h" #include "lib/script/script.h" #include "lib/netplay/netplay.h" #include "scripttabs.h" #include "scriptextern.h" #include "display.h" #include "multiplay.h" #include "main.h" #include "hci.h" #include "lib/gamelib/gtime.h" // current game level SDWORD scrGameLevel = 0; // whether the tutorial is active BOOL bInTutorial = false; // whether any additional special case victory/failure conditions have been met BOOL bExtraVictoryFlag = false; BOOL bExtraFailFlag = false; // whether or not to track the player's transporter as it comes // into an offworld mission. BOOL bTrackTransporter = false; // reset the script externals for a new level void scrExternReset(void) { scrGameLevel = 0; bInTutorial = false; bExtraVictoryFlag = false; bExtraFailFlag = false; } // General function to get some basic game values BOOL scrGenExternGet(UDWORD index) { INTERP_TYPE type; INTERP_VAL scrFunctionResult; //function return value to be pushed to stack switch (index) { case EXTID_TRACKTRANSPORTER: type = VAL_BOOL; scrFunctionResult.v.bval = bTrackTransporter; break; case EXTID_MAPWIDTH: type = VAL_INT; scrFunctionResult.v.ival = mapWidth; break; case EXTID_MAPHEIGHT: type = VAL_INT; scrFunctionResult.v.ival = mapHeight; break; case EXTID_GAMEINIT: type = VAL_BOOL; scrFunctionResult.v.bval = gameInitialised; break; case EXTID_SELECTEDPLAYER: type = VAL_INT; scrFunctionResult.v.ival = selectedPlayer; break; case EXTID_GAMELEVEL: type = VAL_INT; scrFunctionResult.v.ival = scrGameLevel; break; case EXTID_GAMETIME: type = VAL_INT; scrFunctionResult.v.ival = (SDWORD)(gameTime/SCR_TICKRATE); break; case EXTID_TUTORIAL: type = VAL_BOOL; scrFunctionResult.v.bval = bInTutorial; break; case EXTID_CURSOR: type = VAL_INT; scrFunctionResult.v.ival = 0; // FIXME Set to 0 since function returned undef value break; case EXTID_INTMODE: type=VAL_INT; scrFunctionResult.v.ival=intMode; break; case EXTID_TARGETTYPE: type=VAL_INT; scrFunctionResult.v.ival=getTargetType(); break; case EXTID_EXTRAVICTORYFLAG: type=VAL_BOOL; scrFunctionResult.v.bval=bExtraVictoryFlag; break; case EXTID_EXTRAFAILFLAG: type=VAL_BOOL; scrFunctionResult.v.bval=bExtraFailFlag; break; case EXTID_MULTIGAMETYPE: // multiplayer variable.. type = VAL_INT; scrFunctionResult.v.ival = game.type; break; case EXTID_MULTIGAMEHUMANMAX: // multiplayer variable.. type = VAL_INT; scrFunctionResult.v.ival = game.maxPlayers; break; case EXTID_MULTIGAMEBASETYPE: type = VAL_INT; scrFunctionResult.v.ival = game.base; break; case EXTID_MULTIGAMEALLIANCESTYPE: type = VAL_INT; scrFunctionResult.v.ival = game.alliance; break; default: ASSERT( false, "scrGenExternGet: unknown variable index" ); return false; break; } if (!stackPushResult(type, &scrFunctionResult)) { return false; } return true; } // General function to set some basic game values BOOL scrGenExternSet(UDWORD index) { INTERP_VAL sVal; INTERP_TYPE type; SDWORD val; // Get the value and store it in type,val if (!stackPop(&sVal)) { return false; } type = sVal.type; val = sVal.v.ival; switch (index) { case EXTID_GAMELEVEL: if (type != VAL_INT) { ASSERT( false,"invalid type for gameLevel" ); return false; } scrGameLevel = val; break; case EXTID_TUTORIAL: if (type != VAL_BOOL) { ASSERT( false,"invalid type for inTutorial" ); return false; } bInTutorial = val; if (val) { // Since tutorial is skirmish NetPlay.players[0].allocated = true; debug(LOG_ERROR, "tutorial turned %s", val ? "on" : "off"); } break; case EXTID_EXTRAVICTORYFLAG: if (type != VAL_BOOL) { ASSERT( false,"invalid type for extraVictoryFlag" ); return false; } bExtraVictoryFlag = val; break; case EXTID_EXTRAFAILFLAG: if (type != VAL_BOOL) { ASSERT( false,"invalid type for extraFailFlag" ); return false; } bExtraFailFlag = val; break; default: ASSERT( false, "scrGenExternSet: unknown variable index" ); return false; break; } return true; }
// FrictionSolver.h // // Breannan Smith // Last updated: 09/03/2015 #ifndef FRICTION_SOLVER_H #define FRICTION_SOLVER_H #include <memory> #include "scisim/Math/MathDefines.h" class Constraint; class FlowableSystem; class FrictionSolver { public: virtual ~FrictionSolver() = 0; virtual void solve( const unsigned iteration, const scalar& dt, const FlowableSystem& fsys, const SparseMatrixsc& M, const SparseMatrixsc& Minv, const VectorXs& CoR, const VectorXs& mu, const VectorXs& q0, const VectorXs& v0, std::vector<std::unique_ptr<Constraint>>& active_set, const MatrixXXsc& contact_bases, const unsigned max_iters, const scalar& tol, VectorXs& f, VectorXs& alpha, VectorXs& beta, VectorXs& v2, bool& solve_succeeded, scalar& error ) = 0; virtual unsigned numFrictionImpulsesPerNormal( const unsigned ambient_space_dimensions ) const = 0; virtual void serialize( std::ostream& output_stream ) const = 0; virtual std::string name() const = 0; }; #endif
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef BACKEND_AMIGAOS_DIALOGS_H #define BACKEND_AMIGAOS_DIALOGS_H #if defined(__amigaos4__) && defined(USE_SYSDIALOGS) #include "common/dialogs.h" #include "common/fs.h" class AmigaOSDialogManager : public Common::DialogManager { public: virtual DialogResult showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser); }; #endif #endif // BACKEND_AMIGAOS_DIALOGS_H
#define source_width 32 #define source_height 32 #define source_x_hot 1 #define source_y_hot 8 static unsigned char source_bits[] = { 0x00, 0x00, 0x18, 0x07, 0x00, 0x00, 0xa6, 0x0c, 0x00, 0x00, 0x6b, 0x78, 0x00, 0x80, 0x21, 0x48, 0x00, 0x80, 0x34, 0x88, 0x00, 0xc0, 0x10, 0x84, 0x00, 0x40, 0x0a, 0x82, 0x00, 0x60, 0x09, 0x81, 0x0c, 0x20, 0x85, 0x40, 0x18, 0x90, 0x44, 0x40, 0x63, 0x10, 0x22, 0x20, 0x46, 0x10, 0x11, 0x18, 0xdc, 0x20, 0x09, 0x06, 0x30, 0x43, 0xc5, 0x03, 0x0c, 0xf4, 0x7f, 0x00, 0x14, 0xf8, 0xfc, 0x00, 0x32, 0xe8, 0x39, 0x03, 0x01, 0xc8, 0x71, 0x07, 0x81, 0xc8, 0x73, 0x3e, 0x41, 0xc8, 0x73, 0x36, 0x62, 0xc8, 0x73, 0x66, 0x3c, 0xc4, 0x71, 0xe6, 0xc0, 0xe3, 0x79, 0xe6, 0x00, 0xfe, 0x78, 0xf6, 0x00, 0xfe, 0x3c, 0x7e, 0x00, 0xfc, 0xbf, 0x3f, 0x00, 0xfc, 0xff, 0x03, 0x00, 0xcc, 0xff, 0x00, 0x00, 0x08, 0x8c, 0x03, 0x00, 0x18, 0x0c, 0x0e, 0x00, 0x30, 0x38, 0x38, 0x00, 0x60, 0x60, 0x00};
class srumbler_state : public driver_device { public: srumbler_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) { } UINT8 *m_backgroundram; UINT8 *m_foregroundram; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; int m_scroll[4]; }; /*----------- defined in video/srumbler.c -----------*/ WRITE8_HANDLER( srumbler_background_w ); WRITE8_HANDLER( srumbler_foreground_w ); WRITE8_HANDLER( srumbler_scroll_w ); WRITE8_HANDLER( srumbler_4009_w ); VIDEO_START( srumbler ); SCREEN_UPDATE( srumbler ); SCREEN_EOF( srumbler );
/* * Copyright (c) 2007 Boudewijn Rempt <boud@valdyas.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KIS_NODE_MODEL #define KIS_NODE_MODEL #include <KoDocumentSectionModel.h> #include "krita_export.h" #include <kis_types.h> /** * KisNodeModel offers a Qt model-view compatible view on the node * hierarchy. * * Note that there's a discrepancy between the krita node tree model * and the model Qt wants to see: we hide the root node from Qt. * * The node model shows an inverse view on the layer tree: we want the * first layer to show up at the bottom. */ class KRITAUI_EXPORT KisNodeModel : public KoDocumentSectionModel { Q_OBJECT public: // from QAbstractItemModel KisNodeModel(QObject * parent); ~KisNodeModel(); void setImage(KisImageWSP image); KisNodeSP nodeFromIndex(const QModelIndex &index); vKisNodeSP nodesFromIndexes(const QModelIndexList &list); virtual QModelIndex indexFromNode(const KisNodeSP node) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex parent(const QModelIndex &index) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); virtual QStringList mimeTypes() const; QMimeData * mimeData(const QModelIndexList & indexes) const; virtual bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent); virtual Qt::DropActions supportedDragActions() const; virtual Qt::DropActions supportedDropActions() const; signals: void nodeActivated(KisNodeSP); void requestAddNode(KisNodeSP node, KisNodeSP activeNode); void requestAddNode(KisNodeSP node, KisNodeSP parent, int index); void requestMoveNode(KisNodeSP node, KisNodeSP activeNode); void requestMoveNode(KisNodeSP node, KisNodeSP parent, int index); private slots: void beginInsertNodes(KisNode * parent, int index); void endInsertNodes(KisNode * parent, int index); void beginRemoveNodes(KisNode * parent, int index); void endRemoveNodes(KisNode * parent, int index); void updateSettings(); void progressPercentageChanged(int, const KisNodeSP); void layersChanged(); void nodeChanged(KisNode * node); void updateNodes(); private: class Private; Private * const m_d; }; #endif
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // Mono.Security.PKCS7/ContentInfo struct ContentInfo_t638; // System.Byte[] struct ByteU5BU5D_t104; #include "mscorlib_System_Object.h" // Mono.Security.PKCS7/EncryptedData struct EncryptedData_t639 : public Object_t { // System.Byte Mono.Security.PKCS7/EncryptedData::_version uint8_t ____version_0; // Mono.Security.PKCS7/ContentInfo Mono.Security.PKCS7/EncryptedData::_content ContentInfo_t638 * ____content_1; // Mono.Security.PKCS7/ContentInfo Mono.Security.PKCS7/EncryptedData::_encryptionAlgorithm ContentInfo_t638 * ____encryptionAlgorithm_2; // System.Byte[] Mono.Security.PKCS7/EncryptedData::_encrypted ByteU5BU5D_t104* ____encrypted_3; };
/* Copyright (C) 2007 Paul Davis 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_resampled_source_h__ #define __ardour_resampled_source_h__ #include <samplerate.h> #include "ardour/types.h" #include "ardour/importable_source.h" namespace ARDOUR { class ResampledImportableSource : public ImportableSource { public: ResampledImportableSource (boost::shared_ptr<ImportableSource>, framecnt_t rate, SrcQuality); ~ResampledImportableSource (); framecnt_t read (Sample* buffer, framecnt_t nframes); float ratio() const { return src_data.src_ratio; } uint32_t channels() const { return source->channels(); } framecnt_t length() const { return source->length(); } framecnt_t samplerate() const { return source->samplerate(); } void seek (framepos_t); framepos_t natural_position() const; bool clamped_at_unity () const { /* resampling may generate inter-sample peaks with magnitude > 1 */ return false; } static const uint32_t blocksize; private: boost::shared_ptr<ImportableSource> source; float* input; int _src_type; SRC_STATE* src_state; SRC_DATA src_data; }; } #endif /* __ardour_resampled_source_h__ */
/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2014-2018 Broadcom * All rights reserved. */ #include <inttypes.h> #include <rte_cycles.h> #include <rte_malloc.h> #include "bnxt.h" #include "bnxt_irq.h" #include "bnxt_ring.h" #include "hsi_struct_def_dpdk.h" /* * Interrupts */ void bnxt_int_handler(void *param) { struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param; struct bnxt *bp = eth_dev->data->dev_private; struct bnxt_cp_ring_info *cpr = bp->async_cp_ring; struct cmpl_base *cmp; uint32_t raw_cons; uint32_t cons; if (cpr == NULL) return; raw_cons = cpr->cp_raw_cons; pthread_mutex_lock(&bp->def_cp_lock); while (1) { if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.doorbell) { pthread_mutex_unlock(&bp->def_cp_lock); return; } if (is_bnxt_in_error(bp)) { pthread_mutex_unlock(&bp->def_cp_lock); return; } cons = RING_CMP(cpr->cp_ring_struct, raw_cons); cmp = &cpr->cp_desc_ring[cons]; if (!CMP_VALID(cmp, raw_cons, cpr->cp_ring_struct)) break; bnxt_event_hwrm_resp_handler(bp, cmp); raw_cons = NEXT_RAW_CMP(raw_cons); } cpr->cp_raw_cons = raw_cons; if (BNXT_HAS_NQ(bp)) bnxt_db_nq_arm(cpr); else B_CP_DB_REARM(cpr, cpr->cp_raw_cons); pthread_mutex_unlock(&bp->def_cp_lock); } int bnxt_free_int(struct bnxt *bp) { struct rte_intr_handle *intr_handle = &bp->pdev->intr_handle; struct bnxt_irq *irq = bp->irq_tbl; int rc = 0; if (!irq) return 0; if (irq->requested) { int count = 0; /* * Callback deregistration will fail with rc -EAGAIN if the * callback is currently active. Retry every 50 ms until * successful or 500 ms has elapsed. */ do { rc = rte_intr_callback_unregister(intr_handle, irq->handler, bp->eth_dev); if (rc >= 0) { irq->requested = 0; break; } rte_delay_ms(50); } while (count++ < 10); if (rc < 0) { PMD_DRV_LOG(ERR, "irq cb unregister failed rc: %d\n", rc); return rc; } } rte_free(bp->irq_tbl); bp->irq_tbl = NULL; return 0; } void bnxt_disable_int(struct bnxt *bp) { struct bnxt_cp_ring_info *cpr = bp->async_cp_ring; if (BNXT_NUM_ASYNC_CPR(bp) == 0) return; if (is_bnxt_in_error(bp)) return; if (!cpr || !cpr->cp_db.doorbell) return; /* Only the default completion ring */ if (BNXT_HAS_NQ(bp)) bnxt_db_nq(cpr); else B_CP_DB_DISARM(cpr); } void bnxt_enable_int(struct bnxt *bp) { struct bnxt_cp_ring_info *cpr = bp->async_cp_ring; if (BNXT_NUM_ASYNC_CPR(bp) == 0) return; if (!cpr || !cpr->cp_db.doorbell) return; /* Only the default completion ring */ if (BNXT_HAS_NQ(bp)) bnxt_db_nq_arm(cpr); else B_CP_DB_ARM(cpr); } int bnxt_setup_int(struct bnxt *bp) { uint16_t total_vecs; const int len = sizeof(bp->irq_tbl[0].name); int i; /* DPDK host only supports 1 MSI-X vector */ total_vecs = 1; bp->irq_tbl = rte_calloc("bnxt_irq_tbl", total_vecs, sizeof(struct bnxt_irq), 0); if (bp->irq_tbl) { for (i = 0; i < total_vecs; i++) { bp->irq_tbl[i].vector = i; snprintf(bp->irq_tbl[i].name, len, "%s-%d", bp->eth_dev->device->name, i); bp->irq_tbl[i].handler = bnxt_int_handler; } } else { PMD_DRV_LOG(ERR, "bnxt_irq_tbl setup failed\n"); return -ENOMEM; } return 0; } int bnxt_request_int(struct bnxt *bp) { struct rte_intr_handle *intr_handle = &bp->pdev->intr_handle; struct bnxt_irq *irq = bp->irq_tbl; int rc = 0; if (!irq) return 0; if (!irq->requested) { rc = rte_intr_callback_register(intr_handle, irq->handler, bp->eth_dev); if (!rc) irq->requested = 1; } #ifdef RTE_EXEC_ENV_FREEBSD /** * In FreeBSD OS, nic_uio does not support interrupts and * interrupt register callback will fail. */ rc = 0; #endif return rc; }
/************************************************************************** Copyright (C) 2000 - 2010 Novell, Inc. 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; 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. **************************************************************************/ /*---------------------------------------------------------------------\ | | | __ __ ____ _____ ____ | | \ \ / /_ _/ ___|_ _|___ \ | | \ V / _` \___ \ | | __) | | | | | (_| |___) || | / __/ | | |_|\__,_|____/ |_| |_____| | | | | core system | | (C) SuSE GmbH | \----------------------------------------------------------------------/ File: YQPkgTechnicalDetailsView.h Author: Stefan Hundhammer <sh@suse.de> /-*/ #ifndef YQPkgTechnicalDetailsView_h #define YQPkgTechnicalDetailsView_h #include "YQPkgGenericDetailsView.h" /** * @short Display technical details (very much like 'rpm -qi') for a ZYPP * object - the installed instance, the candidate instance or both ( in two * columns ) if both exist. All other available instances are ignored. **/ class YQPkgTechnicalDetailsView : public YQPkgGenericDetailsView { Q_OBJECT public: /** * Constructor **/ YQPkgTechnicalDetailsView( QWidget * parent ); /** * Destructor **/ virtual ~YQPkgTechnicalDetailsView(); protected: /** * Show details for the specified zypp::ResObject: * In this case technical data, very much like "rpm -qi". * Overwritten from YQPkgGenericDetailsView. **/ virtual void showDetails( ZyppSel selectable ); /** * Returns a string containing a HTML table for technical details for one * package. **/ QString simpleTable( ZyppSel selectable, ZyppPkg pkg ); /** * Returns a string containing a HTML table for technical details for two * package instances: The installed instance and an alternate instance. * ( usually the candidate instance ). **/ QString complexTable( ZyppSel selectable, ZyppPkg installedPkg, ZyppPkg candidatePkg ); /** * Returns a string containing HTML code for a package's authors list. **/ QString authorsListCell( ZyppPkg pkg ) const; /** * Format an RPM group. Retrieves the translated ( ! ) version. **/ QString formatRpmGroup( ZyppPkg pkg ) const; }; #endif // ifndef YQPkgTechnicalDetailsView_h
/************************************************************************************************** $Id: data.c,v 1.35 2006/01/18 20:46:46 bboy Exp $ Copyright (C) 2002-2005 Don Moore <bboy@bboy.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 **************************************************************************************************/ #include "named.h" /* Make this nonzero to enable debugging for this source file */ #define DEBUG_DATA 1 /************************************************************************************************** FIND_SOA Determine the origin in `fqdn' and return the MYDNS_SOA structure for that zone. If `label' is non-NULL, the label part of the fqdn will be copied there. If provided, `label' should be at least DNS_MAXNAMELEN bytes. **************************************************************************************************/ MYDNS_SOA * find_soa( TASK *t, char *fqdn, /* The FQDN provided; return the SOA for the zone in this FQDN */ char *label /* The label part of `fqdn' that is below the origin will be stored here */ ) { MYDNS_SOA *soa = (MYDNS_SOA *)NULL; register size_t fqdnlen = strlen(fqdn); register char *origin, *end; int errflag; #if DEBUG_ENABLED && DEBUG_DATA Debug("%s: find_soa(\"%s\", \"%s\")", desctask(t), fqdn, label); #endif end = fqdn + fqdnlen; for (origin = fqdn; *origin && !soa; origin++) if (origin == fqdn || *origin == '.') { if (*origin == '.' && *(origin+1)) origin++; soa = zone_cache_find(t, 0, NULL, DNS_QTYPE_SOA, origin, end-origin, &errflag, NULL); if (errflag) { dnserror(t, DNS_RCODE_SERVFAIL, ERR_DB_ERROR); return (NULL); } /* Get label */ if (soa && label) { register int origin_len = strlen(soa->origin); register int len = strlen(fqdn) - origin_len - 1; if (origin_len == 1) len++; if (len < 0) len = 0; if (len > DNS_MAXNAMELEN) len = DNS_MAXNAMELEN; memcpy(label, fqdn, len); label[len] = '\0'; } } #if DEBUG_ENABLED && DEBUG_DATA if (soa) Debug("%s: Found SOA: id=%u origin=[%s] ns=[%s] mbox=[%s]", desctask(t), soa->id, soa->origin, soa->ns, soa->mbox); #endif return (soa); } /*--- find_soa() --------------------------------------------------------------------------------*/ /************************************************************************************************** FIND_RR Look up RR. Returns NULL if not found. **************************************************************************************************/ MYDNS_RR * find_rr( TASK *t, MYDNS_SOA *soa, /* The SOA record for this zone */ dns_qtype_t type, /* The type of record to look for */ char *name /* The name to look for in `zone' */ ) { int errflag; MYDNS_RR *rr; #if DEBUG_ENABLED && DEBUG_DATA Debug("%s: find_rr(%u, \"%s\", %s, \"%s\")", desctask(t), soa->id, soa->origin, mydns_qtype_str(type), name); #endif rr = zone_cache_find(t, soa->id, soa->origin, type, name, strlen(name), &errflag, soa); if (errflag) { if (rr) mydns_rr_free(rr); dnserror(t, DNS_RCODE_SERVFAIL, ERR_DB_ERROR); return (NULL); } if (rr) { register MYDNS_RR *r; /* If the data is empty, reply with error */ for (r = rr; r; r = r->next) if (!r->data || !r->data[0]) { if (rr) mydns_rr_free(rr); dnserror(t, DNS_RCODE_SERVFAIL, ERR_NAME_FORMAT); return (NULL); } } #if DEBUG_ENABLED && DEBUG_DATA if (rr) Debug("%s: Found RR: id=%u name=[%s] type=%s data=[%s]", desctask(t), rr->id, rr->name, mydns_qtype_str(rr->type), rr->data); #endif return (rr); } /*--- find_rr() ---------------------------------------------------------------------------------*/ /* vi:set ts=3: */ /* NEED_PO */
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtNetwork module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QNETWORKREPLY_H #define QNETWORKREPLY_H #include <QtCore/QIODevice> #include <QtCore/QString> #include <QtCore/QVariant> #include <QtNetwork/QNetworkRequest> #include <QtNetwork/QNetworkAccessManager> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Network) class QUrl; class QVariant; class QAuthenticator; class QSslConfiguration; class QSslError; class QNetworkReplyPrivate; class Q_NETWORK_EXPORT QNetworkReply: public QIODevice { Q_OBJECT Q_ENUMS(NetworkError) public: enum NetworkError { NoError = 0, // network layer errors [relating to the destination server] (1-99): ConnectionRefusedError = 1, RemoteHostClosedError, HostNotFoundError, TimeoutError, OperationCanceledError, SslHandshakeFailedError, TemporaryNetworkFailureError, UnknownNetworkError = 99, // proxy errors (101-199): ProxyConnectionRefusedError = 101, ProxyConnectionClosedError, ProxyNotFoundError, ProxyTimeoutError, ProxyAuthenticationRequiredError, UnknownProxyError = 199, // content errors (201-299): ContentAccessDenied = 201, ContentOperationNotPermittedError, ContentNotFoundError, AuthenticationRequiredError, ContentReSendError, UnknownContentError = 299, // protocol errors ProtocolUnknownError = 301, ProtocolInvalidOperationError, ProtocolFailure = 399 }; ~QNetworkReply(); virtual void abort() = 0; // reimplemented from QIODevice virtual void close(); virtual bool isSequential() const; // like QAbstractSocket: qint64 readBufferSize() const; virtual void setReadBufferSize(qint64 size); QNetworkAccessManager *manager() const; QNetworkAccessManager::Operation operation() const; QNetworkRequest request() const; NetworkError error() const; bool isFinished() const; bool isRunning() const; QUrl url() const; // "cooked" headers QVariant header(QNetworkRequest::KnownHeaders header) const; // raw headers: bool hasRawHeader(const QByteArray &headerName) const; QList<QByteArray> rawHeaderList() const; QByteArray rawHeader(const QByteArray &headerName) const; typedef QPair<QByteArray, QByteArray> RawHeaderPair; const QList<RawHeaderPair>& rawHeaderPairs() const; // attributes QVariant attribute(QNetworkRequest::Attribute code) const; #ifndef QT_NO_OPENSSL QSslConfiguration sslConfiguration() const; void setSslConfiguration(const QSslConfiguration &configuration); void ignoreSslErrors(const QList<QSslError> &errors); #endif public Q_SLOTS: virtual void ignoreSslErrors(); Q_SIGNALS: void metaDataChanged(); void finished(); void error(QNetworkReply::NetworkError); #ifndef QT_NO_OPENSSL void sslErrors(const QList<QSslError> &errors); #endif void uploadProgress(qint64 bytesSent, qint64 bytesTotal); void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); protected: QNetworkReply(QObject *parent = 0); QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent); virtual qint64 writeData(const char *data, qint64 len); void setOperation(QNetworkAccessManager::Operation operation); void setRequest(const QNetworkRequest &request); void setError(NetworkError errorCode, const QString &errorString); void setFinished(bool); void setUrl(const QUrl &url); void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value); void setRawHeader(const QByteArray &headerName, const QByteArray &value); void setAttribute(QNetworkRequest::Attribute code, const QVariant &value); private: Q_DECLARE_PRIVATE(QNetworkReply) }; QT_END_NAMESPACE QT_END_HEADER #endif
// vim: set tabstop=4 shiftwidth=4 noexpandtab: /* A KIPI plugin to generate HTML image galleries Copyright 2006 by Aurelien Gateau <aurelien dot gateau at free.fr> 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, Cambridge, MA 02110-1301, USA. */ #ifndef WIZARD_H #define WIZARD_H // KDE #include <kassistantdialog.h> namespace KIPI { class Interface; } namespace KIPIHTMLExport { class GalleryInfo; /** * The wizard used by the user to select the various settings. */ class Wizard : public KAssistantDialog { Q_OBJECT public: Wizard(QWidget* parent, GalleryInfo* info, KIPI::Interface*); ~Wizard(); protected Q_SLOTS: virtual void accept(); private Q_SLOTS: void updateCollectionSelectorPageValidity(); void updateFinishPageValidity(); void slotThemeSelectionChanged(); void slotHelp(); private: struct Private; Private* d; }; } // namespace #endif /* WIZARD_H */
/* Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef MSM_FB_PANEL_H #define MSM_FB_PANEL_H #include "msm_fb_def.h" struct msm_fb_data_type; typedef void (*msm_fb_vsync_handler_type) (void *arg); /* panel id type */ typedef struct panel_id_s { uint16 id; uint16 type; } panel_id_type; /* panel type list */ #define NO_PANEL 0xffff /* No Panel */ #define MDDI_PANEL 1 /* MDDI */ #define EBI2_PANEL 2 /* EBI2 */ #define LCDC_PANEL 3 /* internal LCDC type */ #define EXT_MDDI_PANEL 4 /* Ext.MDDI */ #define TV_PANEL 5 /* TV */ #define HDMI_PANEL 6 /* HDMI TV */ #define DTV_PANEL 7 /* DTV */ #define MIPI_VIDEO_PANEL 8 /* MIPI */ #define MIPI_CMD_PANEL 9 /* MIPI */ #define WRITEBACK_PANEL 10 /* Wifi display */ /* panel class */ typedef enum { DISPLAY_LCD = 0, /* lcd = ebi2/mddi */ DISPLAY_LCDC, /* lcdc */ DISPLAY_TV, /* TV Out */ DISPLAY_EXT_MDDI, /* External MDDI */ } DISP_TARGET; /* panel device locaiton */ typedef enum { DISPLAY_1 = 0, /* attached as first device */ DISPLAY_2, /* attached on second device */ DISPLAY_3, /* attached on third writeback device */ MAX_PHYS_TARGET_NUM, } DISP_TARGET_PHYS; /* panel info type */ struct lcd_panel_info { __u32 vsync_enable; __u32 refx100; __u32 v_back_porch; __u32 v_front_porch; __u32 v_pulse_width; __u32 hw_vsync_mode; __u32 vsync_notifier_period; __u32 rev; }; struct lcdc_panel_info { __u32 h_back_porch; __u32 h_front_porch; __u32 h_pulse_width; __u32 v_back_porch; __u32 v_front_porch; __u32 v_pulse_width; __u32 border_clr; __u32 underflow_clr; __u32 hsync_skew; }; struct mddi_panel_info { __u32 vdopkt; boolean is_type1; }; struct mipi_panel_info { char mode; /* video/cmd */ char interleave_mode; char crc_check; char ecc_check; char dst_format; /* shared by video and command */ char data_lane0; char data_lane1; char data_lane2; char data_lane3; char dlane_swap; /* data lane swap */ char rgb_swap; char b_sel; char g_sel; char r_sel; char rx_eot_ignore; char tx_eot_append; char t_clk_post; /* 0xc0, DSI_CLKOUT_TIMING_CTRL */ char t_clk_pre; /* 0xc0, DSI_CLKOUT_TIMING_CTRL */ char vc; /* virtual channel */ struct mipi_dsi_phy_ctrl *dsi_phy_db; /* video mode */ char pulse_mode_hsa_he; char hfp_power_stop; char hbp_power_stop; char hsa_power_stop; char eof_bllp_power_stop; char bllp_power_stop; char traffic_mode; char frame_rate; /* command mode */ char interleave_max; char insert_dcs_cmd; char wr_mem_continue; char wr_mem_start; char te_sel; char stream; /* 0 or 1 */ char mdp_trigger; char dma_trigger; uint32 dsi_pclk_rate; /* The packet-size should not bet changed */ char no_max_pkt_size; /* Clock required during LP commands */ char force_clk_lane_hs; /* Pad width */ uint32 xres_pad; /* Pad height */ uint32 yres_pad; }; struct msm_panel_info { __u32 xres; __u32 yres; __u32 bpp; __u32 mode2_xres; __u32 mode2_yres; __u32 mode2_bpp; __u32 type; __u32 wait_cycle; DISP_TARGET_PHYS pdest; __u32 bl_max; __u32 bl_min; __u32 fb_num; __u32 clk_rate; __u32 clk_min; __u32 clk_max; __u32 frame_count; __u32 is_3d_panel; __u32 frame_rate; #ifdef CONFIG_MACH_ACER_A9 __u32 aa_height; //mm __u32 aa_width; //mm #endif struct mddi_panel_info mddi; struct lcd_panel_info lcd; struct lcdc_panel_info lcdc; struct mipi_panel_info mipi; }; #define MSM_FB_SINGLE_MODE_PANEL(pinfo) \ do { \ (pinfo)->mode2_xres = 0; \ (pinfo)->mode2_yres = 0; \ (pinfo)->mode2_bpp = 0; \ } while (0) struct msm_fb_panel_data { struct msm_panel_info panel_info; void (*set_rect) (int x, int y, int xres, int yres); void (*set_vsync_notifier) (msm_fb_vsync_handler_type, void *arg); void (*set_backlight) (struct msm_fb_data_type *); /* function entry chain */ int (*on) (struct platform_device *pdev); int (*off) (struct platform_device *pdev); int (*power_ctrl) (boolean enable); struct platform_device *next; int (*clk_func) (int enable); }; /*=========================================================================== FUNCTIONS PROTOTYPES ============================================================================*/ struct platform_device *msm_fb_device_alloc(struct msm_fb_panel_data *pdata, u32 type, u32 id); int panel_next_on(struct platform_device *pdev); int panel_next_off(struct platform_device *pdev); int lcdc_device_register(struct msm_panel_info *pinfo); int mddi_toshiba_device_register(struct msm_panel_info *pinfo, u32 channel, u32 panel); #endif /* MSM_FB_PANEL_H */
/* * Backlight Driver for the KB3886 Backlight * * Copyright (c) 2007-2008 Claudio Nieder * * Based on corgi_bl.c by Richard Purdie and kb3886 driver by Robert Woerle * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/mutex.h> #include <linux/fb.h> #include <linux/backlight.h> #include <linux/delay.h> #include <linux/dmi.h> #define KB3886_PARENT 0x64 #define KB3886_IO 0x60 #define KB3886_ADC_DAC_PWM 0xC4 #define KB3886_PWM0_WRITE 0x81 #define KB3886_PWM0_READ 0x41 static DEFINE_MUTEX(bl_mutex); static void kb3886_bl_set_intensity(int intensity) { mutex_lock(&bl_mutex); intensity = intensity&0xff; outb(KB3886_ADC_DAC_PWM, KB3886_PARENT); msleep(10); outb(KB3886_PWM0_WRITE, KB3886_IO); msleep(10); outb(intensity, KB3886_IO); mutex_unlock(&bl_mutex); } struct kb3886bl_machinfo { int max_intensity; int default_intensity; int limit_mask; void (*set_bl_intensity)(int intensity); }; static struct kb3886bl_machinfo kb3886_bl_machinfo = { .max_intensity = 0xff, .default_intensity = 0xa0, .limit_mask = 0x7f, .set_bl_intensity = kb3886_bl_set_intensity, }; static struct platform_device kb3886bl_device = { .name = "kb3886-bl", .dev = { .platform_data = &kb3886_bl_machinfo, }, .id = -1, }; static struct platform_device *devices[] __initdata = { &kb3886bl_device, }; /* * Back to driver */ static int kb3886bl_intensity; static struct backlight_device *kb3886_backlight_device; static struct kb3886bl_machinfo *bl_machinfo; static unsigned long kb3886bl_flags; #define KB3886BL_SUSPENDED 0x01 static struct dmi_system_id __initdata kb3886bl_device_table[] = { { .ident = "Sahara Touch-iT", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "SDV"), DMI_MATCH(DMI_PRODUCT_NAME, "iTouch T201"), }, }, { } }; static int kb3886bl_send_intensity(struct backlight_device *bd) { int intensity = bd->props.brightness; if (bd->props.power != FB_BLANK_UNBLANK) intensity = 0; if (bd->props.fb_blank != FB_BLANK_UNBLANK) intensity = 0; if (kb3886bl_flags & KB3886BL_SUSPENDED) intensity = 0; bl_machinfo->set_bl_intensity(intensity); kb3886bl_intensity = intensity; return 0; } #ifdef CONFIG_PM static int kb3886bl_suspend(struct platform_device *pdev, pm_message_t state) { struct backlight_device *bd = platform_get_drvdata(pdev); kb3886bl_flags |= KB3886BL_SUSPENDED; backlight_update_status(bd); return 0; } static int kb3886bl_resume(struct platform_device *pdev) { struct backlight_device *bd = platform_get_drvdata(pdev); kb3886bl_flags &= ~KB3886BL_SUSPENDED; backlight_update_status(bd); return 0; } #else #define kb3886bl_suspend NULL #define kb3886bl_resume NULL #endif static int kb3886bl_get_intensity(struct backlight_device *bd) { return kb3886bl_intensity; } static const struct backlight_ops kb3886bl_ops = { .get_brightness = kb3886bl_get_intensity, .update_status = kb3886bl_send_intensity, }; static int kb3886bl_probe(struct platform_device *pdev) { struct backlight_properties props; struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; bl_machinfo = machinfo; if (!machinfo->limit_mask) machinfo->limit_mask = -1; memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.max_brightness = machinfo->max_intensity; kb3886_backlight_device = backlight_device_register("kb3886-bl", &pdev->dev, NULL, &kb3886bl_ops, &props); if (IS_ERR(kb3886_backlight_device)) return PTR_ERR(kb3886_backlight_device); platform_set_drvdata(pdev, kb3886_backlight_device); kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; kb3886_backlight_device->props.brightness = machinfo->default_intensity; backlight_update_status(kb3886_backlight_device); return 0; } static int kb3886bl_remove(struct platform_device *pdev) { struct backlight_device *bd = platform_get_drvdata(pdev); backlight_device_unregister(bd); return 0; } static struct platform_driver kb3886bl_driver = { .probe = kb3886bl_probe, .remove = kb3886bl_remove, .suspend = kb3886bl_suspend, .resume = kb3886bl_resume, .driver = { .name = "kb3886-bl", }, }; static int __init kb3886_init(void) { if (!dmi_check_system(kb3886bl_device_table)) return -ENODEV; platform_add_devices(devices, ARRAY_SIZE(devices)); return platform_driver_register(&kb3886bl_driver); } static void __exit kb3886_exit(void) { platform_driver_unregister(&kb3886bl_driver); } module_init(kb3886_init); module_exit(kb3886_exit); MODULE_AUTHOR("Claudio Nieder <private@claudio.ch>"); MODULE_DESCRIPTION("Tabletkiosk Sahara Touch-iT Backlight Driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("dmi:*:svnSDV:pniTouchT201:*");
#ifndef MASKLABEL_H #define MASKLABEL_H #include <QLabel> #include <QMouseEvent> class MaskLabel : public QLabel { Q_OBJECT public: explicit MaskLabel(QWidget *parent = 0) : QLabel(parent) {} void mousePressEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); signals: void posChangedX(int x); void posChangedY(int y); void radiusChanged(int r); public slots: void setEditable(bool editable); private: bool editable = false; bool in_editing = false; int x; int y; }; #endif // MASKLABEL_H
/* Copyright (C) 2005 Ole André Vadla Ravnås <oleavr@gmail.com> * * 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 */ #ifndef MIMIC_H #define MIMIC_H #include <glib.h> #ifdef __cplusplus extern "C" { #endif /** * @defgroup libmimic libmimic public API * @brief The public API of the libmimic library * * libmimic provides the API required for encoding and decoding * MIMIC v2.x-encoded content. * * @{ */ /** * The mimic encoding/decoding context returned by #mimic_open * and used for all further API calls until #mimic_close. */ typedef struct _MimCtx MimCtx; typedef enum { MIMIC_RES_LOW, /**< 160x120 resolution */ MIMIC_RES_HIGH /**< 320x240 resolution */ } MimicResEnum; MimCtx *mimic_open(); void mimic_close(MimCtx *ctx); gboolean mimic_encoder_init(MimCtx *ctx, const MimicResEnum resolution); gboolean mimic_decoder_init(MimCtx *ctx, const guchar *frame_buffer); gboolean mimic_get_property(MimCtx *ctx, const gchar *name, gpointer data); gboolean mimic_set_property(MimCtx *ctx, const gchar *name, gpointer data); gboolean mimic_encode_frame(MimCtx *ctx, const guchar *input_buffer, guchar *output_buffer, gint *output_length, gboolean make_keyframe); gboolean mimic_decode_frame(MimCtx *ctx, const guchar *input_buffer, guchar *output_buffer); /** @} */ #ifdef __cplusplus } #endif #endif
/* ********************************************************************************************************* * uC/GUI * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : GUI_CursorCrossS.C Purpose : Defines the cross cursor, small ---------------------------END-OF-HEADER------------------------------ */ #include <stdlib.h> #include "GUI_Protected.h" GUI_CONST_STORAGE GUI_BITMAP GUI_BitmapCrossS = { 11, /* XSize */ 11, /* YSize */ 3, /* BytesPerLine */ 2, /* BitsPerPixel */ GUI_Pixels_CrossS, /* Pointer to picture data (indices) */ &GUI_CursorPal /* Pointer to palette */ }; GUI_CONST_STORAGE GUI_CURSOR GUI_CursorCrossS = { &GUI_BitmapCrossS, 5, 5 }; /*************************** End of file ****************************/
/* GMODULE - GLIB wrapper code for dynamic module loading * Copyright (C) 1998, 2000 Tim Janik * * dyld (Darwin) GMODULE implementation * Copyright (C) 2001 Dan Winship * * 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 "config.h" #include <mach-o/dyld.h> static gpointer self_module = GINT_TO_POINTER (1); static gpointer _g_module_open (const gchar *file_name, gboolean bind_lazy, gboolean bind_local) { NSObjectFileImage image; NSObjectFileImageReturnCode ret; NSModule module; unsigned long options; char *msg; ret = NSCreateObjectFileImageFromFile (file_name, &image); if (ret != NSObjectFileImageSuccess) { switch (ret) { case NSObjectFileImageInappropriateFile: case NSObjectFileImageFormat: msg = g_strdup_printf ("%s is not a loadable module", file_name); break; case NSObjectFileImageArch: msg = g_strdup_printf ("%s is not built for this architecture", file_name); break; case NSObjectFileImageAccess: if (access (file_name, F_OK) == 0) msg = g_strdup_printf ("%s: permission denied", file_name); else msg = g_strdup_printf ("%s: no such file or directory", file_name); break; default: msg = g_strdup_printf ("unknown error for %s", file_name); break; } g_module_set_error (msg); g_free (msg); return NULL; } options = NSLINKMODULE_OPTION_RETURN_ON_ERROR; if (bind_local) options |= NSLINKMODULE_OPTION_PRIVATE; if (!bind_lazy) options |= NSLINKMODULE_OPTION_BINDNOW; module = NSLinkModule (image, file_name, options); NSDestroyObjectFileImage (image); if (!module) { NSLinkEditErrors c; int error_number; const char *file, *error; NSLinkEditError (&c, &error_number, &file, &error); msg = g_strdup_printf ("could not link %s: %s", file_name, error); g_module_set_error (msg); g_free (msg); return NULL; } return module; } static gpointer _g_module_self (void) { return &self_module; } static void _g_module_close (gpointer handle, gboolean is_unref) { if (handle == &self_module) return; if (!NSUnLinkModule (handle, 0)) g_module_set_error ("could not unlink module"); } static gpointer _g_module_symbol (gpointer handle, const gchar *symbol_name) { NSSymbol sym; char *msg; if (handle == &self_module) { if (NSIsSymbolNameDefined (symbol_name)) sym = NSLookupAndBindSymbol (symbol_name); else sym = NULL; } else sym = NSLookupSymbolInModule (handle, symbol_name); if (!sym) { msg = g_strdup_printf ("no such symbol %s", symbol_name); g_module_set_error (msg); g_free (msg); return NULL; } return NSAddressOfSymbol (sym); } static gchar* _g_module_build_path (const gchar *directory, const gchar *module_name) { if (directory && *directory) { if (strncmp (module_name, "lib", 3) == 0) return g_strconcat (directory, "/", module_name, NULL); else return g_strconcat (directory, "/lib", module_name, "." G_MODULE_SUFFIX, NULL); } else if (strncmp (module_name, "lib", 3) == 0) return g_strdup (module_name); else return g_strconcat ("lib", module_name, "." G_MODULE_SUFFIX, NULL); }
#define CONFIG_ISDN_BOOL 1
/* * Copyright (c) [2016-2020] SUSE LLC * * All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public 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, contact Novell, Inc. * * To contact Novell about this file by physical or electronic mail, you may * find current contact information at www.novell.com. */ #ifndef SNAPPER_PROXY_LIB_H #define SNAPPER_PROXY_LIB_H #include "proxy.h" #include <snapper/Snapper.h> #include <snapper/Comparison.h> class ProxySnapshotLib : public ProxySnapshot::Impl { public: ProxySnapshotLib(Snapshots::iterator it) : it(it) {} virtual SnapshotType getType() const override { return it->getType(); } virtual unsigned int getNum() const override { return it->getNum(); } virtual time_t getDate() const override { return it->getDate(); } virtual uid_t getUid() const override { return it->getUid(); } virtual unsigned int getPreNum() const override { return it->getPreNum(); } virtual const string& getDescription() const override { return it->getDescription(); } virtual const string& getCleanup() const override { return it->getCleanup(); } virtual const map<string, string>& getUserdata() const override { return it->getUserdata(); } virtual bool isCurrent() const override { return it->isCurrent(); } virtual uint64_t getUsedSpace() const override { return it->getUsedSpace(); } virtual string mountFilesystemSnapshot(bool user_request) const override { it->mountFilesystemSnapshot(user_request); return it->snapshotDir(); } virtual void umountFilesystemSnapshot(bool user_request) const override { it->umountFilesystemSnapshot(user_request); } Snapshots::iterator it; }; class ProxySnapperLib; class ProxySnapshotsLib : public ProxySnapshots { public: virtual iterator getDefault() override; virtual const_iterator getDefault() const override; virtual iterator getActive() override; virtual const_iterator getActive() const override; ProxySnapshotsLib(ProxySnapperLib* backref); ProxySnapperLib* backref; }; class ProxySnapperLib : public ProxySnapper { public: ProxySnapperLib(const string& config_name, const string& target_root) : snapper(new Snapper(config_name, target_root)), proxy_snapshots(this) {} virtual const string& configName() const override { return snapper->configName(); } virtual ProxyConfig getConfig() const override; virtual void setConfig(const ProxyConfig& proxy_config) override; virtual ProxySnapshots::const_iterator createSingleSnapshot(const SCD& scd) override; virtual ProxySnapshots::const_iterator createSingleSnapshot(ProxySnapshots::const_iterator parent, const SCD& scd) override; virtual ProxySnapshots::const_iterator createSingleSnapshotOfDefault(const SCD& scd) override; virtual ProxySnapshots::const_iterator createPreSnapshot(const SCD& scd) override; virtual ProxySnapshots::const_iterator createPostSnapshot(ProxySnapshots::const_iterator pre, const SCD& scd) override; virtual void modifySnapshot(ProxySnapshots::iterator snapshot, const SMD& smd) override; virtual void deleteSnapshots(vector<ProxySnapshots::iterator> snapshots, bool verbose) override; virtual ProxyComparison createComparison(const ProxySnapshot& lhs, const ProxySnapshot& rhs, bool mount) override; virtual void syncFilesystem() const override { snapper->syncFilesystem(); } virtual ProxySnapshots& getSnapshots() override { return proxy_snapshots; } virtual const ProxySnapshots& getSnapshots() const override { return proxy_snapshots; } virtual void setupQuota() override { snapper->setupQuota(); } virtual void prepareQuota() const override { snapper->prepareQuota(); } virtual QuotaData queryQuotaData() const override { return snapper->queryQuotaData(); } virtual FreeSpaceData queryFreeSpaceData() const override { return snapper->queryFreeSpaceData(); } virtual void calculateUsedSpace() const override { snapper->calculateUsedSpace(); } std::unique_ptr<Snapper> snapper; private: ProxySnapshotsLib proxy_snapshots; }; class ProxySnappersLib : public ProxySnappers::Impl { public: ProxySnappersLib(const string& target_root) : target_root(target_root) {} virtual void createConfig(const string& config_name, const string& subvolume, const string& fstype, const string& template_name) override; virtual void deleteConfig(const string& config_name) override; virtual ProxySnapper* getSnapper(const string& config_name) override; virtual map<string, ProxyConfig> getConfigs() const override; virtual vector<string> debug() const override { return Snapper::debug(); } private: const string target_root; list<std::unique_ptr<ProxySnapperLib>> proxy_snappers; }; class ProxyComparisonLib : public ProxyComparison::Impl { public: ProxyComparisonLib(ProxySnapperLib* proxy_snapper, const ProxySnapshot& lhs, const ProxySnapshot& rhs, bool mount); virtual const Files& getFiles() const override { return comparison->getFiles(); } ProxySnapper* proxy_snapper; private: std::unique_ptr<Comparison> comparison; }; const ProxySnapshotLib& to_lib(const ProxySnapshot& proxy_snapshot); #endif
/* * This file is part of Rabbits * Copyright (C) 2015 Clement Deschamps and Luc Michel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __PLATFORM_NOC_H__ #define __PLATFORM_NOC_H__ class PlatformNoc; #include "components/rabbits/master.h" #include "components/rabbits/slave.h" #include "components/rabbits/interconnect_noc_impl.h" #include "components/rabbits/node_impl.h" #include <tlm_utils/simple_initiator_socket.h> #include <tlm_utils/simple_target_socket.h> #include <vector> class PlatformNoc: public sc_module { protected: struct mapping_descr { uint64_t addr; uint64_t len; }; std::vector<Slave *> m_targets; std::vector<Master *> m_initiators; std::vector<mapping_descr *> m_mappings; InterconnectNoc<32> *m_interco; virtual void end_of_elaboration(); public: PlatformNoc(sc_module_name name); ~PlatformNoc(); void connect_target(Slave *target, uint64_t addr, uint64_t len, int x,int y,int z); void connect_target(Slave *target, uint64_t addr, uint64_t len, int x,int y) { connect_target(target,addr,len,x,y,0); } void connect_target(Slave *target, uint64_t addr, uint64_t len); template <unsigned int BUSWIDTH> void connect_target(tlm::tlm_target_socket<BUSWIDTH> *target, uint64_t addr, uint64_t len,int x,int y,int z) { mapping_descr *descr = new mapping_descr; descr->addr = addr; descr->len = len; m_mappings.push_back(descr); m_interco->connect_target(target, addr, len,x,y,z); } template <unsigned int BUSWIDTH> void connect_target(tlm::tlm_target_socket<BUSWIDTH> *target, uint64_t addr, uint64_t len,int x,int y) { mapping_descr *descr = new mapping_descr; descr->addr = addr; descr->len = len; m_mappings.push_back(descr); m_interco->connect_target(target, addr, len,x,y,0); } template <unsigned int BUSWIDTH> void connect_target(tlm::tlm_target_socket<BUSWIDTH> *target, uint64_t addr, uint64_t len) { mapping_descr *descr = new mapping_descr; descr->addr = addr; descr->len = len; m_mappings.push_back(descr); m_interco->Interconnect<BUSWIDTH>::connect_target(target, addr, len); } void connect_initiator(Master *initiator,int x,int y,int z); void connect_initiator(Master *initiator,int x,int y) { connect_initiator(initiator,x,y,0); } void connect_initiator(Master *initiator); template <unsigned int BUSWIDTH> void connect_initiator(tlm::tlm_initiator_socket<BUSWIDTH> *initiator, int x, int y, int z) { m_interco->connect_initiator(initiator,x,y,z); } template <unsigned int BUSWIDTH> void connect_initiator(tlm::tlm_initiator_socket<BUSWIDTH> *initiator, int x, int y) { m_interco->connect_initiator(initiator,x,y,0); } template <unsigned int BUSWIDTH> void connect_initiator(tlm::tlm_initiator_socket<BUSWIDTH> *initiator) { m_interco->Interconnect<BUSWIDTH>::connect_initiator(initiator); } void create_network(int type,int col,int row,int h) { m_interco->create_network(type,col,row,h); } void create_network(int type,int col,int row) { m_interco->create_network(type,col,row,1); } void create_network(int type) { m_interco->create_network(type); } }; #endif /* __PLATFORM_NOC_H__ */
/* dia -- an diagram creation/manipulation program * Copyright (C) 1998 Alexander Larsson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef DIA_XML_H #define DIA_XML_H #include <glib.h> #include "geometry.h" #include "color.h" #include "font.h" #include "diavar.h" #include <libxml/tree.h> /* * Though the Dia homepage is now http://www.gnome.org/projects/dia * Dia's xml namespace definition still needs to point to the * original site. In fact the xml namespace definition has nothing to do * with existing website, they just need to be unique to allow to * differentiate between varying definitions. Changing the namespace * from the old to the new site would strictly speaking break all * older diagrams - although some tools may not take the actual * key into account. * See also : doc/diagram.dtd */ #define DIA_XML_NAME_SPACE_BASE "http://www.lysator.liu.se/~alla/dia/" DIAVAR int pretty_formated_xml; typedef xmlNodePtr XML_NODE; typedef XML_NODE ObjectNode; typedef XML_NODE AttributeNode; typedef XML_NODE DataNode; typedef enum{ DATATYPE_COMPOSITE, DATATYPE_INT, DATATYPE_ENUM, DATATYPE_REAL, DATATYPE_BOOLEAN, DATATYPE_COLOR, DATATYPE_POINT, DATATYPE_RECTANGLE, DATATYPE_STRING, DATATYPE_FONT, DATATYPE_BEZPOINT, DATATYPE_DICT } DataType; AttributeNode object_find_attribute(ObjectNode obj_node, const char *attrname); AttributeNode composite_find_attribute(DataNode composite_node, const char *attrname); int attribute_num_data(AttributeNode attribute); DataNode attribute_first_data(AttributeNode attribute); DataNode data_next(DataNode data); DataType data_type(DataNode data); int data_int(DataNode data); int data_enum(DataNode data); real data_real(DataNode data); int data_boolean(DataNode data); void data_color(DataNode data, Color *col); void data_point(DataNode data, Point *point); void data_bezpoint(DataNode data, BezPoint *point); void data_rectangle(DataNode data, Rectangle *rect); char *data_string(DataNode data); char *data_filename(DataNode data); DiaFont *data_font(DataNode data); AttributeNode new_attribute(ObjectNode obj_node, const char *attrname); AttributeNode composite_add_attribute(DataNode composite_node, const char *attrname); void data_add_int(AttributeNode attr, int data); void data_add_enum(AttributeNode attr, int data); void data_add_real(AttributeNode attr, real data); void data_add_boolean(AttributeNode attr, int data); void data_add_color(AttributeNode attr, const Color *col); void data_add_point(AttributeNode attr, const Point *point); void data_add_bezpoint(AttributeNode attr, const BezPoint *point); void data_add_rectangle(AttributeNode attr, const Rectangle *rect); void data_add_string(AttributeNode attr, const char *str); void data_add_filename(AttributeNode attr, const char *str); void data_add_font(AttributeNode attr, const DiaFont *font); DataNode data_add_composite(AttributeNode attr, const char *type); /* can be NULL */ GHashTable *data_dict (DataNode data); void data_add_dict (AttributeNode attr, GHashTable *data); #endif /* DIA_XML_H */
#if !defined(SOLVING_GOAL_ANY_REACHED_TESTER_H) #define SOLVING_GOAL_ANY_REACHED_TESTER_H #include "solving/machinery/solve.h" /* This module provides functionality dealing with slices that detect * whether an any goal has just been reached */ /* Try to solve in solve_nr_remaining half-moves. * @param si slice index * @note assigns solve_result the length of solution found and written, i.e.: * previous_move_is_illegal the move just played is illegal * this_move_is_illegal the move being played is illegal * immobility_on_next_move the moves just played led to an * unintended immobility on the next move * <=n+1 length of shortest solution found (n+1 only if in next * branch) * n+2 no solution found in this branch * n+3 no solution found in next branch * (with n denominating solve_nr_remaining) */ void goal_any_reached_tester_solve(slice_index si); #endif
/* * Copyright (c) International Business Machines Corp., 2001 * * 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 * * Ported by John George */ /* * Test that root can change the real and effective uid to an * unpriviledged user. */ #include <errno.h> #include <stdlib.h> #include <pwd.h> #include <sys/wait.h> #include "test.h" #include "usctest.h" #include "compat_16.h" TCID_DEFINE(setreuid04); static uid_t neg_one = -1; static struct passwd nobody, root; /* * The following structure contains all test data. Each structure in the array * is used for a separate test. The tests are executed in the for loop below. */ struct test_data_t { uid_t *real_uid; uid_t *eff_uid; struct passwd *exp_real_usr; struct passwd *exp_eff_usr; char *test_msg; } test_data[] = { { &neg_one, &neg_one, &root, &root, "After setreuid(-1, nobody),"}, { &nobody.pw_uid, &nobody.pw_uid, &nobody, &nobody, "After setreuid(-1, -1),"},}; /*int TST_TOTAL = sizeof(test_data)/sizeof(test_data[0]);*/ int TST_TOTAL = 2; static void setup(void); static void cleanup(void); static void uid_verify(struct passwd *, struct passwd *, char *); int main(int ac, char **av) { int lc; const char *msg; if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { int i, pid; tst_count = 0; if ((pid = FORK_OR_VFORK()) == -1) { tst_brkm(TBROK, cleanup, "fork failed"); } else if (pid == 0) { /* child */ for (i = 0; i < TST_TOTAL; i++) { /* Set the real or effective user id */ TEST(SETREUID(cleanup, *test_data[i].real_uid, *test_data[i].eff_uid)); if (TEST_RETURN != -1) { tst_resm(TPASS, "setreuid(%d, %d) " "succeeded as expected.", *test_data[i].real_uid, *test_data[i].eff_uid); } else { tst_resm(TFAIL, "setreuid(%d, %d) " "did not return as expected.", *test_data[i].real_uid, *test_data[i].eff_uid); } uid_verify(test_data[i].exp_real_usr, test_data[i].exp_eff_usr, test_data[i].test_msg); } tst_exit(); } else { /* parent */ tst_record_childstatus(cleanup, pid); } } cleanup(); tst_exit(); } static void setup(void) { tst_require_root(NULL); tst_sig(FORK, DEF_HANDLER, cleanup); if (getpwnam("nobody") == NULL) tst_brkm(TBROK, NULL, "nobody must be a valid user."); root = *(getpwnam("root")); UID16_CHECK(root.pw_uid, setreuid, cleanup); nobody = *(getpwnam("nobody")); UID16_CHECK(nobody.pw_uid, setreuid, cleanup); TEST_PAUSE; } static void cleanup(void) { TEST_CLEANUP; } static void uid_verify(struct passwd *ru, struct passwd *eu, char *when) { if ((getuid() != ru->pw_uid) || (geteuid() != eu->pw_uid)) { tst_resm(TFAIL, "ERROR: %s real uid = %d; effective uid = %d", when, getuid(), geteuid()); tst_resm(TINFO, "Expected: real uid = %d; effective uid = %d", ru->pw_uid, eu->pw_uid); } }
/* Definitions for ELF assembler support. Copyright (C) 1999, 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* So we can conditionalize small amounts of code in pa.c or pa.md. */ #define OBJ_ELF #define ENDFILE_SPEC "crtend.o%s" #define STARTFILE_SPEC "%{!shared: \ %{!symbolic: \ %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\ crtbegin.o%s" #define TEXT_SECTION_ASM_OP "\t.text" #define DATA_SECTION_ASM_OP "\t.data" #define BSS_SECTION_ASM_OP "\t.section\t.bss" #define TARGET_ASM_FILE_START pa_elf_file_start #undef ASM_DECLARE_FUNCTION_NAME #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { \ if (TREE_PUBLIC (DECL)) \ { \ fputs ("\t.EXPORT ", FILE); \ assemble_name (FILE, NAME); \ fputs (",ENTRY\n", FILE); \ } \ } while (0) /* This is how to output a command to make the user-level label named NAME defined for reference from other files. We use assemble_name_raw instead of assemble_name since a symbol in a .IMPORT directive that isn't otherwise referenced is not placed in the symbol table of the assembled object. Failure to import a function reference can cause the HP linker to segmentation fault! Note that the SOM based tools need the symbol imported as a CODE symbol, while the ELF based tools require the symbol to be imported as an ENTRY symbol. */ #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \ pa_hpux_asm_output_external ((FILE), (DECL), (NAME)) #define ASM_OUTPUT_EXTERNAL_REAL(FILE, DECL, NAME) \ do { fputs ("\t.IMPORT ", FILE); \ assemble_name_raw (FILE, NAME); \ if (FUNCTION_NAME_P (NAME)) \ fputs (",ENTRY\n", FILE); \ else \ fputs (",DATA\n", FILE); \ } while (0) /* The bogus HP assembler requires ALL external references to be "imported", even library calls. They look a bit different, so here's this macro. Also note not all libcall names are passed to targetm.encode_section_info (__main for example). To make sure all libcall names have section info recorded in them, we do it here. */ #undef ASM_OUTPUT_EXTERNAL_LIBCALL #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \ do { fputs ("\t.IMPORT ", FILE); \ if (!function_label_operand (RTL, VOIDmode)) \ hppa_encode_label (RTL); \ assemble_name (FILE, XSTR ((RTL), 0)); \ fputs (",ENTRY\n", FILE); \ } while (0) /* Biggest alignment supported by the object file format of this machine. Use this macro to limit the alignment which can be specified using the `__attribute__ ((aligned (N)))' construct. If not defined, the default value is `BIGGEST_ALIGNMENT'. */ #define MAX_OFILE_ALIGNMENT (32768 * 8)
// rdescape_string.h // // Escape non-valid characters in a string. // // (C) Copyright 2002-2005 Fred Gleason <fredg@paravelsystems.com> // // $Id: rdescape_string.h,v 1.4.6.1 2009/06/29 14:20:48 cvs Exp $ // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // #include <qstring.h> #ifndef RDESCAPE_STRING_H #define RDESCAPE_STRING_H QString RDEscapeString(const QString &str); /** * Escape a string so it is safe to be used as a SQL (MySQL) column. * For details see http://dev.mysql.com/doc/refman/4.1/en/identifiers.html * * @param str The string to escape. * * Returns escaped string **/ QString RDEscapeStringSQLColumn(const QString &str); #endif
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <assert.h> #include <exception> // System.Security.Cryptography.HMACSHA1 struct HMACSHA1_t745; // System.Byte[] struct ByteU5BU5D_t104; #include "codegen/il2cpp-codegen.h" // System.Void System.Security.Cryptography.HMACSHA1::.ctor() extern "C" void HMACSHA1__ctor_m6796 (HMACSHA1_t745 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Security.Cryptography.HMACSHA1::.ctor(System.Byte[]) extern "C" void HMACSHA1__ctor_m6797 (HMACSHA1_t745 * __this, ByteU5BU5D_t104* ___key, const MethodInfo* method) IL2CPP_METHOD_ATTR;
/* * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator * LGS8913, LGS8GL5, LGS8G75 * experimental support LGS8G42, LGS8G52 * * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com> * Copyright (C) 2008 Sirius International (Hong Kong) Limited * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5) * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef LGS8913_PRIV_H #define LGS8913_PRIV_H struct lgs8gxx_state { struct i2c_adapter *i2c; /* configuration settings */ const struct lgs8gxx_config *config; struct dvb_frontend frontend; u16 curr_gi; /* current guard interval */ }; #define SC_MASK 0x1C /* Sub-Carrier Modulation Mask */ #define SC_QAM64 0x10 /* 64QAM modulation */ #define SC_QAM32 0x0C /* 32QAM modulation */ #define SC_QAM16 0x08 /* 16QAM modulation */ #define SC_QAM4NR 0x04 /* 4QAM-NR modulation */ #define SC_QAM4 0x00 /* 4QAM modulation */ #define LGS_FEC_MASK 0x03 /* FEC Rate Mask */ #define LGS_FEC_0_4 0x00 /* FEC Rate 0.4 */ #define LGS_FEC_0_6 0x01 /* FEC Rate 0.6 */ #define LGS_FEC_0_8 0x02 /* FEC Rate 0.8 */ #define TIM_MASK 0x20 /* Time Interleave Length Mask */ #define TIM_LONG 0x20 /* Time Interleave Length = 720 */ #define TIM_MIDDLE 0x00 /* Time Interleave Length = 240 */ #define CF_MASK 0x80 /* Control Frame Mask */ #define CF_EN 0x80 /* Control Frame On */ #define GI_MASK 0x03 /* Guard Interval Mask */ #define GI_420 0x00 /* 1/9 Guard Interval */ #define GI_595 0x01 /* */ #define GI_945 0x02 /* 1/4 Guard Interval */ #define TS_PARALLEL 0x00 /* Parallel TS Output a.k.a. SPI */ #define TS_SERIAL 0x01 /* Serial TS Output a.k.a. SSI */ #define TS_CLK_NORMAL 0x00 /* MPEG Clock Normal */ #define TS_CLK_INVERTED 0x02 /* MPEG Clock Inverted */ #define TS_CLK_GATED 0x00 /* MPEG clock gated */ #define TS_CLK_FREERUN 0x04 /* MPEG clock free running*/ #endif
/* system.h * * This include file contains information that is included in every * function in the test set. * * COPYRIGHT (c) 1989-1999. * 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$ */ /* functions */ #include <pmacros.h> void *POSIX_Init( void *argument ); void *Task_1( void *argument ); /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_MAXIMUM_POSIX_THREADS 4 #define CONFIGURE_POSIX_INIT_THREAD_TABLE #include <rtems/confdefs.h> /* global variables */ #ifdef CONFIGURE_INIT #define TEST_EXTERN #else #define TEST_EXTERN extern #endif TEST_EXTERN pthread_t Init_id; TEST_EXTERN pthread_t Task_id; /* end of include file */
/* * Linux/PA-RISC Project (http://www.parisc-linux.org/) * * Floating-point emulation code * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * BEGIN_DESC * * File: * @(#) pa/spmath/sfcmp.c $Revision: 1.1.1.1 $ * * Purpose: * sgl_cmp: compare two values * * External Interfaces: * sgl_fcmp(leftptr, rightptr, cond, status) * * Internal Interfaces: * * Theory: * <<please update with a overview of the operation of this file>> * * END_DESC */ #include "float.h" #include "sgl_float.h" /* * sgl_cmp: compare two values */ int sgl_fcmp (sgl_floating_point * leftptr, sgl_floating_point * rightptr, unsigned int cond, unsigned int *status) /* The predicate to be tested */ { register unsigned int left, right; register int xorresult; /* Create local copies of the numbers */ left = *leftptr; right = *rightptr; /* * Test for NaN */ if( (Sgl_exponent(left) == SGL_INFINITY_EXPONENT) || (Sgl_exponent(right) == SGL_INFINITY_EXPONENT) ) { /* Check if a NaN is involved. Signal an invalid exception when * comparing a signaling NaN or when comparing quiet NaNs and the * low bit of the condition is set */ if( ( (Sgl_exponent(left) == SGL_INFINITY_EXPONENT) && Sgl_isnotzero_mantissa(left) && (Exception(cond) || Sgl_isone_signaling(left))) || ( (Sgl_exponent(right) == SGL_INFINITY_EXPONENT) && Sgl_isnotzero_mantissa(right) && (Exception(cond) || Sgl_isone_signaling(right)) ) ) { if( Is_invalidtrap_enabled() ) { Set_status_cbit(Unordered(cond)); return(INVALIDEXCEPTION); } else Set_invalidflag(); Set_status_cbit(Unordered(cond)); return(NOEXCEPTION); } /* All the exceptional conditions are handled, now special case NaN compares */ else if( ((Sgl_exponent(left) == SGL_INFINITY_EXPONENT) && Sgl_isnotzero_mantissa(left)) || ((Sgl_exponent(right) == SGL_INFINITY_EXPONENT) && Sgl_isnotzero_mantissa(right)) ) { /* NaNs always compare unordered. */ Set_status_cbit(Unordered(cond)); return(NOEXCEPTION); } /* infinities will drop down to the normal compare mechanisms */ } /* First compare for unequal signs => less or greater or * special equal case */ Sgl_xortointp1(left,right,xorresult); if( xorresult < 0 ) { /* left negative => less, left positive => greater. * equal is possible if both operands are zeros. */ if( Sgl_iszero_exponentmantissa(left) && Sgl_iszero_exponentmantissa(right) ) { Set_status_cbit(Equal(cond)); } else if( Sgl_isone_sign(left) ) { Set_status_cbit(Lessthan(cond)); } else { Set_status_cbit(Greaterthan(cond)); } } /* Signs are the same. Treat negative numbers separately * from the positives because of the reversed sense. */ else if( Sgl_all(left) == Sgl_all(right) ) { Set_status_cbit(Equal(cond)); } else if( Sgl_iszero_sign(left) ) { /* Positive compare */ if( Sgl_all(left) < Sgl_all(right) ) { Set_status_cbit(Lessthan(cond)); } else { Set_status_cbit(Greaterthan(cond)); } } else { /* Negative compare. Signed or unsigned compares * both work the same. That distinction is only * important when the sign bits differ. */ if( Sgl_all(left) > Sgl_all(right) ) { Set_status_cbit(Lessthan(cond)); } else { Set_status_cbit(Greaterthan(cond)); } } return(NOEXCEPTION); }
/* * Kernel Panic LED Trigger * * Copyright 2016 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/leds.h> static struct led_trigger *trigger; static long led_panic_blink(int state) { led_trigger_event(trigger, state ? LED_FULL : LED_OFF); return 0; } static int __init ledtrig_panic_init(void) { led_trigger_register_simple("panic", &trigger); panic_blink = led_panic_blink; return 0; } device_initcall(ledtrig_panic_init);
/* Aseprite * Copyright (C) 2001-2013 David Capello * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef APP_MODULES_GUI_H_INCLUDED #define APP_MODULES_GUI_H_INCLUDED #pragma once #include "app/ui/skin/skin_property.h" #include "base/exception.h" #include "ui/base.h" namespace ui { class ButtonBase; class CheckBox; class Message; class RadioButton; class Widget; class Window; } namespace app { class Command; class Document; class Params; namespace tools { class Tool; } int init_module_gui(); void exit_module_gui(); int get_screen_scaling(); void set_screen_scaling(int scaling); void update_screen_for_document(Document* document); void gui_run(); void gui_feedback(); void gui_setup_screen(bool reload_font); void load_window_pos(ui::Widget* window, const char *section); void save_window_pos(ui::Widget* window, const char *section); ui::Widget* setup_mini_font(ui::Widget* widget); ui::Widget* setup_mini_look(ui::Widget* widget); ui::Widget* setup_look(ui::Widget* widget, skin::LookType lookType); void setup_bevels(ui::Widget* widget, int b1, int b2, int b3, int b4); void set_gfxicon_to_button(ui::ButtonBase* button, int normal_part_id, int selected_part_id, int disabled_part_id, int icon_align); ui::CheckBox* check_button_new(const char* text, int b1, int b2, int b3, int b4); } // namespace app #endif
/*************************************************************************** qgsauthpkipathsedit.h --------------------- begin : September 1, 2015 copyright : (C) 2015 by Boundless Spatial, Inc. USA author : Larry Shaffer email : lshaffer at boundlessgeo 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 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSAUTHPKIPATHSEDIT_H #define QGSAUTHPKIPATHSEDIT_H #include <QWidget> #include "qgsauthmethodedit.h" #include "ui_qgsauthpkipathsedit.h" #include "qgsauthconfig.h" class QgsAuthPkiPathsEdit : public QgsAuthMethodEdit, private Ui::QgsAuthPkiPathsEdit { Q_OBJECT public: enum Validity { Valid, Invalid, Unknown }; explicit QgsAuthPkiPathsEdit( QWidget *parent = nullptr ); virtual ~QgsAuthPkiPathsEdit(); bool validateConfig() override; QgsStringMap configMap() const override; public slots: void loadConfig( const QgsStringMap &configmap ) override; void resetConfig() override; void clearConfig() override; private slots: void clearPkiMessage( QLineEdit *lineedit ); void writePkiMessage( QLineEdit *lineedit, const QString &msg, Validity valid = Unknown ); void clearPkiPathsCertPath(); void clearPkiPathsKeyPath(); void clearPkiPathsKeyPass(); void on_chkPkiPathsPassShow_stateChanged( int state ); void on_btnPkiPathsCert_clicked(); void on_btnPkiPathsKey_clicked(); private: bool validityChange( bool curvalid ); QgsStringMap mConfigMap; bool mValid; }; #endif // QGSAUTHPKIPATHSEDIT_H
#ifndef __prepsubband_cmd__ #define __prepsubband_cmd__ /***** command line parser interface -- generated by clig (http://wsd.iitb.fhg.de/~geg/clighome/) The command line parser `clig': (C) 1995-2004 Harald Kirsch (clig@geggus.net) *****/ typedef struct s_Cmdline { /***** -ncpus: Number of processors to use with OpenMP */ char ncpusP; int ncpus; int ncpusC; /***** -o: Root of the output file names */ char outfileP; char* outfile; int outfileC; /***** -pkmb: Raw data in Parkes Multibeam format */ char pkmbP; /***** -gmrt: Raw data in GMRT Phased Array format */ char gmrtP; /***** -bcpm: Raw data in Berkeley-Caltech Pulsar Machine (BPP) format */ char bcpmP; /***** -spigot: Raw data in Caltech-NRAO Spigot Card format */ char spigotP; /***** -filterbank: Raw data in SIGPROC filterbank format */ char filterbankP; /***** -psrfits: Raw data in PSRFITS format */ char psrfitsP; /***** -noweights: Do not apply PSRFITS weights */ char noweightsP; /***** -noscales: Do not apply PSRFITS scales */ char noscalesP; /***** -nooffsets: Do not apply PSRFITS offsets */ char nooffsetsP; /***** -wapp: Raw data in Wideband Arecibo Pulsar Processor (WAPP) format */ char wappP; /***** -window: Window correlator lags with a Hamming window before FFTing */ char windowP; /***** -numwapps: Number of WAPPs used with contiguous frequencies */ char numwappsP; int numwapps; int numwappsC; /***** -if: A specific IF to use if available (summed IFs is the default) */ char ifsP; int ifs; int ifsC; /***** -clip: Time-domain sigma to use for clipping (0.0 = no clipping, 6.0 = default */ char clipP; float clip; int clipC; /***** -noclip: Do not clip the data. (The default is to _always_ clip!) */ char noclipP; /***** -invert: For rawdata, flip (or invert) the band */ char invertP; /***** -zerodm: Subtract the mean of all channels from each sample (i.e. remove zero DM) */ char zerodmP; /***** -runavg: Running mean subtraction from the input data */ char runavgP; /***** -sub: Write subbands instead of de-dispersed data */ char subP; /***** -subdm: The DM to use when de-dispersing subbands for -sub */ char subdmP; double subdm; int subdmC; /***** -numout: Output this many values. If there are not enough values in the original data file, will pad the output file with the average value */ char numoutP; long numout; int numoutC; /***** -nobary: Do not barycenter the data */ char nobaryP; /***** -lodm: The lowest dispersion measure to de-disperse (cm^-3 pc) */ char lodmP; double lodm; int lodmC; /***** -dmstep: The stepsize in dispersion measure to use(cm^-3 pc) */ char dmstepP; double dmstep; int dmstepC; /***** -numdms: The number of DMs to de-disperse */ char numdmsP; int numdms; int numdmsC; /***** -nsub: The number of sub-bands to use */ char nsubP; int nsub; int nsubC; /***** -downsamp: The number of neighboring bins to co-add */ char downsampP; int downsamp; int downsampC; /***** -dmprec: The number of decimals in the precision of the DM in the filename. */ char dmprecP; int dmprec; int dmprecC; /***** -mask: File containing masking information to use */ char maskfileP; char* maskfile; int maskfileC; /***** uninterpreted command line parameters */ int argc; /*@null*/char **argv; /***** the whole command line concatenated */ char *full_cmd_line; } Cmdline; extern char *Program; extern void usage(void); extern /*@shared*/Cmdline *parseCmdline(int argc, char **argv); extern void showOptionValues(void); #endif
#pragma once /* * Copyright (C) 2005-2008 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "GUIDialogBoxBase.h" class CGUIDialogYesNo : public CGUIDialogBoxBase { public: CGUIDialogYesNo(void); virtual ~CGUIDialogYesNo(void); virtual bool OnMessage(CGUIMessage& message); virtual bool OnAction(const CAction& action); static bool ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel=-1, int iYesLabel=-1); static bool ShowAndGetInput(int heading, int line0, int line1, int line2, bool& bCanceled); static bool ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel, int iYesLabel, bool& bCanceled, unsigned int autoCloseTime = 0); static bool ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, const CStdString& noLabel="", const CStdString& yesLabel=""); static bool ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, bool &bCanceled, const CStdString& noLabel="", const CStdString& yesLabel=""); protected: bool m_bCanceled; };
/* * AtmoDefs.h: a lot of globals defines for the color computation - most of this file * is an one to one copy of "defs.h" from Atmo VDR Plugin * * See the README.txt file for copyright information and how to reach the author(s). * * $Id$ */ #ifndef _AtmoDefs_h_ #define _AtmoDefs_h_ #if defined(__LIBVLC__) # include <vlc_common.h> /* some things need to be changed if this code is used inside VideoLan Filter Module */ # define _ATMO_VLC_PLUGIN_ # define get_time mdate() # define do_sleep(a) msleep(a) #else # define MakeDword(ch1,ch2,ch3,ch4) ((((DWORD)(ch1)&255) << 24) | \ (((DWORD)(ch2)&255) << 16) | \ (((DWORD)(ch3)&255) << 8) | \ (((DWORD)(ch4)&255))) # define get_time GetTickCount() # define do_sleep(a) Sleep(a) #endif #define ATMO_BOOL bool #define ATMO_TRUE true #define ATMO_FALSE false /* can't use the VLC_TWOCC macro because the byte order there is CPU dependent but for the use in Atmo I need for this single purpose Intel Byte Order every time! */ #define MakeIntelWord(ch1,ch2) ((((int)(ch1)&255)<<8) | \ ((int)(ch2)&255)) // my own min max macros #define ATMO_MIN(X, Y) ((X) < (Y) ? (X) : (Y)) #define ATMO_MAX(X, Y) ((X) > (Y) ? (X) : (Y)) #if !defined(WIN32) #define INVALID_HANDLE_VALUE -1 typedef int HANDLE; typedef unsigned long DWORD; #define BI_RGB 0L #if !defined(_BITMAPFILEHEADER_) #define _BITMAPFILEHEADER_ typedef struct #ifdef HAVE_ATTRIBUTE_PACKED __attribute__((__packed__)) #endif { uint16_t bfType; uint32_t bfSize; uint16_t bfReserved1; uint16_t bfReserved2; uint32_t bfOffBits; } BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER; #endif #endif // maximal Anzahl Kanäle... original 5! #define CAP_MAX_NUM_ZONES 64 // only for classic to avoid changing too much code! // #define ATMO_MAX_NUM_CHANNELS 5 // capture width/height // #define CAP_WIDTH 88 #ifdef CAP_16x9 # define CAP_WIDTH 88 # define CAP_HEIGHT 48 #else # define CAP_WIDTH 64 # define CAP_HEIGHT 48 #endif // imagesize #define IMAGE_SIZE (CAP_WIDTH * CAP_HEIGHT) /* number of pixel the atmo zones should overlap - based on CAP_WIDTH and CAP_HEIGHT */ #define CAP_ZONE_OVERLAP 2 enum AtmoConnectionType { actClassicAtmo = 0, actDummy = 1, actDMX = 2, actNUL = 3, actMultiAtmo = 4, actMondolight = 5, actMoMoLight = 6, actFnordlicht = 7 }; static const char AtmoDeviceTypes[8][16] = { "Atmo-Classic", "Dummy", "DMX", "Nul-Device", "Multi-Atmo", "Mondolight", "MoMoLight", "Fnordlicht" }; #define ATMO_DEVICE_COUNT 8 #if defined(_ATMO_VLC_PLUGIN_) enum EffectMode { emUndefined = -1, emDisabled = 0, emStaticColor = 1, emLivePicture = 2 }; enum LivePictureSource { lpsDisabled = 0, lpsExtern = 2 }; #else enum EffectMode { emUndefined = -1, emDisabled = 0, emStaticColor = 1, emLivePicture = 2, emColorChange = 3, emLrColorChange = 4 }; enum LivePictureSource { lpsDisabled = 0, lpsScreenCapture = 1, lpsExtern = 2 }; #endif enum AtmoGammaCorrect { agcNone = 0, agcPerColor = 1, agcGlobal = 2 }; enum AtmoFilterMode { afmNoFilter, afmCombined, afmPercent }; // --- tRGBColor -------------------------------------------------------------- typedef struct { unsigned char r, g, b; } tRGBColor; // --- tColorPacket ----------------------------------------------------------- typedef struct { int numColors; tRGBColor zone[1]; } xColorPacket; typedef xColorPacket* pColorPacket; #define AllocColorPacket(packet, numColors_) packet = (pColorPacket)new char[sizeof(xColorPacket) + (numColors_)*sizeof(tRGBColor)]; \ packet->numColors = numColors_; #define DupColorPacket(dest, source) dest = NULL; \ if(source) { \ dest = (pColorPacket)new char[sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)]; \ memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor)); \ } #define CopyColorPacket( source, dest) memcpy(dest, source, sizeof(xColorPacket) + (source->numColors)*sizeof(tRGBColor) ); #define ZeroColorPacket( packet ) memset( &((packet)->zone[0]), 0, (packet->numColors)*sizeof(tRGBColor)); // --- tRGBColorLongInt ------------------------------------------------------- typedef struct { long int r, g, b; } tRGBColorLongInt; // --- tColorPacketLongInt ---------------------------------------------------- typedef struct { int numColors; tRGBColorLongInt longZone[1]; } xColorPacketLongInt; typedef xColorPacketLongInt* pColorPacketLongInt; #define AllocLongColorPacket(packet, numColors_) packet = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (numColors_)*sizeof(tRGBColorLongInt)]; \ packet->numColors = numColors_; #define DupLongColorPacket(dest, source) dest = NULL; \ if(source) { \ dest = (pColorPacketLongInt)new char[sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)]; \ memcpy(dest, source, sizeof(xColorPacketLongInt) + (source->numColors)*sizeof(tRGBColorLongInt)); \ } #define ZeroLongColorPacket( packet ) memset( &((packet)->longZone[0]), 0, (packet->numColors)*sizeof(tRGBColorLongInt)); // --- tWeightPacket ---------------------------------------------------------- /* typedef struct { int channel[CAP_MAX_NUM_ZONES]; } tWeightPacket; */ // --- tHSVColor -------------------------------------------------------------- typedef struct { unsigned char h, s, v; } tHSVColor; #endif
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWebEngine module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPLv3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or later as published by the Free ** Software Foundation and appearing in the file LICENSE.GPL included in ** the packaging of this file. Please review the following information to ** ensure the GNU General Public License version 2.0 requirements will be ** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QQUICKWEBENGINETESTSUPPORT_P_H #define QQUICKWEBENGINETESTSUPPORT_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <private/qtwebengineglobal_p.h> #include <QObject> #include <QUrl> QT_BEGIN_NAMESPACE class QQuickWebEngineLoadRequest; class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineErrorPage : public QObject { Q_OBJECT public: QQuickWebEngineErrorPage(); void loadFinished(bool success, const QUrl &url); void loadStarted(const QUrl &provisionalUrl); Q_SIGNALS: void loadingChanged(QQuickWebEngineLoadRequest *loadRequest); }; class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTestSupport : public QObject { Q_OBJECT Q_PROPERTY(QQuickWebEngineErrorPage *errorPage READ errorPage) public: QQuickWebEngineTestSupport(); QQuickWebEngineErrorPage *errorPage() const; private: QScopedPointer<QQuickWebEngineErrorPage> m_errorPage; }; QT_END_NAMESPACE #endif // QQUICKWEBENGINETESTSUPPORT_P_H