text
stringlengths
4
6.14k
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef MOZILLA_SVGTRANSFORMLIST_H__ #define MOZILLA_SVGTRANSFORMLIST_H__ #include "gfxMatrix.h" #include "nsDebug.h" #include "nsTArray.h" #include "nsSVGTransform.h" namespace mozilla { namespace dom { class SVGTransform; } // namespace dom /** * ATTENTION! WARNING! WATCH OUT!! * * Consumers that modify objects of this type absolutely MUST keep the DOM * wrappers for those lists (if any) in sync!! That's why this class is so * locked down. * * The DOM wrapper class for this class is DOMSVGTransformList. */ class SVGTransformList { friend class nsSVGAnimatedTransformList; friend class DOMSVGTransformList; friend class dom::SVGTransform; public: SVGTransformList() {} ~SVGTransformList() {} // Only methods that don't make/permit modification to this list are public. // Only our friend classes can access methods that may change us. /// This may return an incomplete string on OOM, but that's acceptable. void GetValueAsString(nsAString& aValue) const; bool IsEmpty() const { return mItems.IsEmpty(); } uint32_t Length() const { return mItems.Length(); } const nsSVGTransform& operator[](uint32_t aIndex) const { return mItems[aIndex]; } bool operator==(const SVGTransformList& rhs) const { return mItems == rhs.mItems; } bool SetCapacity(uint32_t size) { return mItems.SetCapacity(size, fallible); } void Compact() { mItems.Compact(); } gfxMatrix GetConsolidationMatrix() const; // Access to methods that can modify objects of this type is deliberately // limited. This is to reduce the chances of someone modifying objects of // this type without taking the necessary steps to keep DOM wrappers in sync. // If you need wider access to these methods, consider adding a method to // SVGAnimatedTransformList and having that class act as an intermediary so it // can take care of keeping DOM wrappers in sync. protected: /** * These may fail on OOM if the internal capacity needs to be increased, in * which case the list will be left unmodified. */ nsresult CopyFrom(const SVGTransformList& rhs); nsresult CopyFrom(const nsTArray<nsSVGTransform>& aTransformArray); nsSVGTransform& operator[](uint32_t aIndex) { return mItems[aIndex]; } /** * This may fail (return false) on OOM if the internal capacity is being * increased, in which case the list will be left unmodified. */ bool SetLength(uint32_t aNumberOfItems) { return mItems.SetLength(aNumberOfItems, fallible); } private: // Marking the following private only serves to show which methods are only // used by our friend classes (as opposed to our subclasses) - it doesn't // really provide additional safety. nsresult SetValueFromString(const nsAString& aValue); void Clear() { mItems.Clear(); } bool InsertItem(uint32_t aIndex, const nsSVGTransform& aTransform) { if (aIndex >= mItems.Length()) { aIndex = mItems.Length(); } return !!mItems.InsertElementAt(aIndex, aTransform, fallible); } void ReplaceItem(uint32_t aIndex, const nsSVGTransform& aTransform) { MOZ_ASSERT(aIndex < mItems.Length(), "DOM wrapper caller should have raised INDEX_SIZE_ERR"); mItems[aIndex] = aTransform; } void RemoveItem(uint32_t aIndex) { MOZ_ASSERT(aIndex < mItems.Length(), "DOM wrapper caller should have raised INDEX_SIZE_ERR"); mItems.RemoveElementAt(aIndex); } bool AppendItem(const nsSVGTransform& aTransform) { return !!mItems.AppendElement(aTransform, fallible); } protected: /* * See SVGLengthList for the rationale for using FallibleTArray<nsSVGTransform> * instead of FallibleTArray<nsSVGTransform, 1>. */ FallibleTArray<nsSVGTransform> mItems; }; } // namespace mozilla #endif // MOZILLA_SVGTRANSFORMLIST_H__
/*///////////////////////////////////////////////////////////////////////// // // File: String_InternalMember.h // Description: // // Rel: 01.00 // Created: November, 2002 // // Revised: // // (C) Copyright 2009 Telefonica Investigacion y Desarrollo // S.A.Unipersonal (Telefonica I+D) // // This file is part of Morfeo CORBA Platform. // // Morfeo CORBA Platform is free software: you can redistribute it and/or // modify it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the License, // or (at your option) any later version. // // Morfeo CORBA Platform 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with Morfeo CORBA Platform. If not, see // // http://www.gnu.org/licenses // // Info about members and contributors of the MORFEO project // is available at // // http://morfeo-project.org // /////////////////////////////////////////////////////////////////////////*/ #ifndef _TIDORB_TYPES_STRING_INTERNAL_MEMBER_H_ #define _TIDORB_TYPES_STRING_INTERNAL_MEMBER_H_ #include <string.h> #ifdef TIDORB_HAVE_IOSTREAM #include <iostream> #else #include <iostream.h> #endif #ifdef TIDORB_HAVE_NAMESPACE_STD using namespace std; #endif namespace TIDorb { namespace types { // Tipo String_InternalMember // // Este es un tipo auxiliar no accesible al usuario disenado para // tipar los miembros string de structs, unions y arrays. // Su implementacion es similar a la de CORBA::String_var, pero se inicializa // por defecto con una cadena vacia // class String_InternalMember { public: String_InternalMember(): m_ptr(CORBA::string_dup("")){} String_InternalMember(char *p): m_ptr(p){} String_InternalMember(const char *p) : m_ptr (CORBA::string_dup(p)){} String_InternalMember(const CORBA::String_var &s): m_ptr(CORBA::string_dup(s)) {}; String_InternalMember(const String_InternalMember &s): m_ptr(CORBA::string_dup(s.m_ptr)) {}; ~String_InternalMember() {CORBA::string_free(m_ptr);} String_InternalMember& operator=(char *p) { if(m_ptr != p) { CORBA::string_free(m_ptr); m_ptr = p; } return *this; } String_InternalMember& operator=(const char *p) { if(m_ptr != p) { CORBA::string_free(m_ptr); m_ptr = CORBA::string_dup(p); } return *this; } String_InternalMember& operator=(const CORBA::String_var &s) { CORBA::string_free(m_ptr); m_ptr = CORBA::string_dup(s); return *this; } String_InternalMember& operator=(const String_InternalMember &s) { if(this != &s) { CORBA::string_free(m_ptr); m_ptr = CORBA::string_dup(s.m_ptr); } return *this; } operator char*&() { return m_ptr;} operator const char*&() const { const char*& aux = (const char*&) m_ptr; return aux; } const char* in() const { return m_ptr;} char*& inout() { return m_ptr;} char*& out() { if(m_ptr) CORBA::string_free(m_ptr); return m_ptr; } char* _retn() { char* tmp_ptr = m_ptr; m_ptr = 0; return tmp_ptr; } char& operator[](CORBA::ULong index) { return m_ptr[index]; } char operator[](CORBA::ULong index) const { return m_ptr[index]; } private: char* m_ptr; }; } // end of namespace types } // end of namespace TIDorb inline ostream& operator<<(ostream& os, const ::TIDorb::types::String_InternalMember& s) { os << (const char *) s; return os; } inline istream& operator>>(istream& is, ::TIDorb::types::String_InternalMember& s) { is >> (char *) s; return is; } #endif
/* * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero 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 <https://www.gnu.org/licenses/>. */ #include "ogs-core.h" #include "core/abts.h" static void test1_func(abts_case *tc, void *data) { char *ptr = ogs_malloc(256); ABTS_PTR_NOTNULL(tc, ptr); ogs_free(ptr); } static void test2_func(abts_case *tc, void *data) { char *ptr = ogs_calloc(2, 10); int i; ABTS_PTR_NOTNULL(tc, ptr); for (i = 0; i < 2*10; i++) { ABTS_INT_EQUAL(tc, 0, ptr[i]); } ogs_free(ptr); } static void test3_func(abts_case *tc, void *data) { char *ptr = ogs_realloc(0, 10); ABTS_PTR_NOTNULL(tc, ptr); ogs_free(ptr); ptr = ogs_malloc(20); ABTS_PTR_NOTNULL(tc, ptr); ptr = ogs_realloc(ptr, 0); } static void test4_func(abts_case *tc, void *data) { char *p, *q; p = ogs_malloc(10); ABTS_PTR_NOTNULL(tc, p); memset(p, 1, 10); q = ogs_realloc(p, 128 - sizeof(ogs_pkbuf_t *) - 1); ABTS_TRUE(tc, p == q); p = ogs_realloc(q, 128 - sizeof(ogs_pkbuf_t *)); ABTS_TRUE(tc, p == q); q = ogs_realloc(p, 128 - sizeof(ogs_pkbuf_t *) + 1); ABTS_TRUE(tc, p != q); ABTS_TRUE(tc, memcmp(p, q, 10) == 0); ogs_free(q); } abts_suite *test_memory(abts_suite *suite) { suite = ADD_SUITE(suite) abts_run_test(suite, test1_func, NULL); abts_run_test(suite, test2_func, NULL); abts_run_test(suite, test3_func, NULL); abts_run_test(suite, test4_func, NULL); return suite; }
/* Copyright 2002-2013 CEA LIST This file is part of LIMA. LIMA is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. LIMA 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with LIMA. If not, see <http://www.gnu.org/licenses/> */ /** * @brief this file contains the definitions of several constraint * functions for the detection of subsentences * * @file SimplificationConstraints.h * @author Gael de Chalendar (Gael.de-Chalendar@cea.fr) * Copyright (c) 2005 by CEA * @date Created on Tue Mar, 15 2005 * * */ #ifndef LIMA_SYNTACTICANALYSIS_SIMPLIFICATIONCONSTRAINTS_H #define LIMA_SYNTACTICANALYSIS_SIMPLIFICATIONCONSTRAINTS_H #include "SyntacticAnalysisExport.h" #include "HomoSyntagmaticConstraints.h" #include "linguisticProcessing/core/Automaton/constraintFunction.h" #include "linguisticProcessing/core/Automaton/recognizerMatch.h" #include <iostream> namespace Lima { namespace LinguisticProcessing { namespace SyntacticAnalysis { //********************************************************************** // ids of constraints defined in this file #define DefineStringId "DefineString" #define SameStringId "SameString" #define DefineModelId "DefineModel" #define SetInstanceId "SetInstance" //********************************************************************** class LIMA_SYNTACTICANALYSIS_EXPORT DefineString : public Automaton::ConstraintFunction { public: explicit DefineString(MediaId language, const LimaString& complement=LimaString()); ~DefineString() {} bool operator()(const Lima::LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph& graph, const LinguisticGraphVertex& v1, const LinguisticGraphVertex& v2, AnalysisContent& analysis) const; private: uint64_t m_language; }; class LIMA_SYNTACTICANALYSIS_EXPORT SameString : public Automaton::ConstraintFunction { public: explicit SameString(MediaId language, const LimaString& complement=LimaString()); ~SameString() {} bool operator()(const Lima::LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph& graph, const LinguisticGraphVertex& v1, const LinguisticGraphVertex& v2, AnalysisContent& analysis) const; bool actionNeedsRecognizedExpression() { return true; } private: uint64_t m_language; const Common::PropertyCode::PropertyAccessor* m_microAccessor; }; class LIMA_SYNTACTICANALYSIS_EXPORT DefineModel : public Automaton::ConstraintFunction { public: explicit DefineModel(MediaId language, const LimaString& complement=LimaString()); ~DefineModel() {} bool operator()(const Lima::LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph& graph, const LinguisticGraphVertex& v1, const LinguisticGraphVertex& v2, AnalysisContent& analysis) const; }; class LIMA_SYNTACTICANALYSIS_EXPORT SetInstance : public Automaton::ConstraintFunction { public: explicit SetInstance(MediaId language, const LimaString& complement=LimaString()); ~SetInstance() {} bool operator()( const Lima::LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph& graph, const LinguisticGraphVertex& v1, const LinguisticGraphVertex& v2, AnalysisContent& analysis) const; }; } // end namespace SyntacticAnalysis } // end namespace LinguisticProcessing } // end namespace Lima #endif // LIMA_SYNTACTICANALYSIS_SIMPLIFICATIONCONSTRAINTS_H
/** * @file libcomp/src/MessageTimeout.h * @ingroup libcomp * * @author COMP Omega <compomega@tutanota.com> * * @brief Indicates that a timeout has occurred. * * This file is part of the COMP_hack Library (libcomp). * * Copyright (C) 2012-2016 COMP_hack Team <compomega@tutanota.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LIBCOMP_SRC_MESSAGETIMEOUT_H #define LIBCOMP_SRC_MESSAGETIMEOUT_H // libcomp Includes #include "CString.h" #include "Message.h" // Standard C++11 Includes #include <memory> namespace libcomp { namespace Message { /** * Message that signifies a connection has timed out. */ class Timeout : public Message { public: /** * Create the message. */ Timeout(); /** * Cleanup the message. */ virtual ~Timeout(); virtual MessageType GetType() const; }; } // namespace Message } // namespace libcomp #endif // LIBCOMP_SRC_MESSAGETIMEOUT_H
/* * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "../support/s1ap-r16.4.0/36413-g40.asn" * `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER` */ #include "S1AP_BluetoothName.h" int S1AP_BluetoothName_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size >= 1UL && size <= 248UL)) { /* Constraint check succeeded */ return 0; } else { ASN__CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using OCTET_STRING, * so here we adjust the DEF accordingly. */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) asn_per_constraints_t asn_PER_type_S1AP_BluetoothName_constr_1 CC_NOTUSED = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 8, 8, 1, 248 } /* (SIZE(1..248)) */, 0, 0 /* No PER value map */ }; #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ static const ber_tlv_tag_t asn_DEF_S1AP_BluetoothName_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) }; asn_TYPE_descriptor_t asn_DEF_S1AP_BluetoothName = { "BluetoothName", "BluetoothName", &asn_OP_OCTET_STRING, asn_DEF_S1AP_BluetoothName_tags_1, sizeof(asn_DEF_S1AP_BluetoothName_tags_1) /sizeof(asn_DEF_S1AP_BluetoothName_tags_1[0]), /* 1 */ asn_DEF_S1AP_BluetoothName_tags_1, /* Same as above */ sizeof(asn_DEF_S1AP_BluetoothName_tags_1) /sizeof(asn_DEF_S1AP_BluetoothName_tags_1[0]), /* 1 */ { #if !defined(ASN_DISABLE_OER_SUPPORT) 0, #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */ #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) &asn_PER_type_S1AP_BluetoothName_constr_1, #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ S1AP_BluetoothName_constraint }, 0, 0, /* No members */ &asn_SPC_OCTET_STRING_specs /* Additional specs */ };
/* Copyright contributors as noted in the AUTHORS file. This file is part of PLATANOS. PLATANOS is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. PLATANOS 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "action.h" //action is only created by a received msg void action_minit (action_t ** action, char *key, zmsg_t * msg) { *action = calloc (1, sizeof (action_t)); memcpy ((*action)->key, key, 17); zframe_t *frame = zmsg_first (msg); memcpy (&((*action)->start), zframe_data (frame), zframe_size (frame)); frame = zmsg_next (msg); memcpy (&((*action)->end), zframe_data (frame), zframe_size (frame)); }
// // PayPalOAuthScopes.h // // Version 2.11.1 // // Copyright (c) 2014, PayPal // All rights reserved. // // Currently available scope-values to which the user can be asked to consent. // @see https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details /// Authorize charges for future purchases paid for with PayPal. extern NSString *const kPayPalOAuth2ScopeFuturePayments; /// Share basic account information. extern NSString *const kPayPalOAuth2ScopeProfile; /// Basic Authentication. extern NSString *const kPayPalOAuth2ScopeOpenId; /// Share your personal and account information. extern NSString *const kPayPalOAuth2ScopePayPalAttributes; /// Share your email address. extern NSString *const kPayPalOAuth2ScopeEmail; /// Share your account address. extern NSString *const kPayPalOAuth2ScopeAddress; /// Share your phone number. extern NSString *const kPayPalOAuth2ScopePhone;
#ifndef JSON_WRITER_H_INCLUDED # define JSON_WRITER_H_INCLUDED # include "value.h" # include <vector> # include <string> # include <iostream> namespace Json { class Value; /** \brief Abstract class for writers. */ class JSON_API Writer { public: virtual ~Writer(); virtual std::string write( const Value &root ) = 0; }; /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format without formatting (not human friendly). * * The JSON document is written in a single line. It is not intended for 'human' consumption, * but may be usefull to support feature such as RPC where bandwith is limited. * \sa Reader, Value */ class JSON_API FastWriter : public Writer { public: FastWriter(); virtual ~FastWriter(){} void enableYAMLCompatibility(); public: // overridden from Writer virtual std::string write( const Value &root ); private: void writeValue( const Value &value ); std::string document_; bool yamlCompatiblityEnabled_; }; /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter: public Writer { public: StyledWriter(); virtual ~StyledWriter(){} public: // overridden from Writer /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format. * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ virtual std::string write( const Value &root ); private: void writeValue( const Value &value ); void writeArrayValue( const Value &value ); bool isMultineArray( const Value &value ); void pushValue( const std::string &value ); void writeIndent(); void writeWithIndent( const std::string &value ); void indent(); void unindent(); void writeCommentBeforeValue( const Value &root ); void writeCommentAfterValueOnSameLine( const Value &root ); bool hasCommentForValue( const Value &value ); static std::string normalizeEOL( const std::string &text ); typedef std::vector<std::string> ChildValues; ChildValues childValues_; std::string document_; std::string indentString_; int rightMargin_; int indentSize_; bool addChildValues_; }; /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way, to a stream rather than to a string. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. * \sa Reader, Value, Value::setComment() */ class JSON_API StyledStreamWriter { public: StyledStreamWriter( std::string indentation="\t" ); ~StyledStreamWriter(){} public: /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format. * \param out Stream to write to. (Can be ostringstream, e.g.) * \param root Value to serialize. * \note There is no point in deriving from Writer, since write() should not return a value. */ void write( std::ostream &out, const Value &root ); private: void writeValue( const Value &value ); void writeArrayValue( const Value &value ); bool isMultineArray( const Value &value ); void pushValue( const std::string &value ); void writeIndent(); void writeWithIndent( const std::string &value ); void indent(); void unindent(); void writeCommentBeforeValue( const Value &root ); void writeCommentAfterValueOnSameLine( const Value &root ); bool hasCommentForValue( const Value &value ); static std::string normalizeEOL( const std::string &text ); typedef std::vector<std::string> ChildValues; ChildValues childValues_; std::ostream* document_; std::string indentString_; int rightMargin_; std::string indentation_; bool addChildValues_; }; std::string JSON_API valueToString( Int value ); std::string JSON_API valueToString( UInt value ); std::string JSON_API valueToString( double value ); std::string JSON_API valueToString( bool value ); std::string JSON_API valueToQuotedString( const char *value ); /// \brief Output using the StyledStreamWriter. /// \see Json::operator>>() std::ostream& operator<<( std::ostream&, const Value &root ); } // namespace Json #endif // JSON_WRITER_H_INCLUDED
/** ****************************************************************************** * @file DMA2D/DMA2D_MemToMemWithPFC/Inc/main.h * @author MCD Application Team * @version V1.2.5 * @date 29-January-2016 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stm32f429i_discovery.h" #include "stm32f429i_discovery_lcd.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* Bacula® - The Network Backup Solution Copyright (C) 2006-2014 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. You may use this file and others of this release according to the license defined in the LICENSE file, which includes the Affero General Public License, v3.0 ("AGPLv3") and some additional permissions and terms pursuant to its AGPLv3 Section 7. Bacula® is a registered trademark of Kern Sibbald. */ /* * Implement routines to determine drive type (Windows specific). * * Written by Robert Nelson, June 2006 * * Version $Id$ */ #ifndef TEST_PROGRAM #include "bacula.h" #include "find.h" #else /* Set up for testing a stand alone program */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define SUPPORTEDOSES \ "HAVE_WIN32\n" #define false 0 #define true 1 #define bstrncpy strncpy #define Dmsg0(n,s) fprintf(stderr, s) #define Dmsg1(n,s,a1) fprintf(stderr, s, a1) #define Dmsg2(n,s,a1,a2) fprintf(stderr, s, a1, a2) #endif /* * These functions should be implemented for each OS * * bool drivetype(const char *fname, char *dt, int dtlen); */ #if defined (HAVE_WIN32) /* Windows */ bool drivetype(const char *fname, char *dt, int dtlen) { CHAR rootpath[4]; UINT type; /* Copy Drive Letter, colon, and backslash to rootpath */ bstrncpy(rootpath, fname, 3); rootpath[3] = '\0'; type = GetDriveType(rootpath); switch (type) { case DRIVE_REMOVABLE: bstrncpy(dt, "removable", dtlen); return true; case DRIVE_FIXED: bstrncpy(dt, "fixed", dtlen); return true; case DRIVE_REMOTE: bstrncpy(dt, "remote", dtlen); return true; case DRIVE_CDROM: bstrncpy(dt, "cdrom", dtlen); return true; case DRIVE_RAMDISK: bstrncpy(dt, "ramdisk", dtlen); return true; case DRIVE_UNKNOWN: case DRIVE_NO_ROOT_DIR: default: return false; } } /* Windows */ #else /* No recognised OS */ bool drivetype(const char *fname, char *dt, int dtlen) { Dmsg0(10, "!!! drivetype() not implemented for this OS. !!!\n"); #ifdef TEST_PROGRAM Dmsg1(10, "Please define one of the following when compiling:\n\n%s\n", SUPPORTEDOSES); exit(EXIT_FAILURE); #endif return false; } #endif #ifdef TEST_PROGRAM int main(int argc, char **argv) { char *p; char dt[1000]; int status = 0; if (argc < 2) { p = (argc < 1) ? "drivetype" : argv[0]; printf("usage:\t%s path ...\n" "\t%s prints the drive type and pathname of the paths.\n", p, p); return EXIT_FAILURE; } while (*++argv) { if (!drivetype(*argv, dt, sizeof(dt))) { status = EXIT_FAILURE; } else { printf("%s\t%s\n", dt, *argv); } } return status; } #endif
#pragma once #include "../Interface/Thread.h" #include "../Interface/Database.h" #include "../Interface/Query.h" #include "../Interface/Pipe.h" #include "../Interface/File.h" #include "../urbackupcommon/os_functions.h" #include "ChunkPatcher.h" #include "server_prepare_hash.h" #include "FileIndex.h" #include "dao/ServerFilesDao.h" #include <vector> #include <map> #include "../urbackupcommon/chunk_hasher.h" #include "server_log.h" #include "../urbackupcommon/ExtentIterator.h" class FileMetadata; class MaxFileId; const int64 link_file_min_size = 2048; struct STmpFile { STmpFile(int backupid, std::string fp, std::string hashpath) : backupid(backupid), fp(fp), hashpath(hashpath) { } STmpFile(void) {} int backupid; std::string fp; std::string hashpath; }; class BackupServerHash : public IThread, public INotEnoughSpaceCallback, public IChunkPatcherCallback { public: enum EAction { EAction_LinkOrCopy, EAction_Copy }; BackupServerHash(IPipe *pPipe, int pClientid, bool use_snapshots, bool use_reflink, bool use_tmpfiles, logid_t logid, bool snapshot_file_inplace, MaxFileId& max_file_id); ~BackupServerHash(void); void operator()(void); bool isWorking(void); bool hasError(void); virtual bool handle_not_enough_space(const std::string &path); virtual void next_chunk_patcher_bytes(const char *buf, size_t bsize, bool changed, bool* is_sparse); virtual void next_sparse_extent_bytes(const char *buf, size_t bsize); virtual int64 chunk_patcher_pos(); void setupDatabase(void); void deinitDatabase(void); bool findFileAndLink(const std::string &tfn, IFile *tf, std::string hash_fn, const std::string &sha2, _i64 t_filesize, const std::string &hashoutput_fn, bool copy_from_hardlink_if_failed, bool &tries_once, std::string &ff_last, bool &hardlink_limit, bool &copied_file, int64& entryid, int& entryclientid, int64& rsize, int64& next_entry, FileMetadata& metadata, bool datch_dbs, ExtentIterator* extent_iterator); void addFileSQL(int backupid, int clientid, int incremental, const std::string &fp, const std::string &hash_path, const std::string &shahash, _i64 filesize, _i64 rsize, int64 prev_entry, int64 prev_entry_clientid, int64 next_entry, bool update_fileindex); static void addFileSQL(ServerFilesDao& filesdao, FileIndex& fileindex, int backupid, int clientid, int incremental, const std::string &fp, const std::string &hash_path, const std::string &shahash, _i64 filesize, _i64 rsize, int64 prev_entry, int64 prev_entry_clientid, int64 next_entry, bool update_fileindex); static void deleteFileSQL(ServerFilesDao& filesdao, FileIndex& fileindex, int64 id); struct SInMemCorrection { std::map<int64, int64> next_entries; std::map<int64, int64> prev_entries; std::map<int64, int> pointed_to; int64 max_correct; int64 min_correct; bool needs_correction(int64 id) { return id >= min_correct && id <= max_correct; } }; static void deleteFileSQL(ServerFilesDao& filesdao, FileIndex& fileindex, const char* pHash, _i64 filesize, _i64 rsize, int clientid, int backupid, int incremental, int64 id, int64 prev_id, int64 next_id, int pointed_to, bool use_transaction, bool del_entry, bool detach_dbs, bool with_backupstat, SInMemCorrection* correction); private: void addFile(int backupid, int incremental, IFile *tf, const std::string &tfn, std::string hash_fn, const std::string &sha2, const std::string &orig_fn, const std::string &hashoutput_fn, int64 t_filesize, FileMetadata& metadata, bool with_hashes, ExtentIterator* extent_iterator, int64 fileid); struct SFindState { SFindState() : state(0) {} int state; int64 orig_prev; ServerFilesDao::SFindFileEntry prev; std::map<int, int64> entryids; std::map<int, int64>::iterator client; }; ServerFilesDao::SFindFileEntry findFileHash(const std::string &pHash, _i64 filesize, int clientid, SFindState& state); bool copyFile(IFile *tf, const std::string &dest, ExtentIterator* extent_iterator); bool copyFileWithHashoutput(IFile *tf, const std::string &dest, const std::string hash_dest, ExtentIterator* extent_iterator); bool freeSpace(int64 fs, const std::string &fp); int countFilesInTmp(void); IFsFile* openFileRetry(const std::string &dest, int mode, std::string& errstr); bool patchFile(IFile *patch, const std::string &source, const std::string &dest, const std::string hash_output, const std::string hash_dest, _i64 tfilesize, ExtentIterator* extent_iterator); bool replaceFile(IFile *tf, const std::string &dest, const std::string &orig_fn, ExtentIterator* extent_iterator); bool replaceFileWithHashoutput(IFile *tf, const std::string &dest, const std::string hash_dest, const std::string &orig_fn, ExtentIterator* extent_iterator); bool renameFileWithHashoutput(IFile *tf, const std::string &dest, const std::string hash_dest, ExtentIterator* extent_iterator); bool renameFile(IFile *tf, const std::string &dest, bool log_info=true); bool correctPath(std::string& ff, std::string& f_hashpath); bool correctClientName(const std::string& backupfolder, std::string& ff, std::string& f_hashpath); bool punchHoleOrZero(IFile *tf, int64 offset, int64 size); std::map<std::pair<std::string, _i64>, std::vector<STmpFile> > files_tmp; ServerFilesDao* filesdao; IPipe *pipe; IDatabase *db; int link_logcnt; int space_logcnt; int clientid; volatile bool working; volatile bool has_error; IFsFile *chunk_output_fn; ChunkPatcher chunk_patcher; bool chunk_patcher_has_error; bool use_snapshots; bool use_reflink; bool use_tmpfiles; bool has_reflink; _i64 chunk_patch_pos; _i64 cow_filesize; FileIndex *fileindex; std::string backupfolder; bool old_backupfolders_loaded; std::vector<std::string> old_backupfolders; std::map<std::string, std::vector<std::string> > client_moved_to; logid_t logid; bool enabled_sparse; bool snapshot_file_inplace; MaxFileId& max_file_id; };
/* * Copyright (C) 1998, 2000-2007, 2010, 2011, 2012, 2013 SINTEF ICT, * Applied Mathematics, Norway. * * Contact information: E-mail: tor.dokken@sintef.no * SINTEF ICT, Department of Applied Mathematics, * P.O. Box 124 Blindern, * 0314 Oslo, Norway. * * This file is part of GoTools. * * GoTools is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * GoTools 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public * License along with GoTools. If not, see * <http://www.gnu.org/licenses/>. * * In accordance with Section 7(b) of the GNU Affero General Public * License, a covered work must retain the producer line in every data * file that is created or manipulated using GoTools. * * Other Usage * You can be released from the requirements of the license by purchasing * a commercial license. Buying such a license is mandatory as soon as you * develop commercial activities involving the GoTools library without * disclosing the source code of your own applications. * * This file may be used in accordance with the terms contained in a * written agreement between you and SINTEF ICT. */ #ifndef COMPLETEEDGENET_H #define COMPLETEEDGENET_H #include "GoTools/compositemodel/SurfaceModel.h" namespace Go { /// \brief Complete the edge net of a SurfaceModel. Fetches the wire /// frame model corresponding to a surface model, and extends it such /// that the extended wire frame will become the wire frame model corresponding /// to a volume model have the given surface model as its outer boundary. /// The extension to the wireframe is represented as pairs of vertices where /// these vertices lie at the endpoints of the missing edges. /// NB! This solution is currently not expected to handle all configurations. class CompleteEdgeNet { public: /// Constructor. The method is applied on a SurfaceModel /// \param sfmodel Pointer to a SurfaceModel CompleteEdgeNet(shared_ptr<SurfaceModel> sfmodel, bool perform_step2, bool smooth_connections); /// Destructor ~CompleteEdgeNet(); /// Apply algorithm for completing the edge net and create /// a starting ground for a block structured model of solids /// \return Whether the edge net was completed or not. bool perform(std::vector<std::pair<Point,Point> >& corr_vx_pts); /// Fetch modified model (after regularization) /// \return Pointer to the modified model shared_ptr<SurfaceModel> getRegularizedModel() { return model_; } /// Fetch new edges represented by their end vertices /// \return Vector of pointers to end vertices of the edges std::vector<std::pair<shared_ptr<Vertex>, shared_ptr<Vertex> > > getMissingEdges() { return missing_edges_; } private: shared_ptr<SurfaceModel> model_; std::vector<std::pair<shared_ptr<Vertex>, shared_ptr<Vertex> > > missing_edges_; bool perform_step2_; bool smooth_connections_; /// Given a regular solid, add the edges required to make a block /// structured model void addMissingEdges(); void identifyVertexConnection(std::vector<shared_ptr<Vertex> > vxs, size_t ki1, size_t ki2, int& ix1, int& ix2); void traverseEdges(std::vector<ftEdge*>& edges, std::vector<ftEdge*>& curr_path, std::vector<int>& curr_idx, ftEdge *curr_edge, shared_ptr<Vertex> vx, bool search_end); ftEdge* fetchNextEdge(ftEdge *curr_edge, shared_ptr<Vertex> vx, int& next_idx); bool regularizeEdgeLoop(std::vector<ftEdge*>& edges); void splitLoop(std::vector<ftEdge*>& edges, std::vector<shared_ptr<Vertex> >& vxs, bool to_add_edges, std::vector<std::vector<ftEdge*> >& split_loops, std::vector<std::vector<shared_ptr<Vertex> > >& split_vxs, std::vector<bool>& add_edges_split); bool regularizeCurrLoop(std::vector<ftEdge*>& edges, std::vector<shared_ptr<Vertex> >& vxs, bool to_add_edges); double getVertexAngle(ftEdge *edge1, ftEdge *edge2); void addRemainingEdges(); bool vertexInfo(shared_ptr<Vertex> vx, double& angle, Point& centre); void writePath(std::vector<ftEdge*>& edges, shared_ptr<Vertex> vx); std::vector<ftEdge*> getStartEdges(); void addIdentifiedEdges(std::vector<std::pair<Point,Point> >& corr_vx_pts); bool betterConnectionInFace(shared_ptr<Vertex> source, Body *bd, ftEdge* edg1, ftEdge *edg2, shared_ptr<Vertex> dest); }; } // namespace Go #endif // COMPLETEEDGENET_H
/* * (c) Copyright Ascensio System SIA 2010-2019 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #ifndef OOX_EXTERNAL_INCLUDE_H_ #define OOX_EXTERNAL_INCLUDE_H_ #include "../File.h" #include "../FileTypes.h" namespace OOX { class External : public File { public: External(OOX::Document* pMain) : File(pMain) { } External(OOX::Document* pMain, const CPath& uri) : File(pMain) { read(uri); } ~External() { } virtual void read(const CPath& uri) { m_uri = uri; } virtual void write(const CPath& filename, const CPath& directory, CContentTypes& content) const { } CPath Uri() const { return m_uri; } void set_Uri(CPath & file_path) { m_uri = file_path; m_sOutputFilename = file_path.GetFilename(); } protected: CPath m_uri; }; } // namespace OOX #endif // OOX_EXTERNAL_INCLUDE_H_
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** Commercial Usage ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef ABSTRACTNODEINSTANCEVIEW_H #define ABSTRACTNODEINSTANCEVIEW_H #include "corelib_global.h" #include "abstractview.h" #include <QtGui/QWidget> #include <QtCore/QHash> #include <QtScript/QScriptEngine> #include <QWeakPointer> #include <QtCore/QHash> #include <modelnode.h> #include <nodeinstance.h> QT_BEGIN_NAMESPACE class QDeclarativeEngine; class QGraphicsScene; class QGraphicsView; QT_END_NAMESPACE namespace QmlDesigner { namespace Internal { class ChildrenChangeEventFilter; } class CORESHARED_EXPORT NodeInstanceView : public AbstractView { Q_OBJECT friend class NodeInstance; friend class Internal::ObjectNodeInstance; public: typedef QWeakPointer<NodeInstanceView> Pointer; NodeInstanceView(QObject *parent = 0); ~NodeInstanceView(); void modelAttached(Model *model); void modelAboutToBeDetached(Model *model); void nodeCreated(const ModelNode &createdNode); void nodeAboutToBeRemoved(const ModelNode &removedNode); void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange); void propertiesAdded(const ModelNode &node, const QList<AbstractProperty>& propertyList); void propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList); void propertiesRemoved(const QList<AbstractProperty>& propertyList); void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange); void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange); void nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange); void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion); void fileUrlChanged(const QUrl &oldUrl, const QUrl &newUrl); void nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId); void modelStateAboutToBeRemoved(const ModelState &modelState); void modelStateAdded(const ModelState &modelState); void nodeStatesAboutToBeRemoved(const QList<ModelNode> &nodeStateList); void nodeStatesAdded(const QList<ModelNode> &nodeStateList); void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex); NodeInstance rootNodeInstance() const; NodeInstance viewNodeInstance() const; void selectedNodesChanged(const QList<ModelNode> &selectedNodeList, const QList<ModelNode> &lastSelectedNodeList); QList<NodeInstance> instances() const; NodeInstance instanceForNode(const ModelNode &node); bool hasInstanceForNode(const ModelNode &node); NodeInstance instanceForObject(QObject *object); bool hasInstanceForObject(QObject *object); void anchorsChanged(const ModelNode &nodeState); void render(QPainter *painter, const QRectF &target=QRectF(), const QRectF &source=QRect(), Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio); QRectF boundingRect() const; QRectF sceneRect() const; void setBlockChangeSignal(bool block); void notifyPropertyChange(const ModelNode &modelNode, const QString &propertyName); void setQmlModelView(QmlModelView *qmlModelView); QmlModelView *qmlModelView() const ; void setBlockStatePropertyChanges(bool block); signals: void instanceRemoved(const NodeInstance &nodeInstance); private slots: void emitParentChanged(QObject *child); private: // functions NodeInstance loadNode(const ModelNode &rootNode, QObject *objectToBeWrapped = 0); void loadModel(Model *model); void loadNodes(const QList<ModelNode> &nodeList); void removeAllInstanceNodeRelationships(); void removeRecursiveChildRelationship(const ModelNode &removedNode); void insertInstanceNodeRelationship(const ModelNode &node, const NodeInstance &instance); void removeInstanceNodeRelationship(const ModelNode &node); QDeclarativeEngine *engine() const; Internal::ChildrenChangeEventFilter *childrenChangeEventFilter(); void removeInstanceAndSubInstances(const ModelNode &node); private: //variables NodeInstance m_rootNodeInstance; QScopedPointer<QGraphicsView> m_graphicsView; QHash<ModelNode, NodeInstance> m_nodeInstanceHash; QHash<QObject*, NodeInstance> m_objectInstanceHash; // This is purely internal. Might contain dangling pointers! QWeakPointer<QDeclarativeEngine> m_engine; QWeakPointer<Internal::ChildrenChangeEventFilter> m_childrenChangeEventFilter; QWeakPointer<QmlModelView> m_qmlModelView; bool m_blockChangeSignal; bool m_blockStatePropertyChanges; }; } #endif // ABSTRACTNODEINSTANCEVIEW_H
/** * @file element_compare.c * @brief element.h implementation * @author Aleix Conchillo Flaque <aconchillo@gmail.com> * @date Thu Aug 27, 2009 01:38 * * @if copyright * * Copyright (C) 2009 Aleix Conchillo Flaque * * SCEW 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. * * SCEW 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. * * @endif */ #include "xelement.h" #include "attribute.h" #include "str.h" #include <assert.h> /* Private */ static scew_bool compare_element_ (scew_element const *a, scew_element const *b); static scew_bool compare_children_ (scew_element const *a, scew_element const *b, scew_element_cmp_hook hook); static scew_bool compare_attributes_ (scew_element const *a, scew_element const *b); /* Public */ scew_bool scew_element_compare (scew_element const *a, scew_element const *b, scew_element_cmp_hook hook) { scew_element_cmp_hook cmp_hook = NULL; assert (a != NULL); assert (b != NULL); cmp_hook = (NULL == hook) ? compare_element_ : hook; return (cmp_hook (a, b) && compare_children_ (a, b, cmp_hook)); } /* Private */ scew_bool compare_element_ (scew_element const *a, scew_element const *b) { scew_bool equal = SCEW_FALSE; assert (a != NULL); assert (b != NULL); equal = (scew_strcmp (a->name, b->name) == 0) && (scew_strcmp (a->contents, b->contents) == 0) && compare_attributes_ (a, b); return equal; } scew_bool compare_attributes_ (scew_element const *a, scew_element const *b) { scew_bool equal = SCEW_TRUE; scew_list *list_a = NULL; scew_list *list_b = NULL; assert (a != NULL); assert (b != NULL); equal = (a->n_attributes == b->n_attributes); list_a = a->attributes; list_b = b->attributes; while (equal && (list_a != NULL) && (list_b != NULL)) { scew_attribute *attr_a = scew_list_data (list_a); scew_attribute *attr_b = scew_list_data (list_b); equal = scew_attribute_compare (attr_a, attr_b); list_a = scew_list_next (list_a); list_b = scew_list_next (list_b); } return equal; } scew_bool compare_children_ (scew_element const *a, scew_element const *b, scew_element_cmp_hook hook) { scew_bool equal = SCEW_TRUE; scew_list *list_a = NULL; scew_list *list_b = NULL; assert (a != NULL); assert (b != NULL); equal = (a->n_children == b->n_children); list_a = a->children; list_b = b->children; while (equal && (list_a != NULL) && (list_b != NULL)) { scew_element *child_a = scew_list_data (list_a); scew_element *child_b = scew_list_data (list_b); equal = scew_element_compare (child_a, child_b, hook); list_a = scew_list_next (list_a); list_b = scew_list_next (list_b); } return equal; }
/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin <alex.kanavin@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef OFONOMODEMMANAGER_H #define OFONOMODEMMANAGER_H #include <QtCore/QObject> #include <QVariant> #include <QDBusObjectPath> #include <QStringList> #include "libofono-qt_global.h" //! Provides access to the list of available modems and changes in that list. class OFONO_QT_EXPORT OfonoModemManager : public QObject { Q_OBJECT public: OfonoModemManager(QObject *parent=0); ~OfonoModemManager(); //! Returns a list of d-bus object paths that represent available modems Q_INVOKABLE QStringList modems() const; signals: //! Issued when a modem has been added void modemAdded(const QString &modemPath); //! Issued when a modem has been removed void modemRemoved(const QString &modemPath); private slots: void onModemAdded(const QDBusObjectPath &path, const QVariantMap &map); void onModemRemoved(const QDBusObjectPath &path); private: QStringList m_modems; }; #endif
/****************************************************************************** JUserNotification.h Interface for the JUserNotification class. Copyright © 1994-96 by John Lindal. All rights reserved. ******************************************************************************/ #ifndef _H_JUserNotification #define _H_JUserNotification #if !defined _J_UNIX && !defined ACE_LACKS_PRAGMA_ONCE #pragma once #endif #include <jTypes.h> class JUserNotification { public: enum CloseAction { kSaveData, kDiscardData, kDontClose }; public: JUserNotification(); virtual ~JUserNotification(); virtual void DisplayMessage(const JCharacter* message) = 0; virtual void ReportError(const JCharacter* message) = 0; virtual JBoolean AskUserYes(const JCharacter* message) = 0; virtual JBoolean AskUserNo(const JCharacter* message) = 0; virtual CloseAction OKToClose(const JCharacter* message) = 0; virtual JBoolean AcceptLicense() = 0; // control of Message and Error display JBoolean IsSilent() const; void SetSilent(const JBoolean beQuiet); private: JBoolean itsSilenceFlag; private: // not allowed JUserNotification(const JUserNotification& source); const JUserNotification& operator=(const JUserNotification& source); }; /****************************************************************************** Silence ******************************************************************************/ inline JBoolean JUserNotification::IsSilent() const { return itsSilenceFlag; } inline void JUserNotification::SetSilent ( const JBoolean beQuiet ) { itsSilenceFlag = beQuiet; } #endif
// -*- C++ -*- /* GG is a GUI for SDL and OpenGL. Copyright (C) 2003-2008 T. Zachary Laine This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA If you do not wish to comply with the terms of the LGPL please contact the author as other terms are available for a fee. Zach Laine whatwasthataddress@gmail.com */ /** \file MultiEditFwd.h \brief Contains forward declaration of the MultiEdit class, and the MultiEditStyle flags. */ #ifndef _GG_MultiEditFwd_h_ #define _GG_MultiEditFwd_h_ #include <GG/Flags.h> namespace GG { class MultiEdit; /** The styles of display and interaction for a MultiEdit. */ GG_FLAG_TYPE(MultiEditStyle); extern GG_API const MultiEditStyle MULTI_NONE; ///< Default style selected. extern GG_API const MultiEditStyle MULTI_WORDBREAK; ///< Breaks words. Lines are automatically broken between words if a word would extend past the edge of the control's bounding rectangle. (As always, a '\\n' also breaks the line.) extern GG_API const MultiEditStyle MULTI_LINEWRAP; ///< Lines are automatically broken when the next character (or space) would be drawn outside the the text rectangle. extern GG_API const MultiEditStyle MULTI_VCENTER; ///< Vertically centers text. extern GG_API const MultiEditStyle MULTI_TOP; ///< Aligns text to the top. extern GG_API const MultiEditStyle MULTI_BOTTOM; ///< Aligns text to the bottom. extern GG_API const MultiEditStyle MULTI_CENTER; ///< Centers text. extern GG_API const MultiEditStyle MULTI_LEFT; ///< Aligns text to the left. extern GG_API const MultiEditStyle MULTI_RIGHT; ///< Aligns text to the right. extern GG_API const MultiEditStyle MULTI_READ_ONLY; ///< The control is not user-interactive, only used to display text. Text can still be programmatically altered and selected. extern GG_API const MultiEditStyle MULTI_TERMINAL_STYLE; ///< The text in the control is displayed so that the bottom is visible, instead of the top. extern GG_API const MultiEditStyle MULTI_INTEGRAL_HEIGHT; ///< The height of the control will always be a multiple of the height of one row (fractions rounded down). extern GG_API const MultiEditStyle MULTI_NO_VSCROLL; ///< Vertical scrolling is not available, and there is no vertical scroll bar. extern GG_API const MultiEditStyle MULTI_NO_HSCROLL; ///< Horizontal scrolling is not available, and there is no horizontal scroll bar. extern GG_API const Flags<MultiEditStyle> MULTI_NO_SCROLL; ///< Scrolls are not used for this control. } #endif
/**************************************************************************** This file is part of the GLC-lib library. Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net) http://glc-lib.sourceforge.net GLC-lib is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. GLC-lib 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 GLC-lib; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *****************************************************************************/ //! \file glc_line3d.h Interface for the GLC_Line3d class. #ifndef GLC_LINE3D_H_ #define GLC_LINE3D_H_ #include <QMetaType> #include "glc_vector3d.h" #include "../glc_config.h" ////////////////////////////////////////////////////////////////////// //! \class GLC_Line3d /*! \brief GLC_Line3d : Math 3d line representation */ /*! GLC_Line3d is definined by a 3d point and a vector*/ ////////////////////////////////////////////////////////////////////// class GLC_LIB_EXPORT GLC_Line3d { ////////////////////////////////////////////////////////////////////// /*! @name Constructor / Destructor */ //@{ ////////////////////////////////////////////////////////////////////// public: //! Default constructor GLC_Line3d(); //! Construct a 3d line with the given 3d point and vector GLC_Line3d(const GLC_Point3d& point, const GLC_Vector3d& vector); //! Construct a 3d line with the given 3d line GLC_Line3d(const GLC_Line3d& line); //! Destructor ~GLC_Line3d(); //@} ////////////////////////////////////////////////////////////////////// /*! \name Get Functions*/ //@{ ////////////////////////////////////////////////////////////////////// public: //! Return the starting 3d point of this line inline GLC_Point3d startingPoint() const {return m_Point;} //! Return the direction vector of this line inline GLC_Vector3d direction() const {return m_Vector;} //@} ////////////////////////////////////////////////////////////////////// /*! \name Set Functions*/ //@{ ////////////////////////////////////////////////////////////////////// public: //! Set the starting point of this 3d line inline void setStartingPoint(const GLC_Point3d& point) {m_Point= point;} //! Set the direction vector of this line inline void setDirection(const GLC_Vector3d& direction) {m_Vector= direction;} //@} ////////////////////////////////////////////////////////////////////// // Private Member ////////////////////////////////////////////////////////////////////// private: //! Starting point of the 3d line GLC_Point3d m_Point; //! Vector of the line GLC_Vector3d m_Vector; }; Q_DECLARE_METATYPE(GLC_Line3d) #endif /* GLC_LINE3D_H_ */
/* dlvhex -- Answer-Set Programming with external interfaces. * Copyright (C) 2005-2007 Roman Schindlauer * Copyright (C) 2006-2015 Thomas Krennwallner * Copyright (C) 2009-2016 Peter Schüller * Copyright (C) 2011-2016 Christoph Redl * Copyright (C) 2015-2016 Tobias Kaminski * Copyright (C) 2015-2016 Antonius Weinzierl * * This file is part of dlvhex. * * dlvhex 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. * * dlvhex 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 dlvhex; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA. */ /** * @file PluginContainer.h * @author Roman Schindlauer * @author Peter Schueller * @date Thu Sep 1 17:21:53 2005 * * @brief Container class for plugins. * * */ #if !defined(_DLVHEX_PLUGINCONTAINER_H) #define _DLVHEX_PLUGINCONTAINER_H #include "dlvhex2/PlatformDefinitions.h" #include "dlvhex2/fwd.h" #include "dlvhex2/PluginInterface.h" #include <string> #include <vector> #include <boost/shared_ptr.hpp> DLVHEX_NAMESPACE_BEGIN /** * @brief Collects and administrates all available plugins. * * The PluginContainer loads and manages dynamically loaded and internal plugins. * It is not aware of the configuration or usage of plugins or plugin atoms in a * ProgramCtx. * * Important: memory allocation policy: * * PluginInterface objects are passed by pointer from the extern "C" plugin * import function, they are wrapped in a non-deleting smart pointer by the * PluginContainer and must be deallocated by the library itself. * * PluginAtom objects are created by PluginInterface::getAtoms and * then owned by a smart pointer in the PluginContainer. These smart pointers * must contain a "deleter" compiled into the library. */ class DLVHEX_EXPORT PluginContainer { private: /** \brief Copy-constructor. * * Must not be used, would duplicate library unloads. * @param c Other PluginContainer. */ PluginContainer(const PluginContainer& p); public: /** \brief Constructor. */ PluginContainer(); /** \brief Destructor. * * Unloads shared libraries (if shared_ptr reference counts are ok). */ ~PluginContainer(); // // loading and accessing // /** \brief Search for plugins in searchpath and open those that are plugins. * * May be called multiple times with different paths. * Paths may be separated by ":" just like LD_LIBRARY_PATH. * @param searchpath Path(es) to search. */ void loadPlugins(const std::string& searchpath=""); /** \brief Add a PluginInterface to the container. * * The smart pointer will not be reconfigured, so if you need to use a * custom "deleter", do it before you call this method. * @param plugin Pointer to an internal plugin. */ void addInternalPlugin(PluginInterfacePtr plugin); /** \brief Get container with plugins loaded so far. * @return Vector of plugins loaded so far. */ const std::vector<PluginInterfacePtr>& getPlugins() const { return pluginInterfaces; } // // batch operations on all plugins // /** \brief Calls printUsage for each loaded plugin. * @param o Stream to print the output to. */ void printUsage(std::ostream& o); public: struct LoadedPlugin; typedef boost::shared_ptr<LoadedPlugin> LoadedPluginPtr; typedef std::vector<LoadedPluginPtr> LoadedPluginVector; typedef std::vector<PluginInterfacePtr> PluginInterfaceVector; private: /** \brief Add loaded plugin (do not extract plugin atoms). * @param lplugin Pointer to the loaded plugin. */ void addInternalPlugin(LoadedPluginPtr lplugin); /** \brief Current search path. */ std::string searchPath; /** \brief Loaded plugins. */ LoadedPluginVector plugins; /** \brief Loaded plugins (interface ptrs). */ PluginInterfaceVector pluginInterfaces; }; typedef boost::shared_ptr<PluginContainer> PluginContainerPtr; DLVHEX_NAMESPACE_END #endif /* _DLVHEX_PLUGINCONTAINER_H */ // vim:expandtab:ts=4:sw=4: // mode: C++ // End:
// The libMesh Finite Element Library. // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __tecplot_io_h__ #define __tecplot_io_h__ // Local includes #include "libmesh_common.h" #include "mesh_output.h" // C++ Includes #include <cstddef> namespace libMesh { // Forward declarations class MeshBase; /** * This class implements writing meshes in the Tecplot format. * * @author Benjamin S. Kirk, 2004 */ // ------------------------------------------------------------ // TecplotIO class definition class TecplotIO : public MeshOutput<MeshBase> { public: /** * Constructor. Takes a reference to a constant mesh object. * This constructor will only allow us to write the mesh. * The optional parameter \p binary can be used to switch * between ASCII (\p false, the default) or binary (\p true) * output files. */ explicit TecplotIO (const MeshBase&, const bool binary=false); /** * This method implements writing a mesh to a specified file. */ virtual void write (const std::string& ); /** * This method implements writing a mesh with nodal data to a * specified file where the nodal data and variable names are provided. */ virtual void write_nodal_data (const std::string&, const std::vector<Number>&, const std::vector<std::string>&); /** * Flag indicating whether or not to write a binary file * (if the tecio.a library was found by \p configure). */ bool & binary (); private: /** * This method implements writing a mesh with nodal data to a * specified file where the nodal data and variable names are optionally * provided. This will write an ASCII file. */ void write_ascii (const std::string&, const std::vector<Number>* = NULL, const std::vector<std::string>* = NULL); /** * This method implements writing a mesh with nodal data to a * specified file where the nodal data and variable names are optionally * provided. This will write a binary file if the tecio.a library was * found at compile time, otherwise a warning message will be printed and * an ASCII file will be created. */ void write_binary (const std::string&, const std::vector<Number>* = NULL, const std::vector<std::string>* = NULL); //--------------------------------------------------------------------------- // local data /** * Flag to write binary data. */ bool _binary; }; // ------------------------------------------------------------ // TecplotIO inline members inline TecplotIO::TecplotIO (const MeshBase& mesh, const bool binary) : MeshOutput<MeshBase> (mesh), _binary (binary) { } inline bool & TecplotIO::binary () { return _binary; } } // namespace libMesh #endif // #define __tecplot_io_h__
#include "key2pho8.h" const static int shift[] = { 9, 7, 3, 0 }; const static int sb[] = { 31, 3, 15, 7 }; const char *ph_pho[] = { /* number of bits */ " ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙ", /* 5 */ " ㄧㄨㄩ", /* 2 */ " ㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦ", /* 4 */ " ˙ˊˇˋ" /* 3 */ }; /* Translate a single phone into a single uint assume phone is a big5 null-terminated string with no spaces */ uint16_t PhoneWc2Uint( const wchar_t *phone ) { int i, j, len = wcslen( phone ); uint16_t result = 0; wchar_t *pc; wchar_t temp; wchar_t *wcPho; for ( i = 0, j = 0; i < len && j < 4; j++ ) { temp = phone[ i ]; wcPho = malloc(sizeof(wchar_t)*22); mbstowcs( wcPho, ph_pho[ j ], 22); pc = wcschr( wcPho, temp ); if ( pc ) { result |= ( ( pc - wcPho ) - 1 ) << shift[ j ]; i++; } free( wcPho ); } return result; } uint16_t Uint2PhoneWc( wchar_t *phone, uint16_t seq ) { int i, j; wchar_t *wcPho; for ( i = 0, j = 0; i < 4; i++) { wcPho = malloc(sizeof(wchar_t)*22); mbstowcs( wcPho, ph_pho[ i ], 22); if ( wcPho[ ((seq >> shift[ i ]) & sb[ i ]) + 1 ] != ' ' ) { phone[ j ] = wcPho[ ((seq >> shift[ i ]) & sb[ i ]) + 1 ]; j++; } free (wcPho); } return j; } //int main(int argc, char *argv[]) //{ // wchar_t phone[100]; // char bphone[100]; // if (argc < 2) // { // fprintf(stderr, "Usage: key2pho <number>\n"); // exit(1); // } // setlocale(LC_CTYPE, "zh_TW.UTF-8"); //// mbstowcs( phone, "ㄊㄡˊ", 3 ); //// printf("ㄊㄡˊ : %d\n", PhoneWc2Uint( phone )); // memset(phone, 0, sizeof(phone)); // Uint2PhoneWc(phone, atoi(argv[1])); // wcstombs( bphone, phone, sizeof(bphone) ); // printf("%d: %s\n",atoi(argv[1]), bphone); // // return 0; //}
/* * StarPU * Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (see AUTHORS file) * * 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 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 in COPYING.LGPL for more details. */ #include <errno.h> #include <core/workers.h> #include <common/config.h> #include <starpu.h> #include <starpu_cuda.h> #include <drivers/opencl/opencl.h> #if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL) struct malloc_pinned_codelet_struct { void **ptr; size_t dim; }; #endif //#ifdef STARPU_USE_OPENCL //static void malloc_pinned_opencl_codelet(void *buffers[] __attribute__((unused)), void *arg) //{ // struct malloc_pinned_codelet_struct *s = arg; // // *(s->ptr) = malloc(s->dim); // _starpu_opencl_allocate_memory((void **)(s->ptr), s->dim, CL_MEM_READ_WRITE|CL_MEM_ALLOC_HOST_PTR); //} //#endif #ifdef STARPU_USE_CUDA static void malloc_pinned_cuda_codelet(void *buffers[] __attribute__((unused)), void *arg) { struct malloc_pinned_codelet_struct *s = arg; cudaError_t cures; cures = cudaHostAlloc((void **)(s->ptr), s->dim, cudaHostAllocPortable); if (STARPU_UNLIKELY(cures)) STARPU_CUDA_REPORT_ERROR(cures); } #endif #if defined(STARPU_USE_CUDA)// || defined(STARPU_USE_OPENCL) static struct starpu_perfmodel_t malloc_pinned_model = { .type = STARPU_HISTORY_BASED, .symbol = "malloc_pinned" }; static starpu_codelet malloc_pinned_cl = { .cuda_func = malloc_pinned_cuda_codelet, //#ifdef STARPU_USE_OPENCL // .opencl_func = malloc_pinned_opencl_codelet, //#endif .nbuffers = 0, .model = &malloc_pinned_model }; #endif int starpu_data_malloc_pinned_if_possible(void **A, size_t dim) { if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls())) return -EDEADLK; STARPU_ASSERT(A); if (_starpu_may_submit_cuda_task()) { #ifdef STARPU_USE_CUDA int push_res; struct malloc_pinned_codelet_struct s = { .ptr = A, .dim = dim }; malloc_pinned_cl.where = STARPU_CUDA; struct starpu_task *task = starpu_task_create(); task->callback_func = NULL; task->cl = &malloc_pinned_cl; task->cl_arg = &s; task->synchronous = 1; #ifdef STARPU_USE_FXT _starpu_exclude_task_from_dag(task); #endif push_res = starpu_task_submit(task, NULL); STARPU_ASSERT(push_res != -ENODEV); #endif } // else if (_starpu_may_submit_opencl_task()) // { //#ifdef STARPU_USE_OPENCL // int push_res; // // struct malloc_pinned_codelet_struct s = { // .ptr = A, // .dim = dim // }; // // malloc_pinned_cl.where = STARPU_OPENCL; // struct starpu_task *task = starpu_task_create(); // task->callback_func = NULL; // task->cl = &malloc_pinned_cl; // task->cl_arg = &s; // // task->synchronous = 1; // //#ifdef STARPU_USE_FXT // _starpu_exclude_task_from_dag(task); //#endif // // push_res = starpu_task_submit(task, NULL); // STARPU_ASSERT(push_res != -ENODEV); //#endif // } else { *A = malloc(dim); } STARPU_ASSERT(*A); return 0; } #ifdef STARPU_USE_CUDA static void free_pinned_cuda_codelet(void *buffers[] __attribute__((unused)), void *arg) { cudaError_t cures; cures = cudaFreeHost(arg); if (STARPU_UNLIKELY(cures)) STARPU_CUDA_REPORT_ERROR(cures); } #endif //#ifdef STARPU_USE_OPENCL //static void free_pinned_opencl_codelet(void *buffers[] __attribute__((unused)), void *arg) //{ // // free(arg); // int err = clReleaseMemObject(arg); // if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err); //} //#endif #if defined(STARPU_USE_CUDA) // || defined(STARPU_USE_OPENCL) static struct starpu_perfmodel_t free_pinned_model = { .type = STARPU_HISTORY_BASED, .symbol = "free_pinned" }; static starpu_codelet free_pinned_cl = { .cuda_func = free_pinned_cuda_codelet, //#ifdef STARPU_USE_OPENCL // .opencl_func = free_pinned_opencl_codelet, //#endif .nbuffers = 0, .model = &free_pinned_model }; #endif int starpu_data_free_pinned_if_possible(void *A) { if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls())) return -EDEADLK; if (_starpu_may_submit_cuda_task()) { #ifdef STARPU_USE_CUDA int push_res; free_pinned_cl.where = STARPU_CUDA; struct starpu_task *task = starpu_task_create(); task->callback_func = NULL; task->cl = &free_pinned_cl; task->cl_arg = A; task->synchronous = 1; #ifdef STARPU_USE_FXT _starpu_exclude_task_from_dag(task); #endif push_res = starpu_task_submit(task, NULL); STARPU_ASSERT(push_res != -ENODEV); #endif } // else if (_starpu_may_submit_opencl_task()) // { //#ifdef STARPU_USE_OPENCL // int push_res; // // free_pinned_cl.where = STARPU_OPENCL; // struct starpu_task *task = starpu_task_create(); // task->callback_func = NULL; // task->cl = &free_pinned_cl; // task->cl_arg = A; // // task->synchronous = 1; // //#ifdef STARPU_USE_FXT // _starpu_exclude_task_from_dag(task); //#endif // // push_res = starpu_task_submit(task, NULL); // STARPU_ASSERT(push_res != -ENODEV); //#endif // } else { free(A); } return 0; }
/* * (C) 2001 Clemson University and The University of Chicago * * See COPYING in top-level directory. */ #ifndef __DBPF_OPEN_CACHE_H__ #define __DBPF_OPEN_CACHE_H__ #include <db.h> #include "trove.h" #include "trove-internal.h" enum open_cache_open_type { DBPF_FD_BUFFERED_READ = 1, DBPF_FD_BUFFERED_WRITE, DBPF_FD_DIRECT_READ, DBPF_FD_DIRECT_WRITE }; struct open_cache_ref { int fd; enum open_cache_open_type type; void* internal; /* pointer to underlying data structure */ }; void dbpf_open_cache_initialize(void); void dbpf_open_cache_finalize(void); int dbpf_open_cache_get( TROVE_coll_id coll_id, TROVE_handle handle, enum open_cache_open_type type, struct open_cache_ref* out_ref); void dbpf_open_cache_put( struct open_cache_ref* in_ref); int dbpf_open_cache_remove( TROVE_coll_id coll_id, TROVE_handle handle); #endif /* __DBPF_OPEN_CACHE_H__ */ /* * Local variables: * c-indent-level: 4 * c-basic-offset: 4 * End: * * vim: ts=8 sts=4 sw=4 expandtab */
/* * * Copyright (C) 2011 MeVis Medical Solutions AG All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29, * 28359 Bremen, Germany or: * * http://www.mevis.de * */ //---------------------------------------------------------------------------------- /*! // \file dPython.h - This file was copied from VTK and was originally named vtkPython.h // \author David Gobbi // \author Last changed by $Author: jcfr $ // \date 2012 */ //---------------------------------------------------------------------------------- #ifndef __PythonQtPythonInclude_h #define __PythonQtPythonInclude_h // Undefine macros that Python.h defines to avoid redefinition warning. #undef _POSIX_C_SOURCE #undef _POSIX_THREADS #undef _XOPEN_SOURCE // // Use the real python debugging library if it is provided. // Otherwise use the "documented" trick involving checking for _DEBUG // and undefined that symbol while we include Python headers. // Update: this method does not fool Microsoft Visual C++ 8 anymore; two // of its header files (crtdefs.h and use_ansi.h) check if _DEBUG was set // or not, and set flags accordingly (_CRT_MANIFEST_RETAIL, // _CRT_MANIFEST_DEBUG, _CRT_MANIFEST_INCONSISTENT). The next time the // check is performed in the same compilation unit, and the flags are found, // and error is triggered. Let's prevent that by setting _CRT_NOFORCE_MANIFEST. // // If PYTHONQT_USE_RELEASE_PYTHON_FALLBACK is enabled, try to link // release Python DLL if it is available by undefining _DEBUG while // including Python.h #if defined(PYTHONQT_USE_RELEASE_PYTHON_FALLBACK) && defined(_DEBUG) # undef _DEBUG // Include these low level headers before undefing _DEBUG. Otherwise when doing // a debug build against a release build of python the compiler will end up // including these low level headers without DEBUG enabled, causing it to try // and link release versions of this low level C api. # include <basetsd.h> # include <assert.h> # include <ctype.h> # include <errno.h> # include <io.h> # include <math.h> # include <sal.h> # include <stdarg.h> # include <stddef.h> # include <stdio.h> # include <stdlib.h> # include <string.h> # include <sys/stat.h> # include <time.h> # include <wchar.h> # if defined(_MSC_VER) && _MSC_VER >= 1400 # define _CRT_NOFORCE_MANIFEST 1 # endif # include <Python.h> # define _DEBUG #else # include <Python.h> #endif #endif
// Platform.h #ifndef SEVENZIPCORE_PLATFORM_H #define SEVENZIPCORE_PLATFORM_H #if defined(_WIN32) || defined(__WIN32__) #ifndef __WINDOWS__ #define __WINDOWS__ #endif #include <Windows.h> #endif #define FOLDER_SEPARATOR_WINDOWS TEXT('\\') #define FOLDER_SEPARATOR_POSIX TEXT('/') #ifdef __WINDOWS__ #define FOLDER_SEPARATOR TEXT('\\') #define FOLDER_SEPARATOR_STRING TEXT("\\") #define FOLDER_POSSIBLE_SEPARATOR TEXT("\\/") #else #define FOLDER_SEPARATOR TEXT('/') #define FOLDER_SEPARATOR_STRING TEXT("/") #define FOLDER_POSSIBLE_SEPARATOR TEXT("/") #endif #define FILE_EXTENSION_SEPARATOR TEXT('.') #define FILE_EXTENSION_SEPARATOR_STRING TEXT(".") #endif // SEVENZIPCORE_PLATFORM_H
/* Test of case-insensitive memory area comparison function. Copyright (C) 2007-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2009. */ #include <config.h> #include "mbmemcasecmp.h" #include <locale.h> #include <stdbool.h> #include <string.h> #include "macros.h" #include "test-mbmemcasecmp.h" int main (int argc, char *argv[]) { /* configure should already have checked that the locale is supported. */ if (setlocale (LC_ALL, "") == NULL) return 1; test_ascii (mbmemcasecmp); if (argc > 1) switch (argv[1][0]) { case '1': /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ test_iso_8859_1 (mbmemcasecmp, true); return 0; case '2': /* Locale encoding is UTF-8, locale is not Turkish. */ test_utf_8 (mbmemcasecmp, false); return 0; case '3': /* Locale encoding is UTF-8, locale is Turkish. */ test_utf_8 (mbmemcasecmp, true); return 0; } return 1; }
/******************************************************************************\ This file is part of the C! library. A.K.A the cbang library. Copyright (c) 2003-2019, Cauldron Development LLC Copyright (c) 2003-2017, Stanford University All rights reserved. The 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 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 C! library. If not, see <http://www.gnu.org/licenses/>. In addition, BSD licensing may be granted on a case by case basis by written permission from at least one of the copyright holders. You may request written permission by emailing the authors. For information regarding this software email: Joseph Coffland joseph@cauldrondevelopment.com \******************************************************************************/ #pragma once #include <math.h> #include <cmath> #include <limits> namespace cb { namespace Math { #if defined(_WIN32) && !defined(__MINGW32__) #include <float.h> // Windows doesn't have round() inline static double round(double x) {return floor(x + 0.5);} inline static float round(float x) {return floorf(x + 0.5);} // Or isnan inline static bool isnan(double x) {return _isnan(x);} inline static bool isnan(float x) {return _isnan(x);} // Or isinf inline static bool isinf(double x) {return !_finite(x) && !_isnan(x);} inline static bool isinf(float x) {return !_finite(x) && !_isnan(x);} #else inline static double round(double x) {return ::round(x);} inline static float round(float x) {return roundf(x);} inline static bool isnan(double x) {return std::isnan(x);} inline static bool isnan(float x) {return std::isnan(x);} inline static bool isinf(double x) {return std::isinf(x);} inline static bool isinf(float x) {return std::isinf(x);} #endif inline static bool isfinite(double x) {return !(isnan(x) || isinf(x));} inline static bool isfinite(float x) {return !(isnan(x) || isinf(x));} inline static double nextUp(double x) { return nextafter(x, std::numeric_limits<double>::infinity()); } inline static double nextDown(double x) { return nextafter(x, -std::numeric_limits<double>::infinity()); } } } #ifndef M_PI #define M_PI 3.14159265358979323846 #endif
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef GMOBILE1D_H #define GMOBILE1D_H #include "Kernel.h" #include "GGroup.h" //Forward Declarations class GMobile1D; template<> InputParameters validParams<GMobile1D>(); class GMobile1D : public Kernel { public: GMobile1D(const InputParameters & parameters); protected: virtual Real computeQpResidual(); virtual Real computeQpJacobian(); virtual Real computeQpOffDiagJacobian(unsigned int jvar); int getGroupNumber(std::string); double getConcBySize(int); double getAbsorbCoef(int); private: int _number_v; int _number_i; int _max_mobile_v; int _max_mobile_i; const GGroup & _gc; std::vector<unsigned int> _no_v_vars; std::vector<const VariableValue *> _val_v_vars; std::vector<unsigned int> _no_i_vars; std::vector<const VariableValue *> _val_i_vars; std::vector<const VariableValue *> _val_i_auxvars; int _cur_size; int max_v,max_i; }; #endif
/* this file is part of libccc, criawips' cairo-based canvas * * AUTHORS * Sven Herzberg <herzi@gnome-de.org> * * Copyright (C) 2005 Sven Herzberg * * 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 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 Lesser 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 FIFTEEN_GRID_H #define FIFTEEN_GRID_H #include <ccc/cc-rectangle.h> G_BEGIN_DECLS typedef struct _FifteenGrid FifteenGrid; typedef struct _CcRectangleClass FifteenGridClass; #define FIFTEEN_TYPE_GRID (fifteen_grid_get_type()) #define FIFTEEN_GRID(i) (G_TYPE_CHECK_INSTANCE_CAST((i), FIFTEEN_TYPE_GRID, FifteenGrid)) #define FIFTEEN_GRID_CLASS(c) (G_TYPE_CHECK_CLASS_CAST((c), FIFTEEN_TYPE_GRID, FifteenGridClass)) #define FIFTEEN_IS_GRID(i) (G_TYPE_CHECK_INSTANCE_TYPE((i), FIFTEEN_TYPE_GRID)) #define FIFTEEN_IS_GRID_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE((c), FIFTEEN_TYPE_GRID)) #define FIFTEEN_GRID_GET_CLASS(i) (G_TYPE_INSTANCE_GET_CLASS((i), FIFTEEN_TYPE_GRID, FifteenGridClass)) GType fifteen_grid_get_type(void); CcItem* fifteen_grid_new (PangoFontDescription* desc); void fifteen_grid_scramble(FifteenGrid* self); struct _FifteenGrid { CcRectangle base_instance; CcItem * elements[16]; PangoFontDescription* font_description; }; G_END_DECLS #endif /* !FIFTEEN_GRID_H */
//////////////////////////////////////////////////////////////// // // Copyright (C) 2005 Affymetrix, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License (version 2) as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program;if not, write to the // // Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //////////////////////////////////////////////////////////////// #ifndef __SDKSTATSTEST_H_ #define __SDKSTATSTEST_H_ #include <cppunit/extensions/HelperMacros.h> class SdkStatsTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( SdkStatsTest ); CPPUNIT_TEST(test_pnorm); CPPUNIT_TEST(test_psignrank); CPPUNIT_TEST(test_signedRankTest); CPPUNIT_TEST(test_pwilcox); CPPUNIT_TEST(test_ranksumTest); CPPUNIT_TEST(test_uprob); CPPUNIT_TEST(test_chisqrprob); CPPUNIT_TEST(test_PearsonCorrelation); CPPUNIT_TEST(test_CalcHWEqPValue); CPPUNIT_TEST_SUITE_END(); public: void setUp(); void tearDown(); void test_pnorm(); void test_psignrank(); void test_signedRankTest(); void test_pwilcox(); void test_ranksumTest(); void test_uprob(); void test_chisqrprob(); void test_PearsonCorrelation(); void test_CalcHWEqPValue(); }; #endif // __SDKSTATSTEST_H_
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef CIRCLEAVERAGEMATERIALPROPERTYAUX_H #define CIRCLEAVERAGEMATERIALPROPERTYAUX_H #include "AuxKernel.h" //Forward Declarations class CircleAverageMaterialPropertyAux; class CircleAverageMaterialProperty; template<> InputParameters validParams<CircleAverageMaterialPropertyAux>(); class CircleAverageMaterialPropertyAux : public AuxKernel { public: CircleAverageMaterialPropertyAux(const InputParameters & parameters); protected: virtual Real computeValue(); const CircleAverageMaterialProperty & _uo; const Real _radius; }; #endif // CIRCLEAVERAGEMATERIALPROPERTYAUX_H
/* * Copyright (C) 2011 Apple Inc. All Rights Reserved. * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) * * 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. ``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 * 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 WebSocketServer_h #define WebSocketServer_h #if ENABLE(INSPECTOR_SERVER) #include <wtf/Deque.h> #include <wtf/OwnPtr.h> #include <wtf/text/WTFString.h> #if PLATFORM(QT) namespace WebKit { class QtTcpServerHandler; } #endif namespace WebCore { class SocketStreamHandle; } namespace WebKit { class WebSocketServerClient; class WebSocketServerConnection; class WebSocketServer { public: enum ServerState { Closed, Listening }; WebSocketServer(WebSocketServerClient*); virtual ~WebSocketServer(); // Server operations. bool listen(const String& bindAddress, unsigned short port); String bindAddress() const { return m_bindAddress; }; unsigned short port() const { return m_port; }; ServerState serverState() const { return m_state; }; void close(); WebSocketServerClient* client() const { return m_client; } void didAcceptConnection(PassOwnPtr<WebSocketServerConnection>); private: void didCloseWebSocketServerConnection(WebSocketServerConnection*); void platformInitialize(); bool platformListen(const String& bindAddress, unsigned short port); void platformClose(); ServerState m_state; Deque<OwnPtr<WebSocketServerConnection> > m_connections; WebSocketServerClient* m_client; String m_bindAddress; unsigned short m_port; #if PLATFORM(QT) OwnPtr<QtTcpServerHandler> m_tcpServerHandler; #endif friend class WebSocketServerConnection; }; } #endif // ENABLE(INSPECTOR_SERVER) #endif // WebSocketServer_h
/* Copyright (C) 2009 Conrad Parker */ #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/sendfile.h> #include <fcntl.h> #include <pthread.h> #include <oggz/oggz.h> #include "http-reqline.h" #include "http-status.h" #include "params.h" #include "resource.h" #include "stream.h" #include "tempfd.h" /*#define DEBUG*/ #define DEFAULT_CONTENT_TYPE "application/ogg" #define x_strdup(s) ((s)?strdup((s)):(NULL)) struct header_tracker { long serialno; size_t num_headers; }; struct oggstdin { const char * path; const char * content_type; pthread_t main_thread; int active; struct ringbuffer rb; int headers_fd; size_t headers_len; /* pointer to current writeable position in headers */ int in_headers; list_t *header_tracker; OGGZ * oggz; }; static struct oggstdin oggstdin_pvt; static int oggstdin_read_page (OGGZ * oggz, const ogg_page * og, long serialno, void * data) { struct oggstdin * st = (struct oggstdin *)data; if (ogg_page_bos(og)) { if (st->in_headers == 0) { st->headers_len = 0; lseek (st->headers_fd, 0, SEEK_SET); } ++st->in_headers; } if (st->in_headers) { list_t *list = st->header_tracker; while (list && ((struct header_tracker*)list->data)->serialno != serialno) list = list->next; if (!list) { struct header_tracker *ht = malloc(sizeof(struct header_tracker)); ht->serialno = serialno; ht->num_headers = 0; list = st->header_tracker = list_prepend(st->header_tracker, ht); } ((struct header_tracker*)list->data)->num_headers += ogg_page_packets (og); write (st->headers_fd, og->header, og->header_len); st->headers_len += og->header_len; write (st->headers_fd, og->body, og->body_len); st->headers_len += og->body_len; fsync (st->headers_fd); if (((struct header_tracker*)list->data)->num_headers >= oggz_stream_get_numheaders(oggz, serialno)) { --st->in_headers; } } else { ringbuffer_write (&st->rb, og->header, og->header_len); ringbuffer_write (&st->rb, og->body, og->body_len); } return (st->active ? OGGZ_CONTINUE : OGGZ_STOP_OK); } static void * oggstdin_main (void * data) { struct oggstdin * st = (struct oggstdin *)data; st->oggz = oggz_open_stdio (stdin, OGGZ_READ); oggz_set_read_page (st->oggz, -1, oggstdin_read_page, st); oggz_run (st->oggz); oggz_close (st->oggz); return NULL; } int oggstdin_run (void) { struct oggstdin *st = &oggstdin_pvt; return pthread_create (&st->main_thread, NULL, oggstdin_main, st); } void oggstdin_sighandler (void) { struct oggstdin *st = &oggstdin_pvt; st->active = 0; pthread_join (st->main_thread, NULL); } static int oggstdin_check (http_request * request, void * data) { struct oggstdin * st = (struct oggstdin *)data; return !strncmp (request->path, st->path, strlen(st->path)); } static void oggstdin_head (http_request * request, params_t * request_headers, const char ** status_line, params_t ** response_headers, void * data) { struct oggstdin * st = (struct oggstdin *)data; params_t * r = *response_headers; *status_line = http_status_line (HTTP_STATUS_OK); r = params_append (r, "Content-Type", st->content_type); } static void oggstdin_body (int fd, http_request * request, params_t * request_headers, void * data) { struct oggstdin * st = (struct oggstdin *)data; size_t n, avail; off_t offset=0; int rd; while (st->in_headers) { usleep (10000); } if ((n = sendfile (fd, st->headers_fd, &offset, st->headers_len)) == -1) { perror ("OggStdin body write"); return; } fsync (fd); rd = ringbuffer_open (&st->rb); while (st->active) { while ((avail = ringbuffer_avail (&st->rb, rd)) == 0) usleep (10000); #ifdef DEBUG if (avail != 0) printf ("stream_reader: %ld bytes available\n", avail); #endif n = ringbuffer_writefd (fd, &st->rb, rd); if (n == -1) { break; } fsync (fd); #ifdef DEBUG if (n!=0 || avail != 0) printf ("stream_reader: wrote %ld of %ld bytes to socket\n", n, avail); #endif } ringbuffer_close (&st->rb, rd); } static void oggstdin_delete (void * data) { struct oggstdin * st = (struct oggstdin *)data; free (st->path); free (st->content_type); free (st->rb.data); list_free_with (st->header_tracker, &free); close (st->headers_fd); oggz_close (st->oggz); } struct resource * oggstdin_resource (const char * path, const char * content_type) { struct oggstdin * st = &oggstdin_pvt; unsigned char * data, * headers; size_t len = 4096*16*32; size_t header_len = 10 * 1024; if ((data = malloc (len)) == NULL) { return NULL; } if ((st->headers_fd = create_tempfd ("sighttpd-XXXXXXXXXX")) == -1) { perror ("create_tempfd"); return NULL; } st->path = x_strdup (path); if (st->path == NULL) { free (data); return NULL; } st->content_type = x_strdup (content_type); if (st->content_type == NULL) { free (data); free (st->path); return NULL; } ringbuffer_init (&st->rb, data, len); st->active = 1; st->headers_len = 0; st->in_headers = 0; st->header_tracker = list_new (); return resource_new (oggstdin_check, oggstdin_head, oggstdin_body, oggstdin_delete, st); } list_t * oggstdin_resources (Dictionary * config) { list_t * l; const char * path; const char * ctype; l = list_new(); path = dictionary_lookup (config, "Path"); ctype = dictionary_lookup (config, "Type"); if (!ctype) ctype = DEFAULT_CONTENT_TYPE; if (path) l = list_append (l, oggstdin_resource (path, ctype)); return l; }
#pragma once class LoginUi { public: LoginUi(void); ~LoginUi(void); public: bool Show(); private: void DoLogin(); bool OnWindowCreated(Base::NBaseObj* source, NEventData* eventData); bool OnBtnRetry(Base::NBaseObj* source, NEventData* eventData); static unsigned int WINAPI ThreadProc(void* data); private: NInstPtr<NWindow> window_; NLabel* statusLabel_; NImage* qrcode_; NButton* btnRetry_; bool loginOk_; bool stop_; HANDLE loginThread_; };
/* * Created on: May 10, 2012 * Author: mdonahue * * Copyright (C) 2012-2016 VMware, Inc. All rights reserved. -- VMware Confidential */ #ifndef AMQPIMPL_H_ #define AMQPIMPL_H_ #include "amqpClient/amqpImpl/IContentHeader.h" #include "amqpClient/amqpImpl/IMethod.h" namespace Caf { namespace AmqpClient { /** * @author mdonahue * @ingroup AmqpApiImpl * @remark LIBRARY IMPLEMENTATION - NOT PART OF THE PUBLIC API * @brief A set of helpers to convert c-api data structures into C++ objects */ class AMQPImpl { public: /** * @brief Convert a c-api method structure into the appropriate IMethod object * @param method c-api method data * @return IMethod object */ static SmartPtrIMethod methodFromFrame(const amqp_method_t * const method); /** * @brief Convert a c-api properties structure into the appropriate IContentHedaer object * @param properties c-api properties data * @return IContentHeader object */ static SmartPtrIContentHeader headerFromFrame(const SmartPtrCAmqpFrame& frame); }; }} #endif /* AMQPIMPL_H_ */
/* GDK - The GIMP Drawing Kit * Copyright (C) 2013 Jan Arne Petersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 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, see <http://www.gnu.org/licenses/>. */ #ifndef __GDK_WAYLAND_DEVICE_H__ #define __GDK_WAYLAND_DEVICE_H__ #if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdkwayland.h> can be included directly." #endif #include <gdk/gdk.h> #include <wayland-client.h> G_BEGIN_DECLS #ifdef GDK_COMPILATION typedef struct _GdkWaylandDevice GdkWaylandDevice; #else typedef GdkDevice GdkWaylandDevice; #endif typedef struct _GdkWaylandDeviceClass GdkWaylandDeviceClass; #define GDK_TYPE_WAYLAND_DEVICE (gdk_wayland_device_get_type ()) #define GDK_WAYLAND_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_WAYLAND_DEVICE, GdkWaylandDevice)) #define GDK_WAYLAND_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_WAYLAND_DEVICE, GdkWaylandDeviceClass)) #define GDK_IS_WAYLAND_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_WAYLAND_DEVICE)) #define GDK_IS_WAYLAND_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_WAYLAND_DEVICE)) #define GDK_WAYLAND_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_WAYLAND_DEVICE, GdkWaylandDeviceClass)) GDK_AVAILABLE_IN_ALL GType gdk_wayland_device_get_type (void); GDK_AVAILABLE_IN_ALL struct wl_seat *gdk_wayland_device_get_wl_seat (GdkDevice *device); GDK_AVAILABLE_IN_ALL struct wl_pointer *gdk_wayland_device_get_wl_pointer (GdkDevice *device); GDK_AVAILABLE_IN_ALL struct wl_keyboard *gdk_wayland_device_get_wl_keyboard (GdkDevice *device); GDK_AVAILABLE_IN_3_20 struct wl_seat *gdk_wayland_seat_get_wl_seat (GdkSeat *seat); G_END_DECLS #endif /* __GDK_WAYLAND_DEVICE_H__ */
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with ** the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef ORGANIZERITEMTRANSFORM_H_ #define ORGANIZERITEMTRANSFORM_H_ #include <QList> #include <qmobilityglobal.h> #include "qorganizeritemdetaildefinition.h" QTM_BEGIN_NAMESPACE class QOrganizerItem; QTM_END_NAMESPACE QTM_USE_NAMESPACE class CCalEntry; class CCalInstance; class OrganizerItemDetailTransform; class OrganizerItemTransform { public: OrganizerItemTransform(); ~OrganizerItemTransform(); void modifyBaseSchemaDefinitions(QMap<QString, QMap<QString, QOrganizerItemDetailDefinition> > &schemaDefs) const; void toEntryL(const QOrganizerItem &item, CCalEntry *entry); void toItemL(const CCalEntry &entry, QOrganizerItem *item) const; void toItemPostSaveL(const CCalEntry &entry, QOrganizerItem *item, QString managerUri) const; void toItemOccurrenceL(const CCalInstance &instance, QOrganizerItem *itemOccurrence) const; private: QList<OrganizerItemDetailTransform *> m_detailTransforms; }; #endif /* ORGANIZERITEMTRANSFORM_H_ */
/* * cpu_s390.c: CPU driver for s390(x) CPUs * * Copyright (C) 2013 Red Hat, Inc. * Copyright IBM Corp. 2012 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. */ #include <config.h> #include "viralloc.h" #include "virstring.h" #include "cpu.h" #define VIR_FROM_THIS VIR_FROM_CPU static const virArch archs[] = { VIR_ARCH_S390, VIR_ARCH_S390X }; static virCPUCompareResult virCPUs390Compare(virCPUDefPtr host G_GNUC_UNUSED, virCPUDefPtr cpu G_GNUC_UNUSED, bool failMessages G_GNUC_UNUSED) { /* s390 relies on QEMU to perform all runability checking. Return * VIR_CPU_COMPARE_IDENTICAL to bypass Libvirt checking. */ return VIR_CPU_COMPARE_IDENTICAL; } static int virCPUs390Update(virCPUDefPtr guest, const virCPUDef *host) { g_autoptr(virCPUDef) updated = NULL; size_t i; if (guest->mode == VIR_CPU_MODE_CUSTOM) { if (guest->match == VIR_CPU_MATCH_MINIMUM) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("match mode %s not supported"), virCPUMatchTypeToString(guest->match)); } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("optional CPU features are not supported")); } return -1; } if (!host) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("unknown host CPU model")); return -1; } if (!(updated = virCPUDefCopyWithoutModel(guest))) return -1; updated->mode = VIR_CPU_MODE_CUSTOM; if (virCPUDefCopyModel(updated, host, true) < 0) return -1; for (i = 0; i < guest->nfeatures; i++) { if (virCPUDefUpdateFeature(updated, guest->features[i].name, guest->features[i].policy) < 0) return -1; } virCPUDefStealModel(guest, updated, false); guest->mode = VIR_CPU_MODE_CUSTOM; guest->match = VIR_CPU_MATCH_EXACT; return 0; } static int virCPUs390ValidateFeatures(virCPUDefPtr cpu) { size_t i; for (i = 0; i < cpu->nfeatures; i++) { if (cpu->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("only cpu feature policies 'require' and " "'disable' are supported for %s"), cpu->features[i].name); return -1; } } return 0; } struct cpuArchDriver cpuDriverS390 = { .name = "s390", .arch = archs, .narch = G_N_ELEMENTS(archs), .compare = virCPUs390Compare, .decode = NULL, .encode = NULL, .baseline = NULL, .update = virCPUs390Update, .validateFeatures = virCPUs390ValidateFeatures, };
/* * PKCS #11 PAM Login Module * Copyright (C) 2003 Mario Strasser <mast@gmx.net>, * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (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. * * $Id$ */ #ifndef __PKCS11_LIB_H__ #define __PKCS11_LIB_H__ #include "cert_st.h" typedef struct cert_object_str cert_object_t; typedef struct pkcs11_handle_str pkcs11_handle_t; #ifndef __PKCS11_LIB_C__ #define PKCS11_EXTERN extern #else #define PKCS11_EXTERN #endif PKCS11_EXTERN int crypto_init(cert_policy *policy); PKCS11_EXTERN int load_pkcs11_module(const char *module, pkcs11_handle_t **h); PKCS11_EXTERN int init_pkcs11_module(pkcs11_handle_t *h,int flag); PKCS11_EXTERN int find_slot_by_number(pkcs11_handle_t *h,unsigned int slot_num, unsigned int *slot); PKCS11_EXTERN int find_slot_by_number_and_label(pkcs11_handle_t *h, int slot_num, const char *slot_label, unsigned int *slot); PKCS11_EXTERN const char *get_slot_tokenlabel(pkcs11_handle_t *h); PKCS11_EXTERN int wait_for_token(pkcs11_handle_t *h, int wanted_slot_num, const char *wanted_token_label, unsigned int *slot); PKCS11_EXTERN int find_slot_by_slotlabel(pkcs11_handle_t *h, const char *wanted_slot_label, unsigned int *slot); PKCS11_EXTERN int find_slot_by_slotlabel_and_tokenlabel(pkcs11_handle_t *h, const char *wanted_slot_label, const char *wanted_token_label, unsigned int *slot); PKCS11_EXTERN int wait_for_token_by_slotlabel(pkcs11_handle_t *h, const char *wanted_slot_label, const char *wanted_token_label, unsigned int *slot); PKCS11_EXTERN const X509 *get_X509_certificate(cert_object_t *cert); PKCS11_EXTERN void release_pkcs11_module(pkcs11_handle_t *h); PKCS11_EXTERN int open_pkcs11_session(pkcs11_handle_t *h, unsigned int slot); PKCS11_EXTERN int close_pkcs11_session(pkcs11_handle_t *h); PKCS11_EXTERN int pkcs11_login(pkcs11_handle_t *h, char *password); PKCS11_EXTERN int pkcs11_pass_login(pkcs11_handle_t *h, int nullok); PKCS11_EXTERN int get_slot_login_required(pkcs11_handle_t *h); PKCS11_EXTERN int get_slot_protected_authentication_path(pkcs11_handle_t *h); PKCS11_EXTERN cert_object_t **get_certificate_list(pkcs11_handle_t *h, int *ncert); PKCS11_EXTERN int get_private_key(pkcs11_handle_t *h, cert_object_t *); PKCS11_EXTERN int sign_value(pkcs11_handle_t *h, cert_object_t *, unsigned char *data, unsigned long length, unsigned char **signature, unsigned long *signature_length); PKCS11_EXTERN int get_random_value(unsigned char *data, int length); #undef PKCS11_EXTERN /* end of pkcs11_lib.h */ #endif
/*****************************************************************************\ * ANALYSIS PERFORMANCE TOOLS * * Extrae * * Instrumentation package for parallel applications * ***************************************************************************** * ___ This library is free software; you can redistribute it and/or * * / __ modify it under the terms of the GNU LGPL as published * * / / _____ by the Free Software Foundation; either version 2.1 * * / / / \ of the License, or (at your option) any later version. * * ( ( ( B S C ) * * \ \ \_____/ This library is distributed in 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 LGPL 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 * * The GNU LEsser General Public License is contained in the file COPYING. * * --------- * * Barcelona Supercomputing Center - Centro Nacional de Supercomputacion * \*****************************************************************************/ #ifndef _OMP_SNIPPETS_H_INCLUDED_ #define _OMP_SNIPPETS_H_INCLUDED_ #include <BPatch.h> #include "applicationType.h" void InstrumentOMPruntime (bool locks, ApplicationType *at, BPatch_image *appImage); void InstrumentOMPruntime_Intel (BPatch_image *appImage, BPatch_process *appProcess); #endif
/* -*- OpenSAF -*- * * (C) Copyright 2008 The OpenSAF 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. This file and program are licensed * under the GNU Lesser General Public License Version 2.1, February 1999. * The complete license can be accessed from the following location: * http://opensource.org/licenses/lgpl-license.php * See the Copying file included with the OpenSAF distribution for full * licensing terms. * * Author(s): Emerson Network Power * */ /***************************************************************************** .............................................................................. .............................................................................. DESCRIPTION: ****************************************************************************** */ #ifndef MDA_PVT_API_H #define MDA_PVT_API_H #include "ncs_ubaid.h" #include "ncs_util.h" #include "ncs_lib.h" #define VDA_SVC_PVT_VER 1 #define VDA_WRT_VDS_SUBPART_VER_MIN 1 #define VDA_WRT_VDS_SUBPART_VER_MAX 1 #define VDA_WRT_VDS_SUBPART_VER_RANGE \ (VDA_WRT_VDS_SUBPART_VER_MAX - \ VDA_WRT_VDS_SUBPART_VER_MIN +1) #define m_NCS_VDA_ENC_MSG_FMT_GET m_NCS_ENC_MSG_FMT_GET #define m_NCS_VDA_MSG_FORMAT_IS_VALID m_NCS_MSG_FORMAT_IS_VALID /***********************************************************************\ VDA-PRIVATE APIs used by VDS. \***********************************************************************/ EXTERN_C uns32 vda_chg_role_vdest(MDS_DEST *i_vdest, V_DEST_RL i_new_role); EXTERN_C uns32 vda_create_vdest_locally(uns32 i_policy, MDS_DEST *i_vdest, MDS_HDL *o_mds_vdest_hdl); EXTERN_C uns32 vda_util_enc_8bit(NCS_UBAID *uba, uns8 data); EXTERN_C uns8 vda_util_dec_8bit(NCS_UBAID *uba); #define vda_util_enc_n_octets(uba, size, buff) ncs_encode_n_octets_in_uba(uba, buff, size) #define vda_util_dec_n_octets(uba, size, buff) ncs_decode_n_octets_from_uba(uba, buff, size) EXTERN_C uns32 vda_util_enc_vdest_name(NCS_UBAID *uba, SaNameT *name); EXTERN_C uns32 vda_util_dec_vdest_name(NCS_UBAID *uba, SaNameT *name); EXTERN_C uns32 vda_util_enc_vdest(NCS_UBAID *uba, MDS_DEST *dest); EXTERN_C uns32 vda_util_dec_vdest(NCS_UBAID *uba, MDS_DEST *dest); /***********************************************************************\ ada_lib_req : This API initializes ADA (Absolute Destination Agent code) \***********************************************************************/ /* Service provider abstract name */ #define m_ADA_SP_ABST_NAME "NCS_ADA" EXTERN_C uns32 ada_lib_req(NCS_LIB_REQ_INFO *req); /***********************************************************************\ vda_lib_req : This API initializes VDA (Virtual Destination Agent code) \***********************************************************************/ /* Service provider abstract name */ #define m_VDA_SP_ABST_NAME "NCS_VDA" EXTERN_C uns32 vda_lib_req(NCS_LIB_REQ_INFO *req); typedef enum { MDA_INST_NAME_TYPE_NULL, MDA_INST_NAME_TYPE_ADEST, MDA_INST_NAME_TYPE_UNNAMED_VDEST, MDA_INST_NAME_TYPE_NAMED_VDEST, } MDA_INST_NAME_TYPE; MDA_INST_NAME_TYPE mda_get_inst_name_type(SaNameT *name); #ifndef MDA_TRACE_LEVEL #define MDA_TRACE_LEVEL 0 #endif #if (MDA_TRACE_LEVEL == 1) #define MDA_TRACE1_ARG1(x) printf(x) #define MDA_TRACE1_ARG2(x,y) printf(x,y) #else #define MDA_TRACE1_ARG1(x) #define MDA_TRACE1_ARG2(x,y) #endif #endif
/* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef ImageLoaderClient_h #define ImageLoaderClient_h namespace WebCore { class Element; class ImageLoaderClient { public: virtual ~ImageLoaderClient() { } virtual Element* sourceElement() = 0; virtual Element* imageElement() = 0; virtual void refSourceElement() = 0; virtual void derefSourceElement() = 0; }; template<typename T> class ImageLoaderClientBase : public ImageLoaderClient { public: Element* sourceElement() { return static_cast<T*>(this); } Element* imageElement() { return static_cast<T*>(this); } void refSourceElement() { static_cast<T*>(this)->ref(); } void derefSourceElement() { static_cast<T*>(this)->deref(); } }; } #endif
/*************************************************************************** * Copyright (C) 2013 by Jeroen Broekhuizen * * jengine.sse@live.nl * * * * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 2.1 of the * * License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Library 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 SPRITE_FACTORY_H #define SPRITE_FACTORY_H #include "core/core_base.h" #include <memory> namespace Graphics { class Device; } namespace c2d { class Sprite; class SpriteDefinition; class CORE_API SpriteFactory { public: static Sprite create(Graphics::Device& device, SpriteDefinition& definition); }; } #endif // SPRITE_FACTORY_H
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_PUTBUCKETENCRYPTIONREQUEST_P_H #define QTAWS_PUTBUCKETENCRYPTIONREQUEST_P_H #include "s3request_p.h" #include "putbucketencryptionrequest.h" namespace QtAws { namespace S3 { class PutBucketEncryptionRequest; class PutBucketEncryptionRequestPrivate : public S3RequestPrivate { public: PutBucketEncryptionRequestPrivate(const S3Request::Action action, PutBucketEncryptionRequest * const q); PutBucketEncryptionRequestPrivate(const PutBucketEncryptionRequestPrivate &other, PutBucketEncryptionRequest * const q); private: Q_DECLARE_PUBLIC(PutBucketEncryptionRequest) }; } // namespace S3 } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEJOBSRESPONSE_H #define QTAWS_DESCRIBEJOBSRESPONSE_H #include "mgnresponse.h" #include "describejobsrequest.h" namespace QtAws { namespace mgn { class DescribeJobsResponsePrivate; class QTAWSMGN_EXPORT DescribeJobsResponse : public mgnResponse { Q_OBJECT public: DescribeJobsResponse(const DescribeJobsRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const DescribeJobsRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DescribeJobsResponse) Q_DISABLE_COPY(DescribeJobsResponse) }; } // namespace mgn } // namespace QtAws #endif
// Created file "Lib\src\Uuid\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_CONTENT_TYPE_DOCUMENT, 0x680adf52, 0x950a, 0x4041, 0x9b, 0x41, 0x65, 0xe3, 0x93, 0x64, 0x81, 0x55);
// Created file "Lib\src\strmiids\X64\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CLSID_DirectDrawClipper, 0x593817a0, 0x7db3, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56);
/*+@@file@@----------------------------------------------------------------*//*! \file storprop.h \par Description Extension and update of headers for PellesC compiler suite. \par Project: PellesC Headers extension \date Created on Sat Sep 17 01:29:35 2016 \date Modified on Sat Sep 17 01:29:35 2016 \author frankie \*//*-@@file@@----------------------------------------------------------------*/ #ifndef __STORPROP_H__ #define __STORPROP_H__ #if __POCC__ >= 500 #pragma once #endif #include <setupapi.h> #define REDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO_VERSION 1 typedef struct _REDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO { ULONG Version; ULONG Accurate; ULONG Supported; ULONG AccurateMask0; } REDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO, *PREDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO; DWORD CdromCddaInfo(HDEVINFO HDevInfo, PSP_DEVINFO_DATA DevInfoData, PREDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO CddaInfo, PULONG BufferSize); BOOL CdromKnownGoodDigitalPlayback(HDEVINFO HDevInfo, PSP_DEVINFO_DATA DevInfoData); LONG CdromEnableDigitalPlayback(HDEVINFO DevInfo, PSP_DEVINFO_DATA DevInfoData, BOOLEAN ForceUnknown); LONG CdromDisableDigitalPlayback(HDEVINFO DevInfo, PSP_DEVINFO_DATA DevInfoData); LONG CdromIsDigitalPlaybackEnabled(HDEVINFO DevInfo, PSP_DEVINFO_DATA DevInfoData, PBOOLEAN Enabled); #endif
// Created file "Lib\src\MMC\X64\ndmgrpriv" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IScopeTree, 0xd8dbf067, 0x5fb2, 0x11d0, 0xa9, 0x86, 0x00, 0xc0, 0x4f, 0xd8, 0xd5, 0x65);
// UGThemes.h: interface for the UGThemes class. // ////////////////////////////////////////////////////////////////////// /*! ************************************************************************************** \file UGThemes.h ************************************************************************************** \author ³Â¹úÐÛ \brief רÌâͼ¼¯ºÏÀà¡£ \attention ----------------------------------------------------------------------------------<br> Copyright (c) 2000-2010 SuperMap Software Co., Ltd. <br> All Rights Reserved. <br> ----------------------------------------------------------------------------------<br> ************************************************************************************** \version 2005-05-20 ³Â¹úÐÛ ³õʼ»¯°æ±¾. <br> ************************************************************************************** */ #if !defined(AFX_UGTHEMES_H__869EEDDC_C92D_4D07_9903_4345F3138D0A__INCLUDED_) #define AFX_UGTHEMES_H__869EEDDC_C92D_4D07_9903_4345F3138D0A__INCLUDED_ #include "Map/UGTheme.h" namespace UGC { class MAP_API UGThemes { public: UGThemes(); #ifdef SYMBIAN60 ~UGThemes(); #else virtual ~UGThemes(); #endif UGThemes(const UGThemes& Themes); UGThemes& operator =(const UGThemes& Themes); public: static UGTheme* CreateTheme(UGTheme::UGThemeType nThemeType); static UGTheme* CloneTheme(UGTheme* pTheme); UGTheme* GetVisibleStyleTheme(UGdouble dScale)const; UGTheme* GetVisibleDotDensityTheme(UGdouble dScale)const; UGTheme* GetVisibleSymbolTheme(UGdouble dScale)const; UGTheme* GetVisibleLabelTheme(UGdouble dScale)const; UGTheme* GetVisibleGridTheme(UGdouble dScale)const; UGbool MoveTo(UGint nIndexFrom, UGint nIndexTo); UGbool MoveBottom(UGint nIndex); UGbool MoveDown(UGint nIndex); UGbool MoveUp(UGint nIndex); UGbool MoveTop(UGint nIndex); UGint Append(const UGThemes& Themes); UGint Add(UGTheme* pTheme); void InsertAt(UGint nIndex, UGTheme* pTheme); void SetAt(UGint nIndex, UGTheme* pTheme); UGTheme* GetAt(UGint nIndex)const; void RemoveAll(); UGint RemoveAt(UGint nIndex, UGint nCount = 1); UGint GetCount()const; UGbool IsEmpty()const; UGbool IsModified()const; void SetModifiedFlag(UGbool bModified = true); UGint Find(UGTheme* pTheme) const; UGString ToXML(UGint nVersion = 0)const; UGbool FromXML(const UGString& strXML, UGint nVersion = 0); protected: UGbool m_bModified; UGArray<UGTheme*> m_Themes; }; } #endif // !defined(AFX_UGTHEMES_H__869EEDDC_C92D_4D07_9903_4345F3138D0A__INCLUDED_)
#include <stdlib.h> #include <glib.h> #include "gegl.h" #include "opencl/gegl-cl-init.h" #define ITERATIONS 600 #define PERCENTILE 0.75 /* if we want to bias to the better results with more noise, increase this number towards 1.0, like 0.8 */ #define BAIL_THRESHOLD 0.001 #define BAIL_COUNT 20 #define MIN_ITER 20 static long ticks_start; typedef void (*t_run_perf)(GeglBuffer *buffer); long babl_ticks (void); /* using babl_ticks instead of gegl_ticks to be able to go further back in time */ void test_start (void); void test_end (const gchar *id, double bytes); void test_end_suffix (const gchar *id, const gchar *suffix, gdouble bytes); GeglBuffer *test_buffer (gint width, gint height, const Babl *format); void do_bench(const gchar *id, GeglBuffer *buffer, t_run_perf test_func, gboolean opencl); void bench(const gchar *id, GeglBuffer *buffer, t_run_perf test_func ); int converged = 0; long ticks_iter_start = 0; long iter_db[ITERATIONS]; int iter_no = 0; float prev_median = 0.0; void test_start (void) { ticks_start = babl_ticks (); iter_no = 0; converged = 0; prev_median = 0.0; } static void test_start_iter (void) { ticks_iter_start = babl_ticks (); } static int compare_long (const void * a, const void * b) { return ( *(long*)a - *(long*)b ); } static float compute_median (void) { qsort(iter_db,iter_no,sizeof(long),compare_long); return iter_db[(int)(iter_no * (1.0-PERCENTILE))]; } #include <math.h> #include <stdio.h> static void test_end_iter (void) { long ticks = babl_ticks ()-ticks_iter_start; float median; iter_db[iter_no] = ticks; iter_no++; median = compute_median (); if (iter_no > MIN_ITER && fabs ((median - prev_median) / median) < BAIL_THRESHOLD) { /* we've converged */ converged++; } else { converged = 0; } prev_median = median; } void test_end_suffix (const gchar *id, const gchar *suffix, gdouble bytes) { // long ticks = babl_ticks ()-ticks_start; g_print ("@ %s%s: %.2f megabytes/second\n", id, suffix, (bytes / 1024.0 / ITERATIONS/ 1024.0) / (compute_median()/1000000.0)); // (bytes / 1024.0 / 1024.0) / (ticks / 1000000.0)); } void test_end (const gchar *id, gdouble bytes) { test_end_suffix (id, "", bytes); } /* create a test buffer of random data in -0.5 to 2.0 range */ GeglBuffer *test_buffer (gint width, gint height, const Babl *format) { GeglRectangle bound = {0, 0, width, height}; GeglBuffer *buffer; gfloat *buf = g_malloc0 (width * height * 16); gint i; buffer = gegl_buffer_new (&bound, format); for (i=0; i < width * height * 4; i++) buf[i] = g_random_double_range (-0.5, 2.0); gegl_buffer_set (buffer, NULL, 0, babl_format ("RGBA float"), buf, 0); g_free (buf); return buffer; } void do_bench (const gchar *id, GeglBuffer *buffer, t_run_perf test_func, gboolean opencl) { gchar* suffix = ""; g_object_set(G_OBJECT(gegl_config()), "use-opencl", opencl, NULL); if (opencl) { if ( ! gegl_cl_is_accelerated()) { g_print("OpenCL is disabled. Skipping OpenCL test\n"); return; } suffix = " (OpenCL)"; } // warm up test_func(buffer); test_start (); for (int i=0; i<ITERATIONS && converged<4; ++i) { test_start_iter(); test_func(buffer); test_end_iter(); } test_end_suffix (id, suffix, ((double)gegl_buffer_get_pixel_count (buffer)) * 16 * ITERATIONS); } void bench (const gchar *id, GeglBuffer *buffer, t_run_perf test_func) { do_bench(id, buffer, test_func, FALSE ); do_bench(id, buffer, test_func, TRUE ); }
#include "testutils.h" static void ref_mod (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn) { mpz_t r, a, m; mpz_init (r); mpz_mod (r, mpz_roinit_n (a, ap, 2*mn), mpz_roinit_n (m, mp, mn)); mpz_limbs_copy (rp, r, mn); mpz_clear (r); } #define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS) #define MAX_SIZE (2*MAX_ECC_SIZE) #define COUNT 50000 /* Destructively normalize tp, then compare */ static int mod_equal(const struct ecc_modulo *m, const mp_limb_t *ref, mp_limb_t *tp) { if (mpn_cmp (tp, m->m, m->size) >= 0) mpn_sub_n (tp, tp, m->m, m->size); return mpn_cmp (ref, tp, m->size) == 0; } static void test_one(const char *name, const struct ecc_modulo *m, const mpz_t r) { mp_limb_t a[MAX_SIZE]; mp_limb_t t[MAX_SIZE]; mp_limb_t ref[MAX_SIZE]; mpz_limbs_copy (a, r, 2*m->size); ref_mod (ref, a, m->m, m->size); mpn_copyi (t, a, 2*m->size); m->mod (m, t, t); if (!mod_equal (m, ref, t)) { fprintf (stderr, "m->mod %s failed: bit_size = %u, rp == xp\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } mpn_copyi (t, a, 2*m->size); m->mod (m, t + m->size, t); if (!mod_equal (m, ref, t + m->size)) { fprintf (stderr, "m->mod %s failed: bit_size = %u, rp == xp + size\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t + m->size, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } if (m->B_size < m->size) { mpn_copyi (t, a, 2*m->size); ecc_mod (m, t, t); if (!mod_equal (m, ref, t)) { fprintf (stderr, "ecc_mod %s failed: bit_size = %u, rp == xp\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } mpn_copyi (t, a, 2*m->size); ecc_mod (m, t + m->size, t); if (!mod_equal (m, ref, t + m->size)) { fprintf (stderr, "ecc_mod %s failed: bit_size = %u, rp == xp + size\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t + m->size, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } } } static void test_modulo (gmp_randstate_t rands, const char *name, const struct ecc_modulo *m, unsigned count) { mpz_t r; unsigned j; mpz_init (r); for (j = 0; j < count; j++) { if (j & 2) { if (j & 1) mpz_rrandomb (r, rands, 2*m->size * GMP_NUMB_BITS); else mpz_urandomb (r, rands, 2*m->size * GMP_NUMB_BITS); } else { /* Test inputs close to a multiple of m. */ mpz_t q; unsigned q_size; int diff; mpz_urandomb(r, rands, 30); q_size = 11 + mpz_get_ui(r) % (m->size * GMP_NUMB_BITS - 10); mpz_urandomb(r, rands, 30); diff = mpz_get_si(r) % 20 - 10; if (j & 1) mpz_rrandomb (r, rands, q_size); else mpz_urandomb (r, rands, q_size); mpz_mul (r, r, mpz_roinit_n(q, m->m, m->size)); if (diff >= 0) mpz_add_ui (r, r, diff); else mpz_sub_ui (r, r, -diff); if (mpz_sgn(r) < 0) continue; } test_one (name, m, r); } mpz_clear (r); } static void test_fixed (void) { mpz_t r; mpz_init (r); /* Triggered a bug reported by Hanno Böck. */ mpz_set_str (r, "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFF001C2C00", 16); mpz_mul_2exp (r, r, 256); test_one ("p", &_nettle_secp_256r1.p, r); test_one ("q", &_nettle_secp_256r1.q, r); mpz_set_str (r, "ffffffff00000001fffffffeffffffffffffffffffffffffffffffc0000000000007ffffffffffffffffffffffffffff00000000000000000fffffffffffffff", 16); test_one ("p", &_nettle_secp_256r1.p, r); test_one ("q", &_nettle_secp_256r1.q, r); /* Triggered a bug reported by Hanno Böck. */ mpz_set_str (r, "4c9000000000000000000000000000000000000000000000004a604db486e000000000000000000000000000000000000000121025be29575adb2c8ffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16); test_one ("p", &_nettle_secp_384r1.p, r); test_one ("q", &_nettle_secp_384r1.q, r); /* Triggered a carry bug in development version. */ mpz_set_str (r, "e64a84643150260640e4677c19ffc4faef06042132b86af6e9ee33fe1850222e57a514d5f1d6d444008bb896a96a43d5629945e57548f5e12f66be132b24110cbb2df6d7d3dd3aaadc98b0bbf29573843ad72e57f59fc5d4f56cc599da18bb99", 16); test_one ("p", &_nettle_secp_384r1.p, r); test_one ("q", &_nettle_secp_384r1.q, r); mpz_clear (r); } static void test_patterns (const char *name, const struct ecc_modulo *m) { mpz_t r; unsigned j; mpz_init (r); for (j = m->bit_size; j < 2*m->bit_size; j++) { /* Single one bit */ mpz_set_ui (r, 1); mpz_mul_2exp (r, r, j); test_one (name, m, r); /* All ones. */ mpz_mul_2exp (r, r, 1); mpz_sub_ui (r, r, 1); test_one (name, m, r); } mpz_clear (r); } void test_main (void) { gmp_randstate_t rands; unsigned count = COUNT; unsigned i; gmp_randinit_default (rands); test_fixed (); for (i = 0; ecc_curves[i]; i++) { test_patterns ("p", &ecc_curves[i]->p); test_patterns ("q", &ecc_curves[i]->p); } if (test_randomize(rands)) count *= 20; for (i = 0; ecc_curves[i]; i++) { test_modulo (rands, "p", &ecc_curves[i]->p, count); test_modulo (rands, "q", &ecc_curves[i]->q, count); } gmp_randclear (rands); }
#ifndef OBSERVER_H #define OBSERVER_H /* * Copyright (c) 2016 CERN * @author Michele Castellana <michele.castellana@cern.ch> * * This 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. * * This 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 this program. If not, see <http://www.gnu.org/licenses/>. */ #include "vpi_user.h" class vvp_net_t; class Observer { public: virtual void update( vvp_net_t* ) = 0; protected: Observer() {}; }; #endif /* OBSERVER_H */
#pragma once struct IRenderMesh; struct IRenderer { virtual ~IRenderer() {} virtual void PrepareFrame() = 0; virtual void DrawOneFrame() = 0; virtual void EndOneFrame() = 0; virtual void DrawMesh(IRenderMesh *) = 0; virtual void OnResize(int width, int height) = 0; };
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTOFFERINGSREQUEST_P_H #define QTAWS_LISTOFFERINGSREQUEST_P_H #include "medialiverequest_p.h" #include "listofferingsrequest.h" namespace QtAws { namespace MediaLive { class ListOfferingsRequest; class ListOfferingsRequestPrivate : public MediaLiveRequestPrivate { public: ListOfferingsRequestPrivate(const MediaLiveRequest::Action action, ListOfferingsRequest * const q); ListOfferingsRequestPrivate(const ListOfferingsRequestPrivate &other, ListOfferingsRequest * const q); private: Q_DECLARE_PUBLIC(ListOfferingsRequest) }; } // namespace MediaLive } // namespace QtAws #endif
#include <stdio.h> #include <stdlib.h> #include <assert.h> extern int base64encode(const void* data_buf, size_t dataLength, char* result, size_t resultSize); extern int base64decode(char *in, size_t inLen, unsigned char *out, size_t *outLen); int main(int argc, char *argv[]) { return 0; }
/* This file is part of Poti Poti is free software: you can redistribute it and/or modify it under the terms of the GNU Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Poti 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 Public License for more details. You should have received a copy of the GNU Public License along with Poti. If not, see <http://www.gnu.org/licenses/>. */ #include <poti.h> struct test { bool poti_basic_events; bool poti_legacy_header; bool poti_with_comments; bool poti_with_alias; bool poti_relative_timestamps; }; /* * This program tests all combinations by which poti can be initialize. */ int main (int argc, char **argv) { int tn; if (argc != 2){ return 1; }else{ tn = atoi(argv[1]); } struct test *tests = malloc(sizeof(struct test)); int ntests = 1; int a, b, c, d; for (a = 0; a < 2; a++){ for (b = 0; b < 2; b++){ for (c = 0; c < 2; c++){ for (d = 0; d < 2; d++){ tests[ntests-1].poti_basic_events = a; tests[ntests-1].poti_legacy_header = b; tests[ntests-1].poti_with_comments = false; tests[ntests-1].poti_with_alias = c; tests[ntests-1].poti_relative_timestamps = d; ntests++; tests = realloc(tests, ntests * sizeof(struct test)); } } } } if (tn < ntests){ printf ("# Running test %d out of %d tests.\n", tn, ntests); poti_init_custom (NULL, tests[tn].poti_basic_events, tests[tn].poti_legacy_header, tests[tn].poti_with_comments, tests[tn].poti_with_alias, tests[tn].poti_relative_timestamps); }else{ //Unsupported test printf ("# Unsupported test %d.\n", tn); return 2; } printf("# This trace has been created with the following init configuration:\n"); printf("# With basic events: %s\n", tests[tn].poti_basic_events ? "true" : "false"); printf("# With legacy header: %s\n", tests[tn].poti_legacy_header ? "true" : "false"); printf("# With comments: %s\n", tests[tn].poti_with_comments ? "true" : "false"); printf("# With aliases: %s\n", tests[tn].poti_with_alias ? "true" : "false"); printf("# With relative timestamps: %s\n", tests[tn].poti_relative_timestamps ? "true" : "false"); poti_header(); poti_DContainerType ("0", "PROCESS"); poti_DStateType ("PROCESS", "VAR"); poti_ECreateContainer (123, "PROCESS", "0", "p1"); poti_ESetState (123.1, "p1", "VAR", "Inicio"); poti_EPushState (123.2, "p1", "VAR", "Meio"); poti_EPopState (123.3, "p1", "VAR"); poti_close(); free(tests); return 0; }
#pragma once #include <QtWidgets/QDialog> #include <QtGui/QFont> #include <QtCore/QString> #include <QtCore/QStringList> namespace Ui { class EditHeadlineDialog; } class EditHeadlineDialog : public QDialog { Q_OBJECT public: explicit EditHeadlineDialog(QWidget *parent = nullptr); ~EditHeadlineDialog(); void set_style_name(const QString& name); void set_style_font(const QFont& font); void set_style_stylesheet(const QString& stylesheet); void set_style_triggers(const QStringList& triggers); QString get_style_name() const; QString get_style_stylesheet() const; QStringList get_style_triggers() const; private slots: // void slot_update_font(const QFont& font); // void slot_update_font_size(int index); void slot_apply_stylesheet(); void slot_update_ok(); private: Ui::EditHeadlineDialog *ui{nullptr}; };
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATEWEBACLREQUEST_P_H #define QTAWS_CREATEWEBACLREQUEST_P_H #include "wafrequest_p.h" #include "createwebaclrequest.h" namespace QtAws { namespace WAF { class CreateWebACLRequest; class CreateWebACLRequestPrivate : public WafRequestPrivate { public: CreateWebACLRequestPrivate(const WafRequest::Action action, CreateWebACLRequest * const q); CreateWebACLRequestPrivate(const CreateWebACLRequestPrivate &other, CreateWebACLRequest * const q); private: Q_DECLARE_PUBLIC(CreateWebACLRequest) }; } // namespace WAF } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATESECURITYCONFIGURATIONREQUEST_P_H #define QTAWS_CREATESECURITYCONFIGURATIONREQUEST_P_H #include "emrrequest_p.h" #include "createsecurityconfigurationrequest.h" namespace QtAws { namespace EMR { class CreateSecurityConfigurationRequest; class CreateSecurityConfigurationRequestPrivate : public EmrRequestPrivate { public: CreateSecurityConfigurationRequestPrivate(const EmrRequest::Action action, CreateSecurityConfigurationRequest * const q); CreateSecurityConfigurationRequestPrivate(const CreateSecurityConfigurationRequestPrivate &other, CreateSecurityConfigurationRequest * const q); private: Q_DECLARE_PUBLIC(CreateSecurityConfigurationRequest) }; } // namespace EMR } // namespace QtAws #endif
// Created file "Lib\src\mfuuid\mfinternal_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IMFByteStreamReservation, 0x1a37165b, 0x2079, 0x402c, 0x9e, 0x2c, 0xeb, 0xcd, 0xed, 0xe8, 0xc1, 0x2f);
#ifndef UITEXTCURSOR_H #define UITEXTCURSOR_H #include "Bang/BangDefines.h" #include "Bang/ComponentMacros.h" #include "Bang/LineRenderer.h" #include "Bang/String.h" #include "Bang/Time.h" namespace Bang { class UITextCursor : public LineRenderer { COMPONENT(UITextCursor) public: UITextCursor(); virtual ~UITextCursor() override; virtual void OnUpdate() override; void ResetTickTime(); void SetStroke(float cursorWidth); void SetTickTime(Time cursorTickTime); float GetStroke() const; Time GetTickTime() const; private: Time m_cursorTime; Time m_cursorTickTime; }; } #endif // UITEXTCURSOR_H
/* * File: DistanceToBall2.h * Author: chung * * Created on January 14, 2016, 2:02 AM */ #ifndef DISTANCETOBALL2_H #define DISTANCETOBALL2_H #include "Function.h" #include <cmath> /** * \class DistanceToBall2 * \brief Distance from the unit ball of R^n * \version version 0.1 * \ingroup Functions * \date Created on January 14, 2016, 2:02 AM * \author Pantelis Sopasakis * * This class extends Function and implements the squared distance to the closed ball * of norm-2 in \f$\mathbb{R}^n\f$ of radius \f$\rho\f$, centered at \f$c\in\mathbb{R}^n\f$ * which is defined by * * \f[ * B_2(\rho, c) = \{x\in\mathbb{R}^n: \|x-c\|_2 \leq \rho\}, * \f] * * that is, this is the function * * \f[ * f(x) = \frac{w}{2}d(x, B_2(\rho, c))^2 = \frac{w}{2}\|x-\mathrm{proj}(x, B_2(\rho, c))\|^2, * \f] * * where \f$w>0\f$ is a positive scalar and * \f[ * \mathrm{proj}(x, B_2) = \mathrm{argmin}\limits_{\|y-c\|\leq \rho}\|y-x\| * \f] * is the projection of \f$x\f$ on \f$B_2(\rho, c)\f$. This is computed as * * \f[ * \mathrm{proj}(x, B_2) = \begin{cases} * x, &\text{ if } \|x-c\|\leq \rho\\ * c+\frac{\rho}{\|x-c\|}(x-c), &\text{ otherwise} * \end{cases} * \f] * * Essentially, the squared distance to ball-2 is given by * * \f[ * f(x) = \begin{cases} * 0, &\text{ if } \|x-c\|\leq \rho,\\ * \frac{w}{2}(\|x-c\|-\rho)^2,&\text{ otherwise} * \end{cases} * \f] * * * The gradient of \f$f\f$ is given by * * \f[ * \begin{align} * \nabla f (x) &= \frac{w}{2}(x-\mathrm{proj}(x, B_2(\rho, c)))\\ * &= \begin{cases} * 0, & \text{if } \|x-c\|\leq \rho,\\ * \left(1-\frac{\rho}{\|x-c\|}\right)(x-c), &\text{otherwise} * \end{cases} * \end{align} * \f] * */ class DistanceToBall2 : public Function { public: using Function::call; /** * Constructs the indicator of the closed norm-2 unit ball centered at the * origin, i.e., the function * * \f[ * f(x) = \frac{1}{2}d(x, B_2), * \f] * * where * * \f[ * B_2 = \{x\in\mathbb{R}^n: \|x\|_2\leq 1\}. * \f] */ DistanceToBall2(); /** * Constructs the indicator of the closed norm-2 unit ball centered at the * origin scaled by a given scalar. The function has the form * * \f[ * f(x) = \frac{w}{2}d(x, B_2), * \f] * * where * * \f[ * B_2 = \{x\in\mathbb{R}^n: \|x\|_2\leq 1\}. * \f] * * @param w scaling parameter */ explicit DistanceToBall2(double w); /** * Constructs the indicator of the closed norm-2 ball centered at the * origin with radius \f$\rho\f$ scaled by a given scalar. The function has the form * * \f[ * f(x) = \frac{w}{2}d(x, B_2(\rho)), * \f] * * where * * \f[ * B_2(\rho) = \{x\in\mathbb{R}^n: \|x\|_2\leq \rho\}. * \f] * * @param w scaling factor * @param rho radius of the ball */ DistanceToBall2(double w, double rho); /** * Constructs the indicator of the closed norm-2 ball centered at the * a point \f$c\in\mathbb{R}^n\f$ with radius \f$\rho\f$ scaled by a * given scalar. The function has the form * * \f[ * f(x) = \frac{w}{2}d(x, B_2(\rho, c)), * \f] * * where * * \f[ * B_2(\rho,c) = \{x\in\mathbb{R}^n: \|x-c\|_2\leq \rho\}. * \f] * * * @param w scaling factor * @param rho radius of the ball * @param center center of the ball */ DistanceToBall2(double w, double rho, Matrix &center); /** * Default destructor. */ virtual ~DistanceToBall2(); virtual int call(Matrix& x, double& f, Matrix& grad); virtual int call(Matrix& x, double& f); virtual FunctionOntologicalClass category(); private: /** * ball radius */ double m_rho; /** * scaling factor (the function is scaled by w/2) */ double m_w; /** * center of the ball (vector). * Default is the origin (in which case this pointer is \c NULL). */ Matrix * m_center; }; #endif /* DISTANCETOBALL2_H */
#include <esdm-internal.h> #include "dummy/dummy.h" #ifdef ESDM_HAS_S3 # include "s3/s3.h" # pragma message("Building ESDM with support for S3 backend.") #endif #ifdef ESDM_HAS_POSIX # include "posix/posix.h" # pragma message("Building ESDM with support for generic POSIX backend.") #endif #ifdef ESDM_HAS_IME # include "ime/ime.h" # pragma message("Building ESDM with IME support.") #endif #ifdef ESDM_HAS_KDSA # include "kdsa/esdm-kdsa.h" # pragma message("Building ESDM with Kove XPD KDSA support.") #endif #ifdef ESDM_HAS_MOTR # include "Motr/client.h" # pragma message("Building ESDM with Motr support.") #endif #ifdef ESDM_HAS_WOS # include "WOS/wos.h" # pragma message("Building ESDM with WOS support.") #endif #ifdef ESDM_HAS_PMEM # include "pmem/esdm-pmem.h" # pragma message("Building ESDM with PMEM support.") #endif esdm_backend_t * esdmI_init_backend(char const * name, esdm_config_backend_t * b){ if (strncmp(b->type, "DUMMY", 5) == 0) { return dummy_backend_init(b); } #ifdef ESDM_HAS_POSIX else if (strncmp(b->type, "POSIX", 5) == 0) { return posix_backend_init(b); } #endif #ifdef ESDM_HAS_IME else if (strncasecmp(b->type, "IME", 3) == 0) { return ime_backend_init(b); } #endif #ifdef ESDM_HAS_KDSA else if (strncasecmp(b->type, "KDSA", 4) == 0) { return kdsa_backend_init(b); } #endif #ifdef ESDM_HAS_MOTR else if (strncasecmp(b->type, "MOTR", 6) == 0) { return motr_backend_init(b); } #endif #ifdef ESDM_HAS_WOS else if (strncmp(b->type, "WOS", 3) == 0) { return wos_backend_init(b); } #endif #ifdef ESDM_HAS_PMEM else if (strncmp(b->type, "PMEM", 4) == 0) { return pmem_backend_init(b); } #endif #ifdef ESDM_HAS_S3 else if (strncmp(b->type, "S3", 2) == 0){ return s3_backend_init(b); } #endif return NULL; }
/* This source file is part of KBEngine For the latest info, see http://www.kbengine.org/ Copyright (c) 2008-2016 KBEngine. KBEngine is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. KBEngine 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 KBEngine. If not, see <http://www.gnu.org/licenses/>. */ #ifndef KBE_ENDPOINT_H #define KBE_ENDPOINT_H #include "common/common.h" #include "common/objectpool.h" #include "helper/debug_helper.h" #include "network/address.h" #include "network/common.h" namespace KBEngine { namespace Network { class Bundle; class EndPoint : public PoolObject { public: typedef KBEShared_ptr< SmartPoolObject< EndPoint > > SmartPoolObjectPtr; static SmartPoolObjectPtr createSmartPoolObj(); static ObjectPool<EndPoint>& ObjPool(); static EndPoint* createPoolObject(); static void reclaimPoolObject(EndPoint* obj); static void destroyObjPool(); void onReclaimObject(); virtual size_t getPoolObjectBytes() { size_t bytes = sizeof(KBESOCKET) + address_.getPoolObjectBytes(); return bytes; } EndPoint(Address address); EndPoint(u_int32_t networkAddr = 0, u_int16_t networkPort = 0); virtual ~EndPoint(); INLINE operator KBESOCKET() const; static void initNetwork(); INLINE bool good() const; void socket(int type); INLINE KBESOCKET socket() const; INLINE void setFileDescriptor(int fd); INLINE int joinMulticastGroup(u_int32_t networkAddr); INLINE int quitMulticastGroup(u_int32_t networkAddr); INLINE int close(); INLINE int setnonblocking(bool nonblocking); INLINE int setbroadcast(bool broadcast); INLINE int setreuseaddr(bool reuseaddr); INLINE int setkeepalive(bool keepalive); INLINE int setnodelay(bool nodelay = true); INLINE int setlinger(uint16 onoff, uint16 linger); INLINE int bind(u_int16_t networkPort = 0, u_int32_t networkAddr = INADDR_ANY); INLINE int listen(int backlog = 5); INLINE int connect(u_int16_t networkPort, u_int32_t networkAddr = INADDR_BROADCAST, bool autosetflags = true); INLINE int connect(bool autosetflags = true); INLINE EndPoint* accept(u_int16_t * networkPort = NULL, u_int32_t * networkAddr = NULL, bool autosetflags = true); INLINE int send(const void * gramData, int gramSize); void send(Bundle * pBundle); void sendto(Bundle * pBundle, u_int16_t networkPort, u_int32_t networkAddr = BROADCAST); INLINE int recv(void * gramData, int gramSize); bool recvAll(void * gramData, int gramSize); INLINE uint32 getRTT(); INLINE int getInterfaceFlags(char * name, int & flags); INLINE int getInterfaceAddress(const char * name, u_int32_t & address); INLINE int getInterfaceNetmask(const char * name, u_int32_t & netmask); bool getInterfaces(std::map< u_int32_t, std::string > &interfaces); int findIndicatedInterface(const char * spec, u_int32_t & address); int findDefaultInterface(char * name, int buffsize); int getInterfaceAddressByName(const char * name, u_int32_t & address); int getInterfaceAddressByMAC(const char * mac, u_int32_t & address); int getDefaultInterfaceAddress(u_int32_t & address); int getBufferSize(int optname) const; bool setBufferSize(int optname, int size); INLINE int getlocaladdress(u_int16_t * networkPort, u_int32_t * networkAddr) const; INLINE int getremoteaddress(u_int16_t * networkPort, u_int32_t * networkAddr) const; Network::Address getLocalAddress() const; Network::Address getRemoteAddress() const; bool getClosedPort(Network::Address & closedPort); INLINE const char * c_str() const; INLINE int getremotehostname(std::string * name) const; INLINE int sendto(void * gramData, int gramSize, u_int16_t networkPort, u_int32_t networkAddr = BROADCAST); INLINE int sendto(void * gramData, int gramSize, struct sockaddr_in & sin); INLINE int recvfrom(void * gramData, int gramSize, u_int16_t * networkPort, u_int32_t * networkAddr); INLINE int recvfrom(void * gramData, int gramSize, struct sockaddr_in & sin); INLINE const Address& addr() const; INLINE void addr(const Address& newAddress); INLINE void addr(u_int16_t newNetworkPort, u_int32_t newNetworkAddress); bool waitSend(); protected: KBESOCKET socket_; Address address_; }; } } #ifdef CODE_INLINE #include "endpoint.inl" #endif #endif // KBE_ENDPOINT_H
/*************************************************************************** * Copyright (C) 2006 by Dominik Seichter * * domseichter@web.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 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 Library 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. * * * * In addition, as a special exception, the copyright holders give * * permission to link the code of portions of this program with the * * OpenSSL library under certain conditions as described in each * * individual source file, and distribute linked combinations * * including the two. * * You must obey the GNU General Public License in all respects * * for all of the code used other than OpenSSL. If you modify * * file(s) with this exception, you may extend this exception to your * * version of the file(s), but you are not obligated to do so. If you * * do not wish to do so, delete this exception statement from your * * version. If you delete this exception statement from all source * * files in the program, then also delete it here. * ***************************************************************************/ /* * WARNING: This file was automatically generated by Beautiful Capi! * Do not edit this file! Please edit the source API description. * * Beautiful Capi project: * https://github.com/PetrPPetrov/beautiful-capi * * PoDoFo API description project: * https://github.com/GkmSoft/podofo-capi */ virtual ~PdfAction() {} virtual bool HasScript() const = 0; virtual PoDoFo::EPdfAction GetType() const = 0; virtual void AddToDictionary(PoDoFo::PdfDictionary dictionary) const = 0; virtual PoDoFo::PdfString GetURI() const = 0; virtual void SetURI(PoDoFo::PdfString uri) = 0; virtual PoDoFo::PdfString GetScript() const = 0; virtual void SetScript(PoDoFo::PdfString script) = 0;
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CANCELCAPACITYRESERVATIONRESPONSE_H #define QTAWS_CANCELCAPACITYRESERVATIONRESPONSE_H #include "ec2response.h" #include "cancelcapacityreservationrequest.h" namespace QtAws { namespace EC2 { class CancelCapacityReservationResponsePrivate; class QTAWSEC2_EXPORT CancelCapacityReservationResponse : public Ec2Response { Q_OBJECT public: CancelCapacityReservationResponse(const CancelCapacityReservationRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const CancelCapacityReservationRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(CancelCapacityReservationResponse) Q_DISABLE_COPY(CancelCapacityReservationResponse) }; } // namespace EC2 } // namespace QtAws #endif
#pragma once #include "../data.h" #include "../type.h" #include "../value.h" #include "stacktrace.h" #include <string> #include <memory> namespace sqf { namespace runtime { struct t_stacktrace : public type::extend<t_stacktrace> { t_stacktrace() : extend() {} static const std::string name() { return "VM-STACKTRACE"; } }; } namespace types { class d_stacktrace : public sqf::runtime::data { public: using data_type = sqf::runtime::t_stacktrace; private: sqf::runtime::diagnostics::stacktrace m_value; protected: bool do_equals(std::shared_ptr<sqf::runtime::data> other, bool invariant) const override { // A stacktrace is never equal to another stacktrace return false; } public: d_stacktrace() = default; d_stacktrace(sqf::runtime::diagnostics::stacktrace stacktrace) : m_value(stacktrace) {} std::string to_string_sqf() const override { return "'" + m_value.to_string() + "'"; } std::string to_string() const override { return m_value.to_string(); } sqf::runtime::type type() const override { return data_type(); } sqf::runtime::diagnostics::stacktrace value() const { return m_value; } void value(sqf::runtime::diagnostics::stacktrace stacktrace) { m_value = stacktrace; } operator sqf::runtime::diagnostics::stacktrace() { return m_value; } }; template<> inline std::shared_ptr<sqf::runtime::data> to_data<sqf::runtime::diagnostics::stacktrace>(sqf::runtime::diagnostics::stacktrace str) { return std::make_shared<d_stacktrace>(str); } } }
// Created file "Lib\src\Uuid\propkeys" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_NetworkLocation, 0x28636aa6, 0x953d, 0x11d2, 0xb5, 0xd6, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);
/* -*- C -*- * mmap.c -- memory mapping for the sculld char module * * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet * Copyright (C) 2001 O'Reilly & Associates * * The source code in this file can be freely used, adapted, * and redistributed in source or binary form, so long as an * acknowledgment appears in derived source files. The citation * should list that the code comes from the book "Linux Device * Drivers" by Alessandro Rubini and Jonathan Corbet, published * by O'Reilly & Associates. No warranty is attached; * we cannot take responsibility for errors or fitness for use. * * $Id: _mmap.c.in,v 1.13 2004/10/18 18:07:36 corbet Exp $ */ #include <linux/module.h> #include <linux/fs.h> #include <linux/mm.h> /* everything */ #include <linux/errno.h> /* error codes */ #include <asm/pgtable.h> #include "sculld.h" /* local definitions */ /* * open and close: just keep track of how many times the device is * mapped, to avoid releasing it. */ void sculld_vma_open(struct vm_area_struct *vma) { struct sculld_dev *dev = vma->vm_private_data; dev->vmas++; } void sculld_vma_close(struct vm_area_struct *vma) { struct sculld_dev *dev = vma->vm_private_data; dev->vmas--; } /* * The nopage method: the core of the file. It retrieves the * page required from the sculld device and returns it to the * user. The count for the page must be incremented, because * it is automatically decremented at page unmap. * * For this reason, "order" must be zero. Otherwise, only the first * page has its count incremented, and the allocating module must * release it as a whole block. Therefore, it isn't possible to map * pages from a multipage block: when they are unmapped, their count * is individually decreased, and would drop to 0. */ static int sculld_vma_nopage(struct vm_area_struct *vma, struct vm_fault *vmf) { unsigned long offset; struct sculld_dev *ptr, *dev = vma->vm_private_data; struct page *page = NULL; void *pageptr = NULL; /* default to "missing" */ int retval = VM_FAULT_NOPAGE; down(&dev->sem); offset = (unsigned long)(vmf->virtual_address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT); if (offset >= dev->size) goto out; /* out of range */ /* * Now retrieve the sculld device from the list,then the page. * If the device has holes, the process receives a SIGBUS when * accessing the hole. */ offset >>= PAGE_SHIFT; /* offset is a number of pages */ for (ptr = dev; ptr && offset >= dev->qset;) { ptr = ptr->next; offset -= dev->qset; } if (ptr && ptr->data) pageptr = ptr->data[offset]; if (!pageptr) goto out; /* hole or end-of-file */ /* got it, now increment the count */ get_page(page); vmf->page = page; retval = 0; out: up(&dev->sem); return retval; } struct vm_operations_struct sculld_vm_ops = { .open = sculld_vma_open, .close = sculld_vma_close, .fault = sculld_vma_nopage, }; int sculld_mmap(struct file *filp, struct vm_area_struct *vma) { struct inode *inode = filp->f_path.dentry->d_inode; /* refuse to map if order is not 0 */ if (sculld_devices[iminor(inode)].order) return -ENODEV; /* don't do anything here: "nopage" will set up page table entries */ vma->vm_ops = &sculld_vm_ops; vma->vm_flags |= VM_RESERVED; vma->vm_private_data = filp->private_data; sculld_vma_open(vma); return 0; }
// CSmtp.h: interface for the Smtp class. // ////////////////////////////////////////////////////////////////////// #pragma once #ifndef __CSMTP_H__ #define __CSMTP_H__ #include <vector> #include <string.h> #include <assert.h> #ifdef LINUX #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <errno.h> #include <stdio.h> #include <iostream> #define SOCKET_ERROR -1 #define INVALID_SOCKET -1 typedef unsigned short WORD; typedef int SOCKET; typedef struct sockaddr_in SOCKADDR_IN; typedef struct hostent* LPHOSTENT; typedef struct servent* LPSERVENT; typedef struct in_addr* LPIN_ADDR; typedef struct sockaddr* LPSOCKADDR; #else #include <winsock2.h> #include <time.h> #pragma comment(lib, "ws2_32.lib") #endif #define TIME_IN_SEC 10 // how long client will wait for server response in non-blocking mode #define BUFFER_SIZE 10240 // SendData and RecvData buffers sizes #define MSG_SIZE_IN_MB 5 // the maximum size of the message with all attachments #define COUNTER_VALUE 100 // how many times program will try to receive data const char BOUNDARY_TEXT[] = "__MESSAGE__ID__54yg6f6h6y456345"; enum CSmptXPriority { XPRIORITY_HIGH = 2, XPRIORITY_NORMAL = 3, XPRIORITY_LOW = 4 }; class ECSmtp { public: enum CSmtpError { CSMTP_NO_ERROR = 0, WSA_STARTUP = 100, // WSAGetLastError() WSA_VER, WSA_SEND, WSA_RECV, WSA_CONNECT, WSA_GETHOSTBY_NAME_ADDR, WSA_INVALID_SOCKET, WSA_HOSTNAME, WSA_IOCTLSOCKET, WSA_SELECT, BAD_IPV4_ADDR, UNDEF_MSG_HEADER = 200, UNDEF_MAIL_FROM, UNDEF_SUBJECT, UNDEF_RECIPIENTS, UNDEF_LOGIN, UNDEF_PASSWORD, UNDEF_RECIPIENT_MAIL, COMMAND_MAIL_FROM = 300, COMMAND_EHLO, COMMAND_AUTH_LOGIN, COMMAND_DATA, COMMAND_QUIT, COMMAND_RCPT_TO, MSG_BODY_ERROR, CONNECTION_CLOSED = 400, // by server SERVER_NOT_READY, // remote server SERVER_NOT_RESPONDING, SELECT_TIMEOUT, FILE_NOT_EXIST, MSG_TOO_BIG, BAD_LOGIN_PASS, UNDEF_XYZ_RESPONSE, LACK_OF_MEMORY, TIME_ERROR, RECVBUF_IS_EMPTY, SENDBUF_IS_EMPTY, OUT_OF_MSG_RANGE, }; ECSmtp(CSmtpError err_) : ErrorCode(err_) {} CSmtpError GetErrorNum(void) const {return ErrorCode;} std::string GetErrorText(void) const; private: CSmtpError ErrorCode; }; class CSmtp { public: CSmtp(); virtual ~CSmtp(); void AddRecipient(const char *email, const char *name=NULL); void AddBCCRecipient(const char *email, const char *name=NULL); void AddCCRecipient(const char *email, const char *name=NULL); void AddAttachment(const char *path); void AddMsgLine(const char* text); void DelRecipients(void); void DelBCCRecipients(void); void DelCCRecipients(void); void DelAttachments(void); void DelMsgLines(void); void DelMsgLine(unsigned int line); void ModMsgLine(unsigned int line,const char* text); unsigned int GetBCCRecipientCount() const; unsigned int GetCCRecipientCount() const; unsigned int GetRecipientCount() const; const char* GetLocalHostIP() const; const char* GetLocalHostName() const; const char* GetMsgLineText(unsigned int line) const; unsigned int GetMsgLines(void) const; const char* GetReplyTo() const; const char* GetMailFrom() const; const char* GetSenderName() const; const char* GetSubject() const; const char* GetXMailer() const; CSmptXPriority GetXPriority() const; void Send(); void SetSubject(const char*); void SetSenderName(const char*); void SetSenderMail(const char*); void SetReplyTo(const char*); void SetXMailer(const char*); void SetLogin(const char*); void SetPassword(const char*); void SetXPriority(CSmptXPriority); void SetSMTPServer(const char* server,const unsigned short port=0); private: std::string m_sLocalHostName; std::string m_sMailFrom; std::string m_sNameFrom; std::string m_sSubject; std::string m_sXMailer; std::string m_sReplyTo; std::string m_sIPAddr; std::string m_sLogin; std::string m_sPassword; std::string m_sSMTPSrvName; unsigned short m_iSMTPSrvPort; CSmptXPriority m_iXPriority; char *SendBuf; char *RecvBuf; SOCKET hSocket; struct Recipient { std::string Name; std::string Mail; }; std::vector<Recipient> Recipients; std::vector<Recipient> CCRecipients; std::vector<Recipient> BCCRecipients; std::vector<std::string> Attachments; std::vector<std::string> MsgBody; void ReceiveData(); void SendData(); void FormatHeader(char*); int SmtpXYZdigits(); SOCKET ConnectRemoteServer(const char* server, const unsigned short port=0); }; #endif // __CSMTP_H__
#ifndef ROPE_H #define ROPE_H #include "BangMath/AABox.h" #include "Bang/Array.h" #include "Bang/AssetHandle.h" #include "Bang/BangDefines.h" #include "Bang/ComponentMacros.h" #include "Bang/LineRenderer.h" #include "Bang/MetaNode.h" #include "Bang/Particle.h" #include "Bang/String.h" namespace Bang { class Serializable; class Mesh; class ShaderProgram; class Rope : public LineRenderer { COMPONENT_WITHOUT_CLASS_ID(Rope) public: Rope(); virtual ~Rope() override; // Component void OnStart() override; void OnUpdate() override; // Renderer void Bind() override; void OnRender() override; virtual AABox GetAABBox() const override; void SetUniformsOnBind(ShaderProgram *sp) override; void Reset(); void SetDamping(float damping); void SetNumPoints(uint numPoints); void SetBounciness(float bounciness); void SetRopeLength(float ropeLength); void SetSpringsForce(float springsForce); void SetSpringsDamping(float springsDamping); void SetFixedPoint(uint i, bool fixed); void SetFixedPoints(const Array<bool> &pointsFixed); void SetPoints(const Array<Vector3> &points); void SetSeeDebugPoints(bool seeDebugPoints); bool IsPointFixed(uint i) const; float GetSpringsForce() const; float GetRopeLength() const; float GetBounciness() const; float GetDamping() const; uint GetNumPoints() const; bool GetSeeDebugPoints() const; float GetSpringsDamping() const; // Serializable virtual void CloneInto(Serializable *clone, bool cloneGUID) const override; // Serializable virtual void Reflect() override; private: Array<Vector3> m_points; Array<bool> m_fixedPoints; Particle::Parameters m_particleParams; float m_ropeLength = 1.0f; float m_springsForce = 1.0f; float m_springsDamping = 1.0f; Array<Particle::Data> m_particlesData; bool m_seeDebugPoints = false; AH<Mesh> m_ropeDebugPointsMesh; bool m_validLineRendererPoints = false; void InitParticle(uint i, const Particle::Parameters &params); const Particle::Parameters &GetParameters() const; float GetPartLength() const; void AddSpringForces(); void ConstrainPointsPositions(); void UpdateLineRendererPoints(); }; } #endif // ROPE_H
/* * Tulip Indicators * https://tulipindicators.org/ * Copyright (c) 2010-2020 Tulip Charts LLC * Lewis Van Winkle (LV@tulipcharts.org) * * This file is part of Tulip Indicators. * * Tulip Indicators is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * Tulip Indicators 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 Tulip Indicators. If not, see <http://www.gnu.org/licenses/>. * */ /*VERSION*/ #include "indicators.h" const char* ti_version(void) {return TI_VERSION;} long int ti_build(void) {return TI_BUILD;} int ti_indicator_count(void) {return TI_INDICATOR_COUNT;} /*INDICATORS*/ struct ti_stream { int index; int progress; }; int ti_stream_run(ti_stream *stream, int size, TI_REAL const *const *inputs, TI_REAL *const *outputs) { return ti_indicators[stream->index].stream_run(stream, size, inputs, outputs); } ti_indicator_info *ti_stream_get_info(ti_stream *stream) { return ti_indicators + stream->index; } int ti_stream_get_progress(ti_stream *stream) { return stream->progress; } void ti_stream_free(ti_stream *stream) { ti_indicators[stream->index].stream_free(stream); } const ti_indicator_info *ti_find_indicator(const char *name) { int imin = 0; int imax = sizeof(ti_indicators) / sizeof(ti_indicator_info) - 2; /*Binary search.*/ while (imax >= imin) { const int i = (imin + ((imax-imin)/2)); const int c = strcmp(name, ti_indicators[i].name); if (c == 0) { return ti_indicators + i; } else if (c > 0) { imin = i + 1; } else { imax = i - 1; } } return 0; }
int f(){ return 0; } int main(void){ f(); return 0; }
/* gdb_hooks.h - Hooks for GDB Stub library Copyright (c) 2018 Ivan Grokhotkov. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include <user_config.h> #ifdef __cplusplus extern "C" { #endif /** @defgroup GDB GDB debugging support * @{ */ /** * @brief Initialise GDB stub, if present * @note Called by framework at startup, but does nothing if gdbstub is not linked. */ void gdb_init(void); /** * @brief Dynamically enable/disable GDB stub * @param state true to enable, false to disable * @note has no effect if gdbstub is not present * * Calling with `enable = false` overrides configured behaviour as follows: * * - Debug exceptions will be silently ignored * - System exceptions will cause a watchdog reset, as for `GDBSTUB_BREAK_ON_EXCEPTION = 0` * - All incoming serial data is passed through to UART2 without inspection, as for `GDBSTUB_CTRLC_BREAK = 0` * */ void gdb_enable(bool state); /** * @brief Break into GDB, if present */ #ifdef ENABLE_GDB #ifdef ARCH_HOST #define gdb_do_break() __asm__("int $0x03") #else #define gdb_do_break() __asm__("break 0,0") #endif #else #define gdb_do_break() \ do { \ } while(0) #endif typedef enum { eGDB_NotPresent, eGDB_Detached, eGDB_Attached, } GdbState; /** * @brief Check if GDB stub is present */ GdbState gdb_present(void); /** * @brief Called from task queue when GDB attachment status changes * @note User can implement this function to respond to attachment changes */ void gdb_on_attach(bool attached); /** * @brief Detach from GDB, if attached * @note We send GDB an 'exit process' message */ void gdb_detach(); /* * @brief Called by framekwork on unexpected system reset */ void debug_crash_callback(const struct rst_info* rst_info, uint32_t stack, uint32_t stack_end); /** * @brief Send a stack dump to debug output * @param start Start address to output * @param end Output up to - but not including - this address */ void debug_print_stack(uint32_t start, uint32_t end); #ifdef __cplusplus } // extern "C" #endif /** @} */
// // 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 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 Lesser 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, see http://www.gnu.org/licenses/. // #ifndef LISNOCBASEMODULE_H_ #define LISNOCBASEMODULE_H_ #include <csimplemodule.h> #include <LISNoCMessages.h> namespace lisnoc { /** * Basic flow control handling * * This class provides the designer the basic flow control protocol * handling as employed by all modules. The class itself is * abstract, i.e., it cannot be instantiated. You need to derive * your module from this class and implement the following function: * * - `void handleIncomingFlit(LISNoCFlit *msg)`: Handle an incoming * message after successfull flow control handshake * * */ class LISNoCBaseModule: public cSimpleModule { public: virtual ~LISNoCBaseModule(); virtual void finish(); private: bool m_allowLateAck; cMessage *m_selfTrigger; LISNoCFlowControlRequest *m_delayedTransfer; simtime_t m_clock; bool m_activeRequest; std::pair<LISNoCFlowControlRequest*, simtime_t> m_pendingRequestWithLateAck; bool m_isInitialized; virtual LISNoCFlowControlRequest *createFlowControlRequest(LISNoCFlit *flit); virtual LISNoCFlowControlRequest *createFlowControlRequest(LISNoCFlowControlGrant *grant); virtual LISNoCFlowControlGrant *createFlowControlGrant(LISNoCFlowControlRequest *request); protected: virtual void initialize(); virtual void allowLateAck(); virtual void handleMessage(cMessage *msg); virtual void handleIncomingRequest(LISNoCFlowControlRequest *msg); virtual void handleIncomingGrant(LISNoCFlowControlGrant *msg); virtual void handleIncomingFlit(LISNoCFlit *msg) = 0; virtual void triggerSelf(unsigned int numcycles = 1, cMessage *msg = NULL); virtual void handleSelfMessage(cMessage *msg) = 0; virtual bool canRequestTransfer(LISNoCFlit *msg); virtual void requestTransfer(LISNoCFlit *msg); virtual void requestTransferAfter(LISNoCFlit *msg, unsigned int numcycles); virtual void delayedTransfer(); virtual void doTransfer() = 0; virtual bool isRequestGranted(LISNoCFlowControlRequest *msg) = 0; virtual void tryLateGrant(); }; } /* namespace lisnoc */ #endif /* LISNOCBASEMODULE_H_ */
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DELETEROOMRESPONSE_P_H #define QTAWS_DELETEROOMRESPONSE_P_H #include "alexaforbusinessresponse_p.h" namespace QtAws { namespace AlexaForBusiness { class DeleteRoomResponse; class DeleteRoomResponsePrivate : public AlexaForBusinessResponsePrivate { public: explicit DeleteRoomResponsePrivate(DeleteRoomResponse * const q); void parseDeleteRoomResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(DeleteRoomResponse) Q_DISABLE_COPY(DeleteRoomResponsePrivate) }; } // namespace AlexaForBusiness } // namespace QtAws #endif
// Created file "Lib\src\Uuid\X64\ieguids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(NOTIFICATIONTYPE_TASKS_ABORT, 0xd34f17e9, 0x576e, 0x11d0, 0xb2, 0x8c, 0x00, 0xc0, 0x4f, 0xd7, 0xcd, 0x22);
#include "image.h" struct Bitmap* bitmap_create(int res[]) { struct Bitmap* B = malloc(sizeof(struct Bitmap)); B->width = res[0]; B->height = res[1]; B->pixels = malloc(sizeof(struct Pixel)*res[0]*res[1]); return B; } struct Pixel* bitmap_get_pixel(struct Bitmap* bitmap, size_t x, size_t y) { return bitmap->pixels + bitmap->width*y + x; } void bitmap_set_pixel(struct Bitmap* bitmap, size_t x, size_t y, uint8_t color[]) { struct Pixel* pixel = bitmap_get_pixel(bitmap, x, bitmap->height-y-1); pixel->red = color[0]; pixel->green = color[1]; pixel->blue = color[2]; } bool bitmap_save_png(struct Bitmap *bitmap, char* png_file_path) { FILE* f_png; png_structp png_ptr = NULL; png_infop info_ptr = NULL; size_t x, y; png_byte** row_pointers = NULL; f_png = fopen(png_file_path, "wb"); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); info_ptr = png_create_info_struct(png_ptr); if (!png_ptr) { fprintf(stderr, "image: 'png_create_write_struct' failed!\n"); } if (!info_ptr) { fprintf(stderr, "image: 'png_create_info_struct' failed!\n"); } if (f_png == NULL) { fprintf(stderr, "image: failed to open file '%s' for output.\n", png_file_path); return false; } /* set image attributes */ png_set_IHDR(png_ptr, info_ptr, bitmap->width, bitmap->height, PNG_BIT_DEPTH, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); /* initialize rows of PNG */ row_pointers = png_malloc(png_ptr, bitmap->height * sizeof(png_byte *)); for (y = 0; y < bitmap->height; y++) { png_byte *row = png_malloc(png_ptr, sizeof(uint8_t)*bitmap->width*PIXEL_SIZE); row_pointers[y] = row; for (x = 0; x < bitmap->width; x++) { struct Pixel* pixel = bitmap_get_pixel(bitmap, x, y); *row++ = pixel->red; *row++ = pixel->green; *row++ = pixel->blue; } } /* write the image data to file */ png_init_io(png_ptr, f_png); png_set_rows(png_ptr, info_ptr, row_pointers); png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); printf("image: bitmap written to '%s'.\n", png_file_path); for (y = 0; y < bitmap->height; y++) { png_free(png_ptr, row_pointers[y]); } png_free(png_ptr, row_pointers); fclose(f_png); return true; } void bitmap_free(struct Bitmap* bitmap) { free(bitmap->pixels); free(bitmap); }
const unsigned char imageRLE[341]={ 0x01,0x00,0x01,0x3d,0x23,0x00,0x01,0x0e,0x80,0x80,0x00,0x82,0x80,0x83,0x00,0x83, 0x00,0x82,0x00,0x82,0x80,0x00,0x82,0x80,0x00,0x01,0x0f,0x86,0x80,0x00,0x80,0x01, 0x02,0x00,0x81,0x5c,0x81,0x00,0x86,0x00,0x00,0x84,0x83,0x00,0x01,0x0f,0x85,0x00, 0x00,0x85,0x00,0x84,0x00,0x85,0x00,0x84,0x00,0x84,0x80,0x00,0x80,0x85,0x00,0x01, 0x84,0x82,0x80,0x01,0x05,0x83,0x00,0x82,0x80,0x80,0x83,0x00,0x01,0x04,0x82,0x80, 0x01,0x06,0x83,0x00,0x01,0x04,0x81,0x8d,0x01,0x05,0x84,0x83,0x81,0x8d,0x8d,0x81, 0x00,0x01,0x04,0x81,0x8d,0x01,0x06,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x82,0x80, 0x83,0x8d,0x8d,0x81,0x81,0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x82,0x80, 0x01,0x03,0x85,0x00,0x01,0x04,0x81,0x8d,0x8d,0x84,0x80,0x85,0x8d,0x8d,0x81,0x81, 0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x84,0x80,0x01,0x02,0x83,0x00,0x01, 0x05,0x81,0x8d,0x01,0x06,0x81,0x81,0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d, 0x94,0x01,0x03,0x81,0x00,0x01,0x05,0x81,0x8d,0x8d,0x8b,0x8d,0x8d,0x8e,0x82,0x85, 0x81,0x8d,0x8d,0x81,0x00,0x01,0x04,0x81,0x8d,0x8d,0x82,0x80,0x01,0x02,0x85,0x00, 0x01,0x05,0x81,0x8d,0x8d,0x82,0x83,0x8d,0x8d,0x84,0x83,0x81,0x8d,0x8d,0x84,0x80, 0x01,0x03,0x83,0x81,0x8d,0x8d,0x84,0x80,0x01,0x03,0x83,0x00,0x01,0x04,0x81,0x8d, 0x8d,0x81,0x84,0x83,0x8d,0x8d,0x81,0x81,0x8d,0x01,0x06,0x81,0x81,0x8d,0x01,0x06, 0x81,0x00,0x01,0x04,0x84,0x80,0x80,0x85,0x00,0x84,0x80,0x80,0x85,0x84,0x80,0x01, 0x06,0x85,0x84,0x80,0x01,0x06,0x85,0x00,0x01,0x07,0x52,0x55,0x4e,0x00,0x00,0x2d, 0x2d,0x00,0x4c,0x45,0x4e,0x47,0x54,0x48,0x00,0x00,0x45,0x4e,0x43,0x4f,0x44,0x49, 0x4e,0x47,0x00,0x01,0x26,0xeb,0xef,0xe4,0xe9,0xf2,0xef,0xf7,0xe1,0xee,0xe9,0xe5, 0x00,0x00,0xe4,0xec,0xe9,0xee,0x00,0x00,0xf3,0xe5,0xf2,0xe9,0xea,0x00,0x01,0xfe, 0x00,0x01,0x63,0x01,0x00 };
// Header file CandyBox.h in project Ex9_02 #pragma once #include "Box.h" class CCandyBox: public CBox { public: char* m_Contents; CCandyBox(char* str = "Candy") // Constructor { m_Contents = new char[ strlen(str) + 1 ]; strcpy_s(m_Contents, strlen(str) + 1, str); } ~CCandyBox() // Destructor { delete[] m_Contents; }; };
// // RSAPubKey.h // // Version 1.0.0 // // Created by yangtu222 on 2016.06.30. // Copyright (C) 2016, andlisoft.com. // // Distributed under the permissive zlib License // Get the latest version from here: // // https://github.com/yangtu222/RSAPublicKey // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // #import <Foundation/Foundation.h> #import <Security/Security.h> @interface RSAPubKey : NSObject + (SecKeyRef) stringToRSAPubKey: (NSString*) modulus andExponent:(NSString*) exponent; //m and e is base64 encoded. + (SecKeyRef) dataRSAPubKey: (NSData*) modulus andExponent:(NSData*) exponent; @end
#pragma once #include "maths.h" #include "utils.h" #include <map> using namespace maths; using namespace utils; struct Camera { Camera(); void update(std::map<int, Transform>& transforms); bool follow_vehicle; bool target_changed; int last_target_index; int current_target_index; float target_distance; float field_of_view; float aspect_ratio; vec2 resolution; vec2 depth_range_ortho; vec2 depth_range_persp; vec3 position_start; vec3 position_current; vec3 position_target; vec3 orientation_up; vec3 old_position; vec3 old_target; mat4 matrix_view; mat4 matrix_projection_persp; mat4 matrix_projection_ortho; float height; int index_list_position_current; std::vector<vec3> list_position_current; };
#ifndef FILERWKIT_H #define FILERWKIT_H #include <QObject> #include <QVector> #include <QFile> #include <QXmlStreamReader> #include <QXmlStreamWriter> #include <QString> #include <QStringList> #include <QDebug> #include <QDir> #include <QDateTime> #include <QtMath> class QFileIO : public QObject { Q_OBJECT public: explicit QFileIO(QObject *parent = 0); QVector< QVector<double> > ReadCSV(QString filename); private: signals: public slots: }; #endif // FILERWKIT_H
#import <UIKit/UIKit.h> #import "_DDDecimalFunctions.h" #import "_DDFunctionEvaluator.h" #import "_DDFunctionExpression.h" #import "_DDFunctionTerm.h" #import "_DDGroupTerm.h" #import "_DDNumberExpression.h" #import "_DDNumberTerm.h" #import "_DDOperatorTerm.h" #import "_DDParserTerm.h" #import "_DDPrecisionFunctionEvaluator.h" #import "_DDRewriteRule.h" #import "_DDVariableExpression.h" #import "_DDVariableTerm.h" #import "DDExpression.h" #import "DDExpressionRewriter.h" #import "DDMathEvaluator+Private.h" #import "DDMathEvaluator.h" #import "DDMathOperator.h" #import "DDMathOperator_Internal.h" #import "DDMathParser.h" #import "DDMathParserMacros.h" #import "DDMathStringToken.h" #import "DDMathStringTokenizer.h" #import "DDParser.h" #import "DDParserTypes.h" #import "DDTypes.h" #import "NSString+HYPMathParsing.h" FOUNDATION_EXPORT double HYPMathParserVersionNumber; FOUNDATION_EXPORT const unsigned char HYPMathParserVersionString[];
/* * sprite.h * * Created on: Sep 8, 2013 * Author: drb */ #ifndef SPRITE_H_ #define SPRITE_H_ #include <vector> #include "../util/Point.h" #include "ISprite.h" class sprite : public ISprite { public: sprite(); virtual ~sprite(); virtual void render (double delta , SDL_Renderer* rednerer , SDL_Point CameraOffset); virtual void update (double delta); virtual void event (SDL_Event event, double delta); SDL_Rect getBounds(void); void setBounds(SDL_Rect rect); double getAngle(void); double getArea(void); void setAngle(double angle); Point getPosition(void); void setPosition(Point pos); SDL_Point getCenter (); std::vector<SDL_Point>* getPointBounds (); SDL_Point* getPointBoundsArray (); }; #endif /* SPRITE_H_ */
#pragma once class COrderItem { public: COrderItem(void); ~COrderItem(void); public: CString orderID; CString orderTel; CString orderStatus; CString orderType; float orderPayed; float orderDiscount; int orderBig; int orderSmall; CString orderName; int iIndex; };
// // SheetWindowController.h // b-music // // Created by Sergey P on 02.10.13. // Copyright (c) 2013 Sergey P. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // 1. The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // 2. This Software cannot be used to archive or collect data such as (but not // limited to) that of events, news, experiences and activities, for the // purpose of any concept relating to diary/journal keeping. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <Cocoa/Cocoa.h> #import <WebKit/WebKit.h> @protocol SheetDelegate <NSObject> -(void) cancelSheet:(NSString*)token user_id:(NSInteger)user_id execute:(SEL)someFunc; @end @interface SheetWindowController : NSWindowController @property (weak) id <SheetDelegate> delegate; @property (weak) IBOutlet WebView *webview; -(IBAction)cancel:(id)sender; -(void)clearCookie; -(void) loadURL:(NSString *) URLsring execute:(SEL)someFunc; @end
// // UIImage+AKCryptography.h // AmazeKit // // Created by Jeff Kelley on 8/13/12. // Copyright (c) 2013 Detroit Labs. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import <UIKit/UIKit.h> @interface UIImage (AKCryptography) - (NSString *)AK_sha1Hash; @end
/* * Copyright 2011-2013 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ #ifndef __DEVICE_TASK_H__ #define __DEVICE_TASK_H__ #include "device_memory.h" #include "util_function.h" #include "util_list.h" #include "util_task.h" CCL_NAMESPACE_BEGIN /* Device Task */ class Device; class RenderBuffers; class RenderTile; class Tile; class DeviceTask : public Task { public: typedef enum { PATH_TRACE, FILM_CONVERT, SHADER } Type; Type type; int x, y, w, h; device_ptr rgba_byte; device_ptr rgba_half; device_ptr buffer; int sample; int num_samples; int offset, stride; device_ptr shader_input; device_ptr shader_output; int shader_eval_type; int shader_x, shader_w; DeviceTask(Type type = PATH_TRACE); int get_subtask_count(int num, int max_size = 0); void split(list<DeviceTask>& tasks, int num, int max_size = 0); void update_progress(RenderTile *rtile); boost::function<bool(Device *device, RenderTile&)> acquire_tile; boost::function<void(void)> update_progress_sample; boost::function<void(RenderTile&)> update_tile_sample; boost::function<void(RenderTile&)> release_tile; boost::function<bool(void)> get_cancel; bool need_finish_queue; bool integrator_branched; protected: double last_update_time; }; CCL_NAMESPACE_END #endif /* __DEVICE_TASK_H__ */
#define PI_2 (2 * M_PI_F) // buffer length defaults to the argument to the integrate kernel // but if it's known at compile time, it can be provided which allows // compiler to change i%n to i&(n-1) if n is a power of two. #ifndef NH #define NH nh #endif #ifndef WARP_SIZE #define WARP_SIZE 32 #endif #include <stdio.h> // for printf #include <curand_kernel.h> #include <curand.h> __device__ float wrap_2_pi_(float x)/*{{{*/ { bool neg_mask = x < 0.0f; bool pos_mask = !neg_mask; // fmodf diverges 51% of time float pos_val = fmodf(x, PI_2); float neg_val = PI_2 - fmodf(-x, PI_2); return neg_mask * neg_val + pos_mask * pos_val; }/*}}}*/ __device__ float wrap_2_pi(float x) // not divergent/*{{{*/ { bool lt_0 = x < 0.0f; bool gt_2pi = x > PI_2; return (x + PI_2)*lt_0 + x*(!lt_0)*(!gt_2pi) + (x - PI_2)*gt_2pi; }/*}}}*/ __global__ void integrate(/*{{{*/ // config unsigned int i_step, unsigned int n_node, unsigned int nh, unsigned int n_step, unsigned int n_params, float dt, float speed, float * __restrict__ weights, float * __restrict__ lengths, float * __restrict__ params_pwi, // pwi: per work item // state float * __restrict__ state_pwi, // outputs float * __restrict__ tavg_pwi ) {/*}}}*/ // work id & size/*{{{*/ const unsigned int id = (blockIdx.y * gridDim.x + blockIdx.x) * blockDim.x + threadIdx.x; const unsigned int size = blockDim.x * gridDim.x * gridDim.y;/*}}}*/ // ND array accessors (TODO autogen from py shape info)/*{{{*/ #define params(i_par) (params_pwi[(size * (i_par)) + id]) #define state(time, i_node) (state_pwi[((time) * n_node + (i_node))*size + id]) #define tavg(i_node) (tavg_pwi[((i_node) * size) + id])/*}}}*/ // unpack params/*{{{*/ //***// These are the two parameters which are usually explore in fitting in this model const float global_coupling = params(1); const float global_speed = params(0);/*}}}*/ // derived/*{{{*/ const float rec_n = 1.0f / n_node; //***// The speed affects the delay and speed_value is a parameter which is usually explored in fitting *** const float rec_speed_dt = 1.0f / global_speed / (dt); //***// This is a parameter specific to the Kuramoto model const float omega = 60.0 * 2.0 * M_PI_F / 1e3; //***// This is a parameter for the stochastic integration step, you can leave this constant for the moment const float sig = sqrt(dt) * sqrt(2.0 * 1e-5);/*}}}*/ //-->noise sigma value curandState s; curand_init(id * (blockDim.x * gridDim.x * gridDim.y), 0, 0, &s); //***// This is only initialization of the observable for (unsigned int i_node = 0; i_node < n_node; i_node++) tavg(i_node) = 0.0f; //***// This is the loop over time, should stay always the same for (unsigned int t = i_step; t < (i_step + n_step); t++) { //***// This is the loop over nodes, which also should stay the same for (unsigned int i_node = threadIdx.y; i_node < n_node; i_node+=blockDim.y) { //***// We here gather the current state of the node float theta_i = state(t % NH, i_node); //***// This variable is used to traverse the weights and lengths matrix, which is really just a vector. It is just a displacement. unsigned int i_n = i_node * n_node; float sum = 0.0f; //***// For all nodes that are not the current node (i_node) sum the coupling for (unsigned int j_node = 0; j_node < n_node; j_node++) { //***// Get the weight of the coupling between node i and node j float wij = weights[i_n + j_node]; // nb. not coalesced if (wij == 0.0) continue; //***// Get the delay between node i and node j unsigned int dij = lengths[i_n + j_node] * rec_speed_dt; //***// Get the state of node j which is delayed by dij float theta_j = state((t - dij + NH) % NH, j_node); //***// Sum it all together using the coupling function. This is a kuramoto coupling so: a * sin(pre_syn - post_syn) coupling_value += wij * sin(theta_j - theta_i); } // j_node //***// This is actually the integration step and the update in the state of the node theta_i += dt * (omega + global_coupling * rec_n * coupling_value); //***// We add some noise if noise is selected theta_i += sig * curand_normal2(&s).x; //***// Wrap it within the limits of the model (0-2pi) theta_i = wrap_2_pi_(theta_i); //***// Update the state state((t + 1) % NH, i_node) = theta_i; //***// Update the observable tavg(i_node) = sin(theta_i); // sync across warps executing nodes for single sim, before going on to next time step __syncthreads(); } // for i_node } // for t // cleanup macros/*{{{*/ #undef params #undef state #undef tavg/*}}}*/ } // kernel integrate
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef itkPromoteType_h #define itkPromoteType_h // Simplification of boost::common_type namespace itk { namespace details { template <int N, typename TA, typename TB> struct SizeToType; template <int N> struct Identity { typedef char Type[N]; }; #define ASSOC(N, Typed)\ template <typename TA, typename TB> struct SizeToType<N,TA,TB> { typedef Typed Type; }; ASSOC(1, TA); ASSOC(2, TB); ASSOC(3, short); ASSOC(4, unsigned short); ASSOC(5, int); ASSOC(6, unsigned int); ASSOC(7, long); ASSOC(8, unsigned long); ASSOC(9, long long); ASSOC(10, unsigned long long); ASSOC(11, float); ASSOC(12, double); ASSOC(13, long double); #undef ASSOC } // details namespace template <typename TA, typename TB> struct PromoteType { static TA a; static TB b; // Aimed at supporting overloads template <typename T> static details::Identity<1>::Type& check(typename details::SizeToType<1, TA, TB>::Type, T); template <typename T> static details::Identity<2>::Type& check(typename details::SizeToType<2, TA, TB>::Type, T); // Common numeric types static details::Identity<3 >::Type& check(typename details::SizeToType<3, TA, TB>::Type, int); static details::Identity<4 >::Type& check(typename details::SizeToType<4, TA, TB>::Type, int); static details::Identity<5 >::Type& check(typename details::SizeToType<5, TA, TB>::Type, int); static details::Identity<6 >::Type& check(typename details::SizeToType<6, TA, TB>::Type, int); static details::Identity<7 >::Type& check(typename details::SizeToType<7, TA, TB>::Type, int); static details::Identity<8 >::Type& check(typename details::SizeToType<8, TA, TB>::Type, int); static details::Identity<9 >::Type& check(typename details::SizeToType<9, TA, TB>::Type, int); static details::Identity<10>::Type& check(typename details::SizeToType<10, TA, TB>::Type, int); static details::Identity<11>::Type& check(typename details::SizeToType<11, TA, TB>::Type, int); static details::Identity<12>::Type& check(typename details::SizeToType<12, TA, TB>::Type, int); static details::Identity<13>::Type& check(typename details::SizeToType<13, TA, TB>::Type, int); public: typedef typename details::SizeToType<sizeof check(a+b, 0), TA, TB>::Type Type; }; } // itk namespace #if 0 #include <boost/mpl/assert.hpp> #include <boost/type_traits/is_same.hpp> BOOST_MPL_ASSERT((boost::is_same<itk::PromoteType<int,int> ::Type, int>)); BOOST_MPL_ASSERT((boost::is_same<itk::PromoteType<short,int> ::Type, int>)); BOOST_MPL_ASSERT((boost::is_same<itk::PromoteType<double,int> ::Type, double>)); BOOST_MPL_ASSERT((boost::is_same<itk::PromoteType<float,int> ::Type, float>)); BOOST_MPL_ASSERT((boost::is_same<itk::PromoteType<long,int> ::Type, long>)); BOOST_MPL_ASSERT((boost::is_same<itk::PromoteType<long,long double>::Type, long double>)); #endif #endif // itkPromoteType_h
// Copyright 2009-2017 Brad Sokol // // 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. // // MainViewController.h // FieldTools // // Created by Brad on 2008/11/29. // #import <UIKit/UIKit.h> #import "FlipsideViewController.h" #import "SubjectDistanceSliderPolicy.h" @class DistanceFormatter; @class ResultView; @protocol AnalyticsPolicy; @interface MainViewController : UIViewController <FlipsideViewControllerDelegate, UIActionSheetDelegate> { IBOutlet UIButton *cameraAndLensDescription; IBOutlet UIButton *infoButton; IBOutlet UILabel* apertureLabel; IBOutlet UISlider* apertureSlider; IBOutlet UILabel* apertureText; IBOutlet UILabel* apertureMinimum; IBOutlet UILabel* apertureMaximum; IBOutlet UISegmentedControl* distanceType; IBOutlet UISlider* focalLengthSlider; IBOutlet UILabel* focalLengthText; IBOutlet UILabel* focalLengthMinimum; IBOutlet UILabel* focalLengthMaximum; __weak IBOutlet NSLayoutConstraint*apertureToFocalLengthConstraint; IBOutlet UISlider* subjectDistanceSlider; IBOutlet UILabel* subjectDistanceLabel; IBOutlet UILabel* subjectDistanceText; IBOutlet UILabel* subjectDistanceMinimum; IBOutlet UILabel* subjectDistanceMaximum; IBOutlet UIButton* subjectDistanceRangeText; IBOutlet ResultView* resultView; DistanceFormatter* distanceFormatter; NSInteger apertureIndex; float circleOfLeastConfusion; float focalLength; float subjectDistance; NSMutableArray* apertures; SubjectDistanceSliderPolicy* subjectDistanceSliderPolicy; } - (IBAction)subjectDistanceRangeTextWasTouched:(id)sender; - (IBAction)apertureDidChange:(id)sender; - (IBAction)distanceTypeDidChange:(id)sender; - (IBAction)focalLengthDidChange:(id)sender; - (IBAction)subjectDistanceDidChange:(id)sender; - (float)aperture; - (IBAction)toggleView; @property (nonatomic, strong) UIButton* cameraAndLensDescription; @property (nonatomic, strong) UIButton *infoButton; @property(assign) float circleOfLeastConfusion; @property(assign) float focalLength; @property(assign) float subjectDistance; @property(nonatomic, strong) id<AnalyticsPolicy> analyticsPolicy; @end
#include <stdio.h> #include <stdlib.h> #include <stdarg.h> int __attribute__((naked)) sub(int a, int b) { __asm__("sub r0, r0, r1 \n" "bx lr \n"); } int add(int a, int b) { return a + b; } int sum(int count, ...) { int ret = 0; va_list args; va_start(args, count); while (count--) { int e = va_arg(args, int); ret = add(ret, e); } va_end(args); return ret; } int main(int argc, char * argv[]) { printf("%d\n", sum(5, 1, 2, 3, 4, 5)); }
#ifdef __cplusplus extern "C" { #endif #include <inttypes.h> #include <libxml.h> #include <libxml/relaxng.h> #include <libxml/xmlerror.h> #include <stdlib.h> #include <libhfuzz/libhfuzz.h> FILE* null_file = NULL; int LLVMFuzzerInitialize(int* argc, char*** argv) { null_file = fopen("/dev/null", "w"); return 0; } int LLVMFuzzerTestOneInput(const uint8_t* buf, size_t len) { xmlDocPtr p = xmlReadMemory((const char*)buf, len, "http://www.google.com", "UTF-8", XML_PARSE_RECOVER | XML_PARSE_NONET); if (!p) { return 0; } xmlDocFormatDump(null_file, p, 1); xmlFreeDoc(p); return 0; } #ifdef __cplusplus } #endif
/* * OeScript http://www.oescript.net * Copyright 2012 Ed Sweeney, all rights reserved. */ #ifdef __cplusplus extern "C" { #endif #ifndef OENETCONN_H #define OENETCONN_H /** * API for implementing reading and writing with the async OeNet * API */ #include "config.h" #include "oec_values.h" #define T OeNetConn struct netconn_T; typedef void OENETCONN_free_conn_obj(void *); typedef int OENETCONN_get_pos (struct netconn_T*, char *, size_t); typedef size_t OENETCONN_available (struct netconn_T*); typedef size_t OENETCONN_read (struct netconn_T*, void *, size_t); typedef int OENETCONN_write (struct netconn_T*, char *, size_t); typedef void *OENETCONN_peek (struct netconn_T*, size_t, size_t); typedef void OENETCONN_clear_timeout(void *); struct netconn_T { OENETCONN_free_conn_obj *free_conn_obj_fun; OENETCONN_get_pos *get_pos_fun; OENETCONN_available *available_fun; OENETCONN_read *read_fun; OENETCONN_write *write_fun; OENETCONN_peek *peek_fun; OENETCONN_clear_timeout *clear_timeout_fun; void *conn_obj; void *timeout; }; typedef struct netconn_T *T; extern T OeNetConn_new(OENETCONN_free_conn_obj *free_conn_obj_fun, OENETCONN_get_pos *get_pos_fun, OENETCONN_available *available_fun, OENETCONN_read *read_fun, OENETCONN_write *write_fun, OENETCONN_peek *peek_fun, OENETCONN_clear_timeout *clear_timeout_fun); extern void OeNetConn_free( T* ); //impl package internal apis (do not use) //extern void oenetconn_set_fd( T, int ); //extern int oenetconn_get_fd( T ); extern void oenetconn_set_conn_obj( T, void * ); extern void *oenetconn_get_conn_obj( T ); extern void oenetconn_set_timeout(T, void *); extern void *oenetconn_get_timeout(T); extern void OeNetConn_free_conn_obj(T); //the user's network bytes api extern void *OeNetConn_peek (T, size_t, size_t ); extern int OeNetConn_get_pos (T, char *, size_t ); extern size_t OeNetConn_read (T, void *, size_t ); extern int OeNetConn_write (T, char *, size_t ); extern size_t OeNetConn_available(T ); extern void OeNetConn_clear_timeout(T); #undef T #endif #ifdef __cplusplus } #endif
// // YR_PersonalPageViewController.h // Artand // // Created by dllo on 16/9/9. // Copyright © 2016年 kaleidoscope. All rights reserved. // #import <UIKit/UIKit.h> @interface YR_PersonalPageViewController : UIViewController @property (nonatomic, copy) NSString *uid; @end
/* libparted - a library for manipulating disk partitions Copyright (C) 2000, 2003-2005, 2007, 2009-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Author : Guillaume Knispel <k_guillaume@libertysurf.fr> Report bug to <bug-parted@gnu.org> */ #include <config.h> #include <parted/parted.h> #include <parted/endian.h> #include <parted/debug.h> #include <stdint.h> #if ENABLE_NLS # include <libintl.h> # define _(String) dgettext (PACKAGE, String) #else # define _(String) (String) #endif /* ENABLE_NLS */ #include "hfs.h" #include "probe.h" uint8_t* hfs_block = NULL; uint8_t* hfsp_block = NULL; unsigned hfs_block_count; unsigned hfsp_block_count; #define HFS_BLOCK_SIZES ((int[2]){512, 0}) #define HFSP_BLOCK_SIZES ((int[2]){512, 0}) #define HFSX_BLOCK_SIZES ((int[2]){512, 0}) static PedFileSystemOps hfs_ops = { probe: hfs_probe, }; static PedFileSystemOps hfsplus_ops = { probe: hfsplus_probe, }; static PedFileSystemOps hfsx_ops = { probe: hfsx_probe, }; static PedFileSystemType hfs_type = { next: NULL, ops: &hfs_ops, name: "hfs", block_sizes: HFS_BLOCK_SIZES }; static PedFileSystemType hfsplus_type = { next: NULL, ops: &hfsplus_ops, name: "hfs+", block_sizes: HFSP_BLOCK_SIZES }; static PedFileSystemType hfsx_type = { next: NULL, ops: &hfsx_ops, name: "hfsx", block_sizes: HFSX_BLOCK_SIZES }; void ped_file_system_hfs_init () { ped_file_system_type_register (&hfs_type); ped_file_system_type_register (&hfsplus_type); ped_file_system_type_register (&hfsx_type); } void ped_file_system_hfs_done () { ped_file_system_type_unregister (&hfs_type); ped_file_system_type_unregister (&hfsplus_type); ped_file_system_type_unregister (&hfsx_type); }