text
stringlengths
4
6.14k
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/iam/IAM_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace IAM { namespace Model { enum class SortKeyType { NOT_SET, SERVICE_NAMESPACE_ASCENDING, SERVICE_NAMESPACE_DESCENDING, LAST_AUTHENTICATED_TIME_ASCENDING, LAST_AUTHENTICATED_TIME_DESCENDING }; namespace SortKeyTypeMapper { AWS_IAM_API SortKeyType GetSortKeyTypeForName(const Aws::String& name); AWS_IAM_API Aws::String GetNameForSortKeyType(SortKeyType value); } // namespace SortKeyTypeMapper } // namespace Model } // namespace IAM } // namespace Aws
// Copyright 2014 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING 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. // ----------------------------------------------------------------------------- // // Near-lossless image preprocessing adjusts pixel values to help // compressibility with a guarantee of maximum deviation between original and // resulting pixel values. // // Author: Jyrki Alakuijala (jyrki@google.com) // Converted to C by Aleksander Kramarz (akramarz@google.com) #include <assert.h> #include <stdlib.h> #include "../dsp/lossless_common.h" #include "../utils/utils.h" #include "./vp8enci.h" #define MIN_DIM_FOR_NEAR_LOSSLESS 64 #define MAX_LIMIT_BITS 5 // Quantizes the value up or down to a multiple of 1<<bits (or to 255), // choosing the closer one, resolving ties using bankers' rounding. static int FindClosestDiscretized(int a, int bits) { const int mask = (1 << bits) - 1; const int biased = a + (mask >> 1) + ((a >> bits) & 1); assert(bits > 0); if (biased > 0xff) return 0xff; return biased & ~mask; } // Applies FindClosestDiscretized to all channels of pixel. static uint32_t ClosestDiscretizedArgb(uint32_t a, int bits) { return (FindClosestDiscretized(a >> 24, bits) << 24) | (FindClosestDiscretized((a >> 16) & 0xff, bits) << 16) | (FindClosestDiscretized((a >> 8) & 0xff, bits) << 8) | (FindClosestDiscretized(a & 0xff, bits)); } // Checks if distance between corresponding channel values of pixels a and b // is within the given limit. static int IsNear(uint32_t a, uint32_t b, int limit) { int k; for (k = 0; k < 4; ++k) { const int delta = (int)((a >> (k * 8)) & 0xff) - (int)((b >> (k * 8)) & 0xff); if (delta >= limit || delta <= -limit) { return 0; } } return 1; } static int IsSmooth(const uint32_t* const prev_row, const uint32_t* const curr_row, const uint32_t* const next_row, int ix, int limit) { // Check that all pixels in 4-connected neighborhood are smooth. return (IsNear(curr_row[ix], curr_row[ix - 1], limit) && IsNear(curr_row[ix], curr_row[ix + 1], limit) && IsNear(curr_row[ix], prev_row[ix], limit) && IsNear(curr_row[ix], next_row[ix], limit)); } // Adjusts pixel values of image with given maximum error. static void NearLossless(int xsize, int ysize, uint32_t* argb, int limit_bits, uint32_t* copy_buffer) { int x, y; const int limit = 1 << limit_bits; uint32_t* prev_row = copy_buffer; uint32_t* curr_row = prev_row + xsize; uint32_t* next_row = curr_row + xsize; memcpy(copy_buffer, argb, xsize * 2 * sizeof(argb[0])); for (y = 1; y < ysize - 1; ++y) { uint32_t* const curr_argb_row = argb + y * xsize; uint32_t* const next_argb_row = curr_argb_row + xsize; memcpy(next_row, next_argb_row, xsize * sizeof(argb[0])); for (x = 1; x < xsize - 1; ++x) { if (!IsSmooth(prev_row, curr_row, next_row, x, limit)) { curr_argb_row[x] = ClosestDiscretizedArgb(curr_row[x], limit_bits); } } { // Three-way swap. uint32_t* const temp = prev_row; prev_row = curr_row; curr_row = next_row; next_row = temp; } } } int VP8ApplyNearLossless(int xsize, int ysize, uint32_t* argb, int quality) { int i; uint32_t* const copy_buffer = (uint32_t*)WebPSafeMalloc(xsize * 3, sizeof(*copy_buffer)); const int limit_bits = VP8LNearLosslessBits(quality); assert(argb != NULL); assert(limit_bits >= 0); assert(limit_bits <= MAX_LIMIT_BITS); if (copy_buffer == NULL) { return 0; } // For small icon images, don't attempt to apply near-lossless compression. if (xsize < MIN_DIM_FOR_NEAR_LOSSLESS && ysize < MIN_DIM_FOR_NEAR_LOSSLESS) { WebPSafeFree(copy_buffer); return 1; } for (i = limit_bits; i != 0; --i) { NearLossless(xsize, ysize, argb, i, copy_buffer); } WebPSafeFree(copy_buffer); return 1; }
#import <Foundation/Foundation.h> @interface MPKitActivity : NSObject - (BOOL)isKitActive:(nonnull NSNumber *)integrationId; - (nullable id)kitInstance:(nonnull NSNumber *)integrationId; - (void)kitInstance:(nonnull NSNumber *)integrationId withHandler:(void (^ _Nonnull)(id _Nullable kitInstance))handler; @end
/** ****************************************************************************** * @file IWDG/IWDG_WindowMode/main.c * @author MCD Application Team * @version V1.3.0 * @date 16-January-2014 * @brief Main program body ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /** @addtogroup STM32F0xx_StdPeriph_Examples * @{ */ /** @addtogroup IWDG_WindowMode * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ __IO uint32_t TimingDelay = 0; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /** * @brief Main program. * @param None * @retval None */ int main(void) { /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f0xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f0xx.c file */ /* Initialize LEDs and Tamper Button mounted on EVAL board */ STM_EVAL_LEDInit(LED1); STM_EVAL_LEDInit(LED2); STM_EVAL_LEDInit(LED3); STM_EVAL_PBInit(BUTTON_TAMPER, BUTTON_MODE_EXTI); /* Check if the system has resumed from IWDG reset */ if (RCC_GetFlagStatus(RCC_FLAG_IWDGRST) != RESET) { /* IWDGRST flag set */ /* Turn on LED1 */ STM_EVAL_LEDOn(LED1); /* Clear reset flags */ RCC_ClearFlag(); } else { /* IWDGRST flag is not set */ /* Turn off LED1 */ STM_EVAL_LEDOff(LED1); } /* Setup SysTick Timer for 1 msec interrupts */ if (SysTick_Config(SystemCoreClock / 1000)) { /* Capture error */ while (1) {} } /********************* IWDG configuration ***********************************/ /* Enable IWDG, set reload and window values to 2000 and 1000, respectively. In this case the refresh window is: (2000-1000) / (LSI/16) = ~400 ms < refresh window < 2000 / (LSI/16) = ~800 ms Note: the refresh window may varies due to LSI frequency dispersion ---- */ /* Enable IWDG (the LSI oscillator will be enabled by hardware) */ IWDG_Enable(); /* Enable write access to IWDG_PR and IWDG_RLR registers */ IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); /* Set IWDG Prescaler value to 16 */ IWDG_SetPrescaler(IWDG_Prescaler_16); /* Set IWDG Reload value to 2000 */ IWDG_SetReload(2000); /* Wait until RVU flag is reset to be sure that the reload value update operation is completed */ while(IWDG_GetFlagStatus(IWDG_FLAG_RVU) != RESET); /* Set the IWDG window value to 1000 */ IWDG_SetWindowValue(1000); while (1) { /* Toggle LED2 */ STM_EVAL_LEDToggle(LED2); /* Insert 750 ms delay */ Delay(750); /* Reload IWDG counter */ IWDG_ReloadCounter(); } } /** * @brief Inserts a delay time. * @param nTime: specifies the delay time length, in 1 ms. * @retval None */ void Delay(__IO uint32_t nTime) { TimingDelay = nTime; while(TimingDelay != 0); } /** * @brief Decrements the TimingDelay variable. * @param None * @retval None */ void TimingDelay_Decrement(void) { if (TimingDelay != 0x00) { TimingDelay--; } } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t* file, uint32_t line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* Infinite loop */ while (1) { } } #endif /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * 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 (BSON_INSIDE) && !defined (BSON_COMPILATION) # error "Only <bson.h> can be included directly." #endif #ifndef BSON_CLOCK_H #define BSON_CLOCK_H #include "bson-compat.h" #include "bson-macros.h" #include "bson-types.h" BSON_BEGIN_DECLS int64_t bson_get_monotonic_time (void); int bson_gettimeofday (struct timeval *tv, struct timezone *tz); BSON_END_DECLS #endif /* BSON_CLOCK_H */
/*! * Copyright (c) 2016 by Contributors * \file nnvm/op_attr_types.h * \brief Data structures that can appear in operator attributes. */ #ifndef NNVM_OP_ATTR_TYPES_H_ #define NNVM_OP_ATTR_TYPES_H_ #include <vector> #include <string> #include <utility> #include <functional> #include "./base.h" #include "./node.h" #include "./tuple.h" namespace nnvm { // These types are optional attributes in each operator. // Each attribute can be required by some passes. /*! * \brief Return list of input arguments names of each operator. * * \param attrs The attributes of the node. * \return list of inputs * \note Register under "FListInputNames", default return {"data"}. * * FListInputNames enables automatic variable creation for missing arguments. */ using FListInputNames = std::function<std::vector<std::string> (const NodeAttrs& attrs)>; /*! * \brief Return number of visible outputs by the user. * * \param attrs The attributes of the node. * * \note Register under "FNumVisibleOutputs", default not registered. * This can be used to hide certain output from the user, * but the additional outputs can be used to pass information from * forward to gradient pass. */ using FNumVisibleOutputs = std::function<uint32_t (const NodeAttrs& attrs)>; /*! * \brief Return list of output arguments names of each operator. * * \param attrs The attributes of the node. * \return list of inputs * \note Register under "FListOutputNames", default return {"outputs"}. * * FListOutputNames customized naming for operator outputs. */ using FListOutputNames = std::function<std::vector<std::string> (const NodeAttrs& attrs)>; /*! * \brief Check whether operator will mutate k-th input. * \param attrs The attributes of the node. * \return list of input indices it mutates. * * \note Register under "FMutateInputs", default return false * FMutateInputs enables mutation order handling correctly. */ using FMutateInputs = std::function<std::vector<uint32_t> (const NodeAttrs& attrs)>; /*! * \brief Inference function of certain type. * \tparam AttrType The type of the attribute to be infered. * \return whether all attributes are inferred. */ template<typename AttrType> using FInferNodeEntryAttr = std::function<bool (const NodeAttrs& attrs, std::vector<AttrType> *in_attrs, std::vector<AttrType> *out_attrs)>; /*! * \brief Get attribute dictionary from node. * * \param attrs The attributes of the node. * \return The attribute dict. * \note Register under "FUpdateAttrDict" */ using FGetAttrDict = std::function< std::unordered_map<std::string, std::string> (const NodeAttrs& attrs)>; /*! * \brief Shape inference function. * Update the shapes given the input shape information. * TShape.ndim() == 0 means the shape is still unknown. * * \note Register under "FInferShape", * by default do not update any shapes. * * FInferShape is needed by shape inference */ using FInferShape = FInferNodeEntryAttr<TShape>; /*! * \brief Type inference function. * Update the type given the known type information. * * \note Register under "FInferType", * by default set all the output types to 0. */ using FInferType = FInferNodeEntryAttr<int>; /*! * \brief Whether this op is an explicit backward operator, * If TIsBackward is true: * - The first control_deps of the node points to the corresponding forward operator. * * \note Register under "TIsBackward" * This enables easier shape/type inference for backward operators. */ using TIsBackward = bool; /*! * \brief Get possible inplace options. * This function enables optimization to reuse memory of inputs in output. * \param attrs The attributes of the node * \return list of pair of that maps input->output, * indicating possible in place operations. * * \note Register under "FInplaceOption", by default no inplace can happen. */ using FInplaceOption = std::function< std::vector<std::pair<int, int> > (const NodeAttrs& attrs)>; /*! * \brief Get if the inplace option is an identity * This function enables inplace optimization even when input reference count * is greater than one. * \param attrs The attributes of the node * \return list of bool indicating whether corresponding pair from FInplaceOption * is an identity * * \note Register under "FInplaceIdentity", by default no identities. */ using FInplaceIdentity = std::function<std::vector<bool> (const NodeAttrs& attrs)>; /*! * \brief Get list of inputs in the op whose content are actually not used by the operator * These are dummy input that can be used for example in zeros_like, ones_like. * * \param attrs The attributes of the node * \return list input index that are not used by the operator. * * \note Register under "FIgnoreInputs". */ using FIgnoreInputs = std::function< std::vector<uint32_t> (const NodeAttrs& attrs)>; /*! * \brief Get the gradient node of the op node * This function generates the backward graph of the node * \param nodeptr The node to take gradient * \param out_grads Gradient of current node's outputs * \return gradients of the inputs * * \note Register under "FGradient" */ using FGradient = std::function<std::vector<NodeEntry>( const NodePtr& nodeptr, const std::vector<NodeEntry>& out_grads)>; /*! * \brief Set the attributes of input variable. * Usually used for setting initialization or weight decay. * \param attrs The attributes of this node. * \param var the input variable * \param index index of var in all inputs */ using FSetInputVarAttrOnCompose = std::function<void( const NodeAttrs& attrs, NodePtr var, const int index)>; } // namespace nnvm #endif // NNVM_OP_ATTR_TYPES_H_
/* * Copyright (c) 2015 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr.h> #include <errno.h> #include <misc/printk.h> #include <net/net_pkt.h> #include <net/net_ip.h> #include <net/net_core.h> #include "zperf.h" #include "zperf_internal.h" #define TAG CMD_STR_TCP_UPLOAD" " static char sample_packet[PACKET_SIZE_MAX]; void zperf_tcp_upload(struct net_context *ctx, unsigned int duration_in_ms, unsigned int packet_size, struct zperf_results *results) { u32_t duration = MSEC_TO_HW_CYCLES(duration_in_ms); u32_t nb_packets = 0, nb_errors = 0; u32_t start_time, last_print_time, last_loop_time, end_time; u8_t time_elapsed = 0, finished = 0; if (packet_size > PACKET_SIZE_MAX) { printk(TAG "WARNING! packet size too large! max size: %u\n", PACKET_SIZE_MAX); packet_size = PACKET_SIZE_MAX; } /* Start the loop */ start_time = k_cycle_get_32(); last_print_time = start_time; last_loop_time = start_time; printk(TAG "New session started\n"); memset(sample_packet, 'z', sizeof(sample_packet)); do { int ret = 0; struct net_pkt *pkt; struct net_buf *frag; u32_t loop_time; /* Timestamps */ loop_time = k_cycle_get_32(); last_loop_time = loop_time; pkt = net_pkt_get_tx(ctx, K_FOREVER); if (!pkt) { printk(TAG "ERROR! Failed to retrieve a packet\n"); break; } frag = net_pkt_get_data(ctx, K_FOREVER); if (!frag) { net_pkt_unref(pkt); printk(TAG "ERROR! Failed to retrieve a fragment\n"); break; } net_pkt_frag_add(pkt, frag); /* Fill in the TCP payload */ net_pkt_append(pkt, sizeof(sample_packet), sample_packet, K_FOREVER); /* Send the packet */ ret = net_context_send(pkt, NULL, K_NO_WAIT, NULL, NULL); if (ret < 0) { printk(TAG "ERROR! Failed to send the packet (%d)\n", ret); net_pkt_unref(pkt); nb_errors++; break; } else { nb_packets++; if (time_elapsed) { finished = 1; } } if (!time_elapsed && time_delta(start_time, last_loop_time) > duration) { time_elapsed = 1; } k_yield(); } while (!finished); end_time = k_cycle_get_32(); /* Add result coming from the client */ results->nb_packets_sent = nb_packets; results->client_time_in_us = HW_CYCLES_TO_USEC(time_delta(start_time, end_time)); results->packet_size = packet_size; results->nb_packets_errors = nb_errors; net_context_put(ctx); }
// Copyright 2019 the V8 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. #ifndef V8_TORQUE_LS_JSON_H_ #define V8_TORQUE_LS_JSON_H_ #include <map> #include <string> #include <vector> #include "src/base/logging.h" #include "src/base/template-utils.h" namespace v8 { namespace internal { namespace torque { namespace ls { struct JsonValue; using JsonObject = std::map<std::string, JsonValue>; using JsonArray = std::vector<JsonValue>; struct JsonValue { public: enum { OBJECT, ARRAY, STRING, NUMBER, BOOL, IS_NULL } tag; static JsonValue From(double number) { JsonValue result; result.tag = JsonValue::NUMBER; result.number_ = number; return result; } static JsonValue From(JsonObject object) { JsonValue result; result.tag = JsonValue::OBJECT; result.object_ = base::make_unique<JsonObject>(std::move(object)); return result; } static JsonValue From(bool b) { JsonValue result; result.tag = JsonValue::BOOL; result.flag_ = b; return result; } static JsonValue From(const std::string& string) { JsonValue result; result.tag = JsonValue::STRING; result.string_ = string; return result; } static JsonValue From(JsonArray array) { JsonValue result; result.tag = JsonValue::ARRAY; result.array_ = base::make_unique<JsonArray>(std::move(array)); return result; } static JsonValue JsonNull() { JsonValue result; result.tag = JsonValue::IS_NULL; return result; } bool IsNumber() const { return tag == NUMBER; } double ToNumber() const { CHECK(IsNumber()); return number_; } bool IsBool() const { return tag == BOOL; } bool ToBool() const { CHECK(IsBool()); return flag_; } bool IsString() const { return tag == STRING; } const std::string& ToString() const { CHECK(IsString()); return string_; } bool IsObject() const { return object_ && tag == OBJECT; } const JsonObject& ToObject() const { CHECK(IsObject()); return *object_; } JsonObject& ToObject() { CHECK(IsObject()); return *object_; } bool IsArray() const { return array_ && tag == ARRAY; } const JsonArray& ToArray() const { CHECK(IsArray()); return *array_; } JsonArray& ToArray() { CHECK(IsArray()); return *array_; } private: double number_ = 0; bool flag_ = false; std::string string_; std::unique_ptr<JsonObject> object_; std::unique_ptr<JsonArray> array_; }; std::string SerializeToString(const JsonValue& value); } // namespace ls } // namespace torque } // namespace internal } // namespace v8 #endif // V8_TORQUE_LS_JSON_H_
/********************************************************************* * NAN - Native Abstractions for Node.js * * Copyright (c) 2017 NAN contributors * * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md> ********************************************************************/ #ifndef NAN_CALLBACKS_H_ #define NAN_CALLBACKS_H_ template<typename T> class FunctionCallbackInfo; template<typename T> class PropertyCallbackInfo; template<typename T> class Global; typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&); typedef void(*GetterCallback) (v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&); typedef void(*SetterCallback)( v8::Local<v8::String>, v8::Local<v8::Value>, const PropertyCallbackInfo<void>&); typedef void(*PropertyGetterCallback)( v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&); typedef void(*PropertySetterCallback)( v8::Local<v8::String>, v8::Local<v8::Value>, const PropertyCallbackInfo<v8::Value>&); typedef void(*PropertyEnumeratorCallback) (const PropertyCallbackInfo<v8::Array>&); typedef void(*PropertyDeleterCallback)( v8::Local<v8::String>, const PropertyCallbackInfo<v8::Boolean>&); typedef void(*PropertyQueryCallback)( v8::Local<v8::String>, const PropertyCallbackInfo<v8::Integer>&); typedef void(*IndexGetterCallback)( uint32_t, const PropertyCallbackInfo<v8::Value>&); typedef void(*IndexSetterCallback)( uint32_t, v8::Local<v8::Value>, const PropertyCallbackInfo<v8::Value>&); typedef void(*IndexEnumeratorCallback) (const PropertyCallbackInfo<v8::Array>&); typedef void(*IndexDeleterCallback)( uint32_t, const PropertyCallbackInfo<v8::Boolean>&); typedef void(*IndexQueryCallback)( uint32_t, const PropertyCallbackInfo<v8::Integer>&); namespace imp { typedef v8::Local<v8::AccessorSignature> Sig; static const int kDataIndex = 0; static const int kFunctionIndex = 1; static const int kFunctionFieldCount = 2; static const int kGetterIndex = 1; static const int kSetterIndex = 2; static const int kAccessorFieldCount = 3; static const int kPropertyGetterIndex = 1; static const int kPropertySetterIndex = 2; static const int kPropertyEnumeratorIndex = 3; static const int kPropertyDeleterIndex = 4; static const int kPropertyQueryIndex = 5; static const int kPropertyFieldCount = 6; static const int kIndexPropertyGetterIndex = 1; static const int kIndexPropertySetterIndex = 2; static const int kIndexPropertyEnumeratorIndex = 3; static const int kIndexPropertyDeleterIndex = 4; static const int kIndexPropertyQueryIndex = 5; static const int kIndexPropertyFieldCount = 6; } // end of namespace imp #if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION # include "nan_callbacks_12_inl.h" // NOLINT(build/include) #else # include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include) #endif #endif // NAN_CALLBACKS_H_
/* +----------------------------------------------------------------------+ | Swoole | +----------------------------------------------------------------------+ | This source file is subject to version 2.0 of the Apache license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.apache.org/licenses/LICENSE-2.0.html | | If you did not receive a copy of the Apache2.0 license and are unable| | to obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Tianfeng Han <mikan.tenny@gmail.com> | +----------------------------------------------------------------------+ */ #ifndef SW_HTTP_H_ #define SW_HTTP_H_ #ifdef __cplusplus extern "C" { #endif #include <sys/types.h> #include <stdint.h> enum swHttpMethod { HTTP_DELETE = 1, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, /* pathological */ HTTP_CONNECT, HTTP_OPTIONS, HTTP_TRACE, /* webdav */ HTTP_COPY, HTTP_LOCK, HTTP_MKCOL, HTTP_MOVE, HTTP_PROPFIND, HTTP_PROPPATCH, HTTP_UNLOCK, /* subversion */ HTTP_REPORT, HTTP_MKACTIVITY, HTTP_CHECKOUT, HTTP_MERGE, /* upnp */ HTTP_MSEARCH, HTTP_NOTIFY, HTTP_SUBSCRIBE, HTTP_UNSUBSCRIBE, }; enum swHttpVersion { HTTP_VERSION_10 = 1, HTTP_VERSION_11, }; typedef struct _swHttpRequest { uint8_t method; uint8_t offset; uint8_t version; uint8_t free_memory; uint32_t header_length; uint32_t content_length; swString *buffer; uint8_t opcode; } swHttpRequest; int swHttpRequest_get_protocol(swHttpRequest *request); int swHttpRequest_get_content_length(swHttpRequest *request); int swHttpRequest_get_header_length(swHttpRequest *request); int swHttpRequest_have_content_length(swHttpRequest *request); void swHttpRequest_free(swConnection *conn); #ifdef SW_HTTP_100_CONTINUE int swHttpRequest_has_expect_header(swHttpRequest *request); #endif #ifdef __cplusplus } #endif #endif /* SW_HTTP_H_ */
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/email/SES_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace SES { namespace Model { /** * <p>Indicates that the Amazon Simple Notification Service (Amazon SNS) * destination is invalid. See the error message for details.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/email-2010-12-01/InvalidSNSDestinationException">AWS * API Reference</a></p> */ class AWS_SES_API InvalidSNSDestinationException { public: InvalidSNSDestinationException(); InvalidSNSDestinationException(const Aws::Utils::Xml::XmlNode& xmlNode); InvalidSNSDestinationException& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** * <p>Indicates that the configuration set does not exist.</p> */ inline const Aws::String& GetConfigurationSetName() const{ return m_configurationSetName; } /** * <p>Indicates that the configuration set does not exist.</p> */ inline bool ConfigurationSetNameHasBeenSet() const { return m_configurationSetNameHasBeenSet; } /** * <p>Indicates that the configuration set does not exist.</p> */ inline void SetConfigurationSetName(const Aws::String& value) { m_configurationSetNameHasBeenSet = true; m_configurationSetName = value; } /** * <p>Indicates that the configuration set does not exist.</p> */ inline void SetConfigurationSetName(Aws::String&& value) { m_configurationSetNameHasBeenSet = true; m_configurationSetName = std::move(value); } /** * <p>Indicates that the configuration set does not exist.</p> */ inline void SetConfigurationSetName(const char* value) { m_configurationSetNameHasBeenSet = true; m_configurationSetName.assign(value); } /** * <p>Indicates that the configuration set does not exist.</p> */ inline InvalidSNSDestinationException& WithConfigurationSetName(const Aws::String& value) { SetConfigurationSetName(value); return *this;} /** * <p>Indicates that the configuration set does not exist.</p> */ inline InvalidSNSDestinationException& WithConfigurationSetName(Aws::String&& value) { SetConfigurationSetName(std::move(value)); return *this;} /** * <p>Indicates that the configuration set does not exist.</p> */ inline InvalidSNSDestinationException& WithConfigurationSetName(const char* value) { SetConfigurationSetName(value); return *this;} /** * <p>Indicates that the event destination does not exist.</p> */ inline const Aws::String& GetEventDestinationName() const{ return m_eventDestinationName; } /** * <p>Indicates that the event destination does not exist.</p> */ inline bool EventDestinationNameHasBeenSet() const { return m_eventDestinationNameHasBeenSet; } /** * <p>Indicates that the event destination does not exist.</p> */ inline void SetEventDestinationName(const Aws::String& value) { m_eventDestinationNameHasBeenSet = true; m_eventDestinationName = value; } /** * <p>Indicates that the event destination does not exist.</p> */ inline void SetEventDestinationName(Aws::String&& value) { m_eventDestinationNameHasBeenSet = true; m_eventDestinationName = std::move(value); } /** * <p>Indicates that the event destination does not exist.</p> */ inline void SetEventDestinationName(const char* value) { m_eventDestinationNameHasBeenSet = true; m_eventDestinationName.assign(value); } /** * <p>Indicates that the event destination does not exist.</p> */ inline InvalidSNSDestinationException& WithEventDestinationName(const Aws::String& value) { SetEventDestinationName(value); return *this;} /** * <p>Indicates that the event destination does not exist.</p> */ inline InvalidSNSDestinationException& WithEventDestinationName(Aws::String&& value) { SetEventDestinationName(std::move(value)); return *this;} /** * <p>Indicates that the event destination does not exist.</p> */ inline InvalidSNSDestinationException& WithEventDestinationName(const char* value) { SetEventDestinationName(value); return *this;} private: Aws::String m_configurationSetName; bool m_configurationSetNameHasBeenSet; Aws::String m_eventDestinationName; bool m_eventDestinationNameHasBeenSet; }; } // namespace Model } // namespace SES } // namespace Aws
#ifndef UNITTEST_DEFERREDTESTREPORTER_H #define UNITTEST_DEFERREDTESTREPORTER_H #include "TestReporter.h" #include "DeferredTestResult.h" #include "Config.h" #include <vector> namespace UnitTest { class DeferredTestReporter : public TestReporter { public: virtual void ReportTestStart(TestDetails const& details); virtual void ReportFailure(TestDetails const& details, char const* failure); virtual void ReportTestFinish(TestDetails const& details, float secondsElapsed); typedef std::vector< DeferredTestResult > DeferredTestResultList; DeferredTestResultList& GetResults(); private: DeferredTestResultList m_results; }; } #endif
/*- * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c)1999 Citrus Project, * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * citrus Id: wcsspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp */ #include <sys/cdefs.h> #if 0 #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD: head/lib/libc/string/wcsspn.c 326193 2017-11-25 17:12:48Z pfg $"); #include <wchar.h> size_t wcsspn(const wchar_t *s, const wchar_t *set) { const wchar_t *p; const wchar_t *q; p = s; while (*p) { q = set; while (*q) { if (*p == *q) break; q++; } if (!*q) goto done; p++; } done: return (p - s); }
/** @author Sergey Mamontov @since 4.0 @copyright © 2009-2016 PubNub, Inc. */ #import "PubNub+Subscribe.h" NS_ASSUME_NONNULL_BEGIN #pragma mark Private interface declaration @interface PubNub (SubscribePrivate) ///------------------------------------------------ /// @name Unsubscription ///------------------------------------------------ /** @brief Unsubscribe/leave from specified set of channels. @discussion Using this API client will push leave presence event on specified \c channels and if it will be required it will re-subscribe on rest of the channels. @param channels List of channel names from which client should try to unsubscribe. @param shouldObservePresence Whether client should disable presence observation on specified channels or keep listening for presence event on them. @param block Reference on subscription completion block which is used to notify code. @since 4.0 */ - (void)unsubscribeFromChannels:(NSArray<NSString *> *)channels withPresence:(BOOL)shouldObservePresence completion:(nullable PNSubscriberCompletionBlock)block; /** @brief Unsubscribe/leave from specified set of channel groups. @discussion Using this API client will push leave presence event on specified \c groups. In this case leave event will be pushed to all channels which is part of \c groups. If it will be required it will re-subscribe on rest of the channels. @param groups List of channel group names from which client should try to unsubscribe. @param shouldObservePresence Whether client should disable presence observation on specified channel groups or keep listening for presence event on them. @param block Reference on subscription completion block which is used to notify code. @since 4.0 */ - (void)unsubscribeFromChannelGroups:(NSArray<NSString *> *)groups withPresence:(BOOL)shouldObservePresence completion:(nullable PNSubscriberCompletionBlock)block; #pragma mark - @end NS_ASSUME_NONNULL_END
/*---------------------------------------------------------------------------- * File: ooaofooa_I_TIM_class.c * * Class: Timer (I_TIM) * Component: ooaofooa * * your copyright statement can go here (from te_copyright.body) *--------------------------------------------------------------------------*/ #include "sys_sys_types.h" #include "LOG_bridge.h" #include "POP_bridge.h" #include "T_bridge.h" #include "ooaofooa_classes.h" /* * Instance Loader (from string data). */ Escher_iHandle_t ooaofooa_I_TIM_instanceloader( Escher_iHandle_t instance, const c_t * avlstring[] ) { Escher_iHandle_t return_identifier = 0; ooaofooa_I_TIM * self = (ooaofooa_I_TIM *) instance; /* Initialize application analysis class attributes. */ self->Timer_ID = (Escher_iHandle_t) Escher_atoi( avlstring[ 1 ] ); return_identifier = self->Timer_ID; self->delay = Escher_atoi( avlstring[ 2 ] ); self->running = ( '0' != *avlstring[ 3 ] ); self->recurring = ( '0' != *avlstring[ 4 ] ); self->Event_ID = (Escher_iHandle_t) Escher_atoi( avlstring[ 5 ] ); Escher_strcpy( self->Label, avlstring[ 6 ] ); self->expiration = Escher_atoi( avlstring[ 7 ] ); return return_identifier; } /* * Select any where using referential/identifying attribute set. * If not_empty, relate this instance to the selected instance. */ void ooaofooa_I_TIM_batch_relate( Escher_iHandle_t instance ) { ooaofooa_I_TIM * ooaofooa_I_TIM_instance = (ooaofooa_I_TIM *) instance; ooaofooa_I_EVI * ooaofooa_I_EVIrelated_instance1 = (ooaofooa_I_EVI *) Escher_instance_cache[ (intptr_t) ooaofooa_I_TIM_instance->Event_ID ]; if ( ooaofooa_I_EVIrelated_instance1 ) { ooaofooa_I_TIM_R2940_Link_delivered_by( ooaofooa_I_EVIrelated_instance1, ooaofooa_I_TIM_instance ); } } /* * RELATE I_EVI TO I_TIM ACROSS R2940 */ void ooaofooa_I_TIM_R2940_Link_delivered_by( ooaofooa_I_EVI * part, ooaofooa_I_TIM * form ) { /* Use TagEmptyHandleDetectionOn() to detect empty handle references. */ form->Event_ID = part->Event_ID; form->I_EVI_R2940_provides_delayed_delivery_of = part; part->I_TIM_R2940_delivered_by = form; } /* * UNRELATE I_EVI FROM I_TIM ACROSS R2940 */ void ooaofooa_I_TIM_R2940_Unlink_delivered_by( ooaofooa_I_EVI * part, ooaofooa_I_TIM * form ) { /* Use TagEmptyHandleDetectionOn() to detect empty handle references. */ form->Event_ID = 0; form->I_EVI_R2940_provides_delayed_delivery_of = 0; part->I_TIM_R2940_delivered_by = 0; } /* * Dump instances in SQL format. */ void ooaofooa_I_TIM_instancedumper( Escher_iHandle_t instance ) { ooaofooa_I_TIM * self = (ooaofooa_I_TIM *) instance; printf( "INSERT INTO I_TIM VALUES ( %ld,%d,%d,%d,%ld,'%s',%d );\n", ((long)self->Timer_ID & ESCHER_IDDUMP_MASK), self->delay, self->running, self->recurring, ((long)self->Event_ID & ESCHER_IDDUMP_MASK), self->Label, self->expiration ); } /* * Statically allocate space for the instance population for this class. * Allocate space for the class instance and its attribute values. * Depending upon the collection scheme, allocate containoids (collection * nodes) for gathering instances into free and active extents. */ static Escher_SetElement_s ooaofooa_I_TIM_container[ ooaofooa_I_TIM_MAX_EXTENT_SIZE ]; static ooaofooa_I_TIM ooaofooa_I_TIM_instances[ ooaofooa_I_TIM_MAX_EXTENT_SIZE ]; Escher_Extent_t pG_ooaofooa_I_TIM_extent = { {0,0}, {0,0}, &ooaofooa_I_TIM_container[ 0 ], (Escher_iHandle_t) &ooaofooa_I_TIM_instances, sizeof( ooaofooa_I_TIM ), 0, ooaofooa_I_TIM_MAX_EXTENT_SIZE };
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/chime/Chime_EXPORTS.h> #include <aws/chime/ChimeRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/chime/model/UserType.h> #include <utility> namespace Aws { namespace Chime { namespace Model { /** */ class AWS_CHIME_API CreateUserRequest : public ChimeRequest { public: CreateUserRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "CreateUser"; } Aws::String SerializePayload() const override; /** * <p>The Amazon Chime account ID.</p> */ inline const Aws::String& GetAccountId() const{ return m_accountId; } /** * <p>The Amazon Chime account ID.</p> */ inline bool AccountIdHasBeenSet() const { return m_accountIdHasBeenSet; } /** * <p>The Amazon Chime account ID.</p> */ inline void SetAccountId(const Aws::String& value) { m_accountIdHasBeenSet = true; m_accountId = value; } /** * <p>The Amazon Chime account ID.</p> */ inline void SetAccountId(Aws::String&& value) { m_accountIdHasBeenSet = true; m_accountId = std::move(value); } /** * <p>The Amazon Chime account ID.</p> */ inline void SetAccountId(const char* value) { m_accountIdHasBeenSet = true; m_accountId.assign(value); } /** * <p>The Amazon Chime account ID.</p> */ inline CreateUserRequest& WithAccountId(const Aws::String& value) { SetAccountId(value); return *this;} /** * <p>The Amazon Chime account ID.</p> */ inline CreateUserRequest& WithAccountId(Aws::String&& value) { SetAccountId(std::move(value)); return *this;} /** * <p>The Amazon Chime account ID.</p> */ inline CreateUserRequest& WithAccountId(const char* value) { SetAccountId(value); return *this;} /** * <p>The user name.</p> */ inline const Aws::String& GetUsername() const{ return m_username; } /** * <p>The user name.</p> */ inline bool UsernameHasBeenSet() const { return m_usernameHasBeenSet; } /** * <p>The user name.</p> */ inline void SetUsername(const Aws::String& value) { m_usernameHasBeenSet = true; m_username = value; } /** * <p>The user name.</p> */ inline void SetUsername(Aws::String&& value) { m_usernameHasBeenSet = true; m_username = std::move(value); } /** * <p>The user name.</p> */ inline void SetUsername(const char* value) { m_usernameHasBeenSet = true; m_username.assign(value); } /** * <p>The user name.</p> */ inline CreateUserRequest& WithUsername(const Aws::String& value) { SetUsername(value); return *this;} /** * <p>The user name.</p> */ inline CreateUserRequest& WithUsername(Aws::String&& value) { SetUsername(std::move(value)); return *this;} /** * <p>The user name.</p> */ inline CreateUserRequest& WithUsername(const char* value) { SetUsername(value); return *this;} /** * <p>The user's email address.</p> */ inline const Aws::String& GetEmail() const{ return m_email; } /** * <p>The user's email address.</p> */ inline bool EmailHasBeenSet() const { return m_emailHasBeenSet; } /** * <p>The user's email address.</p> */ inline void SetEmail(const Aws::String& value) { m_emailHasBeenSet = true; m_email = value; } /** * <p>The user's email address.</p> */ inline void SetEmail(Aws::String&& value) { m_emailHasBeenSet = true; m_email = std::move(value); } /** * <p>The user's email address.</p> */ inline void SetEmail(const char* value) { m_emailHasBeenSet = true; m_email.assign(value); } /** * <p>The user's email address.</p> */ inline CreateUserRequest& WithEmail(const Aws::String& value) { SetEmail(value); return *this;} /** * <p>The user's email address.</p> */ inline CreateUserRequest& WithEmail(Aws::String&& value) { SetEmail(std::move(value)); return *this;} /** * <p>The user's email address.</p> */ inline CreateUserRequest& WithEmail(const char* value) { SetEmail(value); return *this;} /** * <p>The user type.</p> */ inline const UserType& GetUserType() const{ return m_userType; } /** * <p>The user type.</p> */ inline bool UserTypeHasBeenSet() const { return m_userTypeHasBeenSet; } /** * <p>The user type.</p> */ inline void SetUserType(const UserType& value) { m_userTypeHasBeenSet = true; m_userType = value; } /** * <p>The user type.</p> */ inline void SetUserType(UserType&& value) { m_userTypeHasBeenSet = true; m_userType = std::move(value); } /** * <p>The user type.</p> */ inline CreateUserRequest& WithUserType(const UserType& value) { SetUserType(value); return *this;} /** * <p>The user type.</p> */ inline CreateUserRequest& WithUserType(UserType&& value) { SetUserType(std::move(value)); return *this;} private: Aws::String m_accountId; bool m_accountIdHasBeenSet; Aws::String m_username; bool m_usernameHasBeenSet; Aws::String m_email; bool m_emailHasBeenSet; UserType m_userType; bool m_userTypeHasBeenSet; }; } // namespace Model } // namespace Chime } // namespace Aws
#ifndef agent_utils_h #define agent_utils_h void die(const char *fmt, ...); extern void die_on_error(int x, char const *context); extern void die_on_amqp_error(amqp_rpc_reply_t x, char const *context); extern void amqp_dump(void const *buffer, size_t len); extern uint64_t now_microseconds(void); extern void microsleep(int usec); #endif
/* hashtab.h Simple, fixed size hash table. Darn simple. Uses a contiguous block of memory, so you can put it in a memory mapped file very easily. */ /* 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 "../pch.h" #include <map> #include "../db/dur.h" namespace mongo { #pragma pack(1) /* you should define: int Key::hash() return > 0 always. */ template < class Key, class Type > class HashTable : boost::noncopyable { public: const char *name; struct Node { int hash; Key k; Type value; bool inUse() { return hash != 0; } void setUnused() { hash = 0; } }; void* _buf; int n; // number of hashtable buckets int maxChain; Node& nodes(int i) { Node *nodes = (Node *) _buf; return nodes[i]; } int _find(const Key& k, bool& found) { found = false; int h = k.hash(); int i = h % n; int start = i; int chain = 0; int firstNonUsed = -1; while ( 1 ) { if ( !nodes(i).inUse() ) { if ( firstNonUsed < 0 ) firstNonUsed = i; } if ( nodes(i).hash == h && nodes(i).k == k ) { if ( chain >= 200 ) out() << "warning: hashtable " << name << " long chain " << endl; found = true; return i; } chain++; i = (i+1) % n; if ( i == start ) { // shouldn't get here / defensive for infinite loops out() << "error: hashtable " << name << " is full n:" << n << endl; return -1; } if( chain >= maxChain ) { if ( firstNonUsed >= 0 ) return firstNonUsed; out() << "error: hashtable " << name << " max chain reached:" << maxChain << endl; return -1; } } } public: /* buf must be all zeroes on initialization. */ HashTable(void* buf, int buflen, const char *_name) : name(_name) { int m = sizeof(Node); // out() << "hashtab init, buflen:" << buflen << " m:" << m << endl; n = buflen / m; if ( (n & 1) == 0 ) n--; maxChain = (int) (n * 0.05); _buf = buf; //nodes = (Node *) buf; if ( sizeof(Node) != 628 ) { out() << "HashTable() " << _name << " sizeof(node):" << sizeof(Node) << " n:" << n << " sizeof(Key): " << sizeof(Key) << " sizeof(Type):" << sizeof(Type) << endl; assert( sizeof(Node) == 628 ); } } Type* get(const Key& k) { bool found; int i = _find(k, found); if ( found ) return &nodes(i).value; return 0; } void kill(const Key& k) { bool found; int i = _find(k, found); if ( i >= 0 && found ) { Node* n = &nodes(i); n = getDur().writing(n); n->k.kill(); n->setUnused(); } } /** returns false if too full */ bool put(const Key& k, const Type& value) { bool found; int i = _find(k, found); if ( i < 0 ) return false; Node* n = getDur().writing( &nodes(i) ); if ( !found ) { n->k = k; n->hash = k.hash(); } else { assert( n->hash == k.hash() ); } n->value = value; return true; } typedef void (*IteratorCallback)( const Key& k , Type& v ); void iterAll( IteratorCallback callback ) { for ( int i=0; i<n; i++ ) { if ( nodes(i).inUse() ) { callback( nodes(i).k , nodes(i).value ); } } } // TODO: should probably use boost::bind for this, but didn't want to look at it typedef void (*IteratorCallback2)( const Key& k , Type& v , void * extra ); void iterAll( IteratorCallback2 callback , void * extra ) { for ( int i=0; i<n; i++ ) { if ( nodes(i).inUse() ) { callback( nodes(i).k , nodes(i).value , extra ); } } } }; #pragma pack() } // namespace mongo
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/codecommit/CodeCommit_EXPORTS.h> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CodeCommit { namespace Model { /** * <p>Information about the size of files in a merge or pull request.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/FileSizes">AWS * API Reference</a></p> */ class AWS_CODECOMMIT_API FileSizes { public: FileSizes(); FileSizes(Aws::Utils::Json::JsonView jsonValue); FileSizes& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The size of a file in the source of a merge or pull request.</p> */ inline long long GetSource() const{ return m_source; } /** * <p>The size of a file in the source of a merge or pull request.</p> */ inline bool SourceHasBeenSet() const { return m_sourceHasBeenSet; } /** * <p>The size of a file in the source of a merge or pull request.</p> */ inline void SetSource(long long value) { m_sourceHasBeenSet = true; m_source = value; } /** * <p>The size of a file in the source of a merge or pull request.</p> */ inline FileSizes& WithSource(long long value) { SetSource(value); return *this;} /** * <p>The size of a file in the destination of a merge or pull request.</p> */ inline long long GetDestination() const{ return m_destination; } /** * <p>The size of a file in the destination of a merge or pull request.</p> */ inline bool DestinationHasBeenSet() const { return m_destinationHasBeenSet; } /** * <p>The size of a file in the destination of a merge or pull request.</p> */ inline void SetDestination(long long value) { m_destinationHasBeenSet = true; m_destination = value; } /** * <p>The size of a file in the destination of a merge or pull request.</p> */ inline FileSizes& WithDestination(long long value) { SetDestination(value); return *this;} /** * <p>The size of a file in the base of a merge or pull request.</p> */ inline long long GetBase() const{ return m_base; } /** * <p>The size of a file in the base of a merge or pull request.</p> */ inline bool BaseHasBeenSet() const { return m_baseHasBeenSet; } /** * <p>The size of a file in the base of a merge or pull request.</p> */ inline void SetBase(long long value) { m_baseHasBeenSet = true; m_base = value; } /** * <p>The size of a file in the base of a merge or pull request.</p> */ inline FileSizes& WithBase(long long value) { SetBase(value); return *this;} private: long long m_source; bool m_sourceHasBeenSet; long long m_destination; bool m_destinationHasBeenSet; long long m_base; bool m_baseHasBeenSet; }; } // namespace Model } // namespace CodeCommit } // namespace Aws
/* * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. 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 WORKLOAD_BLAST_APPLICATION_H_ #define WORKLOAD_BLAST_APPLICATION_H_ #include <json/json.h> #include <prim/prim.h> #include <string> #include "event/Component.h" #include "workload/Application.h" #include "workload/Workload.h" class MetadataHandler; namespace Blast { class Application : public ::Application { public: Application(const std::string& _name, const Component* _parent, u32 _id, Workload* _workload, MetadataHandler* _metadataHandler, Json::Value _settings); ~Application(); f64 percentComplete() const override; void start() override; void stop() override; void kill() override; void terminalWarmed(u32 _id); void terminalSaturated(u32 _id); void terminalComplete(u32 _id); void terminalDone(u32 _id); void processEvent(void* _event, s32 _type) override; private: // WARMING = sending and monitoring outstanding flits to determine if warm/sat // LOGGING = sending messages marked to be logged // BLABBING = sending messages not marked to be logged // DRAINING = not sending messages enum class Fsm {WARMING, LOGGING, BLABBING, DRAINING}; const bool killOnSaturation_; const bool logDuringSaturation_; const u64 maxSaturationCycles_; const f64 warmupThreshold_; Fsm fsm_; u32 activeTerminals_; u32 warmedTerminals_; u32 saturatedTerminals_; bool doLogging_; u32 completedTerminals_; u32 doneTerminals_; }; } // namespace Blast #endif // WORKLOAD_BLAST_APPLICATION_H_
// Copyright 2012 the V8 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. #ifndef V8_HEAP_INCREMENTAL_MARKING_JOB_H_ #define V8_HEAP_INCREMENTAL_MARKING_JOB_H_ #include "src/cancelable-task.h" namespace v8 { namespace internal { class Heap; class Isolate; // The incremental marking job uses platform tasks to perform incremental // marking steps. The job posts a foreground task that makes a small (~1ms) // step and posts another task until the marking is completed. class IncrementalMarkingJob { public: enum class TaskType { kNormal, kDelayed }; IncrementalMarkingJob() V8_NOEXCEPT = default; void Start(Heap* heap); void ScheduleTask(Heap* heap, TaskType task_type = TaskType::kNormal); private: class Task; static constexpr double kDelayInSeconds = 10.0 / 1000.0; bool IsTaskPending(TaskType task_type) { return task_type == TaskType::kNormal ? normal_task_pending_ : delayed_task_pending_; } void SetTaskPending(TaskType task_type, bool value) { if (task_type == TaskType::kNormal) { normal_task_pending_ = value; } else { delayed_task_pending_ = value; } } bool normal_task_pending_ = false; bool delayed_task_pending_ = false; }; } // namespace internal } // namespace v8 #endif // V8_HEAP_INCREMENTAL_MARKING_JOB_H_
/** * @file CollectionTaskScheduler.h * @author Zhongxia Li * @date Mar 6, 2012 * @brief */ #ifndef SF1R_PROCESS_COMMON_COLLECTION_TASK_SCHEDULER_H_ #define SF1R_PROCESS_COMMON_COLLECTION_TASK_SCHEDULER_H_ #include <vector> #include <util/singleton.h> #include <util/scheduler.h> namespace sf1r { class CollectionTask; class CollectionHandler; class CollectionTaskScheduler { public: CollectionTaskScheduler(); ~CollectionTaskScheduler(); static CollectionTaskScheduler* get() { return izenelib::util::Singleton<CollectionTaskScheduler>::get(); } bool schedule(const CollectionHandler* collectionHandler); private: typedef std::vector<boost::shared_ptr<CollectionTask> > TaskListType; TaskListType taskList_; }; } #endif /* SF1R_PROCESS_COMMON_COLLECTION_TASK_SCHEDULER_H_ */
/* * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef BitStack_h #define BitStack_h #include "core/CoreExport.h" #include "wtf/Allocator.h" #include "wtf/Vector.h" namespace blink { class Node; class CORE_EXPORT BitStack { STACK_ALLOCATED(); public: BitStack(); ~BitStack(); void push(bool); void pop(); bool top() const; unsigned size() const; private: unsigned m_size; Vector<unsigned, 1> m_words; }; } // namespace blink #endif // BitStack_h
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <memory> #include <mutex> #include <react/renderer/core/LayoutMetrics.h> #include <react/renderer/core/ReactPrimitives.h> #include "TouchEventEmitter.h" namespace facebook { namespace react { class ViewEventEmitter; using SharedViewEventEmitter = std::shared_ptr<const ViewEventEmitter>; class ViewEventEmitter : public TouchEventEmitter { public: using TouchEventEmitter::TouchEventEmitter; #pragma mark - Accessibility void onAccessibilityAction(const std::string &name) const; void onAccessibilityTap() const; void onAccessibilityMagicTap() const; void onAccessibilityEscape() const; #pragma mark - Layout void onLayout(const LayoutMetrics &layoutMetrics) const; private: mutable std::mutex layoutMetricsMutex_; mutable LayoutMetrics lastLayoutMetrics_; mutable std::shared_ptr<std::atomic_uint_fast8_t> eventCounter_{ std::make_shared<std::atomic_uint_fast8_t>(0)}; }; } // namespace react } // namespace facebook
// // arch/arm/fpu/add_32.h // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // static inline void fpu_add_32( const uint32_t *fs, const uint32_t *ft, uint32_t *fd) { }
/*========================================================================= Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cm_zlib.h,v $ Language: C++ Date: $Date: 2006-10-19 19:00:09 $ Version: $Revision: 1.1 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __cm_zlib_h #define __cm_zlib_h /* Use the zlib library configured for CMake. */ #include "cmThirdParty.h" #ifdef CMAKE_USE_SYSTEM_ZLIB # include <zlib.h> #else # include <cmzlib/zlib.h> #endif #endif
#ifndef ALIGNMENT_SAM_ALIGNMENT_TO_CMP_H5_ADAPTERH_ #define ALIGNMENT_SAM_ALIGNMENT_TO_CMP_H5_ADAPTERH_ #include "SAMAlignment.h" #include "ReferenceSequence.h" #include "data/hdf/HDFCmpFile.h" #include "datastructures/alignment/AlignmentCandidate.h" template<typename T_ReferenceSequence, typename T_CmpH5File> void StoreSAMAlignmentInCmpH5(SAMAlignment &samAlignment, vector<T_ReferenceSequence> &references, T_CmpH5File &cmpH5File) { // // } #endif
// 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 CHROME_BROWSER_IMPORTER_IMPORTER_DATA_TYPES_H_ #define CHROME_BROWSER_IMPORTER_IMPORTER_DATA_TYPES_H_ #include <string> #include "base/basictypes.h" #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/strings/string16.h" #include "chrome/browser/importer/importer_type.h" #include "net/url_request/url_request_context_getter.h" // Types needed for importing data from other browsers and the Google Toolbar. namespace importer { // An enumeration of the type of data that can be imported. enum ImportItem { NONE = 0, HISTORY = 1 << 0, FAVORITES = 1 << 1, COOKIES = 1 << 2, // Not supported yet. PASSWORDS = 1 << 3, SEARCH_ENGINES = 1 << 4, HOME_PAGE = 1 << 5, ALL = (1 << 6) - 1 // All the bits should be 1, hence the -1. }; // Information about a profile needed by an importer to do import work. struct SourceProfile { SourceProfile(); ~SourceProfile(); string16 importer_name; ImporterType importer_type; base::FilePath source_path; base::FilePath app_path; uint16 services_supported; // Bitmask of ImportItem. // The application locale. Stored because we can only access it from the UI // thread on the browser process. This is only used by the Firefox importer. std::string locale; // The URLRequestContextGetter is only used for Google Toolbar. scoped_refptr<net::URLRequestContextGetter> request_context_getter; }; } // namespace importer #endif // CHROME_BROWSER_IMPORTER_IMPORTER_DATA_TYPES_H_
/* Copyright (c) 1999-2008, Phillip Stanley-Marbell (author) 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 author 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. */ /* */ /* Programmable Interrupt Controller. Provides queued intrs. */ /* */ typedef struct Interrupt Interrupt; struct Interrupt { ulong type; ulong value; /* */ /* Used for misc things, like */ /* memaccess_type tagging. */ /* */ ulong misc; Interrupt *next; Interrupt *prev; }; typedef struct InterruptQ InterruptQ; struct InterruptQ { Interrupt *hd; Interrupt *tl; int nqintrs; };
/* * Copyright 2009, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // This file contains declarations for the Stream class. #ifndef O3D_CORE_CROSS_STREAM_H_ #define O3D_CORE_CROSS_STREAM_H_ #include <vector> #include "core/cross/field.h" #include "core/cross/param.h" namespace o3d { class ServiceLocator; // A stream object defines how Field data is interpreted by a Shape. It contains // a reference to a Field the semantic associated with it. class Stream : public ObjectBase { public: typedef SmartPointer<Stream> Ref; // Semantics used when binding buffers to the shape. They determine how // the Stream links up to the shader inputs. // TODO: replace the Stream::Semantic types with proper semantic // strings and maps that allow aliasing of semantics. enum Semantic { UNKNOWN_SEMANTIC = 0, POSITION, // Position NORMAL, // Normal TANGENT, // Tangent BINORMAL, // Binormal COLOR, // Color TEXCOORD, // Texture Coordinate }; Stream(ServiceLocator* service_locator, Field *field, unsigned int start_index, Semantic semantic, int semantic_index); // Returns a pointer to the associated Field object. Field& field() const { // This is guaranteed to be not NULL. return *field_.Get(); } // Returns the semantic specified for the Stream. Semantic semantic() const { return semantic_; } // Returns the semantic index specified for the Stream // (eg., TEXCOORD1 = 1, BINORMAL7 = 7, etc). int semantic_index() const { return semantic_index_; } // Returns the start index for the specified Stream. unsigned int start_index() const { return start_index_; } // Returns the maximum vertices available given the stream's settings // and its buffer. unsigned GetMaxVertices() const; // Gets the last field change count. unsigned int last_field_change_count() const { return last_field_change_count_; } // Sets the last field change count. void set_last_field_change_count(unsigned int count) const { last_field_change_count_ = count; } static const char* GetSemanticDescription(Semantic); private: Field::Ref field_; // which field in the buffer this stream is using unsigned int field_id_; // Used to track if the field has changed offsets. mutable unsigned int last_field_change_count_; unsigned int start_index_; Semantic semantic_; int semantic_index_; O3D_DECL_CLASS(Stream, ObjectBase); DISALLOW_COPY_AND_ASSIGN(Stream); }; // Defines a type for an array Stream objects. typedef std::vector<Stream::Ref> StreamRefVector; // A Param that can modify the contents of a vertex buffer. // NOTE: This param behaves like no other param and therefore seems a little // fishy. It feels like ParamChar (if there was such a thing) where you can do // things like: // // param->set_value(value); // value = param->value(); // param->bind(otherParamVertexBufferStream); // // But, the difference is when you call param->value(), if the param is bound to // another stream we don't copy the stream or reference to the stream like other // params. Using SlaveParamVertexBufferStream which is derived from this class // a call to value() will call UpdateValue() which will call a virtual // ComputeValue() which will update the vertex buffers in the destination stream // using whatever means the owner of the Slave param specifies. class ParamVertexBufferStream : public TypedParamBase<char> { public: typedef SmartPointer<ParamVertexBufferStream> Ref; ParamVertexBufferStream(ServiceLocator* service_locator, Stream* stream, bool dynamic, bool read_only) : TypedParamBase<char>(service_locator, dynamic, read_only), stream_(stream) { DCHECK(stream); } virtual void CopyDataFromParam(Param *source_param); const Stream& stream() { // We guarantee there will always be a stream. return *stream_.Get(); } // Marks the stream as valid so that it will not be updated again until // invalid. void ValidateStream() { Validate(); } // Updates the stream if its bound to anything. void UpdateStream() { UpdateValue(); } private: Stream::Ref stream_; O3D_DECL_CLASS(ParamVertexBufferStream, Param); DISALLOW_COPY_AND_ASSIGN(ParamVertexBufferStream); }; typedef std::vector<ParamVertexBufferStream::Ref> StreamParamVector; } // namespace o3d #endif // O3D_CORE_CROSS_STREAM_H_
/* * The Biomechanical ToolKit * Copyright (c) 2009-2014, Arnaud Barré * 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(s) 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 AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __btkAnalogOffsetRemover_h #define __btkAnalogOffsetRemover_h #include "btkProcessObject.h" #include "btkAcquisition.h" namespace btk { class AnalogOffsetRemover : public ProcessObject { public: typedef btkSharedPtr<AnalogOffsetRemover> Pointer; typedef btkSharedPtr<const AnalogOffsetRemover> ConstPointer; static Pointer New() {return Pointer(new AnalogOffsetRemover());}; // ~AnalogOffsetRemover(); // Implicit void SetRawInput(Acquisition::Pointer input) {this->SetNthInput(0, input);}; Acquisition::Pointer GetRawInput() {return this->GetInput(0);}; void SetOffsetInput(Acquisition::Pointer input) {this->SetNthInput(1, input);}; Acquisition::Pointer GetOffsetInput() {return this->GetInput(1);}; Acquisition::Pointer GetOutput() {return this->GetOutput(0);}; protected: BTK_BASICFILTERS_EXPORT AnalogOffsetRemover(); Acquisition::Pointer GetInput(int idx) {return static_pointer_cast<Acquisition>(this->GetNthInput(idx));}; Acquisition::Pointer GetOutput(int idx) {return static_pointer_cast<Acquisition>(this->GetNthOutput(idx));}; BTK_BASICFILTERS_EXPORT virtual DataObject::Pointer MakeOutput(int idx); BTK_BASICFILTERS_EXPORT virtual void GenerateData(); private: AnalogOffsetRemover(const AnalogOffsetRemover& ); // Not implemented. AnalogOffsetRemover& operator=(const AnalogOffsetRemover& ); // Not implemented. }; }; #endif // __btkAnalogOffsetRemover_h
// // Copyright (C) 2004-2006 Rational Discovery LLC // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #ifndef __RD_UFFPARAMS_H__ #define __RD_UFFPARAMS_H__ #include <string> #include <cmath> #include <map> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif namespace ForceFields { namespace UFF { const double DEG2RAD = M_PI / 180.0; const double RAD2DEG = 180.0 / M_PI; inline bool isDoubleZero(const double x) { return ((x < 1.0e-10) && (x > -1.0e-10)); } inline void clipToOne(double &x) { if (x > 1.0) { x = 1.0; } else if (x < -1.0) { x = -1.0; } } //! class to store UFF parameters for bond stretching class UFFBond { public: double kb; double r0; }; //! class to store UFF parameters for angle bending class UFFAngle { public: double ka; double theta0; }; //! class to store UFF parameters for torsions class UFFTor { public: double V; }; //! class to store UFF parameters for inversions class UFFInv { public: double K; }; //! class to store UFF parameters for van der Waals interactions class UFFVdW { public: double x_ij; double D_ij; }; //! class to store atomic parameters for the Universal Force Field class AtomicParams { public: double r1; //!< valence bond radius double theta0; //!< valence angle double x1; //!< vdW characteristic length double D1; //!< vdW atomic energy double zeta; //!< vdW scaling term double Z1; //!< effective charge double V1; //!< sp3 torsional barrier parameter double U1; //!< torsional contribution for sp2-sp3 bonds double GMP_Xi; //!< GMP Electronegativity; double GMP_Hardness; //!< GMP Hardness double GMP_Radius; //!< GMP Radius value }; namespace Params { const double lambda = 0.1332; //!< scaling factor for rBO correction const double G = 332.06; //!< bond force constant prefactor const double amideBondOrder = 1.41; //!< special case bond order for amide C-N bonds. }; //! singleton class for retrieving UFF AtomParams /*! Use the singleton like this: \verbatim ParamCollection *params=ParamCollection::getParams(); const AtomParams *ap=params("C_3"); \endverbatim If you have your own parameter data, it can be supplied as a string: \verbatim ParamCollection *params=ParamCollection::getParams(myParamData); const AtomParams *ap=params("C_3"); \endverbatim You are responsible for making sure that the data is in the correct format (see Params.cpp for an example). */ class ParamCollection { public: //! gets a pointer to the singleton ParamCollection /*! \param paramData (optional) a string with parameter data. See below for more information about this argument \return a pointer to the singleton ParamCollection <b>Notes:</b> - do <b>not</b> delete the pointer returned here - if the singleton ParamCollection has already been instantiated and \c paramData is empty, the singleton will be returned. - if \c paramData is empty and the singleton ParamCollection has not yet been instantiated, the default UFF parameters (from Params.cpp) will be used. - if \c paramData is supplied, a new singleton will be instantiated. The current instantiation (if there is one) will be deleted. */ static ParamCollection *getParams(const std::string &paramData = ""); //! Looks up the parameters for a particular UFF key and returns them. /*! \return a pointer to the AtomicParams object, NULL on failure. */ const AtomicParams *operator()(const std::string &symbol) const { std::map<std::string, AtomicParams>::const_iterator res; res = d_params.find(symbol); if (res != d_params.end()) { return &((*res).second); } return 0; } private: //! to force this to be a singleton, the constructor must be private ParamCollection(std::string paramData); static class ParamCollection *ds_instance; //!< the singleton std::map<std::string, AtomicParams> d_params; //!< the parameter map }; } } #endif
/* A simple event-driven programming library. Originally I wrote this code * for the Jim's event-loop (Jim is a Tcl interpreter) but later translated * it in form of a library for easy reuse. * * Copyright (c) 2006-2012, Salvatore Sanfilippo <antirez at gmail dot com> * 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 Redis nor the names of its contributors may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __AE_H__ #define __AE_H__ #include <time.h> #define AE_OK 0 #define AE_ERR -1 #define AE_NONE 0 /* No events registered. */ #define AE_READABLE 1 /* Fire when descriptor is readable. */ #define AE_WRITABLE 2 /* Fire when descriptor is writable. */ #define AE_BARRIER 4 /* With WRITABLE, never fire the event if the READABLE event already fired in the same event loop iteration. Useful when you want to persist things to disk before sending replies, and want to do that in a group fashion. */ #define AE_FILE_EVENTS (1<<0) #define AE_TIME_EVENTS (1<<1) #define AE_ALL_EVENTS (AE_FILE_EVENTS|AE_TIME_EVENTS) #define AE_DONT_WAIT (1<<2) #define AE_CALL_BEFORE_SLEEP (1<<3) #define AE_CALL_AFTER_SLEEP (1<<4) #define AE_NOMORE -1 #define AE_DELETED_EVENT_ID -1 /* Macros */ #define AE_NOTUSED(V) ((void) V) struct aeEventLoop; /* Types and data structures */ typedef void aeFileProc(struct aeEventLoop *eventLoop, int fd, void *clientData, int mask); typedef int aeTimeProc(struct aeEventLoop *eventLoop, long long id, void *clientData); typedef void aeEventFinalizerProc(struct aeEventLoop *eventLoop, void *clientData); typedef void aeBeforeSleepProc(struct aeEventLoop *eventLoop); /* File event structure */ typedef struct aeFileEvent { int mask; /* one of AE_(READABLE|WRITABLE|BARRIER) */ aeFileProc *rfileProc; aeFileProc *wfileProc; void *clientData; } aeFileEvent; /* Time event structure */ typedef struct aeTimeEvent { long long id; /* time event identifier. */ long when_sec; /* seconds */ long when_ms; /* milliseconds */ aeTimeProc *timeProc; aeEventFinalizerProc *finalizerProc; void *clientData; struct aeTimeEvent *prev; struct aeTimeEvent *next; int refcount; /* refcount to prevent timer events from being * freed in recursive time event calls. */ } aeTimeEvent; /* A fired event */ typedef struct aeFiredEvent { int fd; int mask; } aeFiredEvent; /* State of an event based program */ typedef struct aeEventLoop { int maxfd; /* highest file descriptor currently registered */ int setsize; /* max number of file descriptors tracked */ long long timeEventNextId; time_t lastTime; /* Used to detect system clock skew */ aeFileEvent *events; /* Registered events */ aeFiredEvent *fired; /* Fired events */ aeTimeEvent *timeEventHead; int stop; void *apidata; /* This is used for polling API specific data */ aeBeforeSleepProc *beforesleep; aeBeforeSleepProc *aftersleep; int flags; } aeEventLoop; /* Prototypes */ aeEventLoop *aeCreateEventLoop(int setsize); void aeDeleteEventLoop(aeEventLoop *eventLoop); void aeStop(aeEventLoop *eventLoop); int aeCreateFileEvent(aeEventLoop *eventLoop, int fd, int mask, aeFileProc *proc, void *clientData); void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask); int aeGetFileEvents(aeEventLoop *eventLoop, int fd); long long aeCreateTimeEvent(aeEventLoop *eventLoop, long long milliseconds, aeTimeProc *proc, void *clientData, aeEventFinalizerProc *finalizerProc); int aeDeleteTimeEvent(aeEventLoop *eventLoop, long long id); int aeProcessEvents(aeEventLoop *eventLoop, int flags); int aeWait(int fd, int mask, long long milliseconds); void aeMain(aeEventLoop *eventLoop); char *aeGetApiName(void); void aeSetBeforeSleepProc(aeEventLoop *eventLoop, aeBeforeSleepProc *beforesleep); void aeSetAfterSleepProc(aeEventLoop *eventLoop, aeBeforeSleepProc *aftersleep); int aeGetSetSize(aeEventLoop *eventLoop); int aeResizeSetSize(aeEventLoop *eventLoop, int setsize); void aeSetDontWait(aeEventLoop *eventLoop, int noWait); #endif
// Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR). // Distributed under the terms of the BSD license (see the LICENSE // file for the exact terms). // Email: hermes1d@googlegroups.com, home page: http://hpfem.org/ #ifndef _HERMES1D_H_ #define _HERMES1D_H_ #include <stdlib.h> #include <iostream> #include <fstream> #include <math.h> #include <string.h> #include "quad_std.h" #include "common.h" #include "mesh.h" #include "matrix.h" #include "quad_std.h" #include "legendre.h" #include "lobatto.h" #include "discrete.h" #include "solution.h" #include "linearizer.h" #include "transforms.h" #include "adapt.h" #include "graph.h" #include "solvers.h" #endif
/** * @file * * @brief common functions for gpg-related unit testing. * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ static int gpg_available (KeySet * conf) { int available = 0; char * gpgPath = NULL; Key * parentKey = keyNew ("system:/", KEY_END); int gpg_search_result = ELEKTRA_PLUGIN_FUNCTION (gpgGetBinary) (&gpgPath, conf, parentKey); if (gpg_search_result == 1) { available = 1; } if (gpgPath) { elektraFree (gpgPath); } keyDel (parentKey); ksDel (conf); return available; }
/* * conn_array.c * * Created on: Apr 9, 2014 * Author: mgrosvenor */ #include "q2pc_transport.h" #include "../../deps/chaste/data_structs/array/array.h" #include "../../deps/chaste/data_structs/array/array_typed_declare_template.h" #include "../../deps/chaste/data_structs/array/array_typed_define_template.h" define_array(TRANS_CONN,struct q2pc_trans_conn_s)
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef GRPCXX_SERVER_CONTEXT_H #define GRPCXX_SERVER_CONTEXT_H #include <map> #include <grpc/support/time.h> #include <grpc++/config.h> #include <grpc++/time.h> struct gpr_timespec; struct grpc_metadata; struct grpc_call; namespace grpc { template <class W, class R> class ServerAsyncReader; template <class W> class ServerAsyncWriter; template <class W> class ServerAsyncResponseWriter; template <class R, class W> class ServerAsyncReaderWriter; template <class R> class ServerReader; template <class W> class ServerWriter; template <class R, class W> class ServerReaderWriter; template <class ServiceType, class RequestType, class ResponseType> class RpcMethodHandler; template <class ServiceType, class RequestType, class ResponseType> class ClientStreamingHandler; template <class ServiceType, class RequestType, class ResponseType> class ServerStreamingHandler; template <class ServiceType, class RequestType, class ResponseType> class BidiStreamingHandler; class Call; class CallOpBuffer; class CompletionQueue; class Server; // Interface of server side rpc context. class ServerContext { public: ServerContext(); // for async calls ~ServerContext(); #ifndef GRPC_CXX0X_NO_CHRONO std::chrono::system_clock::time_point deadline() { return Timespec2Timepoint(deadline_); } #endif // !GRPC_CXX0X_NO_CHRONO gpr_timespec raw_deadline() { return deadline_; } void AddInitialMetadata(const grpc::string& key, const grpc::string& value); void AddTrailingMetadata(const grpc::string& key, const grpc::string& value); bool IsCancelled(); const std::multimap<grpc::string, grpc::string>& client_metadata() { return client_metadata_; } private: friend class ::grpc::Server; template <class W, class R> friend class ::grpc::ServerAsyncReader; template <class W> friend class ::grpc::ServerAsyncWriter; template <class W> friend class ::grpc::ServerAsyncResponseWriter; template <class R, class W> friend class ::grpc::ServerAsyncReaderWriter; template <class R> friend class ::grpc::ServerReader; template <class W> friend class ::grpc::ServerWriter; template <class R, class W> friend class ::grpc::ServerReaderWriter; template <class ServiceType, class RequestType, class ResponseType> friend class RpcMethodHandler; template <class ServiceType, class RequestType, class ResponseType> friend class ClientStreamingHandler; template <class ServiceType, class RequestType, class ResponseType> friend class ServerStreamingHandler; template <class ServiceType, class RequestType, class ResponseType> friend class BidiStreamingHandler; // Prevent copying. ServerContext(const ServerContext&); ServerContext& operator=(const ServerContext&); class CompletionOp; void BeginCompletionOp(Call* call); ServerContext(gpr_timespec deadline, grpc_metadata* metadata, size_t metadata_count); CompletionOp* completion_op_; gpr_timespec deadline_; grpc_call* call_; CompletionQueue* cq_; bool sent_initial_metadata_; std::multimap<grpc::string, grpc::string> client_metadata_; std::multimap<grpc::string, grpc::string> initial_metadata_; std::multimap<grpc::string, grpc::string> trailing_metadata_; }; } // namespace grpc #endif // GRPCXX_SERVER_CONTEXT_H
// Estimates outside torques working on our joints // Author: Max Schwarz <max.schwarz@uni-bonn.de> #ifndef TORQUEESTIMATOR_H #define TORQUEESTIMATOR_H #include <boost/shared_ptr.hpp> #include <urdf/model.h> #include <kdl/tree.hpp> #include <kdl/chainidsolver_recursive_newton_euler.hpp> class TorqueEstimator { public: TorqueEstimator(); virtual ~TorqueEstimator(); bool init(const boost::shared_ptr<KDL::Chain>& chain); void setJointState(int id, double pos, double vel, double acc); bool estimate(); double torque(int id) const; private: boost::shared_ptr<KDL::Chain> m_chain; boost::shared_ptr<KDL::ChainIdSolver_RNE> m_solver; std::vector<int> m_idMap; KDL::JntArray m_positions; KDL::JntArray m_velocities; KDL::JntArray m_accelerations; KDL::JntArray m_torques; KDL::Wrenches m_forces; }; #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_WM_SYSTEM_GESTURE_EVENT_FILTER_H_ #define ASH_WM_SYSTEM_GESTURE_EVENT_FILTER_H_ #include "ash/shell.h" #include "ash/touch/touch_uma.h" #include "base/timer.h" #include "ui/aura/event_filter.h" #include "ui/aura/window_observer.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/linear_animation.h" #include "ui/gfx/point.h" #include <map> namespace aura { class Window; } namespace ui { class LocatedEvent; } namespace ash { namespace test { class SystemGestureEventFilterTest; } namespace internal { class BezelGestureHandler; class LongPressAffordanceHandler; class SystemPinchHandler; class TouchUMA; class TwoFingerDragHandler; // An event filter which handles system level gesture events. class SystemGestureEventFilter : public aura::EventFilter, public aura::WindowObserver { public: SystemGestureEventFilter(); virtual ~SystemGestureEventFilter(); // Overridden from aura::EventFilter: virtual bool PreHandleKeyEvent(aura::Window* target, ui::KeyEvent* event) OVERRIDE; virtual bool PreHandleMouseEvent(aura::Window* target, ui::MouseEvent* event) OVERRIDE; virtual ui::TouchStatus PreHandleTouchEvent( aura::Window* target, ui::TouchEvent* event) OVERRIDE; virtual ui::EventResult PreHandleGestureEvent( aura::Window* target, ui::GestureEvent* event) OVERRIDE; // Overridden from aura::WindowObserver. virtual void OnWindowVisibilityChanged(aura::Window* window, bool visible) OVERRIDE; virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; private: friend class ash::test::SystemGestureEventFilterTest; // Removes system-gesture handlers for a window. void ClearGestureHandlerForWindow(aura::Window* window); typedef std::map<aura::Window*, SystemPinchHandler*> WindowPinchHandlerMap; // Created on demand when a system-level pinch gesture is initiated. Destroyed // when the system-level pinch gesture ends for the window. WindowPinchHandlerMap pinch_handlers_; bool system_gestures_enabled_; scoped_ptr<BezelGestureHandler> bezel_gestures_; scoped_ptr<LongPressAffordanceHandler> long_press_affordance_; scoped_ptr<TwoFingerDragHandler> two_finger_drag_; TouchUMA touch_uma_; DISALLOW_COPY_AND_ASSIGN(SystemGestureEventFilter); }; } // namespace internal } // namespace ash #endif // ASH_WM_SYSTEM_GESTURE_EVENT_FILTER_H_
/** * @file tag_featurizer.h * @author Sean Massung * @author Chase Geigle * * All files in META are released under the MIT license. For more details, * consult the file LICENSE in the root of the project. */ #ifndef META_TAG_FEATURIZER_H_ #define META_TAG_FEATURIZER_H_ #include "parser/analyzers/featurizers/tree_featurizer.h" #include "util/clonable.h" namespace meta { namespace analyzers { /** * Tokenizes parse trees by looking at labels of leaf and interior nodes. */ class tag_featurizer : public util::clonable<tree_featurizer, tag_featurizer> { public: /** * Counts occurrences of leaf and interior node labels. * @param doc The document to parse * @param tree The current parse_tree in the document */ void tree_tokenize(corpus::document& doc, const parser::parse_tree& tree) const override; /// Identifier for this featurizer const static std::string id; }; } } #endif
// // ASControlNode+Subclasses.h // Texture // // Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. // Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import <AsyncDisplayKit/ASControlNode.h> #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN /** * The subclass header _ASControlNode+Subclasses_ defines methods to be * overridden by custom nodes that subclass ASControlNode. * * These methods should never be called directly by other classes. */ @interface ASControlNode (Subclassing) /** @abstract Sends action messages for the given control events. @param controlEvents A bitmask whose set flags specify the control events for which action messages are sent. See "Control Events" in ASControlNode.h for bitmask constants. @param touchEvent An event object encapsulating the information specific to the user event. @discussion ASControlNode implements this method to send all action messages associated with controlEvents. The list of targets is constructed from prior invocations of addTarget:action:forControlEvents:. */ - (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)touchEvent; /** @abstract Sent to the control when tracking begins. @param touch The touch on the receiving control. @param touchEvent An event object encapsulating the information specific to the user event. @result YES if the receiver should respond continuously (respond when touch is dragged); NO otherwise. */ - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent; /** @abstract Sent continuously to the control as it tracks a touch within the control's bounds. @param touch The touch on the receiving control. @param touchEvent An event object encapsulating the information specific to the user event. @result YES if touch tracking should continue; NO otherwise. */ - (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)touchEvent; /** @abstract Sent to the control when tracking should be cancelled. @param touchEvent An event object encapsulating the information specific to the user event. This parameter may be nil, indicating that the cancelation was caused by something other than an event, such as the display node being removed from its supernode. */ - (void)cancelTrackingWithEvent:(nullable UIEvent *)touchEvent; /** @abstract Sent to the control when the last touch completely ends, telling it to stop tracking. @param touch The touch that ended. @param touchEvent An event object encapsulating the information specific to the user event. */ - (void)endTrackingWithTouch:(nullable UITouch *)touch withEvent:(nullable UIEvent *)touchEvent; /** @abstract Settable version of highlighted property. */ @property (getter=isHighlighted) BOOL highlighted; @end NS_ASSUME_NONNULL_END
// // ____ _ __ _ _____ // / ___\ /_\ /\/\ /\ /\ /__\ /_\ \_ \ // \ \ //_\\ / \ / / \ \ / \// //_\\ / /\/ // /\_\ \ / _ \ / /\/\ \ \ \_/ / / _ \ / _ \ /\/ /_ // \____/ \_/ \_/ \/ \/ \___/ \/ \_/ \_/ \_/ \____/ // // Copyright Samurai development team and other contributors // // http://www.samurai-framework.com // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import "Samurai_Core.h" #import "Samurai_Event.h" #import "Samurai_UIConfig.h" #import "Samurai_ViewCore.h" #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) #pragma mark - @class SamuraiActivity; @class SamuraiIntent; @interface UIWindow(Activity) @prop_strong( SamuraiActivity *, rootActivity ); @end #pragma mark - #undef activity #define activity( __name, ... ) \ interface __name : SamuraiActivity< __VA_ARGS__ > \ @end \ @implementation __name #undef activity_extend #define activity_extend( __name, __parent, ... ) \ interface __name : __parent< __VA_ARGS__ > \ @end \ @implementation __name #pragma mark - typedef enum { ActivityState_Inited = 0, ActivityState_Created, ActivityState_Activating, ActivityState_Activated, ActivityState_Deactivating, ActivityState_Deactivated, ActivityState_Destroyed } ActivityState; #pragma mark - @interface SamuraiActivity : UIViewController @joint( stateChanged ); @prop_strong( SamuraiIntent *, intent ); @prop_assign( BOOL, animated ); @prop_assign( UIInterfaceOrientation, orientation ); @prop_assign( UIInterfaceOrientationMask, orientationMask ); @prop_copy( BlockType, stateChanged ); @prop_assign( ActivityState, state ); @prop_readonly( BOOL, created ); @prop_readonly( BOOL, deactivated ); @prop_readonly( BOOL, deactivating ); @prop_readonly( BOOL, activating ); @prop_readonly( BOOL, activated ); @prop_readonly( BOOL, destroyed ); + (instancetype)activity; + (instancetype)activityWithNibName:(NSString *)nibNameOrNil; + (instancetype)activityWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; + (NSArray *)activities; - (void)changeState:(ActivityState)value; - (void)onCreate; // override point - (void)onDestroy; // override point - (void)onStart; // override point - (void)onResume; // override point - (void)onLayout; // override point - (void)onPause; // override point - (void)onStop; // override point @end #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
/*************************************************************************/ /* app_packager.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef UWP_APP_PACKAGER_H #define UWP_APP_PACKAGER_H #include "core/config/project_settings.h" #include "core/core_bind.h" #include "core/crypto/crypto_core.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" #include "core/io/marshalls.h" #include "core/io/zip_io.h" #include "core/object/class_db.h" #include "core/version.h" #include "editor/editor_export.h" #include "editor/editor_node.h" #include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/zip.h" #include <zlib.h> class AppxPackager { enum { FILE_HEADER_MAGIC = 0x04034b50, DATA_DESCRIPTOR_MAGIC = 0x08074b50, CENTRAL_DIR_MAGIC = 0x02014b50, END_OF_CENTRAL_DIR_MAGIC = 0x06054b50, ZIP64_END_OF_CENTRAL_DIR_MAGIC = 0x06064b50, ZIP64_END_DIR_LOCATOR_MAGIC = 0x07064b50, P7X_SIGNATURE = 0x58434b50, ZIP64_HEADER_ID = 0x0001, ZIP_VERSION = 20, ZIP_ARCHIVE_VERSION = 45, GENERAL_PURPOSE = 0x00, BASE_FILE_HEADER_SIZE = 30, DATA_DESCRIPTOR_SIZE = 24, BASE_CENTRAL_DIR_SIZE = 46, EXTRA_FIELD_LENGTH = 28, ZIP64_HEADER_SIZE = 24, ZIP64_END_OF_CENTRAL_DIR_SIZE = (56 - 12), END_OF_CENTRAL_DIR_SIZE = 42, BLOCK_SIZE = 65536, }; struct BlockHash { String base64_hash; size_t compressed_size = 0; }; struct FileMeta { String name; int lfh_size = 0; bool compressed = false; size_t compressed_size = 0; size_t uncompressed_size = 0; Vector<BlockHash> hashes; uLong file_crc32 = 0; ZPOS64_T zip_offset = 0; }; String progress_task; FileAccess *package = nullptr; Set<String> mime_types; Vector<FileMeta> file_metadata; ZPOS64_T central_dir_offset; ZPOS64_T end_of_central_dir_offset; Vector<uint8_t> central_dir_data; String hash_block(const uint8_t *p_block_data, size_t p_block_len); void make_block_map(const String &p_path); void make_content_types(const String &p_path); _FORCE_INLINE_ unsigned int buf_put_int16(uint16_t p_val, uint8_t *p_buf) { for (int i = 0; i < 2; i++) { *p_buf++ = (p_val >> (i * 8)) & 0xFF; } return 2; } _FORCE_INLINE_ unsigned int buf_put_int32(uint32_t p_val, uint8_t *p_buf) { for (int i = 0; i < 4; i++) { *p_buf++ = (p_val >> (i * 8)) & 0xFF; } return 4; } _FORCE_INLINE_ unsigned int buf_put_int64(uint64_t p_val, uint8_t *p_buf) { for (int i = 0; i < 8; i++) { *p_buf++ = (p_val >> (i * 8)) & 0xFF; } return 8; } _FORCE_INLINE_ unsigned int buf_put_string(String p_val, uint8_t *p_buf) { for (int i = 0; i < p_val.length(); i++) { *p_buf++ = p_val.utf8().get(i); } return p_val.length(); } Vector<uint8_t> make_file_header(FileMeta p_file_meta); void store_central_dir_header(const FileMeta &p_file, bool p_do_hash = true); Vector<uint8_t> make_end_of_central_record(); String content_type(String p_extension); public: void set_progress_task(String p_task) { progress_task = p_task; } void init(FileAccess *p_fa); Error add_file(String p_file_name, const uint8_t *p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress = false); void finish(); AppxPackager(); ~AppxPackager(); }; #endif
/* GTK - The GIMP Toolkit * gtklinkbutton.h - an hyperlink-enabled button * * Copyright (C) 2005 Emmanuele Bassi <ebassi@gmail.com> * All rights reserved. * * Based on gnome-href code by: * James Henstridge <james@daa.com.au> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif #ifndef __GTK_LINK_BUTTON_H__ #define __GTK_LINK_BUTTON_H__ #include <gtk/gtkbutton.h> G_BEGIN_DECLS #define GTK_TYPE_LINK_BUTTON (gtk_link_button_get_type ()) #define GTK_LINK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LINK_BUTTON, GtkLinkButton)) #define GTK_IS_LINK_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LINK_BUTTON)) #define GTK_LINK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LINK_BUTTON, GtkLinkButtonClass)) #define GTK_IS_LINK_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LINK_BUTTON)) #define GTK_LINK_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LINK_BUTTON, GtkLinkButtonClass)) typedef struct _GtkLinkButton GtkLinkButton; typedef struct _GtkLinkButtonClass GtkLinkButtonClass; typedef struct _GtkLinkButtonPrivate GtkLinkButtonPrivate; /** * GtkLinkButton: * * The <structname>GtkLinkButton</structname> structure contains only * private data and should be accessed using the provided API. */ struct _GtkLinkButton { /*< private >*/ GtkButton parent_instance; GtkLinkButtonPrivate *priv; }; /** * GtkLinkButtonClass: * @activate_link: class handler for the #GtkLinkButton::activate-link signal * * The <structname>GtkLinkButtonClass</structname> structure contains only * private data. */ struct _GtkLinkButtonClass { /*< private >*/ GtkButtonClass parent_class; /*< public >*/ gboolean (* activate_link) (GtkLinkButton *button); /*< private >*/ /* Padding for future expansion */ void (*_gtk_padding1) (void); void (*_gtk_padding2) (void); void (*_gtk_padding3) (void); void (*_gtk_padding4) (void); }; GType gtk_link_button_get_type (void) G_GNUC_CONST; GtkWidget * gtk_link_button_new (const gchar *uri); GtkWidget * gtk_link_button_new_with_label (const gchar *uri, const gchar *label); const gchar * gtk_link_button_get_uri (GtkLinkButton *link_button); void gtk_link_button_set_uri (GtkLinkButton *link_button, const gchar *uri); gboolean gtk_link_button_get_visited (GtkLinkButton *link_button); void gtk_link_button_set_visited (GtkLinkButton *link_button, gboolean visited); G_END_DECLS #endif /* __GTK_LINK_BUTTON_H__ */
// // TCClick.h // TCClick // // Created by YongQing Gu on 7/31/12. // Copyright (c) 2012 TrueColor. All rights reserved. // #import <Foundation/Foundation.h> @interface TCClick : NSObject{ NSString* channel; NSString* uploadUrl; } @property(nonatomic, retain) NSString* channel; @property(nonatomic, retain) NSString* uploadUrl; + (void) start:(NSString*) uploadUrl channel:(NSString*) channel; + (NSString*) udid; + (TCClick*) sharedInstance; + (bool) isDeviceJailbroken; // 记录发生了某一个事件,等同于 event:name param:name value:name + (void)event:(NSString *)name; // 记录发生了某一个事件,等同于 event:name param:name value:value + (void)event:(NSString *)name value:(NSString*)value; + (void)event:(NSString *)name param:(NSString *)param value:(NSString*)value; @end @interface TCClickDevice : NSObject + (NSString*) getUDID; + (NSString*) getModel; + (NSString*) getCarrier; + (NSString*) getResolution; + (NSString*) getNetwork; + (NSString*) getAppVersion; + (NSString*) getOsVersion; + (bool) isJailbroken; @end
/*************************************************************************** * * File : pubnub.h * Author : Kurt E. Clothier * Date : June 17, 2015 * Modified : June 25, 2015 * * Description : Pubnub header file * * Compiler : Xtensa Tools - GCC * Hardware : ESP8266 * * Preprocessor Info : http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html * More Information : http://www.pubnub.com/ * : http://www.esp8266.com/ * ****************************************************************************/ #ifndef _PUBNUB_H_ #define _PUBNUB_H_ /************************************************************************** Included Files ***************************************************************************/ #include "esp8266.h" #include "string.h" /************************************************************************** Definitions ***************************************************************************/ #define PUBNUB_ORIGIN "pubsub.pubnub.com" #define PUBNUB_DOMAIN "http://pubsub.pubnub.com" #define PUBNUB_ORIGIN_PORT 80 #define PUBNUB_CHANNEL_MAXLEN 128 #define PUBNUB_BUF_MAXLEN 256 #define PUBNUB_REPLY_MAXLEN 512 #define PUBNUB_CTX_MAX 2 #define PUBNUB_TIMER_VALUE 100 /************************************************************************** Custom Types and Structures ***************************************************************************/ typedef void (*Pubnub_subscribeCB)(char *message); // Espconn connection type typedef struct espconn Espconn; // Pubnub Transaction States enum pubnub_trans { PBTT_NONE, // No Transactions at all PBTT_INIT_SUB, // Initial subscribe to get timetoken PBTT_SUBSCRIBE, // Subscribe Transaction PBTT_PUBLISH, // Publish Transaction PBTT_LEAVE, // Leave (channel(s)) transaction }; // Pubnub States enum pubnub_state { PS_IDLE, // Line is Idle PS_WAIT_DNS, // Waiting for DNS PS_WAIT_CONNECT, // Connected PS_WAIT_SEND, // Waiting for message to send PS_WAIT_RECV, // Waiting for message to be received PS_RECV, // }; // Pubnub Last Result Codes enum pubnub_res { PNR_OK, // Success - transaction finished successfully PNR_TIMEOUT, // Time out before the request has completed PNR_IO_ERROR, // Communication error (network or HTTP response format) PNR_HTTP_ERROR, // HTTP error PNR_FORMAT_ERROR, // Undexpected input in received JSON PNR_CANCELLED, // Request cancelled by user PNR_STARTED, // Transaction started, await the outcome via process message PNR_IN_PROGRESS, // Transaction (already) ongoing, can't start a new trans PNR_RX_BUFF_NOT_EMPTY, // Recv buffer (from last trans) not read, new subscription no allowed PNR_TX_BUFF_TOO_SMALL // The buffer is too small, need to increease #PUBNUB_BUF_MAXLEN }; // Pubnub Structure - holds all relevant keys and attriutes typedef struct pubnub { const char *publish_key, *subscribe_key; const char *uuid, *auth; const char *subscribe_channel; char timetoken[64]; enum pubnub_res last_result; // Result of last Pubnub transaction enum pubnub_trans trans; // transaction state enum pubnub_state state; // pubnub state // These buffers hold information about http GET messages and replies char http_msgOut[PUBNUB_BUF_MAXLEN]; char http_reply[PUBNUB_REPLY_MAXLEN]; char http_msgIn[PUBNUB_REPLY_MAXLEN]; unsigned http_len; // These buffers hold data from the last attpemted publish char publish_message[PUBNUB_BUF_MAXLEN]; char publish_channel[PUBNUB_CHANNEL_MAXLEN]; Pubnub_subscribeCB subscribeCB; /* These in-string offsets are used for yielding messages received * by subscribe - the beginning of last yielded message and total * length of message buffer, and the same for channels. */ unsigned short msg_ofs, msg_end, chan_ofs, chan_end; } pubnub_t, Pubnub; /************************************************************************** PubNub Client API ***************************************************************************/ /** * Creates a connection to Pubnub * This should be called when a network connection is established! */ void IFA pubnub_connect(void); /** * Initialize the PubNub Connection * * @param *publish_key publish key to use in this connection * @param *subscribe_key subscribe_key key to use in this connection */ void IFA pubnub_init(const char *publish_key, const char *subscribe_key); /** * Publish message on channel using Pubnub. * JSON type message should be used, Unicode characters are injected automatically... * Example: * sprintf(buffer, "\"TEXT\""); * -- OR -- * sprintf(buffer, "{\"TEXT\":[[\"TEXT\", \"%d\"]]}", variable); * -- THEN -- * pubnub_publish(channel, buffer); * * @param *channel pubnub channel where message is published * @param *message message to be published * @return <tt>true</tt> if no errors encountered */ bool IFA pubnub_publish(const char *channel, const char *message); /** * Subscribe to a Pubnub channel * - typedef void (*Pubnub_subscribeCB)(char *message); * * Due to the limitations of single-threading, this function * must be called manually each time a subscribe is desired. * * The library can be altered to automatically handle the subscriptions, * but you lose the ability to publish at will. * * @param *channel pubnub channel to listen on * @param Pubnub_subscribeCB callback for subscribe events * * @return <tt>true</tt> on successful subscribe */ bool IFA pubnub_subscribe(const char *channel, Pubnub_subscribeCB subCB); /** * Unsubscribe to a Pubnub channel * * @param *channel pubnub channel to stop listening on * @return <tt>false</tt> if channel not found */ bool IFA pubnub_unsubscribe(const char *channel); #endif //_PUBNUB_H_
/* Copyright (C) 2014 by Gianluca Della Vedova You can redistribute this file 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. Box 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 file If not, see <http://www.gnu.org/licenses/>. */ /** @file fibo-array2.c @brief Compute the fibonacci numbers up to \c n and save the result in an array. */ #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <inttypes.h> #include <glib.h> #include "fibo-array3.h" /** Since I do not know the number of elements in the sequence, I cannot fix the array size at declaration time. I save the results in a list, and then I copy the list to an array. The last element of \c results is a sentinel with value \c 0. */ int main(int argc, char **argv) { uint32_t limit = atoi(argv[1]); uint32_t* results = fibo_array(limit); for (uint32_t n = 0; results[n] > 0; n++) printf("%" PRIu32 ": %" PRIu32 "\n", n + 1, results[n]); free(results); } /** \brief actual function */ uint32_t* fibo_array(uint32_t limit) { GSList* list = NULL; uint32_t prev = 1; uint32_t prev2 = 1; uint32_t actual = 0; if (limit >= 1) list = g_slist_append(list, GINT_TO_POINTER(1)); if (limit >= 2) list = g_slist_append(list, GINT_TO_POINTER(1)); for (uint32_t n = 2; actual <= limit; n++) { actual = prev + prev2; list = g_slist_append(list, GINT_TO_POINTER(actual)); prev2 = prev; prev = actual; } uint32_t size = g_slist_length(list); uint32_t* results = malloc((size + 1) * sizeof(uint32_t)); uint32_t i = 0; for (GSList* p = list; p != NULL; p = g_slist_next(p), i++) { results[i] = GPOINTER_TO_INT(p->data); } results[i] = 0; g_slist_free(list); return results; }
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by win32.rc // #define IDR_LICENSE 104 #define IDR_IMAGEDATABASE 105 #define IDB_LAUNCHERTREE_CLOSED 130 #define IDB_LAUNCHERTREE_OPEN 131 #define IDI_APP 141 #define IDI_APP_J 142 #define IDI_NES 143 #define IDI_NES_J 144 #define IDI_UNF 145 #define IDI_UNF_J 146 #define IDI_FDS 147 #define IDI_NSF 148 #define IDI_NSF_J 149 #define IDI_PAD 152 #define IDI_PAD_J 153 #define IDC_CURSOR_GUN 161 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 3064 #define _APS_NEXT_COMMAND_VALUE 4106 #define _APS_NEXT_CONTROL_VALUE 5163 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
#include <stdio.h> asm (".secondary bar"); asm (".weak bar"); void bar (void) { printf ("secondary bar\n"); } void xxx (void) { printf ("xxx\n"); }
/* Copyright (C) 2008-2017 Free Software Foundation, Inc. Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <utmp.h> #include <utmpx.h> #include "utmp-compat.h" #undef weak_alias #define weak_alias(n,a) #define pututxline __pututxline #include "login/pututxline.c" #undef pututxline default_symbol_version (__pututxline, pututxline, UTMP_COMPAT_BASE);
//===--- Tool.h - The LLVM Compiler Driver ----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open // Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Tool abstract base class - an interface to tool descriptions. // //===----------------------------------------------------------------------===// #ifndef LLVM_INCLUDE_COMPILER_DRIVER_TOOL_H #define LLVM_INCLUDE_COMPILER_DRIVER_TOOL_H #include "llvm/CompilerDriver/Action.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/Path.h" #include <string> #include <vector> #include <utility> namespace llvmc { class LanguageMap; typedef std::vector<std::pair<unsigned, std::string> > ArgsVector; typedef std::vector<llvm::sys::Path> PathVector; typedef std::vector<std::string> StrVector; typedef llvm::StringSet<> InputLanguagesSet; /// Tool - Represents a single tool. class Tool : public llvm::RefCountedBaseVPTR<Tool> { public: virtual ~Tool() {} /// GenerateAction - Generate an Action given particular command-line /// options. Returns non-zero value on error. virtual int GenerateAction (Action& Out, const PathVector& inFiles, const bool HasChildren, const llvm::sys::Path& TempDir, const InputLanguagesSet& InLangs, const LanguageMap& LangMap) const = 0; /// GenerateAction - Generate an Action given particular command-line /// options. Returns non-zero value on error. virtual int GenerateAction (Action& Out, const llvm::sys::Path& inFile, const bool HasChildren, const llvm::sys::Path& TempDir, const InputLanguagesSet& InLangs, const LanguageMap& LangMap) const = 0; virtual const char* Name() const = 0; virtual const char** InputLanguages() const = 0; virtual const char** OutputLanguages() const = 0; virtual bool IsJoin() const = 0; virtual bool WorksOnEmpty() const = 0; protected: /// OutFileName - Generate the output file name. llvm::sys::Path OutFilename(const llvm::sys::Path& In, const llvm::sys::Path& TempDir, bool StopCompilation, const char* OutputSuffix) const; StrVector SortArgs(ArgsVector& Args) const; }; /// JoinTool - A Tool that has an associated input file list. class JoinTool : public Tool { public: void AddToJoinList(const llvm::sys::Path& P) { JoinList_.push_back(P); } void ClearJoinList() { JoinList_.clear(); } bool JoinListEmpty() const { return JoinList_.empty(); } int GenerateAction(Action& Out, const bool HasChildren, const llvm::sys::Path& TempDir, const InputLanguagesSet& InLangs, const LanguageMap& LangMap) const { return GenerateAction(Out, JoinList_, HasChildren, TempDir, InLangs, LangMap); } // We shouldn't shadow base class's version of GenerateAction. using Tool::GenerateAction; private: PathVector JoinList_; }; } #endif // LLVM_INCLUDE_COMPILER_DRIVER_TOOL_H
/* * drivers/devfreq/dramfreq/sunxi-mdfs.h * * Copyright(c) 2013-2015 Allwinnertech Co., Ltd. * * Author: Pan Nan <pannan@allwinnertech.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. */ #ifndef __MDFS_H__ #define __MDFS_H__ #include <asm/memory.h> #ifdef CONFIG_ARCH_SUN9IW1P1 /* register define */ #define MCTL_COM_BASE (0xf1c62000) #define MCTL_CTL_BASE (0xf1c63000) #define MCTL_PHY_BASE (0xf1c65000) #define CCM_PLL_BASE (0xf6000000) #define CCM_MOD_BASE (0xf6000400) #define UART_BASE (0xf7000000) #define R_PRCM_BASE (0xf8001400) #define CNT64_CTRL_REG (0xf8001c00) #define MC_CR (MCTL_COM_BASE + 0x00) #define MC_CCR (MCTL_COM_BASE + 0x04) #define MC_RMCR (MCTL_COM_BASE + 0x10) #define M0_STATR (MCTL_CTL_BASE + 0x004) #define M0_MRCTRL0 (MCTL_CTL_BASE + 0x010) #define M0_PWRCTL (MCTL_CTL_BASE + 0x030) #define M0_RFSHCTL3 (MCTL_CTL_BASE + 0x060) #define M0_ODTMAP (MCTL_CTL_BASE + 0x244) #define M0_DCMDAPC (MCTL_CTL_BASE + 0x304) #define P0_PIR (MCTL_PHY_BASE + 0x004) #define P0_PGSR0 (MCTL_PHY_BASE + 0x018) #define P0_PLLGCR (MCTL_PHY_BASE + 0x020) #define P0_PTR1 (MCTL_PHY_BASE + 0x028) #define P0_MR1 (MCTL_PHY_BASE + 0x0a0) #define P0_DTCR (MCTL_PHY_BASE + 0x0B0) #define CCM_PLL6_DDR_REG (CCM_PLL_BASE + 0x014) #define CCM_DRAMCLK_CFG_REG (CCM_MOD_BASE + 0x084) #define CCM_AHB0_SOFT_RST_REG (CCM_MOD_BASE + 0x1a0) #define CCM_AHB0_CLK_GAT_REG (CCM_MOD_BASE + 0x180) #define SUART_THR (UART_BASE + 0x00) #define SUART_USR (UART_BASE + 0x7c) #define VDD_SYS_POFF_GATING (R_PRCM_BASE + 0x110) #define CNT64_LOW_REG (CNT64_CTRL_REG + 0x04) #define CNT64_HIGH_REG (CNT64_CTRL_REG + 0x08) #elif defined(CONFIG_ARCH_SUN8IW5P1) /* register define */ #define MCTL_COM_BASE (0xf1c62000) #define MCTL_CTL_BASE (0xf1c63000) #define CCM_PLL_BASE (0xf1c20000) #define UART_BASE (0xf1c28000) #define R_PRCM_BASE (0xf1f01400) #define R_CPU_CFG_REG (0xf1f01c00) #define MC_WORK_MODE (MCTL_COM_BASE + 0x00) #define MC_MAER (MCTL_COM_BASE + 0x94) #define MC_MDFSCR (MCTL_COM_BASE + 0x100) #define MC_MDFSMER (MCTL_COM_BASE + 0x104) #define MC_MDFSMRMR (MCTL_COM_BASE + 0x108) #define PIR (MCTL_CTL_BASE + 0x00) #define MC_CLKEN (MCTL_CTL_BASE + 0x0c) #define PWRCTL (MCTL_CTL_BASE + 0x04) #define PGSR0 (MCTL_CTL_BASE + 0x10) #define STATR (MCTL_CTL_BASE + 0x18) #define PLLGCR (MCTL_CTL_BASE + 0x40) #define PTR1 (MCTL_CTL_BASE + 0x48) #define DTCR (MCTL_CTL_BASE + 0xc0) #define ODTMAP (MCTL_CTL_BASE + 0x120) #define DXnGCR0(x) (MCTL_CTL_BASE + 0x344 + 0x80*(x)) #define _CCM_PLL_DDR0_REG (CCM_PLL_BASE + 0x20) #define _CCM_PLL_DDR1_REG (CCM_PLL_BASE + 0x4C) #define CCM_DRAM_CFG_REG (CCM_PLL_BASE + 0xf4) #define _CCM_PLL_DDR_CFG_REG (CCM_PLL_BASE + 0xf8) #define _CCM_PLL_DDR1_PATTERN_REG (CCM_PLL_BASE + 0x2ac) #define _CCM_PLL_DDR0_PATTERN_REG (CCM_PLL_BASE + 0x290) #define SUART_THR (UART_BASE + 0x00) #define SUART_USR (UART_BASE + 0x7c) #define VDD_SYS_POFF_GATING (R_PRCM_BASE + 0x110) #define CNT64_CTRL_REG (R_CPU_CFG_REG + 0x280) #define CNT64_LOW_REG (R_CPU_CFG_REG + 0x284) #define CNT64_HIGH_REG (R_CPU_CFG_REG + 0x288) #endif typedef struct __DRAM_PARA { unsigned int dram_clk; unsigned int dram_type; //dram_type DDR2: 2; DDR3: 3; LPDDR2: 6; LPDDR3: 7; DDR3L: 31 unsigned int dram_zq; //[7:0] for CK/CA [15:8] for DX0/1 [23:16] for DX2/3 unsigned int dram_odt_en; unsigned int dram_para1; //[31:30]-channel_enable [29:28]-channel_number [27:24]-bank_size [23:16]-row_width [15:8]-bus_width [7:4]-rank [3:0]-page_size unsigned int dram_para2; //[2]-single_chip_DQ_width [1:0]-single_chip_density unsigned int dram_mr0; unsigned int dram_mr1; unsigned int dram_mr2; unsigned int dram_mr3; unsigned int dram_tpr0; unsigned int dram_tpr1; unsigned int dram_tpr2; unsigned int dram_tpr3; unsigned int dram_tpr4; //[0]-1T/2T [4]-half_dq unsigned int dram_tpr5; unsigned int dram_tpr6; //[0]-wake_branch unsigned int dram_tpr7; unsigned int dram_tpr8; unsigned int dram_tpr9; unsigned int dram_tpr10; unsigned int dram_tpr11; unsigned int dram_tpr12; unsigned int dram_tpr13; } __dram_para_t; static inline unsigned long ddr_save_sp(unsigned long new_sp) { unsigned long old_sp; asm volatile ("mov %0, sp" : "=r" (old_sp)); asm volatile ("mov sp, %0" :: "r" (new_sp)); return old_sp; } /* sp define */ #define SRAM_DDRFREQ_SP_ADDR (SRAM_DDRFREQ_OFFSET + 0x2000) #define DDR_SAVE_SP(save_sp) do { save_sp = ddr_save_sp(((unsigned long)SRAM_DDRFREQ_SP_ADDR)); } while (0) #define DDR_RESTORE_SP(save_sp) do { ddr_save_sp(save_sp); } while (0) #define mctl_read_w(n) (*((volatile unsigned int *)(n))) #define mctl_write_w(c,n) (*((volatile unsigned int *)(n)) = (c)) extern int __sram mdfs_main(unsigned int jump, __dram_para_t *dram_para, unsigned int pll_para_from_dram, unsigned int div); #endif /* __MDFS_H__ */
/* Copyright (C) 1996-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <math.h> #ifndef FUNC # define FUNC lrint #endif #ifndef ITYPE # define ITYPE double # define IREGS "d" #else # ifndef IREGS # error IREGS not defined # endif #endif #ifndef OTYPE # define OTYPE long int #endif #define OREGS "x" #define __CONCATX(a,b) __CONCAT(a,b) OTYPE __CONCATX(__,FUNC) (ITYPE x) { OTYPE result; ITYPE temp; asm ( "frintx" "\t%" IREGS "1, %" IREGS "2\n\t" "fcvtzs" "\t%" OREGS "0, %" IREGS "1" : "=r" (result), "=w" (temp) : "w" (x) ); return result; } weak_alias (__CONCATX(__,FUNC), FUNC)
/*! \file servo.c \brief Interrupt-driven RC Servo function library. */ //***************************************************************************** // // File Name : 'servo.c' // Title : Interrupt-driven RC Servo function library // Author : Pascal Stang - Copyright (C) 2002 // Created : 7/31/2002 // Revised : 8/02/2002 // Version : 1.0 // Target MCU : Atmel AVR Series // Editor Tabs : 4 // // This code is distributed under the GNU Public License // which can be found at http://www.gnu.org/licenses/gpl.txt // //***************************************************************************** #ifndef WIN32 #include <avr/io.h> #endif #include "global.h" #include "servo.h" // Program ROM constants // Global variables // servo channel registers u16 ServoPosTics; u16 ServoPeriodTics; u08 ServoChannel; ServoChannelType ServoChannels[SERVO_NUM_CHANNELS]; // functions //! initializes software PWM system void servoInit(void) { u08 channel; // disble the timer1 output compare A interrupt cbi(TIMSK, OCIE1A); // set the prescaler for timer1 timer1SetPrescaler(TIMER_CLK_DIV256); // attach the software PWM service routine to timer1 output compare A timerAttach(TIMER1OUTCOMPAREA_INT, servoService); // enable and clear channels for(channel=0; channel<SERVO_NUM_CHANNELS; channel++) { // set minimum position as default ServoChannels[channel].duty = SERVO_MIN; // set default port and pins assignments ServoChannels[channel].port = _SFR_IO_ADDR(SERVO_DEFAULT_PORT); //ServoChannels[channel].port = (unsigned char)&SERVO_DEFAULT_PORT; ServoChannels[channel].pin = (1<<channel); // set channel pin to output // THIS IS OBSOLETED BY THE DYNAMIC CHANNEL TO PORT,PIN ASSIGNMENTS //outb(SERVODDR, inb(SERVODDR) | (1<<channel)); } // set PosTics ServoPosTics = 0; // set PeriodTics ServoPeriodTics = SERVO_MAX*9; // set initial interrupt time u16 OCValue; // read in current value of output compare register OCR1A OCValue = inb(OCR1AL); // read low byte of OCR1A OCValue += inb(OCR1AH)<<8; // read high byte of OCR1A // increment OCR1A value by nextTics OCValue += ServoPeriodTics; // set future output compare time to this new value outb(OCR1AH, (OCValue>>8)); // write high byte outb(OCR1AL, (OCValue & 0x00FF)); // write low byte // enable the timer1 output compare A interrupt sbi(TIMSK, OCIE1A); } //! turns off software PWM system void servoOff(void) { // disable the timer1 output compare A interrupt cbi(TIMSK, OCIE1A); // detach the service routine timerDetach(TIMER1OUTCOMPAREA_INT); } //! set port and I/O pin for channel void servoSetChannelIO(u08 channel, u08 port, u08 pin) { ServoChannels[channel].port = port; ServoChannels[channel].pin = (1<<(pin&0x07)); } //! set servo position on channel void servoSetPosition(u08 channel, u08 position) { // input should be between 0 and SERVO_POSITION_MAX u16 pos_scaled; // calculate scaled position pos_scaled = ((u16)position*(SERVO_MAX-SERVO_MIN)/SERVO_POSITION_MAX)+SERVO_MIN; // set position servoSetPositionRaw(channel, pos_scaled); } //! get servo position on channel u08 servoGetPosition(u08 channel) { return (u08)( ((servoGetPositionRaw(channel)-SERVO_MIN)*SERVO_POSITION_MAX)/(SERVO_MAX-SERVO_MIN) ); } //! set servo position on channel (raw unscaled format) void servoSetPositionRaw(u08 channel, u16 position) { // bind to limits position = MAX(position, SERVO_MIN); position = MIN(position, SERVO_MAX); // set position ServoChannels[channel].duty = position; } //! get servo position on channel (raw unscaled format) u16 servoGetPositionRaw(u08 channel) { return ServoChannels[channel].duty; } void servoService(void) { u16 nextTics; if(ServoChannel < SERVO_NUM_CHANNELS) { // turn off current channel outb(_SFR_IO8(ServoChannels[ServoChannel].port), inb(_SFR_IO8(ServoChannels[ServoChannel].port)) & ~(ServoChannels[ServoChannel].pin)); } // next channel ServoChannel++; if(ServoChannel != SERVO_NUM_CHANNELS) { // loop to channel 0 if needed if(ServoChannel > SERVO_NUM_CHANNELS) ServoChannel = 0; // turn on new channel outb(_SFR_IO8(ServoChannels[ServoChannel].port), inb(_SFR_IO8(ServoChannels[ServoChannel].port)) | (ServoChannels[ServoChannel].pin)); // schedule turn off time nextTics = ServoChannels[ServoChannel].duty; } else //(Channel == SERVO_NUM_CHANNELS) { // ***we could save time by precalculating this // schedule end-of-period nextTics = ServoPeriodTics-ServoPosTics; } // schedule next interrupt u16 OCValue; // read in current value of output compare register OCR1A OCValue = inb(OCR1AL); // read low byte of OCR1A OCValue += inb(OCR1AH)<<8; // read high byte of OCR1A // increment OCR1A value by nextTics OCValue += nextTics; // OCR1A+=nextTics; // set future output compare time to this new value outb(OCR1AH, (OCValue>>8)); // write high byte outb(OCR1AL, (OCValue & 0x00FF)); // write low byte // set our new tic position ServoPosTics += nextTics; if(ServoPosTics >= ServoPeriodTics) ServoPosTics = 0; }
/* gr_rect.h */ #include <e_gem.h> /********** structs **********/ typedef struct { GRECT *rects; int max,used; } dirty_rect; /********* functions ************/ dirty_rect *new_dirty_rect(int size); void delete_dirty_rect(dirty_rect *this); int add_dirty_rect(dirty_rect *dr,GRECT *area); int get_dirty_rect(dirty_rect* dr,GRECT *area); int clear_dirty_rect(dirty_rect *dr); int resize_dirty_rect(dirty_rect *dr,int new_size);
/* * Copyright (C) 2013 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation version 2. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether express or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <stdarg.h> #include <linux/smp.h> #include <linux/io.h> #include <linux/ioport.h> #include <asm/cacheflush.h> #include <linux/of_address.h> #include "bcm_kona_smc.h" static u32 bcm_smc_buffer_phys; /* physical address */ static void __iomem *bcm_smc_buffer; /* virtual address */ struct bcm_kona_smc_data { unsigned service_id; unsigned arg0; unsigned arg1; unsigned arg2; unsigned arg3; unsigned result; }; static const struct of_device_id bcm_kona_smc_ids[] __initconst = { {.compatible = "brcm,kona-smc"}, {.compatible = "bcm,kona-smc"}, /* deprecated name */ {}, }; /* Map in the args buffer area */ int __init bcm_kona_smc_init(void) { struct device_node *node; const __be32 *prop_val; u64 prop_size = 0; unsigned long buffer_size; u32 buffer_phys; /* Read buffer addr and size from the device tree node */ node = of_find_matching_node(NULL, bcm_kona_smc_ids); if (!node) return -ENODEV; prop_val = of_get_address(node, 0, &prop_size, NULL); if (!prop_val) return -EINVAL; /* We assume space for four 32-bit arguments */ if (prop_size < 4 * sizeof(u32) || prop_size > (u64)ULONG_MAX) return -EINVAL; buffer_size = (unsigned long)prop_size; buffer_phys = be32_to_cpup(prop_val); if (!buffer_phys) return -EINVAL; bcm_smc_buffer = ioremap(buffer_phys, buffer_size); if (!bcm_smc_buffer) return -ENOMEM; bcm_smc_buffer_phys = buffer_phys; pr_info("Kona Secure API initialized\n"); return 0; } /* * int bcm_kona_do_smc(u32 service_id, u32 buffer_addr) * * Only core 0 can run the secure monitor code. If an "smc" request * is initiated on a different core it must be redirected to core 0 * for execution. We rely on the caller to handle this. * * Each "smc" request supplies a service id and the address of a * buffer containing parameters related to the service to be * performed. A flags value defines the behavior of the level 2 * cache and interrupt handling while the secure monitor executes. * * Parameters to the "smc" request are passed in r4-r6 as follows: * r4 service id * r5 flags (SEC_ROM_*) * r6 physical address of buffer with other parameters * * Execution of an "smc" request produces two distinct results. * * First, the secure monitor call itself (regardless of the specific * service request) can succeed, or can produce an error. When an * "smc" request completes this value is found in r12; it should * always be SEC_EXIT_NORMAL. * * In addition, the particular service performed produces a result. * The values that should be expected depend on the service. We * therefore return this value to the caller, so it can handle the * request result appropriately. This result value is found in r0 * when the "smc" request completes. */ #ifdef __clang__ #define R12 "r12" #else /* !__clang__ */ #define R12 "ip" /* gcc calls r12 "ip" */ #endif /* !__clang__ */ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) { register u32 ip asm(R12); /* Also called r12 */ register u32 r0 asm("r0"); register u32 r4 asm("r4"); register u32 r5 asm("r5"); register u32 r6 asm("r6"); r4 = service_id; r5 = 0x3; /* Keep IRQ and FIQ off in SM */ r6 = buffer_phys; asm volatile ( /* Make sure we got the registers we want */ __asmeq("%0", R12) __asmeq("%1", "r0") __asmeq("%2", "r4") __asmeq("%3", "r5") __asmeq("%4", "r6") #ifdef REQUIRES_SEC ".arch_extension sec\n" #endif " smc #0\n" : "=r" (ip), "=r" (r0) : "r" (r4), "r" (r5), "r" (r6) : "r1", "r2", "r3", "r7", "lr"); BUG_ON(ip != SEC_EXIT_NORMAL); return r0; } /* __bcm_kona_smc() should only run on CPU 0, with pre-emption disabled */ static void __bcm_kona_smc(void *info) { struct bcm_kona_smc_data *data = info; u32 *args = bcm_smc_buffer; BUG_ON(smp_processor_id() != 0); BUG_ON(!args); /* Copy the four 32 bit argument values into the bounce area */ writel_relaxed(data->arg0, args++); writel_relaxed(data->arg1, args++); writel_relaxed(data->arg2, args++); writel(data->arg3, args); /* Flush caches for input data passed to Secure Monitor */ flush_cache_all(); /* Trap into Secure Monitor and record the request result */ data->result = bcm_kona_do_smc(data->service_id, bcm_smc_buffer_phys); } unsigned bcm_kona_smc(unsigned service_id, unsigned arg0, unsigned arg1, unsigned arg2, unsigned arg3) { struct bcm_kona_smc_data data; data.service_id = service_id; data.arg0 = arg0; data.arg1 = arg1; data.arg2 = arg2; data.arg3 = arg3; data.result = 0; /* * Due to a limitation of the secure monitor, we must use the SMP * infrastructure to forward all secure monitor calls to Core 0. */ smp_call_function_single(0, __bcm_kona_smc, &data, 1); return data.result; }
/* ** ** Copyright 2008, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ #ifndef _DBG_CAM_N3D_PARAM_H #define _DBG_CAM_N3D_PARAM_H #include "dbg_n3d_ae_param.h" #include "dbg_n3d_awb_param.h" //Common Parameter Structure typedef enum { N3D_TAG_VERSION = 0, }DEBUG_N3D_TAG_T; // Native3D debug info #define N3D_DEBUG_TAG_SIZE (N3D_AE_DEBUG_TAG_SIZE+N3D_AWB_DEBUG_TAG_SIZE) #define N3D_DEBUG_TAG_VERSION 1 typedef struct DEBUG_N3D_INFO_S { DEBUG_CAM_TAG_T Tag[N3D_DEBUG_TAG_SIZE]; } DEBUG_N3D_INFO_T; #define DEBUG_N3D_AE_MODULE_ID 0x0001 #define DEBUG_N3D_AWB_MODULE_ID 0x0002 #define N3DAAATAG(module_id, tag, line_keep) \ ( (MINT32) \ ((MUINT32)(0x00000000) | \ (MUINT32)((module_id & 0xff) << 24) | \ (MUINT32)((line_keep & 0x01) << 23) | \ (MUINT32)(tag & 0xffff)) \ ) typedef struct { N3D_AE_DEBUG_INFO_T rAEDebugInfo; N3D_AWB_DEBUG_INFO_T rAWBDebugInfo; } N3D_DEBUG_INFO_T; #endif //_DBG_CAM_N3D_PARAM_H
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, 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. ------------------------------------------------------------------------- */ #ifdef FIX_CLASS // clang-format off FixStyle(client/md,FixClientMD); // clang-format on #else #ifndef LMP_FIX_CLIENT_MD_H #define LMP_FIX_CLIENT_MD_H #include "fix.h" namespace LAMMPS_NS { class FixClientMD : public Fix { public: FixClientMD(class LAMMPS *, int, char **); ~FixClientMD() override; int setmask() override; void init() override; void setup(int) override; void min_setup(int) override; void post_force(int) override; void min_post_force(int) override; double compute_scalar() override; private: int maxatom, units, server_error; double eng; double inv_nprocs; double fconvert, econvert, pconvert; double box[3][3]; double *xpbc; void pack_coords(); void pack_box(); void receive_fev(int); }; } // namespace LAMMPS_NS #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. */
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* Meta tile preview */ /* * Copyright (C) 2010 Florian Müllner * * 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 META_TILE_PREVIEW_H #define META_TILE_PREVIEW_H #include "boxes.h" #include "types.h" typedef struct _MetaTilePreview MetaTilePreview; MetaTilePreview *meta_tile_preview_new (int screen_number); void meta_tile_preview_free (MetaTilePreview *preview); void meta_tile_preview_show (MetaTilePreview *preview, MetaRectangle *rect, MetaScreen *screen); void meta_tile_preview_hide (MetaTilePreview *preview); #endif /* META_TILE_PREVIEW_H */
/* Single-precision floating point e^x. Copyright (C) 1997, 1998, 2005, 2006, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Geoffrey Keating <geoffk@ozemail.com.au> The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* How this works: The input value, x, is written as x = n * ln(2) + t/512 + delta[t] + x; where: - n is an integer, 127 >= n >= -150; - t is an integer, 177 >= t >= -177 - delta is based on a table entry, delta[t] < 2^-28 - x is whatever is left, |x| < 2^-10 Then e^x is approximated as e^x = 2^n ( e^(t/512 + delta[t]) + ( e^(t/512 + delta[t]) * ( p(x + delta[t] + n * ln(2)) - delta ) ) ) where - p(x) is a polynomial approximating e(x)-1; - e^(t/512 + delta[t]) is obtained from a table. The table used is the same one as for the double precision version; since we have the table, we might as well use it. It turns out to be faster to do calculations in double precision than to perform an 'accurate table method' expf, because of the range reduction overhead (compare exp2f). */ #include <float.h> #include <ieee754.h> #include <math.h> #include <fenv.h> #include <inttypes.h> #include <math_private.h> extern const float __exp_deltatable[178]; extern const double __exp_atable[355] /* __attribute__((mode(DF))) */; static const float TWOM100 = 7.88860905e-31; static const float TWO127 = 1.7014118346e+38; float __ieee754_expf (float x) { static const float himark = 88.72283935546875; static const float lomark = -103.972084045410; /* Check for usual case. */ if (isless (x, himark) && isgreater (x, lomark)) { static const float THREEp42 = 13194139533312.0; static const float THREEp22 = 12582912.0; /* 1/ln(2). */ #undef M_1_LN2 static const float M_1_LN2 = 1.44269502163f; /* ln(2) */ #undef M_LN2 static const double M_LN2 = .6931471805599452862; int tval; double x22, t, result, dx; float n, delta; union ieee754_double ex2_u; fenv_t oldenv; libc_feholdexcept_setroundf (&oldenv, FE_TONEAREST); /* Calculate n. */ n = x * M_1_LN2 + THREEp22; n -= THREEp22; dx = x - n*M_LN2; /* Calculate t/512. */ t = dx + THREEp42; t -= THREEp42; dx -= t; /* Compute tval = t. */ tval = (int) (t * 512.0); if (t >= 0) delta = - __exp_deltatable[tval]; else delta = __exp_deltatable[-tval]; /* Compute ex2 = 2^n e^(t/512+delta[t]). */ ex2_u.d = __exp_atable[tval+177]; ex2_u.ieee.exponent += (int) n; /* Approximate e^(dx+delta) - 1, using a second-degree polynomial, with maximum error in [-2^-10-2^-28,2^-10+2^-28] less than 5e-11. */ x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta; /* Return result. */ libc_fesetenvf (&oldenv); result = x22 * ex2_u.d + ex2_u.d; return (float) result; } /* Exceptional cases: */ else if (isless (x, himark)) { if (__isinff (x)) /* e^-inf == 0, with no error. */ return 0; else /* Underflow */ return TWOM100 * TWOM100; } else /* Return x, if x is a NaN or Inf; or overflow, otherwise. */ return TWO127*x; } strong_alias (__ieee754_expf, __expf_finite)
#include "store_null.h" #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <limits.h> static int tile_read(struct storage_backend * store, const char *xmlconfig, const char *options, int x, int y, int z, char *buf, size_t sz, int * compressed, char * err_msg) { snprintf(err_msg, PATH_MAX - 1, "Cannot read from NULL storage."); return -1; } static struct stat_info tile_stat(struct storage_backend * store, const char *xmlconfig, const char *options, int x, int y, int z) { struct stat_info tile_stat; tile_stat.size = -1; tile_stat.atime = 0; tile_stat.mtime = 0; tile_stat.ctime = 0; tile_stat.expired = 1; return tile_stat; } static int metatile_write(struct storage_backend * store, const char *xmlconfig, const char *options, int x, int y, int z, const char *buf, int sz) { // fake like we actually wrote the tile, but we didn't... return sz; } static int metatile_delete(struct storage_backend * store, const char *xmlconfig, int x, int y, int z) { return 0; } static int metatile_expire(struct storage_backend * store, const char *xmlconfig, int x, int y, int z) { return 0; } static char * tile_storage_id(struct storage_backend * store, const char *xmlconfig, const char *options, int x, int y, int z, char * string) { snprintf(string, PATH_MAX - 1, "null://"); return string; } static int close_storage(struct storage_backend * store) { return 0; } struct storage_backend *init_storage_null() { struct storage_backend *store = malloc(sizeof *store); if (store == NULL) { log_message(STORE_LOGLVL_ERR, "init_storage_null: Failed to allocate memory for storage backend"); return NULL; } store->storage_ctx = NULL; store->tile_read = &tile_read; store->tile_stat = &tile_stat; store->metatile_write = &metatile_write; store->metatile_delete = &metatile_delete; store->metatile_expire = &metatile_expire; store->tile_storage_id = &tile_storage_id; store->close_storage = &close_storage; return store; }
/* * This file is part of cc-oci-runtime. * * Copyright (C) 2016 Intel Corporation * * 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 <stdbool.h> #include <string.h> #include <errno.h> #include <glib.h> #include <glib/gstdio.h> #include "oci.h" #include "util.h" #include "runtime.h" /*! * Update the specified config with the runtime path. * * \param config \ref cc_oci_config. * * \return \c true on success, else \c false. */ gboolean cc_oci_runtime_path_get (struct cc_oci_config *config) { if (! config) { return false; } if (! config->optarg_container_id) { return false; } g_snprintf (config->state.runtime_path, (gulong)sizeof (config->state.runtime_path), "%s/%s", config->root_dir ? config->root_dir : CC_OCI_RUNTIME_DIR_PREFIX, config->optarg_container_id); return true; } /*! * Create the runtime path specified by \p config. * * \param config \ref cc_oci_config. * * \return \c true on success, else \c false. */ gboolean cc_oci_runtime_dir_setup (struct cc_oci_config *config) { g_autofree gchar *dirname = NULL; if (! config) { return false; } /* XXX: This test is expected to fail normally, but by * performing the check here, the tests can subvert * the path. */ if (! config->state.runtime_path[0]) { if (! cc_oci_runtime_path_get (config)) { return false; } } g_snprintf (config->state.comms_path, (gulong)sizeof (config->state.comms_path), "%s/%s", config->state.runtime_path, CC_OCI_HYPERVISOR_SOCKET); g_snprintf (config->state.procsock_path, (gulong)sizeof (config->state.procsock_path), "%s/%s", config->state.runtime_path, CC_OCI_PROCESS_SOCKET); dirname = g_path_get_dirname (config->state.runtime_path); if (! dirname) { return false; } if (g_mkdir_with_parents (dirname, CC_OCI_DIR_MODE)) { g_critical ("failed to create directory %s: %s", dirname, strerror (errno)); } g_debug ("creating directory %s", config->state.runtime_path); return ! g_mkdir_with_parents (config->state.runtime_path, CC_OCI_DIR_MODE); } /*! * Recursively delete the runtime directory specified by \p config. * * \param config \ref cc_oci_config. * \return \c true on success, else \c false. */ gboolean cc_oci_runtime_dir_delete (struct cc_oci_config *config) { if (! config) { return false; } if (config->state.runtime_path[0] != '/') { return false; } return cc_oci_rm_rf (config->state.runtime_path); }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef TITANIC_BROKEN_PELLERATOR_FROZ_H #define TITANIC_BROKEN_PELLERATOR_FROZ_H #include "titanic/game/broken_pell_base.h" namespace Titanic { class CBrokenPelleratorFroz : public CBrokenPellBase { DECLARE_MESSAGE_MAP; bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); bool LeaveViewMsg(CLeaveViewMsg *msg); bool ActMsg(CActMsg *msg); bool MovieEndMsg(CMovieEndMsg *msg); private: CString _string2; CString _string3; CString _string4; CString _string5; public: CLASSDEF; /** * Save the data for the class to file */ virtual void save(SimpleFile *file, int indent); /** * Load the data for the class from file */ virtual void load(SimpleFile *file); }; } // End of namespace Titanic #endif /* TITANIC_BROKEN_PELLERATOR_FROZ_H */
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Copyright (C) 2009 Sun Microsystems, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include <drizzled/statement/create_table.h> namespace drizzled { namespace statement { class CreateIndex : public CreateTable { public: CreateIndex(Session *in_session); bool execute(); }; } /* namespace statement */ } /* namespace drizzled */
/* * drivers/gpu/ion/ion_system_mapper.c * * Copyright (C) 2011 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/err.h> #include <linux/module.h> #include <linux/ion.h> #include <linux/memory.h> #include <linux/mm.h> #include <linux/slab.h> #include <linux/vmalloc.h> #include "ion_priv.h" /* * This mapper is valid for any heap that allocates memory that already has * a kernel mapping, this includes vmalloc'd memory, kmalloc'd memory, * pages obtained via io_remap, etc. */ static void *ion_kernel_mapper_map(struct ion_mapper *mapper, struct ion_buffer *buffer, struct ion_mapping **mapping) { if (!((1 << buffer->heap->type) & mapper->heap_mask)) { pr_err("%s: attempting to map an unsupported heap\n", __func__); return ERR_PTR(-EINVAL); } /* XXX REVISIT ME!!! */ *((unsigned long *)mapping) = (unsigned long)buffer->priv; return buffer->priv; } static void ion_kernel_mapper_unmap(struct ion_mapper *mapper, struct ion_buffer *buffer, struct ion_mapping *mapping) { if (!((1 << buffer->heap->type) & mapper->heap_mask)) pr_err("%s: attempting to unmap an unsupported heap\n", __func__); } static void *ion_kernel_mapper_map_kernel(struct ion_mapper *mapper, struct ion_buffer *buffer, struct ion_mapping *mapping) { if (!((1 << buffer->heap->type) & mapper->heap_mask)) { pr_err("%s: attempting to unmap an unsupported heap\n", __func__); return ERR_PTR(-EINVAL); } return buffer->priv; } static int ion_kernel_mapper_map_user(struct ion_mapper *mapper, struct ion_buffer *buffer, struct vm_area_struct *vma, struct ion_mapping *mapping) { int ret; switch (buffer->heap->type) { case ION_HEAP_KMALLOC: { unsigned long pfn = __phys_to_pfn(virt_to_phys(buffer->priv)); ret = remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot); break; } case ION_HEAP_VMALLOC: ret = remap_vmalloc_range(vma, buffer->priv, vma->vm_pgoff); break; default: pr_err("%s: attempting to map unsupported heap to userspace\n", __func__); return -EINVAL; } return ret; } static struct ion_mapper_ops ops = { .map = ion_kernel_mapper_map, .map_kernel = ion_kernel_mapper_map_kernel, .map_user = ion_kernel_mapper_map_user, .unmap = ion_kernel_mapper_unmap, }; struct ion_mapper *ion_system_mapper_create(void) { struct ion_mapper *mapper; mapper = kzalloc(sizeof(struct ion_mapper), GFP_KERNEL); if (!mapper) return ERR_PTR(-ENOMEM); mapper->type = ION_SYSTEM_MAPPER; mapper->ops = &ops; mapper->heap_mask = (1 << ION_HEAP_VMALLOC) | (1 << ION_HEAP_KMALLOC); return mapper; } void ion_system_mapper_destroy(struct ion_mapper *mapper) { kfree(mapper); }
/* * claa104xa01cw_lcd.c -- support for CPT CLAA104XA01CW LCD * * Copyright (C) 2009, 2010 Telechips, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/gpio.h> #include <linux/clk.h> #include <mach/tcc_fb.h> #include <mach/gpio.h> #include <mach/tca_lcdc.h> #include <mach/TCC_LCD_Interface.h> #include <mach/globals.h> #include <mach/reg_physical.h> #include <mach/tca_ckc.h> #include <asm/mach-types.h> #include <asm/io.h> static struct mutex panel_lock; static char lcd_pwr_state; static unsigned int lcd_bl_level; extern void lcdc_initialize(struct lcd_panel *lcd_spec, unsigned int lcdc_num); static struct clk *lvds_clk; static int claa104xa01cw_panel_init(struct lcd_panel *panel) { printk("%s : %d\n", __func__, 0); return 0; } static int claa104xa01cw_set_power(struct lcd_panel *panel, int on, unsigned int lcd_num) { PDDICONFIG pDDICfg; struct lcd_platform_data *pdata = panel->dev->platform_data; printk("%s : %d %d \n", __func__, on, lcd_bl_level); mutex_lock(&panel_lock); lcd_pwr_state = on; pDDICfg = (volatile PDDICONFIG)tcc_p2v(HwDDI_CONFIG_BASE); if (on) { gpio_set_value(pdata->power_on, 1); gpio_set_value(pdata->reset, 1); // LVDS power on clk_enable(lvds_clk); lcdc_initialize(panel, lcd_num); // LVDS reset BITSET(pDDICfg->LVDS_CTRL, Hw1); // reset BITCLR(pDDICfg->LVDS_CTRL, Hw1); // normal pDDICfg->LVDS_TXO_SEL0 = 0x15141312; // SEL_03, SEL_02, SEL_01, SEL_00, pDDICfg->LVDS_TXO_SEL1 = 0x0B0A1716; // SEL_07, SEL_06, SEL_05, SEL_04, pDDICfg->LVDS_TXO_SEL2 = 0x0F0E0D0C; // SEL_11, SEL_10, SEL_09, SEL_08, pDDICfg->LVDS_TXO_SEL3 = 0x05040302; // SEL_15, SEL_14, SEL_13, SEL_12, pDDICfg->LVDS_TXO_SEL4 = 0x1A190706; // SEL_19, SEL_18, SEL_17, SEL_16, pDDICfg->LVDS_TXO_SEL5 = 0x1F1E1F18; // SEL_20, pDDICfg->LVDS_TXO_SEL6 = 0x1F1E1F1E; pDDICfg->LVDS_TXO_SEL7 = 0x1F1E1F1E; pDDICfg->LVDS_TXO_SEL8 = 0x1F1E1F1E; // LVDS Select // BITCLR(pDDICfg->LVDS_CTRL, Hw0); //LCDC0 BITSET(pDDICfg->LVDS_CTRL, Hw0); //LCDC1 #ifdef CONFIG_ARCH_TCC88XX { unsigned int P, M, S, VSEL; M = 10; P = 10; S = 0; VSEL = 0; BITCSET(pDDICfg->LVDS_CTRL, Hw21- Hw4, (VSEL<<4)|(S<<5)|(M<<8)|(P<<15)); //LCDC1 } BITSET(pDDICfg->LVDS_CTRL, Hw1); // reset #endif// // LVDS enable BITSET(pDDICfg->LVDS_CTRL, Hw2); // enable msleep(16); gpio_set_value(pdata->display_on, 1); } else { #ifdef CONFIG_ARCH_TCC88XX BITCLR(pDDICfg->LVDS_CTRL, Hw1); // reset #endif// BITCLR(pDDICfg->LVDS_CTRL, Hw2); // disable clk_disable(lvds_clk); gpio_set_value(pdata->display_on, 0); gpio_set_value(pdata->reset, 0); gpio_set_value(pdata->power_on, 0); } mutex_unlock(&panel_lock); return 0; } static int claa104xa01cw_set_backlight_level(struct lcd_panel *panel, int level) { struct lcd_platform_data *pdata = panel->dev->platform_data; mutex_lock(&panel_lock); if (level == 0) { gpio_set_value(pdata->bl_on, 0); } else { gpio_set_value(pdata->bl_on, 1); } mutex_unlock(&panel_lock); return 0; } struct lcd_panel claa104xa01cw_panel = { .name = "CLAA104XA01CW", .manufacturer = "CPT", .xres = 1024, .yres = 768, .width = 211, .height = 158, .bpp = 32, .clk_freq = 650000, .clk_div = 2, .bus_width = 24, .lpw = 0, .lpc = 1024, .lswc = 0, .lewc = 317, .vdb = 0, .vdf = 0, .fpw1 = 0, .flc1 = 768, .fswc1 = 0, .fewc1 = 35, .fpw2 = 0, .flc2 = 768, .fswc2 = 0, .fewc2 = 35, .sync_invert = IV_INVERT | IH_INVERT, .init = claa104xa01cw_panel_init, .set_power = claa104xa01cw_set_power, .set_backlight_level = claa104xa01cw_set_backlight_level, }; static int claa104xa01cw_probe(struct platform_device *pdev) { struct lcd_platform_data *pdata = pdev->dev.platform_data; printk("%s : %s\n", __func__, pdev->name); mutex_init(&panel_lock); lcd_pwr_state = 1; gpio_request(pdata->power_on, "lcd_on"); gpio_request(pdata->bl_on, "lcd_bl"); gpio_request(pdata->display_on, "lcd_display"); gpio_request(pdata->reset, "lcd_reset"); gpio_direction_output(pdata->power_on, 1); gpio_direction_output(pdata->bl_on, 1); gpio_direction_output(pdata->display_on, 1); gpio_direction_output(pdata->reset, 1); claa104xa01cw_panel.dev = &pdev->dev; lvds_clk = clk_get(0, "lvds"); BUG_ON(lvds_clk == NULL); clk_enable(lvds_clk); tccfb_register_panel(&claa104xa01cw_panel); return 0; } static int claa104xa01cw_remove(struct platform_device *pdev) { return 0; } static struct platform_driver claa104xa01cw_lcd = { .probe = claa104xa01cw_probe, .remove = claa104xa01cw_remove, .driver = { .name = "claa104xa01cw_lcd", .owner = THIS_MODULE, }, }; static __init int claa104xa01cw_init(void) { printk("~ %s ~ \n", __func__); return platform_driver_register(&claa104xa01cw_lcd); } static __exit void claa104xa01cw_exit(void) { return platform_driver_unregister(&claa104xa01cw_lcd); } subsys_initcall(claa104xa01cw_init); module_exit(claa104xa01cw_exit); MODULE_DESCRIPTION("CLAA104XA01CW LCD driver"); MODULE_LICENSE("GPL");
/* Copyright (C) 2000 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_session_route_h__ #define __ardour_session_route_h__ #include <iostream> #include <glibmm/threads.h> #include "ardour/session.h" #include "ardour/route.h" namespace ARDOUR { template<class T> void Session::foreach_route (T *obj, void (T::*func)(Route&), bool sort) { boost::shared_ptr<RouteList> r = routes.reader(); RouteList public_order (*r); if (sort) { public_order.sort (RoutePublicOrderSorter()); } for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { (obj->*func) (**i); } } template<class T> void Session::foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>), bool sort) { boost::shared_ptr<RouteList> r = routes.reader(); RouteList public_order (*r); if (sort) { public_order.sort (RoutePublicOrderSorter()); } for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { (obj->*func) (*i); } } template<class T, class A> void Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort) { boost::shared_ptr<RouteList> r = routes.reader(); RouteList public_order (*r); if (sort) { public_order.sort (RoutePublicOrderSorter()); } for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { (obj->*func) (**i, arg1); } } } /* namespace */ #endif /* __ardour_session_route_h__ */
// Copyright 2014 Citra Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #pragma once #include "common/emu_window.h" struct GLFWwindow; class EmuWindow_GLFW : public EmuWindow { public: EmuWindow_GLFW(); ~EmuWindow_GLFW(); /// Swap buffers to display the next frame void SwapBuffers() override; /// Polls window events void PollEvents() override; /// Makes the graphics context current for the caller thread void MakeCurrent() override; /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread void DoneCurrent() override; static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods); /// Whether the window is still open, and a close request hasn't yet been sent const bool IsOpen(); static void OnClientAreaResizeEvent(GLFWwindow* win, int width, int height); static void OnFramebufferResizeEvent(GLFWwindow* win, int width, int height); void ReloadSetKeymaps() override; private: void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) override; static EmuWindow_GLFW* GetEmuWindow(GLFWwindow* win); GLFWwindow* m_render_window; ///< Internal GLFW render window /// Device id of keyboard for use with KeyMap int keyboard_id; };
// DeflateConst.h #ifndef __DEFLATE_CONST_H #define __DEFLATE_CONST_H namespace NCompress { namespace NDeflate { const unsigned kNumHuffmanBits = 15; const UInt32 kHistorySize32 = (1 << 15); const UInt32 kHistorySize64 = (1 << 16); const unsigned kDistTableSize32 = 30; const unsigned kDistTableSize64 = 32; const unsigned kNumLenSymbols32 = 256; const unsigned kNumLenSymbols64 = 255; // don't change it. It must be <= 255. const unsigned kNumLenSymbolsMax = kNumLenSymbols32; const unsigned kNumLenSlots = 29; const unsigned kFixedDistTableSize = 32; const unsigned kFixedLenTableSize = 31; const unsigned kSymbolEndOfBlock = 0x100; const unsigned kSymbolMatch = kSymbolEndOfBlock + 1; const unsigned kMainTableSize = kSymbolMatch + kNumLenSlots; const unsigned kFixedMainTableSize = kSymbolMatch + kFixedLenTableSize; const unsigned kLevelTableSize = 19; const unsigned kTableDirectLevels = 16; const unsigned kTableLevelRepNumber = kTableDirectLevels; const unsigned kTableLevel0Number = kTableLevelRepNumber + 1; const unsigned kTableLevel0Number2 = kTableLevel0Number + 1; const unsigned kLevelMask = 0xF; const Byte kLenStart32[kFixedLenTableSize] = {0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224, 255, 0, 0}; const Byte kLenStart64[kFixedLenTableSize] = {0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224, 0, 0, 0}; const Byte kLenDirectBits32[kFixedLenTableSize] = {0,0,0,0,0,0,0,0,1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0}; const Byte kLenDirectBits64[kFixedLenTableSize] = {0,0,0,0,0,0,0,0,1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 16, 0, 0}; const UInt32 kDistStart[kDistTableSize64] = {0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768, 1024,1536,2048,3072,4096,6144,8192,12288,16384,24576,32768,49152}; const Byte kDistDirectBits[kDistTableSize64] = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14}; const Byte kLevelDirectBits[3] = {2, 3, 7}; const Byte kCodeLengthAlphabetOrder[kLevelTableSize] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; const unsigned kMatchMinLen = 3; const unsigned kMatchMaxLen32 = kNumLenSymbols32 + kMatchMinLen - 1; // 256 + 2 const unsigned kMatchMaxLen64 = kNumLenSymbols64 + kMatchMinLen - 1; // 255 + 2 const unsigned kMatchMaxLen = kMatchMaxLen32; const unsigned kFinalBlockFieldSize = 1; namespace NFinalBlockField { enum { kNotFinalBlock = 0, kFinalBlock = 1 }; } const unsigned kBlockTypeFieldSize = 2; namespace NBlockType { enum { kStored = 0, kFixedHuffman = 1, kDynamicHuffman = 2 }; } const unsigned kNumLenCodesFieldSize = 5; const unsigned kNumDistCodesFieldSize = 5; const unsigned kNumLevelCodesFieldSize = 4; const unsigned kNumLitLenCodesMin = 257; const unsigned kNumDistCodesMin = 1; const unsigned kNumLevelCodesMin = 4; const unsigned kLevelFieldSize = 3; const unsigned kStoredBlockLengthFieldSize = 16; struct CLevels { Byte litLenLevels[kFixedMainTableSize]; Byte distLevels[kFixedDistTableSize]; void SubClear() { unsigned i; for (i = kNumLitLenCodesMin; i < kFixedMainTableSize; i++) litLenLevels[i] = 0; for (i = 0; i < kFixedDistTableSize; i++) distLevels[i] = 0; } void SetFixedLevels() { unsigned i = 0; for (; i < 144; i++) litLenLevels[i] = 8; for (; i < 256; i++) litLenLevels[i] = 9; for (; i < 280; i++) litLenLevels[i] = 7; for (; i < 288; i++) litLenLevels[i] = 8; for (i = 0; i < kFixedDistTableSize; i++) // test it: InfoZip only uses kDistTableSize distLevels[i] = 5; } }; }} #endif
#define PHYSICS HD #define DIMENSIONS 2 #define COMPONENTS 2 #define GEOMETRY POLAR #define BODY_FORCE VECTOR #define FORCED_TURB NO #define COOLING NO #define RECONSTRUCTION LINEAR #define TIME_STEPPING RK2 #define DIMENSIONAL_SPLITTING NO #define NTRACER 0 #define USER_DEF_PARAMETERS 3 /* -- physics dependent declarations -- */ #define EOS IDEAL #define ENTROPY_SWITCH NO #define THERMAL_CONDUCTION NO #define VISCOSITY NO #define ROTATING_FRAME YES /* -- user-defined parameters (labels) -- */ #define KPAR 0 #define HSCALE 1 #define MACH 2 /* [Beg] user-defined constants (do not change this line) */ #define LIMITER MC_LIM /* [End] user-defined constants (do not change this line) */
/* Copyright (C) 2000 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_route_params_ui_h__ #define __ardour_route_params_ui_h__ #include <list> #include <gtkmm/box.h> #include <gtkmm/button.h> #include <gtkmm/eventbox.h> #include <gtkmm/frame.h> #include <gtkmm/label.h> #include <gtkmm/paned.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/togglebutton.h> #include <gtkmm/treeview.h> #include "pbd/stateful.h" #include "pbd/signals.h" #include "ardour/ardour.h" #include "ardour_window.h" #include "processor_box.h" #include "route_processor_selection.h" #include "latency_gui.h" namespace ARDOUR { class Route; class Send; class Processor; class Session; class PortInsert; class Connection; class Plugin; } class PluginSelector; class IOSelector; class RouteParams_UI : public ArdourWindow, public PBD::ScopedConnectionList { public: RouteParams_UI (); ~RouteParams_UI(); void set_session (ARDOUR::Session*); void session_going_away (); PluginSelector* plugin_selector() { return _plugin_selector; } private: Gtk::HBox global_hpacker; Gtk::VBox global_vpacker; Gtk::ScrolledWindow scroller; Gtk::EventBox scroller_base; Gtk::HBox scroller_hpacker; Gtk::VBox mixer_scroller_vpacker; Gtk::VBox list_vpacker; Gtk::Label route_list_button_label; Gtk::Button route_list_button; Gtk::ScrolledWindow route_select_scroller; Gtk::Notebook notebook; Gtk::Frame input_frame; Gtk::Frame output_frame; Gtk::HPaned redir_hpane; Gtk::Frame route_select_frame; Gtk::HBox route_hpacker; Gtk::VBox route_vpacker; ProcessorBox* insert_box; Gtk::HPaned list_hpane; Gtk::HPaned right_hpane; Gtk::Frame route_choice_frame; Gtk::Frame route_param_frame; Gtk::VBox choice_vpacker; Gtk::Frame latency_frame; Gtk::VBox latency_packer; Gtk::HButtonBox latency_button_box; Gtk::Button latency_apply_button; LatencyGUI* latency_widget; Gtk::Label delay_label; PBD::ScopedConnectionList latency_connections; sigc::connection latency_click_connection; void refresh_latency (); Gtk::ToggleButton input_button; Gtk::ToggleButton output_button; Gtk::Label track_input_label; Gtk::Label title_label; Gtk::Container * _active_view; IOSelector * _input_iosel; IOSelector * _output_iosel; PluginSelector *_plugin_selector; RouteProcessorSelection _rr_selection; boost::shared_ptr<ARDOUR::Route> _route; PBD::ScopedConnection _route_processors_connection; PBD::ScopedConnectionList route_connections; boost::shared_ptr<ARDOUR::Processor> _processor; PBD::ScopedConnection _processor_going_away_connection; enum ConfigView { NO_CONFIG_VIEW = 0, INPUT_CONFIG_VIEW, OUTPUT_CONFIG_VIEW, PLUGIN_CONFIG_VIEW, PORTINSERT_CONFIG_VIEW, SEND_CONFIG_VIEW }; ConfigView _current_view; /* treeview */ struct RouteDisplayModelColumns : public Gtk::TreeModel::ColumnRecord { RouteDisplayModelColumns() { add(text); add(route); } Gtk::TreeModelColumn<std::string> text; Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route; }; RouteDisplayModelColumns route_display_columns ; Gtk::TreeView route_display; Glib::RefPtr<Gtk::ListStore> route_display_model; void add_routes (ARDOUR::RouteList&); void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route> route); void route_removed (boost::weak_ptr<ARDOUR::Route> route); void map_frozen (); void route_selected(); //void route_unselected (gint row, gint col, GdkEvent *ev); void setup_io_frames(); void cleanup_io_frames(); void cleanup_view(bool stopupdate = true); void cleanup_latency_frame (); void setup_latency_frame (); void processors_changed (ARDOUR::RouteProcessorChange); void setup_processor_boxes(); void cleanup_processor_boxes(); void redirect_selected (boost::shared_ptr<ARDOUR::Processor>); void plugin_going_away (ARDOUR::Placement); void processor_going_away (boost::weak_ptr<ARDOUR::Processor>); gint edit_input_configuration (GdkEventButton *ev); gint edit_output_configuration (GdkEventButton *ev); void update_routeinfo (ARDOUR::Route * route); Gtk::Menu *track_menu; void show_track_menu(); void update_title (); //void unselect_all_redirects (); sigc::connection update_connection; void update_views (); void start_updating (); void stop_updating (); }; #endif /* __ardour_route_params_ui_h__ */
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-RRC-Definitions" * found in "fixed_grammar.asn" * `asn1c -gen-PER` */ #include "TPC-Index.h" static int memb_indexOfFormat3_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 1 && value <= 15)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_indexOfFormat3A_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 1 && value <= 31)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static asn_per_constraints_t asn_PER_memb_indexOfFormat3_constr_2 GCC_NOTUSED = { { APC_CONSTRAINED, 4, 4, 1, 15 } /* (1..15) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_indexOfFormat3A_constr_3 GCC_NOTUSED = { { APC_CONSTRAINED, 5, 5, 1, 31 } /* (1..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_type_TPC_Index_constr_1 GCC_NOTUSED = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static asn_TYPE_member_t asn_MBR_TPC_Index_1[] = { { ATF_NOFLAGS, 0, offsetof(struct TPC_Index, choice.indexOfFormat3), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_indexOfFormat3_constraint_1, &asn_PER_memb_indexOfFormat3_constr_2, 0, "indexOfFormat3" }, { ATF_NOFLAGS, 0, offsetof(struct TPC_Index, choice.indexOfFormat3A), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_indexOfFormat3A_constraint_1, &asn_PER_memb_indexOfFormat3A_constr_3, 0, "indexOfFormat3A" }, }; static asn_TYPE_tag2member_t asn_MAP_TPC_Index_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* indexOfFormat3 at 2805 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* indexOfFormat3A at 2806 */ }; static asn_CHOICE_specifics_t asn_SPC_TPC_Index_specs_1 = { sizeof(struct TPC_Index), offsetof(struct TPC_Index, _asn_ctx), offsetof(struct TPC_Index, present), sizeof(((struct TPC_Index *)0)->present), asn_MAP_TPC_Index_tag2el_1, 2, /* Count of tags in the map */ 0, -1 /* Extensions start */ }; asn_TYPE_descriptor_t asn_DEF_TPC_Index = { "TPC-Index", "TPC-Index", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_decode_uper, CHOICE_encode_uper, CHOICE_decode_aper, CHOICE_encode_aper, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ &asn_PER_type_TPC_Index_constr_1, asn_MBR_TPC_Index_1, 2, /* Elements count */ &asn_SPC_TPC_Index_specs_1 /* Additional specs */ };
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LOG4CXX_HELPER_FORMATTING_INFO_H #define _LOG4CXX_HELPER_FORMATTING_INFO_H #include <log4cxx/helpers/objectimpl.h> #include <log4cxx/logstring.h> namespace log4cxx { namespace pattern { class FormattingInfo; typedef helpers::ObjectPtrT<FormattingInfo> FormattingInfoPtr; /** * Modifies the output of a pattern converter for a specified minimum * and maximum width and alignment. * * * * */ class LOG4CXX_EXPORT FormattingInfo : public virtual log4cxx::helpers::ObjectImpl { /** * Minimum length. */ const int minLength; /** * Maximum length. */ const int maxLength; /** * Alignment. */ const bool leftAlign; public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(FormattingInfo) BEGIN_LOG4CXX_CAST_MAP() LOG4CXX_CAST_ENTRY(FormattingInfo) END_LOG4CXX_CAST_MAP() /** * Creates new instance. * @param leftAlign left align if true. * @param minLength minimum length. * @param maxLength maximum length. */ FormattingInfo( const bool leftAlign, const int minLength, const int maxLength); /** * Gets default instance. * @return default instance. */ static FormattingInfoPtr getDefault(); /** * Determine if left aligned. * @return true if left aligned. */ inline bool isLeftAligned() const { return leftAlign; } /** * Get minimum length. * @return minimum length. */ inline int getMinLength() const { return minLength; } /** * Get maximum length. * @return maximum length. */ inline int getMaxLength() const { return maxLength; } /** * Adjust the content of the buffer based on the specified lengths and alignment. * * @param fieldStart start of field in buffer. * @param buffer buffer to be modified. */ void format(const int fieldStart, LogString& buffer) const; }; LOG4CXX_PTR_DEF(FormattingInfo); } } #endif
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software under the terms of the * GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. * * Cleanflight and Betaflight are distributed in the hope that they * 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 software. * * If not, see <http://www.gnu.org/licenses/>. */ #include <stdint.h> #include "platform.h" #ifdef TARGET_VALIDATECONFIG #include "fc/config.h" #include "sensors/gyro.h" void targetValidateConfiguration(void) { if (gyroConfig()->gyro_use_32khz && gyroConfig()->gyroMovementCalibrationThreshold < 148) { gyroConfigMutable()->gyroMovementCalibrationThreshold = 148; } } #endif
/* -*- c++ -*- */ /* * Copyright 2004,2011,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * SPDX-License-Identifier: GPL-3.0-or-later * */ #ifndef INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_CC_H #define INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_CC_H #include <gnuradio/block.h> #include <gnuradio/digital/api.h> namespace gr { namespace digital { /*! * \brief Mueller and Müller (M&M) based clock recovery block with complex input, complex * output. \ingroup synchronizers_blk * * \details * This implements the Mueller and Müller (M&M) discrete-time * error-tracking synchronizer. * * The peak to peak input signal amplitude must be symmetrical * about zero, as the M&M timing error detector (TED) is a * decision directed TED, and this block uses a symbol decision * slicer referenced at zero. * * The input signal peak amplitude should be controlled to a * consistent level (e.g. +/- 1.0) before this block to achieve * consistent results for given gain settings; as the TED's output * error signal is directly affected by the input amplitude. * * The input signal must have peaks in order for the TED to output * a correct error signal. If the input signal pulses do not have * peaks (e.g. rectangular pulses) the input signal should be * conditioned with a matched pulse filter or other appropriate * filter to peak the input pulses. For a rectangular base pulse * that is N samples wide, the matched filter taps would be * [1.0/float(N)]*N, or in other words a moving average over N * samples. * * This block will output samples at a rate of one sample per * recovered symbol, and is thus not outputting at a constant rate. * * Output symbols are not a subset of input, but may be interpolated. * * The complex version here is based on: Modified Mueller and * Muller clock recovery circuit: * * G. R. Danesfahani, T.G. Jeans, "Optimisation of modified Mueller * and Muller algorithm," Electronics Letters, Vol. 31, no. 13, 22 * June 1995, pp. 1032 - 1033. */ class DIGITAL_API clock_recovery_mm_cc : virtual public block { public: // gr::digital::clock_recovery_mm_cc::sptr typedef std::shared_ptr<clock_recovery_mm_cc> sptr; /*! * Make a M&M clock recovery block. * * \param omega Initial estimate of samples per symbol * \param gain_omega Gain setting for omega update loop * \param mu Initial estimate of phase of sample * \param gain_mu Gain setting for mu update loop * \param omega_relative_limit limit on omega */ static sptr make(float omega, float gain_omega, float mu, float gain_mu, float omega_relative_limit); virtual float mu() const = 0; virtual float omega() const = 0; virtual float gain_mu() const = 0; virtual float gain_omega() const = 0; virtual void set_verbose(bool verbose) = 0; virtual void set_gain_mu(float gain_mu) = 0; virtual void set_gain_omega(float gain_omega) = 0; virtual void set_mu(float mu) = 0; virtual void set_omega(float omega) = 0; }; } /* namespace digital */ } /* namespace gr */ #endif /* INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_CC_H */
/** * \file sha1.h * * \brief SHA-1 cryptographic hash function * * Copyright (C) 2006-2014, Brainspark B.V. * * This file is part of PolarSSL (http://www.polarssl.org) * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef SHA1_H #define SHA1_H #include <string.h> #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32) #include <basetsd.h> typedef UINT32 uint32_t; #else #include <inttypes.h> #endif #define POLARSSL_ERR_SHA1_FILE_IO_ERROR -0x0076 /**< Read/write error in file. */ #if !defined(POLARSSL_SHA1_ALT) // Regular implementation // #ifdef __cplusplus extern "C" { #endif /** * \brief SHA-1 context structure */ typedef struct { uint32_t total[2]; /*!< number of bytes processed */ uint32_t state[5]; /*!< intermediate digest state */ unsigned char buffer[64]; /*!< data block being processed */ unsigned char ipad[64]; /*!< HMAC: inner padding */ unsigned char opad[64]; /*!< HMAC: outer padding */ } sha1_context; /** * \brief Initialize SHA-1 context * * \param ctx SHA-1 context to be initialized */ void sha1_init(sha1_context* ctx); /** * \brief Clear SHA-1 context * * \param ctx SHA-1 context to be cleared */ void sha1_free(sha1_context* ctx); /** * \brief SHA-1 context setup * * \param ctx context to be initialized */ void sha1_starts(sha1_context* ctx); /** * \brief SHA-1 process buffer * * \param ctx SHA-1 context * \param input buffer holding the data * \param ilen length of the input data */ void sha1_update(sha1_context* ctx, const unsigned char* input, size_t ilen); /** * \brief SHA-1 final digest * * \param ctx SHA-1 context * \param output SHA-1 checksum result */ void sha1_finish(sha1_context* ctx, unsigned char output[20]); /* Internal use */ void sha1_process(sha1_context* ctx, const unsigned char data[64]); #ifdef __cplusplus } #endif #else /* POLARSSL_SHA1_ALT */ #include "sha1_alt.h" #endif /* POLARSSL_SHA1_ALT */ #ifdef __cplusplus extern "C" { #endif /** * \brief Output = SHA-1( input buffer ) * * \param input buffer holding the data * \param ilen length of the input data * \param output SHA-1 checksum result */ void sha1(const unsigned char* input, size_t ilen, unsigned char output[20]); /** * \brief Output = SHA-1( file contents ) * * \param path input file name * \param output SHA-1 checksum result * * \return 0 if successful, or POLARSSL_ERR_SHA1_FILE_IO_ERROR */ int sha1_file(const char* path, unsigned char output[20]); /** * \brief SHA-1 HMAC context setup * * \param ctx HMAC context to be initialized * \param key HMAC secret key * \param keylen length of the HMAC key */ void sha1_hmac_starts(sha1_context* ctx, const unsigned char* key, size_t keylen); /** * \brief SHA-1 HMAC process buffer * * \param ctx HMAC context * \param input buffer holding the data * \param ilen length of the input data */ void sha1_hmac_update(sha1_context* ctx, const unsigned char* input, size_t ilen); /** * \brief SHA-1 HMAC final digest * * \param ctx HMAC context * \param output SHA-1 HMAC checksum result */ void sha1_hmac_finish(sha1_context* ctx, unsigned char output[20]); /** * \brief SHA-1 HMAC context reset * * \param ctx HMAC context to be reset */ void sha1_hmac_reset(sha1_context* ctx); /** * \brief Output = HMAC-SHA-1( hmac key, input buffer ) * * \param key HMAC secret key * \param keylen length of the HMAC key * \param input buffer holding the data * \param ilen length of the input data * \param output HMAC-SHA-1 result */ void sha1_hmac(const unsigned char* key, size_t keylen, const unsigned char* input, size_t ilen, unsigned char output[20]); /** * \brief Checkup routine * * \return 0 if successful, or 1 if the test failed */ int sha1_self_test(int verbose); #ifdef __cplusplus } #endif #endif /* sha1.h */
/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once class ApiWrap; namespace ChatHelpers { namespace details { class EmojiKeywordsLangPackDelegate { public: virtual ApiWrap *api() = 0; virtual void langPackRefreshed() = 0; protected: ~EmojiKeywordsLangPackDelegate() = default; }; } // namespace details class EmojiKeywords final : private details::EmojiKeywordsLangPackDelegate { public: EmojiKeywords(); EmojiKeywords(const EmojiKeywords &other) = delete; EmojiKeywords &operator=(const EmojiKeywords &other) = delete; ~EmojiKeywords(); void refresh(); [[nodiscard]] rpl::producer<> refreshed() const; struct Result { EmojiPtr emoji = nullptr; QString label; QString replacement; }; [[nodiscard]] std::vector<Result> query( const QString &query, bool exact = false) const; [[nodiscard]] int maxQueryLength() const; private: class LangPack; not_null<details::EmojiKeywordsLangPackDelegate*> delegate(); ApiWrap *api() override; void langPackRefreshed() override; void handleSessionChanges(); void apiChanged(ApiWrap *api); void refreshInputLanguages(); [[nodiscard]] std::vector<QString> languages(); void refreshRemoteList(); void setRemoteList(std::vector<QString> &&list); void refreshFromRemoteList(); ApiWrap *_api = nullptr; std::vector<QString> _localList; std::vector<QString> _remoteList; mtpRequestId _langsRequestId = 0; base::flat_map<QString, std::unique_ptr<LangPack>> _data; std::deque<std::unique_ptr<LangPack>> _notUsedData; std::deque<QStringList> _inputLanguages; rpl::event_stream<> _refreshed; rpl::lifetime _suggestedChangeLifetime; rpl::lifetime _lifetime; base::has_weak_ptr _guard; }; } // namespace ChatHelpers
/*****************************************/ /* Written by andrew.wilkins@csiro.au */ /* Please contact me if you make changes */ /*****************************************/ #ifndef RICHARDSSEFF1VG_H #define RICHARDSSEFF1VG_H #include "RichardsSeff.h" #include "RichardsSeffVG.h" class RichardsSeff1VG; template<> InputParameters validParams<RichardsSeff1VG>(); /** * Effective saturation as a function of porepressure * using the van Genuchten formula. Note this is not a function * of capillary pressure: i use porepressure instead, so * seff = 1 for p >= 0. */ class RichardsSeff1VG : public RichardsSeff { public: RichardsSeff1VG(const std::string & name, InputParameters parameters); /** * effective saturation as a function of porepressure * @param p porepressure in the element. Note that (*p[0])[qp] is the porepressure at quadpoint qp * @param qp the quad point to evaluate effective saturation at */ Real seff(std::vector<VariableValue *> p, unsigned int qp) const; /** * derivative of effective saturation as a function of porepressure * @param p porepressure in the element. Note that (*p[0])[qp] is the porepressure at quadpoint qp * @param qp the quad point to evaluate effective saturation at * @param result the derivtives will be placed in this array */ void dseff(std::vector<VariableValue *> p, unsigned int qp, std::vector<Real> &result) const; /** * second derivative of effective saturation as a function of porepressure * @param p porepressure in the element. Note that (*p[0])[qp] is the porepressure at quadpoint qp * @param qp the quad point to evaluate effective saturation at * @param result the derivtives will be placed in this array */ void d2seff(std::vector<VariableValue *> p, unsigned int qp, std::vector<std::vector<Real> > &result) const; protected: /// van Genuchten alpha parameter Real _al; /// van Genuchten m parameter Real _m; }; #endif // RICHARDSSEFF1VG_H
/* * OpenRPT report writer and rendering engine * Copyright (C) 2001-2014 by OpenMFG, LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Please contact info@openmfg.com with any questions on this license. */ #ifndef __QUUENCODE_H__ #define __QUUENCODE_H__ #include <QString> class QIODevice; QString QUUEncode(QIODevice &, const QString & = QString::null, int mode = 0); QByteArray QUUDecode(const QString &, QString * = 0, int * = 0); #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef SOURCE_UTILS_H #define SOURCE_UTILS_H #include <QString> namespace TextEditor { class ITextEditor; } namespace Core { class IEditor; } namespace CPlusPlus { class Snapshot; } namespace Debugger { namespace Internal { // Editor tooltip support bool isCppEditor(Core::IEditor *editor); QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos, int *line, int *column, QString *function = 0); QString fixCppExpression(const QString &exp); QString cppFunctionAt(const QString &fileName, int line); // Get variables that are not initialized at a certain line // of a function from the code model. Shadowed variables will // be reported using the debugger naming conventions '<shadowed n>' bool getUninitializedVariables(const CPlusPlus::Snapshot &snapshot, const QString &function, const QString &file, int line, QStringList *uninitializedVariables); } // namespace Internal } // namespace Debugger #endif // SOURCE_UTILS_H
/* * DO NOT EDIT THIS FILE - it is generated by Glade. */ GtkWidget* create_mainwindow (void); GtkWidget* create_dialog_preferences (void); GtkWidget* create_dialog_connect (void); GtkWidget* create_dialog_azel_graph (void); GtkWidget* create_dialog_dbedit (void); GtkWidget* create_dialog_about (void);
//////////////////////////////////////////////////////////////////////////// // Module : graph_engine_space.h // Created : 21.03.2002 // Modified : 26.11.2003 // Author : Dmitriy Iassenev // Description : Graph engine //////////////////////////////////////////////////////////////////////////// #pragma once template < typename _condition_type, typename _value_type > class COperatorConditionAbstract; template < typename _world_property > class CConditionState; template < typename _world_property, typename _edge_value_type > class COperatorAbstract; template < typename _dist_type, typename _index_type, typename _iteration_type > struct SBaseParameters; template < typename _dist_type, typename _index_type, typename _iteration_type > struct SFlooder ; template < typename _dist_type, typename _index_type, typename _iteration_type > struct SStraightLineParams; template < typename _dist_type, typename _index_type, typename _iteration_type > struct SNearestVertex; template < typename _dist_type, typename _index_type, typename _iteration_type > struct SGameLevel; template < typename _dist_type, typename _index_type, typename _iteration_type > struct SGameVertex; namespace GraphEngineSpace { typedef float _dist_type; typedef u32 _index_type; typedef u32 _iteration_type; typedef u16 _solver_dist_type; typedef u32 _solver_condition_type; typedef bool _solver_value_type; struct CSolverConditionValue { _solver_condition_type m_condition; _solver_value_type m_value; IC CSolverConditionValue (const _solver_condition_type &condition, const _solver_value_type &value) { m_condition = condition; m_value = value; } IC bool operator== (const _solver_condition_type &condition) const { return (condition == m_condition); } }; typedef xr_vector<CSolverConditionValue> CSolverConditionStorage; typedef COperatorConditionAbstract< _solver_condition_type, _solver_value_type > CWorldProperty; typedef CConditionState< CWorldProperty > CWorldState; typedef COperatorAbstract< CWorldProperty, _solver_dist_type > CWorldOperator; typedef CWorldState _solver_index_type; typedef u32 _solver_edge_type; typedef SBaseParameters< _solver_dist_type, _solver_index_type, _iteration_type > CSolverBaseParameters; typedef SBaseParameters< _dist_type, _index_type, _iteration_type > CBaseParameters; typedef SFlooder< _dist_type, _index_type, _iteration_type > CFlooder; typedef SStraightLineParams< _dist_type, _index_type, _iteration_type > CStraightLineParams; typedef SNearestVertex< _dist_type, _index_type, _iteration_type > CNearestVertexParameters; typedef SGameLevel< _dist_type, _index_type, _iteration_type > CGameLevelParams; typedef SGameVertex< _dist_type, _index_type, _iteration_type > CGameVertexParams; };
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkAnchorOpenCloseLine_h #define itkAnchorOpenCloseLine_h #include "itkMorphologyHistogram.h" #include "itkIndent.h" //#define RAWHIST namespace itk { /** * \class AnchorOpenCloseLine * \brief class to implement openings and closings using anchor * methods. This is the base class that must be instantiated with * appropriate definitions of greater, less and so on * \ingroup ITKMathematicalMorphology */ template< typename TInputPix, typename TCompare > class ITK_TEMPLATE_EXPORT AnchorOpenCloseLine { public: /** Some convenient type alias. */ using InputImagePixelType = TInputPix; AnchorOpenCloseLine(); ~AnchorOpenCloseLine() = default; void PrintSelf(std::ostream & os, Indent indent) const; /** Single-threaded version of GenerateData. This filter delegates * to GrayscaleGeodesicErodeImageFilter. */ void DoLine(std::vector<InputImagePixelType> & buffer, unsigned bufflength); void SetSize(unsigned int size) { m_Size = size; } private: unsigned int m_Size; using HistogramType = Function::MorphologyHistogram< InputImagePixelType, TCompare >; bool StartLine(std::vector<InputImagePixelType> & buffer, InputImagePixelType & Extreme, unsigned & outLeftP, unsigned & outRightP); void FinishLine(std::vector<InputImagePixelType> & buffer, InputImagePixelType & Extreme, unsigned & outLeftP, unsigned & outRightP); inline bool Compare1( const InputImagePixelType & a, const InputImagePixelType & b ) { TCompare compare; return ! compare( a, b ); } inline bool Compare2( const InputImagePixelType & a, const InputImagePixelType & b ) { TCompare compare; return compare( a, b ) || a == b; } }; // end of class } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkAnchorOpenCloseLine.hxx" #endif #endif
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s #ifdef SVE_OVERLOADED_FORMS // A simple used,unused... macro, long enough to represent any SVE builtin. #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3 #else #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4 #endif #include <arm_sve.h> svint16_t test_svqdmulh_lane_s16(svint16_t op1, svint16_t op2) { // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 7]}} return SVE_ACLE_FUNC(svqdmulh_lane,_s16,,)(op1, op2, -1); } svint32_t test_svqdmulh_lane_s32(svint32_t op1, svint32_t op2) { // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 3]}} return SVE_ACLE_FUNC(svqdmulh_lane,_s32,,)(op1, op2, 4); } svint64_t test_svqdmulh_lane_s64(svint64_t op1, svint64_t op2) { // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [0, 1]}} return SVE_ACLE_FUNC(svqdmulh_lane,_s64,,)(op1, op2, 2); }
// // KCSRequestConfiguration.h // KinveyKit // // Copyright (c) 2015 Kinvey. All rights reserved. // // This software is licensed to you under the Kinvey terms of service located at // http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this // software, you hereby accept such terms of service (and any agreement referenced // therein) and agree that you have read, understand and agree to be bound by such // terms of service and are of legal age to agree to such terms with Kinvey. // // This software contains valuable confidential and proprietary information of // KINVEY, INC and is subject to applicable licensing agreements. // Unauthorized reproduction, transmission or distribution of this file and its // contents is a violation of applicable laws. // #import <Foundation/Foundation.h> /** Configuration wrapper for setting up Kinvey requests such as Client App Version and Custom Request Properties. This configuration object can be used as a global configuration attached to KCSClient or per request using the overload methods in a KCSStore instance. @since 1.29.0 */ @interface KCSRequestConfiguration : NSObject /** The Client Application Version that will be send in each Kinvey request. @since 1.29.0 */ @property (nonatomic, strong) NSString *clientAppVersion; /** The Custom Request Properties that will be send in each Kinvey request. @since 1.29.0 */ @property (nonatomic, strong) NSDictionary *customRequestProperties; /** The network timeout to use for the request (in seconds). When specified, this value overrides the global KCS_CONNECTION_TIMEOUT configuration option. @since 1.35.0 */ @property (nonatomic) NSTimeInterval timeout; /** Creates and initializes a new request configuration to be used in Kinvey request. @param clientAppVersion client application version that will be send in each Kinvey request. @param customRequestProperties custom request properties that will be send in each Kinvey request. @return an instance of KCSRequestConfiguration @since 1.29.0 */ +(instancetype)requestConfigurationWithClientAppVersion:(NSString*)clientAppVersion andCustomRequestProperties:(NSDictionary*)customRequestProperties; /** Initializes the request configuration to be used in Kinvey request. @param clientAppVersion client application version that will be send in each Kinvey request. @param customRequestProperties custom request properties that will be send in each Kinvey request. @return an instance of KCSRequestConfiguration @since 1.29.0 */ -(instancetype)initWithClientAppVersion:(NSString*)clientAppVersion andCustomRequestProperties:(NSDictionary*)customRequestProperties; @end
/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <ztest.h> #include "test_queue.h" #ifndef CONFIG_USERSPACE static void test_queue_supv_to_user(void) { ztest_test_skip(); } static void test_auto_free(void) { ztest_test_skip(); } #endif /*test case main entry*/ void test_main(void) { ztest_test_suite(queue_api, ztest_unit_test(test_queue_supv_to_user), ztest_unit_test(test_auto_free), ztest_unit_test(test_queue_thread2thread), ztest_unit_test(test_queue_thread2isr), ztest_unit_test(test_queue_isr2thread), ztest_unit_test(test_queue_get_2threads), ztest_unit_test(test_queue_get_fail), ztest_unit_test(test_queue_loop), ztest_unit_test(test_queue_alloc)); ztest_run_test_suite(queue_api); }
/******************************************************************************* * @file * @purpose * @version 0.1 *------------------------------------------------------------------------------ * Copyright (C) 2011 Gumstix Inc. * All rights reserved. * * Contributer(s): * Neil MacMunn <neil@gumstix.com> *------------------------------------------------------------------------------ * 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. * * 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. ******************************************************************************/ //#include "core_cm3.h" #include "LPC17xx.h" #include "return.h" int _NVIC_EnableIRQ(uint8_t * args) { uint8_t * arg_ptr; IRQn_Type IRQn; if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1; IRQn = (IRQn_Type) strtoul((char *) arg_ptr, NULL, 16); NVIC_EnableIRQ(IRQn); return 0; } int _NVIC_ClearPendingIRQ(uint8_t * args) { uint8_t * arg_ptr; IRQn_Type IRQn; if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1; IRQn = (IRQn_Type) strtoul((char *) arg_ptr, NULL, 16); NVIC_ClearPendingIRQ(IRQn); return 0; }
/* $NetBSD: flt_rounds.c,v 1.6 2012/06/24 15:26:02 christos Exp $ */ /* * Written by J.T. Conklin, Apr 10, 1995 * Public domain. */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: flt_rounds.c,v 1.6 2012/06/24 15:26:02 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> #include <machine/float.h> static const int map[] = { 1, /* round to nearest */ 0, /* round to zero */ 2, /* round to positive infinity */ 3 /* round to negative infinity */ }; int __flt_rounds(void) { uint32_t x; __asm("st %%fsr,%0" : "=m" (*&x)); return map[(x >> 30) & 0x03]; }
#ifndef READXL_XLSWORKSHEET_ #define READXL_XLSWORKSHEET_ #include <Rcpp.h> #include <libxls/xls.h> #include "XlsWorkBook.h" #include "CellType.h" #include "utils.h" class XlsWorkSheet { xls::xlsWorkSheet* pWS_; int nrow_, ncol_; double offset_; std::set<int> customDateFormats_; public: XlsWorkSheet(const XlsWorkBook& wb, int i) { offset_ = dateOffset(wb.workbook()->is1904); if (i < 0 || i >= wb.nSheets()) Rcpp::stop("Invalid sheet index"); pWS_ = xls_getWorkSheet(wb.workbook(), i); if (pWS_ == NULL) Rcpp::stop("Failed open sheet"); xls_parseWorkSheet(pWS_); nrow_ = pWS_->rows.lastrow + 1; ncol_ = pWS_->rows.lastcol; // excel always pads with an empty column customDateFormats_ = wb.customDateFormats(); } ~XlsWorkSheet() { try { xls_close_WS(pWS_); } catch(...) {} } int nrow() const { return nrow_; } int ncol() const { return ncol_; } Rcpp::CharacterVector colNames(int nskip = 0) { Rcpp::CharacterVector out(ncol_); if (nskip > nrow_) return out; xls::st_row::st_row_data row = pWS_->rows.row[nskip]; for (int j = 0; j < ncol_; ++j) { xls::st_cell::st_cell_data cell = row.cells.cell[j]; if (cell.str == NULL) { out[j] = NA_STRING; } else { out[j] = Rf_mkCharCE((char*) cell.str, CE_UTF8); } } return out; } std::vector<CellType> colTypes(std::string na, int nskip = 0, int n_max = 100) { std::vector<CellType> types(ncol_); for (int i = nskip; i < nrow_ && i < n_max; ++i) { if ((i + 1) % 10000 == 0) Rcpp::checkUserInterrupt(); xls::st_row::st_row_data row = pWS_->rows.row[i]; for (int j = 0; j < ncol_; ++j) { CellType type = cellType(row.cells.cell[j], &pWS_->workbook->xfs, customDateFormats_, na); // Excel is simple enough we can enforce a strict ordering if (type > types[j]) { types[j] = type; } } } return types; } Rcpp::List readCols(Rcpp::CharacterVector names, std::vector<CellType> types, std::string na, int nskip = 0) { if ((int) names.size() != ncol_ || (int) types.size() != ncol_) Rcpp::stop("Need one name and type for each column"); Rcpp::List cols(ncol_); // Initialise columns int n = nrow_ - nskip; for (int j = 0; j < ncol_; ++j) { cols[j] = makeCol(types[j], n); } // Fill with data for (int i = 0; i < n; ++i) { xls::st_row::st_row_data row = pWS_->rows.row[i + nskip]; for (int j = 0; j < ncol_; ++j) { xls::st_cell::st_cell_data cell = row.cells.cell[j]; Rcpp::RObject col = cols[j]; CellType type = cellType(cell, &pWS_->workbook->xfs, customDateFormats_, na); // Needs to compare to actual cell type to give warnings switch(types[j]) { case CELL_BLANK: break; case CELL_NUMERIC: switch(type) { case CELL_BLANK: REAL(col)[i] = NA_REAL; break; case CELL_NUMERIC: case CELL_DATE: REAL(col)[i] = cell.d; break; case CELL_TEXT: Rcpp::warning("Expecting numeric in [%i, %i] got `%s`", i + 1, j + 1, (char*) cell.str); REAL(col)[i] = NA_REAL; } break; case CELL_DATE: switch(type) { case CELL_BLANK: REAL(col)[i] = NA_REAL; break; case CELL_NUMERIC: Rcpp::warning("Expecting date in [%i, %i] got %d", i + 1, j + 1, cell.d); REAL(col)[i] = NA_REAL; break; case CELL_DATE: REAL(col)[i] = (cell.d - offset_) * 86400; break; case CELL_TEXT: Rcpp::warning("Expecting date in [%i, %i] got '%s'", i + 1, j + 1, cell.str); REAL(col)[i] = NA_REAL; break; } break; case CELL_TEXT: if (type == CELL_BLANK) { SET_STRING_ELT(col, i, NA_STRING); } else { std::string stdString((char*) cell.str); Rcpp::RObject rString = stdString == na ? NA_STRING : Rf_mkCharCE(stdString.c_str(), CE_UTF8); SET_STRING_ELT(col, i, rString); } break; } } } return colDataframe(cols, names, types); } }; #endif
#include "config.h" #include <sys/mman.h> #include <sys/stat.h> #include <fcntl.h> #include "evas_cs2.h" #include "evas_cs2_private.h" #ifdef EVAS_CSERVE2 void * evas_cserve2_image_data_get(Image_Entry *ie) { Data_Entry *dentry = ie->data2; if (!dentry) return NULL; return dentry->shm.data; } #endif
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2001-2007, Tom St Denis * 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 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. */ /* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" /** @file cbc_decrypt.c CBC implementation, encrypt block, Tom St Denis */ #ifdef LTC_CBC_MODE /** CBC decrypt @param ct Ciphertext @param pt [out] Plaintext @param len The number of bytes to process (must be multiple of block length) @param cbc CBC state @return CRYPT_OK if successful */ int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CBC *cbc) { int x, err; unsigned char tmp[16]; #ifdef LTC_FAST LTC_FAST_TYPE tmpy; #else unsigned char tmpy; #endif LTC_ARGCHK(pt != NULL); LTC_ARGCHK(ct != NULL); LTC_ARGCHK(cbc != NULL); if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { return err; } /* is blocklen valid? */ if (cbc->blocklen < 1 || cbc->blocklen > (int)sizeof(cbc->IV)) { return CRYPT_INVALID_ARG; } if (len % cbc->blocklen) { return CRYPT_INVALID_ARG; } #ifdef LTC_FAST if (cbc->blocklen % sizeof(LTC_FAST_TYPE)) { return CRYPT_INVALID_ARG; } #endif if (cipher_descriptor[cbc->cipher]->accel_cbc_decrypt != NULL) { return cipher_descriptor[cbc->cipher]->accel_cbc_decrypt(ct, pt, len / cbc->blocklen, cbc->IV, &cbc->key); } else { while (len) { /* decrypt */ if ((err = cipher_descriptor[cbc->cipher]->ecb_decrypt(ct, tmp, &cbc->key)) != CRYPT_OK) { return err; } /* xor IV against plaintext */ #if defined(LTC_FAST) for (x = 0; x < cbc->blocklen; x += sizeof(LTC_FAST_TYPE)) { tmpy = *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) ^ *((LTC_FAST_TYPE*)((unsigned char *)tmp + x)); *((LTC_FAST_TYPE*)((unsigned char *)cbc->IV + x)) = *((LTC_FAST_TYPE*)((unsigned char *)ct + x)); *((LTC_FAST_TYPE*)((unsigned char *)pt + x)) = tmpy; } #else for (x = 0; x < cbc->blocklen; x++) { tmpy = tmp[x] ^ cbc->IV[x]; cbc->IV[x] = ct[x]; pt[x] = tmpy; } #endif ct += cbc->blocklen; pt += cbc->blocklen; len -= cbc->blocklen; } } return CRYPT_OK; } #endif /* $Source: /cvs/libtom/libtomcrypt/src/modes/cbc/cbc_decrypt.c,v $ */ /* $Revision: 1.16 $ */ /* $Date: 2006/12/28 01:27:24 $ */
// [AsmJit] // Complete x86/x64 JIT and Remote Assembler for C++. // // [License] // Zlib - See LICENSE.md file in the package. // [Guard] #ifndef _ASMJIT_CONFIG_H #define _ASMJIT_CONFIG_H // This file can be used to modify built-in features of AsmJit. AsmJit is by // default compiled only for host processor to enable JIT compilation. Both // Assembler and Compiler code generators are compiled by default. // // ASMJIT_BUILD_... flags can be defined to build additional backends that can // be used for remote code generation. // // ASMJIT_DISABLE_... flags can be defined to disable standard features. These // are handy especially when building asmjit statically and some features are // not needed or unwanted (like Compiler). // ============================================================================ // [AsmJit - Build-Type] // ============================================================================ // #define ASMJIT_EMBED // Asmjit is embedded (implies ASMJIT_STATIC). // #define ASMJIT_STATIC // Define to enable static-library build. // ============================================================================ // [AsmJit - Build-Mode] // ============================================================================ // #define ASMJIT_DEBUG // Define to enable debug-mode. // #define ASMJIT_RELEASE // Define to enable release-mode. // #define ASMJIT_TRACE // Define to enable tracing. // ============================================================================ // [AsmJit - Features] // ============================================================================ // If none of these is defined AsmJit will select host architecture by default. // #define ASMJIT_BUILD_X86 // Define to enable x86 instruction set (32-bit). // #define ASMJIT_BUILD_X64 // Define to enable x64 instruction set (64-bit). // #define ASMJIT_BUILD_HOST // Define to enable host instruction set. // AsmJit features are enabled by default. // #define ASMJIT_DISABLE_COMPILER // Disable Compiler (completely). // #define ASMJIT_DISABLE_LOGGER // Disable Logger (completely). // #define ASMJIT_DISABLE_NAMES // Disable everything that uses strings // (instruction names, error names, ...). // [Guard] #endif // _ASMJIT_CONFIG_H
#pragma once #include "Iop_Module.h" #include "Iop_SifMan.h" #include <functional> class CIopBios; namespace Iop { class CLoadcore : public CModule, public CSifModule { public: enum MODULE_ID { MODULE_ID = 0x80000006 }; typedef std::function<uint32 (const char*, const char*)> LoadExecutableHandler; CLoadcore(CIopBios&, uint8*, CSifMan&); virtual ~CLoadcore(); std::string GetId() const override; std::string GetFunctionName(unsigned int) const override; void Invoke(CMIPS&, unsigned int) override; bool Invoke(uint32, uint32*, uint32, uint32*, uint32, uint8*) override; void SetLoadExecutableHandler(const LoadExecutableHandler&); private: uint32 RegisterLibraryEntries(uint32); uint32 QueryBootMode(uint32); uint32 SetRebootTimeLibraryHandlingMode(uint32, uint32); bool LoadModule(uint32*, uint32, uint32*, uint32); void LoadExecutable(uint32*, uint32, uint32*, uint32); void LoadModuleFromMemory(uint32*, uint32, uint32*, uint32); bool StopModule(uint32*, uint32, uint32*, uint32); void UnloadModule(uint32*, uint32, uint32*, uint32); void SearchModuleByName(uint32*, uint32, uint32*, uint32); void Initialize(uint32*, uint32, uint32*, uint32); CIopBios& m_bios; uint8* m_ram; LoadExecutableHandler m_loadExecutableHandler; }; }
#include <../Source/ccolamd_global.c>
/*========================================================================= Program: Visualization Toolkit Module: vtkXMLFileOutputWindow.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkXMLFileOutputWindow - XML File Specific output window class // .SECTION Description // Writes debug/warning/error output to an XML file. Uses prefined XML // tags for each text display method. The text is processed to replace // XML markup characters. // // DisplayText - <Text> // // DisplayErrorText - <Error> // // DisplayWarningText - <Warning> // // DisplayGenericWarningText - <GenericWarning> // // DisplayDebugText - <Debug> // // The method DisplayTag outputs the text unprocessed. To use this // class, instantiate it and then call SetInstance(this). #ifndef __vtkXMLFileOutputWindow_h #define __vtkXMLFileOutputWindow_h #include "vtkCommonCoreModule.h" // For export macro #include "vtkFileOutputWindow.h" class VTKCOMMONCORE_EXPORT vtkXMLFileOutputWindow : public vtkFileOutputWindow { public: vtkTypeMacro(vtkXMLFileOutputWindow, vtkFileOutputWindow); static vtkXMLFileOutputWindow* New(); // Description: // Put the text into the log file. The text is processed to // replace &, <, > with &amp, &lt, and &gt. // Each display method outputs a different XML tag. virtual void DisplayText(const char*); virtual void DisplayErrorText(const char*); virtual void DisplayWarningText(const char*); virtual void DisplayGenericWarningText(const char*); virtual void DisplayDebugText(const char*); // Description: // Put the text into the log file without processing it. virtual void DisplayTag(const char*); protected: vtkXMLFileOutputWindow() {}; virtual ~vtkXMLFileOutputWindow() {}; void Initialize(); virtual void DisplayXML(const char*, const char*); private: vtkXMLFileOutputWindow(const vtkXMLFileOutputWindow&); // Not implemented. void operator=(const vtkXMLFileOutputWindow&); // Not implemented. }; #endif // VTK-HeaderTest-Exclude: vtkXMLFileOutputWindow.h
/* Copyright (C) 2014, The University of Texas at Austin This file is part of libflame and is available under the 3-Clause BSD license, which can be found in the LICENSE file at the top-level directory, or at http://opensource.org/licenses/BSD-3-Clause */ #include "FLAME.h" #ifdef FLA_ENABLE_NON_CRITICAL_CODE FLA_Error FLA_Herk_ln_blk_var3( FLA_Obj alpha, FLA_Obj A, FLA_Obj beta, FLA_Obj C, fla_herk_t* cntl ) { FLA_Obj AT, A0, AB, A1, A2; FLA_Obj CTL, CTR, C00, C01, C02, CBL, CBR, C10, C11, C12, C20, C21, C22; dim_t b; FLA_Part_2x1( A, &AT, &AB, 0, FLA_BOTTOM ); FLA_Part_2x2( C, &CTL, &CTR, &CBL, &CBR, 0, 0, FLA_BR ); while ( FLA_Obj_length( AB ) < FLA_Obj_length( A ) ){ b = FLA_Determine_blocksize( AT, FLA_TOP, FLA_Cntl_blocksize( cntl ) ); FLA_Repart_2x1_to_3x1( AT, &A0, &A1, /* ** */ /* ** */ AB, &A2, b, FLA_TOP ); FLA_Repart_2x2_to_3x3( CTL, /**/ CTR, &C00, &C01, /**/ &C02, &C10, &C11, /**/ &C12, /* ************* */ /* ******************** */ CBL, /**/ CBR, &C20, &C21, /**/ &C22, b, b, FLA_TL ); /*------------------------------------------------------------*/ /* C21 = C21 + A2 * A1' */ FLA_Gemm_internal( FLA_NO_TRANSPOSE, FLA_CONJ_TRANSPOSE, alpha, A2, A1, beta, C21, FLA_Cntl_sub_gemm( cntl ) ); /* C11 = C11 + A1 * A1' */ FLA_Herk_internal( FLA_LOWER_TRIANGULAR, FLA_NO_TRANSPOSE, alpha, A1, beta, C11, FLA_Cntl_sub_herk( cntl ) ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &AT, A0, /* ** */ /* ** */ A1, &AB, A2, FLA_BOTTOM ); FLA_Cont_with_3x3_to_2x2( &CTL, /**/ &CTR, C00, /**/ C01, C02, /* ************** */ /* ****************** */ C10, /**/ C11, C12, &CBL, /**/ &CBR, C20, /**/ C21, C22, FLA_BR ); } return FLA_SUCCESS; } #endif
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef StyleInvalidator_h #define StyleInvalidator_h #include "core/css/invalidation/PendingInvalidations.h" #include "platform/heap/Handle.h" #include "wtf/Noncopyable.h" namespace blink { class Document; class Element; class HTMLSlotElement; class InvalidationSet; class StyleInvalidator { DISALLOW_NEW(); WTF_MAKE_NONCOPYABLE(StyleInvalidator); public: StyleInvalidator(); ~StyleInvalidator(); void invalidate(Document&); void scheduleInvalidationSetsForElement(const InvalidationLists&, Element&); void clearInvalidation(Element&); DECLARE_TRACE(); private: struct RecursionData { RecursionData() : m_invalidateCustomPseudo(false) , m_wholeSubtreeInvalid(false) , m_treeBoundaryCrossing(false) , m_insertionPointCrossing(false) , m_invalidatesSlotted(false) { } void pushInvalidationSet(const DescendantInvalidationSet&); bool matchesCurrentInvalidationSets(Element&) const; bool matchesCurrentInvalidationSetsAsSlotted(Element&) const; bool hasInvalidationSets() const { return !wholeSubtreeInvalid() && m_invalidationSets.size(); } bool wholeSubtreeInvalid() const { return m_wholeSubtreeInvalid; } void setWholeSubtreeInvalid() { m_wholeSubtreeInvalid = true; } bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } bool insertionPointCrossing() const { return m_insertionPointCrossing; } bool invalidatesSlotted() const { return m_invalidatesSlotted; } using DescendantInvalidationSets = Vector<const DescendantInvalidationSet*, 16>; DescendantInvalidationSets m_invalidationSets; bool m_invalidateCustomPseudo; bool m_wholeSubtreeInvalid; bool m_treeBoundaryCrossing; bool m_insertionPointCrossing; bool m_invalidatesSlotted; }; class SiblingData { STACK_ALLOCATED(); public: SiblingData() : m_elementIndex(0) { } void pushInvalidationSet(const SiblingInvalidationSet&); bool matchCurrentInvalidationSets(Element&, RecursionData&) const; bool isEmpty() const { return m_invalidationEntries.isEmpty(); } void advance() { m_elementIndex++; } private: struct Entry { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); Entry(const SiblingInvalidationSet* invalidationSet, unsigned invalidationLimit) : m_invalidationSet(invalidationSet) , m_invalidationLimit(invalidationLimit) {} const SiblingInvalidationSet* m_invalidationSet; unsigned m_invalidationLimit; }; mutable Vector<Entry, 16> m_invalidationEntries; unsigned m_elementIndex; }; bool invalidate(Element&, RecursionData&, SiblingData&); bool invalidateShadowRootChildren(Element&, RecursionData&); bool invalidateChildren(Element&, RecursionData&); void invalidateSlotDistributedElements(HTMLSlotElement&, const RecursionData&) const; bool checkInvalidationSetsAgainstElement(Element&, RecursionData&, SiblingData&); void pushInvalidationSetsForElement(Element&, RecursionData&, SiblingData&); class RecursionCheckpoint { public: RecursionCheckpoint(RecursionData* data) : m_prevInvalidationSetsSize(data->m_invalidationSets.size()) , m_prevInvalidateCustomPseudo(data->m_invalidateCustomPseudo) , m_prevWholeSubtreeInvalid(data->m_wholeSubtreeInvalid) , m_treeBoundaryCrossing(data->m_treeBoundaryCrossing) , m_insertionPointCrossing(data->m_insertionPointCrossing) , m_invalidatesSlotted(data->m_invalidatesSlotted) , m_data(data) { } ~RecursionCheckpoint() { m_data->m_invalidationSets.remove(m_prevInvalidationSetsSize, m_data->m_invalidationSets.size() - m_prevInvalidationSetsSize); m_data->m_invalidateCustomPseudo = m_prevInvalidateCustomPseudo; m_data->m_wholeSubtreeInvalid = m_prevWholeSubtreeInvalid; m_data->m_treeBoundaryCrossing = m_treeBoundaryCrossing; m_data->m_insertionPointCrossing = m_insertionPointCrossing; m_data->m_invalidatesSlotted = m_invalidatesSlotted; } private: int m_prevInvalidationSetsSize; bool m_prevInvalidateCustomPseudo; bool m_prevWholeSubtreeInvalid; bool m_treeBoundaryCrossing; bool m_insertionPointCrossing; bool m_invalidatesSlotted; RecursionData* m_data; }; using PendingInvalidationMap = HeapHashMap<Member<Element>, OwnPtr<PendingInvalidations>>; PendingInvalidations& ensurePendingInvalidations(Element&); PendingInvalidationMap m_pendingInvalidationMap; }; } // namespace blink #endif // StyleInvalidator_h
#ifndef AUX_PROP_H #define AUX_PROP_H #include <pins2lts-sym/aux/options.h> #include <vset-lib/vector_set.h> typedef struct rel_expr_info { int* vec; // a long vector to use for expanding short vectors int len; // number of dependencies in this relational expression int* deps; // the dependencies in this relational expression ltsmin_expr_t e; // the relation expression ltsmin_parse_env_t env; // its environment } rel_expr_info_t; extern void rel_expr_cb(vset_t set, void *context, int *e); extern void init_action_detection(); extern void init_invariant_detection(); extern void inv_info_prepare(ltsmin_expr_t e, ltsmin_parse_env_t env, int i); extern void find_trace(int trace_end[][N], int end_count, int level, vset_t *levels, char* file_prefix); extern void find_action(int* src, int* dst, int* cpy, int group, char* action); extern void check_invariants(vset_t set, int level); extern void deadlock_check(vset_t deadlocks, bitvector_t *reach_groups); #endif //AUX_PROP_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_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ #define CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ #include <map> #include "base/memory/singleton.h" #include "base/platform_file.h" #include "base/process.h" #include "ipc/ipc_platform_file.h" class FilePath; namespace content { class WebContents; class MHTMLGenerationManager { public: static MHTMLGenerationManager* GetInstance(); typedef base::Callback<void(const FilePath& /* path to the MHTML file */, int64 /* size of the file */)> GenerateMHTMLCallback; // Instructs the render view to generate a MHTML representation of the current // page for |web_contents|. void GenerateMHTML(WebContents* web_contents, const FilePath& file, const GenerateMHTMLCallback& callback); // Notification from the renderer that the MHTML generation finished. // |mhtml_data_size| contains the size in bytes of the generated MHTML data, // or -1 in case of failure. void MHTMLGenerated(int job_id, int64 mhtml_data_size); private: friend struct DefaultSingletonTraits<MHTMLGenerationManager>; struct Job{ Job(); ~Job(); FilePath file_path; // The handles to file the MHTML is saved to, for the browser and renderer // processes. base::PlatformFile browser_file; IPC::PlatformFileForTransit renderer_file; // The IDs mapping to a specific contents. int process_id; int routing_id; // The callback to call once generation is complete. GenerateMHTMLCallback callback; }; MHTMLGenerationManager(); ~MHTMLGenerationManager(); // Called on the file thread to create |file|. void CreateFile(int job_id, const FilePath& file, base::ProcessHandle renderer_process); // Called on the UI thread when the file that should hold the MHTML data has // been created. This returns a handle to that file for the browser process // and one for the renderer process. These handles are // kInvalidPlatformFileValue if the file could not be opened. void FileCreated(int job_id, base::PlatformFile browser_file, IPC::PlatformFileForTransit renderer_file); // Called on the file thread to close the file the MHTML was saved to. void CloseFile(base::PlatformFile file); // Called on the UI thread when a job has been processed (successfully or // not). Closes the file and removes the job from the job map. // |mhtml_data_size| is -1 if the MHTML generation failed. void JobFinished(int job_id, int64 mhtml_data_size); typedef std::map<int, Job> IDToJobMap; IDToJobMap id_to_job_; DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); }; } // namespace content #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSIMD_P_H #define QSIMD_P_H #include <qglobal.h> QT_BEGIN_HEADER #if defined(QT_NO_MAC_XARCH) || (defined(Q_OS_DARWIN) && (defined(__ppc__) || defined(__ppc64__))) // Disable MMX and SSE on Mac/PPC builds, or if the compiler // does not support -Xarch argument passing #undef QT_HAVE_SSE #undef QT_HAVE_SSE2 #undef QT_HAVE_SSE3 #undef QT_HAVE_SSSE3 #undef QT_HAVE_SSE4_1 #undef QT_HAVE_SSE4_2 #undef QT_HAVE_AVX #undef QT_HAVE_3DNOW #undef QT_HAVE_MMX #endif // SSE intrinsics #if defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC)) #if defined(QT_LINUXBASE) /// this is an evil hack - the posix_memalign declaration in LSB /// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431 # define posix_memalign _lsb_hack_posix_memalign # include <emmintrin.h> # undef posix_memalign #else # ifdef Q_CC_MINGW # include <windows.h> # endif # include <emmintrin.h> #endif // SSE3 intrinsics #if defined(QT_HAVE_SSE3) && (defined(__SSE3__) || defined(Q_CC_MSVC)) #include <pmmintrin.h> #endif // SSSE3 intrinsics #if defined(QT_HAVE_SSSE3) && (defined(__SSSE3__) || defined(Q_CC_MSVC)) #include <tmmintrin.h> #endif // SSE4.1 intrinsics #if defined(QT_HAVE_SSE4_1) && (defined(__SSE4_1__) || defined(Q_CC_MSVC)) #include <smmintrin.h> #endif // SSE4.2 intrinsics #if defined(QT_HAVE_SSE4_2) && (defined(__SSE4_2__) || defined(Q_CC_MSVC)) #include <nmmintrin.h> #endif // AVX intrinsics #if defined(QT_HAVE_AVX) && (defined(__AVX__) || defined(Q_CC_MSVC)) #include <immintrin.h> #endif #if !defined(QT_BOOTSTRAPPED) && (!defined(Q_CC_MSVC) || (defined(_M_X64) || _M_IX86_FP == 2)) #define QT_ALWAYS_HAVE_SSE2 #endif #endif // defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC)) // NEON intrinsics #if defined __ARM_NEON__ #define QT_ALWAYS_HAVE_NEON #include <arm_neon.h> #endif // IWMMXT intrinsics #if defined(QT_HAVE_IWMMXT) #include <mmintrin.h> #if defined(Q_OS_WINCE) # include "qplatformdefs.h" #endif #endif #if defined(QT_HAVE_IWMMXT) #if !defined(__IWMMXT__) && !defined(Q_OS_WINCE) # include <xmmintrin.h> #elif defined(Q_OS_WINCE_STD) && defined(_X86_) # pragma warning(disable: 4391) # include <xmmintrin.h> #endif #endif // 3D now intrinsics #if defined(QT_HAVE_3DNOW) #include <mm3dnow.h> #endif QT_BEGIN_NAMESPACE QT_MODULE(Core) enum CPUFeatures { None = 0, MMX = 0x1, MMXEXT = 0x2, MMX3DNOW = 0x4, MMX3DNOWEXT = 0x8, SSE = 0x10, SSE2 = 0x20, CMOV = 0x40, IWMMXT = 0x80, NEON = 0x100, SSE3 = 0x200, SSSE3 = 0x400, SSE4_1 = 0x800, SSE4_2 = 0x1000, AVX = 0x2000 }; Q_CORE_EXPORT uint qDetectCPUFeatures(); #define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \ for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((4 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x3)) & 0x3))); ++i) QT_END_NAMESPACE QT_END_HEADER #endif // QSIMD_P_H