text
stringlengths
4
6.14k
/* -*- 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/. */ #ifndef nsIAbsorbingTransaction_h__ #define nsIAbsorbingTransaction_h__ #include "nsISupports.h" /* Transaction interface to outside world */ #define NS_IABSORBINGTRANSACTION_IID \ { /* a6cf9116-15b3-11d2-932e-00805f8add32 */ \ 0xa6cf9116, \ 0x15b3, \ 0x11d2, \ {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } class nsIAtom; namespace mozilla { class EditorBase; class SelectionState; } // namespace mozilla /** * A transaction interface mixin - for transactions that can support. * the placeholder absorbtion idiom. */ class nsIAbsorbingTransaction : public nsISupports{ public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IABSORBINGTRANSACTION_IID) NS_IMETHOD Init(nsIAtom* aName, mozilla::SelectionState* aSelState, mozilla::EditorBase* aEditorBase) = 0; NS_IMETHOD EndPlaceHolderBatch()=0; NS_IMETHOD GetTxnName(nsIAtom **aName)=0; NS_IMETHOD StartSelectionEquals(mozilla::SelectionState* aSelState, bool* aResult) = 0; NS_IMETHOD ForwardEndBatchTo(nsIAbsorbingTransaction *aForwardingAddress)=0; NS_IMETHOD Commit()=0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIAbsorbingTransaction, NS_IABSORBINGTRANSACTION_IID) #endif // nsIAbsorbingTransaction_h__
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libpagemaker 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 __PMDOCUMENT_H__ #define __PMDOCUMENT_H__ #include <librevenge/librevenge.h> #ifdef DLL_EXPORT #ifdef LIBPAGEMAKER_BUILD #define PAGEMAKERAPI __declspec(dllexport) #else #define PAGEMAKERAPI __declspec(dllimport) #endif #else #define PAGEMAKERAPI #endif namespace libpagemaker { class PMDocument { public: /** Analyzes the content of an input stream to see if it can be parsed. \param input The input stream \return A value that indicates whether the content from the input stream is a PageMaker document that libpagemaker is able to parse */ static PAGEMAKERAPI bool isSupported(librevenge::RVNGInputStream *input); /** Parses the input stream content. It will make callbacks to the functions provided by a librevenge::RVNGDrawingInterface class implementation when needed. \param input The input stream \param painter A librevenge::RVNGDrawingInterface implementation \return A value that indicates whether the parsing was successful */ static PAGEMAKERAPI bool parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter); }; } // namespace libpagemaker #endif // __PMDOCUMENT_H__ /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
/* * Copyright 2013 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrSimpleTextureEffect_DEFINED #define GrSimpleTextureEffect_DEFINED #include "GrSingleTextureEffect.h" class GrInvariantOutput; /** * The output color of this effect is a modulation of the input color and a sample from a texture. * It allows explicit specification of the filtering and wrap modes (GrTextureParams) and accepts * a matrix that is used to compute texture coordinates from local coordinates. */ class GrSimpleTextureEffect : public GrSingleTextureEffect { public: /* unfiltered, clamp mode */ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix) { return sk_sp<GrFragmentProcessor>( new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix, GrTextureParams::kNone_FilterMode)); } /* clamp mode */ static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix, GrTextureParams::FilterMode filterMode) { return sk_sp<GrFragmentProcessor>( new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix, filterMode)); } static sk_sp<GrFragmentProcessor> Make(GrTexture* tex, sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix, const GrTextureParams& p) { return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix, p)); } virtual ~GrSimpleTextureEffect() {} const char* name() const override { return "SimpleTexture"; } private: GrSimpleTextureEffect(GrTexture* texture, sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix, GrTextureParams::FilterMode filterMode) : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode) { this->initClassID<GrSimpleTextureEffect>(); } GrSimpleTextureEffect(GrTexture* texture, sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix, const GrTextureParams& params) : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, params) { this->initClassID<GrSimpleTextureEffect>(); } GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; bool onIsEqual(const GrFragmentProcessor& other) const override { return true; } void onComputeInvariantOutput(GrInvariantOutput* inout) const override; GR_DECLARE_FRAGMENT_PROCESSOR_TEST; typedef GrSingleTextureEffect INHERITED; }; #endif
// // ProcessInfoController.h // System Monitor // // 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 (c) 2013 Arvydas Sidorenko // #import <Foundation/Foundation.h> @interface ProcessInfoController : NSObject - (NSArray*)getProcesses; @end
/* 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 _SECITEM_H_ #define _SECITEM_H_ #include "utilrename.h" /* * secitem.h - public data structures and prototypes for handling * SECItems */ #include "plarena.h" #include "plhash.h" #include "seccomon.h" SEC_BEGIN_PROTOS /* ** Allocate an item. If "arena" is not NULL, then allocate from there, ** otherwise allocate from the heap. If "item" is not NULL, allocate ** only the data buffer for the item, not the item itself. If "len" is ** 0, do not allocate the data buffer for the item; simply set the data ** field to NULL and the len field to 0. The item structure is allocated ** zero-filled; the data buffer is not zeroed. The caller is responsible ** for initializing the type field of the item. ** ** The resulting item is returned; NULL if any error occurs. ** ** XXX This probably should take a SECItemType, but since that is mostly ** unused and our improved APIs (aka Stan) are looming, I left it out. */ extern SECItem *SECITEM_AllocItem(PLArenaPool *arena, SECItem *item, unsigned int len); /* ** This is a legacy function containing bugs. It doesn't update item->len, ** and it has other issues as described in bug 298649 and bug 298938. ** However, the function is kept unchanged for consumers that might depend ** on the broken behaviour. New code should call SECITEM_ReallocItemV2. ** ** Reallocate the data for the specified "item". If "arena" is not NULL, ** then reallocate from there, otherwise reallocate from the heap. ** In the case where oldlen is 0, the data is allocated (not reallocated). ** In any case, "item" is expected to be a valid SECItem pointer; ** SECFailure is returned if it is not. If the allocation succeeds, ** SECSuccess is returned. */ extern SECStatus SECITEM_ReallocItem(/* deprecated function */ PLArenaPool *arena, SECItem *item, unsigned int oldlen, unsigned int newlen); /* ** Reallocate the data for the specified "item". If "arena" is not NULL, ** then reallocate from there, otherwise reallocate from the heap. ** If item->data is NULL, the data is allocated (not reallocated). ** In any case, "item" is expected to be a valid SECItem pointer; ** SECFailure is returned if it is not, and the item will remain unchanged. ** If the allocation succeeds, the item is updated and SECSuccess is returned. */ extern SECStatus SECITEM_ReallocItemV2(PLArenaPool *arena, SECItem *item, unsigned int newlen); /* ** Compare two items returning the difference between them. */ extern SECComparison SECITEM_CompareItem(const SECItem *a, const SECItem *b); /* ** Compare two items -- if they are the same, return true; otherwise false. */ extern PRBool SECITEM_ItemsAreEqual(const SECItem *a, const SECItem *b); /* ** Copy "from" to "to" */ extern SECStatus SECITEM_CopyItem(PLArenaPool *arena, SECItem *to, const SECItem *from); /* ** Allocate an item and copy "from" into it. */ extern SECItem *SECITEM_DupItem(const SECItem *from); /* ** Allocate an item and copy "from" into it. The item itself and the ** data it points to are both allocated from the arena. If arena is ** NULL, this function is equivalent to SECITEM_DupItem. */ extern SECItem *SECITEM_ArenaDupItem(PLArenaPool *arena, const SECItem *from); /* ** Free "zap". If freeit is PR_TRUE then "zap" itself is freed. */ extern void SECITEM_FreeItem(SECItem *zap, PRBool freeit); /* ** Zero and then free "zap". If freeit is PR_TRUE then "zap" itself is freed. */ extern void SECITEM_ZfreeItem(SECItem *zap, PRBool freeit); PLHashNumber PR_CALLBACK SECITEM_Hash(const void *key); PRIntn PR_CALLBACK SECITEM_HashCompare(const void *k1, const void *k2); extern SECItemArray *SECITEM_AllocArray(PLArenaPool *arena, SECItemArray *array, unsigned int len); extern SECItemArray *SECITEM_DupArray(PLArenaPool *arena, const SECItemArray *from); extern void SECITEM_FreeArray(SECItemArray *array, PRBool freeit); extern void SECITEM_ZfreeArray(SECItemArray *array, PRBool freeit); SEC_END_PROTOS #endif /* _SECITEM_H_ */
#ifndef PLASTIQQSSLCERTIFICATEEXTENSION_H #define PLASTIQQSSLCERTIFICATEEXTENSION_H #include "plastiqobject.h" class PlastiQQSslCertificateExtension : public PlastiQObject { PLASTIQ_OBJECT(IsQtObject,QSslCertificateExtension,Q_NULLPTR) PLASTIQ_INHERITS() public: ~PlastiQQSslCertificateExtension(); }; #endif // PLASTIQQSSLCERTIFICATEEXTENSION_H
/* -*- 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 KEY6PARSER_H_INCLUDED #define KEY6PARSER_H_INCLUDED #include "IWAParser.h" #include "KEYTypes_fwd.h" namespace libetonyek { class KEYCollector; class KEY6Parser : public IWAParser { public: KEY6Parser(const RVNGInputStreamPtr_t &fragments, const RVNGInputStreamPtr_t &package, KEYCollector &collector); private: bool parseDocument() override; bool parsePresentation(unsigned id); bool parseSlideList(unsigned id); KEYSlidePtr_t parseSlide(unsigned id, bool master); bool parsePlaceholder(unsigned id); void parseNotes(unsigned id); bool parseStickyNote(const IWAMessage &msg) override; const IWORKStylePtr_t querySlideStyle(unsigned id) const; void parseSlideStyle(unsigned id, IWORKStylePtr_t &style); private: KEYCollector &m_collector; mutable std::unordered_map<unsigned, KEYSlidePtr_t> m_masterSlides; mutable std::deque<KEYSlidePtr_t> m_slides; mutable StyleMap_t m_slideStyles; }; } #endif /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
/* * bbsrand.c * * Test driver for routines in bbs_rand.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/. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <limits.h> #include "bbs_rand.h" #define NUM_TESTS 100 int main(void) { unsigned int seed, result, ix; seed = time(NULL); bbs_srand((unsigned char *)&seed, sizeof(seed)); for (ix = 0; ix < NUM_TESTS; ix++) { result = bbs_rand(); printf("Test %3u: %08X\n", ix + 1, result); } return 0; }
/** * MPDQ * Music Player Daemon Query * Adding trayicons to control mpd * Licenced under MPL 2.0 */ #ifndef UTIL_H #define UTIL_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <X11/Xlib.h> extern char* version; extern int debug; extern char* volume; extern int cycles; struct _Rect { int x, y, w, h; }; typedef struct _Rect Rect; void die(char* c, int stop); void _log(char* c); char* append(char* a, char* b); int starts_with(const char* str, const char* pre); void scale_point(float scale, XPoint* p); void scale_rect(float scale, Rect* r); void shift_point(int x, int y, XPoint* p); void shift_rect(int x, int y, Rect* r); void free_rect(Rect* r); char* itoc(int i); #endif /* UTIL_H */
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2016. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation, either version 3 or (at your option) any * * later version. This program is distributed without any warranty. See * * the file COPYING.gpl-v3 for details. * \*************************************************************************/ #include <stdlib.h> #include <stdio.h> void xyz(void) { printf(" func1-xyz\n"); } void abc(void) { printf(" func1-abc\n"); } void func1(int x) { printf("Called func1\n"); xyz(); abc(); }
#ifndef SRC_LIB_NGSI_CONDITIONVALUELIST_H_ #define SRC_LIB_NGSI_CONDITIONVALUELIST_H_ /* * * Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U * * This file is part of Orion Context Broker. * * Orion Context Broker 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. * * Orion Context Broker 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 Orion Context Broker. If not, see http://www.gnu.org/licenses/. * * For those usages not covered by this license please contact with * iot_support at tid dot es * * Author: Ken Zangelin */ #include <string> #include <vector> #include "ngsi/Metadata.h" #include "ngsi/Request.h" /* **************************************************************************** * * ConditionValueList - */ typedef struct ConditionValueList { std::vector<std::string> vec; std::string render(const std::string& indent, bool comma); void present(const std::string& indent); void release(void); void push_back(const std::string& attributeName); unsigned int size(void); void fill(ConditionValueList& cvlP); std::string check(RequestType requestType, const std::string& indent, const std::string& predetectedError, int counter); std::string operator[] (unsigned int ix) const; } ConditionValueList; #endif // SRC_LIB_NGSI_CONDITIONVALUELIST_H_
/** * \file * * \brief SAM L22 Xplained Pro B test configuration. * * Copyright (c) 2015 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * 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 * EXPRESSLY AND SPECIFICALLY 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. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_TEST_H_INCLUDED #define CONF_TEST_H_INCLUDED #define CONF_STDIO_USART EDBG_CDC_MODULE #define CONF_STDIO_MUX_SETTING EDBG_CDC_SERCOM_MUX_SETTING #define CONF_STDIO_PINMUX_PAD0 EDBG_CDC_SERCOM_PINMUX_PAD0 #define CONF_STDIO_PINMUX_PAD1 EDBG_CDC_SERCOM_PINMUX_PAD1 #define CONF_STDIO_PINMUX_PAD2 EDBG_CDC_SERCOM_PINMUX_PAD2 #define CONF_STDIO_PINMUX_PAD3 EDBG_CDC_SERCOM_PINMUX_PAD3 #define CONF_STDIO_BAUDRATE 38400 /* GPIO pin used for testing the interrupts */ #define GPIO_TEST_PIN_EXTINT EXT3_PIN_5 #define EIC_TEST_CHANNEL EXT1_IRQ_INPUT #define EIC_TEST_PIN EXT1_IRQ_PIN #define EIC_TEST_PIN_MUX EXT1_IRQ_PINMUX #endif /* CONF_TEST_H_INCLUDED */
/**************************************************************************** * Copyright (C) 2014-2019 Jaroslaw Stanczyk <jaroslaw.stanczyk@upwr.edu.pl>* * The source code presented on my lectures: "C Programming Language" * **************************************************************************** * * source of this code: * J. R. Hanly and E. B. Koffman: "Problem Solving and Program Design in C", * 6-th Ed., Pearson Education, Inc, Boston, 2012 */ /* * Converts distance in miles to kilometers. */ #include <stdio.h> /* printf, scanf definitions */ #define KMS_PER_MILE 1.609 /* conversion constant */ int main (void) { double miles, /* input - distance in miles */ kms; /* output - distance in km */ /* get the distance in miles */ printf ("Enter the distance in miles > "); scanf ("%lf", &miles); /* convert the distance to km */ kms = KMS_PER_MILE * miles; /* display the distance in km */ printf ("That equals %f kilometres.\n", kms); return (0); } /* eof. */
// Copyright 2015, 2016, 2017 Ingo Steinwart // // This file is part of liquidSVM. // // liquidSVM 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. // // liquidSVM 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 liquidSVM. If not, see <http://www.gnu.org/licenses/>. #if !defined (VALIDATION_ERROR_COMPUTATION_H) #define VALIDATION_ERROR_COMPUTATION_H //********************************************************************************************************************************** __global__ void evaluate_val_predictions(double* validation_kernel_GPU, double* prediction_GPU, unsigned* coefficient_changed_GPU, double* coefficient_delta_GPU, unsigned col_set_size, unsigned col_set_size_aligned, unsigned number_coefficients_changed); //********************************************************************************************************************************** #if !defined(COMPILE_SEPERATELY__) && !defined(COMPILE_SEPERATELY__CUDA) #include "sources/svm/solver/validation_error_computation.cu" #endif #endif
/* Copyright (c) 2014-2021 AscEmu Team <http://www.ascemu.org> This file is released under the MIT license. See README-MIT for more information. */ #pragma once #include "ManagedPacket.h" #include "WorldPacket.h" namespace AscEmu::Packets { class CmsgChannelPassword : public ManagedPacket { public: std::string name; std::string password; CmsgChannelPassword() : CmsgChannelPassword("", "") { } CmsgChannelPassword(std::string name, std::string password) : ManagedPacket(CMSG_CHANNEL_PASSWORD, 0), name(name), password(password) { } protected: bool internalSerialise(WorldPacket& /*packet*/) override { return false; } bool internalDeserialise(WorldPacket& packet) override { packet >> name >> password; return true; } }; }
#ifndef PLATFORM_H #define PLATFORM_H #ifdef _WIN32 //#define _WIN32_WINNT 0x0400 // Windows NT 4.0 //#define WIN32_LEAN_AND_MEAN #include <stddef.h> // for intptr_t #include <malloc.h> // for _alloca() #pragma warning(disable: 4244) // conversion to smaller type, possible loss of data #pragma warning(disable: 4267) // conversion from size_t to smaller type, possible loss of data #pragma warning(disable: 4355) // 'this' : used in base member initializer list // VC++ 8.0 is not C99-compatible typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #define snprintf _snprintf #define strdup _strdup // 64bit compatible format string specifiers according to this document // http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx #define PRIu64 "I64i" #define PRIi64 "I64i" #define alloca _alloca #define alloca16(x) ((void *)((((intptr_t)alloca((x) + 15)) + 15) & ~15)) #define localtime_r(t, tm) localtime_s(tm, t) #else #include <stdint.h> #include <inttypes.h> #include <unistd.h> #endif // PLATFORM_STRING selection #ifdef PLATFORM_WINDOWS #ifdef _WIN64 #define PLATFORM_STRING "Windows 64bit" #else #define PLATFORM_STRING "Windows" #endif #else #ifdef PLATFORM_LINUX #ifdef __amd64__ #define PLATFORM_STRING "Linux 64bit" #else #define PLATFORM_STRING "Linux" #endif #endif #ifdef PLATFORM_DARWIN #ifdef __amd64__ #define PLATFORM_STRING "Darwin 64bit" #else #define PLATFORM_STRING "Darwin" #endif #endif #endif bool ChangeUser(const char *username); uint64_t GetMicroTimestamp(); uint64_t GetMilliTimestamp(); #endif
/* * frexp.c * * R wrapper for frexp() * * Part of the Accuracy package. Available from www.r-project.org and * www.hmdc.harvard.edu/numerical_issues/ * * Copyright (C) 2004 Micah Altman * * 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 <math.h> #include <time.h> void R_frexp(double v[], int *nv, double mantissa[], int exp[]) { int i, tmpi; for (i=0; i < *nv; i++) { mantissa[i] = frexp(v[i], &tmpi); exp[i]=tmpi; } } void R_time (int *seconds) { *seconds = (int) time(NULL); }
#ifndef __HDS_MANIFEST_H__ #define __HDS_MANIFEST_H__ // includes #include "../mp4/mp4_builder.h" #include "../mp4/mp4_parser.h" #include "../segmenter.h" #include "../common.h" // typedefs typedef struct { vod_str_t fragment_file_name_prefix; } hds_manifest_config_t; // functions vod_status_t hds_packager_build_manifest( request_context_t* request_context, hds_manifest_config_t* conf, vod_str_t* manifest_id, segmenter_conf_t* segmenter_conf, media_set_t* media_set, vod_str_t* result); #endif // __HDS_MANIFEST_H__
/***************************************************************************/ /* */ /* ftgrays.h */ /* */ /* FreeType smooth renderer declaration */ /* */ /* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __FTGRAYS_H__ #define __FTGRAYS_H__ #ifdef __cplusplus extern "C" { #endif #ifdef _STANDALONE_ #include "ftimage.h" #else #include <ft2build.h> #include FT_CONFIG_CONFIG_H /* for FT_CONFIG_OPTION_PIC */ #include FT_IMAGE_H #endif /*************************************************************************/ /* */ /* To make ftgrays.h independent from configuration files we check */ /* whether FT_EXPORT_VAR has been defined already. */ /* */ /* On some systems and compilers (Win32 mostly), an extra keyword is */ /* necessary to compile the library as a DLL. */ /* */ #ifndef FT_EXPORT_VAR #define FT_EXPORT_VAR( x ) extern x #endif FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; #ifdef __cplusplus } #endif #endif /* __FTGRAYS_H__ */ /* END */
/*- * Copyright (c) 2014 Michihiro NAKAJIMA * 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. */ #include "archive_platform.h" #pragma hdrstop __FBSDID("$FreeBSD$"); #include "archive_read_private.h" static void add_passphrase_to_tail(struct archive_read * a, struct archive_read_passphrase * p) { *a->passphrases.last = p; a->passphrases.last = &p->next; p->next = NULL; } static struct archive_read_passphrase * remove_passphrases_from_head(struct archive_read * a) { struct archive_read_passphrase * p; p = a->passphrases.first; if(p != NULL) a->passphrases.first = p->next; return (p); } static void insert_passphrase_to_head(struct archive_read * a, struct archive_read_passphrase * p) { p->next = a->passphrases.first; a->passphrases.first = p; if(&a->passphrases.first == a->passphrases.last) { a->passphrases.last = &p->next; p->next = NULL; } } static struct archive_read_passphrase * new_read_passphrase(struct archive_read * a, const char * passphrase) { struct archive_read_passphrase * p = static_cast<struct archive_read_passphrase *>(SAlloc::M(sizeof(*p))); if(!p) { archive_set_error(&a->archive, ENOMEM, "Can't allocate memory"); return NULL; } p->passphrase = sstrdup(passphrase); if(p->passphrase == NULL) { SAlloc::F(p); archive_set_error(&a->archive, ENOMEM, "Can't allocate memory"); return NULL; } return (p); } int archive_read_add_passphrase(struct archive * _a, const char * passphrase) { struct archive_read * a = (struct archive_read *)_a; struct archive_read_passphrase * p; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_add_passphrase"); if(isempty(passphrase)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Empty passphrase is unacceptable"); return ARCHIVE_FAILED; } p = new_read_passphrase(a, passphrase); if(!p) return ARCHIVE_FATAL; add_passphrase_to_tail(a, p); return ARCHIVE_OK; } int archive_read_set_passphrase_callback(struct archive * _a, void * client_data, archive_passphrase_callback * cb) { struct archive_read * a = (struct archive_read *)_a; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_set_passphrase_callback"); a->passphrases.callback = cb; a->passphrases.client_data = client_data; return ARCHIVE_OK; } /* * Call this in advance when you start to get a passphrase for decryption * for a entry. */ void __archive_read_reset_passphrase(struct archive_read * a) { a->passphrases.candidate = -1; } /* * Get a passphrase for decryption. */ const char * __archive_read_next_passphrase(struct archive_read * a) { struct archive_read_passphrase * p; const char * passphrase; if(a->passphrases.candidate < 0) { /* Count out how many passphrases we have. */ int cnt = 0; for(p = a->passphrases.first; p != NULL; p = p->next) cnt++; a->passphrases.candidate = cnt; p = a->passphrases.first; } else if(a->passphrases.candidate > 1) { /* Rotate a passphrase list. */ a->passphrases.candidate--; p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); /* Pick a new passphrase candidate up. */ p = a->passphrases.first; } else if(a->passphrases.candidate == 1) { /* This case is that all candidates failed to decrypt. */ a->passphrases.candidate = 0; if(a->passphrases.first->next != NULL) { /* Rotate a passphrase list. */ p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); } p = NULL; } else /* There is no passphrase candidate. */ p = NULL; if(p != NULL) passphrase = p->passphrase; else if(a->passphrases.callback != NULL) { /* Get a passphrase through a call-back function * since we tried all passphrases out or we don't * have it. */ passphrase = a->passphrases.callback(&a->archive, a->passphrases.client_data); if(passphrase != NULL) { p = new_read_passphrase(a, passphrase); if(!p) return NULL; insert_passphrase_to_head(a, p); a->passphrases.candidate = 1; } } else passphrase = NULL; return (passphrase); }
#include <stdlib.h> #include <string.h> #include <stdio.h> #include "usage_mon_data_scope.h" OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_create( OpenAPI_snssai_t *snssai, OpenAPI_list_t *dnn ) { OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope_local_var = OpenAPI_malloc(sizeof(OpenAPI_usage_mon_data_scope_t)); if (!usage_mon_data_scope_local_var) { return NULL; } usage_mon_data_scope_local_var->snssai = snssai; usage_mon_data_scope_local_var->dnn = dnn; return usage_mon_data_scope_local_var; } void OpenAPI_usage_mon_data_scope_free(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope) { if (NULL == usage_mon_data_scope) { return; } OpenAPI_lnode_t *node; OpenAPI_snssai_free(usage_mon_data_scope->snssai); OpenAPI_list_for_each(usage_mon_data_scope->dnn, node) { ogs_free(node->data); } OpenAPI_list_free(usage_mon_data_scope->dnn); ogs_free(usage_mon_data_scope); } cJSON *OpenAPI_usage_mon_data_scope_convertToJSON(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope) { cJSON *item = NULL; if (usage_mon_data_scope == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [UsageMonDataScope]"); return NULL; } item = cJSON_CreateObject(); cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(usage_mon_data_scope->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); goto end; } cJSON_AddItemToObject(item, "snssai", snssai_local_JSON); if (item->child == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); goto end; } if (usage_mon_data_scope->dnn) { cJSON *dnn = cJSON_AddArrayToObject(item, "dnn"); if (dnn == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); goto end; } OpenAPI_lnode_t *dnn_node; OpenAPI_list_for_each(usage_mon_data_scope->dnn, dnn_node) { if (cJSON_AddStringToObject(dnn, "", (char*)dnn_node->data) == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); goto end; } } } end: return item; } OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_parseFromJSON(cJSON *usage_mon_data_scopeJSON) { OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope_local_var = NULL; cJSON *snssai = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [snssai]"); goto end; } OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); cJSON *dnn = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "dnn"); OpenAPI_list_t *dnnList; if (dnn) { cJSON *dnn_local; if (!cJSON_IsArray(dnn)) { ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); goto end; } dnnList = OpenAPI_list_create(); cJSON_ArrayForEach(dnn_local, dnn) { if (!cJSON_IsString(dnn_local)) { ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); goto end; } OpenAPI_list_add(dnnList , ogs_strdup_or_assert(dnn_local->valuestring)); } } usage_mon_data_scope_local_var = OpenAPI_usage_mon_data_scope_create ( snssai_local_nonprim, dnn ? dnnList : NULL ); return usage_mon_data_scope_local_var; end: return NULL; } OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_copy(OpenAPI_usage_mon_data_scope_t *dst, OpenAPI_usage_mon_data_scope_t *src) { cJSON *item = NULL; char *content = NULL; ogs_assert(src); item = OpenAPI_usage_mon_data_scope_convertToJSON(src); if (!item) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed"); return NULL; } content = cJSON_Print(item); cJSON_Delete(item); if (!content) { ogs_error("cJSON_Print() failed"); return NULL; } item = cJSON_Parse(content); ogs_free(content); if (!item) { ogs_error("cJSON_Parse() failed"); return NULL; } OpenAPI_usage_mon_data_scope_free(dst); dst = OpenAPI_usage_mon_data_scope_parseFromJSON(item); cJSON_Delete(item); return dst; }
/* Generated by Snowball 2.0.0 - https://snowballstem.org/ */ #include "steminternal.h" namespace Xapian { class InternalStemIndonesian : public SnowballStemImplementation { int I_prefix; int I_measure; int r_remove_suffix(); int r_remove_second_order_prefix(); int r_remove_first_order_prefix(); int r_remove_possessive_pronoun(); int r_remove_particle(); public: int r_VOWEL(); int r_SUFFIX_I_OK(); int r_SUFFIX_AN_OK(); int r_SUFFIX_KAN_OK(); int r_KER(); InternalStemIndonesian(); ~InternalStemIndonesian(); int stem(); std::string get_description() const; }; }
/* Copyright 2002-2013 CEA LIST This file is part of LIMA. LIMA is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. LIMA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with LIMA. If not, see <http://www.gnu.org/licenses/> */ /************************************************************************ * * @file BinaryWriterBoWDocumentHandler.h * @author Mesnard Olivier (olivier.mesnard@.cea.fr) * @date Wed Oct 12 2005 * copyright Copyright (C) 2005-2012 by CEA LIST * Project BagOfWords * * @brief handler for structured bow document that produces a text output * * ***********************************************************************/ #ifndef TEXTWRITERBOWDOCUMENTHANDLER_H #define TEXTWRITERBOWDOCUMENTHANDLER_H #include "linguisticProcessing/LinguisticProcessingCommon.h" #include "bowToken.h" #include "bowText.h" #include "bowBinaryReaderWriter.h" #include "AbstractBoWDocumentHandler.h" #include "common/Data/genericDocumentProperties.h" namespace Lima { namespace Common { namespace BagOfWords { class LIMA_BOW_EXPORT BinaryWriterBoWDocumentHandler : public AbstractBoWDocumentHandler { public: BinaryWriterBoWDocumentHandler(std::ostream& os); ~BinaryWriterBoWDocumentHandler(); void openSBoWNode(const Misc::GenericDocumentProperties* properties, const std::string& elementName); void openSBoWIndexingNode(const Misc::GenericDocumentProperties* properties, const std::string& elementName); void processSBoWText(const BoWText* boWText, bool useIterators); void processProperties(const Misc::GenericDocumentProperties* properties, bool useIterators); void closeSBoWNode(); private: BoWBinaryWriter m_writer; std::ostream& m_outputStream; }; } // end namespace } // end namespace } // end namespace #endif
/* * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ /* Dispatch functions for AES GCM mode */ #include "cipher_local.h" #include "internal/ciphers/cipher_gcm.h" static int generic_aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key, size_t keylen) { PROV_AES_GCM_CTX *actx = (PROV_AES_GCM_CTX *)ctx; AES_KEY *ks = &actx->ks.ks; # ifdef HWAES_CAPABLE if (HWAES_CAPABLE) { # ifdef HWAES_ctr32_encrypt_blocks GCM_HW_SET_KEY_CTR_FN(ks, HWAES_set_encrypt_key, HWAES_encrypt, HWAES_ctr32_encrypt_blocks); # else GCM_HW_SET_KEY_CTR_FN(ks, HWAES_set_encrypt_key, HWAES_encrypt, NULL); # endif /* HWAES_ctr32_encrypt_blocks */ } else # endif /* HWAES_CAPABLE */ # ifdef BSAES_CAPABLE if (BSAES_CAPABLE) { GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, bsaes_ctr32_encrypt_blocks); } else # endif /* BSAES_CAPABLE */ # ifdef VPAES_CAPABLE if (VPAES_CAPABLE) { GCM_HW_SET_KEY_CTR_FN(ks, vpaes_set_encrypt_key, vpaes_encrypt, NULL); } else # endif /* VPAES_CAPABLE */ { # ifdef AES_CTR_ASM GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, AES_ctr32_encrypt); # else GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, NULL); # endif /* AES_CTR_ASM */ } ctx->key_set = 1; return 1; } static const PROV_GCM_HW aes_gcm = { generic_aes_gcm_initkey, gcm_setiv, gcm_aad_update, gcm_cipher_update, gcm_cipher_final, gcm_one_shot }; #if defined(S390X_aes_128_CAPABLE) # include "cipher_aes_gcm_hw_s390x.inc" #elif defined(AESNI_CAPABLE) # include "cipher_aes_gcm_hw_aesni.inc" #elif defined(SPARC_AES_CAPABLE) # include "cipher_aes_gcm_hw_t4.inc" #else const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits) { return &aes_gcm; } #endif
/* * ptw_parameters_1.h * * */ #ifndef _OpenAPI_ptw_parameters_1_H_ #define _OpenAPI_ptw_parameters_1_H_ #include <string.h> #include "../external/cJSON.h" #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" #include "operation_mode.h" #ifdef __cplusplus extern "C" { #endif typedef struct OpenAPI_ptw_parameters_1_s OpenAPI_ptw_parameters_1_t; typedef struct OpenAPI_ptw_parameters_1_s { OpenAPI_operation_mode_e operation_mode; char *ptw_value; } OpenAPI_ptw_parameters_1_t; OpenAPI_ptw_parameters_1_t *OpenAPI_ptw_parameters_1_create( OpenAPI_operation_mode_e operation_mode, char *ptw_value ); void OpenAPI_ptw_parameters_1_free(OpenAPI_ptw_parameters_1_t *ptw_parameters_1); OpenAPI_ptw_parameters_1_t *OpenAPI_ptw_parameters_1_parseFromJSON(cJSON *ptw_parameters_1JSON); cJSON *OpenAPI_ptw_parameters_1_convertToJSON(OpenAPI_ptw_parameters_1_t *ptw_parameters_1); OpenAPI_ptw_parameters_1_t *OpenAPI_ptw_parameters_1_copy(OpenAPI_ptw_parameters_1_t *dst, OpenAPI_ptw_parameters_1_t *src); #ifdef __cplusplus } #endif #endif /* _OpenAPI_ptw_parameters_1_H_ */
/* * (c) Copyright Ascensio System SIA 2010-2019 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #ifndef PPTX_LOGIC_RUN_INCLUDE_H_ #define PPTX_LOGIC_RUN_INCLUDE_H_ #include "RunBase.h" #include "./../RunProperties.h" namespace PPTX { namespace Logic { class Run : public RunBase { public: WritingElement_AdditionConstructors(Run) PPTX_LOGIC_BASE2(Run) Run& operator=(const Run& oSrc) { parentFile = oSrc.parentFile; parentElement = oSrc.parentElement; rPr = oSrc.rPr; text = oSrc.text; return *this; } virtual OOX::EElementType getType () const { return OOX::et_a_r; } virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) { if ( oReader.IsEmptyNode() ) return; int nParentDepth = oReader.GetDepth(); while( oReader.ReadNextSiblingNode( nParentDepth ) ) { std::wstring sName = oReader.GetName(); if ( L"a:rPr" == sName ) { rPr = oReader ; } else if ( L"a:t" == sName ) { if (!text.IsInit()) text = oReader.GetText2(); } } } virtual void fromXML(XmlUtils::CXmlNode& node) { XmlUtils::CXmlNodes oNodes; if (node.GetNodes(_T("*"), oNodes)) { int count = oNodes.GetCount(); for (int i = 0; i < count; ++i) { XmlUtils::CXmlNode oNode; oNodes.GetAt(i, oNode); std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName()); if (_T("rPr") == strName) { rPr = oNode; } else if (_T("t") == strName) { if (!text.IsInit()) text = oNode.GetTextExt(); } } } FillParentPointersForChilds(); } virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const { pWriter->StartNode(_T("a:r")); pWriter->EndAttributes(); if (rPr.is_init()) rPr->m_name = _T("a:rPr"); pWriter->Write(rPr); if (text.is_init()) { pWriter->WriteString(_T("<a:t>")); pWriter->WriteStringXML(*text); pWriter->WriteString(_T("</a:t>")); } pWriter->EndNode(_T("a:r")); } virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const { pWriter->StartRecord(PARRUN_TYPE_RUN); pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart); pWriter->WriteString2(0, text); pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd); pWriter->WriteRecord2(0, rPr); pWriter->EndRecord(); if (pWriter->m_pCommon->m_pNativePicker->m_bIsEmbeddedFonts) pWriter->m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckString(text); } virtual std::wstring GetText()const{return text.get_value_or(_T(""));}; void SetText(const std::wstring& srcText) { text = srcText; } public: nullable<RunProperties> rPr; private: nullable_string text; protected: virtual void FillParentPointersForChilds() { if(rPr.IsInit()) rPr->SetParentPointer(this); } }; } // namespace Logic } // namespace PPTX #endif // PPTX_LOGIC_RUN_INCLUDE_H
/*************** <auto-copyright.pl BEGIN do not edit this line> ************** * * VR Juggler is (C) Copyright 1998-2007 by Iowa State University * * Original Authors: * Allen Bierbaum, Christopher Just, * Patrick Hartling, Kevin Meinert, * Carolina Cruz-Neira, Albert Baker * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * *************** <auto-copyright.pl END do not edit this line> ***************/ #ifndef SQUARE_IMAGE #define SQUARE_IMAGE extern const Image squareImage; #endif
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2008, Willow Garage, 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 the Willow Garage 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. *********************************************************************/ /* Author: Josh Faust */ #ifndef URDF_INTERFACE_COLOR_H #define URDF_INTERFACE_COLOR_H #include <string> #include <vector> #include <math.h> #include <boost/algorithm/string.hpp> #include <boost/lexical_cast.hpp> namespace urdf { class Color { public: Color() {this->clear();}; float r; float g; float b; float a; void clear() { r = g = b = 0.0f; a = 1.0f; } bool init(const std::string &vector_str) { this->clear(); std::vector<std::string> pieces; std::vector<float> rgba; boost::split( pieces, vector_str, boost::is_any_of(" ")); for (unsigned int i = 0; i < pieces.size(); ++i) { if (!pieces[i].empty()) { try { rgba.push_back(boost::lexical_cast<double>(pieces[i].c_str())); } catch (boost::bad_lexical_cast &e) { throw("color rgba element ("+pieces[i]+") is not a valid float"); } } } if (rgba.size() != 4) { //ROS_ERROR("Color contains %i elements instead of 4 elements", (int)rgba.size()); return false; } this->r = rgba[0]; this->g = rgba[1]; this->b = rgba[2]; this->a = rgba[3]; return true; }; }; } #endif
#include <stdio.h> int main(int argc, char *argv[]) { fprintf(stdout,"hello world\n"); fprintf(stderr,"error\n"); return 0; }
/* Copyright 2015 the unarr project authors (see AUTHORS file). License: LGPLv3 */ #include "unarr-imp.h" #ifdef WIN32 #define COBJMACROS #include <Objidl.h> #include <Unknwn.h> #endif ar_stream *ar_open_stream(void *data, ar_stream_close_fn close, ar_stream_read_fn read, ar_stream_seek_fn seek, ar_stream_tell_fn tell) { ar_stream *stream = malloc(sizeof(ar_stream)); if (!stream) { close(data); return NULL; } stream->data = data; stream->close = close; stream->read = read; stream->seek = seek; stream->tell = tell; return stream; } void ar_close(ar_stream *stream) { if (stream) stream->close(stream->data); free(stream); } size_t ar_read(ar_stream *stream, void *buffer, size_t count) { return stream->read(stream->data, buffer, count); } bool ar_seek(ar_stream *stream, off64_t offset, int origin) { return stream->seek(stream->data, offset, origin); } bool ar_skip(ar_stream *stream, off64_t count) { return stream->seek(stream->data, count, SEEK_CUR); } off64_t ar_tell(ar_stream *stream) { return stream->tell(stream->data); } /***** stream based on FILE *****/ static void file_close(void *data) { fclose(data); } static size_t file_read(void *data, void *buffer, size_t count) { return fread(buffer, 1, count, data); } static bool file_seek(void *data, off64_t offset, int origin) { #ifdef _MSC_VER return _fseeki64(data, offset, origin) == 0; #else #if _POSIX_C_SOURCE >= 200112L if (sizeof(off_t) == 8) return fseeko(data, offset, origin) == 0; #endif if (offset > INT32_MAX || offset < INT32_MIN) return false; return fseek(data, (long)offset, origin) == 0; #endif } static off64_t file_tell(void *data) { #ifdef _MSC_VER return _ftelli64(data); #elif _POSIX_C_SOURCE >= 200112L return ftello(data); #else return ftell(data); #endif } ar_stream *ar_open_file(const char *path) { FILE *f = path ? fopen(path, "rb") : NULL; if (!f) return NULL; return ar_open_stream(f, file_close, file_read, file_seek, file_tell); } #ifdef _WIN32 ar_stream *ar_open_file_w(const wchar_t *path) { FILE *f = path ? _wfopen(path, L"rb") : NULL; if (!f) return NULL; return ar_open_stream(f, file_close, file_read, file_seek, file_tell); } #endif /***** stream based on preallocated memory *****/ struct MemoryStream { const uint8_t *data; size_t length; size_t offset; }; static void memory_close(void *data) { struct MemoryStream *stm = data; free(stm); } static size_t memory_read(void *data, void *buffer, size_t count) { struct MemoryStream *stm = data; if (count > stm->length - stm->offset) count = stm->length - stm->offset; memcpy(buffer, stm->data + stm->offset, count); stm->offset += count; return count; } static bool memory_seek(void *data, off64_t offset, int origin) { struct MemoryStream *stm = data; if (origin == SEEK_CUR) offset += stm->offset; else if (origin == SEEK_END) offset += stm->length; if (offset < 0 || offset > (off64_t)stm->length || (size_t)offset > stm->length) return false; stm->offset = (size_t)offset; return true; } static off64_t memory_tell(void *data) { struct MemoryStream *stm = data; return stm->offset; } ar_stream *ar_open_memory(const void *data, size_t datalen) { struct MemoryStream *stm = malloc(sizeof(struct MemoryStream)); if (!stm) return NULL; stm->data = data; stm->length = datalen; stm->offset = 0; return ar_open_stream(stm, memory_close, memory_read, memory_seek, memory_tell); } #ifdef _WIN32 /***** stream based on IStream *****/ #define COBJMACROS #include <windows.h> static void stream_close(void *data) { IUnknown_Release((IStream *)data); } static size_t stream_read(void *data, void *buffer, size_t count) { size_t read = 0; HRESULT res; ULONG cbRead; #ifdef _WIN64 while (count > ULONG_MAX) { res = IStream_Read((IStream *)data, buffer, ULONG_MAX, &cbRead); if (FAILED(res)) return read; read += cbRead; buffer = (BYTE *)buffer + ULONG_MAX; count -= ULONG_MAX; } #endif res = IStream_Read((IStream *)data, buffer, (ULONG)count, &cbRead); if (SUCCEEDED(res)) read += cbRead; return read; } static bool stream_seek(void *data, off64_t offset, int origin) { LARGE_INTEGER off; ULARGE_INTEGER n; HRESULT res; off.QuadPart = offset; res = IStream_Seek((IStream *)data, off, origin, &n); return SUCCEEDED(res); } static off64_t stream_tell(void *data) { LARGE_INTEGER zero = { 0 }; ULARGE_INTEGER n = { 0 }; IStream_Seek((IStream *)data, zero, SEEK_CUR, &n); return (off64_t)n.QuadPart; } ar_stream *ar_open_istream(IStream *stream) { LARGE_INTEGER zero = { 0 }; HRESULT res = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL); if (FAILED(res)) return NULL; IUnknown_AddRef(stream); return ar_open_stream(stream, stream_close, stream_read, stream_seek, stream_tell); } #endif
/* Copyright (c) 2013, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Ford Motor Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_H_ #include "application_manager/commands/command_request_impl.h" #include "utils/macro.h" namespace application_manager { namespace commands { /** * @brief speak request command class **/ class SpeakRequest : public CommandRequestImpl { public: /** * \brief SpeakRequest class constructor **/ explicit SpeakRequest(const MessageSharedPtr& message); /** * \brief SpeakRequest class destructor **/ virtual ~SpeakRequest(); /** * @brief Execute command **/ virtual void Run(); private: DISALLOW_COPY_AND_ASSIGN(SpeakRequest); }; } // namespace commands } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SPEAK_REQUEST_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 QtXmlPatterns 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$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. #ifndef Patternist_StaticBaseURIStore_H #define Patternist_StaticBaseURIStore_H #include "qsinglecontainer_p.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE namespace QPatternist { /** * @short A compile time only AST node that changes the static base URI, * used when @c xml:base attributes appears. * * @see StaticBaseURIContext * @author Frans Englich <frans.englich@nokia.com> * @ingroup Patternist_expressions * @since 4.5 */ class StaticBaseURIStore : public SingleContainer { public: /** * @p baseURI must be valid, not empty, and either relative or * absolute. */ StaticBaseURIStore(const QUrl &baseURI, const Expression::Ptr &operand); virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context, const SequenceType::Ptr &reqType); virtual SequenceType::Ptr staticType() const; virtual SequenceType::List expectedOperandTypes() const; virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const; private: const QUrl m_baseURI; }; } QT_END_NAMESPACE QT_END_HEADER #endif
/* CAGLFramebuffer.h Copyright (C) 2012 Free Software Foundation, Inc. Author: Ivan Vučica <ivan@vucica.net> Date: July 2012 This file is part of QuartzCore. 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; see the file COPYING.LIB. If not, see <http://www.gnu.org/licenses/> or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This object is called a simple framebuffer because all it allows is a texture serving as a color attachment point and a renderbuffer serving as a depth attachment. It also isn't too nice that it directly manages the renderbuffer for depth. It'd be more powerful if we also wrapped framebuffer in a way that allows more finetuned manipulation of attachment points. However, for the time being, we don't need that. */ #import <Foundation/Foundation.h> #if !(__APPLE__) #define GL_GLEXT_PROTOTYPES 1 #import <GL/gl.h> #import <GL/glu.h> #import <GL/glext.h> #else #import <OpenGL/OpenGL.h> #import <OpenGL/gl.h> #import <OpenGL/glu.h> #endif @class CAGLTexture; @interface CAGLSimpleFramebuffer : NSObject { GLuint _framebufferID; GLuint _depthRenderbufferID; CAGLTexture * _texture; BOOL _depthBufferEnabled; } @property (nonatomic, retain, readonly) CAGLTexture * texture; @property (nonatomic, getter=hasDepthBuffer) BOOL depthBufferEnabled; - (id)initWithWidth: (CGFloat) width height: (CGFloat) height; - (void) bind; - (void) unbind; @end /* vim: set cindent cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1 expandtabs shiftwidth=2 tabstop=8: */
/** STCompiledMethod.h Copyright (c) 2002 Free Software Foundation This file is part of the StepTalk. 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 */ #import "STCompiledCode.h" #import <StepTalk/STMethod.h> @class STMessage; @interface STCompiledMethod:STCompiledCode<STMethod> { NSString *selector; short argCount; // unsigned primitive; } + methodWithCode:(STCompiledCode *)code messagePattern:(STMessage *)pattern; - initWithSelector:(NSString *)sel argumentCount:(unsigned)aCount bytecodesData:(NSData *)data literals:(NSArray *)anArray temporariesCount:(unsigned)tCount stackSize:(unsigned)size namedReferences:(NSMutableArray *)refs; - (NSString *)selector; - (unsigned)argumentCount; @end
/* * virsh-network.c: Commands to manage network * * Copyright (C) 2005, 2007-2012 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/>. * * Daniel Veillard <veillard@redhat.com> * Karel Zak <kzak@redhat.com> * Daniel P. Berrange <berrange@redhat.com> * */ #ifndef VIRSH_NETWORK_H # define VIRSH_NETWORK_H # include "virsh.h" virNetworkPtr vshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, const char **name, unsigned int flags); /* default is lookup by Name and UUID */ # define vshCommandOptNetwork(_ctl, _cmd, _name) \ vshCommandOptNetworkBy(_ctl, _cmd, _name, \ VSH_BYUUID|VSH_BYNAME) extern const vshCmdDef networkCmds[]; #endif /* VIRSH_NETWORK_H */
/* * upnpavd - UPNP AV Daemon * * Copyright (C) 2009 - 2010 Alper Akcan, alper.akcan@gmail.com * Copyright (C) 2009 - 2010 CoreCodec, Inc., http://www.CoreCodec.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Any non-LGPL usage of this software or parts of this software is strictly * forbidden. * * Commercial non-LGPL licensing of this software is possible. * For more info contact CoreCodec through info@corecodec.com */ #include <config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h> #include "platform.h" #include "gena.h" #include "upnp.h" #include "common.h" #include "metadata.h" #include "mediarenderer.h" struct upnpavd_mediarenderer_s { char *interface; char *ipaddr; char *netmask; char *friendlyname; device_t *device; }; upnpavd_mediarenderer_t * upnpavd_mediarenderer_init (const char *interface, const char *friendlyname) { char *opt; upnpavd_mediarenderer_t *c; c = (upnpavd_mediarenderer_t *) malloc(sizeof(upnpavd_mediarenderer_t)); if (c == NULL) { goto err0; } memset(c, 0, sizeof(upnpavd_mediarenderer_t)); c->interface = strdup(interface); c->ipaddr = upnpd_interface_getaddr(interface); c->netmask = upnpd_interface_getmask(interface); c->friendlyname = (friendlyname == NULL) ? strdup("mediarenderer") : strdup(friendlyname); if (c->interface == NULL || c->ipaddr == NULL || c->netmask == NULL || c->friendlyname == NULL) { goto err1; } if (asprintf(&opt, "ipaddr=%s,netmask=%s,friendlyname=%s", c->ipaddr, c->netmask, c->friendlyname) < 0) { goto err1; } c->device = upnpd_mediarenderer_init(opt); if (c->device == NULL) { goto err2; } free(opt); return c; err2: free(opt); err1: free(c->netmask); free(c->ipaddr); free(c->interface); free(c->friendlyname); free(c); err0: return NULL; } int upnpavd_mediarenderer_uninit (upnpavd_mediarenderer_t *mediarenderer) { free(mediarenderer->interface); free(mediarenderer->ipaddr); free(mediarenderer->netmask); free(mediarenderer->friendlyname); upnpd_mediarenderer_uninit(mediarenderer->device); free(mediarenderer); return 0; }
// // CCClosestFirstIterator.h // CCGraphT // // Created by James Kane on 11/10/12. // Copyright (c) 2012 James Kane. All rights reserved. // #import "CCCrossComponentIterator.h" @class CCFibonacciHeapNode; @interface CCClosestFirstIterator : CCCrossComponentIterator - (id)initWithGraph:(CCAbstractBaseGraph *)graph; - (id)initWithGraph:(CCAbstractGraph *)graph startFrom:(id)startVertex withRadius:(double)radius; - (void)checkRadiusTraversal:(BOOL)crossComponentTraversal; - (double)shortestPathLength:(id)vertex; - (id)spanningTreeEdge:(id)vertex; - (double)calculatePathLength:(id)vertex on:(id)edge; - (CCFibonacciHeapNode *)createSeenData:(id)vertex on:(id)edge; @end @interface CCQueueEntry : NSObject @property (strong, nonatomic) id spanningTreeEdge; @property (strong, nonatomic) id vertex; @property (nonatomic) BOOL frozen; @end
#include <stdio.h> #include <string.h> #include <ctype.h> /* tolower */ #include <stdlib.h> /* exit */ #define PC 0 #define MPE 0 #define ANSI 0 #define TRACE 0 #if PC #include <process.h> #endif #if ANSI void erro(char *s1, char *s2); #else void erro(); #endif char line[16*BUFSIZ+1]; void main(argc,argv) int argc; char *argv[]; { FILE *fp; char filn[64+1]; char *p,*q; long count,skipl; if (argc > 1) { if (sscanf(argv[1],"%ld",&skipl) != 1) erro("fatal: ",argv[1]); while (skipl-- > 0) gets(line); } p=gets(line); count=0; while (p) { if (strncmp(line,"/******",7)) erro("not 7 aster: ",line); gets(line); sscanf(line,"%s",filn); if (argc > 2) { for (q=filn; *q ; q++) if (*q == '.') { *q='\0'; break; } } for (q=filn; *q ; q++) if (*q>='A' && *q<='Z') *q = tolower(*q); printf("\nWriting file %s.. \n",filn); #if MPE fp=fopen(filn,"w R80"); fprintf(stderr,"\g\g+++ w R80"); #else fp=fopen(filn,"w"); #endif if (fp == NULL) erro("Open error: ",filn); gets(line); /* 2nd aster line */ while ((p=gets(line)) != NULL) { if (strncmp(line,"}/******",8) == 0) { /* final crlf missing */ fprintf(fp,"}\n"); count++; strcpy(line,"/******"); } if (strncmp(line,"/******",7)) { fprintf(fp,"%s\n",line); count++; #if TRACE printf("%6ld: %s",count,line); getchar(); #endif } else { printf("%ld lines written\n",count); fclose(fp); count=0; break; } } } if (count) printf("%ld lines written\n",count); exit(0); } void erro(s1,s2) char *s1,*s2; { fprintf(stderr,"\n%s%s\n\n",s1,s2); exit(1); }
/* * Copyright (C) 2005 Tommi Maekitalo * * 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. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * 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 TNT_SESSIONSCOPE_H #define TNT_SESSIONSCOPE_H #include <tnt/scope.h> #include <tnt/tntconfig.h> #include <time.h> namespace tnt { class Sessionscope : public Scope { time_t _atime; unsigned _timeout; public: Sessionscope() : _timeout(TntConfig::it().sessionTimeout) { touch(); } void touch() { time(&_atime); } time_t getAtime() const { return _atime; } unsigned getTimeout() const { return _timeout; } void setTimeout(unsigned t) { _timeout = t; } }; } #endif // TNT_SESSIONSCOPE_H
/****************************************************************************** Copyright 2009, Freie Universität Berlin (FUB). All rights reserved. These sources were developed at the Freie Universitaet Berlin, Computer Systems and Telematics group (http://cst.mi.fu-berlin.de). ------------------------------------------------------------------------------- This file is part of RIOT. 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. RIOT 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/ . -------------------------------------------------------------------------------- For further information and questions please use the web site http://scatterweb.mi.fu-berlin.de and the mailinglist (subscription via web site) scatterweb@lists.spline.inf.fu-berlin.de *******************************************************************************/ #ifndef GPIOINT_H_ #define GPIOINT_H_ /** * @defgroup dev_gpioint GPIO IRQ Multiplexer * @ingroup dev * * Provides an API to implement interrupt handlers on IO pins. * * Multiplexer and interrupt handling must be implemented platform specific. * * See gpioint-example.c for an example of how to use gpioint. * * @{ */ /** * @example gpioint-example.c * This example shows how to setup an interrupt handler for a GPIO pin * without using the HAL. */ /** * @file * @brief GPIO IRQ Multiplexer interface * * @author Freie Universität Berlin, Computer Systems & Telematics * @author Michael Baar <michael.baar@fu-berlin.de> * @version $Revision: 1508 $ * * @note $Id: gpioint.h 1508 2009-10-26 15:10:02Z baar $ */ #include <stdint.h> #include <stdbool.h> /* * gpioint_flags: * Note: - We rely on the exact values for the edges. * - These flags are extended in hal/drivers/device-gpio.h */ #define GPIOINT_DISABLE 0x00 #define GPIOINT_RISING_EDGE 0x01 ///< interrupt is generated on rising edge #define GPIOINT_FALLING_EDGE 0x02 ///< interrupt is generated on falling edge #define GPIOINT_DEBOUNCE 0x04 ///< debounce this interrupt /** * @brief GPIO IRQ callback function type * @param[in] data User defined callback data passed through gpioint_set * @param[in] edge A combination of GPIOINT_RISING_EDGE and GPIOINT_FALLING_EDGE */ typedef void(*fp_irqcb)(void); /** * @brief GPIO IRQ handler setup * @param[in] port CPU specific port number (starting at 0) * @param[in] bitmask One or more bits for which to set the handler * @param[in] flags A combination of #GPIOINT_RISING_EDGE and #GPIOINT_FALLING_EDGE * @param[in] callback A pointer to a handler function * @retval true successful * @retval false failed * * To enable interrupt handling for a pin flags and callback must be non-zero. To disable interrupt * handling flags and callback shall be zero. */ bool gpioint_set(int port, uint32_t bitmask, int flags, fp_irqcb callback); void gpioint_init(void); /** @} */ #endif /* GPIOINT_H_ */
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** 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 QSIMULATORMULTIMEDIADATA_P_H #define QSIMULATORMULTIMEDIADATA_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qmobilityglobal.h" #include <QtCore/QMetaType> #include <QtCore/QDateTime> #include <qcamera.h> QT_BEGIN_HEADER QTM_BEGIN_NAMESPACE struct QCameraData { struct QCameraDetails { QString description; QString imagePath; }; QHash<QString, QCameraDetails> cameras; }; void qt_registerCameraTypes(); QTM_END_NAMESPACE Q_DECLARE_METATYPE(QtMobility::QCameraData) Q_DECLARE_METATYPE(QtMobility::QCameraData::QCameraDetails) QT_END_HEADER #endif // QMULTIMEDIADATA_SIMULATOR_P_H
/* * Copyright 2006 Serge van den Boom <svdb@stack.nl> * * 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 "port.h" #define SOCKET_INTERNAL #include "socket.h" #ifdef USE_WINSOCK # include <winsock2.h> #else # include <sys/socket.h> # include <netinet/in.h> #endif //////////////////////////////////////////////////////////////////////////// const int protocolFamilyTranslation[] = { /* .[PF_unspec] = */ PF_UNSPEC, /* .[PF_inet] = */ PF_INET, /* .[PF_inet6] = */ PF_INET6, }; const int protocolTranslation[] = { /* .[IPProto_tcp] = */ IPPROTO_TCP, /* .[IPProto_udp] = */ IPPROTO_UDP, }; const int socketTypeTranslation[] = { /* .[Sock_stream] = */ SOCK_STREAM, /* .[Sock_dgram] = */ SOCK_DGRAM, }; Socket * Socket_open(ProtocolFamily domain, SocketType type, Protocol protocol) { return Socket_openNative(protocolFamilyTranslation[domain], socketTypeTranslation[type], protocolTranslation[protocol]); } ////////////////////////////////////////////////////////////////////////////
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Solutions Commercial License Agreement provided ** with the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** Please note Third Party Software included with Qt Solutions may impose ** additional restrictions and it is the user's responsibility to ensure ** that they have met the licensing requirements of the GPL, LGPL, or Qt ** Solutions Commercial license and the relevant license of the Third ** Party Software they are using. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QMLBACKENDMONITORAO_H_ #define QMLBACKENDMONITORAO_H_ #include <e32base.h> // For CActive, link against: euser.lib #include <lbs.h> #include <lbscommon.h> #include <lbt.h> #include <lbtsessiontrigger.h> #include "qgeoareamonitor.h" QTM_BEGIN_NAMESPACE class CBackendMonitorInfo; enum enTriggerType { EntryTrigger, ExitTrigger, NotifyChangesTrigger, InvalidTrigger = -1 }; class QGeoAreaMonitorS60; class QMLBackendMonitorAO : public CActive { public : static QMLBackendMonitorAO* NewL(RLbtServer &aLbtServer); static void DeleteAO(QGeoAreaMonitorS60* aParent); void NotifyFiredEvent(); void DoCancel(); void RunL(); private : QMLBackendMonitorAO(); ~QMLBackendMonitorAO(); static QMLBackendMonitorAO* NewLC(RLbtServer &aLbt); void ConstructL(RLbtServer &aLbtServ); bool isValid() { return subsessionCreated && (iTriggerMonitorInfo != NULL); } private: //Design change static QMLBackendMonitorAO* iBackendMonitorAO; //single instance for access from all the QGeoAreaMonitorS60 objects CBackendMonitorInfo* iTriggerMonitorInfo; //single instance of the CBackendMonitorInfo object static TInt refCount; //count : number of monitors created by the clients TLbtTriggerFireInfo iTriggerInfo; //info of the fired event bool subsessionCreated; //check for the successful creation of the subsession RLbt iLbt; //subsession }; QTM_END_NAMESPACE #endif /* QMLBACKENDMONITORAO_H_ */
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtDeclarative module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QDECLARATIVETEXTEDIT_P_H #define QDECLARATIVETEXTEDIT_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // /*#include "qdeclarativeitem.h" #include "private/qdeclarativeimplicitsizeitem_p_p.h" #include <qdeclarative.h> */ #include "qquicktextedit_p.h" #include "qquickimplicitsizeitem_p_p.h" #include "qquicktextcontrol_p.h" #include <QtQml/qqml.h> #include <QtCore/qlist.h> QT_BEGIN_NAMESPACE class QTextLayout; class QTextDocument; class QWidgetTextControl; class QQuickTextEditPrivate : public QQuickImplicitSizeItemPrivate { Q_DECLARE_PUBLIC(QQuickTextEdit) public: QQuickTextEditPrivate() : color("black"), hAlign(QQuickTextEdit::AlignLeft), vAlign(QQuickTextEdit::AlignTop), imgDirty(true), control(0),dirty(false), richText(false), cursorVisible(false), focusOnPress(true), showInputPanelOnFocus(true), clickCausedFocus(false), persistentSelection(true), requireImplicitWidth(false), hAlignImplicit(true), rightToLeftText(false), selectByMouse(false), canPaste(false), canPasteValid(false), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), cursorComponent(0), cursor(0), format(QQuickTextEdit::AutoText), document(0), wrapMode(QQuickTextEdit::NoWrap), mouseSelectionMode(QQuickTextEdit::SelectCharacters), yoff(0) { } void init(); void updateDefaultTextOption(); void relayoutDocument(); void updateSelection(); bool determineHorizontalAlignment(); bool setHAlign(QQuickTextEdit::HAlignment, bool forceAlign = false); void mirrorChange(); qreal implicitWidth() const; void focusChanged(bool); QString text; QFont font; QFont sourceFont; QColor color; QColor selectionColor; QColor selectedTextColor; QString style; QColor styleColor; QPixmap imgCache; QPixmap imgStyleCache; QQuickTextEdit::HAlignment hAlign; QQuickTextEdit::VAlignment vAlign; bool imgDirty : 1; bool dirty : 1; bool richText : 1; bool cursorVisible : 1; bool focusOnPress : 1; bool showInputPanelOnFocus : 1; bool clickCausedFocus : 1; bool persistentSelection : 1; bool requireImplicitWidth:1; bool hAlignImplicit:1; bool rightToLeftText:1; bool selectByMouse : 1; mutable bool canPaste : 1; mutable bool canPasteValid : 1; qreal textMargin; int lastSelectionStart; int lastSelectionEnd; QQuickItem * cursorComponent; QQuickItem* cursor; QQuickTextEdit::TextFormat format; QTextDocument *document; //QWidgetTextControl *control; QQuickTextControl *control; QQuickTextEdit::WrapMode wrapMode; QQuickTextEdit::SelectionMode mouseSelectionMode; int lineCount; int yoff; QSize paintedSize; }; QT_END_NAMESPACE #endif
/* GStreamer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <gst/rtp/gstrtpbuffer.h> #include <stdlib.h> #include <string.h> #include "gstrtpg729depay.h" GST_DEBUG_CATEGORY_STATIC (rtpg729depay_debug); #define GST_CAT_DEFAULT (rtpg729depay_debug) /* references: * * RFC 3551 (4.5.6) */ enum { /* FILL ME */ LAST_SIGNAL }; enum { ARG_0 }; /* input is an RTP packet * */ static GstStaticPadTemplate gst_rtp_g729_depay_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("application/x-rtp, " "media = (string) \"audio\", " "clock-rate = (int) 8000, " "encoding-name = (string) \"G729\"; " "application/x-rtp, " "media = (string) \"audio\", " "payload = (int) " GST_RTP_PAYLOAD_G729_STRING ", " "clock-rate = (int) 8000") ); static GstStaticPadTemplate gst_rtp_g729_depay_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/G729, " "channels = (int) 1," "rate = (int) 8000") ); static gboolean gst_rtp_g729_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps); static GstBuffer *gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf); #define gst_rtp_g729_depay_parent_class parent_class G_DEFINE_TYPE (GstRtpG729Depay, gst_rtp_g729_depay, GST_TYPE_RTP_BASE_DEPAYLOAD); static void gst_rtp_g729_depay_class_init (GstRtpG729DepayClass * klass) { GstElementClass *gstelement_class; GstRTPBaseDepayloadClass *gstrtpbasedepayload_class; GST_DEBUG_CATEGORY_INIT (rtpg729depay_debug, "rtpg729depay", 0, "G.729 RTP Depayloader"); gstelement_class = (GstElementClass *) klass; gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass; gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_rtp_g729_depay_src_template)); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&gst_rtp_g729_depay_sink_template)); gst_element_class_set_static_metadata (gstelement_class, "RTP G.729 depayloader", "Codec/Depayloader/Network/RTP", "Extracts G.729 audio from RTP packets (RFC 3551)", "Laurent Glayal <spglegle@yahoo.fr>"); gstrtpbasedepayload_class->process = gst_rtp_g729_depay_process; gstrtpbasedepayload_class->set_caps = gst_rtp_g729_depay_setcaps; } static void gst_rtp_g729_depay_init (GstRtpG729Depay * rtpg729depay) { GstRTPBaseDepayload *depayload; depayload = GST_RTP_BASE_DEPAYLOAD (rtpg729depay); gst_pad_use_fixed_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (depayload)); } static gboolean gst_rtp_g729_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) { GstStructure *structure; GstCaps *srccaps; GstRtpG729Depay *rtpg729depay; const gchar *params; gint clock_rate, channels; gboolean ret; rtpg729depay = GST_RTP_G729_DEPAY (depayload); structure = gst_caps_get_structure (caps, 0); if (!(params = gst_structure_get_string (structure, "encoding-params"))) channels = 1; else { channels = atoi (params); } if (!gst_structure_get_int (structure, "clock-rate", &clock_rate)) clock_rate = 8000; if (channels != 1) goto wrong_channels; if (clock_rate != 8000) goto wrong_clock_rate; depayload->clock_rate = clock_rate; srccaps = gst_caps_new_simple ("audio/G729", "channels", G_TYPE_INT, channels, "rate", G_TYPE_INT, clock_rate, NULL); ret = gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (depayload), srccaps); gst_caps_unref (srccaps); return ret; /* ERRORS */ wrong_channels: { GST_DEBUG_OBJECT (rtpg729depay, "expected 1 channel, got %d", channels); return FALSE; } wrong_clock_rate: { GST_DEBUG_OBJECT (rtpg729depay, "expected 8000 clock-rate, got %d", clock_rate); return FALSE; } } static GstBuffer * gst_rtp_g729_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) { GstRtpG729Depay *rtpg729depay; GstBuffer *outbuf = NULL; gint payload_len; gboolean marker; GstRTPBuffer rtp = { NULL }; rtpg729depay = GST_RTP_G729_DEPAY (depayload); gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp); payload_len = gst_rtp_buffer_get_payload_len (&rtp); /* At least 2 bytes (CNG from G729 Annex B) */ if (payload_len < 2) { GST_ELEMENT_WARNING (rtpg729depay, STREAM, DECODE, (NULL), ("G729 RTP payload too small (%d)", payload_len)); goto bad_packet; } GST_LOG_OBJECT (rtpg729depay, "payload len %d", payload_len); if ((payload_len % 10) == 2) { GST_LOG_OBJECT (rtpg729depay, "G729 payload contains CNG frame"); } outbuf = gst_rtp_buffer_get_payload_buffer (&rtp); marker = gst_rtp_buffer_get_marker (&rtp); gst_rtp_buffer_unmap (&rtp); if (marker) { /* marker bit starts talkspurt */ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT); } GST_LOG_OBJECT (depayload, "pushing buffer of size %" G_GSIZE_FORMAT, gst_buffer_get_size (outbuf)); return outbuf; /* ERRORS */ bad_packet: { /* no fatal error */ return NULL; } } gboolean gst_rtp_g729_depay_plugin_init (GstPlugin * plugin) { return gst_element_register (plugin, "rtpg729depay", GST_RANK_SECONDARY, GST_TYPE_RTP_G729_DEPAY); }
///////////////////////////////////////////////////////////////////////////// // // File: timer2_calc_crc_val.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 "timer2.h" #include "pwr_clk_mgmt.h" ///////////////////////////////////////////////////////////////////////////////////////////////////////// // // uint16_t timer2_calc_crc_val(float period_in_seconds, bool t2ps_bit_val) // // Description: // Gets the closest reload value for timer 2 based on the input timer period and prescaler value // // Parameters: // float period_in_seconds - length of the expected timer period in nanoseconds // bool t2ps_bit_val - value of the T2CON.T2PS value (timer 2's prescaler) // // Return value: // Value to set the CRCH:CRCL registers (and initialize TH2:TH1 registers) based on the input timer // period // ///////////////////////////////////////////////////////////////////////////////////////////////////////// uint16_t timer2_calc_crc_val(float period_in_seconds, bool t2ps_bit_val) { float calc_crc_val_f; //Calculates the CRCH:CRCL value from the desired timer overflow period // // period * CCLK_FREQ //CRC = 65536 - ----------------------------------- // (2 ^ PRESCALER) * 12 clocks/timer++ // calc_crc_val_f = (float)65536 - ((period_in_seconds * (float)pwr_clk_mgmt_get_cclk_freq_in_hz()) / ((float)(((t2ps_bit_val ? 2 : 1) * 12)))); //Check if the calculated value will overflow or underflow the CRC register if(calc_crc_val_f >= (float)65535) { //The value will overflow, so just return the maximum possible value return 65535; } else if(calc_crc_val_f <= (float)0) { //The value will underflow, so just return the minimum possible value return 0; } else { //Round the floating point number to the nearest integer by adding 0.5, then return that integer return ((uint16_t)(calc_crc_val_f + 0.5)); } }
/* * This file is part of Handset UX Transfer user interface * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. * Contact: Jukka Tiihonen <jukka.tiihonen@nokia.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #ifndef _TRANSFER_STRUCTURES_H_ #define _TRANSFER_STRUCTURES_H_ #include "TransferUI/transferenums.h" #include <QObject> #include <QImage> #include <QDateTime> #include <QSharedPointer> using namespace TransferUI; /*! \struct TUIData \brief Struct for the TUI Data Model */ struct TUIData { TUIData(); ~TUIData(); double progressData; //!< Progress Data qlonglong bytes; //!< Total bytes. int estimateTime; //!< Estimated time in seconds int currentFileIndex; //!< current file index which is being transfered int filesCount; //!< Total No of Items TransferStatus status; //!< Status of the transfer.Refer TransferTypes TransferType method; //!< Type of the transfer.Refer TransferTypes bool canPause; //!< true if transfer can be paused else false bool canRepair; //!< true if error can be reparied else false bool canSendImdtly; //!< Applicable only for uploads bool showInHistory; //!< show this transfer in history bool removeWhenCleared; //!< flag set when the tui should clear the temp file QString name; //!< Name which will be displayed QString message; //!< Message displayed for non-active transfers. QString headerMsg; //!< Header Description of the Error QString detailMsg; //!< Detail Description of the Error QString actionName; //!< Action Name of the Error QString thumbnailFile; //!< filename of the transfer QString thumbnailMimeType; //!< mimetype of the thumbnail QString targetName; //!< Target Name QString fileTypeIcon; //!< file type icon for the transfer QString cancelButtonText; //!< custom cancel button text QString transferTitle; //!< custom transfer dialog title QString replaceId; //!< replace id for the given transfer QString clientId; //!< clinet interface information for custom dialogs QString resultUri; //!< Uri to launch application of the completed transfers QString thumbnailImagePath; //!< transfer image path QString resultMimeType; //!< Mime Type for the result file. QDateTime completedTime; //!< completed time of the transfer QDateTime startTime; //!< time when transfer started }; #endif
#ifndef _FEEDSERVICEUTILS2_H_ #define _FEEDSERVICEUTILS2_H_ typedef struct{ void* query_loaderdata; }query_loader; typedef struct{ void* db_interface_data; }db_interface; typedef struct{ void* handle; }file_watcher; typedef gboolean (*HttpProgressCallback)(gdouble bytes_sent,gpointer user_data); typedef struct{ HttpProgressCallback callback; gpointer user_data; }HttpProgress; extern void query_loader_free(query_loader* db_loader); extern void db_interface_free(db_interface* database); extern void file_watcher_free(file_watcher* watcher); extern int network_utils_get_with_progress_and_validate_certificate( GString *url, GArray *response, GHashTable *headers, GHashTable *query_params, ConIcConnection *con, HttpProgress *progress, GError **error ); extern int network_utils_post_multipart_with_progress( GString *url, const gchar *file, GHashTable *query_params, GArray *response, ConIcConnection *con, HttpProgress *progress, GError **error ); extern int network_utils_get_with_progress( GString *url, GArray *result, GHashTable *headers, GHashTable *query_params, ConIcConnection *con, HttpProgress *progress, GError **error ); extern int network_utils_get( GString *url, GArray *result, GHashTable *headers, GHashTable *query_params, ConIcConnection *con, GError **error ); #endif /* _FEEDSERVICEUTILS2_H_ */
/* * Copyright (c) 2015 Intel Corporation. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef _BLE_CENTRAL_H_INCLUDED #define _BLE_CENTRAL_H_INCLUDED #include "BLECommon.h" #include "BLERoleBase.h" class BLEAttribute; /** * @brief A class defining the BLE central function * * This class abstract the BLE central. */ class BLECentral{ public: /** * @brief Start scan * * @param none * * @return bool Indicate the success or error * * @note none */ bool startScan(); /** * @brief Start scan with scan parameter * * @param[in] interval The scan interval in ms * * @param[in] window The scan window in ms * * @return bool Indicate the success or error * * @note none */ bool startScan(float interval, float window); /** * @brief Stop scan * * @param none * * @return bool Indicate the success or error * * @note none */ bool stopScan(); /** * @brief Schedule a connect request to peripheral to establish a connection * * @param[in] addr The MAC address of peripheral device that want to establish connection * * @param[in] param The connetion parameters * * @return bool Indicate the success or error * * @note none */ bool connect(const bt_addr_le_t *addr, const ble_conn_param_t *param); /** * @brief Discover the peripheral device profile * * @param[in] peripheral The Peripheral that need to discover the profile * * @return none * * @note none */ void discover(BLEPeripheralHelper &peripheral); /** * @brief Set the scan parameter * * @param[in] interval The scan interval in ms * * @param[in] window The scan window in ms * * @return none * * @note 1. The scale of the interval and window are 2.5 - 10240ms * 2. The scan interval and window are like below. * The device can see the ADV packet in the window. * window * ---- ---- * | | | | * --- ------- ---- * |interval| */ void setScanParam(float interval, float window); /** * @brief Add an attribute to the BLE Central Device * * @param[in] attribute Attribute to add to Central * * @return BleStatus indicating success or error * * @note The attribute will used for discover the peripheral handler * Only need check return value at first call. Memory only alloc at first call */ BleStatus addAttribute(BLEAttribute& attribute); /** * Provide a function to be called when events related to this Device are raised * * @param[in] event Event type for callback * @param[in] callback Pointer to callback function to invoke when an event occurs. */ void setEventHandler(BLERoleEvent event, BLERoleEventHandler callback); /** * @brief Provide a function to be called when scanned the advertisement * * @param[in] advcb Pointer to callback function to invoke when advertisement received * * @return none * * @note none */ void setAdvertiseHandler(ble_advertise_handle_cb_t advcb); /** * @brief Setup attributes and start scan * * @return bool indicating success or error */ bool begin(void); /** * @brief Get peer peripheral device * *@param peripheral peer peripheral device of the central board * * @return pointer of peer peripheral device */ BLEPeripheralHelper *getPeerPeripheralBLE(BLEHelper& peripheral); protected: private: }; #endif
#include <stdio.h> #include "CompilerKit.h" /** The following shows how to build up a Finite State Machine and search through it. */ // Build up the state machine. Should match "fsm" or "demo", separated by (but not ending with) spaces. CompilerKitFSM *state_machine () { CompilerKitFSM* fsm; // Creates pointer for FSM fsm = compilerkit_FSM_new("A"); // Calls the constructor for the FSM // compilerkit_FSM_set_start_state(fsm, "A"); compilerkit_FSM_add_transition (fsm, "A", "B", 'd'); compilerkit_FSM_add_transition (fsm, "A", "F", 'f'); compilerkit_FSM_add_transition (fsm, "B", "C", 'e'); compilerkit_FSM_add_transition (fsm, "C", "D", 'm'); compilerkit_FSM_add_transition (fsm, "D", "E", 'o'); compilerkit_FSM_add_transition (fsm, "E", "A", ' '); compilerkit_FSM_add_transition (fsm, "F", "G", 's'); compilerkit_FSM_add_transition (fsm, "G", "H", 'm'); compilerkit_FSM_add_transition (fsm, "H", "A", ' '); compilerkit_FSM_add_accepting_state (fsm, "E"); compilerkit_FSM_add_accepting_state (fsm, "H"); return fsm; } // Print out the states void print_states(CompilerKitFSM *fsm) { GList *list; printf ("states: "); list = compilerkit_FSM_get_states (fsm); while (list) { printf ((compilerkit_FSM_is_accepting_state(fsm, list->data) ? "(%s) " : "%s "), list->data); list = g_list_next(list); } printf ("\n"); g_list_free (list); } // Match a string. void match_string(CompilerKitFSM *fsm) { char *state; gchar buf[20]; gchar *str; printf ("Enter a string: "); scanf ("%20[^\n]s", buf); str = buf; state = compilerkit_FSM_get_start_state(fsm); while (*str) { printf ("%s %c\n", state, *str); state = compilerkit_FSM_get_next_state (fsm, state, *str); *str++; } printf ((compilerkit_FSM_is_accepting_state(fsm, state)) ? "Accepted!\n" : "Not accepted!\n"); } int main (int argc, char ** argv) { CompilerKitFSM* fsm; // Initialize GObject type system. // Allow us to query the types of an object. // Only needs to be called once, Test suite already calls it and is not necessary there. g_type_init(); fsm = state_machine(); print_states(fsm); match_string(fsm); g_object_unref (fsm); // Decreases the reference count by 1, if count becomes 0, then free memeory. }
/***********************************************\ GTL sample Copyright (c) 2003-2004, G-Truc Creation ************************************************* G-Truc Creation, www.g-truc.net par Groove, groove@g-truc.net ************************************************* particle_system.h, 06/10/2004 \***********************************************/ #ifndef PARTICLE_SYSTEM_H #define PARTICLE_SYSTEM_H #include "./particle_element.h" #include "./timer.h" #include "./window_sdl.h" #define PARTICLE_MAX 1024 #define PARTICLE_SIZE 16 #define PARTICLE_TIME 8.f class CParticleSystem { private: CParticleElement *m_pElements[PARTICLE_MAX]; gtl::CVector3<float> m_Position; CTimerSDL m_TimerCreate; float m_fTime; unsigned int m_uiTexture; int _FreeIndex () const; public: CParticleSystem (); ~CParticleSystem (); bool Load (const char* szTexture); void Update (); void Draw () const; }; #endif //PARTICLE_SYSTEM_H
/************************************************************************** ** ** Copyright (C) 2012-2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Installer Framework. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** **************************************************************************/ #ifndef ADDQTCREATORARRAYVALUEOPERATION_H #define ADDQTCREATORARRAYVALUEOPERATION_H #include "qinstallerglobal.h" namespace QInstaller { class AddQtCreatorArrayValueOperation : public Operation { public: AddQtCreatorArrayValueOperation(); void backup(); bool performOperation(); bool undoOperation(); bool testOperation(); Operation *clone() const; }; } // namespace QInstaller #endif // ADDQTCREATORARRAYVALUEOPERATION_H
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with ** the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H #define QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H #include <qaudioendpointselector.h> #include <QtCore/qstringlist.h> QT_USE_NAMESPACE class QGstreamerAudioInputEndpointSelector : public QAudioEndpointSelector { Q_OBJECT public: QGstreamerAudioInputEndpointSelector(QObject *parent); ~QGstreamerAudioInputEndpointSelector(); QList<QString> availableEndpoints() const; QString endpointDescription(const QString& name) const; QString defaultEndpoint() const; QString activeEndpoint() const; public Q_SLOTS: void setActiveEndpoint(const QString& name); private: void update(); void updateAlsaDevices(); void updateOssDevices(); void updatePulseDevices(); QString m_audioInput; QList<QString> m_names; QList<QString> m_descriptions; }; #endif // QGSTREAMERAUDIOINPUTENDPOINTSELECTOR_H
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2005-2006 Refractions Research Inc. * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * * Last port: geomgraph/PlanarGraph.java r428 (JTS-1.12+) * **********************************************************************/ #ifndef GEOS_GEOMGRAPH_PLANARGRAPH_H #define GEOS_GEOMGRAPH_PLANARGRAPH_H #include <geos/export.h> #include <map> #include <vector> #include <memory> #include <geos/geom/Coordinate.h> #include <geos/geomgraph/PlanarGraph.h> #include <geos/geomgraph/NodeMap.h> // for typedefs #include <geos/geomgraph/DirectedEdgeStar.h> // for inlines #include <geos/inline.h> // Forward declarations namespace geos { namespace geom { class Coordinate; } namespace geomgraph { class Edge; class Node; class EdgeEnd; class NodeFactory; } } namespace geos { namespace geomgraph { // geos.geomgraph /** * \brief * Represents a directed graph which is embeddable in a planar surface. * * The computation of the IntersectionMatrix relies on the use of a structure * called a "topology graph". The topology graph contains nodes and edges * corresponding to the nodes and line segments of a Geometry. Each * node and edge in the graph is labeled with its topological location * relative to the source geometry. * * Note that there is no requirement that points of self-intersection * be a vertex. * Thus to obtain a correct topology graph, Geometry objects must be * self-noded before constructing their graphs. * * Two fundamental operations are supported by topology graphs: * * - Computing the intersections between all the edges and nodes of * a single graph * - Computing the intersections between the edges and nodes of two * different graphs * */ class GEOS_DLL PlanarGraph { public: /** \brief * For nodes in the collection (first..last), * link the DirectedEdges at the node that are in the result. * * This allows clients to link only a subset of nodes in the graph, * for efficiency (because they know that only a subset is of * interest). */ template <typename It> static void linkResultDirectedEdges(It first, It last) // throw(TopologyException); { for ( ; first!=last; ++first ) { Node *node=*first; assert(node); EdgeEndStar* ees = node->getEdges(); assert(ees); DirectedEdgeStar* des = dynamic_cast<DirectedEdgeStar*>(ees); assert(des); // this might throw an exception des->linkResultDirectedEdges(); } } PlanarGraph(const NodeFactory &nodeFact); PlanarGraph(); virtual ~PlanarGraph(); virtual std::vector<Edge*>::iterator getEdgeIterator(); virtual std::vector<EdgeEnd*>* getEdgeEnds(); virtual bool isBoundaryNode(int geomIndex, const geom::Coordinate& coord); virtual void add(EdgeEnd *e); virtual NodeMap::iterator getNodeIterator(); virtual void getNodes(std::vector<Node*>&); virtual Node* addNode(Node *node); virtual Node* addNode(const geom::Coordinate& coord); /** \brief * @return the node if found; null otherwise */ virtual Node* find(geom::Coordinate& coord); /** \brief * Add a set of edges to the graph. For each edge two DirectedEdges * will be created. DirectedEdges are NOT linked by this method. */ virtual void addEdges(const std::vector<Edge*> &edgesToAdd); virtual void linkResultDirectedEdges(); virtual void linkAllDirectedEdges(); /** \brief * Returns the EdgeEnd which has edge e as its base edge * (MD 18 Feb 2002 - this should return a pair of edges) * * @return the edge, if found * <code>null</code> if the edge was not found */ virtual EdgeEnd* findEdgeEnd(Edge *e); /** \brief * Returns the edge whose first two coordinates are p0 and p1 * * @return the edge, if found * <code>null</code> if the edge was not found */ virtual Edge* findEdge(const geom::Coordinate& p0, const geom::Coordinate& p1); /** \brief * Returns the edge which starts at p0 and whose first segment is * parallel to p1 * * @return the edge, if found * <code>null</code> if the edge was not found */ virtual Edge* findEdgeInSameDirection(const geom::Coordinate& p0, const geom::Coordinate& p1); virtual std::string printEdges(); virtual NodeMap* getNodeMap(); protected: std::vector<Edge*> *edges; NodeMap *nodes; std::vector<EdgeEnd*> *edgeEndList; virtual void insertEdge(Edge *e); private: /** \brief * The coordinate pairs match if they define line segments * lying in the same direction. * * E.g. the segments are parallel and in the same quadrant * (as opposed to parallel and opposite!). */ bool matchInSameDirection(const geom::Coordinate& p0, const geom::Coordinate& p1, const geom::Coordinate& ep0, const geom::Coordinate& ep1); }; } // namespace geos.geomgraph } // namespace geos //#ifdef GEOS_INLINE //# include "geos/geomgraph/PlanarGraph.inl" //#endif #endif // ifndef GEOS_GEOMGRAPH_PLANARGRAPH_H
/* LJKit: an Objective-C implementation of the LiveJournal client protocol Copyright (C) 2002-2003 Benjamin Peter Ragheb 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 You may contact the author via email at benzado@livejournal.com. */ #import <Cocoa/Cocoa.h> #ifndef __private_extern #define __private_extern __attribute__((visibility("hidden"))) #endif /*! * Returns the MD5 digest of the given NSString object as a hex * encoded string. Uses the crypto library distributed with OS X. */ __private_extern NSString *MD5HexDigest(NSString *string); /*! * Converts a hexadecimal digit character to its value. * This function is case insensitive and returns 0x10 if the hex * digit is invalid. */ __private_extern char ValueForHexDigit(char digit); /*! * Creates an NSColor object represented by a given HTML color code. * (e.g., "#FFCC00") */ __private_extern NSColor *ColorForHTMLCode(NSString *code); /*! * Returns the HTML color code which represents the given NSColor object. * Assumes the NSColor is an RGB color. */ __private_extern NSString *HTMLCodeForColor(NSColor *color);
#ifndef _STDDEF_H #define _STDDEF_H typedef __SIZE_TYPE__ size_t; typedef __PTRDIFF_TYPE__ ssize_t; typedef __WCHAR_TYPE__ wchar_t; typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __PTRDIFF_TYPE__ intptr_t; typedef __SIZE_TYPE__ uintptr_t; #ifndef __int8_t_defined #define __int8_t_defined 1 typedef signed char int8_t; typedef signed short int int16_t; typedef signed int int32_t; typedef signed long long int int64_t; typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; #endif typedef unsigned int wint_t; #define NULL ((void *)0) #define offsetof(type, field) ((size_t)&((type *)0)->field) /* XXX: support TLS? */ #define __thread void *alloca(size_t size); #endif
/* * This file is part of crash-reporter * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Ville Ilvonen <ville.p.ilvonen@nokia.com> * Author: Raimo Gratseff <ext-raimo.gratseff@nokia.com> * * This program 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 program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef UT_CREPORTERAUTOUPLOADER_H #define UT_CREPORTERAUTOUPLOADER_H #include <QTest> class CReporterAutoUploader; // CReporterUploadItem mock class. class CReporterUploadItem : public QObject { Q_OBJECT public: CReporterUploadItem(const QString &file); ~CReporterUploadItem(); }; // CReporterUploadQueue mock class. class CReporterUploadQueue : public QObject { Q_OBJECT public: CReporterUploadQueue(QObject *parent = 0); ~CReporterUploadQueue(); void enqueue(CReporterUploadItem *item); }; // CReporterUploadEngine mock class. class CReporterUploadEngine : public QObject { Q_OBJECT public: typedef enum { //! No error. NoError = 0, //! Indicates errors occured on HTTP/ SSL protocol levels. ProtocolError, //! Error occured, when trying to establish internet connection. ConnectionNotAvailable, //! Internet connection was closed due to network disconnected. ConnectionClosed, } ErrorType; CReporterUploadEngine(CReporterUploadQueue *queue, QObject *parent = 0); ~CReporterUploadEngine(); QString lastError() const; Q_SIGNALS: void finished(int error, int sent, int total); public Q_SLOTS: void cancelAll(); }; // Unit test class. class Ut_CReporterAutoUploader : public QObject { Q_OBJECT private Q_SLOTS: void initTestCase(); void init(); void testUploadFiles(); void testUploadFilesInvalid(); void testUploadFilesAgain(); void testQuit(); void cleanup(); void cleanupTestCase(); private: CReporterAutoUploader *m_Subject; }; #endif // UT_CREPORTERAUTOUPLOADER_H
#ifndef __ADPCM_H__ #define __ADPCM_H__ #include "SoundDev.h" struct ADPCMVOICE { TCHAR name[32]; //program name UINT32 staddr; //Start address (bit unit) UINT32 length; //length (bit unit) UINT32 loopstart; //offset from start UINT32 loopend; //offset from start }; class CAdPcmBase : public CSoundDevice { protected: ADPCMVOICE adpcmvoice[128]; size_t maxmem; size_t usedmem; size_t boundary; UINT32 fmaster; UINT8 parentdev; UINT8 fcode; virtual void UpdateVolExp(UINT8 ch) {}; virtual void UpdateVoice(UINT8 ch) {}; virtual void UpdateFreq(UINT8 ch, const FNUM* fnum) {}; virtual void UpdatePanpot(UINT8 ch) {}; virtual void UpdateSustain(UINT8 ch) {}; virtual void UpdateKey(UINT8 ch, UINT8 keyon) {}; virtual void UpdateTL(UINT8 ch, UINT8 op, UINT8 lev) {}; public: CAdPcmBase(CPort* pt, int fsamp, int devide, int offset, size_t memsize, size_t maxch, UINT8 pardev); virtual UINT8 GetParentDev() { return parentdev; }; virtual void LoadVoice(int prog, UINT8* data, size_t length) = 0; virtual void TimerCallBack(UINT32 tick) {}; }; class CYmDelta : public CAdPcmBase //YAMAHA DeltaN ADPCM { protected: virtual ISoundDevice::FNUM GetFnumber(UINT8 ch, SINT16 offset); virtual void UpdateVolExp(UINT8 ch); virtual void UpdateFreq(UINT8 ch, const FNUM* fnum); virtual void UpdateKey(UINT8 ch, UINT8 keyon); virtual void UpdateVoice(UINT8 ch); virtual void UpdatePanpot(UINT8 ch); virtual void PlayPCM(UINT8 ch, UINT8 num, UINT8 volume, SINT8 pan, SINT32 offset); virtual void StopPCM(UINT8 ch, UINT8 num); virtual UINT16 GetDeltaN(int off); UINT8 chena; // L/R struct REGMAP { //ƒŒƒWƒXƒ^ƒAƒhƒŒƒX UINT8 control1; UINT8 control2; UINT8 startLSB; UINT8 startMSB; UINT8 endLSB; UINT8 endMSB; UINT8 limitLSB; UINT8 limitMSB; UINT8 memory; UINT8 deltanLSB; UINT8 deltanMSB; UINT8 volume; UINT8 flag; UINT8 ctrl1init; UINT8 ctrl2init; UINT8 panmask; }; REGMAP regmap; public: CYmDelta(CPort* pt, int fsamp, int devide, UINT32 memsize, UINT8 pardev, const REGMAP& regset); virtual UINT8 QueryCh(CMidiCh* parent, FMVOICE* voice, int mode) { return 0; }; virtual void LoadVoice(int prog, UINT8* data, size_t length); virtual void RhythmOn(UINT8 num, UINT8 vel, SINT8 pan, FMVOICE* rv, FNUM* fnum); virtual void RhythmOff(UINT8 num); }; class CAdPcm3801 : public CYmDelta //Y8950 { protected: public: CAdPcm3801(CPort* pt, int fsamp, UINT32 memsize); }; class CAdPcm2608 : public CYmDelta //YM2608 { protected: public: CAdPcm2608(CPort* pt, int fsamp, UINT32 memsize); }; #if 0 class CAdPcm2610A : public CAdPcmBase //YM2610(B) { }; class CAdPcm2610B : public CAdPcmBase //YM2610(B) { }; class CAdPcm263 : public CAdPcmBase //YMZ263 { }; class CAdPcm705 : public CAdPcmBase //YMZ705 { }; #endif class CAdPcmZ280 : public CAdPcmBase //YAMAHA PCM8 ADPCM { protected: virtual ISoundDevice::FNUM GetFnumber(UINT8 ch, SINT16 offset); virtual void UpdateVolExp(UINT8 ch); virtual void UpdateFreq(UINT8 ch, const FNUM* fnum); virtual void UpdateKey(UINT8 ch, UINT8 keyon); virtual void UpdateVoice(UINT8 ch); virtual void UpdatePanpot(UINT8 ch); virtual UINT16 GetDeltaN(int off); public: CAdPcmZ280(CPort* pt, int fsamp, UINT32 memsize); virtual UINT8 QueryCh(CMidiCh* parent, FMVOICE* voice, int mode) { return 0; }; virtual void LoadVoice(int prog, UINT8* data, size_t length); }; #endif
/** * @file * @ingroup Display */ #ifndef RB_FRAME_LIST_H #define RB_FRAME_LIST_H #include <vector> #include "BaconBox/Display/FrameDetails.h" namespace BaconBox { /** * Array of frame details. * @ingroup Display */ typedef std::vector<FrameDetails> FrameArray; } #endif
#ifndef EDITORBEHAVIOURMANAGER_H #define EDITORBEHAVIOURMANAGER_H #include <queue> #include <vector> #include "Bang/Array.h" #include "Bang/Array.tcc" #include "Bang/BangDefines.h" #include "Bang/BehaviourManager.h" #include "Bang/BinType.h" #include "Bang/Compiler.h" #include "Bang/EventEmitter.tcc" #include "Bang/EventListener.h" #include "Bang/FileTracker.h" #include "Bang/IEventsFileTracker.h" #include "Bang/Map.h" #include "Bang/Mutex.h" #include "Bang/Path.h" #include "Bang/String.h" #include "Bang/Thread.h" #include "Bang/ThreadPool.h" #include "Bang/USet.h" #include "BangEditor/BangEditor.h" namespace Bang { class Behaviour; class Library; class IEventsFileTracker; } // namespace Bang using namespace Bang; namespace BangEditor { class EditorBehaviourManager : public BehaviourManager, public EventListener<IEventsFileTracker> { public: EditorBehaviourManager(); virtual ~EditorBehaviourManager() override; void Update() override; void WaitForAsyncCompileJobs(); bool PrepareBehavioursLibrary(); bool IsCompiled(const Path &behaviourFilepath) const; bool IsCompiledWithError(const Path &behaviourFilepath) const; bool IsCompiledSuccessfully(const Path &behaviourFilepath) const; bool IsBeingCompiled(const Path &behaviourFilepath) const; bool AreAllBehavioursCompiled() const; bool IsSomeBehaviourBeingCompiled() const; bool AreAllBehavioursCompiledSuccessfully() const; bool IsBehavioursLibraryReady() const; static Behaviour *CreateBehaviourInstance(const String &behaviourName); static bool DeleteBehaviourInstance(const String &behaviourName, Behaviour *behaviour); virtual bool IsInstanceCreationAllowed() const override; static EditorBehaviourManager *GetActive(); private: ThreadPool m_compileThreadPool; USet<Path> m_compiledBehaviours; USet<Path> m_modifiedBehaviourPaths; USet<Path> m_behavioursBeingCompiled; USet<Path> m_successfullyCompiledBehaviours; mutable Mutex m_mutex; std::queue<Compiler::Result> m_compileResults; Compiler::Result CompileBehaviourObject(const Path &behaviourPath); Compiler::Result CompileBehaviourObject(const Path &behaviourFilepath, const Path &outputObjectFilepath, BinType binaryType); void CompileBehaviourObjectAsync(const Path &behaviourPath); void CompileAllProjectBehaviours(); void MergeIntoBehavioursLibrary(); static Compiler::Result MergeBehaviourObjects( const Array<Path> &behaviourObjectPaths, const Path &outputLibFilepath, BinType binaryType); static Array<Path> GetCompiledObjectsPaths(); static Array<Path> GetBehaviourSourcesPaths(); static Compiler::Job CreateBaseCompileJob(BinType binaryType, bool addLibs); static Path GetObjectOutputPath(const Path &inputBehaviourPath); static Compiler::Job CreateCompileBehaviourJob( const Path &behaviourFilepath, const Path &outputObjectFilepath, BinType binaryType); static void RemoveBehaviourLibrariesOf(const String &behaviourName); static void RemoveOrphanBehaviourLibrariesAndObjects(); Mutex *GetMutex() const; class BehaviourCompileRunnable : public ThreadRunnable { public: EditorBehaviourManager *m_behaviourManager = nullptr; Path m_behaviourPath = Path::Empty(); void Run() override; }; // IEventsFileTracker void OnPathAdded(const Path &path) override; void OnPathModified(const Path &path) override; void OnPathRemoved(const Path &path) override; friend class GameBuilder; friend class BehaviourCompileRunnable; }; } // namespace BangEditor #endif // EDITORBEHAVIOURMANAGER_H
/* Copyright (C) 2017 Michael A. Hicks Distributed under the terms of the GNU Lesser General Public License. This file is part of Simulacrum. Simulacrum 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. Simulacrum 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 Simulacrum. If not, see <http://www.gnu.org/licenses/>. */ /* A simple example of the Simulacrum Plugin framework */ #include <QLabel> #include <Toolbox/SPlugins/splugins.h> #include <Core/salgorithm.h> #include <GUI/viewPort.h> namespace Simulacrum { class SIMU_API ATestAlgorithmPlugin : public SAlgorithmCPU { public: ATestAlgorithmPlugin(); virtual ~ATestAlgorithmPlugin(); virtual void init (); virtual void kernel (SSpaceIterator *beginc, SSpaceIterator *endc); virtual SAlgorithm* New (); }; class SIMU_API ATestQTWidget : public QLabel { public: explicit ATestQTWidget(QWidget* parent = 0, Qt::WindowFlags f = 0); virtual ~ATestQTWidget(); }; class SIMU_API ATestVPTool : public SViewPortTool { public: ATestVPTool(QObject* parent = 0); virtual ~ATestVPTool(); public slots: virtual void leftClicked (SViewPort&, int x, int y); }; }
/* radare - LGPL3 - 2016-2017 - xarkes */ #include "swf.h" #include "swfdis.h" #include "swf_op_names.h" char* get_swf_file_type(char compression, char flashVersion) { char* type = NULL; switch (compression) { case ISWF_MAGIC_0_0: type = r_str_newf (SWF_FILE_TYPE, flashVersion, SWF_FILE_TYPE_SWF); break; case ISWF_MAGIC_0_1: if (flashVersion < 6) { type = r_str_newf (SWF_FILE_TYPE, flashVersion, SWF_FILE_TYPE_ERROR); } else { type = r_str_newf (SWF_FILE_TYPE, flashVersion, SWF_FILE_TYPE_ZLIB); } break; case ISWF_MAGIC_0_2: if (flashVersion < 13) { type = r_str_newf (SWF_FILE_TYPE, flashVersion, SWF_FILE_TYPE_ERROR); } else { type = r_str_newf (SWF_FILE_TYPE, flashVersion, SWF_FILE_TYPE_LZMA); } break; default: type = r_str_newf (SWF_FILE_TYPE, flashVersion, ""); break; } return type; } swf_hdr r_bin_swf_get_header(RBinFile *arch) { swf_hdr header = {{0}}; ut8 nBits = 0; /* First, get the rect size */ r_buf_read_at (arch->buf, 8, (ut8*)&nBits, 1); nBits = (nBits & 0xf8) >> 3; ut32 rect_size_bits = nBits*4 + 5; ut32 rect_size_bytes = rect_size_bits / 8; if (rect_size_bits % 8) { rect_size_bytes++; } /* Read the whole header */ r_buf_read_at (arch->buf, 0, (ut8*)&header, R_MIN (8, sizeof (header))); header.rect_size = rect_size_bytes; /* TODO: Record rectangle with xmin xmax ymin ymax if needed */ // Do this better (swf reverts values) r_buf_read_at (arch->buf, 8+rect_size_bytes, (ut8*)&header.frame_rate+1, 1); r_buf_read_at (arch->buf, 8+rect_size_bytes+1, (ut8*)&header.frame_rate, 1); r_buf_read_at (arch->buf, 8+rect_size_bytes+2, (ut8*)&header.frame_count+1, 1); r_buf_read_at (arch->buf, 8+rect_size_bytes+3, (ut8*)&header.frame_count, 1); return header; } /* http://www.homer.com.au/webdoc/flash_file_format_specification.pdf */ int r_bin_swf_get_sections(RList *list, RBinFile *arch) { swf_hdr header = r_bin_swf_get_header (arch); if (header.signature[0] == ISWF_MAGIC_0_1) { // CWS file compression is not supported ! // 2 sections in this case : header and zlib data // TODO: Decompress zlib data /* Header section */ RBinSection *head_sect; if (!(head_sect = R_NEW0 (RBinSection))) { return false; } head_sect->name = strdup ("Header"); head_sect->paddr = 0; head_sect->vaddr = 0; ut8 start = 0x8; // signature + version + size head_sect->size = start; head_sect->vsize = start; head_sect->perm = R_PERM_R; r_list_append (list, head_sect); /* ZlibData section */ RBinSection *data; if (!(data = R_NEW0 (RBinSection))) return false; data->name = strdup ("ZlibData"); data->paddr = start; data->vaddr = start; data->size = r_buf_size(arch->buf) - start; data->vsize = r_buf_size(arch->buf) - start; data->perm = R_PERM_R; r_list_append (list, data); } else if (header.signature[0] == ISWF_MAGIC_0_2) { // ZWS file compression is not supported ! // 2 sections in this case : header and Lzma data // TODO: Decompress lzma data /* Header section */ RBinSection *head_sect; if (!(head_sect = R_NEW0 (RBinSection))) { return false; } head_sect->name = strdup ("Header"); head_sect->paddr = 0; head_sect->vaddr = 0; ut8 start = 0x8; // signature + version + size head_sect->size = start; head_sect->vsize = start; head_sect->perm = R_PERM_R; r_list_append (list, head_sect); /* LzmaData section */ RBinSection *data = R_NEW0 (RBinSection); if (!data) { return false; } data->name = strdup ("LzmaData"); data->paddr = start; data->vaddr = start; data->size = r_buf_size(arch->buf) - start; data->vsize = r_buf_size(arch->buf) - start; data->perm = R_PERM_R; r_list_append (list, data); } else { /* Header section */ RBinSection *head_sect; if (!(head_sect = R_NEW0 (RBinSection))) { return false; } head_sect->name = strdup ("Header"); head_sect->paddr = 0; head_sect->vaddr = 0; ut32 start = header.rect_size + SWF_HDR_MIN_SIZE; // rect + min_size head_sect->size = start; head_sect->vsize = start; head_sect->perm = R_PERM_R; r_list_append (list, head_sect); /* Other sections */ ut16 tagCodeAndLength = 0; ut16 tagCode = 0; ut8 tagLengthShort = 0; ut32 end = start; ut32 tagLengthLong; int section = 0; r_buf_read_at (arch->buf, start, (ut8*)&tagCodeAndLength, 2); while (tagCodeAndLength != 0) { start = end; tagLengthLong = 0; tagCode = tagCodeAndLength >> 6; //10 higher bytes is code tagLengthShort = tagCodeAndLength & 0x3f; //6 lowers bytes is length if (tagLengthShort >= 0x3F) { r_buf_read_at (arch->buf, start+2, (ut8*)&tagLengthLong, 4); end = start + 6 + tagLengthLong; } else { end = start + 2 + tagLengthShort; } RBinSection *new = R_NEW0 (RBinSection); if (!new) { return false; } swf_tag_t tag = r_asm_swf_gettag (tagCode); new->name = strdup (tag.name); new->paddr = start; new->vaddr = start; new->size = end - start; new->vsize = end - start; switch (tagCode) { case TAG_DOACTION: case TAG_DOINITACTION: new->perm = R_PERM_RX; new->has_strings = true; break; default: new->perm = R_PERM_R; break; } r_list_append (list, new); /* Read next tag info */ r_buf_read_at (arch->buf, end, (ut8*)&tagCodeAndLength, 2); section++; } } return true; }
// Created file "Lib\src\Uuid\propkeys" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_GPS_Speed, 0xda5d0862, 0x6e76, 0x4e1b, 0xba, 0xbd, 0x70, 0x02, 0x1b, 0xd2, 0x54, 0x94);
/* This file is part of ArXLib, a C++ ArX Primitives Library. * * Copyright (C) 2008-2010 Alexander Fokin <apfokin@gmail.com> * * ArXLib 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. * * ArXLib 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 ArXLib. If not, see <http://www.gnu.org/licenses/>. * * $Id$ */ #ifndef ARX_XML_ERROR_H #define ARX_XML_ERROR_H #include <arx/config.h> namespace arx { namespace xml { /** * Error severity. */ enum ErrorSeverity { ERROR, WARNING }; /** * Base class for all xml errors. */ struct error {}; /** * Node not found error. */ template<class String> struct node_not_found: error { node_not_found(const String &path): path(path) {} const String &path; }; template<class String> node_not_found<String> create_node_not_found(const String &path) { return node_not_found<String>(path); } /** * Invalid value error. */ template<class String> struct invalid_value: error { invalid_value(const String &value): value(value) {} const String &value; }; template<class String> invalid_value<String> create_invalid_value(const String &value) { return invalid_value<String>(value); } /** * Typed invalid value error. */ template<class T, class String> struct invalid_value_for_type: invalid_value<String> { invalid_value_for_type(const String &value): invalid_value<String>(value) {}; typedef T type; }; template<class T, class String> invalid_value_for_type<T, String> create_invalid_value_for_type(const String &value) { return invalid_value_for_type<T, String>(value); } /** * Invalid name error. */ template<class String> struct invalid_name: error { invalid_name(const String &name): name(name) {} String name; }; template<class String> invalid_name<String> create_invalid_name(const String &name) { return invalid_name<String>(name); } /** * Invalid name error for the case when desired name is known. */ template<class String> struct invalid_desired_name: invalid_name<String> { invalid_desired_name(const String &name, const String &desiredName): invalid_name<String>(name), desiredName(desiredName) {} String desiredName; }; template<class String> invalid_desired_name<String> create_invalid_desired_name(const String &name, const String &desiredName) { return invalid_desired_name<String>(name, desiredName); } }} // namespace arx::xml #endif // ARX_XML_ERROR_H
/* ``The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved via the world wide web at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Initial Developer of the Original Code is Ericsson Utvecklings AB. * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings * AB. All Rights Reserved.'' * * $Id$ */ #include "eidef.h" #include "eiext.h" #include "putget.h" /* remove version identifier from the start of the buffer */ int ei_decode_version(const char *buf, int *index, int *version) { const char *s = buf + *index; const char *s0 = s; int v; v = get8(s); if (version) *version = v; if (v != ERL_VERSION_MAGIC) return -1; *index += s-s0; return 0; }
#include <math.h> #include <stdio.h> #include <stdlib.h> static const double PI = 3.14159265359; #pragma xmp nodes p[*] #pragma xmp template t[100] #pragma xmp distribute t[block] onto p int main(){ double a0[100], b0[100], c0[100]; #pragma xmp align a0[i] with t[i] #pragma xmp align b0[i] with t[i] #pragma xmp align c0[i] with t[i] double a[100], b[100], c[100]; #pragma xmp align a[i] with t[i] #pragma xmp align b[i] with t[i] #pragma xmp align c[i] with t[i] int result = 0; #pragma xmp loop on t[i] for (int i = 0; i < 100; i++){ a0[i] = i * (2 * PI / 100); b0[i] = i * (2 * PI / 100); a[i] = i * (2 * PI / 100); b[i] = i * (2 * PI / 100); } #pragma xmp loop on t[i] for (int i = 0; i < 100; i++){ c0[i] = sin(a0[i] + b0[i]); } #pragma xmp array on t[:] c[:] = sin(b[:] + b[:]); #pragma xmp loop on t[i] for (int i = 0; i < 100; i++){ if (c0[i] != c[i]) result = -1; } #pragma xmp reduction(+:result) #pragma xmp task on p[0] { if (result == 0){ printf("PASS\n"); } else{ printf("ERROR\n"); exit(1); } } return 0; }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_GETSKILLGROUPRESPONSE_P_H #define QTAWS_GETSKILLGROUPRESPONSE_P_H #include "alexaforbusinessresponse_p.h" namespace QtAws { namespace AlexaForBusiness { class GetSkillGroupResponse; class GetSkillGroupResponsePrivate : public AlexaForBusinessResponsePrivate { public: explicit GetSkillGroupResponsePrivate(GetSkillGroupResponse * const q); void parseGetSkillGroupResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(GetSkillGroupResponse) Q_DISABLE_COPY(GetSkillGroupResponsePrivate) }; } // namespace AlexaForBusiness } // 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_DESCRIBEOPERATINGSYSTEMSRESPONSE_P_H #define QTAWS_DESCRIBEOPERATINGSYSTEMSRESPONSE_P_H #include "opsworksresponse_p.h" namespace QtAws { namespace OpsWorks { class DescribeOperatingSystemsResponse; class DescribeOperatingSystemsResponsePrivate : public OpsWorksResponsePrivate { public: explicit DescribeOperatingSystemsResponsePrivate(DescribeOperatingSystemsResponse * const q); void parseDescribeOperatingSystemsResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(DescribeOperatingSystemsResponse) Q_DISABLE_COPY(DescribeOperatingSystemsResponsePrivate) }; } // namespace OpsWorks } // 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_UPDATEDOMAINNAMEREQUEST_P_H #define QTAWS_UPDATEDOMAINNAMEREQUEST_P_H #include "apigatewayrequest_p.h" #include "updatedomainnamerequest.h" namespace QtAws { namespace APIGateway { class UpdateDomainNameRequest; class UpdateDomainNameRequestPrivate : public APIGatewayRequestPrivate { public: UpdateDomainNameRequestPrivate(const APIGatewayRequest::Action action, UpdateDomainNameRequest * const q); UpdateDomainNameRequestPrivate(const UpdateDomainNameRequestPrivate &other, UpdateDomainNameRequest * const q); private: Q_DECLARE_PUBLIC(UpdateDomainNameRequest) }; } // namespace APIGateway } // namespace QtAws #endif
#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <termios.h> #include "serial.h" #define COM_PATH "/dev/ttyS1" /** * [copy_from_old description] * @Author: Krylin * @DateTime 2016-12-18T21:13:32+080 * @param fd the opened com num * @param new_config the pointer of new_config * @param old_config the pointer of old_config */ int main(int argc, char const *argv[]) { int pid; //the pid of process int len; //the length of buf char cmd_byte; char com_write_buf[64]; char com_read_buf[64]; struct termios new_config, old_config; int sfd = open_com(COM_PATH); memset(com_write_buf, 0, sizeof(com_write_buf)); memset(com_read_buf, 0, sizeof(com_read_buf)); copy_from_old(sfd, &new_config, &old_config); //copy the old setting if (0 != set_com_config(sfd, &new_config)){ //set config perror("com config error!"); exit(-1); } #if 0 for (size_t i = 0; i < 10; i++) { //com_read read(fd, read_duf, sizeof(read_duf)); printf("%s\n", read_duf); /* code */ } #endif #if 0 if (argc > 1) { //com_write_str strcpy(com_write_buf, argv[1]); strcat(com_write_buf, "\n\r"); }else if (1 == argc) { gets(com_write_buf); // scanf("%s", com_write_buf); strcat(com_write_buf, "\n\r"); } write(fd, com_write_buf, sizeof(com_write_buf)); // strtol() while (1) { send_byte_com(sfd, 0x55); sleep(1); send_byte_com(sfd, 0x66); sleep(1); } #endif if (( pid = fork()) < 0) { perror("fork function error!"); return 0; } if (pid == 0 ) { //子进程 while(1) { bzero(com_read_buf, sizeof(com_read_buf)); read(sfd, com_read_buf, sizeof(com_read_buf)); printf("%s\n", com_read_buf); } } else { //父进程 while(1) { // bzero(com_write_buf,sizeof(com_write_buf)); // read(STDIN_FILENO, com_write_buf, sizeof(com_write_buf)); //键盘输入发送信息 // len = strlen(com_write_buf); // com_write_buf[len] = '\n'; //换行 // // if(write(sfd, com_write_buf, sizeof(com_write_buf)) <= 0) // printf("write error!\n"); read(STDIN_FILENO, com_write_buf, sizeof(com_write_buf)); //键盘输入发送信息 cmd_byte = strtol(com_write_buf, NULL, 16); send_byte_com(sfd, cmd_byte); } } if (0 != set_com_config(sfd, &old_config)){ //set config perror("com restore error!"); exit(-1); } close(sfd); return 0; }
/* This file is part of GEGL * * GEGL 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. * * GEGL 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 GEGL; if not, see <https://www.gnu.org/licenses/>. * * Copyright 2003-2018 GEGL contributors. */ #ifndef __GEGL_UTILS_H__ #define __GEGL_UTILS_H__ G_BEGIN_DECLS typedef enum GeglSerializeFlag { GEGL_SERIALIZE_TRIM_DEFAULTS = (1<<0), GEGL_SERIALIZE_VERSION = (1<<1), GEGL_SERIALIZE_INDENT = (1<<2), GEGL_SERIALIZE_BAKE_ANIM = (1<<3), } GeglSerializeFlag; /** * gegl_create_chain_argv: * @ops: an argv style, NULL terminated array of arguments * @op_start: node to pass in as input of chain * @op_end: node to get processed data * @time: the time to use for interpolatino of keyframed values * @rel_dim: relative dimension to scale rel suffixed values by * @path_root: path in filesystem to use as relative root * @error: error for signalling parsing errors * * Create a node chain from argv style list of op data. */ void gegl_create_chain_argv (char **ops, GeglNode *op_start, GeglNode *op_end, double time, int rel_dim, const char *path_root, GError **error); /** * gegl_create_chain: * @ops: an argv style, NULL terminated array of arguments * @op_start: node to pass in as input of chain * @op_end: node to get processed data * @time: the time to use for interpolatino of keyframed values * @rel_dim: relative dimension to scale rel suffixed values by * @path_root: path in filesystem to use as relative root * @error: error for signalling parsing errors * * Create a node chain from an unparsed commandline string. */ void gegl_create_chain (const char *ops, GeglNode *op_start, GeglNode *op_end, double time, int rel_dim, const char *path_root, GError **error); /** * gegl_serialize: * @start: first node in chain to serialize * @end: last node in chain to serialize * @basepath: top-level absolute path to turn into relative root * @serialize_flags: anded together combination of: * GEGL_SERIALIZE_TRIM_DEFAULTS, GEGL_SERIALIZE_VERSION, GEGL_SERIALIZE_INDENT. */ gchar *gegl_serialize (GeglNode *start, GeglNode *end, const char *basepath, GeglSerializeFlag serialize_flags); /* gegl_node_new_from_serialized: * @chaindata: string of chain serialized to parse. * @path_root: absolute file system root to use as root for relative paths. * * create a composition from chain serialization, creating end-points for * chain as/if needed. */ GeglNode *gegl_node_new_from_serialized (const gchar *chaindata, const gchar *path_root); /** * gegl_node_set_time: * @node: a a GeglNode * @time: the time to set the properties which have keyfraes attached to * * Sets the right value in animated properties of this node and all its * dependendcies to be the specified time position. */ void gegl_node_set_time (GeglNode *node, double time); /** * gegl_buffer_set_color: * @buffer: a #GeglBuffer * @rect: a rectangular region to fill with a color. * @color: the GeglColor to fill with. * * Sets the region covered by rect to the specified color. */ void gegl_buffer_set_color (GeglBuffer *buffer, const GeglRectangle *rect, GeglColor *color); const Babl *gegl_babl_variant (const Babl *format, GeglBablVariant variant); G_END_DECLS #endif /* __GEGL_UTILS_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_CREATEDISTRIBUTIONWITHTAGSRESPONSE_H #define QTAWS_CREATEDISTRIBUTIONWITHTAGSRESPONSE_H #include "cloudfrontresponse.h" #include "createdistributionwithtagsrequest.h" namespace QtAws { namespace CloudFront { class CreateDistributionWithTagsResponsePrivate; class QTAWSCLOUDFRONT_EXPORT CreateDistributionWithTagsResponse : public CloudFrontResponse { Q_OBJECT public: CreateDistributionWithTagsResponse(const CreateDistributionWithTagsRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const CreateDistributionWithTagsRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(CreateDistributionWithTagsResponse) Q_DISABLE_COPY(CreateDistributionWithTagsResponse) }; } // namespace CloudFront } // namespace QtAws #endif
/* * heap.h * * Copyright (c) 2008-2010 CSIRO, Delft University of Technology. * * This file is part of Darjeeling. * * Darjeeling 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. * * Darjeeling 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 Darjeeling. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __heap_h #define __heap_h #include "types.h" #define SAFE_POINTER_POOL_SIZE 32 #define SAFE_REFERENCE_POOL_SIZE 4 /** * Heap chunk types. Darjeeling keeps a heap where Java objects and non-Java objects are mixed on the same heap. * This enumeration indicates the types of built-in objects. */ // CHUNKID_FREE acts as a marker. Everything above CHUNKID_FREE is a built-in object and is never garbage collected // Please don't change the order of things here enum chunk_id { CHUNKID_FREE=0, CHUNKID_INVALID=1, CHUNKID_MONITOR_BLOCK=2, CHUNKID_VM=3, CHUNKID_FRAME=4, CHUNKID_THREAD=5, CHUNKID_MANAGED_START=6, CHUNKID_INFUSION=6, CHUNKID_REFARRAY=7, CHUNKID_INTARRAY=8, CHUNKID_JAVA_START=9 }; typedef struct _heap_chunk heap_chunk; /** * */ enum { TCM_WHITE = 0, TCM_GRAY = 1, TCM_BLACK = 2, }; // in front of every memory location allocated on the heap, one // heap chunk struct will be place // thus the sizeof(heap_chunk) needs to be 32bit aligned on cortex-m systems struct _heap_chunk { uint16_t size; uint16_t shift; uint8_t color; uint8_t id; #ifdef ALIGN_32 uint8_t PADDING[2]; #endif } #ifdef PACK_STRUCTS __attribute__ ((__packed__)) #endif ; void dj_mem_init(void *mem_pointer, uint16_t mem_size); void * dj_mem_alloc(uint16_t size, runtime_id_t id); void dj_mem_free(void *ptr); void dj_mem_setPanicExceptionObject(dj_object *obj); dj_object * dj_mem_getPanicExceptionObject(); void dj_mem_addSafePointer(void ** ptr); void dj_mem_removeSafePointer(void ** ptr); void dj_mem_addSafeReference(ref_t * ref); void dj_mem_removeSafeReference(ref_t * ref); int dj_mem_countChunks(runtime_id_t id); void dj_mem_gc(); void * dj_mem_getPointer(); void dj_mem_shiftRuntimeIDs(runtime_id_t start, uint16_t range); uint16_t dj_mem_getFree(); uint16_t dj_mem_getSize(); #ifdef DARJEELING_DEBUG void dj_mem_dump(); #endif #ifdef DARJEELING_DEBUG_CHECK_HEAP_SANITY void dj_check_sanity(); #endif static inline void * dj_mem_getData(heap_chunk * chunk) { return (void*)((size_t)(chunk) + sizeof(heap_chunk)); } static inline runtime_id_t dj_mem_getChunkId(void *ptr) { return ((heap_chunk*)((size_t)ptr-sizeof(heap_chunk)))->id; } static inline void dj_mem_setChunkId(void *ptr, uint8_t id) { ((heap_chunk*)((size_t)ptr-sizeof(heap_chunk)))->id = id; } static inline uint16_t dj_mem_getChunkSize(void *ptr) { return ((heap_chunk*)((size_t)ptr-sizeof(heap_chunk)))->size; } static inline uint16_t dj_mem_getChunkShift(void *ptr) { return ((heap_chunk*)((size_t)ptr-sizeof(heap_chunk)))->shift; } static inline void * dj_mem_getUpdatedPointer(void * ptr) { return (ptr==0)? 0 : (void*)((size_t)ptr - dj_mem_getChunkShift(ptr)); } static inline ref_t dj_mem_getUpdatedReference(ref_t ref) { return (ref==0)?0:(ref - dj_mem_getChunkShift(REF_TO_VOIDP(ref))); } static inline void dj_mem_setChunkColor(void *ptr, int color) { ((heap_chunk*)((size_t)ptr - sizeof(heap_chunk)))->color = color; } static inline int dj_mem_getChunkColor(void *ptr) { return ((heap_chunk*)((size_t)ptr - sizeof(heap_chunk)))->color; } static inline void dj_mem_setRefGrayIfWhite(ref_t ref) { if (ref==nullref) return; heap_chunk * chunk = ((heap_chunk*)((size_t)REF_TO_VOIDP(ref) - sizeof(heap_chunk))); if (chunk->color==TCM_WHITE) chunk->color=TCM_GRAY; } static inline void dj_mem_setPointerGrayIfWhite(void * ptr) { if (ptr == NULL) return; heap_chunk * chunk = ((heap_chunk*)((size_t)ptr - sizeof(heap_chunk))); if (chunk->color==TCM_WHITE) chunk->color=TCM_GRAY; } static inline void dj_mem_setRefColor(ref_t ref, int color) { if (ref==nullref) return; dj_mem_setChunkColor(REF_TO_VOIDP(ref), color); } #endif
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <pthread.h> #include <stdint.h> /** * service prêparé pour être un thread mais aussi pourrait être appelé directement */ void *service(void *comm_fd) { int comm_sock=(intptr_t)comm_fd; //printf("%d", comm_sock); char str[100]; int nb; do { if ((nb=read(comm_sock, str, 100)) < 0) { perror("read"); exit(3); } str[nb] = 0; printf("[INFO] Le serveur reçoit - %s", str); write(comm_sock, str, nb + 1); } while (str[0] != '.'); close(comm_sock); return 0; }
/* * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. * * Author: Simon Goldschmidt * */ #ifndef __LWIP_NETDB_H__ #define __LWIP_NETDB_H__ #include "lwip/opt.h" #if LWIP_DNS && LWIP_SOCKET #include <stddef.h> /* for size_t */ #include "lwip/inet.h" #include "lwip/sockets.h" #ifdef __cplusplus extern "C" { #endif /* some rarely used options */ #ifndef LWIP_DNS_API_DECLARE_H_ERRNO #define LWIP_DNS_API_DECLARE_H_ERRNO 1 #endif #ifndef LWIP_DNS_API_DEFINE_ERRORS #define LWIP_DNS_API_DEFINE_ERRORS 1 #endif #ifndef LWIP_DNS_API_DECLARE_STRUCTS #define LWIP_DNS_API_DECLARE_STRUCTS 1 #endif #if LWIP_DNS_API_DEFINE_ERRORS /** Errors used by the DNS API functions, h_errno can be one of them */ #define EAI_NONAME 200 #define EAI_SERVICE 201 #define EAI_FAIL 202 #define EAI_MEMORY 203 #define HOST_NOT_FOUND 210 #define NO_DATA 211 #define NO_RECOVERY 212 #define TRY_AGAIN 213 #endif /* LWIP_DNS_API_DEFINE_ERRORS */ #if LWIP_DNS_API_DECLARE_STRUCTS struct hostent { char *h_name; /* Official name of the host. */ char **h_aliases; /* A pointer to an array of pointers to alternative host names, terminated by a null pointer. */ int h_addrtype; /* Address type. */ int h_length; /* The length, in bytes, of the address. */ char **h_addr_list; /* A pointer to an array of pointers to network addresses (in network byte order) for the host, terminated by a null pointer. */ #define h_addr h_addr_list[0] /* for backward compatibility */ }; struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Address family of socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol of socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address of socket. */ char *ai_canonname; /* Canonical name of service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; #endif /* LWIP_DNS_API_DECLARE_STRUCTS */ #if LWIP_DNS_API_DECLARE_H_ERRNO /* application accessible error code set by the DNS API functions */ extern int h_errno; #endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/ struct hostent *lwip_gethostbyname(const char *name); int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); void lwip_freeaddrinfo(struct addrinfo *ai); int lwip_getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); #if LWIP_COMPAT_SOCKETS #define gethostbyname(name) lwip_gethostbyname(name) #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) #define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) #define getaddrinfo(nodname, servname, hints, res) \ lwip_getaddrinfo(nodname, servname, hints, res) #endif /* LWIP_COMPAT_SOCKETS */ #ifdef __cplusplus } #endif #endif /* LWIP_DNS && LWIP_SOCKET */ #endif /* __LWIP_NETDB_H__ */
#pragma once #include "..\..\PhysX\PxPhysicsAPI.h" using namespace physx; inline PxVec3* fromVertex(vertexDatas* vertex, int size) { PxVec3* mem = new PxVec3[size]; for (int i = 0; i < size; ++i) { mem[i] = PxVec3(vertex[i].m_pos.x, vertex[i].m_pos.y, vertex[i].m_pos.z); } return mem; } inline PxVec3 XMtoPX(const XMFLOAT3& pos) { return PxVec3(pos.x, pos.y, pos.z); } inline PxExtendedVec3 XMtoPXEx(const XMFLOAT3& pos) { return PxExtendedVec3(pos.x, pos.y, pos.z); } inline XMFLOAT3 PXtoXM(const PxExtendedVec3& pos) { return XMFLOAT3(pos.x, pos.y, pos.z); } inline XMFLOAT3 PXtoXM(const PxVec3& pos) { return XMFLOAT3(pos.x, pos.y, pos.z); } class DamageVal { private: char randDamageVal[7] = { -3, -2, -1, 0, 1, 2, 3 }; public: float hitback; unsigned char baseDamage; char paticleType; DamageVal(float back, int damage) { hitback = back; baseDamage = damage; paticleType = 0; } void randDamage() { baseDamage += randDamageVal[rand() % 7]; } }; class PhysSimulation : public PxSimulationEventCallback { private: void PlayerToEnemy(PxTriggerPair* trigger); void EnemyToPlayer(PxTriggerPair* trigger); GameObject* player = nullptr; public: void onTrigger(PxTriggerPair* pairs, PxU32 count); //Æ®¸®°Å¹Ú½º Ãæµ¹ üũ void onAdvance(const PxRigidBody*const*, const PxTransform*, const PxU32) {} void onConstraintBreak(PxConstraintInfo*, PxU32) { } void onWake(PxActor**, PxU32) { } void onSleep(PxActor**, PxU32) { } void onContact(const PxContactPairHeader&, const PxContactPair*, PxU32) { } void setPlayer(GameObject* object) { player = object; } }; class Raycast { private: PxGeometry * m_geom; PxVec3 m_pos; XMFLOAT3* m_startPos; XMFLOAT3 m_dir; float m_closest; PxRaycastHit hitData; PxHitFlags hitFlag; int maxHit; public: Raycast(PxGeometry* geom, XMFLOAT3* startPos); ~Raycast(); PxAgain onHit(); void setPos(PxExtendedVec3 pos); };
/******************************************************** [DateTime]:2013.8.30 [Author ]:Mr.Huang [Email ]:hsq2013(at)foxmail(dot)com [Content ]:The main 3d view control /********************************************************/ #include "Instance.h" #include "EAViewGlobe.h" //#include "MemLeakCheck.h" #include <windows.h> #include <process.h> //#include <iostream.h> #pragma once using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; namespace EAViewEngine { /// <summary> /// Summary for EAViewGlobeControl /// </summary> //[ToolboxBitmap(EAViewGlobeControl::typeid)]//,"EAViewGlobeControl.bmp")]//the icon //DWORD WINAPI RenderThreadProc(LPVOID lpParameter); unsigned int RTID; HANDLE RTHandle; unsigned int __stdcall RenderThreadStart(void*); public ref class EAViewGlobeControl : public System::Windows::Forms::UserControl { public: //friend class EAViewGlobe; EAViewGlobeControl(void) { InitializeComponent(); // //TODO: Add the constructor code here // /*MemLeakCheck::InitMemLeakCheck(); char* p=new char[1];*/ Instance::EAViewGlobeInit(_window); Object=gcnew EAViewGlobe; _viewer=Instance::GetEAViewer(); } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~EAViewGlobeControl() { Instance::EAViewGlobeTerminate(); if(RTHandle!=0) { CloseHandle(RTHandle); } if (components) { delete components; } } public: /// <summary> /// get a class EAViewGlobe instance /// </summary> System::Object^ Object; protected: private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container^ components; System::Windows::Forms::Panel^ _window; osgViewer::Viewer* _viewer; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->_window = (gcnew System::Windows::Forms::Panel()); this->SuspendLayout(); // // _window // this->_window->BackColor = System::Drawing::Color::Transparent; this->_window->Dock = System::Windows::Forms::DockStyle::Fill; this->_window->Location = System::Drawing::Point(0, 0); this->_window->Name = L"_window"; this->_window->Size = System::Drawing::Size(250, 200); this->_window->TabIndex = 1; // // EAViewGlobeControl // this->AllowDrop = true; this->AutoScaleDimensions = System::Drawing::SizeF(6, 12); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->Controls->Add(this->_window); this->ForeColor = System::Drawing::SystemColors::WindowFrame; this->Name = L"EAViewGlobeControl"; this->Size = System::Drawing::Size(250, 200); this->Load += gcnew System::EventHandler(this, &EAViewGlobeControl::EAViewGlobeControl_Load); this->ResumeLayout(false); } #pragma endregion private: /// <summary> /// this is a event to triger the osg render thread /// </summary> /// <param name="sender"></param> /// <param name="e"></param> System::Void EAViewGlobeControl_Load(System::Object^ sender, System::EventArgs^ e); }; }
#ifndef _HASHTABLE_H #define _HASHTABLE_H #include <stdbool.h> #include <stddef.h> // TODO: yoink typedefs typedef struct { unsigned int key; void *value; void *next; } sui_hashtable_entry_t; typedef struct { unsigned int (*hash)(const void *); sui_hashtable_entry_t **buckets; size_t bucket_count; } sui_hashtable_t; sui_hashtable_t *hashtable_create(size_t buckets, unsigned int (*hash_function)(const void *)); void hashtable_free(sui_hashtable_t *table); void *hashtable_get(sui_hashtable_t *table, const void *key); void *hashtable_set(sui_hashtable_t *table, const void *key, void *value); void *hashtable_del(sui_hashtable_t *table, const void *key); bool hashtable_contains(sui_hashtable_t *table, const void *key); // TODO: Persist unmolested keys and iterate with them too void hashtable_iter(sui_hashtable_t *table, void (*iter)(void *item, void *state), void *state); #endif
// Created file "Lib\src\Uuid\propkeys" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PPM_IDLE_ACCOUNTING_EX_GUID, 0xd67abd39, 0x81f8, 0x4a5e, 0x81, 0x52, 0x72, 0xe3, 0x1e, 0xc9, 0x12, 0xee);
/* ========================================================================= * This file is part of sys-c++ * ========================================================================= * * (C) Copyright 2004 - 2009, General Dynamics - Advanced Information Systems * * sys-c++ is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; If not, * see <http://www.gnu.org/licenses/>. * */ #ifndef __SYS_RUNTIME_PROCESS_H__ #define __SYS_RUNTIME_PROCESS_H__ /*! * \file * \brief Runtime, system-independent process creation API * * When it comes to multitasking, we almost all prefer threads to * heritage process calls. However, threads and processes are almost * never equivalent. Sometimes we need a process. Here we define * a simple API for process creation in a system-independent manner * */ #include "ProcessInterface.h" #if defined(WIN32) # include "ProcessWin32.h" namespace sys { typedef ProcessWin32 Process; } # #else # include "ProcessUnix.h" namespace sys { typedef ProcessUnix Process; } #endif #endif
/******************************************************************************* * SCHNApps * * Copyright (C) 2016, IGG Group, ICube, University of Strasbourg, France * * Plugin ExtractSurface * * Author Etienne Schmitt (etienne.schmitt@inria.fr) Inria/Mimesis * * 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. * * * * Web site: http://cgogn.unistra.fr/ * * Contact information: cgogn@unistra.fr * * * *******************************************************************************/ #ifndef SCHNAPPS_PLUGIN_ATTRIBUTE_EDITOR_EDIT_ATTRIBUTE_DIALOG_H #define SCHNAPPS_PLUGIN_ATTRIBUTE_EDITOR_EDIT_ATTRIBUTE_DIALOG_H #include <dll.h> #include <ui_edit_attribute_dialog.h> #include <schnapps/core/types.h> namespace schnapps { class SCHNApps; class MapHandlerGen; namespace plugin_attribute_editor { class AttributeEditorPlugin; class SCHNAPPS_PLUGIN_ATTRIBUTE_EDITOR_API EditAttributeDialog : public QDialog, public Ui::EditAttribute { Q_OBJECT friend class AttributeEditorPlugin; public: EditAttributeDialog(SCHNApps* s, AttributeEditorPlugin* p); private slots: void map_added(MapHandlerGen*); void map_removed(MapHandlerGen*); void selected_map_changed(const QString&); void orbit_changed(const QString&); void cells_set_changed(const QString&); void attribute_changed(const QString&); void edit_attribute_validated(); private: void update_cells_sets(MapHandlerGen*, CellType ct); void update_attribute_list(MapHandlerGen*, CellType ct); private: SCHNApps* schnapps_; AttributeEditorPlugin* plugin_; bool updating_ui_; }; } // namespace plugin_attribute_editor } // namespace schnapps #endif // SCHNAPPS_PLUGIN_ATTRIBUTE_EDITOR_EDIT_ATTRIBUTE_DIALOG_H
#pragma once //#define NTDDI_VERSION NTDDI_WINXP #include <windows.h>
/* * Memory range functions * * Copyright (c) 2009-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( _LIBBFIO_MEMORY_RANGE_H ) #define _LIBBFIO_MEMORY_RANGE_H #include <common.h> #include <types.h> #include "libbfio_extern.h" #include "libbfio_libcerror.h" #include "libbfio_types.h" #if defined( __cplusplus ) extern "C" { #endif typedef struct libbfio_memory_range_io_handle libbfio_memory_range_io_handle_t; struct libbfio_memory_range_io_handle { /* The start of the memory range */ uint8_t *range_start; /* The size of the memory range */ size_t range_size; /* The current offset in the memory range */ size_t range_offset; /* Value to indicate the memory range is open */ uint8_t is_open; /* The current access flags */ int access_flags; }; int libbfio_memory_range_io_handle_initialize( libbfio_memory_range_io_handle_t **memory_range_io_handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_memory_range_initialize( libbfio_handle_t **handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_free( libbfio_memory_range_io_handle_t **memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_io_handle_clone( libbfio_memory_range_io_handle_t **destination_memory_range_io_handle, libbfio_memory_range_io_handle_t *source_memory_range_io_handle, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_memory_range_get( libbfio_handle_t *handle, uint8_t **range_start, size_t *range_size, libcerror_error_t **error ); LIBBFIO_EXTERN \ int libbfio_memory_range_set( libbfio_handle_t *handle, uint8_t *range_start, size_t range_size, libcerror_error_t **error ); int libbfio_memory_range_open( libbfio_memory_range_io_handle_t *memory_range_io_handle, int access_flags, libcerror_error_t **error ); int libbfio_memory_range_close( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ); ssize_t libbfio_memory_range_read( libbfio_memory_range_io_handle_t *memory_range_io_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ); ssize_t libbfio_memory_range_write( libbfio_memory_range_io_handle_t *memory_range_io_handle, const uint8_t *buffer, size_t size, libcerror_error_t **error ); off64_t libbfio_memory_range_seek_offset( libbfio_memory_range_io_handle_t *memory_range_io_handle, off64_t offset, int whence, libcerror_error_t **error ); int libbfio_memory_range_exists( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_is_open( libbfio_memory_range_io_handle_t *memory_range_io_handle, libcerror_error_t **error ); int libbfio_memory_range_get_size( libbfio_memory_range_io_handle_t *memory_range_io_handle, size64_t *size, libcerror_error_t **error ); #if defined( __cplusplus ) } #endif #endif
#ifndef SIGNEXPORTAPK_H #define SIGNEXPORTAPK_H #include <QLineEdit> #include "dialog.h" #include "macros.h" APP_NAMESPACE_START class SignExportApk : public Dialog { Q_OBJECT private: QLineEdit *_key; QLineEdit *_keyPass; QLineEdit *_keystore; QLineEdit *_keystorePass; public: explicit SignExportApk(QWidget *parent = 0); public: inline QString key() { return _key->text(); } inline QString keyPass() { return _keyPass->text(); } inline QString keystore() { return _keystore->text(); } inline QString keystorePass() { return _keystorePass->text(); } private Q_SLOTS: void onBrowseKeystore(); void onSignClicked(); }; APP_NAMESPACE_END #endif // SIGNEXPORTAPK_H
/** * This file is part of the rgbdemo project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Author: Nicolas Burrus <nicolas@burrus.name>, (C) 2010, 2011 */ #ifndef RAWIMAGESWINDOW_H #define RAWIMAGESWINDOW_H #include <ntk/camera/calibration.h> #include <QMainWindow> namespace Ui { class RawImagesWindow; } class GuiController; class RawImagesWindow : public QMainWindow { Q_OBJECT public: explicit RawImagesWindow(GuiController& controller, QWidget *parent = 0); ~RawImagesWindow(); public: void update(const ntk::RGBDImage& image); private: Ui::RawImagesWindow *ui; GuiController& m_controller; public slots: void closeEvent(QCloseEvent *event); private slots: void on_actionNext_frame_triggered(); void on_actionPause_toggled(bool ); void on_syncMode_toggled(bool checked); void on_action_GrabFrames_toggled(bool ); void on_action_Screen_capture_mode_toggled(bool ); void on_action_Quit_triggered(); void on_action_GrabOneFrame_triggered(); void on_outputDirText_editingFinished(); friend class GuiController; }; #endif // RAWIMAGESWINDOW_H
#include <stdio.h> #include <wiringPi.h> int main(int argc, char **argv) { # if 0 wiringPiSetupSys(); s500_sys_gpio_type(1); while(1) { digitalWrite(3, 1); printf(".....pin 3.........HIGH\n"); delay (6000) ; // mS digitalWrite(3, 0); printf(".....pin 3.........LOW\n"); delay (6000) ; // mS } #else wiringPiSetupSys(); while(1) { //×¢Òâ: ÒÔϵÄpinÐèÒª¸ÄΪbcm ¶ÔÓ¦µÄpin digitalWrite(3, 1); printf(".....pin 3.........HIGH\n"); delay (6000) ; // mS digitalWrite(3, 0); printf(".....pin 3.........LOW\n"); delay (6000) ; // mS } #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_CREATEHOSTRESPONSE_H #define QTAWS_CREATEHOSTRESPONSE_H #include "codestarconnectionsresponse.h" #include "createhostrequest.h" namespace QtAws { namespace CodeStarconnections { class CreateHostResponsePrivate; class QTAWSCODESTARCONNECTIONS_EXPORT CreateHostResponse : public CodeStarconnectionsResponse { Q_OBJECT public: CreateHostResponse(const CreateHostRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const CreateHostRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(CreateHostResponse) Q_DISABLE_COPY(CreateHostResponse) }; } // namespace CodeStarconnections } // namespace QtAws #endif
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/krasnocka/Downloads/j2objc-master/testing/mockito/build_result/java/org/mockito/internal/matchers/LessOrEqual.java // #ifndef _OrgMockitoInternalMatchersLessOrEqual_H_ #define _OrgMockitoInternalMatchersLessOrEqual_H_ @protocol JavaLangComparable; #include "J2ObjC_header.h" #include "java/io/Serializable.h" #include "org/mockito/internal/matchers/CompareTo.h" #define OrgMockitoInternalMatchersLessOrEqual_serialVersionUID -6648773374429103565LL @interface OrgMockitoInternalMatchersLessOrEqual : OrgMockitoInternalMatchersCompareTo < JavaIoSerializable > { } - (instancetype)initWithJavaLangComparable:(id<JavaLangComparable>)value; - (NSString *)getName; - (jboolean)matchResultWithInt:(jint)result; @end J2OBJC_EMPTY_STATIC_INIT(OrgMockitoInternalMatchersLessOrEqual) CF_EXTERN_C_BEGIN J2OBJC_STATIC_FIELD_GETTER(OrgMockitoInternalMatchersLessOrEqual, serialVersionUID, jlong) CF_EXTERN_C_END J2OBJC_TYPE_LITERAL_HEADER(OrgMockitoInternalMatchersLessOrEqual) #endif // _OrgMockitoInternalMatchersLessOrEqual_H_
/** \file tensorflow.h * \brief Tensorflow representation header file. * * \author Wouter Caarls <wouter@caarls.org> * \date 2017-01-31 * * \copyright \verbatim * Copyright (c) 2017, Wouter Caarls * All rights reserved. * * This file is part of GRL, the Generic Reinforcement Learning library. * * GRL 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/>. * \endverbatim */ #ifndef GRL_TENSORFLOW_REPRESENTATION_H_ #define GRL_TENSORFLOW_REPRESENTATION_H_ #include <list> #include <grl/representation.h> #include "tensorflow_api.h" namespace grl { /// Representation using a TensorFlow graph. class TensorFlowRepresentation : public ParameterizedRepresentation { public: TYPEINFO("representation/parameterized/tensorflow", "TensorFlow representation") typedef std::pair<Vector, Vector> Sample; protected: std::string file_, input_layer_, output_layer_, output_target_, sample_weights_, learning_phase_, init_node_, update_node_; double memory_; std::vector<std::string> inputs_write_, outputs_read_, weights_read_, weights_write_, weights_node_; mutable std::vector<TF::Shape> weights_shape_; IndexVector input_shapes_; TF_Graph* graph_; TF_Session* session_; std::vector<Sample> batch_; int inputs_, targets_; std::vector<TF_Tensor*> batch_inputs_; TF_Tensor* batch_target_; size_t counter_; mutable LargeVector params_; pthread_mutex_t mutex_; public: TensorFlowRepresentation() : init_node_("init"), update_node_("update"), memory_(1), graph_(NULL), session_(NULL), counter_(0), mutex_(PTHREAD_MUTEX_INITIALIZER) { } ~TensorFlowRepresentation() { if (session_) { TF_Status *status = TF::NewStatus(); TF::DeleteSession(session_, status); TF::DeleteStatus(status); } if (graph_) TF::DeleteGraph(graph_); } // From Configurable virtual void request(const std::string &role, ConfigurationRequest *config); virtual void configure(Configuration &config); virtual void reconfigure(const Configuration &config); virtual TensorFlowRepresentation &copy(const Configurable &obj); // From Representation virtual double read(const ProjectionPtr &projection, Vector *result, Vector *stddev) const; virtual void write(const ProjectionPtr projection, const Vector &target, const Vector &alpha); virtual void update(const ProjectionPtr projection, const Vector &delta); virtual void finalize(); virtual void batchRead(size_t sz); virtual void batchWrite(size_t sz); virtual void enqueue(const ProjectionPtr &projection); virtual void enqueue(const ProjectionPtr &projection, const Vector &target); virtual void read(Matrix *out); virtual void write(); // From ParameterizedRepresentation virtual size_t size() const; virtual const LargeVector &params() const; virtual void setParams(const LargeVector &params); virtual TensorFlowRepresentation *target() { return dynamic_cast<TensorFlowRepresentation*>(ParameterizedRepresentation::target()); } TF::TensorPtr tensor(TF::Shape shape) const { return TF::TensorPtr(new TF::Tensor(shape)); } TF::TensorPtr tensor(const Vector &v, TF::Shape shape=TF::Shape()) const { return TF::TensorPtr(new TF::Tensor(v, shape)); } TF::TensorPtr tensor(const Matrix &m, TF::Shape shape=TF::Shape()) const { return TF::TensorPtr(new TF::Tensor(m, shape)); } void SessionRun(const std::vector<std::pair<std::string, TF::TensorPtr> > &inputs, const std::vector<std::string> &outputs, const std::vector<std::string> &ops, std::vector<TF::TensorPtr> *results, bool learn=false); private: TF_Operation* OperationByName(const char*) const; int64_t GraphGetTensorElements(TF_Output output) const; }; } #endif /* GRL_TENSORFLOW_REPRESENTATION_H_ */
/* * @BEGIN LICENSE * * Psi4: an open-source quantum chemistry software package * * Copyright (c) 2007-2018 The Psi4 Developers. * * The copyrights for code used from other parties are included in * the corresponding files. * * This file is part of Psi4. * * Psi4 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, version 3. * * Psi4 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 Psi4; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * @END LICENSE */ #ifndef _psi_src_lib_libpsio_config_h_ #define _psi_src_lib_libpsio_config_h_ #include "psi4/pragma.h" namespace psi { #define PSIO_OPEN_NEW 0 #define PSIO_OPEN_OLD 1 #define PSIO_KEYLEN 80 #define PSIO_MAXVOL 8 #define PSIO_MAXUNIT 500 #define PSIO_PAGELEN 65536 #define PSIO_ERROR_INIT 1 #define PSIO_ERROR_DONE 2 #define PSIO_ERROR_MAXVOL 3 #define PSIO_ERROR_NOVOLPATH 4 #define PSIO_ERROR_OPEN 5 #define PSIO_ERROR_REOPEN 6 #define PSIO_ERROR_CLOSE 7 #define PSIO_ERROR_RECLOSE 8 #define PSIO_ERROR_OSTAT 9 #define PSIO_ERROR_LSEEK 10 #define PSIO_ERROR_READ 11 #define PSIO_ERROR_WRITE 12 #define PSIO_ERROR_NOTOCENT 13 #define PSIO_ERROR_TOCENTSZ 14 #define PSIO_ERROR_KEYLEN 15 #define PSIO_ERROR_BLKSIZ 16 #define PSIO_ERROR_BLKSTART 17 #define PSIO_ERROR_BLKEND 18 #define PSIO_ERROR_IDENTVOLPATH 19 #define PSIO_ERROR_MAXUNIT 20 typedef struct { size_t page; /* First page of entry */ size_t offset; /* Starting byte offset on fpage */ } psio_address; typedef struct { char *path; int stream; } psio_vol; typedef struct psio_entry { char key[PSIO_KEYLEN]; psio_address sadd; psio_address eadd; struct psio_entry *next; struct psio_entry *last; } psio_tocentry; typedef struct { size_t numvols; psio_vol vol[PSIO_MAXVOL]; size_t toclen; psio_tocentry *toc; } psio_ud; /** A convenient address initialization struct */ extern PSI_API psio_address PSIO_ZERO; } #endif /* header guard */
#ifndef SOCKETCLIENTHANDLE_H #define SOCKETCLIENTHANDLE_H #include "Socket.h" #include "Runnable.h" #include <stack> class SocketDataServer; class SocketClientHandle : public Runnable { public: SocketClientHandle(SocketDataServer* server, network::Socket* socket); void update(); bool isOk() const; protected: void onStartup(); void onFinish(); private: SocketDataServer *mServer; std::unique_ptr<network::Socket> mSocket; }; #endif // SOCKETCLIENTHANDLE_H
/*************************************************************************** * Copyright (C) 2013 by Ralf Kaestner * * ralf.kaestner@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef POLOLU_USC_USB_WRITESUBROUTINES_H #define POLOLU_USC_USB_WRITESUBROUTINES_H /** \brief USB servo controller write subroutines request (USB protocol) */ #include "script/subroutine.h" #include "usc/usb/blockrequest.h" namespace Pololu { namespace Usc { namespace Usb { class WriteSubroutines : public BlockRequest { public: /** Construct a Pololu USB servo controller write subroutines * request */ WriteSubroutines(unsigned short startIndex, const std::map<std::string, Script::Subroutine>& subroutines = std::map<std::string, Script::Subroutine>()); /** Access the request's subroutines */ void setSubroutines(const std::map<std::string, Script::Subroutine>& subroutines); WriteSubroutines* clone() const; void read(std::istream& stream); }; }; }; }; #endif
// Created file "Lib\src\Uuid\X64\uianimation_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IUIAnimationInterpolator, 0x7815cbba, 0xddf7, 0x478c, 0xa4, 0x6c, 0x7b, 0x6c, 0x73, 0x8b, 0x79, 0x78);
/* * Copyright 2015 by Heiko Schäfer <heiko@rangun.de> * * This file is part of NetMauMau. * * NetMauMau 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. * * NetMauMau 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 NetMauMau. If not, see <http://www.gnu.org/licenses/>. */ #ifndef NETMAUMAU_ENGINE_AI_HAVELESSTHANCONDITION_H #define NETMAUMAU_ENGINE_AI_HAVELESSTHANCONDITION_H #include <cstdlib> #include "binarycondition.h" namespace NetMauMau { namespace AI { template<std::size_t Bound> class HaveLessThanCondition : public BinaryCondition { DISALLOW_COPY_AND_ASSIGN(HaveLessThanCondition) public: HaveLessThanCondition(const IActionPtr &actTrue, const IActionPtr &actFalse) throw() : BinaryCondition(actTrue, actFalse) {} virtual ~HaveLessThanCondition() throw() {} virtual IActionPtr perform(const IAIState &state, const Player::IPlayer::CARDS &) const throw() { return state.getPlayerCards().size() < Bound ? getTrueAction() : getFalseAction(); } #if defined(TRACE_AI) && !defined(NDEBUG) protected: inline virtual std::string traceLog() const throw() { return "HaveLessThanCondition"; } #endif }; } } #endif /* NETMAUMAU_ENGINE_AI_HAVELESSTHANCONDITION_H */ // kate: indent-mode cstyle; indent-width 4; replace-tabs off; tab-width 4;
/* * server/zone/objects/tangible/firework/Firework.h generated by engine3 IDL compiler 0.55 */ #ifndef FIREWORK_H_ #define FIREWORK_H_ #include "engine/orb/DistributedObjectBroker.h" class Player; class TangibleObject; #include "../TangibleObject.h" class Firework : public TangibleObject { public: Firework(Player* player, unsigned int tempCRC, const UnicodeString& n, const String& tempn, int anim); Firework(unsigned long long oid, unsigned int tempCRC, const UnicodeString& n, const String& tempname, int tp = 0); int useObject(Player* player); protected: Firework(DummyConstructorParameter* param); virtual ~Firework(); friend class FireworkHelper; }; class FireworkImplementation; class FireworkAdapter : public TangibleObjectAdapter { public: FireworkAdapter(FireworkImplementation* impl); Packet* invokeMethod(sys::uint32 methid, DistributedMethod* method); int useObject(Player* player); }; class FireworkHelper : public DistributedObjectClassHelper, public Singleton<FireworkHelper> { static FireworkHelper* staticInitializer; public: FireworkHelper(); void finalizeHelper(); DistributedObject* instantiateObject(); DistributedObjectAdapter* createAdapter(DistributedObjectStub* obj); friend class SingletonWrapper<FireworkHelper>; }; #include "../TangibleObjectImplementation.h" class FireworkServant : public TangibleObjectImplementation { public: Firework* _this; public: FireworkServant(unsigned long long oid, int tp); virtual ~FireworkServant(); void _setStub(DistributedObjectStub* stub); DistributedObjectStub* _getStub(); }; #endif /*FIREWORK_H_*/
// Created file "Lib\src\Uuid\X64\propkeys" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_Devices_Notification_StorageFullLinkText, 0xa0e00ee1, 0xf0c7, 0x4d41, 0xb8, 0xe7, 0x26, 0xa7, 0xbd, 0x8d, 0x38, 0xb0);
/* thot package for statistical machine translation Copyright (C) 2013 Daniel Ortiz-Mart\'inez 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; If not, see <http://www.gnu.org/licenses/>. */ /** * @file lm_ienc.h * * @brief Encoder for incremental language models. */ #ifndef _lm_ienc #define _lm_ienc //--------------- Include files -------------------------------------- #if HAVE_CONFIG_H # include <thot_config.h> #endif /* HAVE_CONFIG_H */ #include "vecx_x_incr_enc.h" #include <LM_Defs.h> #include <string> //--------------- Constants ------------------------------------------ //--------------- typedefs ------------------------------------------- //--------------- function declarations ------------------------------ //--------------- Classes -------------------------------------------- //--------------- lm_ienc class class lm_ienc: public vecx_x_incr_enc<std::string,WordIndex> { public: // Constructor lm_ienc(); bool HighSrc_to_Src(const std::vector<std::string>& hs, std::vector<WordIndex>& s); // Given a HSRCDATA object "hs" obtains its corresponding encoded // value in "s". Returns true if the encoding was successful // ("hs" exists in the vocabulary). s stores the corresponding // code if exists, or a not valid one otherwise bool HighTrg_to_Trg(const std::string& ht,WordIndex& t); // The same for HX objects }; #endif
/***************************************************************************** Copyright (c) 2010, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************** * Contents: Native high-level C interface to LAPACK function zptcon * Author: Intel Corporation * Generated October, 2010 *****************************************************************************/ #include "lapacke.h" #include "lapacke_utils.h" lapack_int LAPACKE_zptcon( lapack_int n, const double* d, const lapack_complex_double* e, double anorm, double* rcond ) { lapack_int info = 0; double* work = NULL; #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_d_nancheck( 1, &anorm, 1 ) ) { return -4; } if( LAPACKE_d_nancheck( n, d, 1 ) ) { return -2; } if( LAPACKE_z_nancheck( n-1, e, 1 ) ) { return -3; } #endif /* Allocate memory for working array(s) */ work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zptcon_work( n, d, e, anorm, rcond, work ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zptcon", info ); } return info; }
/* Zimr - Next Generation Web Server * *+ Copyright (c) 2009 Ian Halpern *@ http://Zimr.org * * This file is part of Zimr. * * Zimr 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. * * Zimr 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 Zimr. If not, see <http://www.gnu.org/licenses/> * */ #ifndef _ZM_URLDECODER_H #define _ZM_URLDECODER_H #include <stdlib.h> #include <string.h> #include "general.h" char* url_decode( char*, char*, int url_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_DELETEENVIRONMENTACCOUNTCONNECTIONRESPONSE_H #define QTAWS_DELETEENVIRONMENTACCOUNTCONNECTIONRESPONSE_H #include "protonresponse.h" #include "deleteenvironmentaccountconnectionrequest.h" namespace QtAws { namespace Proton { class DeleteEnvironmentAccountConnectionResponsePrivate; class QTAWSPROTON_EXPORT DeleteEnvironmentAccountConnectionResponse : public ProtonResponse { Q_OBJECT public: DeleteEnvironmentAccountConnectionResponse(const DeleteEnvironmentAccountConnectionRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const DeleteEnvironmentAccountConnectionRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DeleteEnvironmentAccountConnectionResponse) Q_DISABLE_COPY(DeleteEnvironmentAccountConnectionResponse) }; } // namespace Proton } // namespace QtAws #endif