text
stringlengths
4
6.14k
// // UCGroupPostRequest.h // Cloudkit test // // Created by Yury Nechaev on 04.04.16. // Copyright © 2016 Uploadcare. All rights reserved. // #import "UCAPIRequest.h" /** * Creates group with the provided file uuids. * @see https://uploadcare.com/documentation/upload/#create-group */ @interface UCGroupPostRequest : UCAPIRequest + (instancetype)requestWithFileIDs:(NSArray<NSString *> *)fileIDs; @end
/*BEGIN_LEGAL Intel Open Source License Copyright (c) 2002-2010 Intel Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS 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. END_LEGAL */ /// @file xed-operand-visibility-enum.h // This file was automatically generated. // Do not edit this file. #if !defined(_XED_OPERAND_VISIBILITY_ENUM_H_) # define _XED_OPERAND_VISIBILITY_ENUM_H_ #include "xed-common-hdrs.h" typedef enum { XED_OPVIS_INVALID, XED_OPVIS_EXPLICIT, ///< Shows up in operand encoding XED_OPVIS_IMPLICIT, ///< Part of the opcode, but listed as an operand XED_OPVIS_SUPPRESSED, ///< Part of the opcode, but not typically listed as an operand XED_OPVIS_LAST } xed_operand_visibility_enum_t; XED_DLL_EXPORT xed_operand_visibility_enum_t str2xed_operand_visibility_enum_t(const char* s); XED_DLL_EXPORT const char* xed_operand_visibility_enum_t2str(const xed_operand_visibility_enum_t p); XED_DLL_EXPORT xed_operand_visibility_enum_t xed_operand_visibility_enum_t_last(void); #endif
#import <UIKit/UIKit.h> @interface LoginedViewController : UIViewController @end
// slang-source-stream.h #ifndef SLANG_EMIT_SOURCE_WRITER_H #define SLANG_EMIT_SOURCE_WRITER_H #include "../core/slang-basic.h" #include "slang-compiler.h" namespace Slang { /* Class that encapsulates a stream of source. Facilities provided... * Management of the buffer that holds the source content as it is constructed * output line directives + Supports GLSL as well as C/CPP/HLSL style directives * Support for line indention */ class SourceWriter { public: /// Emits without span without any extra processing void emitRawTextSpan(char const* textBegin, char const* textEnd); void emitRawText(char const* text); /// Emit different types into the stream void emit(char const* textBegin, char const* textEnd); void emit(char const* text); void emit(const String& text); void emit(const UnownedStringSlice& text); void emit(Name* name); void emit(const NameLoc& nameAndLoc); void emit(const StringSliceLoc& nameAndLoc); void emit(IntegerLiteralValue value); void emitUInt64(uint64_t value); void emitInt64(int64_t value); void emit(UInt value); void emit(int value); void emit(double value); void emitChar(char c); /// Emit names (doing so can also advance to a new source location) void emitName(const StringSliceLoc& nameAndLoc); void emitName(const NameLoc& nameAndLoc); void emitName(Name* name, const SourceLoc& loc); void emitName(Name* name); void supressLineDirective() { m_supressLineDirective = true; } void resumeLineDirective() { m_supressLineDirective = false; } /// Indent the text void indent(); /// Dedent (the opposite of indenting) the text void dedent(); /// Move the current source location to that specified void advanceToSourceLocation(const SourceLoc& sourceLocation); /// Only advances if the sourceLocation is valid void advanceToSourceLocationIfValid(const SourceLoc& sourceLocation); /// Get the content as a string String getContent() { return m_builder.ProduceString(); } /// Clear the content void clearContent() { m_builder.Clear(); } /// Get the content as a string and clear the internal representation String getContentAndClear(); /// Get the line directive mode used LineDirectiveMode getLineDirectiveMode() const { return m_lineDirectiveMode; } /// Get the source manager user SourceManager* getSourceManager() const { return m_sourceManager; } /// Ctor SourceWriter(SourceManager* sourceManager, LineDirectiveMode lineDirectiveMode); protected: void _emitTextSpan(char const* textBegin, char const* textEnd); void _flushSourceLocationChange(); // Emit a `#line` directive to the output, and also // ensure that source location tracking information // is correct based on the directive we just output. void _emitLineDirectiveAndUpdateSourceLocation(const HumaneSourceLoc& sourceLocation); void _emitLineDirectiveIfNeeded(const HumaneSourceLoc& sourceLocation); // Emit a `#line` directive to the output. // Doesn't update state of source-location tracking. void _emitLineDirective(const HumaneSourceLoc& sourceLocation); // The string of code we've built so far. // TODO(JS): We could store the text in chunks, and then only sew together into one buffer // when we are done. Doing so would not require copies/reallocs until the full buffer has been // produced. A downside to doing this is that it won't be so simple to debug by trying to // look at the current contents of the buffer StringBuilder m_builder; // Current source position for tracking purposes... HumaneSourceLoc m_loc; SourceLoc m_nextSourceLoc; HumaneSourceLoc m_nextHumaneSourceLocation; bool m_needToUpdateSourceLocation = false; bool m_supressLineDirective = false; // Are we at the start of a line, so that we should indent // before writing any other text? bool m_isAtStartOfLine = true; // How far are we indented? Int m_indentLevel = 0; SourceManager* m_sourceManager = nullptr; // For GLSL output, we can't emit traditional `#line` directives // with a file path in them, so we maintain a map that associates // each path with a unique integer, and then we output those // instead. Dictionary<String, int> m_mapGLSLSourcePathToID; int m_glslSourceIDCount = 0; LineDirectiveMode m_lineDirectiveMode; }; } #endif
#include "pge_collision.h" #define min(a, b) ((a) < (b)) ? (a) : (b) #define max(a, b) ((a) > (b)) ? (a) : (b) // Uses separated axis theorem where rectangles are aligned with the x and y axis bool pge_collision_rectangle_rectangle(GRect *rect_a, GRect *rect_b) { struct overlap_rect{ GPoint ul; // upper-left GPoint ur; // upper-right GPoint bl; // bottom-left GPoint br; // bottom-right }; struct overlap_rect overlap_a = (struct overlap_rect){ {rect_a->origin.x, rect_a->origin.y}, {rect_a->origin.x + rect_a->size.w, rect_a->origin.y}, {rect_a->origin.x, rect_a->origin.y + rect_a->size.h}, {rect_a->origin.x + rect_a->size.w, rect_a->origin.y + rect_a->size.h}}; struct overlap_rect overlap_b = (struct overlap_rect){ {rect_b->origin.x, rect_b->origin.y}, {rect_b->origin.x + rect_b->size.w, rect_b->origin.y}, {rect_b->origin.x, rect_b->origin.y + rect_b->size.h}, {rect_b->origin.x + rect_b->size.w, rect_b->origin.y + rect_b->size.h}}; GPoint a_min = GPoint( min( min( overlap_a.ul.x,overlap_a.ur.x),min( overlap_a.bl.x,overlap_a.br.x ) ), min( min( overlap_a.ul.y,overlap_a.ur.y),min( overlap_a.bl.y,overlap_a.br.y ) ) ); GPoint a_max = GPoint( max( max( overlap_a.ul.x,overlap_a.ur.x),max( overlap_a.bl.x,overlap_a.br.x ) ), max( max( overlap_a.ul.y,overlap_a.ur.y),max( overlap_a.bl.y,overlap_a.br.y ) ) ); GPoint b_min = GPoint( min( min( overlap_b.ul.x,overlap_b.ur.x),min( overlap_b.bl.x,overlap_b.br.x ) ), min( min( overlap_b.ul.y,overlap_b.ur.y),min( overlap_b.bl.y,overlap_b.br.y ) ) ); GPoint b_max = GPoint( max( max( overlap_b.ul.x,overlap_b.ur.x),max( overlap_b.bl.x,overlap_b.br.x ) ), max( max( overlap_b.ul.y,overlap_b.ur.y),max( overlap_b.bl.y,overlap_b.br.y ) ) ); //checks if cannot overlap, returns true if overlapped return !( a_min.x > b_max.x || a_max.x < b_min.x || a_min.y > b_max.y || a_max.y < b_min.y ); } bool pge_collision_line_rectangle(GLine *line, GRect *rect) { bool retval = false; retval |= pge_collision_line_line( line, &(GLine){ {rect->origin.x, rect->origin.y}, {rect->origin.x + rect->size.w, rect->origin.y}}); retval |= pge_collision_line_line( line, &(GLine){ {rect->origin.x + rect->size.w, rect->origin.y}, {rect->origin.x + rect->size.w, rect->origin.y + rect->size.h}}); retval |= pge_collision_line_line( line, &(GLine){ {rect->origin.x + rect->size.w, rect->origin.y + rect->size.h}, {rect->origin.x, rect->origin.y + rect->size.h}}); retval |= pge_collision_line_line( line, &(GLine){ {rect->origin.x, rect->origin.y + rect->size.h}, {rect->origin.x, rect->origin.y}}); return retval; } bool pge_collision_line_line(GLine *line_a, GLine *line_b) { // Dot product, positive results mean point is on one side of a line, // checking both ranges shows if intersection is within segments. return (((line_b->p1.x-line_a->p1.x)*(line_a->p2.y-line_a->p1.y) + (line_b->p1.y-line_a->p1.y)*(line_a->p2.x-line_a->p1.x)) * ((line_b->p2.x-line_a->p1.x)*(line_a->p2.y-line_a->p1.y) + (line_b->p2.y-line_a->p1.y)*(line_a->p2.x-line_a->p1.x)) < 0) && (((line_a->p1.x-line_b->p1.x)*(line_b->p2.y-line_b->p1.y) + (line_a->p1.y-line_b->p1.y)*(line_b->p2.x-line_b->p1.x)) * ((line_a->p2.x-line_b->p1.x)*(line_b->p2.y-line_b->p1.y) + (line_a->p2.y-line_b->p1.y)*(line_b->p2.x-line_b->p1.x)) < 0); } bool pge_collision_point_rectangle(GPoint *point, GRect *rect){ return (point->x >= rect->origin.x && point->x <= (rect->origin.x + rect->size.w)) && (point->y >= rect->origin.y && point->y <= (rect->origin.y + rect->size.h)); }
/* LUFA Library Copyright (C) Dean Camera, 2013. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, 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. */ /** \file * \brief Architecture Specific Hardware Platform Drivers. * * This file is the master dispatch header file for the device-specific hardware platform drivers, for low level * hardware configuration and management. The platform drivers are a set of drivers which are designed to provide * a high level management layer for the various low level system functions such as clock control and interrupt * management. * * User code may choose to either include this master dispatch header file to include all available platform * driver header files for the current architecture, or may choose to only include the specific platform driver * modules required for a particular application. */ /** \defgroup Group_PlatformDrivers System Platform Drivers - LUFA/Platform/Platform.h * \brief Hardware platform drivers. * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: * - <b>UC3 Architecture Only:</b> LUFA/Platform/UC3/InterruptManagement.c <i>(Makefile source module name: LUFA_SRC_PLATFORM)</i> * - <b>UC3 Architecture Only:</b> LUFA/Platform/UC3/Exception.S <i>(Makefile source module name: LUFA_SRC_PLATFORM)</i> * * \section Sec_ModDescription Module Description * Device-specific hardware platform drivers, for low level hardware configuration and management. The platform * drivers are a set of drivers which are designed to provide a high level management layer for the various low level * system functions such as clock control and interrupt management. * * User code may choose to either include this master dispatch header file to include all available platform * driver header files for the current architecture, or may choose to only include the specific platform driver * modules required for a particular application. * * \note The exact APIs and availability of sub-modules within the platform driver group may vary depending on the * target used - see individual target module documentation for the API specific to your target processor. */ #ifndef __LUFA_PLATFORM_H__ #define __LUFA_PLATFORM_H__ /* Includes: */ #include "../Common/Common.h" /* Includes: */ #if (ARCH == ARCH_UC3) #include "UC3/ClockManagement.h" #include "UC3/InterruptManagement.h" #elif (ARCH == ARCH_XMEGA) #include "XMEGA/ClockManagement.h" #endif #endif
int main() { return 1 / 0; }
/* The Keccak sponge function, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. For more information, feedback or questions, please refer to our website: http://keccak.noekeon.org/ Implementation by the designers, hereby denoted as "the implementer". To the extent possible under law, the implementer has waived all copyright and related or neighboring rights to the source code in this file. http://creativecommons.org/publicdomain/zero/1.0/ */ #ifndef _KeccakPermutationInterface_h_ #define _KeccakPermutationInterface_h_ #define KeccakPermutationSize 1600 #define KeccakPermutationSizeInBytes (KeccakPermutationSize/8) void KeccakInitialize(void); void KeccakInitializeState(unsigned char *state); void KeccakPermutation(unsigned char *state); void KeccakAbsorb(unsigned char *state, const unsigned char *data, unsigned int laneCount); void KeccakExtract(const unsigned char *state, unsigned char *data, unsigned int laneCount); #endif
/* * Copyright (C) 2007, 2008, 2013, 2015 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. * 3. Neither the name of Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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. */ #pragma once #include "ExceptionOr.h" #include "SQLTransactionBackend.h" #include <wtf/Condition.h> #include <wtf/Lock.h> #include <wtf/Vector.h> namespace WebCore { // Can be used to wait until DatabaseTask is completed. // Has to be passed into DatabaseTask::create to be associated with the task. class DatabaseTaskSynchronizer { WTF_MAKE_NONCOPYABLE(DatabaseTaskSynchronizer); public: DatabaseTaskSynchronizer(); // Called from main thread to wait until task is completed. void waitForTaskCompletion(); // Called by the task. void taskCompleted(); #ifndef NDEBUG bool hasCheckedForTermination() const { return m_hasCheckedForTermination; } void setHasCheckedForTermination() { m_hasCheckedForTermination = true; } #endif private: bool m_taskCompleted { false }; Lock m_synchronousMutex; Condition m_synchronousCondition; #ifndef NDEBUG bool m_hasCheckedForTermination { false }; #endif }; class DatabaseTask { WTF_MAKE_FAST_ALLOCATED; public: virtual ~DatabaseTask(); void performTask(); Database& database() const { return m_database; } #if !ASSERT_DISABLED bool hasSynchronizer() const { return m_synchronizer; } bool hasCheckedForTermination() const { return m_synchronizer->hasCheckedForTermination(); } #endif protected: DatabaseTask(Database&, DatabaseTaskSynchronizer*); private: virtual void doPerformTask() = 0; Database& m_database; DatabaseTaskSynchronizer* m_synchronizer; #if !LOG_DISABLED virtual const char* debugTaskName() const = 0; #endif #if !ASSERT_DISABLED bool m_complete { false }; #endif }; class DatabaseOpenTask final : public DatabaseTask { public: DatabaseOpenTask(Database&, bool setVersionInNewDatabase, DatabaseTaskSynchronizer&, ExceptionOr<void>& result); private: void doPerformTask() final; #if !LOG_DISABLED const char* debugTaskName() const final; #endif bool m_setVersionInNewDatabase; ExceptionOr<void>& m_result; }; class DatabaseCloseTask final : public DatabaseTask { public: DatabaseCloseTask(Database&, DatabaseTaskSynchronizer&); private: void doPerformTask() final; #if !LOG_DISABLED const char* debugTaskName() const final; #endif }; class DatabaseTransactionTask final : public DatabaseTask { public: explicit DatabaseTransactionTask(RefPtr<SQLTransaction>&&); virtual ~DatabaseTransactionTask(); SQLTransaction* transaction() const { return m_transaction.get(); } private: void doPerformTask() final; #if !LOG_DISABLED const char* debugTaskName() const final; #endif RefPtr<SQLTransaction> m_transaction; bool m_didPerformTask; }; class DatabaseTableNamesTask final : public DatabaseTask { public: DatabaseTableNamesTask(Database&, DatabaseTaskSynchronizer&, Vector<String>& result); private: void doPerformTask() final; #if !LOG_DISABLED const char* debugTaskName() const override; #endif Vector<String>& m_result; }; } // namespace WebCore
/******************************************************************************* * File Name: SPI_1_ss_s.h * Version 2.10 * * Description: * This file contains the Alias definitions for Per-Pin APIs in cypins.h. * Information on using these APIs can be found in the System Reference Guide. * * Note: * ******************************************************************************** * Copyright 2008-2014, Cypress Semiconductor Corporation. All rights reserved. * You may use this file only in accordance with the license, terms, conditions, * disclaimers, and limitations in the end user license agreement accompanying * the software package with which this file was provided. *******************************************************************************/ #if !defined(CY_PINS_SPI_1_ss_s_ALIASES_H) /* Pins SPI_1_ss_s_ALIASES_H */ #define CY_PINS_SPI_1_ss_s_ALIASES_H #include "cytypes.h" #include "cyfitter.h" #include "cypins.h" /*************************************** * Constants ***************************************/ #define SPI_1_ss_s_0 (SPI_1_ss_s__0__PC) #define SPI_1_ss_s_0_PS (SPI_1_ss_s__0__PS) #define SPI_1_ss_s_0_PC (SPI_1_ss_s__0__PC) #define SPI_1_ss_s_0_DR (SPI_1_ss_s__0__DR) #define SPI_1_ss_s_0_SHIFT (SPI_1_ss_s__0__SHIFT) #endif /* End Pins SPI_1_ss_s_ALIASES_H */ /* [] END OF FILE */
#ifndef SD_MISC_H #define SD_MISC_H #ifdef __KERNEL__ #include <linux/bitops.h> #include <linux/mmc/host.h> #endif struct msdc_ioctl{ int opcode; int host_num; int iswrite; int trans_type; unsigned int total_size; unsigned int address; unsigned int* buffer; int cmd_pu_driving; int cmd_pd_driving; int dat_pu_driving; int dat_pd_driving; int clk_pu_driving; int clk_pd_driving; int clock_freq; int partition; int hopping_bit; int hopping_time; int result; }; /**************for msdc_ssc***********************/ #define AUDPLL_CTL_REG12 (0xF0007070) #define AUDPLL_CTL_REG01 (0xF00071E0) #define AUDPLL_CTL_REG02 (0xF100000C) #define AUDPLL_TSEL_MASK (1792) //MASK = 00000111 00000000 #define AUDPLL_TSEL_RESULT1 (0) //REG = 00000000 00000000 30.5us #define AUDPLL_TSEL_RESULT2 (256) //REG = 00000001 00000000 61.0us #define AUDPLL_TSEL_RESULT3 (512) //REG = 00000010 00000000 122.1us #define AUDPLL_TSEL_RESULT4 (768) //REG = 00000011 00000000 244.1us #define AUDPLL_TSEL_RESULT5 (1024) //REG = 00000100 00000000 448.3us #define AUDPLL_BSEL_MASK (7) //MASK = 00000000 00000111 #define AUDPLL_BSEL_RESULT0 (0) //REG = 00000000 00000000 REG init val #define AUDPLL_BSEL_RESULT1 (1) //REG = 00000000 00000001 2.26MHz #define AUDPLL_BSEL_RESULT2 (2) //REG = 00000000 00000010 4.52MHz #define AUDPLL_BSEL_RESULT3 (4) //REG = 00000000 00000100 9.04MHz #define SET_HOP_BIT_NONE (0) #define SET_HOP_BIT1 (1) #define SET_HOP_BIT2 (2) #define SET_HOP_BIT3 (3) #define SET_HOP_TIME0 (0) #define SET_HOP_TIME1 (1) #define SET_HOP_TIME2 (2) #define SET_HOP_TIME3 (3) #define SET_HOP_TIME4 (4) /**************for msdc_ssc***********************/ #define MSDC_DRIVING_SETTING (0) #define MSDC_CLOCK_FREQUENCY (1) #define MSDC_SINGLE_READ_WRITE (2) #define MSDC_MULTIPLE_READ_WRITE (3) #define MSDC_GET_CID (4) #define MSDC_GET_CSD (5) #define MSDC_GET_EXCSD (6) #define MSDC_ERASE_PARTITION (7) #define MSDC_HOPPING_SETTING (8) #ifdef MTK_SD_REINIT_SUPPORT #define MSDC_REINIT_SDCARD _IOW('r', 9, int) #endif #define MSDC_CARD_DUNM_FUNC (0xff) typedef enum { USER_PARTITION = 0, BOOT_PARTITION_1, BOOT_PARTITION_2, RPMB_PARTITION, GP_PARTITION_1, GP_PARTITION_2, GP_PARTITION_3, GP_PARTITION_4, }PARTITON_ACCESS_T; #endif /* end of SD_MISC_H */
/* msg_res_cmd.c * WiMax MAC Management RES-CMD Message decoder * * Copyright (c) 2007 by Intel Corporation. * * Author: Lu Pan <lu.pan@intel.com> * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1999 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* #define DEBUG // for debug only */ /* Include files */ #include "config.h" #include <glib.h> #include <epan/packet.h> #include "wimax_tlv.h" #include "wimax_mac.h" #include "wimax_utils.h" static gint proto_mac_mgmt_msg_res_cmd_decoder = -1; static gint ett_mac_mgmt_msg_res_cmd_decoder = -1; /* fix fields */ static gint hf_res_cmd_unknown_type = -1; static gint hf_res_cmd_invalid_tlv = -1; /* Wimax Mac RES-CMD Message Dissector */ static void dissect_mac_mgmt_msg_res_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint offset = 0; guint tvb_len; gint tlv_type, tlv_len, tlv_value_offset; proto_item *res_cmd_item; proto_tree *res_cmd_tree; proto_tree *tlv_tree = NULL; tlv_info_t tlv_info; { /* we are being asked for details */ /* Get the tvb reported length */ tvb_len = tvb_reported_length(tvb); /* display MAC payload type RES-CMD */ res_cmd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, -1, "Reset Command (RES-CMD)"); /* add MAC RES-CMD subtree */ res_cmd_tree = proto_item_add_subtree(res_cmd_item, ett_mac_mgmt_msg_res_cmd_decoder); /* Decode and display the Reset Command (RES-CMD) */ /* process the RES-CMD TLVs */ while(offset < tvb_len) { /* get the TLV information */ init_tlv_info(&tlv_info, tvb, offset); /* get the TLV type */ tlv_type = get_tlv_type(&tlv_info); /* get the TLV length */ tlv_len = get_tlv_length(&tlv_info); if(tlv_type == -1 || tlv_len > MAX_TLV_LEN || tlv_len < 1) { /* invalid tlv info */ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RES-CMD TLV error"); proto_tree_add_item(res_cmd_tree, hf_res_cmd_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA); break; } /* get the TLV value offset */ tlv_value_offset = get_tlv_value_offset(&tlv_info); #ifdef DEBUG /* for debug only */ proto_tree_add_protocol_format(res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "RES-CMD Type: %u (%u bytes, offset=%u, tlv_len=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tlv_len, tvb_len); #endif /* process RES-CMD TLV Encoded information */ switch (tlv_type) { case HMAC_TUPLE: /* Table 348d */ /* decode and display the HMAC Tuple */ tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tlv_len, "HMAC Tuple"); wimax_hmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len); break; case CMAC_TUPLE: /* Table 348b */ /* decode and display the CMAC Tuple */ tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tlv_len, "CMAC Tuple"); wimax_cmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len); break; default: /* display the unknown tlv in hex */ add_tlv_subtree(&tlv_info, res_cmd_tree, hf_res_cmd_unknown_type, tvb, offset, ENC_NA); break; } offset += (tlv_len+tlv_value_offset); } /* end of TLV process while loop */ } } /* Register Wimax Mac RES-CMD Message Dissector */ void proto_register_mac_mgmt_msg_res_cmd(void) { /* DSx display */ static hf_register_info hf_res_cmd[] = { { &hf_res_cmd_invalid_tlv, {"Invalid TLV", "wmx.res_cmd.invalid_tlv", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL} }, { &hf_res_cmd_unknown_type, {"Unknown TLV type", "wmx.res_cmd.unknown_tlv_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL} } }; /* Setup protocol subtree array */ static gint *ett_res_cmd[] = { &ett_mac_mgmt_msg_res_cmd_decoder, }; proto_mac_mgmt_msg_res_cmd_decoder = proto_register_protocol ( "WiMax RES-CMD Message", /* name */ "WiMax RES-CMD (res)", /* short name */ "wmx.res" /* abbrev */ ); proto_register_field_array(proto_mac_mgmt_msg_res_cmd_decoder, hf_res_cmd, array_length(hf_res_cmd)); proto_register_subtree_array(ett_res_cmd, array_length(ett_res_cmd)); } void proto_reg_handoff_mac_mgmt_msg_res_cmd(void) { dissector_handle_t handle; handle = create_dissector_handle(dissect_mac_mgmt_msg_res_cmd_decoder, proto_mac_mgmt_msg_res_cmd_decoder); dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_RES_CMD, handle); }
/* crypto/evp/m_mdc2.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #ifndef OPENSSL_NO_MDC2 #include <stdio.h> #include "cryptlib.h" #include <openssl/evp.h> #include "evp_locl.h" #include <openssl/objects.h> #include <openssl/x509.h> #include <openssl/mdc2.h> static int init(EVP_MD_CTX *ctx) { return MDC2_Init(ctx->md_data); } static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) { return MDC2_Update(ctx->md_data,data,count); } static int final(EVP_MD_CTX *ctx,unsigned char *md) { return MDC2_Final(md,ctx->md_data); } static const EVP_MD mdc2_md= { NID_mdc2, NID_mdc2WithRSA, MDC2_DIGEST_LENGTH, 0, init, update, final, NULL, NULL, EVP_PKEY_RSA_ASN1_OCTET_STRING_method, MDC2_BLOCK, sizeof(EVP_MD *)+sizeof(MDC2_CTX), }; const EVP_MD *EVP_mdc2(void) { return(&mdc2_md); } #endif
#include "cg_local.h" void qlua_HandleMessage() { if(GetClientLuaState() != NULL) { int data = trap_N_ReadByte(); qlua_gethook(GetClientLuaState(),"_HandleMessage"); lua_pushinteger(GetClientLuaState(),data); qlua_pcall(GetClientLuaState(),1,0,qtrue); } } int qlua_readbyte(lua_State *L) { lua_pushinteger(L,trap_N_ReadByte()); return 1; } int qlua_readshort(lua_State *L) { lua_pushinteger(L,trap_N_ReadShort()); return 1; } int qlua_readlong(lua_State *L) { lua_pushinteger(L,trap_N_ReadLong()); return 1; } int qlua_readstring(lua_State *L) { char *str = trap_N_ReadString(); lua_pushstring(L,str); return 1; } int qlua_readfloat(lua_State *L) { lua_pushnumber(L,trap_N_ReadFloat()); return 1; } int qlua_readbits(lua_State *L) { int n = lua_tointeger(L,1); lua_pushnumber(L,trap_N_ReadBits(n)); return 1; } static const luaL_reg Message_methods[] = { {"ReadByte", qlua_readbyte}, {"ReadShort", qlua_readshort}, {"ReadLong", qlua_readlong}, {"ReadString", qlua_readstring}, {"ReadFloat", qlua_readfloat}, {"ReadBits", qlua_readbits}, {0,0} }; void CG_InitLuaMessages(lua_State *L) { luaL_openlib(L, "_message", Message_methods, 0); }
/* Kernel module to match AH parameters. */ /* (C) 2001-2002 Andras Kis-Szabo <kisza@sch.bme.hu> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/skbuff.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/types.h> #include <net/checksum.h> #include <net/ipv6.h> #include <linux/netfilter/x_tables.h> #include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter_ipv6/ip6t_ah.h> MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Xtables: IPv6 IPsec-AH match"); MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); /* Returns 1 if the spi is matched by the range, 0 otherwise */ static inline bool spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert) { bool r; pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n", invert ? '!' : ' ', min, spi, max); r = (spi >= min && spi <= max) ^ invert; pr_debug(" result %s\n", r ? "PASS" : "FAILED"); return r; } static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par) { struct ip_auth_hdr _ah; const struct ip_auth_hdr *ah; const struct ip6t_ah *ahinfo = par->matchinfo; unsigned int ptr; unsigned int hdrlen = 0; int err; err = ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL); if (err < 0) { if (err != -ENOENT) par->hotdrop = true; return false; } ah = skb_header_pointer(skb, ptr, sizeof(_ah), &_ah); if (ah == NULL) { par->hotdrop = true; return false; } hdrlen = (ah->hdrlen + 2) << 2; pr_debug("IPv6 AH LEN %u %u ", hdrlen, ah->hdrlen); pr_debug("RES %04X ", ah->reserved); pr_debug("SPI %u %08X\n", ntohl(ah->spi), ntohl(ah->spi)); pr_debug("IPv6 AH spi %02X ", spi_match(ahinfo->spis[0], ahinfo->spis[1], ntohl(ah->spi), !!(ahinfo->invflags & IP6T_AH_INV_SPI))); pr_debug("len %02X %04X %02X ", ahinfo->hdrlen, hdrlen, (!ahinfo->hdrlen || (ahinfo->hdrlen == hdrlen) ^ !!(ahinfo->invflags & IP6T_AH_INV_LEN))); pr_debug("res %02X %04X %02X\n", ahinfo->hdrres, ah->reserved, !(ahinfo->hdrres && ah->reserved)); return (ah != NULL) && spi_match(ahinfo->spis[0], ahinfo->spis[1], ntohl(ah->spi), !!(ahinfo->invflags & IP6T_AH_INV_SPI)) && (!ahinfo->hdrlen || (ahinfo->hdrlen == hdrlen) ^ !!(ahinfo->invflags & IP6T_AH_INV_LEN)) && !(ahinfo->hdrres && ah->reserved); } static int ah_mt6_check(const struct xt_mtchk_param *par) { const struct ip6t_ah *ahinfo = par->matchinfo; if (ahinfo->invflags & ~IP6T_AH_INV_MASK) { pr_debug("unknown flags %X\n", ahinfo->invflags); return -EINVAL; } return 0; } static struct xt_match ah_mt6_reg __read_mostly = { .name = "ah", .family = NFPROTO_IPV6, .match = ah_mt6, .matchsize = sizeof(struct ip6t_ah), .checkentry = ah_mt6_check, .me = THIS_MODULE, }; static int __init ah_mt6_init(void) { return xt_register_match(&ah_mt6_reg); } static void __exit ah_mt6_exit(void) { xt_unregister_match(&ah_mt6_reg); } module_init(ah_mt6_init); module_exit(ah_mt6_exit);
/* ********************************************************************************************************* * uC/GUI * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : SCROLLBAR_Create.c Purpose : Implementation of scrollbar widget ---------------------------END-OF-HEADER------------------------------ */ #include "SCROLLBAR.h" #if GUI_WINSUPPORT /********************************************************************* * * Exported routines * ********************************************************************** */ /********************************************************************* * * SCROLLBAR_Create */ SCROLLBAR_Handle SCROLLBAR_Create (int x0, int y0, int xsize, int ysize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags) { return SCROLLBAR_CreateEx(x0, y0, xsize, ysize, hParent, WinFlags, SpecialFlags, Id); } /********************************************************************* * * SCROLLBAR_CreateAttached */ SCROLLBAR_Handle SCROLLBAR_CreateAttached(WM_HWIN hParent, int SpecialFlags) { SCROLLBAR_Handle hThis; int Id; int WinFlags; if (SpecialFlags & SCROLLBAR_CF_VERTICAL) { Id = GUI_ID_VSCROLL; WinFlags = WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_ANCHOR_RIGHT | WM_CF_ANCHOR_TOP | WM_CF_ANCHOR_BOTTOM; } else { Id = GUI_ID_HSCROLL; WinFlags = WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_ANCHOR_BOTTOM | WM_CF_ANCHOR_LEFT | WM_CF_ANCHOR_RIGHT; } hThis = SCROLLBAR_CreateEx(0, 0, 0, 0, hParent, WinFlags, SpecialFlags, Id); WM_NotifyParent(hThis, WM_NOTIFICATION_SCROLLBAR_ADDED); return hThis; } #else /* avoid empty object files */ void SCROLLBAR_Create_C(void) {} #endif
// // SPCA506Driver.h // macam // // Created by Harald on 11/14/07. // Copyright 2007 HXR. All rights reserved. // #import <SPCA505Driver.h> @interface SPCA506Driver : SPCA505Driver { } @end @interface SPCA506ADriver : SPCA506Driver { } @end
#include "zebra.h" #include "command.h" #include "log.h" #include "zclient.h" struct zclient *zclient = NULL; /* Zebra route add and delete treatment. */ int mplsadmd_zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length) { if (command == ZEBRA_IPV4_ROUTE_ADD) zlog_info ("ADD"); else zlog_info ("DEL"); return 0; } /* Zebra node structure. */ struct cmd_node zebra_node = { ZEBRA_NODE, "%s(config-router)# ", }; /* MPLSADMD configuration write function. */ int config_write_zebra (struct vty *vty) { if (! zclient->enable) { vty_out (vty, "no router zebra%s", VTY_NEWLINE); return 1; } return 0; } DEFUN ( router_zebra, router_zebra_cmd, "router zebra", "Enable a routing process\n" "Make connection to zebra daemon\n") { vty->node = ZEBRA_NODE; zclient->enable = 1; zclient_start (zclient); return CMD_SUCCESS; } DEFUN ( no_router_zebra, no_router_zebra_cmd, "no router zebra", NO_STR "Enable a routing process\n" "Make connection to zebra daemon\n") { zclient->enable = 0; zclient_stop (zclient); return CMD_SUCCESS; } void mplsadmd_zclient_init(void) { /* Set default value to the zebra client structure. */ zclient = zclient_new (); zclient_init (zclient, ZEBRA_ROUTE_MPLSADMD); zclient->ipv4_route_add = mplsadmd_zebra_read_ipv4; zclient->ipv4_route_delete = mplsadmd_zebra_read_ipv4; /* Install zebra node. */ install_node (&zebra_node, config_write_zebra); /* Install command elements to zebra node. */ install_element (CONFIG_NODE, &router_zebra_cmd); install_element (CONFIG_NODE, &no_router_zebra_cmd); install_default (ZEBRA_NODE); }
/* * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 MediaSessionManager_h #define MediaSessionManager_h #include "MediaSession.h" #include "Settings.h" #include <map> #include <wtf/Vector.h> namespace WebCore { class HTMLMediaElement; class MediaSession; class MediaSessionManager { public: static MediaSessionManager& sharedManager(); virtual ~MediaSessionManager() { } bool has(MediaSession::MediaType) const; int count(MediaSession::MediaType) const; void beginInterruption(); void endInterruption(MediaSession::EndInterruptionFlags); void applicationWillEnterForeground() const; void applicationWillEnterBackground() const; enum SessionRestrictionFlags { NoRestrictions = 0, ConcurrentPlaybackNotPermitted = 1 << 0, InlineVideoPlaybackRestricted = 1 << 1, MetadataPreloadingNotPermitted = 1 << 2, AutoPreloadingNotPermitted = 1 << 3, BackgroundPlaybackNotPermitted = 1 << 4, }; typedef unsigned SessionRestrictions; void addRestriction(MediaSession::MediaType, SessionRestrictions); void removeRestriction(MediaSession::MediaType, SessionRestrictions); SessionRestrictions restrictions(MediaSession::MediaType); virtual void resetRestrictions(); void sessionWillBeginPlayback(const MediaSession&) const; bool sessionRestrictsInlineVideoPlayback(const MediaSession&) const; protected: friend class MediaSession; explicit MediaSessionManager(); void addSession(MediaSession&); void removeSession(MediaSession&); private: void updateSessionState(); SessionRestrictions m_restrictions[MediaSession::WebAudio + 1]; Vector<MediaSession*> m_sessions; bool m_interrupted; }; } #endif // MediaSessionManager_h
/* * Copyright (c) 2012, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or 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 THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR 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. */ #if !defined( __WLAN_QCT_PAL_TYPE_H ) #define __WLAN_QCT_PAL_TYPE_H /**========================================================================= \file wlan_qct_pal_type.h \brief define basic types PAL exports. wpt = (Wlan Pal Type) Definitions for platform independent. Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. Qualcomm Confidential and Proprietary. ========================================================================*/ #include "wlan_qct_os_type.h" typedef wpt_uint8 wpt_macAddr[6]; enum { eWLAN_PAL_FALSE = 0, eWLAN_PAL_TRUE = 1, }; typedef enum { eWLAN_MODULE_DAL, eWLAN_MODULE_DAL_CTRL, eWLAN_MODULE_DAL_DATA, eWLAN_MODULE_PAL, // eWLAN_MODULE_COUNT } wpt_moduleid; typedef struct { // // #ifndef WLAN_PAL_BIG_ENDIAN_BIT wpt_byte protVer :2; wpt_byte type :2; wpt_byte subType :4; wpt_byte toDS :1; wpt_byte fromDS :1; wpt_byte moreFrag :1; wpt_byte retry :1; wpt_byte powerMgmt :1; wpt_byte moreData :1; wpt_byte wep :1; wpt_byte order :1; #else wpt_byte subType :4; wpt_byte type :2; wpt_byte protVer :2; wpt_byte order :1; wpt_byte wep :1; wpt_byte moreData :1; wpt_byte powerMgmt :1; wpt_byte retry :1; wpt_byte moreFrag :1; wpt_byte fromDS :1; wpt_byte toDS :1; #endif } wpt_FrameCtrl; typedef struct { /* */ wpt_FrameCtrl frameCtrl; /* */ wpt_uint16 usDurationId; /* */ wpt_macAddr vA1; /* */ wpt_macAddr vA2; /* */ wpt_macAddr vA3; /* */ wpt_uint16 sSeqCtrl; /* */ wpt_macAddr optvA4; /* */ wpt_uint16 usQosCtrl; }wpt_80211Header; typedef struct { wpt_macAddr dest; wpt_macAddr sec; wpt_uint16 lenOrType; } wpt_8023Header; #endif //
/* linux/drivers/modem/modem.c * * Copyright (C) 2010 Google, Inc. * Copyright (C) 2010 Samsung Electronics. * * 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/init.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/miscdevice.h> #include <linux/uaccess.h> #include <linux/fs.h> #include <linux/io.h> #include <linux/wait.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/mutex.h> #include <linux/irq.h> #include <linux/gpio.h> #include <linux/delay.h> #include <linux/wakelock.h> #include <linux/platform_data/modem.h> #include "modem_prj.h" #include "modem_variation.h" static struct modem_ctl *create_modemctl_device(struct platform_device *pdev) { int ret = 0; struct modem_data *pdata; struct modem_ctl *modemctl; struct device *dev = &pdev->dev; /* create modem control device */ modemctl = kzalloc(sizeof(struct modem_ctl), GFP_KERNEL); if (!modemctl) return NULL; modemctl->dev = dev; modemctl->phone_state = STATE_OFFLINE; pdata = pdev->dev.platform_data; modemctl->name = pdata->name; /* init modemctl device for getting modemctl operations */ ret = call_modem_init_func(modemctl, pdata); if (ret) { printk(KERN_ERR "[MODEM_IF] call_modem_init_func is failed\n"); kfree(modemctl); return NULL; } pr_debug("[MODEM_IF] %s:create_modemctl_device DONE\n", modemctl->name); return modemctl; } static struct io_device *create_io_device(struct modem_io_t *io_t, struct modem_ctl *modemctl, enum modem_network modem_net) { int ret = 0; struct io_device *iod = NULL; iod = kzalloc(sizeof(struct io_device), GFP_KERNEL); if (!iod) { pr_err("[MODEM_IF] io device memory alloc fail\n"); return NULL; } iod->name = io_t->name; iod->id = io_t->id; iod->format = io_t->format; iod->io_typ = io_t->io_type; iod->net_typ = modem_net; /* link between io device and modem control */ iod->mc = modemctl; if (iod->format == IPC_FMT) modemctl->iod = iod; /* register misc device or net device */ ret = init_io_device(iod); if (ret) { kfree(iod); return NULL; } pr_debug("[MODEM_IF] %s : create_io_device DONE\n", io_t->name); return iod; } static int __devinit modem_probe(struct platform_device *pdev) { int i; struct modem_data *pdata; struct modem_ctl *modemctl; struct io_device *iod[MAX_NUM_IO_DEV]; struct link_device *ld; struct io_raw_devices *io_raw_devs = NULL; pdata = pdev->dev.platform_data; memset(iod, 0, sizeof(iod)); modemctl = create_modemctl_device(pdev); if (!modemctl) { printk(KERN_ERR "[MODEM_IF] modemctl is null\n"); return -ENOMEM; } /* create link device */ ld = call_link_init_func(pdev, pdata->link_types); if (!ld) goto err_free_modemctl; io_raw_devs = kzalloc(sizeof(struct io_raw_devices), GFP_KERNEL); if (!io_raw_devs) { printk(KERN_ERR "[MODEM_IF] io_raw_devs is null\n"); return -ENOMEM; } /* create io deivces and connect to modemctl device */ for (i = 0; i < pdata->num_iodevs; i++) { iod[i] = create_io_device(&pdata->iodevs[i], modemctl, pdata->modem_net); if (!iod[i]) goto err_free_modemctl; if (iod[i]->format == IPC_RAW) { int ch = iod[i]->id & 0x1F; io_raw_devs->raw_devices[ch] = iod[i]; io_raw_devs->num_of_raw_devs++; iod[i]->link = ld; } else { /* connect io devices to one link device */ ld->attach(ld, iod[i]); } if (iod[i]->format == IPC_MULTI_RAW) iod[i]->private_data = (void *)io_raw_devs; } platform_set_drvdata(pdev, modemctl); pr_debug("[MODEM_IF] modem_probe DONE\n"); return 0; err_free_modemctl: for (i = 0; i < pdata->num_iodevs; i++) if (iod[i] != NULL) kfree(iod[i]); if (io_raw_devs != NULL) kfree(io_raw_devs); if (modemctl != NULL) kfree(modemctl); return -ENOMEM; } static void modem_shutdown(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct modem_ctl *mc = dev_get_drvdata(dev); if (!mc) return; free_irq(mc->irq_phone_active, mc); if (mc->ops.modem_off) mc->ops.modem_off(mc); } static int modem_suspend(struct device *pdev) { struct modem_ctl *mc = dev_get_drvdata(pdev); gpio_set_value(mc->gpio_pda_active, 0); return 0; } static int modem_resume(struct device *pdev) { struct modem_ctl *mc = dev_get_drvdata(pdev); gpio_set_value(mc->gpio_pda_active, 1); return 0; } static const struct dev_pm_ops modem_pm_ops = { .suspend = modem_suspend, .resume = modem_resume, }; static struct platform_driver modem_driver = { .probe = modem_probe, .shutdown = modem_shutdown, .driver = { .name = "modem_if", .pm = &modem_pm_ops, }, }; static int __init modem_init(void) { return platform_driver_register(&modem_driver); } module_init(modem_init); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Samsung Modem Interface Driver");
/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: bing.wei.liu REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * Test that pthread_mutexattr_setprotocol() * * Sets the protocol attribute of a mutexattr object (which was prev. created * by the function pthread_mutexattr_init()). * * Steps: * 1. In a for loop, call pthread_mutexattr_setprotocol with all the valid 'protocol' values. * 2. In the for loop, then call pthread_mutexattr_getprotocol and ensure that the same * value that was set was the same value that was retrieved from this function. */ #include <pthread.h> #include <stdio.h> #include <sched.h> #include "posixtest.h" int main() { pthread_mutexattr_t mta; int protocol, protcls[3],i; /* Initialize a mutex attributes object */ if(pthread_mutexattr_init(&mta) != 0) { perror("Error at pthread_mutexattr_init()\n"); return PTS_UNRESOLVED; } protcls[0]=PTHREAD_PRIO_NONE; protcls[1]=PTHREAD_PRIO_INHERIT; protcls[2]=PTHREAD_PRIO_PROTECT; for(i=0;i<3;i++) { /* Set the protocol to one of the 3 valid protocols. */ if(pthread_mutexattr_setprotocol(&mta,protcls[i]) != 0) { printf("Error setting protocol to %d\n", protcls[i]); return PTS_UNRESOLVED; } /* Get the protocol mutex attr. */ if(pthread_mutexattr_getprotocol(&mta, &protocol) != 0) { fprintf(stderr,"Error obtaining the protocol attribute.\n"); return PTS_UNRESOLVED; } /* Make sure that the protocol set is the protocl we get when calling * pthread_mutexattr_getprocol() */ if(protocol != protcls[i]) { printf("Test FAILED: Set protocol %d, but instead got protocol %d.\n", protcls[i], protocol); return PTS_FAIL; } } printf("Test PASSED\n"); return PTS_PASS; }
/* * Musepack decoder * Copyright (c) 2006 Konstantin Shishkov * * This file is part of Libav. * * Libav is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * Libav 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 Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_MPCDATA_H #define AVCODEC_MPCDATA_H static const float mpc_CC[18] = { 65536.0000, 21845.3333, 13107.2000, 9362.2857, 7281.7778, 4369.0667, 2114.0645, 1040.2539, 516.0315, 257.0039, 128.2505, 64.0626, 32.0156, 16.0039, 8.0010, 4.0002, 2.0001, 1.0000 }; static const float mpc_SCF[128] = { 307.330047607421875000, 255.999984741210937500, 213.243041992187500000, 177.627334594726562500, 147.960128784179687500, 123.247924804687500000, 102.663139343261718750, 85.516410827636718750, 71.233520507812500000, 59.336143493652343750, 49.425861358642578125, 41.170787811279296875, 34.294471740722656250, 28.566631317138671875, 23.795452117919921875, 19.821151733398437500, 16.510635375976562500, 13.753040313720703125, 11.456016540527343750, 9.542640686035156250, 7.948835372924804688, 6.621226310729980469, 5.515353679656982422, 4.594182968139648438, 3.826865673065185547, 3.187705039978027344, 2.655296564102172852, 2.211810588836669922, 1.842395424842834473, 1.534679770469665527, 1.278358578681945801, 1.064847946166992188, 0.886997759342193604, 0.738851964473724365, 0.615449428558349609, 0.512657463550567627, 0.427033752202987671, 0.355710864067077637, 0.296300262212753296, 0.246812388300895691, 0.205589950084686279, 0.171252459287643433, 0.142649993300437927, 0.118824683129787445, 0.098978661000728607, 0.082447312772274017, 0.068677015602588654, 0.057206626981496811, 0.047652013599872589, 0.039693206548690796, 0.033063672482967377, 0.027541399002075195, 0.022941453382372856, 0.019109787419438362, 0.015918083488941193, 0.013259455561637878, 0.011044870130717754, 0.009200163185596466, 0.007663558237254620, 0.006383595988154411, 0.005317411851137877, 0.004429301247000694, 0.003689522389322519, 0.003073300700634718, 0.002560000168159604, 0.002132430672645569, 0.001776273478753865, 0.001479601487517357, 0.001232479466125369, 0.001026631565764546, 0.000855164253152907, 0.000712335284333676, 0.000593361502978951, 0.000494258652906865, 0.000411707907915115, 0.000342944724252447, 0.000285666319541633, 0.000237954518524930, 0.000198211506358348, 0.000165106350323185, 0.000137530398205854, 0.000114560163638089, 0.000095426403277088, 0.000079488345363643, 0.000066212254751008, 0.000055153526773211, 0.000045941822463647, 0.000038268648495432, 0.000031877043511486, 0.000026552961571724, 0.000022118103515822, 0.000018423952496960, 0.000015346795407822, 0.000012783583770215, 0.000010648477655195, 0.000008869976227288, 0.000007388518497464, 0.000006154492893984, 0.000005126573796588, 0.000004270336830814, 0.000003557107902452, 0.000002963002089018, 0.000002468123511790, 0.000002055899130937, 0.000001712524181130, 0.000001426499579793, 0.000001188246528727, 0.000000989786371974, 0.000000824472920158, 0.000000686770022185, 0.000000572066142013, 0.000000476520028769, 0.000000396931966407, 0.000000330636652279, 0.000000275413924555, 0.000000229414467867, 0.000000191097811353, 0.000000159180785886, 0.000000132594522029, 0.000000110448674207, 0.000000092001613439, 0.000000076635565449, 0.000000063835940978, 0.000000053174105119, 0.000000044293003043, 0.000000036895215771, 0.000000030733001921, 0.000000025599996789 }; #endif /* AVCODEC_MPCDATA_H */
/* $Id: main_mod.c 2394 2008-12-23 17:27:53Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "test.h" #include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk(KERN_INFO "PJLIB test module loaded. Starting tests...\n"); test_main(); /* Prevent module from loading. We've finished test anyway.. */ return 1; } void cleanup_module(void) { printk(KERN_INFO "PJLIB test module unloading...\n"); } MODULE_LICENSE("GPL");
/*************************************************************************** qgsxyzconnectiondialog.h --------------------- begin : February 2017 copyright : (C) 2017 by Martin Dobias email : wonder dot sk at gmail dot com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSXYZCONNECTIONDIALOG_H #define QGSXYZCONNECTIONDIALOG_H #include <QDialog> #include "ui_qgsxyzconnectiondialog.h" struct QgsXyzConnection; class QgsXyzConnectionDialog : public QDialog, public Ui::QgsXyzConnectionDialog { Q_OBJECT public: explicit QgsXyzConnectionDialog( QWidget *parent = 0 ); void setConnection( const QgsXyzConnection &conn ); QgsXyzConnection connection() const; }; #endif // QGSXYZCONNECTIONDIALOG_H
// // PhongMaterial.h // TestApp // // Created by Juan Roberto Cabral Flores on 8/5/12. // Copyright (c) 2012 Juan Roberto Cabral Flores. All rights reserved. // #ifndef __TestApp__PhongMaterial__ #define __TestApp__PhongMaterial__ #include <iostream> #include <PlastilinaCore/Color.h> #include <PlastilinaCore/Material.h> #include <PlastilinaCore/opengl/OpenGL.h> #include <PlastilinaCore/opengl/Sampler.h> #include <PlastilinaCore/opengl/Texture.h> class DLLEXPORT PhongMaterial : public Material { public: PhongMaterial(); virtual ~PhongMaterial(); virtual void load(); virtual void unload(); virtual void setup(const std::shared_ptr<SceneNode>& doc); virtual void setup(const std::shared_ptr<const SceneNode>& doc); /** * Exponent used for phong lighting model */ float exponent() const; /** * Set the exponent for Phong lighting model */ void setExponent(float exp); /** * Returns the color of the specular component used in shading color * computation. */ Color specular() const; /** * Sets the color used for specular component used for shading color * computation. */ void setSpecular(const Color& c); /** * Returns the diffuse color component used in shading color computation. */ Color diffuse() const; /** * Sets the diffuse color used for shading color computation. */ void setDiffuse(const Color& c); /** * Returns the diffuse color component used in shading color computation. */ Color ambient() const; /** * Sets the diffuse color used for shading color computation. */ void setAmbient(const Color& c); /** * Returns the texture used for diffuse color. */ gl::Texture2D::shared_ptr diffuseTexture(); /** * Sets the texture to use for diffuse color. * if set to null, the material will use the regular diffuse color. */ void setDiffuseTexture(gl::Texture2D::shared_ptr& text); private: struct Impl; std::unique_ptr<Impl> d; }; #endif /* defined(__TestApp__PhongMaterial__) */
#ifndef _DLCOUNT_H #define _DLCOUNT_H /* $Id: dlcount.h,v 1.1 2005/08/11 15:14:27 mbse Exp $ */ void dlcount(void); #endif
/** * @file * Test code for mutt_list_insert_tail() * * @authors * Copyright (C) 2019 Richard Russon <rich@flatcap.org> * * @copyright * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ #define TEST_NO_MAIN #include "config.h" #include "acutest.h" #include "mutt/lib.h" #include "common.h" void test_mutt_list_insert_tail(void) { // struct ListNode *mutt_list_insert_tail(struct ListHead *h, char *s); { TEST_CHECK(!mutt_list_insert_tail(NULL, "apple")); } { struct ListHead listhead = STAILQ_HEAD_INITIALIZER(listhead); struct ListNode *newnode = NULL; TEST_CHECK((newnode = mutt_list_insert_tail(&listhead, NULL)) != NULL); FREE(&newnode); } { static const char *expected_names[] = { "Zelda", NULL }; char *insert = "Zelda"; struct ListHead start = STAILQ_HEAD_INITIALIZER(start); struct ListHead expected = test_list_create(expected_names, false); TEST_CHECK(mutt_list_insert_tail(&start, insert) != NULL); TEST_CHECK(mutt_list_compare(&start, &expected) == true); mutt_list_clear(&start); mutt_list_clear(&expected); } { static const char *start_names[] = { "Amy", "Beth", "Cathy", NULL }; static const char *expected_names[] = { "Amy", "Beth", "Cathy", "Zelda", NULL }; char *insert = "Zelda"; struct ListHead start = test_list_create(start_names, false); struct ListHead expected = test_list_create(expected_names, false); TEST_CHECK(mutt_list_insert_tail(&start, insert) != NULL); TEST_CHECK(mutt_list_compare(&start, &expected) == true); mutt_list_clear(&start); mutt_list_clear(&expected); } }
#ifndef FSEMU_FADE_H_ #define FSEMU_FADE_H_ #include <stdint.h> #include "fsemu-common.h" #ifdef __cplusplus extern "C" { #endif void fsemu_fade_init(void); void fsemu_fade_update(void); void fsemu_fade_set_color(uint32_t color); #if 0 void fsemu_fade_force(bool force); #endif #ifdef FSEMU_INTERNAL #define fsemu_fade_log(format, ...) \ fsemu_log("[FSE] [FAD] " format, ##__VA_ARGS__) #endif // FSEMU_INTERNAL #ifdef __cplusplus } #endif #endif // FSEMU_FADE_H_
// Copyright: CC0 #include <stdio.h> #include <math.h> #include <glib.h> #include <glib/gstdio.h> #include "geotag_exif.h" #include "vikcoord.h" int main(int argc, char *argv[]) { #if !GLIB_CHECK_VERSION(2,36,0) g_type_init (); #endif int answer = 0; if ( argv[1] ) { struct LatLon ll = { 51.179489, -1.826217 }; VikCoord vc; vik_coord_load_from_latlon ( &vc, VIK_COORD_LATLON, &ll ); // NB sqrt(-1) is delibrate to generate a NaN value // (so no image direction EXIF tags are generated) answer = a_geotag_write_exif_gps ( argv[1], vc, 0.0, sqrt(-1), WP_IMAGE_DIRECTION_REF_TRUE, TRUE ); } return answer; }
#ifndef __IMX_CLK_H #define __IMX_CLK_H struct clk *clk_gate2(const char *name, const char *parent, void __iomem *reg, u8 shift); static inline struct clk *imx_clk_divider(const char *name, const char *parent, void __iomem *reg, u8 shift, u8 width) { return clk_divider(name, parent, reg, shift, width, CLK_SET_RATE_PARENT); } static inline struct clk *imx_clk_divider_np(const char *name, const char *parent, void __iomem *reg, u8 shift, u8 width) { return clk_divider(name, parent, reg, shift, width, 0); } static inline struct clk *imx_clk_divider_table(const char *name, const char *parent, void __iomem *reg, u8 shift, u8 width, const struct clk_div_table *table) { return clk_divider_table(name, parent, reg, shift, width, table, CLK_SET_RATE_PARENT); } static inline struct clk *imx_clk_fixed_factor(const char *name, const char *parent, unsigned int mult, unsigned int div) { return clk_fixed_factor(name, parent, mult, div, CLK_SET_RATE_PARENT); } static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, u8 shift, u8 width, const char **parents, u8 num_parents) { return clk_mux(name, reg, shift, width, parents, num_parents, 0); } static inline struct clk *imx_clk_mux_p(const char *name, void __iomem *reg, u8 shift, u8 width, const char **parents, u8 num_parents) { return clk_mux(name, reg, shift, width, parents, num_parents, CLK_SET_RATE_PARENT); } static inline struct clk *imx_clk_gate(const char *name, const char *parent, void __iomem *reg, u8 shift) { return clk_gate(name, parent, reg, shift, CLK_SET_RATE_PARENT, 0); } static inline struct clk *imx_clk_gate2(const char *name, const char *parent, void __iomem *reg, u8 shift) { return clk_gate2(name, parent, reg, shift); } struct clk *imx_clk_pllv1(const char *name, const char *parent, void __iomem *base); struct clk *imx_clk_pllv2(const char *name, const char *parent, void __iomem *base); enum imx_pllv3_type { IMX_PLLV3_GENERIC, IMX_PLLV3_SYS, IMX_PLLV3_USB, IMX_PLLV3_AV, IMX_PLLV3_ENET, IMX_PLLV3_MLB, }; struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, const char *parent, void __iomem *base, u32 div_mask); struct clk *imx_clk_pfd(const char *name, const char *parent, void __iomem *reg, u8 idx); static inline struct clk *imx_clk_busy_divider(const char *name, const char *parent, void __iomem *reg, u8 shift, u8 width, void __iomem *busy_reg, u8 busy_shift) { /* * For now we do not support rate setting, so just fall back to * regular divider. */ return imx_clk_divider(name, parent, reg, shift, width); } static inline struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift, u8 width, void __iomem *busy_reg, u8 busy_shift, const char **parents, int num_parents) { /* * For now we do not support mux switching, so just fall back to * regular mux. */ return imx_clk_mux(name, reg, shift, width, parents, num_parents); } struct clk *imx_clk_gate_exclusive(const char *name, const char *parent, void __iomem *reg, u8 shift, u32 exclusive_mask); #endif /* __IMX_CLK_H */
/* ********************************************************************************************************* * uC/GUI * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : FRAMEWIN.c Purpose : FRAMEWIN_SetBorderSize ---------------------------END-OF-HEADER------------------------------ */ #include "FRAMEWIN_Private.h" #include "WIDGET.h" #if GUI_WINSUPPORT /********************************************************************* * * Exported code * ********************************************************************** */ /********************************************************************* * * FRAMEWIN_SetBorderSize */ void FRAMEWIN_SetBorderSize(FRAMEWIN_Handle hObj, unsigned Size) { GUI_LOCK(); if (hObj) { GUI_RECT r; WM_Obj * pChild; int Diff, OldSize, OldHeight; WM_HWIN hChild; FRAMEWIN_Obj* pObj = FRAMEWIN_H2P(hObj); OldHeight = FRAMEWIN__CalcTitleHeight(pObj); OldSize = pObj->Props.BorderSize; Diff = Size - OldSize; for (hChild = pObj->Widget.Win.hFirstChild; hChild; hChild = pChild->hNext) { pChild = WM_H2P(hChild); r = pChild->Rect; GUI_MoveRect(&r, -pObj->Widget.Win.Rect.x0, -pObj->Widget.Win.Rect.y0); if ((r.y0 == pObj->Props.BorderSize) && ((r.y1 - r.y0 + 1) == OldHeight)) { if (pChild->Status & WM_SF_ANCHOR_RIGHT) { WM_MoveWindow(hChild, -Diff, Diff); } else { WM_MoveWindow(hChild, Diff, Diff); } } } pObj->Props.BorderSize = Size; FRAMEWIN__UpdatePositions(pObj); FRAMEWIN_Invalidate(hObj); } GUI_UNLOCK(); } #else void FRAMEWIN_SetBorderSize_C(void) {} /* avoid empty object files */ #endif /* GUI_WINSUPPORT */
/**************************************************************************** ** $Id: qt/qlined.h 3.3.8 edited Jan 11 14:46 $ ** ** Compatibility file - should only be included by legacy code. ** It #includes the file which obsoletes this one. ** ** Copyright (C) 1998-2007 Trolltech ASA. All rights reserved. ** This file is part of the Qt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech ASA of Norway and appearing in the file ** LICENSE.QPL included in the packaging of this file. ** ** Licensees holding valid Qt Professional Edition licenses may use this ** file in accordance with the Qt Professional Edition License Agreement ** provided with the Qt Professional Edition. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for ** information about the Professional Edition licensing, or see ** http://www.trolltech.com/qpl/ for QPL licensing information. ** *****************************************************************************/ #ifndef QLINED_H #define QLINED_H #include "qlineedit.h" #endif
/* SPDX-License-Identifier: GPL-2.0-only */ #include <assert.h> #include <commonlib/bsd/bcd.h> #include <console/console.h> #include <delay.h> #include <device/i2c_simple.h> #include <rtc.h> #include <soc/rk808.h> #include <stdint.h> #if CONFIG_PMIC_BUS < 0 #error "PMIC_BUS must be set in mainboard's Kconfig." #endif #define RK808_ADDR 0x1b #define DCDC_EN 0x23 #define LDO_EN 0x24 #define BUCK1SEL 0x2f #define BUCK4SEL 0x38 #define LDO_ONSEL(i) (0x39 + 2 * i) #define LDO_SLPSEL(i) (0x3a + 2 * i) #define RTC_SECOND 0x00 #define RTC_MINUTE 0x01 #define RTC_HOUR 0x02 #define RTC_DAY 0x03 #define RTC_MONTH 0x04 #define RTC_YEAR 0x05 #define RTC_WEEKS 0x06 #define RTC_CTRL 0x10 #define RTC_STATUS 0x11 #define RTC_CTRL_STOP_RTC (1 << 0) #define RTC_CTRL_GET_TIME (1 << 6) #define RTC_CTRL_RTC_READSEL (1 << 7) #define DCDC_UV_ACT 0x28 #define DCDC_ILMAX 0x90 static int rk808_read(uint8_t reg, uint8_t *value) { return i2c_readb(CONFIG_PMIC_BUS, RK808_ADDR, reg, value); } static int rk808_write(uint8_t reg, uint8_t value) { return i2c_writeb(CONFIG_PMIC_BUS, RK808_ADDR, reg, value); } static void rk808_clrsetbits(uint8_t reg, uint8_t clr, uint8_t set) { uint8_t value; if (rk808_read(reg, &value) || rk808_write(reg, (value & ~clr) | set)) printk(BIOS_ERR, "Cannot set Rk808[%#x]!\n", reg); } void rk808_configure_switch(int sw, int enabled) { assert(sw == 1 || sw == 2); rk808_clrsetbits(DCDC_EN, 1 << (sw + 4), !!enabled << (sw + 4)); } void rk808_configure_ldo(int ldo, int millivolts) { uint8_t vsel; if (!millivolts) { rk808_clrsetbits(LDO_EN, 1 << (ldo - 1), 0); return; } switch (ldo) { case 1: case 2: case 4: case 5: case 8: vsel = DIV_ROUND_UP(millivolts, 100) - 18; assert(vsel <= 0x10); break; case 3: case 6: case 7: vsel = DIV_ROUND_UP(millivolts, 100) - 8; assert(vsel <= 0x11); break; default: die("Unknown LDO index!"); } rk808_clrsetbits(LDO_ONSEL(ldo), 0x1f, vsel); rk808_clrsetbits(LDO_EN, 0, 1 << (ldo - 1)); } void rk808_configure_buck(int buck, int millivolts) { uint8_t vsel; uint8_t buck_reg; switch (buck) { case 1: case 2: /* 25mV steps. base = 29 * 25mV = 725 */ vsel = (DIV_ROUND_UP(millivolts, 25) - 29) * 2 + 1; assert(vsel <= 0x3f); buck_reg = BUCK1SEL + 4 * (buck - 1); break; case 4: vsel = DIV_ROUND_UP(millivolts, 100) - 18; assert(vsel <= 0xf); buck_reg = BUCK4SEL; break; default: die("Unknown buck index!"); } rk808_clrsetbits(DCDC_ILMAX, 0, 3 << ((buck - 1) * 2)); /* undervoltage detection may be wrong, disable it */ rk808_clrsetbits(DCDC_UV_ACT, 1 << (buck - 1), 0); rk808_clrsetbits(buck_reg, 0x3f, vsel); rk808_clrsetbits(DCDC_EN, 0, 1 << (buck - 1)); } static void rk808rtc_stop(void) { rk808_clrsetbits(RTC_CTRL, RTC_CTRL_STOP_RTC, 0); } static void rk808rtc_start(void) { rk808_clrsetbits(RTC_CTRL, 0, RTC_CTRL_STOP_RTC); } int rtc_set(const struct rtc_time *time) { int ret = 0; /* RTC time can only be set when RTC is frozen */ rk808rtc_stop(); ret |= rk808_write(RTC_SECOND, bin2bcd(time->sec)); ret |= rk808_write(RTC_MINUTE, bin2bcd(time->min)); ret |= rk808_write(RTC_HOUR, bin2bcd(time->hour)); ret |= rk808_write(RTC_DAY, bin2bcd(time->mday)); ret |= rk808_write(RTC_MONTH, bin2bcd(time->mon)); ret |= rk808_write(RTC_YEAR, bin2bcd(time->year)); rk808rtc_start(); return ret; } int rtc_get(struct rtc_time *time) { uint8_t value; int ret = 0; /* * Set RTC_READSEL to cause reads to access shadow registers and * transition GET_TIME from 0 to 1 to cause dynamic register content * to be copied into shadow registers. This ensures a coherent reading * of time values as we access each register using slow I2C transfers. */ rk808_clrsetbits(RTC_CTRL, RTC_CTRL_GET_TIME, 0); rk808_clrsetbits(RTC_CTRL, 0, RTC_CTRL_GET_TIME | RTC_CTRL_RTC_READSEL); /* * After we set the GET_TIME bit, the rtc time can't be read * immediately. So we should wait up to 31.25 us. */ udelay(32); ret |= rk808_read(RTC_SECOND, &value); time->sec = bcd2bin(value & 0x7f); ret |= rk808_read(RTC_MINUTE, &value); time->min = bcd2bin(value & 0x7f); ret |= rk808_read(RTC_HOUR, &value); time->hour = bcd2bin(value & 0x3f); ret |= rk808_read(RTC_DAY, &value); time->mday = bcd2bin(value & 0x3f); ret |= rk808_read(RTC_MONTH, &value); time->mon = bcd2bin(value & 0x1f); ret |= rk808_read(RTC_YEAR, &value); time->year = bcd2bin(value); time->wday = -1; /* unknown */ return ret; }
/* * Copyright (c) 1983, 1993 * The Regents of the University of California. 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. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. */ /* Copyright (C) 2013-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <ctype.h> /* * Internet network address interpretation routine. * The library routines call this routine to interpret * network numbers. */ u_int32_t inet_network (const char *cp) { u_int32_t val, base, n, i; char c; u_int32_t parts[4], *pp = parts; int digit; again: val = 0; base = 10; digit = 0; if (*cp == '0') digit = 1, base = 8, cp++; if (*cp == 'x' || *cp == 'X') digit = 0, base = 16, cp++; while ((c = *cp) != 0) { if (isdigit(c)) { if (base == 8 && (c == '8' || c == '9')) return (INADDR_NONE); val = (val * base) + (c - '0'); cp++; digit = 1; continue; } if (base == 16 && isxdigit(c)) { val = (val << 4) + (tolower (c) + 10 - 'a'); cp++; digit = 1; continue; } break; } if (!digit) return (INADDR_NONE); if (pp >= parts + 4 || val > 0xff) return (INADDR_NONE); if (*cp == '.') { *pp++ = val, cp++; goto again; } while (isspace(*cp)) cp++; if (*cp) return (INADDR_NONE); if (pp >= parts + 4 || val > 0xff) return (INADDR_NONE); *pp++ = val; n = pp - parts; for (val = 0, i = 0; i < n; i++) { val <<= 8; val |= parts[i] & 0xff; } return (val); }
#pragma once #include "types.h" #include "sh4_if.h" #define r Sh4cntx.r #define r_bank Sh4cntx.r_bank #define gbr Sh4cntx.gbr #define ssr Sh4cntx.ssr #define spc Sh4cntx.spc #define sgr Sh4cntx.sgr #define dbr Sh4cntx.dbr #define vbr Sh4cntx.vbr #define mac Sh4cntx.mac #define pr Sh4cntx.pr #define fpul Sh4cntx.fpul #define next_pc Sh4cntx.pc #define curr_pc (next_pc-2) #define sr Sh4cntx.sr #define fpscr Sh4cntx.fpscr #define old_sr Sh4cntx.old_sr #define old_fpscr Sh4cntx.old_fpscr #define fr (&Sh4cntx.xffr[16]) #define xf Sh4cntx.xffr #define fr_hex ((u32*)fr) #define xf_hex ((u32*)xf) #define dr_hex ((u64*)fr) #define xd_hex ((u64*)xf) #define sh4_int_bCpuRun Sh4cntx.CpuRunning void UpdateFPSCR(); bool UpdateSR(); union DoubleReg { f64 dbl; f32 sgl[2]; }; INLINE f64 GetDR(u32 n) { #ifdef TRACE if (n>7) printf("DR_r INDEX OVERRUN %d >7",n); #endif DoubleReg t; t.sgl[1]=fr[(n<<1) + 0]; t.sgl[0]=fr[(n<<1) + 1]; return t.dbl; } INLINE f64 GetXD(u32 n) { #ifdef TRACE if (n>7) printf("XD_r INDEX OVERRUN %d >7",n); #endif DoubleReg t; t.sgl[1]=xf[(n<<1) + 0]; t.sgl[0]=xf[(n<<1) + 1]; return t.dbl; } INLINE void SetDR(u32 n,f64 val) { #ifdef TRACE if (n>7) printf("DR_w INDEX OVERRUN %d >7",n); #endif DoubleReg t; t.dbl=val; fr[(n<<1) | 1]=t.sgl[0]; fr[(n<<1) | 0]=t.sgl[1]; } INLINE void SetXD(u32 n,f64 val) { #ifdef TRACE if (n>7) printf("XD_w INDEX OVERRUN %d >7",n); #endif DoubleReg t; t.dbl=val; xf[(n<<1) | 1]=t.sgl[0]; xf[(n<<1) | 0]=t.sgl[1]; } //needs to be removed u32* Sh4_int_GetRegisterPtr(Sh4RegType reg); //needs to be made portable void SetFloatStatusReg(); bool Do_Interrupt(u32 intEvn); bool Do_Exeption(u32 epc, u32 expEvn, u32 CallVect);
#ifndef __lib_python_connections_h #define __lib_python_connections_h #include <libsig_comp.h> #include <lib/python/python.h> class PSignal { protected: ePyObject m_list; public: PSignal(); ~PSignal(); void callPython(SWIG_PYOBJECT(ePyObject) tuple); #ifndef SWIG PyObject *getSteal(bool clear=false); #endif PyObject *get(); }; inline PyObject *PyFrom(int v) { return PyInt_FromLong(v); } inline PyObject *PyFrom(const char *c) { return PyString_FromString(c); } template <class R> class PSignal0: public PSignal, public Signal0<R> { public: R operator()() { if (m_list) { PyObject *pArgs = PyTuple_New(0); callPython(pArgs); Org_Py_DECREF(pArgs); } return Signal0<R>::operator()(); } }; template <class R, class V0> class PSignal1: public PSignal, public Signal1<R,V0> { public: R operator()(V0 a0) { if (m_list) { PyObject *pArgs = PyTuple_New(1); PyTuple_SET_ITEM(pArgs, 0, PyFrom(a0)); callPython(pArgs); Org_Py_DECREF(pArgs); } return Signal1<R,V0>::operator()(a0); } }; template <class R, class V0, class V1> class PSignal2: public PSignal, public Signal2<R,V0,V1> { public: R operator()(V0 a0, V1 a1) { if (m_list) { PyObject *pArgs = PyTuple_New(2); PyTuple_SET_ITEM(pArgs, 0, PyFrom(a0)); PyTuple_SET_ITEM(pArgs, 1, PyFrom(a1)); callPython(pArgs); Org_Py_DECREF(pArgs); } return Signal2<R,V0,V1>::operator()(a0, a1); } }; #endif
/*************************************************************************** * Copyright (C) 2009 by The qGo Project * * * * This file is part of qGo. * * * * qGo is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see <http://www.gnu.org/licenses/> * * or write to the Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include <QDialog> //#include "../ui_createroomdialog.h" class QLabel; class QDialogButtonBox; class NetworkConnection; class CreateRoomDialog : public QDialog/*, public Ui::CreateRoomDialog*/ { Q_OBJECT public: CreateRoomDialog(NetworkConnection * conn); ~CreateRoomDialog(); public slots: void slot_create(void); void slot_cancel(void); void slot_privateCB(bool); void slot_roomTypeTab(void); void slot_opponentStrongerRB(void); void slot_opponentEvenRB(void); void slot_opponentWeakerRB(void); void slot_opponentAnyRB(void); void slot_timeQuickRB(void); void slot_timeNormalRB(void); void slot_timePonderousRB(void); void slot_timeAnyRB(void); void slot_oneOnOneRB(void); void slot_pairRB(void); void slot_teachingRB(void); void slot_liveRB(void); private: NetworkConnection * connection; //Ui::CreateRoomDialog ui; }; struct RoomCreate { unsigned char * title; unsigned char * password; enum roomType { GAME = 0, GOMOKU, CHAT, REVIEW, MULTI, VARIATION } type; enum OpponentStrength { STRONGER = 0, EVEN, WEAKER, ANYBODY } opponentStrength; enum TimeLimit { QUICK = 0, NORMAL, PONDEROUS, ANYTIME } timeLimit; enum Topic { BADUK = 0, MOVIES, MUSIC, SPORTS, GAMES, MANGA, HUMOR, CURRENTAFFAIRS, LITERATURE, HOBBIES, TRAVEL, CLIMBING, ENTERTAINMENT, COMPUTING, INTERNET, MISC } topic; enum Age { ALL=0, _9, _10_19, _20_29, _30_39, _40_49, _50_59, _60_69, _70 } age; enum Location { KOREA = 0, CHINA, JAPAN, THAI, US, EUROPE, AUSTRALIA, FOREIGN, OTHER } location; };
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2018 Canonical Ltd. * * 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 * Lesser 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/>. */ #pragma once #include <gsound.h> #include <gtk/gtk.h> #include <pulse/pulseaudio.h> G_BEGIN_DECLS #define CC_TYPE_SPEAKER_TEST_BUTTON (cc_speaker_test_button_get_type ()) G_DECLARE_FINAL_TYPE (CcSpeakerTestButton, cc_speaker_test_button, CC, SPEAKER_TEST_BUTTON, GtkButton) CcSpeakerTestButton *cc_speaker_test_button_new (void); void cc_speaker_test_button_set_channel_position (CcSpeakerTestButton *button, GSoundContext *context, pa_channel_position_t position); G_END_DECLS
/* * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Tim Dykes and Ian Cant * University of Portsmouth * */ #ifndef SPLOTCH_PREVIEWER_LIBS_CORE_PARAMETER #define SPLOTCH_PREVIEWER_LIBS_CORE_PARAMETER //Debug include #include "previewer/libs/core/Debug.h" #include "../../../cxxsupport/paramfile.h" #include <string> #include <map> #include <iostream> #include <fstream> namespace previewer { // Provides the functionality to read and write parameter files. Also // stores all values ready for use in the application class Parameter { public: void Load(std::string); // With file void Load(); // No file void Run(); void Unload(); paramfile* GetParamFileReference(); void WriteParameterFile(std::string); void SetFilePath(std::string); private: // Variables for the parameter file type and a list of // parameters paramfile paramFileReference; std::map<std::string, std::string> parameters; typedef std::map<std::string,std::string> params_type; }; } #endif
/* Copyright (c) 2002-2011 by XMLVM.org * * Project Info: http://www.xmlvm.org * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ #import <MediaPlayer/MediaPlayer.h> #import "xmlvm.h" #import "org_xmlvm_iphone_NSURL.h" #import "org_xmlvm_iphone_UIColor.h" typedef MPMoviePlayerController org_xmlvm_iphone_MPMoviePlayerController; @interface MPMoviePlayerController (cat_org_xmlvm_iphone_MPMoviePlayerController) + (org_xmlvm_iphone_MPMoviePlayerController*) initWithContentURL___org_xmlvm_iphone_NSURL :(org_xmlvm_iphone_NSURL*)n1; - (void) play__; - (void) stop__; - (org_xmlvm_iphone_NSURL*) getContentURL__; - (org_xmlvm_iphone_UIColor*) getBackgroundColor__; - (void) setBackgroundColor___org_xmlvm_iphone_UIColor :(org_xmlvm_iphone_UIColor*)color; - (double) getInitialPlaybackTime__; - (void) setInitialPlaybackTime___double :(double)time; - (int) getScalingMode__; - (void) setScalingMode___int :(int)mode; - (int) getMovieControlMode__; - (void) setMovieControlMode___int :(int)mode; @end
// // DataSourceBase.h // #import <Foundation/Foundation.h> #import "CellGenerator.h" @interface DataSourceBase : NSObject <UITableViewDataSource, UICollectionViewDataSource> @property (copy, nonatomic) NSString * identifier; - (NSInteger)numberOfSections; - (NSInteger)numberOfItemsInSection:(NSInteger)section; - (NSDictionary *)datasetForItemAtIndexPath:(NSIndexPath *)indexPath; - (id)contents; - (NSArray *)items; - (void)refresh; - (void)refreshFromControl:(id)sender; - (void)addLoadingIndicators; - (void)removeAllLoadingIndicators; - (void)addObserver:(id)observer; - (void)removeObserver:(id)observer; - (void)notifyObservers; - (void)notifyObserversForKeyPath:(NSString *)keyPath; - (void)notifyObserversWithUpdate:(BOOL)update; - (void)sendRequestForURLFromString:(NSString *)URLString completion:(void (^)(NSURLResponse* response, NSData* data, NSError* connectionError))completionHandler; @property BOOL usesCellGenerator; - (BOOL)canLoadMore; - (void)loadMore; - (BOOL)isEditable; - (BOOL)deleteItemAtIndexPath:(NSIndexPath *)indexPath; @end @interface NSString (URLEscapedQuery) + (NSString *)urlEscapeString:(NSString *)unencodedString; + (NSString *)queryStringFromDictionary:(NSDictionary *)dict; @end
#pragma once /* * Copyright (C) 2005-2017 Team Kodi * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Kodi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "addons/kodi-addon-dev-kit/include/kodi/addon-instance/Screensaver.h" #include "addons/AddonInstanceHandler.h" namespace ADDON { class CScreenSaver : public IAddonInstanceHandler { public: CScreenSaver(AddonInfoPtr addonInfo); virtual ~CScreenSaver(); bool Start(); void Stop(); void Render(); private: std::string m_name; /*!< To add-on sended name */ std::string m_presets; /*!< To add-on sended preset path */ std::string m_profile; /*!< To add-on sended profile path */ AddonInstance_Screensaver m_struct; }; } /* namespace ADDON */
#include <kernel.h> #include <kdata.h> #include <printf.h> #include <timer.h> #include <blkdev.h> #include <devide_sunrise.h> #include <msx.h> uint8_t ide_error; uint16_t ide_base; uint8_t *devide_buf; struct msx_map sunrise_u, sunrise_k; static void delay(void) { timer_t timeout; timeout = set_timer_ms(25); while(!timer_expired(timeout)) platform_idle(); } static uint8_t sunrise_transfer_sector(void) { uint8_t drive = (blk_op.blkdev->driver_data & IDE_DRIVE_NR_MASK); uint8_t mask = drive ? 0xF0 : 0xE0; uint8_t *addr = blk_op.addr; if (blk_op.is_read) blk_op.blkdev->driver_data |= FLAG_CACHE_DIRTY; /* Shortcut: this range can only occur for a user mode I/O */ if (addr >= (uint8_t *)0x3E00U && addr <= (uint8_t *)0x8000U) { blk_op.addr = tmpbuf(); blk_op.is_user = 0; if (do_ide_xfer(mask) == 0) goto fail; uput(blk_op.addr, addr, 512); tmpfree(blk_op.addr); return 1; } if (do_ide_xfer(mask)) return 1; fail: if (ide_error == 0xFF) kprintf("ide%d: timeout.\n", drive); else kprintf("ide%d: status %x\n", drive, ide_error); return 0; } static int sunrise_flush_cache(void) { uint8_t drive; drive = blk_op.blkdev->driver_data & IDE_DRIVE_NR_MASK; /* check drive has a cache and was written to since the last flush */ if((blk_op.blkdev->driver_data & (FLAG_WRITE_CACHE | FLAG_CACHE_DIRTY)) != (FLAG_WRITE_CACHE | FLAG_CACHE_DIRTY)) return 0; if (do_ide_flush_cache(drive ? 0xF0 : 0xE0)) { udata.u_error = EIO; return -1; } return 0; } static void sunrise_init_drive(uint8_t drive) { uint8_t mask = drive ? 0xF0 : 0xE0; blkdev_t *blk; kprintf("IDE drive %d: ", drive); devide_buf = tmpbuf(); if (do_ide_init_drive(mask) == NULL) goto failout; if (!(devide_buf[99] & 0x02)) { kputs("LBA unsupported.\n"); goto failout; } blk = blkdev_alloc(); if (!blk) goto failout; blk->transfer = sunrise_transfer_sector; blk->flush = sunrise_flush_cache; blk->driver_data = drive; if( !(((uint16_t*)devide_buf)[82] == 0x0000 && ((uint16_t*)devide_buf)[83] == 0x0000) || (((uint16_t*)devide_buf)[82] == 0xFFFF && ((uint16_t*)devide_buf)[83] == 0xFFFF) ){ /* command set notification is supported */ if(devide_buf[164] & 0x20){ /* write cache is supported */ blk->driver_data |= FLAG_WRITE_CACHE; } } /* read out the drive's sector count */ blk->drive_lba_count = le32_to_cpu(*((uint32_t*)&devide_buf[120])); /* done with our temporary memory */ tmpfree(devide_buf); blkdev_scan(blk, SWAPSCAN); return; failout: tmpfree(devide_buf); } void sunrise_probe(uint8_t slot, uint8_t subslot) { uint8_t i = slot; if (subslot != 0xFF) i |= 0x80 | (subslot << 2); /* Generate and cache the needed mapping table */ memcpy(&sunrise_k, map_slot1_kernel(i), sizeof(sunrise_k)); memcpy(&sunrise_u, map_slot1_user(i), sizeof(sunrise_k)); do_ide_begin_reset(); delay(); do_ide_end_reset(); delay(); for (i = 0; i < IDE_DRIVE_COUNT; i++) sunrise_init_drive(i); }
/* * pci.c: GT64120 PCI support. * * Copyright (C) 2006, Wind River System Inc. Rongkai.Zhan <rongkai.zhan@windriver.com> * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/init.h> #include <linux/ioport.h> #include <linux/types.h> #include <linux/pci.h> #include <asm/gt64120.h> extern struct pci_ops gt64xxx_pci0_ops; static struct resource pci0_io_resource = { .name = "pci_0 io", .start = GT_PCI_IO_BASE, .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1, .flags = IORESOURCE_IO, }; static struct resource pci0_mem_resource = { .name = "pci_0 memory", .start = GT_PCI_MEM_BASE, .end = GT_PCI_MEM_BASE + GT_PCI_MEM_SIZE - 1, .flags = IORESOURCE_MEM, }; static struct pci_controller hose_0 = { .pci_ops = &gt64xxx_pci0_ops, .io_resource = &pci0_io_resource, .mem_resource = &pci0_mem_resource, }; static int __init gt64120_pci_init(void) { u32 tmp; tmp = GT_READ(GT_PCI0_CMD_OFS); /* Huh??? -- Ralf */ tmp = GT_READ(GT_PCI0_BARE_OFS); /* reset the whole PCI I/O space range */ ioport_resource.start = GT_PCI_IO_BASE; ioport_resource.end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1; register_pci_controller(&hose_0); return 0; } arch_initcall(gt64120_pci_init);
/* * Copyright 2011, Blender Foundation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contributor: * Jeroen Bakker * Monique Dewanchand */ #ifndef _COM_ViewerOperation_h #define _COM_ViewerOperation_h #include "COM_NodeOperation.h" #include "DNA_image_types.h" #include "BLI_rect.h" #include "BKE_global.h" class ViewerOperation : public NodeOperation { private: float *m_outputBuffer; float *m_depthBuffer; Image *m_image; ImageUser *m_imageUser; bool m_active; float m_centerX; float m_centerY; OrderOfChunks m_chunkOrder; bool m_doDepthBuffer; ImBuf *m_ibuf; bool m_useAlphaInput; const RenderData *m_rd; const char *m_viewName; const ColorManagedViewSettings *m_viewSettings; const ColorManagedDisplaySettings *m_displaySettings; SocketReader *m_imageInput; SocketReader *m_alphaInput; SocketReader *m_depthInput; public: ViewerOperation(); void initExecution(); void deinitExecution(); void executeRegion(rcti *rect, unsigned int tileNumber); bool isOutputOperation(bool /*rendering*/) const { if (G.background) return false; return isActiveViewerOutput(); } void setImage(Image *image) { this->m_image = image; } void setImageUser(ImageUser *imageUser) { this->m_imageUser = imageUser; } const bool isActiveViewerOutput() const { return this->m_active; } void setActive(bool active) { this->m_active = active; } void setCenterX(float centerX) { this->m_centerX = centerX;} void setCenterY(float centerY) { this->m_centerY = centerY;} void setChunkOrder(OrderOfChunks tileOrder) { this->m_chunkOrder = tileOrder; } float getCenterX() const { return this->m_centerX; } float getCenterY() const { return this->m_centerY; } OrderOfChunks getChunkOrder() const { return this->m_chunkOrder; } const CompositorPriority getRenderPriority() const; bool isViewerOperation() const { return true; } void setUseAlphaInput(bool value) { this->m_useAlphaInput = value; } void setRenderData(const RenderData *rd) { this->m_rd = rd; } void setViewName(const char *viewName) { this->m_viewName = viewName; } void setViewSettings(const ColorManagedViewSettings *viewSettings) { this->m_viewSettings = viewSettings; } void setDisplaySettings(const ColorManagedDisplaySettings *displaySettings) { this->m_displaySettings = displaySettings; } private: void updateImage(rcti *rect); void initImage(); }; #endif
/* * Atmel maXTouch Touchscreen driver * * Copyright (C) 2010 Samsung Electronics Co.Ltd * Author: Joonyoung Shim <jy0922.shim@samsung.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #ifndef __LINUX_ATMEL_MXT_TS_H #define __LINUX_ATMEL_MXT_TS_H #ifndef CUST_B_TOUCH #define CUST_B_TOUCH #endif #include <linux/types.h> #define MXT_DEVICE_NAME "lge_touch" #define MXT_MAX_NUM_TOUCHES 10 #define MXT_GESTURE_RECOGNIZE #ifdef MXT_GESTURE_RECOGNIZE #define MXT_LATEST_FW_VERSION 0x10 #define MXT_LATEST_FW_BUILD 0xE2 #else #define MXT_LATEST_FW_VERSION 0x30 #define MXT_LATEST_FW_BUILD 0xAA #endif #ifdef CUST_B_TOUCH enum{ TIME_START_TIME, TIME_CURR_TIME, TIME_EX_PROFILE_MAX }; enum{ FINGER_INACTIVE, FINGER_RELEASED, FINGER_PRESSED, FINGER_MOVED }; #endif enum { MXT_T6 = 0, MXT_T38, MXT_T71, MXT_T7, MXT_T8, MXT_T15, MXT_T18, MXT_T19, MXT_T23, #ifdef MXT_GESTURE_RECOGNIZE MXT_T24, #endif MXT_T25, #ifdef MXT_GESTURE_RECOGNIZE MXT_T35, #endif MXT_T40, MXT_T42, MXT_T46, MXT_T47, MXT_T55, MXT_T56, MXT_T61, MXT_T65, MXT_T66, MXT_T69, MXT_T70, MXT_T72, MXT_T78, MXT_T80, MXT_T84, MXT_T100, MXT_T101, MXT_T102, MXT_T103, MXT_T104, MXT_T105, MXT_TMAX, }; /* Config data for a given maXTouch controller with a specific firmware */ struct mxt_config_info { u8 *config_t[MXT_TMAX]; }; /* The platform data for the Atmel maXTouch touchscreen driver */ struct mxt_platform_data { const struct mxt_config_info *config_array; size_t config_array_size; u8 numtouch; /* Number of touches to report */ int max_x; /* The default reported X range */ int max_y; /* The default reported Y range */ bool i2c_pull_up; unsigned long irqflags; u8 t19_num_keys; const unsigned int *t19_keymap; int t15_num_keys; const unsigned int *t15_keymap; unsigned long gpio_reset; unsigned long gpio_int; const char *cfg_name; }; #endif /* __LINUX_ATMEL_MXT_TS_H */
#include <stdio.h> #include "seqlist.h" int main() { int idx; printf("seqlist_create...\n\n"); seqlist *list = seqlist_create(5); int i = 0; int j = 1; int k = 2; int x = 3; int y = 4; int z = 5; unsigned int *addr_arr[] = { &i, &j, &k, &x, &y, &z, }; printf("seqlist_capacity = %d\n\n", seqlist_capacity(list)); printf("seqlist_insert...\n\n"); for (idx = 0; idx < 5; idx++) seqlist_insert(list, addr_arr[idx], 0); printf("seqlist_getelem...\n"); for(idx = 0; idx < seqlist_length(list); idx++) printf("seqlist_getelem = %d\n", *(int *)seqlist_getelem(list, idx)); //printf("seqlist_getelem = %d\n", *(unsigned int *)seqlist_getelem(list, idx)); printf("seqlist_length = %d\n\n", seqlist_length(list)); printf("seqlist_delete...\n\n"); seqlist_delete(list, 1); printf("seqlist_getelem...\n"); for(idx = 0; idx < seqlist_length(list); idx++) printf("seqlist_getelem = %d\n", *(int *)seqlist_getelem(list, idx)); printf("seqlist_clear...\n\n"); seqlist_clear(list); printf("seqlist_destroy...\n\n"); seqlist_destroy(list); return 0; }
/* Get abbreviation code. Copyright (C) 2003 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2003. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as published by the Open Source Initiative. You should have received a copy of the Open Software License along with this program; if not, you may obtain a copy of the Open Software License version 1.0 from http://www.opensource.org/licenses/osl.php or by writing the Open Source Initiative c/o Lawrence Rosen, Esq., 3001 King Ranch Road, Ukiah, CA 95482. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <assert.h> #include <dwarf.h> #include "libdwP.h" unsigned int dwarf_getabbrevcode (abbrev) Dwarf_Abbrev *abbrev; { return abbrev == NULL ? 0 : abbrev->code; }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef BACKENDS_MIXER_SYMBIAN_SDL_H #define BACKENDS_MIXER_SYMBIAN_SDL_H #include "backends/mixer/sdl/sdl-mixer.h" /** * SDL mixer manager for Symbian */ class SymbianSdlMixerManager : public SdlMixerManager { public: SymbianSdlMixerManager(); virtual ~SymbianSdlMixerManager(); protected: byte *_stereoMixBuffer; virtual void startAudio(); virtual void callbackHandler(byte *samples, int len); }; #endif
/* * This file is part of the coreboot project. * * Copyright (C) 2014 Google 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; version 2 of the License. * * 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 <stddef.h> #include <stdint.h> #include <arch/cpu.h> #include <arch/io.h> #include <arch/cbfs.h> #include <arch/stages.h> #include <arch/early_variables.h> #include <console/console.h> #include <cbfs.h> #include <cbmem.h> #include <cpu/x86/mtrr.h> #include <elog.h> #include <tpm.h> #include <romstage_handoff.h> #include <stage_cache.h> #include <timestamp.h> #include <soc/me.h> #include <soc/pei_data.h> #include <soc/pm.h> #include <soc/reset.h> #include <soc/romstage.h> #include <soc/spi.h> #include <vendorcode/google/chromeos/chromeos.h> /* Entry from cache-as-ram.inc. */ void * asmlinkage romstage_main(unsigned long bist, uint32_t tsc_low, uint32_t tsc_hi) { struct romstage_params rp = { .bist = bist, .pei_data = NULL, }; post_code(0x30); /* Save initial timestamp from bootblock. */ timestamp_init((((uint64_t)tsc_hi) << 32) | (uint64_t)tsc_low); /* Save romstage begin */ timestamp_add_now(TS_START_ROMSTAGE); /* System Agent Early Initialization */ systemagent_early_init(); /* PCH Early Initialization */ pch_early_init(); /* Call into mainboard pre console init. Needed to enable serial port on IT8772 */ mainboard_pre_console_init(); /* Start console drivers */ console_init(); /* Get power state */ rp.power_state = fill_power_state(); /* Print useful platform information */ report_platform_info(); /* Set CPU frequency to maximum */ set_max_freq(); /* Call into mainboard. */ mainboard_romstage_entry(&rp); #if CONFIG_CHROMEOS save_chromeos_gpios(); #endif return setup_stack_and_mttrs(); } /* Entry from the mainboard. */ void romstage_common(struct romstage_params *params) { struct romstage_handoff *handoff; post_code(0x32); timestamp_add_now(TS_BEFORE_INITRAM); params->pei_data->boot_mode = params->power_state->prev_sleep_state; #if CONFIG_ELOG_BOOT_COUNT if (params->power_state->prev_sleep_state != SLEEP_STATE_S3) boot_count_increment(); #endif /* Print ME state before MRC */ intel_me_status(); /* Save ME HSIO version */ intel_me_hsio_version(&params->power_state->hsio_version, &params->power_state->hsio_checksum); /* Initialize RAM */ raminit(params->pei_data); timestamp_add_now(TS_AFTER_INITRAM); handoff = romstage_handoff_find_or_add(); if (handoff != NULL) handoff->s3_resume = (params->power_state->prev_sleep_state == SLEEP_STATE_S3); else printk(BIOS_DEBUG, "Romstage handoff structure not added!\n"); #if CONFIG_LPC_TPM init_tpm(params->power_state->prev_sleep_state == SLEEP_STATE_S3); #endif } void asmlinkage romstage_after_car(void) { /* Load the ramstage. */ copy_and_run(); while (1); } void ramstage_cache_invalid(void) { #if CONFIG_RESET_ON_INVALID_RAMSTAGE_CACHE /* Perform cold reset on invalid ramstage cache. */ reset_system(); #endif } int get_sw_write_protect_state(void) { u8 status; /* Return unprotected status if status read fails. */ return (early_spi_read_wpsr(&status) ? 0 : !!(status & 0x80)); } void __attribute__((weak)) mainboard_pre_console_init(void) {}
/* **************************************************************************** This file is part of Lokalize Copyright (C) 2007-2009 by Nick Shaforostoff <shafff@ukr.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. **************************************************************************** */ #ifndef MULTIEDITORADAPTOR_H #define MULTIEDITORADAPTOR_H #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "editoradaptor.h" #include <kdebug.h> /** * Hack over QDBusAbstractAdaptor to get kross active-editor-adaptor for free */ class MultiEditorAdaptor: public EditorAdaptor { Q_OBJECT public: MultiEditorAdaptor(EditorTab *parent); ~MultiEditorAdaptor() { /*kWarning()<<"bye bye cruel world";*/ } inline EditorTab* editorTab() const { return static_cast<EditorTab*>(QObject::parent()); } void setEditorTab(EditorTab* e); private slots: void handleParentDestroy(QObject* p); }; //methosa are defined in lokalizemainwindow.cpp #endif
/* * SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, const struct timespec __user *, rqtp, struct timespec __user *, rmtp) * * On successfully sleeping for the requested interval, clock_nanosleep() returns 0. * If the call is interrupted by a signal handler or encounters an error, * then it returns one of the positive error number listed in ERRORS. */ #include <time.h> #include "sanitise.h" static unsigned long clock_nanosleep_which[] = { CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, }; static unsigned long clock_nanosleep_flags[] = { TIMER_ABSTIME, }; struct syscallentry syscall_clock_nanosleep = { .name = "clock_nanosleep", .num_args = 4, .arg1name = "which_clock", .arg1type = ARG_OP, .arg1list = ARGLIST(clock_nanosleep_which), .arg2name = "flags", .arg2type = ARG_LIST, .arg2list = ARGLIST(clock_nanosleep_flags), .arg3name = "rqtp", .arg3type = ARG_ADDRESS, .arg4name = "rmtp", .arg4type = ARG_ADDRESS, .rettype = RET_ZERO_SUCCESS, .flags = NEED_ALARM, };
/** * @file com_internal_s3/comcallback_instance.c * * @section desc File description * * @section copyright Copyright * * Trampoline Test Suite * * Trampoline Test Suite is copyright (c) IRCCyN 2005-2007 * Trampoline Test Suite is protected by the French intellectual property law. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 * of the License. * * 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. * * @section infos File informations * * $Date$ * $Rev$ * $Author$ * $URL$ */ /*Instance of comcallback routine*/ #include "tpl_os.h" DeclareMessage(rm_comcallback); /*test case:test the reaction of the system called with an activation of a task*/ static void test_comcallback_instance(void) { StatusType result_inst_1; StatusType received_char; /*not allowed !!! Should be E_OS_CALLEVEL*/ SCHEDULING_CHECK_INIT(10); result_inst_1 = ReceiveMessage(rm_comcallback, &received_char); SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(10,E_OK, result_inst_1); SCHEDULING_CHECK_AND_EQUAL_INT(10,(int)('3'), (int)received_char); } /*create the test suite with all the test cases*/ TestRef COMInternalTest_seq3_comcallback_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_comcallback_instance",test_comcallback_instance) }; EMB_UNIT_TESTCALLER(COMInternalTest,"COMInternalTest_sequence3",NULL,NULL,fixtures); return (TestRef)&COMInternalTest; } /* End of file com_internal_s3/comcallback_instance.c */
#define DOOP(ppname) PUTBACK; PL_op = ppname(aTHX); SPAGAIN #define CCPP(s) OP * s(pTHX) #define PP_LIST(g) do { \ dMARK; \ if (g != G_ARRAY) { \ if (++MARK <= SP) \ *MARK = *SP; \ else \ *MARK = &PL_sv_undef; \ SP = MARK; \ } \ } while (0) #define MAYBE_TAINT_SASSIGN_SRC(sv) \ if (PL_tainting && PL_tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \ !((mg=mg_find(left, 't')) && mg->mg_len & 1)))\ TAINT_NOT #define PP_PREINC(sv) do { \ if (SvIOK(sv)) { \ ++SvIVX(sv); \ SvFLAGS(sv) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK); \ } \ else \ sv_inc(sv); \ SvSETMAGIC(sv); \ } while (0) #define PP_UNSTACK do { \ TAINT_NOT; \ PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; \ FREETMPS; \ oldsave = PL_scopestack[PL_scopestack_ix - 1]; \ LEAVE_SCOPE(oldsave); \ SPAGAIN; \ } while(0) /* Anyone using eval "" deserves this mess */ #define PP_EVAL(ppaddr, nxt) do { \ dJMPENV; \ int ret; \ PUTBACK; \ JMPENV_PUSH(ret); \ switch (ret) { \ case 0: \ PL_op = ppaddr(aTHX); \ PL_retstack[PL_retstack_ix - 1] = Nullop; \ if (PL_op != nxt) CALLRUNOPS(); \ JMPENV_POP; \ break; \ case 1: JMPENV_POP; JMPENV_JUMP(1); \ case 2: JMPENV_POP; JMPENV_JUMP(2); \ case 3: \ JMPENV_POP; \ if (PL_restartop && PL_restartop != nxt) \ JMPENV_JUMP(3); \ } \ PL_op = nxt; \ SPAGAIN; \ } while (0) #define PP_ENTERTRY(jmpbuf,label) \ STMT_START { \ int ret; \ JMPENV_PUSH_ENV(jmpbuf,ret); \ switch (ret) { \ case 1: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(1);\ case 2: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(2);\ case 3: JMPENV_POP_ENV(jmpbuf); SPAGAIN; goto label;\ } \ } STMT_END #define PP_LEAVETRY \ STMT_START{ PL_top_env=PL_top_env->je_prev; }STMT_END
/* * File...........: linux/drivers/s390/block/dasd_genhd.c * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com> * Horst Hummel <Horst.Hummel@de.ibm.com> * Carsten Otte <Cotte@de.ibm.com> * Martin Schwidefsky <schwidefsky@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * * gendisk related functions for the dasd driver. * * $Revision$ */ #include <linux/config.h> #include <linux/interrupt.h> #include <linux/fs.h> #include <linux/blkpg.h> #include <asm/uaccess.h> /* This is ugly... */ #define PRINTK_HEADER "dasd_gendisk:" #include "dasd_int.h" /* * Allocate and register gendisk structure for device. */ int dasd_gendisk_alloc(struct dasd_device *device) { struct gendisk *gdp; int len; /* Make sure the minor for this device exists. */ if (device->devindex >= DASD_PER_MAJOR) return -EBUSY; gdp = alloc_disk(1 << DASD_PARTN_BITS); if (!gdp) return -ENOMEM; /* Initialize gendisk structure. */ gdp->major = DASD_MAJOR; gdp->first_minor = device->devindex << DASD_PARTN_BITS; gdp->fops = &dasd_device_operations; gdp->driverfs_dev = &device->cdev->dev; /* * Set device name. * dasda - dasdz : 26 devices * dasdaa - dasdzz : 676 devices, added up = 702 * dasdaaa - dasdzzz : 17576 devices, added up = 18278 * dasdaaaa - dasdzzzz : 456976 devices, added up = 475252 */ len = sprintf(gdp->disk_name, "dasd"); if (device->devindex > 25) { if (device->devindex > 701) { if (device->devindex > 18277) len += sprintf(gdp->disk_name + len, "%c", 'a'+(((device->devindex-18278) /17576)%26)); len += sprintf(gdp->disk_name + len, "%c", 'a'+(((device->devindex-702)/676)%26)); } len += sprintf(gdp->disk_name + len, "%c", 'a'+(((device->devindex-26)/26)%26)); } len += sprintf(gdp->disk_name + len, "%c", 'a'+(device->devindex%26)); sprintf(gdp->devfs_name, "dasd/%s", device->cdev->dev.bus_id); if (device->features & DASD_FEATURE_READONLY) set_disk_ro(gdp, 1); gdp->private_data = device; gdp->queue = device->request_queue; device->gdp = gdp; set_capacity(device->gdp, 0); add_disk(device->gdp); return 0; } /* * Unregister and free gendisk structure for device. */ void dasd_gendisk_free(struct dasd_device *device) { del_gendisk(device->gdp); device->gdp->queue = 0; put_disk(device->gdp); device->gdp = 0; } /* * Trigger a partition detection. */ int dasd_scan_partitions(struct dasd_device * device) { struct block_device *bdev; /* Make the disk known. */ set_capacity(device->gdp, device->blocks << device->s2b_shift); bdev = bdget_disk(device->gdp, 0); if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) return -ENODEV; /* * See fs/partition/check.c:register_disk,rescan_partitions * Can't call rescan_partitions directly. Use ioctl. */ ioctl_by_bdev(bdev, BLKRRPART, 0); /* * Since the matching blkdev_put call to the blkdev_get in * this function is not called before dasd_destroy_partitions * the offline open_count limit needs to be increased from * 0 to 1. This is done by setting device->bdev (see * dasd_generic_set_offline). As long as the partition * detection is running no offline should be allowed. That * is why the assignment to device->bdev is done AFTER * the BLKRRPART ioctl. */ device->bdev = bdev; return 0; } /* * Remove all inodes in the system for a device, delete the * partitions and make device unusable by setting its size to zero. */ void dasd_destroy_partitions(struct dasd_device * device) { /* The two structs have 168/176 byte on 31/64 bit. */ struct blkpg_partition bpart; struct blkpg_ioctl_arg barg; struct block_device *bdev; /* * Get the bdev pointer from the device structure and clear * device->bdev to lower the offline open_count limit again. */ bdev = device->bdev; device->bdev = 0; /* * See fs/partition/check.c:delete_partition * Can't call delete_partitions directly. Use ioctl. * The ioctl also does locking and invalidation. */ memset(&bpart, 0, sizeof(struct blkpg_partition)); memset(&barg, 0, sizeof(struct blkpg_ioctl_arg)); barg.data = &bpart; barg.op = BLKPG_DEL_PARTITION; for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--) ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg); invalidate_partition(device->gdp, 0); /* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */ blkdev_put(bdev); set_capacity(device->gdp, 0); } int dasd_gendisk_init(void) { int rc; /* Register to static dasd major 94 */ rc = register_blkdev(DASD_MAJOR, "dasd"); if (rc != 0) { MESSAGE(KERN_WARNING, "Couldn't register successfully to " "major no %d", DASD_MAJOR); return rc; } return 0; } void dasd_gendisk_exit(void) { unregister_blkdev(DASD_MAJOR, "dasd"); }
/* * include/linux/random.h * * Include file for the random number generator. */ #ifndef _LINUX_RANDOM_H #define _LINUX_RANDOM_H #include <linux/list.h> #include <linux/once.h> #include <uapi/linux/random.h> struct random_ready_callback { struct list_head list; void (*func)(struct random_ready_callback *rdy); struct module *owner; }; extern void add_device_randomness(const void *, unsigned int); extern void add_input_randomness(unsigned int type, unsigned int code, unsigned int value); extern void add_interrupt_randomness(int irq, int irq_flags); extern void get_random_bytes(void *buf, int nbytes); extern int add_random_ready_callback(struct random_ready_callback *rdy); extern void del_random_ready_callback(struct random_ready_callback *rdy); extern void get_random_bytes_arch(void *buf, int nbytes); extern int random_int_secret_init(void); #ifndef MODULE extern const struct file_operations random_fops, urandom_fops; #endif unsigned int get_random_int(void); unsigned long get_random_long(void); unsigned long randomize_page(unsigned long start, unsigned long range); u32 prandom_u32(void); void prandom_bytes(void *buf, size_t nbytes); void prandom_seed(u32 seed); void prandom_reseed_late(void); struct rnd_state { __u32 s1, s2, s3, s4; }; u32 prandom_u32_state(struct rnd_state *state); void prandom_bytes_state(struct rnd_state *state, void *buf, size_t nbytes); void prandom_seed_full_state(struct rnd_state __percpu *pcpu_state); #define prandom_init_once(pcpu_state) \ DO_ONCE(prandom_seed_full_state, (pcpu_state)) /** * prandom_u32_max - returns a pseudo-random number in interval [0, ep_ro) * @ep_ro: right open interval endpoint * * Returns a pseudo-random number that is in interval [0, ep_ro). Note * that the result depends on PRNG being well distributed in [0, ~0U] * u32 space. Here we use maximally equidistributed combined Tausworthe * generator, that is, prandom_u32(). This is useful when requesting a * random index of an array containing ep_ro elements, for example. * * Returns: pseudo-random number in interval [0, ep_ro) */ static inline u32 prandom_u32_max(u32 ep_ro) { return (u32)(((u64) prandom_u32() * ep_ro) >> 32); } /* * Handle minimum values for seeds */ static inline u32 __seed(u32 x, u32 m) { return (x < m) ? x + m : x; } /** * prandom_seed_state - set seed for prandom_u32_state(). * @state: pointer to state structure to receive the seed. * @seed: arbitrary 64-bit value to use as a seed. */ static inline void prandom_seed_state(struct rnd_state *state, u64 seed) { u32 i = (seed >> 32) ^ (seed << 10) ^ seed; state->s1 = __seed(i, 2U); state->s2 = __seed(i, 8U); state->s3 = __seed(i, 16U); state->s4 = __seed(i, 128U); } #ifdef CONFIG_ARCH_RANDOM # include <asm/archrandom.h> #else static inline bool arch_get_random_long(unsigned long *v) { return 0; } static inline bool arch_get_random_int(unsigned int *v) { return 0; } static inline bool arch_has_random(void) { return 0; } static inline bool arch_get_random_seed_long(unsigned long *v) { return 0; } static inline bool arch_get_random_seed_int(unsigned int *v) { return 0; } static inline bool arch_has_random_seed(void) { return 0; } #endif /* Pseudo random number generator from numerical recipes. */ static inline u32 next_pseudo_random32(u32 seed) { return seed * 1664525 + 1013904223; } #endif /* _LINUX_RANDOM_H */
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #ifndef foosdresolvehfoo #define foosdresolvehfoo /*** This file is part of systemd. Copyright 2005-2014 Lennart Poettering systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <inttypes.h> #include <netdb.h> #include <sys/socket.h> #include <sys/types.h> #include "sd-event.h" #include "_sd-common.h" _SD_BEGIN_DECLARATIONS; /* An opaque sd-resolve session structure */ typedef struct sd_resolve sd_resolve; /* An opaque sd-resolve query structure */ typedef struct sd_resolve_query sd_resolve_query; /* A callback on completion */ typedef int (*sd_resolve_getaddrinfo_handler_t)(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata); typedef int (*sd_resolve_getnameinfo_handler_t)(sd_resolve_query *q, int ret, const char *host, const char *serv, void *userdata); enum { SD_RESOLVE_GET_HOST = 1ULL, SD_RESOLVE_GET_SERVICE = 2ULL, SD_RESOLVE_GET_BOTH = 3ULL }; int sd_resolve_default(sd_resolve **ret); /* Allocate a new sd-resolve session. */ int sd_resolve_new(sd_resolve **ret); /* Free a sd-resolve session. This destroys all attached * sd_resolve_query objects automatically. */ sd_resolve* sd_resolve_unref(sd_resolve *resolve); sd_resolve* sd_resolve_ref(sd_resolve *resolve); /* Return the UNIX file descriptor to poll() for events on. Use this * function to integrate sd-resolve with your custom main loop. */ int sd_resolve_get_fd(sd_resolve *resolve); /* Return the poll() events (a combination of flags like POLLIN, * POLLOUT, ...) to check for. */ int sd_resolve_get_events(sd_resolve *resolve); /* Return the poll() timeout to pass. Returns (uint64_t) -1 as * timeout if no timeout is needed. */ int sd_resolve_get_timeout(sd_resolve *resolve, uint64_t *timeout_usec); /* Process pending responses. After this function is called, you can * get the next completed query object(s) using * sd_resolve_get_next(). */ int sd_resolve_process(sd_resolve *resolve); /* Wait for a resolve event to complete. */ int sd_resolve_wait(sd_resolve *resolve, uint64_t timeout_usec); int sd_resolve_get_tid(sd_resolve *resolve, pid_t *tid); int sd_resolve_attach_event(sd_resolve *resolve, sd_event *e, int priority); int sd_resolve_detach_event(sd_resolve *resolve); sd_event *sd_resolve_get_event(sd_resolve *resolve); /* Issue a name-to-address query on the specified session. The * arguments are compatible with those of libc's * getaddrinfo(3). The function returns a new query object. When the * query is completed, you may retrieve the results using * sd_resolve_getaddrinfo_done(). */ int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata); /* Issue an address-to-name query on the specified session. The * arguments are compatible with those of libc's * getnameinfo(3). The function returns a new query object. When the * query is completed, you may retrieve the results using * sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero * if you want to query the hostname (resp. the service name). */ int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **q, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata); sd_resolve_query *sd_resolve_query_ref(sd_resolve_query* q); sd_resolve_query *sd_resolve_query_unref(sd_resolve_query* q); /* Returns non-zero when the query operation specified by q has been completed. */ int sd_resolve_query_is_done(sd_resolve_query*q); void *sd_resolve_query_get_userdata(sd_resolve_query *q); void *sd_resolve_query_set_userdata(sd_resolve_query *q, void *userdata); sd_resolve *sd_resolve_query_get_resolve(sd_resolve_query *q); _SD_END_DECLARATIONS; #endif
/* * Ekiga -- A VoIP and Video-Conferencing application * Copyright (C) 2000-2009 Damien Sandras <dsandras@seconix.com> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. This program is distributed in the hope * that it will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * Ekiga is licensed under the GPL license and as a special exception, you * have permission to link or otherwise combine this program with the * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB * programs, as long as you do follow the requirements of the GNU GPL for all * the rest of the software thus combined. */ /* * form-request.h - description * ------------------------------------------ * begin : written in 2007 by Julien Puydt * copyright : (c) 2007 by Julien Puydt * description : declaration of a request form * */ #ifndef __FORM_REQUEST_H__ #define __FORM_REQUEST_H__ #include "form.h" namespace Ekiga { /** * @addtogroup forms * @{ */ class FormRequest: public virtual Form { public: virtual void cancel () = 0; virtual void submit (Form &) = 0; }; /** * @} */ }; #endif
/* * Copyright 2020 Canonical Ltd. * * 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.1 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 Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cc-cursor-blinking-dialog.h" #define INTERFACE_SETTINGS "org.gnome.desktop.interface" #define KEY_CURSOR_BLINKING "cursor-blink" #define KEY_CURSOR_BLINKING_TIME "cursor-blink-time" struct _CcCursorBlinkingDialog { GtkDialog parent; GtkScale *blink_time_scale; GtkSwitch *enable_switch; GSettings *interface_settings; }; G_DEFINE_TYPE (CcCursorBlinkingDialog, cc_cursor_blinking_dialog, GTK_TYPE_DIALOG); static void cc_cursor_blinking_dialog_dispose (GObject *object) { CcCursorBlinkingDialog *self = CC_CURSOR_BLINKING_DIALOG (object); g_clear_object (&self->interface_settings); G_OBJECT_CLASS (cc_cursor_blinking_dialog_parent_class)->dispose (object); } static void cc_cursor_blinking_dialog_class_init (CcCursorBlinkingDialogClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); object_class->dispose = cc_cursor_blinking_dialog_dispose; gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/universal-access/cc-cursor-blinking-dialog.ui"); gtk_widget_class_bind_template_child (widget_class, CcCursorBlinkingDialog, blink_time_scale); gtk_widget_class_bind_template_child (widget_class, CcCursorBlinkingDialog, enable_switch); } static void cc_cursor_blinking_dialog_init (CcCursorBlinkingDialog *self) { gtk_widget_init_template (GTK_WIDGET (self)); self->interface_settings = g_settings_new (INTERFACE_SETTINGS); g_settings_bind (self->interface_settings, KEY_CURSOR_BLINKING, self->enable_switch, "active", G_SETTINGS_BIND_DEFAULT); g_settings_bind (self->interface_settings, KEY_CURSOR_BLINKING_TIME, gtk_range_get_adjustment (GTK_RANGE (self->blink_time_scale)), "value", G_SETTINGS_BIND_DEFAULT); } CcCursorBlinkingDialog * cc_cursor_blinking_dialog_new (void) { return g_object_new (cc_cursor_blinking_dialog_get_type (), "use-header-bar", TRUE, NULL); }
/* * RTEMS Monitor partition support * * $Id: mon-part.c,v 1.7 2010/04/12 15:25:43 ralf Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <rtems.h> #include "monitor.h" #include <rtems/rtems/attr.inl> #include <stdio.h> #include <string.h> /* memcpy() */ void rtems_monitor_part_canonical( rtems_monitor_part_t *canonical_part, void *part_void ) { Partition_Control *rtems_part = (Partition_Control *) part_void; canonical_part->attribute = rtems_part->attribute_set; canonical_part->start_addr = rtems_part->starting_address; canonical_part->length = rtems_part->length; canonical_part->buf_size = rtems_part->buffer_size; canonical_part->used_blocks = rtems_part->number_of_used_blocks; } void rtems_monitor_part_dump_header( bool verbose __attribute__((unused)) ) { printf("\ ID NAME ATTR STARTADDR LENGTH BUF_SIZE USED_BLOCKS\n"); /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 1 2 3 4 5 6 7 */ rtems_monitor_separator(); } /* */ void rtems_monitor_part_dump( rtems_monitor_part_t *monitor_part, bool verbose __attribute__((unused)) ) { int length = 0; length += rtems_monitor_dump_id(monitor_part->id); length += rtems_monitor_pad(11, length); length += rtems_monitor_dump_name(monitor_part->id); length += rtems_monitor_pad(18, length); length += rtems_monitor_dump_attributes(monitor_part->attribute); length += rtems_monitor_pad(30, length); length += rtems_monitor_dump_addr(monitor_part->start_addr); length += rtems_monitor_pad(40, length); length += rtems_monitor_dump_hex(monitor_part->length); length += rtems_monitor_pad(50, length); length += rtems_monitor_dump_hex(monitor_part->buf_size); length += rtems_monitor_pad(60, length); length += rtems_monitor_dump_hex(monitor_part->used_blocks); printf("\n"); }
/* * THIS FILE IS NOT IDENTICAL TO THE ORIGINAL * FROM THE BZIP2 DISTRIBUTION. * * It has been modified, mainly to break the library * into smaller pieces. * * Russ Cox * rsc@plan9.bell-labs.com * July 2000 */ /*-------------------------------------------------------------*/ /*--- Library top-level functions. ---*/ /*--- bzlib.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2000 Julian R Seward. 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. 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. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@acm.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ /*-- CHANGES ~~~~~~~ 0.9.0 -- original version. 0.9.0a/b -- no changes in this file. 0.9.0c * made zero-length BZ_FLUSH work correctly in bzCompress(). * fixed bzWrite/bzRead to ignore zero-length requests. * fixed bzread to correctly handle read requests after EOF. * wrong parameter order in call to bzDecompressInit in bzBuffToBuffDecompress. Fixed. --*/ #include "os.h" #include "bzlib.h" #include "bzlib_private.h" #include "bzlib_stdio.h" #include "bzlib_stdio_private.h" Bool bz_feof ( FILE* f ) { Int32 c = fgetc ( f ); if (c == EOF) return True; ungetc ( c, f ); return False; }
/* This file is part of the KDE project Copyright (C) 2008 Dag Andersen <danders@get2net.dk> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KPlato_AppointmentIntervalTester_h #define KPlato_AppointmentIntervalTester_h #include <QtTest/QtTest> namespace KPlato { class AppointmentIntervalTester : public QObject { Q_OBJECT private slots: void addInterval(); void addAppointment(); void addTangentIntervals(); void subtractList(); }; } #endif
/* ============================================================ * * This file is a part of kipi-plugins project * http://www.digikam.org * * Date : 2006-10-12 * Description : IPTC credits settings page. * * Copyright (C) 2006-2012 by Gilles Caulier <caulier dot gilles at gmail dot com> * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, 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. * * ============================================================ */ #ifndef IPTC_CREDITS_H #define IPTC_CREDITS_H // Qt includes #include <QWidget> #include <QByteArray> namespace KIPIMetadataEditPlugin { class IPTCCredits : public QWidget { Q_OBJECT public: explicit IPTCCredits(QWidget* const parent); ~IPTCCredits(); void applyMetadata(QByteArray& iptcData); void readMetadata(QByteArray& iptcData); Q_SIGNALS: void signalModified(); private: class IPTCCreditsPriv; IPTCCreditsPriv* const d; }; } // namespace KIPIMetadataEditPlugin #endif // IPTC_CREDITS_H
/** ****************************************************************************** * @file USB_Host/FWupgrade_Standalone/Inc/command.h * @author MCD Application Team * @version V1.3.1 * @date 09-October-2015 * @brief Header file for command.c ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2015 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 __COMMAND_H #define __COMMAND_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "flash_if.h" #include "main.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macros -----------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void COMMAND_Upload(void); void COMMAND_Download(void); void COMMAND_Jump(void); #ifdef __cplusplus } #endif #endif /* __COMMAND_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* FOGSim, simulator for interconnection networks. https://code.google.com/p/fogsim/ Copyright (C) 2014 University of Cantabria 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 class_gmodule #define class_gmodule #include <iostream> #include <string> #include <cstring> #include <cstdio> #include <string.h> #include <stdlib.h> #include <assert.h> using namespace std; class gModule { public: string name; gModule(); gModule(string name); virtual ~gModule(); virtual void action(); }; #endif
/* * $Id$ * * nonce-count (nc) tracking * * Copyright (C) 2008 iptelorg GmbH * * This file is part of ser, a free SIP server. * * ser 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 * * ser 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 */ /* * Defines: * USE_NC - if not defined no NC specific code will be compiled */ /* * History: * -------- * 2008-07-04 initial version (andrei) */ #ifndef _nc_h #define _nc_h extern int nc_enabled; /* instead of storing only the 2^k size we store also k * for faster operations */ extern unsigned nc_array_k; /* array size bits (k in 2^k) */ extern unsigned nc_array_size; /* 2^k == 1<<nc_array_bits */ #ifdef USE_NC #include "nid.h" /* nid_t */ #include "../../atomic_ops.h" /* default number of maximum in-flight nonces */ #define DEFAULT_NC_ARRAY_SIZE 1024*1024 /* uses 1Mb of memory */ #define MIN_NC_ARRAY_SIZE 102400 /* warn if size < 100k */ #define MAX_NC_ARRAY_SIZE 1024*1024*1024 /* warn if size > 1Gb */ #define MIN_NC_ARRAY_PARTITION 65536 /* warn if a partition is < 65k */ typedef unsigned char nc_t; int init_nonce_count(); void destroy_nonce_count(); enum nc_check_ret{ NC_OK=0, NC_INV_POOL=-1, NC_ID_OVERFLOW=-2, NC_TOO_BIG=-3, NC_REPLAY=-4 }; /* check if nonce-count nc w/ index i is expected/valid and record its * value */ enum nc_check_ret nc_check_val(nid_t i, unsigned pool, unsigned int nc); /* re-init the stored nc for nonce id in pool pool_no */ nid_t nc_new(nid_t id, unsigned char pool_no); #endif /* USE_NC */ #endif /* _nc_h */
#include <linux/types.h> #include <linux/ioctl.h> #include <linux/miscdevice.h> struct modem_dev { const char *name; struct miscdevice miscdev; struct work_struct work; }; /* 耳机数据结构体 */ struct rk29_mu509_data { int (*io_init)(void); int (*io_deinit)(void); unsigned int bp_power; unsigned int bp_power_active_low; unsigned int bp_reset; unsigned int bp_reset_active_low; unsigned int bp_wakeup_ap; unsigned int ap_wakeup_bp; }; #define MODEM_NAME "mu509"
/** * CityDrain3 is an open source software for modelling and simulating integrated * urban drainage systems. * * Copyright (C) 2012 Gregor Burger * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; version 2 of the License. * * 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 SEWER_H #define SEWER_H #include <node.h> #include <flow.h> #include <vector> #include <map> class Sewer : public Node { public: Sewer(); virtual ~Sewer(); bool init(ptime start, ptime end, int dt); int f(ptime time, int dt); void deinit(); private: void addMuskParam(int dt); void setMuskParam(double *C_x, double *C_y, int dt); private: Flow in; Flow out; int K; double X; int N; std::vector<Flow*> V; std::map<int, std::pair<double, double> > musk_param; }; #endif // SEWER_H
/* stream received on pressing 'play' 00 tlabel, ptype, cr, ipid 11 pid1 0e pid0 00 ctype control 48 panel subunit/unit 0 7c passthrough opcode 44 play 00 data length is 0 reply should be: 02 tlabel, ptype, cr reply, ipid 11 pid1 0e pid0 09 control accepted 48 panel subunit/unit 0 7c passthrough opcode 44 play 00 data length is 0 play-> 44, c4 next-> 4b, cb prev-> 4c, cc */ struct avctp_header { uint8_t ipid:1; uint8_t cr:1; uint8_t packet_type:2; uint8_t transaction_label:4; uint16_t pid; } __attribute__ ((packed)); struct avc_frame { struct avctp_header header; uint8_t ctype:4; uint8_t zeroes:4; uint8_t subunit_id:3; uint8_t subunit_type:5; uint8_t opcode; uint8_t operand0; uint8_t operand1; } __attribute__ ((packed)); // avrcp p. 49 for operand examples unit/subunit/passthrough // Message types #define AVCTP_COMMAND_FRAME 0 #define AVCTP_RESPONSE_FRAME 1 // Packet types #define PACKET_TYPE_SINGLE 0 #define PACKET_TYPE_START 1 #define PACKET_TYPE_CONTINUE 2 #define PACKET_TYPE_END 3 // AVRCP profile pid #define AVRCP_PID 0x0e11 // we define the psm #define L2CAP_PSM_AVCTP 0x0017 // ctype entries #define CMD_PASSTHROUGH 0 #define CMD_ACCEPTED 9 // opcodes #define OP_PASS 0x7c // subunits of interest #define SUBUNIT_PANEL 9 // operands in passthrough commands #define VOLUP_OP 0x41 #define VOLDOWN_OP 0x42 #define MUTE_OP 0x43 #define PLAY_OP 0x44 #define STOP_OP 0x45 #define PAUSE_OP 0x46 #define NEXT_OP 0x4b #define PREV_OP 0x4c
/** * @file rem_audio.h Wrapper for all Audio header files * * Copyright (C) 2010 Creytiv.com */ #include "rem_au.h" #include "rem_aubuf.h" #include "rem_aufile.h" #include "rem_autone.h" #include "rem_aumix.h" #include "rem_fir.h" #include "rem_auresamp.h" #include "rem_g711.h"
/* * Copyright (C) 2001 Peter Kelly (pmk@post.com) * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) * Copyright (C) 2003, 2004, 2005, 2006, 2013 Apple Computer, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef MouseRelatedEvent_h #define MouseRelatedEvent_h #include "LayoutPoint.h" #include "UIEventWithKeyState.h" namespace WebCore { // Internal only: Helper class for what's common between mouse and wheel events. class MouseRelatedEvent : public UIEventWithKeyState { public: // Note that these values are adjusted to counter the effects of zoom, so that values // exposed via DOM APIs are invariant under zooming. int screenX() const { return m_screenLocation.x(); } int screenY() const { return m_screenLocation.y(); } const IntPoint& screenLocation() const { return m_screenLocation; } int clientX() const { return m_clientLocation.x(); } int clientY() const { return m_clientLocation.y(); } #if ENABLE(POINTER_LOCK) int webkitMovementX() const { return m_movementDelta.x(); } int webkitMovementY() const { return m_movementDelta.y(); } #endif const LayoutPoint& clientLocation() const { return m_clientLocation; } int layerX() override; int layerY() override; int offsetX(); int offsetY(); bool isSimulated() const { return m_isSimulated; } virtual int pageX() const override; virtual int pageY() const override; virtual const LayoutPoint& pageLocation() const; int x() const; int y() const; // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords, // usable with RenderObject::absoluteToLocal). const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; } void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; } protected: MouseRelatedEvent(); MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>, int detail, const IntPoint& screenLocation, const IntPoint& windowLocation, #if ENABLE(POINTER_LOCK) const IntPoint& movementDelta, #endif bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false); void initCoordinates(); void initCoordinates(const LayoutPoint& clientLocation); virtual void receivedTarget() override; void computePageLocation(); void computeRelativePosition(); // Expose these so MouseEvent::initMouseEvent can set them. IntPoint m_screenLocation; LayoutPoint m_clientLocation; #if ENABLE(POINTER_LOCK) LayoutPoint m_movementDelta; #endif private: LayoutPoint m_pageLocation; LayoutPoint m_layerLocation; LayoutPoint m_offsetLocation; LayoutPoint m_absoluteLocation; bool m_isSimulated; bool m_hasCachedRelativePosition; }; } // namespace WebCore #endif // MouseRelatedEvent_h
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues. Copyright (C) 2009-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>. */ /* Written by Eric Blake. */ /* * POSIX 2008 <stddef.h> for platforms that have issues. * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html> */ #if __GNUC__ >= 3 #endif #if defined __need_wchar_t || defined __need_size_t \ || defined __need_ptrdiff_t || defined __need_NULL \ || defined __need_wint_t /* Special invocation convention inside gcc header files. In particular, gcc provides a version of <stddef.h> that blindly redefines NULL even when __need_wint_t was defined, even though wint_t is not normally provided by <stddef.h>. Hence, we must remember if special invocation has ever been used to obtain wint_t, in which case we need to clean up NULL yet again. */ # if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t # define _GL_STDDEF_WINT_T # endif #if (_MSC_VER < 1900) #include "../include/stddef.h" #else #include "../ucrt/stddef.h" #endif # endif #else /* Normal invocation convention. */ # ifndef _GL_STDDEF_H /* The include_next requires a split double-inclusion guard. */ #if (_MSC_VER < 1900) #include "../include/stddef.h" #else #include "../ucrt/stddef.h" #endif /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ # if (0 \ && (!defined _GL_STDDEF_H || defined _GL_STDDEF_WINT_T)) # undef NULL # ifdef __cplusplus /* ISO C++ says that the macro NULL must expand to an integer constant expression, hence '((void *) 0)' is not allowed in C++. */ # if __GNUG__ >= 3 /* GNU C++ has a __null macro that behaves like an integer ('int' or 'long') but has the same size as a pointer. Use that, to avoid warnings. */ # define NULL __null # else # define NULL 0L # endif # else # define NULL ((void *) 0) # endif # endif # ifndef _GL_STDDEF_H # define _GL_STDDEF_H /* Some platforms lack wchar_t. */ #if !1 # define wchar_t int #endif /* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is a hack in case the configure-time test was done with g++ even though we are currently compiling with gcc. On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was included. Its definition is good since it has an alignment of 8 (on x86 and x86_64). */ #if defined _MSC_VER && defined __cplusplus # include <cstddef> #else # if ! (0 || defined _GCC_MAX_ALIGN_T) # if !GNULIB_defined_max_align_t /* On the x86, the maximum storage alignment of double, long, etc. is 4, but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, and the C11 standard allows this. Work around this problem by using __alignof__ (which returns 8 for double) rather than _Alignof (which returns 4), and align each union member accordingly. */ # ifdef __GNUC__ # define _GL_STDDEF_ALIGNAS(type) \ __attribute__ ((__aligned__ (__alignof__ (type)))) # else # define _GL_STDDEF_ALIGNAS(type) /* */ # endif typedef union { char *__p _GL_STDDEF_ALIGNAS (char *); double __d _GL_STDDEF_ALIGNAS (double); long double __ld _GL_STDDEF_ALIGNAS (long double); long int __i _GL_STDDEF_ALIGNAS (long int); } rpl_max_align_t; # define max_align_t rpl_max_align_t # define GNULIB_defined_max_align_t 1 # endif # endif #endif # endif /* _GL_STDDEF_H */ # endif /* _GL_STDDEF_H */ #endif /* __need_XXX */
/* Copyright (c) 2002,2007-2012, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __KGSL_SHAREDMEM_H #define __KGSL_SHAREDMEM_H #include <linux/slab.h> #include <linux/dma-mapping.h> #include <linux/vmalloc.h> #include "kgsl_mmu.h" #include <linux/slab.h> #include <linux/kmemleak.h> struct kgsl_device; struct kgsl_process_private; #define KGSL_CACHE_OP_INV 0x01 #define KGSL_CACHE_OP_FLUSH 0x02 #define KGSL_CACHE_OP_CLEAN 0x03 /** Set if the memdesc describes cached memory */ #define KGSL_MEMFLAGS_CACHED 0x00000001 /** Set if the memdesc is mapped into all pagetables */ #define KGSL_MEMFLAGS_GLOBAL 0x00000002 extern struct kgsl_memdesc_ops kgsl_page_alloc_ops; int kgsl_sharedmem_page_alloc(struct kgsl_memdesc *memdesc, struct kgsl_pagetable *pagetable, size_t size); int kgsl_sharedmem_page_alloc_user(struct kgsl_memdesc *memdesc, struct kgsl_pagetable *pagetable, size_t size, int flags); int kgsl_sharedmem_alloc_coherent(struct kgsl_memdesc *memdesc, size_t size); int kgsl_sharedmem_ebimem_user(struct kgsl_memdesc *memdesc, struct kgsl_pagetable *pagetable, size_t size, int flags); int kgsl_sharedmem_ebimem(struct kgsl_memdesc *memdesc, struct kgsl_pagetable *pagetable, size_t size); void kgsl_sharedmem_free(struct kgsl_memdesc *memdesc); int kgsl_sharedmem_readl(const struct kgsl_memdesc *memdesc, uint32_t *dst, unsigned int offsetbytes); int kgsl_sharedmem_writel(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, uint32_t src); int kgsl_sharedmem_set(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, unsigned int value, unsigned int sizebytes); void kgsl_cache_range_op(struct kgsl_memdesc *memdesc, int op); void kgsl_process_init_sysfs(struct kgsl_process_private *private); void kgsl_process_uninit_sysfs(struct kgsl_process_private *private); int kgsl_sharedmem_init_sysfs(void); void kgsl_sharedmem_uninit_sysfs(void); static inline unsigned int kgsl_get_sg_pa(struct scatterlist *sg) { /* * Try sg_dma_address first to support ion carveout * regions which do not work with sg_phys(). */ unsigned int pa = sg_dma_address(sg); if (pa == 0) pa = sg_phys(sg); return pa; } int kgsl_sharedmem_map_vma(struct vm_area_struct *vma, const struct kgsl_memdesc *memdesc); /* * For relatively small sglists, it is preferable to use kzalloc * rather than going down the vmalloc rat hole. If the size of * the sglist is < PAGE_SIZE use kzalloc otherwise fallback to * vmalloc */ static inline void *kgsl_sg_alloc(unsigned int sglen) { if ((sglen * sizeof(struct scatterlist)) < PAGE_SIZE) return kzalloc(sglen * sizeof(struct scatterlist), GFP_KERNEL); else return vmalloc(sglen * sizeof(struct scatterlist)); } static inline void kgsl_sg_free(void *ptr, unsigned int sglen) { if ((sglen * sizeof(struct scatterlist)) < PAGE_SIZE) kfree(ptr); else vfree(ptr); } static inline int memdesc_sg_phys(struct kgsl_memdesc *memdesc, unsigned int physaddr, unsigned int size) { memdesc->sg = kgsl_sg_alloc(1); kmemleak_not_leak(memdesc->sg); memdesc->sglen = 1; sg_init_table(memdesc->sg, 1); memdesc->sg[0].length = size; memdesc->sg[0].offset = 0; memdesc->sg[0].dma_address = physaddr; return 0; } static inline int kgsl_allocate(struct kgsl_memdesc *memdesc, struct kgsl_pagetable *pagetable, size_t size) { if (kgsl_mmu_get_mmutype() == KGSL_MMU_TYPE_NONE) return kgsl_sharedmem_ebimem(memdesc, pagetable, size); return kgsl_sharedmem_page_alloc(memdesc, pagetable, size); } static inline int kgsl_allocate_user(struct kgsl_memdesc *memdesc, struct kgsl_pagetable *pagetable, size_t size, unsigned int flags) { if (kgsl_mmu_get_mmutype() == KGSL_MMU_TYPE_NONE) return kgsl_sharedmem_ebimem_user(memdesc, pagetable, size, flags); return kgsl_sharedmem_page_alloc_user(memdesc, pagetable, size, flags); } static inline int kgsl_allocate_contiguous(struct kgsl_memdesc *memdesc, size_t size) { int ret = kgsl_sharedmem_alloc_coherent(memdesc, size); if (!ret && (kgsl_mmu_get_mmutype() == KGSL_MMU_TYPE_NONE)) memdesc->gpuaddr = memdesc->physaddr; return ret; } #endif /* __KGSL_SHAREDMEM_H */
/* * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _XENO_POSIX_SIGNAL_H #define _XENO_POSIX_SIGNAL_H #if defined(__KERNEL__) || defined(__XENO_SIM__) #include <nucleus/xenomai.h> #ifdef __KERNEL__ #include <linux/signal.h> /* These are not defined in kernel-space headers. */ #define sa_sigaction sa_handler typedef void (*sighandler_t) (int sig); typedef unsigned long sig_atomic_t; #endif /* __KERNEL__ */ #ifdef __XENO_SIM__ #include <posix_overrides.h> #endif /* __XENO_SIM__ */ #undef sigemptyset #undef sigfillset #undef sigaddset #undef sigdelset #undef sigismember #undef sigaction #undef sigqueue #undef SIGRTMIN #undef SIGRTMAX #define sigaction(sig, action, old) pse51_sigaction(sig, action, old) #define sigemptyset pse51_sigemptyset #define sigfillset pse51_sigfillset #define sigaddset pse51_sigaddset #define sigdelset pse51_sigdelset #define sigismember pse51_sigismember #define SIGRTMIN 33 #define SIGRTMAX 64 struct pse51_thread; #ifdef __cplusplus extern "C" { #endif int sigemptyset(sigset_t *set); int sigfillset(sigset_t *set); int sigaddset(sigset_t *set, int signum); int sigdelset(sigset_t *set, int signum); int sigismember(const sigset_t *set, int signum); int pthread_kill(struct pse51_thread *thread, int sig); int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset); int sigaction(int sig, const struct sigaction *action, struct sigaction *old); int sigpending(sigset_t *set); int sigwait(const sigset_t *set, int *sig); /* Real-time signals. */ int sigwaitinfo(const sigset_t *__restrict__ set, siginfo_t *__restrict__ info); int sigtimedwait(const sigset_t *__restrict__ user_set, siginfo_t *__restrict__ info, const struct timespec *__restrict__ timeout); int pthread_sigqueue_np (struct pse51_thread *thread, int sig, union sigval value); #ifdef __cplusplus } #endif #else /* !(__KERNEL__ || __XENO_SIM__) */ #pragma GCC system_header #include_next <signal.h> /* In case signal.h is included for a side effect of an __need* macro, include it a second time to get all definitions. */ #include_next <signal.h> #endif /* !(__KERNEL__ || __XENO_SIM__) */ /* * Those are pseudo-signals only available with pthread_kill() to * suspend/resume/unblock threads synchronously via the low-level * nucleus interface. Can't block them, queue them, or even set them * in a sigset. Those are nasty, strictly anti-POSIX things; we do * provide them nevertheless only because we are mean people doing * harmful code for no valid reason. Can't go against your nature, * right? Nah... (this said, don't blame us for POSIX, we are not * _that_ mean). */ #define SIGSUSP (SIGRTMAX + 1) #define SIGRESM (SIGRTMAX + 2) #define SIGRELS (SIGRTMAX + 3) #endif /* _XENO_POSIX_SIGNAL_H */
#include <stdio.h> #include <stdlib.h> #include <sql.h> #include <sqlext.h> #define display_error(a,b) display_error_msg(a,b,__LINE__) void display_error_msg( SQLSMALLINT type, SQLHANDLE handle, int lineno ) { SQLRETURN ret; SQLINTEGER i = 0, native; SQLCHAR state[7], text[256]; SQLSMALLINT len; fprintf(stderr, " test_connect.c line %i:\n", lineno); do { ret = SQLGetDiagRec(type, handle, ++i, state, &native, text, sizeof(text), &len); if (SQL_SUCCEEDED(ret)) { fprintf(stderr, "%s:%ld:%ld:%s\n", state, i, native, text); } } while (ret == SQL_SUCCESS); } int main(int argc, char *argv[]) { SQLHENV henv; SQLHDBC hdbc; SQLHSTMT hstmt; SQLRETURN ret; SQLCHAR dbms_name[256], dbms_ver[256]; SQLSMALLINT columns; int row = 0; ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv); if (!SQL_SUCCEEDED(ret)) { display_error(SQL_HANDLE_ENV, henv); exit(-1); } ret = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); if (!SQL_SUCCEEDED(ret)) { display_error(SQL_HANDLE_ENV, henv); SQLFreeHandle(SQL_HANDLE_ENV, henv); exit(-1); } ret = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc); if (!SQL_SUCCEEDED(ret)) { display_error(SQL_HANDLE_ENV, henv); SQLFreeHandle(SQL_HANDLE_ENV, henv); exit(-1); } // SQLSetConnectAttr(hdbc, SQL_LOGIN_TIMEOUT, (SQLPOINTER*)5, 0); // FreeTDS krasjer på SQLDriverConnect! Derfor bruker vi SQLConnect istedet. ret = SQLConnect(hdbc, (SQLCHAR*) "adventure", SQL_NTS, (SQLCHAR*) "ax", SQL_NTS, (SQLCHAR*) "Ju13brz;", SQL_NTS); /* ret = SQLDriverConnect(hdbc, NULL, "DSN=adventure;UID=ax;PWD={Ju13brz;}", SQL_NTS, output, sizeof(output), &outputlen, SQL_DRIVER_COMPLETE); */ if (ret==SQL_SUCCESS_WITH_INFO) display_error(SQL_HANDLE_DBC, hdbc); if (!SQL_SUCCEEDED(ret)) { display_error(SQL_HANDLE_DBC, hdbc); SQLFreeHandle(SQL_HANDLE_DBC, hdbc); SQLFreeHandle(SQL_HANDLE_ENV, henv); exit(-1); } fprintf(stderr, "ODBC Crawler: Connected to '%s'!\n", "adventure"); SQLGetInfo(hdbc, SQL_DBMS_NAME, (SQLPOINTER)dbms_name, sizeof(dbms_name), NULL); SQLGetInfo(hdbc, SQL_DBMS_VER, (SQLPOINTER)dbms_ver, sizeof(dbms_ver), NULL); fprintf(stderr, "DBMS Name: %s\n", dbms_name); fprintf(stderr, "DBMS Version: %s\n", dbms_ver); ret = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt); if (ret!=SQL_SUCCESS) display_error(SQL_HANDLE_STMT, hstmt); // ret = SQLTables(hstmt, SQL_ALL_CATALOGS, SQL_NTS, "", 0, "", 0, NULL, 0); // ret = SQLTables(hstmt, NULL, 0, NULL, 0, NULL, 0, "TABLE", SQL_NTS); // ret = SQLTables(hstmt, NULL, 0, NULL, 0, "tablename", SQL_NTS, NULL, 0); // ret = SQLExecDirect(hstmt, "select FirstName, LastName from Person.Contact;", SQL_NTS); // ret = SQLTables(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0); // ret = SQLExecDirect(hstmt, "select name, type from AdventureWorks.sys.tables;", SQL_NTS); ret = SQLColumns(hstmt, NULL, 0, NULL, 0, "Individual", SQL_NTS, NULL, 0); if (ret!=SQL_SUCCESS) display_error(SQL_HANDLE_STMT, hstmt); ret = SQLNumResultCols(hstmt, &columns); if (ret!=SQL_SUCCESS) display_error(SQL_HANDLE_STMT, hstmt); while (SQL_SUCCEEDED(ret = SQLFetch(hstmt))) { int colw[5] = {14,15,45,5,4}; // int colw[5] = {45,2,3,3,3}; SQLUSMALLINT i; // printf("Row: %i\n", row++); row++; for (i=1; i<=columns; i++) { SQLINTEGER indicator; char buf[512]; ret = SQLGetData(hstmt, i, SQL_C_CHAR, buf, sizeof(buf), &indicator); if (SQL_SUCCEEDED(ret)) { if (indicator==SQL_NULL_DATA) strcpy(buf, "NULL"); // printf(" Column %u: %s\n", i, buf); // printf("| %-*.*s ", colw[i-1], colw[i-1], buf); printf("| %-10.10s ", buf); /* if (i<=3) printf("| %-16.16s ", buf); else printf("| %-5.5s ", buf); */ } } printf("|\n"); } SQLFreeHandle(SQL_HANDLE_STMT, hstmt); SQLDisconnect(hdbc); SQLFreeHandle(SQL_HANDLE_DBC, hdbc); SQLFreeHandle(SQL_HANDLE_ENV, henv); }
/* * IRC - Internet Relay Chat, nocodeschanmode.c * by Dylan Cochran * based on: * nocolorumode.c (C) 2003 Dominick Meglio * m_nocodes.c (C) Syzop * noquit.c (C) penna@clanintern-irc.de * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include "struct.h" #include "common.h" #include "sys.h" #include "numeric.h" #include "msg.h" #include "channel.h" #include <time.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _WIN32 #include <io.h> #endif #include <fcntl.h> #include "h.h" #include "proto.h" #ifdef STRIPBADWORDS #include "badwords.h" #endif #ifdef _WIN32 #include "version.h" #endif #define FLAG_NOCODES 'U' #define IsNoCodes(x) ((x)->mode.extmode & MODE_NOCODES) Cmode_t MODE_NOCODES = 0L; Cmode *ModeNoCodes; static Hook *CheckMsg; ModuleHeader MOD_HEADER(nocodeschmode) = { "nocodeschmode", "1.4", "codes stripping channelmode v1.4", "3.2-b8-1", NULL }; long CHMODE_NOCODES = 0L; char *h_nocodes_chanmsg(aClient *cptr, aClient *sptr, aChannel *acptr, char *text, int notice); DLLFUNC int MOD_INIT(nocodeschmode)(ModuleInfo *modinfo) { CmodeInfo ModeNC; #ifndef STATIC_LINKING ModuleSetOptions(modinfo->handle, MOD_OPT_PERM); #endif memset(&ModeNoCodes, 0, sizeof ModeNoCodes); ModeNC.paracount = 0; ModeNC.is_ok = extcmode_default_requirechop; ModeNC.flag = FLAG_NOCODES; ModeNoCodes = CmodeAdd(modinfo->handle, ModeNC, &MODE_NOCODES); #ifndef STATIC_LINKING if (ModuleGetError(modinfo->handle) != MODERR_NOERROR || !ModeNoCodes) { config_error("Error adding channel mode +%c when loading module %s: %s", ModeNC.flag,MOD_HEADER(nocodeschmode).name,ModuleGetErrorStr(modinfo->handle)); } #else if (!ModeNoCodes) { config_error("Error adding channel mode +%c when loading module %s:", ModeNC.flag,MOD_HEADER(nocodeschmode).name); } #endif HookAddPCharEx(modinfo->handle, HOOKTYPE_CHANMSG, h_nocodes_chanmsg); return MOD_SUCCESS; } DLLFUNC int MOD_LOAD(nocodeschmode)(int module_load) { return MOD_SUCCESS; } DLLFUNC int MOD_UNLOAD(nocodeschmode)(int module_unload) { return MOD_SUCCESS; } char *h_nocodes_chanmsg(aClient *cptr, aClient *sptr, aChannel *acptr, char *text, int notice) { static char retbuf[4096]; if (IsULine(sptr) || IsServer(sptr)) { return text; } if (IsNoCodes(acptr)) { strncpyzt(retbuf, StripControlCodes(text), sizeof(retbuf)); return retbuf; } else { return text; } }
#include <stdlib.h> static void * alloc1(void); static void * alloc2(void); static void * alloc3(void); static void * alloc4(void); static void * alloc5(void); static void free1(void *ptr); static void free2(void *ptr); static void free3(void *ptr); static void free4(void *ptr); static void free5(void *ptr); static void * alloc1(void) { return alloc2(); } static void * alloc2(void) { return alloc3(); } static void * alloc3(void) { return alloc4(); } static void * alloc4(void) { return alloc5(); } static void * alloc5(void) { return malloc(1); } static void free1(void *ptr) { free2(ptr); } static void free2(void *ptr) { free3(ptr); } static void free3(void *ptr) { free4(ptr); } static void free4(void *ptr) { free5(ptr); } static void free5(void *ptr) { free(ptr); } int main(int argc, char *argv[]) { free1(alloc1()); return 0; }
/* * include/linux/fsl_devices.h * * Definitions for any platform device related flags or structures for * Freescale processor devices * * Maintainer: Kumar Gala (kumar.gala@freescale.com) * * Copyright 2004 Freescale Semiconductor, 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. */ #ifdef __KERNEL__ #ifndef _FSL_DEVICE_H_ #define _FSL_DEVICE_H_ #include <linux/types.h> /* * Some conventions on how we handle peripherals on Freescale chips * * unique device: a platform_device entry in fsl_plat_devs[] plus * associated device information in its platform_data structure. * * A chip is described by a set of unique devices. * * Each sub-arch has its own master list of unique devices and * enumerates them by enum fsl_devices in a sub-arch specific header * * The platform data structure is broken into two parts. The * first is device specific information that help identify any * unique features of a peripheral. The second is any * information that may be defined by the board or how the device * is connected externally of the chip. * * naming conventions: * - platform data structures: <driver>_platform_data * - platform data device flags: FSL_<driver>_DEV_<FLAG> * - platform data board flags: FSL_<driver>_BRD_<FLAG> * */ struct gianfar_platform_data { /* device specific information */ u32 device_flags; /* board specific information */ u32 board_flags; u32 bus_id; u32 phy_id; u8 mac_addr[6]; }; struct gianfar_mdio_data { /* board specific information */ int irq[32]; }; /* Flags related to gianfar device features */ #define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001 #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 #define FSL_GIANFAR_DEV_HAS_CSUM 0x00000010 #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020 #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040 #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080 /* Flags in gianfar_platform_data */ #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ #define FSL_GIANFAR_BRD_PHY_ANEG 0x00000004 /* always use autonegotiation */ struct fsl_i2c_platform_data { /* device specific information */ u32 device_flags; }; /* Flags related to I2C device features */ #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 #define FSL_I2C_DEV_CLOCK_5200 0x00000002 enum fsl_usb2_operating_modes { FSL_USB2_MPH_HOST, FSL_USB2_DR_HOST, FSL_USB2_DR_DEVICE, FSL_USB2_DR_OTG, }; enum fsl_usb2_phy_modes { FSL_USB2_PHY_NONE, FSL_USB2_PHY_ULPI, FSL_USB2_PHY_UTMI, FSL_USB2_PHY_UTMI_WIDE, FSL_USB2_PHY_SERIAL, }; struct fsl_usb2_platform_data { /* board specific information */ enum fsl_usb2_operating_modes operating_mode; enum fsl_usb2_phy_modes phy_mode; unsigned int port_enables; }; /* Flags in fsl_usb2_mph_platform_data */ #define FSL_USB2_PORT0_ENABLED 0x00000001 #define FSL_USB2_PORT1_ENABLED 0x00000002 /* Ethernet interface (phy management and speed) */ typedef enum enet_interface { ENET_10_MII, /* 10 Base T, MII interface */ ENET_10_RMII, /* 10 Base T, RMII interface */ ENET_10_RGMII, /* 10 Base T, RGMII interface */ ENET_100_MII, /* 100 Base T, MII interface */ ENET_100_RMII, /* 100 Base T, RMII interface */ ENET_100_RGMII, /* 100 Base T, RGMII interface */ ENET_1000_GMII, /* 1000 Base T, GMII interface */ ENET_1000_RGMII, /* 1000 Base T, RGMII interface */ ENET_1000_TBI, /* 1000 Base T, TBI interface */ ENET_1000_RTBI /* 1000 Base T, RTBI interface */ } enet_interface_e; struct ucc_geth_platform_data { /* device specific information */ u32 device_flags; u32 phy_reg_addr; /* board specific information */ u32 board_flags; u8 rx_clock; u8 tx_clock; u32 phy_id; enet_interface_e phy_interface; u32 phy_interrupt; u8 mac_addr[6]; }; /* Flags related to UCC Gigabit Ethernet device features */ #define FSL_UGETH_DEV_HAS_GIGABIT 0x00000001 #define FSL_UGETH_DEV_HAS_COALESCE 0x00000002 #define FSL_UGETH_DEV_HAS_RMON 0x00000004 /* Flags in ucc_geth_platform_data */ #define FSL_UGETH_BRD_HAS_PHY_INTR 0x00000001 /* if not set use a timer */ #endif /* _FSL_DEVICE_H_ */ #endif /* __KERNEL__ */
/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: ctscm.c /main/2 1996/05/09 04:01:14 drk $ */ /* * COMPONENT_NAME: austext * * FUNCTIONS: d_ctscm * * ORIGINS: 157 * * OBJECT CODE ONLY SOURCE MATERIALS */ /*----------------------------------------------------------------------- ctscm.c -- db_VISTA current member creation timestamp get module. (C) Copyright 1987 by Raima Corporation. -----------------------------------------------------------------------*/ /* ********************** EDIT HISTORY ******************************* SCR DATE INI DESCRIPTION ----- --------- --- ----------------------------------------------------- 04-Aug-88 RTK MULTI_TASK changes */ #include <stdio.h> #include "vista.h" #include "dbtype.h" #ifndef NO_TIMESTAMP /* Get creation timestamp of current member */ d_ctscm(set, timestamp TASK_PARM DBN_PARM) int set; ULONG FAR *timestamp; TASK_DECL DBN_DECL { INT rec; char FAR *rptr; SET_ENTRY FAR *set_ptr; DB_ENTER(DB_ID TASK_ID LOCK_SET(SET_IO)); if (nset_check(set, &set, (SET_ENTRY FAR * FAR *)&set_ptr) != S_OKAY) RETURN( db_status ); /* make sure we have a current member */ if ( ! curr_mem[set] ) RETURN( dberr(S_NOCM) ); /* read current member */ if ( dio_read( curr_mem[set], (char FAR * FAR *)&rptr , NOPGHOLD) != S_OKAY ) RETURN( db_status ); /* get record id */ bytecpy(&rec, rptr, sizeof(INT)); if ( rec >= 0 ) { rec &= ~RLBMASK; /* mask off rlb */ if (record_table[NUM2INT(rec, rt_offset)].rt_flags & TIMESTAMPED) bytecpy(timestamp, rptr + RECCRTIME, sizeof(ULONG)); else *timestamp = 0L; } else db_status = S_DELETED; RETURN( db_status ); } #endif /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin ctscm.c */
//+------------------------------------------------------------------------- // // Microsoft Windows // Copyright (c) Microsoft Corporation. All rights reserved. // // File: cguid.h // //-------------------------------------------------------------------------- #ifndef __CGUID_H__ #define __CGUID_H__ #if _MSC_VER > 1000 #pragma once #endif #ifdef __cplusplus extern "C" { #endif extern const IID GUID_NULL; extern const IID CATID_MARSHALER; extern const IID IID_IRpcChannel; extern const IID IID_IRpcStub; extern const IID IID_IStubManager; extern const IID IID_IRpcProxy; extern const IID IID_IProxyManager; extern const IID IID_IPSFactory; extern const IID IID_IInternalMoniker; extern const IID IID_IDfReserved1; extern const IID IID_IDfReserved2; extern const IID IID_IDfReserved3; extern const CLSID CLSID_StdMarshal; extern const CLSID CLSID_AggStdMarshal; extern const CLSID CLSID_StdAsyncActManager; extern const IID IID_IStub; extern const IID IID_IProxy; extern const IID IID_IEnumGeneric; extern const IID IID_IEnumHolder; extern const IID IID_IEnumCallback; extern const IID IID_IOleManager; extern const IID IID_IOlePresObj; extern const IID IID_IDebug; extern const IID IID_IDebugStream; extern const CLSID CLSID_PSGenObject; extern const CLSID CLSID_PSClientSite; extern const CLSID CLSID_PSClassObject; extern const CLSID CLSID_PSInPlaceActive; extern const CLSID CLSID_PSInPlaceFrame; extern const CLSID CLSID_PSDragDrop; extern const CLSID CLSID_PSBindCtx; extern const CLSID CLSID_PSEnumerators; extern const CLSID CLSID_StaticMetafile; extern const CLSID CLSID_StaticDib; extern const CLSID CID_CDfsVolume; extern const CLSID CLSID_DCOMAccessControl; extern const CLSID CLSID_StdGlobalInterfaceTable; extern const CLSID CLSID_ComBinding; extern const CLSID CLSID_StdEvent; extern const CLSID CLSID_ManualResetEvent; extern const CLSID CLSID_SynchronizeContainer; extern const CLSID CLSID_AddrControl; //******************************************** // // CD Forms CLSIDs // //******************************************** // // Form Kernel objects // extern const CLSID CLSID_CCDFormKrnl; extern const CLSID CLSID_CCDPropertyPage; extern const CLSID CLSID_CCDFormDialog; // // Control objects // extern const CLSID CLSID_CCDCommandButton; extern const CLSID CLSID_CCDComboBox; extern const CLSID CLSID_CCDTextBox; extern const CLSID CLSID_CCDCheckBox; extern const CLSID CLSID_CCDLabel; extern const CLSID CLSID_CCDOptionButton; extern const CLSID CLSID_CCDListBox; extern const CLSID CLSID_CCDScrollBar; extern const CLSID CLSID_CCDGroupBox; // // Property Pages // extern const CLSID CLSID_CCDGeneralPropertyPage; extern const CLSID CLSID_CCDGenericPropertyPage; extern const CLSID CLSID_CCDFontPropertyPage; extern const CLSID CLSID_CCDColorPropertyPage; extern const CLSID CLSID_CCDLabelPropertyPage; extern const CLSID CLSID_CCDCheckBoxPropertyPage; extern const CLSID CLSID_CCDTextBoxPropertyPage; extern const CLSID CLSID_CCDOptionButtonPropertyPage; extern const CLSID CLSID_CCDListBoxPropertyPage; extern const CLSID CLSID_CCDCommandButtonPropertyPage; extern const CLSID CLSID_CCDComboBoxPropertyPage; extern const CLSID CLSID_CCDScrollBarPropertyPage; extern const CLSID CLSID_CCDGroupBoxPropertyPage; extern const CLSID CLSID_CCDXObjectPropertyPage; extern const CLSID CLSID_CStdPropertyFrame; extern const CLSID CLSID_CFormPropertyPage; extern const CLSID CLSID_CGridPropertyPage; extern const CLSID CLSID_CWSJArticlePage; extern const CLSID CLSID_CSystemPage; extern const CLSID CLSID_IdentityUnmarshal; extern const CLSID CLSID_InProcFreeMarshaler; extern const CLSID CLSID_Picture_Metafile; extern const CLSID CLSID_Picture_EnhMetafile; extern const CLSID CLSID_Picture_Dib; // // Enumerations // extern const GUID GUID_TRISTATE; #ifdef __cplusplus } #endif #endif // __CGUID_H__
/* * Copyright (c) 2010, * Gavriloaie Eugen-Andrei (shiretu@gmail.com) * * This file is part of crtmpserver. * crtmpserver is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * crtmpserver is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with crtmpserver. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAS_PROTOCOL_RTP #ifndef _BASERTSPAPPPROTOCOLHANDLER_H #define _BASERTSPAPPPROTOCOLHANDLER_H #include "application/baseappprotocolhandler.h" #include "streaming/streamcapabilities.h" class RTSPProtocol; class BaseInNetStream; class OutboundConnectivity; class DLLEXP BaseRTSPAppProtocolHandler : public BaseAppProtocolHandler { public: BaseRTSPAppProtocolHandler(Variant &configuration); virtual ~BaseRTSPAppProtocolHandler(); virtual void RegisterProtocol(BaseProtocol *pProtocol); virtual void UnRegisterProtocol(BaseProtocol *pProtocol); virtual bool PullExternalStream(URI uri, Variant streamConfig); static bool SignalProtocolCreated(BaseProtocol *pProtocol, Variant &parameters); virtual bool HandleRTSPRequest(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPResponse(RTSPProtocol *pFrom, Variant &responseHeaders, string &responseContent); protected: //handle requests routines virtual bool HandleRTSPRequestOptions(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestDescribe(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestSetup(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestSetupOutbound(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestSetupInbound(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestPlay(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestTearDown(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestAnnounce(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); virtual bool HandleRTSPRequestRecord(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent); //handle response routines virtual bool HandleRTSPResponse(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse200(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse404(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse200Options(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse200Describe(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse200Setup(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse200Play(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); virtual bool HandleRTSPResponse404Play(RTSPProtocol *pFrom, Variant &requestHeaders, string &requestContent, Variant &responseHeaders, string &responseContent); //operations virtual bool Play(RTSPProtocol *pFrom); private: OutboundConnectivity *GetOutboundConnectivity(RTSPProtocol *pFrom); BaseInNetStream *GetInboundStream(string streamName); StreamCapabilities *GetInboundStreamCapabilities(string streamName); string GetAudioTrack(RTSPProtocol *pFrom, StreamCapabilities *pCapabilities); string GetVideoTrack(RTSPProtocol *pFrom, StreamCapabilities *pCapabilities); bool SendSetupTrackMessages(RTSPProtocol *pFrom, string sessionId); }; #endif /* _BASERTSPAPPPROTOCOLHANDLER_H */ #endif /* HAS_PROTOCOL_RTP */
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-cen-xr-w32-bld/build/storage/public/mozIStorageResultSet.idl */ #ifndef __gen_mozIStorageResultSet_h__ #define __gen_mozIStorageResultSet_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif class mozIStorageRow; /* forward declaration */ /* starting interface: mozIStorageResultSet */ #define MOZISTORAGERESULTSET_IID_STR "18dd7953-076d-4598-8105-3e32ad26ab24" #define MOZISTORAGERESULTSET_IID \ {0x18dd7953, 0x076d, 0x4598, \ { 0x81, 0x05, 0x3e, 0x32, 0xad, 0x26, 0xab, 0x24 }} class NS_NO_VTABLE NS_SCRIPTABLE mozIStorageResultSet : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(MOZISTORAGERESULTSET_IID) /** * Obtains the next row from the result set from the statement that was * executed. * * @returns the next row from the result set. This will be null when there * are no more results. */ /* mozIStorageRow getNextRow (); */ NS_SCRIPTABLE NS_IMETHOD GetNextRow(mozIStorageRow **_retval NS_OUTPARAM) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(mozIStorageResultSet, MOZISTORAGERESULTSET_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_MOZISTORAGERESULTSET \ NS_SCRIPTABLE NS_IMETHOD GetNextRow(mozIStorageRow **_retval NS_OUTPARAM); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_MOZISTORAGERESULTSET(_to) \ NS_SCRIPTABLE NS_IMETHOD GetNextRow(mozIStorageRow **_retval NS_OUTPARAM) { return _to GetNextRow(_retval); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_MOZISTORAGERESULTSET(_to) \ NS_SCRIPTABLE NS_IMETHOD GetNextRow(mozIStorageRow **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNextRow(_retval); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class _MYCLASS_ : public mozIStorageResultSet { public: NS_DECL_ISUPPORTS NS_DECL_MOZISTORAGERESULTSET _MYCLASS_(); private: ~_MYCLASS_(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(_MYCLASS_, mozIStorageResultSet) _MYCLASS_::_MYCLASS_() { /* member initializers and constructor code */ } _MYCLASS_::~_MYCLASS_() { /* destructor code */ } /* mozIStorageRow getNextRow (); */ NS_IMETHODIMP _MYCLASS_::GetNextRow(mozIStorageRow **_retval NS_OUTPARAM) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_mozIStorageResultSet_h__ */
/* Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG */ #if !defined(AFX_VMSFDMISSGENERATOR_H__A2BDF39E_ABE2_42D6_8CFA_D5B0C891BE75__INCLUDED_) #define AFX_VMSFDMISSGENERATOR_H__A2BDF39E_ABE2_42D6_8CFA_D5B0C891BE75__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif class vmsFDMISSGenerator { public: void Generate (LPCSTR pszOutputFile); vmsFDMISSGenerator(); virtual ~vmsFDMISSGenerator(); protected: BOOL m_bAddDownloadsFile; CString m_strDownloadsFile; BOOL m_bAddSiteLinkToFavorites; BOOL m_bModifyHomepage; CString m_strSiteIcoFile; BOOL m_bAddSiteLinkToStartMenu; CString m_strSiteLink; CString m_strOutputFile; CString m_strOutputFolder; CString m_strVersion; CString m_strInstallationName; CString m_strInputFolder; }; #endif
/* MN10200 ELF support for BFD. Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file holds definitions specific to the MN10200 ELF ABI. */ #ifndef _ELF_MN10200_H #define _ELF_MN10200_H #include "elf/reloc-macros.h" /* Relocations. */ START_RELOC_NUMBERS (elf_mn10200_reloc_type) RELOC_NUMBER (R_MN10200_NONE, 0) RELOC_NUMBER (R_MN10200_32, 1) RELOC_NUMBER (R_MN10200_16, 2) RELOC_NUMBER (R_MN10200_8, 3) RELOC_NUMBER (R_MN10200_24, 4) RELOC_NUMBER (R_MN10200_PCREL8, 5) RELOC_NUMBER (R_MN10200_PCREL16, 6) RELOC_NUMBER (R_MN10200_PCREL24, 7) END_RELOC_NUMBERS (R_MN10200_max) #endif /* _ELF_MN10200_H */
#include "soc_common.h" #include <arpa/inet.h> #include <ctype.h> #include <stdint.h> int inet_aton(const char *cp, struct in_addr *inp) { int base; uint32_t val; int c; char bytes[4]; size_t num_bytes = 0; c = *cp; for(;;) { if(!isdigit(c)) return 0; val = 0; base = 10; if(c == '0') { c = *++cp; if(c == 'x' || c == 'X') { base = 16; c = *++cp; } else base = 8; } for(;;) { if(isdigit(c)) { if(base == 8 && c >= '8') return 0; val *= base; val += c - '0'; c = *++cp; } else if(base == 16 && isxdigit(c)) { val *= base; val += c + 10 - (islower(c) ? 'a' : 'A'); c = *++cp; } else break; } if(c == '.') { if(num_bytes > 3) return 0; if(val > 0xFF) return 0; bytes[num_bytes++] = val; c = *++cp; } else break; } if(c != 0) return 0; switch(num_bytes) { case 0: break; case 1: if(val > 0xFFFFFF) return 0; val |= bytes[0] << 24; break; case 2: if(val > 0xFFFF) return 0; val |= bytes[0] << 24; val |= bytes[1] << 16; break; case 3: if(val > 0xFF) return 0; val |= bytes[0] << 24; val |= bytes[1] << 16; val |= bytes[2] << 8; break; } if(inp) inp->s_addr = htonl(val); return 1; }
/* general_config.h * Copyright (C) 2016 Jonathan Bennett * Header file for general_config.cpp * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <wx/wx.h> #include <wx/fileconf.h> class gConfigDialog : public wxDialog { public: gConfigDialog(wxFileConfig *configFile); private: wxTextCtrl *url_txt; wxFileConfig *privateConfigFile; wxCheckBox *countdownCheck; wxCheckBox *debugCheck; enum { ID_OKButton = 1200, ID_DefButton, ID_CancelButton }; void OnDef(wxCommandEvent& event); void OnOK(wxCommandEvent& event); void OnCancel(wxCommandEvent& event); DECLARE_EVENT_TABLE() };
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: sdk/game/CGarages.h * PURPOSE: Garage manager interface * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #ifndef __CGAME_GARAGES #define __CGAME_GARAGES #include "CGarage.h" #include "Common.h" #define MAX_GARAGES 50 class CGarages { public: virtual CGarage* GetGarage ( DWORD dwID ) = 0; virtual void Initialize ( ) = 0; }; #endif
/* This file is part of Darling. Copyright (C) 2017 Lubos Dolezel Darling is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface CIPhotoEffectTonal : NSObject @end
/* * 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 3 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 this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once #include <AP_HAL/utility/RingBuffer.h> #include <AP_HAL/AP_HAL_Boards.h> #include "AP_HAL_ChibiOS.h" #if HAL_USE_EICU == TRUE #define INPUT_CAPTURE_FREQUENCY 1000000 //capture unit in microseconds #ifndef SOFTSIG_MAX_SIGNAL_TRANSITIONS #define SOFTSIG_MAX_SIGNAL_TRANSITIONS 128 #endif class ChibiOS::SoftSigReaderInt { public: SoftSigReaderInt(); /* Do not allow copies */ SoftSigReaderInt(const SoftSigReaderInt &other) = delete; SoftSigReaderInt &operator=(const SoftSigReaderInt&) = delete; // get singleton static SoftSigReaderInt *get_singleton(void) { return _singleton; } void init(EICUDriver* icu_drv, eicuchannel_t chan); bool read(uint32_t &widths0, uint32_t &widths1); private: // singleton static SoftSigReaderInt *_singleton; static void _irq_handler(EICUDriver *eicup, eicuchannel_t channel); static eicuchannel_t get_pair_channel(eicuchannel_t channel); typedef struct PACKED { uint16_t w0; uint16_t w1; } pulse_t; ObjectBuffer<pulse_t> sigbuf{SOFTSIG_MAX_SIGNAL_TRANSITIONS}; EICUConfig icucfg; EICUChannelConfig channel_config; EICUChannelConfig aux_channel_config; EICUDriver* _icu_drv = nullptr; uint16_t last_value; }; #endif // HAL_USE_EICU
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtWebView module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPLv3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or later as published by the Free ** Software Foundation and appearing in the file LICENSE.GPL included in ** the packaging of this file. Please review the following information to ** ensure the GNU General Public License version 2.0 requirements will be ** met: http://www.gnu.org/licenses/gpl-2.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWEBVIEW_WINRT_P_H #define QWEBVIEW_WINRT_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qwebview_p.h" namespace ABI { namespace Windows { namespace UI { namespace Xaml { namespace Controls { struct IWebView; struct IWebViewNavigationStartingEventArgs; struct IWebViewNavigationCompletedEventArgs; } } } } } QT_BEGIN_NAMESPACE struct WinRTWebView; class QWinRTWebViewPrivate : public QWebViewPrivate { Q_OBJECT public: explicit QWinRTWebViewPrivate(QObject *parent = Q_NULLPTR); ~QWinRTWebViewPrivate() Q_DECL_OVERRIDE; QUrl url() const Q_DECL_OVERRIDE; void setUrl(const QUrl &url) Q_DECL_OVERRIDE; bool canGoBack() const Q_DECL_OVERRIDE; bool canGoForward() const Q_DECL_OVERRIDE; QString title() const Q_DECL_OVERRIDE; int loadProgress() const Q_DECL_OVERRIDE; bool isLoading() const Q_DECL_OVERRIDE; void setParentView(QObject *view) Q_DECL_OVERRIDE; QObject *parentView() const Q_DECL_OVERRIDE; void setGeometry(const QRect &geometry) Q_DECL_OVERRIDE; void setVisibility(QWindow::Visibility visibility) Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; public Q_SLOTS: void goBack() Q_DECL_OVERRIDE; void goForward() Q_DECL_OVERRIDE; void reload() Q_DECL_OVERRIDE; void stop() Q_DECL_OVERRIDE; void loadHtml(const QString &html, const QUrl &baseUrl = QUrl()) Q_DECL_OVERRIDE; protected: void runJavaScriptPrivate(const QString &script, int callbackId) Q_DECL_OVERRIDE; private: HRESULT onNavigationStarted(ABI::Windows::UI::Xaml::Controls::IWebView *, ABI::Windows::UI::Xaml::Controls::IWebViewNavigationStartingEventArgs *); HRESULT onNavigationCompleted(ABI::Windows::UI::Xaml::Controls::IWebView *, ABI::Windows::UI::Xaml::Controls::IWebViewNavigationCompletedEventArgs *); QScopedPointer<WinRTWebView> d; }; QT_END_NAMESPACE #endif // QWEBVIEW_WINRT_P_H
/* * Copyright 2014 Jakob Gruber * * This file is part of kpqueue. * * kpqueue is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * kpqueue 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 kpqueue. If not, see <http://www.gnu.org/licenses/>. */ template <class K, class V, int Rlx> void dist_lsm<K, V, Rlx>::insert(const K &key) { insert(key, key); } template <class K, class V, int Rlx> void dist_lsm<K, V, Rlx>::insert(const K &key, const V &val) { m_local.get()->insert(key, val, nullptr); } template <class K, class V, int Rlx> void dist_lsm<K, V, Rlx>::insert(const K &key, const V &val, shared_lsm<K, V, Rlx> *slsm) { m_local.get()->insert(key, val, slsm); } template <class K, class V, int Rlx> bool dist_lsm<K, V, Rlx>::delete_min(V &val) { return m_local.get()->delete_min(this, val); } template <class K, class V, int Rlx> bool dist_lsm<K, V, Rlx>::delete_min(K &key, V &val) { return m_local.get()->delete_min(this, key, val); } template <class K, class V, int Rlx> void dist_lsm<K, V, Rlx>::find_min(typename block<K, V>::peek_t &best) { m_local.get()->peek(best); } template <class K, class V, int Rlx> int dist_lsm<K, V, Rlx>::spy() { return m_local.get()->spy(this); } template <class K, class V, int Rlx> void dist_lsm<K, V, Rlx>::print() { for (size_t i = 0; i < m_local.num_threads(); i++) { m_local.get(i)->print(); } }
/* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad Copyright (C) 2015-2016 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Stockfish 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 MISC_H_INCLUDED #define MISC_H_INCLUDED #include <cassert> #include <chrono> #include <ostream> #include <string> #include <vector> #include "types.h" const std::string engine_info(bool to_uci = false); void prefetch(void* addr); void start_logger(const std::string& fname); void dbg_hit_on(bool b); void dbg_hit_on(bool c, bool b); void dbg_mean_of(int v); void dbg_print(); typedef std::chrono::milliseconds::rep TimePoint; // A value in milliseconds inline TimePoint now() { return std::chrono::duration_cast<std::chrono::milliseconds> (std::chrono::steady_clock::now().time_since_epoch()).count(); } template<class Entry, int Size> struct HashTable { Entry* operator[](Key key) { return &table[(uint32_t)key & (Size - 1)]; } private: std::vector<Entry> table = std::vector<Entry>(Size); }; enum SyncCout { IO_LOCK, IO_UNLOCK }; std::ostream& operator<<(std::ostream&, SyncCout); #define sync_cout std::cout << IO_LOCK #define sync_endl std::endl << IO_UNLOCK /// xorshift64star Pseudo-Random Number Generator /// This class is based on original code written and dedicated /// to the public domain by Sebastiano Vigna (2014). /// It has the following characteristics: /// /// - Outputs 64-bit numbers /// - Passes Dieharder and SmallCrush test batteries /// - Does not require warm-up, no zeroland to escape /// - Internal state is a single 64-bit integer /// - Period is 2^64 - 1 /// - Speed: 1.60 ns/call (Core i7 @3.40GHz) /// /// For further analysis see /// <http://vigna.di.unimi.it/ftp/papers/xorshift.pdf> class PRNG { uint64_t s; uint64_t rand64() { s ^= s >> 12, s ^= s << 25, s ^= s >> 27; return s * 2685821657736338717LL; } public: PRNG(uint64_t seed) : s(seed) { assert(seed); } template<typename T> T rand() { return T(rand64()); } /// Special generator used to fast init magic numbers. /// Output values only have 1/8th of their bits set on average. template<typename T> T sparse_rand() { return T(rand64() & rand64() & rand64()); } }; /// Under Windows it is not possible for a process to run on more than one /// logical processor group. This usually means to be limited to use max 64 /// cores. To overcome this, some special platform specific API should be /// called to set group affinity for each thread. Original code from Texel by /// Peter Österlund. namespace WinProcGroup { void bindThisThread(size_t idx); } #endif // #ifndef MISC_H_INCLUDED
/* ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "ch.h" #include "hal.h" /** * @brief Exception handler type. */ typedef void @far @interrupt (*interrupt_handler_t)(void); /* * Various external symbols. */ void _stext(void); @far @interrupt void vector10(void); @far @interrupt void vector13(void); @far @interrupt void vector17(void); @far @interrupt void vector18(void); @far @interrupt void vector20(void); @far @interrupt void vector21(void); /** * @brief Exception vector type. */ typedef struct { uint8_t ev_instruction; interrupt_handler_t ev_handler; } exception_vector_t; /** * @brief Undefined interrupt handler. * @note It should never be invoked. */ @far @interrupt static void vector (void) { return; } /** * @brief Exceptions table. */ exception_vector_t const _vectab[] = { {0x82, (interrupt_handler_t)_stext}, /* reset */ {0x82, vector}, /* trap */ {0x82, vector}, /* vector0 */ {0x82, vector}, /* vector1 */ {0x82, vector}, /* vector2 */ {0x82, vector}, /* vector3 */ {0x82, vector}, /* vector4 */ {0x82, vector}, /* vector5 */ {0x82, vector}, /* vector6 */ {0x82, vector}, /* vector7 */ {0x82, vector}, /* vector8 */ {0x82, vector}, /* vector9 */ #if HAL_USE_SPI && STM8S_SPI_USE_SPI {0x82, vector10}, #else {0x82, vector}, /* vector10 */ #endif {0x82, vector}, /* vector11 */ {0x82, vector}, /* vector12 */ {0x82, vector13}, /* vector13 */ {0x82, vector}, /* vector14 */ {0x82, vector}, /* vector15 */ {0x82, vector}, /* vector16 */ #if HAL_USE_SERIAL && STM8S_SERIAL_USE_UART1 {0x82, vector17}, /* vector17 */ {0x82, vector18}, /* vector18 */ #else {0x82, vector}, /* vector17 */ {0x82, vector}, /* vector18 */ #endif {0x82, vector}, /* vector19 */ #if HAL_USE_SERIAL && (STM8S_SERIAL_USE_UART2 || STM8S_SERIAL_USE_UART3) {0x82, vector20}, /* vector20 */ {0x82, vector21}, /* vector21 */ #else {0x82, vector}, /* vector20 */ {0x82, vector}, /* vector21 */ #endif {0x82, vector}, /* vector22 */ {0x82, vector}, /* vector23 */ {0x82, vector}, /* vector24 */ {0x82, vector}, /* vector25 */ {0x82, vector}, /* vector26 */ {0x82, vector}, /* vector27 */ {0x82, vector}, /* vector28 */ {0x82, vector}, /* vector29 */ };
// // Student.c // FirstExamples // // Created by Luiz on 2016-09-06. // Copyright © 2016 Ideia do Luiz. All rights reserved. // #include <stdlib.h> #include "Student.h" StudentRef Student_new() { return malloc(sizeof(Student)); } void Student_free(StudentRef this) { free(this); }
/* =========================================================================== Doom 3 GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?). Doom 3 Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Doom 3 Source Code 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 Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #if !defined(AFX_LIGHTDLG_H__9DF57520_ED11_4BD8_968A_F6A7E34167D2__INCLUDED_) #define AFX_LIGHTDLG_H__9DF57520_ED11_4BD8_968A_F6A7E34167D2__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "GLWidget.h" class CLightInfo { public: CLightInfo(); bool pointLight; float fallOff; CString strTexture; bool equalRadius; bool explicitStartEnd; idVec3 lightStart; idVec3 lightEnd; idVec3 lightUp; idVec3 lightRight; idVec3 lightTarget; idVec3 lightCenter; idVec3 color; bool fog; idVec4 fogDensity; bool strobe; float strobeSpeed; bool rotate; float rotateSpeed; idVec3 lightRadius; bool castShadows; bool castSpecular; bool castDiffuse; bool hasCenter; bool isParallel; void Defaults(); void DefaultProjected(); void DefaultPoint(); void FromDict(const idDict *e); void ToDict(idDict *e); void ToDictFromDifferences(idDict *e, const idDict *differences); void ToDictWriteAllInfo(idDict *e); }; ///////////////////////////////////////////////////////////////////////////// // CLightDlg dialog class CLightDlg : public CDialog { public: CLightDlg(CWnd *pParent = NULL); // standard constructor ~CLightDlg(); void UpdateDialogFromLightInfo(void); void UpdateDialog(bool updateChecks); void UpdateLightInfoFromDialog(void); void UpdateColor(float r, float g, float b, float a); void SetSpecifics(); void EnableControls(); void LoadLightTextures(); void ColorButtons(); void SaveLightInfo(const idDict *differences); // Dialog Data //{{AFX_DATA(CLightDlg) enum { IDD = IDD_DIALOG_LIGHT }; idGLWidget m_wndPreview; CComboBox m_wndLights; CSliderCtrl m_wndFalloff; BOOL m_bEqualRadius; BOOL m_bExplicitFalloff; BOOL m_bPointLight; BOOL m_bCheckProjected; float m_fFallloff; int m_nFalloff; BOOL m_bRotate; BOOL m_bShadows; BOOL m_bSpecular; BOOL m_bDiffuse; float m_fEndX; float m_fEndY; float m_fEndZ; float m_fRadiusX; float m_fRadiusY; float m_fRadiusZ; float m_fRightX; float m_fRightY; float m_fRightZ; float m_fRotate; float m_fStartX; float m_fStartY; float m_fStartZ; float m_fTargetX; float m_fTargetY; float m_fTargetZ; float m_fUpX; float m_fUpY; float m_fUpZ; BOOL m_hasCenter; float m_centerX; float m_centerY; float m_centerZ; BOOL m_bIsParallel; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CLightDlg) public: virtual BOOL DestroyWindow(); protected: virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CLightDlg) virtual BOOL OnInitDialog(); afx_msg void OnDestroy(); afx_msg void OnBtnTexture(); afx_msg void OnCheckEqualradius(); afx_msg void OnCheckExplicitfalloff(); afx_msg void OnCheckPoint(); afx_msg void OnCheckProjected(); afx_msg void OnRadioFalloff(); virtual void OnOK(); afx_msg void OnApply(); afx_msg void OnBtnColor(); afx_msg void OnBtnFog(); afx_msg void OnCheckFog(); afx_msg void OnCheckRotate(); afx_msg void OnCheckStrobe(); virtual void OnCancel(); afx_msg HBRUSH OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor); afx_msg void OnSelchangeComboTexture(); afx_msg void OnCheckCenter(); afx_msg void OnCheckParallel(); afx_msg void OnApplyDifferences(); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: CBitmap colorBitmap; CBitmap fogBitmap; CLightInfo lightInfo; CLightInfo lightInfoOriginal; idVec3 color; idGLDrawableMaterial *m_drawMaterial; }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_LIGHTDLG_H__9DF57520_ED11_4BD8_968A_F6A7E34167D2__INCLUDED_)
/* * Vortex OpenSplice * * This software and documentation are Copyright 2006 to TO_YEAR ADLINK * Technology Limited, its affiliated companies and licensors. All rights * reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /**************************************************************** * Implementation for thread management conforming to * * OpenSplice requirements * ****************************************************************/ /** \file os/code/os_thread.c * \brief Thread management - create threads * * A thread is a unit of execution. Threads can compete with each * other within the context of a process for the CPU (unbounded * threads, scheduling is on process scope) or threads can compete * with other processes or threads within the same or other processes * for the CPU (bounded threads, scheduling is on system scope). * A thread has its own stack, but shares the address space with * other threads within a process. * * \par Thread model on Solaris * Solaris supports bouded and unbounded threads, the OS layer * will only support bouded threads * * \par Thread model on Linux * Linux only supports bounded threads */ #include "os_thread.h" /* include OS specific thread implementation */ #include "code/os_thread.c"
#ifndef Py_PYTHREAD_H #define Py_PYTHREAD_H typedef void *PyThread_type_lock; typedef void *PyThread_type_sema; #ifdef __cplusplus extern "C" { #endif /* Return status codes for Python lock acquisition. Chosen for maximum * backwards compatibility, ie failure -> 0, success -> 1. */ typedef enum PyLockStatus { PY_LOCK_FAILURE = 0, PY_LOCK_ACQUIRED = 1, PY_LOCK_INTR } PyLockStatus; PyAPI_FUNC(void) PyThread_init_thread(void); PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *); PyAPI_FUNC(void) PyThread_exit_thread(void); PyAPI_FUNC(long) PyThread_get_thread_ident(void); PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void); PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock); PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int); #define WAIT_LOCK 1 #define NOWAIT_LOCK 0 /* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting on a lock (see PyThread_acquire_lock_timed() below). PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that type, and depends on the system threading API. NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread module exposes a higher-level API, with timeouts expressed in seconds and floating-point numbers allowed. */ #if defined(HAVE_LONG_LONG) #define PY_TIMEOUT_T PY_LONG_LONG #define PY_TIMEOUT_MAX PY_LLONG_MAX #else #define PY_TIMEOUT_T long #define PY_TIMEOUT_MAX LONG_MAX #endif /* In the NT API, the timeout is a DWORD and is expressed in milliseconds */ #if defined (NT_THREADS) #if (Py_LL(0xFFFFFFFF) * 1000 < PY_TIMEOUT_MAX) #undef PY_TIMEOUT_MAX #define PY_TIMEOUT_MAX (Py_LL(0xFFFFFFFF) * 1000) #endif #endif /* If microseconds == 0, the call is non-blocking: it returns immediately even when the lock can't be acquired. If microseconds > 0, the call waits up to the specified duration. If microseconds < 0, the call waits until success (or abnormal failure) microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is undefined. If intr_flag is true and the acquire is interrupted by a signal, then the call will return PY_LOCK_INTR. The caller may reattempt to acquire the lock. */ PyAPI_FUNC(PyLockStatus) PyThread_acquire_lock_timed(PyThread_type_lock, PY_TIMEOUT_T microseconds, int intr_flag); PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock); PyAPI_FUNC(size_t) PyThread_get_stacksize(void); PyAPI_FUNC(int) PyThread_set_stacksize(size_t); /* Thread Local Storage (TLS) API */ PyAPI_FUNC(int) PyThread_create_key(void); PyAPI_FUNC(void) PyThread_delete_key(int); PyAPI_FUNC(int) PyThread_set_key_value(int, void *); PyAPI_FUNC(void *) PyThread_get_key_value(int); PyAPI_FUNC(void) PyThread_delete_key_value(int key); /* Cleanup after a fork */ PyAPI_FUNC(void) PyThread_ReInitTLS(void); #ifdef __cplusplus } #endif #endif /* !Py_PYTHREAD_H */
/* $BEGIN_LICENSE This file is part of Minitube. Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com> Minitube is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Minitube 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 Minitube. If not, see <http://www.gnu.org/licenses/>. $END_LICENSE */ #ifndef AUTOCOMPLETE_H #define AUTOCOMPLETE_H #include <QtGui> class Suggester; class Suggestion; class SearchWidget; QT_FORWARD_DECLARE_CLASS(QListWidget) QT_FORWARD_DECLARE_CLASS(QListWidgetItem) QT_FORWARD_DECLARE_CLASS(QLineEdit) class AutoComplete : public QObject { Q_OBJECT public: AutoComplete(SearchWidget *buddy, QLineEdit *lineEdit); void setSuggester(Suggester* suggester); QListWidget* getPopup() { return popup; } void preventSuggest(); void enableSuggest(); signals: void suggestionAccepted(Suggestion *suggestion); void suggestionAccepted(const QString &value); protected: bool eventFilter(QObject *obj, QEvent *ev); private slots: void acceptSuggestion(); void suggest(); void itemEntered(QListWidgetItem *item); void currentItemChanged(QListWidgetItem *item); void suggestionsReady(const QVector<Suggestion*> &suggestions); void adjustPosition(); void enableItemHovering(); private: void showSuggestions(const QVector<Suggestion*> &suggestions); void hideSuggestions(); SearchWidget *buddy; QLineEdit *lineEdit; QString originalText; QListWidget *popup; QTimer *timer; bool enabled; Suggester *suggester; QVector<Suggestion*> suggestions; bool itemHovering; }; #endif // AUTOCOMPLETE_H
/* * Panopticon - A libre disassembler * Copyright (C) 2017 Panopticon authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <QObject> #include "glue.h" #pragma once class QBasicBlockLine : public QObject { Q_OBJECT public: QBasicBlockLine(const BasicBlockLine& op, QObject* parent = 0); virtual ~QBasicBlockLine(); Q_PROPERTY(QString opcode READ getOpcode NOTIFY opcodeChanged) Q_PROPERTY(QString region READ getRegion NOTIFY regionChanged) Q_PROPERTY(quint64 offset READ getOffset NOTIFY offsetChanged) Q_PROPERTY(QString comment READ getComment NOTIFY commentChanged) Q_PROPERTY(QVariantList operandKind READ getOperandKind NOTIFY operandKindChanged) Q_PROPERTY(QVariantList operandDisplay READ getOperandDisplay NOTIFY operandDisplayChanged) Q_PROPERTY(QVariantList operandAlt READ getOperandAlt NOTIFY operandAltChanged) Q_PROPERTY(QVariantList operandData READ getOperandData NOTIFY operandDataChanged) QString getOpcode(void) const; QString getRegion(void) const; quint64 getOffset(void) const; QString getComment(void) const; QVariantList getOperandKind(void) const; QVariantList getOperandDisplay(void) const; QVariantList getOperandAlt(void) const; QVariantList getOperandData(void) const; void replace(const BasicBlockLine& line); signals: void opcodeChanged(void); void regionChanged(void); void offsetChanged(void); void commentChanged(void); void operandKindChanged(void); void operandDisplayChanged(void); void operandAltChanged(void); void operandDataChanged(void); protected: QString m_opcode; QString m_region; quint64 m_offset; QString m_comment; QVariantList m_operandKind; QVariantList m_operandDisplay; QVariantList m_operandAlt; QVariantList m_operandData; };