text
stringlengths
4
6.14k
/* * Copyright 2016, Simula Research Laboratory * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #include <vector> #include <cuda_runtime.h> namespace popsift { namespace cuda { class device_prop_t { int _num_devices; std::vector<cudaDeviceProp*> _properties; public: device_prop_t( ); ~device_prop_t( ); void print( ); void set( int n, bool print_choice = false ); }; }}
// This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>. // // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of // Mathematics and Physics, Charles University in Prague, Czech Republic. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #pragma once #include "common.h" #include "utils/string_piece.h" namespace ufal { namespace morphodita { struct derivated_lemma { string lemma; }; class derivator { public: virtual ~derivator() {} // For given lemma, return the parent in the derivation graph. // The lemma is assumed to be lemma id and any lemma comments are ignored. virtual bool parent(string_piece lemma, derivated_lemma& parent) const = 0; // For given lemma, return the children in the derivation graph. // The lemma is assumed to be lemma id and any lemma comments are ignored. virtual bool children(string_piece lemma, vector<derivated_lemma>& children) const = 0; }; } // namespace morphodita } // namespace ufal
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_DOMImplementation_h #define mozilla_dom_DOMImplementation_h #include "nsIDOMDOMImplementation.h" #include "nsWrapperCache.h" #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsIDocument.h" #include "nsIScriptGlobalObject.h" #include "nsIURI.h" #include "nsIWeakReferenceUtils.h" #include "nsString.h" class nsIDOMDocument; namespace mozilla { namespace dom { class DocumentType; class DOMImplementation final : public nsIDOMDOMImplementation , public nsWrapperCache { ~DOMImplementation() { } public: DOMImplementation(nsIDocument* aOwner, nsIGlobalObject* aScriptObject, nsIURI* aDocumentURI, nsIURI* aBaseURI) : mOwner(aOwner) , mScriptObject(do_GetWeakReference(aScriptObject)) , mDocumentURI(aDocumentURI) , mBaseURI(aBaseURI) { MOZ_ASSERT(aOwner); } NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMImplementation) nsIDocument* GetParentObject() const { return mOwner; } virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; // nsIDOMDOMImplementation NS_DECL_NSIDOMDOMIMPLEMENTATION bool HasFeature() { return true; } already_AddRefed<DocumentType> CreateDocumentType(const nsAString& aQualifiedName, const nsAString& aPublicId, const nsAString& aSystemId, ErrorResult& aRv); already_AddRefed<nsIDocument> CreateDocument(const nsAString& aNamespaceURI, const nsAString& aQualifiedName, nsIDOMDocumentType* aDoctype, ErrorResult& aRv); already_AddRefed<nsIDocument> CreateHTMLDocument(const Optional<nsAString>& aTitle, ErrorResult& aRv); private: nsresult CreateDocument(const nsAString& aNamespaceURI, const nsAString& aQualifiedName, nsIDOMDocumentType* aDoctype, nsIDocument** aDocument, nsIDOMDocument** aDOMDocument); nsresult CreateHTMLDocument(const nsAString& aTitle, nsIDocument** aDocument, nsIDOMDocument** aDOMDocument); nsCOMPtr<nsIDocument> mOwner; nsWeakPtr mScriptObject; nsCOMPtr<nsIURI> mDocumentURI; nsCOMPtr<nsIURI> mBaseURI; }; } // namespace dom } // namespace mozilla #endif // mozilla_dom_DOMImplementation_h
// // TVHEpgStore.h // TVHeadend iPhone Client // // Created by Luis Fernandes on 2/10/13. // Copyright 2013 Luis Fernandes // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // #import "TVHEpgStore.h" @class TVHServer; @class TVHEpgStore; @interface TVHEpgStoreAbstract : NSObject <TVHEpgStore, TVHApiClientDelegate> @property (nonatomic, strong) NSString *filterToProgramTitle; @property (nonatomic, strong) NSString *filterToChannelName; @property (nonatomic, strong) NSString *filterToTagName; @property (nonatomic, strong) NSString *filterToContentTypeId; @property NSInteger filterStart; @property NSInteger filterLimit; @property (nonatomic) BOOL fullTextSearch; @property (nonatomic, weak) TVHServer *tvhServer; @property (nonatomic, strong) NSString *statsEpgName; - (id)initWithStatsEpgName:(NSString*)statsEpgName withTvhServer:(TVHServer*)tvhServer; - (void)appWillEnterForeground:(NSNotification*)note; - (NSInteger)numberOfRequestedEpgItems; - (void)downloadAllEpgItems; - (void)downloadEpgList; - (void)downloadMoreEpgList; - (void)clearEpgData; - (NSArray*)epgStoreItems; - (NSDictionary*)epgByChannelCopy; - (NSArray*)channelsOfEpgByChannel; - (void)setDelegate:(id <TVHEpgStoreDelegate>)delegate; - (void)removeOldProgramsFromStore; - (BOOL)isLastEpgFromThePast; - (void)setFilterToChannel:(TVHChannel *)filterToChannel; - (void)setFilterToTag:(TVHTag *)filterToTag; - (NSInteger)totalEventCount; @end
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libetonyek project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef KEYENUM_H_INCLUDED #define KEYENUM_H_INCLUDED namespace libetonyek { enum KEYTransitionStyleType { KEY_TRANSITION_STYLE_TYPE_INHERITED, KEY_TRANSITION_STYLE_TYPE_NONE, KEY_TRANSITION_STYLE_TYPE_NAMED }; } #endif // KEYENUM_H_INCLUDED /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * interface for rendering objects that manually create subtrees of * anonymous content */ #ifndef nsIAnonymousContentCreator_h___ #define nsIAnonymousContentCreator_h___ #include "nsQueryFrame.h" #include "nsStyleContext.h" #include "nsTArrayForwardDeclare.h" class nsIContent; class nsIFrame; /** * Any source for anonymous content can implement this interface to provide it. * HTML frames like nsFileControlFrame currently use this. * * @see nsCSSFrameConstructor */ class nsIAnonymousContentCreator { public: NS_DECL_QUERYFRAME_TARGET(nsIAnonymousContentCreator) struct ContentInfo { explicit ContentInfo(nsIContent* aContent) : mContent(aContent) {} ContentInfo(nsIContent* aContent, nsStyleContext* aStyleContext) : mContent(aContent), mStyleContext(aStyleContext) {} nsIContent* mContent; RefPtr<nsStyleContext> mStyleContext; nsTArray<ContentInfo> mChildren; }; /** * Creates "native" anonymous content and adds the created content to * the aElements array. None of the returned elements can be nullptr. * * If the anonymous content creator sets the editable flag on some * of the elements that it creates, the flag will be applied to the node * upon being bound to the document. * * @note The returned elements are owned by this object. This object is * responsible for calling UnbindFromTree on the elements it returned * from CreateAnonymousContent when appropriate (i.e. before releasing * them). * * @note Implementations of this method that add items to mChildren must not * hook them up to any parent since frame construction takes care of * that. */ virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements)=0; /** * Appends "native" anonymous children created by CreateAnonymousContent() * to the given content list depending on the filter. * * @see nsIContent::GetChildren for set of values used for filter. Currently, * eSkipPlaceholderContent is the only flag that any implementation of * this method heeds. */ virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements, uint32_t aFilter) = 0; /** * Implementations can override this method to create special frames for the * anonymous content returned from CreateAnonymousContent. * By default this method returns nullptr, which means the default frame * is created. */ virtual nsIFrame* CreateFrameFor(nsIContent* aContent) { return nullptr; } }; #endif
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _CCAPIAPI_FEATURE_INFO_H_ #define _CCAPIAPI_FEATURE_INFO_H_ #include "ccapi_types.h" /** * Get the physical button number on which this feature is configured * @param feature - feature reference handle * @return cc_int32_t - button assgn to the feature */ cc_int32_t CCAPI_featureInfo_getButton(cc_featureinfo_ref_t feature); /** * Get the featureID * @param feature - feature reference handle * @return cc_int32_t - button assgn to the feature */ cc_int32_t CCAPI_featureInfo_getFeatureID(cc_featureinfo_ref_t feature); /** * Get the feature Name * @param feature - feature reference handle * @return cc_string_t - handle of the feature created */ cc_string_t CCAPI_featureInfo_getDisplayName(cc_featureinfo_ref_t feature); /** * Get the speeddial Number * @param feature - feature reference handle * @return cc_string_t - handle of the feature created */ cc_string_t CCAPI_featureInfo_getSpeedDialNumber(cc_featureinfo_ref_t feature); /** * Get the contact * @param feature - feature reference handle * @return cc_string_t - handle of the feature created */ cc_string_t CCAPI_featureInfo_getContact(cc_featureinfo_ref_t feature); /** * Get the retrieval prefix * @param feature - feature reference handle * @return cc_string_t - handle of the feature created */ cc_string_t CCAPI_featureInfo_getRetrievalPrefix(cc_featureinfo_ref_t feature); /** * Get BLF state * @param feature - feature reference handle * @return cc_string_t - handle of the feature created */ cc_blf_state_t CCAPI_featureInfo_getBLFState(cc_featureinfo_ref_t feature); /** * Get the feature option mask * @param feature - feature reference handle * @return cc_int32_t - button assgn to the feature */ cc_int32_t CCAPI_featureInfo_getFeatureOptionMask(cc_featureinfo_ref_t feature); #endif /* _CCAPIAPI_FEATURE_INFO_H_ */
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2008-2015 MonetDB B.V. */ /* ! ENSURE THAT THESE LOCAL MACROS ARE UNDEFINED AT THE END OF THIS FILE ! */ /* stringify token */ #define _STRNG_(s) #s #define STRNG(t) _STRNG_(t) /* concatenate two or four tokens */ #define CONCAT_2(a,b) a##b #define CONCAT_4(a,b,c,d) a##b##c##d #define NIL(t) CONCAT_2(t,_nil) #define TPE(t) CONCAT_2(TYPE_,t) #define FUN(a,b,c,d) CONCAT_4(a,b,c,d) str FUN(,TP1,_dec2_,TP2) (TP2 *res, const int *s1, const TP1 *v) { int scale = *s1; TP2 r, h = (*v < 0) ? -5 : 5; /* shortcut nil */ if (*v == NIL(TP1)) { *res = NIL(TP2); return (MAL_SUCCEED); } /* since the TP2 type is bigger than or equal to the TP1 type, it will always fit */ r = (TP2) *v; if (scale) r = (TP2) ((r + h * scales[scale - 1]) / scales[scale]); *res = r; return (MAL_SUCCEED); } str FUN(,TP1,_dec2dec_,TP2) (TP2 *res, const int *S1, const TP1 *v, const int *d2, const int *S2) { int p = *d2, inlen = 1; TP1 cpyval = *v; int s1 = *S1, s2 = *S2; TP2 r, h = (*v < 0) ? -5 : 5; /* shortcut nil */ if (*v == NIL(TP1)) { *res = NIL(TP2); return (MAL_SUCCEED); } /* count the number of digits in the input */ while (cpyval /= 10) inlen++; /* rounding is allowed */ inlen += (s2 - s1); if (p && inlen > p) { throw(SQL, "convert", "22003!too many digits (%d > %d)", inlen, p); } /* since the TP2 type is bigger than or equal to the TP1 type, it will always fit */ r = (TP2) *v; if (s2 > s1) r *= (TP2) scales[s2 - s1]; else if (s2 != s1) r = (TP2) ((r + h * scales[s1 - s2 - 1]) / scales[s1 - s2]); *res = r; return (MAL_SUCCEED); } str FUN(,TP1,_num2dec_,TP2) (TP2 *res, const TP1 *v, const int *d2, const int *s2) { int zero = 0; return FUN(,TP1,_dec2dec_,TP2)(res, &zero, v, d2, s2); } str FUN(bat,TP1,_dec2_,TP2) (bat *res, const int *s1, const bat *bid) { BAT *b, *bn; TP1 *p, *q; char *msg = NULL; int scale = *s1; TP2 *o; if ((b = BATdescriptor(*bid)) == NULL) { throw(SQL, "batcalc."STRNG(FUN(,TP1,_dec2_,TP2)), "Cannot access descriptor"); } bn = BATnew(TYPE_void, TPE(TP2), BATcount(b), TRANSIENT); if (bn == NULL) { BBPunfix(b->batCacheid); throw(SQL, "sql."STRNG(FUN(,TP1,_dec2_,TP2)), MAL_MALLOC_FAIL); } bn->hsorted = b->hsorted; bn->hrevsorted = b->hrevsorted; BATseqbase(bn, b->hseqbase); o = (TP2 *) Tloc(bn, BUNfirst(bn)); p = (TP1 *) Tloc(b, BUNfirst(b)); q = (TP1 *) Tloc(b, BUNlast(b)); bn->T->nonil = 1; if (b->T->nonil) { if (scale) for (; p < q; p++, o++) *o = (TP2) ((*p + (*p < 0 ? -5 : 5) * scales[scale - 1]) / scales[scale]); else for (; p < q; p++, o++) *o = (TP2) (*p); } else { for (; p < q; p++, o++) { if (*p == NIL(TP1)) { *o = NIL(TP2); bn->T->nonil = FALSE; } else if (scale) { *o = (TP2) ((*p + (*p < 0 ? -5 : 5) * scales[scale - 1]) / scales[scale]); } else { *o = (TP2) (*p); } } } BATsetcount(bn, BATcount(b)); bn->hrevsorted = bn->batCount <= 1; bn->tsorted = 0; bn->trevsorted = 0; BATkey(BATmirror(bn), FALSE); if (!(bn->batDirty & 2)) BATsetaccess(bn, BAT_READ); BBPkeepref(*res = bn->batCacheid); BBPunfix(b->batCacheid); return msg; } str FUN(bat,TP1,_dec2dec_,TP2) (bat *res, const int *S1, const bat *bid, const int *d2, const int *S2) { BAT *b, *dst; BATiter bi; BUN p, q; char *msg = NULL; if ((b = BATdescriptor(*bid)) == NULL) { throw(SQL, "batcalc."STRNG(FUN(,TP1,_dec2dec_,TP2)), "Cannot access descriptor"); } bi = bat_iterator(b); dst = BATnew(TYPE_void, TPE(TP2), BATcount(b), TRANSIENT); if (dst == NULL) { BBPunfix(b->batCacheid); throw(SQL, "sql."STRNG(FUN(,TP1,_dec2dec_,TP2)), MAL_MALLOC_FAIL); } BATseqbase(dst, b->hseqbase); BATloop(b, p, q) { TP1 *v = (TP1 *) BUNtail(bi, p); TP2 r; msg = FUN(,TP1,_dec2dec_,TP2)(&r, S1, v, d2, S2); if (msg) { BBPunfix(dst->batCacheid); BBPunfix(b->batCacheid); return msg; } BUNappend(dst, &r, FALSE); } BATseqbase(dst, b->hseqbase); BBPkeepref(*res = dst->batCacheid); BBPunfix(b->batCacheid); return msg; } str FUN(bat,TP1,_num2dec_,TP2) (bat *res, const bat *bid, const int *d2, const int *s2) { BAT *b, *dst; BATiter bi; BUN p, q; char *msg = NULL; if ((b = BATdescriptor(*bid)) == NULL) { throw(SQL, "batcalc."STRNG(FUN(,TP1,_num2dec_,TP2)), "Cannot access descriptor"); } bi = bat_iterator(b); dst = BATnew(TYPE_void, TPE(TP2), BATcount(b), TRANSIENT); if (dst == NULL) { BBPunfix(b->batCacheid); throw(SQL, "sql."STRNG(FUN(,TP1,_num2dec_,TP2)), MAL_MALLOC_FAIL); } BATseqbase(dst, b->hseqbase); BATloop(b, p, q) { TP1 *v = (TP1 *) BUNtail(bi, p); TP2 r; msg = FUN(,TP1,_num2dec_,TP2)(&r, v, d2, s2); if (msg) { BBPunfix(dst->batCacheid); BBPunfix(b->batCacheid); return msg; } BUNappend(dst, &r, FALSE); } BATseqbase(dst, b->hseqbase); BBPkeepref(*res = dst->batCacheid); BBPunfix(b->batCacheid); return msg; } /* undo local defines */ #undef FUN #undef NIL #undef TPE #undef CONCAT_2 #undef CONCAT_4 #undef STRNG #undef _STRNG_
#ifndef LOGGER_H #define LOGGER_H #include <cstdarg> #include <chrono> #include <cstdio> #include <vector> #include "Utils.h" class Logger { public: enum PRIORITY { INFO, WARNING, ERROR, FATAL }; enum OUTPUT { STDOUT = Utils::bit(0), STDERR = Utils::bit(1), LOGFILE = Utils::bit(2) }; Logger(PRIORITY minPrio, char output, const char* file = ""); ~Logger(); void info(const char* format, ...); void warning(const char* format, ...); void error(const char* format, ...); void fatal(const char* format, ...); private: void log(PRIORITY prio, const char* format, va_list args); static std::chrono::system_clock::time_point _startClock; PRIORITY _minPrio; std::vector<FILE*> _outputs; FILE* _file; }; #endif
/* Copyright (c) 2016 Catalin Alexandru Nastase * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #include <RuntimeConfig.h> #include <Reflection/TypeConfig.h> #include <functional> #include <string> #include <vector> #include <set> namespace reflection { class Any; class Field; struct Attribute; class RUNTIME_API Type { public: typedef std::vector<Type> List; typedef std::set<Type> Set; static const TypeID Invalid = 0; Type(void); Type(const Type &rhs); Type(TypeID id); operator bool(void) const; Type &operator=(const Type &rhs); bool operator<(const Type &rhs) const; bool operator>(const Type &rhs) const; bool operator<=(const Type &rhs) const; bool operator>=(const Type &rhs) const; bool operator==(const Type &rhs) const; bool operator!=(const Type &rhs) const; TypeID GetID(void) const; const std::string &GetName(void) const; bool IsValid(void) const; bool IsPrimitive(void) const; bool IsEnum(void) const; bool IsPointer(void) const; bool IsClass(void) const; Any Create() const; Any CreateDynamic() const; void Destroy(Any &instance) const; template<typename AttributeType> const AttributeType* GetAttribute(void) const; std::vector<std::pair<Type, const Attribute *>> GetAttributes(void) const; const Field &GetField(const std::string &name) const; std::vector<Field> GetFields(void) const; bool IsDerivedFrom(const Type &other) const; template<typename T> bool IsDerivedFrom(void) const; bool IsTypeOf(const Type &other) const; template<typename T> bool IsTypeOf(void) const; const Set &GetBaseClasses(void) const; private: friend class std::allocator<Type>; friend class TypeData; friend class Any; friend class Field; TypeID m_ID; }; template<typename AttributeType> const AttributeType* Type::GetAttribute(void) const { return ReflectionManager::Instance().GetTypeData(m_ID).GetAttribute<AttributeType>(); } template<typename T> bool Type::IsDerivedFrom(void) const { return IsDerivedFrom(typeof(T)); } template<typename T> bool Type::IsTypeOf(void) const { return IsTypeOf(typeof(T)); } }
/* helper.h - all functions that don't have another place Copyright (C) 2014 Stefan Klein This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _JUGGLER_HELPER_H_ #define _JUGGLER_HELPER_H_ #include "document.h" extern ErrorCode juggler_get_info_obj_num(juggler_t *juggler, int *num, int *gen); extern ErrorCode juggler_get_root_obj_num(juggler_t *juggler, int *num, int *gen); #endif /* _JUGGLER_HELPER_H_ */
/* * ArcPro MMORPG Server * Copyright (C) 2011 - 2013 (http://arcpro.sexyi.am/) * Copyright (C) 2008-2012 <http://www.arcpro.com/> * * Circular Buffer Class * Based on the Bip Buffer concept, from http://www.codeproject.com/KB/IP/bipbuffer.aspx * Implementation Copyright (C) 2008-2010 Burlex * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef _NETLIB_CIRCULARBUFFER_H #define _NETLIB_CIRCUALRBUFFER_H class CircularBuffer { // allocated whole block pointer uint8* m_buffer; uint8* m_bufferEnd; // region A pointer, and size uint8* m_regionAPointer; size_t m_regionASize; // region size uint8* m_regionBPointer; size_t m_regionBSize; // pointer magic! inline size_t GetAFreeSpace() { return (m_bufferEnd - m_regionAPointer - m_regionASize); } inline size_t GetSpaceBeforeA() { return (m_regionAPointer - m_buffer); } inline size_t GetSpaceAfterA() { return (m_bufferEnd - m_regionAPointer - m_regionASize); } inline size_t GetBFreeSpace() { if(m_regionBPointer == NULL) { return 0; } return (m_regionAPointer - m_regionBPointer - m_regionBSize); } public: /** Constructor */ CircularBuffer(); /** Destructor */ ~CircularBuffer(); /** Read bytes from the buffer * @param destination pointer to destination where bytes will be written * @param bytes number of bytes to read * @return true if there was enough data, false otherwise */ bool Read(void* destination, size_t bytes); void AllocateB(); /** Write bytes to the buffer * @param data pointer to the data to be written * @param bytes number of bytes to be written * @return true if was successful, otherwise false */ bool Write(const void* data, size_t bytes); /** Returns the number of available bytes left. */ size_t GetSpace(); /** Returns the number of bytes currently stored in the buffer. */ size_t GetSize(); /** Returns the number of contiguous bytes (that can be pushed out in one operation) */ size_t GetContiguiousBytes(); /** Removes len bytes from the front of the buffer * @param len the number of bytes to "cut" */ void Remove(size_t len); /** Returns a pointer at the "end" of the buffer, where new data can be written */ void* GetBuffer(); /** Allocate the buffer with room for size bytes * @param size the number of bytes to allocate */ void Allocate(size_t size); /** Increments the "writen" pointer forward len bytes * @param len number of bytes to step */ void IncrementWritten(size_t len); // known as "commit" /** Returns a pointer at the "beginning" of the buffer, where data can be pulled from */ void* GetBufferStart(); }; #endif // _NETLIB_CIRCULARBUFFER_H
/* * ArcEmu MMORPG Server * Copyright (C) 2008-2012 <http://www.ArcEmu.org/> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #include "Util/CallBack.h" #ifndef WIN32 static pthread_cond_t abortcond; static pthread_mutex_t abortmutex; #endif template<class Type> class PeriodicFunctionCaller : public ThreadBase { public: template<class T> PeriodicFunctionCaller(T* callback, void (T::*method)(), uint32 Interval) { cb = new CallbackP0<T>(callback, method); interval = Interval; running.SetVal(true); } ~PeriodicFunctionCaller() { delete cb; } bool run() { #ifndef WIN32 struct timeval now; struct timespec tv; uint32 next = Arcemu::Shared::Util::getMSTime() + interval; pthread_mutex_init(&abortmutex, NULL); pthread_cond_init(&abortcond, NULL); while(running.GetVal() && mrunning.GetVal()) { if(Arcemu::Shared::Util::getMSTime() > next) { cb->execute(); next = Arcemu::Shared::Util::getMSTime() + interval; } gettimeofday(&now, NULL); tv.tv_sec = now.tv_sec + 120; tv.tv_nsec = now.tv_usec * 1000; pthread_mutex_lock(&abortmutex); pthread_cond_timedwait(&abortcond, &abortmutex, &tv); pthread_mutex_unlock(&abortmutex); } #else thread_active = true; hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); for(;;) { if(hEvent) WaitForSingleObject(hEvent, interval); if(!running.GetVal()) break; /* we got killed */ /* times up */ if(hEvent) ResetEvent(hEvent); cb->execute(); } thread_active = false; #endif return false; } void kill() { running.SetVal(false); #ifdef WIN32 /* push the event */ SetEvent(hEvent); LOG_DETAIL("Waiting for PFC thread to exit..."); /* wait for the thread to exit */ while(thread_active) { Arcemu::Shared::Util::Sleep(100); } LOG_DETAIL("PFC thread exited."); #else pthread_cond_signal(&abortcond); #endif } private: CallbackBase* cb; uint32 interval; Arcemu::Threading::AtomicBoolean running; #ifdef WIN32 bool thread_active; HANDLE hEvent; #endif }; #define SpawnPeriodicCallThread(otype, ptr, method, interval) \ launch_thread(new PeriodicFunctionCaller<otype>(ptr, method, interval));
/* Copyright © 2001-2018, Canal TP and/or its affiliates. All rights reserved. This file is part of Navitia, the software to build cool stuff with public transport. Hope you'll enjoy and contribute to this project, powered by Canal TP (www.canaltp.fr). Help us simplify mobility and open public transport: a non ending quest to the responsive locomotion way of traveling! LICENCE: This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Stay tuned using twitter @navitia channel `#navitia` on riot https://riot.im/app/#/room/#navitia:matrix.org https://groups.google.com/d/forum/navitia www.navitia.io */ #pragma once #include "type/type.pb.h" #include <boost/optional.hpp> #include <boost/utility.hpp> #include <prometheus/exposer.h> #include <prometheus/counter.h> #include <prometheus/gauge.h> #include <memory> #include <map> // forward declare namespace prometheus { class Registry; class Counter; class Histogram; } // namespace prometheus namespace navitia { enum class RTAction { deletion = 0, chaos, kirin }; class InFlightGuard { prometheus::Gauge* gauge; public: explicit InFlightGuard(prometheus::Gauge* gauge); InFlightGuard(InFlightGuard& other) = delete; InFlightGuard(InFlightGuard&& other) noexcept; void operator=(InFlightGuard& other) = delete; InFlightGuard& operator=(InFlightGuard&& other) noexcept; ~InFlightGuard(); }; class Metrics : boost::noncopyable { protected: std::unique_ptr<prometheus::Exposer> exposer; std::shared_ptr<prometheus::Registry> registry; std::map<pbnavitia::API, prometheus::Histogram*> request_histogram; prometheus::Gauge* in_flight; prometheus::Histogram* data_loading_histogram; prometheus::Histogram* data_cloning_histogram; prometheus::Histogram* handle_rt_histogram; prometheus::Histogram* handle_disruption_histogram; prometheus::Histogram* delete_disruption_histogram; prometheus::Gauge* next_st_cache_miss; public: Metrics(const boost::optional<std::string>& endpoint, const std::string& coverage); void observe_api(pbnavitia::API api, double duration) const; InFlightGuard start_in_flight() const; void observe_data_loading(double duration) const; void observe_data_cloning(double duration) const; void observe_handle_rt(double duration) const; void observe_handle_disruption(double duration) const; void observe_delete_disruption(double duration) const; void set_raptor_cache_miss(size_t nb_cache_miss) const; }; } // namespace navitia
/** ****************************************************************************** * @file LwIP/LwIP_UDPTCP_Echo_Server_Netconn_RTOS/Inc/stm32f4xx_it.h * @author MCD Application Team * @version V1.0.3 * @date 29-January-2016 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void EXTI9_5_IRQHandler(void); void ETH_IRQHandler(void); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * (c) Copyright Ascensio System SIA 2010-2014 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, * EU, LV-1021. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #ifndef PPTX_VIEWPROPS_GRIDSPACING_INCLUDE_H_ #define PPTX_VIEWPROPS_GRIDSPACING_INCLUDE_H_ #include "./../WrapperWritingElement.h" namespace PPTX { namespace nsViewProps { class GridSpacing : public WrapperWritingElement { public: PPTX_LOGIC_BASE(GridSpacing) public: virtual void fromXML(XmlUtils::CXmlNode& node) { cx = node.ReadAttributeInt(L"cx"); cy = node.ReadAttributeInt(L"cy"); Normalize(); } virtual CString toXML() const { XmlUtils::CAttribute oAttr; oAttr.Write(_T("cx"), cx); oAttr.Write(_T("cy"), cy); return XmlUtils::CreateNode(_T("p:gridSpacing"), oAttr); } virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const { pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart); pWriter->WriteINT(cx); pWriter->WriteINT(cy); pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd); } virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const { pWriter->StartNode(_T("p:gridSpacing")); pWriter->StartAttributes(); pWriter->WriteAttribute(_T("cx"), cx); pWriter->WriteAttribute(_T("cy"), cy); pWriter->EndAttributes(); pWriter->EndNode(_T("p:gridSpacing")); } public: int cx; int cy; protected: virtual void FillParentPointersForChilds(){}; AVSINLINE void Normalize() { if (cx < 0) cx = 0; if (cy < 0) cy = 0; } }; } } #endif // PPTX_VIEWPROPS_GRIDSPACING_INCLUDE_H_
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2020, 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 https://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 "test.h" #include "memdebug.h" int test(char *URL) { CURLcode res; CURL *curl; (void)URL; /* we don't use this */ if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); return TEST_ERR_MAJOR_BAD; } curl = curl_easy_init(); if(!curl) { fprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } test_setopt(curl, CURLOPT_HEADER, 1L); /* just verify that setting this to -1 is fine */ test_setopt(curl, CURLOPT_MAXREDIRS, -1L); res = curl_easy_perform(curl); test_cleanup: curl_easy_cleanup(curl); curl_global_cleanup(); return (int)res; }
/* * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #ifndef TEST_EMM_HANDLE_H #define TEST_EMM_HANDLE_H #ifdef __cplusplus extern "C" { #endif void testemm_handle_identity_request(test_ue_t *test_ue, ogs_nas_eps_identity_request_t *identity_request); void testemm_handle_authentication_request(test_ue_t *test_ue, ogs_nas_eps_authentication_request_t *authentication_request); void testemm_handle_security_mode_command(test_ue_t *test_ue, ogs_nas_eps_security_mode_command_t *security_mode_command); void testemm_handle_attach_accept(test_ue_t *test_ue, ogs_nas_eps_attach_accept_t *attach_accept); void testemm_handle_tau_accept(test_ue_t *test_ue, ogs_nas_eps_tracking_area_update_accept_t *tau_accept); #ifdef __cplusplus } #endif #endif /* TEST_EMM_HANDLE_H */
/* * ArcEmu MMORPG Server * Copyright (C) 2008 <http://www.ArcEmu.org/> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ // Class CThread - Base class for all threads in the // server, and allows for easy management by ThreadMgr. #ifndef _MAPUPDATER_H #define _MAPUPDATER_H class MapMgr; class Object; class Player; class WorldSession; class Creature; class GameObject; #define MAPMGR_UPDATEOBJECT_LOOP_DELAY 100 #define MAPMGR_SESSION_UPDATE_DELAY 50 #define MAPMGR_UPDATE_DELAY 100 enum CThreadState { THREADSTATE_TERMINATE = 0, THREADSTATE_PAUSED = 1, THREADSTATE_SLEEPING = 2, THREADSTATE_BUSY = 3, THREADSTATE_AWAITING = 4, }; struct NameTableEntry; class SERVER_DECL CThread : public ThreadBase { public: CThread(); ~CThread(); ARCEMU_INLINE void SetThreadState(CThreadState thread_state) { ThreadState = thread_state; } ARCEMU_INLINE CThreadState GetThreadState() { return ThreadState; } int GetThreadId() { return ThreadId; } time_t GetStartTime() { return start_time; } virtual bool run(); virtual void OnShutdown(); protected: CThreadState ThreadState; time_t start_time; int ThreadId; }; #endif
///////////////////////////////////////////////////////////////////////////// // // File: mspi_configure.c // // Copyright S. Brennen Ball, 2011 // // The author provides no guarantees, warantees, or promises, implied or // otherwise. By using this software you agree to indemnify the author // of any damages incurred by using it. // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ///////////////////////////////////////////////////////////////////////////// #include "mspi.h" /////////////////////////////////////////// // Internal defines /////////////////////////////////////////// #define MSPI_CONFIG_OPTION_SPIMCON0_MASK 0x7F //Mask for the options used for SPIMCON0 #define MSPI_CONFIG_OPTION_SPIMCON1_MASK 0x0F //Mask for the options used for SPIMCON1 //////////////////////////////////////////////////////////////////////////////// // // void mspi_configure(uint16_t mspi_config_options) // // Description: // Configures the MSPI // // Parameters: // uint16_t mspi_config_options - MSPI configuration options // // Return value: // None // //////////////////////////////////////////////////////////////////////////////// void mspi_configure(uint16_t mspi_config_options) { //Set up SPIMCON0 and SPIMCON1 registers from mspi_config_options SPIMCON0 = (SPIMCON0 & ~MSPI_CONFIG_OPTION_SPIMCON0_MASK) | (((uint8_t)(mspi_config_options >> MSPI_CONFIG_OPTION_SPIMCON0_OFFSET_SHIFT)) & MSPI_CONFIG_OPTION_SPIMCON0_MASK); SPIMCON1 = (SPIMCON1 & ~MSPI_CONFIG_OPTION_SPIMCON1_MASK) | (((uint8_t)(mspi_config_options >> MSPI_CONFIG_OPTION_SPIMCON1_OFFSET_SHIFT)) & MSPI_CONFIG_OPTION_SPIMCON1_MASK); }
/* ** Copyright (C) 2003-2012 Erik de Castro Lopo <erikd@mega-nerd.com> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <math.h> #include <sndfile.h> #include "utils.h" #define BUFFER_LEN (1 << 16) #define LOG_BUFFER_SIZE 1024 static void dither_test (const char *filename, int filetype) ; /* Force the start of this buffer to be double aligned. Sparc-solaris will ** choke if its not. */ static short data_out [BUFFER_LEN] ; int main (int argc, char *argv []) { int do_all = 0 ; int test_count = 0 ; if (argc != 2) { printf ("Usage : %s <test>\n", argv [0]) ; printf (" Where <test> is one of the following:\n") ; printf (" wav - test WAV file peak chunk\n") ; printf (" aiff - test AIFF file PEAK chunk\n") ; printf (" all - perform all tests\n") ; exit (1) ; } ; do_all = ! strcmp (argv [1], "all") ; if (do_all || ! strcmp (argv [1], "wav")) { dither_test ("dither.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "aiff")) { dither_test ("dither.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "au")) { dither_test ("dither.au", SF_FORMAT_AU | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "svx")) { dither_test ("dither.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "nist")) { dither_test ("dither.nist", SF_FORMAT_NIST | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "paf")) { dither_test ("dither.paf", SF_FORMAT_PAF | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "ircam")) { dither_test ("dither.ircam", SF_FORMAT_IRCAM | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "voc")) { dither_test ("dither.voc", SF_FORMAT_VOC | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "w64")) { dither_test ("dither.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "mat4")) { dither_test ("dither.mat4", SF_FORMAT_MAT4 | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "mat5")) { dither_test ("dither.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (do_all || ! strcmp (argv [1], "pvf")) { dither_test ("dither.pvf", SF_FORMAT_PVF | SF_FORMAT_PCM_S8) ; test_count++ ; } ; if (test_count == 0) { printf ("Mono : ************************************\n") ; printf ("Mono : * No '%s' test defined.\n", argv [1]) ; printf ("Mono : ************************************\n") ; return 1 ; } ; return 0 ; } /* main */ /*============================================================================================ ** Here are the test functions. */ static void dither_test (const char *filename, int filetype) { SNDFILE *file ; SF_INFO sfinfo ; SF_DITHER_INFO dither ; filetype = filetype ; print_test_name ("dither_test", filename) ; sfinfo.samplerate = 44100 ; sfinfo.format = filetype ; sfinfo.channels = 1 ; sfinfo.frames = 0 ; file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; /* Check for old version of the dither API. */ if (sf_command (file, SFC_SET_DITHER_ON_WRITE, NULL, SF_TRUE) == 0) { printf ("\n\nLine %d: Should have an error here but don't.\n\n", __LINE__) ; exit (1) ; } ; memset (&dither, 0, sizeof (dither)) ; dither.type = SFD_WHITE ; dither.level = 0 ; if (sf_command (file, SFC_SET_DITHER_ON_WRITE, &dither, sizeof (dither)) != 0) { printf ("\n\nLine %d: sf_command (SFC_SET_DITHER_ON_WRITE) returned error : %s\n\n", __LINE__, sf_strerror (file)) ; exit (1) ; } ; /* Write data to file. */ test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; sf_close (file) ; file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; if (sfinfo.frames != BUFFER_LEN) { printf ("\n\nLine %d: Bad frame count %d (should be %d)\n\n", __LINE__, (int) sfinfo.frames, BUFFER_LEN) ; } ; sf_close (file) ; /*-unlink (filename) ;-*/ puts ("ok") ; } /* dither_test */
/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * File: $Id: RooMappedCategory.h,v 1.22 2007/05/11 09:11:30 verkerke Exp $ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * * * Copyright (c) 2000-2005, Regents of the University of California * * and Stanford University. All rights reserved. * * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ #ifndef ROO_MAPPED_CATEGORY #define ROO_MAPPED_CATEGORY #include "TObjArray.h" #include "RooAbsCategory.h" #include "RooCategoryProxy.h" #include "RooCatType.h" #include "TRegexp.h" #include <map> #include <string> class RooMappedCategory : public RooAbsCategory { public: // Constructors etc. enum CatIdx { NoCatIdx=-99999 } ; inline RooMappedCategory() : _defCat(0) { } RooMappedCategory(const char *name, const char *title, RooAbsCategory& inputCat, const char* defCatName="NotMapped", Int_t defCatIdx=NoCatIdx); RooMappedCategory(const RooMappedCategory& other, const char *name=0) ; virtual TObject* clone(const char* newname) const { return new RooMappedCategory(*this,newname); } virtual ~RooMappedCategory(); // Mapping function Bool_t map(const char* inKeyRegExp, const char* outKeyName, Int_t outKeyNum=NoCatIdx) ; // Printing interface (human readable) void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ; void printMetaArgs(ostream& os) const ; // I/O streaming interface (machine readable) virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ; virtual void writeToStream(ostream& os, Bool_t compact) const ; class Entry { public: inline Entry() : _regexp(0), _cat() {} virtual ~Entry() { delete _regexp ; } ; Entry(const char* exp, const RooCatType* cat) : _expr(exp), _regexp(new TRegexp(mangle(exp),kTRUE)), _cat(*cat) {} Entry(const Entry& other) : _expr(other._expr), _regexp(new TRegexp(mangle(other._expr.Data()),kTRUE)), _cat(other._cat) {} inline Bool_t ok() { return (_regexp->Status()==TRegexp::kOK) ; } Bool_t match(const char* testPattern) const { return (TString(testPattern).Index(*_regexp)>=0) ; } inline const RooCatType& outCat() const { return _cat ; } Entry& operator=(const Entry& other); protected: TString mangle(const char* exp) const ; TString _expr ; TRegexp* _regexp ; //! RooCatType _cat ; ClassDef(Entry,1) // Map cat entry definition } ; protected: RooCatType* _defCat ; // Default (unmapped) output type RooCategoryProxy _inputCat ; // Input category std::map<std::string,RooMappedCategory::Entry> _mapArray ; // List of mapping rules virtual RooCatType evaluate() const ; ClassDef(RooMappedCategory,1) // Index variable, derived from another index using pattern-matching based mapping }; #endif
/*---------------------------------------------------------------------------*\ * OpenSG * * * * * * Copyright (C) 2000-2002 by the OpenSG Forum * * * * www.opensg.org * * * * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * * * \*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*\ * License * * * * This library is free software; you can redistribute it and/or modify it * * under the terms of the GNU Library General Public License as published * * by the Free Software Foundation, version 2. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * \*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*\ * Changes * * * * * * * * * * * * * \*---------------------------------------------------------------------------*/ #ifndef _OSGCOREGLWINDOWDATAFIELDS_H_ #define _OSGCOREGLWINDOWDATAFIELDS_H_ #ifdef __sgi #pragma once #endif #include "OSGConfig.h" // Forget everything if we're not doing a Mac OS compile #if defined(__APPLE__) || defined(OSG_DO_DOC) #include "OSGWindowCoreGLDef.h" #include "OSGWindowFields.h" #include <OpenGL/OpenGL.h> /*! The field types for the local types needed by the CoreGLWindow class */ OSG_BEGIN_NAMESPACE /*! \ingroup GrpWindowCoreGLFieldTraits */ template <> struct FieldTraits<CGLContextObj> : public FieldTraitsPtrToStringTemplateBase<CGLContextObj> { typedef FieldTraits<CGLContextObj> Self; static DataType _type; enum { Convertible = (Self::ToStringConvertible | Self::FromStringConvertible)}; OSG_WINDOWCOREGL_DLLMAPPING static DataType &getType (void); static char *getSName(void) { return "SFCGLContextObj"; } static char *getMName(void) { return "MFCGLContextObj"; } static bool getFromCString( CGLContextObj &, const Char8 *) { return true; } static void putToString (const CGLContextObj &, std::string &outStr) { outStr.assign("CGLContextObj"); } }; #ifndef DOXYGEN_SHOULD_SKIP_THIS /*! \ingroup GrpWindowCoreGLFieldSFields */ typedef SField<CGLContextObj> SFCGLContextObj; /*! \ingroup GrpWindowCoreGLFieldMFields */ typedef MField<CGLContextObj> MFCGLContextObj; #else /*! \ingroup GrpWindowCoreGLFieldSFields \ingroup GrpLibOSGWindowCoreGL */ struct SFCGLContextObj : public SField<CGLContextObj> {}; /*! \ingroup GrpWindowCoreGLFieldMFields \ingroup GrpLibOSGWindowCoreGL */ struct MFCGLContextObj : public MField<CGLContextObj> {}; #endif OSG_END_NAMESPACE #endif /* __APPLE__ */ #endif /* _OSGCOREGLWINDOWDATAFIELDS_H_ */
/******************************************************************************\ This file is part of the C! library. A.K.A the cbang library. Copyright (c) 2003-2015, Cauldron Development LLC Copyright (c) 2003-2015, Stanford University All rights reserved. The C! library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. The C! library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the C! library. If not, see <http://www.gnu.org/licenses/>. In addition, BSD licensing may be granted on a case by case basis by written permission from at least one of the copyright holders. You may request written permission by emailing the authors. For information regarding this software email: Joseph Coffland joseph@cauldrondevelopment.com \******************************************************************************/ #ifndef CB_CERTIFICATE_STORE_H #define CB_CERTIFICATE_STORE_H typedef struct x509_store_st X509_STORE; namespace cb { class Certificate; class CRL; class CertificateStore { X509_STORE *store; public: CertificateStore(const CertificateStore &o); CertificateStore(X509_STORE *store = 0); ~CertificateStore(); CertificateStore &operator=(const CertificateStore &o); X509_STORE *getX509_STORE() const {return store;} void add(const Certificate &cert); void add(const CRL &crl); void verify(const Certificate &cert) const; }; } #endif // CB_CERTIFICATE_STORE_H
/* * Mash - A library for displaying PLY models in a Clutter scene * Copyright (C) 2010 Intel Corporation * Copyright (C) 2010 Luca Bruno <lethalman88@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ /** * SECTION:mash-data-loader * @short_description: An object for loading data from a file in a specific format. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <glib-object.h> #include <string.h> #include <cogl/cogl.h> #include "mash-data-loader.h" G_DEFINE_ABSTRACT_TYPE (MashDataLoader, mash_data_loader, G_TYPE_OBJECT); #define MASH_DATA_LOADER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MASH_TYPE_DATA_LOADER, \ MashDataLoaderPrivate)) /* reserved for future use */ struct _MashDataLoaderPrivate { }; static void mash_data_loader_class_init (MashDataLoaderClass *klass) { } static void mash_data_loader_init (MashDataLoader *self) { } /** * mash_data_loader_load: * @data_loader: The #MashDataLoader instance * @flags: Flags used to specify load-time modifications to the data * @filename: The name of a file to load * @error: Return location for an error or %NULL * * Loads the data from the file called @filename into @self. * This function is not usually called by applications. */ gboolean mash_data_loader_load (MashDataLoader *data_loader, MashDataFlags flags, const gchar *filename, GError **error) { g_return_val_if_fail (MASH_IS_DATA_LOADER (data_loader), FALSE); return MASH_DATA_LOADER_GET_CLASS (data_loader)->load (data_loader, flags, filename, error); } /** * mash_data_loader_load: * @data_loader: The #MashDataLoader instance * @loader_data: The #MashDataLoaderData to set the loaded data. * * Obtains the loaded data after calling mash_data_loader_load(). * This function is not usually called by applications. */ void mash_data_loader_get_data (MashDataLoader *data_loader, MashDataLoaderData *loader_data) { g_return_if_fail (MASH_IS_DATA_LOADER (data_loader)); g_return_if_fail (loader_data != NULL); MASH_DATA_LOADER_GET_CLASS (data_loader)->get_data (data_loader, loader_data); }
/***************************************************************************** FILE : $Source: /projects/higgs1/SNNS/CVS/SNNS/kernel/sources/kr_art1.h,v $ SHORTNAME : SNNS VERSION : 4.2 PURPOSE : SNNS Kernel Function Prototypes for ART1-Networks NOTES : AUTHOR : Kai-Uwe Herrmann DATE : 17.05.92 CHANGED BY : Sven Doering RCS VERSION : $Revision: 2.6 $ LAST CHANGE : $Date: 1998/02/25 15:26:34 $ Copyright (c) 1990-1995 SNNS Group, IPVR, Univ. Stuttgart, FRG Copyright (c) 1996-1998 SNNS Group, WSI, Univ. Tuebingen, FRG ******************************************************************************/ #ifndef _KR_ART1_DEFINED_ #define _KR_ART1_DEFINED_ extern int Art1_NoOfRecUnits; extern struct Unit *Art1_cl_unit; /* Pointer to ART1 cl-unit */ extern struct Unit *Art1_nc_unit; /* Pointer to ART1 nc-unit */ /***************************************************************************/ /* kra1_sort () Set logical layer numbers and logical unit numbers in an ART1 network. Also this function checks, whether the network is an ART1 network or not. Returns an error code, when actual network is no ART1 architecture. */ extern krui_err kra1_sort ( void ); /***************************************************************************/ /* kra1_init_i_act () Sets the initial activation values of the units */ extern krui_err kra1_init_i_act ( double rho ); /***************************************************************************/ /* kra1_getClassNo () Returns the number of the actually activated class J, 1 <= J <= M */ extern int kra1_getClassNo ( void ); #endif /* 74 lines generated by deleteprivatedefinitions.awk */
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /************************************************ rbatkobject.c - $Author: ggc $ $Date: 2007/07/13 16:07:28 $ Copyright (C) 2003,2004 Masao Mutoh ************************************************/ #include "rbatk.h" #define _SELF(s) (ATK_OBJECT(RVAL2GOBJ(s))) /* How can I implement this? Since 1.10 AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor); */ /* Use properties accessible_* G_CONST_RETURN gchar* atk_object_get_name (AtkObject *accessible); G_CONST_RETURN gchar* atk_object_get_description (AtkObject *accessible); AtkObject* atk_object_get_parent (AtkObject *accessible); (AtkObject *accessible); */ static VALUE rbatkobj_get_n_accessible_children(VALUE self) { return INT2NUM(atk_object_get_n_accessible_children(_SELF(self))); } static VALUE rbatkobj_ref_accessible_child(VALUE self, VALUE i) { return GOBJ2RVAL(atk_object_ref_accessible_child(_SELF(self), NUM2INT(i))); } static VALUE rbatkobj_ref_releation_set(VALUE self) { return GOBJ2RVAL(atk_object_ref_relation_set(_SELF(self))); } /* Use properties accessible_* AtkLayer atk_object_get_layer (AtkObject *accessible); gint atk_object_get_mdi_zorder (AtkObject *accessible); AtkRole atk_object_get_role (AtkObject *accessible); */ static VALUE rbatkobj_ref_state_set(VALUE self) { return GOBJ2RVAL(atk_object_ref_state_set(_SELF(self))); } static VALUE rbatkobj_get_index_in_parent(VALUE self) { return INT2NUM(atk_object_get_index_in_parent(_SELF(self))); } /* Use properties accessible_* void atk_object_set_name (AtkObject *accessible, const gchar *name); void atk_object_set_description (AtkObject *accessible, const gchar *description); void atk_object_set_parent (AtkObject *accessible, AtkObject *parent); void atk_object_set_role (AtkObject *accessible, AtkRole role); */ /* guint atk_object_connect_property_change_handler (AtkObject *accessible, AtkPropertyChangeHandler *handler); void atk_object_remove_property_change_handler (AtkObject *accessible, guint handler_id); */ static VALUE rbatkobj_notify_state_change(VALUE self, VALUE state, VALUE value) { atk_object_notify_state_change(_SELF(self), RVAL2GENUM(state, ATK_TYPE_STATE_TYPE), RVAL2CBOOL(value)); return self; } /* I don't have a good idea to implement this method. Any idea? void atk_object_initialize (AtkObject *accessible, gpointer data); */ #ifdef HAVE_ATK_OBJECT_ADD_RELATIONSHIP static VALUE rbatkobj_add_relationship(VALUE self, VALUE relationship, VALUE target) { return CBOOL2RVAL(atk_object_add_relationship( _SELF(self), RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE), _SELF(target))); } #endif #ifdef HAVE_ATK_OBJECT_REMOVE_RELATIONSHIP static VALUE rbatkobj_remove_relationship(VALUE self, VALUE relationship, VALUE target) { return CBOOL2RVAL(atk_object_remove_relationship( _SELF(self), RVAL2GENUM(relationship, ATK_TYPE_RELATION_TYPE), _SELF(target))); } #endif /* We don't need this. G_CONST_RETURN gchar* atk_role_get_name (AtkRole role); */ static VALUE rbatkrole_get_localized_name(VALUE self) { #ifdef HAVE_ATK_ROLE_GET_LOCALIZED_NAME return CSTR2RVAL(atk_role_get_localized_name(RVAL2GENUM(self, ATK_TYPE_ROLE))); #else rb_warning("not supported in this version of ATK."); return Qnil; #endif } static VALUE rbatkrole_s_for_name(VALUE self, VALUE name) { return GENUM2RVAL(atk_role_for_name(RVAL2CSTR(name)), ATK_TYPE_ROLE); } void Init_atk_object() { VALUE obj = G_DEF_CLASS(ATK_TYPE_OBJECT, "Object", mAtk); VALUE role; rb_define_method(obj, "n_accessible_children", rbatkobj_get_n_accessible_children, 0); rb_define_method(obj, "ref_accessible_child", rbatkobj_ref_accessible_child, 1); rb_define_method(obj, "ref_relation_set", rbatkobj_ref_releation_set, 0); rb_define_method(obj, "ref_state_set", rbatkobj_ref_state_set, 0); rb_define_method(obj, "index_in_parent", rbatkobj_get_index_in_parent, 0); rb_define_method(obj, "notify_state_change", rbatkobj_notify_state_change, 2); #ifdef HAVE_ATK_OBJECT_ADD_RELATIONSHIP rb_define_method(obj, "add_relationship", rbatkobj_add_relationship, 2); #endif #ifdef HAVE_ATK_OBJECT_REMOVE_RELATIONSHIP rb_define_method(obj, "remove_relationship", rbatkobj_remove_relationship, 2); #endif /* AtkRole */ role = G_DEF_CLASS(ATK_TYPE_ROLE, "Role", obj); rb_define_method(role, "localized_name", rbatkrole_get_localized_name, 0); rb_define_singleton_method(role, "for_name", rbatkrole_s_for_name, 1); G_DEF_CONSTANTS(obj, ATK_TYPE_ROLE, "ATK_"); /* AtkLayer */ G_DEF_CLASS(ATK_TYPE_LAYER, "Layer", obj); G_DEF_CONSTANTS(obj, ATK_TYPE_LAYER, "ATK_"); }
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* flow-simplex-element.c - A unidirectional processing element. * * Copyright (C) 2006 Hans Petter Jansson * * 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, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Authors: Hans Petter Jansson <hpj@copyleft.no> */ #include "config.h" #include "flow-util.h" #include "flow-gobject-util.h" #include "flow-simplex-element.h" /* --- FlowSimplexElement private data --- */ struct _FlowSimplexElementPrivate { }; /* --- FlowSimplexElement properties --- */ FLOW_GOBJECT_PROPERTIES_BEGIN (flow_simplex_element) FLOW_GOBJECT_PROPERTIES_END () /* --- FlowSimplexElement definition --- */ FLOW_GOBJECT_MAKE_IMPL (flow_simplex_element, FlowSimplexElement, FLOW_TYPE_ELEMENT, 0) /* --- FlowSimplexElement implementation --- */ static void flow_simplex_element_output_pad_blocked (FlowElement *element, FlowPad *output_pad) { flow_pad_block (g_ptr_array_index (element->input_pads, 0)); } static void flow_simplex_element_output_pad_unblocked (FlowElement *element, FlowPad *output_pad) { flow_pad_unblock (g_ptr_array_index (element->input_pads, 0)); } static void flow_simplex_element_process_input (FlowElement *element, FlowPad *input_pad) { FlowPacketQueue *packet_queue; FlowPacket *packet; packet_queue = flow_pad_get_packet_queue (input_pad); for ( ; (packet = flow_packet_queue_pop_packet (packet_queue)); ) { flow_handle_universal_events (element, packet); flow_pad_push (g_ptr_array_index (element->output_pads, 0), packet); } } static void flow_simplex_element_type_init (GType type) { } static void flow_simplex_element_class_init (FlowSimplexElementClass *klass) { FlowElementClass *element_klass = FLOW_ELEMENT_CLASS (klass); element_klass->output_pad_blocked = flow_simplex_element_output_pad_blocked; element_klass->output_pad_unblocked = flow_simplex_element_output_pad_unblocked; element_klass->process_input = flow_simplex_element_process_input; } static void flow_simplex_element_init (FlowSimplexElement *simplex_element) { FlowElement *element = (FlowElement *) simplex_element; g_ptr_array_add (element->input_pads, g_object_new (FLOW_TYPE_INPUT_PAD, "owner-element", simplex_element, NULL)); g_ptr_array_add (element->output_pads, g_object_new (FLOW_TYPE_OUTPUT_PAD, "owner-element", simplex_element, NULL)); } static void flow_simplex_element_construct (FlowSimplexElement *simplex_element) { } static void flow_simplex_element_dispose (FlowSimplexElement *simplex_element) { } static void flow_simplex_element_finalize (FlowSimplexElement *simplex_element) { } /* --- FlowSimplexElement public API --- */ FlowInputPad * flow_simplex_element_get_input_pad (FlowSimplexElement *simplex_element) { FlowElement *element = (FlowElement *) simplex_element; g_return_val_if_fail (FLOW_IS_SIMPLEX_ELEMENT (simplex_element), NULL); return g_ptr_array_index (element->input_pads, 0); } FlowOutputPad * flow_simplex_element_get_output_pad (FlowSimplexElement *simplex_element) { FlowElement *element = (FlowElement *) simplex_element; g_return_val_if_fail (FLOW_IS_SIMPLEX_ELEMENT (simplex_element), NULL); return g_ptr_array_index (element->output_pads, 0); }
/* * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef WebContentLayer_h #define WebContentLayer_h #include "WebCommon.h" #include "WebScrollableLayer.h" namespace WebCore { class ContentLayerChromium; } namespace WebKit { class WebContentLayerClient; class WebContentLayerImpl; class WebContentLayer : public WebScrollableLayer { public: WEBKIT_EXPORT static WebContentLayer create(WebContentLayerClient*); WebContentLayer() { } WebContentLayer(const WebContentLayer& layer) : WebScrollableLayer(layer) { } virtual ~WebContentLayer() { } WebContentLayer& operator=(const WebContentLayer& layer) { WebLayer::assign(layer); return *this; } // Called when the WebContentLayerClient is going away and should not be used. WEBKIT_EXPORT void clearClient(); // Set to true if the backside of this layer's contents should be visible when composited. // Defaults to false. WEBKIT_EXPORT void setDoubleSided(bool); // Set to apply a scale factor used when painting and drawing this layer's content. Defaults to 1.0. WEBKIT_EXPORT void setContentsScale(float); #if WEBKIT_IMPLEMENTATION WebContentLayer(const WTF::PassRefPtr<WebCore::ContentLayerChromium>&); WebContentLayer& operator=(const WTF::PassRefPtr<WebCore::ContentLayerChromium>&); operator WTF::PassRefPtr<WebCore::ContentLayerChromium>() const; #endif }; } // namespace WebKit #endif // WebContentLayer_h
#include <config.h> #include <gconf/gconf-client.h> #include <glib/gmain.h> #include <libedataserver/e-source-list.h> static GConfClient *conf_client; static GMainLoop *main_loop; static char *arg_hostname, *arg_username, *arg_password; static void add_account (const char *conf_key, const char *hostname, const char *username) { ESourceList *source_list; ESourceGroup *group; ESource *source; char *group_name; source_list = e_source_list_new_for_gconf (conf_client, conf_key); group_name = g_strdup_printf (hostname); group = e_source_group_new (group_name, "groupwise://"); e_source_list_add_group (source_list, group, -1); g_free (group_name); group_name = g_strdup_printf ("%s:7181/soap/", hostname); source = e_source_new ("Calendar", group_name); e_source_set_property (source, "auth", "1"); e_source_set_property (source, "username", username); e_source_group_add_source (group, source, -1); e_source_list_sync (source_list, NULL); g_free (group_name); g_object_unref (source); g_object_unref (group); g_object_unref (source_list); } static gboolean idle_cb (gpointer data) { add_account ("/apps/evolution/calendar/sources", arg_hostname, arg_username); add_account ("/apps/evolution/tasks/sources", arg_hostname, arg_username); g_main_loop_quit (main_loop); return FALSE; } int main (int argc, char *argv[]) { g_type_init (); if (argc != 3 && argc != 4) { g_print ("Usage: %s hostname username [password]\n", argv[0]); return -1; } arg_hostname = argv[1]; arg_username = argv[2]; if (argc == 4) arg_password = argv[3]; else arg_password = NULL; conf_client = gconf_client_get_default (); main_loop = g_main_loop_new (NULL, TRUE); g_idle_add ((GSourceFunc) idle_cb, NULL); g_main_loop_run (main_loop); /* terminate */ g_object_unref (conf_client); g_main_loop_unref (main_loop); return 0; }
/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin <alex.kanavin@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef OFONOMESSAGEWAITING_H #define OFONOMESSAGEWAITING_H #include <QtCore/QObject> #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono message waiting API /*! * oFono message manager API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/message-waiting-api.txt */ class OFONO_QT_EXPORT OfonoMessageWaiting : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(bool voicemailWaiting READ voicemailWaiting NOTIFY voicemailWaitingChanged) Q_PROPERTY(int voicemailMessageCount READ voicemailMessageCount NOTIFY voicemailMessageCountChanged) Q_PROPERTY(QString voicemailMailboxNumber READ voicemailMailboxNumber WRITE setVoicemailMailboxNumber NOTIFY voicemailMailboxNumberChanged) public: OfonoMessageWaiting(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoMessageWaiting(); bool voicemailWaiting() const; int voicemailMessageCount() const; QString voicemailMailboxNumber() const; public Q_SLOTS: void setVoicemailMailboxNumber(QString mailboxnumber); Q_SIGNALS: void voicemailWaitingChanged(bool waiting); void voicemailMessageCountChanged(int count); void voicemailMailboxNumberChanged(const QString &mailboxnumber); void setVoicemailMailboxNumberFailed(); private Q_SLOTS: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); }; #endif /* !OFONOMESSAGEWAITING_H */
/* p11-getslotinfo.c - Cryptoki implementation. * Copyright (C) 2006 g10 Code GmbH * * This file is part of Scute. * * Scute 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. * * Scute is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see <https://gnu.org/licenses/>. * SPDX-License-Identifier: LGPL-2.1-or-later */ #if HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> #include <string.h> #include "cryptoki.h" #include "agent.h" #include "locking.h" #include "support.h" #include "settings.h" #include "slots.h" CK_RV CK_SPEC C_GetSlotInfo (CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo) { CK_RV err = CKR_OK; slot_iterator_t slot; const char *s; int minor; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; err = slots_update_slot (slot); if (err) goto out; /* FIXME: Query some of this from SCD. */ scute_copy_string (pInfo->slotDescription, SLOT_DESCRIPTION, 64); scute_copy_string (pInfo->manufacturerID, SLOT_MANUFACTURER_ID, 32); pInfo->flags = CKF_REMOVABLE_DEVICE | CKF_HW_SLOT; if (slot_token_present (slot)) pInfo->flags |= CKF_TOKEN_PRESENT; /* Use the gpg-agent version for the hardware version.. */ pInfo->hardwareVersion.major = get_gnupg_version (&minor); pInfo->hardwareVersion.minor = minor; /* Use Scute version as Firmware version. */ s = PACKAGE_VERSION; pInfo->firmwareVersion.major = atoi (s); s = strchr (s, '.'); pInfo->firmwareVersion.minor = s? atoi (s+1): 0; out: scute_global_unlock (); return err; }
/* * Copyright (c) 2011 Apple Inc. All rights reserved. * Copyright (C) 2012-2014 Erik de Castro Lopo <erikd@mega-nerd.com> * * @APPLE_APACHE_LICENSE_HEADER_START@ * * 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. * * @APPLE_APACHE_LICENSE_HEADER_END@ */ /* File: alac_codec.h */ #ifndef ALAC_CODEC_H #define ALAC_CODEC_H #include <stdint.h> #include "ALACAudioTypes.h" #define ALAC_FRAME_LENGTH (4096) struct BitBuffer ; typedef struct alac_decoder_s { // decoding parameters (public for use in the analyzer) ALACSpecificConfig mConfig ; uint16_t mActiveElements ; // decoding buffers int32_t mMixBufferU [ALAC_FRAME_LENGTH] ; int32_t mMixBufferV [ALAC_FRAME_LENGTH] ; union { int32_t mPredictor [ALAC_FRAME_LENGTH] ; uint16_t mShiftBuffer [ALAC_FRAME_LENGTH] ; } ; uint32_t mNumChannels ; } ALAC_DECODER ; typedef struct alac_encoder_s { // ALAC encoder parameters int16_t mBitDepth ; // encoding state int16_t mLastMixRes [kALACMaxChannels] ; int32_t mFastMode ; // encoding buffers int32_t mMixBufferU [ALAC_FRAME_LENGTH] ; int32_t mMixBufferV [ALAC_FRAME_LENGTH] ; int32_t mPredictorU [ALAC_FRAME_LENGTH] ; int32_t mPredictorV [ALAC_FRAME_LENGTH] ; uint16_t mShiftBufferUV [2 * ALAC_FRAME_LENGTH] ; uint8_t mWorkBuffer [4 * ALAC_FRAME_LENGTH] ; // per-channel coefficients buffers int16_t mCoefsU [kALACMaxChannels][kALACMaxSearches][kALACMaxCoefs] ; int16_t mCoefsV [kALACMaxChannels][kALACMaxSearches][kALACMaxCoefs] ; // encoding statistics uint32_t mTotalBytesGenerated ; uint32_t mAvgBitRate ; uint32_t mMaxFrameBytes ; uint32_t mFrameSize ; uint32_t mMaxOutputBytes ; uint32_t mNumChannels ; uint32_t mOutputSampleRate ; } ALAC_ENCODER ; int32_t alac_decoder_init (ALAC_DECODER *p, void * inMagicCookie, uint32_t inMagicCookieSize) ; int32_t alac_encoder_init (ALAC_ENCODER *p, uint32_t samplerate, uint32_t channels, uint32_t format_flags, uint32_t frameSize) ; int32_t alac_decode (ALAC_DECODER *, struct BitBuffer * bits, int32_t * sampleBuffer, uint32_t numSamples, uint32_t * outNumSamples) ; int32_t alac_encode (ALAC_ENCODER *p, uint32_t numSamples, const int32_t * theReadBuffer, unsigned char * theWriteBuffer, uint32_t * ioNumBytes) ; void alac_set_fastmode (ALAC_ENCODER * p, int32_t fast) ; uint32_t alac_get_magic_cookie_size (uint32_t inNumChannels) ; void alac_get_magic_cookie (ALAC_ENCODER *p, void * config, uint32_t * ioSize) ; void alac_get_source_format (ALAC_ENCODER *p, const AudioFormatDescription * source, AudioFormatDescription * output) ; #endif
#ifndef _OSGTEXTUREMANAGER_H_ #define _OSGTEXTUREMANAGER_H_ #ifdef __sgi #pragma once #endif #include <OSGConfig.h> #include <OSGSystemDef.h> #include <OSGChunkMaterial.h> #include <OSGImage.h> #include <vector> OSG_BEGIN_NAMESPACE // forward declarations class DVRVolume; class BrickSet; class Brick; class DrawActionBase; /*! \brief *put brief class description here* Auxiliary class for DVRVolume. It is intended for texture management and bricking. */ struct TextureRecord { ImagePtr _image; UInt32 _internalFormat; UInt32 _externalFormat; Int32 _textureStage0; Int32 _textureStage1; TextureRecord(ImagePtr img, UInt32 internal, UInt32 externalFormat, Int32 stage0, Int32 stage1); ~TextureRecord(void); private: //!! We do not want the copy constructor to be called - //!! would require deep copy TextureRecord(const TextureRecord &source); void operator =(const TextureRecord &source); }; typedef std::vector<TextureRecord *> TextureSet; class OSG_SYSTEMLIB_DLLMAPPING TextureManager { public: //! Texture mode enum TextureMode { TM_3D = 0, TM_2D, TM_2D_Multi, NUM_TEXTURE_MODES }; //! Bricking mode enum BrickingMode { BRICK_SUBDIVIDE_ON_TEXTURE_MEMORY = 0, BRICK_SUBDIVIDE_STATIC, BRICK_SUBDIVIDE_ON_BRICK_SIZE, NUM_BRICKING_MODES }; //! Constructor/ destructor TextureManager(DVRVolume *volume); ~TextureManager(void); //! Register texture /*! \brief register an image for use as texture with direct volume * rendering * image points to the image * internal/externalFormat defines the texture format * doBricking specifies, whether the texture is uses * as utility * texture or as volume texture * (volume textures are * divided into bricks - utility textures * are loaded as they are) * textureState0 * textureState1 (optional) specifies which * (multi-)texture stages * the texture shall be bound */ Int32 registerTexture(ImagePtr image, UInt32 internalFormat, UInt32 externalFormat, bool doBricking = 1, Int32 textureStage0 = 0, Int32 textureStage1 = -1); //! Remove texture void unregisterTexture(Int32 id); //! Reload texture void reloadTexture(Int32 id, DrawActionBase * action); //! Clear all registered textures void clearTextures(ChunkMaterialPtr material = NullFC); //! Create texture chunks for registered textures void buildTextures(ChunkMaterialPtr material, DVRVolume *volume, TextureMode mode = TM_3D); //! Return sorted brick list Brick *sortBricks(DrawActionBase *da, Matrix modelMat, Vec3f eyePoint, DVRVolume *volume, TextureMode mode); //! Output the instance for debug purposes void dump( UInt32 uiIndent = 0, const BitVector bvFlags = 0) const; private: TextureSet _registeredTextures; DVRVolume *_parent; BrickSet *_brickSets; //! Calculate bricking static Vec3f calcBrickSubdivision(Int32 resX, Int32 resY, Int32 resZ, Int32 dataSize, DVRVolume *volume); friend struct BrickSet; }; OSG_END_NAMESPACE #endif
// The libMesh Finite Element Library. // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // libMesh includes #include "libmesh/function_base.h" #include "libmesh/auto_ptr.h" // libmesh_make_unique // Example includes #include "laplace_exact_solution.h" using namespace libMesh; #ifndef SOLUTION_FUNCTION_H #define SOLUTION_FUNCTION_H class SolutionFunction : public FunctionBase<Number> { public: SolutionFunction (const unsigned int u_var) : _u_var(u_var) {} ~SolutionFunction() {} virtual Number operator() (const Point &, const Real = 0) { libmesh_not_implemented(); } virtual void operator() (const Point & p, const Real, DenseVector<Number> & output) { output.zero(); const Real x=p(0), y=p(1), z=p(2); // libMesh assumes each component of the vector-valued variable is stored // contiguously. output(_u_var) = soln(0, x, y, z); output(_u_var+1) = soln(1, x, y, z); output(_u_var+2) = soln(2, x, y, z); } virtual Number component(unsigned int component_in, const Point & p, const Real) { const Real x=p(0), y=p(1), z=p(2); return soln(component_in, x, y, z); } virtual std::unique_ptr<FunctionBase<Number>> clone() const { return libmesh_make_unique<SolutionFunction>(_u_var); } private: const unsigned int _u_var; LaplaceExactSolution soln; }; //FIXME: PB: We ought to be able to merge the above class with this one // through templating, but I'm being lazy. class SolutionGradient : public FunctionBase<Gradient> { public: SolutionGradient(const unsigned int u_var) : _u_var(u_var) {} ~SolutionGradient(){} virtual Gradient operator() (const Point &, const Real = 0) { libmesh_not_implemented(); } virtual void operator() (const Point & p, const Real, DenseVector<Gradient>& output) { output.zero(); const Real x=p(0), y=p(1), z=p(2); output(_u_var) = soln(0, x, y, z); output(_u_var+1) = soln(1, x, y, z); output(_u_var+2) = soln(2, x, y, z); } virtual Gradient component(unsigned int component_in, const Point & p, const Real) { const Real x=p(0), y=p(1), z=p(2); return soln(component_in, x, y, z); } virtual std::unique_ptr<FunctionBase<Gradient>> clone() const { return libmesh_make_unique<SolutionGradient>(_u_var); } private: const unsigned int _u_var; LaplaceExactGradient soln; }; #endif // SOLUTION_FUNCTION_H
#ifndef GAS_H_ #define GAS_H_ #include "Material.h" //#include "LinearInterpolation.h" //#include "SplineInterpolation.h" #include "MonotoneCubicInterpolation.h" class Gas; template <> InputParameters validParams<Gas>(); class Gas : public Material { public: Gas(const InputParameters & parameters); protected: virtual void computeQpProperties(); MonotoneCubicInterpolation _alpha_interpolation; MonotoneCubicInterpolation _alphaEx_interpolation; MonotoneCubicInterpolation _alphaEl_interpolation; MonotoneCubicInterpolation _mu_interpolation; MonotoneCubicInterpolation _diff_interpolation; /* SplineInterpolation _alpha_interpolation; SplineInterpolation _alphaEx_interpolation; SplineInterpolation _alphaEl_interpolation; SplineInterpolation _mu_interpolation; SplineInterpolation _diff_interpolation; */ /* LinearInterpolation _d_alpha_d_actual_mean_energy_interpolation; */ /* bool _townsend; */ bool _interp_trans_coeffs; bool _interp_elastic_coeff; bool _ramp_trans_coeffs; std::string _potential_units; Real _r_units; Real _t_units; Real _voltage_scaling; Real _user_se_coeff; Real _user_work_function; Real _user_field_enhancement; Real _user_Richardson_coefficient; Real _user_cathode_temperature; Real _user_T_gas; Real _user_p_gas; bool _use_moles; MaterialProperty<Real> & _muem; MaterialProperty<Real> & _d_muem_d_actual_mean_en; MaterialProperty<Real> & _diffem; MaterialProperty<Real> & _d_diffem_d_actual_mean_en; MaterialProperty<Real> & _muArp; MaterialProperty<Real> & _diffArp; MaterialProperty<Real> & _rate_coeff_ion; MaterialProperty<Real> & _Eiz; MaterialProperty<Real> & _Eex; MaterialProperty<Real> & _Ar; MaterialProperty<Real> & _mumean_en; MaterialProperty<Real> & _d_mumean_en_d_actual_mean_en; MaterialProperty<Real> & _diffmean_en; MaterialProperty<Real> & _d_diffmean_en_d_actual_mean_en; MaterialProperty<Real> & _rate_coeff_elastic; MaterialProperty<Real> & _massem; MaterialProperty<Real> & _massGas; MaterialProperty<Real> & _massArp; MaterialProperty<Real> & _se_coeff; MaterialProperty<Real> & _work_function; MaterialProperty<Real> & _field_enhancement; MaterialProperty<Real> & _Richardson_coefficient; MaterialProperty<Real> & _cathode_temperature; MaterialProperty<Real> & _se_energy; MaterialProperty<Real> & _ElectronTotalFluxMag; MaterialProperty<Real> & _ElectronTotalFluxMagSizeForm; MaterialProperty<Real> & _ElectronTotalFlux; MaterialProperty<Real> & _ElectronAdvectiveFlux; MaterialProperty<Real> & _ElectronDiffusiveFlux; MaterialProperty<Real> & _IonTotalFlux; MaterialProperty<Real> & _IonAdvectiveFlux; MaterialProperty<Real> & _IonDiffusiveFlux; MaterialProperty<Real> & _EField; MaterialProperty<Real> & _Source_term; MaterialProperty<Real> & _Source_term_coeff; MaterialProperty<Real> & _e; MaterialProperty<Real> & _eps; MaterialProperty<Real> & _Tem_lfa; MaterialProperty<Real> & _Tip_lfa; MaterialProperty<Real> & _k_boltz; MaterialProperty<Real> & _Avogadro; MaterialProperty<Real> & _vthermal_em; MaterialProperty<Real> & _vthermal_ip; MaterialProperty<Real> & _iz_coeff_efield_a; MaterialProperty<Real> & _iz_coeff_efield_b; MaterialProperty<Real> & _iz_coeff_efield_c; MaterialProperty<Real> & _iz_coeff_energy_a; MaterialProperty<Real> & _iz_coeff_energy_b; MaterialProperty<Real> & _iz_coeff_energy_c; MaterialProperty<Real> & _N_A; MaterialProperty<Real> & _el_coeff_energy_a; MaterialProperty<Real> & _el_coeff_energy_b; MaterialProperty<Real> & _el_coeff_energy_c; MaterialProperty<Real> & _alpha_iz; MaterialProperty<Real> & _d_iz_d_actual_mean_en; MaterialProperty<Real> & _alpha_ex; MaterialProperty<Real> & _d_ex_d_actual_mean_en; MaterialProperty<Real> & _alpha_el; MaterialProperty<Real> & _d_el_d_actual_mean_en; MaterialProperty<Real> & _sgnem; MaterialProperty<Real> & _sgnmean_en; MaterialProperty<Real> & _sgnArp; MaterialProperty<Real> & _diffpotential; MaterialProperty<Real> & _actual_mean_energy; MaterialProperty<Real> & _TArp; MaterialProperty<Real> & _Tem; MaterialProperty<Real> & _muu; MaterialProperty<Real> & _diffu; MaterialProperty<Real> & _sgnu; MaterialProperty<Real> & _T_gas; MaterialProperty<Real> & _p_gas; MaterialProperty<Real> & _n_gas; MaterialProperty<Real> & _kiz; MaterialProperty<Real> & _kex; MaterialProperty<Real> & _kel; MaterialProperty<Real> & _d_kiz_d_actual_mean_en; MaterialProperty<Real> & _d_kex_d_actual_mean_en; MaterialProperty<Real> & _d_kel_d_actual_mean_en; MaterialProperty<Real> & _TemVolts; const VariableGradient & _grad_potential; const VariableValue & _em; const VariableValue & _ip; const VariableGradient & _grad_em; const VariableGradient & _grad_ip; const VariableValue & _mean_en; }; #endif // GAS_H
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef SPALARTALLMARASBF_H #define SPALARTALLMARASBF_H #include "Kernel.h" // Forward Declarations class SpalartAllmarasBF; template<> InputParameters validParams<SpalartAllmarasBF>(); class SpalartAllmarasBF : public Kernel { public: SpalartAllmarasBF(const InputParameters & parameters); virtual ~SpalartAllmarasBF(){} protected: virtual Real computeQpResidual(); virtual Real computeQpJacobian(); // Coupled old variables const VariableValue & _u_vel; const VariableValue & _v_vel; const VariableValue & _w_vel; const VariableValue & _d; const VariableValue & _body_force_vorticity_mag; // Coupled old gradients const VariableGradient & _grad_u_vel; const VariableGradient & _grad_v_vel; const VariableGradient & _grad_w_vel; // Required parameters Real _rho; Real _mu_mol; Real _Ce; // Old value const VariableValue & _nu_tilde; }; #endif
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* Copyright (C) 2010 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.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __SPICE_CLIENT_AUDIO_H__ #define __SPICE_CLIENT_AUDIO_H__ #if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION) #warning "Only <spice-client.h> can be included directly" #endif #include <glib-object.h> #include <gio/gio.h> #include "spice-util.h" #include "spice-session.h" #include "channel-main.h" G_BEGIN_DECLS #define SPICE_TYPE_AUDIO spice_audio_get_type() #define SPICE_AUDIO(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_AUDIO, SpiceAudio)) #define SPICE_AUDIO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_AUDIO, SpiceAudioClass)) #define SPICE_IS_AUDIO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_AUDIO)) #define SPICE_IS_AUDIO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_AUDIO)) #define SPICE_AUDIO_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_AUDIO, SpiceAudioClass)) typedef struct _SpiceAudio SpiceAudio; typedef struct _SpiceAudioClass SpiceAudioClass; typedef struct _SpiceAudioPrivate SpiceAudioPrivate; /** * SpiceAudio: * * The #SpiceAudio struct is opaque and should not be accessed directly. */ struct _SpiceAudio { GObject parent; SpiceAudioPrivate *priv; }; /** * SpiceAudioClass: * @parent_class: Parent class. * * Class structure for #SpiceAudio. */ struct _SpiceAudioClass { GObjectClass parent_class; /*< private >*/ gboolean (*connect_channel)(SpiceAudio *audio, SpiceChannel *channel); void (*get_playback_volume_info_async)(SpiceAudio *audio, GCancellable *cancellable, SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data); gboolean (*get_playback_volume_info_finish)(SpiceAudio *audio, GAsyncResult *res, gboolean *mute, guint8 *nchannels, guint16 **volume, GError **error); void (*get_record_volume_info_async)(SpiceAudio *audio, GCancellable *cancellable, SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data); gboolean (*get_record_volume_info_finish)(SpiceAudio *audio, GAsyncResult *res, gboolean *mute, guint8 *nchannels, guint16 **volume, GError **error); gchar _spice_reserved[SPICE_RESERVED_PADDING - 4 * sizeof(void *)]; }; GType spice_audio_get_type(void); SpiceAudio* spice_audio_get(SpiceSession *session, GMainContext *context); #ifndef SPICE_DISABLE_DEPRECATED G_DEPRECATED_FOR(spice_audio_get) SpiceAudio* spice_audio_new(SpiceSession *session, GMainContext *context, const char *name); #endif G_END_DECLS #endif /* __SPICE_CLIENT_AUDIO_H__ */
/* Test of fabsl() function. Copyright (C) 2010-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2010-2012. */ #include <config.h> #include <math.h> #include "signature.h" SIGNATURE_CHECK (fabsl, long double, (long double)); #include <string.h> #include "macros.h" #include "minus-zero.h" #define DOUBLE long double #define L_(literal) literal##L #define MINUS_ZERO minus_zerol #define FABS fabsl #define RANDOM randoml #include "test-fabs.h" int main () { /* A particular positive value. */ x = 0.6L; y = fabsl (x); ASSERT (y == 0.6L); /* A particular negative value. */ x = -0.6L; y = fabsl (x); ASSERT (y == 0.6L); test_function (); return 0; }
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Compositor. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "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 Digia Plc and its Subsidiary(-ies) 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." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef WLDATADEVICE_H #define WLDATADEVICE_H #include <QtCompositor/private/qwayland-server-wayland.h> #include <qwlpointer_p.h> QT_BEGIN_NAMESPACE class QWaylandSurfaceView; namespace QtWayland { class Compositor; class DataSource; class InputDevice; class Surface; class DataDevice : public QtWaylandServer::wl_data_device, public PointerGrabber { public: DataDevice(InputDevice *inputDevice); void setFocus(QtWaylandServer::wl_keyboard::Resource *focusResource); void setDragFocus(QWaylandSurfaceView *focus, const QPointF &localPosition); QWaylandSurfaceView *dragIcon() const; void sourceDestroyed(DataSource *source); void focus() Q_DECL_OVERRIDE; void motion(uint32_t time) Q_DECL_OVERRIDE; void button(uint32_t time, Qt::MouseButton button, uint32_t state) Q_DECL_OVERRIDE; protected: void data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) Q_DECL_OVERRIDE; void data_device_set_selection(Resource *resource, struct ::wl_resource *source, uint32_t serial) Q_DECL_OVERRIDE; private: Compositor *m_compositor; InputDevice *m_inputDevice; DataSource *m_selectionSource; struct ::wl_client *m_dragClient; DataSource *m_dragDataSource; QWaylandSurfaceView *m_dragFocus; Resource *m_dragFocusResource; QWaylandSurfaceView *m_dragIcon; }; } QT_END_NAMESPACE #endif // WLDATADEVICE_H
/**************************************************************************** ** ** Copyright (C) 2009 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$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** 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. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QGRAPHICSLAYOUT_P_H #define QGRAPHICSLAYOUT_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of other Qt classes. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <QtCore/qglobal.h> #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW #include "qgraphicslayout.h" #include "qgraphicslayoutitem_p.h" #include <QtGui/qstyle.h> #include <QtGui/qwidget.h> #include <QtGui/qstyleoption.h> QT_BEGIN_NAMESPACE class QGraphicsLayoutItem; class QGraphicsWidget; #ifdef QT_DEBUG inline bool qt_graphicsLayoutDebug() { static int checked_env = -1; if(checked_env == -1) checked_env = !!qgetenv("QT_GRAPHICSLAYOUT_DEBUG").toInt(); return checked_env; } #endif class QLayoutStyleInfo { public: inline QLayoutStyleInfo() { invalidate(); } inline QLayoutStyleInfo(QStyle *style, QWidget *widget) : m_valid(true), m_style(style), m_widget(widget) { Q_ASSERT(style); if (widget) //### m_styleOption.initFrom(widget); m_defaultSpacing[0] = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing); m_defaultSpacing[1] = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing); } inline void invalidate() { m_valid = false; m_style = 0; m_widget = 0; } inline QStyle *style() const { return m_style; } inline QWidget *widget() const { return m_widget; } inline bool operator==(const QLayoutStyleInfo &other) { return m_style == other.m_style && m_widget == other.m_widget; } inline bool operator!=(const QLayoutStyleInfo &other) { return !(*this == other); } inline void setDefaultSpacing(Qt::Orientation o, qreal spacing){ if (spacing >= 0) m_defaultSpacing[o - 1] = spacing; } inline qreal defaultSpacing(Qt::Orientation o) const { return m_defaultSpacing[o - 1]; } inline qreal perItemSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation) const { Q_ASSERT(style()); return style()->layoutSpacing(control1, control2, orientation, &m_styleOption, widget()); } private: bool m_valid; QStyle *m_style; QWidget *m_widget; QStyleOption m_styleOption; qreal m_defaultSpacing[2]; }; class Q_AUTOTEST_EXPORT QGraphicsLayoutPrivate : public QGraphicsLayoutItemPrivate { Q_DECLARE_PUBLIC(QGraphicsLayout) public: QGraphicsLayoutPrivate() : QGraphicsLayoutItemPrivate(0, true), left(-1.0), top(-1.0), right(-1.0), bottom(-1.0), activated(true) { } void reparentChildItems(QGraphicsItem *newParent); void getMargin(qreal *result, qreal userMargin, QStyle::PixelMetric pm) const; Qt::LayoutDirection visualDirection() const; void addChildLayoutItem(QGraphicsLayoutItem *item); void activateRecursive(QGraphicsLayoutItem *item); qreal left, top, right, bottom; bool activated; }; QT_END_NAMESPACE #endif //QT_NO_GRAPHICSVIEW #endif
#include <stddef.h> #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <string.h> #include <unistd.h> #include <dirent.h> #include <errno.h> #include <malloc.h> #include <ctype.h> #include <fcntl.h> #include "stats.h" #include "trace.h" #include "pscanf.h" #include "pci.h" #include "intel_pmc_uncore.h" #define MASK0 0x238 #define MASK1 0x23C #define MATCH0 0x228 #define MATCH1 0x22C #define CTL_KEYS \ X(CTL0, "C", ""), \ X(CTL1, "C", ""), \ X(CTL2, "C", ""), \ X(CTL3, "C", "") #define CTR_KEYS \ X(CTR0, "E,W=48,U=flt", ""), \ X(CTR1, "E,W=48,U=flt", ""), \ X(CTR2, "E,W=48,U=flt", ""), \ X(CTR3, "E,W=48,U=flt", "") #define KEYS CTL_KEYS, CTR_KEYS #define PERF_EVENT(event, umask) \ ( (event) \ | (umask << 8) \ | (0UL << 18) /* Edge Detection. */ \ | (1UL << 21) /* Enable extra bit. */ \ | (1UL << 22) /* Enable. */ \ | (0UL << 23) /* Invert */ \ ) #define TxL_FLITS_G1_SNP PERF_EVENT(0x00,0x01) //!< snoops requests #define TxL_FLITS_G1_HOM PERF_EVENT(0x00,0x04) //!< snoop responses #define G1_DRS_DATA PERF_EVENT(0x02,0x08) //!< for data bandwidth, flits x 8B/time #define G2_NCB_DATA PERF_EVENT(0x03,0x04) //!< for data bandwidth, flits x 8B/time static int dids[] = {0x2F32, 0x2F33, 0x2F3A}; static uint32_t events[] = {TxL_FLITS_G1_SNP, TxL_FLITS_G1_HOM, G1_DRS_DATA, G2_NCB_DATA}; static int intel_hsw_qpi_begin(struct stats_type *type) { int nr = 0; int nr_dids = 3; int nr_events = 4; char **dev_paths = NULL; int nr_devs; if (pci_map_create(&dev_paths, &nr_devs, dids, nr_dids) < 0) TRACE("Failed to identify pci devices"); int i; for (i = 0; i < nr_devs; i++) if (intel_pmc_uncore_begin_dev(dev_paths[i], events, nr_events) == 0) nr++; if (nr == 0) type->st_enabled = 0; pci_map_destroy(&dev_paths, nr_devs); return nr > 0 ? 0 : -1; } static void intel_hsw_qpi_collect(struct stats_type *type) { int nr_dids = 3; char **dev_paths = NULL; int nr_devs; if (pci_map_create(&dev_paths, &nr_devs, dids, nr_dids) < 0) TRACE("Failed to identify pci devices"); int i; for (i = 0; i < nr_devs; i++) intel_pmc_uncore_collect_dev(type, dev_paths[i]); pci_map_destroy(&dev_paths, nr_devs); } struct stats_type intel_hsw_qpi_stats_type = { .st_name = "intel_hsw_qpi", .st_begin = &intel_hsw_qpi_begin, .st_collect = &intel_hsw_qpi_collect, #define X SCHEMA_DEF .st_schema_def = JOIN(KEYS), #undef X };
/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef MEXTENSIONRUNNER_H_ #define MEXTENSIONRUNNER_H_ #include <QObject> #include <QRectF> #include <QPixmap> #include <mnamespace.h> #include <mexport.h> class MWidget; class MScene; class MWindow; class QGraphicsWidget; class MAppletClient; class MAppletMessage; class MAppletMouseMessage; class MAppletCancelMessage; class MAppletMetaData; class MAppletInterface; class MAppletSharedMutex; class QAction; #ifdef QT_OPENGL_LIB class QGLContext; #endif #ifdef HAVE_CONTEXTSUBSCRIBER class ContextProperty; #endif //! \internal /** * MExtensionRunner is a class that is used to start and run oop (out of process) * extension widgets. * * W A R N I N G * ------------- * This file is not part of the libmeegotouch API. It should only be used by applet runner developers. */ class M_EXTENSIONS_EXPORT MExtensionRunner : public QObject { Q_OBJECT public: /*! * MExtensionRunner constructor */ MExtensionRunner(); //! MExtensionRunner destructor virtual ~MExtensionRunner(); /*! * Initialize the extension and establish an IPC connection between the runner and * the host application. * * \param serverName the name of the host process's server. * \return \c true if the extension and IPC connection were initialized correctly, * \c false if something went wrong. */ virtual bool init(const QString &serverName); /*! * Sends a message of type MAppletUpdateGeometryMessage to the host. */ virtual void sendUpdateGeometryMessage(); Q_SIGNALS: /*! * \brief A signal that is emitted when item is shown/hidden * TODO: Remove this redundant signal during next API/ABI break */ void visibilityChanged(bool visibility); /*! * \brief A signal that is emitted when item is shown/hidden */ void visibilityChanged(); protected slots: /*! * \brief A slot for receiving messages from the host application */ virtual void messageReceived(const MAppletMessage &message); /*! * \brief A slot for notifying that the scene has changed and needs to be painted */ virtual void sceneChanged(const QList<QRectF> &region); /*! * \brief Slot to be called when the host process has not sent any messages in ALIVE_TIMER_TIMEOUT milliseconds */ virtual void hostProcessNotAlive(); /*! * \brief Stops or starts the alive timer depending on the display blanking state */ void updateDisplayState(); protected: //! AppletClient for communicating between the runner and the host processes. MAppletClient *communicator; //! A parent widget for the actual extension widget QGraphicsWidget *parentWidget; //! The extension widget instantiated from shared library QGraphicsWidget *widget; //! Scene where the widget is inserted. MScene *scene; //! View into the scene. MWindow *view; /*! Pixmap in which the extension is painted. The underlying X pixmap is shared between the host and runner processes. */ QPixmap pixmap; //! List to hold object menu actions received from widget. QList<QAction *> widgetObjectMenuActions; #ifdef HAVE_CONTEXTSUBSCRIBER //! Context property for getting the screen blanking status ContextProperty *screenBlankProperty; #endif //! True if the display is currently blanked bool displayBlanked; //! Timer for checking that the host process is alive QTimer *aliveTimer; //! Shared mutex for locking the pixmap MAppletSharedMutex *pixmapMutex; //! Combined changed rect for the scene QRectF changedRect; //! Visibility status of the extension bool visible; /*! * Frees all resources that have been reserved by this object currently. */ virtual void teardown(); /*! * Handles an AppletMouseMessage. * * \param message the AppletMouseMessage to handle */ virtual void handleMouseEvent(const MAppletMouseMessage *message); /*! * Handles an AppletCancelMessage. * * \param message to be handled */ virtual void handleCancelEvent(const MAppletCancelMessage *message); /*! * Sets pixmap to use the received X pixmap handle * * \param handle the X pixmap handle to use */ virtual void createAppletPixmap(Qt::HANDLE handle); #ifdef UNIT_TEST friend class Ut_MExtensionRunner; #endif }; //! \internal_end #endif /* MEXTENSIONRUNNER_H_ */
/* * Copyright (C) 2020 ML!PA Consulting GmbH * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup tests * @{ * * @file * @brief Message bus test application * * @author Benjamin Valentin <benjamin.valentin@ml-pa.com> * * @} */ #include <stdio.h> #include <inttypes.h> #include "thread.h" #include "msg.h" #include "msg_bus.h" char t1_stack[THREAD_STACKSIZE_MAIN]; char t2_stack[THREAD_STACKSIZE_MAIN]; char t3_stack[THREAD_STACKSIZE_MAIN]; kernel_pid_t p_main, p1, p2, p3; void *thread1(void *arg) { msg_t msg; msg_bus_entry_t sub; puts("THREAD 1 start"); msg_bus_attach(arg, &sub); msg_bus_subscribe(&sub, 23); msg_bus_subscribe(&sub, 24); msg_receive(&msg); /* check if the message came from the right bus */ assert(msg_is_from_bus(arg, &msg)); printf("T1 recv: %s (type=%d)\n", (char*) msg.content.ptr, msg_bus_get_type(&msg)); msg_bus_detach(arg, &sub); return NULL; } void *thread2(void *arg) { msg_t msg; msg_bus_entry_t sub; puts("THREAD 2 start"); msg_bus_attach(arg, &sub); msg_bus_subscribe(&sub, 24); msg_receive(&msg); /* check if the message came from the right bus */ assert(msg_is_from_bus(arg, &msg)); printf("T2 recv: %s (type=%d)\n", (char*) msg.content.ptr, msg_bus_get_type(&msg)); msg_bus_detach(arg, &sub); return NULL; } void *thread3(void *arg) { msg_t msg; msg_bus_entry_t sub; puts("THREAD 3 start"); msg_bus_attach(arg, &sub); msg_bus_subscribe(&sub, 23); msg_receive(&msg); /* check if the message came from the right bus */ assert(msg_is_from_bus(arg, &msg)); printf("T3 recv: %s (type=%d)\n", (char*) msg.content.ptr, msg_bus_get_type(&msg)); msg_bus_detach(arg, &sub); return NULL; } int main(void) { msg_bus_t my_bus; msg_bus_init(&my_bus); p_main = thread_getpid(); p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 3, THREAD_CREATE_STACKTEST, thread1, &my_bus, "nr1"); p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 2, THREAD_CREATE_STACKTEST, thread2, &my_bus, "nr2"); p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST, thread3, &my_bus, "nr3"); puts("THREADS CREATED"); const char hello[] = "Hello Threads!"; for (int id = 22; id < 25; ++id) { int woken = msg_bus_post(&my_bus, id, (void*)hello); printf("Posted event %d to %d threads\n", id, woken); } /* make sure all threads have terminated */ if (thread_getstatus(p1) != STATUS_NOT_FOUND || thread_getstatus(p2) != STATUS_NOT_FOUND || thread_getstatus(p3) != STATUS_NOT_FOUND ) { puts("FAILED"); return 1; } puts("SUCCESS"); return 0; }
/* ---------------------------------------------------------------------------- * ATMEL Microcontroller Software Support - ROUSSET - * ---------------------------------------------------------------------------- * Copyright (c) 2007, Stelian Pop <stelian.pop@leadtechdesign.com> * Copyright (c) 2007 Lead Tech Design <www.leadtechdesign.com> * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the disclaimer below. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the disclaimer below in the documentation and/or * other materials provided with the distribution. * * Atmel's name may not be used to endorse or promote products derived from * this software without specific prior written permission. * * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- * File Name : at91cap9adk.h * Object : * Creation : *----------------------------------------------------------------------------- */ #ifndef _AT91CAP9ADK_H #define _AT91CAP9ADK_H /* ******************************************************************* */ /* PMC Settings */ /* */ /* The main oscillator is enabled as soon as possible in the c_startup */ /* and MCK is switched on the main oscillator. */ /* PLL initialization is done later in the hw_init() function */ /* ******************************************************************* */ #define MASTER_CLOCK (200000000/2) #define PLL_LOCK_TIMEOUT 1000000 /* PLLA = 12 MHz * (49 + 1) / 3 = 200 MHz */ #define PLLA_SETTINGS 0x2031be03 /* Set PLLB to 12 MHz * (7 + 1) / 1 = 96 MHz */ #define PLLB_SETTINGS 0x10073e01 /* Switch MCK on PLLA output PCK = PLLA = 2 * MCK */ #define MCKR_SETTINGS (AT91C_PMC_CSS_PLLA_CLK | AT91C_PMC_PRES_CLK | AT91C_PMC_MDIV_2) /* ******************************************************************* */ /* NorFlash Settings */ /* */ /* ******************************************************************* */ /* ******************************************************************* */ /* SDDRC Settings */ /* */ /* ******************************************************************* */ /* ******************************************************************* */ /* BootStrap Settings */ /* */ /* ******************************************************************* */ #define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */ #define IMG_SIZE 0x38000 /* Image Size in NorFlash */ #define MACH_TYPE 1442 /* AT91CAP9ADK */ #define JUMP_ADDR 0x73000000 /* Final Jump Address */ /* ******************************************************************* */ /* Application Settings */ /* ******************************************************************* */ #define CFG_HW_INIT #define CFG_SDDRC #define CFG_DEBUG #define CFG_NORFLASH #endif /* _AT91CAP9ADK_H */
/* Copyright (C) 2013 Fredrik Johansson This file is part of Arb. Arb is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include "acb_poly.h" void _acb_poly_evaluate2_rectangular(acb_t y, acb_t z, acb_srcptr poly, slong len, const acb_t x, slong prec) { slong i, j, m, r; acb_ptr xs; acb_t s, t, c; if (len < 3) { if (len == 0) { acb_zero(y); acb_zero(z); } else if (len == 1) { acb_set_round(y, poly + 0, prec); acb_zero(z); } else if (len == 2) { acb_mul(y, x, poly + 1, prec); acb_add(y, y, poly + 0, prec); acb_set_round(z, poly + 1, prec); } return; } m = n_sqrt(len) + 1; m *= 1; r = (len + m - 1) / m; xs = _acb_vec_init(m + 1); acb_init(s); acb_init(t); acb_init(c); _acb_vec_set_powers(xs, x, m + 1, prec); acb_set(y, poly + (r - 1) * m); for (j = 1; (r - 1) * m + j < len; j++) acb_addmul(y, xs + j, poly + (r - 1) * m + j, prec); for (i = r - 2; i >= 0; i--) { acb_set(s, poly + i * m); for (j = 1; j < m; j++) acb_addmul(s, xs + j, poly + i * m + j, prec); acb_mul(y, y, xs + m, prec); acb_add(y, y, s, prec); } len -= 1; r = (len + m - 1) / m; acb_mul_ui(z, poly + (r - 1) * m + 1, (r - 1) * m + 1, ARF_PREC_EXACT); for (j = 1; (r - 1) * m + j < len; j++) { acb_mul_ui(c, poly + (r - 1) * m + j + 1, (r - 1) * m + j + 1, ARF_PREC_EXACT); acb_addmul(z, xs + j, c, prec); } for (i = r - 2; i >= 0; i--) { acb_mul_ui(s, poly + i * m + 1, i * m + 1, ARF_PREC_EXACT); for (j = 1; j < m; j++) { acb_mul_ui(c, poly + i * m + j + 1, i * m + j + 1, ARF_PREC_EXACT); acb_addmul(s, xs + j, c, prec); } acb_mul(z, z, xs + m, prec); acb_add(z, z, s, prec); } _acb_vec_clear(xs, m + 1); acb_clear(s); acb_clear(t); acb_clear(c); } void acb_poly_evaluate2_rectangular(acb_t r, acb_t s, const acb_poly_t f, const acb_t a, slong prec) { _acb_poly_evaluate2_rectangular(r, s, f->coeffs, f->length, a, prec); }
/** * This file is part of TelepathyQt4 * * @copyright Copyright (C) 2009-2011 Collabora Ltd. <http://www.collabora.co.uk/> * @license LGPL 2.1 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _TelepathyQt4_examples_roster_roster_window_h_HEADER_GUARD_ #define _TelepathyQt4_examples_roster_roster_window_h_HEADER_GUARD_ #include <QMainWindow> #include <TelepathyQt4/Account> #include <TelepathyQt4/Types> namespace Tp { class PendingOperation; } class RosterWidget; class RosterWindow : public QMainWindow { Q_OBJECT public: RosterWindow(const QString &accountName, QWidget *parent = 0); virtual ~RosterWindow(); private Q_SLOTS: void onAccountReady(Tp::PendingOperation *op); void onAccountConnectionChanged(const Tp::ConnectionPtr &conn); private: void setupGui(); Tp::AccountPtr mAccount; RosterWidget *mRoster; }; #endif
#ifndef MIXMOPS_INCLUDED // -*- C++ -*- #define MIXMOPS_INCLUDED // #endif // WARNING: Multiple inclusions allowed /************************************************************************ Low-level matrix math operations. This header file is intended for internal library use only. You should understand what's going on in here before trying to use it yourself. Copyright (C) 1998 Michael Garland. See "COPYING.txt" for details. $Id: mixmops.h,v 1.8 1999/11/30 02:39:38 garland Exp $ ************************************************************************/ #ifdef MIXVOPS_DEFAULT_DIM # define __DIM const int N=MIXVOPS_DEFAULT_DIM #else # define __DIM const int N #endif #ifndef __T # define __T double #endif #define forall(i, N) for(unsigned int i=0; i<N*N; i++) #define def3(name, op) inline __T *name(__T *r, const __T *a, const __T *b, __DIM) { forall(i,N) op; return r; } #define def2(name, op) inline __T *name(__T *r, const __T *a, __DIM) { forall(i,N) op; return r; } #define def1(name, op) inline __T *name(__T *r, __DIM) { forall(i,N) op; return r; } #define def2s(name, op) inline __T *name(__T *r, const __T *a, __T d, __DIM) { forall(i,N) op; return r; } #define def1s(name, op) inline __T *name(__T *r, __T d, __DIM) { forall(i,N) op; return r; } def3(mxm_add, r[i] = a[i] + b[i]) def3(mxm_sub, r[i] = a[i] - b[i]) def2(mxm_addinto, r[i] += a[i]) def2(mxm_subfrom, r[i] -= a[i]) def2(mxm_set, r[i] = a[i]) def1(mxm_neg, r[i] = -r[i]) def2(mxm_neg, r[i] = -a[i]) def1s(mxm_set, r[i]=d) def1s(mxm_scale, r[i] *= d) def1s(mxm_invscale, r[i] /= d) def2s(mxm_scale, r[i] = a[i]*d) def2s(mxm_invscale, r[i] = a[i]/d) inline __T &mxm_ref(__T *A, uint i, uint j, __DIM) { return A[i*N + j]; } inline __T mxm_ref(const __T *A, uint i, uint j, __DIM) { return A[i*N + j]; } inline __T *mxm_row(__T *A, uint i, __DIM) { return A + i*N; } inline const __T *mxm_row(const __T *A, uint i, __DIM) { return A + i*N; } inline __T *mxm_identity(__T *A, __DIM) { mxm_set(A, 0.0, N); for(uint i=0; i<N; i++) mxm_ref(A, i, i, N) = 1.0; return A; } inline __T *mxm_xform(__T *r, const __T *A, const __T *x, __DIM) { const __T *a = A; for(uint i=0; i<N; i++) { r[i] = 0.0; for(uint j=0; j<N; j++) r[i] += (*a++) * x[j]; } return r; } //////////////////////////////////////////////////////////////////////// // The following couple of procedures are fairly straightforward but // rather inefficient. mxm_ref() provides an easy way to access the // (i,j) element of the matrix, but it's inefficient for looping over // all the elements. // inline __T *mxm_outerprod(__T *A, const __T *u, const __T *v, __DIM) { for(uint i=0; i<N; i++) for(uint j=0; j<N; j++) mxm_ref(A, i, j, N) = u[i] * v[j]; return A; } inline __T *mxm_mul(__T *r, const __T *a, const __T *b, __DIM) { mxm_set(r, 0.0, N); for(uint i=0; i<N; i++) for(uint j=0; j<N; j++) { for(uint k=0; k<N; k++) mxm_ref(r, i, j, N) += mxm_ref(a, i, k, N) * mxm_ref(b, k, j, N); } return r; } // // Only actually implemented for double (and maybe float). // extern __T mxm_invert(__T *r, const __T *a, __DIM); extern __T mxm_solve(__T *x, const __T *A, const __T *b, __DIM); extern int mxm_cholesky(__T *c, const __T *a, __DIM); inline ostream& mxm_write(ostream& out, const __T *a, __DIM) { for(uint i=0; i<N; i++) { for(uint j=0; j<N; j++) out << mxm_ref(a, i, j, N) << " "; out << endl; } return out; } inline ostream& mxm_write(const __T *a, __DIM) {return mxm_write(cout, a, N);} #ifndef mxm_local_block #ifdef __GNUC__ # define mxm_local_block(a,T,N) T a[N*N] # define mxm_free_local(a) #else # ifdef HAVE_ALLOCA # include <alloca.h> # define mxm_local_block(a,T,N) T *a = (T *)alloca(sizeof(T)*(N)*(N)) # define mxm_free_local(a) # else # define mxm_local_block(a,T,N) T *a = new T[(N)*(N)] # define mxm_free_local(a) delete[] a # endif #endif #endif #undef __T #undef __DIM #undef forall #undef def3 #undef def2 #undef def1 #undef def2s #undef def1s // MIXMOPS_INCLUDED
/* This file is part of the gf2x library. Copyright 2007, 2008, 2009, 2010, 2013, 2015 Richard Brent, Pierrick Gaudry, Emmanuel Thome', Paul Zimmermann This program is free software; you can redistribute it and/or modify it under the terms of either: - If the archive contains a file named toom-gpl.c (not a trivial placeholder), 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. - If the archive contains a file named toom-gpl.c which is a trivial placeholder, the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license text for more details. You should have received a copy of the GNU General Public License as well as the GNU Lesser General Public License along with this program; see the files COPYING and COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Helper program for rewriting headers after tuning. */ #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include "replace.h" void set_hash_define_int(struct hash_define * ptr, const char * name, int x) { ptr->identifier = strdup(name); ptr->string = malloc(32); snprintf(ptr->string, 32, "%d", x); } void set_hash_define(struct hash_define * ptr, const char * name, const char *v) { ptr->identifier = strdup(name); ptr->string = strdup(v); unsigned long l = strlen(ptr->string); for( ; l && isspace(ptr->string[l-1]) ; l--); ptr->string[l] = '\0'; } typedef int (*sortfunc_t) (const void *, const void *); int cmp_hash_define(struct hash_define * a, struct hash_define * b) { return strcmp(a->identifier, b->identifier); } int search_hash_define(const char * a, struct hash_define * b) { return strcmp(a, b->identifier); } void replace(struct hash_define * ptr, unsigned long n, const char * fname) { qsort(ptr, n, sizeof(struct hash_define), (sortfunc_t) & cmp_hash_define); FILE * fi, * fo; char * fname_out; size_t sl = strlen(fname)+10; char buffer[1024]; char id[80]; fname_out = malloc(sl); snprintf(fname_out,sl,"%s.new",fname); fi = fopen(fname, "r"); fo = fopen(fname_out, "w"); for (;!feof(fi);) { const char * x, *y; if (fgets(buffer, sizeof(buffer), fi) == NULL) { /* EOF, most certainly */ break; } #define IS_HDEFINE(X) (strncmp(X,"#define",7) == 0) #define IS_HUNDEF(X) (strncmp(X,"#undef",6) == 0) if (!(IS_HDEFINE(buffer) || IS_HUNDEF(buffer))) { fputs(buffer, fo); continue; } x = buffer; for(;*x && !isspace(*x);x++); for(;*x && isspace(*x);x++); for(y=x;*y&&!isspace(*y);y++); strncpy(id,x,y-x); id[y-x]='\0'; /* identifier is id */ struct hash_define * loc; loc = bsearch(id, ptr, n, sizeof(struct hash_define), (sortfunc_t) & search_hash_define); if (loc == NULL) { fputs(buffer, fo); continue; } if (loc->string[0] == '\0') { fprintf(stderr, "Error: replacement string %s used twice!\n", loc->identifier); exit(1); } for( ;; ) { x = buffer + strlen(buffer) - 1; for( ; (x - buffer >= 0) && isspace(*x) ; x--); /* If the current line was followed by a backslash, gobble * the following line as well. */ if ((x - buffer >= 0) && *x != '\\') break; /* It's normally an error to arrive here, although there's * not much questioning as to what to do in such a situation */ if (fgets(buffer, sizeof(buffer), fi) == NULL) break; } fprintf(fo,"#define %s\t\t%s\n", id, loc->string); loc->string[0]='\0'; } for(unsigned long i = 0 ; i < n ; i++) { struct hash_define * loc = ptr + i; if (loc->string[0] != '\0') { fprintf(stderr, "Warning: replacement string %s not used ; value:\n%s\n", loc->identifier, loc->string); } } fclose(fi); fclose(fo); rename(fname_out, fname); }
/* Searching in a string. Copyright (C) 2008-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include <string.h> /* Find the first occurrence of C in S. */ void * rawmemchr (const void *s, int c_in) { /* On 32-bit hardware, choosing longword to be a 32-bit unsigned long instead of a 64-bit uintmax_t tends to give better performance. On 64-bit hardware, unsigned long is generally 64 bits already. Change this typedef to experiment with performance. */ typedef unsigned long int longword; const unsigned char *char_ptr; const longword *longword_ptr; longword repeated_one; longword repeated_c; unsigned char c; c = (unsigned char) c_in; /* Handle the first few bytes by reading one byte at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ for (char_ptr = (const unsigned char *) s; (size_t) char_ptr % sizeof (longword) != 0; ++char_ptr) if (*char_ptr == c) return (void *) char_ptr; longword_ptr = (const longword *) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ /* Compute auxiliary longword values: repeated_one is a value which has a 1 in every byte. repeated_c has c in every byte. */ repeated_one = 0x01010101; repeated_c = c | (c << 8); repeated_c |= repeated_c << 16; if (0xffffffffU < (longword) -1) { repeated_one |= repeated_one << 31 << 1; repeated_c |= repeated_c << 31 << 1; if (8 < sizeof (longword)) { size_t i; for (i = 64; i < sizeof (longword) * 8; i *= 2) { repeated_one |= repeated_one << i; repeated_c |= repeated_c << i; } } } /* Instead of the traditional loop which tests each byte, we will test a longword at a time. The tricky part is testing if *any of the four* bytes in the longword in question are equal to NUL or c. We first use an xor with repeated_c. This reduces the task to testing whether *any of the four* bytes in longword1 is zero. We compute tmp = ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7). That is, we perform the following operations: 1. Subtract repeated_one. 2. & ~longword1. 3. & a mask consisting of 0x80 in every byte. Consider what happens in each byte: - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff, and step 3 transforms it into 0x80. A carry can also be propagated to more significant bytes. - If a byte of longword1 is nonzero, let its lowest 1 bit be at position k (0 <= k <= 7); so the lowest k bits are 0. After step 1, the byte ends in a single bit of value 0 and k bits of value 1. After step 2, the result is just k bits of value 1: 2^k - 1. After step 3, the result is 0. And no carry is produced. So, if longword1 has only non-zero bytes, tmp is zero. Whereas if longword1 has a zero byte, call j the position of the least significant zero byte. Then the result has a zero at positions 0, ..., j-1 and a 0x80 at position j. We cannot predict the result at the more significant bytes (positions j+1..3), but it does not matter since we already have a non-zero bit at position 8*j+7. The test whether any byte in longword1 is zero is equivalent to testing whether tmp is nonzero. This test can read beyond the end of a string, depending on where C_IN is encountered. However, this is considered safe since the initialization phase ensured that the read will be aligned, therefore, the read will not cross page boundaries and will not cause a fault. */ while (1) { longword longword1 = *longword_ptr ^ repeated_c; if ((((longword1 - repeated_one) & ~longword1) & (repeated_one << 7)) != 0) break; longword_ptr++; } char_ptr = (const unsigned char *) longword_ptr; /* At this point, we know that one of the sizeof (longword) bytes starting at char_ptr is == c. On little-endian machines, we could determine the first such byte without any further memory accesses, just by looking at the tmp result from the last loop iteration. But this does not work on big-endian machines. Choose code that works in both cases. */ char_ptr = (unsigned char *) longword_ptr; while (*char_ptr != c) char_ptr++; return (void *) char_ptr; }
/******************************************************************************\ This file is part of the C! library. A.K.A the cbang library. Copyright (c) 2003-2019, Cauldron Development LLC Copyright (c) 2003-2017, Stanford University All rights reserved. The C! library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. The C! library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the C! library. If not, see <http://www.gnu.org/licenses/>. In addition, BSD licensing may be granted on a case by case basis by written permission from at least one of the copyright holders. You may request written permission by emailing the authors. For information regarding this software email: Joseph Coffland joseph@cauldrondevelopment.com \******************************************************************************/ #pragma once #include "Buffer.h" #include <boost/iostreams/categories.hpp> // bidirectional_device_tag #include <boost/iostreams/positioning.hpp> // stream_offset #include <boost/iostreams/stream.hpp> namespace cb { class BufferDevice { Buffer &buffer; public: typedef char char_type; typedef boost::iostreams::bidirectional_device_tag category; BufferDevice(Buffer &buffer) : buffer(buffer) {} std::streamsize read(char *s, std::streamsize n) {return (std::streamsize)buffer.read(s, n);} std::streamsize write(const char *s, std::streamsize n) {return (std::streamsize)buffer.write(s, n);} }; typedef boost::iostreams::stream<BufferDevice> BufferStream; }
/* Simple DirectMedia Layer Copyright (C) 1997-2011 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, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #ifndef _SDL_cocoavideo_h #define _SDL_cocoavideo_h #include "SDL_opengl.h" #include <ApplicationServices/ApplicationServices.h> #include <Cocoa/Cocoa.h> #include "SDL_keycode.h" #include "../SDL_sysvideo.h" #include "SDL_cocoaclipboard.h" #include "SDL_cocoaevents.h" #include "SDL_cocoakeyboard.h" #include "SDL_cocoamodes.h" #include "SDL_cocoamouse.h" #include "SDL_cocoaopengl.h" #include "SDL_cocoawindow.h" #if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 #if __LP64__ typedef long NSInteger; typedef unsigned long NSUInteger; #else typedef int NSInteger; typedef unsigned int NSUInteger; #endif #endif /* Private display data */ @class SDLTranslatorResponder; typedef struct SDL_VideoData { SInt32 osversion; unsigned int modifierFlags; void *key_layout; SDLTranslatorResponder *fieldEdit; NSInteger clipboard_count; Uint32 screensaver_activity; } SDL_VideoData; /* Utility functions */ extern NSImage * Cocoa_CreateImage(SDL_Surface * surface); #endif /* _SDL_cocoavideo_h */ /* vi: set ts=4 sw=4 expandtab: */
/* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef LocaleWin_h #define LocaleWin_h #include <windows.h> #include <wtf/Forward.h> #include <wtf/Vector.h> #include <wtf/text/WTFString.h> namespace WebCore { class DateComponents; struct DateFormatToken; class LocaleWin { public: static PassOwnPtr<LocaleWin> create(LCID); static LocaleWin* currentLocale(); ~LocaleWin(); double parseDate(const String&); String formatDate(const DateComponents&); #if ENABLE(CALENDAR_PICKER) String dateFormatText(); const Vector<String>& monthLabels(); const Vector<String>& weekDayShortLabels(); unsigned firstDayOfWeek() { return m_firstDayOfWeek; } #endif #if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) String timeFormatText(); String shortTimeFormatText(); const Vector<String>& timeAMPMLabels(); #endif // For testing. double parseDate(const String& format, int baseYear, const String& input); String formatDate(const String& format, int baseYear, int year, int month, int day); static String dateFormatText(const String& format, const String& yearText, const String& monthText, const String& dayText); private: explicit LocaleWin(LCID); String getLocaleInfoString(LCTYPE); void ensureShortMonthLabels(); void ensureMonthLabels(); void ensureShortDateTokens(); int parseNumberOrMonth(const String&, unsigned& index); double parseDate(const Vector<DateFormatToken>&, int baseYear, const String&); String formatDate(const Vector<DateFormatToken>&, int baseYear, int year, int month, int day); #if ENABLE(CALENDAR_PICKER) void ensureWeekDayShortLabels(); #endif LCID m_lcid; int m_baseYear; Vector<DateFormatToken> m_shortDateTokens; Vector<String> m_shortMonthLabels; Vector<String> m_monthLabels; #if ENABLE(CALENDAR_PICKER) Vector<String> m_weekDayShortLabels; unsigned m_firstDayOfWeek; #endif #if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS) String m_timeFormatText; Vector<String> m_timeAMPMLabels; #endif }; } #endif
/**************************************************************************** ** ** 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://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 IOSDEBUGSUPPORT_H #define IOSDEBUGSUPPORT_H #include "iosrunconfiguration.h" #include <QProcess> namespace Debugger { class DebuggerRunControl; } namespace ProjectExplorer { class RunControl; } namespace Ios { namespace Internal { class IosRunConfiguration; class IosRunner; class IosDebugSupport : public QObject { Q_OBJECT public: static ProjectExplorer::RunControl *createDebugRunControl(IosRunConfiguration *runConfig, QString *errorMessage); IosDebugSupport(IosRunConfiguration *runConfig, Debugger::DebuggerRunControl *runControl); ~IosDebugSupport(); private slots: void handleGdbServerPort(int gdbServerFd); void handleGotInferiorPid(Q_PID); void handleRemoteProcessFinished(bool cleanEnd); void handleRemoteOutput(const QString &output); void handleRemoteErrorOutput(const QString &output); private: Debugger::DebuggerRunControl *m_runControl; IosRunner * const m_runner; const QString m_dumperLib; int m_qmlPort; }; } // namespace Internal } // namespace Ios #endif // IOSDEBUGSUPPORT_H
/* libaio Linux async I/O interface compat-0_1.c : compatibility symbols for libaio 0.1.x-0.3.x Copyright 2002 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdlib.h> #include <asm/errno.h> #include "libaio.h" #include "vsys_def.h" #include "syscall.h" #ifndef ANDROID /* ABI change. Provide partial compatibility on this one for now. */ SYMVER(compat0_1_io_cancel, io_cancel, 0.1); int compat0_1_io_cancel(io_context_t ctx, struct iocb *iocb) { struct io_event event; /* FIXME: the old ABI would return the event on the completion queue */ return io_cancel(ctx, iocb, &event); } SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1); int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) { struct timespec timeout; if (when) timeout = *when; return io_getevents(ctx, 0, 0, NULL, when ? &timeout : NULL); } /* ABI change. Provide backwards compatibility for this one. */ SYMVER(compat0_1_io_getevents, io_getevents, 0.1); int compat0_1_io_getevents(io_context_t ctx_id, long nr, struct io_event *events, const struct timespec *const_timeout) { struct timespec timeout; if (const_timeout) timeout = *const_timeout; return io_getevents(ctx_id, 1, nr, events, const_timeout ? &timeout : NULL); } #endif
#ifndef _ControllerFloatHandler_H_ #define _ControllerFloatHandler_H_ namespace Ogre { //rastaman 11/13/2005 // ControllerValueFloat Event Director // need some way to callback into C# for getValue and setValue typedef float (SWIGSTDCALL *CVFH_GetValue_FunctionPointer)(void); typedef void (SWIGSTDCALL *CVFH_SetValue_FunctionPointer)(float); class ControllerValueFloatDirector : public ControllerValue<float> { public: CVFH_GetValue_FunctionPointer mGetValueFP; CVFH_SetValue_FunctionPointer mSetValueFP; public: ControllerValueFloatDirector() { mGetValueFP =0; mSetValueFP =0; } virtual float getValue (void) const { if(mGetValueFP) return mGetValueFP(); else return 0; } virtual void setValue (float value) { if(mSetValueFP) mSetValueFP(value); } }; //rastaman 11/14/2005 // ControllerFunctionFloat Event Director // need some way to callback into C# for calculate typedef float (SWIGSTDCALL *CFFH_Calculate_FunctionPointer)(float); typedef float (SWIGSTDCALL *CFFH_GetAdjustedInput_FunctionPointer)(float); class ControllerFunctionFloatDirector : public ControllerFunction<float> { protected: float getAdjustedInput(float input) { if(mGetAdjustedInputFP) return mGetAdjustedInputFP(input); else return ControllerFunction<Real>::getAdjustedInput(input); } public: CFFH_Calculate_FunctionPointer mCalculateFP; CFFH_GetAdjustedInput_FunctionPointer mGetAdjustedInputFP; ControllerFunctionFloatDirector(bool deltaInput) : ControllerFunction<float>(deltaInput) { mCalculateFP = 0; mGetAdjustedInputFP = 0; } float calculate (float sourceValue) { if(mCalculateFP) return mCalculateFP(sourceValue); else return 0; } bool GetDeltaInput() { return mDeltaInput; } void SetDeltaInput(bool vv) { mDeltaInput = vv; } float GetDeltaCount() { return mDeltaCount; } void SetDeltaCount(float vv) { mDeltaCount = vv; } }; } extern "C" SWIGEXPORT void CVFH_GetValue_Function(void* cv, void* fn) { ((Ogre::ControllerValueFloatDirector*)cv)->mGetValueFP = (CVFH_GetValue_FunctionPointer)fn; } extern "C" SWIGEXPORT void CVFH_SetValue_Function(ControllerValueFloatDirector* cv, void* fn) { ((Ogre::ControllerValueFloatDirector*)cv)->mSetValueFP = (CVFH_SetValue_FunctionPointer)fn; } extern "C" SWIGEXPORT void CFFH_Calculate_Function(void* cf, void* fn) { ((Ogre::ControllerFunctionFloatDirector*)cf)->mCalculateFP = (CFFH_Calculate_FunctionPointer)fn; } extern "C" SWIGEXPORT void CFFH_GetAdjustedInput_Function(void* cf, void* fn) { ((Ogre::ControllerFunctionFloatDirector*)cf)->mGetAdjustedInputFP = (CFFH_GetAdjustedInput_FunctionPointer)fn; } #endif //_ControllerFloatHandler_H_
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** 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. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ //! [0] #ifndef MULTIPAGEWIDGETPLUGIN_H #define MULTIPAGEWIDGETPLUGIN_H #include <QtDesigner/QDesignerCustomWidgetInterface> QT_BEGIN_NAMESPACE class QIcon; class QWidget; QT_END_NAMESPACE class MultiPageWidgetPlugin: public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: MultiPageWidgetPlugin(QObject *parent = 0); QString name() const; QString group() const; QString toolTip() const; QString whatsThis() const; QString includeFile() const; QIcon icon() const; bool isContainer() const; QWidget *createWidget(QWidget *parent); bool isInitialized() const; void initialize(QDesignerFormEditorInterface *formEditor); QString domXml() const; private slots: void currentIndexChanged(int index); void pageTitleChanged(const QString &title); private: bool initialized; }; #endif //! [0]
// @(#)root/proofd:$Id$ // Author: G. Ganis June 2005 /************************************************************************* * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_XrdProofdResponse #define ROOT_XrdProofdResponse ////////////////////////////////////////////////////////////////////////// // // // XrdProofdResponse // // // // Authors: G. Ganis, CERN, 2005 // // // // Utility class to handle replies to clients. // // // ////////////////////////////////////////////////////////////////////////// #include <string.h> #include <unistd.h> #include <sys/uio.h> #include "XpdSysPthread.h" #include "XrdOuc/XrdOucString.hh" #include "XProofProtocol.h" class XrdLink; class XrdProofdResponse { public: XrdProofdResponse() { fLink = 0; *fTrsid = '\0'; fSID = 0; fResp.dlen = 0; fResp.status = 0; fResp.streamid[0] = 0; fResp.streamid[1] = 0; } virtual ~XrdProofdResponse() {} inline const char *STRID() { return (const char *)fTrsid;} inline const char *TraceID() const { return fTraceID.c_str(); } inline XrdLink *Link() const { return fLink; } int LinkSend(const char *buff, int len, XrdOucString &e); int LinkSend(const struct iovec *iov, int iocnt, int len, XrdOucString &e); int Send(void); int Send(const char *msg); int Send(void *data, int dlen); int Send(XResponseType rcode); int Send(XResponseType rcode, void *data, int dlen); int Send(XErrorCode ecode, const char *msg); int Send(XPErrorCode ecode, const char *msg); int Send(XResponseType rcode, int info, char *data = 0); int Send(XResponseType rcode, XProofActionCode acode, int info); int Send(XResponseType rcode, XProofActionCode acode, void *data, int dlen); int Send(XResponseType rcode, XProofActionCode acode, kXR_int32 sid, void *data, int dlen); int SendI(kXR_int32 int1, void *data = 0, int dlen = 0); int SendI(kXR_int32 int1, kXR_int32 int2, void *data = 0, int dlen = 0); int SendI(kXR_int32 int1, kXR_int16 int2, kXR_int16 int3, void *data = 0, int dlen = 0); void Set(XrdLink *l); inline void SetTag(const char *tag) { fTag = tag; } void SetTraceID(); void Set(unsigned char *stream); void Set(unsigned short streamid); void Set(ServerResponseHeader *resp); void GetSID(unsigned short &sid); void SetTrsid(); // To protect from concurrent use XrdSysRecMutex fMutex; private: ServerResponseHeader fResp; XrdLink *fLink; char fTrsid[8]; // sizeof() does not work here unsigned short fSID; XrdOucString fTraceID; XrdOucString fTag; }; #endif
#ifndef _ISPATIALINDEXREADER_H_ #define _ISPATIALINDEXREADER_H_ // // // Copyright (C) 2004-2006 Autodesk, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of version 2.1 of the GNU Lesser // General Public License as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // /// <library> /// FdoRdbms.lib /// </library> #ifdef _WIN32 #pragma once #endif #include <Fdo.h> #include "Rdbms/SpatialIndexDimensionType.h" #include "Rdbms/SpatialIndexType.h" /// <summary>The ISpatialIndexReader interface provides forward only, readonly /// functionality for enumerating spatial indexes. A reference to an /// ISpatialIndexReader is returned from the GetSpatialIndexes command. /// The initial position of the ISpatialIndexReader is prior to the /// first item. Therefore you must call ReadNext to begin accessing any data.</summary> class FdoISpatialIndexReader : public FdoIDisposable { public: /// <summary>Gets the name of the spatial index currently being read.</summary> /// <returns>Returns the name of the spatial context.</returns> FDO_API virtual const wchar_t* GetName() = 0; /// <summary>Gets the name of the current spatial context as a String.</summary> /// <returns>Returns the description of the spatial context </returns> FDO_API virtual const wchar_t* GetSpatialContextName() = 0; /// <summary>Gets the type of the current spatial Index, either Quad-Tree or R-Tree.</summary> /// <returns>Returns the spatial index type</returns> FDO_API virtual SpatialIndexType GetSpatialIndexType() = 0; /// <summary>Gets the number of dimensions of the current spatial Index.</summary> /// <returns>Returns the extent type</returns> FDO_API virtual SpatialIndexDimensionType GetNumDimensions() = 0; /// <summary>Advances the reader to the next item. The default position of the reader /// is prior to the first item. Therefore you must call ReadNext to begin /// accessing any data.</summary> /// <returns>Returns true if there is a next item.</returns> FDO_API virtual bool ReadNext() = 0; /// <summary>Closes the ISpatialIndexReader object freeing any resources it may /// be holding.</summary> /// <returns>Returns nothing</returns> FDO_API virtual void Dispose() = 0; }; #endif
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (info@qt.nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at info@qt.nokia.com. ** **************************************************************************/ #ifndef QMLDESIGNER_QT4NODEINSTANCECLIENTPROXY_H #define QMLDESIGNER_QT4NODEINSTANCECLIENTPROXY_H #include "nodeinstanceclientproxy.h" namespace QmlDesigner { class Qt4NodeInstanceClientProxy : public NodeInstanceClientProxy { Q_OBJECT public: explicit Qt4NodeInstanceClientProxy(QObject *parent = 0); }; } // namespace QmlDesigner #endif // QMLDESIGNER_QT4NODEINSTANCECLIENTPROXY_H
/* -*-c++-*- IfcPlusPlus - www.ifcplusplus.com - Copyright (C) 2011 Fabian Gerold * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * 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 * OpenSceneGraph Public License for more details. */ #pragma once #include <vector> #include <map> #include <sstream> #include <string> #include "ifcpp/model/shared_ptr.h" #include "ifcpp/model/IfcPPObject.h" #include "ifcpp/model/IfcPPGlobal.h" #include "IfcPreDefinedPropertySet.h" class IFCPP_EXPORT IfcPositiveLengthMeasure; class IFCPP_EXPORT IfcNonNegativeLengthMeasure; class IFCPP_EXPORT IfcNormalisedRatioMeasure; class IFCPP_EXPORT IfcShapeAspect; class IFCPP_EXPORT IfcLengthMeasure; //ENTITY class IFCPP_EXPORT IfcWindowLiningProperties : public IfcPreDefinedPropertySet { public: IfcWindowLiningProperties(); IfcWindowLiningProperties( int id ); ~IfcWindowLiningProperties(); virtual shared_ptr<IfcPPObject> getDeepCopy( IfcPPCopyOptions& options ); virtual void getStepLine( std::stringstream& stream ) const; virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const; virtual void readStepArguments( const std::vector<std::wstring>& args, const boost::unordered_map<int,shared_ptr<IfcPPEntity> >& map ); virtual void setInverseCounterparts( shared_ptr<IfcPPEntity> ptr_self ); virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes ); virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes ); virtual void unlinkFromInverseCounterparts(); virtual const char* className() const { return "IfcWindowLiningProperties"; } // IfcRoot ----------------------------------------------------------- // attributes: // shared_ptr<IfcGloballyUniqueId> m_GlobalId; // shared_ptr<IfcOwnerHistory> m_OwnerHistory; //optional // shared_ptr<IfcLabel> m_Name; //optional // shared_ptr<IfcText> m_Description; //optional // IfcPropertyDefinition ----------------------------------------------------------- // inverse attributes: // std::vector<weak_ptr<IfcRelDeclares> > m_HasContext_inverse; // std::vector<weak_ptr<IfcRelAssociates> > m_HasAssociations_inverse; // IfcPropertySetDefinition ----------------------------------------------------------- // inverse attributes: // std::vector<weak_ptr<IfcTypeObject> > m_DefinesType_inverse; // std::vector<weak_ptr<IfcRelDefinesByTemplate> > m_IsDefinedBy_inverse; // std::vector<weak_ptr<IfcRelDefinesByProperties> > m_DefinesOccurrence_inverse; // IfcPreDefinedPropertySet ----------------------------------------------------------- // IfcWindowLiningProperties ----------------------------------------------------------- // attributes: shared_ptr<IfcPositiveLengthMeasure> m_LiningDepth; //optional shared_ptr<IfcNonNegativeLengthMeasure> m_LiningThickness; //optional shared_ptr<IfcNonNegativeLengthMeasure> m_TransomThickness; //optional shared_ptr<IfcNonNegativeLengthMeasure> m_MullionThickness; //optional shared_ptr<IfcNormalisedRatioMeasure> m_FirstTransomOffset; //optional shared_ptr<IfcNormalisedRatioMeasure> m_SecondTransomOffset; //optional shared_ptr<IfcNormalisedRatioMeasure> m_FirstMullionOffset; //optional shared_ptr<IfcNormalisedRatioMeasure> m_SecondMullionOffset; //optional shared_ptr<IfcShapeAspect> m_ShapeAspectStyle; //optional shared_ptr<IfcLengthMeasure> m_LiningOffset; //optional shared_ptr<IfcLengthMeasure> m_LiningToPanelOffsetX; //optional shared_ptr<IfcLengthMeasure> m_LiningToPanelOffsetY; //optional };
/* MyTRIM - a three dimensional binary collision Monte Carlo library. Copyright (C) 2008-2018 Daniel Schwen <daniel@schwen.de> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MYTRIM_SAMPLE_BURRIED_WIRE_H #define MYTRIM_SAMPLE_BURRIED_WIRE_H #include "sample_wire.h" namespace MyTRIM_NS { class SampleBurriedWire : public SampleWire { public: SampleBurriedWire(Real x = 10000.0, Real y = 10000.0, Real z = 10000.0); virtual MaterialBase * lookupMaterial(Point & pos); }; } // namespace MyTRIM_NS #endif
/* Copyright (C) 2021 Fredrik Johansson This file is part of Arb. Arb is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include "arb_hypgeom.h" void rising_algorithm(arb_t res, const arb_t x, ulong n, ulong m, slong prec, int alg, int alias) { if (alias) { arb_set(res, x); rising_algorithm(res, res, n, m, prec, alg, 0); return; } if (alg == 0) arb_hypgeom_rising_ui_rs(res, x, n, m, prec); else if (alg == 1) arb_hypgeom_rising_ui_forward(res, x, n, prec); else if (alg == 2) arb_hypgeom_rising_ui_bs(res, x, n, prec); else if (alg == 3) arb_hypgeom_rising_ui_rec(res, x, n, prec); else arb_hypgeom_rising_ui(res, x, n, prec); } int main() { slong iter; flint_rand_t state; flint_printf("rising_ui...."); fflush(stdout); flint_randinit(state); for (iter = 0; iter < 10000 * arb_test_multiplier(); iter++) { arb_t x, xk, y, ya, yb, yayb; ulong k, n, m1, m2, m3; slong prec; int alg1, alg2, alg3, alias1, alias2, alias3; prec = 2 + n_randint(state, 200); k = n_randint(state, 10); n = n_randint(state, 50); m1 = n_randint(state, 2) ? 0 : 1 + n_randint(state, FLINT_MAX(n + k, 1)); m2 = n_randint(state, 2) ? 0 : 1 + n_randint(state, FLINT_MAX(k, 1)); m3 = n_randint(state, 2) ? 0 : 1 + n_randint(state, FLINT_MAX(n, 1)); alg1 = n_randint(state, 5); alg2 = n_randint(state, 5); alg3 = n_randint(state, 5); alias1 = n_randint(state, 2); alias2 = n_randint(state, 2); alias3 = n_randint(state, 2); if (n_randint(state, 100) == 0) n += 100; arb_init(x); arb_init(xk); arb_init(y); arb_init(ya); arb_init(yb); arb_init(yayb); arb_randtest(x, state, prec, 10 + n_randint(state, 200)); arb_add_ui(xk, x, k, prec); rising_algorithm(y, x, n + k, m1, prec, alg1, alias1); rising_algorithm(ya, x, k, m2, prec, alg2, alias2); rising_algorithm(yb, xk, n, m3, prec, alg3, alias3); arb_mul(yayb, ya, yb, prec); if (!arb_overlaps(y, yayb)) { flint_printf("FAIL\n\n"); flint_printf("k = %wu, n = %wu, m1 = %wu, m2 = %wu, m3 = %wu\n\n", k, n, m1, m2, m3); flint_printf("x = "); arb_printn(x, 100, 0); flint_printf("\n\n"); flint_printf("y = "); arb_printn(y, 100, 0); flint_printf("\n\n"); flint_printf("ya = "); arb_printn(ya, 100, 0); flint_printf("\n\n"); flint_printf("yb = "); arb_printn(yb, 100, 0); flint_printf("\n\n"); flint_printf("yayb = "); arb_printn(yayb, 100, 0); flint_printf("\n\n"); flint_abort(); } arb_clear(x); arb_clear(xk); arb_clear(y); arb_clear(ya); arb_clear(yb); arb_clear(yayb); } flint_randclear(state); flint_cleanup(); flint_printf("PASS\n"); return EXIT_SUCCESS; }
/* * Description: This file is the packet format of neighbor discovery advertisement packet * Author: Haoyang Yu <haoyang.yu@rutgers.edu> */ #ifndef NEIGHBORDISCOVERY_NBD_ADV_HDR_H_ #define NEIGHBORDISCOVERY_NBD_ADV_HDR_H_ #endif #include <stdint.h> #include <timex.h> /** * @brief define the neighbor discovery advertisement header */ typedef struct __attribute__((packed)) { uint8_t versionType; uint16_t guid; timex_t lifetime; bool isnew; } mf_nbd_adv_hdr_t; //set version of neighbor discovery advertisement packet static inline void mf_nbd_adv_hdr_setVersion(mf_nbd_adv_hdr_t *hdr, uint8_t version){ //get the version out uint8_t type = hdr->versionType & 0x0f; version <<= 4; hdr->versionType = version | type; } //get version of neighbor discovery advertisement packet static inline uint8_t mf_nbd_adv_hdr_getVersion(mf_nbd_adv_hdr_t *hdr){ return hdr->versionType >> 4; } //set type of neighbor discovery advertisement packet static inline void mf_nbd_adv_hdr_setType(mf_nbd_adv_hdr_t *hdr, uint8_t type){ hdr->versionType &= 0xf0; hdr->versionType |= type; } //get type of neighbor discovery advertisement packet static inline uint8_t mf_nbd_adv_hdr_getType(mf_nbd_adv_hdr_t *hdr){ return hdr->versionType &= 0x0f; } static inline void mf_nbd_adv_hdr_init(mf_nbd_adv_hdr_t *hdr, uint8_t version, uint8_t type, uint16_t guid){ timex_t time; mf_nbd_adv_hdr_setVersion(hdr, version); mf_nbd_adv_hdr_setType(hdr, type); hdr->guid = guid; hdr->lifetime = time; hdr->isnew = 1; }
#ifndef _SYS_UIO_H #define _SYS_UIO_H #ifdef __cplusplus extern "C" { #endif #define __NEED_size_t #define __NEED_ssize_t #define __NEED_struct_iovec #include <bits/alltypes.h> ssize_t readv (int, const struct iovec *, int); ssize_t writev (int, const struct iovec *, int); #ifdef __cplusplus } #endif #endif
/* radare - LGPL - Copyright 2017 - wargio */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <r_lib.h> #include <r_util.h> #include <r_flag.h> #include <r_anal.h> #include <r_parse.h> static int replace(int argc, const char *argv[], char *newstr) { int i,j,k; struct { char *op; char *str; } ops[] = { { "add", "A += B"}, { "adc", "A += B + carry"}, { "adiw", "A+1:A += B"}, { "sub", "A -= B"}, { "subi", "A -= B"}, { "sbc", "A -= (B + carry)"}, { "sbci", "A -= (B + carry)"}, { "sbiw", "A+1:A -= B"}, { "and", "A &= B"}, { "andi", "A &= B"}, { "or", "A |= B"}, { "ori", "A |= B"}, { "eor", "A ^= B"}, { "com", "A = 0xff - A"}, { "neg", "A = -A"}, { "sbr", "A |= B"}, { "cbr", "A &= (0xff - B)"}, { "inc", "A++"}, { "dec", "A--"}, { "tst", "A &= A"}, { "clr", "A ^= A"}, { "ser", "A = 0xff"}, { "mul", "r1:r0 = A * B"}, { "rjmp", "goto A"}, { "ijmp", "goto z"}, { "jmp", "goto A"}, { "rcall", "goto A"}, { "icall", "goto z"}, { "call", "goto A"}, { "ret", "return"}, { "iret", "return_interrupt()"}, { "cp", "var = A - B"}, { "cpc", "var = A - B - carry"}, { "cpi", "var = A - B"}, { "breq", "if(!var) goto A"}, { "brne", "if(var) goto A"}, { "brsh", "if(var >= 0) goto A"}, { "brlo", "if(var < 0) goto A"}, { "brmi", "if(var < 0) goto A"}, { "brpl", "if(var > 0) goto A"}, { "brge", "if(var >= 0) goto A"}, { "brlt", "if(var < 0) goto A"}, { "mov", "A = B"}, { "movw", "A+1:A = B+1:B"}, { "ldi", "A = B"}, { "lds", "A = *(B)"}, { "ld", "A = *(B)"}, { "ldd", "A = *(B)"}, { "lpm", "r0 = z"}, { "in", "A = B"}, { "out", "A = B"}, { "push", "push(A)"}, { "pop", "A = pop()"}, { "lsl", "A <<= 1"}, { "lsr", "A >>= 1"}, { "rol", "A = (A << 1) | (A >> 7)"}, { "ror", "A = (A << 7) | (A >> 1)"}, { "asr", "A >>= 1"}, { "swap", "A = ((A & 0xf0) >> 4) | ((A & 0x0f) << 4)"}, { "sec", "c = 1"}, { "clc", "c = 0"}, { "sen", "n = 1"}, { "cln", "n = 0"}, { "sez", "z = 1"}, { "clz", "z = 0"}, { "sei", "i = 1"}, { "cli", "i = 0"}, { "ses", "s = 1"}, { "cls", "s = 0"}, { "sev", "v = 1"}, { "clv", "v = 0"}, { "set", "t = 1"}, { "clt", "t = 0"}, { "seh", "h = 1"}, { "clh", "h = 0"}, { "nop", ""}, { "halt", "_halt()"}, { "wdr", "_watchdog_reset()"}, { "std", "*(A) = B"}, { "st", "*(A) = B"}, { "sts", "*(A) = B"}, { NULL } }; for (i = 0; ops[i].op != NULL; i++) { if (!strcmp (ops[i].op, argv[0])) { if (newstr != NULL) { for (j = k = 0; ops[i].str[j] != '\0'; j++, k++) { if (ops[i].str[j] >= 'A' && ops[i].str[j] <= 'J') { const char *w = argv[ops[i].str[j] - '@']; if (w != NULL) { strcpy (newstr + k, w); k += strlen(w) - 1; } } else newstr[k] = ops[i].str[j]; } newstr[k] = '\0'; } return true; } } /* TODO: this is slow */ if (newstr != NULL) { newstr[0] = '\0'; for (i = 0; i < argc; i++) { strcat (newstr, argv[i]); strcat (newstr, (i == 0 || i == argc - 1) ? " ":", "); } } return false; } #define WSZ 128 static int parse(RParse *p, const char *data, char *str) { int i, len = strlen (data); char w0[WSZ]; char w1[WSZ]; char w2[WSZ]; char w3[WSZ]; char w4[WSZ]; char *buf, *ptr, *optr; // malloc can be slow here :? if (!(buf = malloc (len + 1))) { return false; } memcpy (buf, data, len + 1); r_str_trim (buf); if (*buf) { w0[0] = '\0'; w1[0] = '\0'; w2[0] = '\0'; w3[0] = '\0'; w4[0] = '\0'; ptr = strchr (buf, ' '); if (!ptr) { ptr = strchr (buf, '\t'); } if (ptr) { *ptr = '\0'; for (++ptr; *ptr == ' '; ptr++) { //nothing to see here } strncpy (w0, buf, WSZ - 1); strncpy (w1, ptr, WSZ - 1); optr = ptr; ptr = strchr (ptr, ','); if (ptr) { *ptr = '\0'; for (++ptr; *ptr == ' '; ptr++) { //nothing to see here } strncpy (w1, optr, WSZ - 1); strncpy (w2, ptr, WSZ - 1); optr = ptr; ptr = strchr (ptr, ','); if (ptr) { *ptr = '\0'; for (++ptr; *ptr == ' '; ptr++) { //nothing to see here } strncpy (w2, optr, WSZ - 1); strncpy (w3, ptr, WSZ - 1); optr = ptr; // bonus ptr = strchr (ptr, ','); if (ptr) { *ptr = '\0'; for (++ptr; *ptr == ' '; ptr++) { //nothing to see here } strncpy (w3, optr, WSZ - 1); strncpy (w4, ptr, WSZ - 1); } } } } else { strncpy (w0, buf, WSZ - 1); } { const char *wa[] = { w0, w1, w2, w3, w4 }; int nw = 0; for (i = 0; i < 5; i++) { if (wa[i][0] != '\0') { nw++; } } replace (nw, wa, str); } } free (buf); return true; } RParsePlugin r_parse_plugin_avr_pseudo = { .name = "avr.pseudo", .desc = "AVR pseudo syntax", .parse = parse }; #ifndef CORELIB RLibStruct radare_plugin = { .type = R_LIB_TYPE_PARSE, .data = &r_parse_plugin_avr_pseudo, .version = R2_VERSION }; #endif
#ifndef COMMANDBAR_H #define COMMANDBAR_H #include <QtWidgets> /* This file is part of Dooscape. Dooscape is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Dooscape 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 Dooscape. If not, see <http://www.gnu.org/licenses/>. */ class CommandBar : public QFrame { Q_OBJECT public: explicit CommandBar(QWidget *parent = 0); QLineEdit *textEdit; signals: void searchWeb(); void searchWord(); void goToWeb(); void closeRequested(); protected: void keyPressEvent(QKeyEvent *event); void resizeEvent(QResizeEvent *event); public slots: void setColor(QString color); void enableShadow(bool enable); void setFocus(); void reset(); private slots: void textEdited(QString text); void finishedEditing(); private: QToolButton *btnSearchWeb; QToolButton *btnSearchWord; QToolButton *btnGoToWeb; QToolButton *btnExecCmd; QPushButton *btnClose; QTextEdit *helpMessage; QGraphicsDropShadowEffect *shadow; }; #endif // COMMANDBAR_H
enum MainMenuType {mmt_main,mmt_new,mmt_load,mmt_none}; class MenuArea{ MainMenuType status; MenuList Speaker, Map, VPs, Load; deque<MenuList> PlayerRaces; deque<MenuList> PlayerStatus; deque<InputString> PlayerNames; GameInitSettings InitS; NodePath ReloadButton, BackPic; static void DrawMain(const Event *ev, void *data); static void DrawNewGame(const Event *ev, void *data); static void DrawConnected(const Event *ev, void *data); static void DrawQuickGame(const Event *ev, void *data); static void DrawConToGame(const Event *ev, void *data); static void DrawLoadGame(const Event *ev, void *data); static void DrawExitGame(const Event *ev, void *data); static void ReloadTemplate(const Event *ev, void *data); static void ReloadSave(const Event *ev, void *data); static void StartGameHost(const Event *ev, void *data); static void StartGameClient(const Event *ev, void *data); static void GameSequence(const Event *ev, void *data); static void TryConnection(const Event *ev, void *data); static void LoadGame(const Event *ev, void *data); public: void start(); } _MenuArea;
/* * Codepage functions * * Copyright (c) 2009-2012, Joachim Metz <jbmetz@users.sourceforge.net> * * Refer to AUTHORS for acknowledgements. * * This software is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software. If not, see <http://www.gnu.org/licenses/>. */ #include <common.h> #include <memory.h> #include <types.h> #include <liberror.h> #include <libnotify.h> #include "libfmapi_codepage.h" #if defined( HAVE_DEBUG_OUTPUT ) libfmapi_codepage_t libfmapi_codepages[ ] = { { 874, "windows-874", "Thai" }, { 932, "iso-2022-jp", "Japanese (Shift-JIS)" }, { 936, "gb2312", "Chinese Simplified" }, { 949, "ks_c_5601-1987", "Korean" }, { 950, "big5", "Chinese Traditional" }, { 1200, "unicode", "Unicode" }, { 1250, "windows-1250", "Central European" }, { 1251, "windows-1251", "Cyrillic" }, { 1252, "windows-1252", "Western European" }, { 1253, "windows-1253", "Greek" }, { 1254, "windows-1254", "Turkish" }, { 1255, "windows-1255", "Hebrew" }, { 1256, "windows-1256", "Arabic" }, { 1257, "windows-1257", "Baltic" }, { 1258, "windows-1258", "Vietnamese" }, { 20127, "us-ascii", "7-bit American Standard Code for Information Interchange (ASCII)" }, { 20866, "koi8-r", "Cyrillic" }, { 21866, "koi8-u", "Cyrillic" }, { 28591, "iso-8859-1", "Western European" }, { 28592, "iso-8859-2", "Central European" }, { 28593, "iso-8859-3", "Latin 3 " }, { 28594, "iso-8859-4", "Baltic" }, { 28595, "iso-8859-5", "Cyrillic" }, { 28596, "iso-8859-6", "Arabic" }, { 28597, "iso-8859-7", "Greek" }, { 28598, "iso-8859-8-i", "Hebrew" }, { 28599, "iso-8859-7", "Turkish" }, { 28605, "iso-8859-15", "Latin 9 " }, { 50220, "iso-2022-jp", "Japanese (JIS)" }, { 50221, "csISO2022JP", "Japanese (JIS-Allow 1 byte Kana)" }, { 51932, "euc-jp", "Japanese" }, { 51949, "euc-kr", "Korean" }, { 52936, "hz-gb-2312", "Chinese Simplified" }, { 65000, "utf-7", "7-bit Unicode Transformation Format (UTF-7)" }, { 65001, "utf-8", "8-bit Unicode Transformation Format (UTF-8)" }, { (uint32_t) -1, "_UNKNOWN_", "Unknown" } }; /* Retrieves a string containing the codepage identifier */ const char *libfmapi_codepage_get_identifier( uint32_t codepage ) { int iterator = 0; while( ( libfmapi_codepages[ iterator ] ).codepage != (uint32_t) -1 ) { if( ( libfmapi_codepages[ iterator ] ).codepage == codepage ) { break; } iterator++; } return( ( libfmapi_codepages[ iterator ] ).identifier ); } /* Retrieves a string containing the codepage description */ const char *libfmapi_codepage_get_description( uint32_t codepage ) { int iterator = 0; while( ( libfmapi_codepages[ iterator ] ).codepage != (uint32_t) -1 ) { if( ( libfmapi_codepages[ iterator ] ).codepage == codepage ) { break; } iterator++; } return( ( libfmapi_codepages[ iterator ] ).description ); } #endif
// Created file "Lib\src\ehstorguids\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_GPS_DestDistanceRef, 0xed4df2d3, 0x8695, 0x450b, 0x85, 0x6f, 0xf5, 0xc1, 0xc5, 0x3a, 0xcb, 0x66);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_GETIDENTITYDKIMATTRIBUTESRESPONSE_P_H #define QTAWS_GETIDENTITYDKIMATTRIBUTESRESPONSE_P_H #include "sesresponse_p.h" namespace QtAws { namespace SES { class GetIdentityDkimAttributesResponse; class GetIdentityDkimAttributesResponsePrivate : public SesResponsePrivate { public: explicit GetIdentityDkimAttributesResponsePrivate(GetIdentityDkimAttributesResponse * const q); void parseGetIdentityDkimAttributesResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(GetIdentityDkimAttributesResponse) Q_DISABLE_COPY(GetIdentityDkimAttributesResponsePrivate) }; } // namespace SES } // namespace QtAws #endif
// blowfish.h interface file for blowfish.cpp // _THE BLOWFISH ENCRYPTION ALGORITHM_ // by Bruce Schneier // Revised code--3/20/94 // Converted to C++ class 5/96, Jim Conger #define MAXKEYBYTES 56 // 448 bits max #define NPASS 16 // SBox passes #define DWORD unsigned long #define WORD unsigned short #define BYTE unsigned char class CBlowFish { private: DWORD * PArray ; DWORD (* SBoxes)[256]; void Blowfish_encipher (DWORD *xl, DWORD *xr) ; void Blowfish_decipher (DWORD *xl, DWORD *xr) ; public: CBlowFish () ; ~CBlowFish () ; void Initialize (BYTE key[], int keybytes) ; DWORD GetOutputLength (DWORD lInputLong) ; DWORD Encode (BYTE * pInput, BYTE * pOutput, DWORD lSize) ; void Decode (BYTE * pInput, BYTE * pOutput, DWORD lSize) ; } ; // choose a byte order for your hardware #define ORDER_DCBA // chosing Intel in this case #ifdef ORDER_DCBA // DCBA - little endian - intel union aword { DWORD dword; BYTE byte [4]; struct { unsigned int byte3:8; unsigned int byte2:8; unsigned int byte1:8; unsigned int byte0:8; } w; }; #endif #ifdef ORDER_ABCD // ABCD - big endian - motorola union aword { DWORD dword; BYTE byte [4]; struct { unsigned int byte0:8; unsigned int byte1:8; unsigned int byte2:8; unsigned int byte3:8; } w; }; #endif #ifdef ORDER_BADC // BADC - vax union aword { DWORD dword; BYTE byte [4]; struct { unsigned int byte1:8; unsigned int byte0:8; unsigned int byte3:8; unsigned int byte2:8; } w; }; #endif
/* * Copyright (C) International Business Machines Corp., 2010 * Author(s): Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> * * 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 */ #define _GNU_SOURCE #include <sys/ioctl.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include "handle.h" #define AT_FDCWD -100 #define OPENHANDLE_DRIVER_MAGIC 'O' #define OPENHANDLE_OPEN_BY_HANDLE _IOWR(OPENHANDLE_DRIVER_MAGIC, 1, struct open_arg) #define OPENHANDLE_LINK_BY_FD _IOWR(OPENHANDLE_DRIVER_MAGIC, 2, struct link_arg) #define OPENHANDLE_READLINK_BY_FD _IOWR(OPENHANDLE_DRIVER_MAGIC, 3, struct readlink_arg) main(int argc, char *argv[]) { int handle_fd; char buf[100]; int fd, rc, file_fd; struct open_arg oarg; struct file_handle *handle; if(argc != 4) { fprintf(stderr, "Usage: %s, <device> <mountdir> <handle-file>\n", argv[0]); exit(1); } fd = open(argv[1], O_RDONLY); if(fd < 0) perror("open"), exit(1); handle = malloc(sizeof(struct file_handle) + 20); /* read the handle to a handle.data file */ handle_fd = open(argv[3], O_RDONLY); read(handle_fd, handle, sizeof(struct file_handle) + 20); printf("Handle size is %d\n", handle->handle_size); oarg.mountdirfd = open(argv[2], O_RDONLY | O_DIRECTORY); if(oarg.mountdirfd < 0) perror("open"), exit(2); oarg.handle = handle; oarg.flags = O_RDONLY; file_fd = ioctl(fd, OPENHANDLE_OPEN_BY_HANDLE, &oarg); if(file_fd < 0) perror("ioctl"), exit(2); memset(buf, 0, 100); while(1) { rc = read(file_fd, buf, 99); if(rc <= 0) break; buf[rc] = '\0'; printf("%s", buf); memset(buf, 0, 100); } close(file_fd); close(fd); }
/* The zlib/libpng License Copyright (c) 2018 Arthur Brainville Copyright (c) 2015 Andrew Fenn Copyright (c) 2005-2010 Phillip Castaneda (pjcast -- www.wreckedgames.com) This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef OIS_SDLPrereqs_H #define OIS_SDLPrereqs_H #include "OISPrereqs.h" #ifdef OIS_APPLE_PLATFORM #include <SDL/SDL.h> #else #include <SDL.h> #endif #define OIS_SDL_KEY_BUFF 16 #define OIS_SDL_MOUSE_BUFF 50 #define OIS_SDL_JOY_BUFF 80 #endif
/*----------------------------------------------------------------------------- Name mainwindow.h Purpose Handles the majority of user input; History 11 Jun 16 AFB Created -----------------------------------------------------------------------------*/ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> // ISA QMainWindow #include <QValidator> // USES QValidators to validate user inputs; #include <QMessageBox> // USES QMessageBox to alert users of program events; #include "gotcalc.h" // HASA GotCalc member for calulating G Over T; #include "solarcalc.h" // HASA SolarCalc member for calculating Solar position; #include "howto.h" // HASA HowTo to display the 'How To' Dialog; #include "optionmenu.h" // HASA OptionMenu for providing user options; #include "about.h" // HASA About page; #include "logfile.h" // HASA LogFile for logging calculations; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); // Constructor; ~MainWindow(); // Destructor; private slots: void calculateSolarAzAlt(); // Calculates the Solar Azimuth and Altitude; void calculateGot(); // Calculates Gain Over Temperature; void setFrequencies(); // Used for interpolating data points; void save(); // Saves Log Files; void howTo(); // Opens a How To window; void options(); // Opens an Options Menu Window; void about(); private: Ui::MainWindow *ui; // UI object; GotCalc* mGotCalc; // Used for Calculating Gain Over Temperature; SolarCalc* mSolarCalc; // Used for Calculating Solar Position; HowTo* mHowTo; // 'How To' Dialog; OptionMenu* mOptions; // Options Menu Dialog; About* mAbout; // About page Dialog; LogFile* mLogFile; // Used for Logging; QDoubleValidator mLatValid; // Validates the Latitude input; QDoubleValidator mLonValid; // Validates the Longitude input; QDoubleValidator mBeamwidthValid; // Validates the Beamwidth input; QDoubleValidator mMeasurementValid; // Validates hot and cold measurments; QDoubleValidator mFluxValid; // Validates Solar Flux input; QString mDefaultSaveLoc; // Holds the default save location; double mUpperFreq; // Upper frequency used for data interpolation; double mLowerFreq; // Lower frequency used for data interpolation; bool checkGotFields(void); // Ensures completion of G Over T fields; void loadSettings(void); // Loads settings; }; #endif // MAINWINDOW_H
// Created file "Lib\src\ehstorguids\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_Contact_BusinessAddressStreet, 0xddd1460f, 0xc0bf, 0x4553, 0x8c, 0xe4, 0x10, 0x43, 0x3c, 0x90, 0x8f, 0xb0);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_REGISTERCLIENTREQUEST_H #define QTAWS_REGISTERCLIENTREQUEST_H #include "ssooidcrequest.h" namespace QtAws { namespace SSOOIDC { class RegisterClientRequestPrivate; class QTAWSSSOOIDC_EXPORT RegisterClientRequest : public SsooidcRequest { public: RegisterClientRequest(const RegisterClientRequest &other); RegisterClientRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(RegisterClientRequest) }; } // namespace SSOOIDC } // namespace QtAws #endif
/* This source file is part of KBEngine For the latest info, see http://www.kbengine.org/ Copyright (c) 2008-2016 KBEngine. KBEngine is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. KBEngine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with KBEngine. If not, see <http://www.gnu.org/licenses/>. */ #ifndef KBENGINE_CLIENTS_REMOTE_ENTITY_METHOD_H #define KBENGINE_CLIENTS_REMOTE_ENTITY_METHOD_H #include "common/common.h" #if KBE_PLATFORM == PLATFORM_WIN32 #pragma warning (disable : 4910) #pragma warning (disable : 4251) #endif // common include #include "entitydef/datatype.h" #include "entitydef/datatypes.h" #include "helper/debug_helper.h" #include "pyscript/scriptobject.h" //#define NDEBUG // windows include #if KBE_PLATFORM == PLATFORM_WIN32 #else // linux include #endif namespace KBEngine{ class ClientsRemoteEntityMethod : public script::ScriptObject { /** 子类化 将一些py操作填充进派生类 */ INSTANCE_SCRIPT_HREADER(ClientsRemoteEntityMethod, script::ScriptObject) public: ClientsRemoteEntityMethod(MethodDescription* methodDescription, bool otherClients, ENTITY_ID id); virtual ~ClientsRemoteEntityMethod(); const char* getName(void) const { return methodDescription_->getName(); }; MethodDescription* getDescription(void) const { return methodDescription_; } static PyObject* tp_call(PyObject* self, PyObject* args, PyObject* kwds); PyObject* callmethod(PyObject* args, PyObject* kwds); protected: MethodDescription* methodDescription_; // 这个方法的描述 bool otherClients_; // 是否只是其他客户端, 不包括自己 ENTITY_ID id_; // entityID }; } #endif // KBENGINE_CLIENTS_REMOTE_ENTITY_METHOD_H
// Created file "Lib\src\Uuid\shguids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IShellLinkDual, 0x88a05c00, 0xf000, 0x11ce, 0x83, 0x50, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_TAGRESOURCERESPONSE_H #define QTAWS_TAGRESOURCERESPONSE_H #include "lookoutforvisionresponse.h" #include "tagresourcerequest.h" namespace QtAws { namespace LookoutforVision { class TagResourceResponsePrivate; class QTAWSLOOKOUTFORVISION_EXPORT TagResourceResponse : public LookoutforVisionResponse { Q_OBJECT public: TagResourceResponse(const TagResourceRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const TagResourceRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(TagResourceResponse) Q_DISABLE_COPY(TagResourceResponse) }; } // namespace LookoutforVision } // namespace QtAws #endif
#include "pca9557.h" #include "drv8832.h" #ifndef SETTINGS_H_ #define SETTINGS_H_ enum i2c_location { //coil register addressing 1 I2C_STATUSOFSPECTROMETER, I2C_STATUSOFTHERMOCONTROLLERS, I2C_AVAILABILITYOFEXTERNALREQUEST, I2C_STATUSOFZEROTEST, I2C_STATUSOFCALIBRATION, //holding register addressing I2C_ELEMENTALMERCURYROW, I2C_TOTALMERCURYROW, I2C_OXIDIZEDMERCURYROW, I2C_MONITORFLOW, I2C_VACUUM, I2C_DILUTIONPRESSURE, I2C_BYPASSPRESSURE, I2C_TEMPERATUREOFSPECTROMETER, I2C_CODEOFACURRENTMODE, I2C_ERRORSANDWARNINGS, I2C_TOTALMERCURYCOEFFICENT, //coil register addressing 2 I2C_REQUESTTOSTARTCALIBRATION, I2C_REQUESTTOSTARTZEROTEST, I2C_REQUESTTOSTARTMEASURMENTOFELEMENTALMERCURY, I2C_REQUESTTOSTARTPURGE, I2C_REQUESTTOENDPURGE, //settings I2C_IPADDRESS, I2C_MACADDRESS, I2C_LENGTHTABLE, I2C_JUMPTABLE, I2C_AD7705_SETUP_REGISTER, I2C_AD7705_CLOCK_REGISTER, }; enum modelist { STARTLEVEL = 5, CELLDELAY = 7, CELLLEVEL = 8, ZERODELAY = 11, ZEROTEST = 12, PURGE = 13, TOTALMERCURYDELAY = 21, TOTALMERCURY = 22, ELEMENTALMERCURYDELAY = 26, ELEMENTALMERCURY = 27, PRECALIBRATIONDELAY = 31, CALIBRATION = 32, POSTCALIBRATIONDELAY = 33 }; struct lengthtablestruct { int startlevel; int celldelay; int celllevel; int zerodelay; int zerotest; int purge; int totalmercurydelay; int totalmercury; int elementalmercurydelay; int elementalmercury; int precalibrationdelay; int calibration; int postcalibrationdelay; }; struct jumptablestruct { enum modelist startlevel; enum modelist celldelay; enum modelist celllevel; enum modelist zerodelay; enum modelist zerotest; enum modelist purge; enum modelist totalmercurydelay; enum modelist totalmercury; enum modelist elementalmercurydelay; enum modelist elementalmercury; enum modelist precalibrationdelay; enum modelist calibration; enum modelist postcalibrationdelay; }; struct mysettingsstruct { uint8_t ip[4]; uint8_t mac[6]; struct lengthtablestruct length_table; struct jumptablestruct jump_table; uint8_t ad7705_setup_register; uint8_t ad7705_clock_register; uint8_t ad7705_zero_scale[3]; uint8_t ad7705_full_scale[3]; float standard_concentration; float c_twentie_five; float kfactor; struct pca9557_pin x20_relay; struct pca9557_pin x19_relay; struct pca9557_pin x22; struct pca9557_pin vt4; struct pca9557_pin elemental; struct pca9557_pin calibration; struct pca9557_pin zero; struct pca9557_pin ignition; struct drv8832 cell; }; struct mydatastate { int timetoexitmode; enum modelist currentmode; int coefficent; int zerolevelavg; int celllevelavg; int celltempavg; struct mysettingsstruct settings; }; #endif /* SETTINGS_H_ */
# 1 "castExpr.c" int func(void) { int n = 3; short m = 5; n = ((int) m); return 0; }
/* * Date and time functions * * Copyright (c) 2008-2014, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * This software is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software. If not, see <http://www.gnu.org/licenses/>. */ #if !defined( _PYEWF_DATETIME_H ) #define _PYEWF_DATETIME_H #include <common.h> #include <types.h> #include "pyewf_python.h" #if defined( __cplusplus ) extern "C" { #endif PyObject *pyewf_datetime_new_from_fat_date_time( uint32_t fat_date_time ); PyObject *pyewf_datetime_new_from_filetime( uint64_t filetime ); PyObject *pyewf_datetime_new_from_posix_time( uint32_t posix_time ); #if defined( __cplusplus ) } #endif #endif
#ifndef FLOW_DATA_H #define FLOW_DATA_H struct flow_data_common { uint8_t rec_type:2, // 0 - proto name, // 1 - start, 2 - flow, 3 - lost traffic family:1, // 0 - ipv4, 1 - ipv6 nat_flags:3,// 1 - snat, 2 - dnat, 4 - userid extflag:2, // 0 - old, 1 - new, 2,3 - reserved proto, // transport protocol opt_len, // option length (0 - none) host_len; // host name length (0 - none) // cert_len + host_len < 510; // 4 bytes uint32_t time_start; // 4 bytes /* 0 - in, 1 - out */ uint32_t p[2]; // 8 bytes uint64_t b[2]; // 16 bytes uint32_t time_end; // 4 bytes uint16_t ifidx,ofidx; // 4 bytes uint16_t proto_master,proto_app; // 4 bytes uint32_t connmark; // 4 bytes } __attribute ((packed)); // 48 bytes struct flow_data_v4 { uint32_t ip_s,ip_d; // 8 bytes uint32_t ip_snat,ip_dnat; // 8 bytes uint16_t sport,dport,sport_nat,dport_nat; // 8 bytes } __attribute ((packed)); // 24 bytes struct flow_data_v6 { uint8_t ip_s[16],ip_d[16]; // 32 bytes uint16_t sport,dport; // 4 bytes } __attribute ((packed)); // 36 bytes struct flow_data { struct flow_data_common c; union { struct flow_data_v4 v4; struct flow_data_v6 v6; } d; } __attribute ((packed)); #define flow_data_v4_size (sizeof(struct flow_data_common) + sizeof(struct flow_data_v4)) #define flow_data_v6_size (sizeof(struct flow_data_common) + sizeof(struct flow_data_v6)) /* * start record: 8 bytes (rec_type+family,cert_len,host_len,nat_flags,time_start) * * ipv4 info: >= 72 bytes * flow_data_common + flow_data_v4 + cert_name_len + host_name_len * * ipv6 info: >= 84 bytes * flow_data_common + flow_data_v6 + cert_name_len + host_name_len * * lost trafic record: 48 bytes * * name of protocols records: 4 bytes + proto_name_len * byte 0: 0, * byte 1: proto_id & 0xff, * byte 2: proto_id >> 8, * byte 3: proto_name_len * */ #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTTAGSFORRESOURCEREQUEST_P_H #define QTAWS_LISTTAGSFORRESOURCEREQUEST_P_H #include "shieldrequest_p.h" #include "listtagsforresourcerequest.h" namespace QtAws { namespace Shield { class ListTagsForResourceRequest; class ListTagsForResourceRequestPrivate : public ShieldRequestPrivate { public: ListTagsForResourceRequestPrivate(const ShieldRequest::Action action, ListTagsForResourceRequest * const q); ListTagsForResourceRequestPrivate(const ListTagsForResourceRequestPrivate &other, ListTagsForResourceRequest * const q); private: Q_DECLARE_PUBLIC(ListTagsForResourceRequest) }; } // namespace Shield } // namespace QtAws #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEDEPLOYMENTSRESPONSE_H #define QTAWS_DESCRIBEDEPLOYMENTSRESPONSE_H #include "opsworksresponse.h" #include "describedeploymentsrequest.h" namespace QtAws { namespace OpsWorks { class DescribeDeploymentsResponsePrivate; class QTAWSOPSWORKS_EXPORT DescribeDeploymentsResponse : public OpsWorksResponse { Q_OBJECT public: DescribeDeploymentsResponse(const DescribeDeploymentsRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const DescribeDeploymentsRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DescribeDeploymentsResponse) Q_DISABLE_COPY(DescribeDeploymentsResponse) }; } // namespace OpsWorks } // namespace QtAws #endif
// cilkarts cilk++ #if defined(CILK) #include <cilk.h> #define parallel_main cilk_main #define parallel_for cilk_for #define parallel_for_1 _Pragma("cilk_grainsize = 1") cilk_for #define parallel_for_256 _Pragma("cilk_grainsize = 256") cilk_for // intel cilk+ #elif defined(CILKP) #include "/home/dolem/cilkplus-install/include/cilk/cilk.h" #define parallel_for cilk_for #define parallel_main main #define parallel_for_1 _Pragma("cilk grainsize = 1") cilk_for #define parallel_for_256 _Pragma("cilk grainsize = 256") cilk_for // openmp #elif defined(OPENMP) #include <omp.h> #define cilk_spawn #define cilk_sync #define parallel_main main #define parallel_for _Pragma("omp parallel for") for #define parallel_for_1 _Pragma("omp parallel for schedule (static,1)") for #define parallel_for_256 _Pragma("omp parallel for schedule (static,256)") for // c++ #else #define cilk_spawn #define cilk_sync #define parallel_main main #define parallel_for for #define parallel_for_1 for #define parallel_for_256 for #define cilk_for for #endif #include <limits.h> #if defined(LONG) typedef long intT; typedef unsigned long uintT; #define INT_T_MAX LONG_MAX #else typedef int intT; typedef unsigned int uintT; #define INT_T_MAX INT_MAX #endif
#ifndef __BUFFER_H__ #define __BUFFER_H__ #include "noncopyable.h" #include "common.h" #include <string> #include <cstdio> #include <cstring> namespace light { template <int N> class BasicBuffer : noncopyable { public: BasicBuffer() : size_(N), cur_(0) { ::memset(arr_, 0, N);} ~BasicBuffer() = default; size_t size() const { return size_; } size_t currentSize() const { return cur_; } size_t availSize() const { return size_ - cur_; } const char* data() const { return arr_; } char* data() { return arr_; } void append(std::string& str); void append(const char* str); void append(const char* str, size_t len); void append(float v); void append(double v); template <typename T> void append(T v); void reset(); private: char arr_[N]; size_t size_; size_t cur_; }; template <int N> void BasicBuffer<N>::append(std::string& str) { ::memcpy(&arr_[cur_], str.c_str(), str.size()); cur_ += str.size(); } template <int N> void BasicBuffer<N>::append(const char* str) { append(str, strlen(str)); } template <int N> void BasicBuffer<N>::append(const char* str, size_t len) { ::memcpy(&arr_[cur_], str, len); cur_ += len; } template <int N> template <typename T> void BasicBuffer<N>::append(T v) { //max uint64_t ==> 1844674407370955161 char buf[32]; size_t len = int2str(buf, v); append(buf, len); } template <int N> void BasicBuffer<N>::append(float v) { append(static_cast<double>(v)); } template <int N> void BasicBuffer<N>::append(double v) { char buf[32]; int len = ::sprintf(buf, "%.12g", v); append(buf, len); } template <int N> void BasicBuffer<N>::reset() { cur_ = 0; } } #endif
// -*- mode: C++; c-file-style: "cc-mode" -*- //************************************************************************* // DESCRIPTION: Verilator: Inlining of modules // // Code available from: http://www.veripool.org/verilator // //************************************************************************* // // Copyright 2003-2019 by Wilson Snyder. This program is free software; you can // redistribute it and/or modify it under the terms of either the GNU // Lesser General Public License Version 3 or the Perl Artistic License // Version 2.0. // // Verilator 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 _V3TASK_H_ #define _V3TASK_H_ 1 #include "config_build.h" #include "verilatedos.h" #include "V3Error.h" #include "V3Ast.h" #include <vector> //============================================================================ typedef std::pair<AstVar*,AstArg*> V3TaskConnect; // [port, pin-connects-to] typedef std::vector<V3TaskConnect> V3TaskConnects; // [ [port, pin-connects-to] ... ] //============================================================================ class V3Task { public: static void taskAll(AstNetlist* nodep); /// Return vector of [port, pin-connects-to] (SLOW) static V3TaskConnects taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp); static string assignInternalToDpi(AstVar* portp, bool isRtn, bool isPtr, const string& frSuffix, const string& toSuffix, const string& frPrefix=""); static bool dpiToInternalFrStmt(AstVar* portp, const string& frName, bool cvt, string& frstmt); }; #endif // Guard
// Copyright (C) 2010 by Claire Dune, Thomas Moulard, CNRS. // // This file is part of the LLVC. // // This software is provided "as is" without warranty of any kind, // either expressed or implied, including but not limited to the // implied warranties of fitness for a particular purpose. // // See the COPYING file for more information. #ifndef ACTION_GRAB_CLIENT_H_ # define ACTION_GRAB_CLIENT_H_ # include <iosfwd> # include <string> # include <vector> # include <visp/vpHomogeneousMatrix.h> # include <visp/vpImage.h> # include <visp/vpCameraParameters.h> # include <LowLevelVisionSystem.hh> # include <llvs/tools/CORBAClient.h> # include <llvs/tools/ActionWithLLVSBase.h> namespace trackingClient { // FIXME: move this elsewhere. /// \brief Convert Corba image to ViSP image. /// /// Throw if the image sizes does not match. /// /// \param imageCorbaSrc Corba source image /// \param imageVispDest ViSP destination image void convertCorbaImageToVispImage(const ImageData_var& imageCorbaSrc, vpImage<unsigned char>& imageVispDest); void convertCorbaImageToVispImage(const ImageData& imageCorbaSrc, vpImage<unsigned char>& imageVispDest); /// \brief Grab an image from LLVS and expose it publicly. /// /// This class holds the responsibility of starting /// processes required to grab an image. /// /// Please note that this class will automatically /// stop the processes when destructed. By consequence, /// do not create more than one instance of this class /// to avoid premature stopping of the grabbing vision /// processes on server-side. class ActionGrab : public LLVClient::ActionWithLLVSBase { public: /// Alias to ViSP image type. typedef vpImage<unsigned char> image_t; explicit ActionGrab(bool rectification, bool triggerMode ); virtual ~ActionGrab(); virtual std::ostream& print (std::ostream& stream) const; virtual bool Initialize(); virtual bool ExecuteAction(); virtual void CleanUp(); void setTriggerMode(bool atriggerMode); const vpCameraParameters& camera() const { return m_cam; } const image_t& image() const { return m_image; } private: /// Enable trigger mode for grabbing. bool m_triggerMode; /// Pointer to the server LLVS. LowLevelVisionSystem_var m_LLVS; /// Grabbed image. image_t m_image; /// Semantic camera id. long m_cameraID; /// Image format. std::string m_format; //FIXME: for now this is not synchronized with server-side. /// Visp camera parameters vpCameraParameters m_cam; }; std::ostream& operator <<(std::ostream& stream, const ActionGrab& actionTrackingClient); } #endif
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBESIMULATIONAPPLICATIONREQUEST_H #define QTAWS_DESCRIBESIMULATIONAPPLICATIONREQUEST_H #include "robomakerrequest.h" namespace QtAws { namespace RoboMaker { class DescribeSimulationApplicationRequestPrivate; class QTAWSROBOMAKER_EXPORT DescribeSimulationApplicationRequest : public RoboMakerRequest { public: DescribeSimulationApplicationRequest(const DescribeSimulationApplicationRequest &other); DescribeSimulationApplicationRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DescribeSimulationApplicationRequest) }; } // namespace RoboMaker } // namespace QtAws #endif
/* * URL values functions * * Copyright (C) 2009-2021, Joachim Metz <joachim.metz@gmail.com> * * Refer to AUTHORS for acknowledgements. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #if !defined( _LIBMSIECF_URL_VALUES_H ) #define _LIBMSIECF_URL_VALUES_H #include <common.h> #include <types.h> #include "libmsiecf_io_handle.h" #include "libmsiecf_libbfio.h" #include "libmsiecf_libcerror.h" #include "libmsiecf_libfvalue.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libmsiecf_url_values libmsiecf_url_values_t; struct libmsiecf_url_values { /* The (URL record) type */ uint8_t type; /* The primary date and time * Contains a 64-bit version of a filetime */ uint64_t primary_time; /* The secondary date and time * Contains a 64-bit version of a filetime */ uint64_t secondary_time; /* The expiration date and time * Contains a 32-bit version of a filetime in format version 4.7 * Contains a 32-bit version of a FAT date time in format version 5.2 */ uint64_t expiration_time; /* The last checked date and time * Contains a 32-bit version of a FAT date time */ uint32_t last_checked_time; /* The cached file size */ uint32_t cached_file_size; /* The number of hits */ uint32_t number_of_hits; /* The cache directory index */ uint8_t cache_directory_index; /* The location string value */ libfvalue_value_t *location; /* The filename string value */ libfvalue_value_t *filename; /* The data */ uint8_t *data; /* The data size */ size_t data_size; }; int libmsiecf_url_values_initialize( libmsiecf_url_values_t **url_values, libcerror_error_t **error ); int libmsiecf_url_values_free( libmsiecf_url_values_t **url_values, libcerror_error_t **error ); int libmsiecf_url_values_read_data( libmsiecf_url_values_t *url_values, libmsiecf_io_handle_t *io_handle, const uint8_t *data, size_t data_size, uint8_t item_flags, libcerror_error_t **error ); int libmsiecf_url_values_read_file_io_handle( libmsiecf_url_values_t *url_values, libmsiecf_io_handle_t *io_handle, libbfio_handle_t *file_io_handle, off64_t url_record_offset, size32_t record_size, uint8_t item_flags, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif /* !defined( _LIBMSIECF_URL_VALUES_H ) */
#ifndef TRENDERBOX_H #define TRENDERBOX_H #include "ControlHeaders.h" class TRenderBox:public QWidget { public: TRenderBox(TRenderBox * parent); ~TRenderBox(); void ClearRenderBox(); void StartRender(); void StopRender(); void RestartRender(); bool IsRender(); void actionEvent(QActionEvent * event); void changeEvent(QEvent * event); void closeEvent(QCloseEvent * event); void contextMenuEvent(QContextMenuEvent * event); void dragEnterEvent(QDragEnterEvent * event); void dragLeaveEvent(QDragLeaveEvent * event); void dragMoveEvent(QDragMoveEvent * event); void dropEvent(QDropEvent * event); void enterEvent(QEvent * event); void focusInEvent(QFocusEvent * event); void focusOutEvent(QFocusEvent * event); void hideEvent(QHideEvent * event); void inputMethodEvent(QInputMethodEvent * event); void keyPressEvent(QKeyEvent * event); void keyReleaseEvent(QKeyEvent * event); void leaveEvent(QEvent * event); void mouseDoubleClickEvent(QMouseEvent * event); void mouseMoveEvent(QMouseEvent * event); void mousePressEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent * event); void moveEvent(QMoveEvent * event); bool nativeEvent(const QByteArray & eventType, void * message, long * result); void paintEvent(QPaintEvent * event); void resizeEvent(QResizeEvent * event); void showEvent(QShowEvent * event); void tabletEvent(QTabletEvent * event); void wheelEvent(QWheelEvent * event); void repaint(int x, int y, int w, int h); void repaint(const QRect &); void repaint(const QRegion &); private: QCursor *Cursor; bool RenderFlag; }; #endif
// // File: %d-dump.c // Summary: "various debug output functions" // Section: debug // Project: "Rebol 3 Interpreter and Run-time (Ren-C branch)" // Homepage: https://github.com/metaeducation/ren-c/ // //=////////////////////////////////////////////////////////////////////////=// // // Copyright 2012 REBOL Technologies // Copyright 2012-2017 Ren-C Open Source Contributors // REBOL is a trademark of REBOL Technologies // // See README.md and CREDITS.md for more information. // // Licensed under the Lesser GPL, Version 3.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.gnu.org/licenses/lgpl-3.0.html // //=////////////////////////////////////////////////////////////////////////=// // // Most of these low-level debug routines were leftovers from R3-Alpha, which // had no DEBUG build (and was perhaps frequently debugged without an IDE // debugger). After the open source release, Ren-C's reliance is on a // more heavily checked debug build...so these routines were not used. // // They're being brought up to date to be included in the debug build only // version of panic(). That should keep them in working shape. // // Note: These routines use `printf()`, which is only linked in DEBUG builds. // Higher-level Rebol formatting should ultimately be using BLOCK! dialects, // as opposed to strings with %s and %d. Bear in mind the "z" modifier in // printf is unavailable in C89, so if something might be 32-bit or 64-bit // depending, it must be cast to unsigned long: // // http://stackoverflow.com/q/2125845 // #include "sys-core.h" #if DEBUG_FANCY_PANIC // !!! separate switch, DEBUG_HAS_DUMP? #ifdef _MSC_VER #define snprintf _snprintf #endif // // Dump_Series: C // void Dump_Series(REBSER *s, const char *memo) { printf("Dump_Series(%s) @ %p\n", memo, cast(void*, s)); fflush(stdout); if (s == NULL) return; printf(" wide: %d\n", cast(int, SER_WIDE(s))); printf(" size: %ld\n", cast(unsigned long, SER_TOTAL_IF_DYNAMIC(s))); if (GET_SERIES_FLAG(s, DYNAMIC)) printf(" bias: %d\n", cast(int, SER_BIAS(s))); printf(" used: %d\n", cast(int, SER_USED(s))); printf(" rest: %d\n", cast(int, SER_REST(s))); // flags includes len if non-dynamic printf(" flags: %lx\n", cast(unsigned long, s->leader.bits)); // info includes width printf(" info: %lx\n", cast(unsigned long, SER_INFO(s))); fflush(stdout); } // // Dump_Info: C // void Dump_Info(void) { printf("^/--REBOL Kernel Dump--\n"); printf("Evaluator:\n"); printf(" Cycles: %ld\n", cast(unsigned long, Total_Eval_Cycles)); printf(" Counter: %d\n", cast(int, Eval_Countdown)); printf(" Dose: %d\n", cast(int, Eval_Dose)); printf(" Signals: %lx\n", cast(unsigned long, Eval_Signals)); printf(" Sigmask: %lx\n", cast(unsigned long, Eval_Sigmask)); printf(" DSP: %ld\n", cast(unsigned long, DSP)); printf("Memory/GC:\n"); printf(" Ballast: %d\n", cast(int, GC_Ballast)); printf(" Disable: %s\n", GC_Disabled ? "yes" : "no"); printf(" Guarded Nodes: %d\n", cast(int, SER_USED(GC_Guarded))); fflush(stdout); } // // Dump_Stack: C // // Simple debug routine to list the function names on the stack and what the // current feed value is. // void Dump_Stack(REBFRM *f) { if (f == FS_BOTTOM) { printf("<FS_BOTTOM>\n"); fflush(stdout); return; } const char *label; if (not Is_Action_Frame(f)) label = "<eval>"; else if (not f->label) label = "<anonymous>"; else label = STR_UTF8(unwrap(f->label)); printf("LABEL: %s @ FILE: %s @ LINE: %d\n", label, FRM_FILE_UTF8(f), FRM_LINE(f) ); Dump_Stack(f->prior); } #endif // DUMP is picked up by scan regardless of #ifdef, must be defined // // dump: native [ // // "Temporary debug dump" // // return: <void> // :value [word!] // ] // REBNATIVE(dump) { INCLUDE_PARAMS_OF_DUMP; #ifdef NDEBUG UNUSED(ARG(value)); fail (Error_Debug_Only_Raw()); #else REBVAL *v = ARG(value); PROBE(v); printf("=> "); if (IS_WORD(v)) { const REBVAL* var = try_unwrap(Lookup_Word(v, SPECIFIED)); if (not var) { PROBE("\\unbound\\"); } else if (IS_NULLED(var)) { PROBE("\\null\\"); } else PROBE(var); } RETURN_INVISIBLE; #endif }
/* * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a * aplicativos mainframe. Registro no INPI sob o nome G3270. * * Copyright (C) <2008> <Banco do Brasil S.A.> * * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela * Free Software Foundation. * * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para * obter mais detalhes. * * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin * St, Fifth Floor, Boston, MA 02110-1301 USA * * Este programa está nomeado como common.h e possui - linhas de código. * * Contatos: * * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * */ #ifndef COMMON_H_INCLUDED #define COMMON_H_INCLUDED 1 // "PW" Standards #include <gtk/gtk.h> #include <errno.h> #include <lib3270/config.h> #ifdef WIN32 #include <windows.h> #ifndef KEY_WOW64_64KEY #define KEY_WOW64_64KEY 0x0100 #endif // KEY_WOW64_64KEY #ifndef KEY_WOW64_32KEY #define KEY_WOW64_32KEY 0x0200 #endif // KEY_WOW64_64KEY #endif // WIN32 #define ENABLE_NLS #ifndef GETTEXT_PACKAGE #define GETTEXT_PACKAGE PACKAGE_NAME #endif #include <libintl.h> #include <glib/gi18n.h> #include <gtk/gtk.h> #if defined( DEBUG ) #define trace(x, ...) fprintf(stderr,"%s(%d):\t" x "\n",__FILE__,__LINE__, __VA_ARGS__); fflush(stderr); #else #define trace(x, ...) /* */ #endif // Configuration void configuration_init(void); void configuration_deinit(void); gchar * get_string_from_config(const gchar *group, const gchar *key, const gchar *def); gboolean get_boolean_from_config(const gchar *group, const gchar *key, gboolean def); gint get_integer_from_config(const gchar *group, const gchar *key, gint def); void set_string_to_config(const gchar *group, const gchar *key, const gchar *fmt, ...); void set_boolean_to_config(const gchar *group, const gchar *key, gboolean val); void set_integer_to_config(const gchar *group, const gchar *key, gint val); gchar * build_data_filename(const gchar *first_element, ...); gchar * filename_from_va(const gchar *first_element, va_list args); void save_window_state_to_config(const gchar *group, const gchar *key, GdkWindowState CurrentState); void save_window_size_to_config(const gchar *group, const gchar *key, GtkWidget *hwnd); void restore_window_from_config(const gchar *group, const gchar *key, GtkWidget *hwnd); #ifdef HAVE_WIN_REGISTRY gboolean get_registry_handle(const gchar *group, HKEY *hKey, REGSAM samDesired); void registry_foreach(HKEY parent, const gchar *name,void (*cbk)(const gchar *key, const gchar *val, gpointer *user_data), gpointer *user_data); void registry_set_double(HKEY hKey, const gchar *key, gdouble value); gboolean registry_get_double(HKEY hKey, const gchar *key, gdouble *value); #else GKeyFile * get_application_keyfile(void); #endif // HAVE_WIN_REGISTRY #endif
/* * TokenNode.h * * Created on: Apr 16, 2014 * Author: 3philic */ #ifndef TokenNODE_H_ #define TokenNODE_H_ #include "../../Token.h" class TokenNode { public: Token* data; TokenNode* next; TokenNode* previous; TokenNode(Token* data, TokenNode* next, TokenNode* previous); virtual ~TokenNode(); }; #endif /* TokenNODE_H_ */
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_UPDATEFUNCTIONREQUEST_H #define QTAWS_UPDATEFUNCTIONREQUEST_H #include "appsyncrequest.h" namespace QtAws { namespace AppSync { class UpdateFunctionRequestPrivate; class QTAWSAPPSYNC_EXPORT UpdateFunctionRequest : public AppSyncRequest { public: UpdateFunctionRequest(const UpdateFunctionRequest &other); UpdateFunctionRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(UpdateFunctionRequest) }; } // namespace AppSync } // namespace QtAws #endif
/* * strManager - High Speed Packet Reflector * Copyright (C) 2007-2009 Fundació i2CAT, Internet i Innovació digital a Catalunya * * This file is part of strManager. * * strManager is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * strManager is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Authors: Javier López Rubio <javi.lopez@i2cat.net> * Guillem Cabrera Añon <guillem.cabrera@i2cat.net> * Xavier Calvo Brugal <xavier.calvo-brugal@upc.edu> * Julio Carlos Barrera Juez <julio.carlos.barrera@i2cat.net> */ #ifndef MESSAGE_H_ #define MESSAGE_H_ #include <string> /** * Object to communicate any Worker with his Manager */ class Message { public: int type; /** an integer attribute, to identify the message.*/ int from; /** an integer attribute, to identify the message origin.*/ char body[255]; /** char array to insert a body to the message.*/ /** * Constructor of the Message object. */ Message(); /** * Constructor of the Manager object. * @param type * integer argument with the message type. * @param from * integer argument with the origin identifier. * @param body * string with the body of the message. */ Message(int type, int from, std::string body); /** * Auxiliary method to print the object. */ void print(); /** * Destructor of the Message object */ virtual ~Message(); }; #endif /* MESSAGE_H_ */
/* * This file is part of CcOS. * * CcOS is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * CcOS 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 CcOS. If not, see <http://www.gnu.org/licenses/>. **/ /** * @page Types * @subpage CcUserList * * @page CcUserList * @copyright Andreas Dirmeier (C) 2017 * @author Andreas Dirmeier * @par Web: http://coolcow.de/projects/CcOS * @par Language: C++11 * @brief Class CcUserList */ #ifndef H_CCUSERLIST_H_ #define H_CCUSERLIST_H_ #include "CcBase.h" #include "CcBase.h" #include "CcUser.h" #include "CcList.h" #include "CcReferenceCount.h" #ifdef _MSC_VER template class CcKernelSHARED CcList<CcUser>; #endif /** * @brief Example Class implementation */ class CcKernelSHARED CcUserList : public CcList<CcUser*> { public: /** * @brief Constructor */ CcUserList(); ~CcUserList(); /** * @brief Constructor */ CcUserList(const CcUserList& oToCopy); CcUserList& operator=(const CcUserList& oToCopy) = default; CcUser* findUser(const CcString& Username); CcUser* findUser(const CcString& Username) const; CcUser* findUserPassword(const CcString& Username, const CcString& Password); inline CcUser* currentUser() const { return m_CurrentUser; } bool setCurrentUser(const CcString& Username); private: CcReferenceCount* m_pReference = nullptr; CcUser* m_CurrentUser = nullptr; }; #endif // H_CcUSERLIST_H_
/** * @file mcf5225x_eth.h * @brief Coldfire V2 MCF5225x Ethernet MAC controller * * @section License * * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved. * * This file is part of CycloneTCP Open. * * 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. * * @author Oryx Embedded SARL (www.oryx-embedded.com) * @version 1.7.8 **/ #ifndef _MCF5225X_ETH_H #define _MCF5225X_ETH_H //Number of TX buffers #ifndef MCF5225X_ETH_TX_BUFFER_COUNT #define MCF5225X_ETH_TX_BUFFER_COUNT 2 #elif (MCF5225X_ETH_TX_BUFFER_COUNT < 1) #error MCF5225X_ETH_TX_BUFFER_COUNT parameter is not valid #endif //TX buffer size #ifndef MCF5225X_ETH_TX_BUFFER_SIZE #define MCF5225X_ETH_TX_BUFFER_SIZE 1536 #elif (MCF5225X_ETH_TX_BUFFER_SIZE != 1536) #error MCF5225X_ETH_TX_BUFFER_SIZE parameter is not valid #endif //Number of RX buffers #ifndef MCF5225X_ETH_RX_BUFFER_COUNT #define MCF5225X_ETH_RX_BUFFER_COUNT 4 #elif (MCF5225X_ETH_RX_BUFFER_COUNT < 1) #error MCF5225X_ETH_RX_BUFFER_COUNT parameter is not valid #endif //RX buffer size #ifndef MCF5225X_ETH_RX_BUFFER_SIZE #define MCF5225X_ETH_RX_BUFFER_SIZE 1536 #elif (MCF5225X_ETH_RX_BUFFER_SIZE != 1536) #error MCF5225X_ETH_RX_BUFFER_SIZE parameter is not valid #endif //Ethernet interrupt level #ifndef MCF5225X_ETH_IRQ_LEVEL #define MCF5225X_ETH_IRQ_LEVEL 4 #elif (MCF5225X_ETH_IRQ_LEVEL < 0) #error MCF5225X_ETH_IRQ_LEVEL parameter is not valid #endif //Ethernet interrupt priority #ifndef MCF5225X_ETH_IRQ_PRIORITY #define MCF5225X_ETH_IRQ_PRIORITY 1 #elif (MCF5225X_ETH_IRQ_PRIORITY < 0) #error MCF5225X_ETH_IRQ_PRIORITY parameter is not valid #endif //Align to 16-byte boundary #define FEC_ALIGN16(p) ((void *) ((((uint32_t) (p)) + 15) & 0xFFFFFFF0)) //Transmit buffer descriptor #define FEC_TX_BD_R 0x8000 #define FEC_TX_BD_TO1 0x4000 #define FEC_TX_BD_W 0x2000 #define FEC_TX_BD_TO2 0x1000 #define FEC_TX_BD_L 0x0800 #define FEC_TX_BD_TC 0x0400 #define FEC_TX_BD_ABC 0x0200 //Receive buffer descriptor #define FEC_RX_BD_E 0x8000 #define FEC_RX_BD_RO1 0x4000 #define FEC_RX_BD_W 0x2000 #define FEC_RX_BD_RO2 0x1000 #define FEC_RX_BD_L 0x0800 #define FEC_RX_BD_M 0x0100 #define FEC_RX_BD_BC 0x0080 #define FEC_RX_BD_MC 0x0040 #define FEC_RX_BD_LG 0x0020 #define FEC_RX_BD_NO 0x0010 #define FEC_RX_BD_CR 0x0004 #define FEC_RX_BD_OV 0x0002 #define FEC_RX_BD_TR 0x0001 /** * @brief Transmit buffer descriptor **/ typedef struct { uint16_t status; uint16_t length; uint32_t address; } Mcf5225xTxBufferDesc; /** * @brief Receive buffer descriptor **/ typedef struct { uint16_t status; uint16_t length; uint32_t address; } Mcf5225xRxBufferDesc; //MCF5225x Ethernet MAC driver extern const NicDriver mcf5225xEthDriver; //MCF5225x Ethernet MAC related functions error_t mcf5225xEthInit(NetInterface *interface); void mcf5225xEthInitGpio(NetInterface *interface); void mcf5225xEthInitBufferDesc(NetInterface *interface); void mcf5225xEthTick(NetInterface *interface); void mcf5225xEthEnableIrq(NetInterface *interface); void mcf5225xEthDisableIrq(NetInterface *interface); void mcf5225xEthEventHandler(NetInterface *interface); error_t mcf5225xEthSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset); error_t mcf5225xEthReceivePacket(NetInterface *interface); error_t mcf5225xEthSetMulticastFilter(NetInterface *interface); error_t mcf5225xEthUpdateMacConfig(NetInterface *interface); void mcf5225xEthWritePhyReg(uint8_t phyAddr, uint8_t regAddr, uint16_t data); uint16_t mcf5225xEthReadPhyReg(uint8_t phyAddr, uint8_t regAddr); uint32_t mcf5225xEthCalcCrc(const void *data, size_t length); #endif