text
stringlengths
4
6.14k
// Copyright 2012 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // You may freely redistribute and use this sample code, with or // without modification, provided you include the original copyright // notice and use restrictions. // // See the use restrictions at http://help.arcgis.com/en/sdk/10.0/usageRestrictions.htm // #import <UIKit/UIKit.h> @interface WeatherInfoSampleAppDelegate : NSObject <UIApplicationDelegate> @property (nonatomic, strong) IBOutlet UIWindow *window; @end
/* Copyright JS Foundation and other contributors, http://js.foundation * * 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 "jerryscript-port.h" #include "jerryscript-port-default.h" /** * Pointer to the current context. * Note that it is a global variable, and is not a thread safe implementation. */ static jerry_context_t *current_context_p = NULL; /** * Set the current_context_p as the passed pointer. */ void jerry_port_default_set_current_context (jerry_context_t *context_p) /**< points to the created context */ { current_context_p = context_p; } /* jerry_port_default_set_current_context */ /** * Get the current context. * * @return the pointer to the current context */ jerry_context_t * jerry_port_get_current_context (void) { return current_context_p; } /* jerry_port_get_current_context */
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Tencent is pleased to support the open source community by making Appecker available. // // Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions and // limitations under the License. /////////////////////////////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> @interface AppeckerHookManager : NSObject + (void)hijackClassSelector:(SEL)originalSelector inClass:(Class) srcCls withSelector:(SEL)newSelector inClass:(Class) dstCls; + (void)hijackInstanceSelector:(SEL)originalSelector inClass:(Class) srcCls withSelector:(SEL)newSelector inClass:(Class) dstCls; @end
/* * Copyright 2015 Naver Corp. * * 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 <errno.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #ifdef SFI_ENABLED #include <pthread.h> #endif #include "smr.h" #include "log_internal.h" #define ERRNO_FILE_ID UTIL_FILE_ID long long currtime_usec (void) { struct timeval tv; long long usec; gettimeofday (&tv, NULL); usec = tv.tv_sec * 1000000; usec += tv.tv_usec; return usec; } int ll_cmpr (const void *v1, const void *v2) { long long ll1 = *(long long *) v1; long long ll2 = *(long long *) v2; return (ll1 > ll2) ? 1 : ((ll1 == ll2) ? 0 : -1); } int init_log_file (int fd) { int ret; ret = ftruncate (fd, SMR_LOG_FILE_ACTUAL_SIZE); if (ret < 0) { ERRNO_POINT (); return -1; } // extended parts reads null bytes return 0; } #ifdef SFI_ENABLED static pthread_once_t sfi_once = PTHREAD_ONCE_INIT; static pthread_key_t sfi_key; // ISO C forbids conversion of function pointer to object pointer type struct funcWrap { void (*callback) (char *, int); }; static void initialize_key (void) { pthread_key_create (&sfi_key, free); } void sfi_mshmcs_probe (char *file, int line) { struct funcWrap *wrap; (void) pthread_once (&sfi_once, initialize_key); wrap = pthread_getspecific (sfi_key); if (wrap) { wrap->callback (file, line); } } void sfi_mshmcs_register (void (*callback) (char *, int)) { struct funcWrap *wrap = NULL; (void) pthread_once (&sfi_once, initialize_key); wrap = malloc (sizeof (struct funcWrap)); if (wrap) { wrap->callback = callback; } pthread_setspecific (sfi_key, wrap); } #endif
/* * Copyright 2014 MongoDB, 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. */ #if !defined (MONGOC_COMPILATION) #error "Only <mongoc.h> can be included directly." #endif #ifndef MONGOC_SCRAM_PRIVATE_H #define MONGOC_SCRAM_PRIVATE_H #include <bson.h> #include "mongoc-crypto-private.h" BSON_BEGIN_DECLS #define MONGOC_SCRAM_HASH_SIZE 20 typedef struct _mongoc_scram_t { bool done; int step; char *user; char *pass; uint8_t salted_password[MONGOC_SCRAM_HASH_SIZE]; char encoded_nonce[48]; int32_t encoded_nonce_len; uint8_t *auth_message; uint32_t auth_messagemax; uint32_t auth_messagelen; #ifdef MONGOC_ENABLE_CRYPTO mongoc_crypto_t crypto; #endif } mongoc_scram_t; void _mongoc_scram_startup(); void _mongoc_scram_init (mongoc_scram_t *scram); void _mongoc_scram_set_pass (mongoc_scram_t *scram, const char *pass); void _mongoc_scram_set_user (mongoc_scram_t *scram, const char *user); void _mongoc_scram_destroy (mongoc_scram_t *scram); bool _mongoc_scram_step (mongoc_scram_t *scram, const uint8_t *inbuf, uint32_t inbuflen, uint8_t *outbuf, uint32_t outbufmax, uint32_t *outbuflen, bson_error_t *error); BSON_END_DECLS #endif /* MONGOC_SCRAM_PRIVATE_H */
// Copyright 2004-present Facebook. All Rights Reserved. // // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, // copy, modify, and distribute this software in source code or binary form for use // in connection with the web services and APIs provided by Facebook. // // As with any software that integrates with the Facebook platform, your use of // this software is subject to the Facebook Developer Principles and Policies // [http://developers.facebook.com/policy/]. This copyright 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 FBAudienceNetwork_FBAdDefines_h #define FBAudienceNetwork_FBAdDefines_h #ifdef __cplusplus #define FB_EXTERN_C_BEGIN extern "C" { #define FB_EXTERN_C_END } #else #define FB_EXTERN_C_BEGIN #define FB_EXTERN_C_END #endif #ifdef __cplusplus #define FB_EXPORT extern "C" __attribute__((visibility("default"))) #else #define FB_EXPORT extern __attribute__((visibility("default"))) #endif #define FB_CLASS_EXPORT __attribute__((visibility("default"))) #define FB_DEPRECATED __attribute__((deprecated)) #define FB_DEPRECATED_WITH_MESSAGE(M) __attribute__((deprecated(M))) #if __has_feature(objc_generics) #define FB_NSArrayOf(x) NSArray<x> #define FB_NSMutableArrayOf(x) NSMutableArray<x> #define FB_NSDictionaryOf(x, y) NSDictionary<x, y> #define FB_NSMutableDictionaryOf(x, y) NSMutableDictionary<x, y> #define FB_NSSetOf(x) NSSet<x> #define FB_NSMutableSetOf(x) NSMutableSet<x> #else #define FB_NSArrayOf(x) NSArray #define FB_NSMutableArrayOf(x) NSMutableArray #define FB_NSDictionaryOf(x, y) NSDictionary #define FB_NSMutableDictionaryOf(x, y) NSMutableDictionary #define FB_NSSetOf(x) NSSet #define FB_NSMutableSetOf(x) NSMutableSet #define __covariant #endif #if !__has_feature(nullability) #define NS_ASSUME_NONNULL_BEGIN #define NS_ASSUME_NONNULL_END #define nullable #define __nullable #endif #ifndef FB_SUBCLASSING_RESTRICTED #if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) #define FB_SUBCLASSING_RESTRICTED __attribute__((objc_subclassing_restricted)) #else #define FB_SUBCLASSING_RESTRICTED #endif #endif #endif
// // FLEXKeychainQuery.h // // Derived from: // SSKeychainQuery.h in SSKeychain // Created by Caleb Davenport on 3/19/13. // Copyright (c) 2010-2014 Sam Soffes. All rights reserved. // #import <Foundation/Foundation.h> #import <Security/Security.h> #if __IPHONE_7_0 || __MAC_10_9 // Keychain synchronization available at compile time #define FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE 1 #endif #if __IPHONE_3_0 || __MAC_10_9 // Keychain access group available at compile time #define FLEXKEYCHAIN_ACCESS_GROUP_AVAILABLE 1 #endif #ifdef FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE typedef NS_ENUM(NSUInteger, FLEXKeychainQuerySynchronizationMode) { FLEXKeychainQuerySynchronizationModeAny, FLEXKeychainQuerySynchronizationModeNo, FLEXKeychainQuerySynchronizationModeYes }; #endif /// Simple interface for querying or modifying keychain items. @interface FLEXKeychainQuery : NSObject /// kSecAttrAccount @property (nonatomic, copy) NSString *account; /// kSecAttrService @property (nonatomic, copy) NSString *service; /// kSecAttrLabel @property (nonatomic, copy) NSString *label; #ifdef FLEXKEYCHAIN_ACCESS_GROUP_AVAILABLE /// kSecAttrAccessGroup (only used on iOS) @property (nonatomic, copy) NSString *accessGroup; #endif #ifdef FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE /// kSecAttrSynchronizable @property (nonatomic) FLEXKeychainQuerySynchronizationMode synchronizationMode; #endif /// Root storage for password information @property (nonatomic, copy) NSData *passwordData; /// This property automatically transitions between an object and the value of /// `passwordData` using NSKeyedArchiver and NSKeyedUnarchiver. @property (nonatomic, copy) id<NSCoding> passwordObject; /// Convenience accessor for setting and getting a password string. Passes through /// to `passwordData` using UTF-8 string encoding. @property (nonatomic, copy) NSString *password; #pragma mark Saving & Deleting /// Save the receiver's attributes as a keychain item. Existing items with the /// given account, service, and access group will first be deleted. /// /// @param error Populated should an error occur. /// @return `YES` if saving was successful, `NO` otherwise. - (BOOL)save:(NSError **)error; /// Delete keychain items that match the given account, service, and access group. /// /// @param error Populated should an error occur. /// @return `YES` if saving was successful, `NO` otherwise. - (BOOL)deleteItem:(NSError **)error; #pragma mark Fetching /// Fetch all keychain items that match the given account, service, and access /// group. The values of `password` and `passwordData` are ignored when fetching. /// /// @param error Populated should an error occur. /// @return An array of dictionaries that represent all matching keychain items, /// or `nil` should an error occur. The order of the items is not determined. - (NSArray<NSDictionary<NSString *, id> *> *)fetchAll:(NSError **)error; /// Fetch the keychain item that matches the given account, service, and access /// group. The `password` and `passwordData` properties will be populated unless /// an error occurs. The values of `password` and `passwordData` are ignored when /// fetching. /// /// @param error Populated should an error occur. /// @return `YES` if fetching was successful, `NO` otherwise. - (BOOL)fetch:(NSError **)error; #pragma mark Synchronization Status #ifdef FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE /// Returns a boolean indicating if keychain synchronization is available on the device at runtime. /// The #define FLEXKEYCHAIN_SYNCHRONIZATION_AVAILABLE is only for compile time. /// If you are checking for the presence of synchronization, you should use this method. /// /// @return A value indicating if keychain synchronization is available + (BOOL)isSynchronizationAvailable; #endif @end
/* * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_AUDIO_PROCESSING_BEAMFORMER_COVARIANCE_MATRIX_GENERATOR_H_ #define MODULES_AUDIO_PROCESSING_BEAMFORMER_COVARIANCE_MATRIX_GENERATOR_H_ #include "modules/audio_processing/beamformer/complex_matrix.h" #include "modules/audio_processing/beamformer/array_util.h" namespace webrtc { // Helper class for Beamformer in charge of generating covariance matrices. For // each function, the passed-in ComplexMatrix is expected to be of size // |num_input_channels| x |num_input_channels|. class CovarianceMatrixGenerator { public: // A uniform covariance matrix with a gap at the target location. WARNING: // The target angle is assumed to be 0. static void UniformCovarianceMatrix(float wave_number, const std::vector<Point>& geometry, ComplexMatrix<float>* mat); // The covariance matrix of a source at the given angle. static void AngledCovarianceMatrix(float sound_speed, float angle, size_t frequency_bin, size_t fft_size, size_t num_freq_bins, int sample_rate, const std::vector<Point>& geometry, ComplexMatrix<float>* mat); // Calculates phase shifts that, when applied to a multichannel signal and // added together, cause constructive interferernce for sources located at // the given angle. static void PhaseAlignmentMasks(size_t frequency_bin, size_t fft_size, int sample_rate, float sound_speed, const std::vector<Point>& geometry, float angle, ComplexMatrix<float>* mat); }; } // namespace webrtc #endif // MODULES_AUDIO_PROCESSING_BEAMFORMER_BF_HELPERS_H_
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ssm/SSM_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace SSM { namespace Model { enum class MaintenanceWindowExecutionStatus { NOT_SET, PENDING, IN_PROGRESS, SUCCESS, FAILED, TIMED_OUT, CANCELLING, CANCELLED, SKIPPED_OVERLAPPING }; namespace MaintenanceWindowExecutionStatusMapper { AWS_SSM_API MaintenanceWindowExecutionStatus GetMaintenanceWindowExecutionStatusForName(const Aws::String& name); AWS_SSM_API Aws::String GetNameForMaintenanceWindowExecutionStatus(MaintenanceWindowExecutionStatus value); } // namespace MaintenanceWindowExecutionStatusMapper } // namespace Model } // namespace SSM } // namespace Aws
// GoogleAnalyticsIntegration.h // Copyright (c) 2014 Segment.io. All rights reserved. #import <Foundation/Foundation.h> #import "SEGAnalyticsIntegration.h" #import "SEGEcommerce.h" @interface SEGGoogleAnalyticsIntegration : SEGAnalyticsIntegration <SEGEcommerce> @property(nonatomic, copy) NSString *name; @property(nonatomic, assign) BOOL valid; @property(nonatomic, assign) BOOL initialized; @property(nonatomic, copy) NSDictionary *settings; @end
/** * Copyright (c) 2016-present, Facebook, 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. */ #pragma once #include <caffe2/distributed/store_handler.h> namespace caffe2 { class FileStoreHandler : public StoreHandler { public: explicit FileStoreHandler(const std::string& path, const std::string& prefix); virtual ~FileStoreHandler(); virtual void set(const std::string& name, const std::string& data) override; virtual std::string get(const std::string& name) override; virtual int64_t add(const std::string& name, int64_t value) override; virtual bool check(const std::vector<std::string>& names) override; virtual void wait( const std::vector<std::string>& names, const std::chrono::milliseconds& timeout = kDefaultTimeout) override; protected: std::string basePath_; std::string realPath(const std::string& path); std::string tmpPath(const std::string& name); std::string objectPath(const std::string& name); }; } // namespace caffe2
#pragma once #include <memory> #include <string> #include <vector> namespace YAML { class Node; } namespace Tangram { class StyleMixer { public: using Node = YAML::Node; // Get the sequence of style names that are designated to be mixed into the // input style node by its 'base' and 'mix' fields. std::vector<std::string> getStylesToMix(const Node& _style); // Get a sequence of style names ordered such that if style 'a' mixes style // 'b', 'b' will always precede 'a' in the sequence. std::vector<std::string> getMixingOrder(const Node& _styles); // Apply mixing to all styles in the input map with modifications in-place // unless otherwise noted. void mixStyleNodes(Node _styles); // Apply the given list of 'mixin' styles to the first style. void applyStyleMixins(Node _style, const std::vector<Node>& _mixins); // Apply the given list of 'mixin' style shader nodes to the first style // shader node. Note that 'blocks' and 'extensions' are merged into new // output fields called 'blocks_merged' and 'extensions_merged'. void applyShaderMixins(Node _shaders, const std::vector<Node>& _mixins); private: void mergeBooleanFieldAsDisjunction(const std::string& _key, Node _target, const std::vector<Node>& _sources); void mergeFieldTakingLast(const std::string& _key, Node _target, const std::vector<Node>& _sources); void mergeMapFieldTakingLast(const std::string& _key, Node _target, const std::vector<Node>& _sources); }; }
/* * The Minimal snprintf() implementation * * Copyright (c) 2013 Michal Ludvig <michal@logix.cz> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the auhor 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 AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __MINI_PRINTF__ #define __MINI_PRINTF__ #include <stdarg.h> int mini_vsnprintf(char* buffer, unsigned int buffer_len, char *fmt, va_list va); int mini_snprintf(char* buffer, unsigned int buffer_len, char *fmt, ...); #define vsnprintf mini_vsnprintf #define snprintf mini_snprintf #endif
// Copyright (c) 2013 Marshall A. Greenblatt. 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 name Chromium Embedded // Framework 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. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool and should not edited // by hand. See the translator.README.txt file in the tools directory for // more information. // #ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ #pragma once #ifdef __cplusplus extern "C" { #endif #include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to find results. The // functions of this structure will be called on the UI thread. /// typedef struct _cef_find_handler_t { /// // Base structure. /// cef_base_t base; /// // Called to report find results returned by cef_browser_t::find(). // |identifer| is the identifier passed to cef_browser_t::find(), |count| is // the number of matches currently identified, |selectionRect| is the location // of where the match was found (in window coordinates), |activeMatchOrdinal| // is the current position in the search results, and |finalUpdate| is true // (1) if this is the last find notification. /// void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self, struct _cef_browser_t* browser, int identifier, int count, const cef_rect_t* selectionRect, int activeMatchOrdinal, int finalUpdate); } cef_find_handler_t; #ifdef __cplusplus } #endif #endif // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ #define CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ #include "base/compiler_specific.h" #include "content/common/content_export.h" #include "content/public/common/page_transition_types.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURLRequest.h" #include "third_party/WebKit/public/web/WebPageVisibilityState.h" namespace content { // Can be used by callers to store extra data on every ResourceRequest // which will be incorporated into the ResourceHostMsg_Request message // sent by ResourceDispatcher. class CONTENT_EXPORT RequestExtraData : public NON_EXPORTED_BASE(blink::WebURLRequest::ExtraData) { public: RequestExtraData(); virtual ~RequestExtraData(); blink::WebPageVisibilityState visibility_state() const { return visibility_state_; } void set_visibility_state(blink::WebPageVisibilityState visibility_state) { visibility_state_ = visibility_state; } int render_frame_id() const { return render_frame_id_; } void set_render_frame_id(int render_frame_id) { render_frame_id_ = render_frame_id; } bool is_main_frame() const { return is_main_frame_; } void set_is_main_frame(bool is_main_frame) { is_main_frame_ = is_main_frame; } GURL frame_origin() const { return frame_origin_; } void set_frame_origin(const GURL& frame_origin) { frame_origin_ = frame_origin; } bool parent_is_main_frame() const { return parent_is_main_frame_; } void set_parent_is_main_frame(bool parent_is_main_frame) { parent_is_main_frame_ = parent_is_main_frame; } int parent_render_frame_id() const { return parent_render_frame_id_; } void set_parent_render_frame_id(int parent_render_frame_id) { parent_render_frame_id_ = parent_render_frame_id; } bool allow_download() const { return allow_download_; } void set_allow_download(bool allow_download) { allow_download_ = allow_download; } PageTransition transition_type() const { return transition_type_; } void set_transition_type(PageTransition transition_type) { transition_type_ = transition_type; } bool should_replace_current_entry() const { return should_replace_current_entry_; } void set_should_replace_current_entry( bool should_replace_current_entry) { should_replace_current_entry_ = should_replace_current_entry; } int transferred_request_child_id() const { return transferred_request_child_id_; } void set_transferred_request_child_id( int transferred_request_child_id) { transferred_request_child_id_ = transferred_request_child_id; } int transferred_request_request_id() const { return transferred_request_request_id_; } void set_transferred_request_request_id( int transferred_request_request_id) { transferred_request_request_id_ = transferred_request_request_id; } int service_worker_provider_id() const { return service_worker_provider_id_; } void set_service_worker_provider_id( int service_worker_provider_id) { service_worker_provider_id_ = service_worker_provider_id; } // |custom_user_agent| is used to communicate an overriding custom user agent // to |RenderViewImpl::willSendRequest()|; set to a null string to indicate no // override and an empty string to indicate that there should be no user // agent. const blink::WebString& custom_user_agent() const { return custom_user_agent_; } void set_custom_user_agent( const blink::WebString& custom_user_agent) { custom_user_agent_ = custom_user_agent; } private: blink::WebPageVisibilityState visibility_state_; int render_frame_id_; bool is_main_frame_; GURL frame_origin_; bool parent_is_main_frame_; int parent_render_frame_id_; bool allow_download_; PageTransition transition_type_; bool should_replace_current_entry_; int transferred_request_child_id_; int transferred_request_request_id_; int service_worker_provider_id_; blink::WebString custom_user_agent_; DISALLOW_COPY_AND_ASSIGN(RequestExtraData); }; } // namespace content #endif // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_
#ifndef TAIJU_TRIE_CONVERTER_FACTORY_H #define TAIJU_TRIE_CONVERTER_FACTORY_H #include "trie-converter-base.h" namespace taiju { class TrieConverterFactory { public: static TrieConverterBase *Create(const BuilderConfig &config); static TrieConverterBase *Create(TrieType type); private: // Disallows instantiation. TrieConverterFactory(); ~TrieConverterFactory(); // Disallows copies. TrieConverterFactory(const TrieConverterFactory &); TrieConverterFactory &operator=(const TrieConverterFactory &); }; } // namespace taiju #endif // TAIJU_TRIE_CONVERTER_FACTORY_H
@import import_self.c; #include "import-self-d.h" // FIXME: This should not work; names from 'a' should not be visible here. MyTypeA import_self_test_a; // FIXME: This should work but does not; names from 'b' are not actually visible here. //MyTypeC import_self_test_c; MyTypeD import_self_test_d;
/***************************************************************************** Copyright (c) 2014, Intel Corp. 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 Intel Corporation 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. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function zsytrf_aa * Author: Intel Corporation * Generated November 2017 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_zsytrf_aa_2stage( int matrix_layout, char uplo, lapack_int n, lapack_complex_double* a, lapack_int lda, lapack_complex_double* tb, lapack_int ltb, lapack_int* ipiv, lapack_int* ipiv2 ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zsytrf_aa_2stage", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_zsy_nancheck( matrix_layout, uplo, n, a, lda ) ) { return -5; } if( LAPACKE_zge_nancheck( matrix_layout, 4*n, 1, tb, ltb ) ) { return -7; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_zsytrf_aa_2stage_work( matrix_layout, uplo, n, a, lda, tb, ltb, ipiv, ipiv2, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for work arrays */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zsytrf_aa_2stage_work( matrix_layout, uplo, n, a, lda, tb, ltb, ipiv, ipiv2, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zsytrf_aa_2stage", info ); } return info; }
/*- * Copyright (C) 2002 Benno Rice. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY Benno Rice ``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 TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ #include "opt_ddb.h" #include <sys/param.h> #include <sys/systm.h> #include <sys/kdb.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/malloc.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/rman.h> #include <machine/resource.h> #include <dev/ofw/openfirm.h> #include <powerpc/powermac/maciovar.h> struct pswitch_softc { int sc_irqrid; struct resource *sc_irq; void *sc_ih; }; static int pswitch_probe(device_t); static int pswitch_attach(device_t); static int pswitch_intr(void *); static device_method_t pswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pswitch_probe), DEVMETHOD(device_attach, pswitch_attach), { 0, 0 } }; static driver_t pswitch_driver = { "pswitch", pswitch_methods, sizeof(struct pswitch_softc) }; static devclass_t pswitch_devclass; DRIVER_MODULE(pswitch, macio, pswitch_driver, pswitch_devclass, 0, 0); static int pswitch_probe(device_t dev) { char *type = macio_get_devtype(dev); if (strcmp(type, "gpio") != 0) return (ENXIO); device_set_desc(dev, "GPIO Programmer's Switch"); return (0); } static int pswitch_attach(device_t dev) { struct pswitch_softc *sc; phandle_t node, child; char type[32]; u_int irq[2]; sc = device_get_softc(dev); node = macio_get_node(dev); for (child = OF_child(node); child != 0; child = OF_peer(child)) { if (OF_getprop(child, "device_type", type, 32) == -1) continue; if (strcmp(type, "programmer-switch") == 0) break; } if (child == 0) { device_printf(dev, "could not find correct node\n"); return (ENXIO); } if (OF_getprop(child, "interrupts", irq, sizeof(irq)) == -1) { device_printf(dev, "could not get interrupt\n"); return (ENXIO); } sc->sc_irqrid = 0; sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_irqrid, irq[0], irq[0], 1, RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); return (ENXIO); } if (bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_MISC, pswitch_intr, NULL, dev, &sc->sc_ih) != 0) { device_printf(dev, "could not setup interrupt\n"); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqrid, sc->sc_irq); return (ENXIO); } return (0); } static int pswitch_intr(void *arg) { device_t dev; dev = (device_t)arg; kdb_enter(KDB_WHY_POWERPC, device_get_nameunit(dev)); return (FILTER_HANDLED); }
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file pta_int.h * @author drose * @date 2000-05-10 */ #ifndef PTA_INT_H #define PTA_INT_H #include "pandabase.h" #include "pointerToArray.h" #include "vector_int.h" /** * A pta of ints. This class is defined once here, and exported to PANDA.DLL; * other packages that want to use a pta of this type (whether they need to * export it or not) should include this header file, rather than defining the * pta again. */ EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEXPRESS, EXPTP_PANDAEXPRESS, PointerToBase<ReferenceCountedVector<int> >) EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEXPRESS, EXPTP_PANDAEXPRESS, PointerToArrayBase<int>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEXPRESS, EXPTP_PANDAEXPRESS, PointerToArray<int>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEXPRESS, EXPTP_PANDAEXPRESS, ConstPointerToArray<int>) typedef PointerToArray<int> PTA_int; typedef ConstPointerToArray<int> CPTA_int; // Tell GCC that we'll take care of the instantiation explicitly here. #ifdef __GNUC__ #pragma interface #endif #endif
#include "FLA_lapack2flame_return_defs.h" #include "FLA_f2c.h" /* Table of constant values */ static int c__1 = 1; static int c_n1 = -1; int sgeqrfp_check(int *m, int *n, float *a, int *lda, float *tau, float *work, int *lwork, int *info) { /* System generated locals */ int a_dim1, a_offset, i__1; /* Local variables */ int k, nb; int lwkopt; logical lquery; /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1; a -= a_offset; --tau; --work; /* Function Body */ *info = 0; nb = ilaenv_(&c__1, "SGEQRF", " ", m, n, &c_n1, &c_n1); lwkopt = *n * nb; work[1] = (float) lwkopt; lquery = *lwork == -1; if (*m < 0) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*lda < max(1,*m)) { *info = -4; } else if (*lwork < max(1,*n) && ! lquery) { *info = -7; } if (*info != 0) { i__1 = -(*info); xerbla_("SGEQRFP", &i__1); return LAPACK_FAILURE; } else if (lquery) { return LAPACK_QUERY_RETURN; } /* Quick return if possible */ k = min(*m,*n); if (k == 0) { work[1] = 1.f; return LAPACK_QUICK_RETURN; } return LAPACK_SUCCESS; }
// // DiskCacheStd.h // Macshroom // // Created by Moishe Lettvin on 11/7/06. // Copyright (C) 2006 Google Inc. All rights reserved. // // #ifndef TALK_BASE_DISKCACHESTD_H__ #define TALK_BASE_DISKCACHESTD_H__ #include "talk/base/diskcache.h" namespace talk_base { class DiskCacheStd : public DiskCache { protected: virtual bool InitializeEntries(); virtual bool PurgeFiles(); virtual bool FileExists(const std::string& filename) const; virtual bool DeleteFile(const std::string& filename) const; }; } #endif // TALK_BASE_DISKCACHESTD_H__
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Radu Serban // ============================================================================= // // Tracked vehicle double-pin sprocket model constructed with data from file // (JSON format). // // ============================================================================= #ifndef SPROCKET_DOUBLE_PIN_H #define SPROCKET_DOUBLE_PIN_H #include "chrono_vehicle/ChApiVehicle.h" #include "chrono_vehicle/tracked_vehicle/sprocket/ChSprocketDoublePin.h" #include "chrono_thirdparty/rapidjson/document.h" namespace chrono { namespace vehicle { /// @addtogroup vehicle_tracked_sprocket /// @{ /// Tracked vehicle double-pin sprocket model constructed with data from file (JSON format). class CH_VEHICLE_API SprocketDoublePin : public ChSprocketDoublePin { public: SprocketDoublePin(const std::string& filename); SprocketDoublePin(const rapidjson::Document& d); ~SprocketDoublePin() {} /// Get the number of teeth of the gear. virtual int GetNumTeeth() const override { return m_num_teeth; } /// Get the radius of the gear. /// This quantity is used during the automatic track assembly. virtual double GetAssemblyRadius() const override { return m_gear_RA; } /// Return the mass of the gear body. virtual double GetGearMass() const override { return m_gear_mass; } /// Return the moments of inertia of the gear body. virtual const ChVector<>& GetGearInertia() override { return m_gear_inertia; } /// Return the inertia of the axle shaft. virtual double GetAxleInertia() const override { return m_axle_inertia; } /// Return the distance between the two gear profiles. virtual double GetSeparation() const override { return m_separation; } /// Return the radius of the addendum circle. virtual double GetOuterRadius() const override { return m_gear_RT; } /// Return the radius of the (concave) tooth circular arc. virtual double GetArcRadius() const override { return m_gear_R; } /// Return height of arc center. virtual double GetArcCenterHeight() const override { return m_gear_C; } /// Return offset of arc center. virtual double GetArcCenterOffset() const override { return m_gear_W; } /// Return the allowed backlash (play) before lateral contact with track shoes is enabled (to prevent detracking). virtual double GetLateralBacklash() const override { return m_lateral_backlash; } private: virtual void Create(const rapidjson::Document& d) override; /// Create the contact material consistent with the specified contact method. virtual void CreateContactMaterial(ChContactMethod contact_method) override; /// Add visualization of the sprocket. virtual void AddVisualizationAssets(VisualizationType vis) override; int m_num_teeth; double m_gear_mass; ChVector<> m_gear_inertia; double m_axle_inertia; double m_separation; double m_gear_RT; double m_gear_R; double m_gear_RA; double m_gear_C; double m_gear_W; double m_lateral_backlash; bool m_has_mesh; std::string m_meshFile; MaterialInfo m_mat_info; }; /// @} vehicle_tracked_sprocket } // end namespace vehicle } // end namespace chrono #endif
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2014 Garrett D'Amore <garrett@damore.org> * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBINTL_H #define _LIBINTL_H #include <sys/isa_defs.h> #ifdef __cplusplus extern "C" { #endif /* * wchar_t is a built-in type in standard C++ and as such is not * defined here when using standard C++. However, the GNU compiler * fixincludes utility nonetheless creates its own version of this * header for use by gcc and g++. In that version it adds a redundant * guard for __cplusplus. To avoid the creation of a gcc/g++ specific * header we need to include the following magic comment: * * we must use the C++ compiler's type * * The above comment should not be removed or changed until GNU * gcc/fixinc/inclhack.def is updated to bypass this header. */ #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__)) #ifndef _WCHAR_T #define _WCHAR_T #if defined(_LP64) typedef int wchar_t; #else typedef long wchar_t; #endif #endif /* !_WCHAR_T */ #endif /* !defined(__cplusplus) ... */ #define TEXTDOMAINMAX 256 #define __GNU_GETTEXT_SUPPORTED_REVISION(m) \ ((((m) == 0) || ((m) == 1)) ? 1 : -1) extern char *dcgettext(const char *, const char *, const int); extern char *dgettext(const char *, const char *); extern char *gettext(const char *); extern char *textdomain(const char *); extern char *bindtextdomain(const char *, const char *); /* * LI18NUX 2000 Globalization Specification Version 1.0 * with Amendment 2 */ extern char *dcngettext(const char *, const char *, const char *, unsigned long int, int); extern char *dngettext(const char *, const char *, const char *, unsigned long int); extern char *ngettext(const char *, const char *, unsigned long int); extern char *bind_textdomain_codeset(const char *, const char *); /* Word handling functions --- requires dynamic linking */ /* Warning: these are experimental and subject to change. */ extern int wdinit(void); extern int wdchkind(wchar_t); extern int wdbindf(wchar_t, wchar_t, int); extern wchar_t *wddelim(wchar_t, wchar_t, int); extern wchar_t mcfiller(void); extern int mcwrap(void); #ifdef __cplusplus } #endif #endif /* _LIBINTL_H */
/** @file GUIDs used for SAL system table entries in the EFI system table. SAL System Table contains Itanium-based processor centric information about the system. 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. @par Revision Reference: GUIDs defined in UEFI 2.0 spec. **/ #ifndef __SAL_SYSTEM_TABLE_GUID_H__ #define __SAL_SYSTEM_TABLE_GUID_H__ #define SAL_SYSTEM_TABLE_GUID \ { \ 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } extern EFI_GUID gEfiSalSystemTableGuid; #endif
// // InsertInfoServiceImpl.h // ThirdAssignment // // Created by Xin on 28/10/2015. // Copyright © 2015 Huang Xin. All rights reserved. // #import <Foundation/Foundation.h> #import "InsertInfoService.h" #define INSERT_INFO_USER_DEFAULTS_KEY @"InsertInfoServiceImpl.UserDefaults" /** * A insert info service implementation with NSUserDefaults. */ @interface InsertInfoServiceImpl : NSObject<InsertInfoService> @end
#ifndef org_apache_lucene_codecs_compressing_Compressor_H #define org_apache_lucene_codecs_compressing_Compressor_H #include "java/lang/Object.h" namespace org { namespace apache { namespace lucene { namespace store { class DataOutput; } } } } namespace java { namespace lang { class Class; } namespace io { class IOException; } } template<class T> class JArray; namespace org { namespace apache { namespace lucene { namespace codecs { namespace compressing { class Compressor : public ::java::lang::Object { public: enum { mid_compress_13c9f1ba, max_mid }; static ::java::lang::Class *class$; static jmethodID *mids$; static bool live$; static jclass initializeClass(bool); explicit Compressor(jobject obj) : ::java::lang::Object(obj) { if (obj != NULL) env->getClass(initializeClass); } Compressor(const Compressor& obj) : ::java::lang::Object(obj) {} void compress(const JArray< jbyte > &, jint, jint, const ::org::apache::lucene::store::DataOutput &) const; }; } } } } } #include <Python.h> namespace org { namespace apache { namespace lucene { namespace codecs { namespace compressing { extern PyTypeObject PY_TYPE(Compressor); class t_Compressor { public: PyObject_HEAD Compressor object; static PyObject *wrap_Object(const Compressor&); static PyObject *wrap_jobject(const jobject&); static void install(PyObject *module); static void initialize(PyObject *module); }; } } } } } #endif
//----------------------------------------------------------------------------- // Copyright (c) 2013 GarageGames, LLC // // 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. //----------------------------------------------------------------------------- ////////////////////////////////////////////////////////////////////////// /// \file lang.h /// \brief Header for language support ////////////////////////////////////////////////////////////////////////// #include "sim/simBase.h" #include "collection/vector.h" #ifndef _LANG_H_ #define _LANG_H_ #define LANG_INVALID_ID 0xffffffff ///!< Invalid ID. Used for returning failure ////////////////////////////////////////////////////////////////////////// /// \brief Class for working with language files ////////////////////////////////////////////////////////////////////////// class LangFile { protected: Vector<UTF8 *> mStringTable; UTF8 * mLangName; UTF8 * mLangFile; void freeTable(); public: LangFile(const UTF8 *langName = NULL); virtual ~LangFile(); bool load(const UTF8 *filename); bool save(const UTF8 *filename); bool load(Stream *s); bool save(Stream *s); const UTF8 * getString(U32 id); U32 addString(const UTF8 *str); // [tom, 4/22/2005] setString() added to help the language compiler a bit void setString(U32 id, const UTF8 *str); void setLangName(const UTF8 *newName); const UTF8 *getLangName(void) { return mLangName; } const UTF8 *getLangFile(void) { return mLangFile; } void setLangFile(const UTF8 *langFile); bool activateLanguage(void); void deactivateLanguage(void); bool isLoaded(void) { return mStringTable.size() > 0; } S32 getNumStrings(void) { return mStringTable.size(); } }; ////////////////////////////////////////////////////////////////////////// /// \brief Language file table ////////////////////////////////////////////////////////////////////////// class LangTable : public SimObject { typedef SimObject Parent; protected: Vector<LangFile *> mLangTable; S32 mDefaultLang; S32 mCurrentLang; public: DECLARE_CONOBJECT(LangTable); LangTable(); virtual ~LangTable(); S32 addLanguage(LangFile *lang, const UTF8 *name = NULL); S32 addLanguage(const UTF8 *filename, const UTF8 *name = NULL); void setDefaultLanguage(S32 langid); void setCurrentLanguage(S32 langid); S32 getCurrentLanguage(void) { return mCurrentLang; } const UTF8 * getLangName(const S32 langid) const { if(langid < 0 || langid >= mLangTable.size()) return NULL; return mLangTable[langid]->getLangName(); } const S32 getNumLang(void) const { return mLangTable.size(); } const UTF8 * getString(const U32 id) const; const U32 getStringLength(const U32 id) const; }; extern UTF8 *sanitiseVarName(const UTF8 *varName, UTF8 *buffer, U32 bufsize); extern UTF8 *getCurrentModVarName(UTF8 *buffer, U32 bufsize); extern const LangTable *getCurrentModLangTable(); extern const LangTable *getModLangTable(const UTF8 *mod); #endif // _LANG_H_
// // AppDelegate.h // JSPatchPlayground // // Created by bang on 5/14/16. // Copyright © 2016 bang. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
#include <stdio.h> #include <stdlib.h> void rotr ( int * , int * , int * ); int main() { int a, b, c, rotate_times; scanf( "%d %d %d %d" , &a , &b , &c , &rotate_times ); for ( ; rotate_times > 0 ; rotate_times-- ) { rotr( &a , &b , &c ); } printf("%d %d %d", a , b , c); return 0; } void rotr ( int *a , int *b , int *c ) { int swap_help; swap_help = *a; *a = *c; *c = *b; *b = swap_help; }
/** @file EFI SMM Base2 Protocol as defined in the PI 1.2 specification. This protocol is utilized by all SMM drivers to locate the SMM infrastructure services and determine whether the driver is being invoked inside SMRAM or outside of SMRAM. Copyright (c) 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. **/ #ifndef _SMM_BASE2_H_ #define _SMM_BASE2_H_ #include <Pi/PiSmmCis.h> #define EFI_SMM_BASE2_PROTOCOL_GUID \ { \ 0xf4ccbfb7, 0xf6e0, 0x47fd, {0x9d, 0xd4, 0x10, 0xa8, 0xf1, 0x50, 0xc1, 0x91 } \ } typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL; /** Service to indicate whether the driver is currently executing in the SMM Initialization phase. This service is used to indicate whether the driver is currently executing in the SMM Initialization phase. For SMM drivers, this will return TRUE in InSmram while inside the driver's entry point and otherwise FALSE. For combination SMM/DXE drivers, this will return FALSE in the DXE launch. For the SMM launch, it behaves as an SMM driver. @param[in] This The EFI_SMM_BASE2_PROTOCOL instance. @param[out] InSmram Pointer to a Boolean which, on return, indicates that the driver is currently executing inside of SMRAM (TRUE) or outside of SMRAM (FALSE). @retval EFI_SUCCESS The call returned successfully. @retval EFI_INVALID_PARAMETER InSmram was NULL. **/ typedef EFI_STATUS (EFIAPI *EFI_SMM_INSIDE_OUT2)( IN CONST EFI_SMM_BASE2_PROTOCOL *This, OUT BOOLEAN *InSmram ) ; /** Returns the location of the System Management Service Table (SMST). This function returns the location of the System Management Service Table (SMST). The use of the API is such that a driver can discover the location of the SMST in its entry point and then cache it in some driver global variable so that the SMST can be invoked in subsequent handlers. @param[in] This The EFI_SMM_BASE2_PROTOCOL instance. @param[in,out] Smst On return, points to a pointer to the System Management Service Table (SMST). @retval EFI_SUCCESS The operation was successful. @retval EFI_INVALID_PARAMETER Smst was invalid. @retval EFI_UNSUPPORTED Not in SMM. **/ typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_SMST_LOCATION2)( IN CONST EFI_SMM_BASE2_PROTOCOL *This, IN OUT EFI_SMM_SYSTEM_TABLE2 **Smst ) ; /// /// EFI SMM Base2 Protocol is utilized by all SMM drivers to locate the SMM infrastructure /// services and determine whether the driver is being invoked inside SMRAM or outside of SMRAM. /// struct _EFI_SMM_BASE2_PROTOCOL { EFI_SMM_INSIDE_OUT2 InSmm; EFI_SMM_GET_SMST_LOCATION2 GetSmstLocation; }; extern EFI_GUID gEfiSmmBase2ProtocolGuid; #endif
/*========================================================================= Program: OsiriX Copyright (c) OsiriX Team All rights reserved. Distributed under GNU - LGPL See http://www.osirix-viewer.com/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================*/ #import <AppKit/AppKit.h> #import "OSIWindowController.h" @class ThickSlabVR; /** \brief Thick Slab window coontroller */ @interface ThickSlabController : NSWindowController <NSWindowDelegate> { IBOutlet ThickSlabVR *view; } -(id) init; -(void) setImageData:(long) w :(long) h :(long) c :(float) sX :(float) sY :(float) t :(BOOL) flip; -(unsigned char*) renderSlab; -(void) setWLWW: (float) l :(float) w; -(void) setBlendingWLWW: (float) l :(float) w; -(void) setImageSource: (float*) i :(long) c; -(void) setFlip: (BOOL) f; -(void) setCLUT: (unsigned char*) r : (unsigned char*) g : (unsigned char*) b; -(void) setBlendingCLUT:( unsigned char*) r : (unsigned char*) g : (unsigned char*) b; - (void) setLowQuality:(BOOL) q; -(void) setOpacity:(NSArray*) array; -(void) setImageBlendingSource: (float*) i; @end
/*========================================================================= Program: OsiriX Copyright (c) OsiriX Team All rights reserved. Distributed under GNU - LGPL See http://www.osirix-viewer.com/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================*/ #import <Cocoa/Cocoa.h> #import "browserController.h" /** \brief Category for DCMTK calls from BrowserController */ @interface BrowserController (BrowserControllerDCMTKCategory) + (NSString*) compressionString: (NSString*) string; #ifndef OSIRIX_LIGHT - (NSData*) getDICOMFile:(NSString*) file inSyntax:(NSString*) syntax quality: (int) quality; - (BOOL) testFiles: (NSArray*) files __deprecated; - (BOOL) needToCompressFile: (NSString*) path __deprecated; - (BOOL) compressDICOMWithJPEG:(NSArray *) paths __deprecated; - (BOOL) compressDICOMWithJPEG:(NSArray *) paths to:(NSString*) dest __deprecated; - (BOOL) decompressDICOMList:(NSArray *) files to:(NSString*) dest __deprecated; #endif @end
//===-- llvm/Target/TargetELFWriterInfo.h - ELF Writer Info -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the TargetELFWriterInfo class. // //===----------------------------------------------------------------------===// #ifndef LLVM_TARGET_TARGETELFWRITERINFO_H #define LLVM_TARGET_TARGETELFWRITERINFO_H namespace llvm { //===--------------------------------------------------------------------===// // TargetELFWriterInfo //===--------------------------------------------------------------------===// class TargetELFWriterInfo { protected: // EMachine - This field is the target specific value to emit as the // e_machine member of the ELF header. unsigned short EMachine; bool is64Bit, isLittleEndian; public: // Machine architectures enum MachineType { EM_NONE = 0, // No machine EM_M32 = 1, // AT&T WE 32100 EM_SPARC = 2, // SPARC EM_386 = 3, // Intel 386 EM_68K = 4, // Motorola 68000 EM_88K = 5, // Motorola 88000 EM_486 = 6, // Intel 486 (deprecated) EM_860 = 7, // Intel 80860 EM_MIPS = 8, // MIPS R3000 EM_PPC = 20, // PowerPC EM_ARM = 40, // ARM EM_ALPHA = 41, // DEC Alpha EM_SPARCV9 = 43, // SPARC V9 EM_X86_64 = 62 // AMD64 }; // ELF File classes enum { ELFCLASS32 = 1, // 32-bit object file ELFCLASS64 = 2 // 64-bit object file }; // ELF Endianess enum { ELFDATA2LSB = 1, // Little-endian object file ELFDATA2MSB = 2 // Big-endian object file }; explicit TargetELFWriterInfo(bool is64Bit_, bool isLittleEndian_); virtual ~TargetELFWriterInfo(); unsigned short getEMachine() const { return EMachine; } unsigned getEFlags() const { return 0; } unsigned getEIClass() const { return is64Bit ? ELFCLASS64 : ELFCLASS32; } unsigned getEIData() const { return isLittleEndian ? ELFDATA2LSB : ELFDATA2MSB; } /// ELF Header and ELF Section Header Info unsigned getHdrSize() const { return is64Bit ? 64 : 52; } unsigned getSHdrSize() const { return is64Bit ? 64 : 40; } /// Symbol Table Info unsigned getSymTabEntrySize() const { return is64Bit ? 24 : 16; } /// getPrefELFAlignment - Returns the preferred alignment for ELF. This /// is used to align some sections. unsigned getPrefELFAlignment() const { return is64Bit ? 8 : 4; } /// getRelocationEntrySize - Entry size used in the relocation section unsigned getRelocationEntrySize() const { return is64Bit ? (hasRelocationAddend() ? 24 : 16) : (hasRelocationAddend() ? 12 : 8); } /// getRelocationType - Returns the target specific ELF Relocation type. /// 'MachineRelTy' contains the object code independent relocation type virtual unsigned getRelocationType(unsigned MachineRelTy) const = 0; /// hasRelocationAddend - True if the target uses an addend in the /// ELF relocation entry. virtual bool hasRelocationAddend() const = 0; /// getDefaultAddendForRelTy - Gets the default addend value for a /// relocation entry based on the target ELF relocation type. virtual long int getDefaultAddendForRelTy(unsigned RelTy, long int Modifier = 0) const = 0; /// getRelTySize - Returns the size of relocatable field in bits virtual unsigned getRelocationTySize(unsigned RelTy) const = 0; /// isPCRelativeRel - True if the relocation type is pc relative virtual bool isPCRelativeRel(unsigned RelTy) const = 0; /// getJumpTableRelocationTy - Returns the machine relocation type used /// to reference a jumptable. virtual unsigned getAbsoluteLabelMachineRelTy() const = 0; /// computeRelocation - Some relocatable fields could be relocated /// directly, avoiding the relocation symbol emission, compute the /// final relocation value for this symbol. virtual long int computeRelocation(unsigned SymOffset, unsigned RelOffset, unsigned RelTy) const = 0; }; } // end llvm namespace #endif // LLVM_TARGET_TARGETELFWRITERINFO_H
#ifndef _IQ_H_ #define _IQ_H_ #include <QByteArray> #include "global.h" class OJN_EXPORT IQ { public: enum Iq_Types { Iq_Get, Iq_Set, Iq_Result, Iq_Unknown }; IQ(QByteArray const&); ~IQ() {}; bool IsValid() const; IQ::Iq_Types Type() const; QByteArray const& Content() const; QByteArray const& From() const; // %1 = id, %2 = from, %3 = to, %4 = result QByteArray Reply(Iq_Types type, QByteArray const&, QByteArray const& content); protected: Iq_Types fromString(QByteArray const&) const; QByteArray toString(IQ::Iq_Types type) const; bool isValid; QByteArray from; QByteArray to; Iq_Types type; QByteArray id; QByteArray content; }; inline bool IQ::IsValid() const { return isValid; } inline IQ::Iq_Types IQ::Type() const { return type; } inline QByteArray const& IQ::Content() const { return content; } inline QByteArray const& IQ::From() const { return from; } #endif
/* * localconf.h * */ #include "config.h" #ifdef WORDS_BIGENDIAN #define host_is_BIG_ENDIAN 1 #else #define host_is_LITTLE_ENDIAN 1 #endif #include <stdio.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_NET_INET_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #if SIZEOF_U_INT8_T == 0 #undef SIZEOF_U_INT8_T #define SIZEOF_U_INT8_T SIZEOF_UINT8_T typedef uint8_t u_int8_t; #endif #if SIZEOF_U_INT16_T == 0 #undef SIZEOF_U_INT16_T #define SIZEOF_U_INT16_T SIZEOF_UINT16_T typedef uint16_t u_int16_t; #endif #if SIZEOF_U_INT32_T == 0 #undef SIZEOF_U_INT32_T #define SIZEOF_U_INT32_T SIZEOF_UINT32_T typedef uint32_t u_int32_t; #endif #include "localperl.h"
/*-------------------------------- Arctic Core ------------------------------ * Copyright (C) 2013, ArcCore AB, Sweden, www.arccore.com. * Contact: <contact@arccore.com> * * You may ONLY use this file: * 1)if you have a valid commercial ArcCore license and then in accordance with * the terms contained in the written license agreement between you and ArcCore, * or alternatively * 2)if you follow the terms found in GNU General Public License version 2 as * published by the Free Software Foundation and appearing in the file * LICENSE.GPL included in the packaging of this file or here * <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt> *-------------------------------- Arctic Core -----------------------------*/ #ifndef COMM_CONFIGTYPES_H_ #define COMM_CONFIGTYPES_H_ typedef enum { COMM_BUS_TYPE_CAN, COMM_BUS_TYPE_FR, COMM_BUS_TYPE_INTERNAL, COMM_BUS_TYPE_LIN } ComM_BusTypeType; typedef enum { COMM_NM_VARIANT_NONE, COMM_NM_VARIANT_LIGHT, COMM_NM_VARIANT_PASSIVE, COMM_NM_VARIANT_FULL } ComM_NmVariantType; typedef struct { const ComM_BusTypeType BusType; const NetworkHandleType BusSMNetworkHandle; const NetworkHandleType NmChannelHandle; const ComM_NmVariantType NmVariant; const uint32 MainFunctionPeriod; const uint32 LightTimeout; const uint8 Number; } ComM_ChannelType; typedef struct { const ComM_ChannelType** ChannelList; const uint8 ChannelCount; } ComM_UserType; typedef struct { const ComM_ChannelType* Channels; const ComM_UserType* Users; } ComM_ConfigType; #endif /* COMM_CONFIGTYPES_H_ */
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2015. * * * * This program is free software. You may use, modify, and redistribute 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. This program is distributed without any warranty. See * * the file COPYING.gpl-v3 for details. * \*************************************************************************/ /* sv_lib_v2.c */ #include <stdio.h> __asm__(".symver xyz_old,xyz@VER_1"); __asm__(".symver xyz_new,xyz@@VER_2"); void xyz_old(void) { printf("v1 xyz\n"); } void xyz_new(void) { printf("v2 xyz\n"); } void pqr(void) { printf("v2 pqr\n"); }
/* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */ /* * There are duplicates of this code in: * - tools/xenstore/hashtable_private.h * - tools/vtpm_manager/util/hashtable_private.h */ #ifndef __HASHTABLE_PRIVATE_CWC22_H__ #define __HASHTABLE_PRIVATE_CWC22_H__ #include "hashtable.h" /*****************************************************************************/ struct entry { void *k, *v; unsigned int h; struct entry *next; }; struct hashtable { unsigned int tablelength; struct entry **table; unsigned int entrycount; unsigned int loadlimit; unsigned int primeindex; unsigned int (*hashfn) (void *k); int (*eqfn) (void *k1, void *k2); }; /*****************************************************************************/ unsigned int hash(struct hashtable *h, void *k); /*****************************************************************************/ /* indexFor */ static inline unsigned int indexFor(unsigned int tablelength, unsigned int hashvalue) { return (hashvalue % tablelength); }; /* Only works if tablelength == 2^N */ /*static inline unsigned int indexFor(unsigned int tablelength, unsigned int hashvalue) { return (hashvalue & (tablelength - 1u)); } */ /*****************************************************************************/ #define freekey(X) free(X) /*define freekey(X) ; */ /*****************************************************************************/ #endif /* __HASHTABLE_PRIVATE_CWC22_H__*/ /* * Copyright (c) 2002, Christopher Clark * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of the original author; nor the names of any 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. */
/*************************************************************************** qgsfeatureexpressionvaluesgatherer - QgsFeatureExpressionValuesGatherer --------------------- begin : 10.3.2017 copyright : (C) 2017 by Matthias Kuhn email : matthias@opengis.ch *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSFEATUREEXPRESSIONVALUESGATHERER_H #define QGSFEATUREEXPRESSIONVALUESGATHERER_H #include <QThread> #include <QMutex> #include "qgsapplication.h" #include "qgslogger.h" #include "qgsvectorlayer.h" #include "qgsvectorlayerfeatureiterator.h" #define SIP_NO_FILE // just internal guff - definitely not for exposing to public API! ///@cond PRIVATE /** * \class QgsFieldExpressionValuesGatherer * Gathers features with substring matching on an expression. * * \since QGIS 3.14 */ class QgsFeatureExpressionValuesGatherer: public QThread { Q_OBJECT public: /** * Constructor * \param layer the vector layer * \param displayExpression if empty, the display expression is taken from the layer definition * \param request the request to perform * \param identifierFields an optional list of fields name to be save in a variant list for an easier reuse */ QgsFeatureExpressionValuesGatherer( QgsVectorLayer *layer, const QString &displayExpression = QString(), const QgsFeatureRequest &request = QgsFeatureRequest(), const QStringList &identifierFields = QStringList() ) : mSource( new QgsVectorLayerFeatureSource( layer ) ) , mDisplayExpression( displayExpression.isEmpty() ? layer->displayExpression() : displayExpression ) , mRequest( request ) , mIdentifierFields( identifierFields ) { } struct Entry { Entry() = default; Entry( const QVariantList &_identifierFields, const QString &_value, const QgsFeature &_feature ) : identifierFields( _identifierFields ) , featureId( _feature.isValid() ? _feature.id() : FID_NULL ) , value( _value ) , feature( _feature ) {} Entry( const QgsFeatureId &_featureId, const QString &_value, const QgsVectorLayer *layer ) : featureId( _featureId ) , value( _value ) , feature( QgsFeature( layer->fields() ) ) {} QVariantList identifierFields; QgsFeatureId featureId; QString value; QgsFeature feature; bool operator()( const Entry &lhs, const Entry &rhs ) const; }; static Entry nullEntry( QgsVectorLayer *layer ) { return Entry( QVariantList(), QgsApplication::nullRepresentation(), QgsFeature( layer->fields() ) ); } void run() override { mWasCanceled = false; QgsFeatureIterator iterator = mSource->getFeatures( mRequest ); mDisplayExpression.prepare( &mExpressionContext ); QgsFeature feature; QList<int> attributeIndexes; for ( const QString &fieldName : qgis::as_const( mIdentifierFields ) ) attributeIndexes << mSource->fields().indexOf( fieldName ); while ( iterator.nextFeature( feature ) ) { mExpressionContext.setFeature( feature ); QVariantList attributes; for ( const int idx : attributeIndexes ) attributes << feature.attribute( idx ); const QString expressionValue = mDisplayExpression.evaluate( &mExpressionContext ).toString(); mEntries.append( Entry( attributes, expressionValue, feature ) ); QMutexLocker locker( &mCancelMutex ); if ( mWasCanceled ) return; } } //! Informs the gatherer to immediately stop collecting values void stop() { QMutexLocker locker( &mCancelMutex ); mWasCanceled = true; } //! Returns TRUE if collection was canceled before completion bool wasCanceled() const { QMutexLocker locker( &mCancelMutex ); return mWasCanceled; } QVector<Entry> entries() const { return mEntries; } QgsFeatureRequest request() const { return mRequest; } /** * Internal data, use for whatever you want. */ QVariant data() const { return mData; } /** * Internal data, use for whatever you want. */ void setData( const QVariant &data ) { mData = data; } protected: QVector<Entry> mEntries; private: std::unique_ptr<QgsVectorLayerFeatureSource> mSource; QgsExpression mDisplayExpression; QgsExpressionContext mExpressionContext; QgsFeatureRequest mRequest; bool mWasCanceled = false; mutable QMutex mCancelMutex; QStringList mIdentifierFields; QVariant mData; }; ///@endcond #endif // QGSFEATUREEXPRESSIONVALUESGATHERER_H
#pragma once /* * Copyright (C) 2005-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include <map> #include <vector> #include "StdString.h" #define HTTPHEADER_CONTENT_TYPE "Content-Type" typedef std::map<CStdString, CStdString> HeaderParams; typedef std::map<CStdString, CStdString>::iterator HeaderParamsIter; class CHttpHeader { public: CHttpHeader(); ~CHttpHeader(); void Parse(CStdString strData); CStdString GetValue(CStdString strParam) const; void GetHeader(CStdString& strHeader) const; CStdString GetMimeType() { return GetValue(HTTPHEADER_CONTENT_TYPE); } CStdString GetProtoLine() { return m_protoLine; } void Clear(); /* PLEX */ CStdString GetHeaders() { return m_headers; } /* END PLEX */ protected: HeaderParams m_params; CStdString m_protoLine; /* PLEX */ CStdString m_headers; /* END PLEX */ };
/********************************************************************** * * Filename: circbuf.h * * Description: An easy-to-use circular buffer class. * * Notes: * * * Copyright (c) 1998 by Michael Barr. This software is placed into * the public domain and may be used for any purpose. However, this * notice must not be changed or removed and no warranty is either * expressed or implied by its publication or distribution. **********************************************************************/ #include <stdio.h> #ifndef _CIRCBUF_H #define _CIRCBUF_H typedef unsigned char item; class CircBuf { public: CircBuf(int nItems); ~CircBuf(); //destructor //consideramos que el tail apunta siempre a una posicion vacia void add(item); void display_buffer(); void display_sin_htc(); item remove(); void flush(); int isEmpty(); int isFull(); private: item * array; //permite guardar los eltos del buffer circular int size; //contiene el tamanio del buffer int head; //apunta al primer elto del buffer int tail; //apunta al ultimo elto. del buffer int count; //guarda la cantidad de eltos. que actualmente posee el buffer }; #endif /* _CIRCBUF_H */
/* -*- c++ -*- ---------------------------------------------------------- * * *** Smooth Mach Dynamics *** * * This file is part of the USER-SMD package for LAMMPS. * Copyright (2014) Georg C. Ganzenmueller, georg.ganzenmueller@emi.fhg.de * Fraunhofer Ernst-Mach Institute for High-Speed Dynamics, EMI, * Eckerstrasse 4, D-79104 Freiburg i.Br, Germany. * * ----------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifndef SMD_MATERIAL_MODELS_H #define SMD_MATERIAL_MODELS_H #include <Eigen/Eigen> /* * EOS models */ void LinearEOS(double lambda, double pInitial, double d, double dt, double &pFinal, double &p_rate); void ShockEOS(double rho, double rho0, double e, double e0, double c0, double S, double Gamma, double pInitial, double dt, double &pFinal, double &p_rate); void polynomialEOS(double rho, double rho0, double e, double C0, double C1, double C2, double C3, double C4, double C5, double C6, double pInitial, double dt, double &pFinal, double &p_rate); void TaitEOS_density(const double exponent, const double c0_reference, const double rho_reference, const double rho_current, double &pressure, double &sound_speed); void PerfectGasEOS(const double gamma, const double vol, const double mass, const double energy, double &pFinal__, double &c0); /* * Material strength models */ void LinearStrength(const double mu, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, const double dt, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__); void LinearPlasticStrength(const double G, const double yieldStress, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, const double dt, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); void JohnsonCookStrength(const double G, const double cp, const double espec, const double A, const double B, const double a, const double C, const double epdot0, const double T0, const double Tmelt, const double M, const double dt, const double ep, const double epdot, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); /* * Damage models */ bool IsotropicMaxStrainDamage(const Eigen::Matrix3d E, const double maxStrain); bool IsotropicMaxStressDamage(const Eigen::Matrix3d E, const double maxStrain); double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d Sdev, const double d1, const double d2, const double d3, const double d4, const double epdot0, const double epdot); #endif /* SMD_MATERIAL_MODELS_H_ */
/* GemRB - Infinity Engine Emulator * Copyright (C) 2003 The GemRB 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * */ #ifndef BIFIMPORTER_H #define BIFIMPORTER_H #include "IndexedArchive.h" #include "globals.h" #include "System/DataStream.h" namespace GemRB { struct FileEntry { ieDword resLocator; ieDword dataOffset; ieDword fileSize; ieWord type; ieWord u1; //Unknown Field }; struct TileEntry { ieDword resLocator; ieDword dataOffset; ieDword tilesCount; ieDword tileSize; //named tilesize so it isn't confused ieWord type; ieWord u1; //Unknown Field }; class BIFImporter : public IndexedArchive { private: FileEntry* fentries; TileEntry* tentries; ieDword fentcount, tentcount; DataStream* stream; public: BIFImporter(void); ~BIFImporter(void); int OpenArchive(const char* filename); DataStream* GetStream(unsigned long Resource, unsigned long Type); private: static DataStream* DecompressBIF(DataStream* compressed, const char* path); static DataStream* DecompressBIFC(DataStream* compressed, const char* path); void ReadBIF(void); }; } #endif
// Aseprite // Copyright (C) 2001-2015 David Capello // // 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 APP_UI_PALETTE_POPUP_H_INCLUDED #define APP_UI_PALETTE_POPUP_H_INCLUDED #pragma once #include "app/ui/palettes_listbox.h" #include "ui/popup_window.h" namespace ui { class Button; class View; } namespace app { namespace gen { class PalettePopup; } class PalettePopup : public ui::PopupWindow { public: PalettePopup(); void showPopup(const gfx::Rect& bounds); protected: void onPalChange(doc::Palette* palette); void onLoadPal(); void onOpenFolder(); private: gen::PalettePopup* m_popup; PalettesListBox m_paletteListBox; }; } // namespace app #endif
/* Copyright (c) 2002-2012 Croteam Ltd. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #if !defined(AFX_WNDDISPLAYTEXTURE_H__4B489BC1_FAD9_11D1_82EA_000000000000__INCLUDED_) #define AFX_WNDDISPLAYTEXTURE_H__4B489BC1_FAD9_11D1_82EA_000000000000__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // WndDisplayTexture.h : header file // ///////////////////////////////////////////////////////////////////////////// // CWndDisplayTexture window class CWndDisplayTexture : public CWnd { // Construction public: CWndDisplayTexture(); // function that is called when lmb is clicked inline void SetLeftMouseButtonClicked( void(*pLeftMouseButtonClicked)( PIX pixX, PIX pixY)) {m_pLeftMouseButtonClicked=pLeftMouseButtonClicked;}; // function that is called when lmb is released inline void SetLeftMouseButtonReleased( void(*pLeftMouseButtonReleased)( PIX pixX, PIX pixY)) {m_pLeftMouseButtonReleased=pLeftMouseButtonReleased;}; // function that is called when rmb is clicked inline void SetRightMouseButtonClicked( void(*pRightMouseButtonClicked)( PIX pixX, PIX pixY)) {m_pRightMouseButtonClicked=pRightMouseButtonClicked;}; // function that is called when rmb is moved inline void SetRightMouseButtonMoved( void(*pRightMouseButtonMoved)( PIX pixX, PIX pixY)) {m_pRightMouseButtonMoved=pRightMouseButtonMoved;}; void (*m_pLeftMouseButtonClicked)( PIX pixX, PIX pixY); void (*m_pLeftMouseButtonReleased)( PIX pixX, PIX pixY); void (*m_pRightMouseButtonClicked)( PIX pixX, PIX pixY); void (*m_pRightMouseButtonMoved)( PIX pixX, PIX pixY); CTextureObject m_toTexture; CDrawPort *m_pDrawPort; CViewPort *m_pViewPort; int m_iTimerID; BOOL m_bChequeredAlpha; BOOL m_bForce32; FLOAT m_fWndTexRatio; PIX m_pixWinWidth; PIX m_pixWinHeight; PIX m_pixWinOffsetU; PIX m_pixWinOffsetV; public: BOOL m_bDrawLine; PIX m_pixLineStartU; PIX m_pixLineStartV; PIX m_pixLineStopU; PIX m_pixLineStopV; // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CWndDisplayTexture) //}}AFX_VIRTUAL // Implementation public: virtual ~CWndDisplayTexture(); // Generated message map functions protected: //{{AFX_MSG(CWndDisplayTexture) afx_msg void OnDestroy(); afx_msg void OnPaint(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_WNDDISPLAYTEXTURE_H__4B489BC1_FAD9_11D1_82EA_000000000000__INCLUDED_)
/** * Structures and functions for separating a character buffer into lexemes -- * groups of characters. The lexer reads through a buffer of characters * (themselves typically read from standard input), strips whitespace, and * breaks them up into logical atoms of character strings which, in turn, may be * passed on to later processes (such as a tokenizer). * * \file lexer.h * * \author Justin J. Meza * * \date 2010-2012 */ #ifndef __LEXER_H__ #define __LEXER_H__ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include "error.h" #undef DEBUG /** * Stores a lexeme. A lexeme is a group of contiguous characters, stripped of * surrounding whitespace or other lexemes. */ typedef struct { char *image; /**< The string that identifies the lexeme. */ const char *fname; /**< The name of the file containing the lexeme. */ unsigned int line; /**< The line number the lexeme occurred on. */ } Lexeme; /** * Stores a list of lexemes. */ typedef struct { unsigned int num; /**< The number of lexemes stored. */ Lexeme **lexemes; /**< The array of stored lexemes. */ } LexemeList; /** * \name Lexeme modifiers * * Functions for performing helper tasks. */ /**@{*/ Lexeme *createLexeme(char *, const char *, unsigned int); void deleteLexeme(Lexeme *); LexemeList *createLexemeList(void); Lexeme *addLexeme(LexemeList *, Lexeme*); void deleteLexemeList(LexemeList *); /**@}*/ /** * \name Buffer lexer * * Generates lexemes from a character buffer. */ /**@{*/ LexemeList *scanBuffer(const char *, unsigned int, const char *); /**@}*/ #endif /* __LEXER_H__ */
/* * Ghost - A honeypot for USB malware * Copyright (C) 2011-2012 Sebastian Poeplau (sebastian.poeplau@gmail.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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/>. * * Additional permission under GNU GPL version 3 section 7 * * If you modify this Program, or any covered work, by linking or combining * it with the Windows Driver Frameworks (or a modified version of that library), * containing parts covered by the terms of the Microsoft Software License Terms - * Microsoft Windows Driver Kit, the licensors of this Program grant you additional * permission to convey the resulting work. * */ #ifndef DEVICELIST_H #define DEVICELIST_H #include <windows.h> #include <ghostbus.h> #include "ghostlib.h" typedef struct _GHOST_INCIDENT { int IncidentID; PGHOST_DRIVE_WRITER_INFO_RESPONSE WriterInfo; struct _GHOST_INCIDENT *Next; } GHOST_INCIDENT, *PGHOST_INCIDENT; typedef struct _GHOST_DEVICE { int DeviceID; GhostIncidentCallback Callback; void *Context; HANDLE StopEvent; HANDLE InfoThread; PGHOST_INCIDENT Incidents; struct _GHOST_DEVICE *Next; } GHOST_DEVICE, *PGHOST_DEVICE; void DeviceListInit(); void DeviceListDestroy(); PGHOST_DEVICE DeviceListCreateDevice(int DeviceID); void DeviceListAdd(PGHOST_DEVICE Device); PGHOST_DEVICE DeviceListGet(int DeviceID); void DeviceListRemove(int DeviceID); #endif
/* * Copyright (c) 2012, Mathieu Malaterre * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE 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. */ #include <assert.h> #include <string.h> #include <stdio.h> #include "opj_config.h" #include "openjpeg.h" #define J2K_CFMT 0 void error_callback(const char *msg, void *v); void warning_callback(const char *msg, void *v); void info_callback(const char *msg, void *v); void error_callback(const char *msg, void *v) { (void)msg; (void)v; puts(msg); } void warning_callback(const char *msg, void *v) { (void)msg; (void)v; puts(msg); } void info_callback(const char *msg, void *v) { (void)msg; (void)v; puts(msg); } int main(int argc, char *argv[]) { const char * v = opj_version(); const OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; unsigned int numcomps = 1; unsigned int i; unsigned int image_width = 256; unsigned int image_height = 256; opj_cparameters_t parameters; unsigned int subsampling_dx = 0; unsigned int subsampling_dy = 0; opj_image_cmptparm_t cmptparm; opj_image_t *image; opj_codec_t* l_codec = 00; OPJ_BOOL bSuccess; opj_stream_t *l_stream = 00; (void)argc; (void)argv; opj_set_default_encoder_parameters(&parameters); parameters.cod_format = J2K_CFMT; puts(v); cmptparm.prec = 8; cmptparm.bpp = 8; cmptparm.sgnd = 0; cmptparm.dx = subsampling_dx; cmptparm.dy = subsampling_dy; cmptparm.w = image_width; cmptparm.h = image_height; image = opj_image_create(numcomps, &cmptparm, color_space); assert( image ); for (i = 0; i < image_width * image_height; i++) { unsigned int compno; for(compno = 0; compno < numcomps; compno++) { image->comps[compno].data[i] = 0; } } /* catch events using our callbacks and give a local context */ opj_set_info_handler(l_codec, info_callback,00); opj_set_warning_handler(l_codec, warning_callback,00); opj_set_error_handler(l_codec, error_callback,00); l_codec = opj_create_compress(OPJ_CODEC_J2K); opj_set_info_handler(l_codec, info_callback,00); opj_set_warning_handler(l_codec, warning_callback,00); opj_set_error_handler(l_codec, error_callback,00); opj_setup_encoder(l_codec, &parameters, image); l_stream = opj_stream_create_default_file_stream("testempty1.j2k",OPJ_FALSE); assert(l_stream); bSuccess = opj_start_compress(l_codec,image,l_stream); if( !bSuccess ) { opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(image); return 0; } assert( bSuccess ); bSuccess = opj_encode(l_codec, l_stream); assert( bSuccess ); bSuccess = opj_end_compress(l_codec, l_stream); assert( bSuccess ); opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(image); puts( "end" ); return 0; }
/**************************************************************************/ /*! @file mcp4725.h @author K. Townsend (microBuilder.eu) @section LICENSE Software License Agreement (BSD License) Copyright (c) 2010, microBuilder SARL All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /**************************************************************************/ #ifndef _MCP4725_H_ #define _MCP4725_H_ #include "projectconfig.h" #define MCP4725_ADDRESS (0xC0) // 1100000x - Assumes A0 is GND and A2,A1 are 0 (MCP4725A0T-E/CH) #define MCP4725_READ (0x01) #define MCP4726_CMD_WRITEDAC (0x40) // Writes data to the DAC #define MCP4726_CMD_WRITEDACEEPROM (0x60) // Writes data to the DAC and the EEPROM (persisting the assigned value after reset) int mcp4725Init(); void mcp4725SetVoltage( uint16_t output, bool writeEEPROM ); void mcp472ReadConfig( uint8_t *status, uint16_t *value ); #endif
/* grain.h */ /* This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 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/>. */ /** \file grain.h * \author Daniel Otte * \email daniel.otte@rub.de * \license GPLv3 or later * \brief implementation of the Grain streamcipher */ #ifndef GRAIN_H_ #define GRAIN_H_ #include <stdint.h> typedef struct gain_ctx_st{ uint8_t lfsr[10]; uint8_t nfsr[10]; } grain_ctx_t; uint8_t grain_getbyte(grain_ctx_t* ctx); uint8_t grain_enc(grain_ctx_t* ctx); void grain_init(const void* key, const void* iv, grain_ctx_t* ctx); #endif /*GRAIN_H_*/
/** * @file CC3000.h * @version 1.0 * * @section License * Copyright (C) 2015, Mikael Patel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * This file is part of the Arduino Che Cosa project. */ #ifndef COSA_CC3000_H #define COSA_CC3000_H #include "CC3000.hh" #endif
/**************************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ /* */ /* Copyright 2000 Institut National de Recherche en Informatique et */ /* en Automatique. */ /* */ /* All rights reserved. This file is distributed under the terms of */ /* the GNU Lesser General Public License version 2.1, with the */ /* special exception on linking described in the file LICENSE. */ /* */ /**************************************************************************/ #define CAML_NAME_SPACE #include <stdio.h> #include <caml/mlvalues.h> #include <caml/bigarray.h> extern void filltab_(void); extern void printtab_(float * data, int * dimx, int * dimy); extern float ftab_[]; value fortran_filltab(value unit) { filltab_(); return caml_ba_alloc_dims(CAML_BA_FLOAT32 | CAML_BA_FORTRAN_LAYOUT, 2, ftab_, (intnat)8, (intnat)6); } value fortran_printtab(value ba) { int dimx = Caml_ba_array_val(ba)->dim[0]; int dimy = Caml_ba_array_val(ba)->dim[1]; printtab_(Caml_ba_data_val(ba), &dimx, &dimy); return Val_unit; }
/* * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de> * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @defgroup pkg_lwip_arch_cc Compiler and processor description * @ingroup pkg_lwip * @brief Describes compiler and processor to lwIP * @{ * * @file * @brief Compiler and processor definitions * * @author Martine Lenders <mlenders@inf.fu-berlin.de> */ #ifndef ARCH_CC_H #define ARCH_CC_H #include <assert.h> #include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include "irq.h" #include "byteorder.h" #include "mutex.h" #ifdef MODULE_LOG #include "log.h" #endif #ifdef __cplusplus extern "C" { #endif #ifndef BYTE_ORDER #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ # define BYTE_ORDER (LITTLE_ENDIAN) /**< platform's endianess */ #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ # define BYTE_ORDER (BIG_ENDIAN) /**< platform's endianess */ #else # error "Byte order is neither little nor big!" #endif #endif /** * @brief (sn)printf formatters for the generic lwIP types * @{ */ #define X8_F "02" PRIx8 #define U16_F PRIu16 #define S16_F PRId16 #define X16_F PRIx16 #define U32_F PRIu32 #define S32_F PRId32 #define X32_F PRIx32 #define SZT_F "lu" /** * @} */ /** * @brief Compiler hints for packing structures * @{ */ #define PACK_STRUCT_FIELD(x) x #define PACK_STRUCT_STRUCT __attribute__((packed)) #define PACK_STRUCT_BEGIN #define PACK_STRUCT_END /** * @} */ /** * @todo check for best value */ #define LWIP_CHKSUM_ALGORITHM (3) #ifdef MODULE_LOG # define LWIP_PLATFORM_DIAG(x) LOG_INFO x # ifdef NDEBUG # define LWIP_PLATFORM_ASSERT(x) # else # define LWIP_PLATFORM_ASSERT(x) \ do { \ LOG_ERROR("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \ fflush(NULL); \ abort(); \ } while (0) # endif #else # define LWIP_PLATFORM_DIAG(x) printf x # ifdef NDEBUG # define LWIP_PLATFORM_ASSERT(x) # else # define LWIP_PLATFORM_ASSERT(x) \ do { \ printf("Assertion \"%s\" failed at %s:%d\n", x, __FILE__, __LINE__); \ fflush(NULL); \ abort(); \ } while (0) # endif #endif #define SYS_ARCH_PROTECT(x) mutex_lock(&x) #define SYS_ARCH_UNPROTECT(x) mutex_unlock(&x) #define SYS_ARCH_DECL_PROTECT(x) mutex_t x = MUTEX_INIT #ifdef __cplusplus } #endif #endif /* ARCH_CC_H */ /** @} */
/* BEGIN_COMMON_COPYRIGHT_HEADER * (c)LGPL2+ * * LXQt - a lightweight, Qt based, desktop toolset * http://razor-qt.org, http://lxde.org/ * * Copyright: 2010-2012 LXQt team * Authors: * Petr Vanek <petr@scribus.info> * * This program or library is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA * * END_COMMON_COPYRIGHT_HEADER */ #ifndef DEFAULTAPPS_H #define DEFAULTAPPS_H #include <QWidget> namespace Ui { class DefaultAppsPage; } class DefaultApps : public QWidget { Q_OBJECT public: explicit DefaultApps(QWidget *parent = 0); ~DefaultApps(); signals: void defaultAppChanged(const QString&, const QString&); public slots: void updateEnvVar(const QString &var, const QString &val); private: Ui::DefaultAppsPage *ui; private slots: void browserButton_clicked(); void terminalButton_clicked(); void browserChanged(); void terminalChanged(); }; #endif // DEFAULTAPPS_H
/* * casocklib - An asynchronous communication library for C++ * --------------------------------------------------------- * Copyright (C) 2010 Leandro Costa * * This file is part of casocklib. * * casocklib 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. * * casocklib 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 casocklib. If not, see <http://www.gnu.org/licenses/>. */ /*! * \file casock/rpc/protobuf/server/RPCCallHandlerFactory.h * \brief [brief description] * \author Leandro Costa * \date 2010 * * $LastChangedDate$ * $LastChangedBy$ * $Revision$ */ #ifndef __CASOCKLIB__CASOCK_RPC_SIGIO_PROTOBUF_SERVER__RPC_CALL_HANDLER_FACTORY_H_ #define __CASOCKLIB__CASOCK_RPC_SIGIO_PROTOBUF_SERVER__RPC_CALL_HANDLER_FACTORY_H_ namespace casock { namespace rpc { namespace protobuf { namespace server { class RPCCallHandler; class RPCCallQueue; class RPCCallHandlerFactory { public: virtual RPCCallHandler* buildRPCCallHandler (RPCCallQueue& rCallQueue) const = 0; }; } } } } #endif // __CASOCKLIB__CASOCK_RPC_SIGIO_PROTOBUF_SERVER__RPC_CALL_HANDLER_FACTORY_H_
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_IR_DIALECT_H_ #define TENSORFLOW_CORE_IR_DIALECT_H_ #include "mlir/IR/BuiltinTypes.h" // from @llvm-project #include "mlir/IR/Diagnostics.h" // from @llvm-project #include "mlir/IR/Dialect.h" // from @llvm-project #include "mlir/IR/TypeUtilities.h" // from @llvm-project #include "tensorflow/core/ir/interfaces.h" #include "tensorflow/core/ir/types/dialect.h" namespace mlir { namespace tfg { // Include the relevant TensorFlow attrs/types directly in the TFG namespace. using mlir::tf_type::Bfloat16RefType; // NOLINT using mlir::tf_type::BoolRefType; // NOLINT using mlir::tf_type::Complex128RefType; // NOLINT using mlir::tf_type::Complex64RefType; // NOLINT using mlir::tf_type::ControlType; // NOLINT using mlir::tf_type::DoubleRefType; // NOLINT using mlir::tf_type::FloatRefType; // NOLINT using mlir::tf_type::FuncAttr; // NOLINT using mlir::tf_type::HalfRefType; // NOLINT using mlir::tf_type::Int16RefType; // NOLINT using mlir::tf_type::Int32RefType; // NOLINT using mlir::tf_type::Int64RefType; // NOLINT using mlir::tf_type::Int8RefType; // NOLINT using mlir::tf_type::OpaqueTensorType; // NOLINT using mlir::tf_type::PlaceholderAttr; // NOLINT using mlir::tf_type::Qint16RefType; // NOLINT using mlir::tf_type::Qint16Type; // NOLINT using mlir::tf_type::Qint32RefType; // NOLINT using mlir::tf_type::Qint32Type; // NOLINT using mlir::tf_type::Qint8RefType; // NOLINT using mlir::tf_type::Qint8Type; // NOLINT using mlir::tf_type::Quint16RefType; // NOLINT using mlir::tf_type::Quint16Type; // NOLINT using mlir::tf_type::Quint8RefType; // NOLINT using mlir::tf_type::Quint8Type; // NOLINT using mlir::tf_type::ResourceRefType; // NOLINT using mlir::tf_type::ResourceType; // NOLINT using mlir::tf_type::ShapeAttr; // NOLINT using mlir::tf_type::StringRefType; // NOLINT using mlir::tf_type::StringType; // NOLINT using mlir::tf_type::Uint16RefType; // NOLINT using mlir::tf_type::Uint32RefType; // NOLINT using mlir::tf_type::Uint64RefType; // NOLINT using mlir::tf_type::Uint8RefType; // NOLINT using mlir::tf_type::VariantRefType; // NOLINT using mlir::tf_type::VariantType; // NOLINT using mlir::tf_type::VersionAttr; // NOLINT class TFGraphOpAsmInterface; } // namespace tfg } // namespace mlir // Dialect main class is defined in ODS, we include it here. #include "tensorflow/core/ir/dialect.h.inc" #endif // TENSORFLOW_CORE_IR_DIALECT_H_
/* * * 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. * */ /// An Alarm posts the user provided tag to its associated completion queue upon /// expiry or cancellation. #ifndef GRPCXX_ALARM_H #define GRPCXX_ALARM_H #include <grpc++/impl/codegen/completion_queue.h> #include <grpc++/impl/codegen/completion_queue_tag.h> #include <grpc++/impl/codegen/grpc_library.h> #include <grpc++/impl/codegen/time.h> #include <grpc++/impl/grpc_library.h> #include <grpc/grpc.h> struct grpc_alarm; namespace grpc { class CompletionQueue; /// A thin wrapper around \a grpc_alarm (see / \a / src/core/surface/alarm.h). class Alarm : private GrpcLibraryCodegen { public: /// Create an unset completion queue alarm Alarm() : tag_(nullptr), alarm_(grpc_alarm_create(nullptr)) {} /// DEPRECATED: Create and set a completion queue alarm instance associated to /// \a cq. /// This form is deprecated because it is inherently racy. /// \internal We rely on the presence of \a cq for grpc initialization. If \a /// cq were ever to be removed, a reference to a static /// internal::GrpcLibraryInitializer instance would need to be introduced /// here. \endinternal. template <typename T> Alarm(CompletionQueue* cq, const T& deadline, void* tag) : tag_(tag), alarm_(grpc_alarm_create(nullptr)) { grpc_alarm_set(alarm_, cq->cq(), TimePoint<T>(deadline).raw_time(), static_cast<void*>(&tag_), nullptr); } /// Trigger an alarm instance on completion queue \a cq at the specified time. /// Once the alarm expires (at \a deadline) or it's cancelled (see \a Cancel), /// an event with tag \a tag will be added to \a cq. If the alarm expired, the /// event's success bit will be true, false otherwise (ie, upon cancellation). template <typename T> void Set(CompletionQueue* cq, const T& deadline, void* tag) { tag_.Set(tag); grpc_alarm_set(alarm_, cq->cq(), TimePoint<T>(deadline).raw_time(), static_cast<void*>(&tag_), nullptr); } /// Alarms aren't copyable. Alarm(const Alarm&) = delete; Alarm& operator=(const Alarm&) = delete; /// Alarms are movable. Alarm(Alarm&& rhs) : tag_(rhs.tag_), alarm_(rhs.alarm_) { rhs.alarm_ = nullptr; } Alarm& operator=(Alarm&& rhs) { tag_ = rhs.tag_; alarm_ = rhs.alarm_; rhs.alarm_ = nullptr; return *this; } /// Destroy the given completion queue alarm, cancelling it in the process. ~Alarm() { if (alarm_ != nullptr) grpc_alarm_destroy(alarm_, nullptr); } /// Cancel a completion queue alarm. Calling this function over an alarm that /// has already fired has no effect. void Cancel() { if (alarm_ != nullptr) grpc_alarm_cancel(alarm_, nullptr); } private: class AlarmEntry : public CompletionQueueTag { public: AlarmEntry(void* tag) : tag_(tag) {} void Set(void* tag) { tag_ = tag; } bool FinalizeResult(void** tag, bool* status) override { *tag = tag_; return true; } private: void* tag_; }; AlarmEntry tag_; grpc_alarm* alarm_; // owned }; } // namespace grpc #endif // GRPCXX_ALARM_H
//============================================================================= // // Adventure Game Studio (AGS) // // Copyright (C) 1999-2011 Chris Jones and 2011-20xx others // The full list of copyright holders can be found in the Copyright.txt // file, which is part of this source code distribution. // // The AGS source code is provided under the Artistic License 2.0. // A copy of this license can be found in the file License.txt and at // http://www.opensource.org/licenses/artistic-license-2.0.php // //============================================================================= // // // //============================================================================= #ifndef __AGS_EE_AC__TEXTBOX_H #define __AGS_EE_AC__TEXTBOX_H #include "gui/guitextbox.h" const char* TextBox_GetText_New(GUITextBox *texbox); void TextBox_GetText(GUITextBox *texbox, char *buffer); void TextBox_SetText(GUITextBox *texbox, const char *newtex); int TextBox_GetTextColor(GUITextBox *guit); void TextBox_SetTextColor(GUITextBox *guit, int colr); int TextBox_GetFont(GUITextBox *guit); void TextBox_SetFont(GUITextBox *guit, int fontnum); #endif // __AGS_EE_AC__TEXTBOX_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 CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_MEDIA_PICKER_H_ #define CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_MEDIA_PICKER_H_ #include <memory> #include "base/callback_forward.h" #include "base/macros.h" #include "base/strings/string16.h" #include "content/public/browser/desktop_media_id.h" #include "ui/gfx/native_widget_types.h" class DesktopMediaList; namespace content { class WebContents; } // Abstract interface for desktop media picker UI. It's used by Desktop Media // API to let user choose a desktop media source. class DesktopMediaPicker { public: typedef base::Callback<void(content::DesktopMediaID)> DoneCallback; // Creates default implementation of DesktopMediaPicker for the current // platform. static std::unique_ptr<DesktopMediaPicker> Create(); DesktopMediaPicker() {} virtual ~DesktopMediaPicker() {} // Shows dialog with list of desktop media sources (screens, windows, tabs) // provided by |screen_list|, |window_list| and |tab_list|. // Dialog window will call |done_callback| when user chooses one of the // sources or closes the dialog. virtual void Show(content::WebContents* web_contents, gfx::NativeWindow context, gfx::NativeWindow parent, const base::string16& app_name, const base::string16& target_name, std::unique_ptr<DesktopMediaList> screen_list, std::unique_ptr<DesktopMediaList> window_list, std::unique_ptr<DesktopMediaList> tab_list, bool request_audio, const DoneCallback& done_callback) = 0; private: DISALLOW_COPY_AND_ASSIGN(DesktopMediaPicker); }; #endif // CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_MEDIA_PICKER_H_
/* * Copyright (c) 2017, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** * @file * This file implements the OpenThread platform abstraction for the alarm. * */ #include <stdbool.h> #include <stdint.h> #include <openthread/config.h> #include <openthread/platform/alarm-milli.h> #include <openthread/platform/diag.h> #include "utils/code_utils.h" #include "em_core.h" #include "rail.h" static uint32_t sTimerHi = 0; static uint32_t sTimerLo = 0; static uint32_t sAlarmT0 = 0; static uint32_t sAlarmDt = 0; static bool sIsRunning = false; void efr32AlarmInit(void) { } uint32_t otPlatAlarmMilliGetNow(void) { uint32_t timer_lo; uint32_t timer_ms; CORE_DECLARE_IRQ_STATE; CORE_ENTER_CRITICAL(); timer_lo = RAIL_GetTime(); if (timer_lo < sTimerLo) { sTimerHi++; } sTimerLo = timer_lo; timer_ms = (((uint64_t)sTimerHi << 32) | sTimerLo) / 1000; CORE_EXIT_CRITICAL(); return timer_ms; } void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt) { (void)aInstance; sAlarmT0 = t0; sAlarmDt = dt; sIsRunning = true; } void otPlatAlarmMilliStop(otInstance *aInstance) { (void)aInstance; sIsRunning = false; } void efr32AlarmProcess(otInstance *aInstance) { uint32_t now = otPlatAlarmMilliGetNow(); uint32_t expires; bool fire = false; otEXPECT(sIsRunning); expires = sAlarmT0 + sAlarmDt; if (sAlarmT0 <= now) { fire = (expires >= sAlarmT0 && expires <= now); } else { fire = (expires >= sAlarmT0 || expires <= now); } if (fire) { sIsRunning = false; #if OPENTHREAD_ENABLE_DIAG if (otPlatDiagModeGet()) { otPlatDiagAlarmFired(aInstance); } else #endif { otPlatAlarmMilliFired(aInstance); } } exit: return; } void RAILCb_TimerExpired(void) { }
// 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 UI_GL_ANDROID_SURFACE_TEXTURE_H_ #define UI_GL_ANDROID_SURFACE_TEXTURE_H_ #include <jni.h> #include "base/android/scoped_java_ref.h" #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "ui/gl/gl_export.h" struct ANativeWindow; namespace gfx { // This class serves as a bridge for native code to call java functions inside // android SurfaceTexture class. class GL_EXPORT SurfaceTexture : public base::RefCountedThreadSafe<SurfaceTexture>{ public: static scoped_refptr<SurfaceTexture> Create(int texture_id); static scoped_refptr<SurfaceTexture> CreateSingleBuffered(int texture_id); // Set the listener callback, which will be invoked on the same thread that // is being called from here for registration. // Note: Since callbacks come in from Java objects that might outlive objects // being referenced from the callback, the only robust way here is to create // the callback from a weak pointer to your object. void SetFrameAvailableCallback(const base::Closure& callback); // Set the listener callback, but allow it to be invoked on any thread. The // same caveats apply as SetFrameAvailableCallback, plus whatever other issues // show up due to multithreading (e.g., don't bind the Closure to a method // via a weak ref). void SetFrameAvailableCallbackOnAnyThread(const base::Closure& callback); // Update the texture image to the most recent frame from the image stream. void UpdateTexImage(); // Release the texture content. This is needed only in single buffered mode // to allow the image content producer to take ownership // of the image buffer. // This is *only* supported on SurfaceTexture instantiated via // |CreateSingleBuffered(...)|. void ReleaseTexImage(); // Retrieve the 4x4 texture coordinate transform matrix associated with the // texture image set by the most recent call to updateTexImage. void GetTransformMatrix(float mtx[16]); // Attach the SurfaceTexture to the texture currently bound to // GL_TEXTURE_EXTERNAL_OES. void AttachToGLContext(); // Detaches the SurfaceTexture from the context that owns its current GL // texture. Must be called with that context current on the calling thread. void DetachFromGLContext(); // Creates a native render surface for this surface texture. // The caller must release the underlying reference when done with the handle // by calling ANativeWindow_release(). ANativeWindow* CreateSurface(); const base::android::JavaRef<jobject>& j_surface_texture() const { return j_surface_texture_; } // This should only be used to guard the SurfaceTexture instantiated via // |CreateSingleBuffered(...)| static bool IsSingleBufferModeSupported(); static bool RegisterSurfaceTexture(JNIEnv* env); protected: explicit SurfaceTexture( const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture); private: friend class base::RefCountedThreadSafe<SurfaceTexture>; ~SurfaceTexture(); // Java SurfaceTexture instance. base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); }; } // namespace gfx #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_
/*=================================================================== 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 ClippedSurfaceBoundsCalculator_h_included #define ClippedSurfaceBoundsCalculator_h_included #include "mitkImage.h" #include "mitkPlaneGeometry.h" #include <vector> /** * \brief Find image slices visible on a given plane. * * The class name is not helpful in finding this class. Good suggestions welcome. * * Given a PlaneGeometry (e.g. the 2D plane of a render window), this class * calculates which slices of an mitk::Image are visible on this plane. * Calculation is done for X, Y, and Z direction, the result is available in * form of a pair (minimum,maximum) slice index. * * Such calculations are useful if you want to display information about the * currently visible slice (overlays, statistics, ...) and you don't want to * depend on any prior information about hat the renderwindow is currently showing. * * \warning The interface attempts to look like an ITK filter but it is far from being one. */ namespace mitk { class MITKCORE_EXPORT ClippedSurfaceBoundsCalculator { public: typedef std::vector<mitk::Point3D> PointListType; ClippedSurfaceBoundsCalculator(const mitk::PlaneGeometry* geometry = nullptr, mitk::Image::Pointer image = nullptr); ClippedSurfaceBoundsCalculator(const mitk::BaseGeometry* geometry, mitk::Image::Pointer image); ClippedSurfaceBoundsCalculator(const PointListType pointlist, mitk::Image::Pointer image); void InitializeOutput(); virtual ~ClippedSurfaceBoundsCalculator(); void SetInput(const mitk::PlaneGeometry* geometry, mitk::Image* image); void SetInput(const mitk::BaseGeometry *geometry, mitk::Image *image); void SetInput(const PointListType pointlist, mitk::Image *image); /** \brief Request calculation. How cut/visible slice indices are determined: 1. construct a bounding box of the image. This is the box that connect the outer voxel centers(!). 2. check the edges of this box. 3. intersect each edge with the plane geometry - if the intersection point is within the image box, we update the visible/cut slice indices for all dimensions. - else we ignore the cut */ void Update(); /** \brief Minimum (first) and maximum (second) slice index. */ typedef std::pair<int, int> OutputType; /** \brief What X coordinates (slice indices) are cut/visible in given plane. */ OutputType GetMinMaxSpatialDirectionX(); /** \brief What Y coordinates (slice indices) are cut/visible in given plane. */ OutputType GetMinMaxSpatialDirectionY(); /** \brief What Z coordinates (slice indices) are cut/visible in given plane. */ OutputType GetMinMaxSpatialDirectionZ(); protected: void CalculateIntersectionPoints(const mitk::PlaneGeometry* geometry); void CalculateIntersectionPoints( PointListType pointList ); /** * \brief Clips the resulting index-coordinates to make sure they do * not exceed the imagebounds. */ void EnforceImageBounds(); mitk::PlaneGeometry::ConstPointer m_PlaneGeometry; mitk::BaseGeometry::ConstPointer m_Geometry3D; mitk::Image::Pointer m_Image; std::vector<mitk::Point3D> m_ObjectPointsInWorldCoordinates; std::vector< OutputType > m_MinMaxOutput; }; } //namespace mitk #endif
#include "bli_config.h" #include "bli_system.h" #include "bli_type_defs.h" #include "bli_cblas.h" #ifdef BLIS_ENABLE_CBLAS /* * * cblas_ztrsm.c * This program is a C interface to ztrsm. * Written by Keita Teranishi * 4/8/1998 * */ #include "cblas.h" #include "cblas_f77.h" void cblas_ztrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int M, const int N, const void *alpha, const void *A, const int lda, void *B, const int ldb) { char UL, TA, SD, DI; #ifdef F77_CHAR F77_CHAR F77_TA, F77_UL, F77_SD, F77_DI; #else #define F77_TA &TA #define F77_UL &UL #define F77_SD &SD #define F77_DI &DI #endif #ifdef F77_INT F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_ldb=ldb; #else #define F77_M M #define F77_N N #define F77_lda lda #define F77_ldb ldb #endif extern int CBLAS_CallFromC; extern int RowMajorStrg; RowMajorStrg = 0; CBLAS_CallFromC = 1; if( Order == CblasColMajor ) { if( Side == CblasRight) SD='R'; else if ( Side == CblasLeft ) SD='L'; else { cblas_xerbla(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if( Uplo == CblasUpper) UL='U'; else if ( Uplo == CblasLower ) UL='L'; else { cblas_xerbla(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if( TransA == CblasTrans) TA ='T'; else if ( TransA == CblasConjTrans ) TA='C'; else if ( TransA == CblasNoTrans ) TA='N'; else { cblas_xerbla(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if( Diag == CblasUnit ) DI='U'; else if ( Diag == CblasNonUnit ) DI='N'; else { cblas_xerbla(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } #ifdef F77_CHAR F77_UL = C2F_CHAR(&UL); F77_TA = C2F_CHAR(&TA); F77_SD = C2F_CHAR(&SD); F77_DI = C2F_CHAR(&DI); #endif F77_ztrsm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_M, &F77_N, alpha, A, &F77_lda, B, &F77_ldb); } else if (Order == CblasRowMajor) { RowMajorStrg = 1; if( Side == CblasRight) SD='L'; else if ( Side == CblasLeft ) SD='R'; else { cblas_xerbla(2, "cblas_ztrsm", "Illegal Side setting, %d\n", Side); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if( Uplo == CblasUpper) UL='L'; else if ( Uplo == CblasLower ) UL='U'; else { cblas_xerbla(3, "cblas_ztrsm", "Illegal Uplo setting, %d\n", Uplo); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if( TransA == CblasTrans) TA ='T'; else if ( TransA == CblasConjTrans ) TA='C'; else if ( TransA == CblasNoTrans ) TA='N'; else { cblas_xerbla(4, "cblas_ztrsm", "Illegal Trans setting, %d\n", TransA); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } if( Diag == CblasUnit ) DI='U'; else if ( Diag == CblasNonUnit ) DI='N'; else { cblas_xerbla(5, "cblas_ztrsm", "Illegal Diag setting, %d\n", Diag); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } #ifdef F77_CHAR F77_UL = C2F_CHAR(&UL); F77_TA = C2F_CHAR(&TA); F77_SD = C2F_CHAR(&SD); F77_DI = C2F_CHAR(&DI); #endif F77_ztrsm(F77_SD, F77_UL, F77_TA, F77_DI, &F77_N, &F77_M, alpha, A, &F77_lda, B, &F77_ldb); } else cblas_xerbla(1, "cblas_ztrsm", "Illegal Order setting, %d\n", Order); CBLAS_CallFromC = 0; RowMajorStrg = 0; return; } #endif
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_CLIENT_HINTS_COMMON_CLIENT_HINTS_H_ #define COMPONENTS_CLIENT_HINTS_COMMON_CLIENT_HINTS_H_ #include "components/content_settings/core/common/content_settings.h" namespace url { class Origin; } namespace blink { class EnabledClientHints; } namespace client_hints { const char kClientHintsSettingKey[] = "client_hints"; // Retrieves the persistent client hints that should be set when fetching a // resource from |url|. The method updates |client_hints| with the result. // |client_hints_rules| contains the content settings for the client hints. void GetAllowedClientHintsFromSource( const url::Origin& origin, const ContentSettingsForOneType& client_hints_rules, blink::EnabledClientHints* client_hints); } // namespace client_hints #endif // COMPONENTS_CLIENT_HINTS_COMMON_CLIENT_HINTS_H_
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import <Foundation/Foundation.h> #import "RCTBridgeMethod.h" #import "RCTNullability.h" @class RCTBridge; @interface RCTMethodArgument : NSObject @property (nonatomic, copy, readonly) NSString *type; @property (nonatomic, readonly) RCTNullability nullability; @property (nonatomic, readonly) BOOL unused; @end @interface RCTModuleMethod : NSObject <RCTBridgeMethod> @property (nonatomic, readonly) Class moduleClass; @property (nonatomic, readonly) SEL selector; - (instancetype)initWithMethodSignature:(NSString *)objCMethodName JSMethodName:(NSString *)JSMethodName moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER; - (void)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray *)arguments; @end
// Copyright 2022 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 CC_PAINT_SKOTTIE_TEXT_PROPERTY_VALUE_H_ #define CC_PAINT_SKOTTIE_TEXT_PROPERTY_VALUE_H_ #include <string> #include "base/containers/flat_map.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_refptr.h" #include "cc/paint/paint_export.h" #include "cc/paint/skottie_resource_metadata.h" namespace cc { // Contains a subset of the fields in skottie::TextPropertyValue that the caller // may want to override when rendering the animation. The primary field of // course is the text itself, but other fields may be added to this class as // desired. All skottie::TextPropertyValue fields not present in this class will // ultimately assume the same values as those baked into the Lottie file when // rendered. // // This class is intentionally cheap to copy. class CC_PAINT_EXPORT SkottieTextPropertyValue { public: explicit SkottieTextPropertyValue(std::string text); SkottieTextPropertyValue(const SkottieTextPropertyValue& other); SkottieTextPropertyValue& operator=(const SkottieTextPropertyValue& other); ~SkottieTextPropertyValue(); bool operator==(const SkottieTextPropertyValue& other) const; bool operator!=(const SkottieTextPropertyValue& other) const; void SetText(std::string text); const std::string& text() const { return text_->data(); } private: // Make the text ref-counted to eliminate as many deep copies as possible when // this class is passed through the rendering pipeline. Note the text's string // content is never mutated once it's set, eliminating the chance of any race // conditions. scoped_refptr<base::RefCountedString> text_; // For fast comparison operator. size_t text_hash_ = 0; }; // Node name in the Lottie file (hashed) to corresponding // SkottieTextPropertyValue. using SkottieTextPropertyValueMap = base::flat_map<SkottieResourceIdHash, SkottieTextPropertyValue>; } // namespace cc #endif // CC_PAINT_SKOTTIE_TEXT_PROPERTY_VALUE_H_
// // ASCollectionViewLayoutInspector.h // AsyncDisplayKit // // Created by Garrett Moon on 11/19/16. // Copyright © 2016 Facebook. All rights reserved. // #import <Foundation/Foundation.h> #import <AsyncDisplayKit/ASDimension.h> #import <AsyncDisplayKit/ASScrollDirection.h> @class ASCollectionView; @protocol ASCollectionDataSource; @protocol ASCollectionDelegate; NS_ASSUME_NONNULL_BEGIN extern ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView *collectionView); @protocol ASCollectionViewLayoutInspecting <NSObject> /** * Asks the inspector to provide a constrained size range for the given collection view node. */ - (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath; /** * Return the directions in which your collection view can scroll */ - (ASScrollDirection)scrollableDirections; @optional /** * Asks the inspector to provide a constrained size range for the given supplementary node. */ - (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath; /** * Asks the inspector for the number of supplementary views for the given kind in the specified section. */ - (NSUInteger)collectionView:(ASCollectionView *)collectionView supplementaryNodesOfKind:(NSString *)kind inSection:(NSUInteger)section; /** * Allow the inspector to respond to delegate changes. * * @discussion A great time to update perform selector caches! */ - (void)didChangeCollectionViewDelegate:(nullable id<ASCollectionDelegate>)delegate; /** * Allow the inspector to respond to dataSource changes. * * @discussion A great time to update perform selector caches! */ - (void)didChangeCollectionViewDataSource:(nullable id<ASCollectionDataSource>)dataSource; #pragma mark Deprecated Methods /** * Asks the inspector for the number of supplementary sections in the collection view for the given kind. * * @deprecated This method will not be called, and it is only deprecated as a reminder to remove it. * Supplementary elements must exist in the same sections as regular collection view items i.e. -numberOfSectionsInCollectionView: */ - (NSUInteger)collectionView:(ASCollectionView *)collectionView numberOfSectionsForSupplementaryNodeOfKind:(NSString *)kind ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode's method instead."); @end /** * A layout inspector for non-flow layouts that returns a constrained size to let the cells layout itself as * far as possible based on the scrollable direction of the collection view. * It doesn't support supplementary nodes and therefore doesn't implement delegate methods * that are related to supplementary node's management. * * @warning This class is not meant to be subclassed and will be restricted in the future. */ @interface ASCollectionViewLayoutInspector : NSObject <ASCollectionViewLayoutInspecting> - (instancetype)initWithCollectionView:(ASCollectionView *)collectionView ASDISPLAYNODE_DEPRECATED_MSG("Use -init instead."); @end NS_ASSUME_NONNULL_END
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file cvsCopy.h * @author drose * @date 2000-10-31 */ #ifndef CVSCOPY_H #define CVSCOPY_H #include "pandatoolbase.h" #include "cvsSourceTree.h" #include "programBase.h" #include "filename.h" #include "pvector.h" /** * This is the base class for a family of programs that copy files, typically * model files like .flt files and their associated textures, into a CVS- * controlled source tree. */ class CVSCopy : public ProgramBase { public: CVSCopy(); CVSSourceTree::FilePath import(const Filename &source, void *extra_data, CVSSourceDirectory *suggested_dir); bool continue_after_error(); protected: virtual bool handle_args(Args &args); virtual bool post_command_line(); virtual bool verify_file(const Filename &source, const Filename &dest, CVSSourceDirectory *dest_dir, void *extra_data); virtual bool copy_file(const Filename &source, const Filename &dest, CVSSourceDirectory *dest_dir, void *extra_data, bool new_file)=0; bool verify_binary_file(Filename source, Filename dest); bool copy_binary_file(Filename source, Filename dest); bool cvs_add(const Filename &filename); static string protect_from_shell(const string &source); virtual string filter_filename(const string &source); private: bool scan_hierarchy(); bool scan_for_root(const string &dirname); string prompt(const string &message); protected: bool _force; bool _interactive; bool _got_model_dirname; Filename _model_dirname; bool _got_map_dirname; Filename _map_dirname; bool _got_root_dirname; Filename _root_dirname; Filename _key_filename; bool _no_cvs; string _cvs_binary; bool _user_aborted; typedef pvector<Filename> SourceFiles; SourceFiles _source_files; CVSSourceTree _tree; CVSSourceDirectory *_model_dir; CVSSourceDirectory *_map_dir; typedef pmap<string, CVSSourceTree::FilePath> CopiedFiles; CopiedFiles _copied_files; }; #endif
/* * @brief LPC8xx System & Control driver * * @note * Copyright(C) NXP Semiconductors, 2012 * All rights reserved. * * @par * Software that is described herein is for illustrative purposes only * which provides customers with programming information regarding the * LPC products. This software is supplied "AS IS" without any warranties of * any kind, and NXP Semiconductors and its licenser disclaim any and * all warranties, express or implied, including all implied warranties of * merchantability, fitness for a particular purpose and non-infringement of * intellectual property rights. NXP Semiconductors assumes no responsibility * or liability for the use of the software, conveys no license or rights under any * patent, copyright, mask work right, or any other intellectual property rights in * or to any products. NXP Semiconductors reserves the right to make changes * in the software without notification. NXP Semiconductors also makes no * representation or warranty that such application will be suitable for the * specified use without further testing or modification. * * @par * Permission to use, copy, modify, and distribute this software and its * documentation is hereby granted, under NXP Semiconductors' and its * licensor's relevant copyrights in the software, without fee, provided that it * is used in conjunction with NXP Semiconductors microcontrollers. This * copyright, permission, and disclaimer notice must appear in all copies of * this code. */ #include "chip.h" /***************************************************************************** * Private types/enumerations/variables ****************************************************************************/ /* PDSLEEPCFG register mask */ #define PDSLEEPWRMASK (0x0000FFB7) #define PDSLEEPDATMASK (0x00000048) #if defined(CHIP_LPC82X) /* PDWAKECFG and PDRUNCFG register masks */ #define PDWAKEUPWRMASK (0x00006D00) #define PDWAKEUPDATMASK (0x000080FF) #else /* PDWAKECFG and PDRUNCFG register masks */ #define PDWAKEUPWRMASK (0x00006D10) #define PDWAKEUPDATMASK (0x000080EF) #endif /***************************************************************************** * Public types/enumerations/variables ****************************************************************************/ /***************************************************************************** * Private functions ****************************************************************************/ /***************************************************************************** * Public functions ****************************************************************************/ /* Setup deep sleep behaviour for power down */ void Chip_SYSCTL_SetDeepSleepPD(uint32_t sleepmask) { /* Update new value */ LPC_SYSCTL->PDSLEEPCFG = PDSLEEPWRMASK | (sleepmask & PDSLEEPDATMASK); } /* Setup wakeup behaviour from deep sleep */ void Chip_SYSCTL_SetWakeup(uint32_t wakeupmask) { /* Update new value */ LPC_SYSCTL->PDAWAKECFG = PDWAKEUPWRMASK | (wakeupmask & PDWAKEUPDATMASK); } /* Power down one or more blocks or peripherals */ void Chip_SYSCTL_PowerDown(uint32_t powerdownmask) { uint32_t pdrun; /* Get current power states */ pdrun = LPC_SYSCTL->PDRUNCFG & PDWAKEUPDATMASK; /* Disable peripheral states by setting high */ pdrun |= (powerdownmask & PDWAKEUPDATMASK); /* Update power states with required register bits */ LPC_SYSCTL->PDRUNCFG = (PDWAKEUPWRMASK | pdrun); } /* Power up one or more blocks or peripherals */ void Chip_SYSCTL_PowerUp(uint32_t powerupmask) { uint32_t pdrun; /* Get current power states */ pdrun = LPC_SYSCTL->PDRUNCFG & PDWAKEUPDATMASK; /* Enable peripheral states by setting low */ pdrun &= ~(powerupmask & PDWAKEUPDATMASK); /* Update power states with required register bits */ LPC_SYSCTL->PDRUNCFG = (PDWAKEUPWRMASK | pdrun); }
/* packet-rstat.c * Stubs for Sun's remote statistics RPC service * * Guy Harris <guy@alum.mit.edu> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include "packet-rpc.h" void proto_register_rstat(void); void proto_reg_handoff_rstat(void); static int proto_rstat = -1; static int hf_rstat_procedure_v1 = -1; static int hf_rstat_procedure_v2 = -1; static int hf_rstat_procedure_v3 = -1; static int hf_rstat_procedure_v4 = -1; static gint ett_rstat = -1; #define RSTAT_PROGRAM 100001 #define RSTATPROC_NULL 0 #define RSTATPROC_STATS 1 #define RSTATPROC_HAVEDISK 2 /* proc number, "proc name", dissect_request, dissect_reply */ /* NULL as function pointer means: type of arguments is "void". */ static const vsff rstat1_proc[] = { { RSTATPROC_NULL, "NULL", NULL, NULL }, { RSTATPROC_STATS, "STATS", NULL, NULL }, { RSTATPROC_HAVEDISK, "HAVEDISK", NULL, NULL }, { 0, NULL, NULL, NULL } }; static const value_string rstat1_proc_vals[] = { { RSTATPROC_NULL, "NULL" }, { RSTATPROC_STATS, "STATS" }, { RSTATPROC_HAVEDISK, "HAVEDISK" }, { 0, NULL } }; static const vsff rstat2_proc[] = { { RSTATPROC_NULL, "NULL", NULL, NULL }, { RSTATPROC_STATS, "STATS", NULL, NULL }, { RSTATPROC_HAVEDISK, "HAVEDISK", NULL, NULL }, { 0, NULL, NULL, NULL } }; static const value_string rstat2_proc_vals[] = { { RSTATPROC_NULL, "NULL" }, { RSTATPROC_STATS, "STATS" }, { RSTATPROC_HAVEDISK, "HAVEDISK" }, { 0, NULL } }; static const vsff rstat3_proc[] = { { RSTATPROC_NULL, "NULL", NULL, NULL }, { RSTATPROC_STATS, "STATS", NULL, NULL }, { RSTATPROC_HAVEDISK, "HAVEDISK", NULL, NULL }, { 0, NULL, NULL, NULL } }; static const value_string rstat3_proc_vals[] = { { RSTATPROC_NULL, "NULL" }, { RSTATPROC_STATS, "STATS" }, { RSTATPROC_HAVEDISK, "HAVEDISK" }, { 0, NULL } }; static const vsff rstat4_proc[] = { { RSTATPROC_NULL, "NULL", NULL, NULL }, { RSTATPROC_STATS, "STATS", NULL, NULL }, { RSTATPROC_HAVEDISK, "HAVEDISK", NULL, NULL }, { 0, NULL, NULL, NULL } }; static const value_string rstat4_proc_vals[] = { { RSTATPROC_NULL, "NULL" }, { RSTATPROC_STATS, "STATS" }, { RSTATPROC_HAVEDISK, "HAVEDISK" }, { 0, NULL } }; void proto_register_rstat(void) { static hf_register_info hf[] = { { &hf_rstat_procedure_v1, { "V1 Procedure", "rstat.procedure_v1", FT_UINT32, BASE_DEC, VALS(rstat1_proc_vals), 0, NULL, HFILL }}, { &hf_rstat_procedure_v2, { "V2 Procedure", "rstat.procedure_v2", FT_UINT32, BASE_DEC, VALS(rstat2_proc_vals), 0, NULL, HFILL }}, { &hf_rstat_procedure_v3, { "V3 Procedure", "rstat.procedure_v3", FT_UINT32, BASE_DEC, VALS(rstat3_proc_vals), 0, NULL, HFILL }}, { &hf_rstat_procedure_v4, { "V4 Procedure", "rstat.procedure_v4", FT_UINT32, BASE_DEC, VALS(rstat4_proc_vals), 0, NULL, HFILL }} }; static gint *ett[] = { &ett_rstat, }; proto_rstat = proto_register_protocol("RSTAT", "RSTAT", "rstat"); proto_register_field_array(proto_rstat, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_rstat(void) { /* Register the protocol as RPC */ rpc_init_prog(proto_rstat, RSTAT_PROGRAM, ett_rstat); /* Register the procedure tables */ rpc_init_proc_table(RSTAT_PROGRAM, 1, rstat1_proc, hf_rstat_procedure_v1); rpc_init_proc_table(RSTAT_PROGRAM, 2, rstat2_proc, hf_rstat_procedure_v2); rpc_init_proc_table(RSTAT_PROGRAM, 3, rstat3_proc, hf_rstat_procedure_v3); rpc_init_proc_table(RSTAT_PROGRAM, 4, rstat4_proc, hf_rstat_procedure_v4); } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
#ifndef _ASM_X86_APICDEF_H #define _ASM_X86_APICDEF_H /* * Constants for various Intel APICs. (local APIC, IOAPIC, etc.) * * Alan Cox <Alan.Cox@linux.org>, 1995. * Ingo Molnar <mingo@redhat.com>, 1999, 2000 */ #define APIC_DEFAULT_PHYS_BASE 0xfee00000 #define APIC_ID 0x20 #define APIC_LVR 0x30 #define APIC_LVR_MASK 0xFF00FF #define GET_APIC_VERSION(x) ((x) & 0xFFu) #define GET_APIC_MAXLVT(x) (((x) >> 16) & 0xFFu) #ifdef CONFIG_X86_32 # define APIC_INTEGRATED(x) ((x) & 0xF0u) #else # define APIC_INTEGRATED(x) (1) #endif #define APIC_XAPIC(x) ((x) >= 0x14) #define APIC_TASKPRI 0x80 #define APIC_TPRI_MASK 0xFFu #define APIC_ARBPRI 0x90 #define APIC_ARBPRI_MASK 0xFFu #define APIC_PROCPRI 0xA0 #define APIC_EOI 0xB0 #define APIC_EIO_ACK 0x0 #define APIC_RRR 0xC0 #define APIC_LDR 0xD0 #define APIC_LDR_MASK (0xFFu << 24) #define GET_APIC_LOGICAL_ID(x) (((x) >> 24) & 0xFFu) #define SET_APIC_LOGICAL_ID(x) (((x) << 24)) #define APIC_ALL_CPUS 0xFFu #define APIC_DFR 0xE0 #define APIC_DFR_CLUSTER 0x0FFFFFFFul #define APIC_DFR_FLAT 0xFFFFFFFFul #define APIC_SPIV 0xF0 #define APIC_SPIV_FOCUS_DISABLED (1 << 9) #define APIC_SPIV_APIC_ENABLED (1 << 8) #define APIC_ISR 0x100 #define APIC_ISR_NR 0x8 /* Number of 32 bit ISR registers. */ #define APIC_TMR 0x180 #define APIC_IRR 0x200 #define APIC_ESR 0x280 #define APIC_ESR_SEND_CS 0x00001 #define APIC_ESR_RECV_CS 0x00002 #define APIC_ESR_SEND_ACC 0x00004 #define APIC_ESR_RECV_ACC 0x00008 #define APIC_ESR_SENDILL 0x00020 #define APIC_ESR_RECVILL 0x00040 #define APIC_ESR_ILLREGA 0x00080 #define APIC_ICR 0x300 #define APIC_DEST_SELF 0x40000 #define APIC_DEST_ALLINC 0x80000 #define APIC_DEST_ALLBUT 0xC0000 #define APIC_ICR_RR_MASK 0x30000 #define APIC_ICR_RR_INVALID 0x00000 #define APIC_ICR_RR_INPROG 0x10000 #define APIC_ICR_RR_VALID 0x20000 #define APIC_INT_LEVELTRIG 0x08000 #define APIC_INT_ASSERT 0x04000 #define APIC_ICR_BUSY 0x01000 #define APIC_DEST_LOGICAL 0x00800 #define APIC_DEST_PHYSICAL 0x00000 #define APIC_DM_FIXED 0x00000 #define APIC_DM_LOWEST 0x00100 #define APIC_DM_SMI 0x00200 #define APIC_DM_REMRD 0x00300 #define APIC_DM_NMI 0x00400 #define APIC_DM_INIT 0x00500 #define APIC_DM_STARTUP 0x00600 #define APIC_DM_EXTINT 0x00700 #define APIC_VECTOR_MASK 0x000FF #define APIC_ICR2 0x310 #define GET_APIC_DEST_FIELD(x) (((x) >> 24) & 0xFF) #define SET_APIC_DEST_FIELD(x) ((x) << 24) #define APIC_LVTT 0x320 #define APIC_LVTTHMR 0x330 #define APIC_LVTPC 0x340 #define APIC_LVT0 0x350 #define APIC_LVT_TIMER_BASE_MASK (0x3 << 18) #define GET_APIC_TIMER_BASE(x) (((x) >> 18) & 0x3) #define SET_APIC_TIMER_BASE(x) (((x) << 18)) #define APIC_TIMER_BASE_CLKIN 0x0 #define APIC_TIMER_BASE_TMBASE 0x1 #define APIC_TIMER_BASE_DIV 0x2 #define APIC_LVT_TIMER_PERIODIC (1 << 17) #define APIC_LVT_MASKED (1 << 16) #define APIC_LVT_LEVEL_TRIGGER (1 << 15) #define APIC_LVT_REMOTE_IRR (1 << 14) #define APIC_INPUT_POLARITY (1 << 13) #define APIC_SEND_PENDING (1 << 12) #define APIC_MODE_MASK 0x700 #define GET_APIC_DELIVERY_MODE(x) (((x) >> 8) & 0x7) #define SET_APIC_DELIVERY_MODE(x, y) (((x) & ~0x700) | ((y) << 8)) #define APIC_MODE_FIXED 0x0 #define APIC_MODE_NMI 0x4 #define APIC_MODE_EXTINT 0x7 #define APIC_LVT1 0x360 #define APIC_LVTERR 0x370 #define APIC_TMICT 0x380 #define APIC_TMCCT 0x390 #define APIC_TDCR 0x3E0 #define APIC_SELF_IPI 0x3F0 #define APIC_TDR_DIV_TMBASE (1 << 2) #define APIC_TDR_DIV_1 0xB #define APIC_TDR_DIV_2 0x0 #define APIC_TDR_DIV_4 0x1 #define APIC_TDR_DIV_8 0x2 #define APIC_TDR_DIV_16 0x3 #define APIC_TDR_DIV_32 0x8 #define APIC_TDR_DIV_64 0x9 #define APIC_TDR_DIV_128 0xA #define APIC_EILVT0 0x500 #define APIC_EILVT_NR_AMD_K8 1 /* # of extended interrupts */ #define APIC_EILVT_NR_AMD_10H 4 #define APIC_EILVT_LVTOFF(x) (((x) >> 4) & 0xF) #define APIC_EILVT_MSG_FIX 0x0 #define APIC_EILVT_MSG_SMI 0x2 #define APIC_EILVT_MSG_NMI 0x4 #define APIC_EILVT_MSG_EXT 0x7 #define APIC_EILVT_MASKED (1 << 16) #define APIC_EILVT1 0x510 #define APIC_EILVT2 0x520 #define APIC_EILVT3 0x530 #define APIC_BASE_MSR 0x800 #endif /* _ASM_X86_APICDEF_H */
/* * exynos_thermal.h - Samsung EXYNOS TMU (Thermal Management Unit) * * Copyright (C) 2011 Samsung Electronics * Donggeun Kim <dg77.kim@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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LINUX_EXYNOS_THERMAL_H #define _LINUX_EXYNOS_THERMAL_H #include <linux/cpu_cooling.h> enum calibration_type { TYPE_ONE_POINT_TRIMMING, TYPE_TWO_POINT_TRIMMING, TYPE_NONE, }; enum soc_type { SOC_ARCH_EXYNOS4 = 1, SOC_ARCH_EXYNOS5, }; /** * struct exynos_tmu_platform_data * @threshold: basic temperature for generating interrupt * 25 <= threshold <= 125 [unit: degree Celsius] * @trigger_levels: array for each interrupt levels * [unit: degree Celsius] * 0: temperature for trigger_level0 interrupt * condition for trigger_level0 interrupt: * current temperature > threshold + trigger_levels[0] * 1: temperature for trigger_level1 interrupt * condition for trigger_level1 interrupt: * current temperature > threshold + trigger_levels[1] * 2: temperature for trigger_level2 interrupt * condition for trigger_level2 interrupt: * current temperature > threshold + trigger_levels[2] * 3: temperature for trigger_level3 interrupt * condition for trigger_level3 interrupt: * current temperature > threshold + trigger_levels[3] * @trigger_level0_en: * 1 = enable trigger_level0 interrupt, * 0 = disable trigger_level0 interrupt * @trigger_level1_en: * 1 = enable trigger_level1 interrupt, * 0 = disable trigger_level1 interrupt * @trigger_level2_en: * 1 = enable trigger_level2 interrupt, * 0 = disable trigger_level2 interrupt * @trigger_level3_en: * 1 = enable trigger_level3 interrupt, * 0 = disable trigger_level3 interrupt * @gain: gain of amplifier in the positive-TC generator block * 0 <= gain <= 15 * @reference_voltage: reference voltage of amplifier * in the positive-TC generator block * 0 <= reference_voltage <= 31 * @noise_cancel_mode: noise cancellation mode * 000, 100, 101, 110 and 111 can be different modes * @type: determines the type of SOC * @efuse_value: platform defined fuse value * @cal_type: calibration type for temperature * @freq_clip_table: Table representing frequency reduction percentage. * @freq_tab_count: Count of the above table as frequency reduction may * applicable to only some of the trigger levels. * * This structure is required for configuration of exynos_tmu driver. */ struct exynos_tmu_platform_data { u8 threshold; u8 trigger_levels[4]; bool trigger_level0_en; bool trigger_level1_en; bool trigger_level2_en; bool trigger_level3_en; char clk_name[100]; u8 gain; u8 reference_voltage; u8 noise_cancel_mode; u32 efuse_value; enum calibration_type cal_type; enum soc_type type; struct freq_clip_table freq_tab[8]; struct freq_clip_table freq_tab_kfc[8]; int size[THERMAL_TRIP_CRITICAL + 1]; unsigned int freq_tab_count; }; #endif /* _LINUX_EXYNOS_THERMAL_H */
/* Unix SMB/CIFS implementation. replacement routines for broken systems Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "includes.h" void replace1_dummy(void); void replace1_dummy(void) {} #ifndef HAVE_SETENV int setenv(const char *name, const char *value, int overwrite) { char *p = NULL; int ret = -1; asprintf(&p, "%s=%s", name, value); if (overwrite || getenv(name)) { if (p) ret = putenv(p); } else { ret = 0; } return ret; } #endif
/* input.h - Interface to the input component of a virtual console. Copyright (C) 2002 Free Software Foundation, Inc. Written by Marcus Brinkmann. This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The GNU Hurd 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, USA. */ #ifndef INPUT_H #define INPUT_H #include <errno.h> struct input; typedef struct input *input_t; /* Create a new virtual console input queue, with the system encoding being ENCODING. */ error_t input_create (input_t *r_input, const char *encoding); /* Destroy the input queue INPUT. */ void input_destroy (input_t input); /* Enter DATALEN characters from the buffer DATA into the input queue INPUT. The DATA must be supplied in UTF-8 encoding (XXX UCS-4 would be nice, too, but it requires knowledge of endianness). The function returns the amount of bytes written (might be smaller than DATALEN) or -1 and the error number in errno. If NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK if operation would block for a long time. */ ssize_t input_enqueue (input_t input, int nonblock, char *data, size_t datalen); /* Remove DATALEN characters from the input queue and put them in the buffer DATA. The data will be supplied in the local encoding. The function returns the amount of bytes removed (might be smaller than DATALEN) or -1 and the error number in errno. If NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK if operation would block for a long time. */ ssize_t input_dequeue (input_t input, int nonblock, char *data, size_t datalen); /* Flush the input buffer, discarding all pending data. */ void input_flush (input_t input); #endif /* INPUT_H */
/* <!-- copyright */ /* * aria2 - The high speed download utility * * Copyright (C) 2006 Tatsuhiro Tsujikawa * * 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 * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. */ /* copyright --> */ #ifndef D_TIMED_HALT_COMMAND_H #define D_TIMED_HALT_COMMAND_H #include "TimeBasedCommand.h" namespace aria2 { class TimedHaltCommand:public TimeBasedCommand { private: bool forceHalt_; public: TimedHaltCommand(cuid_t cuid, DownloadEngine* e, std::chrono::seconds secondsToHalt, bool forceHalt = false); virtual ~TimedHaltCommand(); virtual void preProcess() CXX11_OVERRIDE; virtual void process() CXX11_OVERRIDE; }; } // namespace aria2 #endif // D_TIMED_HALT_COMMAND_H
/* * Copyright 2009 Marco Martin <notmart@gmail.com> * * This program 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, 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 Library 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 PLASMA_ASSOCIATEDAPPLICATIONMANAGER_P_H #define PLASMA_ASSOCIATEDAPPLICATIONMANAGER_P_H #include <QObject> #include <kurl.h> namespace Plasma { class Applet; class AssociatedApplicationManagerPrivate; class AssociatedApplicationManager : public QObject { Q_OBJECT public: static AssociatedApplicationManager *self(); //set an application name for an applet void setApplication(Plasma::Applet *applet, const QString &application); //returns the application name associated to an applet QString application(const Plasma::Applet *applet) const; //sets the urls associated to an applet void setUrls(Plasma::Applet *applet, const KUrl::List &urls); //returns the urls associated to an applet KUrl::List urls(const Plasma::Applet *applet) const; //run the associated application or the urls if no app is associated void run(Plasma::Applet *applet); //returns true if the applet has a valid associated application or urls bool appletHasValidAssociatedApplication(const Plasma::Applet *applet) const; private: AssociatedApplicationManager(QObject *parent = 0); ~AssociatedApplicationManager(); AssociatedApplicationManagerPrivate *const d; friend class AssociatedApplicationManagerSingleton; Q_PRIVATE_SLOT(d, void cleanupApplet(QObject *obj)) }; } // namespace Plasma #endif // multiple inclusion guard
#ifndef included_main_version_h #define included_main_version_h /*****************************************************************************/ /* */ /* Copyright (c) 1990-2001 Morgan Stanley Dean Witter & Co. All rights reserved. */ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ /* external macro declarations */ #define RELEASE_CODE "4.22" #define OWNER_FULLNAME "" #define IMDIR "/usr/local" #endif /* included_main_version_h */
// directory.h // Data structures to manage a UNIX-like directory of file names. // // A directory is a table of pairs: <file name, sector #>, // giving the name of each file in the directory, and // where to find its file header (the data structure describing // where to find the file's data blocks) on disk. // // We assume mutual exclusion is provided by the caller. // // Copyright (c) 1992-1993 The Regents of the University of California. // All rights reserved. See copyright.h for copyright notice and limitation // of liability and disclaimer of warranty provisions. #include "copyright.h" #ifndef DIRECTORY_H #define DIRECTORY_H #include "openfile.h" #define FileNameMaxLen 9 // for simplicity, we assume // file names are <= 9 characters long // The following class defines a "directory entry", representing a file // in the directory. Each entry gives the name of the file, and where // the file's header is to be found on disk. // // Internal data structures kept public so that Directory operations can // access them directly. class DirectoryEntry { public: bool inUse; // Is this directory entry in use? int sector; // Location on disk to find the // FileHeader for this file char name[FileNameMaxLen + 1]; // Text name for file, with +1 for // the trailing '\0' }; // The following class defines a UNIX-like "directory". Each entry in // the directory describes a file, and where to find it on disk. // // The directory data structure can be stored in memory, or on disk. // When it is on disk, it is stored as a regular Nachos file. // // The constructor initializes a directory structure in memory; the // FetchFrom/WriteBack operations shuffle the directory information // from/to disk. class Directory { public: Directory(int size); // Initialize an empty directory // with space for "size" files ~Directory(); // De-allocate the directory void FetchFrom(OpenFile *file); // Init directory contents from disk void WriteBack(OpenFile *file); // Write modifications to // directory contents back to disk int Find(char *name); // Find the sector number of the // FileHeader for file: "name" bool Add(char *name, int newSector); // Add a file name into the directory bool Remove(char *name); // Remove a file from the directory void List(); // Print the names of all the files // in the directory void Print(); // Verbose print of the contents // of the directory -- all the file // names and their contents. private: int tableSize; // Number of directory entries DirectoryEntry *table; // Table of pairs: // <file name, file header location> int FindIndex(char *name); // Find the index into the directory // table corresponding to "name" }; #endif // DIRECTORY_H
/* $Id$ */ /** @file * VBox OpenGL list of opengl functions common in Mesa and vbox opengl stub */ /* * Copyright (C) 2009-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ #ifndef GLXAPI_ENTRY #error GLXAPI_ENTRY should be defined. #endif /*This should match glX* entries which are exported by Mesa's libGL.so, * use something like the following to get the list: * objdump -T libGL.so|grep glX|grep -v __|awk '{print $7;};'|sed 's/glX//'|awk '{OFS=""; print "GLXAPI_ENTRY(",$1,")"}' */ /* #######Note: if you change the list, don't forget to change Linux_i386_glxapi_exports.py####### */ GLXAPI_ENTRY(CopyContext) GLXAPI_ENTRY(UseXFont) /*GLXAPI_ENTRY(GetDriverConfig)*/ GLXAPI_ENTRY(GetProcAddress) GLXAPI_ENTRY(QueryExtension) GLXAPI_ENTRY(IsDirect) GLXAPI_ENTRY(DestroyGLXPbufferSGIX) GLXAPI_ENTRY(QueryGLXPbufferSGIX) GLXAPI_ENTRY(CreateGLXPixmap) GLXAPI_ENTRY(CreateGLXPixmapWithConfigSGIX) GLXAPI_ENTRY(QueryContext) GLXAPI_ENTRY(CreateContextWithConfigSGIX) GLXAPI_ENTRY(SwapBuffers) GLXAPI_ENTRY(CreateNewContext) GLXAPI_ENTRY(SelectEventSGIX) GLXAPI_ENTRY(GetCurrentDrawable) GLXAPI_ENTRY(ChooseFBConfig) GLXAPI_ENTRY(WaitGL) GLXAPI_ENTRY(GetFBConfigs) GLXAPI_ENTRY(CreatePixmap) GLXAPI_ENTRY(GetSelectedEventSGIX) GLXAPI_ENTRY(GetCurrentReadDrawable) GLXAPI_ENTRY(GetCurrentDisplay) GLXAPI_ENTRY(QueryServerString) GLXAPI_ENTRY(CreateWindow) GLXAPI_ENTRY(SelectEvent) GLXAPI_ENTRY(GetVisualFromFBConfigSGIX) GLXAPI_ENTRY(GetFBConfigFromVisualSGIX) GLXAPI_ENTRY(QueryDrawable) GLXAPI_ENTRY(CreateContext) GLXAPI_ENTRY(GetConfig) GLXAPI_ENTRY(CreateGLXPbufferSGIX) GLXAPI_ENTRY(CreatePbuffer) GLXAPI_ENTRY(ChooseFBConfigSGIX) GLXAPI_ENTRY(WaitX) GLXAPI_ENTRY(GetVisualFromFBConfig) /*GLXAPI_ENTRY(GetScreenDriver)*/ GLXAPI_ENTRY(GetFBConfigAttrib) GLXAPI_ENTRY(GetCurrentContext) GLXAPI_ENTRY(GetClientString) GLXAPI_ENTRY(DestroyPixmap) GLXAPI_ENTRY(MakeCurrent) GLXAPI_ENTRY(DestroyContext) GLXAPI_ENTRY(GetProcAddressARB) GLXAPI_ENTRY(GetSelectedEvent) GLXAPI_ENTRY(DestroyPbuffer) GLXAPI_ENTRY(DestroyWindow) GLXAPI_ENTRY(DestroyGLXPixmap) GLXAPI_ENTRY(QueryVersion) GLXAPI_ENTRY(ChooseVisual) GLXAPI_ENTRY(MakeContextCurrent) GLXAPI_ENTRY(QueryExtensionsString) GLXAPI_ENTRY(GetFBConfigAttribSGIX) #ifdef VBOXOGL_FAKEDRI GLXAPI_ENTRY(FreeMemoryMESA) GLXAPI_ENTRY(QueryContextInfoEXT) GLXAPI_ENTRY(ImportContextEXT) GLXAPI_ENTRY(GetContextIDEXT) GLXAPI_ENTRY(MakeCurrentReadSGI) GLXAPI_ENTRY(AllocateMemoryMESA) GLXAPI_ENTRY(GetMemoryOffsetMESA) GLXAPI_ENTRY(CreateGLXPixmapMESA) GLXAPI_ENTRY(GetCurrentDisplayEXT) GLXAPI_ENTRY(FreeContextEXT) #endif
// Project64 - A Nintendo 64 emulator // https://www.pj64-emu.com/ // Copyright(C) 2001-2021 Project64 // Copyright(C) 2000-2015 Azimer // GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once #include <Common/SyncEvent.h> #include <Common/CriticalSection.h> class SoundDriverBase { public: SoundDriverBase(); void AI_SetFrequency(uint32_t Frequency, uint32_t BufferSize); void AI_LenChanged(uint8_t *start, uint32_t length); void AI_Startup(); void AI_Shutdown(); void AI_Update(bool Wait); uint32_t AI_ReadLength(); virtual void SetFrequency(uint32_t Frequency, uint32_t BufferSize); virtual void StartAudio(); virtual void StopAudio(); protected: enum { MAX_SIZE = 48000 * 2 * 2 }; // Max buffer size (44100Hz * 16-bit * stereo) virtual bool Initialize(); void LoadAiBuffer(uint8_t *start, uint32_t length); // Reads in length amount of audio bytes uint32_t m_MaxBufferSize; // Variable size determined by playback rate CriticalSection m_CS; private: void BufferAudio(); SyncEvent m_AiUpdateEvent; uint8_t *m_AI_DMAPrimaryBuffer, *m_AI_DMASecondaryBuffer; uint32_t m_AI_DMAPrimaryBytes, m_AI_DMASecondaryBytes; uint32_t m_BufferRemaining; // Buffer remaining uint32_t m_CurrentReadLoc; // Currently playing buffer uint32_t m_CurrentWriteLoc; // Currently writing buffer uint8_t m_Buffer[MAX_SIZE]; // Emulated buffers };
#ifndef __ARM_ARCH_DEV_HAWII_LOGANDS_NFC_H #define __ARM_ARCH_DEV_HAWII_LOGANDS_NFC_H void __init hawaii_nfc_init(void); #endif
/* Copyright (C) 1999-2008 by Mark D. Hill and David A. Wood for the Wisconsin Multifacet Project. Contact: gems@cs.wisc.edu http://www.cs.wisc.edu/gems/ -------------------------------------------------------------------- This file is part of the Opal Timing-First Microarchitectural Simulator, a component of the Multifacet GEMS (General Execution-driven Multiprocessor Simulator) software toolset originally developed at the University of Wisconsin-Madison. Opal was originally developed by Carl Mauer based upon code by Craig Zilles. Substantial further development of Multifacet GEMS at the University of Wisconsin was performed by Alaa Alameldeen, Brad Beckmann, Jayaram Bobba, Ross Dickson, Dan Gibson, Pacia Harper, Derek Hower, Milo Martin, Michael Marty, Carl Mauer, Michelle Moravan, Kevin Moore, Andrew Phelps, Manoj Plakal, Daniel Sorin, Haris Volos, Min Xu, and Luke Yen. -------------------------------------------------------------------- If your use of this software contributes to a published paper, we request that you (1) cite our summary paper that appears on our website (http://www.cs.wisc.edu/gems/) and (2) e-mail a citation for your published paper to gems@cs.wisc.edu. If you redistribute derivatives of this software, we request that you notify us and either (1) ask people to register with us at our website (http://www.cs.wisc.edu/gems/) or (2) collect registration information and periodically send it to us. -------------------------------------------------------------------- Multifacet GEMS is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. Multifacet GEMS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Multifacet GEMS; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA The GNU General Public License is contained in the file LICENSE. ### END HEADER ### */ #ifndef CS752_CACHE_H #define CS752_CACHE_H #include <iostream.h> #include <sys/types.h> #include "Types.h" #include "CacheEntry.h" // #define CACHE_SIZE 0x800000 // #define CACHE_LINE_SIZE 0x40 // #define CACHE_ASSOCIATIVITY 1 // #define CACHE_NUM_LINES CACHE_SIZE/(CACHE_LINE_SIZE*CACHE_ASSOCIATIVITY) class Cache { public: Cache(uint64_t cacheSize, int cacheAss, int lineSize); // address accessors Address getTag(Address a); Address getIndex(Address a); Address getOffset(Address a); int getNumLines( void ); bool isHit(Address a, CacheEntry * &matchedEntry); void updateLRUStatus(Address mostRecentAddress); void load(Address newPhysicalAddress, Address newLoadingPC, CacheEntry &victimEntry); void load(Address newPhysicalAddress, Address newLoadingPC, CacheEntry &victimEntry, int ReadOrWrite, bool isData); void dump(void); protected: void updateLRUStatus(Address index, int entryOffset); int findLRUIndex( Address index ); int getLog2(uint64_t num); uint64_t getMask(uint64_t numBits); CacheEntry **lines; uint64_t m_tagBits; uint64_t m_indexBits; uint64_t m_offsetBits; uint64_t m_tagMask; uint64_t m_indexMask; uint64_t m_offsetMask; int m_cacheAss; int m_lineSize; int m_cacheSize; int m_numLines; }; #endif
/* OS/2 compatibility functions. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program 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, 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #define OS2_AWARE #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> #include <string.h> /* A version of getenv() that works from DLLs */ extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); char * _nl_getenv (const char *name) { unsigned char *value; if (DosScanEnv (name, &value)) return NULL; else return value; } char _nl_default_dirname[] = /* a 260+1 bytes large buffer */ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0" #define LOCALEDIR_MAX 260 char *_os2_libdir = NULL; char *_os2_localealiaspath = NULL; char *_os2_localedir = NULL; static __attribute__((constructor)) void os2_initialize () { char *root = getenv ("UNIXROOT"); char *gnulocaledir = getenv ("GNULOCALEDIR"); _os2_libdir = gnulocaledir; if (!_os2_libdir) { if (root) { size_t sl = strlen (root); _os2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); memcpy (_os2_libdir, root, sl); memcpy (_os2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); } else _os2_libdir = LIBDIR; } _os2_localealiaspath = gnulocaledir; if (!_os2_localealiaspath) { if (root) { size_t sl = strlen (root); _os2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); memcpy (_os2_localealiaspath, root, sl); memcpy (_os2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); } else _os2_localealiaspath = LOCALE_ALIAS_PATH; } _os2_localedir = gnulocaledir; if (!_os2_localedir) { if (root) { size_t sl = strlen (root); _os2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); memcpy (_os2_localedir, root, sl); memcpy (_os2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); } else _os2_localedir = LOCALEDIR; } { extern const char _nl_default_dirname__[]; if (strlen (_os2_localedir) <= LOCALEDIR_MAX) strcpy (_nl_default_dirname__, _os2_localedir); } }
/* Kernel module to match ESP parameters. */ /* (C) 2001-2002 Andras Kis-Szabo <kisza@sch.bme.hu> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/skbuff.h> #include <linux/ipv6.h> #include <linux/types.h> #include <net/checksum.h> #include <net/ipv6.h> #include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter_ipv6/ip6t_esp.h> MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("IPv6 ESP match"); MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); #if 0 #define DEBUGP printk #else #define DEBUGP(format, args...) #endif /* Returns 1 if the spi is matched by the range, 0 otherwise */ static inline int spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, int invert) { int r=0; DEBUGP("esp spi_match:%c 0x%x <= 0x%x <= 0x%x",invert? '!':' ', min,spi,max); r=(spi >= min && spi <= max) ^ invert; DEBUGP(" result %s\n",r? "PASS\n" : "FAILED\n"); return r; } static int match(const struct sk_buff *skb, const struct net_device *in, const struct net_device *out, const void *matchinfo, int offset, unsigned int protoff, int *hotdrop) { struct ip_esp_hdr _esp, *eh; const struct ip6t_esp *espinfo = matchinfo; unsigned int ptr; /* Make sure this isn't an evil packet */ /*DEBUGP("ipv6_esp entered \n");*/ if (ipv6_find_hdr(skb, &ptr, NEXTHDR_ESP) < 0) return 0; eh = skb_header_pointer(skb, ptr, sizeof(_esp), &_esp); if (eh == NULL) { *hotdrop = 1; return 0; } DEBUGP("IPv6 ESP SPI %u %08X\n", ntohl(eh->spi), ntohl(eh->spi)); return (eh != NULL) && spi_match(espinfo->spis[0], espinfo->spis[1], ntohl(eh->spi), !!(espinfo->invflags & IP6T_ESP_INV_SPI)); } /* Called when user tries to insert an entry of this type. */ static int checkentry(const char *tablename, const struct ip6t_ip6 *ip, void *matchinfo, unsigned int matchinfosize, unsigned int hook_mask) { const struct ip6t_esp *espinfo = matchinfo; if (matchinfosize != IP6T_ALIGN(sizeof(struct ip6t_esp))) { DEBUGP("ip6t_esp: matchsize %u != %u\n", matchinfosize, IP6T_ALIGN(sizeof(struct ip6t_esp))); return 0; } if (espinfo->invflags & ~IP6T_ESP_INV_MASK) { DEBUGP("ip6t_esp: unknown flags %X\n", espinfo->invflags); return 0; } return 1; } static struct ip6t_match esp_match = { .name = "esp", .match = &match, .checkentry = &checkentry, .me = THIS_MODULE, }; static int __init init(void) { return ip6t_register_match(&esp_match); } static void __exit cleanup(void) { ip6t_unregister_match(&esp_match); } module_init(init); module_exit(cleanup);
/* * Copyright (C) 2015 Ewoud Smeur <ewoud.smeur@gmail.com> * * This file is part of paparazzi. * * paparazzi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * paparazzi 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 paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /** * @file firmwares/rotorcraft/guidance/guidance_indi.h * * A guidance mode based on Incremental Nonlinear Dynamic Inversion * Come to ICRA2016 to learn more! * */ #ifndef GUIDANCE_INDI_H #define GUIDANCE_INDI_H #include "std.h" #include "math/pprz_algebra_int.h" #include "math/pprz_algebra_float.h" extern void guidance_indi_enter(void); extern void guidance_indi_run(bool in_flight, int32_t heading); extern void stabilization_attitude_set_setpoint_rp_quat_f(struct FloatEulers* indi_rp_cmd, bool in_flight, int32_t heading); extern float guidance_indi_thrust_specific_force_gain; extern struct FloatVect3 euler_cmd; #endif /* GUIDANCE_INDI_H */
/* * linux/drivers/video/mmp/fb/vsync_notify.c * vsync driver support * * Copyright (C) 2013 Marvell Technology Group Ltd. * Authors: Yu Xu <yuxu@marvell.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, see <http://www.gnu.org/licenses/>. * */ #include "mmpfb.h" #include <video/mmp_trace.h> void mmpfb_wait_vsync(struct mmpfb_info *fbi) { dev_dbg(fbi->dev, "wait vsync: vcnt %d, irq_en_ref: %d\n", atomic_read(&fbi->vsync.vcnt), atomic_read(&fbi->path->irq_en_ref)); /* * for N buffer cases, * #1- (N-2) buffers passed in one frame: * no need to wait vsync * #N-1 buffer need to wait vsync * e.g, for two buffer case, always wait * for three buffer, only 2nd buffer need wait * * If vcnt is 0, we can't decrease it. */ if (atomic_read(&fbi->vsync.vcnt)) if (!atomic_dec_and_test(&fbi->vsync.vcnt)) return; mmp_wait_vsync(&fbi->path->vsync); } static void mmpfb_vcnt_clean(struct mmpfb_info *fbi) { atomic_set(&fbi->vsync.vcnt, fbi->buffer_num - 1); } /* Get time stamp of vsync */ static ssize_t mmpfb_vsync_ts_show(struct device *dev, struct device_attribute *attr, char *buf) { struct mmpfb_info *fbi = dev_get_drvdata(dev); return sprintf(buf, "%llx\n", fbi->vsync.ts_nano); } DEVICE_ATTR(vsync_ts, S_IRUGO, mmpfb_vsync_ts_show, NULL); static ssize_t mmpfb_vsync_show(struct device *dev, struct device_attribute *attr, char *buf) { struct mmpfb_info *fbi = dev_get_drvdata(dev); int s = 0; s += sprintf(buf + s, "%s vsync uevent report\n", fbi->vsync.en ? "enable" : "disable"); return s; } static ssize_t mmpfb_vsync_store( struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { struct mmpfb_info *fbi = dev_get_drvdata(dev); if (sysfs_streq(buf, "u1")) { fbi->vsync.en = 1; mmp_path_set_irq(fbi->path, 1); } else if (sysfs_streq(buf, "u0")) { fbi->vsync.en = 0; mmp_path_set_irq(fbi->path, 0); } else { dev_dbg(fbi->dev, "invalid input, please echo as follow:\n"); dev_dbg(fbi->dev, "\tu1: enable vsync uevent\n"); dev_dbg(fbi->dev, "\tu0: disable vsync uevent\n"); } trace_vsync(fbi->vsync.en); dev_dbg(fbi->dev, "vsync_en = %d\n", fbi->vsync.en); return size; } DEVICE_ATTR(vsync, S_IRUGO | S_IWUSR, mmpfb_vsync_show, mmpfb_vsync_store); static void mmpfb_overlay_vsync_cb(void *data) { struct mmpfb_info *fbi = (struct mmpfb_info *)data; if (fbi) queue_work(fbi->vsync.wq, &fbi->vsync.fence_work); } static void mmpfb_vsync_cb(void *data) { struct timespec vsync_time; struct mmpfb_info *fbi = (struct mmpfb_info *)data; /* in vsync callback */ mmpfb_vcnt_clean(fbi); /* Get time stamp of vsync */ ktime_get_ts(&vsync_time); fbi->vsync.ts_nano = ((uint64_t)vsync_time.tv_sec) * 1000 * 1000 * 1000 + ((uint64_t)vsync_time.tv_nsec); if (atomic_read(&fbi->op_count)) { queue_work(fbi->vsync.wq, &fbi->vsync.work); queue_work(fbi->vsync.wq, &fbi->vsync.fence_work); } } static void mmpfb_vsync_notify_work(struct work_struct *work) { struct mmpfb_vsync *vsync = container_of(work, struct mmpfb_vsync, work); struct mmpfb_info *fbi = container_of(vsync, struct mmpfb_info, vsync); sysfs_notify(&fbi->dev->kobj, NULL, "vsync_ts"); } int mmpfb_overlay_vsync_notify_init(struct mmpfb_info *fbi) { int ret = 0; struct mmp_vsync_notifier_node *notifier_node; notifier_node = &fbi->vsync.notifier_node; fbi->vsync.wq = alloc_workqueue(fbi->name, WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM, 1); if (!fbi->vsync.wq) { dev_err(fbi->dev, "alloc_workqueue failed\n"); return ret; } INIT_WORK(&fbi->vsync.fence_work, mmpfb_overlay_fence_work); notifier_node->cb_notify = mmpfb_overlay_vsync_cb; notifier_node->cb_data = (void *)fbi; mmp_register_vsync_cb(&fbi->path->vsync, notifier_node); return ret; } int mmpfb_vsync_notify_init(struct mmpfb_info *fbi) { int ret = 0; struct mmp_vsync_notifier_node *notifier_node; notifier_node = &fbi->vsync.notifier_node; ret = device_create_file(fbi->dev, &dev_attr_vsync); if (ret < 0) { dev_err(fbi->dev, "device attr create fail: %d\n", ret); return ret; } ret = device_create_file(fbi->dev, &dev_attr_vsync_ts); if (ret < 0) { dev_err(fbi->dev, "device attr create fail: %d\n", ret); return ret; } fbi->vsync.wq = alloc_workqueue(fbi->name, WQ_HIGHPRI | WQ_UNBOUND | WQ_MEM_RECLAIM, 1); if (!fbi->vsync.wq) { dev_err(fbi->dev, "alloc_workqueue failed\n"); return ret; } INIT_WORK(&fbi->vsync.work, mmpfb_vsync_notify_work); INIT_WORK(&fbi->vsync.fence_work, mmpfb_overlay_fence_work); notifier_node->cb_notify = mmpfb_vsync_cb; notifier_node->cb_data = (void *)fbi; mmp_register_vsync_cb(&fbi->path->vsync, notifier_node); mmpfb_vcnt_clean(fbi); return ret; } void mmpfb_vsync_notify_deinit(struct mmpfb_info *fbi) { mmp_unregister_vsync_cb(&fbi->vsync.notifier_node); device_remove_file(fbi->dev, &dev_attr_vsync_ts); destroy_workqueue(fbi->vsync.wq); }
#ifndef ASEMANAUDIORECORDER_H #define ASEMANAUDIORECORDER_H #include <QObject> #include <QUrl> #include <QMediaRecorder> #include <QStringList> class AsemanAudioEncoderSettings; class AsemanAudioRecorderPrivate; class AsemanAudioRecorder : public QObject { Q_OBJECT Q_ENUMS(State) Q_ENUMS(Status) Q_PROPERTY(AsemanAudioEncoderSettings* encoderSettings READ encoderSettings WRITE setEncoderSettings NOTIFY encoderSettingsChanged) Q_PROPERTY(QUrl output READ output WRITE setOutput NOTIFY outputChanged) Q_PROPERTY(bool mute READ mute WRITE setMute NOTIFY muteChanged) Q_PROPERTY(bool available READ available NOTIFY availableChanged) Q_PROPERTY(int availability READ availability NOTIFY availabilityChanged) Q_PROPERTY(int state READ state NOTIFY stateChanged) Q_PROPERTY(int status READ status NOTIFY statusChanged) Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged) Q_PROPERTY(QString audioInput READ audioInput WRITE setAudioInput NOTIFY audioInputChanged) Q_PROPERTY(QStringList audioInputs READ audioInputs NOTIFY audioInputsChanged) public: enum State { StoppedState = QMediaRecorder::StoppedState, RecordingState = QMediaRecorder::RecordingState, PausedState = QMediaRecorder::PausedState }; enum Status { UnavailableStatus = QMediaRecorder::UnavailableStatus, UnloadedStatus = QMediaRecorder::UnloadedStatus, LoadingStatus = QMediaRecorder::LoadingStatus, LoadedStatus = QMediaRecorder::LoadedStatus, StartingStatus = QMediaRecorder::StartingStatus, RecordingStatus = QMediaRecorder::RecordingStatus, PausedStatus = QMediaRecorder::PausedStatus, FinalizingStatus = QMediaRecorder::FinalizingStatus }; AsemanAudioRecorder(QObject *parent = 0); ~AsemanAudioRecorder(); AsemanAudioEncoderSettings *encoderSettings() const; void setEncoderSettings(AsemanAudioEncoderSettings *settings); void setOutput(const QUrl &url); QUrl output() const; bool mute() const; void setMute(bool stt); qreal volume() const; void setVolume(qreal vol); void setAudioInput(const QString &input); QString audioInput() const; QStringList audioInputs() const; bool available() const; int availability() const; int state() const; int status() const; public slots: void stop(); void pause(); void record(); signals: void encoderSettingsChanged(); void outputChanged(); void muteChanged(); void volumeChanged(); void availableChanged(); void availabilityChanged(); void stateChanged(); void statusChanged(); void audioInputChanged(); void audioInputsChanged(); private: AsemanAudioRecorderPrivate *p; }; #endif // ASEMANAUDIORECORDER_H
/** * Copyright (c) 2006-2011 LOVE Development Team * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. **/ #ifndef LOVE_GRAPHICS_COLOR_H #define LOVE_GRAPHICS_COLOR_H namespace love { namespace graphics { template <typename T> struct ColorT { T r; T g; T b; T a; ColorT() : r(0), g(0), b(0), a(0) {} ColorT(T r_, T g_, T b_, T a_) : r(r_), g(g_), b(b_), a(a_) {} void set(T r_, T g_, T b_, T a_) { r = r_; g = g_; b = b_; a = a_; } ColorT<T> operator+=(const ColorT<T> &other); ColorT<T> operator*=(T s); ColorT<T> operator/=(T s); }; template <typename T> ColorT<T> ColorT<T>::operator+=(const ColorT<T> &other) { r += other.r; g += other.g; b += other.b; a += other.a; return *this; } template <typename T> ColorT<T> ColorT<T>::operator*=(T s) { r *= s; g *= s; b *= s; a *= s; return *this; } template <typename T> ColorT<T> ColorT<T>::operator/=(T s) { r /= s; g /= s; b /= s; a /= s; return *this; } template <typename T> ColorT<T> operator+(const ColorT<T> &a, const ColorT<T> &b) { ColorT<T> tmp(a); return tmp += b; } template <typename T> ColorT<T> operator*(const ColorT<T> &a, T s) { ColorT<T> tmp(a); return tmp *= s; } template <typename T> ColorT<T> operator/(const ColorT<T> &a, T s) { ColorT<T> tmp(a); return tmp /= s; } typedef ColorT<unsigned char> Color; typedef ColorT<float> Colorf; } // graphics } // love #endif // LOVE_GRAPHICS_COLOR_H
// Berkeley Open Infrastructure for Network Computing // http://boinc.berkeley.edu // Copyright (C) 2005 University of California // // This is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; // either version 2.1 of the License, or (at your option) any later version. // // This software 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. // // To view the GNU Lesser General Public License visit // http://www.gnu.org/copyleft/lesser.html // or write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef _CAHIDEBOINCMASTERPROFILE_H_ #define _CAHIDEBOINCMASTERPROFILE_H_ class CAHideBOINCMasterProfile : public BOINCCABase { public: CAHideBOINCMasterProfile(MSIHANDLE hMSIHandle); ~CAHideBOINCMasterProfile(); virtual UINT OnExecution(); }; #endif
/** * @file iqthread.c * @brief thread to receive iq samples * @author John Melton, G0ORX/N6LYT * @version 0.1 * @date 2009-10-13 */ /* Copyright (C) * 2009 - John Melton, G0ORX/N6LYT * 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 <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #include <arpa/inet.h> #include <pthread.h> #include "iqthread.h" #define SMALL_PACKETS static int iq_socket; static struct sockaddr_in iq_addr; static int iq_length; static pthread_t iq_thread_id; static void (*iq_callback)(void *); void* iq_thread(void* arg); void init_iq_thread(int rx) { iq_length=sizeof(iq_addr); iq_socket=socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP); if(iq_socket<0) { perror("create iq socket failed"); exit(1); } memset(&iq_addr,0,iq_length); iq_addr.sin_family=AF_INET; iq_addr.sin_addr.s_addr=htonl(INADDR_ANY); iq_addr.sin_port=htons(IQPORT+rx); if(bind(iq_socket,(struct sockaddr*)&iq_addr,iq_length)<0) { perror("bind socket failed for iq socket"); exit(1); } } int get_iq_port() { return ntohs(iq_addr.sin_port); } void start_iq_thread( void(*callback)(void *)) { iq_callback=callback; if(pthread_create(&iq_thread_id,NULL,iq_thread,NULL)<0) { perror("pthread_create failed for iq_thread"); exit(1); } } void* iq_thread(void* arg) { struct sockaddr_in server_addr; int server_length; int bytes; char buffer[1024*4*2]; BUFFER small_buffer; unsigned long sequence=0L; unsigned short offset=0;; unsigned short length; fprintf(stderr,"iq_thread: listening on port %d\n",ntohs(iq_addr.sin_port)); #ifdef SMALL_PACKETS fprintf(stderr,"SMALL_PACKETS defined\n"); #endif while(1) { #ifdef SMALL_PACKETS while(1) { bytes=recvfrom(iq_socket,(char*)&small_buffer,sizeof(small_buffer),0,(struct sockaddr*)&server_addr,&server_length); if(bytes<0) { perror("recvfrom socket failed for spectrum buffer"); exit(1); } if(small_buffer.offset==0) { offset=0; sequence=small_buffer.sequence; // start of a frame memcpy((char *)&buffer[small_buffer.offset],(char *)&small_buffer.data[0],small_buffer.length); offset+=small_buffer.length; } else { if((sequence==small_buffer.sequence) && (offset==small_buffer.offset)) { memcpy((char *)&buffer[small_buffer.offset],(char *)&small_buffer.data[0],small_buffer.length); offset+=small_buffer.length; if(offset==sizeof(buffer)) { offset=0; break; } } else { } } } #else bytes=recvfrom(iq_socket,(char*)buffer,sizeof(buffer),0,(struct sockaddr*)&server_addr,&server_length); if(bytes<0) { perror("recvfrom failed for iq buffer"); exit(1); } #endif // process the I/Q samples iq_callback(buffer); } }
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #if !defined( WRECTH ) #define WRECTH typedef struct rect_s { int left, right, top, bottom; } wrect_t; #endif
/* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cmsis.h" #include "platform/mbed_semihost_api.h" #include <stdint.h> #include <string.h> #if DEVICE_SEMIHOST // ARM Semihosting Commands #define SYS_OPEN (0x1) #define SYS_CLOSE (0x2) #define SYS_WRITE (0x5) #define SYS_READ (0x6) #define SYS_ISTTY (0x9) #define SYS_SEEK (0xa) #define SYS_ENSURE (0xb) #define SYS_FLEN (0xc) #define SYS_REMOVE (0xe) #define SYS_RENAME (0xf) #define SYS_EXIT (0x18) // mbed Semihosting Commands #define RESERVED_FOR_USER_APPLICATIONS (0x100) // 0x100 - 0x1ff #define USR_XFFIND (RESERVED_FOR_USER_APPLICATIONS + 0) #define USR_UID (RESERVED_FOR_USER_APPLICATIONS + 1) #define USR_RESET (RESERVED_FOR_USER_APPLICATIONS + 2) #define USR_VBUS (RESERVED_FOR_USER_APPLICATIONS + 3) #define USR_POWERDOWN (RESERVED_FOR_USER_APPLICATIONS + 4) #define USR_DISABLEDEBUG (RESERVED_FOR_USER_APPLICATIONS + 5) #if DEVICE_LOCALFILESYSTEM FILEHANDLE semihost_open(const char* name, int openmode) { uint32_t args[3]; args[0] = (uint32_t)name; args[1] = (uint32_t)openmode; args[2] = (uint32_t)strlen(name); return __semihost(SYS_OPEN, args); } int semihost_close(FILEHANDLE fh) { return __semihost(SYS_CLOSE, &fh); } int semihost_write(FILEHANDLE fh, const unsigned char* buffer, unsigned int length, int mode) { if (length == 0) return 0; uint32_t args[3]; args[0] = (uint32_t)fh; args[1] = (uint32_t)buffer; args[2] = (uint32_t)length; return __semihost(SYS_WRITE, args); } int semihost_read(FILEHANDLE fh, unsigned char* buffer, unsigned int length, int mode) { uint32_t args[3]; args[0] = (uint32_t)fh; args[1] = (uint32_t)buffer; args[2] = (uint32_t)length; return __semihost(SYS_READ, args); } int semihost_istty(FILEHANDLE fh) { return __semihost(SYS_ISTTY, &fh); } int semihost_seek(FILEHANDLE fh, long position) { uint32_t args[2]; args[0] = (uint32_t)fh; args[1] = (uint32_t)position; return __semihost(SYS_SEEK, args); } int semihost_ensure(FILEHANDLE fh) { return __semihost(SYS_ENSURE, &fh); } long semihost_flen(FILEHANDLE fh) { return __semihost(SYS_FLEN, &fh); } int semihost_remove(const char *name) { uint32_t args[2]; args[0] = (uint32_t)name; args[1] = (uint32_t)strlen(name); return __semihost(SYS_REMOVE, args); } int semihost_rename(const char *old_name, const char *new_name) { uint32_t args[4]; args[0] = (uint32_t)old_name; args[1] = (uint32_t)strlen(old_name); args[0] = (uint32_t)new_name; args[1] = (uint32_t)strlen(new_name); return __semihost(SYS_RENAME, args); } #endif int semihost_exit(void) { uint32_t args[4]; return __semihost(SYS_EXIT, args); } int semihost_uid(char *uid) { uint32_t args[2]; args[0] = (uint32_t)uid; args[1] = DEVICE_ID_LENGTH + 1; return __semihost(USR_UID, &args); } int semihost_reset(void) { // Does not normally return, however if used with older firmware versions // that do not support this call it will return -1. return __semihost(USR_RESET, NULL); } int semihost_vbus(void) { return __semihost(USR_VBUS, NULL); } int semihost_powerdown(void) { return __semihost(USR_POWERDOWN, NULL); } #if DEVICE_DEBUG_AWARENESS int semihost_connected(void) { return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? 1 : 0; } #else // These processors cannot know if the interface is connect, assume so: static int is_debugger_attached = 1; int semihost_connected(void) { return is_debugger_attached; } #endif int semihost_disabledebug(void) { #if !(DEVICE_DEBUG_AWARENESS) is_debugger_attached = 0; #endif return __semihost(USR_DISABLEDEBUG, NULL); } #endif
/* Copyright 2007-2015 QReal Research Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <QtGui/QPainter> #include "qrutils/utilsDeclSpec.h" namespace qReal { namespace ui { /// An interface for object that implements some painting logic on PaintWidget. /// @see qReal::ui::PaintWidget class QRUTILS_EXPORT PainterInterface { public: virtual ~PainterInterface() {} /// Implements the painting process itself. virtual void paint(QPainter *painter) = 0; /// Clears all drawn stuff. virtual void reset() = 0; }; } }
// Copyright (c) 2011 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 BASE_I18N_BIDI_LINE_ITERATOR_H_ #define BASE_I18N_BIDI_LINE_ITERATOR_H_ #include "base/basictypes.h" #include "base/i18n/base_i18n_export.h" #include "base/string16.h" #include "third_party/icu/public/common/unicode/ubidi.h" namespace base { namespace i18n { // A simple wrapper class for the bidirectional iterator of ICU. // This class uses the bidirectional iterator of ICU to split a line of // bidirectional texts into visual runs in its display order. class BASE_I18N_EXPORT BiDiLineIterator { public: BiDiLineIterator(); ~BiDiLineIterator(); // Initializes the bidirectional iterator with the specified text. Returns // whether initialization succeeded. bool Open(const string16& text, bool right_to_left, bool url); // Returns the number of visual runs in the text, or zero on error. int CountRuns(); // Gets the logical offset, length, and direction of the specified visual run. UBiDiDirection GetVisualRun(int index, int* start, int* length); // Given a start position, figure out where the run ends (and the BiDiLevel). void GetLogicalRun(int start, int* end, UBiDiLevel* level); private: UBiDi* bidi_; DISALLOW_COPY_AND_ASSIGN(BiDiLineIterator); }; } // namespace i18n } // namespace base #endif // BASE_I18N_BIDI_LINE_ITERATOR_H_
#pragma once #include <list> #include "envoy/init/init.h" namespace Envoy { namespace Server { /** * Implementation of Init::Manager for use during post cluster manager init / pre listening. */ class InitManagerImpl : public Init::Manager { public: void initialize(std::function<void()> callback); // Init::Manager void registerTarget(Init::Target& target) override; private: enum class State { NotInitialized, Initializing, Initialized }; void initializeTarget(Init::Target& target); std::list<Init::Target*> targets_; State state_{State::NotInitialized}; std::function<void()> callback_; }; } // namespace Server } // namespace Envoy
/** @file bson_db.h This file contains the implementation of BSON-related methods that are required by the MongoDB database server. Normally, for standalone BSON usage, you do not want this file - it will tend to pull in some other files from the MongoDB project. Thus, bson.h (the main file one would use) does not include this file. */ /* Copyright 2009 10gen 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. */ #pragma once #include "../util/optime.h" #include "../util/time_support.h" namespace mongo { /** Timestamps are a special BSON datatype that is used internally for replication. Append a timestamp element to the object being ebuilt. @param time - in millis (but stored in seconds) */ inline BSONObjBuilder& BSONObjBuilder::appendTimestamp( const StringData& fieldName , unsigned long long time , unsigned int inc ) { OpTime t( (unsigned) (time / 1000) , inc ); appendTimestamp( fieldName , t.asDate() ); return *this; } inline OpTime BSONElement::_opTime() const { if( type() == mongo::Date || type() == Timestamp ) return OpTime( *reinterpret_cast< const unsigned long long* >( value() ) ); return OpTime(); } inline std::string BSONElement::_asCode() const { switch( type() ) { case mongo::String: case Code: return std::string(valuestr(), valuestrsize()-1); case CodeWScope: return std::string(codeWScopeCode(), *(int*)(valuestr())-1); default: log() << "can't convert type: " << (int)(type()) << " to code" << std::endl; } uassert( 10062 , "not code" , 0 ); return ""; } inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(DateNowLabeler& id) { _builder->appendDate(_fieldName, jsTime()); _fieldName = 0; return *_builder; } inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(NullLabeler& id) { _builder->appendNull(_fieldName); _fieldName = 0; return *_builder; } inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(MinKeyLabeler& id) { _builder->appendMinKey(_fieldName); _fieldName = 0; return *_builder; } inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(MaxKeyLabeler& id) { _builder->appendMaxKey(_fieldName); _fieldName = 0; return *_builder; } }
/* Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include <vector> #include "kernel/expr_maps.h" namespace lean { class equiv_manager { typedef unsigned node_ref; struct node { node_ref m_parent; unsigned m_rank; }; std::vector<node> m_nodes; expr_struct_map<node_ref> m_to_node; bool m_use_hash; node_ref mk_node(); node_ref find(node_ref n); void merge(node_ref n1, node_ref n2); node_ref to_node(expr const & e); bool is_equiv_core(expr const & e1, expr const & e2); public: equiv_manager():m_use_hash(false) {} bool is_equiv(expr const & e1, expr const & e2, bool use_hash = false); void add_equiv(expr const & e1, expr const & e2); }; }
// 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 CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_ #include <map> #include <string> #include <vector> #include "chrome/browser/extensions/api/input_ime/input_ime_event_router_base.h" #include "chrome/common/extensions/api/input_ime/input_components_handler.h" #include "extensions/browser/extension_function.h" namespace chromeos { class InputMethodEngine; } // namespace chromeos namespace extensions { class InputImeClearCompositionFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.clearComposition", INPUT_IME_CLEARCOMPOSITION) protected: ~InputImeClearCompositionFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeSetCandidateWindowPropertiesFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.setCandidateWindowProperties", INPUT_IME_SETCANDIDATEWINDOWPROPERTIES) protected: ~InputImeSetCandidateWindowPropertiesFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeSetCandidatesFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.setCandidates", INPUT_IME_SETCANDIDATES) protected: ~InputImeSetCandidatesFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeSetCursorPositionFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.setCursorPosition", INPUT_IME_SETCURSORPOSITION) protected: ~InputImeSetCursorPositionFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeSetMenuItemsFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.setMenuItems", INPUT_IME_SETMENUITEMS) protected: ~InputImeSetMenuItemsFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeUpdateMenuItemsFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.updateMenuItems", INPUT_IME_UPDATEMENUITEMS) protected: ~InputImeUpdateMenuItemsFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeDeleteSurroundingTextFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.deleteSurroundingText", INPUT_IME_DELETESURROUNDINGTEXT) protected: ~InputImeDeleteSurroundingTextFunction() override {} // ExtensionFunction: ResponseAction Run() override; }; class InputImeHideInputViewFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("input.ime.hideInputView", INPUT_IME_HIDEINPUTVIEW) protected: ~InputImeHideInputViewFunction() override {} // ExtensionFunction: bool RunAsync() override; }; class InputMethodPrivateNotifyImeMenuItemActivatedFunction : public UIThreadExtensionFunction { public: InputMethodPrivateNotifyImeMenuItemActivatedFunction() {} protected: ~InputMethodPrivateNotifyImeMenuItemActivatedFunction() override {} // UIThreadExtensionFunction: ResponseAction Run() override; private: DECLARE_EXTENSION_FUNCTION("inputMethodPrivate.notifyImeMenuItemActivated", INPUTMETHODPRIVATE_NOTIFYIMEMENUITEMACTIVATED) DISALLOW_COPY_AND_ASSIGN( InputMethodPrivateNotifyImeMenuItemActivatedFunction); }; class InputImeEventRouter : public InputImeEventRouterBase { public: explicit InputImeEventRouter(Profile* profile); ~InputImeEventRouter() override; bool RegisterImeExtension( const std::string& extension_id, const std::vector<extensions::InputComponentInfo>& input_components); void UnregisterAllImes(const std::string& extension_id); chromeos::InputMethodEngine* GetEngine(const std::string& extension_id, const std::string& component_id); input_method::InputMethodEngineBase* GetActiveEngine( const std::string& extension_id) override; private: // The engine map from extension_id to an engine. std::map<std::string, chromeos::InputMethodEngine*> engine_map_; DISALLOW_COPY_AND_ASSIGN(InputImeEventRouter); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_CHROMEOS_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_TAB_CONTENTS_CONTROLLER_H_ #define CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_TAB_CONTENTS_CONTROLLER_H_ #include <Cocoa/Cocoa.h> #include <memory> class FullscreenObserver; namespace content { class WebContents; } // A class that controls the WebContents view. It internally creates a container // view (the NSView accessed by calling |-view|) which manages the layout and // display of the WebContents view. // // Client code that inserts [controller view] into the view hierarchy needs to // call -ensureContentsVisibleInSuperview:(NSView*)superview to match the // container to the [superview bounds] and avoid multiple resize messages being // sent to the renderer, which triggers redundant and costly layouts. // // AutoEmbedFullscreen mode: When enabled, TabContentsController will observe // for WebContents fullscreen changes and automatically swap the normal // WebContents view with the fullscreen view (if different). In addition, if a // WebContents is being screen-captured, the view will be centered within the // container view, sized to the aspect ratio of the capture video resolution, // and scaling will be avoided whenever possible. @interface TabContentsController : NSViewController { @private content::WebContents* contents_; // weak // When |fullscreenObserver_| is not-NULL, TabContentsController monitors for // and auto-embeds fullscreen widgets as a subview. std::unique_ptr<FullscreenObserver> fullscreenObserver_; // Set to true while TabContentsController is embedding a fullscreen widget // view as a subview instead of the normal WebContentsView render view. // Note: This will be false in the case of non-Flash fullscreen. BOOL isEmbeddingFullscreenWidget_; // Set to true if the window is a popup. BOOL isPopup_; } @property(readonly, nonatomic) content::WebContents* webContents; // This flag is set to true when we don't want the fullscreen widget to // resize. This is done so that we can avoid resizing the fullscreen widget // to intermediate sizes during the fullscreen transition. // As a result, we would prevent janky movements during the transition and // Pepper Fullscreen from blowing up. @property(assign, nonatomic) BOOL blockFullscreenResize; // Create the contents of a tab represented by |contents|. - (id)initWithContents:(content::WebContents*)contents isPopup:(BOOL)popup; // Call to insert the container view into the view hierarchy, sizing it to match // |superview|. Then, this method will select either the WebContents view or // the fullscreen view and swap it into the container for display. - (void)ensureContentsVisibleInSuperview:(NSView*)superview; // Called after we enter fullscreen to ensure that the fullscreen widget will // have the right frame. - (void)updateFullscreenWidgetFrame; // Call to change the underlying web contents object. View is not changed, // call |-ensureContentsVisible| to display the |newContents|'s render widget // host view. - (void)changeWebContents:(content::WebContents*)newContents; // Called when the tab contents is the currently selected tab and is about to be // removed from the view hierarchy. - (void)willBecomeUnselectedTab; // Called when the tab contents is about to be put into the view hierarchy as // the selected tab. Handles things such as ensuring the toolbar is correctly // enabled. - (void)willBecomeSelectedTab; // Called when the tab contents is updated in some non-descript way (the // notification from the model isn't specific). |updatedContents| could reflect // an entirely new tab contents object. - (void)tabDidChange:(content::WebContents*)updatedContents; // Called to switch the container's subview to the WebContents-owned fullscreen // widget or back to WebContentsView's widget. - (void)toggleFullscreenWidget:(BOOL)enterFullscreen; @end #endif // CHROME_BROWSER_UI_COCOA_TAB_CONTENTS_TAB_CONTENTS_CONTROLLER_H_