text
stringlengths
4
6.14k
/*++ Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: MiscBiosVendorData.c Abstract: This driver parses the mMiscSubclassDataTable structure and reports any generated data to the DataHub. **/ #include "MiscSubClassDriver.h" // // Static (possibly build generated) Bios Vendor data. // MISC_SMBIOS_TABLE_DATA(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor) = { STRING_TOKEN(STR_MISC_BIOS_VENDOR), // BiosVendor STRING_TOKEN(STR_MISC_BIOS_VERSION), // BiosVersion STRING_TOKEN(STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate 0xBABE, // BiosStartingAddress { // BiosPhysicalDeviceSize 2, // Value 3, // Exponent }, { // BiosCharacteristics1 0, // Reserved1 :2 0, // Unknown :1 1, // BiosCharacteristicsNotSupported :1 0, // IsaIsSupported :1 0, // McaIsSupported :1 0, // EisaIsSupported :1 0, // PciIsSupported :1 0, // PcmciaIsSupported :1 0, // PlugAndPlayIsSupported :1 0, // ApmIsSupported :1 0, // BiosIsUpgradable :1 0, // BiosShadowingAllowed :1 0, // VlVesaIsSupported :1 0, // EscdSupportIsAvailable :1 0, // BootFromCdIsSupported :1 0, // SelectableBootIsSupported :1 0, // RomBiosIsSocketed :1 0, // BootFromPcmciaIsSupported :1 0, // EDDSpecificationIsSupported :1 0, // JapaneseNecFloppyIsSupported :1 0, // JapaneseToshibaFloppyIsSupported :1 0, // Floppy525_360IsSupported :1 0, // Floppy525_12IsSupported :1 0, // Floppy35_720IsSupported :1 0, // Floppy35_288IsSupported :1 0, // PrintScreenIsSupported :1 0, // Keyboard8042IsSupported :1 0, // SerialIsSupported :1 0, // PrinterIsSupported :1 0, // CgaMonoIsSupported :1 0, // NecPc98 :1 0, // AcpiIsSupported :1 0, // UsbLegacyIsSupported :1 0, // AgpIsSupported :1 0, // I20BootIsSupported :1 0, // Ls120BootIsSupported :1 0, // AtapiZipDriveBootIsSupported :1 0, // Boot1394IsSupported :1 0, // SmartBatteryIsSupported :1 0, // BiosBootSpecIsSupported :1 0, // FunctionKeyNetworkBootIsSupported :1 0 // Reserved :22 }, { // BiosCharacteristics2 0, // BiosReserved :16 0, // SystemReserved :16 0 // Reserved :32 }, }; /* eof - MiscBiosVendorData.c */
/*++ Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: PostCode.c Abstract: Post Code Lib --*/ #include "EdkIIGlueDxe.h" /** Converts POST code value to status code value. This macro converts the post code to status code value. Bits 0..4 of PostCode are mapped to bits 16..20 of status code value, and bits 5..7 of PostCode are mapped to bits 24..26 of status code value. @param PostCode POST code value. @return The converted status code value. **/ #define POST_CODE_TO_STATUS_CODE_VALUE(PostCode) \ ((EFI_STATUS_CODE_VALUE) (((PostCode & 0x1f) << 16) | ((PostCode & 0x3) << 19))) /** Sends an 32-bit value to a POST card. Sends the 32-bit value specified by Value to a POST card, and returns Value. Some implementations of this library function may perform I/O operations directly to a POST card device. Other implementations may send Value to ReportStatusCode(), and the status code reporting mechanism will eventually display the 32-bit value on the status reporting device. PostCode() must actively prevent recursion. If PostCode() is called while processing another any other Report Status Code Library function, then PostCode() must return Value immediately. @param Value The 32-bit value to write to the POST card. @return Value **/ UINT32 EFIAPI GluePostCode ( IN UINT32 Value ) { REPORT_STATUS_CODE (EFI_PROGRESS_CODE, POST_CODE_TO_STATUS_CODE_VALUE (Value)); return Value; } /** Sends an 32-bit value to a POST and associated ASCII string. Sends the 32-bit value specified by Value to a POST card, and returns Value. If Description is not NULL, then the ASCII string specified by Description is also passed to the handler that displays the POST card value. Some implementations of this library function may perform I/O operations directly to a POST card device. Other implementations may send Value to ReportStatusCode(), and the status code reporting mechanism will eventually display the 32-bit value on the status reporting device. PostCodeWithDescription()must actively prevent recursion. If PostCodeWithDescription() is called while processing another any other Report Status Code Library function, then PostCodeWithDescription() must return Value immediately. @param Value The 32-bit value to write to the POST card. @param Description Pointer to an ASCII string that is a description of the POST code value. This is an optional parameter that may be NULL. @return Value **/ UINT32 EFIAPI GluePostCodeWithDescription ( IN UINT32 Value, IN CONST CHAR8 *Description OPTIONAL ) { if (Description == NULL) { REPORT_STATUS_CODE ( EFI_PROGRESS_CODE, POST_CODE_TO_STATUS_CODE_VALUE (Value) ); } else { REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( EFI_PROGRESS_CODE, POST_CODE_TO_STATUS_CODE_VALUE (Value), Description, AsciiStrSize (Description) ); } return Value; } /** Returns TRUE if POST Codes are enabled. This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of PcdPostCodeProperyMask is set. @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of PcdPostCodeProperyMask is clear. **/ BOOLEAN EFIAPI GluePostCodeEnabled ( VOID ) { return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0); } /** Returns TRUE if POST code descriptions are enabled. This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned. @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of PcdPostCodeProperyMask is set. @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of PcdPostCodeProperyMask is clear. **/ BOOLEAN EFIAPI GluePostCodeDescriptionEnabled ( VOID ) { return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0); }
/* ========================================================================== */ /* === UMF_tuple_lengths ==================================================== */ /* ========================================================================== */ /* -------------------------------------------------------------------------- */ /* Copyright (c) 2005-2012 by Timothy A. Davis, http://www.suitesparse.com. */ /* All Rights Reserved. See ../Doc/License for License. */ /* -------------------------------------------------------------------------- */ /* Determine the tuple list lengths, and the amount of memory required for */ /* them. Return the amount of memory needed to store all the tuples. */ /* This routine assumes that the tuple lists themselves are either already */ /* deallocated, or will be shortly (so Row[ ].tlen and Col[ ].tlen are */ /* overwritten) */ #include "umf_internal.h" #include "umf_tuple_lengths.h" GLOBAL Int UMF_tuple_lengths /* return memory usage */ ( NumericType *Numeric, WorkType *Work, double *p_dusage /* output argument */ ) { /* ---------------------------------------------------------------------- */ /* local variables */ /* ---------------------------------------------------------------------- */ double dusage ; Int e, nrows, ncols, nel, i, *Rows, *Cols, row, col, n_row, n_col, *E, *Row_degree, *Row_tlen, *Col_degree, *Col_tlen, usage, n1 ; Element *ep ; Unit *p ; /* ---------------------------------------------------------------------- */ /* get parameters */ /* ---------------------------------------------------------------------- */ E = Work->E ; Row_degree = Numeric->Rperm ; /* for NON_PIVOTAL_ROW macro only */ Col_degree = Numeric->Cperm ; /* for NON_PIVOTAL_COL macro only */ Row_tlen = Numeric->Uilen ; Col_tlen = Numeric->Lilen ; n_row = Work->n_row ; n_col = Work->n_col ; n1 = Work->n1 ; nel = Work->nel ; DEBUG3 (("TUPLE_LENGTHS: n_row "ID" n_col "ID" nel "ID"\n", n_row, n_col, nel)) ; ASSERT (nel < Work->elen) ; /* tuple list lengths already initialized to zero */ /* ---------------------------------------------------------------------- */ /* scan each element: count tuple list lengths (include element 0) */ /* ---------------------------------------------------------------------- */ for (e = 1 ; e <= nel ; e++) /* for all elements, in any order */ { if (E [e]) { #ifndef NDEBUG UMF_dump_element (Numeric, Work, e, FALSE) ; #endif p = Numeric->Memory + E [e] ; GET_ELEMENT_PATTERN (ep, p, Cols, Rows, ncols) ; nrows = ep->nrows ; for (i = 0 ; i < nrows ; i++) { row = Rows [i] ; ASSERT (row == EMPTY || (row >= n1 && row < n_row)) ; if (row >= n1) { ASSERT (NON_PIVOTAL_ROW (row)) ; Row_tlen [row] ++ ; } } for (i = 0 ; i < ncols ; i++) { col = Cols [i] ; ASSERT (col == EMPTY || (col >= n1 && col < n_col)) ; if (col >= n1) { ASSERT (NON_PIVOTAL_COL (col)) ; Col_tlen [col] ++ ; } } } } /* note: tuple lengths are now modified, but the tuple lists are not */ /* updated to reflect that fact. */ /* ---------------------------------------------------------------------- */ /* determine the required memory to hold all the tuple lists */ /* ---------------------------------------------------------------------- */ DEBUG0 (("UMF_build_tuples_usage\n")) ; usage = 0 ; dusage = 0 ; ASSERT (Col_tlen && Col_degree) ; for (col = n1 ; col < n_col ; col++) { if (NON_PIVOTAL_COL (col)) { usage += 1 + UNITS (Tuple, TUPLES (Col_tlen [col])) ; dusage += 1 + DUNITS (Tuple, TUPLES (Col_tlen [col])) ; DEBUG0 ((" col: "ID" tlen "ID" usage so far: "ID"\n", col, Col_tlen [col], usage)) ; } } ASSERT (Row_tlen && Row_degree) ; for (row = n1 ; row < n_row ; row++) { if (NON_PIVOTAL_ROW (row)) { usage += 1 + UNITS (Tuple, TUPLES (Row_tlen [row])) ; dusage += 1 + DUNITS (Tuple, TUPLES (Row_tlen [row])) ; DEBUG0 ((" row: "ID" tlen "ID" usage so far: "ID"\n", row, Row_tlen [row], usage)) ; } } DEBUG0 (("UMF_build_tuples_usage "ID" %g\n", usage, dusage)) ; *p_dusage = dusage ; return (usage) ; }
/** * Copyright (c) 2015-present, Parse, LLC. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import "PFRESTCommand.h" NS_ASSUME_NONNULL_BEGIN @interface PFRESTUserCommand : PFRESTCommand @property (nonatomic, assign, readonly) BOOL revocableSessionEnabled; ///-------------------------------------- #pragma mark - Log In ///-------------------------------------- + (instancetype)logInUserCommandWithUsername:(NSString *)username password:(NSString *)password revocableSession:(BOOL)revocableSessionEnabled error:(NSError **)error; + (instancetype)serviceLoginUserCommandWithAuthenticationType:(NSString *)authenticationType authenticationData:(NSDictionary *)authenticationData revocableSession:(BOOL)revocableSessionEnabled error:(NSError **)error; + (instancetype)serviceLoginUserCommandWithParameters:(NSDictionary *)parameters revocableSession:(BOOL)revocableSessionEnabled sessionToken:(nullable NSString *)sessionToken error:(NSError **)error; ///-------------------------------------- #pragma mark - Sign Up ///-------------------------------------- + (instancetype)signUpUserCommandWithParameters:(NSDictionary *)parameters revocableSession:(BOOL)revocableSessionEnabled sessionToken:(nullable NSString *)sessionToken error:(NSError **)error; ///-------------------------------------- #pragma mark - Current User ///-------------------------------------- + (instancetype)getCurrentUserCommandWithSessionToken:(NSString *)sessionToken error:(NSError **)error; + (instancetype)upgradeToRevocableSessionCommandWithSessionToken:(NSString *)sessionToken error:(NSError **)error; + (instancetype)logOutUserCommandWithSessionToken:(NSString *)sessionToken error:(NSError **)error; ///-------------------------------------- #pragma mark - Password Rest ///-------------------------------------- + (instancetype)resetPasswordCommandForUserWithEmail:(NSString *)email error:(NSError **)error; @end NS_ASSUME_NONNULL_END
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ #define _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ #include "mitkBaseProperty.h" #include "mitkIsoDoseLevelCollections.h" #include "MitkDicomRTExports.h" namespace mitk { /** \brief Property class for dose iso level sets. */ class MITKDICOMRT_EXPORT IsoDoseLevelSetProperty : public BaseProperty { protected: IsoDoseLevelSet::Pointer m_IsoLevelSet; IsoDoseLevelSetProperty(); IsoDoseLevelSetProperty(const IsoDoseLevelSetProperty& other); IsoDoseLevelSetProperty(IsoDoseLevelSet* levelSet); public: mitkClassMacro(IsoDoseLevelSetProperty, BaseProperty); itkNewMacro(IsoDoseLevelSetProperty); mitkNewMacro1Param(IsoDoseLevelSetProperty, IsoDoseLevelSet*); typedef IsoDoseLevelSet ValueType; virtual ~IsoDoseLevelSetProperty(); const IsoDoseLevelSet * GetIsoDoseLevelSet() const; const IsoDoseLevelSet * GetValue() const; IsoDoseLevelSet * GetIsoDoseLevelSet(); IsoDoseLevelSet * GetValue(); void SetIsoDoseLevelSet(IsoDoseLevelSet* levelSet); void SetValue(IsoDoseLevelSet* levelSet); virtual std::string GetValueAsString() const override; using BaseProperty::operator=; private: // purposely not implemented IsoDoseLevelSetProperty& operator=(const IsoDoseLevelSetProperty&); itk::LightObject::Pointer InternalClone() const override; virtual bool IsEqual(const BaseProperty& property) const override; virtual bool Assign(const BaseProperty& property) override; }; } // namespace mitk #endif /* _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ */
// 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 COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ #define COMPONENTS_USER_PREFS_TRACKED_PREF_HASH_FILTER_H_ #include <stddef.h> #include <map> #include <memory> #include <set> #include <vector> #include "base/callback.h" #include "base/compiler_specific.h" #include "base/containers/scoped_ptr_hash_map.h" #include "base/macros.h" #include "components/user_prefs/tracked/interceptable_pref_filter.h" #include "components/user_prefs/tracked/tracked_preference.h" class PrefHashStore; class PrefService; class PrefStore; class TrackedPreferenceValidationDelegate; namespace base { class DictionaryValue; class Time; class Value; } // namespace base namespace user_prefs { class PrefRegistrySyncable; } // namespace user_prefs // Intercepts preference values as they are loaded from disk and verifies them // using a PrefHashStore. Keeps the PrefHashStore contents up to date as values // are changed. class PrefHashFilter : public InterceptablePrefFilter { public: enum EnforcementLevel { NO_ENFORCEMENT, ENFORCE_ON_LOAD }; enum PrefTrackingStrategy { // Atomic preferences are tracked as a whole. TRACKING_STRATEGY_ATOMIC, // Split preferences are dictionaries for which each top-level entry is // tracked independently. Note: preferences using this strategy must be kept // in sync with TrackedSplitPreferences in histograms.xml. TRACKING_STRATEGY_SPLIT, }; enum ValueType { VALUE_IMPERSONAL, // The preference value may contain personal information. VALUE_PERSONAL, }; struct TrackedPreferenceMetadata { size_t reporting_id; const char* name; EnforcementLevel enforcement_level; PrefTrackingStrategy strategy; ValueType value_type; }; // Constructs a PrefHashFilter tracking the specified |tracked_preferences| // using |pref_hash_store| to check/store hashes. An optional |delegate| is // notified of the status of each preference as it is checked. // If |on_reset_on_load| is provided, it will be invoked if a reset occurs in // FilterOnLoad. // |reporting_ids_count| is the count of all possible IDs (possibly greater // than |tracked_preferences.size()|). If |report_super_mac_validity| is true, // the state of the super MAC will be reported via UMA during // FinalizeFilterOnLoad. PrefHashFilter( std::unique_ptr<PrefHashStore> pref_hash_store, const std::vector<TrackedPreferenceMetadata>& tracked_preferences, const base::Closure& on_reset_on_load, TrackedPreferenceValidationDelegate* delegate, size_t reporting_ids_count, bool report_super_mac_validity); ~PrefHashFilter() override; // Registers required user preferences. static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); // Retrieves the time of the last reset event, if any, for the provided user // preferences. If no reset has occurred, Returns a null |Time|. static base::Time GetResetTime(PrefService* user_prefs); // Clears the time of the last reset event, if any, for the provided user // preferences. static void ClearResetTime(PrefService* user_prefs); // Initializes the PrefHashStore with hashes of the tracked preferences in // |pref_store_contents|. |pref_store_contents| will be the |storage| passed // to PrefHashStore::BeginTransaction(). void Initialize(base::DictionaryValue* pref_store_contents); // PrefFilter remaining implementation. void FilterUpdate(const std::string& path) override; void FilterSerializeData(base::DictionaryValue* pref_store_contents) override; private: // InterceptablePrefFilter implementation. void FinalizeFilterOnLoad( const PostFilterOnLoadCallback& post_filter_on_load_callback, std::unique_ptr<base::DictionaryValue> pref_store_contents, bool prefs_altered) override; // Callback to be invoked only once (and subsequently reset) on the next // FilterOnLoad event. It will be allowed to modify the |prefs| handed to // FilterOnLoad before handing them back to this PrefHashFilter. FilterOnLoadInterceptor filter_on_load_interceptor_; // A map of paths to TrackedPreferences; this map owns this individual // TrackedPreference objects. typedef base::ScopedPtrHashMap<std::string, std::unique_ptr<TrackedPreference>> TrackedPreferencesMap; // A map from changed paths to their corresponding TrackedPreferences (which // aren't owned by this map). typedef std::map<std::string, const TrackedPreference*> ChangedPathsMap; std::unique_ptr<PrefHashStore> pref_hash_store_; // Invoked if a reset occurs in a call to FilterOnLoad. const base::Closure on_reset_on_load_; TrackedPreferencesMap tracked_paths_; // The set of all paths whose value has changed since the last call to // FilterSerializeData. ChangedPathsMap changed_paths_; // Whether to report the validity of the super MAC at load time (via UMA). bool report_super_mac_validity_; DISALLOW_COPY_AND_ASSIGN(PrefHashFilter); }; #endif // COMPONENTS_PREFS_TRACKED_PREF_HASH_FILTER_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_DEVTOOLS_V8_SAMPLING_PROFILER_H_ #define CONTENT_RENDERER_DEVTOOLS_V8_SAMPLING_PROFILER_H_ #include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" #include "base/trace_event/trace_event_impl.h" #include "content/common/content_export.h" namespace content { class Sampler; class V8SamplingThread; // The class monitors enablement of V8 CPU profiler and // spawns a sampling thread when needed. class CONTENT_EXPORT V8SamplingProfiler final : public base::trace_event::TraceLog::EnabledStateObserver { public: explicit V8SamplingProfiler(bool underTest = false); ~V8SamplingProfiler(); // Implementation of TraceLog::EnabledStateObserver void OnTraceLogEnabled() override; void OnTraceLogDisabled() override; void EnableSamplingEventForTesting(int code_added_events, int sample_events); void WaitSamplingEventForTesting(); private: void StartSamplingThread(); void StopSamplingThread(); scoped_ptr<base::WaitableEvent> waitable_event_for_testing_; scoped_ptr<V8SamplingThread> sampling_thread_; scoped_ptr<Sampler> render_thread_sampler_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; DISALLOW_COPY_AND_ASSIGN(V8SamplingProfiler); }; } // namespace content #endif // CONTENT_RENDERER_DEVTOOLS_V8_SAMPLING_PROFILER_H_
/*========================================================================= Program: Visualization Toolkit Module: QVTKWin32Header.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /*------------------------------------------------------------------------- Copyright 2008 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ #ifndef __QVTKWin32Header_h #define __QVTKWin32Header_h #include "vtkConfigure.h" #include "vtkABI.h" #if defined(VTK_BUILD_SHARED_LIBS) # if defined(QVTK_EXPORTS) || defined(QVTKWidgetPlugin_EXPORTS) # define QVTK_EXPORT VTK_ABI_EXPORT # else # define QVTK_EXPORT VTK_ABI_IMPORT # endif #else # define QVTK_EXPORT #endif #endif /*__QVTKWin32Header_h*/
// // hsc3.cpp structures // #ifndef __hsc3_h #define __hsc3_h #define HSC3TITLE "HSP script preprocessor" #define HSC3TITLE2 "HSP code generator" #define HSC3_OPT_NOHSPDEF 1 #define HSC3_OPT_DEBUGMODE 2 #define HSC3_OPT_MAKEPACK 4 #define HSC3_OPT_READAHT 8 #define HSC3_OPT_MAKEAHT 16 #define HSC3_OPT_UTF8IN 32 // UTF8ソースを入力 #define HSC3_OPT_UTF8OUT 64 // UTF8コードを出力 #define HSC3_MODE_DEBUG 1 #define HSC3_MODE_DEBUGWIN 2 #define HSC3_MODE_UTF8 4 // UTF8コードを出力 class CMemBuf; class CToken; /* rev 54 lb_info の型を void * から CLabel * に変更。 hsc3.cpp:207 mingw : warning : void * 型の delete は未定義 に対処。 */ class CLabel; // HSC3 class class CHsc3 { public: CHsc3(); ~CHsc3(); char *GetError( void ); int GetErrorSize( void ); void ResetError( void ); int PreProcess( char *fname, char *outname, int option, char *rname, void *ahtoption=NULL ); int PreProcessAht( char *fname, void *ahtoption, int mode=0 ); void PreProcessEnd( void ); int Compile( char *fname, char *outname, int mode ); void SetCommonPath( char *path ); // Service int GetCmdList( int option ); int OpenPackfile( void ); void ClosePackfile( void ); void GetPackfileOption( char *out, char *keyword, char *defval ); int GetPackfileOptionInt( char *keyword, int defval ); int GetRuntimeFromHeader( char *fname, char *res ); int SaveOutbuf( char *fname ); int SaveAHTOutbuf( char *fname ); // Data // CMemBuf *errbuf; CMemBuf *pfbuf; CMemBuf *addkw; CMemBuf *outbuf; CMemBuf *ahtbuf; private: // Private Data // int process_option; void AddSystemMacros( CToken *tk, int option ); char common_path[512]; // common path // for Header info int hed_option; char hed_runtime[64]; // for Compile Optimize int cmpopt; CLabel *lb_info; }; #endif
/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef SRC_VIDEO_ENGINE_TEST_AUTO_TEST_HELPERS_RANDOM_ENCRYPTION_H_ #define SRC_VIDEO_ENGINE_TEST_AUTO_TEST_HELPERS_RANDOM_ENCRYPTION_H_ #include "webrtc/common_types.h" // These algorithms attempt to create an uncrackable encryption // scheme by completely disregarding the input data. class RandomEncryption : public webrtc::Encryption { public: explicit RandomEncryption(unsigned int rand_seed); virtual void encrypt(int channel_no, unsigned char* in_data, unsigned char* out_data, int bytes_in, int* bytes_out) { GenerateRandomData(out_data, bytes_in, bytes_out); } virtual void decrypt(int channel_no, unsigned char* in_data, unsigned char* out_data, int bytes_in, int* bytes_out) { GenerateRandomData(out_data, bytes_in, bytes_out); } virtual void encrypt_rtcp(int channel_no, unsigned char* in_data, unsigned char* out_data, int bytes_in, int* bytes_out) { GenerateRandomData(out_data, bytes_in, bytes_out); } virtual void decrypt_rtcp(int channel_no, unsigned char* in_data, unsigned char* out_data, int bytes_in, int* bytes_out) { GenerateRandomData(out_data, bytes_in, bytes_out); } private: // Generates some completely random data with roughly the right length. void GenerateRandomData(unsigned char* out_data, int bytes_in, int* bytes_out); // Makes up a length within +- 50 of the original length, without // overstepping the contract for encrypt / decrypt. int MakeUpSimilarLength(int original_length); }; #endif // SRC_VIDEO_ENGINE_TEST_AUTO_TEST_HELPERS_RANDOM_ENCRYPTION_H_
/* * definition for store system information stsi * * Copyright IBM Corp. 2001, 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License (version 2 only) * as published by the Free Software Foundation. * * Author(s): Ulrich Weigand <weigand@de.ibm.com> * Christian Borntraeger <borntraeger@de.ibm.com> */ #ifndef __ASM_S390_SYSINFO_H #define __ASM_S390_SYSINFO_H #include <asm/bitsperlong.h> #include <linux/uuid.h> struct sysinfo_1_1_1 { unsigned char p:1; unsigned char :6; unsigned char t:1; unsigned char :8; unsigned char ccr; unsigned char cai; char reserved_0[28]; char manufacturer[16]; char type[4]; char reserved_1[12]; char model_capacity[16]; char sequence[16]; char plant[4]; char model[16]; char model_perm_cap[16]; char model_temp_cap[16]; unsigned int model_cap_rating; unsigned int model_perm_cap_rating; unsigned int model_temp_cap_rating; unsigned char typepct[5]; unsigned char reserved_2[3]; unsigned int ncr; unsigned int npr; unsigned int ntr; }; struct sysinfo_1_2_1 { char reserved_0[80]; char sequence[16]; char plant[4]; char reserved_1[2]; unsigned short cpu_address; }; struct sysinfo_1_2_2 { char format; char reserved_0[1]; unsigned short acc_offset; unsigned char mt_installed :1; unsigned char :2; unsigned char mt_stid :5; unsigned char :3; unsigned char mt_gtid :5; char reserved_1[18]; unsigned int nominal_cap; unsigned int secondary_cap; unsigned int capability; unsigned short cpus_total; unsigned short cpus_configured; unsigned short cpus_standby; unsigned short cpus_reserved; unsigned short adjustment[0]; }; struct sysinfo_1_2_2_extension { unsigned int alt_capability; unsigned short alt_adjustment[0]; }; struct sysinfo_2_2_1 { char reserved_0[80]; char sequence[16]; char plant[4]; unsigned short cpu_id; unsigned short cpu_address; }; struct sysinfo_2_2_2 { char reserved_0[32]; unsigned short lpar_number; char reserved_1; unsigned char characteristics; unsigned short cpus_total; unsigned short cpus_configured; unsigned short cpus_standby; unsigned short cpus_reserved; char name[8]; unsigned int caf; char reserved_2[8]; unsigned char mt_installed :1; unsigned char :2; unsigned char mt_stid :5; unsigned char :3; unsigned char mt_gtid :5; unsigned char :3; unsigned char mt_psmtid :5; char reserved_3[5]; unsigned short cpus_dedicated; unsigned short cpus_shared; }; #define LPAR_CHAR_DEDICATED (1 << 7) #define LPAR_CHAR_SHARED (1 << 6) #define LPAR_CHAR_LIMITED (1 << 5) struct sysinfo_3_2_2 { char reserved_0[31]; unsigned char :4; unsigned char count:4; struct { char reserved_0[4]; unsigned short cpus_total; unsigned short cpus_configured; unsigned short cpus_standby; unsigned short cpus_reserved; char name[8]; unsigned int caf; char cpi[16]; char reserved_1[3]; char ext_name_encoding; unsigned int reserved_2; uuid_be uuid; } vm[8]; char reserved_3[1504]; char ext_names[8][256]; }; extern int topology_max_mnest; #define TOPOLOGY_CORE_BITS 64 #define TOPOLOGY_NR_MAG 6 struct topology_core { unsigned char nl; unsigned char reserved0[3]; unsigned char :6; unsigned char pp:2; unsigned char reserved1; unsigned short origin; unsigned long mask[TOPOLOGY_CORE_BITS / BITS_PER_LONG]; }; struct topology_container { unsigned char nl; unsigned char reserved[6]; unsigned char id; }; union topology_entry { unsigned char nl; struct topology_core cpu; struct topology_container container; }; struct sysinfo_15_1_x { unsigned char reserved0[2]; unsigned short length; unsigned char mag[TOPOLOGY_NR_MAG]; unsigned char reserved1; unsigned char mnest; unsigned char reserved2[4]; union topology_entry tle[0]; }; int stsi(void *sysinfo, int fc, int sel1, int sel2); /* * Service level reporting interface. */ struct service_level { struct list_head list; void (*seq_print)(struct seq_file *, struct service_level *); }; int register_service_level(struct service_level *); int unregister_service_level(struct service_level *); #endif /* __ASM_S390_SYSINFO_H */
#ifndef __AaptExt__OpenAtlasResource__ #define __AaptExt__OpenAtlasResource__ #include <stdio.h> #include <string> #include <iostream> #include <map> class OpenAtlasResource { map<std::string,int> animMaps; map<std::string,int> animatorMaps; map<std::string,int> arrayMaps; map<std::string,int> attrMaps; map<std::string,int> boolMaps; map<std::string,int> colorMaps; map<std::string,int> dimenMaps; map<std::string,int> drawableMaps; map<std::string,int> fractionMaps; map<std::string,int> idMaps; map<std::string,int> integerMaps; map<std::string,int> interpolatorMaps; map<std::string,int> layoutMaps; map<std::string,int> menuMaps; map<std::string,int> mipmapMaps; map<std::string,int> pluralsMaps; map<std::string,int> rawMaps; map<std::string,int> stringMaps; map<std::string,int> styleMaps; map<std::string,int> transitionMaps; map<std::string,int> xmlMaps; public: // start gen function anim void setAnim(std::string resName,int resId); int getAnim(std::string resName); // end gen function anim // start gen function animator void setAnimator(std::string resName,int resId); int getAnimator(std::string resName); // end gen function animator // start gen function array void setArray(std::string resName,int resId); int getArray(std::string resName); // end gen function array // start gen function attr void setAttr(std::string resName,int resId); int getAttr(std::string resName); // end gen function attr // start gen function bool void setBool(std::string resName,int resId); int getBool(std::string resName); // end gen function bool // start gen function color void setColor(std::string resName,int resId); int getColor(std::string resName); // end gen function color // start gen function dimen void setDimen(std::string resName,int resId); int getDimen(std::string resName); // end gen function dimen // start gen function drawable void setDrawable(std::string resName,int resId); int getDrawable(std::string resName); // end gen function drawable // start gen function fraction void setFraction(std::string resName,int resId); int getFraction(std::string resName); // end gen function fraction // start gen function id void setId(std::string resName,int resId); int getId(std::string resName); // end gen function id // start gen function integer void setInteger(std::string resName,int resId); int getInteger(std::string resName); // end gen function integer // start gen function interpolator void setInterpolator(std::string resName,int resId); int getInterpolator(std::string resName); // end gen function interpolator // start gen function layout void setLayout(std::string resName,int resId); int getLayout(std::string resName); // end gen function layout // start gen function menu void setMenu(std::string resName,int resId); int getMenu(std::string resName); // end gen function menu // start gen function mipmap void setMipmap(std::string resName,int resId); int getMipmap(std::string resName); // end gen function mipmap // start gen function plurals void setPlurals(std::string resName,int resId); int getPlurals(std::string resName); // end gen function plurals // start gen function raw void setRaw(std::string resName,int resId); int getRaw(std::string resName); // end gen function raw // start gen function string void setString(std::string resName,int resId); int getString(std::string resName); // end gen function string // start gen function style void setStyle(std::string resName,int resId); int getStyle(std::string resName); // end gen function style // start gen function transition void setTransition(std::string resName,int resId); int getTransition(std::string resName); // end gen function transition // start gen function xml void setXml(std::string resName,int resId); int getXml(std::string resName); // end gen function xml }; #endif
/* getopt.c */ #include <errno.h> #include <string.h> #include <stdio.h> int xoptind = 1; /* index of which argument is next */ char *xoptarg; /* pointer to argument of current option */ int xopterr = 0; /* allow error message */ static char *letP = NULL; /* remember next option char's location */ char SW = '-'; /* DOS switch character, either '-' or '/' */ /* Parse the command line options, System V style. Standard option syntax is: option ::= SW [optLetter]* [argLetter space* argument] */ int xgetopt(int argc, char *argv[], char *optionS) { unsigned char ch; char *optP; if (SW == 0) { SW = '/'; } if (argc > xoptind) { if (letP == NULL) { if ((letP = argv[xoptind]) == NULL || *(letP++) != SW) goto gopEOF; if (*letP == SW) { xoptind++; goto gopEOF; } } if (0 == (ch = *(letP++))) { xoptind++; goto gopEOF; } if (':' == ch || (optP = strchr(optionS, ch)) == NULL) goto gopError; if (':' == *(++optP)) { xoptind++; if (0 == *letP) { if (argc <= xoptind) goto gopError; letP = argv[xoptind++]; } xoptarg = letP; letP = NULL; } else { if (0 == *letP) { xoptind++; letP = NULL; } xoptarg = NULL; } return ch; } gopEOF: xoptarg = letP = NULL; return EOF; gopError: xoptarg = NULL; errno = EINVAL; if (xopterr) perror ("get command line option"); return ('?'); }
// // UIButton+Position.h // @import UIKit; @interface UIButton (Position) /*! * Sets position of title in the button below image in the button */ - (void)hay_setTitleBelowWithSpacing:(CGFloat)spacing; /*! * Sets position of title in the button above image in the button */ //- (void)setTitleAboveWithSpacing:(CGFloat)spacing; /*! * Sets position of title in the button right of the image in the button (default) */ //- (void)setTitleRightWithSpacing:(CGFloat)spacing; /*! * Sets position of title in the button left of the image in the button */ //- (void)setTitleLeftWithSpacing:(CGFloat)spacing; @end
/* * toolbarview.h * * Created on: 14.06.2012 * @author Ralph Schurade */ #ifndef TOOLBARVIEW_H_ #define TOOLBARVIEW_H_ #include "../../data/enums.h" #include <QAbstractItemView> class ToolBarView : public QAbstractItemView { Q_OBJECT public: ToolBarView( QWidget* parent = 0 ); virtual ~ToolBarView(); QRect visualRect( const QModelIndex &index ) const; void scrollTo( const QModelIndex &index, ScrollHint hint = EnsureVisible ); QModelIndex indexAt( const QPoint &point ) const; QModelIndex moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ); int horizontalOffset() const; int verticalOffset() const; bool isIndexHidden( const QModelIndex &index ) const; void setSelection( const QRect &rect, QItemSelectionModel::SelectionFlags flags ); QRegion visualRegionForSelection( const QItemSelection &selection ) const; int getSelected(); public slots: void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected ); private: int m_selected; signals: void sigSelectionChanged( int type ); }; #endif /* TOOLBARVIEW_H_ */
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2011 Torus Knot Software Ltd Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de> 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 __Polygon_H__ #define __Polygon_H__ #include "OgrePrerequisites.h" #include "OgreVector3.h" namespace Ogre { /** \addtogroup Core * @{ */ /** \addtogroup Math * @{ */ /** The class represents a polygon in 3D space. @remarks It is made up of 3 or more vertices in a single plane, listed in counter-clockwise order. */ class _OgreExport Polygon { public: typedef vector<Vector3>::type VertexList; typedef multimap<Vector3, Vector3>::type EdgeMap; typedef std::pair< Vector3, Vector3> Edge; protected: VertexList mVertexList; mutable Vector3 mNormal; mutable bool mIsNormalSet; /** Updates the normal. */ void updateNormal(void) const; public: Polygon(); ~Polygon(); Polygon( const Polygon& cpy ); /** Inserts a vertex at a specific position. @note Vertices must be coplanar. */ void insertVertex(const Vector3& vdata, size_t vertexIndex); /** Inserts a vertex at the end of the polygon. @note Vertices must be coplanar. */ void insertVertex(const Vector3& vdata); /** Returns a vertex. */ const Vector3& getVertex(size_t vertex) const; /** Sets a specific vertex of a polygon. @note Vertices must be coplanar. */ void setVertex(const Vector3& vdata, size_t vertexIndex); /** Removes duplicate vertices from a polygon. */ void removeDuplicates(void); /** Vertex count. */ size_t getVertexCount(void) const; /** Returns the polygon normal. */ const Vector3& getNormal(void) const; /** Deletes a specific vertex. */ void deleteVertex(size_t vertex); /** Determines if a point is inside the polygon. @remarks A point is inside a polygon if it is both on the polygon's plane, and within the polygon's bounds. Polygons are assumed to be convex and planar. */ bool isPointInside(const Vector3& point) const; /** Stores the edges of the polygon in ccw order. The vertices are copied so the user has to take the deletion into account. */ void storeEdges(EdgeMap *edgeMap) const; /** Resets the object. */ void reset(void); /** Determines if the current object is equal to the compared one. */ bool operator == (const Polygon& rhs) const; /** Determines if the current object is not equal to the compared one. */ bool operator != (const Polygon& rhs) const { return !( *this == rhs ); } /** Prints out the polygon data. */ _OgreExport friend std::ostream& operator<< ( std::ostream& strm, const Polygon& poly ); }; /** @} */ /** @} */ } #endif
/* * How we use DRAM on Allwinner CPUs * * Copyright (C) 2014 Alexandru Gagniuc <mr.nuke.me@gmail.com> * Subject to the GNU GPL v2, or (at your option) any later version. */ #include <config.h> /* * Put CBMEM at top of RAM */ static inline void *a1x_get_cbmem_top(void) { return (void *)CONFIG_SYS_SDRAM_BASE + (CONFIG_DRAM_SIZE_MB << 20); } /* * By CBFS cache, we mean a cached copy, in RAM, of the entire CBFS region. */ static inline void *a1x_get_cbfs_cache_top(void) { /* Arbitrary 16 MiB gap for cbmem tables and bouncebuffer */ return a1x_get_cbmem_top() - (16 << 20); } static inline void *a1x_get_cbfs_cache_base(void) { return a1x_get_cbfs_cache_top() - CONFIG_ROM_SIZE; }
/* This testcase is part of GDB, the GNU debugger. Copyright 2008, 2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Check that GDB isn't messing the SIGCHLD mask while creating an inferior. */ #include <signal.h> #include <stdlib.h> int main () { sigset_t mask; sigemptyset (&mask); sigprocmask (SIG_BLOCK, NULL, &mask); if (!sigismember (&mask, SIGCHLD)) return 0; /* good, not blocked */ else return 1; /* bad, blocked */ }
/* * * Copyright (c) International Business Machines Corp., 2002 * * 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 */ /* * http://www.opengroup.org/onlinepubs/009695399/functions/sysconf.html * * NAME : * sysconf01 : test for sysconf( get configurable system variables) sys call. * * USAGE : * sysconf01 */ #define _GNU_SOURCE 1 #include <stdio.h> #include <sys/types.h> #include <errno.h> #include <unistd.h> #define INVAL_FLAG -1 /** LTP Port **/ #include "test.h" #include "usctest.h" char *TCID = "sysconf01"; int TST_TOTAL = 56; static void _test_sysconf(long name, const char *strname) { long retval; /* make sure we reset this as sysconf() will not */ errno = 0; retval = sysconf(name); if (retval == -1) { /* * The manpage for sysconf(2) specifically states that: * 1. If -1 is returned and errno is EINVAL, then the resource * name doesn't exist. * 2. If errno remains 0, then the limit isn't implemented. * 3. Else, something weird happened with the syscall. */ switch (errno) { case EINVAL: tst_resm(TCONF, "Resource doesn't exist: %s", strname); break; case 0: tst_resm(TCONF, "Not supported sysconf resource: %s", strname); break; default: tst_resm(TFAIL | TERRNO, "Unexpected errno value for " "%s", strname); break; } } else tst_resm(TPASS, "%s = %li", strname, retval); } #define test_sysconf(name) _test_sysconf(name, #name) int main(void) { /* 1 - 5 */ test_sysconf(_SC_CLK_TCK); test_sysconf(_SC_ARG_MAX); test_sysconf(_SC_CHILD_MAX); test_sysconf(_SC_OPEN_MAX); test_sysconf(_SC_JOB_CONTROL); /* 6 - 10 */ test_sysconf(_SC_SAVED_IDS); test_sysconf(_SC_VERSION); test_sysconf(_SC_PASS_MAX); test_sysconf(_SC_LOGIN_NAME_MAX); test_sysconf(_SC_XOPEN_VERSION); /* 11 - 15 */ test_sysconf(_SC_TZNAME_MAX); test_sysconf(_SC_STREAM_MAX); test_sysconf(_SC_XOPEN_CRYPT); test_sysconf(_SC_XOPEN_ENH_I18N); test_sysconf(_SC_XOPEN_SHM); /* 16 - 20 */ test_sysconf(_SC_XOPEN_XCU_VERSION); test_sysconf(_SC_ATEXIT_MAX); test_sysconf(_SC_2_C_BIND); test_sysconf(_SC_2_C_DEV); test_sysconf(_SC_2_C_VERSION); /* 21 - 25 */ test_sysconf(_SC_2_CHAR_TERM); test_sysconf(_SC_2_FORT_DEV); test_sysconf(_SC_2_FORT_RUN); test_sysconf(_SC_2_LOCALEDEF); test_sysconf(_SC_2_SW_DEV); /* 26 - 30 */ test_sysconf(_SC_2_UPE); test_sysconf(_SC_2_VERSION); test_sysconf(_SC_BC_BASE_MAX); test_sysconf(_SC_BC_DIM_MAX); test_sysconf(_SC_BC_SCALE_MAX); /* 31 - 35 */ test_sysconf(_SC_BC_STRING_MAX); test_sysconf(_SC_COLL_WEIGHTS_MAX); test_sysconf(_SC_EXPR_NEST_MAX); test_sysconf(_SC_LINE_MAX); test_sysconf(_SC_RE_DUP_MAX); /* 36 - 40 */ test_sysconf(_SC_XOPEN_UNIX); test_sysconf(_SC_PAGESIZE); test_sysconf(_SC_PHYS_PAGES); test_sysconf(_SC_AVPHYS_PAGES); test_sysconf(_SC_AIO_MAX); /* 41 - 45 */ test_sysconf(_SC_AIO_PRIO_DELTA_MAX); test_sysconf(_SC_SEMAPHORES); test_sysconf(_SC_SEM_NSEMS_MAX); test_sysconf(_SC_SEM_VALUE_MAX); test_sysconf(_SC_MEMORY_PROTECTION); /* 46 - 50 */ test_sysconf(_SC_FSYNC); test_sysconf(_SC_MEMORY_PROTECTION); test_sysconf(_SC_TIMERS); test_sysconf(_SC_TIMER_MAX); test_sysconf(_SC_MAPPED_FILES); /* 51 - 55 */ test_sysconf(_SC_THREAD_PRIORITY_SCHEDULING); test_sysconf(_SC_XOPEN_LEGACY); test_sysconf(_SC_MEMLOCK); test_sysconf(_SC_XBS5_ILP32_OFF32); test_sysconf(_SC_XBS5_ILP32_OFFBIG); /* 56 */ { int retval, actual; errno = 0; retval = sysconf(INVAL_FLAG); actual = errno; if (retval != -1) { tst_resm(TFAIL, "sysconf succeeded for invalid flag (%i), " " retval=%d errno=%d: %s", INVAL_FLAG, retval, actual, strerror(actual)); } else if (actual != EINVAL) { tst_resm(TFAIL, "sysconf correctly failed, but expected " "errno (%i) != actual (%i)", EINVAL, actual); } else tst_resm(TPASS, "The invalid sysconf key was trapped " "appropriately"); } tst_exit(); }
/*-------------------------------------------------------------------------+ | This file contains the PC386 BSP startup package. It includes application, | board, and monitor specific initialization and configuration. The generic CPU | dependent initialization has been performed before this routine is invoked. +--------------------------------------------------------------------------+ | (C) Copyright 1997 - | - NavIST Group - Real-Time Distributed Systems and Industrial Automation | | http://pandora.ist.utl.pt | | Instituto Superior Tecnico * Lisboa * PORTUGAL +--------------------------------------------------------------------------+ | Disclaimer: | | This file is provided "AS IS" without warranty of any kind, either | expressed or implied. +--------------------------------------------------------------------------+ | This code is based on: | bspstart.c,v 1.8 1996/05/28 13:12:40 joel Exp - go32 BSP | With the following copyright notice: | ************************************************************************** | * COPYRIGHT (c) 1989-2008. | * On-Line Applications Research Corporation (OAR). | * | * The license and distribution terms for this file may be | * found in the file LICENSE in this distribution or at | * http://www.rtems.com/license/LICENSE. | ************************************************************************** +--------------------------------------------------------------------------*/ #include <bsp.h> #include <bsp/irq.h> #include <rtems/pci.h> #include <libcpu/cpuModel.h> /* * External routines */ extern void Calibrate_loop_1ms(void); extern void rtems_irq_mngt_init(void); extern void bsp_size_memory(void); void Clock_driver_install_handler(void); /*-------------------------------------------------------------------------+ | Function: bsp_start | Description: Called before main is invoked. | Global Variables: None. | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ void bsp_start_default( void ) { int pci_init_retval; /* * We need to determine how much memory there is in the system. */ bsp_size_memory(); /* * Calibrate variable for 1ms-loop (see timer.c) */ Calibrate_loop_1ms(); /* * Init rtems interrupt management */ rtems_irq_mngt_init(); /* * Init rtems exceptions management */ rtems_exception_init_mngt(); /* * init PCI Bios interface... */ pci_init_retval = pci_initialize(); if (pci_init_retval != PCIB_ERR_SUCCESS) { printk("PCI bus: could not initialize PCI BIOS interface\n"); } Clock_driver_install_handler(); bsp_ide_cmdline_init(); } /* bsp_start */ /* * By making this a weak alias for bsp_start_default, a brave soul * can override the actual bsp_start routine used. */ void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));
/* * Asterisk -- An open source telephony toolkit. * * Copyright (C) 2013, Digium, Inc. * * Jason Parker <jparker@digium.com> * * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. */ /*! \file * * \brief System AMI event handling * * \author Jason Parker <jparker@digium.com> */ #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/stasis.h" #include "asterisk/stasis_message_router.h" #include "asterisk/stasis_system.h" /*! \brief The \ref stasis subscription returned by the forwarding of the system topic * to the manager topic */ static struct stasis_forward *topic_forwarder; static void manager_system_shutdown(void) { stasis_forward_cancel(topic_forwarder); topic_forwarder = NULL; } int manager_system_init(void) { int ret = 0; struct stasis_topic *manager_topic; struct stasis_topic *system_topic; struct stasis_message_router *message_router; manager_topic = ast_manager_get_topic(); if (!manager_topic) { return -1; } message_router = ast_manager_get_message_router(); if (!message_router) { return -1; } system_topic = ast_system_topic(); if (!system_topic) { return -1; } topic_forwarder = stasis_forward_all(system_topic, manager_topic); if (!topic_forwarder) { return -1; } ast_register_atexit(manager_system_shutdown); /* If somehow we failed to add any routes, just shut down the whole * thing and fail it. */ if (ret) { manager_system_shutdown(); return -1; } return 0; }
/* * Copyright (c) 2003, 2007-11 Matteo Frigo * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /* This file was automatically generated --- DO NOT EDIT */ /* Generated on Sat Apr 28 10:59:09 EDT 2012 */ #include "codelet-dft.h" #ifdef HAVE_FMA /* Generated by: ../../../genfft/gen_twiddle.native -fma -reorder-insns -schedule-for-pipeline -compact -variables 4 -pipeline-latency 4 -n 4 -name t1_4 -include t.h */ /* * This function contains 22 FP additions, 12 FP multiplications, * (or, 16 additions, 6 multiplications, 6 fused multiply/add), * 31 stack variables, 0 constants, and 16 memory accesses */ #include "t.h" static void t1_4(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) { { INT m; for (m = mb, W = W + (mb * 6); m < me; m = m + 1, ri = ri + ms, ii = ii + ms, W = W + 6, MAKE_VOLATILE_STRIDE(rs)) { E To, Te, Tm, T8, Tw, Tx, Tq, Tk; { E T1, Tv, Tu, T7, Tg, Tj, Tf, Ti, Tp, Th; T1 = ri[0]; Tv = ii[0]; { E T3, T6, T2, T5; T3 = ri[WS(rs, 2)]; T6 = ii[WS(rs, 2)]; T2 = W[2]; T5 = W[3]; { E Ta, Td, Tc, Tn, Tb, Tt, T4, T9; Ta = ri[WS(rs, 1)]; Td = ii[WS(rs, 1)]; Tt = T2 * T6; T4 = T2 * T3; T9 = W[0]; Tc = W[1]; Tu = FNMS(T5, T3, Tt); T7 = FMA(T5, T6, T4); Tn = T9 * Td; Tb = T9 * Ta; Tg = ri[WS(rs, 3)]; Tj = ii[WS(rs, 3)]; To = FNMS(Tc, Ta, Tn); Te = FMA(Tc, Td, Tb); Tf = W[4]; Ti = W[5]; } } Tm = T1 - T7; T8 = T1 + T7; Tw = Tu + Tv; Tx = Tv - Tu; Tp = Tf * Tj; Th = Tf * Tg; Tq = FNMS(Ti, Tg, Tp); Tk = FMA(Ti, Tj, Th); } { E Ts, Tr, Tl, Ty; Ts = To + Tq; Tr = To - Tq; Tl = Te + Tk; Ty = Te - Tk; ri[WS(rs, 1)] = Tm + Tr; ri[WS(rs, 3)] = Tm - Tr; ii[WS(rs, 2)] = Tw - Ts; ii[0] = Ts + Tw; ii[WS(rs, 3)] = Ty + Tx; ii[WS(rs, 1)] = Tx - Ty; ri[0] = T8 + Tl; ri[WS(rs, 2)] = T8 - Tl; } } } } static const tw_instr twinstr[] = { {TW_FULL, 0, 4}, {TW_NEXT, 1, 0} }; static const ct_desc desc = { 4, "t1_4", twinstr, &GENUS, {16, 6, 6, 0}, 0, 0, 0 }; void X(codelet_t1_4) (planner *p) { X(kdft_dit_register) (p, t1_4, &desc); } #else /* HAVE_FMA */ /* Generated by: ../../../genfft/gen_twiddle.native -compact -variables 4 -pipeline-latency 4 -n 4 -name t1_4 -include t.h */ /* * This function contains 22 FP additions, 12 FP multiplications, * (or, 16 additions, 6 multiplications, 6 fused multiply/add), * 13 stack variables, 0 constants, and 16 memory accesses */ #include "t.h" static void t1_4(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms) { { INT m; for (m = mb, W = W + (mb * 6); m < me; m = m + 1, ri = ri + ms, ii = ii + ms, W = W + 6, MAKE_VOLATILE_STRIDE(rs)) { E T1, Tp, T6, To, Tc, Tk, Th, Tl; T1 = ri[0]; Tp = ii[0]; { E T3, T5, T2, T4; T3 = ri[WS(rs, 2)]; T5 = ii[WS(rs, 2)]; T2 = W[2]; T4 = W[3]; T6 = FMA(T2, T3, T4 * T5); To = FNMS(T4, T3, T2 * T5); } { E T9, Tb, T8, Ta; T9 = ri[WS(rs, 1)]; Tb = ii[WS(rs, 1)]; T8 = W[0]; Ta = W[1]; Tc = FMA(T8, T9, Ta * Tb); Tk = FNMS(Ta, T9, T8 * Tb); } { E Te, Tg, Td, Tf; Te = ri[WS(rs, 3)]; Tg = ii[WS(rs, 3)]; Td = W[4]; Tf = W[5]; Th = FMA(Td, Te, Tf * Tg); Tl = FNMS(Tf, Te, Td * Tg); } { E T7, Ti, Tn, Tq; T7 = T1 + T6; Ti = Tc + Th; ri[WS(rs, 2)] = T7 - Ti; ri[0] = T7 + Ti; Tn = Tk + Tl; Tq = To + Tp; ii[0] = Tn + Tq; ii[WS(rs, 2)] = Tq - Tn; } { E Tj, Tm, Tr, Ts; Tj = T1 - T6; Tm = Tk - Tl; ri[WS(rs, 3)] = Tj - Tm; ri[WS(rs, 1)] = Tj + Tm; Tr = Tp - To; Ts = Tc - Th; ii[WS(rs, 1)] = Tr - Ts; ii[WS(rs, 3)] = Ts + Tr; } } } } static const tw_instr twinstr[] = { {TW_FULL, 0, 4}, {TW_NEXT, 1, 0} }; static const ct_desc desc = { 4, "t1_4", twinstr, &GENUS, {16, 6, 6, 0}, 0, 0, 0 }; void X(codelet_t1_4) (planner *p) { X(kdft_dit_register) (p, t1_4, &desc); } #endif /* HAVE_FMA */
#ifndef GPIO_H_ #define GPIO_H_ #include "../common.h" //PORTA #define porta0 &PORTA, 0 #define porta1 &PORTA, 1 #define porta2 &PORTA, 2 #define porta3 &PORTA, 3 #define porta4 &PORTA, 4 #define porta5 &PORTA, 5 #define porta6 &PORTA, 6 #define porta7 &PORTA, 7 //PORTB #define portb0 &PORTB, 0 #define portb1 &PORTB, 1 #define portb2 &PORTB, 2 #define portb3 &PORTB, 3 #define portb4 &PORTB, 4 #define portb5 &PORTB, 5 #define portb6 &PORTB, 6 #define portb7 &PORTB, 7 //DAC #define dac0 portb2 #define dac1 portb3 //PORTC 0 - 7 #define portc0 &PORTC, 0 #define portc1 &PORTC, 1 #define portc2 &PORTC, 2 #define portc3 &PORTC, 3 #define portc4 &PORTC, 4 #define portc5 &PORTC, 5 #define portc6 &PORTC, 6 #define portc7 &PORTC, 7 //PORTD 0 - 7 #define portd0 &PORTD, 0 #define portd1 &PORTD, 1 #define portd2 &PORTD, 2 #define portd3 &PORTD, 3 #define portd4 &PORTD, 4 #define portd5 &PORTD, 5 #define portd6 &PORTD, 6 #define portd7 &PORTD, 7 //PORTE 0 - 7 #define porte0 &PORTE, 0 #define porte1 &PORTE, 1 #define porte2 &PORTE, 2 #define porte3 &PORTE, 3 #define porte4 &PORTE, 4 #define porte5 &PORTE, 5 #define porte6 &PORTE, 6 #define porte7 &PORTE, 7 //PORTF 0 - 7 #define portf0 &PORTF, 0 #define portf1 &PORTF, 1 #define portf2 &PORTF, 2 #define portf3 &PORTF, 3 #define portf4 &PORTF, 4 #define portf5 &PORTF, 5 #define portf6 &PORTF, 6 #define portf7 &PORTF, 7 //PORTR 0- 1 #define portr0 &PORTR, 0 #define portr1 &PORTR, 1 //LEDS #define ledr &PORTD, 0 #define ledg &PORTD, 1 #define ledb &PORTD, 3 //USART0 #define usart0_rx &PORTE, 2 #define usart0_tx &PORTE, 3 //USART1 #define usart1_rx &PORTE, 6 #define usart1_tx &PORTE, 7 //USART2 #define usart2_rx &PORTF, 2 #define usart2_tx &PORTF, 3 //USART3 - PORTC #define usart3_rx &PORTC, 2 #define usart3_tx &PORTC, 3 //USART4 - PWM #define usart4_rx &PORTC, 6 #define usart4_tx &PORTC, 7 //USART5 - SPI #define usart5_rx &PORTD, 6 #define usart5_tx &PORTD, 7 //USART6 - NOT TO BE USED FOR STAX #define usart6_rx &PORTD, 2 #define usart6_tx &PORTD, 3 //SPI #define spi_ss_usb &PORTE, 4 #define spi_ss_sdcard &PORTE, 5 #define spi_ss_user0 &PORTF, 0 #define spi_ss_user1 &PORTF, 1 #define spi_ss_user2 &PORTF, 4 #define spi_ss_user3 &PORTF, 5 #define spi_ss &PORTD, 4 #define spi_mosi &PORTD, 5 #define spi_miso &PORTD, 6 #define spi_sck &PORTD, 7 //I2C #define i2c_sda &PORTE, 0 #define i2c_scl &PORTE, 1 //MISC #define user_button &PORTD, 2 #define bt_reset &PORTF, 6 #define bt_shdn &PORTF, 7 //ISR #define porta_interrupt0 PORTA_INT0_vect #define porta_interrupt1 PORTA_INT1_vect #define portb_interrupt0 PORTB_INT0_vect #define portb_interrupt1 PORTB_INT1_vect #define portc_interrupt0 PORTC_INT0_vect #define portc_interrupt1 PORTC_INT1_vect #define portd_interrupt0 PORTD_INT0_vect #define portd_interrupt1 PORTD_INT1_vect #define porte_interrupt0 PORTE_INT0_vect #define porte_interrupt1 PORTE_INT1_vect #define portf_interrupt0 PORTF_INT0_vect #define portf_interrupt1 PORTF_INT1_vect #define portr_interrupt0 PORTR_INT0_vect #define portr_interrupt1 PORTR_INT1_vect //pullup configuration typedef enum xlib_core_gpio_pull_e { gpio_totem = PORT_OPC_TOTEM_gc, gpio_buskeeper = PORT_OPC_BUSKEEPER_gc, gpio_pull_down = PORT_OPC_PULLDOWN_gc, gpio_pull_up = PORT_OPC_PULLUP_gc, gpio_wired_or = PORT_OPC_WIREDOR_gc, gpio_wired_and = PORT_OPC_WIREDAND_gc, gpio_wired_or_pull = PORT_OPC_WIREDORPULL_gc, gpio_wired_and_pull = PORT_OPC_WIREDANDPULL_gc } xlib_core_gpio_pull; //interrupts typedef enum xlib_core_gpio_int_e { gpio_bothedges = PORT_ISC_BOTHEDGES_gc, gpio_rising = PORT_ISC_RISING_gc, gpio_falling = PORT_ISC_FALLING_gc, gpio_level = PORT_ISC_LEVEL_gc, gpio_input_disable = PORT_ISC_INPUT_DISABLE_gc } xlib_core_gpio_int; typedef enum xlib_core_gpio_intmask_e { gpio_clear, gpio_interrupt0, gpio_interrupt1 } xlib_core_gpio_intmask; void GpioWrite(PORT_t * port, uint8_t pin, uint8_t set); uint8_t GpioRead(PORT_t * port, uint8_t pin); void GpioSetPull(PORT_t * port, uint8_t pin, xlib_core_gpio_pull pull); void GpioSetInvert(PORT_t * port, uint8_t pin, uint8_t inv); void GpioSetDirection(PORT_t * port, uint8_t pin, uint8_t dir); void GpioSetInterrupt(PORT_t * port, uint8_t pin, xlib_core_gpio_intmask mask, xlib_core_gpio_int interrupt); void GpioSetInterrupt(PORT_t * port, uint8_t pin, xlib_core_gpio_intmask mask); #endif /* GPIO_H_ */
/* Release Version: ci_master_byt_20130823_2200 */ /* * Support for Intel Camera Imaging ISP subsystem. * * Copyright (c) 2010 - 2013 Intel Corporation. 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 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifndef _IA_CSS_MEMORY_ACCESS_H_ #define _IA_CSS_MEMORY_ACCESS_H_ #include "ia_css.h" void ia_css_memory_access_init(const struct ia_css_css_mem_env *env); #endif /* _IA_CSS_MEMORY_ACCESS_H_ */
/* * ringbuffer.h: A ring buffer * * See the main source file 'vdr.c' for copyright information and * how to reach the author. * * $Id: ringbuffer.h 3.0 2013/02/16 15:20:37 kls Exp $ */ #ifndef __RINGBUFFER_H #define __RINGBUFFER_H #include "thread.h" #include "tools.h" class cRingBuffer { private: cCondWait readyForPut, readyForGet; int putTimeout; int getTimeout; int size; time_t lastOverflowReport; int overflowCount; int overflowBytes; cIoThrottle *ioThrottle; protected: tThreadId getThreadTid; int maxFill;//XXX int lastPercent; bool statistics;//XXX void UpdatePercentage(int Fill); void WaitForPut(void); void WaitForGet(void); void EnablePut(void); void EnableGet(void); virtual void Clear(void) = 0; virtual int Available(void) = 0; virtual int Free(void) { return Size() - Available() - 1; } int Size(void) { return size; } public: cRingBuffer(int Size, bool Statistics = false); virtual ~cRingBuffer(); void SetTimeouts(int PutTimeout, int GetTimeout); void SetIoThrottle(void); void ReportOverflow(int Bytes); }; class cRingBufferLinear : public cRingBuffer { //#define DEBUGRINGBUFFERS #ifdef DEBUGRINGBUFFERS private: int lastHead, lastTail; int lastPut, lastGet; static cRingBufferLinear *RBLS[]; static void AddDebugRBL(cRingBufferLinear *RBL); static void DelDebugRBL(cRingBufferLinear *RBL); public: static void PrintDebugRBL(void); #endif private: int margin, head, tail; int gotten; uchar *buffer; char *description; protected: virtual int DataReady(const uchar *Data, int Count); ///< By default a ring buffer has data ready as soon as there are at least ///< 'margin' bytes available. A derived class can reimplement this function ///< if it has other conditions that define when data is ready. ///< The return value is either 0 if there is not yet enough data available, ///< or the number of bytes from the beginning of Data that are "ready". public: cRingBufferLinear(int Size, int Margin = 0, bool Statistics = false, const char *Description = NULL); ///< Creates a linear ring buffer. ///< The buffer will be able to hold at most Size-Margin-1 bytes of data, and will ///< be guaranteed to return at least Margin bytes in one consecutive block. ///< The optional Description is used for debugging only. virtual ~cRingBufferLinear(); virtual int Available(void); virtual int Free(void) { return Size() - Available() - 1 - margin; } virtual void Clear(void); ///< Immediately clears the ring buffer. int Read(int FileHandle, int Max = 0); ///< Reads at most Max bytes from FileHandle and stores them in the ///< ring buffer. If Max is 0, reads as many bytes as possible. ///< Only one actual read() call is done. ///< Returns the number of bytes actually read and stored, or ///< an error value from the actual read() call. int Read(cUnbufferedFile *File, int Max = 0); ///< Like Read(int FileHandle, int Max), but reads from a cUnbufferedFile). int Put(const uchar *Data, int Count); ///< Puts at most Count bytes of Data into the ring buffer. ///< Returns the number of bytes actually stored. uchar *Get(int &Count); ///< Gets data from the ring buffer. ///< The data will remain in the buffer until a call to Del() deletes it. ///< Returns a pointer to the data, and stores the number of bytes ///< actually available in Count. If the returned pointer is NULL, Count has no meaning. void Del(int Count); ///< Deletes at most Count bytes from the ring buffer. ///< Count must be less or equal to the number that was returned by a previous ///< call to Get(). }; enum eFrameType { ftUnknown, ftVideo, ftAudio, ftDolby }; class cFrame { friend class cRingBufferFrame; private: cFrame *next; uchar *data; int count; eFrameType type; int index; uint32_t pts; public: cFrame(const uchar *Data, int Count, eFrameType = ftUnknown, int Index = -1, uint32_t Pts = 0); ///< Creates a new cFrame object. ///< If Count is negative, the cFrame object will take ownership of the given ///< Data. Otherwise it will allocate Count bytes of memory and copy Data. ~cFrame(); uchar *Data(void) const { return data; } int Count(void) const { return count; } eFrameType Type(void) const { return type; } int Index(void) const { return index; } uint32_t Pts(void) const { return pts; } }; class cRingBufferFrame : public cRingBuffer { private: cMutex mutex; cFrame *head; int currentFill; void Delete(cFrame *Frame); void Lock(void) { mutex.Lock(); } void Unlock(void) { mutex.Unlock(); } public: cRingBufferFrame(int Size, bool Statistics = false); virtual ~cRingBufferFrame(); virtual int Available(void); virtual void Clear(void); // Immediately clears the ring buffer. bool Put(cFrame *Frame); // Puts the Frame into the ring buffer. // Returns true if this was possible. cFrame *Get(void); // Gets the next frame from the ring buffer. // The actual data still remains in the buffer until Drop() is called. void Drop(cFrame *Frame); // Drops the Frame that has just been fetched with Get(). }; #endif // __RINGBUFFER_H
/* 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 PINK_CURSOR_MGR_H #define PINK_CURSOR_MGR_H #include "common/rect.h" #include "graphics/wincursor.h" #include "pink/objects/object.h" namespace Pink { class CursorActor; class Page; class PinkEngine; class CursorMgr : public Object { public: CursorMgr(PinkEngine *game, Page *page); void update(); void setCursor(uint index, const Common::Point point, const Common::String &itemName); void setCursor(const Common::String &cursorName, const Common::Point point); void setPage(Page *page) { _page = page; } private: void startAnimation(uint index); void showItem(const Common::String &itemName, const Common::Point point); void hideItem(); private: Page *_page; PinkEngine *_game; CursorActor *_actor; uint _time; uint _firstFrameIndex; bool _isPlayingAnimation; bool _isSecondFrame; }; } // End of namespace Pink #endif
/* * Copyright (C) 2007 Martin Willi * Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ /** * @defgroup ike_dpd ike_dpd * @{ @ingroup tasks */ #ifndef IKE_DPD_H_ #define IKE_DPD_H_ typedef struct ike_dpd_t ike_dpd_t; #include <library.h> #include <sa/ike_sa.h> #include <sa/tasks/task.h> /** * Task of type ike_dpd, detects dead peers. * * The DPD task actually does nothing, as a DPD has no associated payloads. */ struct ike_dpd_t { /** * Implements the task_t interface */ task_t task; }; /** * Create a new ike_dpd task. * * @param initiator TRUE if thask is the original initator * @return ike_dpd task to handle by the task_manager */ ike_dpd_t *ike_dpd_create(bool initiator); #endif /** IKE_DPD_H_ @}*/
/* * linux/include/asm-arm/arch-iop3xx/uncompress.h */ #include <linux/config.h> #include <asm/types.h> #include <asm/mach-types.h> #include <linux/serial_reg.h> #include <asm/hardware.h> #ifdef CONFIG_ARCH_IOP321 #define UTYPE unsigned char * #else #define UTYPE u32 * #endif static volatile UTYPE uart_base; #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE) static __inline__ void putc(char c) { while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE); *uart_base = c; } /* * This does not append a newline */ static void putstr(const char *s) { while (*s) { putc(*s); if (*s == '\n') putc('\r'); s++; } } static __inline__ void __arch_decomp_setup(unsigned long arch_id) { if(machine_is_iq80321()) uart_base = (volatile UTYPE)IQ80321_UART; else if(machine_is_iq31244()) uart_base = (volatile UTYPE)IQ31244_UART; else if(machine_is_iq80331()) uart_base = (volatile UTYPE)IQ80331_UART0_PHYS; else uart_base = (volatile UTYPE)0xfe800000; } /* * nothing to do */ #define arch_decomp_setup() __arch_decomp_setup(arch_id) #define arch_decomp_wdog()
/* * ircd-ratbox: A slightly useful ircd. * m_post.c: Exits the user if unregistered, it is a web form. * * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center * Copyright (C) 1996-2002 Hybrid Development Team * Copyright (C) 2002-2005 ircd-ratbox development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * */ #include "stdinc.h" #include "client.h" #include "ircd.h" #include "numeric.h" #include "s_serv.h" #include "send.h" #include "msg.h" #include "parse.h" #include "modules.h" #include "s_conf.h" static int mr_dumb_proxy(struct Client *, struct Client *, int, const char **); struct Message post_msgtab = { "POST", 0, 0, 0, MFLG_SLOW | MFLG_UNREG, {{mr_dumb_proxy, 0}, mg_ignore, mg_ignore, mg_ignore, mg_ignore, mg_ignore} }; struct Message get_msgtab = { "GET", 0, 0, 0, MFLG_SLOW | MFLG_UNREG, {{mr_dumb_proxy, 0}, mg_ignore, mg_ignore, mg_ignore, mg_ignore, mg_ignore} }; struct Message put_msgtab = { "PUT", 0, 0, 0, MFLG_SLOW | MFLG_UNREG, {{mr_dumb_proxy, 0}, mg_ignore, mg_ignore, mg_ignore, mg_ignore, mg_ignore} }; mapi_clist_av1 post_clist[] = { &post_msgtab, &get_msgtab, &put_msgtab, NULL }; DECLARE_MODULE_AV1(post, NULL, NULL, post_clist, NULL, NULL, "$Revision: 498 $"); /* ** mr_dumb_proxy ** parv[1] = comment */ static int mr_dumb_proxy(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { exit_client(client_p, source_p, source_p, "Client Exit"); return 0; }
/* * Syscall API for capability manipulation * * Copyright (C) 2009 Bahadir Balban */ #ifndef __API_CAPABILITY_H__ #define __API_CAPABILITY_H__ #include <l4lib/lib/list.h> #include L4LIB_INC_ARCH(types.h) /* Capability syscall request types */ #define CAP_CONTROL_NCAPS 0x00000000 #define CAP_CONTROL_READ 0x00000001 #define CAP_CONTROL_SHARE 0x00000002 #define CAP_CONTROL_GRANT 0x00000003 #define CAP_CONTROL_REPLICATE 0x00000004 #define CAP_CONTROL_SPLIT 0x00000005 #define CAP_CONTROL_DEDUCE 0x00000006 #define CAP_CONTROL_DESTROY 0x00000007 #define CAP_SHARE_MASK 0x0000000F #define CAP_SHARE_SINGLE 0x00000001 #define CAP_SHARE_ALL_CONTAINER 0x00000002 #define CAP_SHARE_ALL_SPACE 0x00000003 #define CAP_GRANT_MASK 0x0000000F #define CAP_GRANT_SINGLE 0x00000001 #define CAP_GRANT_IMMUTABLE 0x00000004 #define CAP_SPLIT_MASK 0x0000000F #define CAP_SPLIT_SIZE 0x00000001 #define CAP_SPLIT_ACCESS 0x00000002 #define CAP_SPLIT_RANGE 0x00000003 /* Returns -EPERM */ /* * A capability is a unique representation of security * qualifiers on a particular resource. * * In this structure: * * The capid denotes the unique capability ID. * The resid denotes the unique ID of targeted resource. * The owner denotes the unique ID of the one and only capability owner. This is * almost always a thread ID. * * The type field contains two types: * - The capability type, * - The targeted resource type. * * The targeted resouce type denotes what type of resource the capability is * allowed to operate on. For example a thread, a thread group, an address space * or a memory can be of this type. * * The capability type defines the general set of operations allowed on a * particular resource. For example a capability type may be thread_control, * exchange_registers, ipc, or map operations. A resource type may be such as a * thread, a thread group, a virtual or physical memory region. * * There are also quantitative capability types. While their names denote * quantitative objects such as memory, threads, and address spaces, these * types actually define the quantitative operations available on those * resources such as creation and deletion of a thread, allocation and * deallocation of a memory region etc. * * The access field denotes the fine-grain operations available on a particular * resource. The meaning of each bitfield differs according to the type of the * capability. For example, for a capability type thread_control, the bitfields * may mean suspend, resume, create, delete etc. */ struct capability { struct link list; /* Capability identifiers */ l4id_t capid; /* Unique capability ID */ l4id_t owner; /* Capability owner ID */ l4id_t resid; /* Targeted resource ID */ unsigned int type; /* Capability and target resource type */ /* Capability limits/permissions */ u32 access; /* Permitted operations */ /* Limits on the resource (NOTE: must never have signed type) */ unsigned long start; /* Resource start value */ unsigned long end; /* Resource end value */ unsigned long size; /* Resource size */ /* Use count of resource */ unsigned long used; /* Device attributes, if this is a device. */ unsigned int attr; l4id_t irq; }; #endif /* __API_CAPABILITY_H__ */
/************************************************************************************ * configs/ea3131/src/ea3131_internal.h * arch/arm/src/board/ea3131_internal.n * * Copyright (C) 2009-2010,2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ************************************************************************************/ #ifndef __CONFIGS_EA3131_SRC_EA3131_INTERNAL_H #define __CONFIGS_EA3131_SRC_EA3131_INTERNAL_H /************************************************************************************ * Included Files ************************************************************************************/ #include <nuttx/config.h> #include <nuttx/compiler.h> #include <stdint.h> #include "lpc31_ioconfig.h" /************************************************************************************ * Definitions ************************************************************************************/ /* EA3131L GPIOs ********************************************************************/ /* LEDs -- interface through an I2C GPIO expander */ /* BUTTONS -- NOTE that some have EXTI interrupts configured */ /* SPI Chip Selects */ /* SPI NOR flash is the only device on SPI. SPI_CS_OUT0 is its chip select */ #define SPINOR_CS IOCONFIG_SPI_CSOUT0 /* USB Soft Connect Pullup -- NONE */ /************************************************************************************ * Public Types ************************************************************************************/ /************************************************************************************ * Public data ************************************************************************************/ #ifndef __ASSEMBLY__ /************************************************************************************ * Public Functions ************************************************************************************/ /************************************************************************************ * Name: lpc31_meminitialize * * Description: * Initialize external memory resources (sram, sdram, nand, nor, etc.) * ************************************************************************************/ #ifdef CONFIG_ARCH_EXTDRAM extern void lpc31_meminitialize(void); #endif /************************************************************************************ * Name: lpc31_spiinitialize * * Description: * Called to configure SPI chip select GPIO pins for the EA3131 board. * ************************************************************************************/ extern void weak_function lpc31_spiinitialize(void); /************************************************************************************ * Name: lpc31_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the EA3131 board. * ************************************************************************************/ extern void weak_function lpc31_usbinitialize(void); /************************************************************************************ * Name: lpc31_pginitialize * * Description: * Set up mass storage device to support on demand paging. * ************************************************************************************/ #ifdef CONFIG_PAGING extern void weak_function lpc31_pginitialize(void); #endif #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_EA3131_SRC_EA3131_INTERNAL_H */
/* Copyright (c) 2008 -2014 Espressif System. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #ifndef _ESP_PATH_H_ #define _ESP_PATH_H_ #define FWPATH "/system/lib/modules" //module_param_string(fwpath, fwpath, sizeof(fwpath), 0644); #endif /* _ESP_PATH_H_ */
/* * This file is part of Cleanflight. * * Cleanflight is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include <stdbool.h> #include <platform.h> #ifdef USE_TARGET_CONFIG #include "pg/sdcard.h" #include "telemetry/telemetry.h" void targetConfiguration(void) { sdcardConfigMutable()->useDma = true; telemetryConfigMutable()->halfDuplex = 0; } #endif
/* * SAMSUNG NFC N2 Controller * * Copyright (C) 2013 Samsung Electronics Co.Ltd * Author: Woonki Lee <woonki84.lee@samsung.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * */ #include <linux/platform_device.h> #ifdef CONFIG_SEC_NFC_CLK_REQ #include <linux/clk.h> #endif #ifdef CONFIG_SEC_NFC_I2C /* support old driver configuration */ #ifndef CONFIG_SEC_NFC #define CONFIG_SEC_NFC #endif #if !defined(CONFIG_SEC_NFC_IF_I2C) && !defined(CONFIG_SEC_NFC_IF_UART) #define CONFIG_SEC_NFC_IF_I2C #endif #if !defined(CONFIG_SEC_NFC_PRODUCT_N3) && !defined(CONFIG_SEC_NFC_PRODUCT_N5) #define CONFIG_SEC_NFC_PRODUCT_N3 #endif #endif /* CONFIG_SEC_NFC_I2C */ #define SEC_NFC_DRIVER_NAME "nfc_sec" #define SEC_NFC_MAX_BUFFER_SIZE 512 /* ioctl */ #define SEC_NFC_MAGIC 'S' #define SEC_NFC_GET_MODE _IOW(SEC_NFC_MAGIC, 0, unsigned int) #define SEC_NFC_SET_MODE _IOW(SEC_NFC_MAGIC, 1, unsigned int) #define SEC_NFC_SLEEP _IOW(SEC_NFC_MAGIC, 2, unsigned int) #define SEC_NFC_WAKEUP _IOW(SEC_NFC_MAGIC, 3, unsigned int) /* size */ #define SEC_NFC_MSG_MAX_SIZE (256 + 4) /* wait for device stable */ #define SEC_NFC_VEN_WAIT_TIME (100) /* gpio pin configuration */ struct sec_nfc_platform_data { unsigned int irq; unsigned int ven; unsigned int firm; unsigned int wake; unsigned int tvdd; unsigned int avdd; #ifdef CONFIG_SEC_NFC_CLK_REQ unsigned int clk_req; unsigned int clk_irq; unsigned int clk_enable; #endif void (*cfg_gpio)(void); u32 ven_gpio_flags; u32 firm_gpio_flags; u32 irq_gpio_flags; }; enum sec_nfc_mode { SEC_NFC_MODE_OFF = 0, SEC_NFC_MODE_FIRMWARE, SEC_NFC_MODE_BOOTLOADER, SEC_NFC_MODE_COUNT, }; #ifdef CONFIG_SEC_NFC_PRODUCT_N3 enum sec_nfc_power { SEC_NFC_PW_OFF = 0, SEC_NFC_PW_ON, }; #elif defined(CONFIG_SEC_NFC_PRODUCT_N5) enum sec_nfc_power { SEC_NFC_PW_ON = 0, SEC_NFC_PW_OFF, }; #endif enum sec_nfc_firmpin { SEC_NFC_FW_OFF = 0, SEC_NFC_FW_ON, }; enum sec_nfc_wake { SEC_NFC_WAKE_SLEEP = 0, SEC_NFC_WAKE_UP, };
/* * Copyright (c) 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __CHECKER__ #error "Use this header only with sparse. It is not a correct implementation." #endif #ifndef __NETPACKET_PACKET_SPARSE #define __NETPACKET_PACKET_SPARSE 1 #include "openvswitch/types.h" struct sockaddr_ll { unsigned short int sll_family; ovs_be16 sll_protocol; int sll_ifindex; unsigned short int sll_hatype; unsigned char sll_pkttype; unsigned char sll_halen; unsigned char sll_addr[8]; }; #endif /* <netpacket/packet.h> sparse */
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ // //=============================================================================// // GLOS.H // // This is an OS specific header file #include <windows.h> // disable data conversion warnings #pragma warning(disable : 4244) // MIPS #pragma warning(disable : 4136) // X86 #pragma warning(disable : 4051) // ALPHA
/* ** Copyright 2003-2010, VisualOn, Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ /******************************************************************************* File: tns_func.h Content: TNS functions *******************************************************************************/ /* Temporal noise shaping */ #ifndef _TNS_FUNC_H #define _TNS_FUNC_H #include "typedef.h" #include "psy_configuration.h" Word16 InitTnsConfigurationLong(Word32 bitrate, Word32 samplerate, Word16 channels, TNS_CONFIG *tnsConfig, PSY_CONFIGURATION_LONG *psyConfig, Word16 active); Word16 InitTnsConfigurationShort(Word32 bitrate, Word32 samplerate, Word16 channels, TNS_CONFIG *tnsConfig, PSY_CONFIGURATION_SHORT *psyConfig, Word16 active); Word32 TnsDetect(TNS_DATA* tnsData, TNS_CONFIG tC, Word32* pScratchTns, const Word16 sfbOffset[], Word32* spectrum, Word16 subBlockNumber, Word16 blockType, Word32 * sfbEnergy); void TnsSync(TNS_DATA *tnsDataDest, const TNS_DATA *tnsDataSrc, const TNS_CONFIG tC, const Word16 subBlockNumber, const Word16 blockType); Word16 TnsEncode(TNS_INFO* tnsInfo, TNS_DATA* tnsData, Word16 numOfSfb, TNS_CONFIG tC, Word16 lowPassLine, Word32* spectrum, Word16 subBlockNumber, Word16 blockType); void ApplyTnsMultTableToRatios(Word16 startCb, Word16 stopCb, TNS_SUBBLOCK_INFO subInfo, Word32 *thresholds); #endif /* _TNS_FUNC_H */
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef SPLITTER_H #define SPLITTER_H #include <QByteArray> #include <QList> #include <QString> struct FileData { FileData(const QString &f, const QString &c) { filename = f; content = c; } QString filename; QString content; }; typedef QList<FileData> FileDataList; FileDataList splitDiffToFiles(const QString &data); #endif // SPLITTER_H
#ifndef __CR_SECCOMP_H__ #define __CR_SECCOMP_H__ #include <linux/seccomp.h> #include <linux/filter.h> #include "images/core.pb-c.h" #ifndef SECCOMP_MODE_DISABLED #define SECCOMP_MODE_DISABLED 0 #endif #ifndef SECCOMP_MODE_STRICT #define SECCOMP_MODE_STRICT 1 #endif #ifndef SECCOMP_MODE_FILTER #define SECCOMP_MODE_FILTER 2 #endif #ifndef SECCOMP_SET_MODE_FILTER #define SECCOMP_SET_MODE_FILTER 1 #endif #ifndef SECCOMP_FILTER_FLAG_TSYNC #define SECCOMP_FILTER_FLAG_TSYNC 1 #endif extern int collect_seccomp_filters(void); extern int prepare_seccomp_filters(void); struct task_restore_args; extern int seccomp_filters_get_rst_pos(CoreEntry *item, struct task_restore_args *); #endif
////////////////////////////////////////////////////////////////////////////// // Name: wx/univ/statbox.h // Purpose: wxStaticBox declaration // Author: Vadim Zeitlin // Modified by: // Created: 15.08.00 // RCS-ID: $Id: statbox.h,v 1.13 2005/01/07 16:54:07 VZ Exp $ // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_UNIV_STATBOX_H_ #define _WX_UNIV_STATBOX_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "univstatbox.h" #endif class WXDLLEXPORT wxStaticBox : public wxStaticBoxBase { public: wxStaticBox() { } wxStaticBox(wxWindow *parent, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize) { Create(parent, wxID_ANY, label, pos, size); } wxStaticBox(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxStaticBoxNameStr) { Create(parent, id, label, pos, size, style, name); } bool Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxStaticBoxNameStr); // the origin of the static box is inside the border and under the label: // take account of this virtual wxPoint GetBoxAreaOrigin() const; protected: // draw the control virtual void DoDraw(wxControlRenderer *renderer); // get the size of the border wxRect GetBorderGeometry() const; // returning true from here ensures that we act as a container window for // our children virtual bool IsStaticBox() const { return true; } private: DECLARE_DYNAMIC_CLASS(wxStaticBox) }; #endif // _WX_UNIV_STATBOX_H_
/* Copyright 2014 IST Austria Contributed by: Jan Reininghaus This file is part of DIPHA. DIPHA is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. DIPHA 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 DIPHA. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include <dipha/includes.h> namespace dipha { namespace algorithms { template< typename Complex > void get_filtration_to_cell_map( const inputs::abstract_weighted_cell_complex< Complex >& complex, bool dualize, data_structures::distributed_vector< int64_t >& filtration_to_cell_map ) { const int64_t global_num_cells = complex.get_num_cells(); const int64_t local_begin = element_distribution::get_local_begin( global_num_cells ); const int64_t local_end = element_distribution::get_local_end( global_num_cells ); const int64_t local_num_cells = local_end - local_begin; typedef std::pair< double, std::pair< int64_t, int64_t > > sort_value_type; std::vector< sort_value_type > filtration( local_num_cells ); for( int64_t cur_cell = local_begin; cur_cell < local_end; cur_cell++ ) { filtration[ cur_cell - local_begin ].first = complex.get_local_value( cur_cell ); filtration[ cur_cell - local_begin ].second.first = complex.get_local_dim( cur_cell ); filtration[ cur_cell - local_begin ].second.second = cur_cell; } // psort unfortunately uses long for the size. This will cause problems on Win64 for large data std::vector< long > cell_distribution; int num_processes = mpi_utils::get_num_processes(); for( int cur_rank = 0; cur_rank < num_processes; cur_rank++ ) cell_distribution.push_back( (long)( element_distribution::get_local_end( global_num_cells, cur_rank ) - element_distribution::get_local_begin( global_num_cells, cur_rank ) ) ); if( dualize ) p_sort::parallel_sort( filtration.begin(), filtration.end(), std::greater< sort_value_type >(), cell_distribution.data(), MPI_COMM_WORLD ); else p_sort::parallel_sort( filtration.begin(), filtration.end(), std::less< sort_value_type >(), cell_distribution.data(), MPI_COMM_WORLD ); filtration_to_cell_map.init( global_num_cells ); for( int64_t cur_cell = local_begin; cur_cell < local_end; cur_cell++ ) filtration_to_cell_map.set_local_value( cur_cell, filtration[ cur_cell - local_begin ].second.second ); } } }
/* mbed Microcontroller Library ******************************************************************************* * Copyright (c) 2018, STMicroelectronics * 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 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 MBED_PERIPHERALNAMES_H #define MBED_PERIPHERALNAMES_H #include "cmsis.h" #ifdef __cplusplus extern "C" { #endif typedef enum { ADC_1 = (int)ADC1_BASE } ADCName; typedef enum { DAC_1 = (int)DAC_BASE } DACName; typedef enum { UART_1 = (int)USART1_BASE, UART_2 = (int)USART2_BASE, UART_3 = (int)USART3_BASE, UART_4 = (int)UART4_BASE, UART_5 = (int)UART5_BASE, LPUART_1 = (int)LPUART1_BASE } UARTName; typedef enum { SPI_1 = (int)SPI1_BASE, SPI_2 = (int)SPI2_BASE, SPI_3 = (int)SPI3_BASE } SPIName; typedef enum { I2C_1 = (int)I2C1_BASE, I2C_2 = (int)I2C2_BASE, I2C_3 = (int)I2C3_BASE, I2C_4 = (int)I2C4_BASE } I2CName; typedef enum { PWM_1 = (int)TIM1_BASE, PWM_2 = (int)TIM2_BASE, PWM_3 = (int)TIM3_BASE, PWM_4 = (int)TIM4_BASE, PWM_5 = (int)TIM5_BASE, PWM_8 = (int)TIM8_BASE, PWM_15 = (int)TIM15_BASE, PWM_16 = (int)TIM16_BASE, PWM_17 = (int)TIM17_BASE } PWMName; typedef enum { CAN_1 = (int)CAN1_BASE } CANName; #ifdef __cplusplus } #endif #endif
/* mbed Microcontroller Library * Copyright (c) 2006-2015 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "pinmap.h" #include "mbed-drivers/mbed_error.h" void pinmap_pinout(PinName pin, const PinMap *map) { if (pin == NC) return; while (map->pin != NC) { if (map->pin == pin) { pin_function(pin, map->function); pin_mode(pin, PullNone); return; } map++; } error("could not pinout"); } uint32_t pinmap_merge(uint32_t a, uint32_t b) { // both are the same (inc both NC) if (a == b) return a; // one (or both) is not connected if (a == (uint32_t)NC) return b; if (b == (uint32_t)NC) return a; // mis-match error case error("pinmap mis-match"); return (uint32_t)NC; } uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map) { while (map->pin != NC) { if (map->pin == pin) return map->peripheral; map++; } return (uint32_t)NC; } uint32_t pinmap_peripheral(PinName pin, const PinMap* map) { uint32_t peripheral = (uint32_t)NC; if (pin == (PinName)NC) return (uint32_t)NC; peripheral = pinmap_find_peripheral(pin, map); if ((uint32_t)NC == peripheral) // no mapping available error("pinmap not found for peripheral"); return peripheral; } uint32_t pinmap_find_function(PinName pin, const PinMap* map) { while (map->pin != NC) { if (map->pin == pin) return map->function; map++; } return (uint32_t)NC; } uint32_t pinmap_function(PinName pin, const PinMap* map) { uint32_t function = (uint32_t)NC; if (pin == (PinName)NC) return (uint32_t)NC; function = pinmap_find_function(pin, map); if ((uint32_t)NC == function) // no mapping available error("pinmap not found for function"); return function; }
/* * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef WebTextRun_h #define WebTextRun_h #include "WebCommon.h" #include "WebString.h" namespace blink { class TextRun; struct WebTextRun { WebTextRun(const WebString& t, bool isRTL, bool hasDirectionalOverride) : text(t), rtl(isRTL), directionalOverride(hasDirectionalOverride) {} WebTextRun() : rtl(false), directionalOverride(false) {} WebString text; bool rtl; bool directionalOverride; #if INSIDE_BLINK // The resulting blink::TextRun will refer to the text in this // struct, so "this" must outlive the WebCore text run. BLINK_PLATFORM_EXPORT operator TextRun() const; #endif }; } // namespace blink #endif
// Copyright 2015 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 LengthPropertyFunctions_h #define LengthPropertyFunctions_h #include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "platform/Length.h" #include "wtf/Allocator.h" namespace blink { class ComputedStyle; class LengthPropertyFunctions { STATIC_ONLY(LengthPropertyFunctions); public: static ValueRange getValueRange(CSSPropertyID); static bool isZoomedLength(CSSPropertyID); static bool getPixelsForKeyword(CSSPropertyID, CSSValueID, double& resultPixels); static bool getInitialLength(CSSPropertyID, Length& result); static bool getLength(CSSPropertyID, const ComputedStyle&, Length& result); static bool setLength(CSSPropertyID, ComputedStyle&, const Length&); }; } // namespace blink #endif // LengthPropertyFunctions_h
#ifndef DISPLAYLISTINTERPRETER_H_ #define DISPLAYLISTINTERPRETER_H_ class DisplayListInterpreter { public: DisplayListInterpreter(); virtual ~DisplayListInterpreter(); virtual void Interprete() = 0; }; #endif /* DISPLAYLISTINTERPRETER_H_ */
/* * Copyright (c) 2013 - Facebook. * All rights reserved. */ struct s { int x; }; void preincrement(struct s *p) { p->x += 1; (1 ? p : p)->x += 1; p->x += 1 ? 3 : 7; (1 ? p : p)->x += 1 ? 3 : 7; }
// Tencent is pleased to support the open source community by making RapidJSON available. // // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 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 // // http://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. #ifndef RAPIDJSON_FILEWRITESTREAM_H_ #define RAPIDJSON_FILEWRITESTREAM_H_ #include "stream.h" #include <cstdio> #ifdef __clang__ RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_OFF(unreachable-code) #endif RAPIDJSON_NAMESPACE_BEGIN //! Wrapper of C file stream for input using fread(). /*! \note implements Stream concept */ class FileWriteStream { public: typedef char Ch; //!< Character type. Only support char. FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { RAPIDJSON_ASSERT(fp_ != 0); } void Put(char c) { if (current_ >= bufferEnd_) Flush(); *current_++ = c; } void PutN(char c, size_t n) { size_t avail = static_cast<size_t>(bufferEnd_ - current_); while (n > avail) { std::memset(current_, c, avail); current_ += avail; Flush(); n -= avail; avail = static_cast<size_t>(bufferEnd_ - current_); } if (n > 0) { std::memset(current_, c, n); current_ += n; } } void Flush() { if (current_ != buffer_) { size_t result = fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_); if (result < static_cast<size_t>(current_ - buffer_)) { // failure deliberately ignored at this time // added to avoid warn_unused_result build errors } current_ = buffer_; } } // Not implemented char Peek() const { RAPIDJSON_ASSERT(false); return 0; } char Take() { RAPIDJSON_ASSERT(false); return 0; } size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } private: // Prohibit copy constructor & assignment operator. FileWriteStream(const FileWriteStream&); FileWriteStream& operator=(const FileWriteStream&); std::FILE* fp_; char *buffer_; char *bufferEnd_; char *current_; }; //! Implement specialized version of PutN() with memset() for better performance. template<> inline void PutN(FileWriteStream& stream, char c, size_t n) { stream.PutN(c, n); } RAPIDJSON_NAMESPACE_END #ifdef __clang__ RAPIDJSON_DIAG_POP #endif #endif // RAPIDJSON_FILESTREAM_H_
/* Target-dependent globals. Copyright (C) 2010-2014 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 3, 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 COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef TARGET_GLOBALS_H #define TARGET_GLOBALS_H 1 #if SWITCHABLE_TARGET extern struct target_flag_state *this_target_flag_state; extern struct target_regs *this_target_regs; extern struct target_rtl *this_target_rtl; extern struct target_recog *this_target_recog; extern struct target_hard_regs *this_target_hard_regs; extern struct target_reload *this_target_reload; extern struct target_expmed *this_target_expmed; extern struct target_optabs *this_target_optabs; extern struct target_libfuncs *this_target_libfuncs; extern struct target_cfgloop *this_target_cfgloop; extern struct target_ira *this_target_ira; extern struct target_ira_int *this_target_ira_int; extern struct target_builtins *this_target_builtins; extern struct target_gcse *this_target_gcse; extern struct target_bb_reorder *this_target_bb_reorder; extern struct target_lower_subreg *this_target_lower_subreg; #endif struct GTY(()) target_globals { ~target_globals (); struct target_flag_state *GTY((skip)) flag_state; struct target_regs *GTY((skip)) regs; struct target_rtl *rtl; struct target_recog *GTY((skip)) recog; struct target_hard_regs *GTY((skip)) hard_regs; struct target_reload *GTY((skip)) reload; struct target_expmed *GTY((skip)) expmed; struct target_optabs *GTY((skip)) optabs; struct target_libfuncs *libfuncs; struct target_cfgloop *GTY((skip)) cfgloop; struct target_ira *GTY((skip)) ira; struct target_ira_int *GTY((skip)) ira_int; struct target_builtins *GTY((skip)) builtins; struct target_gcse *GTY((skip)) gcse; struct target_bb_reorder *GTY((skip)) bb_reorder; struct target_lower_subreg *GTY((skip)) lower_subreg; }; #if SWITCHABLE_TARGET extern struct target_globals default_target_globals; extern struct target_globals *save_target_globals (void); extern struct target_globals *save_target_globals_default_opts (void); static inline void restore_target_globals (struct target_globals *g) { this_target_flag_state = g->flag_state; this_target_regs = g->regs; this_target_rtl = g->rtl; this_target_recog = g->recog; this_target_hard_regs = g->hard_regs; this_target_reload = g->reload; this_target_expmed = g->expmed; this_target_optabs = g->optabs; this_target_libfuncs = g->libfuncs; this_target_cfgloop = g->cfgloop; this_target_ira = g->ira; this_target_ira_int = g->ira_int; this_target_builtins = g->builtins; this_target_gcse = g->gcse; this_target_bb_reorder = g->bb_reorder; this_target_lower_subreg = g->lower_subreg; } #endif #endif
/*** This file is part of systemd. Copyright 2008-2014 Kay Sievers <kay@vrfy.org> systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <ctype.h> #include <stdarg.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "libudev.h" #include "alloc-util.h" #include "fd-util.h" #include "libudev-private.h" #include "missing.h" #include "string-util.h" /** * SECTION:libudev * @short_description: libudev context * * The context contains the default values read from the udev config file, * and is passed to all library operations. */ /** * udev: * * Opaque object representing the library context. */ struct udev { int refcount; void (*log_fn)(struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args); void *userdata; }; /** * udev_get_userdata: * @udev: udev library context * * Retrieve stored data pointer from library context. This might be useful * to access from callbacks. * * Returns: stored userdata **/ _public_ void *udev_get_userdata(struct udev *udev) { if (udev == NULL) return NULL; return udev->userdata; } /** * udev_set_userdata: * @udev: udev library context * @userdata: data pointer * * Store custom @userdata in the library context. **/ _public_ void udev_set_userdata(struct udev *udev, void *userdata) { if (udev == NULL) return; udev->userdata = userdata; } /** * udev_new: * * Create udev library context. This reads the udev configuration * file, and fills in the default values. * * The initial refcount is 1, and needs to be decremented to * release the resources of the udev library context. * * Returns: a new udev library context **/ _public_ struct udev *udev_new(void) { struct udev *udev; _cleanup_fclose_ FILE *f = NULL; udev = new0(struct udev, 1); if (!udev) { errno = -ENOMEM; return NULL; } udev->refcount = 1; return udev; } /** * udev_ref: * @udev: udev library context * * Take a reference of the udev library context. * * Returns: the passed udev library context **/ _public_ struct udev *udev_ref(struct udev *udev) { if (udev == NULL) return NULL; udev->refcount++; return udev; } /** * udev_unref: * @udev: udev library context * * Drop a reference of the udev library context. If the refcount * reaches zero, the resources of the context will be released. * * Returns: the passed udev library context if it has still an active reference, or #NULL otherwise. **/ _public_ struct udev *udev_unref(struct udev *udev) { if (udev == NULL) return NULL; udev->refcount--; if (udev->refcount > 0) return udev; free(udev); return NULL; } /** * udev_set_log_fn: * @udev: udev library context * @log_fn: function to be called for log messages * * This function is deprecated. * **/ _public_ void udev_set_log_fn(struct udev *udev, void (*log_fn)(struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args)) { return; } /** * udev_get_log_priority: * @udev: udev library context * * This function is deprecated. * **/ _public_ int udev_get_log_priority(struct udev *udev) { return log_get_max_level(); } /** * udev_set_log_priority: * @udev: udev library context * @priority: the new log priority * * This function is deprecated. * **/ _public_ void udev_set_log_priority(struct udev *udev, int priority) { log_set_max_level(priority); }
/* HBVideoController.h $ This file is part of the HandBrake source code. Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License. */ #import <Cocoa/Cocoa.h> @class HBAdvancedController; @class HBVideo; /** * HBVideoController */ @interface HBVideoController : NSViewController - (instancetype)initWithAdvancedController:(HBAdvancedController *)advancedController; @property (nonatomic, readwrite, weak) HBVideo *video; @end
/* * (C) Copyright 2007-2013 * Allwinner Technology Co., Ltd. <www.allwinnertech.com> * Jerry Wang <wangflord@allwinnertech.com> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ /* ÓÐÏßÐÔ±íµÄÌØÐÔ:·ÖΪÁ´Ê½¶ÓÁÐÓë˳Ðò¶ÓÁР˳Ðò¶ÓÁÐ:ÓÃÒ»¶ÎµØÖ·Á¬ÐøµÄ´æ´¢µ¥Ôª´æ´¢Êý¾ÝÔªËØ£¬¶¨ÒåÁ½¸öÓαê:Ö¸Ïò¶ÓÍ· µÄÓαê(front)¡¢Ö¸Ïò¶ÓβµÄÓαê(rear),Èç¹ûfront == rear¶ÓÁÐΪ¿Õ,Èç¹û (rear + 1) % MAXSIZE == front¶ÓÁÐÂú(´ËΪѭ»·¶ÓÁÐ),ÈçÆÕͨ¶ÓÁÐrear==MAXSIZE¶ÓÁÐÂú */ #ifndef __QUEUE_H__ #define __QUEUE_H__ #define QUEUE_MAX_BUFFER_SIZE 64 /* max buffer count of queue */ typedef struct { char *data; uint len; } queue_data; typedef struct { queue_data element[QUEUE_MAX_BUFFER_SIZE]; int front; //head buffer of the queue int rear; //tail buffer of the queue int size; //the bytes of each buffer int the queue int count; //the total count of buffers in the queue void *base_addr; }queue; int initqueue(queue *q, int each_size, int buffer_count); //init queue int destroyqueue(queue *q); //destroy queue void resetqueue(queue *q); int isqueueempty(queue *q); int isqueuefull(queue *q); int inqueue_query(queue *q, queue_data *qdata); int inqueue_ex(queue *q); int outqueue_query(queue *q, queue_data *qdata, queue_data *next_qdata); int outqueue_ex(queue *q); #endif //__QUEUE_H__
/* * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * * NetSurf is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * NetSurf is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef NS_ATARI_OPTIONS_H_ #define NS_ATARI_OPTIONS_H_ /* setup longer default reflow time */ #define DEFAULT_REFLOW_PERIOD 350 /* time in cs */ #endif NSOPTION_STRING(atari_font_driver, "freetype") NSOPTION_INTEGER(atari_font_monochrom, 0) NSOPTION_INTEGER(atari_transparency, 1) NSOPTION_INTEGER(atari_dither, 1) NSOPTION_INTEGER(atari_gui_poll_timeout, 0) NSOPTION_STRING(atari_editor, NULL) NSOPTION_STRING(font_face_sans_serif, NULL) NSOPTION_STRING(font_face_sans_serif_bold, NULL) NSOPTION_STRING(font_face_sans_serif_italic, NULL) NSOPTION_STRING(font_face_sans_serif_italic_bold, NULL) NSOPTION_STRING(font_face_monospace, NULL) NSOPTION_STRING(font_face_monospace_bold, NULL) NSOPTION_STRING(font_face_serif, NULL) NSOPTION_STRING(font_face_serif_bold, NULL) NSOPTION_STRING(font_face_cursive, NULL) NSOPTION_STRING(font_face_fantasy, NULL) NSOPTION_STRING(downloads_path, "downloads") NSOPTION_STRING(url_file, "url.db") NSOPTION_STRING(hotlist_file, "hotlist") NSOPTION_STRING(tree_icons_path, "./res/icons")
/* * Copyright (c) 2002 Fabrice Bellard * Copyright (c) 2013 Michael Niedermayer * Copyright (c) 2013 James Almer * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "libavutil/avstring.h" #include "libavutil/error.h" #include "libavutil/hash.h" #include "libavutil/mem.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <sys/stat.h> #if HAVE_IO_H #include <io.h> #endif #if HAVE_UNISTD_H #include <unistd.h> #endif #define SIZE 65536 static struct AVHashContext *hash; static int out_b64; static void usage(void) { int i = 0; const char *name; printf("usage: ffhash [b64:]algorithm [input]...\n"); printf("Supported hash algorithms:"); do { name = av_hash_names(i); if (name) printf(" %s", name); i++; } while(name); printf("\n"); } static void finish(void) { char res[2 * AV_HASH_MAX_SIZE + 4]; printf("%s=", av_hash_get_name(hash)); if (out_b64) { av_hash_final_b64(hash, res, sizeof(res)); printf("b64:%s", res); } else { av_hash_final_hex(hash, res, sizeof(res)); printf("0x%s", res); } } static int check(char *file) { uint8_t buffer[SIZE]; int fd, flags = O_RDONLY; int ret = 0; #ifdef O_BINARY flags |= O_BINARY; #endif if (file) fd = open(file, flags); else fd = 0; if (fd == -1) { printf("%s=OPEN-FAILED: %s:", av_hash_get_name(hash), strerror(errno)); ret = 1; goto end; } av_hash_init(hash); for (;;) { int size = read(fd, buffer, SIZE); if (size < 0) { close(fd); finish(); printf("+READ-FAILED: %s", strerror(errno)); ret = 2; goto end; } else if(!size) break; av_hash_update(hash, buffer, size); } close(fd); finish(); end: if (file) printf(" *%s", file); printf("\n"); return ret; } int main(int argc, char **argv) { int i; int ret = 0; const char *hash_name; if (argc == 1) { usage(); return 0; } hash_name = argv[1]; out_b64 = av_strstart(hash_name, "b64:", &hash_name); if ((ret = av_hash_alloc(&hash, hash_name)) < 0) { switch(ret) { case AVERROR(EINVAL): printf("Invalid hash type: %s\n", hash_name); break; case AVERROR(ENOMEM): printf("%s\n", strerror(errno)); break; } return 1; } for (i = 2; i < argc; i++) ret |= check(argv[i]); if (argc < 3) ret |= check(NULL); av_hash_freep(&hash); return ret; }
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle * * Machine dependent structs and defines to help the user use * the ptrace system call. */ #ifndef _ASM_PTRACE_H #define _ASM_PTRACE_H #include <asm/isadep.h> /* 0 - 31 are integer registers, 32 - 63 are fp registers. */ #define FPR_BASE 32 #define PC 64 #define CAUSE 65 #define BADVADDR 66 #define MMHI 67 #define MMLO 68 #define FPC_CSR 69 #define FPC_EIR 70 #ifndef __ASSEMBLY__ /* * This struct defines the way the registers are stored on the stack during a * system call/exception. As usual the registers k0/k1 aren't being saved. */ struct pt_regs { /* Pad bytes for argument save space on the stack. */ unsigned long pad0[6]; /* Saved main processor registers. */ unsigned long regs[32]; /* Other saved registers. */ unsigned long lo; unsigned long hi; /* * saved cp0 registers */ unsigned long cp0_epc; unsigned long cp0_badvaddr; unsigned long cp0_status; unsigned long cp0_cause; }; #define __str2(x) #x #define __str(x) __str2(x) #define save_static_function(symbol) \ __asm__ ( \ ".globl\t" #symbol "\n\t" \ ".align\t2\n\t" \ ".type\t" #symbol ", @function\n\t" \ ".ent\t" #symbol ", 0\n" \ #symbol":\n\t" \ ".frame\t$29, 0, $31\n\t" \ "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ "sw\t$17,"__str(PT_R17)"($29)\n\t" \ "sw\t$18,"__str(PT_R18)"($29)\n\t" \ "sw\t$19,"__str(PT_R19)"($29)\n\t" \ "sw\t$20,"__str(PT_R20)"($29)\n\t" \ "sw\t$21,"__str(PT_R21)"($29)\n\t" \ "sw\t$22,"__str(PT_R22)"($29)\n\t" \ "sw\t$23,"__str(PT_R23)"($29)\n\t" \ "sw\t$30,"__str(PT_R30)"($29)\n\t" \ ".end\t" #symbol "\n\t" \ ".size\t" #symbol",. - " #symbol) /* Used in declaration of save_static functions. */ #define static_unused static __attribute__((unused)) #endif /* !__ASSEMBLY__ */ /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ /* #define PTRACE_GETREGS 12 */ /* #define PTRACE_SETREGS 13 */ /* #define PTRACE_GETFPREGS 14 */ /* #define PTRACE_SETFPREGS 15 */ /* #define PTRACE_GETFPXREGS 18 */ /* #define PTRACE_SETFPXREGS 19 */ #define PTRACE_SETOPTIONS 21 /* options set using PTRACE_SETOPTIONS */ #define PTRACE_O_TRACESYSGOOD 0x00000001 #ifdef __ASSEMBLY__ #include <asm/offset.h> #endif #ifdef __KERNEL__ #ifndef __ASSEMBLY__ /* * Does the process account for user or for system time? */ #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) #define instruction_pointer(regs) ((regs)->cp0_epc) extern void show_regs(struct pt_regs *); #endif /* !__ASSEMBLY__ */ #endif #endif /* _ASM_PTRACE_H */
/* * ftp_server.h * * Copyright (C) 2004 Sourcefire,Inc * Steven A. Sturges <ssturges@sourcefire.com> * Daniel J. Roelker <droelker@sourcefire.com> * Marc A. Norton <mnorton@sourcefire.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Description: * * Header file for FTPTelnet FTP Server Module * * This file defines the server structure and functions to access server * inspection. * * NOTES: * - 16.09.04: Initial Development. SAS * */ #ifndef __FTP_SERVER_H__ #define __FTP_SERVER_H__ #include "ftpp_include.h" typedef struct s_FTP_SERVER_RSP { char *rsp_line; unsigned int rsp_line_size; char *rsp_begin; char *rsp_end; unsigned int rsp_size; char *msg_begin; char *msg_end; unsigned int msg_size; char *pipeline_req; int state; } FTP_SERVER_RSP; typedef struct s_FTP_SERVER { FTP_SERVER_RSP response; } FTP_SERVER; int ftp_server_inspection(void *S, unsigned char *data, int dsize); #endif
/* Change the protections of file relative to open directory. Linux version. Copyright (C) 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <fcntl.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <alloca.h> #include <kernel-features.h> #include <sysdep.h> int fchmodat (fd, file, mode, flag) int fd; const char *file; mode_t mode; int flag; { if (flag & ~AT_SYMLINK_NOFOLLOW) { __set_errno (EINVAL); return -1; } #ifndef __NR_lchmod /* Linux so far has no lchmod syscall. */ if (flag & AT_SYMLINK_NOFOLLOW) { __set_errno (ENOTSUP); return -1; } #endif int result; #ifdef __NR_fchmodat # ifndef __ASSUME_ATFCTS if (__have_atfcts >= 0) # endif { result = INLINE_SYSCALL (fchmodat, 3, fd, file, mode); # ifndef __ASSUME_ATFCTS if (result == -1 && errno == ENOSYS) __have_atfcts = -1; else # endif return result; } #endif #ifndef __ASSUME_ATFCTS char *buf = NULL; if (fd != AT_FDCWD && file[0] != '/') { size_t filelen = strlen (file); static const char procfd[] = "/proc/self/fd/%d/%s"; /* Buffer for the path name we are going to use. It consists of - the string /proc/self/fd/ - the file descriptor number - the file name provided. The final NUL is included in the sizeof. A bit of overhead due to the format elements compensates for possible negative numbers. */ size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen; buf = alloca (buflen); __snprintf (buf, buflen, procfd, fd, file); file = buf; } INTERNAL_SYSCALL_DECL (err); # ifdef __NR_lchmod if (flag & AT_SYMLINK_NOFOLLOW) result = INTERNAL_SYSCALL (lchmod, err, 2, file, mode); else # endif result = INTERNAL_SYSCALL (chmod, err, 2, file, mode); if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0)) { __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf); result = -1; } return result; #endif }
#pragma once #include "ASyncSerial.h" #include "DomoticzHardware.h" class CDavisLoggerSerial : public AsyncSerial, public CDomoticzHardwareBase { enum _eDavisState { DSTATE_WAKEUP = 0, DSTATE_LOOP, }; public: CDavisLoggerSerial(const int ID, const std::string& devname, unsigned int baud_rate); ~CDavisLoggerSerial(void); bool WriteToHardware(const char *pdata, const unsigned char length) override; private: bool StartHardware() override; bool StopHardware() override; void readCallback(const char *data, size_t len); bool HandleLoopData(const unsigned char *data, size_t len); bool OpenSerialDevice(); void Do_Work(); private: std::string m_szSerialPort; unsigned int m_iBaudRate; std::shared_ptr<std::thread> m_thread; int m_retrycntr; _eDavisState m_state; int m_statecounter; };
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef bts_MAP_SEQUENCE_EM_H #define bts_MAP_SEQUENCE_EM_H /* ---- includes ----------------------------------------------------------- */ #include "b_BasicEm/Context.h" #include "b_BasicEm/Basic.h" #include "b_BasicEm/Int32Arr.h" #include "b_BasicEm/UInt16Arr.h" #include "b_BasicEm/MemTbl.h" #include "b_TensorEm/VectorMap.h" /* ---- related objects --------------------------------------------------- */ /* ---- typedefs ----------------------------------------------------------- */ /* ---- constants ---------------------------------------------------------- */ /** data format version number */ #define bts_MAP_SEQUENCE_VERSION 100 /* ---- object definition -------------------------------------------------- */ /** sequence of vector maps */ struct bts_MapSequence { /* ---- public data ---------------------------------------------------- */ /** base element (must be first element) */ struct bts_VectorMap baseE; /* ---- private data --------------------------------------------------- */ /** internal vector */ struct bts_Flt16Vec vecE; /* ---- public data ---------------------------------------------------- */ /** map sequence size */ uint32 sizeE; /** preallocation size for internal vector */ uint32 vecSizeE; /** object buffer */ struct bbs_UInt16Arr objBufE; /** map pointer arrray */ struct bts_VectorMap** ptrArrE; }; /* ---- associated objects ------------------------------------------------- */ /* ---- external functions ------------------------------------------------- */ /* ---- \ghd{ constructor/destructor } ------------------------------------- */ /** initializes bts_MapSequence */ void bts_MapSequence_init( struct bbs_Context* cpA, struct bts_MapSequence* ptrA ); /** resets bts_MapSequence */ void bts_MapSequence_exit( struct bbs_Context* cpA, struct bts_MapSequence* ptrA ); /* ---- \ghd{ operators } -------------------------------------------------- */ /** copy operator */ void bts_MapSequence_copy( struct bbs_Context* cpA, struct bts_MapSequence* ptrA, const struct bts_MapSequence* srcPtrA ); /** equal operator */ flag bts_MapSequence_equal( struct bbs_Context* cpA, const struct bts_MapSequence* ptrA, const struct bts_MapSequence* srcPtrA ); /* ---- \ghd{ query functions } -------------------------------------------- */ /* ---- \ghd{ modify functions } ------------------------------------------- */ /* ---- \ghd{ memory I/O } ------------------------------------------------- */ /** word size (16-bit) object needs when written to memory */ uint32 bts_MapSequence_memSize( struct bbs_Context* cpA, const struct bts_MapSequence* ptrA ); /** writes object to memory; returns number of words (16-bit) written */ uint32 bts_MapSequence_memWrite( struct bbs_Context* cpA, const struct bts_MapSequence* ptrA, uint16* memPtrA ); /** reads object from memory; returns number of words (16-bit) read */ uint32 bts_MapSequence_memRead( struct bbs_Context* cpA, struct bts_MapSequence* ptrA, const uint16* memPtrA, struct bbs_MemTbl* mtpA ); /* ---- \ghd{ exec functions } --------------------------------------------- */ /** Vector map operation. * Maps vector inVec to outVec (overflow-safe) * Memory areas of vectors may not overlap */ void bts_MapSequence_map( struct bbs_Context* cpA, const struct bts_VectorMap* ptrA, const struct bts_Flt16Vec* inVecPtrA, struct bts_Flt16Vec* outVecPtrA ); #endif /* bts_MAP_SEQUENCE_EM_H */
//____________________________________________________________________________ /*! \class genie::GVldContext \brief Validity Context for an Event Generator \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab \created November 20, 2004 \cpright Copyright (c) 2003-2015, GENIE Neutrino MC Generator Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE */ //____________________________________________________________________________ #ifndef _GENERATOR_VALIDITY_CONTEXT_H_ #define _GENERATOR_VALIDITY_CONTEXT_H_ #include <string> #include <iostream> #include "Interaction/ScatteringType.h" #include "Interaction/InteractionType.h" using std::string; using std::ostream; namespace genie { class Interaction; class GVldContext { public : GVldContext(); ~GVldContext(); void Decode (string encoded_values); double Emin (void) const { return fEmin; } double Emax (void) const { return fEmax; } void Print (ostream & stream) const; friend ostream & operator<< (ostream & stream, const GVldContext & vldc); private: void Init(void); void DecodeENERGY (string encoded_values); double fEmin; // min probe energy in validity range double fEmax; // max probe energy in validity range }; } // genie namespace #endif // _GENERATOR_VALIDITY_CONTEXT_H_
#include <stdbool.h> #include <sys/types.h> #ifndef GO_MERKLETREE_MERKLE_TREE_H_ #define GO_MERKLETREE_MERKLE_TREE_H_ // These types & functions provide a trampoline to call the C++ MerkleTree // implementation from within Go code. // // Generally we try to jump through hoops to not allocate memory from the C++ // side, but rather have Go allocate it inside its GC memory such that we don't // have to worry about leaks. Apart from the obvious benefit of doing it this // way, it usually also means one less memcpy() too which is nice. #ifdef __cplusplus extern "C" { #endif // The _cgo_export.h file doesn't appear to exist when this header is pulled in // to the .go file, because of this we can't use types like GoSlice here and so // we end up with void* everywhere; we'll at least typedef them so that the // source is a _little_ more readable. // Grumble grumble. typedef void* HASHER; typedef void* TREE; // Allocators & deallocators: // Creates a new Sha256Hasher HASHER NewSha256Hasher(); // Creates a new MerkleTree passing in |hasher|. // The MerkleTree takes ownership of |hasher|. TREE NewMerkleTree(HASHER hasher); // Deletes the passed in |tree|. void DeleteMerkleTree(TREE tree); // MerkleTree methods below. // See the comments in ../../merkletree/merkle_tree.h for details size_t NodeSize(TREE tree); size_t LeafCount(TREE tree); size_t LeafHash(TREE tree, size_t leaf, void* buf, size_t buf_len); size_t LevelCount(TREE tree); size_t AddLeaf(TREE tree, void* leaf, size_t leaf_len); size_t AddLeafHash(TREE tree, void* hash, size_t hash_len); size_t CurrentRoot(TREE tree, void *buf, size_t buf_len); size_t RootAtSnapshot(TREE tree, size_t snapshot, void* buf, size_t buf_len); // |out| must contain sufficent space to hold all of the path elements // sequentially. // |num_entries| is set to the number of actual elements stored in |out|. bool PathToCurrentRoot(TREE tree, size_t leaf, void* out, size_t out_len, size_t* num_entries); // |out| must contain sufficent space to hold all of the path elements // sequentially. // |num_entries| is set to the number of actual elements stored in |out|. bool PathToRootAtSnapshot(TREE tree, size_t leaf, size_t snapshot, void* out, size_t out_len, size_t* num_entries); // |out| must contain sufficent space to hold all of the path elements // sequentially. // |num_entries| is set to the number of actual elements stored in |out|. bool SnapshotConsistency(TREE tree, size_t snapshot1, size_t snapshot2, void* out, size_t out_len, size_t* num_entries); #ifdef __cplusplus } #endif #endif // GO_MERKLETREE_MERKLE_TREE_H_
/* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 2000 Simon Hausmann <hausmann@kde.org> * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. * * 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 RenderFrame_h #define RenderFrame_h #include "RenderPart.h" #include "RenderFrameSet.h" namespace WebCore { class HTMLFrameElement; class RenderFrame : public RenderPart { public: RenderFrame(HTMLFrameElement*); FrameEdgeInfo edgeInfo() const; private: virtual const char* renderName() const { return "RenderFrame"; } virtual bool isFrame() const { return true; } virtual void viewCleared(); }; inline RenderFrame* toRenderFrame(RenderObject* object) { ASSERT(!object || object->isFrame()); return static_cast<RenderFrame*>(object); } // This will catch anyone doing an unnecessary cast. void toRenderFrame(const RenderFrame*); } // namespace WebCore #endif // RenderFrame_h
// WorldStorage.h // Interfaces to the cWorldStorage class representing the chunk loading / saving thread // This class decides which storage schema to use for saving; it queries all available schemas for loading // Also declares the base class for all storage schemas, cWSSchema // Helper serialization class cJsonChunkSerializer is declared as well #pragma once #ifndef WORLDSTORAGE_H_INCLUDED #define WORLDSTORAGE_H_INCLUDED #include "../ChunkDef.h" #include "../OSSupport/IsThread.h" #include "../OSSupport/Queue.h" // fwd: class cWorld; typedef cQueue<cChunkCoordsWithCallback> cChunkCoordsQueue; /** Interface that all the world storage schemas need to implement */ class cWSSchema abstract { public: cWSSchema(cWorld * a_World) : m_World(a_World) {} virtual ~cWSSchema() {} // Force the descendants' destructors to be virtual virtual bool LoadChunk(const cChunkCoords & a_Chunk) = 0; virtual bool SaveChunk(const cChunkCoords & a_Chunk) = 0; virtual const AString GetName(void) const = 0; protected: cWorld * m_World; } ; typedef std::list<cWSSchema *> cWSSchemaList; /** The actual world storage class */ class cWorldStorage : public cIsThread { typedef cIsThread super; public: cWorldStorage(void); ~cWorldStorage(); void QueueLoadChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = nullptr); void QueueSaveChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = nullptr); void UnqueueLoad(int a_ChunkX, int a_ChunkZ); void UnqueueSave(const cChunkCoords & a_Chunk); bool Start(cWorld * a_World, const AString & a_StorageSchemaName, int a_StorageCompressionFactor); // Hide the cIsThread's Start() method, we need to provide args void Stop(void); // Hide the cIsThread's Stop() method, we need to signal the event void WaitForFinish(void); void WaitForLoadQueueEmpty(void); void WaitForSaveQueueEmpty(void); size_t GetLoadQueueLength(void); size_t GetSaveQueueLength(void); protected: cWorld * m_World; AString m_StorageSchemaName; cChunkCoordsQueue m_LoadQueue; cChunkCoordsQueue m_SaveQueue; /** All the storage schemas (all used for loading) */ cWSSchemaList m_Schemas; /** The one storage schema used for saving */ cWSSchema * m_SaveSchema; /** Set when there's any addition to the queues */ cEvent m_Event; /** Loads the chunk specified; returns true on success, false on failure */ bool LoadChunk(int a_ChunkX, int a_ChunkZ); void InitSchemas(int a_StorageCompressionFactor); virtual void Execute(void) override; /** Loads one chunk from the queue (if any queued); returns true if there are more chunks in the load queue */ bool LoadOneChunk(void); /** Saves one chunk from the queue (if any queued); returns true if there are more chunks in the save queue */ bool SaveOneChunk(void); } ; #endif // WORLDSTORAGE_H_INCLUDED
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #pragma once namespace arrow { namespace fs { /// \brief FileSystem entry type enum class FileType : int8_t { /// Entry is not found NotFound, /// Entry exists but its type is unknown /// /// This can designate a special file such as a Unix socket or character /// device, or Windows NUL / CON / ... Unknown, /// Entry is a regular file File, /// Entry is a directory Directory }; struct FileInfo; struct FileSelector; class FileSystem; class SubTreeFileSystem; class SlowFileSystem; class LocalFileSystem; class S3FileSystem; } // namespace fs } // namespace arrow
/* * Copyright 2015 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SRC_CPP_SVCS_STMGR_SRC_UTIL_XOR_MANAGER_H_ #define SRC_CPP_SVCS_STMGR_SRC_UTIL_XOR_MANAGER_H_ #include <map> #include <vector> #include "proto/messages.h" #include "basics/basics.h" #include "network/network.h" namespace heron { namespace stmgr { class RotatingMap; class XorManager { public: XorManager(EventLoop* eventLoop, sp_int32 _timeout, const std::vector<sp_int32>& _task_ids); virtual ~XorManager(); // Create a new entry for the tuple. // _task_id is the task id where the tuple // originated from. // _key is the tuple key // _value is the tuple key as seen by the // destination void create(sp_int32 _task_id, sp_int64 _key, sp_int64 _value); // Add one more entry to the tuple tree // _task_id is the task id where the tuple // originated from. // _key is the tuple key // _value is the tuple key as seen by the // destination // We return true if the xor value is now zerod out // Else return false bool anchor(sp_int32 _task_id, sp_int64 _key, sp_int64 _value); // remove this tuple key from our structure. // return true if this key was found. else false bool remove(sp_int32 _task_id, sp_int64 _key); private: void rotate(EventLoopImpl::Status _status); EventLoop* eventLoop_; sp_int32 timeout_; // map of task_id to a RotatingMap std::map<sp_int32, RotatingMap*> tasks_; // Configs to be read sp_int32 n_buckets_; }; } // namespace stmgr } // namespace heron #endif // SRC_CPP_SVCS_STMGR_SRC_UTIL_XOR_MANAGER_H_
// bsl_clocale.h -*-C++-*- #ifndef INCLUDED_BSL_CLOCALE #define INCLUDED_BSL_CLOCALE #ifndef INCLUDED_BSLS_IDENT #include <bsls_ident.h> #endif BSLS_IDENT("$Id: $") //@PURPOSE: Provide functionality of the corresponding C++ Standard header. // //@SEE_ALSO: package bsl+stdhdrs // //@DESCRIPTION: Provide types, in the 'bsl' namespace, equivalent to those // defined in the corresponding C++ standard header. Include the native // compiler-provided standard header, and also directly include Bloomberg's // implementation of the C++ standard type (if one exists). Finally, place the // included symbols from the 'std' namespace (if any) into the 'bsl' namespace. #ifndef INCLUDED_BSLS_NATIVESTD #include <bsls_nativestd.h> #endif #include <clocale> namespace bsl { // Import selected symbols into bsl namespace using native_std::lconv; using native_std::localeconv; using native_std::setlocale; } // close package namespace #endif // ---------------------------------------------------------------------------- // Copyright 2013 Bloomberg Finance L.P. // // 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. // ----------------------------- END-OF-FILE ----------------------------------
/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2006-08-23 Bernard the first version */ #include <rtthread.h> #define SVCMODE 0x13 /** * @addtogroup AT91SAM7 */ /*@{*/ /** * This function will initialize thread stack * * @param tentry the entry of thread * @param parameter the parameter of entry * @param stack_addr the beginning stack address * @param texit the function will be called when thread exit * * @return stack address */ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_addr, void *texit) { rt_uint32_t *stk; stack_addr += sizeof(rt_uint32_t); stack_addr = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)stack_addr, 8); stk = (rt_uint32_t *)stack_addr; *(--stk) = (rt_uint32_t)tentry; /* entry point */ *(--stk) = (rt_uint32_t)texit; /* lr */ *(--stk) = 0xdeadbeef; /* r12 */ *(--stk) = 0xdeadbeef; /* r11 */ *(--stk) = 0xdeadbeef; /* r10 */ *(--stk) = 0xdeadbeef; /* r9 */ *(--stk) = 0xdeadbeef; /* r8 */ *(--stk) = 0xdeadbeef; /* r7 */ *(--stk) = 0xdeadbeef; /* r6 */ *(--stk) = 0xdeadbeef; /* r5 */ *(--stk) = 0xdeadbeef; /* r4 */ *(--stk) = 0xdeadbeef; /* r3 */ *(--stk) = 0xdeadbeef; /* r2 */ *(--stk) = 0xdeadbeef; /* r1 */ *(--stk) = (rt_uint32_t)parameter; /* r0 : argument */ *(--stk) = SVCMODE; /* cpsr */ *(--stk) = SVCMODE; /* spsr */ /* return task's current stack address */ return (rt_uint8_t *)stk; } /*@}*/
/* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPC_SUPPORT_LOG_H #define GRPC_SUPPORT_LOG_H #include <grpc/support/port_platform.h> #include <grpc/impl/codegen/log.h> // IWYU pragma: export #endif /* GRPC_SUPPORT_LOG_H */
// // Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. // #ifndef ANALYTICS_PROTOBUF_COLLECTOR_H_ #define ANALYTICS_PROTOBUF_COLLECTOR_H_ #include <string> #include <vector> #include <boost/scoped_ptr.hpp> #include "analytics/protobuf_server.h" class DbHandlerInitializer; class ProtobufCollector { public: ProtobufCollector(EventManager *evm, uint16_t udp_server_port, const std::vector<std::string> &cassandra_ips, const std::vector<int> &cassandra_ports, const DbHandler::TtlMap&, const std::string& cassandra_user, const std::string& cassandra_password); virtual ~ProtobufCollector(); bool Initialize(); void Shutdown(); void SendStatistics(const std::string &name); private: void DbInitializeCb(); static const std::string kDbName; static const int kDbTaskInstance; static const std::string kDbTaskName; boost::scoped_ptr<DbHandlerInitializer> db_initializer_; boost::scoped_ptr<protobuf::ProtobufServer> server_; }; #endif // ANALYTICS_PROTOBUF_COLLECTOR_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_ #include <stddef.h> #include <memory> #include <string> #include <vector> #include "base/logging.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "components/translate/core/common/translate_errors.h" namespace translate { class LanguageState; class TranslateClient; class TranslateDriver; class TranslateManager; class TranslatePrefs; // The TranslateUIDelegate is a generic delegate for UI which offers Translate // feature to the user. // Note that the API offers a way to read/set language values through array // indices. Such indices are only valid as long as the visual representation // (infobar, bubble...) is in sync with the underlying language list which // can actually change at run time (see translate_language_list.h). // It is recommended that languages are only updated by language code to // avoid bugs like crbug.com/555124 class TranslateUIDelegate { public: static const size_t kNoIndex = static_cast<size_t>(-1); TranslateUIDelegate(const base::WeakPtr<TranslateManager>& translate_manager, const std::string& original_language, const std::string& target_language); virtual ~TranslateUIDelegate(); // Handles when an error message is shown. void OnErrorShown(TranslateErrors::Type error_type); // Returns the LanguageState associated with this object. const LanguageState& GetLanguageState(); // Returns the number of languages supported. size_t GetNumberOfLanguages() const; // Returns the original language index. size_t GetOriginalLanguageIndex() const; // Returns the original language code. std::string GetOriginalLanguageCode() const; // Updates the original language index. void UpdateOriginalLanguageIndex(size_t language_index); void UpdateOriginalLanguage(const std::string& language_code); // Returns the target language index. size_t GetTargetLanguageIndex() const; // Returns the target language code. std::string GetTargetLanguageCode() const; // Updates the target language index. void UpdateTargetLanguageIndex(size_t language_index); void UpdateTargetLanguage(const std::string& language_code); // Returns the ISO code for the language at |index|. std::string GetLanguageCodeAt(size_t index) const; // Returns the displayable name for the language at |index|. base::string16 GetLanguageNameAt(size_t index) const; // Starts translating the current page. void Translate(); // Reverts translation. void RevertTranslation(); // Processes when the user declines translation. // The function name is not accurate. It only means the user did not take // affirmative action after the translation ui show up. The user either // actively decline the translation or ignore the prompt of translation. // Pass |explicitly_closed| as true if user explicityly decline the // translation. // Pass |explicitly_closed| as false if the translation UI is dismissed // implicit by some user actions which ignore the translation UI, // such as switch to a new tab/window or navigate to another page by // click a link. void TranslationDeclined(bool explicitly_closed); // Returns true if the current language is blocked. bool IsLanguageBlocked(); // Sets the value if the current language is blocked. void SetLanguageBlocked(bool value); // Returns true if the current webpage is blacklisted. bool IsSiteBlacklisted(); // Sets the value if the current webpage is blacklisted. void SetSiteBlacklist(bool value); // Returns true if the webpage in the current original language should be // translated into the current target language automatically. bool ShouldAlwaysTranslate(); // Sets the value if the webpage in the current original language should be // translated into the current target language automatically. void SetAlwaysTranslate(bool value); // Returns true if the Always Translate checkbox should be checked by default. bool ShouldAlwaysTranslateBeCheckedByDefault(); private: // Gets the host of the page being translated, or an empty string if no URL is // associated with the current page. std::string GetPageHost(); TranslateDriver* translate_driver_; base::WeakPtr<TranslateManager> translate_manager_; // ISO code (en, fr...) -> displayable name in the current locale typedef std::pair<std::string, base::string16> LanguageNamePair; // The list supported languages for translation. // The languages are sorted alphabetically based on the displayable name. std::vector<LanguageNamePair> languages_; // The index for language the page is originally in. size_t original_language_index_; // The index for language the page is originally in that was originally // reported (original_language_index_ changes if the user selects a new // original language, but this one does not). This is necessary to report // language detection errors with the right original language even if the user // changed the original language. size_t initial_original_language_index_; // The index for language the page should be translated to. size_t target_language_index_; // The translation related preferences. std::unique_ptr<TranslatePrefs> prefs_; DISALLOW_COPY_AND_ASSIGN(TranslateUIDelegate); }; } // namespace translate #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_UI_DELEGATE_H_
/* $NetBSD: negtf2.c,v 1.1 2011/01/17 10:08:35 matt Exp $ */ /* * Written by Matt Thomas, 2011. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #ifdef FLOAT128 float128 __negtf2(float128); float128 __negtf2(float128 a) { /* libgcc1.c says -a */ a.high ^= FLOAT64_MANGLE(0x8000000000000000ULL); return a; } #endif /* FLOAT128 */
// 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 NET_CERT_CT_TEST_UTIL_H_ #define NET_CERT_CT_TEST_UTIL_H_ #include <stddef.h> #include <stdint.h> #include <string> #include <vector> #include "base/memory/ref_counted.h" namespace net { namespace ct { struct DigitallySigned; struct LogEntry; struct SignedCertificateTimestamp; struct SignedTreeHead; // Note: unless specified otherwise, all test data is taken from Certificate // Transparency test data repository. // Fills |entry| with test data for an X.509 entry. void GetX509CertLogEntry(LogEntry* entry); // Returns a DER-encoded X509 cert. The SCT provided by // GetX509CertSCT is signed over this certificate. std::string GetDerEncodedX509Cert(); // Fills |entry| with test data for a Precertificate entry. void GetPrecertLogEntry(LogEntry* entry); // Returns the binary representation of a test DigitallySigned std::string GetTestDigitallySigned(); // Returns the binary representation of a test serialized SCT. std::string GetTestSignedCertificateTimestamp(); // Test log key std::string GetTestPublicKey(); // ID of test log key std::string GetTestPublicKeyId(); // SCT for the X509Certificate provided above. void GetX509CertSCT(scoped_refptr<SignedCertificateTimestamp>* sct); // SCT for the Precertificate log entry provided above. void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct); // Issuer key hash std::string GetDefaultIssuerKeyHash(); // Fake OCSP response with an embedded SCT list. std::string GetDerEncodedFakeOCSPResponse(); // The SCT list embedded in the response above. std::string GetFakeOCSPExtensionValue(); // The cert the OCSP response is for. std::string GetDerEncodedFakeOCSPResponseCert(); // The issuer of the previous cert. std::string GetDerEncodedFakeOCSPResponseIssuerCert(); // A sample, valid STH. bool GetSampleSignedTreeHead(SignedTreeHead* sth); // A valid STH for the empty tree. bool GetSampleEmptySignedTreeHead(SignedTreeHead* sth); // An STH for an empty tree where the root hash is not the hash of the empty // string, but the signature over the STH is valid. Such an STH is not valid // according to RFC6962. bool GetBadEmptySignedTreeHead(SignedTreeHead* sth); // The SHA256 root hash for the sample STH. std::string GetSampleSTHSHA256RootHash(); // The tree head signature for the sample STH. std::string GetSampleSTHTreeHeadSignature(); // The same signature as GetSampleSTHTreeHeadSignature, decoded. bool GetSampleSTHTreeHeadDecodedSignature(DigitallySigned* signature); // The sample STH in JSON form. std::string GetSampleSTHAsJson(); // Assembles, and returns, a sample STH in JSON format using // the provided parameters. std::string CreateSignedTreeHeadJsonString(size_t tree_size, int64_t timestamp, std::string sha256_root_hash, std::string tree_head_signature); // Assembles, and returns, a sample consistency proof in JSON format using // the provided raw nodes (i.e. the raw nodes will be base64-encoded). std::string CreateConsistencyProofJsonString( const std::vector<std::string>& raw_nodes); } // namespace ct } // namespace net #endif // NET_CERT_CT_TEST_UTIL_H_
// Copyright 2015 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 UI_GFX_WIN_METRO_MODE_H_ #define UI_GFX_WIN_METRO_MODE_H_ #include "ui/gfx/gfx_export.h" namespace gfx { namespace win { // Returns whether Metro Mode should be used. GFX_EXPORT bool ShouldUseMetroMode(); } // namespace win } // namespace gfx #endif // UI_GFX_WIN_METRO_MODE_H_
/**************************************************************************** * VCGLib o o * * Visual and Computer Graphics Library o o * * _ O _ * * Copyright(C) 2004 \/)\/ * * Visual Computing Lab /\/| * * ISTI - Italian National Research Council | * * \ * * 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 (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * ****************************************************************************/ /**************************************************************************** History ****************************************************************************/ #ifndef __VCGLIB_EDGE_DISTANCE #define __VCGLIB_EDGE_DISTANCE #include <vcg/math/base.h> #include <vcg/space/point3.h> #include <vcg/space/distance3.h> #include <vcg/space/segment3.h> namespace vcg { namespace edge{ /*Point edge distance*/ template <class EdgeType> bool PointDistance( const EdgeType &e, const vcg::Point3<typename EdgeType::ScalarType> & q, typename EdgeType::ScalarType & dist, vcg::Point3<typename EdgeType::ScalarType> & p ) { vcg::Segment3<typename EdgeType::ScalarType> s; s.P0()=e.V(0)->P(); s.P1()=e.V(1)->P(); typename EdgeType::CoordType nearest; typename EdgeType::ScalarType d; // nearest=vcg::ClosestPoint<typename EdgeType::ScalarType>(s,q); // d=(q-nearest).Norm(); vcg::SegmentPointDistance(s,q ,nearest,d); if (d<dist){ dist=d; p=nearest; return true; } else return false; } template <class S> class PointDistanceFunctor { public: typedef S ScalarType; typedef Point3<ScalarType> QueryType; static inline const Point3<ScalarType> & Pos(const QueryType & qt) {return qt;} template <class EDGETYPE, class SCALARTYPE> inline bool operator () (const EDGETYPE & e, const Point3<SCALARTYPE> & p, SCALARTYPE & minDist, Point3<SCALARTYPE> & q) { const Point3<typename EDGETYPE::ScalarType> fp = Point3<typename EDGETYPE::ScalarType>::Construct(p); Point3<typename EDGETYPE::ScalarType> fq; typename EDGETYPE::ScalarType md = (typename EDGETYPE::ScalarType)(minDist); const bool ret = vcg::edge::PointDistance(e, fp, md, fq); minDist = (SCALARTYPE)(md); q = Point3<SCALARTYPE>::Construct(fq); return (ret); } }; template <class EdgeType> typename EdgeType::ScalarType Length(const EdgeType &e) { return Distance(e.cV(0)->cP(),e.cV(1)->cP()); } template <class EdgeType> typename EdgeType::VertexType::CoordType Center(const EdgeType &e) { return (e.cV(0)->cP()+e.cV(1)->cP())/2.0; } } // end namespace edge } // end namespace vcg #endif
// 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_STATUS_NETWORK_MENU_H_ #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ #include <string> #include <vector> #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/chromeos/cros/network_library.h" // ConnectionType #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow class Browser; namespace ui { class MenuModel; } namespace views { class MenuItemView; class MenuButton; class MenuModelAdapter; class MenuRunner; } namespace chromeos { class NetworkMenuModel; // This class builds and manages a ui::MenuModel used to build network // menus. It does not represent an actual menu widget. The menu is populated // with the list of networks, and handles connecting to existing networks or // spawning UI to configure a new network. // // The network menu model looks like this: // // <icon> Ethernet // <icon> Wifi Network A // <icon> Wifi Network B // <icon> Wifi Network C // <icon> Cellular Network A // <icon> Cellular Network B // <icon> Cellular Network C // <icon> Other Wi-Fi network... // -------------------------------- // <icon> Private networks -> // <icon> Virtual Network A // <icon> Virtual Network B // ---------------------------------- // Add private network... // Disconnect private network // -------------------------------- // Disable Wifi // Disable Celluar // -------------------------------- // <IP Address> // Network settings... // // <icon> will show the strength of the wifi/cellular networks. // The label will be BOLD if the network is currently connected. class NetworkMenu { public: class Delegate { public: virtual gfx::NativeWindow GetNativeWindow() const = 0; virtual void OpenButtonOptions() = 0; virtual bool ShouldOpenButtonOptions() const = 0; }; explicit NetworkMenu(Delegate* delegate); virtual ~NetworkMenu(); // Access to menu definition. ui::MenuModel* GetMenuModel(); // Update the menu (e.g. when the network list or status has changed). virtual void UpdateMenu(); // Shows network details in Web UI options window. void ShowTabbedNetworkSettings(const Network* network) const; // Getters. Delegate* delegate() const { return delegate_; } // Attempts to connect to the specified network. If the network is already // connected, or is connecting, then it shows the settings for the network. void ConnectToNetwork(Network* network); // Enables/disables wifi/cellular network device. void ToggleWifi(); void ToggleMobile(); // Shows UI to user to connect to an unlisted wifi network. void ShowOtherWifi(); // Shows UI to user to configure vpn. void ShowOtherVPN(); // Shows UI to user to search for cellular networks. void ShowOtherCellular(); private: friend class NetworkMenuModel; // Used in a closure for doing actual network connection. void DoConnect(Network* network); // Weak ptr to delegate. Delegate* delegate_; // Set to true if we are currently refreshing the menu. bool refreshing_menu_; // The network menu. scoped_ptr<NetworkMenuModel> main_menu_model_; // Weak pointer factory so we can start connections at a later time // without worrying that they will actually try to happen after the lifetime // of this object. base::WeakPtrFactory<NetworkMenu> weak_pointer_factory_; DISALLOW_COPY_AND_ASSIGN(NetworkMenu); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_
// Copyright (c) 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 CHROME_BROWSER_GPU_GPU_MODE_MANAGER_H_ #define CHROME_BROWSER_GPU_GPU_MODE_MANAGER_H_ #include "components/prefs/pref_change_registrar.h" class PrefRegistrySimple; class GpuModeManager { public: static void RegisterPrefs(PrefRegistrySimple* registry); GpuModeManager(); GpuModeManager(const GpuModeManager&) = delete; GpuModeManager& operator=(const GpuModeManager&) = delete; ~GpuModeManager(); bool initial_gpu_mode_pref() const; private: static bool IsGpuModePrefEnabled(); PrefChangeRegistrar pref_registrar_; bool initial_gpu_mode_pref_; }; #endif // CHROME_BROWSER_GPU_GPU_MODE_MANAGER_H_
// // ASListTestSection.h // AsyncDisplayKit // // Created by Adlai Holler on 12/25/16. // Copyright © 2016 Facebook. All rights reserved. // #import <IGListKit/IGListKit.h> #import <AsyncDisplayKit/AsyncDisplayKit.h> @interface ASListTestSection : IGListSectionController <IGListSectionType, ASSectionController> @property (nonatomic) NSInteger itemCount; @property (nonatomic) NSInteger selectedItemIndex; @end
#import <PEGKit/PKParser.h> enum { DETERMINISTICPALINDROME_TOKEN_KIND_0 = 14, DETERMINISTICPALINDROME_TOKEN_KIND_1 = 15, DETERMINISTICPALINDROME_TOKEN_KIND_2 = 16, }; @interface DeterministicPalindromeParser : PKParser @end
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once #include "DXSampleHelper.h" using namespace DirectX; using Microsoft::WRL::ComPtr; class FrameResource { private: void SetCityPositions(FLOAT intervalX, FLOAT intervalZ); public: struct SceneConstantBuffer { XMFLOAT4X4 mvp; // Model-view-projection (MVP) matrix. FLOAT padding[48]; }; ComPtr<ID3D12CommandAllocator> m_commandAllocator; ComPtr<ID3D12CommandAllocator> m_bundleAllocator; ComPtr<ID3D12GraphicsCommandList> m_bundle; ComPtr<ID3D12Resource> m_cbvUploadHeap; SceneConstantBuffer* m_pConstantBuffers; UINT64 m_fenceValue; std::vector<XMFLOAT4X4> m_modelMatrices; UINT m_cityRowCount; UINT m_cityColumnCount; UINT m_cityMaterialCount; FrameResource(ID3D12Device* pDevice, UINT cityRowCount, UINT cityColumnCount, UINT cityMaterialCount, float citySpacingInterval); ~FrameResource(); void InitBundle(ID3D12Device* pDevice, ID3D12PipelineState* pPso, UINT frameResourceIndex, UINT numIndices, D3D12_INDEX_BUFFER_VIEW* pIndexBufferViewDesc, D3D12_VERTEX_BUFFER_VIEW* pVertexBufferViewDesc, ID3D12DescriptorHeap* pCbvSrvDescriptorHeap, UINT cbvSrvDescriptorSize, ID3D12DescriptorHeap* pSamplerDescriptorHeap, ID3D12RootSignature* pRootSignature); void PopulateCommandList(ID3D12GraphicsCommandList* pCommandList, ID3D12PipelineState* pPso, UINT frameResourceIndex, UINT numIndices, D3D12_INDEX_BUFFER_VIEW* pIndexBufferViewDesc, D3D12_VERTEX_BUFFER_VIEW* pVertexBufferViewDesc, ID3D12DescriptorHeap* pCbvSrvDescriptorHeap, UINT cbvSrvDescriptorSize, ID3D12DescriptorHeap* pSamplerDescriptorHeap, ID3D12RootSignature* pRootSignature); void XM_CALLCONV UpdateConstantBuffers(FXMMATRIX view, CXMMATRIX projection); };
#include "glfw/src/init.c"
/* * Copyright 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __WFC_UTIL_COMMON_H__ #define __WFC_UTIL_COMMON_H__ /* * wfc_util_htoa * * return : void */ extern void wfc_util_htoa(unsigned char *pHexaBuff, int szHexaBuff, char *pAsciiStringBuff, int szAsciiStringBuff); /* * wfc_util_atoh * * return : void */ extern void wfc_util_atoh(char *pAsciiString, int szAsciiString, unsigned char *pHexaBuff, int szHexaBuff); /* * wfc_util_is_random_mac * * return : it will return 1 if [mac_add] is same with WFC_UTIL_RANDOM_MAC_HEADER * or will return 0 if not. */ extern int wfc_util_is_random_mac(char *mac_add); /* * wfc_util_random_mac * * Create random MAC address * * return : void */ void wfc_util_random_mac(unsigned char* mac_addr); #endif
/** * \file * <!-- * This file is part of BeRTOS. * * Bertos is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * As a special exception, you may use this file as part of a free software * library without restriction. Specifically, if other files instantiate * templates or use macros or inline functions from this file, or you compile * this file and link it with other files to produce an executable, this * file does not by itself cause the resulting executable to be covered by * the GNU General Public License. This exception does not however * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * * Copyright 2010 Develer S.r.l. (http://www.develer.com/) * All Rights Reserved. * --> * * \brief Led on/off macros for AT91SAM7S. * * \author Daniele Basile <asterix@develer.com> */ #ifndef HW_LED_H #define HW_LED_H #include <cfg/macros.h> #include <io/arm.h> #define LED_PIN BV(0) #define LED_ON() PIOA_SODR = LED_PIN; #define LED_OFF() PIOA_CODR = LED_PIN; #define LED_INIT() \ do { \ PIOA_PER = LED_PIN; \ /* Disable pullups */ \ PIOA_PUDR = LED_PIN; \ /* Set PIO stepper power supply as output */ \ PIOA_OER = LED_PIN; \ /* Disable multidrive on all pins */ \ PIOA_MDDR = LED_PIN; \ } while(0) #endif /* HW_LED_H */
/* * head file * operation on ini file API used in kernel * parse ini file to mainkey and subkey value * Author: raymonxiu * */ #ifndef __CFG__OP__H__ #define __CFG__OP__H__ #define LINE_MAX_CHAR_NUM 512 #define MAX_LINE_NUM 2048 #define MAX_NAME_LEN 32 #define MAX_VALUE_LEN 128 #define MAX_MAINKEY_NUM 64 #define MAX_SUBKEY_NUM 512 #define INI_MAX_CHAR_NUM (LINE_MAX_CHAR_NUM * MAX_LINE_NUM) #define BIN_MAX_SIZE 4096*4 enum cfg_item_type { CFG_ITEM_VALUE_TYPE_INVALID = 0, CFG_ITEM_VALUE_TYPE_INT, CFG_ITEM_VALUE_TYPE_STR, }; enum cfg_key_flag { CFG_KEY_RELEASE, CFG_KEY_INIT, }; struct cfg_item { int val; char *str; }; struct cfg_subkey { char name[MAX_NAME_LEN]; struct cfg_item *value; enum cfg_item_type type; enum cfg_key_flag cfg_flag; }; struct cfg_mainkey { char name[MAX_NAME_LEN]; struct cfg_subkey *subkey[MAX_SUBKEY_NUM]; char *subkey_name[MAX_SUBKEY_NUM]; char *subkey_value[MAX_SUBKEY_NUM]; int subkey_cnt; enum cfg_key_flag cfg_flag; }; struct cfg_section { struct cfg_mainkey *mainkey[MAX_MAINKEY_NUM]; char *mainkey_name[MAX_MAINKEY_NUM]; int mainkey_cnt; enum cfg_key_flag cfg_flag; }; int cfg_get_sections(char *buffer, char *sections[]); int cfg_get_one_key_value(char *buffer, struct cfg_mainkey *scts, struct cfg_subkey *subkey); int cfg_get_all_keys_value(char *buffer, struct cfg_mainkey *scts); void cfg_subkey_init(struct cfg_subkey **subkey); void cfg_subkey_release(struct cfg_subkey **subkey); void cfg_mainkey_init(struct cfg_mainkey **mainkey, char **mainkey_name); void cfg_mainkey_release(struct cfg_mainkey **mainkey, char **mainkey_name); void cfg_section_init(struct cfg_section **cfg_sct); void cfg_section_release(struct cfg_section **cfg_sct); int cfg_read_ini(char *file_path, struct cfg_section **cfg_section); int cfg_read_file(char *file_path, char *buf, size_t len); int cfg_get_one_subkey(struct cfg_section *cfg_section, char *main, char *sub, struct cfg_subkey *subkey); #endif //__CFG__OP__H__
/* */ #ifndef __ASM_SMTC_IPI_H #define __ASM_SMTC_IPI_H #include <linux/spinlock.h> // #ifdef SMTC_IPI_DEBUG #include <asm/mipsregs.h> #include <asm/mipsmtregs.h> #endif /* */ /* */ struct smtc_ipi { struct smtc_ipi *flink; int type; void *arg; int dest; #ifdef SMTC_IPI_DEBUG int sender; long stamp; #endif /* */ }; /* */ #define LINUX_SMP_IPI 1 #define SMTC_CLOCK_TICK 2 #define IRQ_AFFINITY_IPI 3 /* */ struct smtc_ipi_q { struct smtc_ipi *head; spinlock_t lock; struct smtc_ipi *tail; int depth; int resched_flag; /* */ }; static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p) { unsigned long flags; spin_lock_irqsave(&q->lock, flags); if (q->head == NULL) q->head = q->tail = p; else q->tail->flink = p; p->flink = NULL; q->tail = p; q->depth++; #ifdef SMTC_IPI_DEBUG p->sender = read_c0_tcbind(); p->stamp = read_c0_count(); #endif /* */ spin_unlock_irqrestore(&q->lock, flags); } static inline struct smtc_ipi *__smtc_ipi_dq(struct smtc_ipi_q *q) { struct smtc_ipi *p; if (q->head == NULL) p = NULL; else { p = q->head; q->head = q->head->flink; q->depth--; /* */ if (q->head == NULL) q->tail = NULL; } return p; } static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q) { unsigned long flags; struct smtc_ipi *p; spin_lock_irqsave(&q->lock, flags); p = __smtc_ipi_dq(q); spin_unlock_irqrestore(&q->lock, flags); return p; } static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p) { unsigned long flags; spin_lock_irqsave(&q->lock, flags); if (q->head == NULL) { q->head = q->tail = p; p->flink = NULL; } else { p->flink = q->head; q->head = p; } q->depth++; spin_unlock_irqrestore(&q->lock, flags); } static inline int smtc_ipi_qdepth(struct smtc_ipi_q *q) { unsigned long flags; int retval; spin_lock_irqsave(&q->lock, flags); retval = q->depth; spin_unlock_irqrestore(&q->lock, flags); return retval; } extern void smtc_send_ipi(int cpu, int type, unsigned int action); #endif /* */
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef __ARCH_ARM_MACH_MSM_GPIOMUX_8X60_H #define __ARCH_ARM_MACH_MSM_GPIOMUX_8X60_H void __init msm8x60_init_gpiomux(struct msm_gpiomux_configs *cfgs); extern struct msm_gpiomux_configs msm8x60_qrdc_gpiomux_cfgs[] __initdata; extern struct msm_gpiomux_configs msm8x60_surf_ffa_gpiomux_cfgs[] __initdata; extern struct msm_gpiomux_configs msm8x60_fluid_gpiomux_cfgs[] __initdata; extern struct msm_gpiomux_configs msm8x60_charm_gpiomux_cfgs[] __initdata; extern struct msm_gpiomux_configs tenderloin_gpiomux_cfgs[] __initdata; extern struct msm_gpiomux_configs rump_gpiomux_cfgs[] __initdata; #endif
/* arch_prctl call for Linux/x32. Copyright (C) 2012-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <sys/prctl.h> #include <sys/syscall.h> #include <sysdep.h> #include <stdint.h> /* Since x32 arch_prctl stores 32-bit base address of segment registers %fs and %gs as unsigned 64-bit value via ARCH_GET_FS and ARCH_GET_GS, we use an unsigned 64-bit variable to hold the base address and copy it to ADDR after the system call returns. */ int __arch_prctl (int code, uintptr_t *addr) { int res; uint64_t addr64; void *prctl_arg = addr; switch (code) { case ARCH_GET_FS: case ARCH_GET_GS: prctl_arg = &addr64; break; } res = INLINE_SYSCALL (arch_prctl, 2, code, prctl_arg); if (res == 0) switch (code) { case ARCH_GET_FS: case ARCH_GET_GS: /* Check for a large value that overflows. */ if ((uintptr_t) addr64 != addr64) { __set_errno (EOVERFLOW); return -1; } *addr = (uintptr_t) addr64; break; } return res; } weak_alias (__arch_prctl, arch_prctl)
/* 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 PINK_ACTION_TALK_H #define PINK_ACTION_TALK_H #include "pink/objects/actions/action_loop.h" namespace Pink { class Sound; class ActionTalk : public ActionLoop { public: void deserialize(Archive &archive) override; void toConsole() const override; void update() override; void end() override; void pause(bool paused) override; protected: void onStart() override; bool isTalk() override { return true; } private: Common::String _vox; Sound _sound; }; } // End of namespace Pink #endif
/* GStreamer * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> * Copyright (C) <2007-2008> Sebastian Dröge <sebastian.droege@collabora.co.uk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __AUDIO_RESAMPLE_H__ #define __AUDIO_RESAMPLE_H__ #include <gst/gst.h> #include <gst/base/gstbasetransform.h> #include <gst/audio/audio.h> #include "speex_resampler_wrapper.h" G_BEGIN_DECLS #define GST_TYPE_AUDIO_RESAMPLE \ (gst_audio_resample_get_type()) #define GST_AUDIO_RESAMPLE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_RESAMPLE,GstAudioResample)) #define GST_AUDIO_RESAMPLE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_RESAMPLE,GstAudioResampleClass)) #define GST_IS_AUDIO_RESAMPLE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_RESAMPLE)) #define GST_IS_AUDIO_RESAMPLE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_RESAMPLE)) typedef struct _GstAudioResample GstAudioResample; typedef struct _GstAudioResampleClass GstAudioResampleClass; /** * GstAudioResample: * * Opaque data structure. */ struct _GstAudioResample { GstBaseTransform element; /* <private> */ gboolean need_discont; GstClockTime t0; guint64 in_offset0; guint64 out_offset0; guint64 samples_in; guint64 samples_out; guint64 num_gap_samples; guint64 num_nongap_samples; /* properties */ gint quality; /* state */ gboolean fp; gint width; gint channels; gint inrate; gint outrate; SpeexResamplerSincFilterMode sinc_filter_mode; guint32 sinc_filter_auto_threshold; guint8 *tmp_in; guint tmp_in_size; guint8 *tmp_out; guint tmp_out_size; SpeexResamplerState *state; const SpeexResampleFuncs *funcs; }; struct _GstAudioResampleClass { GstBaseTransformClass parent_class; }; GType gst_audio_resample_get_type(void); G_END_DECLS #endif /* __AUDIO_RESAMPLE_H__ */
/* * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README */ #include <linux/fs.h> #include <linux/reiserfs_fs.h> #include <linux/time.h> #include <asm/uaccess.h> #include <linux/pagemap.h> #include <linux/smp_lock.h> static int reiserfs_unpack(struct inode *inode, struct file *filp); /* ** reiserfs_ioctl - handler for ioctl for inode ** supported commands: ** 1) REISERFS_IOC_UNPACK - try to unpack tail from direct item into indirect ** and prevent packing file (argument arg has to be non-zero) ** 2) REISERFS_IOC_[GS]ETFLAGS, REISERFS_IOC_[GS]ETVERSION ** 3) That's all for a while ... */ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { unsigned int flags; switch (cmd) { case REISERFS_IOC_UNPACK: if (S_ISREG(inode->i_mode)) { if (arg) return reiserfs_unpack(inode, filp); else return 0; } else return -ENOTTY; /* following two cases are taken from fs/ext2/ioctl.c by Remy Card (card@masi.ibp.fr) */ case REISERFS_IOC_GETFLAGS: if (!reiserfs_attrs(inode->i_sb)) return -ENOTTY; flags = REISERFS_I(inode)->i_attrs; i_attrs_to_sd_attrs(inode, (__u16 *) & flags); return put_user(flags, (int __user *)arg); case REISERFS_IOC_SETFLAGS:{ if (!reiserfs_attrs(inode->i_sb)) return -ENOTTY; if (IS_RDONLY(inode)) return -EROFS; if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) return -EPERM; if (get_user(flags, (int __user *)arg)) return -EFAULT; if (((flags ^ REISERFS_I(inode)-> i_attrs) & (REISERFS_IMMUTABLE_FL | REISERFS_APPEND_FL)) && !capable(CAP_LINUX_IMMUTABLE)) return -EPERM; if ((flags & REISERFS_NOTAIL_FL) && S_ISREG(inode->i_mode)) { int result; result = reiserfs_unpack(inode, filp); if (result) return result; } sd_attrs_to_i_attrs(flags, inode); REISERFS_I(inode)->i_attrs = flags; inode->i_ctime = CURRENT_TIME_SEC; mark_inode_dirty(inode); return 0; } case REISERFS_IOC_GETVERSION: return put_user(inode->i_generation, (int __user *)arg); case REISERFS_IOC_SETVERSION: if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) return -EPERM; if (IS_RDONLY(inode)) return -EROFS; if (get_user(inode->i_generation, (int __user *)arg)) return -EFAULT; inode->i_ctime = CURRENT_TIME_SEC; mark_inode_dirty(inode); return 0; default: return -ENOTTY; } } /* ** reiserfs_unpack ** Function try to convert tail from direct item into indirect. ** It set up nopack attribute in the REISERFS_I(inode)->nopack */ static int reiserfs_unpack(struct inode *inode, struct file *filp) { int retval = 0; int index; struct page *page; struct address_space *mapping; unsigned long write_from; unsigned long blocksize = inode->i_sb->s_blocksize; if (inode->i_size == 0) { REISERFS_I(inode)->i_flags |= i_nopack_mask; return 0; } /* ioctl already done */ if (REISERFS_I(inode)->i_flags & i_nopack_mask) { return 0; } reiserfs_write_lock(inode->i_sb); /* we need to make sure nobody is changing the file size beneath ** us */ down(&inode->i_sem); write_from = inode->i_size & (blocksize - 1); /* if we are on a block boundary, we are already unpacked. */ if (write_from == 0) { REISERFS_I(inode)->i_flags |= i_nopack_mask; goto out; } /* we unpack by finding the page with the tail, and calling ** reiserfs_prepare_write on that page. This will force a ** reiserfs_get_block to unpack the tail for us. */ index = inode->i_size >> PAGE_CACHE_SHIFT; mapping = inode->i_mapping; page = grab_cache_page(mapping, index); retval = -ENOMEM; if (!page) { goto out; } retval = mapping->a_ops->prepare_write(NULL, page, write_from, write_from); if (retval) goto out_unlock; /* conversion can change page contents, must flush */ flush_dcache_page(page); retval = mapping->a_ops->commit_write(NULL, page, write_from, write_from); REISERFS_I(inode)->i_flags |= i_nopack_mask; out_unlock: unlock_page(page); page_cache_release(page); out: up(&inode->i_sem); reiserfs_write_unlock(inode->i_sb); return retval; }
/* * linux/arch/unicore32/kernel/early_printk.c * * Code specific to PKUnity SoC and UniCore ISA * * Copyright (C) 2001-2010 GUAN Xue-tao * * 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/console.h> #include <linux/init.h> #include <linux/string.h> #include <mach/ocd.h> /* */ static void early_ocd_write(struct console *con, const char *s, unsigned n) { while (*s && n-- > 0) { if (*s == '\n') ocd_putc((int)'\r'); ocd_putc((int)*s); s++; } } static struct console early_ocd_console = { .name = "earlyocd", .write = early_ocd_write, .flags = CON_PRINTBUFFER, .index = -1, }; /* */ static struct console *early_console = &early_ocd_console; static int __initdata keep_early; static int __init setup_early_printk(char *buf) { if (!buf) return 0; if (strstr(buf, "keep")) keep_early = 1; if (!strncmp(buf, "ocd", 3)) early_console = &early_ocd_console; if (keep_early) early_console->flags &= ~CON_BOOT; else early_console->flags |= CON_BOOT; register_console(early_console); return 0; } early_param("earlyprintk", setup_early_printk);
/* $NoKeywords:$ */ /** * @file * * Create outline and references for mainpage documentation. * * Design guides, maintenance guides, and general documentation, are * collected using this file onto the documentation mainpage. * This file contains doxygen comment blocks, only. * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: Documentation * */ /* ****************************************************************************** * * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Advanced Micro Devices, Inc. nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************** */ /** * @mainpage * * The design and maintenance documentation for AGESA Sample Code is organized as * follows. On this page, you can reference design guides, maintenance guides, and * general documentation. Detailed Data Structure, Function, and Interface documentation * may be found using the Data Structures or Files tabs. See Related Pages for a * Release content summary, and, if this is not a production release, lists of To Do's, * Deprecated items, etc. * * @subpage starthere "Start Here - Initial Porting and Integration." * * @subpage optionmain "Build Configuration and Options Guides and Documentation." * * @subpage commonmain "Processor Common Component Guides and Documentation." * * @subpage cpumain "CPU Component Guides and Documentation." * * @subpage htmain "HT Component Guides and Documentation." * * @subpage memmain "MEM Component Guides and Documentation." * * @subpage gnbmain "GNB Component Documentation." * * @subpage fchmain "FCH Component Documentation." * * @subpage idsmain "IDS Component Guides and Documentation." * * @subpage recoverymain "Recovery Component Guides and Documentation." * */ /** * @page starthere Initial Porting and Integration * * @par Basic Check List * * <ul> * <li> Copy the \<plat\>Options.c file from the Addendum directory to the platform tip build directory. * AMD recommends the use of a sub-directory named AGESA to contain these files and the build output files. * <li> Copy the OptionsIds.h content in the spec to OptionsIds.h in the platform build tip directory * and make changes to enable the IDS support desired. It is highly recommended to set the following for * initial integration and development:@n * @code * #define IDSOPT_IDS_ENABLED TRUE * #define IDSOPT_ERROR_TRAP_ENABLED TRUE * #define IDSOPT_ASSERT_ENABLED TRUE * @endcode * <li> Edit and modify the option selections in those two files to meet the needs of the specific platform. * <li> Set the environment variable AGESA_ROOT to the root folder of the AGESA code. * <li> Set the environment variable AGESA_OptsDir the platform build tip AGESA directory. * <li> Generate the doxygen documentation or locate the file arch2008.chm within your AGESA release package. * </ul> * * @par Debugging Using ASSERT and IDS_ERROR_TRAP * * While AGESA code uses ::ASSERT and ::IDS_ERROR_TRAP to check for internal errors, these macros can also * catch and assist debug of wrapper and platform BIOS issues. * * When an ::ASSERT fails or an ::IDS_ERROR_TRAP is executed, the AGESA code will enter a halt loop and display a * Stop Code. A Stop Code is eight hex digits. The first (most significant) four are the FILECODE. * FILECODEs can be looked up in Filecode.h to determine which file contains the stop macro. Each file has a * unique code value. * The least significant digits are the line number in that file. * For example, 0210 means the macro is on line two hundred ten. * (see ::IdsErrorStop for more details on stop code display.) * * Enabling ::ASSERT and ::IDS_ERROR_TRAP ensure errors are caught and also provide a useful debug assist. * Comments near each macro use will describe the nature of the error and typical wrapper errors or other * root causes. * * After your wrapper consistently executes ::ASSERT and ::IDS_ERROR_TRAP stop free, you can disable them in * OptionsIds.h, except for regression testing. IDS is not expected to be enabled in production BIOS builds. * */
#include <my_global.h> #include <m_ctype.h> #include <m_string.h> #include <sys/types.h> #include <regex.h> #include "utils.h" #include "regex2.h" #include "debug.ih" /* Added extra paramter to regchar to remove static buffer ; Monty 96.11.27 */ /* - regprint - print a regexp for debugging == void regprint(regex_t *r, FILE *d); */ void regprint(r, d) regex_t *r; FILE *d; { register struct re_guts *g = r->re_g; register int i; register int c; register int last; int nincat[NC]; char buf[10]; fprintf(d, "%ld states, %d categories", (long)g->nstates, g->ncategories); fprintf(d, ", first %ld last %ld", (long)g->firststate, (long)g->laststate); if (g->iflags&USEBOL) fprintf(d, ", USEBOL"); if (g->iflags&USEEOL) fprintf(d, ", USEEOL"); if (g->iflags&BAD) fprintf(d, ", BAD"); if (g->nsub > 0) fprintf(d, ", nsub=%ld", (long)g->nsub); if (g->must != NULL) fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, g->must); if (g->backrefs) fprintf(d, ", backrefs"); if (g->nplus > 0) fprintf(d, ", nplus %ld", (long)g->nplus); fprintf(d, "\n"); s_print(g, d); for (i = 0; i < g->ncategories; i++) { nincat[i] = 0; for (c = CHAR_MIN; c <= CHAR_MAX; c++) if (g->categories[c] == i) nincat[i]++; } fprintf(d, "cc0#%d", nincat[0]); for (i = 1; i < g->ncategories; i++) if (nincat[i] == 1) { for (c = CHAR_MIN; c <= CHAR_MAX; c++) if (g->categories[c] == i) break; fprintf(d, ", %d=%s", i, regchar(c,buf)); } fprintf(d, "\n"); for (i = 1; i < g->ncategories; i++) if (nincat[i] != 1) { fprintf(d, "cc%d\t", i); last = -1; for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ if (c <= CHAR_MAX && g->categories[c] == i) { if (last < 0) { fprintf(d, "%s", regchar(c,buf)); last = c; } } else { if (last >= 0) { if (last != c-1) fprintf(d, "-%s", regchar(c-1,buf)); last = -1; } } fprintf(d, "\n"); } } /* - s_print - print the strip for debugging == static void s_print(register struct re_guts *g, FILE *d); */ static void s_print(g, d) register struct re_guts *g; FILE *d; { register sop *s; register cset *cs; register int i; register int done = 0; register sop opnd; register int col = 0; register int last; register sopno offset = 2; char buf[10]; # define GAP() { if (offset % 5 == 0) { \ if (col > 40) { \ fprintf(d, "\n\t"); \ col = 0; \ } else { \ fprintf(d, " "); \ col++; \ } \ } else \ col++; \ offset++; \ } if (OP(g->strip[0]) != OEND) fprintf(d, "missing initial OEND!\n"); for (s = &g->strip[1]; !done; s++) { opnd = OPND(*s); switch (OP(*s)) { case OEND: fprintf(d, "\n"); done = 1; break; case OCHAR: if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) fprintf(d, "\\%c", (char)opnd); else fprintf(d, "%s", regchar((char)opnd,buf)); break; case OBOL: fprintf(d, "^"); break; case OEOL: fprintf(d, "$"); break; case OBOW: fprintf(d, "\\{"); break; case OEOW: fprintf(d, "\\}"); break; case OANY: fprintf(d, "."); break; case OANYOF: fprintf(d, "[(%ld)", (long)opnd); cs = &g->sets[opnd]; last = -1; for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ if (CHIN(cs, i) && i < g->csetsize) { if (last < 0) { fprintf(d, "%s", regchar(i,buf)); last = i; } } else { if (last >= 0) { if (last != i-1) fprintf(d, "-%s", regchar(i-1,buf)); last = -1; } } fprintf(d, "]"); break; case OBACK_: fprintf(d, "(\\<%ld>", (long)opnd); break; case O_BACK: fprintf(d, "<%ld>\\)", (long)opnd); break; case OPLUS_: fprintf(d, "(+"); if (OP(*(s+opnd)) != O_PLUS) fprintf(d, "<%ld>", (long)opnd); break; case O_PLUS: if (OP(*(s-opnd)) != OPLUS_) fprintf(d, "<%ld>", (long)opnd); fprintf(d, "+)"); break; case OQUEST_: fprintf(d, "(?"); if (OP(*(s+opnd)) != O_QUEST) fprintf(d, "<%ld>", (long)opnd); break; case O_QUEST: if (OP(*(s-opnd)) != OQUEST_) fprintf(d, "<%ld>", (long)opnd); fprintf(d, "?)"); break; case OLPAREN: fprintf(d, "((<%ld>", (long)opnd); break; case ORPAREN: fprintf(d, "<%ld>))", (long)opnd); break; case OCH_: fprintf(d, "<"); if (OP(*(s+opnd)) != OOR2) fprintf(d, "<%ld>", (long)opnd); break; case OOR1: if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) fprintf(d, "<%ld>", (long)opnd); fprintf(d, "|"); break; case OOR2: fprintf(d, "|"); if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) fprintf(d, "<%ld>", (long)opnd); break; case O_CH: if (OP(*(s-opnd)) != OOR1) fprintf(d, "<%ld>", (long)opnd); fprintf(d, ">"); break; default: fprintf(d, "!%ld(%ld)!", OP(*s), opnd); break; } if (!done) GAP(); } } /* - regchar - make a character printable == static char *regchar(int ch); */ static char * /* -> representation */ regchar(ch,buf) int ch; char *buf; { if (isprint(ch) || ch == ' ') sprintf(buf, "%c", ch); else sprintf(buf, "\\%o", ch); return(buf); }
/* mpi.h - Multi Precision Integers * Copyright (C) 1994, 1996, 1998, 1999, * 2000, 2001 Free Software Foundation, Inc. * * This file is part of GNUPG. * * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * Note: This code is heavily based on the GNU MP Library. * Actually it's the same code with only minor changes in the * way the data is stored; this is to support the abstraction * of an optional secure memory allocation which may be used * to avoid revealing of sensitive data due to paging etc. * The GNU MP Library itself is published under the LGPL; * however I decided to publish this code under the plain GPL. */ #ifndef G10_MPI_H #define G10_MPI_H #include <linux/types.h> /* */ #define SHA1_DIGEST_LENGTH 20 /* */ #define BYTES_PER_MPI_LIMB (BITS_PER_LONG / 8) #define BITS_PER_MPI_LIMB BITS_PER_LONG typedef unsigned long int mpi_limb_t; typedef signed long int mpi_limb_signed_t; struct gcry_mpi { int alloced; /* */ int nlimbs; /* */ int nbits; /* */ int sign; /* */ unsigned flags; /* */ /* */ /* */ mpi_limb_t *d; /* */ }; typedef struct gcry_mpi *MPI; #define mpi_get_nlimbs(a) ((a)->nlimbs) #define mpi_is_neg(a) ((a)->sign) /* */ MPI mpi_alloc(unsigned nlimbs); MPI mpi_alloc_secure(unsigned nlimbs); MPI mpi_alloc_like(MPI a); void mpi_free(MPI a); int mpi_resize(MPI a, unsigned nlimbs); int mpi_copy(MPI *copy, const MPI a); void mpi_clear(MPI a); int mpi_set(MPI w, MPI u); int mpi_set_ui(MPI w, ulong u); MPI mpi_alloc_set_ui(unsigned long u); void mpi_m_check(MPI a); void mpi_swap(MPI a, MPI b); /* */ MPI do_encode_md(const void *sha_buffer, unsigned nbits); MPI mpi_read_from_buffer(const void *buffer, unsigned *ret_nread); int mpi_fromstr(MPI val, const char *str); u32 mpi_get_keyid(MPI a, u32 *keyid); void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign); void *mpi_get_secure_buffer(MPI a, unsigned *nbytes, int *sign); int mpi_set_buffer(MPI a, const void *buffer, unsigned nbytes, int sign); #define log_mpidump g10_log_mpidump /* */ int mpi_add_ui(MPI w, MPI u, ulong v); int mpi_add(MPI w, MPI u, MPI v); int mpi_addm(MPI w, MPI u, MPI v, MPI m); int mpi_sub_ui(MPI w, MPI u, ulong v); int mpi_sub(MPI w, MPI u, MPI v); int mpi_subm(MPI w, MPI u, MPI v, MPI m); /* */ int mpi_mul_ui(MPI w, MPI u, ulong v); int mpi_mul_2exp(MPI w, MPI u, ulong cnt); int mpi_mul(MPI w, MPI u, MPI v); int mpi_mulm(MPI w, MPI u, MPI v, MPI m); /* */ ulong mpi_fdiv_r_ui(MPI rem, MPI dividend, ulong divisor); int mpi_fdiv_r(MPI rem, MPI dividend, MPI divisor); int mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor); int mpi_fdiv_qr(MPI quot, MPI rem, MPI dividend, MPI divisor); int mpi_tdiv_r(MPI rem, MPI num, MPI den); int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den); int mpi_tdiv_q_2exp(MPI w, MPI u, unsigned count); int mpi_divisible_ui(const MPI dividend, ulong divisor); /* */ int mpi_gcd(MPI g, const MPI a, const MPI b); /* */ int mpi_pow(MPI w, MPI u, MPI v); int mpi_powm(MPI res, MPI base, MPI exp, MPI mod); /* */ int mpi_mulpowm(MPI res, MPI *basearray, MPI *exparray, MPI mod); /* */ int mpi_cmp_ui(MPI u, ulong v); int mpi_cmp(MPI u, MPI v); /* */ int mpi_getbyte(MPI a, unsigned idx); void mpi_putbyte(MPI a, unsigned idx, int value); unsigned mpi_trailing_zeros(MPI a); /* */ void mpi_normalize(MPI a); unsigned mpi_get_nbits(MPI a); int mpi_test_bit(MPI a, unsigned n); int mpi_set_bit(MPI a, unsigned n); int mpi_set_highbit(MPI a, unsigned n); void mpi_clear_highbit(MPI a, unsigned n); void mpi_clear_bit(MPI a, unsigned n); int mpi_rshift(MPI x, MPI a, unsigned n); /* */ int mpi_invm(MPI x, MPI u, MPI v); #endif /* */
/* This file is part of the KDE libraries Copyright (c) 1999 Preston Brown <pbrown@kde.org> Copyright (C) 1997 Matthias Kalle Dalheimer <kalle@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KMIMESOURCEFACTORY_H #define KMIMESOURCEFACTORY_H #include <kde3support_export.h> #include <kglobal.h> #include <QtGui/QMacMime> #include <Qt3Support/Q3MimeSourceFactory> class K3MimeSourceFactoryPrivate; class KIconLoader; /** * An extension to QMimeSourceFactory that uses KIconLoader to * find images. * * Normally you don't have to instantiate this class at all, KApplication does that for * you automagically and sets QMimeSourceFactory::setDefaultFactory. * * @author Peter Putzer <putzer@kde.org> */ class KDE3SUPPORT_EXPORT K3MimeSourceFactory : public Q3MimeSourceFactory { public: /** * Set up a K3MimeSourceFactory instance as the default mimesource factory. */ static void install(); /** * Constructor. * * @param loader is the iconloader used to find images. */ explicit K3MimeSourceFactory (KIconLoader* loader = 0); /** * Destructor. */ virtual ~K3MimeSourceFactory(); /** * This function is maps an absolute or relative name for a resource to * the absolute one. * * To load an icon, prepend the @p category name before the @p icon name, in the style * of \<category>|\<icon>. * * Example: * \code "<img src=\"user|ksysv_start\"/>", "<img src="\desktop|trash\">", ... * \endcode * * @param abs_or_rel_name is the absolute or relative pathname. * @param context is the path of the context object for the queried resource. Almost always empty. */ virtual QString makeAbsolute (const QString& abs_or_rel_name, const QString& context) const; protected: /** Virtual hook, used to add new "virtual" functions while maintaining binary compatibility. Unused in this class. */ virtual void virtual_hook( int id, void* data ); private: K3MimeSourceFactoryPrivate* const d; }; #endif // KMIMESOURCEFACTORY_H
/* * Copyright (c) 2010, * Gavriloaie Eugen-Andrei (shiretu@gmail.com) * * This file is part of crtmpserver. * crtmpserver is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * crtmpserver 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 crtmpserver. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __VARIANTTESTSSUITE_H #define __VARIANTTESTSSUITE_H #include "common.h" #include "basetestssuite.h" class VariantTestsSuite : public BaseTestsSuite { private: Variant _noParamsVar; Variant _boolVar1; Variant _boolVar2; Variant _int8Var; Variant _int16Var; Variant _int32Var; Variant _int64Var; Variant _uint8Var; Variant _uint16Var; Variant _uint32Var; Variant _uint64Var; Variant _doubleVar; Variant _dateVar; Variant _timeVar; Variant _timestampVar1; Variant _timestampVar2; Variant _pcharVar; Variant _stringVar; Variant _mapVar; Variant _namedMapVar; Variant _referenceVariant1; Variant _referenceVariant2; Variant _referenceVariant3; Variant _referenceVariant4; Variant _referenceVariant5; Variant _referenceVariant6; Variant _referenceVariant7; Variant _referenceVariant8; Variant _referenceVariant9; Variant _referenceVariant10; Variant _referenceVariant11; Variant _referenceVariant12; Variant _referenceVariant13; Variant _referenceVariant14; Variant _referenceVariant15; Variant _referenceVariant16; Variant _referenceVariant17; Variant _referenceVariant18; Variant _referenceVariant19; Variant _referenceVariant20; public: VariantTestsSuite(); virtual ~VariantTestsSuite(); virtual void Run(); private: void test_Constructors(); void test_Reset(); void test_ToString(); void test_OperatorAssign(); void test_OperatorCast(); void test_Compact(); }; #endif /* __VARIANTTESTSSUITE_H */
/* * Runtime.h * * Created on: Jul 23, 2012 * Author: lion */ #include "utils.h" #include "DateCache.h" #ifndef RUNTIME_H_ #define RUNTIME_H_ namespace fibjs { class Runtime { public: static Runtime &now(); static void reg(void *rt); static result_t setError(result_t hr) { Runtime &rt = Runtime::now(); rt.m_code = hr; return rt.m_code; } static result_t setError(std::string err) { Runtime &rt = Runtime::now(); rt.m_code = CALL_E_EXCEPTION; rt.m_error = err; return rt.m_code; } static result_t setError(const char *err = NULL) { Runtime &rt = Runtime::now(); rt.m_code = CALL_E_EXCEPTION; rt.m_error.assign(err ? err : ""); return rt.m_code; } static const std::string &errMessage() { return Runtime::now().m_error; } static result_t errNumber() { return Runtime::now().m_code; } public: DateCache *m_pDateCache; private: result_t m_code; std::string m_error; }; } /* namespace fibjs */ #endif /* RUNTIME_H_ */
/* * Copyright (C) 2013 Intel Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef VIDEO_POST_PROCESS_HOST_H_ #define VIDEO_POST_PROCESS_HOST_H_ #include <string> #include <vector> #include <VideoPostProcessInterface.h> extern "C" { // for dlsym usage /** \file VideoPostProcessHost.h */ /** \fn IVideoPostProcess *createVideoPostProcess(const char *mimeType) * \brief create encoder basing on given mimetype */ YamiMediaCodec::IVideoPostProcess *createVideoPostProcess(const char *mimeType); /** \fn void releaseVideoPostProcess(IVideoPostProcess *p) * \brief destroy encoder */ void releaseVideoPostProcess(YamiMediaCodec::IVideoPostProcess * p); /** \fn void getVideoPostProcessMimeTypes() * \brief return the MimeTypes enabled in the current build */ std::vector<std::string> getVideoPostProcessMimeTypes(); typedef YamiMediaCodec::IVideoPostProcess *(*YamiCreateVideoPostProcessFuncPtr) (const char *mimeType); typedef void (*YamiReleaseVideoPostProcessFuncPtr)(YamiMediaCodec::IVideoPostProcess * p); } #endif /* VIDEO_POST_PROCESS_HOST_H_ */
//--------------------------------------------------------------------------- // Greenplum Database // Copyright 2012 EMC Corp. // // @filename: // CLogicalLeftOuterApply.h // // @doc: // Logical Left Outer Apply operator //--------------------------------------------------------------------------- #ifndef GPOPT_CLogicalLeftOuterApply_H #define GPOPT_CLogicalLeftOuterApply_H #include "gpos/base.h" #include "gpopt/operators/CExpressionHandle.h" #include "gpopt/operators/CLogicalApply.h" namespace gpopt { //--------------------------------------------------------------------------- // @class: // CLogicalLeftOuterApply // // @doc: // Logical left outer Apply operator used in subquery transformations // //--------------------------------------------------------------------------- class CLogicalLeftOuterApply : public CLogicalApply { private: public: CLogicalLeftOuterApply(const CLogicalLeftOuterApply &) = delete; // ctor for patterns explicit CLogicalLeftOuterApply(CMemoryPool *mp); // ctor CLogicalLeftOuterApply(CMemoryPool *mp, CColRefArray *pdrgpcrInner, EOperatorId eopidOriginSubq); // dtor ~CLogicalLeftOuterApply() override; // ident accessors EOperatorId Eopid() const override { return EopLogicalLeftOuterApply; } // return a string for operator name const CHAR * SzId() const override { return "CLogicalLeftOuterApply"; } // return true if we can pull projections up past this operator from its given child BOOL FCanPullProjectionsUp(ULONG child_index) const override { return (0 == child_index); } // return a copy of the operator with remapped columns COperator *PopCopyWithRemappedColumns(CMemoryPool *mp, UlongToColRefMap *colref_mapping, BOOL must_exist) override; //------------------------------------------------------------------------------------- // Derived Relational Properties //------------------------------------------------------------------------------------- // derive output columns CColRefSet * DeriveOutputColumns(CMemoryPool *mp, CExpressionHandle &exprhdl) override { GPOS_ASSERT(3 == exprhdl.Arity()); return PcrsDeriveOutputCombineLogical(mp, exprhdl); } // derive not nullable output columns CColRefSet * DeriveNotNullColumns(CMemoryPool *, // mp CExpressionHandle &exprhdl) const override { // left outer apply passes through not null columns from outer child only return PcrsDeriveNotNullPassThruOuter(exprhdl); } // derive max card CMaxCard DeriveMaxCard(CMemoryPool *mp, CExpressionHandle &exprhdl) const override; // derive constraint property CPropConstraint * DerivePropertyConstraint(CMemoryPool *, //mp, CExpressionHandle &exprhdl) const override { return PpcDeriveConstraintPassThru(exprhdl, 0 /*ulChild*/); } //------------------------------------------------------------------------------------- // Transformations //------------------------------------------------------------------------------------- // candidate set of xforms CXformSet *PxfsCandidates(CMemoryPool *) const override; //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- // conversion function static CLogicalLeftOuterApply * PopConvert(COperator *pop) { GPOS_ASSERT(nullptr != pop); GPOS_ASSERT(EopLogicalLeftOuterApply == pop->Eopid()); return dynamic_cast<CLogicalLeftOuterApply *>(pop); } }; // class CLogicalLeftOuterApply } // namespace gpopt #endif // !GPOPT_CLogicalLeftOuterApply_H // EOF
/* * Copyright (c) 2015, Lars Schmertmann <SmallLars@t-online.de>, * Jens Trillmann <jtrillma@informatik.uni-bremen.de>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This file is part of the Contiki operating system. * */ /** * \file * Calculations on elliptic curve secp256r1 * * This is a efficient ECC implementation on the secp256r1 curve for * 32 Bit CPU architectures. It provides basic operations on the * secp256r1 curve and support for ECDH and ECDSA. * * \author * Lars Schmertmann <SmallLars@t-online.de> * Jens Trillmann <jtrillma@informatik.uni-bremen.de> */ #ifndef ECC_H_ #define ECC_H_ #include <stdint.h> /** * \brief Checks if a (random) number is valid as scalar on elliptic curve secp256r1 * * A (random) number is only usable as scalar on elliptic curve secp256r1 if * it is lower than the order of the curve. For the check, you need to provide * the order of elliptic curve secp256r1. * * uint32_t order[8] = {0xFC632551, 0xF3B9CAC2, 0xA7179E84, 0xBCE6FAAD, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF}; * * \param key The (random) number to check for usability * \param order The order of elliptic curve secp256r1 * * \return 1 if key is valid */ #define ecc_is_valid_key(key, order) (ecc_compare(order, key) == 1) /** * \brief Compares the value of a with the value of b * * This function is only public because its needed for the macro ecc_is_valid_key. * It does a comparison of two 256 bit numbers. The return values are 1, 0 or -1. * * \param a First number * \param b Second number * * \return 1 if a is greater than b 0 if a is equal to b -1 if a is less than b */ int32_t ecc_compare(const uint32_t *a, const uint32_t *b); /** * \brief ECC scalar multiplication on elliptic curve secp256r1 * * This function does a scalar multiplication on elliptic curve secp256r1. * For an Elliptic curve Diffie–Hellman you need two multiplications. First one * with the base point of elliptic curve secp256r1 you need to provide. * * uint32_t base_x[8] = {0xd898c296, 0xf4a13945, 0x2deb33a0, 0x77037d81, 0x63a440f2, 0xf8bce6e5, 0xe12c4247, 0x6b17d1f2}; * uint32_t base_y[8] = {0x37bf51f5, 0xcbb64068, 0x6b315ece, 0x2bce3357, 0x7c0f9e16, 0x8ee7eb4a, 0xfe1a7f9b, 0x4fe342e2}; * * \param resultx Pointer to memory to store the x-coordinate of the result * \param resulty Pointer to memory to store the y-coordinate of the result * \param px x-coordinate of the point to multiply with scalar * \param py y-coordinate of the point to multiply with scalar * \param secret Scalar for multiplication with elliptic curve point */ void ecc_ec_mult(uint32_t *resultx, uint32_t *resulty, const uint32_t *px, const uint32_t *py, const uint32_t *secret); #endif /* ECC_H_ */
// Copyright (c) 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 TOOLS_GN_ITEM_H_ #define TOOLS_GN_ITEM_H_ #include <string> #include "tools/gn/label.h" #include "tools/gn/visibility.h" class Config; class ParseNode; class Pool; class Settings; class Target; class Toolchain; // A named item (target, config, etc.) that participates in the dependency // graph. class Item { public: Item(const Settings* settings, const Label& label); virtual ~Item(); const Settings* settings() const { return settings_; } // This is guaranteed to never change after construction so this can be // accessed from any thread with no locking once the item is constructed. const Label& label() const { return label_; } const ParseNode* defined_from() const { return defined_from_; } void set_defined_from(const ParseNode* df) { defined_from_ = df; } Visibility& visibility() { return visibility_; } const Visibility& visibility() const { return visibility_; } // Manual RTTI. virtual Config* AsConfig(); virtual const Config* AsConfig() const; virtual Pool* AsPool(); virtual const Pool* AsPool() const; virtual Target* AsTarget(); virtual const Target* AsTarget() const; virtual Toolchain* AsToolchain(); virtual const Toolchain* AsToolchain() const; // Returns a name like "target" or "config" for the type of item this is, to // be used in logging and error messages. std::string GetItemTypeName() const; // Called when this item is resolved, meaning it and all of its dependents // have no unresolved deps. Returns true on success. Sets the error and // returns false on failure. virtual bool OnResolved(Err* err); private: const Settings* settings_; Label label_; const ParseNode* defined_from_; Visibility visibility_; }; #endif // TOOLS_GN_ITEM_H_