text
stringlengths
4
6.14k
//##################################################################### // Class Listen //##################################################################### #pragma once #include <geode/value/Value.h> #include <geode/value/Action.h> #include <geode/utility/function.h> namespace geode { class Listen : public Object, public Action { public: GEODE_DECLARE_TYPE(GEODE_CORE_EXPORT) typedef Object Base; private: Ref<const ValueBase> value; function<void()> f; GEODE_CORE_EXPORT Listen(const ValueBase& value, const function<void()>& f); public: ~Listen(); void input_changed() const; }; class BatchListen : public Object, public Action { public: GEODE_DECLARE_TYPE(GEODE_CORE_EXPORT) typedef Object Base; private: vector<Ref<const ValueBase>> values; function<void()> f; GEODE_CORE_EXPORT BatchListen(const vector<Ref<const ValueBase>>& values, const function<void()>& f); public: ~BatchListen(); void input_changed() const; }; GEODE_CORE_EXPORT Ref<Listen> listen(const ValueBase& value, const function<void()>& f); GEODE_CORE_EXPORT Ref<BatchListen> batch_listen(const vector<Ref<const ValueBase>>& values, const function<void()>& f); }
/* Copyright (c) by respective owners including Yahoo!, Microsoft, and individual contributors. All rights reserved. Released under a BSD license as described in the file LICENSE. */ #pragma once namespace PRINT { LEARNER::learner* setup(vw& all); }
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= #ifndef CHMATERIAL_H #define CHMATERIAL_H #include <string> #include <vector> #include "chrono/assets/ChAsset.h" #include "chrono/assets/ChColor.h" #include "chrono/serialization/ChArchive.h" namespace chrono { enum ChMaterialType { CH_MATERIAL_DIFFUSE, CH_MATERIAL_PHONG, CH_MATERIAL_CONDUCTOR, CH_MATERIAL_PLASTIC }; CH_ENUM_MAPPER_BEGIN(ChMaterialType); CH_ENUM_VAL(CH_MATERIAL_DIFFUSE); CH_ENUM_VAL(CH_MATERIAL_PHONG); CH_ENUM_VAL(CH_MATERIAL_CONDUCTOR); CH_ENUM_VAL(CH_MATERIAL_PLASTIC); CH_ENUM_MAPPER_END(ChMaterialType); struct material_option { std::string type, parameter, value; // SERIALIZATION virtual void ArchiveOUT(ChArchiveOut& marchive) { marchive.VersionWrite<material_option>(); // serialize all member data: marchive << CHNVP(type); marchive << CHNVP(parameter); marchive << CHNVP(value); } /// Method to allow de serialization of transient data from archives. virtual void ArchiveIN(ChArchiveIn& marchive) { int version = marchive.VersionRead<material_option>(); // deserialize all member data: marchive >> CHNVP(type); marchive >> CHNVP(parameter); marchive >> CHNVP(value); } }; CH_CLASS_VERSION(ChMaterialOption,0) class ChApi ChMaterial { public: ChMaterial(); ~ChMaterial(); bool IsVisible() const { return visible; } void SetVisible(bool mv) { visible = mv; } // Get the color of the surface. // This information could be used by visualization postprocessing. const ChColor& GetColor() const { return color; } // Set the color of the surface. // This information could be used by visualization postprocessing. void SetColor(const ChColor& mc) { color = mc; } // Get the fading amount, 0..1. // If =0, no transparency of surface, it =1 surface is completely transparent. float GetFading() const { return fading; } // Set the fading amount, 0..1. // If =0, no transparency of surface, it =1 surface is completely transparent. void SetFading(const float mc) { fading = mc; } void SetType(const ChMaterialType type) { material_type = type; } void SetOption(const std::string& type, const std::string& parameter, const std::string& value) { material_option temp; temp.type = type; temp.parameter = parameter; temp.value = value; options.push_back(temp); } ChColor color; // color of material float fading; // transparency of material ChMaterialType material_type; std::vector<material_option> options; bool visible; // // SERIALIZATION // virtual void ArchiveOUT(ChArchiveOut& marchive) { // version number marchive.VersionWrite<ChMaterial>(); // serialize all member data: marchive << CHNVP(color); marchive << CHNVP(fading); ChMaterialType_mapper mmapper; marchive << CHNVP(mmapper(material_type),"material_type"); marchive << CHNVP(options); marchive << CHNVP(visible); } /// Method to allow de serialization of transient data from archives. virtual void ArchiveIN(ChArchiveIn& marchive) { // version number int version = marchive.VersionRead<ChMaterial>(); // stream in all member data: marchive >> CHNVP(color); marchive >> CHNVP(fading); ChMaterialType_mapper mmapper; marchive >> CHNVP(mmapper(material_type),"material_type"); marchive >> CHNVP(options); marchive >> CHNVP(visible); } }; CH_CLASS_VERSION(ChMaterial,0) } // end namespace chrono #endif
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_COMMON_ITUNES_XML_UTILS_H_ #define CHROME_COMMON_ITUNES_XML_UTILS_H_ #include <string> class XmlReader; namespace itunes { // Like XmlReader::SkipToElement, but will advance to the next open tag if the // cursor is on a close tag. bool SkipToNextElement(XmlReader* reader); // Traverse |reader| looking for a node named |name| at the current depth // of |reader|. bool SeekToNodeAtCurrentDepth(XmlReader* reader, const std::string& name); // Search within a "dict" node for |key|. The cursor must be on the starting // "dict" node when entering this function. bool SeekInDict(XmlReader* reader, const std::string& key); } // namespace itunes #endif // CHROME_COMMON_ITUNES_XML_UTILS_H_
/* * pthread_mutex_unlock.c * * Description: * This translation unit implements mutual exclusion (mutex) primitives. * * -------------------------------------------------------------------------- * * Pthreads-win32 - POSIX Threads Library for Win32 * Copyright(C) 1998 John E. Bossom * Copyright(C) 1999,2005 Pthreads-win32 contributors * * Contact Email: rpj@callisto.canberra.edu.au * * The current list of contributors is contained * in the file CONTRIBUTORS included with the source * code distribution. The list can also be seen at the * following World Wide Web location: * http://sources.redhat.com/pthreads-win32/contributors.html * * 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 in the file COPYING.LIB; * if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include "pthread.h" #include "implement.h" int pthread_mutex_unlock (pthread_mutex_t * mutex) { int result = 0; int kind; pthread_mutex_t mx; /* * Let the system deal with invalid pointers. */ mx = *mutex; if (mx == NULL) { return EINVAL; } /* * If the thread calling us holds the mutex then there is no * race condition. If another thread holds the * lock then we shouldn't be in here. */ if (mx < PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) { kind = mx->kind; if (kind >= 0) { if (kind == PTHREAD_MUTEX_NORMAL) { LONG idx; idx = (LONG) PTW32_INTERLOCKED_EXCHANGE_LONG ((PTW32_INTERLOCKED_LONGPTR)&mx->lock_idx, (PTW32_INTERLOCKED_LONG)0); if (idx != 0) { if (idx < 0) { /* * Someone may be waiting on that mutex. */ if (SetEvent (mx->event) == 0) { result = EINVAL; } } } } else { if (pthread_equal (mx->ownerThread, pthread_self())) { if (kind != PTHREAD_MUTEX_RECURSIVE || 0 == --mx->recursive_count) { mx->ownerThread.p = NULL; if ((LONG) PTW32_INTERLOCKED_EXCHANGE_LONG ((PTW32_INTERLOCKED_LONGPTR)&mx->lock_idx, (PTW32_INTERLOCKED_LONG)0) < 0L) { /* Someone may be waiting on that mutex */ if (SetEvent (mx->event) == 0) { result = EINVAL; } } } } else { result = EPERM; } } } else { /* Robust types */ pthread_t self = pthread_self(); kind = -kind - 1; /* Convert to non-robust range */ /* * The thread must own the lock regardless of type if the mutex * is robust. */ if (pthread_equal (mx->ownerThread, self)) { PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG((PTW32_INTERLOCKED_LONGPTR) &mx->robustNode->stateInconsistent, (PTW32_INTERLOCKED_LONG)PTW32_ROBUST_NOTRECOVERABLE, (PTW32_INTERLOCKED_LONG)PTW32_ROBUST_INCONSISTENT); if (PTHREAD_MUTEX_NORMAL == kind) { ptw32_robust_mutex_remove(mutex, NULL); if ((LONG) PTW32_INTERLOCKED_EXCHANGE_LONG((PTW32_INTERLOCKED_LONGPTR) &mx->lock_idx, (PTW32_INTERLOCKED_LONG) 0) < 0) { /* * Someone may be waiting on that mutex. */ if (SetEvent (mx->event) == 0) { result = EINVAL; } } } else { if (kind != PTHREAD_MUTEX_RECURSIVE || 0 == --mx->recursive_count) { ptw32_robust_mutex_remove(mutex, NULL); if ((LONG) PTW32_INTERLOCKED_EXCHANGE_LONG((PTW32_INTERLOCKED_LONGPTR) &mx->lock_idx, (PTW32_INTERLOCKED_LONG) 0) < 0) { /* * Someone may be waiting on that mutex. */ if (SetEvent (mx->event) == 0) { result = EINVAL; } } } } } else { result = EPERM; } } } else if (mx != PTHREAD_MUTEX_INITIALIZER) { result = EINVAL; } return (result); }
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_ #include <string> struct CrxComponent; class GURL; namespace base { class FilePath; } namespace net { class URLFetcher; class URLFetcherDelegate; class URLRequestContextGetter; } namespace component_updater { struct CrxUpdateItem; // An update protocol request starts with a common preamble which includes // version and platform information for Chrome and the operating system, // followed by a request body, which is the actual payload of the request. // For example: // // <?xml version="1.0" encoding="UTF-8"?> // <request protocol="3.0" version="chrome-32.0.1.0" prodversion="32.0.1.0" // requestid="{7383396D-B4DD-46E1-9104-AAC6B918E792}" // updaterchannel="canary" arch="x86" nacl_arch="x86-64" // ADDITIONAL ATTRIBUTES> // <os platform="win" version="6.1" arch="x86"/> // ... REQUEST BODY ... // </request> // Builds a protocol request string by creating the outer envelope for // the request and including the request body specified as a parameter. // If specified, |additional_attributes| are appended as attributes of the // request element. The additional attributes have to be well-formed for // insertion in the request element. std::string BuildProtocolRequest(const std::string& request_body, const std::string& additional_attributes); // Sends a protocol request to the the service endpoint specified by |url|. // The body of the request is provided by |protocol_request| and it is // expected to contain XML data. The caller owns the returned object. net::URLFetcher* SendProtocolRequest( const GURL& url, const std::string& protocol_request, net::URLFetcherDelegate* url_fetcher_delegate, net::URLRequestContextGetter* url_request_context_getter); // Returns true if the url request of |fetcher| was succesful. bool FetchSuccess(const net::URLFetcher& fetcher); // Returns the error code which occured during the fetch. The function returns 0 // if the fetch was successful. If errors happen, the function could return a // network error, an http response code, or the status of the fetch, if the // fetch is pending or canceled. int GetFetchError(const net::URLFetcher& fetcher); // Returns true if the |update_item| contains a valid differential update url. bool HasDiffUpdate(const CrxUpdateItem* update_item); // Returns true if the |status_code| represents a server error 5xx. bool IsHttpServerError(int status_code); // Deletes the file and its directory, if the directory is empty. If the // parent directory is not empty, the function ignores deleting the directory. // Returns true if the file and the empty directory are deleted. bool DeleteFileAndEmptyParentDirectory(const base::FilePath& filepath); // Returns the component id of the |component|. The component id is in a // format similar with the format of an extension id. std::string GetCrxComponentID(const CrxComponent& component); } // namespace component_updater #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef EXTENSIONS_RENDERER_RENDER_FRAME_OBSERVER_NATIVES_H_ #define EXTENSIONS_RENDERER_RENDER_FRAME_OBSERVER_NATIVES_H_ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "extensions/renderer/object_backed_native_handler.h" namespace extensions { class ScriptContext; // Native functions for JS to run callbacks upon RenderFrame events. class RenderFrameObserverNatives : public ObjectBackedNativeHandler { public: explicit RenderFrameObserverNatives(ScriptContext* context); ~RenderFrameObserverNatives() override; private: void Invalidate() override; // Runs a callback upon creation of new document element inside a render frame // (document.documentElement). void OnDocumentElementCreated( const v8::FunctionCallbackInfo<v8::Value>& args); void InvokeCallback(v8::Global<v8::Function> callback, bool succeeded, int frame_id); base::WeakPtrFactory<RenderFrameObserverNatives> weak_ptr_factory_; void OnDestruct( const v8::FunctionCallbackInfo<v8::Value>& args); DISALLOW_COPY_AND_ASSIGN(RenderFrameObserverNatives); }; } // namespace extensions #endif // EXTENSIONS_RENDERER_RENDER_FRAME_OBSERVER_NATIVES_H_
#include <cgreen/cgreen.h> #include <cgreen/mocks.h> #include "stream.h" Describe(Formatter); BeforeEach(Formatter) {} AfterEach(Formatter) {} static int reader(void *stream) { return (int)mock(stream); } static void writer(void *stream, char *paragraph) { mock(stream, paragraph); } Ensure(Formatter, makes_one_letter_paragraph_from_one_character_input) { expect(reader, will_return('a')); always_expect(reader, will_return(EOF)); expect(writer, when(paragraph, is_equal_to_string("a"))); by_paragraph(&reader, NULL, &writer, NULL); } Ensure(Formatter, makes_one_paragraph_if_no_line_endings) { expect(reader, will_return('a')); expect(reader, will_return(' ')); expect(reader, will_return('b')); expect(reader, will_return(' ')); expect(reader, will_return('c')); always_expect(reader, will_return(EOF)); expect(writer, when(paragraph, is_equal_to_string("a b c"))); by_paragraph(&reader, NULL, &writer, NULL); } Ensure(Formatter, generates_separate_paragraphs_for_line_endings) { expect(reader, will_return('a')); expect(reader, will_return('\n')); expect(reader, will_return('b')); expect(reader, will_return('\n')); expect(reader, will_return('c')); always_expect(reader, will_return(EOF)); expect(writer, when(paragraph, is_equal_to_string("a"))); expect(writer, when(paragraph, is_equal_to_string("b"))); expect(writer, when(paragraph, is_equal_to_string("c"))); by_paragraph(&reader, NULL, &writer, NULL); } Ensure(Formatter, pairs_the_functions_with_the_resources) { expect(reader, when(stream, is_equal_to(1)), will_return('a')); always_expect(reader, when(stream, is_equal_to(1)), will_return(EOF)); expect(writer, when(stream, is_equal_to(2))); by_paragraph(&reader, (void *)1, &writer, (void *)2); }
// This file was generated based on 'C:\ProgramData\Uno\Packages\Fuse.Triggers\0.19.3\$.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.Triggers.WhileTrigger.h> namespace g{namespace Fuse{namespace Triggers{struct WhilePlaying;}}} namespace g{namespace Fuse{struct Node;}} namespace g{namespace Fuse{struct PropertyHandle;}} namespace g{ namespace Fuse{ namespace Triggers{ // public sealed class WhilePlaying :1454 // { ::g::Fuse::Triggers::Trigger_type* WhilePlaying_typeof(); void WhilePlaying__ctor_3_fn(WhilePlaying* __this); void WhilePlaying__IsPlaying_fn(::g::Fuse::Node* n, bool* __retval); void WhilePlaying__New1_fn(WhilePlaying** __retval); void WhilePlaying__OnRooted_fn(WhilePlaying* __this, ::g::Fuse::Node* parentNode); void WhilePlaying__SetState_fn(::g::Fuse::Node* n, bool* playing); struct WhilePlaying : ::g::Fuse::Triggers::WhileTrigger { static uSStrong< ::g::Fuse::PropertyHandle*> _whilePlayingProp_; static uSStrong< ::g::Fuse::PropertyHandle*>& _whilePlayingProp() { return WhilePlaying_typeof()->Init(), _whilePlayingProp_; } void ctor_3(); static bool IsPlaying(::g::Fuse::Node* n); static WhilePlaying* New1(); static void SetState(::g::Fuse::Node* n, bool playing); }; // } }}} // ::g::Fuse::Triggers
#include "F28x_Project.h" #include "Comm.h" void Enable_Comm(void) { Wait_memory_access();// Wait Memory Access to GS0/ GS14 SARAM to CPU02 Reset_remote_IPC();// Reset remote IPC Interrupt to avoid initialization issues RS485_init(); }
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996,2008 Oracle. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: hash.h,v 12.12 2008/01/08 20:58:18 bostic Exp $ */ #ifndef _DB_HASH_H_ #define _DB_HASH_H_ #if defined(__cplusplus) extern "C" { #endif /* Hash internal structure. */ typedef struct hash_t { db_pgno_t meta_pgno; /* Page number of the meta data page. */ u_int32_t h_ffactor; /* Fill factor. */ u_int32_t h_nelem; /* Number of elements. */ /* Hash and compare functions. */ u_int32_t (*h_hash) __P((DB *, const void *, u_int32_t)); int (*h_compare) __P((DB *, const DBT *, const DBT *)); } HASH; /* Cursor structure definitions. */ typedef struct cursor_t { /* struct __dbc_internal */ __DBC_INTERNAL /* Hash private part */ /* Per-thread information */ DB_LOCK hlock; /* Metadata page lock. */ HMETA *hdr; /* Pointer to meta-data page. */ PAGE *split_buf; /* Temporary buffer for splits. */ /* Hash cursor information */ db_pgno_t bucket; /* Bucket we are traversing. */ db_pgno_t lbucket; /* Bucket for which we are locked. */ db_indx_t dup_off; /* Offset within a duplicate set. */ db_indx_t dup_len; /* Length of current duplicate. */ db_indx_t dup_tlen; /* Total length of duplicate entry. */ u_int32_t seek_size; /* Number of bytes we need for add. */ db_pgno_t seek_found_page;/* Page on which we can insert. */ db_indx_t seek_found_indx;/* Insert position for item. */ u_int32_t order; /* Relative order among deleted curs. */ #define H_CONTINUE 0x0001 /* Join--search strictly fwd for data */ #define H_DELETED 0x0002 /* Cursor item is deleted. */ #define H_DUPONLY 0x0004 /* Dups only; do not change key. */ #define H_EXPAND 0x0008 /* Table expanded. */ #define H_ISDUP 0x0010 /* Cursor is within duplicate set. */ #define H_NEXT_NODUP 0x0020 /* Get next non-dup entry. */ #define H_NOMORE 0x0040 /* No more entries in bucket. */ #define H_OK 0x0080 /* Request succeeded. */ u_int32_t flags; } HASH_CURSOR; /* Test string. */ #define CHARKEY "%$sniglet^&" /* Overflow management */ /* * The spares table indicates the page number at which each doubling begins. * From this page number we subtract the number of buckets already allocated * so that we can do a simple addition to calculate the page number here. */ #define BS_TO_PAGE(bucket, spares) \ ((bucket) + (spares)[__db_log2((bucket) + 1)]) #define BUCKET_TO_PAGE(I, B) (BS_TO_PAGE((B), (I)->hdr->spares)) /* Constraints about much data goes on a page. */ #define MINFILL 4 #define ISBIG(I, N) (((N) > ((I)->hdr->dbmeta.pagesize / MINFILL)) ? 1 : 0) /* Shorthands for accessing structure */ #define NDX_INVALID 0xFFFF #define BUCKET_INVALID 0xFFFFFFFF /* On page duplicates are stored as a string of size-data-size triples. */ #define DUP_SIZE(len) ((len) + 2 * sizeof(db_indx_t)) /* Log messages types (these are subtypes within a record type) */ #define PAIR_KEYMASK 0x1 #define PAIR_DATAMASK 0x2 #define PAIR_DUPMASK 0x4 #define PAIR_MASK 0xf #define PAIR_ISKEYBIG(N) (N & PAIR_KEYMASK) #define PAIR_ISDATABIG(N) (N & PAIR_DATAMASK) #define PAIR_ISDATADUP(N) (N & PAIR_DUPMASK) #define OPCODE_OF(N) (N & ~PAIR_MASK) #define PUTPAIR 0x20 #define DELPAIR 0x30 #define PUTOVFL 0x40 #define DELOVFL 0x50 #define HASH_UNUSED1 0x60 #define HASH_UNUSED2 0x70 #define SPLITOLD 0x80 #define SPLITNEW 0x90 #define SORTPAGE 0x100 /* Flags to control behavior of __ham_del_pair */ #define HAM_DEL_NO_CURSOR 0x01 /* Don't do any cursor adjustment */ #define HAM_DEL_NO_RECLAIM 0x02 /* Don't reclaim empty pages */ typedef enum { DB_HAM_CURADJ_DEL = 1, DB_HAM_CURADJ_ADD = 2, DB_HAM_CURADJ_ADDMOD = 3, DB_HAM_CURADJ_DELMOD = 4 } db_ham_curadj; typedef enum { DB_HAM_CHGPG = 1, DB_HAM_DELFIRSTPG = 2, DB_HAM_DELMIDPG = 3, DB_HAM_DELLASTPG = 4, DB_HAM_DUP = 5, DB_HAM_SPLIT = 6 } db_ham_mode; #if defined(__cplusplus) } #endif #include "dbinc_auto/hash_auto.h" #include "dbinc_auto/hash_ext.h" #include "dbinc/db_am.h" #endif /* !_DB_HASH_H_ */
#include <stdio.h> #include "wich.h" #include "gc.h" void f(int x,PVector_ptr v); void f(int x,PVector_ptr v) { gc_begin_func(); gc_end_func(); } int main(int ____c, char *____v[]) { setup_error_handlers(); gc_begin_func(); gc_end_func(); gc(); Heap_Info info = get_heap_info(); if ( info.live!=0 ) fprintf(stderr, "%d objects remain after collection\n", info.live); gc_shutdown(); return 0; }
/* Copyright (C) Dean Camera, 2011. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ #ifndef _DS1307_H_ #define _DS1307_H_ /* Includes: */ #include <avr/io.h> #include <LUFA/Drivers/Peripheral/TWI.h> /* Type Defines: */ typedef struct { uint8_t Hour; uint8_t Minute; uint8_t Second; uint8_t Day; uint8_t Month; uint8_t Year; } TimeDate_t; typedef struct { union { struct { unsigned Sec : 4; unsigned TenSec : 3; unsigned CH : 1; } Fields; uint8_t IntVal; } Byte1; union { struct { unsigned Min : 4; unsigned TenMin : 3; unsigned Reserved : 1; } Fields; uint8_t IntVal; } Byte2; union { struct { unsigned Hour : 4; unsigned TenHour : 2; unsigned TwelveHourMode : 1; unsigned Reserved : 1; } Fields; uint8_t IntVal; } Byte3; union { struct { unsigned DayOfWeek : 3; unsigned Reserved : 5; } Fields; uint8_t IntVal; } Byte4; union { struct { unsigned Day : 4; unsigned TenDay : 2; unsigned Reserved : 2; } Fields; uint8_t IntVal; } Byte5; union { struct { unsigned Month : 4; unsigned TenMonth : 1; unsigned Reserved : 3; } Fields; uint8_t IntVal; } Byte6; union { struct { unsigned Year : 4; unsigned TenYear : 4; } Fields; uint8_t IntVal; } Byte7; } DS1307_DateTimeRegs_t; /* Macros: */ #define DS1307_ADDRESS 0xD0 /* Function Prototypes: */ bool DS1307_SetTimeDate(const TimeDate_t* NewTimeDate); bool DS1307_GetTimeDate(TimeDate_t* const TimeDate); #endif
/* This Software is provided under the Zope Public License (ZPL) Version 2.1. Copyright (c) 2009, 2010 by the mingw-w64 project See the AUTHORS file for the list of contributors to the mingw-w64 project. This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF). Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders. 4. The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders. 5. If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. Disclaimer THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED 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 HOLDERS 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. */ /* Float version of the functions. */ #define _NEW_COMPLEX_FLOAT 1 #include "complex_internal.h" #include "conj.def.h"
#ifndef __dom150Instance_articulated_system_h__ #define __dom150Instance_articulated_system_h__ #include <dae/daeDocument.h> #include <1.5/dom/domTypes.h> #include <1.5/dom/domElements.h> #include <1.5/dom/domKinematics_bind.h> #include <1.5/dom/domKinematics_setparam.h> #include <1.5/dom/domKinematics_newparam.h> #include <1.5/dom/domExtra.h> class DAE; namespace ColladaDOM150 { class domInstance_articulated_system : public daeElement { public: virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_ARTICULATED_SYSTEM; } static daeInt ID() { return 450; } virtual daeInt typeID() const { return ID(); } protected: // Attributes domSid attrSid; xsAnyURI attrUrl; xsToken attrName; protected: // Elements domKinematics_bind_Array elemBind_array; domKinematics_setparam_Array elemSetparam_array; domKinematics_newparam_Array elemNewparam_array; domExtra_Array elemExtra_array; public: //Accessors and Mutators /** * Gets the sid attribute. * @return Returns a domSid of the sid attribute. */ domSid getSid() const { return attrSid; } /** * Sets the sid attribute. * @param atSid The new value for the sid attribute. */ void setSid( domSid atSid ) { *(daeStringRef*)&attrSid = atSid;} /** * Gets the url attribute. * @return Returns a xsAnyURI reference of the url attribute. */ xsAnyURI &getUrl() { return attrUrl; } /** * Gets the url attribute. * @return Returns a constant xsAnyURI reference of the url attribute. */ const xsAnyURI &getUrl() const { return attrUrl; } /** * Sets the url attribute. * @param atUrl The new value for the url attribute. */ void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; } /** * Sets the url attribute. * @param atUrl The new value for the url attribute. */ void setUrl( xsString atUrl ) { attrUrl = atUrl; } /** * Gets the name attribute. * @return Returns a xsToken of the name attribute. */ xsToken getName() const { return attrName; } /** * Sets the name attribute. * @param atName The new value for the name attribute. */ void setName( xsToken atName ) { *(daeStringRef*)&attrName = atName;} /** * Gets the bind element array. * @return Returns a reference to the array of bind elements. */ domKinematics_bind_Array &getBind_array() { return elemBind_array; } /** * Gets the bind element array. * @return Returns a constant reference to the array of bind elements. */ const domKinematics_bind_Array &getBind_array() const { return elemBind_array; } /** * Gets the setparam element array. * @return Returns a reference to the array of setparam elements. */ domKinematics_setparam_Array &getSetparam_array() { return elemSetparam_array; } /** * Gets the setparam element array. * @return Returns a constant reference to the array of setparam elements. */ const domKinematics_setparam_Array &getSetparam_array() const { return elemSetparam_array; } /** * Gets the newparam element array. * @return Returns a reference to the array of newparam elements. */ domKinematics_newparam_Array &getNewparam_array() { return elemNewparam_array; } /** * Gets the newparam element array. * @return Returns a constant reference to the array of newparam elements. */ const domKinematics_newparam_Array &getNewparam_array() const { return elemNewparam_array; } /** * Gets the extra element array. * @return Returns a reference to the array of extra elements. */ domExtra_Array &getExtra_array() { return elemExtra_array; } /** * Gets the extra element array. * @return Returns a constant reference to the array of extra elements. */ const domExtra_Array &getExtra_array() const { return elemExtra_array; } protected: /** * Constructor */ domInstance_articulated_system(DAE& dae) : daeElement(dae), attrSid(), attrUrl(dae, *this), attrName(), elemBind_array(), elemSetparam_array(), elemNewparam_array(), elemExtra_array() {} /** * Destructor */ virtual ~domInstance_articulated_system() {} /** * Overloaded assignment operator */ virtual domInstance_articulated_system &operator=( const domInstance_articulated_system &cpy ) { (void)cpy; return *this; } public: // STATIC METHODS /** * Creates an instance of this class and returns a daeElementRef referencing it. * @return a daeElementRef referencing an instance of this object. */ static DLLSPEC daeElementRef create(DAE& dae); /** * Creates a daeMetaElement object that describes this element in the meta object reflection framework. * If a daeMetaElement already exists it will return that instead of creating a new one. * @return A daeMetaElement describing this COLLADA element. */ static DLLSPEC daeMetaElement* registerElement(DAE& dae); }; } // ColladaDOM150 #endif
#import <Foundation/Foundation.h> #import <StoreKit/StoreKit.h> #import "SEGAnalytics.h" NS_ASSUME_NONNULL_BEGIN @interface SEGStoreKitTracker : NSObject <SKPaymentTransactionObserver, SKProductsRequestDelegate> + (instancetype)trackTransactionsForAnalytics:(SEGAnalytics *)analytics; @end NS_ASSUME_NONNULL_END
// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- Contributing authors: William McDoniel (RWTH Aachen University) Rodrigo Canales (RWTH Aachen University) Markus Hoehnerbach (RWTH Aachen University) W. Michael Brown (Intel) ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS // clang-format off KSpaceStyle(pppm/intel,PPPMIntel); // clang-format on #else #ifndef LMP_PPPMINTEL_H #define LMP_PPPMINTEL_H #include "fix_intel.h" #include "pppm.h" namespace LAMMPS_NS { class PPPMIntel : public PPPM { public: PPPMIntel(class LAMMPS *); ~PPPMIntel() override; void init() override; void compute(int, int) override; double memory_usage() override; void compute_first(int, int); void compute_second(int, int); void pack_buffers(); #ifdef _LMP_INTEL_OFFLOAD int use_base(); #endif protected: FixIntel *fix; int _use_lrt; FFT_SCALAR **perthread_density; FFT_SCALAR *particle_ekx; FFT_SCALAR *particle_eky; FFT_SCALAR *particle_ekz; int _use_table; int rho_points; FFT_SCALAR **rho_lookup; FFT_SCALAR **drho_lookup; FFT_SCALAR half_rho_scale, half_rho_scale_plus; #ifdef _LMP_INTEL_OFFLOAD int _use_base; #endif void allocate() override; template <class flt_t, class acc_t> void test_function(IntelBuffers<flt_t, acc_t> *buffers); void precompute_rho(); template <class flt_t, class acc_t> void particle_map(IntelBuffers<flt_t, acc_t> *buffers); template <class flt_t, class acc_t, int use_table> void make_rho(IntelBuffers<flt_t, acc_t> *buffers); template <class flt_t, class acc_t> void make_rho(IntelBuffers<flt_t, acc_t> *buffers) { if (_use_table == 1) { make_rho<flt_t, acc_t, 1>(buffers); } else { make_rho<flt_t, acc_t, 0>(buffers); } } template <class flt_t, class acc_t, int use_table> void fieldforce_ik(IntelBuffers<flt_t, acc_t> *buffers); template <class flt_t, class acc_t> void fieldforce_ik(IntelBuffers<flt_t, acc_t> *buffers) { if (_use_table == 1) { fieldforce_ik<flt_t, acc_t, 1>(buffers); } else { fieldforce_ik<flt_t, acc_t, 0>(buffers); } } template <class flt_t, class acc_t, int use_table> void fieldforce_ad(IntelBuffers<flt_t, acc_t> *buffers); template <class flt_t, class acc_t> void fieldforce_ad(IntelBuffers<flt_t, acc_t> *buffers) { if (_use_table == 1) { fieldforce_ad<flt_t, acc_t, 1>(buffers); } else { fieldforce_ad<flt_t, acc_t, 0>(buffers); } } FFT_SCALAR ***create3d_offset(FFT_SCALAR ***&, int, int, int, int, int, int, const char *name); }; } // namespace LAMMPS_NS #endif #endif /* ERROR/WARNING messages: E: PPPM order greater than supported by INTEL There is a compile time limit on the maximum order for PPPM in the INTEL package that might be different from LAMMPS */
/* * Copyright (C) 2007 Nokia Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * An utility to delete UBI devices (detach MTD devices from UBI). * * Author: Artem Bityutskiy */ #include <stdio.h> #include <stdint.h> #include <getopt.h> #include <stdlib.h> #include <string.h> #include <libubi.h> #include "common.h" #define PROGRAM_VERSION "1.0" #define PROGRAM_NAME "ubidetach" /* The variables below are set by command line arguments */ struct args { int devn; int mtdn; const char *node; }; static struct args args = { .devn = UBI_DEV_NUM_AUTO, .mtdn = -1, .node = NULL, }; static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION " - a tool to remove UBI devices (detach MTD devices from UBI)"; static const char *optionsstr = "-d, --devn=<UBI device number> UBI device number to delete\n" "-m, --mtdn=<MTD device number> or altrnatively, MTD device number to detach -\n" " this will delete corresponding UBI device\n" "-h, --help print help message\n" "-V, --version print program version"; static const char *usage = "Usage: " PROGRAM_NAME "<UBI control device node file name> [-d <UBI device number>] [-m <MTD device number>]\n" "\t\t[--devn <UBI device number>] [--mtdn=<MTD device number>]\n" "Example 1: " PROGRAM_NAME " /dev/ubi_ctrl -d 2 - delete UBI device 2 (ubi2)\n" "Example 2: " PROGRAM_NAME " /dev/ubi_ctrl -m 0 - detach MTD device 0 (mtd0)"; static const struct option long_options[] = { { .name = "devn", .has_arg = 1, .flag = NULL, .val = 'd' }, { .name = "mtdn", .has_arg = 1, .flag = NULL, .val = 'm' }, { .name = "help", .has_arg = 0, .flag = NULL, .val = 'h' }, { .name = "version", .has_arg = 0, .flag = NULL, .val = 'V' }, { NULL, 0, NULL, 0}, }; static int parse_opt(int argc, char * const argv[]) { while (1) { int key; char *endp; key = getopt_long(argc, argv, "m:d:hV", long_options, NULL); if (key == -1) break; switch (key) { case 'd': args.devn = strtoul(optarg, &endp, 0); if (*endp != '\0' || endp == optarg || args.devn < 0) return errmsg("bad UBI device number: \"%s\"", optarg); break; case 'm': args.mtdn = strtoul(optarg, &endp, 0); if (*endp != '\0' || endp == optarg || args.mtdn < 0) return errmsg("bad MTD device number: \"%s\"", optarg); break; case 'h': fprintf(stderr, "%s\n\n", doc); fprintf(stderr, "%s\n\n", usage); fprintf(stderr, "%s\n", optionsstr); exit(EXIT_SUCCESS); case 'V': fprintf(stderr, "%s\n", PROGRAM_VERSION); exit(EXIT_SUCCESS); case ':': return errmsg("parameter is missing"); default: fprintf(stderr, "Use -h for help\n"); return -1; } } if (optind == argc) return errmsg("UBI control device name was not specified (use -h for help)"); else if (optind != argc - 1) return errmsg("more then one UBI control device specified (use -h for help)"); if (args.mtdn == -1 && args.devn == -1) return errmsg("neither MTD nor UBI devices were specified (use -h for help)"); if (args.mtdn != -1 && args.devn != -1) return errmsg("specify either MTD or UBI device (use -h for help)"); args.node = argv[optind]; return 0; } int main(int argc, char * const argv[]) { int err; libubi_t libubi; struct ubi_info ubi_info; err = parse_opt(argc, argv); if (err) return -1; libubi = libubi_open(); if (!libubi) { if (errno == 0) return errmsg("UBI is not present in the system"); return sys_errmsg("cannot open libubi"); } /* * Make sure the kernel is fresh enough and this feature is supported. */ err = ubi_get_info(libubi, &ubi_info); if (err) { sys_errmsg("cannot get UBI information"); goto out_libubi; } if (ubi_info.ctrl_major == -1) { errmsg("MTD detach/detach feature is not supported by your kernel"); goto out_libubi; } if (args.devn != -1) { err = ubi_remove_dev(libubi, args.node, args.devn); if (err) { sys_errmsg("cannot remove ubi%d", args.devn); goto out_libubi; } } else { err = ubi_detach_mtd(libubi, args.node, args.mtdn); if (err) { sys_errmsg("cannot detach mtd%d", args.mtdn); goto out_libubi; } } libubi_close(libubi); return 0; out_libubi: libubi_close(libubi); return -1; }
/**************************************************************************** * * * GNAT COMPILER COMPONENTS * * * * R T F I N A L * * * * C Implementation File * * * * Copyright (C) 2014-2020, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * * ware Foundation; either version 3, or (at your option) any later ver- * * sion. GNAT is distributed in the hope that it will be useful, but WITH- * * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * * or FITNESS FOR A PARTICULAR PURPOSE. * * * * As a special exception under Section 7 of GPL version 3, you are granted * * additional permissions described in the GCC Runtime Library Exception, * * version 3.1, as published by the Free Software Foundation. * * * * You should have received a copy of the GNU General Public License and * * a copy of the GCC Runtime Library Exception along with this program; * * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * * <http://www.gnu.org/licenses/>. * * * * GNAT was originally developed by the GNAT team at New York University. * * Extensive contributions were provided by Ada Core Technologies Inc. * * * ****************************************************************************/ #ifdef __cplusplus extern "C" { #endif extern void __gnat_runtime_finalize (void); /* This routine is called at the extreme end of execution of an Ada program (the call is generated by the binder). The standard routine does nothing at all, the intention is that this be replaced by system specific code where finalization is required. Note that __gnat_runtime_finalize() is called in adafinal() */ extern int __gnat_rt_init_count; /* see initialize.c */ #if defined (__MINGW32__) #include "mingw32.h" #include <windows.h> extern CRITICAL_SECTION ProcListCS; extern HANDLE ProcListEvt; void __gnat_runtime_finalize (void) { /* decrement the reference counter */ __gnat_rt_init_count--; /* if still some referenced return now */ if (__gnat_rt_init_count > 0) return; /* delete critical section and event handle used for the processes chain list */ DeleteCriticalSection(&ProcListCS); CloseHandle (ProcListEvt); } #else void __gnat_runtime_finalize (void) { /* decrement the reference counter */ __gnat_rt_init_count--; /* if still some referenced return now */ if (__gnat_rt_init_count > 0) return; } #endif #ifdef __cplusplus } #endif
#ifndef __AML_AUDIO_HW_H__ #define __AML_AUDIO_HW_H__ #include <mach/power_gate.h> #if MESON_CPU_TYPE < MESON_CPU_TYPE_MESON6 #define AUDIO_CLK_GATE_ON(a) #define AUDIO_CLK_GATE_OFF(a) #else #define AUDIO_CLK_GATE_ON(a) CLK_GATE_ON(a) #define AUDIO_CLK_GATE_OFF(a) CLK_GATE_OFF(a) #endif typedef struct { unsigned short pll; unsigned short mux; unsigned short devisor; } _aiu_clk_setting_t; typedef struct { unsigned short chstat0_l; unsigned short chstat1_l; unsigned short chstat0_r; unsigned short chstat1_r; } _aiu_958_channel_status_t; typedef struct { /* audio clock */ unsigned short clock; /* analog output */ unsigned short i2s_mode; unsigned short i2s_dac_mode; unsigned short i2s_preemphsis; /* digital output */ unsigned short i958_buf_start_addr; unsigned short i958_buf_blksize; unsigned short i958_int_flag; unsigned short i958_mode; unsigned short i958_sync_mode; unsigned short i958_preemphsis; unsigned short i958_copyright; unsigned short bpf; unsigned short brst; unsigned short length; unsigned short paddsize; _aiu_958_channel_status_t chan_status; } audio_output_config_t; typedef struct { unsigned short int_flag; unsigned short bpf; unsigned short brst; unsigned short length; unsigned short paddsize; _aiu_958_channel_status_t *chan_stat; } _aiu_958_raw_setting_t; enum { I2SIN_MASTER_MODE = 0, I2SIN_SLAVE_MODE = 1<<0, SPDIFIN_MODE = 1<<1, }; enum { AML_AUDIO_NA = 0, AML_AUDIO_SPDIFIN = 1<<0, AML_AUDIO_SPDIFOUT = 1<<1, AML_AUDIO_I2SIN = 1<<2, AML_AUDIO_I2SOUT = 1<<3, AML_AUDIO_PCMIN = 1<<4, AML_AUDIO_PCMOUT = 1<<5, }; #define AUDIO_CLK_256FS 0 #define AUDIO_CLK_384FS 1 #define AUDIO_CLK_FREQ_192 0 #define AUDIO_CLK_FREQ_1764 1 #define AUDIO_CLK_FREQ_96 2 #define AUDIO_CLK_FREQ_882 3 #define AUDIO_CLK_FREQ_48 4 #define AUDIO_CLK_FREQ_441 5 #define AUDIO_CLK_FREQ_32 6 #define AUDIO_CLK_FREQ_8 7 #define AUDIO_CLK_FREQ_11 8 #define AUDIO_CLK_FREQ_12 9 #define AUDIO_CLK_FREQ_16 10 #define AUDIO_CLK_FREQ_22 11 #define AUDIO_CLK_FREQ_24 12 #define AIU_958_MODE_RAW 0 #define AIU_958_MODE_PCM16 1 #define AIU_958_MODE_PCM24 2 #define AIU_958_MODE_PCM32 3 #define AIU_958_MODE_PCM_RAW 4 #define AIU_I2S_MODE_PCM16 0 #define AIU_I2S_MODE_PCM24 2 #define AIU_I2S_MODE_PCM32 3 #define AUDIO_ALGOUT_DAC_FORMAT_DSP 0 #define AUDIO_ALGOUT_DAC_FORMAT_LEFT_JUSTIFY 1 extern unsigned ENABLE_IEC958; extern unsigned IEC958_MODE; extern unsigned I2S_MODE; void audio_set_aiubuf(u32 addr, u32 size, unsigned int channel); void audio_set_958outbuf(u32 addr, u32 size, int channels, int flag); void audio_in_i2s_set_buf(u32 addr, u32 size,u32 i2s_mode, u32 i2s_sync); void audio_in_spdif_set_buf(u32 addr, u32 size); void audio_in_i2s_enable(int flag); void audio_in_spdif_enable(int flag); unsigned int audio_in_i2s_rd_ptr(void); unsigned int audio_in_i2s_wr_ptr(void); unsigned int audio_in_spdif_wr_ptr(void); void audio_set_i2s_mode(u32 mode); void audio_set_i2s_clk(unsigned freq, unsigned fs_config, unsigned mpll); void audio_set_958_clk(unsigned freq, unsigned fs_config); void audio_enable_ouput(int flag); unsigned int read_i2s_rd_ptr(void); void audio_i2s_unmute(void); void audio_i2s_mute(void); void aml_audio_i2s_unmute(void); void aml_audio_i2s_mute(void); void audio_util_set_dac_format(unsigned format); void audio_util_set_dac_i2s_format(unsigned format); void audio_util_set_dac_958_format(unsigned format); void audio_set_958_mode(unsigned mode, _aiu_958_raw_setting_t * set); unsigned int read_i2s_mute_swap_reg(void); void audio_i2s_swap_left_right(unsigned int flag); int if_audio_out_enable(void); int if_audio_in_i2s_enable(void); int if_audio_in_spdif_enable(void); void audio_out_i2s_enable(unsigned flag); void audio_hw_958_enable(unsigned flag); void audio_out_enabled(int flag); void audio_util_set_dac_format(unsigned format); unsigned int audio_hdmi_init_ready(void); unsigned int read_iec958_rd_ptr(void); void audio_in_spdif_enable(int flag); unsigned audio_spdifout_pg_enable(unsigned char enable); unsigned audio_aiu_pg_enable(unsigned char enable); #include "mach/cpu.h" /*OVERCLOCK == 1,our SOC privide 512fs mclk,OVERCLOCK == 0 ,256fs*/ #if MESON_CPU_TYPE >= MESON_CPU_TYPE_MESON6TV #define OVERCLOCK 0 #define IEC958_OVERCLOCK 1 #else #define OVERCLOCK 1 #endif #if (OVERCLOCK == 1) #define MCLKFS_RATIO 512 #else #define MCLKFS_RATIO 256 #endif #define I2S_PLL_SRC 1 // MPLL0 #define MPLL_I2S_CNTL HHI_MPLL_CNTL7 #define I958_PLL_SRC 2 // MPLL1 #define MPLL_958_CNTL HHI_MPLL_CNTL8 #endif
/* #----------------------------------------------------------------------------- # Part of osm2pgsql utility #----------------------------------------------------------------------------- # By Artem Pavlenko, Copyright 2007 # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #----------------------------------------------------------------------------- */ #ifndef BUILD_GEOMETRY_H #define BUILD_GEOMETRY_H #ifdef __cplusplus extern "C" { #endif int is_simple(const char* wkt); void add_segment(double x0,double y0,double x1, double y1); const char* get_wkt(size_t index); size_t build_geometry(int polygon); void clear_wkts(); #ifdef __cplusplus } #endif #endif
/* * QEMU Crypto block device encryption LUKS format * * Copyright (c) 2015-2016 Red Hat, Inc. * * 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 QCRYPTO_BLOCK_LUKS_H__ #define QCRYPTO_BLOCK_LUKS_H__ #include "crypto/blockpriv.h" extern const QCryptoBlockDriver qcrypto_block_driver_luks; #endif /* QCRYPTO_BLOCK_LUKS_H__ */
/*************************************************************************** * Copyright (C) 2006 by Tobias Koenig <tokoe@kde.org> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #ifndef _OKULAR_GENERATOR_OOO_H_ #define _OKULAR_GENERATOR_OOO_H_ #include <core/textdocumentgenerator.h> class KOOOGenerator : public Okular::TextDocumentGenerator { public: KOOOGenerator( QObject *parent, const QVariantList &args ); // [INHERITED] reparse configuration void addPages( KConfigDialog* dlg ); }; #endif
#include <signal.h> #include <stdio.h> #include "posixtest.h" /* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: rolla.n.selbak REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. * Test that the sigwait() function. * If prior to the call to sigwait() there are multiple pending instances of * a single signal number (and it is implementation-defined that the signal * number DOES NOT support queued signals), then there should be no remaining * pending signals for that signal number. * Steps are: * 1) Block a signal that doesn't support queueing from delivery. * 2) Raise that signal 4 times. * 3) Call sigwait() * 4) Verify it cleared the signal from the pending signals and there * are no signals left in the pending list. * */ int main() { sigset_t newmask, pendingset; int sig; /* Empty set of blocked signals */ if ( (sigemptyset(&newmask) == -1) || (sigemptyset(&pendingset) == -1) ) { printf("Error in sigemptyset()\n"); return PTS_UNRESOLVED; } /* Add SIGALRM to the set of blocked signals */ if (sigaddset(&newmask, SIGALRM) == -1) { perror("Error in sigaddset()\n"); return PTS_UNRESOLVED; } /* Block SIGALRM */ if (sigprocmask(SIG_SETMASK, &newmask, NULL) == -1) { printf("Error in sigprocmask()\n"); return PTS_UNRESOLVED; } /* Send SIGALRM signal 4 times to this process. Since it is blocked, * it should be pending. */ if (raise(SIGALRM) != 0) { printf("Could not raise SIGALRM\n"); return PTS_UNRESOLVED; } if (raise(SIGALRM) != 0) { printf("Could not raise SIGALRM\n"); return PTS_UNRESOLVED; } if (raise(SIGALRM) != 0) { printf("Could not raise SIGALRM\n"); return PTS_UNRESOLVED; } if (raise(SIGALRM) != 0) { printf("Could not raise SIGALRM\n"); return PTS_UNRESOLVED; } /* Obtain a set of pending signals */ if (sigpending(&pendingset) == -1) { printf("Error calling sigpending()\n"); return PTS_UNRESOLVED; } /* Make sure SIGALRM is pending */ if (sigismember(&pendingset, SIGALRM) == 0) { printf("Error: signal SIGALRM not pending\n"); return PTS_UNRESOLVED; } /* Call sigwait */ if (sigwait(&newmask, &sig) != 0) { printf("Error in sigwait\n"); return PTS_UNRESOLVED; } /* Make sure SIGALRM is not in the pending list anymore */ if (sigpending(&pendingset) == -1) { printf("Error calling sigpending()\n"); return PTS_UNRESOLVED; } if (sigismember(&pendingset, SIGALRM) == 1) { printf("Test FAILED\n"); return PTS_FAIL; } printf("Test PASSED\n"); return PTS_PASS; }
#ifndef _VX_MONITOR_H #define _VX_MONITOR_H enum { VXM_UNUSED = 0, VXM_SYNC = 0x10, VXM_UPDATE = 0x20, VXM_UPDATE_1, VXM_UPDATE_2, VXM_RQINFO_1 = 0x24, VXM_RQINFO_2, VXM_ACTIVATE = 0x40, VXM_DEACTIVATE, VXM_IDLE, VXM_HOLD = 0x44, VXM_UNHOLD, VXM_MIGRATE = 0x48, VXM_RESCHED, /* all other bits are flags */ VXM_SCHED = 0x80, }; struct _vxm_update_1 { uint32_t tokens_max; uint32_t fill_rate; uint32_t interval; }; struct _vxm_update_2 { uint32_t tokens_min; uint32_t fill_rate; uint32_t interval; }; struct _vxm_rqinfo_1 { uint16_t running; uint16_t onhold; uint16_t iowait; uint16_t uintr; uint32_t idle_tokens; }; struct _vxm_rqinfo_2 { uint32_t norm_time; uint32_t idle_time; uint32_t idle_skip; }; struct _vxm_sched { uint32_t tokens; uint32_t norm_time; uint32_t idle_time; }; struct _vxm_task { uint16_t pid; uint16_t state; }; struct _vxm_event { uint32_t jif; union { uint32_t seq; uint32_t sec; }; union { uint32_t tokens; uint32_t nsec; struct _vxm_task tsk; }; }; struct _vx_mon_entry { uint16_t type; uint16_t xid; union { struct _vxm_event ev; struct _vxm_sched sd; struct _vxm_update_1 u1; struct _vxm_update_2 u2; struct _vxm_rqinfo_1 q1; struct _vxm_rqinfo_2 q2; }; }; #endif /* _VX_MONITOR_H */
#include <assert.h> #include <sys/timeb.h> #ifndef BASE_H #define BASE_H #ifdef _MSC_VER typedef signed __int64 int64_t; // ll typedef unsigned __int64 uint64_t; // qw typedef signed __int32 int32_t; // l typedef unsigned __int32 uint32_t; // dw typedef signed __int16 int16_t; // s typedef unsigned __int16 uint16_t; // w typedef signed __int8 int8_t; // c typedef unsigned __int8 uint8_t; // uc #define FORMAT_I64 "I64" #else #include <stdint.h> #define FORMAT_I64 "ll" #endif #define __ASSERT(a) assert(a) #define __ASSERT_BOUND(a, b, c) assert((a) <= (b) && (b) <= (c)) #define __ASSERT_BOUND_2(a, b, c, d) assert((a) <= (b) && (b) <= (c) && (c) <= (d)) inline bool EQV(bool bArg1, bool bArg2) { return bArg1 ? bArg2 : !bArg2; } inline bool XOR(bool bArg1, bool bArg2) { return bArg1 ? !bArg2 : bArg2; } template <typename T> inline T MIN(T Arg1, T Arg2) { return Arg1 < Arg2 ? Arg1 : Arg2; } template <typename T> inline T MAX(T Arg1, T Arg2) { return Arg1 > Arg2 ? Arg1 : Arg2; } template <typename T> inline T ABS(T Arg) { return Arg < 0 ? -Arg : Arg; } template <typename T> inline T SQR(T Arg) { return Arg * Arg; } template <typename T> inline void SWAP(T &Arg1, T &Arg2) { T Temp; Temp = Arg1; Arg1 = Arg2; Arg2 = Temp; } inline int PopCnt8(uint8_t uc) { int n; n = ((uc >> 1) & 0x55) + (uc & 0x55); n = ((n >> 2) & 0x33) + (n & 0x33); return (n >> 4) + (n & 0x0f); } inline int PopCnt16(uint16_t w) { int n; n = ((w >> 1) & 0x5555) + (w & 0x5555); n = ((n >> 2) & 0x3333) + (n & 0x3333); n = ((n >> 4) & 0x0f0f) + (n & 0x0f0f); return (n >> 8) + (n & 0x00ff); } inline int PopCnt32(uint32_t dw) { int n; n = ((dw >> 1) & 0x55555555) + (dw & 0x55555555); n = ((n >> 2) & 0x33333333) + (n & 0x33333333); n = ((n >> 4) & 0x0f0f0f0f) + (n & 0x0f0f0f0f); n = ((n >> 8) & 0x00ff00ff) + (n & 0x00ff00ff); return (n >> 16) + (n & 0x0000ffff); } inline int64_t GetTime() { timeb tb; ftime(&tb); return (int64_t) tb.time * 1000 + tb.millitm; } #endif
// // iTermShortcut.h // iTerm2 // // Created by George Nachman on 6/27/16. // // #import <Cocoa/Cocoa.h> #import "NSDictionary+iTerm.h" #import "ProfileModel.h" extern const NSEventModifierFlags kHotKeyModifierMask; extern CGFloat kShortcutPreferredHeight; // Describes a keyboard shortcut for opening a hotkey window. @interface iTermShortcut : NSObject<NSCopying> @property(nonatomic, assign) NSUInteger keyCode; @property(nonatomic, assign) NSEventModifierFlags modifiers; @property(nonatomic, copy) NSString *characters; @property(nonatomic, copy) NSString *charactersIgnoringModifiers; // A string describing the shortcut. This is how shortcuts are stored in preferences. @property(nonatomic, readonly) NSString *identifier; // Suitable for display. @property(nonatomic, readonly) NSString *stringValue; // Uniquely describes the shortcut for testing with equality against other kinds of hotkeys (e.g., // modifier double-presses) and excludes irrelevant info (like characters with modifiers). @property(nonatomic, readonly) iTermHotKeyDescriptor *descriptor; // Is this shortcut assigned? If not, it "empty" and can't be used. @property(nonatomic, readonly) BOOL isAssigned; // A complete serialization. @property(nonatomic, readonly) NSDictionary *dictionaryValue; // Takes a dictionary like the one produced by -[iTermShortcut dictionaryValue]. + (instancetype)shortcutWithDictionary:(NSDictionary *)dictionary; // Returns assigned shortcuts for a profile. + (NSArray<iTermShortcut *> *)shortcutsForProfile:(Profile *)profile; // Returns the shortcut for a keydown event. + (instancetype)shortcutWithEvent:(NSEvent *)event; + (NSString *)shortStringForDictionary:(NSDictionary *)dict; + (NSDictionary *)dictionaryForShortString:(NSString *)string; - (instancetype)initWithKeyCode:(NSUInteger)code modifiers:(NSEventModifierFlags)modifiers characters:(NSString *)characters charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers NS_DESIGNATED_INITIALIZER; // Change in place from a KeyDown event. - (void)setFromEvent:(NSEvent *)event; // Does the event match this shortcut? - (BOOL)eventIsShortcutPress:(NSEvent *)event; - (BOOL)isEqualToShortcut:(iTermShortcut *)object; @end
/* * Copyright (c) Bull S.A. 2007 All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * 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 General Public License along * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * History: * Created by: Cyril Lacabanne (Cyril.Lacabanne@bull.net) * */ #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <rpc/rpc.h> //Standard define #define PROCNUM 1 #define VERSNUM 1 //Set number of test call int maxIter; int eachResult(char *out, struct sockaddr_in *addr); double average(double *tbl) { //Return average of values in tbl int i; double rslt = 0; for (i = 0; i < maxIter; i++) { rslt += tbl[i]; } rslt = rslt / maxIter; return rslt; } double mini(double *tbl) { //Return minimal of values in tbl int i; double rslt = tbl[0]; for (i = 0; i < maxIter; i++) { if (rslt > tbl[i]) rslt = tbl[i]; } return rslt; } double maxi(double *tbl) { //Return maximal of values in tbl int i; double rslt = tbl[0]; for (i = 0; i < maxIter; i++) { if (rslt < tbl[i]) rslt = tbl[i]; } return rslt; } int main(int argn, char *argc[]) { //Program parameters : argc[1] : HostName or Host IP // argc[2] : Server Program Number // argc[3] : Number of test call // other arguments depend on test case //run_mode can switch into stand alone program or program launch by shell script //1 : stand alone, debug mode, more screen information //0 : launch by shell script as test case, only one printf -> result status int run_mode = 0; int test_status = 0; //Default test result set to FAILED int i; double *resultTbl; struct timeval tv1, tv2; struct timezone tz; long long diff; double rslt; int progNum = atoi(argc[2]); enum clnt_stat cs; int varSnd = 10; int varRec = -1; //Test initialisation maxIter = atoi(argc[3]); resultTbl = (double *)malloc(maxIter * sizeof(double)); //Call tested function several times for (i = 0; i < maxIter; i++) { //Tic gettimeofday(&tv1, &tz); //Call function cs = clnt_broadcast(progNum, VERSNUM, PROCNUM, (xdrproc_t) xdr_int, (char *)&varSnd, (xdrproc_t) xdr_int, (char *)&varRec, eachResult); if (cs != RPC_SUCCESS) clnt_perrno(cs); //Toc gettimeofday(&tv2, &tz); //Add function execution time (toc-tic) diff = (tv2.tv_sec - tv1.tv_sec) * 1000000L + (tv2.tv_usec - tv1.tv_usec); rslt = (double)diff / 1000; if (cs == RPC_SUCCESS) { resultTbl[i] = rslt; } else { test_status = 1; break; } if (run_mode) { fprintf(stderr, "lf time = %lf usecn\n", resultTbl[i]); } } //This last printf gives the result status to the tests suite //normally should be 0: test has passed or 1: test has failed printf("%d\n", test_status); printf("%lf %d\n", average(resultTbl), maxIter); printf("%lf\n", mini(resultTbl)); printf("%lf\n", maxi(resultTbl)); return test_status; } int eachResult(char *out, struct sockaddr_in *addr) { //Nothing to do here in that test case... return 1; }
/* * This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef WMO_H #define WMO_H #define TILESIZE (533.33333f) #define CHUNKSIZE ((TILESIZE) / 16.0f) #include <string> #include <set> #include "vec3d.h" #include "loadlib/loadlib.h" // MOPY flags #define WMO_MATERIAL_NOCAMCOLLIDE 0x01 #define WMO_MATERIAL_DETAIL 0x02 #define WMO_MATERIAL_NO_COLLISION 0x04 #define WMO_MATERIAL_HINT 0x08 #define WMO_MATERIAL_RENDER 0x10 #define WMO_MATERIAL_COLLIDE_HIT 0x20 #define WMO_MATERIAL_WALL_SURFACE 0x40 class WMOInstance; class WMOManager; class MPQFile; /* for whatever reason a certain company just can't stick to one coordinate system... */ static inline Vec3D fixCoords(const Vec3D& v) { return Vec3D(v.z, v.x, v.y); } class WMORoot { public: uint32 nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootWMOID, liquidType; unsigned int col; float bbcorn1[3]; float bbcorn2[3]; WMORoot(std::string& filename); ~WMORoot(); bool open(); bool ConvertToVMAPRootWmo(FILE* output); private: std::string filename; }; struct WMOLiquidHeader { int xverts, yverts, xtiles, ytiles; float pos_x; float pos_y; float pos_z; short type; }; struct WMOLiquidVert { uint16 unk1; uint16 unk2; float height; }; class WMOGroup { public: // MOGP int groupName, descGroupName, mogpFlags; float bbcorn1[3]; float bbcorn2[3]; uint16 moprIdx; uint16 moprNItems; uint16 nBatchA; uint16 nBatchB; uint32 nBatchC, fogIdx, liquidType, groupWMOID; int mopy_size, moba_size; int LiquEx_size; unsigned int nVertices; // number when loaded int nTriangles; // number when loaded char* MOPY; uint16* MOVI; uint16* MoviEx; float* MOVT; uint16* MOBA; int* MobaEx; WMOLiquidHeader* hlq; WMOLiquidVert* LiquEx; char* LiquBytes; uint32 liquflags; WMOGroup(std::string& filename); ~WMOGroup(); bool open(); int ConvertToVMAPGroupWmo(FILE* output, WMORoot* rootWMO, bool pPreciseVectorData); private: std::string filename; }; class WMOInstance { static std::set<int> ids; public: std::string MapName; int currx; int curry; WMOGroup* wmo; Vec3D pos; Vec3D pos2, pos3, rot; uint32 indx, id, d2, d3; int doodadset; WMOInstance(MPQFile& f, const char* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile); static void reset(); }; #endif
//============================================================================= // MuseScore // Music Composition & Notation // // Copyright (C) 2002-2011 Werner Schweer // // 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 and appearing in // the file LICENCE.GPL //============================================================================= #ifndef __BSYMBOL_H__ #define __BSYMBOL_H__ #include "element.h" #include "elementlayout.h" namespace Ms { //--------------------------------------------------------- // @@ BSymbol /// base class for Symbol and Image //--------------------------------------------------------- class BSymbol : public Element, public ElementLayout { Q_OBJECT QList<Element*> _leafs; bool _systemFlag; public: BSymbol(Score* s); BSymbol(const BSymbol&); BSymbol &operator=(const BSymbol&) = delete; virtual void add(Element*) override; virtual void remove(Element*) override; virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true) override; virtual bool acceptDrop(const DropData&) const override; virtual Element* drop(const DropData&) override; virtual void layout() override; virtual QRectF drag(EditData*) override; void writeProperties(Xml& xml) const; bool readProperties(XmlReader&); const QList<Element*>& leafs() const { return _leafs; } QList<Element*>& leafs() { return _leafs; } virtual QPointF pagePos() const override; virtual QPointF canvasPos() const override; virtual QLineF dragAnchor() const override; Segment* segment() const { return (Segment*)parent(); } bool systemFlag() const { return _systemFlag; } void setSystemFlag(bool val) { _systemFlag = val; } }; } // namespace Ms #endif
/* vi: set sw=4 ts=4: */ /* signalpipe.c * * Signal pipe infrastructure. A reliable way of delivering signals. * * Russ Dill <Russ.Dill@asu.edu> December 2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "common.h" static int signal_pipe[2]; static void signal_handler(int sig) { unsigned char ch = sig; /* use char, avoid dealing with partial writes */ if (write(signal_pipe[1], &ch, 1) != 1) bb_perror_msg("cannot send signal"); } /* Call this before doing anything else. Sets up the socket pair * and installs the signal handler */ void udhcp_sp_setup(void) { /* was socketpair, but it needs AF_UNIX in kernel */ xpipe(signal_pipe); fcntl(signal_pipe[0], F_SETFD, FD_CLOEXEC); fcntl(signal_pipe[1], F_SETFD, FD_CLOEXEC); fcntl(signal_pipe[1], F_SETFL, O_NONBLOCK); signal(SIGUSR1, signal_handler); signal(SIGUSR2, signal_handler); signal(SIGTERM, signal_handler); } /* Quick little function to setup the rfds. Will return the * max_fd for use with select. Limited in that you can only pass * one extra fd */ int udhcp_sp_fd_set(fd_set *rfds, int extra_fd) { FD_ZERO(rfds); FD_SET(signal_pipe[0], rfds); if (extra_fd >= 0) { fcntl(extra_fd, F_SETFD, FD_CLOEXEC); FD_SET(extra_fd, rfds); } return signal_pipe[0] > extra_fd ? signal_pipe[0] : extra_fd; } /* Read a signal from the signal pipe. Returns 0 if there is * no signal, -1 on error (and sets errno appropriately), and * your signal on success */ int udhcp_sp_read(fd_set *rfds) { unsigned char sig; if (!FD_ISSET(signal_pipe[0], rfds)) return 0; if (read(signal_pipe[0], &sig, 1) != 1) return -1; return sig; }
/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ extern double __NaN(void); extern double __Inf(int); extern int __isNaN(double); extern int __isInf(double, int);
/* * linux/net/sunrpc/sunrpc_syms.c * * Symbols exported by the sunrpc module. * * Copyright (C) 1997 Olaf Kirch <okir@monad.swb.de> */ #define __NO_VERSION__ #include <linux/config.h> #include <linux/module.h> #include <linux/types.h> #include <linux/socket.h> #include <linux/sched.h> #include <linux/uio.h> #include <linux/unistd.h> #include <linux/sunrpc/sched.h> #include <linux/sunrpc/clnt.h> #include <linux/sunrpc/svc.h> #include <linux/sunrpc/svcsock.h> #include <linux/sunrpc/auth.h> /* RPC scheduler */ EXPORT_SYMBOL(rpc_allocate); EXPORT_SYMBOL(rpc_free); EXPORT_SYMBOL(rpc_execute); EXPORT_SYMBOL(rpc_init_task); EXPORT_SYMBOL(rpc_sleep_on); EXPORT_SYMBOL(rpc_wake_up_next); EXPORT_SYMBOL(rpc_wake_up_task); EXPORT_SYMBOL(rpc_new_child); EXPORT_SYMBOL(rpc_run_child); EXPORT_SYMBOL(rpciod_down); EXPORT_SYMBOL(rpciod_up); EXPORT_SYMBOL(rpc_new_task); EXPORT_SYMBOL(rpc_wake_up_status); EXPORT_SYMBOL(rpc_release_task); /* RPC client functions */ EXPORT_SYMBOL(rpc_create_client); EXPORT_SYMBOL(rpc_destroy_client); EXPORT_SYMBOL(rpc_shutdown_client); EXPORT_SYMBOL(rpc_killall_tasks); EXPORT_SYMBOL(rpc_call_sync); EXPORT_SYMBOL(rpc_call_async); EXPORT_SYMBOL(rpc_call_setup); EXPORT_SYMBOL(rpc_clnt_sigmask); EXPORT_SYMBOL(rpc_clnt_sigunmask); EXPORT_SYMBOL(rpc_delay); EXPORT_SYMBOL(rpc_restart_call); /* Client transport */ EXPORT_SYMBOL(xprt_create_proto); EXPORT_SYMBOL(xprt_destroy); EXPORT_SYMBOL(xprt_set_timeout); /* Client credential cache */ EXPORT_SYMBOL(rpcauth_register); EXPORT_SYMBOL(rpcauth_unregister); EXPORT_SYMBOL(rpcauth_init_credcache); EXPORT_SYMBOL(rpcauth_free_credcache); EXPORT_SYMBOL(rpcauth_insert_credcache); EXPORT_SYMBOL(rpcauth_lookupcred); EXPORT_SYMBOL(rpcauth_bindcred); EXPORT_SYMBOL(rpcauth_matchcred); EXPORT_SYMBOL(put_rpccred); /* RPC server stuff */ EXPORT_SYMBOL(svc_create); EXPORT_SYMBOL(svc_create_thread); EXPORT_SYMBOL(svc_exit_thread); EXPORT_SYMBOL(svc_destroy); EXPORT_SYMBOL(svc_drop); EXPORT_SYMBOL(svc_process); EXPORT_SYMBOL(svc_recv); EXPORT_SYMBOL(svc_wake_up); EXPORT_SYMBOL(svc_makesock); /* RPC statistics */ #ifdef CONFIG_PROC_FS EXPORT_SYMBOL(rpc_proc_register); EXPORT_SYMBOL(rpc_proc_unregister); EXPORT_SYMBOL(rpc_proc_read); EXPORT_SYMBOL(svc_proc_register); EXPORT_SYMBOL(svc_proc_unregister); EXPORT_SYMBOL(svc_proc_read); #endif /* Generic XDR */ EXPORT_SYMBOL(xdr_encode_array); EXPORT_SYMBOL(xdr_encode_string); EXPORT_SYMBOL(xdr_decode_string); EXPORT_SYMBOL(xdr_decode_string_inplace); EXPORT_SYMBOL(xdr_decode_netobj); EXPORT_SYMBOL(xdr_encode_netobj); EXPORT_SYMBOL(xdr_shift_iovec); EXPORT_SYMBOL(xdr_zero_iovec); /* Debugging symbols */ #ifdef RPC_DEBUG EXPORT_SYMBOL(rpc_debug); EXPORT_SYMBOL(nfs_debug); EXPORT_SYMBOL(nfsd_debug); EXPORT_SYMBOL(nlm_debug); #endif
/*************************************************************************** qgsgeorefdelegates.h -------------------------------------- Date : 14-Feb-2010 Copyright : (C) 2010 by Jack R, Maxim Dubinin (GIS-Lab) Email : sim@gis-lab.info *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* $Id$ */ #ifndef QGSDELEGATES_H #define QGSDELEGATES_H #include <QStyledItemDelegate> class QgsNonEditableDelegate : public QStyledItemDelegate { Q_OBJECT public: QgsNonEditableDelegate( QWidget *parent = 0 ); QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const { Q_UNUSED( parent ); Q_UNUSED( option ); Q_UNUSED( index ); return 0; } }; class QgsDmsAndDdDelegate : public QStyledItemDelegate { Q_OBJECT public: QgsDmsAndDdDelegate( QWidget *parent = 0 ); QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const; void setEditorData( QWidget *editor, const QModelIndex &index ) const; void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const; void updateEditorGeometry( QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index ) const; private: QString dmsToDD( QString dms ) const; }; class QgsCoordDelegate : public QStyledItemDelegate { Q_OBJECT public: QgsCoordDelegate( QWidget *parent = 0 ); QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const; // void setEditorData(QWidget *editor, const QModelIndex &index); // void setModelData(QWidget *editor, QAbstractItemModel *model, // const QModelIndex &index); // // void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, // const QModelIndex &index); }; #endif // QGSDELEGATES_H
// Copyright 2012 Google Inc. All Rights Reserved. // Author: yugui@google.com (Yugui Sonoda) #ifndef RUBY_NACL_UNISTD_H #define RUBY_NACL_UNISTD_H int seteuid(pid_t pid); int setegid(pid_t pid); int truncate(const char* path, off_t new_size); int ftruncate(int fd, off_t new_size); #endif
/* sound/soc/s3c24xx/s3c-i2s-v2.h * * ALSA Soc Audio Layer - S3C_I2SV2 I2S driver * * Copyright (c) 2007 Simtec Electronics * http://armlinux.simtec.co.uk/ * Ben Dooks <ben@simtec.co.uk> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ /* This code is the core support for the I2S block found in a number of * Samsung SoC devices which is unofficially named I2S-V2. Currently the * S3C2412 and the S3C64XX series use this block to provide 1 or 2 I2S * channels via configurable GPIO. */ #ifndef __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H #define __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H __FILE__ #define S3C_I2SV2_DIV_BCLK (1) #define S3C_I2SV2_DIV_RCLK (2) #define S3C_I2SV2_DIV_PRESCALER (3) /** * struct s3c_i2sv2_info - S3C I2S-V2 information * @dev: The parent device passed to use from the probe. * @regs: The pointer to the device registe block. * @master: True if the I2S core is the I2S bit clock master. * @dma_playback: DMA information for playback channel. * @dma_capture: DMA information for capture channel. * @suspend_iismod: PM save for the IISMOD register. * @suspend_iiscon: PM save for the IISCON register. * @suspend_iispsr: PM save for the IISPSR register. * * This is the private codec state for the hardware associated with an * I2S channel such as the register mappings and clock sources. */ struct s3c_i2sv2_info { struct device *dev; void __iomem *regs; struct clk *sclk_audio; struct clk *iis_ipclk; struct clk *iis_cclk; struct clk *iis_clk; struct clk *iis_busclk; struct regulator *regulator; unsigned char master; struct s3c_dma_params *dma_playback; struct s3c_dma_params *dma_capture; u32 suspend_iismod; u32 suspend_iiscon; u32 suspend_iispsr; u32 suspend_iisahb; u32 suspend_audss_clksrc; u32 suspend_audss_clkdiv; u32 suspend_audss_clkgate; }; struct s3c_i2sv2_rate_calc { unsigned int clk_div; /* for prescaler */ unsigned int fs_div; /* for root frame clock */ }; extern int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, unsigned int *fstab, unsigned int rate, struct clk *clk); /** * s3c_i2sv2_probe - probe for i2s device helper * @pdev: The platform device supplied to the original probe. * @dai: The ASoC DAI structure supplied to the original probe. * @i2s: Our local i2s structure to fill in. * @base: The base address for the registers. */ extern int s3c_i2sv2_probe(struct platform_device *pdev, struct snd_soc_dai *dai, struct s3c_i2sv2_info *i2s, unsigned long base); /** * s3c_i2sv2_register_dai - register dai with soc core * @dai: The snd_soc_dai structure to register * * Fill in any missing fields and then register the given dai with the * soc core. */ extern int s3c_i2sv2_register_dai(struct snd_soc_dai *dai); extern int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); extern int s3c2412_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai); extern int speaker_scan_init(void); //SPK GPIO #endif /* __SND_SOC_S3C24XX_S3C_I2SV2_I2S_H */
/* * Copyright 2008 Aaron Seigo <aseigo@kde.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DESKTOPCORONA_H #define DESKTOPCORONA_H #include <QtGui/QGraphicsScene> #include <QHash> #include <Plasma/Corona> class QMenu; class QAction; class Activity; namespace KActivities { class Controller; } // namespace namespace Plasma { class Applet; } // namespace Plasma namespace Kephal { class Screen; } // namespace Kephal /** * @short A Corona with desktop-y considerations */ class DesktopCorona : public Plasma::Corona { Q_OBJECT public: explicit DesktopCorona(QObject * parent = 0); ~DesktopCorona(); /** * Loads the default (system wide) layout for this user **/ void loadDefaultLayout(); /** * Ensures we have the necessary containments for every screen */ void checkScreens(bool signalWhenExists = false); /** * Ensures we have the necessary containments for the given screen */ void checkScreen(int screen, bool signalWhenExists = false); int numScreens() const; QRect screenGeometry(int id) const; QRegion availableScreenRegion(int id) const; int screenId(const QPoint &pos) const; bool loadDefaultLayoutScripts(); void processUpdateScripts(); /** * Ensures activities exist for the containments */ void checkActivities(); /** * @return the Activity object for the given activity id */ Activity* activity(const QString &id); KActivities::Controller *activityController(); public Q_SLOTS: QRect availableScreenRect(int id) const; void addPanel(); void addPanel(QAction *action); void addPanel(const QString &plugin); void populateAddPanelsMenu(); void activateNextActivity(); void activatePreviousActivity(); /** If there are more than 1 active activities, stop the current activity*/ void stopCurrentActivity(); void evaluateScripts(const QStringList &scripts, bool isStartup = true); protected Q_SLOTS: void screenAdded(Kephal::Screen *s); void saveDefaultSetup(); void printScriptError(const QString &error); void printScriptMessage(const QString &error); void updateImmutability(Plasma::ImmutabilityType immutability); void checkAddPanelAction(const QStringList &sycocaChanges = QStringList()); void currentActivityChanged(const QString &activity); void activityAdded(const QString &id); void activityRemoved(const QString &id); private: void init(); Plasma::Applet *loadDefaultApplet(const QString &pluginName, Plasma::Containment *c); void checkDesktop(Activity *activity, bool signalWhenExists, int screen, int desktop = -1); QAction *m_addPanelAction; QMenu *m_addPanelsMenu; QTimer *m_delayedUpdateTimer; KActivities::Controller *m_activityController; QHash<QString, Activity*> m_activities; }; #endif
/* recvtab.h -- * Copyright 2012-14 Red Hat Inc., Durham, North Carolina. * 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. * * 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 * * Authors: * Steve Grubb <sgrubb@redhat.com> * Location: include/linux/socket.h * NOTE: If any update are made, update buffer size in interpret.c:print_recv() */ _S(0x00000001, "MSG_OOB") _S(0x00000002, "MSG_PEEK") _S(0x00000004, "MSG_DONTROUTE") _S(0x00000008, "MSG_CTRUNC") _S(0x00000010, "MSG_PROXY") _S(0x00000020, "MSG_TRUNC") _S(0x00000040, "MSG_DONTWAIT") _S(0x00000080, "MSG_EOR") _S(0x00000100, "MSG_WAITALL") _S(0x00000200, "MSG_FIN") _S(0x00000400, "MSG_SYN") _S(0x00000800, "MSG_CONFIRM") _S(0x00001000, "MSG_RST") _S(0x00002000, "MSG_ERRQUEUE") _S(0x00004000, "MSG_NOSIGNAL") _S(0x00008000, "MSG_MORE") _S(0x00010000, "MSG_WAITFORONE") _S(0x00020000, "MSG_SENDPAGE_NOTLAST") _S(0x20000000, "MSG_FASTOPEN") _S(0x40000000, "MSG_CMSG_CLOEXEC") _S(0x80000000, "MSG_CMSG_COMPAT")
/* -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 99; -*- */ /* vim: set ts=4 sw=4 et tw=99: */ /* This file is part of Icecream. Copyright (c) 2004 Stephan Kulow <coolo@suse.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef ICECREAM_ENVIRONMENT_H #define ICECREAM_ENVIRONMENT_H #include <comm.h> #include <list> #include <string> #include <unistd.h> class MsgChannel; extern bool cleanup_cache(const std::string &basedir, uid_t user_uid, gid_t user_gid); extern int start_create_env(const std::string &basedir, uid_t user_uid, gid_t user_gid, const std::string &compiler, const std::list<std::string> &extrafiles); extern size_t finish_create_env(int pipe, const std::string &basedir, std::string &native_environment); Environments available_environmnents(const std::string &basename); extern void save_compiler_timestamps(time_t &gcc_bin_timestamp, time_t &gpp_bin_timestamp, time_t &clang_bin_timestamp); bool compilers_uptodate(time_t gcc_bin_timestamp, time_t gpp_bin_timestamp, time_t clang_bin_timestamp); extern pid_t start_install_environment(const std::string &basename, const std::string &target, const std::string &name, MsgChannel *c, int& pipe_to_child, FileChunkMsg*& fmsg, uid_t user_uid, gid_t user_gid); extern size_t finalize_install_environment(const std::string &basename, const std::string &target, pid_t pid, uid_t user_uid, gid_t user_gid); extern size_t remove_environment(const std::string &basedir, const std::string &env); extern size_t remove_native_environment(const std::string &env); extern void chdir_to_environment(MsgChannel *c, const std::string &dirname, uid_t user_uid, gid_t user_gid); extern bool verify_env(MsgChannel *c, const std::string &basedir, const std::string &target, const std::string &env, uid_t user_uid, gid_t user_gid); #endif
/* Copyright (c) 2002-2012 Croteam Ltd. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ // Animation names #define NEITH_ANIM_DEFAULT_ANIMATION 0 // Color names // Patch names // Names of collision boxes #define NEITH_COLLISION_BOX_PART_NAME 0 // Attaching position names
#ifndef __CCBPROXY_H_ #define __CCBPROXY_H_ #include "scripting/lua-bindings/manual/CCLuaEngine.h" #include "audio/include/SimpleAudioEngine.h" #include "extensions/cocos-ext.h" #include "editor-support/cocosbuilder/CocosBuilder.h" USING_NS_CC; USING_NS_CC_EXT; using namespace cocosbuilder; /** * @addtogroup lua * @{ */ /** * CCBProxy is a proxy for cocosbuilder. * By using CCBProxy we could create a CCBReader object conveniently and set the Lua callback function when some events triggered should be passed onto Lua. */ class CCBProxy : public Layer{ public: /** * Default constructor,do nothing. * * @lua NA * @js NA */ CCBProxy() { } /** * Destructor. * * @lua NA * @js NA */ virtual ~ CCBProxy(){ } /** * Create a CCBProxy object. * * @return a CCBProxy object. * * @lua NA * @js NA */ CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(CCBProxy, create); /** * Create a CCBReader object. * * @return a CCBReader object. * * @lua NA * @js NA */ CCBReader* createCCBReader(); /** * Read a ccb file. * * @param pszFileName the string pointer point to the file name. * @param pCCBReader the CCBreader object pointer. * @param bSetOwner whether to set the owner or not. * @return a Node object pointer. * @js NA */ Node* readCCBFromFile(const char *pszFileName,CCBReader* pCCBReader,bool bSetOwner = false); /** * Get the true type name of pNode. * By using the dynamic_cast function, we could get the true type name of pNode. * * @param pNode the Node object used to query. * @return a string pointer point to the true type name otherwise return "No Support". * @js NA */ const char* getNodeTypeName(Node* pNode); /** * Set relationship between the Lua callback function reference index handle and the node. * According to the different controlEvents values,we would choose different ScriptHandlerMgr::HandlerTyp. * When node receive the events information should be passed on to Lua, it would find the Lua callback function by the Lua callback function reference index. * * @param node the node object should pass on the events information to Lua,when the events are triggered. * @param handle the Lua callback function reference index. * @param controlEvents the combination value of Control::EventType, default 0. * @js NA */ void setCallback(Node* node,int handle, int controlEvents = 0); }; // end group /// @} /// @cond class CCBLayerLoader:public LayerLoader{ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCBLayerLoader, loader); }; /// @endcond #endif // __CCBPROXY_H_
/* Test of searching in a string. Copyright (C) 2007-2018 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 <https://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ #include <config.h> #include <string.h> #include <locale.h> #include "macros.h" int main () { /* configure should already have checked that the locale is supported. */ if (setlocale (LC_ALL, "") == NULL) return 1; /* Tests with a character < 0x30. */ { const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */ const char *result = mbsstr (input, " "); ASSERT (result == input + 4); } { const char input[] = "\312\276\300\375"; /* "示例" */ const char *result = mbsstr (input, " "); ASSERT (result == NULL); } /* Tests with a character >= 0x30. */ { const char input[] = "\272\305123\324\313\320\320\241\243"; /* "号123运行。" */ const char *result = mbsstr (input, "2"); ASSERT (result == input + 3); } /* The following tests show how mbsstr() is different from strstr(). */ { const char input[] = "\313\320\320\320"; /* "诵行" */ const char *result = mbsstr (input, "\320\320"); /* "行" */ ASSERT (result == input + 2); } { const char input[] = "\203\062\332\066123\324\313\320\320\241\243"; /* "씋123运行。" */ const char *result = mbsstr (input, "2"); ASSERT (result == input + 5); } { const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */ const char *result = mbsstr (input, "\276\300"); /* "纠" */ ASSERT (result == NULL); } { const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */ const char *result = mbsstr (input, "\375 "); /* invalid multibyte sequence */ ASSERT (result == NULL); } return 0; }
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "AZSClient/AZSClient.h"
/* RetroArch - A frontend for libretro. * Copyright (C) 2011-2017 - Daniel De Matteis * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #include <compat/strl.h> #include <file/file_path.h> #include <string/stdstring.h> #include "../menu_driver.h" #include "../menu_cbs.h" #include "../../file_path_special.h" #include "../../managers/cheat_manager.h" #ifndef BIND_ACTION_LABEL #define BIND_ACTION_LABEL(cbs, name) \ cbs->action_label = name; \ cbs->action_label_ident = #name; #endif static int action_bind_label_generic( file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) { return 0; } #define fill_label_macro(func, lbl) \ static int (func)(file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) \ { \ strlcpy(s, msg_hash_to_str(lbl), len); \ return 0; \ } fill_label_macro(action_bind_label_rdb_entry_detail, MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DETAIL) fill_label_macro(action_bind_label_internal_memory, MSG_INTERNAL_STORAGE) fill_label_macro(action_bind_label_removable_storage, MSG_REMOVABLE_STORAGE) fill_label_macro(action_bind_label_external_application_dir, MSG_EXTERNAL_APPLICATION_DIR) fill_label_macro(action_bind_label_application_dir, MSG_APPLICATION_DIR) static int action_bind_label_playlist_collection_entry( file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) { const char *playlist_file = NULL; if (string_is_empty(path)) return 0; playlist_file = path_basename(path); if (string_is_empty(playlist_file)) return 0; if (string_is_equal_noncase(path_get_extension(playlist_file), "lpl")) { /* Handle content history */ if (string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_HISTORY))) strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_HISTORY_TAB), len); /* Handle favourites */ else if (string_is_equal(playlist_file, file_path_str(FILE_PATH_CONTENT_FAVORITES))) strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES_TAB), len); /* Handle collection playlists */ else { char playlist_name[PATH_MAX_LENGTH]; playlist_name[0] = '\0'; strlcpy(playlist_name, playlist_file, sizeof(playlist_name)); path_remove_extension(playlist_name); strlcpy(s, playlist_name, len); } } /* This should never happen, but if it does just set * the label to the file name (it's better than nothing...) */ else strlcpy(s, playlist_file, len); return 0; } static int action_bind_label_cheat_browse_address( file_list_t *list, unsigned type, unsigned i, const char *label, const char *path, char *s, size_t len) { snprintf(s, len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEAT_BROWSE_MEMORY), cheat_manager_state.browse_address); return 0; } int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx) { if (!cbs) return -1; BIND_ACTION_LABEL(cbs, action_bind_label_generic); if (cbs->enum_idx != MSG_UNKNOWN) { switch (cbs->enum_idx) { case MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY: BIND_ACTION_LABEL(cbs, action_bind_label_playlist_collection_entry); break; case MENU_ENUM_LABEL_PLAYLIST_MANAGER_SETTINGS: BIND_ACTION_LABEL(cbs, action_bind_label_playlist_collection_entry); break; case MENU_ENUM_LABEL_CHEAT_BROWSE_MEMORY: BIND_ACTION_LABEL(cbs, action_bind_label_cheat_browse_address); break; case MSG_INTERNAL_STORAGE: BIND_ACTION_LABEL(cbs, action_bind_label_internal_memory); break; case MSG_REMOVABLE_STORAGE: BIND_ACTION_LABEL(cbs, action_bind_label_removable_storage); break; case MSG_APPLICATION_DIR: BIND_ACTION_LABEL(cbs, action_bind_label_application_dir); break; case MSG_EXTERNAL_APPLICATION_DIR: BIND_ACTION_LABEL(cbs, action_bind_label_external_application_dir); break; case MENU_ENUM_LABEL_RDB_ENTRY_DETAIL: BIND_ACTION_LABEL(cbs, action_bind_label_rdb_entry_detail); break; default: break; } } return -1; }
#ifndef __PINMUX_H__ #define __PINMUX_H__ #define CONFIG_A 0 #define CONFIG_B 1 #define CONFIG_C 2 #define CONFIG_D 3 #define CONFIG_E 4 #define CONFIG_F 5 #define CONFIG_G 6 #define CONFIG_H 7 //configuration d'une broche pour un peripherique (autre que I/O). //exemple: broche PA.14 utilisée pour le timer TC3 (WO0) // -> configuration E d'après datasheet (p.15) // -> configBroche(PORTA,15,CONFIG_E); void pinMux(unsigned char port,unsigned char numBit, unsigned char config); #endif
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include "qt5nodeinstanceserver.h" #include "tokencommand.h" namespace QmlDesigner { class Qt5InformationNodeInstanceServer : public Qt5NodeInstanceServer { Q_OBJECT public: explicit Qt5InformationNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); void reparentInstances(const ReparentInstancesCommand &command) override; void clearScene(const ClearSceneCommand &command) override; void createScene(const CreateSceneCommand &command) override; void completeComponent(const CompleteComponentCommand &command) override; void token(const TokenCommand &command) override; void removeSharedMemory(const RemoveSharedMemoryCommand &command) override; protected: void collectItemChangesAndSendChangeCommands() override; void sendChildrenChangedCommand(const QList<ServerNodeInstance> &childList); void sendTokenBack(); bool isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const; bool isDirtyRecursiveForParentInstances(QQuickItem *item) const; private: QSet<ServerNodeInstance> m_parentChangedSet; QList<ServerNodeInstance> m_completedComponentList; QList<TokenCommand> m_tokenList; }; } // namespace QmlDesigner
/* Copyright 2011 David Malcolm <dmalcolm@redhat.com> Copyright 2011 Red Hat, Inc. This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <Python.h> /* Test of correct usage of PyErr_SetFromErrno */ PyObject * test(PyObject *self, PyObject *args) { return PyErr_SetFromErrno(PyExc_IOError); } static PyMethodDef test_methods[] = { {"test_method", test, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} /* Sentinel */ }; /* PEP-7 Local variables: c-basic-offset: 4 indent-tabs-mode: nil End: */
/**************************************************************************** ** ** Copyright (C) 2009-11 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Pekka Marjola <pekka.marjola@nokia.com> ** ** This file is part of the Quill package. ** ** 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.0, 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. ** ****************************************************************************/ #include <QObject> #ifndef TEST_QUILL_METADATA_H #define TEST_QUILL_METADATA_H class QuillMetadata; class ut_quillmetadata : public QObject { Q_OBJECT public: ut_quillmetadata(); private slots: void init(); void cleanup(); void initTestCase(); void cleanupTestCase(); // High-level tests for metadata preservation void testPreserveXMP(); void testPreserveIptc(); void testPreserveExif(); void testResetOrientation(); void testNoOrientation(); private: QuillMetadata *metadata; QuillMetadata *xmp; QuillMetadata *iptc; }; #endif // TEST_QUILL_METADATA_H
/* DABlin - capital DAB experience Copyright (C) 2015-2018 Stefan Pöschel 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/>. */ #ifndef DABPLUS_DECODER_H_ #define DABPLUS_DECODER_H_ #include <stdint.h> #include <string.h> #include <stdio.h> #include <stdexcept> #include <string> #if !(defined(DABLIN_AAC_FAAD2) ^ defined(DABLIN_AAC_FDKAAC)) #error "You must select a AAC decoder by defining either DABLIN_AAC_FAAD2 or DABLIN_AAC_FDKAAC!" #endif #ifdef DABLIN_AAC_FAAD2 #include <neaacdec.h> #endif #ifdef DABLIN_AAC_FDKAAC #include <fdk-aac/aacdecoder_lib.h> #endif extern "C" { #include <fec.h> } #include "subchannel_sink.h" #include "tools.h" struct SuperframeFormat { bool dac_rate; bool sbr_flag; bool aac_channel_mode; bool ps_flag; int mpeg_surround_config; int GetCoreSrIndex() { return dac_rate ? (sbr_flag ? 6 : 3) : (sbr_flag ? 8 : 5); // 24/48/16/32 kHz } int GetCoreChConfig() { return aac_channel_mode ? 2 : 1; } int GetExtensionSrIndex() { return dac_rate ? 3 : 5; // 48/32 kHz } bool IsSBR() { return sbr_flag; } size_t GetAULengthMs() { return dac_rate ? (sbr_flag ? 40 : 20) : (sbr_flag ? 60 : 30); // 24/48/16/32 kHz } }; // --- RSDecoder ----------------------------------------------------------------- class RSDecoder { private: void *rs_handle; uint8_t rs_packet[120]; int corr_pos[10]; public: RSDecoder(); ~RSDecoder(); void DecodeSuperframe(uint8_t *sf, size_t sf_len, int& total_corr_count, bool& uncorr_errors); }; // --- AACDecoder ----------------------------------------------------------------- class AACDecoder { protected: SubchannelSinkObserver* observer; uint8_t asc[7]; size_t asc_len; public: AACDecoder(std::string decoder_name, SubchannelSinkObserver* observer, SuperframeFormat sf_format); virtual ~AACDecoder() {} virtual void DecodeFrame(uint8_t *data, size_t len) = 0; }; #ifdef DABLIN_AAC_FAAD2 // --- AACDecoderFAAD2 ----------------------------------------------------------------- class AACDecoderFAAD2 : public AACDecoder { private: bool float32; NeAACDecHandle handle; NeAACDecFrameInfo dec_frameinfo; public: AACDecoderFAAD2(SubchannelSinkObserver* observer, SuperframeFormat sf_format, bool float32); ~AACDecoderFAAD2(); void DecodeFrame(uint8_t *data, size_t len); }; #endif #ifdef DABLIN_AAC_FDKAAC // --- AACDecoderFDKAAC ----------------------------------------------------------------- class AACDecoderFDKAAC : public AACDecoder { private: HANDLE_AACDECODER handle; uint8_t *output_frame; size_t output_frame_len; public: AACDecoderFDKAAC(SubchannelSinkObserver* observer, SuperframeFormat sf_format); ~AACDecoderFDKAAC(); void DecodeFrame(uint8_t *data, size_t len); }; #endif // --- SuperframeFilter ----------------------------------------------------------------- class SuperframeFilter : public SubchannelSink { private: bool decode_audio; bool enable_float32; RSDecoder rs_dec; AACDecoder *aac_dec; size_t frame_len; int frame_count; int sync_frames; uint8_t *sf_raw; uint8_t *sf; size_t sf_len; bool sf_format_set; uint8_t sf_format_raw; SuperframeFormat sf_format; int num_aus; int au_start[6+1]; // +1 for end of last AU BitWriter au_bw; bool CheckSync(); void ProcessFormat(); void ProcessUntouchedStream(const uint8_t *data, size_t len); void CheckForPAD(const uint8_t *data, size_t len); public: SuperframeFilter(SubchannelSinkObserver* observer, bool decode_audio, bool enable_float32); ~SuperframeFilter(); void Feed(const uint8_t *data, size_t len); }; #endif /* DABPLUS_DECODER_H_ */
/********************************************************* * Copyright (C) 2007 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation version 2 and no later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *********************************************************/ /* * request.h -- * * Declarations for the HgfsRequest module. This interface abstracts Hgfs * request processing from the filesystem driver. */ #ifndef _REQUEST_H_ #define _REQUEST_H_ #define INCLUDE_ALLOW_MODULE #include "includeCheck.h" #include "dbllnklst.h" /* Double link list types */ /* * Each request will traverse through this set of states. File systems may * query the state of their request, but they may not update it. */ typedef enum { HGFS_REQ_UNUSED = 1, HGFS_REQ_ALLOCATED, HGFS_REQ_SUBMITTED, HGFS_REQ_ABANDONED, HGFS_REQ_ERROR, HGFS_REQ_COMPLETED } HgfsKReqState; /* * Opaque request handler used by the file system code. Allocated during * HgfsKReq_AllocRequest and released at HgfsKReq_ReleaseRequest. */ typedef struct HgfsKReqObject * HgfsKReqHandle; /* * Opaque request object container for the file system. File systems snag one * of these during HgfsKReq_InitSip & relinquish during HgfsKReq_UninitSip. */ typedef struct HgfsKReqContainer * HgfsKReqContainerHandle; /* * Global functions (prototypes) */ extern int HgfsKReq_SysInit(void); extern int HgfsKReq_SysFini(void); extern HgfsKReqContainerHandle HgfsKReq_AllocateContainer(void); extern void HgfsKReq_FreeContainer(HgfsKReqContainerHandle handle); extern void HgfsKReq_CancelRequests(HgfsKReqContainerHandle handle); extern Bool HgfsKReq_ContainerIsEmpty(HgfsKReqContainerHandle handle); extern HgfsKReqHandle HgfsKReq_AllocateRequest(HgfsKReqContainerHandle handle, int *ret); extern void HgfsKReq_ReleaseRequest(HgfsKReqContainerHandle container, HgfsKReqHandle oldRequest); extern int HgfsKReq_SubmitRequest(HgfsKReqHandle req); extern HgfsKReqState HgfsKReq_GetState(HgfsKReqHandle req); extern uint32_t HgfsKReq_GetId(HgfsKReqHandle req); extern char * HgfsKReq_GetPayload(HgfsKReqHandle req); extern char * HgfsKReq_GetPayload_V3(HgfsKReqHandle req); extern char * HgfsKRep_GetPayload_V3(HgfsKReqHandle req); extern size_t HgfsKReq_GetPayloadSize(HgfsKReqHandle req); extern void HgfsKReq_SetPayloadSize(HgfsKReqHandle req, size_t newSize); #endif /* _REQUEST_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 QtGui module of the Qt Toolkit. ** ** $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 have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWSSIGNALHANDLER_P_H #define QWSSIGNALHANDLER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of the QLibrary class. This header file may change from // version to version without notice, or even be removed. // // We mean it. // #include <QtCore/qglobal.h> #ifndef QT_NO_QWS_SIGNALHANDLER #include <QtCore/qmap.h> #include <QtCore/qvector.h> #include <QtCore/qobjectcleanuphandler.h> QT_BEGIN_NAMESPACE typedef void (*qt_sighandler_t)(int); class QWSSignalHandlerPrivate; class Q_GUI_EXPORT QWSSignalHandler { public: static QWSSignalHandler* instance(); ~QWSSignalHandler(); #ifndef QT_NO_QWS_MULTIPROCESS inline void addSemaphore(int semno) { semaphores.append(semno); } void removeSemaphore(int semno); #endif inline void addObject(QObject *object) { (void)objects.add(object); } private: QWSSignalHandler(); static void handleSignal(int signal); QMap<int, qt_sighandler_t> oldHandlers; #ifndef QT_NO_QWS_MULTIPROCESS QVector<int> semaphores; #endif QObjectCleanupHandler objects; friend class QWSSignalHandlerPrivate; }; QT_END_NAMESPACE #endif // QT_NO_QWS_SIGNALHANDLER #endif // QWSSIGNALHANDLER_P_H
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtXmlPatterns module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** 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. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. #ifndef Patternist_RangeVariableReference_H #define Patternist_RangeVariableReference_H #include "qvariablereference_p.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE namespace QPatternist { /** * @short A reference to a variable declared with @c for or a quantification * expression, but not for instance a @c let binding. * * A range variable always represents a single item, while an other * expression provides the binding and iteration. A @c for expression is * a good example. * * @author Frans Englich <frans.englich@nokia.com> * @ingroup Patternist_expressions */ class RangeVariableReference : public VariableReference { public: RangeVariableReference(const Expression::Ptr &sourceExpression, const VariableSlotID slot); virtual bool evaluateEBV(const DynamicContext::Ptr &context) const; virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const; virtual SequenceType::Ptr staticType() const; /** * @returns IDRangeVariableReference */ virtual ID id() const; virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const; virtual Properties properties() const; private: const Expression::Ptr m_sourceExpression; }; } QT_END_NAMESPACE QT_END_HEADER #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef TASKFILE_H #define TASKFILE_H #include <coreplugin/idocument.h> namespace ProjectExplorer { class Project; } // namespace ProjectExplorer namespace TaskList { namespace Internal { class TaskFile : public Core::IDocument { public: TaskFile(QObject *parent); ~TaskFile(); bool save(QString *errorString, const QString &fileName, bool autoSave); QString fileName() const; QString defaultPath() const; QString suggestedFileName() const; QString mimeType() const; bool isModified() const; bool isSaveAsAllowed() const; ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const; bool reload(QString *errorString, ReloadFlag flag, ChangeType type); void rename(const QString &newName); bool open(QString *errorString, const QString &fileName); ProjectExplorer::Project *context() const; void setContext(ProjectExplorer::Project *context); private: QString m_fileName; ProjectExplorer::Project *m_context; }; } // namespace Internal } // namespace TaskList #endif // TASKFILE_H
/* * This file is part of Cockpit. * * Copyright (C) 2015 Red Hat, Inc. * * Cockpit 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. * * Cockpit 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 Cockpit; If not, see <http://www.gnu.org/licenses/>. */ #ifndef COCKPIT_WEB_INJECT_H__ #define COCKPIT_WEB_INJECT_H__ #include "common/cockpitwebfilter.h" G_BEGIN_DECLS #define COCKPIT_TYPE_WEB_INJECT (cockpit_web_inject_get_type ()) #define COCKPIT_WEB_INJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), COCKPIT_TYPE_WEB_INJECT, CockpitWebInject)) #define COCKPIT_IS_WEB_INJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), COCKPIT_TYPE_WEB_INJECT)) typedef struct _CockpitWebInject CockpitWebInject; GType cockpit_web_inject_get_type (void) G_GNUC_CONST; CockpitWebFilter * cockpit_web_inject_new (const gchar *marker, GBytes *inject); G_END_DECLS #endif /* COCKPIT_WEB_INJECT_H__ */
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://www.qt.io/licensing. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef CPPCODESTYLESETTINGS_H #define CPPCODESTYLESETTINGS_H #include "cpptools_global.h" #include <cplusplus/Overview.h> #include <QVariant> QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE namespace CppTools { class CPPTOOLS_EXPORT CppCodeStyleSettings { public: CppCodeStyleSettings(); bool indentBlockBraces; bool indentBlockBody; bool indentClassBraces; bool indentEnumBraces; bool indentNamespaceBraces; bool indentNamespaceBody; bool indentAccessSpecifiers; bool indentDeclarationsRelativeToAccessSpecifiers; bool indentFunctionBody; bool indentFunctionBraces; bool indentSwitchLabels; bool indentStatementsRelativeToSwitchLabels; bool indentBlocksRelativeToSwitchLabels; bool indentControlFlowRelativeToSwitchLabels; // Formatting of pointer and reference declarations, see Overview::StarBindFlag. bool bindStarToIdentifier; bool bindStarToTypeName; bool bindStarToLeftSpecifier; bool bindStarToRightSpecifier; // false: if (a && // b) // c; // true: if (a && // b) // c; // but always: while (a && // b) // foo; bool extraPaddingForConditionsIfConfusingAlign; // false: a = a + // b; // true: a = a + // b bool alignAssignments; void toSettings(const QString &category, QSettings *s) const; void fromSettings(const QString &category, const QSettings *s); void toMap(const QString &prefix, QVariantMap *map) const; void fromMap(const QString &prefix, const QVariantMap &map); bool equals(const CppCodeStyleSettings &rhs) const; bool operator==(const CppCodeStyleSettings &s) const { return equals(s); } bool operator!=(const CppCodeStyleSettings &s) const { return !equals(s); } /*! Returns an Overview configured by the current project's code style. If no current project is available or an error occurs when getting the current project's code style, the current global code style settings are applied. */ static CPlusPlus::Overview currentProjectCodeStyleOverview(); /*! Returns an Overview configured by the current global code style. If there occurred an error getting the current global code style, a default constructed Overview is returned. */ static CPlusPlus::Overview currentGlobalCodeStyleOverview(); }; } // namespace CppTools Q_DECLARE_METATYPE(CppTools::CppCodeStyleSettings) #endif // CPPCODESTYLESETTINGS_H
#include "config.h" #include <gtk/gtk.h> GtkWidget *notebook; static void remove_notebook_page (GtkWidget *button, GtkWidget *toplevel) { gtk_container_remove (GTK_CONTAINER (notebook), toplevel); gtk_widget_show (toplevel); } GtkWidget * create_tab_label (GtkWidget *toplevel) { GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); GtkWidget *label = gtk_label_new (G_OBJECT_TYPE_NAME (toplevel)); GtkWidget *button = gtk_button_new (); GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); gtk_container_add (GTK_CONTAINER (button), image); gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (box), button, FALSE, TRUE, 0); g_signal_connect (button, "clicked", G_CALLBACK (remove_notebook_page), toplevel); gtk_widget_show_all (box); return box; } static void toplevel_delete_event (GtkWidget *toplevel, GdkEvent *event, gpointer none) { GdkWindow *gdk_win; GtkWidget *label = create_tab_label (toplevel); gdk_win = gtk_widget_get_window (notebook); g_assert (gdk_win); gtk_widget_hide (toplevel); gtk_widget_unrealize (toplevel); gtk_widget_set_parent_window (toplevel, gdk_win); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), toplevel, label); gtk_widget_show (toplevel); } gint main (gint argc, gchar **argv) { GtkWidget *window; GtkWidget *widget; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Toplevel widget embedding example"); g_signal_connect (window, "destroy", gtk_main_quit, NULL); notebook = gtk_notebook_new (); gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); gtk_container_add (GTK_CONTAINER (window), notebook); gtk_widget_realize (notebook); widget = gtk_about_dialog_new (); toplevel_delete_event (widget, NULL, NULL); g_signal_connect (widget, "delete-event", G_CALLBACK (toplevel_delete_event), NULL); widget = gtk_file_chooser_dialog_new ("the chooser", NULL, GTK_FILE_CHOOSER_ACTION_OPEN, NULL, NULL); toplevel_delete_event (widget, NULL, NULL); g_signal_connect (widget, "delete-event", G_CALLBACK (toplevel_delete_event), NULL); widget = gtk_color_chooser_dialog_new ("the colorsel", NULL); toplevel_delete_event (widget, NULL, NULL); g_signal_connect (widget, "delete-event", G_CALLBACK (toplevel_delete_event), NULL); widget = gtk_font_chooser_dialog_new ("the fontsel", NULL); toplevel_delete_event (widget, NULL, NULL); g_signal_connect (widget, "delete-event", G_CALLBACK (toplevel_delete_event), NULL); widget = gtk_recent_chooser_dialog_new ("the recent chooser", NULL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); toplevel_delete_event (widget, NULL, NULL); g_signal_connect (widget, "delete-event", G_CALLBACK (toplevel_delete_event), NULL); widget = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "Do you have any questions ?"); toplevel_delete_event (widget, NULL, NULL); g_signal_connect (widget, "delete-event", G_CALLBACK (toplevel_delete_event), NULL); gtk_widget_show_all (window); gtk_main (); return 0; }
/* $Id$ */ /* fseek( FILE *, long offset, int ) This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. */ #include <stdio.h> #ifndef REGTEST #include <_PDCLIB_io.h> int _PDCLIB_fseek_unlocked( FILE * stream, long loffset, int whence ) { _PDCLIB_int64_t offset = loffset; if ( stream->status & _PDCLIB_FWRITE ) { if ( _PDCLIB_flushbuffer( stream ) == EOF ) { return EOF; } } stream->status &= ~ _PDCLIB_EOFFLAG; if ( stream->status & _PDCLIB_FRW ) { stream->status &= ~ ( _PDCLIB_FREAD | _PDCLIB_FWRITE ); } if ( whence == SEEK_CUR ) { whence = SEEK_SET; offset += _PDCLIB_ftell64_unlocked( stream ); } return ( _PDCLIB_seek( stream, offset, whence ) != EOF ) ? 0 : EOF; } int fseek( FILE * stream, long loffset, int whence ) { _PDCLIB_flockfile( stream ); int r = _PDCLIB_fseek_unlocked( stream, loffset, whence ); _PDCLIB_funlockfile( stream ); return r; } #endif #ifdef TEST #include <_PDCLIB_test.h> #include <string.h> int main( void ) { FILE * fh; TESTCASE( ( fh = tmpfile() ) != NULL ); TESTCASE( fwrite( teststring, 1, strlen( teststring ), fh ) == strlen( teststring ) ); /* General functionality */ TESTCASE( fseek( fh, -1, SEEK_END ) == 0 ); TESTCASE( (size_t)ftell( fh ) == strlen( teststring ) - 1 ); TESTCASE( fseek( fh, 0, SEEK_END ) == 0 ); TESTCASE( (size_t)ftell( fh ) == strlen( teststring ) ); TESTCASE( fseek( fh, 0, SEEK_SET ) == 0 ); TESTCASE( ftell( fh ) == 0 ); TESTCASE( fseek( fh, 5, SEEK_CUR ) == 0 ); TESTCASE( ftell( fh ) == 5 ); TESTCASE( fseek( fh, -3, SEEK_CUR ) == 0 ); TESTCASE( ftell( fh ) == 2 ); /* Checking behaviour around EOF */ TESTCASE( fseek( fh, 0, SEEK_END ) == 0 ); TESTCASE( ! feof( fh ) ); TESTCASE( fgetc( fh ) == EOF ); TESTCASE( feof( fh ) ); TESTCASE( fseek( fh, 0, SEEK_END ) == 0 ); TESTCASE( ! feof( fh ) ); /* Checking undo of ungetc() */ TESTCASE( fseek( fh, 0, SEEK_SET ) == 0 ); TESTCASE( fgetc( fh ) == teststring[0] ); TESTCASE( fgetc( fh ) == teststring[1] ); TESTCASE( fgetc( fh ) == teststring[2] ); TESTCASE( ftell( fh ) == 3 ); TESTCASE( ungetc( teststring[2], fh ) == teststring[2] ); TESTCASE( ftell( fh ) == 2 ); TESTCASE( fgetc( fh ) == teststring[2] ); TESTCASE( ftell( fh ) == 3 ); TESTCASE( ungetc( 'x', fh ) == 'x' ); TESTCASE( ftell( fh ) == 2 ); TESTCASE( fgetc( fh ) == 'x' ); TESTCASE( ungetc( 'x', fh ) == 'x' ); TESTCASE( ftell( fh ) == 2 ); TESTCASE( fseek( fh, 2, SEEK_SET ) == 0 ); TESTCASE( fgetc( fh ) == teststring[2] ); /* PDCLIB-7: Check that we handle the underlying file descriptor correctly * in the SEEK_CUR case */ TESTCASE( fseek( fh, 10, SEEK_SET ) == 0 ); TESTCASE( ftell( fh ) == 10l ); TESTCASE( fseek( fh, 0, SEEK_CUR ) == 0 ); TESTCASE( ftell( fh ) == 10l ); TESTCASE( fseek( fh, 2, SEEK_CUR ) == 0 ); TESTCASE( ftell( fh ) == 12l ); TESTCASE( fseek( fh, -1, SEEK_CUR ) == 0 ); TESTCASE( ftell( fh ) == 11l ); /* Checking error handling */ TESTCASE( fseek( fh, -5, SEEK_SET ) == -1 ); TESTCASE( fseek( fh, 0, SEEK_END ) == 0 ); TESTCASE( fclose( fh ) == 0 ); return TEST_RESULTS; } #endif
/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ART_RUNTIME_GC_SPACE_VALGRIND_MALLOC_SPACE_INL_H_ #define ART_RUNTIME_GC_SPACE_VALGRIND_MALLOC_SPACE_INL_H_ #include "valgrind_malloc_space.h" #include <memcheck/memcheck.h> namespace art { namespace gc { namespace space { // Number of bytes to use as a red zone (rdz). A red zone of this size will be placed before and // after each allocation. 8 bytes provides long/double alignment. static constexpr size_t kValgrindRedZoneBytes = 8; template <typename S, typename A> mirror::Object* ValgrindMallocSpace<S, A>::AllocWithGrowth(Thread* self, size_t num_bytes, size_t* bytes_allocated, size_t* usable_size) { void* obj_with_rdz = S::AllocWithGrowth(self, num_bytes + 2 * kValgrindRedZoneBytes, bytes_allocated, usable_size); if (obj_with_rdz == nullptr) { return nullptr; } mirror::Object* result = reinterpret_cast<mirror::Object*>( reinterpret_cast<byte*>(obj_with_rdz) + kValgrindRedZoneBytes); // Make redzones as no access. VALGRIND_MAKE_MEM_NOACCESS(obj_with_rdz, kValgrindRedZoneBytes); VALGRIND_MAKE_MEM_NOACCESS(reinterpret_cast<byte*>(result) + num_bytes, kValgrindRedZoneBytes); return result; } template <typename S, typename A> mirror::Object* ValgrindMallocSpace<S, A>::Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated, size_t* usable_size) { void* obj_with_rdz = S::Alloc(self, num_bytes + 2 * kValgrindRedZoneBytes, bytes_allocated, usable_size); if (obj_with_rdz == nullptr) { return nullptr; } mirror::Object* result = reinterpret_cast<mirror::Object*>( reinterpret_cast<byte*>(obj_with_rdz) + kValgrindRedZoneBytes); // Make redzones as no access. VALGRIND_MAKE_MEM_NOACCESS(obj_with_rdz, kValgrindRedZoneBytes); VALGRIND_MAKE_MEM_NOACCESS(reinterpret_cast<byte*>(result) + num_bytes, kValgrindRedZoneBytes); return result; } template <typename S, typename A> size_t ValgrindMallocSpace<S, A>::AllocationSize(mirror::Object* obj, size_t* usable_size) { size_t result = S::AllocationSize(reinterpret_cast<mirror::Object*>( reinterpret_cast<byte*>(obj) - kValgrindRedZoneBytes), usable_size); return result; } template <typename S, typename A> size_t ValgrindMallocSpace<S, A>::Free(Thread* self, mirror::Object* ptr) { void* obj_after_rdz = reinterpret_cast<void*>(ptr); void* obj_with_rdz = reinterpret_cast<byte*>(obj_after_rdz) - kValgrindRedZoneBytes; // Make redzones undefined. size_t usable_size = 0; AllocationSize(ptr, &usable_size); VALGRIND_MAKE_MEM_UNDEFINED(obj_with_rdz, usable_size); return S::Free(self, reinterpret_cast<mirror::Object*>(obj_with_rdz)); } template <typename S, typename A> size_t ValgrindMallocSpace<S, A>::FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) { size_t freed = 0; for (size_t i = 0; i < num_ptrs; i++) { freed += Free(self, ptrs[i]); ptrs[i] = nullptr; } return freed; } template <typename S, typename A> ValgrindMallocSpace<S, A>::ValgrindMallocSpace(const std::string& name, MemMap* mem_map, A allocator, byte* begin, byte* end, byte* limit, size_t growth_limit, size_t initial_size, bool can_move_objects, size_t starting_size) : S(name, mem_map, allocator, begin, end, limit, growth_limit, can_move_objects, starting_size, initial_size) { VALGRIND_MAKE_MEM_UNDEFINED(mem_map->Begin() + initial_size, mem_map->Size() - initial_size); } } // namespace space } // namespace gc } // namespace art #endif // ART_RUNTIME_GC_SPACE_VALGRIND_MALLOC_SPACE_INL_H_
/*========================================================================= * * 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 __itkEquivalencyTable_h #define __itkEquivalencyTable_h #include "itkProcessObject.h" #include "itksys/hash_map.hxx" namespace itk { /** \class EquivalencyTable * \brief Hash table to manage integral label equivalencies * * EquivalencyTable is a hash table for recording equivalencies among * unsigned long integer values. EquivalencyTable can store recursive * relationships (8=7, 7=6, 6=5, ...) or be ``flattened'' to eliminate * recursion. The table uses an efficient algorithm for eliminating * redundancy and preventing circular dependencies. * * \par * In the context of the watershed segmentation algorithm * (itk::WatershedImageFilter), this table is used to store connections * identified among image segments and as the input to * itk::watershed::Relabeler. * \ingroup WatershedSegmentation * \ingroup ITKCommon */ class ITKCommon_EXPORT EquivalencyTable:public DataObject { public: /** Standard smart pointer declarations */ typedef EquivalencyTable Self; typedef DataObject Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; itkNewMacro(Self); itkTypeMacro(EquivalencyTable, DataObject); /** Define the container type for the table. */ typedef itksys::hash_map< unsigned long, unsigned long, itksys::hash< unsigned long > > HashTableType; typedef HashTableType::iterator Iterator; typedef HashTableType::const_iterator ConstIterator; typedef HashTableType::value_type ValueType; /** ``Flattens'' the equivalency table by eliminating all redundant * and recursive equivalencies. I.e. the set { 2=1; 3=2; 4=3 } is * converted to {4=1; 3=1; 2=1}. */ void Flatten(); /** Insert an equivalency into the table. A return value of TRUE * indicates that the equivalency did not previously exist in the * table and was successfully added. A FALSE return value indicates * that the equivalency was not added to the table because a * conflict with an existing entry occurred (most likely, the * equivalency was already recorded directly or indirectly). */ bool Add(unsigned long a, unsigned long b); /** Insert an equivalency into the table and flatten that * equivalency. A return value of TRUE indicates that the * equivalency did not previously exist in the table and was * successfully added. A FALSE return value indicates that the * equivalency was not added to the table because a conflict with an * existing entry occurred (most likely, the equivalency was already * recorded directly or indirectly). */ bool AddAndFlatten(unsigned long a, unsigned long b); /** Lookup an equivalency in the table. If no entry is found in the * table, the method returns its the value of the argument. Does * not recursively descent through equivalencies. */ unsigned long Lookup(const unsigned long a) const { ConstIterator result = m_HashMap.find(a); if ( result == m_HashMap.end() ) { return a; } else { return ( *result ).second; } } /** Lookup an equivalency in the table by recursing through all * successive equivalencies. For example, if the follow entries * exist in the table {8=7, 7=6, 6=5}, then RecursiveLookup(8) * returns 5. */ unsigned long RecursiveLookup(const unsigned long a) const; /** Returns TRUE if the label is found in the table and FALSE is the label is * not found in the table. */ bool IsEntry(const unsigned long a) const { if ( m_HashMap.find(a) == m_HashMap.end() ) { return false; } else { return true; } } /** Erases the entry with key a. */ void Erase(const unsigned long a) { m_HashMap.erase(a); } /** Erases all the entries in the table. */ void Clear() { m_HashMap.clear(); } /** Returns TRUE if the table is empty, FALSE if it is not empty. */ bool Empty() const { return m_HashMap.empty(); } /** Returns the number of entries in the table. */ HashTableType::size_type Size() const { return m_HashMap.size(); } /** Returns an iterator pointing to the first element of the (unordered) * table. */ Iterator Begin() { return m_HashMap.begin(); } /** Returns and iterator pointing to one position past the last * element of the (unordered) table. */ Iterator End() { return m_HashMap.end(); } /** Convenience method for debugging. */ // void PrintHashTable(); protected: EquivalencyTable() {} virtual ~EquivalencyTable() {} EquivalencyTable(const Self &); // purposely not implemented void operator=(const Self &); // purposely not implemented void PrintSelf(std::ostream & os, Indent indent) const; HashTableType m_HashMap; }; } // end namespace itk #endif
/* Copyright 1990, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Author: Keith Packard, MIT X Consortium */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #ifndef DEFAULT_BIT_ORDER #ifdef BITMAP_BIT_ORDER #define DEFAULT_BIT_ORDER BITMAP_BIT_ORDER #else #define DEFAULT_BIT_ORDER MSBFirst #endif #endif #ifndef DEFAULT_BYTE_ORDER #ifdef IMAGE_BYTE_ORDER #define DEFAULT_BYTE_ORDER IMAGE_BYTE_ORDER #else #define DEFAULT_BYTE_ORDER MSBFirst #endif #endif #ifndef DEFAULT_GLYPH_PAD #ifdef GLYPHPADBYTES #define DEFAULT_GLYPH_PAD GLYPHPADBYTES #else #define DEFAULT_GLYPH_PAD 4 #endif #endif #ifndef DEFAULT_SCAN_UNIT #define DEFAULT_SCAN_UNIT 1 #endif #include <X11/fonts/fntfilst.h> void FontDefaultFormat (int *bit, int *byte, int *glyph, int *scan) { *bit = DEFAULT_BIT_ORDER; *byte = DEFAULT_BYTE_ORDER; *glyph = DEFAULT_GLYPH_PAD; *scan = DEFAULT_SCAN_UNIT; }
//===--- UseAutoCheck.h - clang-tidy-----------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H #include "../ClangTidyCheck.h" namespace clang { namespace tidy { namespace modernize { class UseAutoCheck : public ClangTidyCheck { public: UseAutoCheck(StringRef Name, ClangTidyContext *Context); void storeOptions(ClangTidyOptions::OptionMap &Opts) override; void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; private: void replaceIterators(const DeclStmt *D, ASTContext *Context); void replaceExpr(const DeclStmt *D, ASTContext *Context, llvm::function_ref<QualType(const Expr *)> GetType, StringRef Message); const unsigned int MinTypeNameLength; const bool RemoveStars; }; } // namespace modernize } // namespace tidy } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H
#ifndef PREFIX #define PREFIX "/usr/local" #endif
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function sspgst * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_sspgst( int matrix_layout, lapack_int itype, char uplo, lapack_int n, float* ap, const float* bp ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sspgst", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_ssp_nancheck( n, ap ) ) { return -5; } if( LAPACKE_ssp_nancheck( n, bp ) ) { return -6; } } #endif return LAPACKE_sspgst_work( matrix_layout, itype, uplo, n, ap, bp ); }
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************** * Contents: Native high-level C interface to LAPACK function zsysv_rook * Author: Intel Corporation * Generated January, 2012 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_zsysv_rook( int matrix_layout, char uplo, lapack_int n, lapack_int nrhs, lapack_complex_double* a, lapack_int lda, lapack_int* ipiv, lapack_complex_double* b, lapack_int ldb ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zsysv_rook", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_zsy_nancheck( matrix_layout, uplo, n, a, lda ) ) { return -5; } if( LAPACKE_zge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) { return -8; } } #endif /* Query optimal working array(s) size */ info = LAPACKE_zsysv_rook_work( matrix_layout, uplo, n, nrhs, a, lda, ipiv, b, ldb, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for work arrays */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zsysv_rook_work( matrix_layout, uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zsysv_rook", info ); } return info; }
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef LISTENERVIEWMITK_H_ #define LISTENERVIEWMITK_H_ // QMitk includes #include <QmitkAbstractView.h> // berry includes #include <berryIWorkbenchWindow.h> // Qt includes #include <QString> // ui includes #include "ui_ListenerViewMitkControls.h" /** * \ingroup org_mitk_example_gui_selectionservicemitk * * \brief This BlueBerry view is part of the BlueBerry example * "Selection service MITK". It creates two radio buttons that listen * for selection events of the Qlistwidget (SelectionProvider) and * change the radio button state accordingly. * * @see SelectionViewMitk * */ class ListenerViewMitk : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; ListenerViewMitk(); protected: void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; //! [MITK Selection Listener method] /** @brief Reimplemention of method from QmitkAbstractView that implements the selection listener functionality. * @param part The workbench part responsible for the selection change. * @param nodes A list of selected nodes. * * @see QmitkAbstractView * */ virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes) override; //! [MITK Selection Listener method] private Q_SLOTS: /** @brief Simple slot function that changes the selection of the radio buttons according to the passed string. * @param selectStr QString that contains the name of the slected list element * */ void ToggleRadioMethod(QString selectStr); private: Ui::ListenerViewMitkControls m_Controls; QWidget *m_Parent; }; #endif /*LISTENERVIEWMITK_H_*/
/* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the Xiph.org Foundation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE 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 FOUNDATION OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FLAC__PROTECTED__STREAM_DECODER_H #define FLAC__PROTECTED__STREAM_DECODER_H #include "FLAC/stream_decoder.h" #if FLAC__HAS_OGG #include "private/ogg_decoder_aspect.h" #endif typedef struct FLAC__StreamDecoderProtected { FLAC__StreamDecoderState state; unsigned channels; FLAC__ChannelAssignment channel_assignment; unsigned bits_per_sample; unsigned sample_rate; /* in Hz */ unsigned blocksize; /* in samples (per channel) */ FLAC__bool md5_checking; /* if true, generate MD5 signature of decoded data and compare against signature in the STREAMINFO metadata block */ #if FLAC__HAS_OGG FLAC__OggDecoderAspect ogg_decoder_aspect; #endif } FLAC__StreamDecoderProtected; /* * return the number of input bytes consumed */ unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder); #endif
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2012, John Haddon. All rights reserved. // Copyright (c) 2013, Image Engine Design 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 John Haddon nor the names of // any other contributors to this software 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 GAFFERSCENE_FILESOURCE_H #define GAFFERSCENE_FILESOURCE_H #include "GafferScene/Source.h" namespace GafferScene { /// The SceneNode class is the base class for all Nodes which are capable of loading /// a scene from a file. class FileSource : public Source { public : FileSource( const std::string &name=defaultName<FileSource>() ); virtual ~FileSource(); IE_CORE_DECLARERUNTIMETYPEDEXTENSION( GafferScene::FileSource, FileSourceTypeId, Source ) /// Holds the name of the file to be loaded. Gaffer::StringPlug *fileNamePlug(); const Gaffer::StringPlug *fileNamePlug() const; /// Number of times the node has been refreshed. Gaffer::IntPlug *refreshCountPlug(); const Gaffer::IntPlug *refreshCountPlug() const; /// Implemented to specify that fileNamePlug() affects all the scene output. virtual void affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const; protected : /// Implemented to add fileNamePlug() and refreshCountPlug() to the hash. virtual void hashBound( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const; virtual void hashTransform( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const; virtual void hashAttributes( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const; virtual void hashObject( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const; virtual void hashChildNames( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const; virtual void hashGlobals( const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const; private : static size_t g_firstPlugIndex; }; } // namespace GafferScene #endif // GAFFERSCENE_FILESOURCE_H
/* Copyright (c) 2011 The WebM project authors. All Rights Reserved. */ /* */ /* Use of this source code is governed by a BSD-style license */ /* that can be found in the LICENSE file in the root of the source */ /* tree. An additional intellectual property rights grant can be found */ /* in the file PATENTS. All contributing project authors may */ /* be found in the AUTHORS file in the root of the source tree. */ /* This file automatically generated by configure. Do not edit! */ #ifndef VPX_CONFIG_H #define VPX_CONFIG_H #define RESTRICT #define INLINE __inline__ __attribute__((always_inline)) #define ARCH_ARM 0 #define ARCH_MIPS 0 #define ARCH_X86 0 #define ARCH_X86_64 1 #define ARCH_PPC32 0 #define ARCH_PPC64 0 #define HAVE_EDSP 0 #define HAVE_MEDIA 0 #define HAVE_NEON 0 #define HAVE_MIPS32 0 #define HAVE_DSPR2 0 #define HAVE_MMX 1 #define HAVE_SSE 1 #define HAVE_SSE2 1 #define HAVE_SSE3 1 #define HAVE_SSSE3 1 #define HAVE_SSE4_1 1 #define HAVE_AVX 1 #define HAVE_AVX2 0 #define HAVE_ALTIVEC 0 #define HAVE_VPX_PORTS 1 #define HAVE_STDINT_H 1 #define HAVE_ALT_TREE_LAYOUT 0 #define HAVE_PTHREAD_H 1 #define HAVE_SYS_MMAN_H 1 #define HAVE_UNISTD_H 1 #define CONFIG_EXTERNAL_BUILD 1 #define CONFIG_INSTALL_DOCS 0 #define CONFIG_INSTALL_BINS 1 #define CONFIG_INSTALL_LIBS 1 #define CONFIG_INSTALL_SRCS 0 #define CONFIG_USE_X86INC 1 #define CONFIG_DEBUG 0 #define CONFIG_GPROF 0 #define CONFIG_GCOV 0 #define CONFIG_RVCT 0 #define CONFIG_GCC 1 #define CONFIG_MSVS 0 #define CONFIG_PIC 1 #define CONFIG_BIG_ENDIAN 0 #define CONFIG_CODEC_SRCS 0 #define CONFIG_DEBUG_LIBS 0 #define CONFIG_FAST_UNALIGNED 1 #define CONFIG_MEM_MANAGER 0 #define CONFIG_MEM_TRACKER 0 #define CONFIG_MEM_CHECKS 0 #define CONFIG_DEQUANT_TOKENS 0 #define CONFIG_DC_RECON 0 #define CONFIG_RUNTIME_CPU_DETECT 1 #define CONFIG_POSTPROC 1 #define CONFIG_VP9_POSTPROC 0 #define CONFIG_MULTITHREAD 1 #define CONFIG_INTERNAL_STATS 0 #define CONFIG_VP8_ENCODER 1 #define CONFIG_VP8_DECODER 1 #define CONFIG_VP9_ENCODER 1 #define CONFIG_VP9_DECODER 1 #define CONFIG_VP8 1 #define CONFIG_VP9 1 #define CONFIG_ENCODERS 1 #define CONFIG_DECODERS 1 #define CONFIG_STATIC_MSVCRT 0 #define CONFIG_SPATIAL_RESAMPLING 1 #define CONFIG_REALTIME_ONLY 1 #define CONFIG_ONTHEFLY_BITPACKING 0 #define CONFIG_ERROR_CONCEALMENT 0 #define CONFIG_SHARED 0 #define CONFIG_STATIC 1 #define CONFIG_SMALL 0 #define CONFIG_POSTPROC_VISUALIZER 0 #define CONFIG_OS_SUPPORT 1 #define CONFIG_UNIT_TESTS 0 #define CONFIG_WEBM_IO 1 #define CONFIG_DECODE_PERF_TESTS 0 #define CONFIG_MULTI_RES_ENCODING 1 #define CONFIG_TEMPORAL_DENOISING 1 #define CONFIG_EXPERIMENTAL 0 #define CONFIG_MULTIPLE_ARF 0 #define CONFIG_ALPHA 0 #endif /* VPX_CONFIG_H */
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function cupgtr * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_cupgtr( int matrix_layout, char uplo, lapack_int n, const lapack_complex_float* ap, const lapack_complex_float* tau, lapack_complex_float* q, lapack_int ldq ) { lapack_int info = 0; lapack_complex_float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_cupgtr", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_cpp_nancheck( n, ap ) ) { return -4; } if( LAPACKE_c_nancheck( n-1, tau, 1 ) ) { return -5; } } #endif /* Allocate memory for working array(s) */ work = (lapack_complex_float*) LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,n-1) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_cupgtr_work( matrix_layout, uplo, n, ap, tau, q, ldq, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_cupgtr", info ); } return info; }
#include <stdlib.h> #include "mod_proxy_core_backlog.h" #include "array-static.h" proxy_backlog *proxy_backlog_init(void) { STRUCT_INIT(proxy_backlog, backlog); return backlog; } void proxy_backlog_free(proxy_backlog *backlog) { if (!backlog) return; free(backlog); } int proxy_backlog_push(proxy_backlog *backlog, proxy_request *req) { /* first entry */ if (NULL == backlog->first) { backlog->first = backlog->last = req; } else { backlog->last->next = req; backlog->last = req; } backlog->length++; return 0; } /** * remove the first element from the backlog */ proxy_request *proxy_backlog_shift(proxy_backlog *backlog) { proxy_request *req = NULL; if (!backlog->first) return req; backlog->length--; req = backlog->first; backlog->first = req->next; /* the backlog is empty */ if (backlog->first == NULL) backlog->last = NULL; return req; } int proxy_backlog_remove_connection(proxy_backlog *backlog, void *con) { proxy_request *req = NULL; if (!backlog->first) return -1; if (!con) return -1; /* the first element is what we look for */ if (backlog->first->con == con) { req = backlog->first; backlog->first = req->next; if (backlog->first == NULL) backlog->last = NULL; backlog->length--; proxy_request_free(req); return 0; } for (req = backlog->first; req && req->next; req = req->next) { proxy_request *cur; if (req->next->con != con) continue; backlog->length--; /* the next node is our searched connection */ cur = req->next; req->next = cur->next; /* the next node is the last one, make the current the new last */ if (cur == backlog->last) { backlog->last = req; } cur->next = NULL; proxy_request_free(cur); return 0; } return -1; } proxy_request *proxy_request_init(void) { STRUCT_INIT(proxy_request, request); return request; } void proxy_request_free(proxy_request *request) { if (!request) return; free(request); }
/* ethcontrol.c - ethcontrol */ #include <xinu.h> /*------------------------------------------------------------------------ * ethcontrol - implement control function for a quark ethernet device *------------------------------------------------------------------------ */ devcall ethcontrol ( struct dentry *devptr, /* entry in device switch table */ int32 func, /* control function */ int32 arg1, /* argument 1, if needed */ int32 arg2 /* argument 2, if needed */ ) { struct ethcblk *ethptr; /* Ethertab entry pointer */ int32 retval = OK; /* Return value of cntl function*/ ethptr = &ethertab[devptr->dvminor]; switch (func) { /* Get MAC address */ case ETH_CTRL_GET_MAC: memcpy((byte *)arg1, ethptr->devAddress, ETH_ADDR_LEN); break; default: return SYSERR; } return retval; }
#import "RCTBridgeModule.h" @interface Sample : NSObject <RCTBridgeModule> @end
// For License please refer to LICENSE file in the root of FastEasyMapping project #import <Foundation/Foundation.h> @interface CarNative : NSObject @property (nonatomic, copy) NSString *model; @property (nonatomic, copy) NSString *year; @property (nonatomic, strong) NSDate *createdAt; @end
/*************************************************************************/ /* script_class_parser.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef SCRIPT_CLASS_PARSER_H #define SCRIPT_CLASS_PARSER_H #include "core/ustring.h" #include "core/variant.h" #include "core/vector.h" class ScriptClassParser { public: struct NameDecl { enum Type { NAMESPACE_DECL, CLASS_DECL, STRUCT_DECL }; String name; Type type; }; struct ClassDecl { String name; String namespace_; Vector<String> base; bool nested; }; private: String code; int idx; int line; String error_str; bool error; Variant value; Vector<ClassDecl> classes; enum Token { TK_BRACKET_OPEN, TK_BRACKET_CLOSE, TK_CURLY_BRACKET_OPEN, TK_CURLY_BRACKET_CLOSE, TK_PERIOD, TK_COLON, TK_COMMA, TK_SYMBOL, TK_IDENTIFIER, TK_STRING, TK_NUMBER, TK_OP_LESS, TK_OP_GREATER, TK_EOF, TK_ERROR, TK_MAX }; static const char *token_names[TK_MAX]; static String get_token_name(Token p_token); Token get_token(); Error _skip_generic_type_params(); Error _parse_type_full_name(String &r_full_name); Error _parse_class_base(Vector<String> &r_base); Error _parse_type_constraints(); Error _parse_namespace_name(String &r_name, int &r_curly_stack); public: Error parse(const String &p_code); Error parse_file(const String &p_filepath); String get_error(); Vector<ClassDecl> get_classes(); }; #endif // SCRIPT_CLASS_PARSER_H
/* Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org> 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. */ /* Simple test of the SDL threading code and error handling */ #include <stdio.h> #include <stdlib.h> #include <signal.h> #include "SDL.h" static int alive = 0; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) { SDL_Quit(); exit(rc); } int SDLCALL ThreadFunc(void *data) { /* Set the child thread error string */ SDL_SetError("Thread %s (%lu) had a problem: %s", (char *) data, SDL_ThreadID(), "nevermind"); while (alive) { SDL_Log("Thread '%s' is alive!\n", (char *) data); SDL_Delay(1 * 1000); } SDL_Log("Child thread error string: %s\n", SDL_GetError()); return (0); } int main(int argc, char *argv[]) { SDL_Thread *thread; /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ if (SDL_Init(0) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return (1); } /* Set the error value for the main thread */ SDL_SetError("No worries"); alive = 1; thread = SDL_CreateThread(ThreadFunc, NULL, "#1"); if (thread == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } SDL_Delay(5 * 1000); SDL_Log("Waiting for thread #1\n"); alive = 0; SDL_WaitThread(thread, NULL); SDL_Log("Main thread error string: %s\n", SDL_GetError()); SDL_Quit(); return (0); }
/* Copyright (c) 2005 Anatoly Sokolov All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holders nor the names of 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. */ /* $Id: iom1280.h 2102 2010-03-16 22:52:39Z joerg_wunsch $ */ /* avr/iom1280.h - definitions for ATmega1280 */ #ifndef _AVR_IOM1280_H_ #define _AVR_IOM1280_H_ 1 #include <avr/iomxx0_1.h> /* Constants */ #define SPM_PAGESIZE 256 #define RAMSTART 0x200 #define RAMEND 0x21FF #define XRAMEND 0xFFFF #define E2END 0xFFF #define E2PAGESIZE 8 #define FLASHEND 0x1FFFF /* Fuses */ #define FUSE_MEMORY_SIZE 3 /* Low Fuse Byte */ #define FUSE_CKSEL0 (unsigned char)~_BV(0) #define FUSE_CKSEL1 (unsigned char)~_BV(1) #define FUSE_CKSEL2 (unsigned char)~_BV(2) #define FUSE_CKSEL3 (unsigned char)~_BV(3) #define FUSE_SUT0 (unsigned char)~_BV(4) #define FUSE_SUT1 (unsigned char)~_BV(5) #define FUSE_CKOUT (unsigned char)~_BV(6) #define FUSE_CKDIV8 (unsigned char)~_BV(7) #define LFUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0 & FUSE_CKDIV8) /* High Fuse Byte */ #define FUSE_BOOTRST (unsigned char)~_BV(0) #define FUSE_BOOTSZ0 (unsigned char)~_BV(1) #define FUSE_BOOTSZ1 (unsigned char)~_BV(2) #define FUSE_EESAVE (unsigned char)~_BV(3) #define FUSE_WDTON (unsigned char)~_BV(4) #define FUSE_SPIEN (unsigned char)~_BV(5) #define FUSE_JTAGEN (unsigned char)~_BV(6) #define FUSE_OCDEN (unsigned char)~_BV(7) #define HFUSE_DEFAULT (FUSE_BOOTSZ0 & FUSE_BOOTSZ1 & FUSE_SPIEN & FUSE_JTAGEN) /* Extended Fuse Byte */ #define FUSE_BODLEVEL0 (unsigned char)~_BV(0) #define FUSE_BODLEVEL1 (unsigned char)~_BV(1) #define FUSE_BODLEVEL2 (unsigned char)~_BV(2) #define EFUSE_DEFAULT (0xFF) /* Lock Bits */ #define __LOCK_BITS_EXIST #define __BOOT_LOCK_BITS_0_EXIST #define __BOOT_LOCK_BITS_1_EXIST /* Signature */ #define SIGNATURE_0 0x1E #define SIGNATURE_1 0x97 #define SIGNATURE_2 0x03 #endif /* _AVR_IOM1280_H_ */
// // JKToast.h // JKToast // // Created by Jakey on 14-10-27. // Copyright (c) 2014年 www.skyfox.org. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #define DEFAULT_DISPLAY_DURATION 2.0f #define Version_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f) @interface JKToast : NSObject { NSString *text; UIButton *contentView; CGFloat duration; } + (void)showWithText:(NSString *) text_; + (void)showWithText:(NSString *) text_ duration:(CGFloat)duration_; + (void)showWithText:(NSString *) text_ topOffset:(CGFloat) topOffset_; + (void)showWithText:(NSString *) text_ topOffset:(CGFloat) topOffset duration:(CGFloat) duration_; + (void)showWithText:(NSString *) text_ bottomOffset:(CGFloat) bottomOffset_; + (void)showWithText:(NSString *) text_ bottomOffset:(CGFloat) bottomOffset_ duration:(CGFloat) duration_; @end
#include <libintl.h> #undef dngettext char* dngettext (const char* domainname,const char* msgid, const char* msgid_plural, unsigned long int n) { (void)domainname; return (char*)(n==1?msgid:msgid_plural); }
/* Assembler macros for i386. Copyright (C) 1991-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <sysdeps/generic/sysdep.h> #include <features.h> /* For __GNUC_PREREQ. */ /* It is desirable that the names of PIC thunks match those used by GCC so that multiple copies are eliminated by the linker. Because GCC 4.6 and earlier use __i686 in the names, it is necessary to override that predefined macro. */ #if defined __i686 && defined __ASSEMBLER__ #undef __i686 #define __i686 __i686 #endif #ifdef __ASSEMBLER__ # define GET_PC_THUNK(reg) __x86.get_pc_thunk.reg #else # define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg #endif #ifdef __ASSEMBLER__ /* Syntactic details of assembler. */ /* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ #define ALIGNARG(log2) 1<<log2 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name; /* Define an entry point visible from C. There is currently a bug in gdb which prevents us from specifying incomplete stabs information. Fake some entries here which specify the current source file. */ #define ENTRY(name) \ .globl C_SYMBOL_NAME(name); \ .type C_SYMBOL_NAME(name),@function; \ .align ALIGNARG(4); \ C_LABEL(name) \ cfi_startproc; \ CALL_MCOUNT #undef END #define END(name) \ cfi_endproc; \ ASM_SIZE_DIRECTIVE(name) #define ENTRY_CHK(name) ENTRY (name) #define END_CHK(name) END (name) /* If compiled for profiling, call `mcount' at the start of each function. */ #ifdef PROF /* The mcount code relies on a normal frame pointer being on the stack to locate our caller, so push one just for its benefit. */ #define CALL_MCOUNT \ pushl %ebp; cfi_adjust_cfa_offset (4); movl %esp, %ebp; \ cfi_def_cfa_register (ebp); call JUMPTARGET(mcount); \ popl %ebp; cfi_def_cfa (esp, 4); #else #define CALL_MCOUNT /* Do nothing. */ #endif /* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the C name space. Make sure we use an innocuous name. */ #define syscall_error __syscall_error #define mcount _mcount #define PSEUDO(name, syscall_name, args) \ .globl syscall_error; \ lose: SYSCALL_PIC_SETUP \ jmp JUMPTARGET(syscall_error); \ ENTRY (name) \ DO_CALL (syscall_name, args); \ jb lose #undef PSEUDO_END #define PSEUDO_END(name) \ END (name) # define SETUP_PIC_REG(reg) \ .ifndef GET_PC_THUNK(reg); \ .section .gnu.linkonce.t.GET_PC_THUNK(reg),"ax",@progbits; \ .globl GET_PC_THUNK(reg); \ .hidden GET_PC_THUNK(reg); \ .p2align 4; \ .type GET_PC_THUNK(reg),@function; \ GET_PC_THUNK(reg): \ movl (%esp), %e##reg; \ ret; \ .size GET_PC_THUNK(reg), . - GET_PC_THUNK(reg); \ .previous; \ .endif; \ call GET_PC_THUNK(reg) # define LOAD_PIC_REG(reg) \ SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg #undef JUMPTARGET #ifdef PIC #define JUMPTARGET(name) name##@PLT #define SYSCALL_PIC_SETUP \ pushl %ebx; \ cfi_adjust_cfa_offset (4); \ call 0f; \ 0: popl %ebx; \ cfi_adjust_cfa_offset (-4); \ addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx; #else #define JUMPTARGET(name) name #define SYSCALL_PIC_SETUP /* Nothing. */ #endif /* Local label name for asm code. */ #ifndef L #define L(name) .L##name #endif #define atom_text_section .section ".text.atom", "ax" #else /* __ASSEMBLER__ */ # define SETUP_PIC_REG_STR(reg) \ ".ifndef " GET_PC_THUNK_STR (reg) "\n" \ ".section .gnu.linkonce.t." GET_PC_THUNK_STR (reg) ",\"ax\",@progbits\n" \ ".globl " GET_PC_THUNK_STR (reg) "\n" \ ".hidden " GET_PC_THUNK_STR (reg) "\n" \ ".p2align 4\n" \ ".type " GET_PC_THUNK_STR (reg) ",@function\n" \ GET_PC_THUNK_STR (reg) ":" \ "movl (%%esp), %%e" #reg "\n" \ "ret\n" \ ".size " GET_PC_THUNK_STR (reg) ", . - " GET_PC_THUNK_STR (reg) "\n" \ ".previous\n" \ ".endif\n" \ "call " GET_PC_THUNK_STR (reg) # define LOAD_PIC_REG_STR(reg) \ SETUP_PIC_REG_STR (reg) "\naddl $_GLOBAL_OFFSET_TABLE_, %%e" #reg #endif /* __ASSEMBLER__ */
/* * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DEF_STEAM_VAULT_H #define DEF_STEAM_VAULT_H #include "CreatureAIImpl.h" #define SteamVaultScriptName "instance_steam_vault" #define DataHeader "SV" uint32 const EncounterCount = 3; enum SVDataTypes { DATA_HYDROMANCER_THESPIA = 0, DATA_MEKGINEER_STEAMRIGGER = 1, DATA_WARLORD_KALITHRESH = 2, DATA_DISTILLER = 3, // Additional Data DATA_ACCESS_PANEL_HYDRO = 4, DATA_ACCESS_PANEL_MEK = 5 }; enum SVCreatureIds { NPC_HYDROMANCER_THESPIA = 17797, NPC_MEKGINEER_STEAMRIGGER = 17796, NPC_WARLORD_KALITHRESH = 17798 }; enum SVGameObjectIds { GO_MAIN_CHAMBERS_DOOR = 183049, GO_ACCESS_PANEL_HYDRO = 184125, GO_ACCESS_PANEL_MEK = 184126 }; template <class AI, class T> inline AI* GetSteamVaultAI(T* obj) { return GetInstanceAI<AI>(obj, SteamVaultScriptName); } #endif
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // 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 Industrial Light & Magic 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. // /////////////////////////////////////////////////////////////////////////// void testWav ();
/* mediastreamer2 library - modular sound and video processing and streaming Copyright (C) 2010 Simon MORLAT (simon.morlat@linphone.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef msitc_h #define msitc_h #include "msfilter.h" #define MS_ITC_SINK_CONNECT MS_FILTER_METHOD(MS_ITC_SINK_ID,0,MSFilter) #define MS_ITC_SOURCE_UPDATED MS_FILTER_EVENT_NO_ARG(MS_ITC_SOURCE_ID,0) #endif
/* * \brief Allocator using bitmaps * \author Alexander Boettcher * \author Stefan Kalkowski * \date 2012-06-14 */ /* * Copyright (C) 2012-2013 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. */ #ifndef _INCLUDE__UTIL__BIT_ARRAY_H_ #define _INCLUDE__UTIL__BIT_ARRAY_H_ #include <util/string.h> #include <base/exception.h> #include <base/stdint.h> namespace Genode { class Bit_array_base; template <unsigned> class Bit_array; } class Genode::Bit_array_base { public: class Invalid_bit_count : public Exception {}; class Invalid_index_access : public Exception {}; class Invalid_clear : public Exception {}; class Invalid_set : public Exception {}; private: enum { BITS_PER_BYTE = 8UL, BITS_PER_WORD = sizeof(addr_t) * BITS_PER_BYTE }; unsigned _bit_cnt; unsigned _word_cnt; addr_t *_words; addr_t _word(addr_t index) const { return index / BITS_PER_WORD; } void _check_range(addr_t const index, addr_t const width) const { if ((index >= _word_cnt * BITS_PER_WORD) || width > _word_cnt * BITS_PER_WORD || _word_cnt * BITS_PER_WORD - width < index) throw Invalid_index_access(); } addr_t _mask(addr_t const index, addr_t const width, addr_t &rest) const { addr_t const shift = index - _word(index) * BITS_PER_WORD; rest = width + shift > BITS_PER_WORD ? width + shift - BITS_PER_WORD : 0; return (width >= BITS_PER_WORD) ? ~0UL << shift : ((1UL << width) - 1) << shift; } void _set(addr_t index, addr_t width, bool free) { _check_range(index, width); addr_t rest, word, mask; do { word = _word(index); mask = _mask(index, width, rest); if (free) { if ((_words[word] & mask) != mask) throw Invalid_clear(); _words[word] &= ~mask; } else { if (_words[word] & mask) throw Invalid_set(); _words[word] |= mask; } index = (_word(index) + 1) * BITS_PER_WORD; width = rest; } while (rest); } public: Bit_array_base(unsigned bits, addr_t *addr, bool clear) : _bit_cnt(bits), _word_cnt(_bit_cnt / BITS_PER_WORD), _words(addr) { if (!bits || bits % BITS_PER_WORD) throw Invalid_bit_count(); if (clear) memset(_words, 0, sizeof(addr_t)*_word_cnt); } /** * Return true if at least one bit is set between * index until index + width - 1 */ bool get(addr_t index, addr_t width) const { _check_range(index, width); bool used = false; addr_t rest, mask; do { mask = _mask(index, width, rest); used = _words[_word(index)] & mask; index = (_word(index) + 1) * BITS_PER_WORD; width = rest; } while (!used && rest); return used; } void set(addr_t const index, addr_t const width) { _set(index, width, false); } void clear(addr_t const index, addr_t const width) { _set(index, width, true); } }; template <unsigned BITS> class Genode::Bit_array : public Bit_array_base { private: static constexpr size_t _WORDS = BITS / BITS_PER_WORD; static_assert(BITS % BITS_PER_WORD == 0, "Count of bits need to be word aligned!"); addr_t _array[_WORDS]; public: Bit_array() : Bit_array_base(BITS, _array, true) { } }; #endif /* _INCLUDE__UTIL__BIT_ARRAY_H_ */
/* * Copyright (c) 2002-2003, Intel Corporation. All rights reserved. * Created by: rusty.lynch REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. Test case for assertion #12 of the sigaction system call that verifies signal-catching functions are executed on the alternate stack if the SA_ONSTACK flag is set in the sigaction.sa_flags parameter to the sigaction function call, and an alternate stack has been setup with sigaltstack(). NOTE: This test case does not attempt to verify the proper operation of sigaltstack. */ #define _XOPEN_SOURCE 600 #include <signal.h> #include <stdio.h> #include <stdlib.h> #include "posixtest.h" stack_t alt_ss; void handler(int signo) { stack_t ss; printf("Caught SIGUSR2\n"); if (sigaltstack((stack_t *)0, &ss) == -1) { perror("Unexpected error while attempting to setup test " "pre-conditions"); exit(-1); } if (ss.ss_sp != alt_ss.ss_sp || ss.ss_size != alt_ss.ss_size) { printf("Test FAILED\n"); exit(-1); } } int main() { struct sigaction act; act.sa_handler = handler; act.sa_flags = SA_ONSTACK; sigemptyset(&act.sa_mask); if (sigaction(SIGUSR2, &act, 0) == -1) { perror("Unexpected error while attempting to setup test " "pre-conditions"); return PTS_UNRESOLVED; } if ((alt_ss.ss_sp = (void *)malloc(SIGSTKSZ)) == NULL) { perror("Unexpected error while attempting to setup test " "pre-conditions"); return PTS_UNRESOLVED; } alt_ss.ss_size = SIGSTKSZ; alt_ss.ss_flags = 0; if (sigaltstack(&alt_ss, (stack_t *)0) == -1) { perror("Unexpected error while attempting to setup test " "pre-conditions"); return PTS_UNRESOLVED; } if (raise(SIGUSR2) == -1) { perror("Unexpected error while attempting to setup test " "pre-conditions"); return PTS_UNRESOLVED; } printf("Test PASSED\n"); return PTS_PASS; }
/* PHYML : a program that computes maximum likelihood phylogenies from DNA or AA homologous sequences Copyright (C) Stephane Guindon. Oct 2003 onward All parts of the source except where indicated are distributed under the GNU public licence. See http://www.opensource.org for details. */ #include <config.h> #ifndef PARS_H #define PARS_H #include "utilities.h" #include "lk.h" #include "optimiz.h" #include "models.h" #include "free.h" int Pars(t_edge *b, t_tree *tree); void Post_Order_Pars(t_node *a, t_node *d, t_tree *tree); void Pre_Order_Pars(t_node *a, t_node *d, t_tree *tree); void Get_Partial_Pars(t_tree *tree, t_edge *b_fcus, t_node *a, t_node *d); void Site_Pars(t_tree *tree); void Init_Ui_Tips(t_tree *tree); void Update_P_Pars(t_tree *tree, t_edge *b_fcus, t_node *n); int Pars_At_Given_Edge(t_edge *b, t_tree *tree); void Get_All_Partial_Pars(t_tree *tree, t_edge *b_fcus, t_node *a, t_node *d); int Update_Pars_At_Given_Edge(t_edge *b_fcus, t_tree *tree); void Init_P_Pars_Tips(t_tree *tree); void Get_Step_Mat(t_tree *tree); int Pars_Core(t_edge *b, t_tree *tree); int One_Pars_Step(t_edge *b,t_tree *tree); #endif
#include "bitlbee.h" #include "lib/http_client.h" #include "msn.h" #define GATEWAY_HOST "geo.gateway.messenger.live.com" #define GATEWAY_PORT 443 #define REQUEST_TEMPLATE \ "POST /gateway/gateway.dll?SessionID=%s&%s HTTP/1.1\r\n" \ "Host: %s\r\n" \ "Content-Length: %zd\r\n" \ "\r\n" \ "%s" static gboolean msn_gw_poll_timeout(gpointer data, gint source, b_input_condition cond); struct msn_gw *msn_gw_new(struct im_connection *ic) { struct msn_gw *gw = g_new0(struct msn_gw, 1); gw->last_host = g_strdup(GATEWAY_HOST); gw->port = GATEWAY_PORT; gw->ssl = (GATEWAY_PORT == 443); gw->poll_timeout = -1; gw->write_timeout = -1; gw->ic = ic; gw->md = ic->proto_data; gw->in = g_byte_array_new(); gw->out = g_byte_array_new(); return gw; } void msn_gw_free(struct msn_gw *gw) { if (gw->poll_timeout != -1) { b_event_remove(gw->poll_timeout); } if (gw->write_timeout != -1) { b_event_remove(gw->write_timeout); } g_byte_array_free(gw->in, TRUE); g_byte_array_free(gw->out, TRUE); g_free(gw->session_id); g_free(gw->last_host); g_free(gw); } static struct msn_gw *msn_gw_from_ic(struct im_connection *ic) { if (g_slist_find(msn_connections, ic) == NULL) { return NULL; } else { struct msn_data *md = ic->proto_data; return md->gw; } } static gboolean msn_gw_parse_session_header(struct msn_gw *gw, char *value) { int i; char **subvalues; gboolean closed = FALSE; subvalues = g_strsplit(value, "; ", 0); for (i = 0; subvalues[i]; i++) { if (strcmp(subvalues[i], "Session=close") == 0) { /* gateway closed, signal the death of the socket */ closed = TRUE; } else if (g_str_has_prefix(subvalues[i], "SessionID=")) { /* copy the part after the = to session_id*/ g_free(gw->session_id); gw->session_id = g_strdup(subvalues[i] + 10); } } g_strfreev(subvalues); return !closed; } void msn_gw_callback(struct http_request *req) { struct msn_gw *gw; char *value; if (!(gw = msn_gw_from_ic(req->data))) { return; } gw->waiting = FALSE; gw->polling = FALSE; if (req->status_code != 200 || !req->reply_body) { gw->callback(gw->md, -1, B_EV_IO_READ); return; } if (getenv("BITLBEE_DEBUG")) { fprintf(stderr, "\n\x1b[90mHTTP:%s\n", req->reply_body); fprintf(stderr, "\n\x1b[97m\n"); } if ((value = get_rfc822_header(req->reply_headers, "X-MSN-Messenger", 0))) { if (!msn_gw_parse_session_header(gw, value)) { gw->callback(gw->md, -1, B_EV_IO_READ); g_free(value); return; } g_free(value); } if ((value = get_rfc822_header(req->reply_headers, "X-MSN-Host", 0))) { g_free(gw->last_host); gw->last_host = value; /* transfer */ } if (req->body_size) { g_byte_array_append(gw->in, (const guint8 *) req->reply_body, req->body_size); if (!gw->callback(gw->md, -1, B_EV_IO_READ)) { return; } } if (gw->poll_timeout != -1) { b_event_remove(gw->poll_timeout); } gw->poll_timeout = b_timeout_add(500, msn_gw_poll_timeout, gw->ic); } void msn_gw_dorequest(struct msn_gw *gw, char *args) { char *request = NULL; char *body = NULL; size_t bodylen = 0; if (gw->out) { bodylen = gw->out->len; g_byte_array_append(gw->out, (guint8 *) "", 1); /* nullnullnull */ body = (char *) g_byte_array_free(gw->out, FALSE); gw->out = g_byte_array_new(); } if (!bodylen && !args) { args = "Action=poll&Lifespan=60"; gw->polling = TRUE; } request = g_strdup_printf(REQUEST_TEMPLATE, gw->session_id ? : "", args ? : "", gw->last_host, bodylen, body ? : ""); http_dorequest(gw->last_host, gw->port, gw->ssl, request, msn_gw_callback, gw->ic); gw->open = TRUE; gw->waiting = TRUE; g_free(body); g_free(request); } void msn_gw_open(struct msn_gw *gw) { msn_gw_dorequest(gw, "Action=open&Server=NS"); } static gboolean msn_gw_poll_timeout(gpointer data, gint source, b_input_condition cond) { struct msn_gw *gw; if (!(gw = msn_gw_from_ic(data))) { return FALSE; } gw->poll_timeout = -1; if (!gw->waiting) { msn_gw_dorequest(gw, NULL); } return FALSE; } ssize_t msn_gw_read(struct msn_gw *gw, char **buf) { size_t bodylen; if (!gw->open) { return 0; } bodylen = gw->in->len; g_byte_array_append(gw->in, (guint8 *) "", 1); /* nullnullnull */ *buf = (char *) g_byte_array_free(gw->in, FALSE); gw->in = g_byte_array_new(); return bodylen; } static gboolean msn_gw_write_cb(gpointer data, gint source, b_input_condition cond) { struct msn_gw *gw; if (!(gw = msn_gw_from_ic(data))) { return FALSE; } if (!gw->open) { msn_gw_open(gw); } else if (gw->polling || !gw->waiting) { msn_gw_dorequest(gw, NULL); } gw->write_timeout = -1; return FALSE; } void msn_gw_write(struct msn_gw *gw, char *buf, size_t len) { g_byte_array_append(gw->out, (const guint8 *) buf, len); /* do a bit of buffering here to send several commands with a single request */ if (gw->write_timeout == -1) { gw->write_timeout = b_timeout_add(1, msn_gw_write_cb, gw->ic); } }
/* conf_sap.c */ /* * Written by Stephen Henson (steve@openssl.org) for the OpenSSL project * 2001. */ /* ==================================================================== * Copyright (c) 2001 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * licensing@OpenSSL.org. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED 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 OpenSSL PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This product includes cryptographic software written by Eric Young * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). * */ #include <stdio.h> #include <openssl/crypto.h> #include "cryptlib.h" #include <openssl/conf.h> #include <openssl/dso.h> #include <openssl/x509.h> #include <openssl/asn1.h> #ifndef OPENSSL_NO_ENGINE # include <openssl/engine.h> #endif /* * This is the automatic configuration loader: it is called automatically by * OpenSSL when any of a number of standard initialisation functions are * called, unless this is overridden by calling OPENSSL_no_config() */ static int openssl_configured = 0; void OPENSSL_config(const char *config_name) { if (openssl_configured) return; OPENSSL_load_builtin_modules(); #ifndef OPENSSL_NO_ENGINE /* Need to load ENGINEs */ ENGINE_load_builtin_engines(); #endif /* Add others here? */ ERR_clear_error(); if (CONF_modules_load_file(NULL, config_name, CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) { BIO *bio_err; ERR_load_crypto_strings(); if ((bio_err = BIO_new_fp(stderr, BIO_NOCLOSE)) != NULL) { BIO_printf(bio_err, "Auto configuration failed\n"); ERR_print_errors(bio_err); BIO_free(bio_err); } exit(1); } return; } void OPENSSL_no_config() { openssl_configured = 1; }
/* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <signal.h> #include <stddef.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <libc-lock.h> #include <sysdep-cancel.h> #define SHELL_PATH "/bin/sh" /* Path of the shell. */ #define SHELL_NAME "sh" /* Name to give it. */ #ifdef _LIBC_REENTRANT static struct sigaction intr, quit; static int sa_refcntr; __libc_lock_define_initialized (static, lock); # define DO_LOCK() __libc_lock_lock (lock) # define DO_UNLOCK() __libc_lock_unlock (lock) # define INIT_LOCK() ({ __libc_lock_init (lock); sa_refcntr = 0; }) # define ADD_REF() sa_refcntr++ # define SUB_REF() --sa_refcntr #else # define DO_LOCK() # define DO_UNLOCK() # define INIT_LOCK() # define ADD_REF() 0 # define SUB_REF() 0 #endif /* Execute LINE as a shell command, returning its status. */ static int do_system (const char *line) { int status, save; pid_t pid; struct sigaction sa; #ifndef _LIBC_REENTRANT struct sigaction intr, quit; #endif sigset_t omask; sa.sa_handler = SIG_IGN; sa.sa_flags = 0; __sigemptyset (&sa.sa_mask); DO_LOCK (); if (ADD_REF () == 0) { if (__sigaction (SIGINT, &sa, &intr) < 0) { (void) SUB_REF (); goto out; } if (__sigaction (SIGQUIT, &sa, &quit) < 0) { save = errno; (void) SUB_REF (); goto out_restore_sigint; } } DO_UNLOCK (); /* We reuse the bitmap in the 'sa' structure. */ __sigaddset (&sa.sa_mask, SIGCHLD); save = errno; if (__sigprocmask (SIG_BLOCK, &sa.sa_mask, &omask) < 0) { #ifndef _LIBC if (errno == ENOSYS) __set_errno (save); else #endif { DO_LOCK (); if (SUB_REF () == 0) { save = errno; (void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL); out_restore_sigint: (void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL); __set_errno (save); } out: DO_UNLOCK (); return -1; } } #ifdef CLEANUP_HANDLER CLEANUP_HANDLER; #endif #ifdef FORK pid = FORK (); #else pid = __fork (); #endif if (pid == (pid_t) 0) { /* Child side. */ const char *new_argv[4]; new_argv[0] = SHELL_NAME; new_argv[1] = "-c"; new_argv[2] = line; new_argv[3] = NULL; /* Restore the signals. */ (void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL); (void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL); (void) __sigprocmask (SIG_SETMASK, &omask, (sigset_t *) NULL); INIT_LOCK (); /* Exec the shell. */ (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ); _exit (127); } else if (pid < (pid_t) 0) /* The fork failed. */ status = -1; else /* Parent side. */ { /* Note the system() is a cancellation point. But since we call waitpid() which itself is a cancellation point we do not have to do anything here. */ if (TEMP_FAILURE_RETRY (__waitpid (pid, &status, 0)) != pid) status = -1; } #ifdef CLEANUP_HANDLER CLEANUP_RESET; #endif save = errno; DO_LOCK (); if ((SUB_REF () == 0 && (__sigaction (SIGINT, &intr, (struct sigaction *) NULL) | __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL)) != 0) || __sigprocmask (SIG_SETMASK, &omask, (sigset_t *) NULL) != 0) { #ifndef _LIBC /* glibc cannot be used on systems without waitpid. */ if (errno == ENOSYS) __set_errno (save); else #endif status = -1; } DO_UNLOCK (); return status; } int __libc_system (const char *line) { if (line == NULL) /* Check that we have a command processor available. It might not be available after a chroot(), for example. */ return do_system ("exit 0") == 0; return do_system (line); } weak_alias (__libc_system, system)
/********************************************************************** CASTEPOptimizer - Tools to interface with CASTEP Copyright (C) 2009-2011 by David C. Lonie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ***********************************************************************/ #ifndef CASTEPOPTIMIZER_H #define CASTEPOPTIMIZER_H #include <xtalopt/optimizers/xtaloptoptimizer.h> #include <QtCore/QObject> namespace GlobalSearch { class OptBase; } namespace XtalOpt { class CASTEPOptimizer : public XtalOptOptimizer { Q_OBJECT public: CASTEPOptimizer(GlobalSearch::OptBase *parent, const QString &filename = ""); }; } // end namespace XtalOpt #endif
/* * Xilinx DRM plane header for Xilinx * * Copyright (C) 2013 Xilinx, Inc. * * Author: Hyun Woo Kwon <hyunk@xilinx.com> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _XILINX_DRM_PLANE_H_ #define _XILINX_DRM_PLANE_H_ struct drm_crtc; struct drm_plane; /* plane operations */ void xilinx_drm_plane_dpms(struct drm_plane *base_plane, int dpms); void xilinx_drm_plane_commit(struct drm_plane *base_plane); int xilinx_drm_plane_mode_set(struct drm_plane *base_plane, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, u32 src_x, u32 src_y, u32 src_w, u32 src_h); int xilinx_drm_plane_get_max_width(struct drm_plane *base_plane); u32 xilinx_drm_plane_get_format(struct drm_plane *base_plane); unsigned int xilinx_drm_plane_get_align(struct drm_plane *base_plane); /* plane manager operations */ struct xilinx_drm_plane_manager; void xilinx_drm_plane_manager_mode_set(struct xilinx_drm_plane_manager *manager, unsigned int crtc_w, unsigned int crtc_h); void xilinx_drm_plane_manager_dpms(struct xilinx_drm_plane_manager *manager, int dpms); struct drm_plane * xilinx_drm_plane_create_primary(struct xilinx_drm_plane_manager *manager, unsigned int possible_crtcs); int xilinx_drm_plane_create_planes(struct xilinx_drm_plane_manager *manager, unsigned int possible_crtcs); bool xilinx_drm_plane_check_format(struct xilinx_drm_plane_manager *manager, u32 format); int xilinx_drm_plane_get_num_planes(struct xilinx_drm_plane_manager *manager); void xilinx_drm_plane_restore(struct xilinx_drm_plane_manager *manager); struct xilinx_drm_plane_manager * xilinx_drm_plane_probe_manager(struct drm_device *drm); void xilinx_drm_plane_remove_manager(struct xilinx_drm_plane_manager *manager); #endif /* _XILINX_DRM_PLANE_H_ */
/* help_dlg.h * * Some content from gtk/help_dlg.h by Laurent Deniel <laurent.deniel@free.fr> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 2000 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ #ifndef __HELP_URL_H__ #define __HELP_URL_H__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** @file help_url.h * "Help" URLs. */ typedef enum { TOPIC_ACTION_NONE, /* pages online at www.wireshark.org */ ONLINEPAGE_HOME, ONLINEPAGE_WIKI, ONLINEPAGE_USERGUIDE, ONLINEPAGE_FAQ, ONLINEPAGE_DOWNLOAD, ONLINEPAGE_SAMPLE_FILES, ONLINEPAGE_CAPTURE_SETUP, ONLINEPAGE_NETWORK_MEDIA, ONLINEPAGE_SAMPLE_CAPTURES, ONLINEPAGE_SECURITY, ONLINEPAGE_CHIMNEY, ONLINEPAGE_ASK, /* local manual pages */ LOCALPAGE_MAN_WIRESHARK = 100, LOCALPAGE_MAN_WIRESHARK_FILTER, LOCALPAGE_MAN_CAPINFOS, LOCALPAGE_MAN_DUMPCAP, LOCALPAGE_MAN_EDITCAP, LOCALPAGE_MAN_MERGECAP, LOCALPAGE_MAN_RAWSHARK, LOCALPAGE_MAN_REORDERCAP, LOCALPAGE_MAN_TEXT2PCAP, LOCALPAGE_MAN_TSHARK, /* help pages (textfiles or local HTML User's Guide) */ HELP_CONTENT = 200, HELP_GETTING_STARTED, /* currently unused */ HELP_CAPTURE_OPTIONS_DIALOG, HELP_CAPTURE_FILTERS_DIALOG, HELP_DISPLAY_FILTERS_DIALOG, HELP_FILTER_EXPRESSION_DIALOG, HELP_COLORING_RULES_DIALOG, HELP_CONFIG_PROFILES_DIALOG, HELP_MANUAL_ADDR_RESOLVE_DIALOG, /* GTK+ only? */ HELP_PRINT_DIALOG, HELP_FIND_DIALOG, HELP_FILESET_DIALOG, HELP_FIREWALL_DIALOG, HELP_GOTO_DIALOG, HELP_CAPTURE_INTERFACES_DIALOG, HELP_CAPTURE_MANAGE_INTERFACES_DIALOG, HELP_ENABLED_PROTOCOLS_DIALOG, HELP_ENABLED_HEURISTICS_DIALOG, HELP_DECODE_AS_DIALOG, HELP_DECODE_AS_SHOW_DIALOG, HELP_FOLLOW_STREAM_DIALOG, HELP_EXPERT_INFO_DIALOG, #if HAVE_EXTCAP HELP_EXTCAP_OPTIONS_DIALOG, #endif HELP_STATS_SUMMARY_DIALOG, HELP_STATS_PROTO_HIERARCHY_DIALOG, HELP_STATS_ENDPOINTS_DIALOG, HELP_STATS_CONVERSATIONS_DIALOG, HELP_STATS_IO_GRAPH_DIALOG, HELP_STATS_COMPARE_FILES_DIALOG, HELP_STATS_LTE_MAC_TRAFFIC_DIALOG, HELP_STATS_LTE_RLC_TRAFFIC_DIALOG, HELP_STATS_WLAN_TRAFFIC_DIALOG, HELP_CAPTURE_INTERFACE_OPTIONS_DIALOG, HELP_CAPTURE_INTERFACES_DETAILS_DIALOG, HELP_PREFERENCES_DIALOG, HELP_CAPTURE_INFO_DIALOG, HELP_EXPORT_FILE_DIALOG, HELP_EXPORT_BYTES_DIALOG, HELP_EXPORT_OBJECT_LIST, HELP_OPEN_DIALOG, HELP_MERGE_DIALOG, HELP_IMPORT_DIALOG, HELP_SAVE_DIALOG, HELP_EXPORT_FILE_WIN32_DIALOG, HELP_EXPORT_BYTES_WIN32_DIALOG, HELP_OPEN_WIN32_DIALOG, HELP_MERGE_WIN32_DIALOG, HELP_SAVE_WIN32_DIALOG, HELP_TIME_SHIFT_DIALOG, HELP_FILTER_SAVE_DIALOG, HELP_TELEPHONY_VOIP_CALLS_DIALOG, HELP_RTP_ANALYSIS_DIALOG, HELP_NEW_PACKET_DIALOG, HELP_IAX2_ANALYSIS_DIALOG, HELP_TELEPHONY_RTP_PLAYER_DIALOG } topic_action_e; /** Given a filename return a filesystem URL. Relative paths are prefixed with * the datafile directory path. * * @param filename A file name or path. Relative paths will be prefixed with * the data file directory path. * @return A filesystem URL for the file or NULL on failure. A non-NULL return * value must be freed with g_free(). */ gchar *data_file_url(const gchar *filename); /** Given a topic action return its online (www.wireshark.org) URL or NULL. * * @param action Topic action, e.g. ONLINEPAGE_HOME or ONLINEPAGE_ASK. * @return A static URL or NULL. MUST NOT be freed. */ const char *topic_online_url(topic_action_e action); /** Given a page in the Wireshark User's Guide return its URL. On Windows * an attempt will be made to open User Guide URLs with HTML Help. If * the attempt succeeds NULL will be returned. * * @param page A page in the User's Guide. * @return A static URL or NULL. A non-NULL return value must be freed * with g_free(). */ gchar *user_guide_url(const gchar *page); /** Given a topic action return its URL. On Windows an attempt will be * made to open User Guide URLs with HTML Help. If the attempt succeeds * NULL will be returned. * * @param action Topic action. * @return A static URL or NULL. A non-NULL return value must be freed * with g_free(). */ gchar *topic_action_url(topic_action_e action); /** Open a specific topic (create a "Help" dialog box or open a webpage). * * @param topic the topic to display */ void topic_action(topic_action_e topic); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __HELP_URL_H__ */ /* * Editor modelines * * Local Variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * ex: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
/*************************************************************************** qgsmaplayercomboboxplugin.h -------------------------------------- Date : 25.04.2014 Copyright : (C) 2014 Denis Rouzaud Email : denis.rouzaud@gmail.com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSMAPLAYERCOMBOBOXPLUGIN_H #define QGSMAPLAYERCOMBOBOXPLUGIN_H #include <QtGlobal> #include <QtUiPlugin/QDesignerCustomWidgetInterface> #include <QtUiPlugin/QDesignerExportWidget> #include "qgis_customwidgets.h" class CUSTOMWIDGETS_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES( QDesignerCustomWidgetInterface ) public: explicit QgsMapLayerComboBoxPlugin( QObject *parent = 0 ); private: bool mInitialized; // QDesignerCustomWidgetInterface interface public: QString name() const override; QString group() const override; QString includeFile() const override; QIcon icon() const override; bool isContainer() const override; QWidget *createWidget( QWidget *parent ) override; bool isInitialized() const override; void initialize( QDesignerFormEditorInterface *core ) override; QString toolTip() const override; QString whatsThis() const override; QString domXml() const override; }; #endif // QGSMAPLAYERCOMBOBOXPLUGIN_H
/* ex: set tabstop=2 expandtab: -*- Mode: C; tab-width: 2; indent-tabs-mode nil -*- */ /** * @file acpp.c * @author Sandro Rigo * Marcus Bartholomeu * Alexandro Baldassin * * @author The ArchC Team * http://www.archc.org/ * * Computer Systems Laboratory (LSC) * IC-UNICAMP * http://www.lsc.ic.unicamp.br/ * * @version 1.0 * @date Fri, 02 Jun 2006 10:59:18 -0300 * * @brief ArchC Pre-processor implementation file * * This file contains wrapper functions to interface with * the GNU bison/flex files. In the future it should scale * to support an intermediate file representation. * * @attention Copyright (C) 2002-2006 --- The ArchC Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include <stdio.h> #include "acpp.h" /*! bison/flex related imported functions/variables */ extern int yyparse(); extern FILE* yyin; extern int line_num; extern int force_setasm_syntax; void acppInit(int force_asm_syntax) { force_setasm_syntax = force_asm_syntax; project_name = NULL; isa_filename = NULL; wordsize = 0; fetchsize = 0; ac_tgt_endian = 1; /* defaults to big endian */ yyin = NULL; } int acppLoad(char* filename) { acppUnload(); yyin = fopen(filename, "r"); if (yyin == NULL) return 0; return 1; } void acppUnload() { if (yyin != NULL) fclose(yyin); yyin = NULL; } int acppRun() { line_num = 1; return yyparse(); }
/******************************************************************************* Intel 10 Gigabit PCI Express Linux driver Copyright(c) 1999 - 2013 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. The full GNU General Public License is included in this distribution in the file called "COPYING". Contact Information: e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 *******************************************************************************/ #ifndef _IXGBE_SRIOV_H_ #define _IXGBE_SRIOV_H_ void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter); int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid, u32 vf); void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe); void ixgbe_msg_task(struct ixgbe_adapter *adapter); int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter, int vf, unsigned char *mac_addr); void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter); void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter); #ifdef IFLA_VF_MAX int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac); int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan, u8 qos); int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate); #ifdef HAVE_VF_SPOOFCHK_CONFIGURE int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting); #endif int ixgbe_ndo_get_vf_config(struct net_device *netdev, int vf, struct ifla_vf_info *ivi); #endif /* IFLA_VF_MAX */ void ixgbe_disable_sriov(struct ixgbe_adapter *adapter); #ifdef CONFIG_PCI_IOV int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask); void ixgbe_enable_sriov(struct ixgbe_adapter *adapter); #endif #ifdef IFLA_VF_MAX void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter); #endif /* IFLA_VF_MAX */ void ixgbe_dump_registers(struct ixgbe_adapter *adapter); /* * These are defined in ixgbe_type.h on behalf of the VF driver * but we need them here unwrapped for the PF driver. */ #define IXGBE_DEV_ID_82599_VF 0x10ED #define IXGBE_DEV_ID_X540_VF 0x1515 #endif /* _IXGBE_SRIOV_H_ */
/** @file pennies.c * * Source for commands to do with money. Giving them, and viewing your "score". * * This file is part of Fuzzball MUCK. Please see LICENSE.md for details. */ #include "config.h" #include "commands.h" #include "db.h" #include "interface.h" #include "match.h" #include "player.h" #include "props.h" #include "tune.h" /** * Implementation of give command * * This transfers "pennies" or value from one player to another. * Or, if you are a wizard, you can use this to take pennies or set the * value of an object. * * This does all necessary permission checks and works pretty much how * you would expect. Players cannot cause another player to exceed * tp_max_pennies * * @param descr the descriptor of the giving player * @param player the giving player * @param recipient the person receiving the gift * @param amount the amount to transfer. */ void do_give(int descr, dbref player, const char *recipient, int amount) { dbref who; struct match_data md; if (amount == 0 || (amount < 0 && !Wizard(OWNER(player)))) { notifyf(player, "You must specify a valid number of %s.", tp_pennies); return; } init_match(descr, player, recipient, TYPE_PLAYER, &md); match_neighbor(&md); match_me(&md); if (Wizard(OWNER(player))) { match_player(&md); match_absolute(&md); } if ((who = noisy_match_result(&md)) == NOTHING) { return; } if (!Wizard(OWNER(player))) { if (Typeof(who) != TYPE_PLAYER) { notify(player, "You can only give to other players."); return; } else if (GETVALUE(who) + amount > tp_max_pennies) { notifyf(player, "That player doesn't need that many %s!", tp_pennies); return; } } if (!payfor(player, amount)) { notifyf(player, "You don't have that many %s to give!", tp_pennies); return; } switch (Typeof(who)) { case TYPE_PLAYER: SETVALUE(who, GETVALUE(who) + amount); if (amount >= 0) { notifyf(player, "You give %d %s to %s.", amount, amount == 1 ? tp_penny : tp_pennies, NAME(who)); notifyf(who, "%s gives you %d %s.", NAME(player), amount, amount == 1 ? tp_penny : tp_pennies); } else { notifyf(player, "You take %d %s from %s.", -amount, amount == -1 ? tp_penny : tp_pennies, NAME(who)); notifyf(who, "%s takes %d %s from you!", NAME(player), -amount, -amount == 1 ? tp_penny : tp_pennies); } break; case TYPE_THING: SETVALUE(who, (GETVALUE(who) + amount)); notifyf(player, "You change the value of %s to %d %s.", NAME(who), GETVALUE(who), GETVALUE(who) == 1 ? tp_penny : tp_pennies); break; default: notifyf(player, "You can't give %s to that!", tp_pennies); break; } DBDIRTY(who); } /** * Implementation of score command * * Which is how you see how many "pennies" you have. * * @param player the player doing the call */ void do_score(dbref player) { notifyf(player, "You have %d %s.", GETVALUE(player), GETVALUE(player) == 1 ? tp_penny : tp_pennies); }
/* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file defines macros for use in compiler-rt assembler source. * This file is not part of the interface of this library. * * ===----------------------------------------------------------------------=== */ #ifndef COMPILERRT_ASSEMBLY_H #define COMPILERRT_ASSEMBLY_H #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) #define SEPARATOR @ #else #define SEPARATOR ; #endif #if defined(__APPLE__) #define HIDDEN(name) .private_extern name #define LOCAL_LABEL(name) L_##name // tell linker it can break up file at label boundaries #define FILE_LEVEL_DIRECTIVE .subsections_via_symbols #define SYMBOL_IS_FUNC(name) #define CONST_SECTION .const #elif defined(__ELF__) #define HIDDEN(name) .hidden name #define LOCAL_LABEL(name) .L_##name #define FILE_LEVEL_DIRECTIVE #if defined(__arm__) #define SYMBOL_IS_FUNC(name) .type name,%function #else #define SYMBOL_IS_FUNC(name) .type name,@function #endif #define CONST_SECTION .section .rodata #else // !__APPLE__ && !__ELF__ #define HIDDEN(name) #define LOCAL_LABEL(name) .L ## name #define FILE_LEVEL_DIRECTIVE #define SYMBOL_IS_FUNC(name) \ .def name SEPARATOR \ .scl 2 SEPARATOR \ .type 32 SEPARATOR \ .endef #define CONST_SECTION .section .rdata,"rd" #endif #if defined(__arm__) #if defined(__ARM_ARCH_4T__) || __ARM_ARCH >= 5 #define ARM_HAS_BX #endif #if !defined(__ARM_FEATURE_CLZ) && \ (__ARM_ARCH >= 6 || (__ARM_ARCH == 5 && !defined(__ARM_ARCH_5__))) #define __ARM_FEATURE_CLZ #endif #ifdef ARM_HAS_BX #define JMP(r) bx r #define JMPc(r, c) bx##c r #else #define JMP(r) mov pc, r #define JMPc(r, c) mov##c pc, r #endif // pop {pc} can't switch Thumb mode on ARMv4T #if __ARM_ARCH >= 5 #define POP_PC() pop {pc} #else #define POP_PC() \ pop {ip}; \ JMP(ip) #endif #if __ARM_ARCH_ISA_THUMB == 2 #define IT(cond) it cond #define ITT(cond) itt cond #else #define IT(cond) #define ITT(cond) #endif #if __ARM_ARCH_ISA_THUMB == 2 #define WIDE(op) op.w #else #define WIDE(op) op #endif #endif #define GLUE2(a, b) a##b #define GLUE(a, b) GLUE2(a, b) #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) #ifdef VISIBILITY_HIDDEN #define DECLARE_SYMBOL_VISIBILITY(name) \ HIDDEN(SYMBOL_NAME(name)) SEPARATOR #else #define DECLARE_SYMBOL_VISIBILITY(name) #endif #define DEFINE_COMPILERRT_FUNCTION(name) \ FILE_LEVEL_DIRECTIVE SEPARATOR \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ DECLARE_SYMBOL_VISIBILITY(name) \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_THUMB_FUNCTION(name) \ FILE_LEVEL_DIRECTIVE SEPARATOR \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \ .thumb_func SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ FILE_LEVEL_DIRECTIVE SEPARATOR \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ HIDDEN(SYMBOL_NAME(name)) SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \ .globl name SEPARATOR \ SYMBOL_IS_FUNC(name) SEPARATOR \ HIDDEN(name) SEPARATOR \ name: #define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR #if defined(__ARM_EABI__) #define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \ DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name) #else #define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) #endif #ifdef __ELF__ #define END_COMPILERRT_FUNCTION(name) \ .size SYMBOL_NAME(name), . - SYMBOL_NAME(name) #else #define END_COMPILERRT_FUNCTION(name) #endif #endif /* COMPILERRT_ASSEMBLY_H */
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "curl_setup.h" #if defined(USE_WIN32_IDN) || ((defined(USE_WINDOWS_SSPI) || \ defined(CURL_LDAP_WIN)) && defined(UNICODE)) /* * MultiByte conversions using Windows kernel32 library. */ #include "curl_multibyte.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> #include "curl_memory.h" /* The last #include file should be: */ #include "memdebug.h" wchar_t *Curl_convert_UTF8_to_wchar(const char *str_utf8) { wchar_t *str_w = NULL; if(str_utf8) { int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str_utf8, -1, NULL, 0); if(str_w_len > 0) { str_w = malloc(str_w_len * sizeof(wchar_t)); if(str_w) { if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w, str_w_len) == 0) { Curl_safefree(str_w); } } } } return str_w; } char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w) { char *str_utf8 = NULL; if(str_w) { int str_utf8_len = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL, 0, NULL, NULL); if(str_utf8_len > 0) { str_utf8 = malloc(str_utf8_len * sizeof(wchar_t)); if(str_utf8) { if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, str_utf8_len, NULL, FALSE) == 0) { Curl_safefree(str_utf8); } } } } return str_utf8; } #endif /* USE_WIN32_IDN || ((USE_WINDOWS_SSPI || CURL_LDAP_WIN) && UNICODE) */
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. #ifndef O2_FRAMEWORK_STRINGCONTEXT_H_ #define O2_FRAMEWORK_STRINGCONTEXT_H_ #include "Framework/FairMQDeviceProxy.h" #include <vector> #include <string> #include <memory> #include <fairmq/FwdDecls.h> namespace o2::framework { /// A context which holds `std::string`s being passed around /// useful for debug purposes and as an illustration of /// how to add a context for a new kind of object. class StringContext { public: StringContext(FairMQDeviceProxy proxy) : mProxy{proxy} { } struct MessageRef { std::unique_ptr<FairMQMessage> header; std::unique_ptr<std::string> payload; std::string channel; }; using Messages = std::vector<MessageRef>; void addString(std::unique_ptr<FairMQMessage> header, std::unique_ptr<std::string> s, const std::string& channel); Messages::iterator begin() { return mMessages.begin(); } Messages::iterator end() { return mMessages.end(); } size_t size() { return mMessages.size(); } void clear(); FairMQDeviceProxy& proxy() { return mProxy; } private: FairMQDeviceProxy mProxy; Messages mMessages; }; } // namespace o2::framework #endif // O2_FRAMEWORK_STRINGCONTEXT_H_
/* sim_megax.c Copyright 2008, 2009 Michel Pollet <buserror@gmail.com> This file is part of simavr. simavr 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. simavr 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 simavr. If not, see <http://www.gnu.org/licenses/>. */ #include "sim_avr.h" #include "sim_megax.h" void mx_init(struct avr_t * avr) { struct mcu_t * mcu = (struct mcu_t*)avr; avr_eeprom_init(avr, &mcu->eeprom); avr_flash_init(avr, &mcu->selfprog); avr_watchdog_init(avr, &mcu->watchdog); avr_extint_init(avr, &mcu->extint); // we try to initialize this one, in case it's declared avr_ioport_init(avr, &mcu->porta); avr_ioport_init(avr, &mcu->portb); avr_ioport_init(avr, &mcu->portc); avr_ioport_init(avr, &mcu->portd); avr_uart_init(avr, &mcu->uart); avr_acomp_init(avr, &mcu->acomp); avr_adc_init(avr, &mcu->adc); avr_timer_init(avr, &mcu->timer0); avr_timer_init(avr, &mcu->timer1); avr_timer_init(avr, &mcu->timer2); avr_spi_init(avr, &mcu->spi); avr_twi_init(avr, &mcu->twi); } void mx_reset(struct avr_t * avr) { // struct mcu_t * mcu = (struct mcu_t*)avr; }
/*@ begin PerfTuning ( import spec bratu; ) @*/ int i, j, k; double hx = 1.0/(ih-1); double hy = 1.0/(jh-1); double sc = hx*hy*lambda; double hxdhy = hx/hy; double hydhx = hy/hx; /*@ begin Loop ( transform UnrollJam(ufactor=Uj) for (j = jl; j <= jh-1; j++) transform UnrollJam(ufactor=Ui) for (i = il; i <= ih-1; i++) { f[j][i] = (2.0*x[j][i] - x[j][i-1] - x[j][i+1]) * hydhx + (2.0*x[j][i] - x[j-1][i] - x[j+1][i])*hxdhy - sc*exp(x[j][i]); } ) @*/ { for (j=jl; j<=jh-3; j=j+3) { for (i=il; i<=ih-8; i=i+8) { f[j][i]=(2*x[j][i]-x[j][i-1]-x[j][i+1])*hydhx+(2*x[j][i]-x[j-1][i]-x[j+1][i])*hxdhy-sc*exp(x[j][i]); f[(j+1)][i]=(2*x[(j+1)][i]-x[(j+1)][i-1]-x[(j+1)][i+1])*hydhx+(2*x[(j+1)][i]-x[j][i]-x[j+2][i])*hxdhy-sc*exp(x[(j+1)][i]); f[(j+2)][i]=(2*x[(j+2)][i]-x[(j+2)][i-1]-x[(j+2)][i+1])*hydhx+(2*x[(j+2)][i]-x[j+1][i]-x[j+3][i])*hxdhy-sc*exp(x[(j+2)][i]); f[j][(i+1)]=(2*x[j][(i+1)]-x[j][i]-x[j][i+2])*hydhx+(2*x[j][(i+1)]-x[j-1][(i+1)]-x[j+1][(i+1)])*hxdhy-sc*exp(x[j][(i+1)]); f[(j+1)][(i+1)]=(2*x[(j+1)][(i+1)]-x[(j+1)][i]-x[(j+1)][i+2])*hydhx+(2*x[(j+1)][(i+1)]-x[j][(i+1)]-x[j+2][(i+1)])*hxdhy-sc*exp(x[(j+1)][(i+1)]); f[(j+2)][(i+1)]=(2*x[(j+2)][(i+1)]-x[(j+2)][i]-x[(j+2)][i+2])*hydhx+(2*x[(j+2)][(i+1)]-x[j+1][(i+1)]-x[j+3][(i+1)])*hxdhy-sc*exp(x[(j+2)][(i+1)]); f[j][(i+2)]=(2*x[j][(i+2)]-x[j][i+1]-x[j][i+3])*hydhx+(2*x[j][(i+2)]-x[j-1][(i+2)]-x[j+1][(i+2)])*hxdhy-sc*exp(x[j][(i+2)]); f[(j+1)][(i+2)]=(2*x[(j+1)][(i+2)]-x[(j+1)][i+1]-x[(j+1)][i+3])*hydhx+(2*x[(j+1)][(i+2)]-x[j][(i+2)]-x[j+2][(i+2)])*hxdhy-sc*exp(x[(j+1)][(i+2)]); f[(j+2)][(i+2)]=(2*x[(j+2)][(i+2)]-x[(j+2)][i+1]-x[(j+2)][i+3])*hydhx+(2*x[(j+2)][(i+2)]-x[j+1][(i+2)]-x[j+3][(i+2)])*hxdhy-sc*exp(x[(j+2)][(i+2)]); f[j][(i+3)]=(2*x[j][(i+3)]-x[j][i+2]-x[j][i+4])*hydhx+(2*x[j][(i+3)]-x[j-1][(i+3)]-x[j+1][(i+3)])*hxdhy-sc*exp(x[j][(i+3)]); f[(j+1)][(i+3)]=(2*x[(j+1)][(i+3)]-x[(j+1)][i+2]-x[(j+1)][i+4])*hydhx+(2*x[(j+1)][(i+3)]-x[j][(i+3)]-x[j+2][(i+3)])*hxdhy-sc*exp(x[(j+1)][(i+3)]); f[(j+2)][(i+3)]=(2*x[(j+2)][(i+3)]-x[(j+2)][i+2]-x[(j+2)][i+4])*hydhx+(2*x[(j+2)][(i+3)]-x[j+1][(i+3)]-x[j+3][(i+3)])*hxdhy-sc*exp(x[(j+2)][(i+3)]); f[j][(i+4)]=(2*x[j][(i+4)]-x[j][i+3]-x[j][i+5])*hydhx+(2*x[j][(i+4)]-x[j-1][(i+4)]-x[j+1][(i+4)])*hxdhy-sc*exp(x[j][(i+4)]); f[(j+1)][(i+4)]=(2*x[(j+1)][(i+4)]-x[(j+1)][i+3]-x[(j+1)][i+5])*hydhx+(2*x[(j+1)][(i+4)]-x[j][(i+4)]-x[j+2][(i+4)])*hxdhy-sc*exp(x[(j+1)][(i+4)]); f[(j+2)][(i+4)]=(2*x[(j+2)][(i+4)]-x[(j+2)][i+3]-x[(j+2)][i+5])*hydhx+(2*x[(j+2)][(i+4)]-x[j+1][(i+4)]-x[j+3][(i+4)])*hxdhy-sc*exp(x[(j+2)][(i+4)]); f[j][(i+5)]=(2*x[j][(i+5)]-x[j][i+4]-x[j][i+6])*hydhx+(2*x[j][(i+5)]-x[j-1][(i+5)]-x[j+1][(i+5)])*hxdhy-sc*exp(x[j][(i+5)]); f[(j+1)][(i+5)]=(2*x[(j+1)][(i+5)]-x[(j+1)][i+4]-x[(j+1)][i+6])*hydhx+(2*x[(j+1)][(i+5)]-x[j][(i+5)]-x[j+2][(i+5)])*hxdhy-sc*exp(x[(j+1)][(i+5)]); f[(j+2)][(i+5)]=(2*x[(j+2)][(i+5)]-x[(j+2)][i+4]-x[(j+2)][i+6])*hydhx+(2*x[(j+2)][(i+5)]-x[j+1][(i+5)]-x[j+3][(i+5)])*hxdhy-sc*exp(x[(j+2)][(i+5)]); f[j][(i+6)]=(2*x[j][(i+6)]-x[j][i+5]-x[j][i+7])*hydhx+(2*x[j][(i+6)]-x[j-1][(i+6)]-x[j+1][(i+6)])*hxdhy-sc*exp(x[j][(i+6)]); f[(j+1)][(i+6)]=(2*x[(j+1)][(i+6)]-x[(j+1)][i+5]-x[(j+1)][i+7])*hydhx+(2*x[(j+1)][(i+6)]-x[j][(i+6)]-x[j+2][(i+6)])*hxdhy-sc*exp(x[(j+1)][(i+6)]); f[(j+2)][(i+6)]=(2*x[(j+2)][(i+6)]-x[(j+2)][i+5]-x[(j+2)][i+7])*hydhx+(2*x[(j+2)][(i+6)]-x[j+1][(i+6)]-x[j+3][(i+6)])*hxdhy-sc*exp(x[(j+2)][(i+6)]); f[j][(i+7)]=(2*x[j][(i+7)]-x[j][i+6]-x[j][i+8])*hydhx+(2*x[j][(i+7)]-x[j-1][(i+7)]-x[j+1][(i+7)])*hxdhy-sc*exp(x[j][(i+7)]); f[(j+1)][(i+7)]=(2*x[(j+1)][(i+7)]-x[(j+1)][i+6]-x[(j+1)][i+8])*hydhx+(2*x[(j+1)][(i+7)]-x[j][(i+7)]-x[j+2][(i+7)])*hxdhy-sc*exp(x[(j+1)][(i+7)]); f[(j+2)][(i+7)]=(2*x[(j+2)][(i+7)]-x[(j+2)][i+6]-x[(j+2)][i+8])*hydhx+(2*x[(j+2)][(i+7)]-x[j+1][(i+7)]-x[j+3][(i+7)])*hxdhy-sc*exp(x[(j+2)][(i+7)]); } for (; i<=ih-1; i=i+1) { f[j][i]=(2*x[j][i]-x[j][i-1]-x[j][i+1])*hydhx+(2*x[j][i]-x[j-1][i]-x[j+1][i])*hxdhy-sc*exp(x[j][i]); f[(j+1)][i]=(2*x[(j+1)][i]-x[(j+1)][i-1]-x[(j+1)][i+1])*hydhx+(2*x[(j+1)][i]-x[j][i]-x[j+2][i])*hxdhy-sc*exp(x[(j+1)][i]); f[(j+2)][i]=(2*x[(j+2)][i]-x[(j+2)][i-1]-x[(j+2)][i+1])*hydhx+(2*x[(j+2)][i]-x[j+1][i]-x[j+3][i])*hxdhy-sc*exp(x[(j+2)][i]); } } for (; j<=jh-1; j=j+1) { for (i=il; i<=ih-8; i=i+8) { f[j][i]=(2*x[j][i]-x[j][i-1]-x[j][i+1])*hydhx+(2*x[j][i]-x[j-1][i]-x[j+1][i])*hxdhy-sc*exp(x[j][i]); f[j][(i+1)]=(2*x[j][(i+1)]-x[j][i]-x[j][i+2])*hydhx+(2*x[j][(i+1)]-x[j-1][(i+1)]-x[j+1][(i+1)])*hxdhy-sc*exp(x[j][(i+1)]); f[j][(i+2)]=(2*x[j][(i+2)]-x[j][i+1]-x[j][i+3])*hydhx+(2*x[j][(i+2)]-x[j-1][(i+2)]-x[j+1][(i+2)])*hxdhy-sc*exp(x[j][(i+2)]); f[j][(i+3)]=(2*x[j][(i+3)]-x[j][i+2]-x[j][i+4])*hydhx+(2*x[j][(i+3)]-x[j-1][(i+3)]-x[j+1][(i+3)])*hxdhy-sc*exp(x[j][(i+3)]); f[j][(i+4)]=(2*x[j][(i+4)]-x[j][i+3]-x[j][i+5])*hydhx+(2*x[j][(i+4)]-x[j-1][(i+4)]-x[j+1][(i+4)])*hxdhy-sc*exp(x[j][(i+4)]); f[j][(i+5)]=(2*x[j][(i+5)]-x[j][i+4]-x[j][i+6])*hydhx+(2*x[j][(i+5)]-x[j-1][(i+5)]-x[j+1][(i+5)])*hxdhy-sc*exp(x[j][(i+5)]); f[j][(i+6)]=(2*x[j][(i+6)]-x[j][i+5]-x[j][i+7])*hydhx+(2*x[j][(i+6)]-x[j-1][(i+6)]-x[j+1][(i+6)])*hxdhy-sc*exp(x[j][(i+6)]); f[j][(i+7)]=(2*x[j][(i+7)]-x[j][i+6]-x[j][i+8])*hydhx+(2*x[j][(i+7)]-x[j-1][(i+7)]-x[j+1][(i+7)])*hxdhy-sc*exp(x[j][(i+7)]); } for (; i<=ih-1; i=i+1) { f[j][i]=(2.0*x[j][i]-x[j][i-1]-x[j][i+1])*hydhx+(2.0*x[j][i]-x[j-1][i]-x[j+1][i])*hxdhy-sc*exp(x[j][i]); } } } /*@ end @*/ /*@ end @*/