text
stringlengths
4
6.14k
/* $NetBSD: openraw.c,v 1.1.2.1 2000/08/14 07:59:59 leo Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Julian Coleman, Waldi Ravens and Leo Weppelman. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "privahdi.h" #include <fcntl.h> #include <paths.h> #include <stdio.h> #include <machine/disklabel.h> /* * Open raw disk partition. */ int openraw (name, flags) const char *name; int flags; { char buf[MAXPATHLEN]; int f; if ((f = open (name, flags)) != -1) return (f); snprintf (buf, MAXPATHLEN, "r%s%c", name, RAW_PART + 'a'); if ((f = open (buf, flags)) != -1) return (f); snprintf (buf, MAXPATHLEN, "%sr%s%c", _PATH_DEV, name, RAW_PART + 'a'); if ((f = open (buf, flags)) != -1) return (f); return (0); }
// RUN: jlang-cc -E %s -verify #define DO_PRAGMA _Pragma DO_PRAGMA ("GCC dependency \"blahblabh\"") // expected-error {{file not found}}
// 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 MEDIA_VIDEO_FAKE_VIDEO_ENCODE_ACCELERATOR_H_ #define MEDIA_VIDEO_FAKE_VIDEO_ENCODE_ACCELERATOR_H_ #include <stddef.h> #include <stdint.h> #include <list> #include <vector> #include "base/containers/queue.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "media/base/bitstream_buffer.h" #include "media/video/video_encode_accelerator.h" namespace base { class SingleThreadTaskRunner; } // namespace base namespace media { static const size_t kMinimumOutputBufferSize = 123456; class FakeVideoEncodeAccelerator : public VideoEncodeAccelerator { public: explicit FakeVideoEncodeAccelerator( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); ~FakeVideoEncodeAccelerator() override; VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles() override; bool Initialize(const Config& config, Client* client) override; void Encode(scoped_refptr<VideoFrame> frame, bool force_keyframe) override; void UseOutputBitstreamBuffer(BitstreamBuffer buffer) override; void RequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate) override; void RequestEncodingParametersChange(const VideoBitrateAllocation& bitrate, uint32_t framerate) override; void Destroy() override; const std::vector<uint32_t>& stored_bitrates() const { return stored_bitrates_; } const std::vector<VideoBitrateAllocation>& stored_bitrate_allocations() const { return stored_bitrate_allocations_; } void SendDummyFrameForTesting(bool key_frame); void SetWillInitializationSucceed(bool will_initialization_succeed); size_t minimum_output_buffer_size() const { return kMinimumOutputBufferSize; } private: void DoRequireBitstreamBuffers(unsigned int input_count, const gfx::Size& input_coded_size, size_t output_buffer_size) const; void EncodeTask(); void DoBitstreamBufferReady(int32_t bitstream_buffer_id, size_t payload_size, bool key_frame) const; // Our original (constructor) calling message loop used for all tasks. const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; std::vector<uint32_t> stored_bitrates_; std::vector<VideoBitrateAllocation> stored_bitrate_allocations_; bool will_initialization_succeed_; VideoEncodeAccelerator::Client* client_; // Keeps track of if the current frame is the first encoded frame. This // is used to force a fake key frame for the first encoded frame. bool next_frame_is_first_frame_; // A queue containing the necessary data for incoming frames. The boolean // represent whether the queued frame should force a key frame. base::queue<bool> queued_frames_; // A list of buffers available for putting fake encoded frames in. std::list<BitstreamBuffer> available_buffers_; base::WeakPtrFactory<FakeVideoEncodeAccelerator> weak_this_factory_{this}; DISALLOW_COPY_AND_ASSIGN(FakeVideoEncodeAccelerator); }; } // namespace media #endif // MEDIA_VIDEO_FAKE_VIDEO_ENCODE_ACCELERATOR_H_
// ---------------------------------------------------------------------------- // Parameter.h // // // Authors: // Peter Polidoro peterpolidoro@gmail.com // ---------------------------------------------------------------------------- #ifndef _MODULAR_SERVER_PARAMETER_H_ #define _MODULAR_SERVER_PARAMETER_H_ #include <Arduino.h> #include <ConstantVariable.h> #include <JsonStream.h> #include <Vector.h> #include <Functor.h> #include <ArduinoJson.h> #include "FirmwareElement.h" #include "Response.h" #include "Constants.h" namespace modular_server { class Parameter : private FirmwareElement { public: Parameter(); void setTypeLong(); void setTypeDouble(); void setTypeBool(); void setTypeString(); void setTypeObject(); void setTypeArray(); void setTypeAny(); void setType(JsonStream::JsonTypes type); void setUnits(const ConstantString & units); template <typename T> void setRange(T min, T max); void setRange(double min, double max); void setRange(float min, float max); void setRange(constants::NumberType min, constants::NumberType max); void removeRange(); void setArrayLengthRange(size_t array_length_min, size_t array_length_max); void removeArrayLengthRange(); template <size_t MAX_SIZE> void setSubset(constants::SubsetMemberType (&subset)[MAX_SIZE], size_t size=MAX_SIZE); void setSubset(constants::SubsetMemberType * subset, size_t max_size, size_t size); void setSubset(Vector<constants::SubsetMemberType> & subset); void addValueToSubset(constants::SubsetMemberType & value); void removeSubset(); size_t getSubsetSize(); size_t getSubsetMaxSize(); template <typename T> bool getValue(T & value); bool getValue(const char * & value); bool getValue(ArduinoJson::JsonArray & value); bool getValue(ArduinoJson::JsonObject & value); bool getValue(const ConstantString * & value); Parameter getElementParameter(); private: const ConstantString * units_ptr_; JsonStream::JsonTypes type_; JsonStream::JsonTypes array_element_type_; constants::NumberType min_; constants::NumberType max_; bool range_is_set_; size_t array_length_min_; size_t array_length_max_; bool array_length_range_is_set_; Vector<constants::SubsetMemberType> subset_; bool subset_is_set_; Parameter(const ConstantString & name); void setup(const ConstantString & name); const ConstantString & getUnits(); JsonStream::JsonTypes getType(); JsonStream::JsonTypes getArrayElementType(); bool rangeIsSet(); template <typename T> bool valueInRange(T value); bool valueInRange(double value); bool valueInRange(float value); const constants::NumberType & getRangeMin(); const constants::NumberType & getRangeMax(); size_t getArrayLengthMin(); size_t getArrayLengthMax(); bool arrayLengthRangeIsSet(); bool arrayLengthInRange(size_t array_length); bool subsetIsSet(); int findSubsetValueIndex(long value); int findSubsetValueIndex(const char * value); int findSubsetValueIndex(const ConstantString * value); bool valueInSubset(long value); bool valueInSubset(const char * value); bool valueInSubset(const ConstantString * value); Vector<constants::SubsetMemberType> & getSubset(); void writeApi(Response & response, bool write_name_only, bool is_property, bool write_firmware, bool write_instance_details); static Functor1wRet<const ConstantString &,ArduinoJson::JsonVariant> get_value_functor_; friend class Property; friend class Function; friend class Callback; friend class Server; }; } #include "ParameterDefinitions.h" #endif
/* * Copyright (C) 2007, 2008 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 THIRD_PARTY_BLINK_RENDERER_CORE_EVENTS_PROGRESS_EVENT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EVENTS_PROGRESS_EVENT_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/events/event.h" namespace blink { class ProgressEventInit; class CORE_EXPORT ProgressEvent : public Event { DEFINE_WRAPPERTYPEINFO(); public: static ProgressEvent* Create() { return MakeGarbageCollected<ProgressEvent>(); } static ProgressEvent* Create(const AtomicString& type, bool length_computable, uint64_t loaded, uint64_t total) { return MakeGarbageCollected<ProgressEvent>(type, length_computable, loaded, total); } static ProgressEvent* Create(const AtomicString& type, const ProgressEventInit* initializer) { return MakeGarbageCollected<ProgressEvent>(type, initializer); } ProgressEvent(); ProgressEvent(const AtomicString& type, bool length_computable, uint64_t loaded, uint64_t total); ProgressEvent(const AtomicString&, const ProgressEventInit*); bool lengthComputable() const { return length_computable_; } uint64_t loaded() const { return loaded_; } uint64_t total() const { return total_; } const AtomicString& InterfaceName() const override; void Trace(Visitor*) override; private: bool length_computable_; uint64_t loaded_; uint64_t total_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_EVENTS_PROGRESS_EVENT_H_
// // SGBubbleTableViewDataSource.h // // Created by Alex Barinov // Project home page: http://alexbarinov.github.com/UIBubbleTableView/ // // This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. // To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ // #import <Foundation/Foundation.h> @class SGBubbleData; @class SGBubbleTableView; @class SGBubbleTableViewContentCell; @class SGBubbleTableViewHeaderCell; @class SGBubbleTableViewTypingCell; @protocol SGBubbleTableViewDataSource <NSObject> @required - (NSInteger)numberOfRowsForBubbleTableView:(SGBubbleTableView *)tableView; - (SGBubbleData *)bubbleTableView:(SGBubbleTableView *)tableView dataForRow:(NSInteger)row; @optional - (SGBubbleTableViewContentCell *)contentCellForBubbleTableView:(SGBubbleTableView *)bubbleTableView withBubbleData:(SGBubbleData *)bubbleData; - (SGBubbleTableViewHeaderCell *)headerCellForBubbleTableView:(SGBubbleTableView *)bubbleTableView withBubbleData:(SGBubbleData *)bubbleData; - (SGBubbleTableViewTypingCell *)typingCellForBubbleTableView:(SGBubbleTableView *)bubbleTableView; @end
/* snefru.h */ #ifndef SNEFRU_H #define SNEFRU_H #include "stdint.h" #ifdef __cplusplus extern "C" { #endif /* Snefru-128 processses message by blocks of 48 bytes, */ /* and Snefru-256 uses blocks of 32 bytes */ /* here we declare the maximal block size */ #define snefru_block_size 48 #define snefru128_hash_length 16 #define snefru256_hash_length 32 /* algorithm context */ typedef struct snefru_ctx { unsigned hash[8]; /* algorithm 512-bit hashing state */ unsigned char buffer[48]; /* 384-bit message block */ uint64_t length; /* processed message length */ unsigned index; /* index in the buffer of the last byte stored */ unsigned digest_length; /* length of the algorithm digest in bytes */ } snefru_ctx; /* hash functions */ void rhash_snefru128_init(snefru_ctx *ctx); void rhash_snefru256_init(snefru_ctx *ctx); void rhash_snefru_update(snefru_ctx *ctx, const unsigned char *data, size_t size); void rhash_snefru_final(snefru_ctx *ctx, unsigned char* result); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ #endif /* SNEFRU_H */
/* / _____) _ | | ( (____ _____ ____ _| |_ _____ ____| |__ \____ \| ___ | (_ _) ___ |/ ___) _ \ _____) ) ____| | | || |_| ____( (___| | | | (______/|_____)_|_|_| \__)_____)\____)_| |_| (C)2013 Semtech Description: Target board general functions implementation License: Revised BSD License, see LICENSE.TXT file include in the project Maintainer: Andreas Pella (IMST GmbH), Miguel Luis and Gregory Cristian */ #ifndef __BOARD_H__ #define __BOARD_H__ #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdint.h> #include "stm32l1xx.h" #include "utilities.h" #include "timer.h" #include "delay.h" #include "gpio.h" #include "adc.h" #include "spi.h" #include "i2c.h" #include "uart.h" #include "radio.h" #include "sx1272/sx1272.h" #include "adc-board.h" #include "rtc-board.h" #include "timer-board.h" #include "sx1272-board.h" /*! * Generic definition */ #ifndef SUCCESS #define SUCCESS 1 #endif #ifndef FAIL #define FAIL 0 #endif /*! * Enables the choice between Led1 and Potentiometer. * LED1 and Potentiometer are exclusive. * \remark When using Potentimeter don't forget that the connection between * ADC input pin of iM880A and the Demoboard Poti requires a connection * between X5:11 - X5:18. * Remove the original jumpers for that. * On SK-iM880A X5 is the 20 pin header close to the DIP SW and Buttons */ #define USE_POTENTIOMETER 1 /*! * Board MCU pins definitions */ #define RADIO_RESET PA_2 #define RADIO_MOSI PA_7 #define RADIO_MISO PA_6 #define RADIO_SCLK PA_5 #define RADIO_NSS PB_0 #define RADIO_DIO_0 PB_1 #define RADIO_DIO_1 PB_10 #define RADIO_DIO_2 PB_11 #define RADIO_DIO_3 PB_7 #define RADIO_DIO_4 PB_5 #define RADIO_DIO_5 PB_4 #define RADIO_ANT_SWITCH_RX PC_13 #define RADIO_ANT_SWITCH_TX PA_4 #define OSC_LSE_IN PC_14 #define OSC_LSE_OUT PC_15 #define OSC_HSE_IN PH_0 #define OSC_HSE_OUT PH_1 #define USB_DM PA_11 #define USB_DP PA_12 #define JTAG_TMS PA_13 #define JTAG_TCK PA_14 #define JTAG_TDI PA_15 #define JTAG_TDO PB_3 #define JTAG_NRST PB_4 #define I2C_SCL PB_8 #define I2C_SDA PB_9 #define UART_TX PA_9 #define UART_RX PA_10 #if ( USE_POTENTIOMETER == 1 ) #define POTI PA_3 #else #define LED_1 PA_3 #endif #define LED_2 PA_0 #define LED_3 PA_1 #define LED_4 PA_8 /*! * LED GPIO pins objects */ #if ( USE_POTENTIOMETER == 0 ) extern Gpio_t Led1; #endif extern Gpio_t Led2; extern Gpio_t Led3; extern Gpio_t Led4; /*! * MCU objects */ extern Adc_t Adc; extern I2c_t I2c; extern Uart_t Uart1; /*! * \brief Initializes the target board peripherals. */ void BoardInitMcu( void ); /*! * \brief Initializes the boards peripherals. */ void BoardInitPeriph( void ); /*! * \brief De-initializes the target board peripherals to decrease power * consumption. */ void BoardDeInitMcu( void ); /*! * \brief Measure the Potentiometer level * * \retval value Potentiometer level ( value in percent ) */ uint8_t BoardMeasurePotiLevel( void ); /*! * \brief Measure the VDD voltage * * \retval value VDD voltage in milivolts */ uint16_t BoardMeasureVdd( void ); /*! * \brief Get the current battery level * * \retval value battery level ( 0: very low, 254: fully charged ) */ uint8_t BoardGetBatteryLevel( void ); /*! * Returns a pseudo random seed generated using the MCU Unique ID * * \retval seed Generated pseudo random seed */ uint32_t BoardGetRandomSeed( void ); /*! * \brief Gets the board 64 bits unique ID * * \param [IN] id Pointer to an array that will contain the Unique ID */ void BoardGetUniqueId( uint8_t *id ); #endif // __BOARD_H__
// Copyright 2021 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_COMPONENTS_ARC_COMPAT_MODE_METRICS_H_ #define ASH_COMPONENTS_ARC_COMPAT_MODE_METRICS_H_ #include "ash/components/arc/mojom/compatibility_mode.mojom.h" namespace arc { enum class ResizeLockActionType { ResizeToPhone, ResizeToTablet, TurnOnResizeLock, TurnOffResizeLock, }; enum class ResizeLockStateHistogramType { InitialState, }; void RecordResizeLockAction(ResizeLockActionType type); void RecordResizeLockStateHistogram(ResizeLockStateHistogramType type, mojom::ArcResizeLockState state); const char* GetResizeLockActionNameForTesting(ResizeLockActionType type); const char* GetResizeLockStateHistogramNameForTesting( ResizeLockStateHistogramType type); } // namespace arc #endif // ASH_COMPONENTS_ARC_COMPAT_MODE_METRICS_H_
/* * Copyright (c) 2013, CETIC. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /** * \file * Basic watchdog for the native Linux platform * \author * 6LBR Team <6lbr@cetic.be> */ #define LOG6LBR_MODULE "ETH" #include "contiki.h" #include "log-6lbr.h" #include <stdio.h> #include <time.h> #include <errno.h> #include <string.h> #include "6lbr-watchdog.h" PROCESS(native_6lbr_watchdog, "6LBR native watchdog"); int watchdog_interval = 60; char const * watchdog_file_name = "/var/log/6lbr.timestamp"; /*---------------------------------------------------------------------------*/ static void reset_watchdog(void) { FILE *watchdog_file = fopen(watchdog_file_name, "w"); if (watchdog_file != NULL) { fclose(watchdog_file); } else { LOG6LBR_ERROR("Can not reset watchdog : %s\n", strerror(errno)); } } /*---------------------------------------------------------------------------*/ PROCESS_THREAD(native_6lbr_watchdog, ev, data) { static struct etimer et; PROCESS_BEGIN(); LOG6LBR_INFO("6LBR watchdog started (interval: %d)\n", watchdog_interval); reset_watchdog(); etimer_set(&et, watchdog_interval); while(1) { PROCESS_YIELD(); if(etimer_expired(&et)) { reset_watchdog(); etimer_reset(&et); } } PROCESS_END(); } /*---------------------------------------------------------------------------*/
/* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. * Copyright 2009 Jerome Glisse. * * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. * * Authors: Dave Airlie * Alex Deucher * Jerome Glisse */ #ifndef __RADEON_OBJECT_H__ #define __RADEON_OBJECT_H__ #include <drm/radeon_drm.h> #include "radeon.h" /** * radeon_mem_type_to_domain - return domain corresponding to mem_type * @mem_type: ttm memory type * * Returns corresponding domain of the ttm mem_type */ static inline unsigned radeon_mem_type_to_domain(u32 mem_type) { switch (mem_type) { case TTM_PL_VRAM: return RADEON_GEM_DOMAIN_VRAM; case TTM_PL_TT: return RADEON_GEM_DOMAIN_GTT; case TTM_PL_SYSTEM: return RADEON_GEM_DOMAIN_CPU; default: break; } return 0; } /** * radeon_bo_reserve - reserve bo * @bo: bo structure * @no_wait: don't sleep while trying to reserve (return -EBUSY) * * Returns: * -EBUSY: buffer is busy and @no_wait is true * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by * a signal. Release all buffer reservations and return to user-space. */ static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_wait) { int r; r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); if (unlikely(r != 0)) { if (r != -ERESTARTSYS) dev_err(bo->rdev->dev, "%p reserve failed\n", bo); return r; } return 0; } static inline void radeon_bo_unreserve(struct radeon_bo *bo) { ttm_bo_unreserve(&bo->tbo); } /** * radeon_bo_gpu_offset - return GPU offset of bo * @bo: radeon object for which we query the offset * * Returns current GPU offset of the object. * * Note: object should either be pinned or reserved when calling this * function, it might be usefull to add check for this for debugging. */ static inline u64 radeon_bo_gpu_offset(struct radeon_bo *bo) { return bo->tbo.offset; } static inline unsigned long radeon_bo_size(struct radeon_bo *bo) { return bo->tbo.num_pages << PAGE_SHIFT; } static inline bool radeon_bo_is_reserved(struct radeon_bo *bo) { return !!atomic_read(&bo->tbo.reserved); } /** * radeon_bo_mmap_offset - return mmap offset of bo * @bo: radeon object for which we query the offset * * Returns mmap offset of the object. * * Note: addr_space_offset is constant after ttm bo init thus isn't protected * by any lock. */ static inline u64 radeon_bo_mmap_offset(struct radeon_bo *bo) { return bo->tbo.addr_space_offset; } static inline int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait) { int r; r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); if (unlikely(r != 0)) { if (r != -ERESTARTSYS) dev_err(bo->rdev->dev, "%p reserve failed for wait\n", bo); return r; } spin_lock(&bo->tbo.lock); if (mem_type) *mem_type = bo->tbo.mem.mem_type; if (bo->tbo.sync_obj) r = ttm_bo_wait(&bo->tbo, true, true, no_wait); spin_unlock(&bo->tbo.lock); ttm_bo_unreserve(&bo->tbo); return r; } extern int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, unsigned long size, bool kernel, u32 domain, struct radeon_bo **bo_ptr); extern int radeon_bo_kmap(struct radeon_bo *bo, void **ptr); extern void radeon_bo_kunmap(struct radeon_bo *bo); extern void radeon_bo_unref(struct radeon_bo **bo); extern int radeon_bo_pin(struct radeon_bo *bo, u32 domain, u64 *gpu_addr); extern int radeon_bo_unpin(struct radeon_bo *bo); extern int radeon_bo_evict_vram(struct radeon_device *rdev); extern void radeon_bo_force_delete(struct radeon_device *rdev); extern int radeon_bo_init(struct radeon_device *rdev); extern void radeon_bo_fini(struct radeon_device *rdev); extern void radeon_bo_list_add_object(struct radeon_bo_list *lobj, struct list_head *head); extern int radeon_bo_list_reserve(struct list_head *head); extern void radeon_bo_list_unreserve(struct list_head *head); extern int radeon_bo_list_validate(struct list_head *head); extern void radeon_bo_list_fence(struct list_head *head, void *fence); extern int radeon_bo_fbdev_mmap(struct radeon_bo *bo, struct vm_area_struct *vma); extern int radeon_bo_set_tiling_flags(struct radeon_bo *bo, u32 tiling_flags, u32 pitch); extern void radeon_bo_get_tiling_flags(struct radeon_bo *bo, u32 *tiling_flags, u32 *pitch); extern int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, bool force_drop); extern void radeon_bo_move_notify(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem); extern int radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo); extern int radeon_bo_get_surface_reg(struct radeon_bo *bo); #endif
/* xxHash - Fast Hash algorithm Copyright (C) 2012-2014, Yann Collet. BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 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 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. You can contact the author at : - xxHash source repository : http://code.google.com/p/xxhash/ */ #include <usual/hashing/xxhash.h> #include <usual/endian.h> #include <usual/bits.h> #define PRIME32_1 2654435761U #define PRIME32_2 2246822519U #define PRIME32_3 3266489917U #define PRIME32_4 668265263U #define PRIME32_5 374761393U #define read32(p) h32dec(p) uint32_t xxhash(const void *input, size_t len, uint32_t seed) { const uint8_t *p = (const uint8_t *)input; const uint8_t * const bEnd = p + len; uint32_t h32; if (len >= 16) { const uint8_t * const limit = bEnd - 16; uint32_t v1, v2, v3, v4; v1 = seed + PRIME32_1 + PRIME32_2; v2 = seed + PRIME32_2; v3 = seed + 0; v4 = seed - PRIME32_1; do { v1 += read32(p) * PRIME32_2; v1 = rol32(v1, 13); v1 *= PRIME32_1; p += 4; v2 += read32(p) * PRIME32_2; v2 = rol32(v2, 13); v2 *= PRIME32_1; p += 4; v3 += read32(p) * PRIME32_2; v3 = rol32(v3, 13); v3 *= PRIME32_1; p += 4; v4 += read32(p) * PRIME32_2; v4 = rol32(v4, 13); v4 *= PRIME32_1; p += 4; } while (p <= limit); h32 = rol32(v1, 1) + rol32(v2, 7) + rol32(v3, 12) + rol32(v4, 18); } else { h32 = seed + PRIME32_5; } h32 += len; while (p <= bEnd - 4) { h32 += read32(p) * PRIME32_3; h32 = rol32(h32, 17) * PRIME32_4 ; p += 4; } while (p < bEnd) { h32 += (*p) * PRIME32_5; h32 = rol32(h32, 11) * PRIME32_1 ; p++; } h32 ^= h32 >> 15; h32 *= PRIME32_2; h32 ^= h32 >> 13; h32 *= PRIME32_3; h32 ^= h32 >> 16; return h32; }
// // ViewController.h // IBDesignables // // Created by MilanPanchal on 17/05/15. // Copyright (c) 2015 Pantech. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
// Portable types #ifndef __OPENCM_MAIN_H_ #define __OPENCM_MAIN_H_ int OpenCM_main( int argc, const char **argv ); #endif
int getid(); int q, p; jasync localme(int c, char *s) { while(1) { printf("@@@@@@@@@@\n"); q = getid(); printf("############-->>> Hello ME %d... %s... %d\n", c, s, q); // jsleep(200000); } } jasync localyou(int c, char *s) { while(1) { jsleep(30000); printf("############-->>> Hello YOU %d, %s\n", c, s); } } jasync localtask() { while(1) { jsleep(200000); printf(">>>>>>> ddddd d\n"); } } int main(int argc, char *argv[]) { localme(10, "cxxxxyyyy"); localyou(10, "cxxxxxxxx"); localtask(); }
#ifndef DYNAMICVECTOR_H #define DYNAMICVECTOR_H #include <iostream> using namespace std; template <typename T> class DynamicVector { public: /** Default constructor */ DynamicVector() { capacity = 2; length = 0; arr = new T[capacity]; } /** Default destructor */ ~DynamicVector() { capacity = 0; length = 0; delete [] arr; } /** Copy constructor * \param other Object to copy from */ DynamicVector(const DynamicVector& other) { capacity = other.capacity; length = other.length; arr = new T[capacity]; for(int i = 0 ; i < other.length; ++ i) arr[i] = other.arr[i]; } /** Assignment operator * \param other Object to assign from * \return A reference to this */ DynamicVector& operator=(const DynamicVector& other) { capacity = other.capacity; length = other.length; arr = new T[capacity]; for(int i = 0 ; i < other.length; ++ i) arr[i] = other.arr[i]; return *this; } void push_back(T el) { if(length == capacity) { capacity *= 2; T* newarr = new T[capacity]; for(int i = 0 ; i < capacity / 2 ; ++ i) newarr[i] = arr[i]; delete [] arr; arr = newarr; } arr[length] = el; ++ length; } void remove(T el) { for(int i = 0 ; i < length ; ++ i) if(arr[i] == el) { swap(arr[i], arr[length - 1]); -- length; } } int size() const { return length; } inline T& operator [] (int pos) { return arr[pos]; } void clear() { capacity = 2; length = 0; delete []arr; arr = new T[capacity]; } protected: private: T *arr; int capacity, length; }; #endif // DYNAMICVECTOR_H
#pragma once #include "EnumSet.h" struct UnitData { float HP; float MoveSpeed; float MoveSpeedFormationBonus; float MoveSpeedMapBonus; float AttackRange; float AttackRangeFormationBonus; float AttackRangeMapBonus; float AttackPower; float AttackPowerFormationBonus; float AttackPowerMapBonus; float Defense; float DefenseFormationBonus; float DefenseMapBonus; ULONGLONG AttackDelay; ULONGLONG AttackDelayFormationBonus; ULONGLONG AttackDelayMapBonus; }; class UnitStatus { public: static bool LoadUnitStatus( ); private: UnitStatus(); ~UnitStatus(); //public: // std::array<float, static_cast<size_t>(UnitType::UNIT_MAX)> UnitHP; // max 256 용량은 둘째치고 매번 캐스팅하면서 쓰느리 그냥 노가다? }; extern UnitData g_Arrow; extern UnitData g_Guard; extern UnitData g_Knight; extern UnitData g_Pike; extern UnitData g_Sword; extern UnitData g_King;
/** * \file * \brief Driver for booting the Xeon Phi Coprocessor card on a Barrelfish Host */ /* * Copyright (c) 2014 ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #include <barrelfish/barrelfish.h> #include <virtio/virtio.h> #include <virtio/virtio_device.h> #include <virtio/devices/virtio_block.h> #include <virtio/virtio_guest.h> #include <dev/virtio/virtio_blk_dev.h> #include "device.h" #include "request.h" #include "service.h" struct vblock_device blk_dev; int main(int argc, char *argv[]) { errval_t err; debug_printf("VirtIO block device driver started.\n"); err = virtio_guest_init(VIRTIO_GUEST_CHAN_FLOUNDER, VIRTIO_BLOCK_FLOUNDER_IFACE); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Could not initialize the library\n"); } struct capref dev_frame; err = virtio_guest_open_device(VIRTIO_DEVICE_BACKEND_MMIO, &dev_frame); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Could not open the device\n"); } struct frame_identity id; err = frame_identify(dev_frame, &id); if (err_is_fail(err)) { USER_PANIC_ERR(err, "identifying the frame failed\n"); } size_t dev_size = id.bytes; void *dev_regs; err = vspace_map_one_frame_attr(&dev_regs, dev_size, dev_frame, VIRTIO_VREGION_FLAGS_DEVICE, NULL, NULL); if (err_is_fail(err)) { USER_PANIC_ERR(err, "failed to map the device frame"); } vblock_device_init(&blk_dev, dev_regs, dev_size); uint32_t count = 0; while(count < 32) { debug_printf("\n\n------------------------------------Round: %u\n", count++); struct vblock_req *req = vblock_request_alloc(&blk_dev); if (!req) { USER_PANIC("no request available\n"); break; } struct virtio_buffer *buf = virtio_buffer_alloc(blk_dev.alloc); if (!buf) { vblock_request_free(&blk_dev, req); USER_PANIC("no buffer available\n"); break; } snprintf(buf->buf, buf->length, "Hello world!!\n"); err = virtio_blist_append(&req->bl, buf); assert(err_is_ok(err)); assert(req->bl.length == 1); err = vblock_request_exec(&blk_dev, req); if (err_is_fail(err)) { USER_PANIC_ERR(err, "execute the request"); } struct virtio_buffer *ret_buf = virtio_blist_head(&req->bl); assert(req->bl.length == 0); assert(ret_buf == buf); debug_printf("data=[%s]", (char*)ret_buf->buf); virtio_buffer_free(buf); vblock_request_free(&blk_dev, req); } debug_printf("VirtIO block device driver terminated.\n"); }
/* * qrencode - QR Code encoder * * Masking. * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MASK_H__ #define __MASK_H__ #include "qrinput.h" extern unsigned char *Mask_makeMask(int width, unsigned char *frame, int mask, QRecLevel level); extern unsigned char *Mask_mask(int width, unsigned char *frame, QRecLevel level); #endif /* __MASK_H__ */ // 版权属于原作者 // http://code4app.com (cn) http://code4app.net (en) // 发布代码于最专业的源码分享网站: Code4App.com
// The MIT License (MIT) // Copyright (c) 2016, Microsoft // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #pragma once #include <mutex> // std::mutex member. #include <unordered_map> // std::unordered_map member. #include "BitFunnel/BitFunnelTypes.h" // For DocId parameter. #include "BitFunnel/NonCopyable.h" // Base class. #include "DocumentHandleInternal.h" // DocHandleInternal template parameter. namespace BitFunnel { class DocumentMap : NonCopyable { public: // Adds a new (DocId, DocumentHandleInternal) pair to the map. DocId is // obtained from DocumentHandleInternal::GetDocId(). Throws if the map // already contains an entry for a given DocId. void Add(DocumentHandleInternal value); // Attempts to find the DocumentHandleInternal corresponding to the // specified DocId value. If such a DocumentHandleInternal exists, a // copy will be returned after setting isFound to true. Otherwise // isFound will be set to false and the return value is undefined. // // DESIGN NOTE: Returning a copy of the item instead of the reference // is done to avoid the multithreading problem that exists when another // thread deletes or modifies this item while we are holding the // reference. DocumentHandleInternal Find(DocId id, bool& isFound) const; // Deletes an entry which corresponds to the given DocId. If no such entry // exists, the request is ignored and the function returns false. // Returns true otherwise. bool Delete(DocId id); // Returns the number of DocIds in the map. size_t size() const; private: // Lock protecting operations on m_docIdToHandle. // Made mutable to allow using it from const functions. mutable std::mutex m_lock; std::unordered_map<DocId, DocumentHandleInternal> m_docIdToDocHandle; }; }
// // BLSpringboardCollectionViewFlowLayout.h // BowerLabsUIKit // // Created by Jeremy Bower on 2013-06-27. // Copyright (c) 2013 Bower Labs Inc. All rights reserved. // #import <UIKit/UIKit.h> @protocol BLSpringboardCollectionViewDataSource <UICollectionViewDataSource> - (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath; @optional - (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath didMoveToIndexPath:(NSIndexPath *)toIndexPath; - (BOOL)collectionView:(UICollectionView *)collectionView canMoveItemAtIndexPath:(NSIndexPath *)indexPath; - (BOOL)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath canMoveToIndexPath:(NSIndexPath *)toIndexPath; @end @protocol BLSpringboardCollectionViewDelegateFlowLayout <UICollectionViewDelegateFlowLayout> @optional - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath; - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath; - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath; - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath; @end @interface BLSpringboardCollectionViewFlowLayout : UICollectionViewFlowLayout @property (nonatomic, assign, getter = isEditModeActive) BOOL editModeActive; @property (assign, nonatomic) CGFloat scrollingSpeed; @property (assign, nonatomic) UIEdgeInsets scrollingTriggerEdgeInsets; @end
// Copyright 2016 Gamemakin LLC. All Rights Reserved. #pragma once #include "Widgets/Input/SCheckBox.h" /** * Implements a widget that is a check box with a label */ class SCheckboxOption : public SCompoundWidget { public: SLATE_BEGIN_ARGS(SCheckboxOption) : _LabelText() , _CheckboxState(ECheckBoxState::Unchecked) , _RightAlignCheckBox(false) { } /** The text of the form label. */ SLATE_ATTRIBUTE(FText, LabelText) /** The initial state of the checkbox */ SLATE_ATTRIBUTE(ECheckBoxState, CheckboxState) /** Whether to right align the checkbox */ SLATE_ATTRIBUTE(bool, RightAlignCheckBox) SLATE_END_ARGS() public: /** * Constructs the widget. * * @param InArgs The Slate argument list. */ void Construct(const FArguments& InArgs, const TSharedRef<ISlateStyle>& InStyle) { ChildSlot [ SNew(SHorizontalBox) + (InArgs._RightAlignCheckBox.Get(false) ? SHorizontalBox::Slot() // Right aligned .VAlign(VAlign_Center) .HAlign(HAlign_Right) .FillWidth(1.0f) .Padding(0.0f, 0.0f, 0.0f, 0.0f) [ SNew(STextBlock) .Text(InArgs._LabelText) .TextStyle(InStyle, TEXT("Section.Text")) ] : SHorizontalBox::Slot() // Not right aligned .VAlign(VAlign_Center) .HAlign(HAlign_Fill) .AutoWidth() .Padding(0.0f, 0.0f, 0.0f, 0.0f) [ SNew(STextBlock) .Text(InArgs._LabelText) .TextStyle(InStyle, TEXT("Section.Text")) ] ) + SHorizontalBox::Slot() .AutoWidth() .VAlign(VAlign_Center) .HAlign(InArgs._RightAlignCheckBox.Get(false) ? HAlign_Right : HAlign_Fill) .Padding(8.0f, 0.0f, 0.0f, 0.0f) [ SAssignNew(CheckBox, SCheckBox) .IsChecked(InArgs._CheckboxState) ] ]; } public: // Holds the check box. TSharedPtr<SCheckBox> CheckBox; };
// // EffectViewController.h // CocosBuilder // // Created by John Twigg on 6/24/14. // // #import <Cocoa/Cocoa.h> #import "EffectsManager.h" @interface EffectViewController : NSViewController @property (nonatomic) id<EffectProtocol> effect; @property (nonatomic) BOOL highlight; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil effect:(id<EffectProtocol>)effect; @end
double HML_ErrorExOfTestFunction_Real(double *x, int VHML_N); double HML_ErrorExOfTestFunction_Real(double *x, int VHML_N, TypeOfTestFunction Type);
// // ______ ______ ______ // /\ __ \ /\ ___\ /\ ___\ // \ \ __< \ \ __\_ \ \ __\_ // \ \_____\ \ \_____\ \ \_____\ // \/_____/ \/_____/ \/_____/ // // // Copyright (c) 2013-2014, {Bee} open source community // http://www.bee-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 "Bee_Precompile.h" #import "Bee_Foundation.h" #import "Bee_Message.h" #pragma mark - @interface NSObject(BeeMessage) @property (nonatomic, readonly) BeeMessageBlockN MSG; @property (nonatomic, readonly) BeeMessageBlockN MSG_IF_NOT_SENDING; @property (nonatomic, readonly) BeeMessageBlockN MSG_CANCEL_IF_SENDING; @property (nonatomic, readonly) BeeMessageBlockN CANCEL_MSG; - (BOOL)sendingMessage:(NSString *)msg; - (void)cancelMessage:(NSString *)msg; - (void)cancelMessages; - (BeeMessage *)message:(NSString *)msg; - (BeeMessage *)message:(NSString *)msg timeoutSeconds:(NSUInteger)seconds; - (BeeMessage *)sendMessage:(NSString *)msg; - (BeeMessage *)sendMessage:(NSString *)msg timeoutSeconds:(NSUInteger)seconds; - (BOOL)prehandleMessage:(BeeMessage *)msg; - (void)posthandleMessage:(BeeMessage *)msg; - (void)handleMessage:(BeeMessage *)msg; @end
typedef struct sp_fog_overlap { struct sp_fog_overlap *nxtact; struct sp_fog_overlap *nxtfree; int32_t timrem, dectim, formphs, forminc; uint32_t risphs; int32_t risinc, decphs, decinc; SPFLOAT curamp, expamp; SPFLOAT pos, inc; } sp_fog_overlap; typedef struct { SPFLOAT amp, dens, trans, spd, oct, band, ris, dur, dec; SPFLOAT iolaps, iphs, itmode; sp_fog_overlap basovrlap; int32_t durtogo, fundphs, fofcount, prvsmps, spdphs; SPFLOAT prvband, expamp, preamp, fogcvt; int16_t formcod, fmtmod, speedcod; sp_auxdata auxch; sp_ftbl *ftp1, *ftp2; } sp_fog; int sp_fog_create(sp_fog **p); int sp_fog_destroy(sp_fog **p); int sp_fog_init(sp_data *sp, sp_fog *p, sp_ftbl *wav, sp_ftbl *win, int iolaps, SPFLOAT iphs); int sp_fog_compute(sp_data *sp, sp_fog *p, SPFLOAT *in, SPFLOAT *out);
// // Cocos2dUpater.h // CocosBuilder // // Created by Nicky Weber on 31.03.14. // // @class AppDelegate; @class ProjectSettings; @interface Cocos2dUpdater : NSObject @property (nonatomic, weak, readonly) AppDelegate *appDelegate; @property (nonatomic, weak, readonly) ProjectSettings *projectSettings; - (instancetype)initWithAppDelegate:(AppDelegate *)appDelegate projectSettings:(ProjectSettings *)projectSettings; - (void)updateAndBypassIgnore:(BOOL)bypassIgnore; @end
Struct Node { ElementType Element; PtrToNode Next; } int IsEmpty(Stack S) { return S -> Next == NULL; } Stack CreateStack(void) { Stack S; S = malloc(sizeof(struct Node)); if (S == NULL) FataError("Out of space!!!"); S -> Next = NULL; MakeEmpty(S); return S; } void MakeEmpty(Stack S) { if (S == NULL) Error("Must use CreateStack first"): else while (!IsEmpty(S)) Pop(S); } void Push(ElementType X, Stack S) { PtrToNode TmpCell; TmpCell = malloc(sizeof(struct Node)); if (TmpCell = NULL) FataError("Out of space !!!"); else { TmpCell -> Element = x; S -> Next = TmpCell; } } ElementType Top(Stack S) { if (!IsEmpty(S)) return S -> Next -> Element; Error("Empty stack"); return 0; } void Pop(Stack S) { PtrToNode FirstCell; if (IsEmpty(S)) Error("Empty stack"); else { FirstCell = S -> Next; S -> Next = S -> Next -> Next; free(FirstCell); } }
#ifndef FD_OFFSET #define FD_OFFSET 0 #endif #undef assert_open_ok #define assert_open_ok(fd, file, mode, flag) \ n = open(file, flag, mode); \ assert(n == fd + FD_OFFSET); #undef assert_open_fail #define assert_open_fail(file, mode, flag, err) \ n = open(file, flag, 0); \ assert(n < 0); \ assert(errno == err); #undef assert_read_ok #define assert_read_ok(fd, buf, len) \ n = read(fd + FD_OFFSET, buf, len); \ assert(n >= 0); #undef assert_read_equal #define assert_read_equal(fd, buf, str) \ { \ int len = strlen(str); \ n = read(fd + FD_OFFSET, buf, len); \ assert(strncmp(str, buf, len) == 0); \ assert(n >= 0); \ } #undef assert_read_fail #define assert_read_fail(fd, buf, len, err) \ n = read(fd + FD_OFFSET, buf, len); \ assert(n < 0); \ assert(errno == err); #undef assert_write_ok #define assert_write_ok(fd, buf, len) \ n = write(fd + FD_OFFSET, buf, len); \ assert(n >= 0); #undef assert_write_fail #define assert_write_fail(fd, buf, len, err) \ n = write(fd + FD_OFFSET, buf, len); \ assert(n < 0); \ assert(errno == err); #undef assert_close_ok #define assert_close_ok(fd) \ n = close(fd + FD_OFFSET); \ assert(n == 0); #undef assert_close_fail #define assert_close_fail(fd, err) \ n = close(fd + FD_OFFSET); \ assert(n < 0); \ assert(errno == err); #undef assert_lseek_ok #define assert_lseek_ok(fd, offset, whence) \ n = lseek(fd + FD_OFFSET, offset, whence); \ assert(n >= 0); #undef assert_pipe_ok #define assert_pipe_ok(fds) \ n = pipe(fds); \ assert(n == 0);
/**************************************************************************** Copyright (c) 2010-2011 cocos2d-x.org http://www.cocos2d-x.org 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 __ANDROID_JNI_HELPER_H__ #define __ANDROID_JNI_HELPER_H__ #include <jni.h> #include <string> #include "CCPlatformMacros.h" NS_CC_BEGIN typedef struct JniMethodInfo_ { JNIEnv * env; jclass classID; jmethodID methodID; } JniMethodInfo; class CC_DLL JniHelper { public: static JavaVM* getJavaVM(); static void setJavaVM(JavaVM *javaVM); static jclass getClassID(const char *className, JNIEnv *env=0); static bool getStaticMethodInfo(JniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode); static bool getMethodInfo(JniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode); static std::string jstring2string(jstring str); private: static JavaVM *m_psJavaVM; }; NS_CC_END #endif // __ANDROID_JNI_HELPER_H__
// // SIDScanFaceViewController.h // SuperIDSDK // // Created by lzn on 16/10/19. // Copyright © 2016年 ISNC. All rights reserved. // #import <UIKit/UIKit.h> #import "SIDCameraManagerViewController.h" #import "SIDCameraPreviewView.h" @protocol SIDSearchFaceProtocol <NSObject> @required /** * 1比N结果回调 * * @param isSucceed 在人脸群组中找到对应用户为成功,返回YES,其他情况为失败,返回NO * @param usersArray 根据人脸群组的检索出的对应用户组,并根据得分进行排序 */ - (void)groupCompareResult:(BOOL)isSucceed usersArray:(NSArray *)usersArray; /** * 输入图像无法通过活体检测回调方法 * * 当输入源为图像或者视频时,将通过该回调方法通知三方,1比N结果不在回调,三方可作为统一失败处理,可以要求用户重新刷脸 * */ - (void)userCannotPassLivenessDetect; /** * 摄像头成功捕获人脸,开始进行人脸检索 */ - (void)hasGetTheUserFace; @end @interface SIDSearchFaceViewController : SIDCameraManagerViewController /** * 初始化摄像头配置以及人脸检测配置,该方法在ViewDidLoad中执行 * * @param previewView 摄像头的preview指针 */ - (void)setupSearchFaceManagerWithPreview:(SIDCameraPreviewView *)previewView; /** * 开启人脸检测和比对方法 * * @param sourceId 用户组对应的source_app_id * @param groupId 用户组ID,多个用户组使用逗号分隔,如:group_1,group_2 */ - (void)startDetectFaceWithSourceId:(NSString *)sourceId GroupId:(NSString *)groupId; @end
// // // (C) Copyright 2003 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // //----------------------------------------------------------------------------- //----- DocData.h : include file for document specific data. An instance of this //----- class is automatically created and managed by the AsdkDataManager class. //----- See the AsdkDmgr.h / DocData.cpp for more datails //----------------------------------------------------------------------------- #pragma once //----------------------------------------------------------------------------- //----- Here you can store the document / database related data. class CDocData { public: CDocData () ; CDocData (const CDocData &data) ; ~CDocData () ; //{{AFX_ARX_DATA(CDocData) // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_ARX_DATA //----- TODO: here you can add your variables } ;
/*********************************************************************************************************************************** Time Management ***********************************************************************************************************************************/ #ifndef COMMON_TIME_H #define COMMON_TIME_H #include <stdint.h> #include <time.h> /*********************************************************************************************************************************** Time types ***********************************************************************************************************************************/ typedef uint64_t TimeMSec; /*********************************************************************************************************************************** Constants describing number of sub-units in an interval ***********************************************************************************************************************************/ #define MSEC_PER_SEC ((TimeMSec)1000) #define SEC_PER_DAY ((time_t)86400) /*********************************************************************************************************************************** Functions ***********************************************************************************************************************************/ // Sleep for specified milliseconds void sleepMSec(TimeMSec sleepMSec); // Epoch time in milliseconds TimeMSec timeMSec(void); // Are the date parts valid? (year >= 1970, month 1-12, day 1-31) void datePartsValid(int year, int month, int day); // Are the time parts valid? void timePartsValid(int hour, int minute, int second); // Are the timezone offset parts valid? void tzPartsValid(int tzHour, int tzMinute); // Given the hours, minutes and sign of a time zone (e.g. -0700 => -7, 0) return the signed number or seconds (e.g. -25200) int tzOffsetSeconds(int tzHour, int tzMinute); // Is the year a leap year? bool yearIsLeap(int year); // Get days since the beginning of the year (year >= 1970, month 1-12, day 1-31), returns 1-366 int dayOfYear(int year, int month, int day); // Return epoch time from date/time parts (year >= 1970, month 1-12, day 1-31, hour 0-23, minute 0-59, second 0-59, tzOffsetSecond // is the number of seconds plus or minus (+/-) the provided time - if 0, then the datetime is assumed to be UTC) time_t epochFromParts(int year, int month, int day, int hour, int minute, int second, int tzOffsetSecond); /*********************************************************************************************************************************** Macros for function logging ***********************************************************************************************************************************/ #define FUNCTION_LOG_TIME_MSEC_TYPE \ TimeMSec #define FUNCTION_LOG_TIME_MSEC_FORMAT(value, buffer, bufferSize) \ cvtUInt64ToZ(value, buffer, bufferSize) #endif
// // AsyncTaskWatchOS.h // AsyncTaskWatchOS // // Created by Zhixuan Lai on 6/20/16. // Copyright © 2016 Zhixuan Lai. All rights reserved. // #import <WatchKit/WatchKit.h> //! Project version number for AsyncTaskWatchOS. FOUNDATION_EXPORT double AsyncTaskWatchOSVersionNumber; //! Project version string for AsyncTaskWatchOS. FOUNDATION_EXPORT const unsigned char AsyncTaskWatchOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <AsyncTaskWatchOS/PublicHeader.h>
#include <stdio.h> #include <stdlib.h> #include <error.h> #include <racr/racr.h> #include "server.h" #include "event.h" static Scheme_Env* global_env; static Scheme_Object* eval_script(const char* filename) { FILE* f = fopen(filename, "r"); if (!f) error(1, 0, "script"); fseek(f, 0, SEEK_END); long size = ftell(f); rewind(f); char source[size + 1]; fread(source, 1, size, f); source[size] = '\0'; return scheme_eval_string_all(source, global_env, 1); } static Scheme_Object* prim_timestamp(int argc, Scheme_Object** argv) { return scheme_make_double(timestamp()); } static Scheme_Object* prim_add_event(int argc, Scheme_Object** argv) { printf("add_event\n"); if (!SCHEME_SYMBOLP(argv[0])) error(1, 0, "prim_add_event"); const char* sym = SCHEME_SYM_VAL(argv[0]); if (strcmp(sym, "event-work-command") == 0) { Event* e = event_append(EVENT_WORK_COMMAND); e->worker = worker_find_by_id(SCHEME_INT_VAL(argv[1])); e->work_id = SCHEME_INT_VAL(argv[2]); e->load_size = SCHEME_DBL_VAL(argv[3]); return scheme_true; } else if (strcmp(sym, "event-halt-command") == 0) { Event* e = event_append(EVENT_HALT_COMMAND); e->worker = worker_find_by_id(SCHEME_INT_VAL(argv[1])); return scheme_true; } else if (strcmp(sym, "event-worker-on") == 0) { Event* e = event_append(EVENT_WORKER_ON); e->worker = worker_find_by_id(SCHEME_INT_VAL(argv[1])); return scheme_true; } else if (strcmp(sym, "event-switch-on") == 0) { Event* e = event_append(EVENT_SWITCH_ON); e->worker = worker_find_by_id(SCHEME_INT_VAL(argv[1])); return scheme_true; } else if (strcmp(sym, "event-switch-off") == 0) { Event* e = event_append(EVENT_SWITCH_OFF); e->worker = worker_find_by_id(SCHEME_INT_VAL(argv[1])); return scheme_true; } return scheme_false; } int eval_string(const char* str) { Scheme_Config* config = scheme_current_config(); Scheme_Object* curout = scheme_get_param(config, MZCONFIG_OUTPUT_PORT); mz_jmp_buf fresh; mz_jmp_buf* volatile save = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &fresh; if (scheme_setjmp(scheme_error_buf)) { scheme_current_thread->error_buf = save; return -1; } else { Scheme_Object* v = scheme_eval_string_all(str, global_env, 1); scheme_display(v, curout); scheme_display(scheme_make_char('\n'), curout); scheme_current_thread->error_buf = save; } return 0; } int main(int argc, char** argv) { RACR_INIT(env, "bytecode", NULL); global_env = env; scheme_add_global( "timestamp", scheme_make_prim_w_arity(prim_timestamp, "timestamp", 0, 0), env); scheme_add_global( "add-event", scheme_make_prim_w_arity(prim_add_event, "add-event", 1, 5), env); eval_script("scheme.scm"); server_run(argc, argv); return 0; }
#ifndef __c1_trajectory_test_h__ #define __c1_trajectory_test_h__ /* Include files */ #include "sfc_sf.h" #include "sfc_mex.h" /* Type Definitions */ typedef struct { SimStruct *S; uint32_T chartNumber; uint32_T instanceNumber; uint8_T c1_is_active_c1_trajectory_test; ChartInfoStruct chartInfo; } SFc1_trajectory_testInstanceStruct; /* Named Constants */ /* Variable Declarations */ /* Variable Definitions */ /* Function Declarations */ /* Function Definitions */ extern void sf_c1_trajectory_test_get_check_sum(mxArray *plhs[]); extern void c1_trajectory_test_method_dispatcher(SimStruct *S, int_T method, void *data); #endif
// // PXAlertView.h // PXAlertViewDemo // // Created by Alex Jarvis on 25/09/2013. // Copyright (c) 2013 Panaxiom Ltd. All rights reserved. // #import <UIKit/UIKit.h> typedef void(^PXAlertViewCompletionBlock)(BOOL cancelled, NSInteger buttonIndex); @interface PXAlertView : UIViewController @property (nonatomic, getter = isVisible) BOOL visible; + (instancetype)showAlertWithTitle:(NSString *)title; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message completion:(PXAlertViewCompletionBlock)completion; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle completion:(PXAlertViewCompletionBlock)completion; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle otherTitle:(NSString *)otherTitle otherDesc:(NSString *)otherDesc otherImage:(NSString *)otherImage completion:(PXAlertViewCompletionBlock)completion; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle otherTitle:(NSString *)otherTitle otherDesc:(NSString *)otherDesc otherImage:(NSString *)otherImage buttonsShouldStack:(BOOL)shouldStack completion:(PXAlertViewCompletionBlock)completion; /** * @param otherTitles Must be a NSArray containing type NSString, or set to nil for no otherTitles. */ + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle otherTitles:(NSArray *)otherTitles otherDesc:(NSArray *)otherDesc otherImages:(NSArray *)otherImages completion:(PXAlertViewCompletionBlock)completion; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle otherTitle:(NSString *)otherTitle otherDesc:(NSString *)otherDesc otherImage:(NSString *)otherImage contentView:(UIView *)view completion:(PXAlertViewCompletionBlock)completion; + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle otherTitle:(NSString *)otherTitle otherDesc:(NSString *)otherDesc otherImage:(NSString *)otherImage buttonsShouldStack:(BOOL)shouldStack contentView:(UIView *)view completion:(PXAlertViewCompletionBlock)completion; /** * @param otherTitles Must be a NSArray containing type NSString, or set to nil for no otherTitles. */ + (instancetype)showAlertWithTitle:(NSString *)title message:(NSString *)message cancelTitle:(NSString *)cancelTitle otherTitles:(NSArray *)otherTitles otherDesc:(NSArray *)otherDesc otherImages:(NSArray *)otherImages contentView:(UIView *)view completion:(PXAlertViewCompletionBlock)completion; /** * Adds a button to the receiver with the given title. * @param title The title of the new button * @return The index of the new button. Button indices start at 0 and increase in the order they are added. */ - (NSInteger)addButtonWithTitle:(NSString *)title cmdButton:(BOOL)cmdButton cancelButton:(BOOL)cancelButton imageName:(NSString *)imageName desc:(NSString *)desc; /** * Dismisses the receiver, optionally with animation. */ - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated; - (NSInteger)getCancelButtonIndex; /** * By default the alert allows you to tap anywhere around the alert to dismiss it. * This method enables or disables this feature. */ - (void)setTapToDismissEnabled:(BOOL)enabled; @end
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // ITSegmentedControl #define COCOAPODS_POD_AVAILABLE_ITSegmentedControl #define COCOAPODS_VERSION_MAJOR_ITSegmentedControl 0 #define COCOAPODS_VERSION_MINOR_ITSegmentedControl 1 #define COCOAPODS_VERSION_PATCH_ITSegmentedControl 0
#ifndef Py_PYTHON_H #define Py_PYTHON_H /* Compat stuff */ #ifndef _WIN32 # include <inttypes.h> # include <stdint.h> # include <stddef.h> # include <limits.h> # include <math.h> # include <errno.h> # include <unistd.h> # define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__)) # define PyAPI_FUNC(RTYPE) RTYPE # define PyAPI_DATA(RTYPE) extern RTYPE # define Py_LOCAL_INLINE(type) static inline type #else # define MS_WIN32 1 # define MS_WINDOWS 1 # ifdef _MSC_VER # include <crtdefs.h> # endif # ifdef __MINGW32__ # include <limits.h> # endif # include <io.h> # define Py_DEPRECATED(VERSION_UNUSED) # ifdef Py_BUILD_CORE # define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE # define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE # else # define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE # define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE # endif # define Py_LOCAL_INLINE(type) static __inline type __fastcall #endif /* Deprecated DL_IMPORT and DL_EXPORT macros */ #ifdef _WIN32 # if defined(Py_BUILD_CORE) # define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE # define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE # else # define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE # define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE # endif #endif #ifndef DL_EXPORT # define DL_EXPORT(RTYPE) RTYPE #endif #ifndef DL_IMPORT # define DL_IMPORT(RTYPE) RTYPE #endif #include <stdlib.h> #ifndef _WIN32 typedef intptr_t Py_ssize_t; #else typedef long Py_ssize_t; #endif #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1) #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) (NARROW)(VALUE) #define Py_USING_UNICODE /* Convert a possibly signed character to a nonnegative int */ /* XXX This assumes characters are 8 bits wide */ #ifdef __CHAR_UNSIGNED__ #define Py_CHARMASK(c) (c) #else #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) #endif #define statichere static #define Py_MEMCPY memcpy #include <pypy_macros.h> #include "patchlevel.h" #include "pyconfig.h" #include "object.h" #include "pyport.h" #include "warnings.h" #include <stdarg.h> #include <stdio.h> #include <string.h> #include <assert.h> #include <locale.h> #include <ctype.h> #include "boolobject.h" #include "floatobject.h" #include "complexobject.h" #include "methodobject.h" #include "funcobject.h" #include "modsupport.h" #include "pythonrun.h" #include "pyerrors.h" #include "sysmodule.h" #include "stringobject.h" #include "descrobject.h" #include "tupleobject.h" #include "dictobject.h" #include "intobject.h" #include "listobject.h" #include "unicodeobject.h" #include "compile.h" #include "frameobject.h" #include "eval.h" #include "pymath.h" #include "pymem.h" #include "pycobject.h" #include "pycapsule.h" #include "bufferobject.h" #include "bytesobject.h" #include "sliceobject.h" #include "datetime.h" #include "pystate.h" #include "fileobject.h" #include "pysignals.h" #include "pythread.h" // XXX This shouldn't be included here #include "structmember.h" #include <pypy_decl.h> /* Define macros for inline documentation. */ #define PyDoc_VAR(name) static char name[] #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) #ifdef WITH_DOC_STRINGS #define PyDoc_STR(str) str #else #define PyDoc_STR(str) "" #endif /* PyPy does not implement --with-fpectl */ #define PyFPE_START_PROTECT(err_string, leave_stmt) #define PyFPE_END_PROTECT(v) #endif
// // Unity3d.h // // Created by Osipov Stanislav on 1/11/13. // // #import <Foundation/Foundation.h> @interface ISNDataConvertor : NSObject + (NSString*) charToNSString: (char*)value; + (const char *) NSIntToChar: (NSInteger) value; + (const char *) NSStringToChar: (NSString *) value; @end
#pragma once #include "libMighty_AbstractRole.h" namespace Mighty { class LIBMIGHTY_API MightyRole final : public CRTPRole<MightyRole> { }; }
#ifndef __al_included_allegro5_aintern_x_h #define __al_included_allegro5_aintern_x_h #include <X11/Xlib.h> typedef struct ALLEGRO_SYSTEM_XGLX ALLEGRO_SYSTEM_XGLX; typedef struct ALLEGRO_DISPLAY_XGLX ALLEGRO_DISPLAY_XGLX; #endif
/* Copyright (c) 2016 Ravi Peters 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 MASBCPP_COMPUTE_MA_PROCESSING_ #define MASBCPP_COMPUTE_MA_PROCESSING_ #include "madata.h" struct ma_parameters { Scalar initial_radius; bool nan_for_initr; double denoise_preserve; double denoise_planar; }; struct ma_result { Point c; int qidx; }; void compute_masb_points(ma_parameters &input_parameters, ma_data &madata); #endif
/****************************************************************************** Filename: config.h Description: Wireless configuration parameters for the WiShield 1.0 ****************************************************************************** TCP/IP stack and driver for the WiShield 1.0 wireless devices Copyright(c) 2009 Async Labs Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Contact Information: <asynclabs@asynclabs.com> Author Date Comment --------------------------------------------------------------- AsyncLabs 05/01/2009 Initial version AsyncLabs 05/29/2009 Adding support for new library *****************************************************************************/ #ifndef CONFIG_H_ #define CONFIG_H_ #include "witypes.h" extern U8 local_ip[]; extern U8 gateway_ip[]; extern U8 subnet_mask[]; extern const prog_char ssid[]; extern U8 ssid_len; extern const prog_char security_passphrase[]; extern U8 security_passphrase_len; extern U8 security_type; extern U8 wireless_mode; extern const prog_uchar wep_keys[]; extern const prog_char webpage[]; extern const prog_char twitter[]; extern unsigned char mfg_id[4]; #define WIRELESS_MODE_INFRA 1 #define WIRELESS_MODE_ADHOC 2 #endif /* CONFIG_H_ */
// Copyright 2016-2018 ELIFE. All rights reserved. // Use of this source code is governed by a MIT // license that can be found in the LICENSE file. #include <ginger/unit.h> UNIT(OnePlusTwo) { ASSERT_EQUAL(3, 1+2); } BEGIN_SUITE(Canary) ADD_UNIT(OnePlusTwo) END_SUITE
/************************************************************************************* *filename: core_frame.h * *to do: ¶¨ÒåCOREµÄ¿ò¼Ü£¬Ö÷ÒªÊDZ¾µØ½ÚµãÐÅÏ¢¹ÜÀí¡¢UDP/TCP¼àÌý¹ÜÀí¡¢Daemon ClientÆô¶¯ ¹ÜÀí *Create on: 2012-05 *Author: zerok *check list: *************************************************************************************/ #ifndef __CORE_FRAME_H #define __CORE_FRAME_H #include "revolver/base_namespace.h" #include "revolver/base_typedef.h" #include "core/core_daemon_client.h" #include "core/core_dc_client.h" BASE_NAMESPACE_BEGIN_DECL class CoreUDPHandler; class CCoreTCPListener; class ICoreServerNotify; class ICoreFrame { public: ICoreFrame(); ~ICoreFrame(); void init(); void destroy(); void start(bool wan = false); void stop(); void release_handler(); //CORE¿âµÄÔËÐк¯Êý void frame_run(); //DAEMON CLIENT·µ»Ø·ÖÅäºÃµÄµØÖ·£¬½øÐÐÍøÂç°ó¶¨£¬Èç¹ûÊÇDAEMON void bind_port(uint16_t port); //×é¼þÉèÖà void create_udp(); void create_tcp_listener(); void create_daemon_client(IDaemonEvent* daemon_event, IDaemonConfig* config = NULL); void create_dc_client(); void attach_server_notify(ICoreServerNotify* notify); CoreUDPHandler* get_udp_handler(){return udp_handler_;}; uint32_t post_write_php(uint32_t dc_sid, CoreDCParam* param, const string& php, const string& php_param, bool ack = true); uint32_t post_read_php(uint32_t dc_sid, CoreDCParam* param, const string& php, const string& php_param, bool ack = true); CoreDCParam* cancel_dc_request(uint32_t exc_id); //±¨¸æ½Úµã״̬µ½daemond·þÎñÉÏ int32_t post_node_state(const string& node_info); //Ìṩ¸øÉϲãµÄʼþ virtual void on_init() = 0; virtual void on_destroy() = 0; virtual void on_start() = 0; virtual void on_stop() = 0; //¼ì²é×Ó½ø³ÌÊÇ·ñ±»Í˳ö virtual void wait_pid(){}; protected: CDaemonClient* daemon_client_; CCoreTCPListener* listener_; CoreUDPHandler* udp_handler_; CCoreDCClient* dc_client_; bool single_thread_; // È«µ¥Ïß³ÌÉè¼Æ }; BASE_NAMESPACE_END_DECL #endif /************************************************************************************/
// // SSThemes.h // Mudrammer // // Created by Jonathan Hersh on 10/27/12. // Copyright (c) 2012 Jonathan Hersh. All rights reserved. // @import Foundation; // All KVO-observable theme keypaths. #define kThemeKeySet @[ kThemeFontColor, kThemeFontName, kThemeFontSize, kThemeBackgroundColor, kThemeLinkColor ] @interface SSThemes : NSObject // Access the shared themer. Sets up application themes on first init. + (instancetype) sharedThemer; #pragma mark - Theme Access // Syntax helper for current theme keys. - (id) valueForThemeKey:(NSString *)key; // A dictionary of theme properties for the theme at a given index. - (NSDictionary *) themeAtIndex:(NSUInteger)index; // Total number of themes available. @property (nonatomic, readonly) NSUInteger themeCount; // The currently active theme. @property (nonatomic, readonly, copy) NSDictionary *currentTheme; // The current font as selected by the user in Settings -> Themes @property (nonatomic, readonly, copy) UIFont *currentFont; // The index in the list of themes at which the currently active theme appears. @property (nonatomic, readonly) NSUInteger indexOfCurrentBaseTheme; // YES == this is a theme with a light font on a dark background // NO == this is a theme with a dark font on a light background @property (nonatomic, readonly, getter=isUsingDarkTheme) BOOL usingDarkTheme; // Apply theme - (void) applyTheme:(NSDictionary *)newTheme; // YES if there is an iCloud key-value store currently available + (BOOL) checkForCloud; // Configures a cell or table to match our current theme. + (void) configureCell:(UITableViewCell *)cell; + (void) configureTable:(UITableView *)table; @end
#include <ginger/unit.h> UNIT(CanaryTest) { ASSERT_EQUAL(5, 1 + 2); // Should fail } BEGIN_SUITE(CanarySuite) ADD_UNIT(CanaryTest) END_SUITE IMPORT_SUITE(VectorSuite); BEGIN_REGISTRATION REGISTER(CanarySuite) REGISTER(VectorSuite) END_REGISTRATION UNIT_MAIN()
#include <stdio.h> #include <stdlib.h> #include <memory.h> #ifndef __DATA_STRUCTURES_COMMON #define __DATA_STRUCTURES_COMMON // Generic comparing function spec typedef int(*comparator)(const void *, const void *); // To provide a for-each construct typedef void(*item_operation)(void *); // Generic hashing function spec typedef size_t(*hashfunc)(const void *); #define ASSERT_NOTNULL(R, MSG) \ if(R == NULL) fprintf(stderr, "[%s:%d] %s\n", __FILE__, __LINE__, MSG); #endif
/********************************************************************* Matt Marchant 2013 - 2014 SFML Tiled Map Loader - https://github.com/bjorn/tiled/wiki/TMX-Map-Format http://trederia.blogspot.com/2013/05/tiled-map-loader-for-sfml.html The zlib license has been used to make this software fully compatible with SFML. See http://www.sfml-dev.org/license.php This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. *********************************************************************/ #ifndef DEBUG_SHAPE_H_ #define DEBUG_SHAPE_H_ #include <SFML/Graphics/VertexArray.hpp> #include <SFML/Graphics/Drawable.hpp> #include <SFML/Graphics/Transformable.hpp> class DebugShape : public sf::Drawable, public sf::Transformable { public: DebugShape(); void AddVertex(const sf::Vertex& vert); void Reset(); void CloseShape(); private: bool m_closed; sf::VertexArray m_array; void draw(sf::RenderTarget& rt, sf::RenderStates states)const; }; #endif
/* * SymStrip UTILITY to strip symbols listed in a file from another * file. * * danp 3 Jun 88 * * usage: symstrip full remove dest * removes lines from full that appear in remove * places result in dest */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define fTrue 1 #define fFalse 0 #define cchMaxLine 130 FILE *fpFull, *fpRemove, *fpDest; FILE *fopen(); main(cArg, rgszArg) int cArg; char *rgszArg[]; { int wComp; int cSkipped = 0; char szFull[cchMaxLine]; char szRemove[cchMaxLine]; /* open files */ if (cArg != 4 || !FOpenFiles(rgszArg)) Usage(); /* make sure source files are sorted properly! */ else if (FCheckSort(fpFull, 1) && FCheckSort(fpRemove, 2)) { /* get current szRemove */ fgets(szRemove, cchMaxLine, fpRemove); /* copy from full to dest, except remove */ fgets(szFull, cchMaxLine, fpFull); while (!feof(fpFull)) { while (!feof(fpRemove) && (wComp = strcmp(szFull, szRemove)) > 0) /* advance szRemove to catch up with szFull */ fgets(szRemove, cchMaxLine, fpRemove); if (feof(fpRemove) || wComp != 0) fputs(szFull, fpDest); else cSkipped++; fgets(szFull, cchMaxLine, fpFull); } printf("Removed %d symbols\r\n", cSkipped); } fcloseall(); } FOpenFiles(psz) char **psz; { if ((fpFull = fopen(*(++psz), "r")) != NULL && (fpRemove = fopen(*(++psz), "r")) != NULL && (fpDest = fopen(*(++psz), "w")) != NULL) return fTrue; else { printf("Error: cannot open %s\r\n", *psz); fcloseall(); return fFalse; } } Usage() { printf("usage: symstrip <full> <remove> <dest>\r\n"); printf("\t<dest> = <full> - <remove>\r\n"); printf("\tboth <full> and <remove> MUST be sorted\r\n"); printf("\tremoval is case sensitive\r\n"); } FCheckSort(fp, iArg) FILE *fp; int iArg; { int cErrors = 0; char sz1[cchMaxLine]; char sz2[cchMaxLine]; char *pch1=sz1, *pch2=sz2, *pchT; fgets(pch1, cchMaxLine, fp); while (!feof(fp)) { fgets(pch2, cchMaxLine, fp); /* pch1 is previous string, pch2 is next string */ if (!feof(fp) && strcmp(pch1, pch2) > 0) { printf("symstrip: sort order error: \r\n\t%s\t%s", pch1, pch2); cErrors++; } pchT = pch1; pch1 = pch2; pch2 = pchT; } if (cErrors) printf("%d errors on argument %d\r\n", cErrors, iArg); else fseek(fp, 0L, SEEK_SET); return !cErrors; }
// // ZFApiHttpGetReplacePhoto.h // // DO NOT MODIFY!! Modifications will be overwritten. // Generated by: Mike Fullerton @ 6/3/13 10:43 AM with PackMule (3.0.1.100) // // Project: Zenfolio Web API // Schema: ZenfolioWebApi // // Copyright 2013 (c) GreenTongue Software LLC, Mike Fullerton // The FishLamp Framework is released under the MIT License: http://fishlamp.com/license // #import "FLModelObject.h" #import "FLHttpRequestDescriptor.h" @class ZFReplacePhotoHttpGetOut; @class ZFReplacePhotoHttpGetIn; @interface ZFApiHttpGetReplacePhoto : FLModelObject<FLHttpRequestDescriptor> { @private ZFReplacePhotoHttpGetIn* _input; ZFReplacePhotoHttpGetOut* _output; } @property (readwrite, strong, nonatomic) ZFReplacePhotoHttpGetIn* input; @property (readonly, strong, nonatomic) NSString* location; @property (readonly, strong, nonatomic) NSString* operationName; @property (readwrite, strong, nonatomic) ZFReplacePhotoHttpGetOut* output; @property (readonly, strong, nonatomic) NSString* targetNamespace; + (ZFApiHttpGetReplacePhoto*) apiHttpGetReplacePhoto; @end
#ifndef DATOS_H #define DATOS_H #include <string> class Datos { public: std::string nombre; int edad; char sexo; double promedio; Datos( std::string, int, char, double ); }; #endif
#pragma once #include "libMighty_AbstractPlayer.h" namespace Mighty { class LIBMIGHTY_API HumanPlayer : public AbstractPlayer { public: virtual void PlayTurn() override; void Init(int id, const std::string& name); }; }
/* * ImageInputFactory.h * * Copyright (c) 2014, Alessandro Pezzato */ #ifndef threescanner_IMAGEINPUTFACTORY_H_ #define threescanner_IMAGEINPUTFACTORY_H_ #include "../prerequisites.h" namespace threescanner { /** * Factory to create instances of ImageInput * * Available types: * * - fs (filesystem) FsImageInput * - cv (opencv camera) CVImageInput */ class ImageInputFactory { public: /** * Create an instance of ImageInput, given the type and a Config object * \param type the implementation type * \param cfg a Config object */ static ImageInputPtr create(const std::string& type, const Config& cfg); /** * \param cfg a Config object. The implementation type must be defined * inside the Config object in the path `type`. */ static ImageInputPtr create(const Config& cfg); }; } /* namespace threescanner */ #endif /* threescanner_IMAGEINPUTFACTORY_H_ */
#pragma once #include "../deps/luacppbridge51/lcbHybridObjectWithProperties.h" namespace LuaNode { class ChildProcess : public LuaCppBridge::HybridObjectWithProperties<ChildProcess> { public: ChildProcess(lua_State* L); ~ChildProcess(); public: LCB_HOWP_DECLARE_EXPORTABLE(ChildProcess); static const char* get_full_class_name_T(); int New(lua_State* L); int Spawn(lua_State* L); int Kill(lua_State* L); private: lua_State* m_L; }; }
/** ****************************************************************************** * @file CortexM/Mode_Privilege/stm32f4xx_it.h * @author MCD Application Team * @version V1.3.0 * @date 13-November-2013 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// // GJGCInfoBaseListViewController.h // ZYChat // // Created by ZYVincent QQ:1003081775 on 15/11/21. // Copyright (c) 2015年 ZYProSoft. QQ群:219357847 All rights reserved. // #import "GJGCBaseViewController.h" #import "GJGCInfoBaseListDataManager.h" #import "GJGCRefreshFooterView.h" #import "GJGCRefreshHeaderView.h" @interface GJGCInfoBaseListViewController : GJGCBaseViewController<GJGCInfoBaseListDataManagerDelegate, GJGCRefreshFooterViewDelegate, GJGCRefreshHeaderViewDelegate, UITableViewDataSource, UITableViewDelegate > @property (nonatomic,strong)UITableView *listTable; @property (nonatomic,strong)GJGCInfoBaseListDataManager *dataManager; - (void)initDataManager; - (void)startRefresh; - (void)startLoadMore; @end
#define VGA_SCREEN_NEEDS_FAR_PTR
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * 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 MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CONNECTION_H #define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CONNECTION_H #include "py/objtuple.h" #include "common-hal/_bleio/Connection.h" #include "common-hal/_bleio/Service.h" extern const mp_obj_type_t bleio_connection_type; void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond); void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self); bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self); mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self); bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self); void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval); void bleio_connection_ensure_connected(bleio_connection_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CONNECTION_H
/* * fichier.h * * * "@(#)fichier.h 1.1 (C) P. Durif 1994" */ /* Toutes les primitives renvoient * -1 en cas d'echec (primitive perreur()) * * SAUF * ouvrir() qui renvoie NULL en cas d'echec. * * DE PLUS * lire() et ecrire() qui renvoient le nombre d'octets manipules * ou -1 en cas d'echec. */ #include "fs.h" typedef struct INFO { u_long taille ; /* en octets */ u_short liens ; enum CATEGORIE type ; INOMBRE i_nombre ; } INFO ; int get_info (const char *nom, INFO *info) ; /* garnit la zone "info" avec les informations sur le fichier "nom" */ int creer_repertoire (const char *nom) ; /* "nom" ne doit pas deja exister, les entrees "." et ".." sont * crees automatiquement. */ int detruire_repertoire (const char *nom) ; /* "nom" doit etre un repertoire vide (sauf "." et "..") qui ne se trouve * pas sur le chemin du repertoire courant. */ /* Remarque : le repertoire racine ne peut jamais etre detruit * puisqu'il se trouve toujours dans le chemin courant */ int creer_lien (const char *nouveau, const char *cible) ; /* ajoute un lien sur "cible" dont le nom est "nouveau", * "nouveau" ne doit pas deja exister * "cible" doit etre un ORDINAIRE */ int detruire_lien (const char *nom) ; /* supprime un lien sur le INOEUD designe par nom * "nom" doit etre ORDINAIRE * si le nombre de liens devient nul, le fichier est effectivement * detruit */ enum MODE {LECTURE = 0x01, ECRITURE = 0x02, LECTURE_ECRITURE = 0x03} ; enum OPERATION {OUVERTURE, CREATION} ; typedef struct FICHIER { INOMBRE i ; enum MODE mode ; u_long pointeur ; /* position courante en octets dans le fichier */ } FICHIER ; FICHIER *ouvrir (const char *nom, enum MODE mode, enum OPERATION o) ; /* en CREATION, le fichier est ORDINAIRE et ne peut ecraser * qu'un fichier ORDINAIRE. */ /* en OUVERTURE, le fichier doit exister et ce peut etre un ORDINAIRE * ou un REPERTOIRE (mais alors, seulement en LECTURE). */ /* les operations : */ /* OUVERTURE : le fichier doit deja exister, les trois modes (LECTURE, * ECRITURE, LECTURE_ECRITURE) sont autorises */ /* CREATION : le fichier est eventuellement cree, dans tous les cas * il est vide. Le "mode" doit etre ECRITURE ou LECTURE_ECRITURE. */ int fermer (FICHIER *f) ; /* desalloue la structure designe par "f" */ int lire (FICHIER *f, void *zone, u_long taille) ; /* lit au plus "taille" octets dans zone depuis la position courante * de "f". */ /* La position courante de "f" est incrementee de "taille". */ /* Renvoit le nombre d'octets lus ou -1 si erreur */ int ecrire (FICHIER *f, const void *zone, u_long taille) ; /* ecrit au plus "taille" octets de "zone" dans le fichier a partir de * la position courante de "f". */ /* La position courante de "f" est incrementee de "taille". */ /* Renvoit le nombre d'octets ecrits ou -1 si erreur */ int positionner (FICHIER *f, u_long pointeur) ; /* la position courante du fichier est mise a "pointeur". */
/**************************************************************************** * Copyright (c) 2002-2004,2009 Free Software Foundation, Inc. * * * * 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, distribute with modifications, 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 ABOVE 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. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Thomas Dickey * ****************************************************************************/ /* ** lib_inwstr.c ** ** The routines winnwstr() and winwstr(). ** */ #include <curses.priv.h> MODULE_ID("$Id: lib_inwstr.c,v 1.1 2011/08/18 02:20:32 tsaitc Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) { int row, col, inx; int count = 0; int last = 0; cchar_t *text; wchar_t wch; T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n)); if (wstr != 0) { if (win) { getyx(win, row, col); text = win->_line[row].text; while (count < n && count != ERR) { if (!isWidecExt(text[col])) { for (inx = 0; (inx < CCHARW_MAX) && ((wch = text[col].chars[inx]) != 0); ++inx) { if (count + 1 > n) { if ((count = last) == 0) { count = ERR; /* error if we store nothing */ } break; } wstr[count++] = wch; } } last = count; if (++col > win->_maxx) { break; } } } if (count > 0) { wstr[count] = '\0'; T(("winnwstr returns %s", _nc_viswbuf(wstr))); } } returnCode(count); } /* * X/Open says winwstr() returns OK if not ERR. If that is not a blunder, it * must have a null termination on the string (see above). Unlike winnstr(), * it does not define what happens for a negative count with winnwstr(). */ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) result = ERR; returnCode(result); }
/* * osdot11nousermode.h * * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved. * 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 Texas Instruments 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. */ /*--------------------------------------------------------------------------*/ /* Module: osDot11.h */ /**/ /* Purpose: */ /**/ /*--------------------------------------------------------------------------*/ #ifndef __OSDOT11NO_USER_MODE_H__ #define __OSDOT11NO_USER_MODE_H__ #define OID_802_11_CAPABILITY 0x0D010218 #define OID_802_11_PMKID 0x0D010219 #endif
/************************************************************************** * * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, 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 (including the * next paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. * **************************************************************************/ /* * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> */ #include <linux/mutex.h> #include <linux/slab.h> #include <linux/module.h> #include "drm_global.h" struct drm_global_item { struct mutex mutex; void *object; int refcount; }; static struct drm_global_item glob[DRM_GLOBAL_NUM]; void drm_global_init(void) { int i; for (i = 0; i < DRM_GLOBAL_NUM; ++i) { struct drm_global_item *item = &glob[i]; mutex_init(&item->mutex); item->object = NULL; item->refcount = 0; } } void drm_global_release(void) { int i; for (i = 0; i < DRM_GLOBAL_NUM; ++i) { struct drm_global_item *item = &glob[i]; BUG_ON(item->object != NULL); BUG_ON(item->refcount != 0); } } int drm_global_item_ref(struct drm_global_reference *ref) { int ret; struct drm_global_item *item = &glob[ref->global_type]; void *object; mutex_lock(&item->mutex); if (item->refcount == 0) { item->object = kzalloc(ref->size, GFP_KERNEL); if (unlikely(item->object == NULL)) { ret = -ENOMEM; goto out_err; } ref->object = item->object; ret = ref->init(ref); if (unlikely(ret != 0)) goto out_err; } ++item->refcount; ref->object = item->object; object = item->object; mutex_unlock(&item->mutex); return 0; out_err: mutex_unlock(&item->mutex); item->object = NULL; return ret; } EXPORT_SYMBOL(drm_global_item_ref); void drm_global_item_unref(struct drm_global_reference *ref) { struct drm_global_item *item = &glob[ref->global_type]; mutex_lock(&item->mutex); BUG_ON(item->refcount == 0); BUG_ON(ref->object != item->object); if (--item->refcount == 0) { ref->release(ref); item->object = NULL; } mutex_unlock(&item->mutex); } EXPORT_SYMBOL(drm_global_item_unref);
/* Copyright (C) 1999 - 2000 Evgenii Rudnyi, rudnyi@comp.chem.msu.su http://www.chem.msu.su/~rudnyi/ This software is a copyrighted work licensed under the terms, described in the file "FREE_LICENSE". */ #ifndef __RESIDUAL_H #define __RESIDUAL_H #include <td_algo.h> class residual { string id_; string yname; string xname; mutable int iy; //the ordinal number of the column for the y double sc; //the scale of x: x = x/scale compute comp; public: residual() {clear();} void clear() { iy = -1; sc = 1.; } istream& read(istream& in) { parser p(in); SGML el; p.GetSGML(el); read(el); return in; } void read(const SGML &el); ostream& write(ostream& out, size_t shift = 0) const; const string& id() const { return id_; } void SetInput(const vec_string &vs) const { iy = SearchString(vs, yname); if (iy == -1) throw gError(string("residual: no yname - ").append(yname)); comp.SetInput(vs); } void SetOnceInput(const vec_string &vs) const { comp.SetOnceInput(vs); } void SetOnce(double *reg) const { comp.SetOnce(reg); } double f(double *reg) const { return comp.f(reg); } double res(double *reg) const; double operator()(double *reg) const { return res(reg); } size_t NOfX(const vec_string &vs) const { return SearchString(vs, xname); } const string& NameOfX() const { return xname; } size_t NOfY() const { return iy; } const string& NameOfY() const { return yname; } double ScaleOfX() const { return sc; } }; OVERLOAD_STREAMS(residual) typedef map<string, residual> map_residual; typedef map_residual::iterator map_residual_i; typedef map_residual::const_iterator map_residual_ci; extern map_residual res; residual& FindResidual(const string &str); #endif
// // Copyright(C) 2014 Night Dive Studios, 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. // // DESCRIPTION: // Configuration and netgame negotiation frontend for // Strife: Veteran Edition // // AUTHORS: // James Haley // Samuel Villarreal (Hi-Res BG code, mouse pointer) // #ifndef FE_COMMANDS_H_ #define FE_COMMANDS_H_ const char *FE_GetHelpForVar(const char *var); char *FE_GetFormattedHelpStr(const char *var, int x, int y); void FE_ExecCmd(const char *verb); // variable types enum { FE_VAR_INT, FE_VAR_FLOAT, FE_VAR_INT_PO2 }; // variable structure typedef struct fevar_s { const char *name; int type; int min; int max; int istep; float fmin; float fmax; float fstep; void (*SetFunc)(int); } fevar_t; fevar_t *FE_VariableForName(const char *name); boolean FE_IncrementVariable(const char *name); boolean FE_DecrementVariable(const char *name); const char *FE_CurrentVideoMode(void); void FE_NextVideoMode(void); void FE_PrevVideoMode(void); const char *FE_NameForValue(const char *valuevar); int FE_IncrementValue(const char *valuevar); int FE_DecrementValue(const char *valuevar); void FE_BindMusicTestVar(void); void FE_MusicTestSaveCurrent(void); void FE_MusicTestRestoreCurrent(void); void FE_MusicTestPlaySelection(void); #endif // EOF
//===- FragmentRefTest.h --------------------------------------------------===// // // The MCLinker Project // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef MCLD_MCFRAGMENT_REF_TEST_H #define MCLD_MCFRAGMENT_REF_TEST_H #include <gtest.h> namespace mcld { class FragmentRef; } // namespace for mcld namespace mcldtest { /** \class FragmentRefTest * \brief Reference Test * * \see FragmentRef */ class FragmentRefTest : public ::testing::Test { public: // Constructor can do set-up work for all test here. FragmentRefTest(); // Destructor can do clean-up work that doesn't throw exceptions here. virtual ~FragmentRefTest(); // SetUp() will be called immediately before each test. virtual void SetUp(); // TearDown() will be called immediately after each test. virtual void TearDown(); }; } // namespace of mcldtest #endif
/* * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /* $Id: lib.c,v 1.11.18.3 2005/08/15 01:46:50 marka Exp $ */ /*! \file */ #include <config.h> #include <stddef.h> #include <isc/once.h> #include <isc/msgcat.h> #include <isc/util.h> #include <dns/lib.h> /*** *** Globals ***/ LIBDNS_EXTERNAL_DATA unsigned int dns_pps = 0U; LIBDNS_EXTERNAL_DATA isc_msgcat_t * dns_msgcat = NULL; /*** *** Private ***/ static isc_once_t msgcat_once = ISC_ONCE_INIT; /*** *** Functions ***/ static void open_msgcat(void) { isc_msgcat_open("libdns.cat", &dns_msgcat); } void dns_lib_initmsgcat(void) { /* * Initialize the DNS library's message catalog, dns_msgcat, if it * has not already been initialized. */ RUNTIME_CHECK(isc_once_do(&msgcat_once, open_msgcat) == ISC_R_SUCCESS); }
/* * zoned.h --- header file for querying zoned device information * * Copyright (C) 2015 Seagate Technology PLC * * Written by: * Paul Paulson <paul.paulson@seagate.com> * * %Begin-Header% * This file is licensed under the terms of the GNU General Public * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. * %End-Header% */ #ifndef _ZONED_H #define _ZONED_H #include "ext2fs/ext2fs.h" typedef enum { INQ_STANDARD = 0, // standard inquiry INQ_DEVICE_ID = 0x83, // device identification inquiry INQ_BLKDEV_CHARACTERISTICS = 0xb1, // block device characteristics } InquiryPageCode; int is_zoned(const char* device_name); blk64_t get_offset_to_zone(const char* device_name, blk64_t zone_size, blk64_t block_size, blk64_t lba); blk64_t get_partition_start(const char *device_name); int get_zone_size(const char* device_name, __u64 *size); #endif /* _ZONED_H */
/** @file src/ini.c INI file reading routines. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "types.h" #include "os/strings.h" #include "ini.h" #include "string.h" char *Ini_GetString(const char *category, const char *key, const char *defaultValue, char *dest, uint16 length, char *source) { char *s; char buffer[1024]; uint16 catLength; char *current; char *ret; if (dest != NULL) { *dest = '\0'; /* Set the default value in case we jump out early */ if (defaultValue != NULL) strncpy(dest, defaultValue, length); dest[length - 1] = '\0'; } if (source == NULL) return NULL; sprintf(buffer, "[%s]", category); for (s = buffer; *s != '\0'; s++) *s = toupper(*s); catLength = strlen(buffer); ret = source; for (current = source; current != NULL; current++) { const char *end; current = strchr(current, '['); if (current == NULL) break; if (strncasecmp(current, buffer, catLength) != 0) continue; if (*(current - 1) != '\r' && *(current - 1) != '\n') continue; current += catLength; while (isspace((uint8)*current)) current++; /* Find the end of this block */ for (end = current; end != NULL; end++) { end = strchr(end, '['); if (end == NULL) break; if (*(end - 1) == '\r' || *(end - 1) == '\n') break; } /* If there is no other '[', take the last char of the file */ if (end == NULL) end = current + strlen(current); if (key != NULL) { uint16 keyLength = strlen(key); ret = current; while (true) { char *value; char *lineEnd; /* Check to see if there is nothing behind the key ('a' should not match 'aa') */ value = current + keyLength; while (isspace((uint8)*value)) value++; /* Now validate the size and if we match at all */ if (*value != '=' || strncasecmp(current, key, keyLength) != 0) { /* Search for LF to support both CR/LF and LF line endings. */ current = strchr(current, '\n'); if (current == NULL) break; while (isspace((uint8)*current)) current++; if (current > end) break; continue; } ret = current; /* Get the value */ current = value + 1; /* Find the end of the line */ lineEnd = strchr(current, '\n'); if (lineEnd == NULL) break; while (isspace((uint8)*lineEnd)) lineEnd++; if (lineEnd > end) break; /* Copy the value */ if (dest != NULL) { uint16 len = lineEnd - current; memcpy(dest, current, len); *(dest + len) = '\0'; String_Trim(dest); } return ret; } /* Failed to find the key. Return anyway. */ if (dest != NULL) *dest = '\0'; return NULL; } ret = current; if (dest == NULL) return ret; /* Read all the keys from this section */ while (true) { uint16 len; char *lineEnd; lineEnd = strchr(current, '='); if (lineEnd == NULL || lineEnd > end) break; len = lineEnd - current; memcpy(dest, current, len); *(dest + len) = '\0'; String_Trim(dest); dest += strlen(dest) + 1; /* Find the next line, ignoring all \r\n */ current = strchr(current, '\n'); if (current == NULL) break; while (isspace((uint8)*current)) current++; if (current > end) break; } *dest++ = '\0'; *dest++ = '\0'; return ret; } return NULL; } int Ini_GetInteger(const char *category, const char *key, int defaultValue, char *source) { char value[16]; char buffer[16]; sprintf(value, "%d", defaultValue); Ini_GetString(category, key, value, buffer, 15, source); return atoi(buffer); } void Ini_SetString(const char *category, const char *key, const char *value, char *source) { char *s; char buffer[120]; if (source == NULL || category == NULL) return; s = Ini_GetString(category, NULL, NULL, NULL, 0, source); if (s == NULL && key != NULL) { sprintf(buffer, "\r\n[%s]\r\n", category); strcat(source, buffer); } s = Ini_GetString(category, key, NULL, NULL, 0, source); if (s != NULL) { uint16 count = strcspn(s, "\r\n"); if (count != 0) { /* Drop first line if not empty */ size_t len = strlen(s + count + 1) + 1; memmove(s, s + count + 1, len); } if (*s == '\n') { /* Drop first line if empty */ size_t len = strlen(s + 1) + 1; memmove(s, s + 1, len); } } else { s = Ini_GetString(category, NULL, NULL, NULL, 0, source); } if (value != NULL) { sprintf(buffer, "%s=%s\r\n", key, value); memmove(s + strlen(buffer), s, strlen(s) + 1); memcpy(s, buffer, strlen(buffer)); } }
/* * Copyright (C) 2014- The University of Notre Dame * This software is distributed under the GNU General Public License. * See the file COPYING for details. */ #ifndef RANDOM_H #define RANDOM_H #include <stdint.h> /** @file random.h A PRNG library. */ /** Initialize the random number generator. * * Uses system PRNG devices to seed the library PRNG. */ void random_init (void); /** Get a random int. * * @return a random int. */ #define random_int() ((int) random_int64()) /** Get a random int32_t. * * @return a random int32_t. */ #define random_int32() ((int32_t) random_int64()) /** Get a random int64_t. * * @return a random int64_t. */ int64_t random_int64 (void); /** Insert random data into an array. * * @param m the memory to fill. * @param l the length of the m. */ void random_array (void *m, size_t l); /** Insert a random string in hexadecimal. * * @param s the location in the string. * @param l the number of characters to insert. Includes NUL byte! */ void random_hex (char *s, size_t l); #endif /* vim: set noexpandtab tabstop=4: */
/* * CopyRight 2014 , bingyu.song All Right Reserved I believe Spring brother */ #ifndef _CONDITION_H_ #define _CONDITION_H_ #include "nocopyable.h" #include "Mutex.h" class Condition { public: explicit Condition(MutexLock& mutex) : mutex_(mutex) { pthread_cond_init(&cond_, NULL); } ~Condition() { pthread_cond_destory(&cond_); } void wait() { pthread_cond_wait(&cond_, mutex_.getMutex()); } void notify() { pthread_cond_signal(&cond_); } void notifyAll() { pthread_cond_broadcast(&cond_); } private: MutexLock& mutex_; pthread_cond_t cond_; }; #endif // _CONDITION_H_
#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/fs.h> #include <linux/buffer_head.h> #include "lab5fs.h" #include "lab5fs_super.h" #include "lab5fs_inode.h" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Sourav Chakraborty"); static struct super_block* lab5fs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, lab5fs_fill_super); } static void lab5fs_kill_sb(struct super_block *sb) { printk("Unmounting lab5fs\n"); kill_block_super(sb); } struct file_system_type lab5fs_fs_type = { .owner = THIS_MODULE, .name = "lab5fs", .fs_flags = FS_REQUIRES_DEV, .get_sb = lab5fs_get_sb, .kill_sb = lab5fs_kill_sb }; static int __init init_lab5fs(void) { int r; printk("Initializing module lab5fs\n"); r = register_filesystem(&lab5fs_fs_type); if(r) { printk("Error registering lab5fs: %d\n", r); } return r; } static void __exit exit_lab5fs(void) { unregister_filesystem(&lab5fs_fs_type); printk("Cleaning up module lab5fs\n"); } module_init(init_lab5fs); module_exit(exit_lab5fs);
/*************************************************************************** QgsAttributeTableDialog.h - dialog for attribute table ------------------- date : Feb 2009 copyright : Vita Cizek email : weetya (at) gmail.com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSATTRIBUTETABLEDIALOG_H_ #define QGSATTRIBUTETABLEDIALOG_H_ #include <QDialog> #include <QModelIndex> #include <QItemSelectionModel> #include <time.h> #include "ui_qgsattributetabledialog.h" #include "qgscontexthelp.h" #include "qgsattributedialog.h" #include "qgsvectorlayer.h" //QgsFeatureIds class QDialogButtonBox; class QPushButton; class QLineEdit; class QComboBox; class QMenu; class QDockWidget; class QSignalMapper; class QgsAttributeTableModel; class QgsAttributeTableFilterModel; class QgsAttributeTableView; class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDialog { Q_OBJECT public: /** * Constructor * @param theLayer layer pointer * @param parent parent object * @param flags window flags */ QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window ); ~QgsAttributeTableDialog(); /** * Sets the filter expression to filter visible features * @param filterString filter query string. QgsExpression compatible. */ void setFilterExpression( QString filterString ); public slots: /** * Toggles editing mode */ void editingToggled(); private slots: /** * Copies selected rows to the clipboard */ void on_mCopySelectedRowsButton_clicked(); /** * Toggles editing mode */ void on_mToggleEditingButton_toggled(); /** * Saves edits */ void on_mSaveEditsButton_clicked(); /** * Inverts selection */ void on_mInvertSelectionButton_clicked(); /** * Clears selection */ void on_mRemoveSelectionButton_clicked(); /** * Zooms to selected features */ void on_mZoomMapToSelectedRowsButton_clicked(); /** * Pans to selected features */ void on_mPanMapToSelectedRowsButton_clicked(); /** * Moves selected lines to the top */ void on_mSelectedToTopButton_toggled(); /** * Opens dialog to add new attribute */ void on_mAddAttribute_clicked(); /** * Opens dialog to remove attribute */ void on_mRemoveAttribute_clicked(); /** * Opens field calculator dialog */ void on_mOpenFieldCalculator_clicked(); /** * deletes the selected features */ void on_mDeleteSelectedButton_clicked(); /** * add feature */ void on_mAddFeature_clicked(); void on_mHelpButton_clicked() { QgsContextHelp::run( metaObject()->className() ); } void on_mExpressionSelectButton_clicked(); void filterColumnChanged( QObject* filterAction ); void filterExpressionBuilder(); void filterShowAll(); void filterSelected(); void filterVisible(); void filterEdited(); void filterQueryChanged( const QString& query ); void filterQueryAccepted(); /** * update window title */ void updateTitle(); signals: /** * Informs that editing mode has been toggled * @param layer layer that has been toggled */ void editingToggled( QgsMapLayer *layer ); /** * Informs that edits should be saved * @param layer layer whose edits are to be saved */ void saveEdits( QgsMapLayer *layer ); protected: /** * Handle closing of the window * @param event unused */ void closeEvent( QCloseEvent* event ); private slots: /** * Initialize column box */ void columnBoxInit(); private: QMenu* mMenuActions; QAction* mActionToggleEditing; QDockWidget* mDock; QMenu* mFilterColumnsMenu; QSignalMapper* mFilterActionMapper; QgsVectorLayer* mLayer; }; #endif
/* Copyright (C) 2009-2013 DeSmuME team This file 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 file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the this software. If not, see <http://www.gnu.org/licenses/>. */ #include <string> #include "types.h" extern const u8 DESMUME_VERSION_MAJOR; extern const u8 DESMUME_VERSION_MINOR; extern const u8 DESMUME_VERSION_BUILD; u32 EMU_DESMUME_VERSION_NUMERIC(); u32 EMU_DESMUME_SUBVERSION_NUMERIC(); const char* EMU_DESMUME_VERSION_STRING(); const char* EMU_DESMUME_SUBVERSION_STRING(); const char* EMU_DESMUME_NAME_AND_VERSION(); const char* EMU_DESMUME_COMPILER_DETAIL();
/* * linux/include/asm-arm/arch-nexuspci/system.h * * Copyright (c) 1996,1997,1998 Russell King. */ #ifndef __ASM_ARCH_SYSTEM_H #define __ASM_ARCH_SYSTEM_H #define arch_do_idle() processor._do_idle() extern __inline__ void arch_reset(char mode) { /* * loop endlessly - the watchdog will reset us if it's enabled. */ cli(); } #endif
/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. * * 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. * */ #ifndef __ARCH_ARM_MACH_MSM_OTG_H #define __ARCH_ARM_MACH_MSM_OTG_H #include <linux/workqueue.h> #include <linux/wakelock.h> /* * The otg driver needs to interact with both device side and host side * usb controllers. it decides which controller is active at a given * moment, using the transceiver, ID signal. */ struct msm_otg_transceiver { struct device *dev; struct clk *clk; struct clk *pclk; int in_lpm; struct msm_otg_ops *dcd_ops; struct msm_otg_ops *hcd_ops; int irq; int flags; int state; int active; void __iomem *regs; /* device memory/io */ struct work_struct work; spinlock_t lock; struct wake_lock wlock; /* bind/unbind the host controller */ int (*set_host)(struct msm_otg_transceiver *otg, struct msm_otg_ops *hcd_ops); /* bind/unbind the peripheral controller */ int (*set_peripheral)(struct msm_otg_transceiver *otg, struct msm_otg_ops *dcd_ops); int (*set_suspend)(struct msm_otg_transceiver *otg, int suspend); }; struct msm_otg_ops { void (*request)(void *, int); void *handle; }; /* for usb host and peripheral controller drivers */ #ifdef CONFIG_USB_MSM_OTG extern struct msm_otg_transceiver *msm_otg_get_transceiver(void); extern void msm_otg_put_transceiver(struct msm_otg_transceiver *xceiv); #else static inline struct msm_otg_transceiver *msm_otg_get_transceiver(void) { return NULL; } static inline void msm_otg_put_transceiver(struct msm_otg_transceiver *xceiv) { } #endif /*CONFIG_USB_MSM_OTG*/ #endif
#include "bbslib.h" int bbspassport_main() { char id[IDLEN + 1], buf[384], site[256]; struct userec *x; html_header(1); if (key_fail) http_fatal("ÄÚ²¿´íÎó ÁªÏµÎ¬»¤!"); strsncpy(buf, getparm("pp"), sizeof (buf)); strsncpy(site, getparm("site"), sizeof (site)); strsncpy(id, des3_decode(buf, 0), IDLEN + 1); if (id[0] && getuser(id, &x) > 0) { snprintf(buf, sizeof (buf), "http://%s?q=%s", site, des3_encode(id, 1)); redirect(buf); http_quit(); return 0; } printf("<form name=lpassport method=post action=lpassport>\n"); printf("<table width=100%%>\n"); printf ("<tr><td align=right>*ÇëÊäÈë´úºÅ:<td align=left><input name=id size=12 maxlength=%d >\n", IDLEN); printf ("<tr><td align=right>*ÇëÊäÈëÃÜÂë:<td align=left><input type=password name=pw size=12 maxlength=%d>\n", PASSLEN - 1); printf("<tr><td><td><input type=hidden name=site value=\"%s\">", site); printf("<tr><td align=right><input type=submit value=µÇ¼>" " <td align=left><input type=reset value=ÖØÐÂÌîд></table>"); printf("</form>"); http_quit(); return 0; }
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.MonoTypeInfo struct MonoTypeInfo_t1352; #include "mscorlib_System_Type.h" // System.MonoType struct MonoType_t : public Type_t { // System.MonoTypeInfo System.MonoType::type_info MonoTypeInfo_t1352 * ___type_info_8; };
/* * 16.1.1 Thread Creation Attributes, P1003.1c/Draft 10, p, 140 * * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id$ */ #if HAVE_CONFIG_H #include "config.h" #endif #include <pthread.h> #include <errno.h> #include <rtems/system.h> #include <rtems/posix/pthread.h> int pthread_attr_setstacksize( pthread_attr_t *attr, size_t stacksize ) { if ( !attr || !attr->is_initialized ) return EINVAL; if (stacksize < PTHREAD_MINIMUM_STACK_SIZE) attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE; else attr->stacksize = stacksize; return 0; }
/* * Semaphore Manager -- Data Instantiation * * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id$ */ #if HAVE_CONFIG_H #include "config.h" #endif /* instantiate semaphore data */ #define RTEMS_SEM_EXTERN #include <rtems/system.h> #include <rtems/rtems/sem.h>
/****************************************************************************** Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. ****************************************************************************** File Name : unf_venc.c Version : Initial Draft Author : Hisilicon multimedia software group Created : 2010/04/08 Description : History : 1.Date : 2009/04/08 Author : j00131665 Modification: Created file *******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "hi_mpi_venc.h" HI_S32 HI_UNF_VENC_Init(HI_VOID) { return HI_MPI_VENC_Init(); } HI_S32 HI_UNF_VENC_DeInit(HI_VOID) { return HI_MPI_VENC_DeInit(); } HI_S32 HI_UNF_VENC_Create(HI_HANDLE *phVencChn, const HI_UNF_VENC_CHN_ATTR_S *pstAttr) { return HI_MPI_VENC_Create(phVencChn,pstAttr); } HI_S32 HI_UNF_VENC_Destroy(HI_HANDLE hVencChn) { return HI_MPI_VENC_Destroy(hVencChn); } HI_S32 HI_UNF_VENC_AttachInput(HI_HANDLE hVencChn,HI_HANDLE hSrc) { return HI_MPI_VENC_AttachInput(hVencChn, hSrc); } HI_S32 HI_UNF_VENC_DetachInput(HI_HANDLE hVencChn) { return HI_MPI_VENC_DetachInput(hVencChn); } HI_S32 HI_UNF_VENC_AcquireStream(HI_HANDLE hVencChn,HI_UNF_VENC_STREAM_S *pstStream, HI_U32 u32TimeoutMs) { return HI_MPI_VENC_AcquireStream(hVencChn, pstStream, u32TimeoutMs); } HI_S32 HI_UNF_VENC_ReleaseStream(HI_HANDLE hVencChn, const HI_UNF_VENC_STREAM_S *pstStream) { return HI_MPI_VENC_ReleaseStream(hVencChn, pstStream); } HI_S32 HI_UNF_VENC_Start(HI_HANDLE hVencChn) { return HI_MPI_VENC_Start(hVencChn); } HI_S32 HI_UNF_VENC_Stop(HI_HANDLE hVencChn) { return HI_MPI_VENC_Stop(hVencChn); } HI_S32 HI_UNF_VENC_SetAttr(HI_HANDLE hVencChn,const HI_UNF_VENC_CHN_ATTR_S *pstAttr) { return HI_MPI_VENC_SetAttr(hVencChn, pstAttr); } HI_S32 HI_UNF_VENC_GetAttr(HI_HANDLE hVencChn, HI_UNF_VENC_CHN_ATTR_S *pstAttr) { return HI_MPI_VENC_GetAttr(hVencChn, pstAttr); } HI_S32 HI_UNF_VENC_RequestIFrame(HI_HANDLE hVencChn) { return HI_MPI_VENC_RequestIFrame(hVencChn); } HI_S32 HI_UNF_VENC_QueueFrame(HI_HANDLE hVenc, HI_UNF_VIDEO_FRAME_INFO_S *pstFrameinfo) //й¦ÄÜ£¬»¹Î´ÊµÏÖ { return HI_MPI_VENC_QueueFrame(hVenc, pstFrameinfo); } HI_S32 HI_UNF_VENC_DequeueFrame(HI_HANDLE hVenc, HI_UNF_VIDEO_FRAME_INFO_S *pstFrameinfo) { return HI_MPI_VENC_DequeueFrame(hVenc, pstFrameinfo); } HI_S32 HI_UNF_VENC_GetDefaultAttr(HI_UNF_VENC_CHN_ATTR_S *pstAttr) { if(NULL==pstAttr) { return HI_ERR_VENC_NULL_PTR; } pstAttr->enVencType = HI_UNF_VCODEC_TYPE_H264; pstAttr->enCapLevel = HI_UNF_VCODEC_CAP_LEVEL_720P; pstAttr->enVencProfile = HI_UNF_H264_PROFILE_HIGH; pstAttr->u32RotationAngle = 0; pstAttr->bSlcSplitEn = HI_FALSE; pstAttr->u32StrmBufSize = 1280 * 720 * 2; pstAttr->u32Width = 1280; pstAttr->u32Height = 720; pstAttr->u32TargetBitRate = 4*1024*1024; pstAttr->u32InputFrmRate = 25; pstAttr->u32TargetFrmRate = 25; pstAttr->u32Gop = 100; pstAttr->u32MaxQp = 48; pstAttr->u32MinQp = 16; pstAttr->bQuickEncode = HI_FALSE; pstAttr->u8Priority = 0; pstAttr->u32Qlevel = 0; return HI_SUCCESS; } //eof
/* * synergy -- mouse and keyboard sharing utility * Copyright (C) 2012-2021 Symless Ltd. * Copyright (C) 2008 Volker Lanz (vl@fidra.de) * * This package is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * found in the file LICENSE that should have accompanied this file. * * This package is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef REGEXPVALIDATOR_H #define REGEXPVALIDATOR_H #include <qregexp.h> #include "IStringValidator.h" namespace validators { class RegExpValidator : public IStringValidator { QRegExp m_Validator; public: RegExpValidator(const QString& message, const QRegExp& validator); bool validate(const QString& input) const override; }; } #endif // REGEXPVALIDATOR_H
#include <stdio.h> #include <glib/gi18n.h> #include <locale.h> #include <glib/gprintf.h> #include <ibus.h> /* * Callback should be skipped */ #ifndef MKDG_SPEC_ONLY #define MKDG_SPEC_ONLY #endif #include "MakerDialogUtil.h" #include "MakerDialogProperty.h" #include "GSettingsBackend.h" #include "IBusChewingProperties.h" #define XML_BUFFER_SIZE 1000 #define DEFAULT_LOCALES "C;zh_TW" static gint verbose = WARN; static gchar *schemasFilename = NULL; static const GOptionEntry entries[] = { {"verbose", 'v', 0, G_OPTION_ARG_INT, &verbose, "Verbose level. The higher the level, the more the debug messages.", "[integer]"}, {NULL}, }; /** * write_gconf_schemas_file: * @filename: Filename for output. * * Output the parameters as GSettings schemes file. */ gboolean write_schemas_file(const gchar * filename) { mkdg_log(INFO, "write_schemes_file(%s,)", filename); FILE *outF = fopen(filename, "w"); if (outF == NULL) { mkdg_log(DEBUG, "write_gconf_schemas_file(%s) file %s cannot be written!", filename, filename); return FALSE; } gboolean result = mkdg_g_settings_write_schema_from_spec_array(QUOTE_ME (PROJECT_SCHEMA_ID), QUOTE_ME (PROJECT_SCHEMA_PATH), outF, propSpecs, QUOTE_ME (PROJECT_NAME)); if (fclose(outF)) return FALSE; mkdg_log(DEBUG, "write_gconf_schemas_file(%s) ... done.", filename); return result; } int main(gint argc, gchar * argv[]) { GError *error = NULL; GOptionContext *context; /* Init i18n messages */ setlocale(LC_ALL, ""); bindtextdomain(QUOTE_ME(PROJECT_NAME), QUOTE_ME(DATA_DIR) "/locale"); textdomain(QUOTE_ME(PROJECT_NAME)); context = g_option_context_new("schemasFile"); g_option_context_add_main_entries(context, entries, "ibus-chewing"); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("Option parsing failed: %s\n", error->message); return 1; } g_option_context_free(context); if (argc < 2) { fprintf(stderr, "Specify filename of outputing schemas file!\n"); return 1; } mkdg_log_set_level(verbose); schemasFilename = argv[1]; gboolean result = write_schemas_file(schemasFilename); if (!result) { return 2; } return 0; }
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * go-color-selector.h - A color selector * * Copyright (c) 2006 Emmanuel Pacaud (emmanuel.pacaud@lapp.in2p3.fr) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License, version 2, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA. */ #ifndef GO_COLOR_SELECTOR_H #define GO_COLOR_SELECTOR_H #include <goffice/utils/go-color.h> #include <goffice/gtk/go-selector.h> #include <gtk/gtkwidget.h> G_BEGIN_DECLS GtkWidget *go_color_selector_new (GOColor initial_color, GOColor default_color, char const *group); GOColor go_color_selector_get_color (GOSelector *selector, gboolean *is_auto); gboolean go_color_selector_set_color (GOSelector *selector, GOColor color); G_END_DECLS #endif /* GO_COLOR_SELECTOR_H */
// rddbmgr.h // // Rivendell database management utility // // (C) Copyright 2018-2020 Fred Gleason <fredg@paravelsystems.com> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // #ifndef RDDBMGR_H #define RDDBMGR_H #include <qobject.h> #include <rdconfig.h> #include <rdfeed.h> #include <rdstation.h> #define RDDBMGR_USAGE "[options]\n" class MainObject : public QObject { public: enum Command {NoCommand=0,ModifyCommand=1,CreateCommand=2,CheckCommand=3}; MainObject(QObject *parent=0); private: // // check.cpp // bool Check(QString *err_msg); void CheckTableAttributes(); void RewriteTable(const QString &tblname, const QString &old_charset, const QString &old_collation, const QString &new_charset, const QString &new_collation); bool RewriteFile(const QString &old_filename,const QString &old_str, const QString &new_filename,const QString &new_str, QString *err_msg); void RelinkAudio(const QString &srcdir) const; void RelinkCut(const QString &src_filename,const QString &cutname, const QString &title, QString *firstdest,bool *delete_src) const; void RelinkCast(const QString &src_filename,const QString &keyname, unsigned cast_id,const QString &title, const QString &audio_filename, QString *firstdest,bool *delete_src) const; void CheckOrphanedTracks() const; void CheckCutCounts() const; void CheckPendingCarts() const; void CheckOrphanedCarts() const; void CheckOrphanedCuts() const; void CheckOrphanedAudio() const; void ValidateAudioLengths() const; void Rehash(const QString &arg) const; void RehashCart(unsigned cartnum) const; void RehashCut(const QString &cutnum) const; void SetCutLength(const QString &cutname,int len) const; void RemoveCart(unsigned cartnum); bool CopyToAudioStore(const QString &destfile,const QString &srcfile) const; bool UserResponse() const; // // create.cpp // bool Create(const QString &station_name,bool gen_audio, QString *err_msg) const; bool CreateNewDb(QString *err_msg) const; bool InititalizeNewDb(const QString &station_name,bool gen_audio, QString *err_msg) const; bool InsertImportFormats(QString *err_msg) const; bool InsertRDAirplayHotkeys(const QString &station_name, QString *err_msg) const; bool CreateReconciliationTable(const QString &svc_name, QString *err_msg) const; // // modify.cpp // bool Modify(QString *err_msg,int set_schema); int GetCurrentSchema() const; bool ModifyCharset(const QString &charset,const QString &collation); // // updateschema.cpp // bool UpdateSchema(int cur_schema,int set_schema,QString *err_msg); void AverageCuts89(unsigned cartnum) const; void TotalMacros89(unsigned cartnum) const; void CreateAuxFieldsTable143(const QString &key_name) const; void CreateFeedLog151(const QString &key_name) const; bool UpdateLogTable186(const QString &table,QString *err_msg) const; bool ConvertTimeField186(const QString &table,const QString &field, QString *err_msg) const; bool ConvertArtistSep307(QString *err_msg) const; bool StackLineTitles347(QString *err_msg) const; // // revertschema.cpp // bool RevertSchema(int cur_schema,int set_schema,QString *err_msg); // // schemamap.cpp // void InitializeSchemaMap(); int GetVersionSchema(const QString &ver) const; QString GetSchemaVersion(int schema) const; // // printstatus.cpp // bool PrintStatus(QString *err_msg) const; void WriteSchemaVersion(int ver); bool TableExists(const QString &tbl_name) const; bool DropTable(const QString &tbl_name,QString *err_msg=NULL) const; bool ColumnExists(const QString &tbl_name,const QString &col_name) const; bool DropColumn(const QString &tbl_name,const QString &col_name, QString *err_msg=NULL) const; bool DropIndex(const QString &tbl_name,const QString &idx_name, QString *err_msg=NULL) const; Command db_command; QString db_mysql_hostname; QString db_mysql_loginname; QString db_mysql_password; QString db_mysql_database; QString db_mysql_driver; QString db_mysql_engine; bool db_verbose; bool db_yes; bool db_no; bool db_check_all; bool db_check_orphaned_audio; bool db_check_orphaned_tracks; bool db_check_orphaned_carts; bool db_check_orphaned_cuts; QString db_orphan_group_name; QString db_dump_cuts_dir; QString db_rehash; QString db_relink_audio; bool db_relink_audio_move; QDateTime db_start_datetime; QString db_table_create_postfix; RDConfig *db_config; }; #endif // RDDBMGR_H
// +------------------------------------------------------------------+ // | ____ _ _ __ __ _ __ | // | / ___| |__ ___ ___| | __ | \/ | |/ / | // | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | // | | |___| | | | __/ (__| < | | | | . \ | // | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | // | | // | Copyright Mathias Kettner 2012 mk@mathias-kettner.de | // +------------------------------------------------------------------+ // // This file is part of Check_MK. // The official homepage is at http://mathias-kettner.de/check_mk. // // check_mk 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 in version 2. check_mk is distributed // in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- // out even the implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the GNU General Public License for more de- // ails. You should have received a copy of the GNU General Public // License along with GNU Make; see the file COPYING. If not, write // to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA. #ifndef TableHosts_h #define TableHosts_h #include <set> #include "config.h" #include "Table.h" #include "nagios.h" using namespace std; class TableContacts; class TableDownComm; struct hostbygroup { host *_host; hostgroup *_hostgroup; struct hostbygroup *_next; }; class TableHosts : public Table { bool _by_group; public: TableHosts(bool by_group); const char *name() { return _by_group ? "hostsbygroup" : "hosts"; } const char *prefixname() { return "hosts"; } bool isAuthorized(contact *ctc, void *data); void *findObject(char *objectspec); void addColumns(Table *, string prefix, int indirect_offset); void answerQuery(Query *query); void cleanupQuery(Query *query); }; #endif // TableHosts_h
/* * * Copyright 2010 Samsung Electronics S.LSI Co. LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * @file SEC_OSAL_Queue.c * @brief * @author SeungBeom Kim (sbcrux.kim@samsung.com) * @version 1.0 * @history * 2010.7.15 : Create */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "SEC_OSAL_Memory.h" #include "SEC_OSAL_Mutex.h" #include "SEC_OSAL_Queue.h" OMX_ERRORTYPE SEC_OSAL_QueueCreate(SEC_QUEUE *queueHandle) { int i = 0; SEC_QElem *newqelem = NULL; SEC_QElem *currentqelem = NULL; SEC_QUEUE *queue = (SEC_QUEUE *)queueHandle; OMX_ERRORTYPE ret = OMX_ErrorNone; if (!queue) return OMX_ErrorBadParameter; ret = SEC_OSAL_MutexCreate(&queue->qMutex); if (ret != OMX_ErrorNone) return ret; queue->first = (SEC_QElem *)SEC_OSAL_Malloc(sizeof(SEC_QElem)); if (queue->first == NULL) return OMX_ErrorInsufficientResources; SEC_OSAL_Memset(queue->first, 0, sizeof(SEC_QElem)); currentqelem = queue->last = queue->first; queue->numElem = 0; for (i = 0; i < (MAX_QUEUE_ELEMENTS - 2); i++) { newqelem = (SEC_QElem *)SEC_OSAL_Malloc(sizeof(SEC_QElem)); if (newqelem == NULL) { while (queue->first != NULL) { currentqelem = queue->first->qNext; SEC_OSAL_Free((OMX_PTR)queue->first); queue->first = currentqelem; } return OMX_ErrorInsufficientResources; } else { SEC_OSAL_Memset(newqelem, 0, sizeof(SEC_QElem)); currentqelem->qNext = newqelem; currentqelem = newqelem; } } currentqelem->qNext = queue->first; return OMX_ErrorNone; } OMX_ERRORTYPE SEC_OSAL_QueueTerminate(SEC_QUEUE *queueHandle) { int i = 0; SEC_QElem *currentqelem = NULL; SEC_QUEUE *queue = (SEC_QUEUE *)queueHandle; OMX_ERRORTYPE ret = OMX_ErrorNone; if (!queue) return OMX_ErrorBadParameter; for ( i = 0; i < (MAX_QUEUE_ELEMENTS - 2); i++) { currentqelem = queue->first->qNext; SEC_OSAL_Free(queue->first); queue->first = currentqelem; } if(queue->first) { SEC_OSAL_Free(queue->first); queue->first = NULL; } ret = SEC_OSAL_MutexTerminate(queue->qMutex); return ret; } int SEC_OSAL_Queue(SEC_QUEUE *queueHandle, void *data) { SEC_QUEUE *queue = (SEC_QUEUE *)queueHandle; if (queue == NULL) return -1; SEC_OSAL_MutexLock(queue->qMutex); if ((queue->last->data != NULL) || (queue->numElem >= MAX_QUEUE_ELEMENTS)) { SEC_OSAL_MutexUnlock(queue->qMutex); return -1; } queue->last->data = data; queue->last = queue->last->qNext; queue->numElem++; SEC_OSAL_MutexUnlock(queue->qMutex); return 0; } void *SEC_OSAL_Dequeue(SEC_QUEUE *queueHandle) { void *data = NULL; SEC_QUEUE *queue = (SEC_QUEUE *)queueHandle; if (queue == NULL) return NULL; SEC_OSAL_MutexLock(queue->qMutex); if ((queue->first->data == NULL) || (queue->numElem <= 0)) { SEC_OSAL_MutexUnlock(queue->qMutex); return NULL; } data = queue->first->data; queue->first->data = NULL; queue->first = queue->first->qNext; queue->numElem--; SEC_OSAL_MutexUnlock(queue->qMutex); return data; } int SEC_OSAL_GetElemNum(SEC_QUEUE *queueHandle) { int ElemNum = 0; SEC_QUEUE *queue = (SEC_QUEUE *)queueHandle; if (queue == NULL) return -1; SEC_OSAL_MutexLock(queue->qMutex); ElemNum = queue->numElem; SEC_OSAL_MutexUnlock(queue->qMutex); return ElemNum; } int SEC_OSAL_SetElemNum(SEC_QUEUE *queueHandle, int ElemNum) { SEC_QUEUE *queue = (SEC_QUEUE *)queueHandle; if (queue == NULL) return -1; SEC_OSAL_MutexLock(queue->qMutex); queue->numElem = ElemNum; SEC_OSAL_MutexUnlock(queue->qMutex); return ElemNum; }
/* Copyright 2013 David Axmark Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* * File: ConnectionCocoaInterface.h * Author: Romain Chalant * * Created on August 5, 2010 */ #ifndef __CONNECTIONCOCOA_H__ #define __CONNECTIONCOCOA_H__ #include <pthread.h> #include <mach/semaphore.h> #include <mach/task.h> #include <IOBluetooth/Bluetooth.h> #include "../connection.h" class ConnectionCocoa; namespace Bluetooth { namespace Darwin { /** * Blocking RFCOMM socket * */ class BtSppConnectionCocoa : public BtSppConnection { private: ConnectionCocoa *mConnection; public: /** * Constructor, creates the socket * * @param a Pointer to bluetooth adress * @param p Port to connect to */ BtSppConnectionCocoa ( const MABtAddr* a, uint p ); /** * Destructor, will close any connection and free * resources * */ virtual ~BtSppConnectionCocoa ( void ); // From connection /** * Attempts to connect to the remote host * * @return > 0 On success * CONNERR On failure */ virtual int connect ( void ); /** * Reads one to max bytes from the the socket without blocking. * * @param dst Pointer to the buffer to write to. * @param max Maximum number of bytes to read. * * @return Number of read bytes or CONNERR if failed. */ virtual int read ( void* dst, int max ); /** * Sends the supplied number of bytes to the destination. * * @param src Pointer to the buffer that holds the data. * @param len Number of bytes to send. * * @return > 0 The data has been sent. * CONNERR, If there was an error. */ virtual int write ( const void* src, int len ); /** * Determines if the socket is connected or not. * * @return TRUE if connected, FALSE otherwise. */ virtual bool isConnected ( void ); // From Closable /** * Closes any open connections * */ virtual void close ( void ); /** * Returns the adress of the remote host. * * @param a Structure to fill */ virtual int getAddr ( MAConnAddr& a ); }; } } #endif /* __CONNECTIONBLUEZ_HPP__ */
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4; coding: utf-8 -*- */ /* dir-node.h * * Copyright (C) 2010 Sébastien Granjoux * * 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 _DIR_NODE_H_ #define _DIR_NODE_H_ #include <glib-object.h> #include <libanjuta/anjuta-project.h> G_BEGIN_DECLS #define ANJUTA_TYPE_DIR_ROOT_NODE (anjuta_dir_root_node_get_type ()) #define ANJUTA_DIR_ROOT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_DIR_ROOT_NODE, AnjutaDirRootNode)) typedef struct _AnjutaDirGroupNode AnjutaDirRootNode; typedef struct _AnjutaDirGroupNodeClass AnjutaDirRootNodeClass; GType anjuta_dir_root_node_get_type (void) G_GNUC_CONST; #define ANJUTA_TYPE_DIR_GROUP_NODE (anjuta_dir_group_node_get_type ()) #define ANJUTA_DIR_GROUP_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_DIR_GROUP_NODE, AnjutaDirGroupNode)) typedef struct _AnjutaDirGroupNode AnjutaDirGroupNode; typedef struct _AnjutaDirGroupNodeClass AnjutaDirGroupNodeClass; GType anjuta_dir_group_node_get_type (void) G_GNUC_CONST; #define ANJUTA_TYPE_DIR_OBJECT_NODE (anjuta_dir_object_node_get_type ()) #define ANJUTA_DIR_OBJECT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_DIR_OBJECT_NODE, AnjutaDirObjectNode)) typedef struct _AnjutaDirObjectNode AnjutaDirObjectNode; GType anjuta_dir_object_node_get_type (void) G_GNUC_CONST; #define ANJUTA_TYPE_DIR_SOURCE_NODE (anjuta_dir_source_node_get_type ()) #define ANJUTA_DIR_SOURCE_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_DIR_SOURCE_NODE, AnjutaDirSourceNode)) typedef struct _AnjutaDirSourceNode AnjutaDirSourceNode; GType anjuta_dir_source_node_get_type (void) G_GNUC_CONST; struct _AnjutaDirGroupNode { AnjutaProjectNode base; GFileMonitor *monitor; GObject *emitter; }; struct _AnjutaDirGroupNodeClass { AnjutaProjectNodeClass parent_class; }; AnjutaProjectNode *dir_group_node_new (GFile *file, GObject *emitter); gboolean dir_group_node_set_file (AnjutaDirGroupNode *group, GFile *new_file, GObject *emitter); AnjutaProjectNode *dir_object_node_new (GFile *file); AnjutaProjectNode *dir_source_node_new (GFile *file); G_END_DECLS #endif /* _DIR_NODE_H_ */
/* * Copyright (C) Research In Motion Limited 2010. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #pragma once #include "SVGAnimatedPropertyMacros.h" #include "SVGAnimatedStaticPropertyTearOff.h" #include "SVGAnimatedTypeAnimator.h" namespace WebCore { typedef SVGAnimatedStaticPropertyTearOff<int> SVGAnimatedInteger; // Helper macros to declare/define a SVGAnimatedInteger object #define DECLARE_ANIMATED_INTEGER(UpperProperty, LowerProperty) \ DECLARE_ANIMATED_PROPERTY(SVGAnimatedInteger, int, UpperProperty, LowerProperty, ) #define DEFINE_ANIMATED_INTEGER(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \ DEFINE_ANIMATED_PROPERTY(AnimatedInteger, OwnerType, DOMAttribute, DOMAttribute->localName(), UpperProperty, LowerProperty) #define DEFINE_ANIMATED_INTEGER_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \ DEFINE_ANIMATED_PROPERTY(AnimatedIntegerOptionalInteger, OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) class SVGAnimationElement; class SVGAnimatedIntegerAnimator final : public SVGAnimatedTypeAnimator { public: SVGAnimatedIntegerAnimator(SVGAnimationElement*, SVGElement*); static void calculateAnimatedInteger(SVGAnimationElement*, float percentage, unsigned repeatCount, int fromInteger, int toInteger, int toAtEndOfDurationInteger, int& animatedInteger); std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override; std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override; void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override; void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override; void animValWillChange(const SVGElementAnimatedPropertyList&) override; void animValDidChange(const SVGElementAnimatedPropertyList&) override; void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override; void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override; float calculateDistance(const String& fromString, const String& toString) override; }; } // namespace WebCore
/* * * Copyright (c) 2002-2005 Broadcom Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * */ #ifndef _BCMMII_H_ #define _BCMMII_H_ /* BRCM EPHY Aux status summery Register */ #define MII_BRCM_AUX_STAT_SUM 0x19 #define MII_BRCM_AUX_FD 0x01 #define MII_BRCM_AUX_AN 0x10 #define MII_BRCM_AUX_LINK_UP 0x20 #define MII_BRCM_AUX_SPEED_100 0x40 #define MII_BRCM_AUX_LP_AN 0x80 #define MII_BRCM_AUX_LP_PR 0x100 #define MII_BRCM_AUX_AN_HCD_MASK 0x03 /* highest common denominator*/ #define MII_BRCM_AUX_AN_HCD_SHIFT 0x08 #define MII_BRCM_AUX_AN_HCD_10T 0X01 #define MII_BRCM_AUX_AN_HCD_10T_FULL 0x02 #define MII_BRCM_AUX_AN_HCD_100TX 0x03 #define MII_BRCM_AUX_AN_HCD_100T4 0x04 #define MII_BRCM_AUX_AN_HCD_100TX_FULL 0x05 #define MII_BRCM_AUX_AN_PAUSE 0x800 #define MII_BRCM_AUX_AN_COMPLETE 0x8000 /* BRCM GPHY Aux status summery register bits ?? */ #define MII_BRCM_AUX_GPHY_TX_PAUSE 0 #define MII_BRCM_AUX_GPHY_RX_PAUSE 1 /**************************************************************************** Prototypes ****************************************************************************/ extern void mii_setup(struct net_device *dev); extern int mii_init(struct net_device *dev); extern int mii_probe(struct net_device * dev, void * p); #endif /* _BCMMII_H_ */
/* ActivityExtenstion, XEP-0108 Copyright (c) 2008-2009 by Nigmatullin Ruslan <euroelessar@gmail.com> *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * *************************************************************************** */ #ifndef activityextension_H #define activityextension_H #include "gloox/stanzaextension.h" #include "src/jProtocol.h" #include <QString> class ActivityExtension : public StanzaExtension { public: ActivityExtension(const Tag* tag = 0); ActivityExtension(const QString &general, const QString &specific="", const QString &text=""); const std::string &filterString () const; StanzaExtension *newInstance (const Tag *tag) const; Tag* tag() const; StanzaExtension* clone() const { return new ActivityExtension(m_general, m_specific, m_text); } const QString &general() const {return m_general;} const QString &specific() const {return m_specific;} const QString &text() const {return m_text;} private: QString m_general; QString m_specific; QString m_text; }; #endif
/* segment.h: MMU segment settings * * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.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 _ASM_SEGMENT_H #define _ASM_SEGMENT_H #ifndef __ASSEMBLY__ typedef struct { unsigned long seg; } mm_segment_t; #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) #ifdef CONFIG_MMU #define USER_DS MAKE_MM_SEG(TASK_SIZE - 1) #define KERNEL_DS MAKE_MM_SEG(0xdfffffffUL) #else #define USER_DS MAKE_MM_SEG(memory_end) #define KERNEL_DS MAKE_MM_SEG(0xe0000000UL) #endif #define get_ds() (KERNEL_DS) #define get_fs() (__current_thread_info->addr_limit) #define segment_eq(a,b) ((a).seg == (b).seg) #define __kernel_ds_p() segment_eq(get_fs(), KERNEL_DS) #define get_addr_limit() (get_fs().seg) #define set_fs(_x) \ do { \ __current_thread_info->addr_limit = (_x); \ } while(0) #endif /* __ASSEMBLY__ */ #endif /* _ASM_SEGMENT_H */
/* * 3.3.2 Send a Signal to a Process, P1003.1b-1993, p. 68 * * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id$ */ #if HAVE_CONFIG_H #include "config.h" #endif #include <pthread.h> #include <errno.h> #include <rtems/system.h> #include <rtems/posix/pthread.h> #include <rtems/posix/psignal.h> int kill( pid_t pid, int sig ) { return killinfo( pid, sig, NULL ); }
#ifndef __CARETEXCEPTION_H__ #define __CARETEXCEPTION_H__ /*LICENSE_START*/ /* * Copyright (C) 2014 Washington University School of Medicine * * 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. */ /*LICENSE_END*/ #include <stdexcept> #include <AString.h> namespace caret { /** * An exception thrown during Caret processing. */ class CaretException : public std::runtime_error { public: CaretException(); CaretException(const AString& s); CaretException(const CaretException& e); CaretException& operator=(const CaretException& e); virtual ~CaretException() throw(); virtual AString whatString() const throw(); AString getCallStack() const; protected: void setExceptionDescription(const AString& s); private: /// Description of the exception AString exceptionDescription; /// the call stack AString callStack; void initializeMembersCaretException(); }; } // namespace #endif // __CARETEXCEPTION_H__
// Filename:- genericparser2.h #ifndef GENERICPARSER2_H #define GENERICPARSER2_H // conditional expression is constant // conversion from int to char, possible loss of data // unreferenced inline funciton has been removed #pragma warning( disable : 4127 4244 4514 ) #ifdef DEBUG_LINKING #pragma message("...including GenericParser2.h") #endif //#include "disablewarnings.h" #ifdef _JK2EXE #define trap_Z_Malloc(x, y) Z_Malloc(x,y,qtrue) #define trap_Z_Free(x) Z_Free(x) #else #define trap_Z_Malloc(x, y) gi.Malloc(x,y,qtrue) #define trap_Z_Free(x) gi.Free(x) #endif class CTextPool; class CGPObject; class CTextPool { private: char *mPool; CTextPool *mNext; int mSize, mUsed; public: CTextPool(int initSize = 10240); ~CTextPool(void); CTextPool *GetNext(void) { return mNext; } void SetNext(CTextPool *which) { mNext = which; } char *GetPool(void) { return mPool; } int GetUsed(void) { return mUsed; } char *AllocText(char *text, bool addNULL = true, CTextPool **poolPtr = 0); }; void CleanTextPool(CTextPool *pool); class CGPObject { protected: const char *mName; CGPObject *mNext, *mInOrderNext, *mInOrderPrevious; public: CGPObject(const char *initName); const char *GetName(void) { return mName; } CGPObject *GetNext(void) { return mNext; } void SetNext(CGPObject *which) { mNext = which; } CGPObject *GetInOrderNext(void) { return mInOrderNext; } void SetInOrderNext(CGPObject *which) { mInOrderNext = which; } CGPObject *GetInOrderPrevious(void) { return mInOrderPrevious; } void SetInOrderPrevious(CGPObject *which) { mInOrderPrevious = which; } bool WriteText(CTextPool **textPool, const char *text); }; class CGPValue : public CGPObject { private: CGPObject *mList; public: CGPValue(const char *initName, const char *initValue = 0); ~CGPValue(void); CGPValue *GetNext(void) { return (CGPValue *)mNext; } CGPValue *Duplicate(CTextPool **textPool = 0); bool IsList(void); const char *GetTopValue(void); CGPObject *GetList(void) { return mList; } void AddValue(const char *newValue, CTextPool **textPool = 0); bool Parse(char **dataPtr, CTextPool **textPool); bool Write(CTextPool **textPool, int depth); }; class CGPGroup : public CGPObject { private: CGPValue *mPairs, *mInOrderPairs; CGPValue *mCurrentPair; CGPGroup *mSubGroups, *mInOrderSubGroups; CGPGroup *mCurrentSubGroup; CGPGroup *mParent; bool mWriteable; void SortObject(CGPObject *object, CGPObject **unsortedList, CGPObject **sortedList, CGPObject **lastObject); public: CGPGroup(const char *initName = "Top Level", CGPGroup *initParent = 0); ~CGPGroup(void); CGPGroup *GetNext(void) { return (CGPGroup *)mNext; } int GetNumSubGroups(void); int GetNumPairs(void); void Clean(void); CGPGroup *Duplicate(CTextPool **textPool = 0, CGPGroup *initParent = 0); void SetWriteable(const bool writeable) { mWriteable = writeable; } CGPValue *GetPairs(void) { return mPairs; } CGPValue *GetInOrderPairs(void) { return mInOrderPairs; } CGPGroup *GetSubGroups(void) { return mSubGroups; } CGPGroup *GetInOrderSubGroups(void) { return mInOrderSubGroups; } CGPValue *AddPair(const char *name, const char *value, CTextPool **textPool = 0); void AddPair(CGPValue *NewPair); CGPGroup *AddGroup(const char *name, CTextPool **textPool = 0); void AddGroup(CGPGroup *NewGroup); CGPGroup *FindSubGroup(const char *name); bool Parse(char **dataPtr, CTextPool **textPool); bool Write(CTextPool **textPool, int depth); CGPValue *FindPair(const char *key); const char *FindPairValue(const char *key, const char *defaultVal = 0); }; class CGenericParser2 { private: CGPGroup mTopLevel; CTextPool *mTextPool; bool mWriteable; public: CGenericParser2(void); ~CGenericParser2(void); void SetWriteable(const bool writeable) { mWriteable = writeable; } CGPGroup *GetBaseParseGroup(void) { return &mTopLevel; } bool Parse(char **dataPtr, bool cleanFirst = true, bool writeable = false); bool Parse(char *dataPtr, bool cleanFirst = true, bool writeable = false) { return Parse(&dataPtr, cleanFirst, writeable); } void Clean(void); bool Write(CTextPool *textPool); }; // The following groups of routines are used for a C interface into GP2. // C++ users should just use the objects as normally and not call these routines below // typedef void *TGenericParser2; typedef void *TGPGroup; typedef void *TGPValue; // CGenericParser2 (void *) routines TGenericParser2 GP_Parse(char **dataPtr, bool cleanFirst, bool writeable); void GP_Clean(TGenericParser2 GP2); void GP_Delete(TGenericParser2 *GP2); TGPGroup GP_GetBaseParseGroup(TGenericParser2 GP2); // CGPGroup (void *) routines const char *GPG_GetName(TGPGroup GPG); TGPGroup GPG_GetNext(TGPGroup GPG); TGPGroup GPG_GetInOrderNext(TGPGroup GPG); TGPGroup GPG_GetInOrderPrevious(TGPGroup GPG); TGPGroup GPG_GetPairs(TGPGroup GPG); TGPGroup GPG_GetInOrderPairs(TGPGroup GPG); TGPGroup GPG_GetSubGroups(TGPGroup GPG); TGPGroup GPG_GetInOrderSubGroups(TGPGroup GPG); TGPGroup GPG_FindSubGroup(TGPGroup GPG, const char *name); TGPValue GPG_FindPair(TGPGroup GPG, const char *key); const char *GPG_FindPairValue(TGPGroup GPG, const char *key, const char *defaultVal); // CGPValue (void *) routines const char *GPV_GetName(TGPValue GPV); TGPValue GPV_GetNext(TGPValue GPV); TGPValue GPV_GetInOrderNext(TGPValue GPV); TGPValue GPV_GetInOrderPrevious(TGPValue GPV); bool GPV_IsList(TGPValue GPV); const char *GPV_GetTopValue(TGPValue GPV); TGPValue GPV_GetList(TGPValue GPV); #endif // #ifndef GENERICPARSER2_H //////////////////// eof /////////////////////
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/xr19rel/WINNT_5.2_Depend/mozilla/embedding/components/webbrowserpersist/public/nsCWebBrowserPersist.idl */ #ifndef __gen_nsCWebBrowserPersist_h__ #define __gen_nsCWebBrowserPersist_h__ #ifndef __gen_nsIWebBrowserPersist_h__ #include "nsIWebBrowserPersist.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif // {7E677795-C582-4cd1-9E8D-8271B3474D2A} #define NS_WEBBROWSERPERSIST_CID \ { 0x7e677795, 0xc582, 0x4cd1, { 0x9e, 0x8d, 0x82, 0x71, 0xb3, 0x47, 0x4d, 0x2a } } #define NS_WEBBROWSERPERSIST_CONTRACTID \ "@mozilla.org/embedding/browser/nsWebBrowserPersist;1" #endif /* __gen_nsCWebBrowserPersist_h__ */
/* arch/arm/mach-msm/nand_partitions.c * * Code to extract partition information from ATAG set up by the * bootloader. * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. * Author: Brian Swetland <swetland@google.com> * * 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/platform_device.h> #include <asm/mach/flash.h> #include <linux/io.h> #include <asm/setup.h> #include <linux/mtd/nand.h> #include <linux/mtd/partitions.h> #include <mach/msm_iomap.h> #include <mach/board.h> #include "smd_private.h" /* configuration tags specific to msm */ #define ATAG_MSM_PARTITION 0x4d534D70 /* MSMp */ struct msm_ptbl_entry { char name[16]; __u32 offset; __u32 size; __u32 flags; }; #ifdef CONFIG_MACH_LGE // LGE_UPDATE_S GELATO moon.jung@lge.com #define MSM_MAX_PARTITIONS 12 // LGE_UPDATE_E GELATO moon.jung@lge.com #else /* original */ #define MSM_MAX_PARTITIONS 10 #endif static struct mtd_partition msm_nand_partitions[MSM_MAX_PARTITIONS]; static char msm_nand_names[MSM_MAX_PARTITIONS * 16]; extern struct flash_platform_data msm_nand_data; static int __init parse_tag_msm_partition(const struct tag *tag) { struct mtd_partition *ptn = msm_nand_partitions; char *name = msm_nand_names; struct msm_ptbl_entry *entry = (void *) &tag->u; unsigned count, n; count = (tag->hdr.size - 2) / (sizeof(struct msm_ptbl_entry) / sizeof(__u32)); if (count > MSM_MAX_PARTITIONS) count = MSM_MAX_PARTITIONS; for (n = 0; n < count; n++) { memcpy(name, entry->name, 15); name[15] = 0; ptn->name = name; ptn->offset = entry->offset; ptn->size = entry->size; printk(KERN_INFO "Partition (from atag) %s " "-- Offset:%llx Size:%llx\n", ptn->name, ptn->offset, ptn->size); name += 16; entry++; ptn++; } msm_nand_data.nr_parts = count; msm_nand_data.parts = msm_nand_partitions; return 0; } __tagtable(ATAG_MSM_PARTITION, parse_tag_msm_partition); #define FLASH_PART_MAGIC1 0x55EE73AA #define FLASH_PART_MAGIC2 0xE35EBDDB #define FLASH_PARTITION_VERSION 0x3 #define LINUX_FS_PARTITION_NAME "0:EFS2APPS" struct flash_partition_entry { char name[16]; u32 offset; /* Offset in blocks from beginning of device */ u32 length; /* Length of the partition in blocks */ u8 attrib1; u8 attrib2; u8 attrib3; u8 which_flash; /* Numeric ID (first = 0, second = 1) */ }; struct flash_partition_table { u32 magic1; u32 magic2; u32 version; u32 numparts; struct flash_partition_entry part_entry[16]; }; static int get_nand_partitions(void) { struct flash_partition_table *partition_table; struct flash_partition_entry *part_entry; struct mtd_partition *ptn = msm_nand_partitions; char *name = msm_nand_names; int part; if (msm_nand_data.nr_parts) return 0; partition_table = (struct flash_partition_table *) smem_alloc(SMEM_AARM_PARTITION_TABLE, sizeof(struct flash_partition_table)); if (!partition_table) { printk(KERN_WARNING "%s: no flash partition table in shared " "memory\n", __func__); return -ENOENT; } if ((partition_table->magic1 != (u32) FLASH_PART_MAGIC1) || (partition_table->magic2 != (u32) FLASH_PART_MAGIC2) || (partition_table->version != (u32) FLASH_PARTITION_VERSION)) { printk(KERN_WARNING "%s: version mismatch -- magic1=%#x, " "magic2=%#x, version=%#x\n", __func__, partition_table->magic1, partition_table->magic2, partition_table->version); return -EFAULT; } msm_nand_data.nr_parts = 0; /* Get the LINUX FS partition info */ for (part = 0; part < partition_table->numparts; part++) { part_entry = &partition_table->part_entry[part]; /* Find a match for the Linux file system partition */ if (strcmp(part_entry->name, LINUX_FS_PARTITION_NAME) == 0) { strcpy(name, part_entry->name); ptn->name = name; /*TODO: Get block count and size info */ ptn->offset = part_entry->offset; /* For SMEM, -1 indicates remaining space in flash, * but for MTD it is 0 */ if (part_entry->length == (u32)-1) ptn->size = 0; else ptn->size = part_entry->length; msm_nand_data.nr_parts = 1; msm_nand_data.parts = msm_nand_partitions; printk(KERN_INFO "Partition(from smem) %s " "-- Offset:%llx Size:%llx\n", ptn->name, ptn->offset, ptn->size); return 0; } } printk(KERN_WARNING "%s: no partition table found!", __func__); return -ENODEV; } device_initcall(get_nand_partitions);
#pragma once #include <list> #include "VideoCommon/VideoCommon.h" inline bool AddressRangesOverlap(u32 aLower, u32 aUpper, u32 bLower, u32 bUpper) { return !((aLower >= bUpper) || (bLower >= aUpper)); } struct XFBSourceBase { virtual ~XFBSourceBase() {} virtual void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) = 0; virtual void CopyEFB(float Gamma) = 0; u32 srcAddr; u32 srcWidth; u32 srcHeight; unsigned int texWidth; unsigned int texHeight; // TODO: only used by OGL TargetRectangle sourceRc; }; class FramebufferManagerBase { public: enum { // There may be multiple XFBs in GameCube RAM. This is the maximum number to // virtualize. MAX_VIRTUAL_XFB = 8 }; FramebufferManagerBase(); virtual ~FramebufferManagerBase(); static void CopyToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma); static const XFBSourceBase* const* GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCount); static void SetLastXfbWidth(unsigned int width) { s_last_xfb_width = width; } static void SetLastXfbHeight(unsigned int height) { s_last_xfb_height = height; } static unsigned int LastXfbWidth() { return s_last_xfb_width; } static unsigned int LastXfbHeight() { return s_last_xfb_height; } static int ScaleToVirtualXfbWidth(int x); static int ScaleToVirtualXfbHeight(int y); static unsigned int GetEFBLayers() { return m_EFBLayers; } protected: struct VirtualXFB { VirtualXFB() { } // Address and size in GameCube RAM u32 xfbAddr = 0; u32 xfbWidth = 0; u32 xfbHeight = 0; XFBSourceBase* xfbSource = nullptr; }; typedef std::list<VirtualXFB> VirtualXFBListType; static unsigned int m_EFBLayers; private: virtual XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) = 0; // TODO: figure out why OGL is different for this guy virtual void GetTargetSize(unsigned int *width, unsigned int *height) = 0; static VirtualXFBListType::iterator FindVirtualXFB(u32 xfbAddr, u32 width, u32 height); static void ReplaceVirtualXFB(); // TODO: merge these virtual funcs, they are nearly all the same virtual void CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma = 1.0f) = 0; static void CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma = 1.0f); static const XFBSourceBase* const* GetRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCount); static const XFBSourceBase* const* GetVirtualXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCount); static XFBSourceBase *m_realXFBSource; // Only used in Real XFB mode static VirtualXFBListType m_virtualXFBList; // Only used in Virtual XFB mode static const XFBSourceBase* m_overlappingXFBArray[MAX_VIRTUAL_XFB]; static unsigned int s_last_xfb_width; static unsigned int s_last_xfb_height; }; extern FramebufferManagerBase *g_framebuffer_manager;