text
stringlengths
4
6.14k
#ifndef JITCORE_H #define JITCORE_H #define RAISE(errtype, msg) {PyObject* p; p = PyErr_Format( errtype, msg ); return p;} #define RAISE_ret0(errtype, msg) {PyObject* p; p = PyErr_Format( errtype, msg ); return 0;} #define PyGetInt(item, value) \ if (PyInt_Check(item)){ \ value = (uint64_t)PyInt_AsLong(item); \ } \ else if (PyLong_Check(item)){ \ value = (uint64_t)PyLong_AsUnsignedLongLong(item); \ } \ else{ \ RAISE(PyExc_TypeError,"arg must be int"); \ } \ #define PyGetInt_ret0(item, value) \ if (PyInt_Check(item)){ \ value = (uint64_t)PyInt_AsLong(item); \ } \ else if (PyLong_Check(item)){ \ value = (uint64_t)PyLong_AsUnsignedLongLong(item); \ } \ else{ \ printf("error\n"); return 0; \ } \ #define getset_reg_u64(regname) \ static PyObject *JitCpu_get_ ## regname (JitCpu *self, void *closure) \ { \ return PyLong_FromUnsignedLongLong((uint64_t)(((vm_cpu_t*)(self->cpu))-> regname )); \ } \ static int JitCpu_set_ ## regname (JitCpu *self, PyObject *value, void *closure) \ { \ uint64_t val; \ PyGetInt_ret0(value, val); \ ((vm_cpu_t*)(self->cpu))-> regname = val; \ return 0; \ } #define getset_reg_u32(regname) \ static PyObject *JitCpu_get_ ## regname (JitCpu *self, void *closure) \ { \ return PyLong_FromUnsignedLongLong((uint32_t)(((vm_cpu_t*)(self->cpu))-> regname )); \ } \ static int JitCpu_set_ ## regname (JitCpu *self, PyObject *value, void *closure) \ { \ uint32_t val; \ PyGetInt_ret0(value, val); \ ((vm_cpu_t*)(self->cpu))-> regname = val; \ return 0; \ } #define getset_reg_u16(regname) \ static PyObject *JitCpu_get_ ## regname (JitCpu *self, void *closure) \ { \ return PyLong_FromUnsignedLongLong((uint16_t)(((vm_cpu_t*)(self->cpu))-> regname )); \ } \ static int JitCpu_set_ ## regname (JitCpu *self, PyObject *value, void *closure) \ { \ uint16_t val; \ PyGetInt_ret0(value, val); \ ((vm_cpu_t*)(self->cpu))-> regname = val; \ return 0; \ } #define get_reg(reg) do { \ o = PyLong_FromUnsignedLongLong((uint64_t)((vm_cpu_t*)(self->cpu))->reg); \ PyDict_SetItemString(dict, #reg, o); \ Py_DECREF(o); \ } while(0); #define get_reg_off(reg) do { \ o = PyLong_FromUnsignedLongLong((uint64_t)offsetof(vm_cpu_t, reg)); \ PyDict_SetItemString(dict, #reg, o); \ Py_DECREF(o); \ } while(0); typedef struct { uint8_t is_local; uint64_t address; } block_id; typedef struct { PyObject_HEAD PyObject *pyvm; PyObject *jitter; void* cpu; } JitCpu; typedef struct _reg_dict{ char* name; size_t offset; } reg_dict; void JitCpu_dealloc(JitCpu* self); PyObject * JitCpu_new(PyTypeObject *type, PyObject *args, PyObject *kwds); PyObject * JitCpu_get_vmmngr(JitCpu *self, void *closure); PyObject * JitCpu_set_vmmngr(JitCpu *self, PyObject *value, void *closure); PyObject * JitCpu_get_jitter(JitCpu *self, void *closure); PyObject * JitCpu_set_jitter(JitCpu *self, PyObject *value, void *closure); void Resolve_dst(block_id* BlockDst, uint64_t addr, uint64_t is_local); uint8_t MEM_LOOKUP_08(JitCpu* jitcpu, uint64_t addr); uint16_t MEM_LOOKUP_16(JitCpu* jitcpu, uint64_t addr); uint32_t MEM_LOOKUP_32(JitCpu* jitcpu, uint64_t addr); uint64_t MEM_LOOKUP_64(JitCpu* jitcpu, uint64_t addr); void MEM_WRITE_08(JitCpu* jitcpu, uint64_t addr, uint8_t src); void MEM_WRITE_16(JitCpu* jitcpu, uint64_t addr, uint16_t src); void MEM_WRITE_32(JitCpu* jitcpu, uint64_t addr, uint32_t src); void MEM_WRITE_64(JitCpu* jitcpu, uint64_t addr, uint64_t src); PyObject* vm_get_mem(JitCpu *self, PyObject* args); #define VM_exception_flag (((VmMngr*)jitcpu->pyvm)->vm_mngr.exception_flags) #define CPU_exception_flag (((vm_cpu_t*)jitcpu->cpu)->exception_flags) #endif
/* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free ** Software License B, Version 1.1 (the "License"), the contents of this ** file are subject only to the provisions of the License. You may not use ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: ** ** http://oss.sgi.com/projects/FreeB ** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. ** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. ** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X ** Window System(R) (Version 1.3), released October 19, 1998. This software ** was created using the OpenGL(R) version 1.2.1 Sample Implementation ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. */ /* * gridline.h * * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/gridline.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ */ #ifndef __glugridline_h_ #define __glugridline_h_ struct Gridline { long v; REAL vval; long vindex; long ustart; long uend; }; #endif /* __glugridline_h_ */
/* ****************************************************************************** * Portions COPYRIGHT 2012 STMicroelectronics * Portions SPIRIT Audio Engine Copyright (c) 1995-2009, SPIRIT * * Licensed under MCD-ST Image SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_image_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __SPIRIT_LOUDNESS_CONTROL_H__ #define __SPIRIT_LOUDNESS_CONTROL_H__ #ifdef __cplusplus extern "C" { #endif //__cplusplus /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ typedef void TSpiritLdCtrl; typedef struct { int gainQ8; } TSpiritLdCtrl_Prms; /* Exported constants --------------------------------------------------------*/ /* SUCCESS codes */ #define SPIRIT_LDCTRL_S_OK 0 /* ERROR codes */ #define SPIRIT_LDCTRL_E_INVALIDARG -1 #define SPIRIT_LDCTRL_E_SAMPLERATE -2 #define SPIRIT_LDCTRL_E_CH -3 #define SPIRIT_LDCTRL_E_BADALIGN_PERSIST -4 #define SPIRIT_LDCTRL_E_BADALIGN_SCRATCH -5 #define SPIRIT_LDCTRL_PERSIST_SIZE_IN_BYTES 120 #define SPIRIT_LDCTRL_SCRATCH_SIZE_IN_BYTES 512 #define SPIRIT_LDCTRL_MAX_CH 2 #define SPIRIT_LDCTRL_GAIN_Q_BITS 8 #define SPIRIT_LDCTRL_GAIN_MAX (1<<(SPIRIT_LDCTRL_GAIN_Q_BITS + 6)) #define SPIRIT_LDCTRL_GAIN_MIN (1<<(SPIRIT_LDCTRL_GAIN_Q_BITS - 6)) /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ int SpiritLdCtrl_Reset ( TSpiritLdCtrl *_); int SpiritLdCtrl_Init ( TSpiritLdCtrl *_, unsigned long sampleRateHz); int SpiritLdCtrl_SetPrms( TSpiritLdCtrl *_, const TSpiritLdCtrl_Prms *prms); int SpiritLdCtrl_GetPrms(const TSpiritLdCtrl *_, TSpiritLdCtrl_Prms *prms); int SpiritLdCtrl_Apply ( TSpiritLdCtrl *_, int nChannels, short *pcm, short nSamplesPerCh, void *scratch); #ifdef __cplusplus } #endif #endif /* __SPIRIT_LOUDNESS_CONTROL_H__ */
/*************************************************************************** ** ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtNfc module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QNEARFIELDSHARETARGET_P_H #define QNEARFIELDSHARETARGET_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 "qnearfieldsharetarget.h" QT_BEGIN_NAMESPACE class QNearFieldShareTargetPrivate : public QObject { Q_OBJECT public: QNearFieldShareTargetPrivate(QNearFieldShareManager::ShareModes modes, QNearFieldShareTarget *q) : QObject(q) { Q_UNUSED(modes) } ~QNearFieldShareTargetPrivate() { } virtual QNearFieldShareManager::ShareModes shareModes() const { return QNearFieldShareManager::NoShare; } virtual bool share(const QNdefMessage &message) { Q_UNUSED(message) return false; } virtual bool share(const QList<QFileInfo> &files) { Q_UNUSED(files) return false; } virtual void cancel() { } virtual bool isShareInProgress() const { return false; } virtual QNearFieldShareManager::ShareError shareError() const { return QNearFieldShareManager::NoError; } }; QT_END_NAMESPACE #endif /* QNEARFIELDSHARETARGET_P_H */
/* mbed Microcontroller Library ******************************************************************************* * Copyright (c) 2014, STMicroelectronics * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************* */ #include "sleep_api.h" #include "cmsis.h" void sleep(void) { // Disable us_ticker update interrupt TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE); SCB->SCR = 0; // Normal sleep mode for ARM core __WFI(); // Re-enable us_ticker update interrupt TIM_ITConfig(TIM1, TIM_IT_Update, ENABLE); } void deepsleep(void) { // Disable us_ticker update interrupt TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE); // Enable PWR clock RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); // Request to enter STOP mode with regulator in low power mode PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); // Re-enable us_ticker update interrupt TIM_ITConfig(TIM1, TIM_IT_Update, ENABLE); }
/* * BitbloqMeLEDMatrixData.h * * Copyright 2017 Alberto Valero <alberto.valero@bq.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * DERIVED FROM * * \par History: * <pre> * `<Author>` `<Time>` `<Version>` `<Descr>` * forfish 2015/11/09 1.0.0 Add description * Mark Yan 2016/01/19 1.0.1 Add some new symbol * Mark Yan 2016/01/27 1.0.2 Add digital printing * Mark Yan 2016/01/29 1.0.3 Fix issue when show integer number * </pre> * */ #ifndef BITBLOQ_ME_LEDMATRIX_FONT_DATA_H_ #define BITBLOQ_ME_LEDMATRIX_FONT_DATA_H_ typedef struct { uint8_t Character[1]; uint8_t data[6]; }LED_Matrix_Font_6x8_TypeDef; //Terminal const LED_Matrix_Font_6x8_TypeDef Character_font_6x8[] PROGMEM = { ' ', 0x00,0x00,0x00,0x00,0x00,0x00, '0', 0x00,0x7C,0x82,0x82,0x7C,0x00, '1', 0x00,0x42,0xFE,0x02,0x00,0x00, '2', 0x00,0x46,0x8A,0x92,0x62,0x00, '3', 0x00,0x44,0x92,0x92,0x6C,0x00, '4', 0x00,0x1C,0x64,0xFE,0x04,0x00, '5', 0x00,0xF2,0x92,0x92,0x8C,0x00, '6', 0x00,0x7C,0x92,0x92,0x4C,0x00, '7', 0x00,0xC0,0x8E,0x90,0xE0,0x00, '8', 0x00,0x6C,0x92,0x92,0x6C,0x00, '9', 0x00,0x64,0x92,0x92,0x7C,0x00, 'a', 0x00,0x04,0x2A,0x2A,0x1E,0x00, 'b', 0x00,0xFE,0x12,0x12,0x0C,0x00, 'c', 0x00,0x0C,0x12,0x12,0x12,0x00, 'd', 0x00,0x0C,0x12,0x12,0xFE,0x00, 'e', 0x00,0x1C,0x2A,0x2A,0x18,0x00, 'f', 0x00,0x10,0x3E,0x50,0x50,0x00, 'g', 0x00,0x08,0x15,0x15,0x1E,0x00, 'h', 0x00,0xFE,0x10,0x1E,0x00,0x00, 'i', 0x00,0x00,0x2E,0x00,0x00,0x00, 'j', 0x00,0x02,0x01,0x2E,0x00,0x00, 'k', 0x00,0xFE,0x08,0x14,0x12,0x00, 'l', 0x00,0x00,0xFE,0x02,0x00,0x00, 'm', 0x00,0x1E,0x10,0x0E,0x10,0x0E, 'n', 0x00,0x1E,0x10,0x10,0x0E,0x00, 'o', 0x00,0x0C,0x12,0x12,0x0C,0x00, 'p', 0x00,0x1F,0x12,0x12,0x0C,0x00, 'q', 0x00,0x0C,0x12,0x12,0x1F,0x00, 'r', 0x00,0x1E,0x08,0x10,0x10,0x00, 's', 0x00,0x12,0x29,0x25,0x12,0x00, 't', 0x00,0x10,0x3E,0x12,0x00,0x00, 'u', 0x00,0x1C,0x02,0x02,0x1E,0x00, 'v', 0x18,0x04,0x02,0x04,0x18,0x00, 'w', 0x18,0x06,0x1C,0x06,0x18,0x00, 'x', 0x00,0x12,0x0C,0x0C,0x12,0x00, 'y', 0x00,0x18,0x05,0x05,0x1E,0x00, 'z', 0x00,0x12,0x16,0x1A,0x12,0x00, 'A', 0x00,0x7E,0x88,0x88,0x7E,0x00, 'B', 0x00,0xFE,0x92,0x92,0x6C,0x00, 'C', 0x00,0x7C,0x82,0x82,0x44,0x00, 'D', 0x00,0xFE,0x82,0x82,0x7C,0x00, 'E', 0x00,0xFE,0x92,0x92,0x82,0x00, 'F', 0x00,0xFE,0x90,0x90,0x80,0x00, 'G', 0x00,0x7C,0x82,0x92,0x5C,0x00, 'H', 0x00,0xFE,0x10,0x10,0xFE,0x00, 'I', 0x00,0x82,0xFE,0x82,0x00,0x00, 'J', 0x00,0x0C,0x02,0x02,0xFC,0x00, 'K', 0x00,0xFE,0x10,0x28,0xC6,0x00, 'L', 0x00,0xFE,0x02,0x02,0x02,0x00, 'M', 0x00,0xFE,0x40,0x30,0x40,0xFE, 'N', 0x00,0xFE,0x40,0x30,0x08,0xFE, 'O', 0x00,0x7C,0x82,0x82,0x82,0x7C, 'P', 0x00,0xFE,0x90,0x90,0x60,0x00, 'Q', 0x00,0x7C,0x82,0x8A,0x84,0x7A, 'R', 0x00,0xFE,0x98,0x94,0x62,0x00, 'S', 0x00,0x64,0x92,0x92,0x4C,0x00, 'T', 0x00,0x80,0xFE,0x80,0x80,0x00, 'U', 0x00,0xFC,0x02,0x02,0xFC,0x00, 'V', 0x00,0xF0,0x0C,0x02,0x0C,0xF0, 'W', 0x00,0xFE,0x04,0x38,0x04,0xFE, 'X', 0x00,0xC6,0x38,0x38,0xC6,0x00, 'Y', 0xC0,0x20,0x1E,0x20,0xC0,0x00, 'Z', 0x00,0x86,0x9A,0xB2,0xC2,0x00, ',', 0x00,0x01,0x0e,0x0c,0x00,0x00, '.', 0x00,0x00,0x06,0x06,0x00,0x00, '%', 0x72,0x54,0x78,0x1e,0x2a,0x4e, '!', 0x00,0x00,0x7a,0x00,0x00,0x00, '?', 0x00,0x20,0x4a,0x30,0x00,0x00, '-', 0x00,0x10,0x10,0x10,0x10,0x00, '+', 0x08,0x08,0x3e,0x08,0x08,0x00, '/', 0x00,0x02,0x0c,0x30,0x40,0x00, '*', 0x22,0x14,0x08,0x14,0x22,0x00, ':', 0x00,0x00,0x14,0x00,0x00,0x00, '"', 0x00,0xC0,0x00,0xC0,0x00,0x00, '#', 0x28,0xFE,0x28,0xFE,0x28,0x00, '(', 0x00,0x00,0x7C,0x82,0x00,0x00, ')', 0x00,0x00,0x82,0x7C,0x00,0x00, ';', 0x00,0x02,0x24,0x00,0x00,0x00, '~', 0x00,0x40,0x80,0x40,0x80,0x00, ';', 0x00,0x02,0x24,0x00,0x00,0x00, '=', 0x00,0x28,0x28,0x28,0x28,0x00, '|', 0x00,0x00,0xFE,0x00,0x00,0x00, '>', 0x00,0x82,0x44,0x28,0x10,0x00, '<', 0x00,0x10,0x28,0x44,0x82,0x00, '@', 0x00,0x00,0x00,0x00,0x00,0x00, // End mark of Character_font_6x8 }; typedef struct { uint8_t data[3]; }LED_Matrix_Clock_Number_Font_3x8_TypeDef; const LED_Matrix_Clock_Number_Font_3x8_TypeDef Clock_Number_font_3x8[] PROGMEM = { 0x7C,0x44,0x7C, //0 0x00,0x7C,0x00, //1 0x5C,0x54,0x74, //2 0x54,0x54,0x7C, //3 0x70,0x10,0x7C, //4 0x74,0x54,0x5C, //5 0x7C,0x54,0x5C, //6 0x40,0x40,0x7C, //7 0x7C,0x54,0x7C, //8 0x74,0x54,0x7C, //9 0x00,0x04,0x00, //. 0x20,0x20,0x20, //- 0x00,0x00,0x00, // }; #endif
// // IASKSettingsStore.h // http://www.inappsettingskit.com // // Copyright (c) 2010: // Luc Vandal, Edovia Inc., http://www.edovia.com // Ortwin Gentz, FutureTap GmbH, http://www.futuretap.com // Marc-Etienne M.Léveillé, Edovia Inc., http://www.edovia.com // All rights reserved. // // It is appreciated but not required that you give credit to Luc Vandal and Ortwin Gentz, // as the original authors of this code. You can give credit in a blog post, a tweet or on // a info page of your app. Also, the original authors appreciate letting them know if you use this code. // // This code is licensed under the BSD license that is available at: http://www.opensource.org/licenses/bsd-license.php // #import <Foundation/Foundation.h> /** protocol that needs to be implemented from a settings store */ @protocol IASKSettingsStore <NSObject> @required - (void)setBool:(BOOL)value forKey:(NSString*)key; - (void)setFloat:(float)value forKey:(NSString*)key; - (void)setDouble:(double)value forKey:(NSString*)key; - (void)setInteger:(int)value forKey:(NSString*)key; - (void)setObject:(id)value forKey:(NSString*)key; - (BOOL)boolForKey:(NSString*)key; - (float)floatForKey:(NSString*)key; - (double)doubleForKey:(NSString*)key; - (int)integerForKey:(NSString*)key; - (id)objectForKey:(NSString*)key; - (BOOL)synchronize; // Write settings to a permanant storage. Returns YES on success, NO otherwise @end /** abstract default implementation of IASKSettingsStore protocol helper to implement a store which maps all methods to setObject:forKey: and objectForKey:. Those 2 methods need to be overwritten. */ @interface IASKAbstractSettingsStore : NSObject <IASKSettingsStore> /** default implementation raises an exception must be overridden by subclasses */ - (void)setObject:(id)value forKey:(NSString*)key; /** default implementation raises an exception must be overridden by subclasses */ - (id)objectForKey:(NSString*)key; /** default implementation does nothing and returns NO */ - (BOOL)synchronize; @end
#include "tommath.h" #ifdef BN_MP_SQRMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a * a (mod b) */ int mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) { int res; mp_int t; if ((res = mp_init (&t)) != MP_OKAY) { return res; } if ((res = mp_sqr (a, &t)) != MP_OKAY) { mp_clear (&t); return res; } res = mp_mod (&t, b, c); mp_clear (&t); return res; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c, v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
/**************************************************************** * * * Copyright 2001, 2007 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "gdsroot.h" #include "gdskill.h" #include "gvcst_kill_sort.h" #define S_CUTOFF 15 void gvcst_kill_sort(kill_set *k) { block_id_ptr_t stack[50],*sp; block_id v,t; block_id_ptr_t l,r; block_id_ptr_t ix,jx,kx; assert(k->used <= BLKS_IN_KILL_SET); sp = stack; l = (block_id_ptr_t)(k->blk); r = l + k->used-1; for (;;) if (r - l < S_CUTOFF) { for (ix = l + 1 ; ix <= r ; ix++) { for (jx = ix , t = *ix; jx > l && *(jx-1) > t; jx--) *jx = *(jx - 1); *jx = t; } if (sp <= stack) break; else { l = *--sp; r = *--sp; } } else { ix = l; jx = r; kx = l + ((int)(r - l) / 2); kx = (*ix > *jx) ? ((*jx > *kx) ? jx: ((*ix > *kx) ? kx : ix)): ((*jx < *kx) ? jx: ((*ix > *kx) ? ix : kx)); t = *kx; *kx = *jx; *jx = t; ix--; do { do ix++; while (*ix < t); do jx--; while (*jx > t); v = *ix; *ix = *jx; *jx = v; } while (jx > ix); *jx = *ix; *ix = *r; *r = v; if (ix - l > r - ix) { *sp++ = ix - 1; *sp++ = l; l = ix + 1; } else { *sp++ = r; *sp++ = ix + 1; r = ix - 1; } } return; }
/* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published by the * Free Software Foundation; either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef WMOROOT_H #define WMOROOT_H #include <string> #include <vector> #include "ChunkedData.h" #include "Utils.h" #include "WorldModelGroup.h" class WorldModelRoot { public: WorldModelRoot(std::string path); ~WorldModelRoot(); std::string Path; ChunkedData* Data; WorldModelHeader Header; std::vector<DoodadInstance> DoodadInstances; std::vector<DoodadSet> DoodadSets; std::vector<WorldModelGroup> Groups; private: void ReadGroups(); void ReadDoodadSets(); void ReadDoodadInstances(); void ReadHeader(); }; #endif
/* * This file is part of libFirm. * Copyright (C) 2012 University of Karlsruhe. */ /** * @file * @brief Performs SSA destruction. * @author Daniel Grund * @date 25.05.2005 */ #ifndef FIRM_BE_BESSADESTR_H #define FIRM_BE_BESSADESTR_H #include <stdbool.h> #include "be_types.h" #include "firm_types.h" /** * Performs SSA destruction. Arguments get adjusted, phi nodes just stay. */ void be_ssa_destruction(ir_graph *irg, const arch_register_class_t *cls); #endif
/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -c AccountManagerProxy -p accountmanagerproxy.h:accountmanagerproxy.cpp org.freedesktop.Telepathy.AccountManager.xml org.freedesktop.Telepathy.AccountManager * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef ACCOUNTMANAGERPROXY_H_1281083196 #define ACCOUNTMANAGERPROXY_H_1281083196 #include <QtCore/QObject> #include <QtCore/QByteArray> #include <QtCore/QList> #include <QtCore/QMap> #include <QtCore/QString> #include <QtCore/QStringList> #include <QtCore/QVariant> #include <QtDBus/QtDBus> /* * Proxy class for interface org.freedesktop.Telepathy.AccountManager */ class AccountManagerProxy: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() { return "org.freedesktop.Telepathy.AccountManager"; } public: AccountManagerProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); ~AccountManagerProxy(); public Q_SLOTS: // METHODS inline QDBusPendingReply<QDBusObjectPath> CreateAccount(const QString &Connection_Manager, const QString &Protocol, const QString &Display_Name, const QVariantMap &Parameters, const QVariantMap &Properties) { QList<QVariant> argumentList; argumentList << qVariantFromValue(Connection_Manager) << qVariantFromValue(Protocol) << qVariantFromValue(Display_Name) << qVariantFromValue(Parameters) << qVariantFromValue(Properties); return asyncCallWithArgumentList(QLatin1String("CreateAccount"), argumentList); } Q_SIGNALS: // SIGNALS void AccountRemoved(const QDBusObjectPath &in0); void AccountValidityChanged(const QDBusObjectPath &in0, bool in1); }; namespace org { namespace freedesktop { namespace Telepathy { typedef ::AccountManagerProxy AccountManager; } } } #endif
/** * This file is part of TelepathyQt * * @copyright Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/> * @copyright Copyright (C) 2008 Nokia Corporation * @license LGPL 2.1 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _TelepathyQt_key_file_h_HEADER_GUARD_ #define _TelepathyQt_key_file_h_HEADER_GUARD_ #include <TelepathyQt/Global> #include <QMetaType> #include <QtGlobal> class QString; class QStringList; #ifndef DOXYGEN_SHOULD_SKIP_THIS namespace Tp { class TP_QT_NO_EXPORT KeyFile { public: enum Status { None = 0, NoError, NotFoundError, AccessError, FormatError, }; KeyFile(); KeyFile(const KeyFile &other); KeyFile(const QString &fileName); ~KeyFile(); KeyFile &operator=(const KeyFile &other); void setFileName(const QString &fileName); QString fileName() const; Status status() const; void setGroup(const QString &group); QString group() const; QStringList allGroups() const; QStringList allKeys() const; QStringList keys() const; bool contains(const QString &key) const; QString rawValue(const QString &key) const; QString value(const QString &key) const; QStringList valueAsStringList(const QString &key) const; static bool unescapeString(const QByteArray &data, int from, int to, QString &result); static bool unescapeStringList(const QByteArray &data, int from, int to, QStringList &result); private: struct Private; friend struct Private; Private *mPriv; }; } Q_DECLARE_METATYPE(Tp::KeyFile); #endif /* DOXYGEN_SHOULD_SKIP_THIS */ #endif
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** **************************************************************************/ #ifndef SUBDIRSPROJECTWIZARDDIALOG_H #define SUBDIRSPROJECTWIZARDDIALOG_H #include "qtwizard.h" namespace Qt4ProjectManager { namespace Internal { struct QtProjectParameters; class SubdirsProjectWizardDialog : public BaseQt4ProjectWizardDialog { Q_OBJECT public: explicit SubdirsProjectWizardDialog(const QString &templateName, const QIcon &icon, QWidget *parent, const Core::WizardDialogParameters &parameters); QtProjectParameters parameters() const; }; } // namespace Internal } // namespace Qt4ProjectManager #endif // SUBDIRSPROJECTWIZARDDIALOG_H
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names ** of its contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef TOOLS_H #define TOOLS_H #using <mscorlib.dll> QT_BEGIN_NAMESPACE class QString; QT_END_NAMESPACE System::String *QStringToString(const QString &qstring); QString StringToQString(System::String *string); #endif // TOOLS_H
/* GTK - The GIMP Toolkit * gtkpapersize.h: Paper Size * Copyright (C) 2006, Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GTK_PAPER_SIZE_H__ #define __GTK_PAPER_SIZE_H__ #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif #include <gtk/gtkenums.h> G_BEGIN_DECLS typedef struct _GtkPaperSize GtkPaperSize; #define GTK_TYPE_PAPER_SIZE (gtk_paper_size_get_type ()) /* Common names, from PWG 5101.1-2002 PWG: Standard for Media Standardized Names */ #define GTK_PAPER_NAME_A3 "iso_a3" #define GTK_PAPER_NAME_A4 "iso_a4" #define GTK_PAPER_NAME_A5 "iso_a5" #define GTK_PAPER_NAME_B5 "iso_b5" #define GTK_PAPER_NAME_LETTER "na_letter" #define GTK_PAPER_NAME_EXECUTIVE "na_executive" #define GTK_PAPER_NAME_LEGAL "na_legal" GType gtk_paper_size_get_type (void) G_GNUC_CONST; GtkPaperSize *gtk_paper_size_new (const gchar *name); GtkPaperSize *gtk_paper_size_new_from_ppd (const gchar *ppd_name, const gchar *ppd_display_name, gdouble width, gdouble height); GtkPaperSize *gtk_paper_size_new_custom (const gchar *name, const gchar *display_name, gdouble width, gdouble height, GtkUnit unit); GtkPaperSize *gtk_paper_size_copy (GtkPaperSize *other); void gtk_paper_size_free (GtkPaperSize *size); gboolean gtk_paper_size_is_equal (GtkPaperSize *size1, GtkPaperSize *size2); GList *gtk_paper_size_get_paper_sizes (gboolean include_custom); /* The width is always the shortest side, measure in mm */ const gchar *gtk_paper_size_get_name (GtkPaperSize *size); const gchar *gtk_paper_size_get_display_name (GtkPaperSize *size); const gchar *gtk_paper_size_get_ppd_name (GtkPaperSize *size); gdouble gtk_paper_size_get_width (GtkPaperSize *size, GtkUnit unit); gdouble gtk_paper_size_get_height (GtkPaperSize *size, GtkUnit unit); gboolean gtk_paper_size_is_custom (GtkPaperSize *size); /* Only for custom sizes: */ void gtk_paper_size_set_size (GtkPaperSize *size, gdouble width, gdouble height, GtkUnit unit); gdouble gtk_paper_size_get_default_top_margin (GtkPaperSize *size, GtkUnit unit); gdouble gtk_paper_size_get_default_bottom_margin (GtkPaperSize *size, GtkUnit unit); gdouble gtk_paper_size_get_default_left_margin (GtkPaperSize *size, GtkUnit unit); gdouble gtk_paper_size_get_default_right_margin (GtkPaperSize *size, GtkUnit unit); const gchar *gtk_paper_size_get_default (void); GtkPaperSize *gtk_paper_size_new_from_key_file (GKeyFile *key_file, const gchar *group_name, GError **error); void gtk_paper_size_to_key_file (GtkPaperSize *size, GKeyFile *key_file, const gchar *group_name); G_END_DECLS #endif /* __GTK_PAPER_SIZE_H__ */
#ifndef TEST_SDB_H #define TEST_SDB_H static void diff_cb(const SdbDiff *diff, void *user) { char buf[2048]; if (sdb_diff_format (buf, sizeof (buf), diff) < 0) { return; } printf ("%s\n", buf); } static inline void print_sdb(Sdb *sdb) { Sdb *e = sdb_new0 (); sdb_diff (e, sdb, diff_cb, NULL); sdb_free (e); } #define assert_sdb_eq(actual, expected, msg) mu_assert ((msg), sdb_diff (expected, actual, diff_cb, NULL)); #endif //R2DB_TEST_UTILS_H
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_PLATFORM_MEM_H_ #define TENSORFLOW_PLATFORM_MEM_H_ #include "tensorflow/core/platform/platform.h" #include "tensorflow/core/platform/types.h" // Include appropriate platform-dependent implementation of // TF_ANNOTATE_MEMORY_IS_INITIALIZED. #if defined(PLATFORM_GOOGLE) #include "tensorflow/core/platform/google/build_config/dynamic_annotations.h" #elif defined(PLATFORM_POSIX) || defined(PLATFORM_POSIX_ANDROID) || \ defined(PLATFORM_GOOGLE_ANDROID) #include "tensorflow/core/platform/default/dynamic_annotations.h" #else #error Define the appropriate PLATFORM_<foo> macro for this platform #endif namespace tensorflow { namespace port { // Aligned allocation/deallocation void* aligned_malloc(size_t size, int minimum_alignment); void aligned_free(void* aligned_memory); // Tries to release num_bytes of free memory back to the operating // system for reuse. Use this routine with caution -- to get this // memory back may require faulting pages back in by the OS, and // that may be slow. // // Currently, if a malloc implementation does not support this // routine, this routine is a no-op. void MallocExtension_ReleaseToSystem(std::size_t num_bytes); // Returns the actual number N of bytes reserved by the malloc for the // pointer p. This number may be equal to or greater than the number // of bytes requested when p was allocated. // // This routine is just useful for statistics collection. The // client must *not* read or write from the extra bytes that are // indicated by this call. // // Example, suppose the client gets memory by calling // p = malloc(10) // and GetAllocatedSize(p) may return 16. The client must only use the // first 10 bytes p[0..9], and not attempt to read or write p[10..15]. // // Currently, if a malloc implementation does not support this // routine, this routine returns 0. std::size_t MallocExtension_GetAllocatedSize(const void* p); // Prefetching support // // Defined behavior on some of the uarchs: // PREFETCH_HINT_T0: // prefetch to all levels of the hierarchy (except on p4: prefetch to L2) // PREFETCH_HINT_NTA: // p4: fetch to L2, but limit to 1 way (out of the 8 ways) // core: skip L2, go directly to L1 // k8 rev E and later: skip L2, can go to either of the 2-ways in L1 enum PrefetchHint { PREFETCH_HINT_T0 = 3, // More temporal locality PREFETCH_HINT_T1 = 2, PREFETCH_HINT_T2 = 1, // Less temporal locality PREFETCH_HINT_NTA = 0 // No temporal locality }; template <PrefetchHint hint> void prefetch(const void* x); // --------------------------------------------------------------------------- // Inline implementation // --------------------------------------------------------------------------- template <PrefetchHint hint> inline void prefetch(const void* x) { #if defined(__llvm__) || defined(COMPILER_GCC) __builtin_prefetch(x, 0, hint); #else // You get no effect. Feel free to add more sections above. #endif } } // namespace port } // namespace tensorflow #endif // TENSORFLOW_PLATFORM_MEM_H_
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WebEventListenerProperties_h #define WebEventListenerProperties_h #include "WebCommon.h" namespace blink { enum class WebEventListenerClass { TouchStartOrMove, // This value includes "touchstart", "touchmove" and // "pointer" events. MouseWheel, // This value includes "wheel" and "mousewheel" events. TouchEndOrCancel, // This value includes "touchend", "touchcancel" events. }; // Indicates the variety of event listener types for a given // WebEventListenerClass. enum class WebEventListenerProperties { Nothing, // This should be "None"; but None #defined in X11's X.h Passive, // This indicates solely passive listeners. Blocking, // This indicates solely blocking listeners. BlockingAndPassive, // This indicates >= 1 blocking listener and >= 1 passive // listeners. }; } // namespace blink #endif
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_FACTORY_FOR_PROFILE_SYNC_TEST_H_ #define COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_FACTORY_FOR_PROFILE_SYNC_TEST_H_ #include <memory> #include <string> #include "base/callback.h" #include "components/sync/engine/sync_manager_factory.h" namespace syncer { class SyncManagerFactoryForProfileSyncTest : public SyncManagerFactory { public: explicit SyncManagerFactoryForProfileSyncTest(base::Closure init_callback); ~SyncManagerFactoryForProfileSyncTest() override; std::unique_ptr<SyncManager> CreateSyncManager( const std::string& name) override; private: base::Closure init_callback_; }; } // namespace syncer #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_FACTORY_FOR_PROFILE_SYNC_TEST_H_
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SKSL_EXPRESSIONSTATEMENT #define SKSL_EXPRESSIONSTATEMENT #include "SkSLExpression.h" #include "SkSLStatement.h" namespace SkSL { /** * A lone expression being used as a statement. */ struct ExpressionStatement : public Statement { ExpressionStatement(std::unique_ptr<Expression> expression) : INHERITED(expression->fOffset, kExpression_Kind) , fExpression(std::move(expression)) {} std::unique_ptr<Statement> clone() const override { return std::unique_ptr<Statement>(new ExpressionStatement(fExpression->clone())); } String description() const override { return fExpression->description() + ";"; } std::unique_ptr<Expression> fExpression; typedef Statement INHERITED; }; } // namespace #endif
/* -*- mode: C -*- */ /* IGraph library. Copyright (C) 2012 Gabor Csardi <csardi.gabor@gmail.com> 334 Harvard st, Cambridge MA, 02139 USA This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <igraph.h> int main() { igraph_t graph; igraph_matrix_t coords; int i; igraph_matrix_init(&coords, 0, 0); for (i=0; i<10; i++) { igraph_erdos_renyi_game(&graph, IGRAPH_ERDOS_RENYI_GNP, /*n=*/ 100, /*p=*/ 2.0/100, IGRAPH_UNDIRECTED, /*loops=*/ 0); igraph_layout_mds(&graph, &coords, /*dist=*/ 0, /*dim=*/ 2, /*options=*/ 0); igraph_destroy(&graph); } igraph_matrix_destroy(&coords); return 0; }
/** * @file uartRead.c */ /* Embedded Xinu, Copyright (C) 2009, 2013. All rights reserved. */ #include <uart.h> #include <interrupt.h> /** * @ingroup uartgeneric * * Reads data from a UART. * * @param devptr * Pointer to the device table entry for a UART. * @param buf * Pointer to a buffer into which to place the read data. * @param len * Maximum number of bytes of data to read. * * @return * On success, returns the number of bytes read, which normally is @p len, * but may be less than @p len if the UART has been set to non-blocking * mode. Returns SYSERR on other error (currently, only if uartInit() has * not yet been called). */ devcall uartRead(device *devptr, void *buf, uint len) { irqmask im; struct uart *uartptr; uint count; uchar c; /* Disable interrupts and get a pointer to the UART structure. */ im = disable(); uartptr = &uarttab[devptr->minor]; /* Make sure uartInit() has run. */ if (NULL == uartptr->csr) { restore(im); return SYSERR; } /* Attempt to read each byte requested. */ for (count = 0; count < len; count++) { /* If the UART is in non-blocking mode, ensure there is a byte available * in the input buffer from the lower half (interrupt handler). If not, * return early with a short count. */ if ((uartptr->iflags & UART_IFLAG_NOBLOCK) && uartptr->icount == 0) { break; } /* Wait for there to be at least one byte in the input buffer from the * lower half (interrupt handler), then remove it. */ wait(uartptr->isema); c = uartptr->in[uartptr->istart]; ((uchar*)buf)[count] = c; uartptr->icount--; uartptr->istart = (uartptr->istart + 1) % UART_IBLEN; /* If the UART is in echo mode, echo the byte back to the UART. */ if (uartptr->iflags & UART_IFLAG_ECHO) { uartPutc(uartptr->dev, c); } } /* Restore interrupts and return the number of bytes read. */ restore(im); return count; }
/* 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_SUBSCRIBE_BUTTON_RESPONSE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_ #include "application_manager/commands/command_response_impl.h" #include "utils/macro.h" namespace application_manager { namespace commands { /** * @brief SubscribeButtonResponse command class **/ class SubscribeButtonResponse : public CommandResponseImpl { public: /** * @brief SubscribeButtonResponse class constructor * * @param message Incoming SmartObject message **/ explicit SubscribeButtonResponse(const MessageSharedPtr& message); /** * @brief SubscribeButtonResponse class destructor **/ virtual ~SubscribeButtonResponse(); /** * @brief Execute command **/ virtual void Run(); private: DISALLOW_COPY_AND_ASSIGN(SubscribeButtonResponse); }; } // namespace commands } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_BUTTON_RESPONSE_H_
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef GRPC_INTERNAL_CORE_CENSUS_CONTEXT_H #define GRPC_INTERNAL_CORE_CENSUS_CONTEXT_H #include <grpc/census.h> /* census_context is the in-memory representation of information needed to * maintain tracing, RPC statistics and resource usage information. */ struct census_context { gpr_uint64 op_id; /* Operation identifier - unique per-context */ gpr_uint64 trace_id; /* Globally unique trace identifier */ /* TODO(aveitch) Add census tags: const census_tag_set *tags; */ }; #endif /* GRPC_INTERNAL_CORE_CENSUS_CONTEXT_H */
/* This file is part of the Pangolin Project. * http://github.com/stevenlovegrove/Pangolin * * Copyright (c) 2013 Steven Lovegrove * * 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 PANGOLIN_COMPAT_TYPE_TRAITS_H #define PANGOLIN_COMPAT_TYPE_TRAITS_H #include <pangolin/platform.h> #include <typeinfo> #ifdef CPP11_NO_BOOST #include <type_traits> #else #include <boost/type_traits.hpp> #endif #include <pangolin/compat/boostd.h> // enable_if From Boost namespace pangolin { template <bool B, class T = void> struct enable_if_c { typedef T type; }; template <class T> struct enable_if_c<false, T> {}; template <class Cond, class T = void> struct enable_if : public enable_if_c<Cond::value, T> {}; } #endif // PANGOLIN_COMPAT_TYPE_TRAITS_H
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_COMMON_CONFLICTS_MODULE_WATCHER_WIN_H_ #define CHROME_COMMON_CONFLICTS_MODULE_WATCHER_WIN_H_ #include <memory> #include "base/callback.h" #include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" class ModuleWatcherTest; union LDR_DLL_NOTIFICATION_DATA; // This class observes modules as they are loaded into a process's address // space. // // This class is safe to be created on any thread. Similarly, it is safe to be // destroyed on any thread, independent of the thread on which the instance was // created. class ModuleWatcher { public: // The types of module events that can occur. enum class ModuleEventType { // A module was already loaded, but its presence is being observed. kModuleAlreadyLoaded, // A module is in the process of being loaded. kModuleLoaded, }; // Houses information about a module event, and some module metadata. struct ModuleEvent { ModuleEvent() = default; ModuleEvent(const ModuleEvent& other) = default; ModuleEvent(ModuleEventType event_type, const base::FilePath& module_path, void* module_load_address, size_t module_size) : event_type(event_type), module_path(module_path), module_load_address(module_load_address), module_size(module_size) {} // The type of module event. ModuleEventType event_type; // The full path to the module on disk. base::FilePath module_path; // The load address of the module. Careful consideration must be made before // accessing memory at this address. See the comment for // OnModuleEventCallback. raw_ptr<void> module_load_address; // The size of the module in memory. size_t module_size; }; // The type of callback that will be invoked for each module event. This // callback may be run from any thread in the process, and may be invoked // during initialization (while iterating over already loaded modules) or in // response to LdrDllNotifications received from the loader. As such, keep the // amount of work performed here to an absolute minimum. // // MODULE_LOADED events are always dispatched directly from the loader while // under the loader's lock, so the module is guaranteed to be loaded in memory // (it is safe to access module_load_address). // // If the event is of type MODULE_ALREADY_LOADED, then the module data comes // from a snapshot and it is possible that its |module_load_address| is // invalid by the time the event is sent. // // Note that it is possible for this callback to be invoked after the // destruction of the watcher. using OnModuleEventCallback = base::RepeatingCallback<void(const ModuleEvent& event)>; // Creates and starts a watcher. This enumerates all loaded modules // synchronously on the current thread during construction, and provides // synchronous notifications as modules are loaded. The callback is invoked in // the context of the thread that is loading a module, and as such may be // invoked on any thread in the process. Note that it is possible to receive // two notifications for some modules as the initial loaded module enumeration // races briefly with the callback mechanism. In this case both a // MODULE_LOADED and a MODULE_ALREADY_LOADED event will be received for the // same module. Since the callback is installed first no modules can be // missed, however. This factory function may be called on any thread. // // Only a single instance of a watcher may exist at any moment. This will // return nullptr when trying to create a second watcher. static std::unique_ptr<ModuleWatcher> Create(OnModuleEventCallback callback); ModuleWatcher(const ModuleWatcher&) = delete; ModuleWatcher& operator=(const ModuleWatcher&) = delete; // This can be called on any thread. After destruction the |callback| // provided to the constructor will no longer be invoked with module events. ~ModuleWatcher(); private: // For unittesting. friend class ModuleWatcherTest; // Private to enforce Singleton semantics. See Create above. ModuleWatcher(); // Initializes the ModuleWatcher instance. void Initialize(OnModuleEventCallback callback); // Registers a DllNotification callback with the OS. Modifies // |dll_notification_cookie_|. Can be called on any thread. void RegisterDllNotificationCallback(); // Removes the installed DllNotification callback. Modifies // |dll_notification_cookie_|. Can be called on any thread. void UnregisterDllNotificationCallback(); // Enumerates all currently loaded modules, synchronously invoking callbacks // on the current thread. Can be called on any thread. static void EnumerateAlreadyLoadedModules( scoped_refptr<base::SequencedTaskRunner> task_runner, OnModuleEventCallback callback); // Helper function for retrieving the callback associated with a given // LdrNotification context. static OnModuleEventCallback GetCallbackForContext(void* context); // The loader notification callback. This is actually // void CALLBACK LoaderNotificationCallback( // DWORD, const LDR_DLL_NOTIFICATION_DATA*, PVOID) // Not using CALLBACK/DWORD/PVOID allows skipping the windows.h header from // this file. static void __stdcall LoaderNotificationCallback( unsigned long notification_reason, const LDR_DLL_NOTIFICATION_DATA* notification_data, void* context); // Used to bind the |callback_| to a WeakPtr. void RunCallback(const ModuleEvent& event); // The current callback. Can end up being invoked on any thread. OnModuleEventCallback callback_; // Used by the DllNotification mechanism. void* dll_notification_cookie_ = nullptr; base::WeakPtrFactory<ModuleWatcher> weak_ptr_factory_{this}; }; #endif // CHROME_COMMON_CONFLICTS_MODULE_WATCHER_WIN_H_
#ifndef __LINUX_JIFFIES_WRAPPER_H #define __LINUX_JIFFIES_WRAPPER_H 1 #include_next <linux/jiffies.h> #include <linux/version.h> /* Same as above, but does so with platform independent 64bit types. * These must be used when utilizing jiffies_64 (i.e. return value of * get_jiffies_64() */ #ifndef time_after64 #define time_after64(a, b) \ (typecheck(__u64, a) && \ typecheck(__u64, b) && \ ((__s64)(b) - (__s64)(a) < 0)) #endif #ifndef time_before64 #define time_before64(a, b) time_after64(b, a) #endif #ifndef time_after_eq64 #define time_after_eq64(a, b) \ (typecheck(__u64, a) && \ typecheck(__u64, b) && \ ((__s64)(a) - (__s64)(b) >= 0)) #endif #ifndef time_before_eq64 #define time_before_eq64(a, b) time_after_eq64(b, a) #endif #endif
// Copyright (c) 2014 The ShadowCoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_STEALTH_H #define BITCOIN_STEALTH_H #include "util.h" #include "serialize.h" #include <stdlib.h> #include <stdio.h> #include <vector> #include <inttypes.h> typedef std::vector<uint8_t> data_chunk; const size_t ec_secret_size = 32; const size_t ec_compressed_size = 33; const size_t ec_uncompressed_size = 65; typedef struct ec_secret { uint8_t e[ec_secret_size]; } ec_secret; typedef data_chunk ec_point; typedef uint32_t stealth_bitfield; struct stealth_prefix { uint8_t number_bits; stealth_bitfield bitfield; }; template <typename T, typename Iterator> T from_big_endian(Iterator in) { //VERIFY_UNSIGNED(T); T out = 0; size_t i = sizeof(T); while (0 < i) out |= static_cast<T>(*in++) << (8 * --i); return out; } template <typename T, typename Iterator> T from_little_endian(Iterator in) { //VERIFY_UNSIGNED(T); T out = 0; size_t i = 0; while (i < sizeof(T)) out |= static_cast<T>(*in++) << (8 * i++); return out; } class CStealthAddress { public: CStealthAddress() { options = 0; } uint8_t options; ec_point scan_pubkey; ec_point spend_pubkey; //std::vector<ec_point> spend_pubkeys; size_t number_signatures; stealth_prefix prefix; mutable std::string label; data_chunk scan_secret; data_chunk spend_secret; bool SetEncoded(const std::string& encodedAddress); std::string Encoded() const; bool operator <(const CStealthAddress& y) const { return memcmp(&scan_pubkey[0], &y.scan_pubkey[0], ec_compressed_size) < 0; } bool operator == (const CStealthAddress& y) const { return (scan_pubkey == y.scan_pubkey) && (spend_pubkey == y.spend_pubkey) && (scan_secret == y.scan_secret) && (spend_secret == y.spend_secret); } IMPLEMENT_SERIALIZE ( READWRITE(this->options); READWRITE(this->scan_pubkey); READWRITE(this->spend_pubkey); READWRITE(this->label); READWRITE(this->scan_secret); READWRITE(this->spend_secret); ); }; void AppendChecksum(data_chunk& data); bool VerifyChecksum(const data_chunk& data); int GenerateRandomSecret(ec_secret& out); int SecretToPublicKey(const ec_secret& secret, ec_point& out); int StealthSecret(ec_secret& secret, ec_point& pubkey, const ec_point& pkSpend, ec_secret& sharedSOut, ec_point& pkOut); int StealthSecretSpend(ec_secret& scanSecret, ec_point& ephemPubkey, ec_secret& spendSecret, ec_secret& secretOut); int StealthSharedToSecretSpend(ec_secret& sharedS, ec_secret& spendSecret, ec_secret& secretOut); bool IsStealthAddress(const std::string& encodedAddress); #endif // BITCOIN_STEALTH_H
// // STXFeedTableViewDelegate.h // STXDynamicTableView // // Created by Jesse Armand on 27/3/14. // Copyright (c) 2014 2359 Media. All rights reserved. // @import Foundation; @protocol STXFeedPhotoCellDelegate; @protocol STXLikesCellDelegate; @protocol STXCaptionCellDelegate; @protocol STXCommentCellDelegate; @protocol STXUserActionDelegate; @interface STXFeedTableViewDelegate : NSObject <UITableViewDelegate> @property (nonatomic) BOOL insertingRow; - (instancetype)initWithController:(id<STXFeedPhotoCellDelegate, STXLikesCellDelegate, STXCaptionCellDelegate, STXCommentCellDelegate, STXUserActionDelegate>)controller; - (void)reloadAtIndexPath:(NSIndexPath *)indexPath forTableView:(UITableView *)tableView; @end
/* * Copyright (c) 2014 ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #include <barrelfish/barrelfish.h> #include <virtio/virtio_guest.h> #include "guest/channel.h" struct virtio_guest_chan_fn *vguest_chan_fn = NULL; /** * */ errval_t virtio_guest_init(enum virtio_guest_channel backend, char *iface) { errval_t err; switch (backend) { case VIRTIO_GUEST_CHAN_FLOUNDER: err = virtio_guest_flounder_init(iface); break; case VIRTIO_GUEST_CHAN_XEON_PHI: err = virtio_guest_xeon_phi_init(); break; default: err = -1; break; } if (err_is_fail(err)) { return err; } assert(vguest_chan_fn); return SYS_ERR_OK; }
/* Verify that ftell returns the correct value after a read and a write on a file opened in a+ mode. Copyright (C) 2014 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <locale.h> #include <wchar.h> /* data points to either char_data or wide_data, depending on whether we're testing regular file mode or wide mode respectively. Similarly, fputs_func points to either fputs or fputws. data_len keeps track of the length of the current data and file_len maintains the current file length. */ #define BUF_LEN 4 static void *buf; static char char_buf[BUF_LEN]; static wchar_t wide_buf[BUF_LEN]; static const void *data; static const char *char_data = "abcdefghijklmnopqrstuvwxyz"; static const wchar_t *wide_data = L"abcdefghijklmnopqrstuvwxyz"; static size_t data_len; static size_t file_len; typedef int (*fputs_func_t) (const void *data, FILE *fp); fputs_func_t fputs_func; typedef void *(*fgets_func_t) (void *s, int size, FILE *stream); fgets_func_t fgets_func; static int do_test (void); #define TEST_FUNCTION do_test () #include "../test-skeleton.c" static FILE * init_file (const char *filename) { FILE *fp = fopen (filename, "w"); if (fp == NULL) { printf ("fopen: %m\n"); return NULL; } int written = fputs_func (data, fp); if (written == EOF) { printf ("fputs failed to write data\n"); fclose (fp); return NULL; } file_len = data_len; fclose (fp); fp = fopen (filename, "a+"); if (fp == NULL) { printf ("fopen(a+): %m\n"); return NULL; } return fp; } static int do_one_test (const char *filename) { FILE *fp = init_file (filename); if (fp == NULL) return 1; void *ret = fgets_func (buf, BUF_LEN, fp); if (ret == NULL) { printf ("read failed: %m\n"); fclose (fp); return 1; } int written = fputs_func (data, fp); if (written == EOF) { printf ("fputs failed to write data\n"); fclose (fp); return 1; } file_len += data_len; long off = ftell (fp); if (off != file_len) { printf ("Incorrect offset %ld, expected %zu\n", off, file_len); fclose (fp); return 1; } else printf ("Correct offset %ld after write.\n", off); return 0; } /* Run the tests for regular files and wide mode files. */ static int do_test (void) { int ret = 0; char *filename; int fd = create_temp_file ("tst-ftell-append-tmp.", &filename); if (fd == -1) { printf ("create_temp_file: %m\n"); return 1; } close (fd); /* Tests for regular files. */ puts ("Regular mode:"); fputs_func = (fputs_func_t) fputs; fgets_func = (fgets_func_t) fgets; data = char_data; buf = char_buf; data_len = strlen (char_data); ret |= do_one_test (filename); /* Tests for wide files. */ puts ("Wide mode:"); if (setlocale (LC_ALL, "en_US.UTF-8") == NULL) { printf ("Cannot set en_US.UTF-8 locale.\n"); return 1; } fputs_func = (fputs_func_t) fputws; fgets_func = (fgets_func_t) fgetws; data = wide_data; buf = wide_buf; data_len = wcslen (wide_data); ret |= do_one_test (filename); return ret; }
#pragma once /* * Copyright (C) 2010-2012 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "Interfaces/AESink.h" #include <stdint.h> #include <dsound.h> #include "../Utils/AEDeviceInfo.h" #include "threads/CriticalSection.h" class CAESinkDirectSound : public IAESink { public: virtual const char *GetName() { return "DirectSound"; } CAESinkDirectSound(); virtual ~CAESinkDirectSound(); virtual bool Initialize (AEAudioFormat &format, std::string &device); virtual void Deinitialize(); virtual bool IsCompatible(const AEAudioFormat format, const std::string device); virtual void Stop (); virtual double GetDelay (); virtual double GetCacheTime (); virtual double GetCacheTotal (); virtual unsigned int AddPackets (uint8_t *data, unsigned int frames, bool hasAudio); virtual bool SoftSuspend (); virtual bool SoftResume (); static std::string GetDefaultDevice (); static void EnumerateDevicesEx (AEDeviceInfoList &deviceInfoList, bool force = false); private: void AEChannelsFromSpeakerMask(DWORD speakers); DWORD SpeakerMaskFromAEChannels(const CAEChannelInfo &channels); void CheckPlayStatus(); bool UpdateCacheStatus(); unsigned int GetSpace(); const char *dserr2str(int err); static const char *WASAPIErrToStr(HRESULT err); LPDIRECTSOUNDBUFFER m_pBuffer; LPDIRECTSOUND8 m_pDSound; AEAudioFormat m_format; enum AEDataFormat m_encodedFormat; CAEChannelInfo m_channelLayout; std::string m_device; unsigned int m_AvgBytesPerSec; unsigned int m_dwChunkSize; unsigned int m_dwFrameSize; unsigned int m_dwBufferLen; unsigned int m_BufferOffset; unsigned int m_CacheLen; unsigned int m_LastCacheCheck; unsigned int m_BufferTimeouts; bool m_running; bool m_initialized; bool m_isDirtyDS; CCriticalSection m_runLock; };
/* libFLAC - Free Lossless Audio Codec library * Copyright (C) 2004-2009 Josh Coalson * Copyright (C) 2011-2013 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the Xiph.org Foundation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FLAC__PRIVATE__FLOAT_H #define FLAC__PRIVATE__FLOAT_H #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "../../../ordinals.h" /* * These typedefs make it easier to ensure that integer versions of * the library really only contain integer operations. All the code * in libFLAC should use FLAC__float and FLAC__double in place of * float and double, and be protected by checks of the macro * FLAC__INTEGER_ONLY_LIBRARY. * * FLAC__real is the basic floating point type used in LPC analysis. */ #ifndef FLAC__INTEGER_ONLY_LIBRARY typedef double FLAC__double; typedef float FLAC__float; /* * WATCHOUT: changing FLAC__real will change the signatures of many * functions that have assembly language equivalents and break them. */ typedef float FLAC__real; #else /* * The convention for FLAC__fixedpoint is to use the upper 16 bits * for the integer part and lower 16 bits for the fractional part. */ typedef FLAC__int32 FLAC__fixedpoint; extern const FLAC__fixedpoint FLAC__FP_ZERO; extern const FLAC__fixedpoint FLAC__FP_ONE_HALF; extern const FLAC__fixedpoint FLAC__FP_ONE; extern const FLAC__fixedpoint FLAC__FP_LN2; extern const FLAC__fixedpoint FLAC__FP_E; #define FLAC__fixedpoint_trunc(x) ((x)>>16) #define FLAC__fixedpoint_mul(x, y) ( (FLAC__fixedpoint) ( ((FLAC__int64)(x)*(FLAC__int64)(y)) >> 16 ) ) #define FLAC__fixedpoint_div(x, y) ( (FLAC__fixedpoint) ( ( ((FLAC__int64)(x)<<32) / (FLAC__int64)(y) ) >> 16 ) ) /* * FLAC__fixedpoint_log2() * -------------------------------------------------------------------- * Returns the base-2 logarithm of the fixed-point number 'x' using an * algorithm by Knuth for x >= 1.0 * * 'fracbits' is the number of fractional bits of 'x'. 'fracbits' must * be < 32 and evenly divisible by 4 (0 is OK but not very precise). * * 'precision' roughly limits the number of iterations that are done; * use (unsigned)(-1) for maximum precision. * * If 'x' is less than one -- that is, x < (1<<fracbits) -- then this * function will punt and return 0. * * The return value will also have 'fracbits' fractional bits. */ FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned precision); #endif #endif
/* * Copyright (c) 2016 Vittorio Giovara <vittorio.giovara@gmail.com> * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * Spherical video */ #ifndef AVUTIL_SPHERICAL_H #define AVUTIL_SPHERICAL_H #include <stddef.h> #include <stdint.h> /** * @addtogroup lavu_video * @{ * * @defgroup lavu_video_spherical Spherical video mapping * @{ */ /** * @addtogroup lavu_video_spherical * A spherical video file contains surfaces that need to be mapped onto a * sphere. Depending on how the frame was converted, a different distortion * transformation or surface recomposition function needs to be applied before * the video should be mapped and displayed. */ /** * Projection of the video surface(s) on a sphere. */ enum AVSphericalProjection { /** * Video represents a sphere mapped on a flat surface using * equirectangular projection. */ AV_SPHERICAL_EQUIRECTANGULAR, /** * Video frame is split into 6 faces of a cube, and arranged on a * 3x2 layout. Faces are oriented upwards for the front, left, right, * and back faces. The up face is oriented so the top of the face is * forwards and the down face is oriented so the top of the face is * to the back. */ AV_SPHERICAL_CUBEMAP, }; /** * This structure describes how to handle spherical videos, outlining * information about projection, initial layout, and any other view modifier. * * @note The struct must be allocated with av_spherical_alloc() and * its size is not a part of the public ABI. */ typedef struct AVSphericalMapping { /** * Projection type. */ enum AVSphericalProjection projection; /** * @name Initial orientation * @{ * There fields describe additional rotations applied to the sphere after * the video frame is mapped onto it. The sphere is rotated around the * viewer, who remains stationary. The order of transformation is always * yaw, followed by pitch, and finally by roll. * * The coordinate system matches the one defined in OpenGL, where the * forward vector (z) is coming out of screen, and it is equivalent to * a rotation matrix of R = r_y(yaw) * r_x(pitch) * r_z(roll). * * A positive yaw rotates the portion of the sphere in front of the viewer * toward their right. A positive pitch rotates the portion of the sphere * in front of the viewer upwards. A positive roll tilts the portion of * the sphere in front of the viewer to the viewer's right. * * These values are exported as 16.16 fixed point. * * See this equirectangular projection as example: * * @code{.unparsed} * Yaw * -180 0 180 * 90 +-------------+-------------+ 180 * | | | up * P | | | y| forward * i | ^ | | /z * t 0 +-------------X-------------+ 0 Roll | / * c | | | | / * h | | | 0|/_____right * | | | x * -90 +-------------+-------------+ -180 * * X - the default camera center * ^ - the default up vector * @endcode */ int32_t yaw; ///< Rotation around the up vector [-180, 180]. int32_t pitch; ///< Rotation around the right vector [-90, 90]. int32_t roll; ///< Rotation around the forward vector [-180, 180]. /** * @} */ } AVSphericalMapping; /** * Allocate a AVSphericalVideo structure and initialize its fields to default * values. * * @return the newly allocated struct or NULL on failure */ AVSphericalMapping *av_spherical_alloc(size_t *size); /** * @} * @} */ #endif /* AVUTIL_SPHERICAL_H */
/* Measure STRCHR functions. Copyright (C) 2013-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #define TEST_MAIN #ifndef WIDE # ifdef USE_FOR_STRCHRNUL # define TEST_NAME "strchrnul" # else # define TEST_NAME "strchr" # endif /* !USE_FOR_STRCHRNUL */ #else # ifdef USE_FOR_STRCHRNUL # define TEST_NAME "wcschrnul" # else # define TEST_NAME "wcschr" # endif /* !USE_FOR_STRCHRNUL */ #endif /* WIDE */ #include "bench-string.h" #ifndef WIDE # ifdef USE_FOR_STRCHRNUL # define STRCHR strchrnul # define stupid_STRCHR stupid_STRCHRNUL # define simple_STRCHR simple_STRCHRNUL # else # define STRCHR strchr # endif /* !USE_FOR_STRCHRNUL */ # define STRLEN strlen # define CHAR char # define BIG_CHAR CHAR_MAX # define MIDDLE_CHAR 127 # define SMALL_CHAR 23 # define UCHAR unsigned char #else # include <wchar.h> # ifdef USE_FOR_STRCHRNUL # define STRCHR wcschrnul # define stupid_STRCHR stupid_WCSCHRNUL # define simple_STRCHR simple_WCSCHRNUL # else # define STRCHR wcschr # endif /* !USE_FOR_STRCHRNUL */ # define STRLEN wcslen # define CHAR wchar_t # define BIG_CHAR WCHAR_MAX # define MIDDLE_CHAR 1121 # define SMALL_CHAR 851 # define UCHAR wchar_t #endif /* WIDE */ #ifdef USE_FOR_STRCHRNUL # define NULLRET(endptr) endptr #else # define NULLRET(endptr) NULL #endif /* !USE_FOR_STRCHRNUL */ typedef CHAR *(*proto_t) (const CHAR *, int); CHAR * simple_STRCHR (const CHAR *s, int c) { for (; *s != (CHAR) c; ++s) if (*s == '\0') return NULLRET ((CHAR *) s); return (CHAR *) s; } CHAR * stupid_STRCHR (const CHAR *s, int c) { size_t n = STRLEN (s) + 1; while (n--) if (*s++ == (CHAR) c) return (CHAR *) s - 1; return NULLRET ((CHAR *) s - 1); } IMPL (stupid_STRCHR, 0) IMPL (simple_STRCHR, 0) IMPL (STRCHR, 1) static void do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res) { size_t i, iters = INNER_LOOP_ITERS; timing_t start, stop, cur; TIMING_NOW (start); for (i = 0; i < iters; ++i) { CALL (impl, s, c); } TIMING_NOW (stop); TIMING_DIFF (cur, start, stop); TIMING_PRINT_MEAN ((double) cur, (double) iters); } static void do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char) /* For wcschr: align here means align not in bytes, but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t)) len for wcschr here isn't in bytes but it's number of wchar_t symbols. */ { size_t i; CHAR *result; CHAR *buf = (CHAR *) buf1; align &= 15; if ((align + len) * sizeof (CHAR) >= page_size) return; for (i = 0; i < len; ++i) { buf[align + i] = 32 + 23 * i % max_char; if (buf[align + i] == seek_char) buf[align + i] = seek_char + 1; else if (buf[align + i] == 0) buf[align + i] = 1; } buf[align + len] = 0; if (pos < len) { buf[align + pos] = seek_char; result = buf + align + pos; } else if (seek_char == 0) result = buf + align + len; else result = NULLRET (buf + align + len); printf ("Length %4zd, alignment in bytes %2zd:", pos, align * sizeof (CHAR)); FOR_EACH_IMPL (impl, 0) do_one_test (impl, buf + align, seek_char, result); putchar ('\n'); } int test_main (void) { size_t i; test_init (); printf ("%20s", ""); FOR_EACH_IMPL (impl, 0) printf ("\t%s", impl->name); putchar ('\n'); for (i = 1; i < 8; ++i) { do_test (0, 16 << i, 2048, SMALL_CHAR, MIDDLE_CHAR); do_test (i, 16 << i, 2048, SMALL_CHAR, MIDDLE_CHAR); } for (i = 1; i < 8; ++i) { do_test (i, 64, 256, SMALL_CHAR, MIDDLE_CHAR); do_test (i, 64, 256, SMALL_CHAR, BIG_CHAR); } for (i = 0; i < 32; ++i) { do_test (0, i, i + 1, SMALL_CHAR, MIDDLE_CHAR); do_test (0, i, i + 1, SMALL_CHAR, BIG_CHAR); } for (i = 1; i < 8; ++i) { do_test (0, 16 << i, 2048, 0, MIDDLE_CHAR); do_test (i, 16 << i, 2048, 0, MIDDLE_CHAR); } for (i = 1; i < 8; ++i) { do_test (i, 64, 256, 0, MIDDLE_CHAR); do_test (i, 64, 256, 0, BIG_CHAR); } for (i = 0; i < 32; ++i) { do_test (0, i, i + 1, 0, MIDDLE_CHAR); do_test (0, i, i + 1, 0, BIG_CHAR); } return ret; } #include "../test-skeleton.c"
/* unistd.h <ndf@linux.mit.edu> */ #include <features.h> #include <sys/types.h> #ifndef __UNISTD_H #define __UNISTD_H #include <errno.h> #include <asm/unistd.h> #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 __BEGIN_DECLS extern int vhangup __P ((void)); extern int close __P ((int)); extern int read __P ((int __fd, void * __buf, size_t __nbytes)); extern int write __P ((int __fd, __const void * __buf, size_t __n)); extern off_t lseek __P ((int __fd, off_t __n, int __whence)); extern int pipe __P ((int __pipedes[2])); extern unsigned int alarm __P ((unsigned int __seconds)); extern int sleep __P ((unsigned int __seconds)); extern void usleep __P ((unsigned long __microseconds)); extern int pause __P ((void)); extern char* crypt __P((__const char *__key, __const char *__salt)); extern int isatty __P ((int __fd)); extern char *ttyname __P ((int __fd)); extern int readlink __P ((__const char *__path, char *__buf, size_t __len)); extern int link __P ((__const char *__from, __const char *__to)); extern int symlink __P ((__const char *__from, __const char *__to)); extern int readlink __P ((__const char *__path, char *__buf, size_t __len)); extern int unlink __P ((__const char *__name)); extern char *getcwd __P ((char *__buf, size_t __size)); extern int fchdir __P ((int __fd)); extern int chdir __P ((__const char *__path)); extern int chown __P ((__const char *__file, uid_t __owner, gid_t __group)); extern int fchown __P ((int __fd, uid_t __owner, gid_t __group)); extern int chroot __P ((__const char *__path)); extern int truncate __P ((__const char *path, __off_t __length)); extern int ftruncate __P ((int __fd, __off_t __length)); extern int fsync __P ((int __fd)); extern int sync __P ((void)); extern int rmdir __P ((__const char *__path)); extern int access __P ((__const char *__name, int __type)); extern int _clone __P ((int (*fn)(void *arg), void *child_stack, int flags, void *arg)); extern long sysconf __P ((int name)); extern pid_t getpid __P ((void)); extern pid_t getppid __P ((void)); extern pid_t getpgrp __P ((void)); extern pid_t tcgetpgrp __P ((int)); extern int setpgrp __P ((void)); extern int tcsetpgrp __P ((int, pid_t)); extern pid_t setsid __P ((void)); extern int sethostname __P ((__const char *name, size_t len)); extern int gethostname __P ((char *__name, size_t __len)); extern int getdomainname __P ((char *__name, size_t __len)); extern int setdomainname __P ((__const char *__name, size_t __len)); extern char *getpass __P ((__const char *__prompt)); extern int getdtablesize __P ((void)); extern pid_t vfork __P ((void)); extern void _exit __P ((int __status)) __attribute__ ((__noreturn__)); extern int dup __P ((int __fd)); extern int dup2 __P ((int __fd, int __fd2)); extern int execl __P ((__const char *__path, __const char *__arg, ...)); extern int execlp __P ((__const char *__file, __const char *__arg, ...)); extern int execle __P ((__const char *__path, __const char *__arg, ...)); extern int execv __P ((__const char *__path, char *__const __argv[])); extern int execvp __P ((__const char *__file, char *__const __argv[])); extern int execve __P ((__const char *__filename, char *__const __argv[], char *__const envp[])); extern int execvep __P (( __const char *file, char * __const argv[], char * __const envp[])); extern void *sbrk __P ((ptrdiff_t __delta)); extern int setuid __P ((uid_t uid)); extern int seteuid __P ((uid_t euid)); extern int setreuid __P ((uid_t ruid, uid_t euid)); extern uid_t getuid __P ((void)); extern uid_t geteuid __P ((void)); extern gid_t getgid __P ((void)); extern gid_t getegid __P ((void)); extern int setgid __P ((gid_t gid)); extern int setegid __P ((gid_t egid)); extern int setregid __P ((gid_t rgid, gid_t egid)); extern int getgroups __P ((int size, gid_t list[])); extern int getopt __P((int argc, char *__const argv[], __const char *optstring)); extern char *optarg; extern int optind, opterr, optopt; __END_DECLS #define fork fork_not_available_use_vfork #define clone clone_not_available_use__clone #ifndef SEEK_SET #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #endif #ifndef R_OK #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ #endif /* And now we'll include the sysconf definitions */ #include <bits/confname.h> extern char **environ; #endif /* __UNISTD_H */
/* * Copyright (C) 2009 by Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef FECDecoder_H #define FECDecoder_H class IFECDecoder { public: virtual bool decode(const bool* in, bool* out, unsigned int inLen, unsigned int& outLen) = 0; private: }; #endif
/* Openswan NAT-Traversal * Copyright (C) 2002-2003 Mathieu Lafon - Arkoon Network Security * Copyright 2005 Michael Richardson <mcr@xelerance.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. See <http://www.fsf.org/copyleft/gpl.txt>. * * 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. * * RCSID $Id: natt_defines.h,v 1.1 2005/04/08 18:23:10 mcr Exp $ */ #ifndef NATT_DEFINES_H #ifndef SOL_UDP #define SOL_UDP 17 #endif #ifndef UDP_ESPINUDP #define UDP_ESPINUDP 100 #endif #define NATT_DEFINES_H #endif
#include <hwloc.h> #include <stdio.h> /* The body of the test is in a separate .c file and a separate library, just to ensure that hwloc didn't force compilation with visibility flags enabled. */ int do_test(void) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_bitmap_t cpu_set; /* Just call a bunch of functions to see if we can link and run */ printf("*** Test 1: bitmap alloc\n"); cpu_set = mytest_hwloc_bitmap_alloc(); if (NULL == cpu_set) return 1; printf("*** Test 2: topology init\n"); if (0 != mytest_hwloc_topology_init(&topology)) return 1; printf("*** Test 3: topology load\n"); if (0 != mytest_hwloc_topology_load(topology)) return 1; printf("*** Test 4: topology get depth\n"); depth = mytest_hwloc_topology_get_depth(topology); if (depth > 10000) return 1; printf(" Max depth: %u\n", depth); printf("*** Test 5: topology destroy\n"); mytest_hwloc_topology_destroy(topology); printf("*** Test 6: bitmap free\n"); mytest_hwloc_bitmap_free(cpu_set); return 0; }
/* * Copyright (C) 2008 Search Solution Corporation. All rights reserved by Search Solution. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ // ToolManage.h: interface for the CUniToolManage class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_UNITOOLMANAGE_H__058665D6_5812_4FE1_8EE2_647FC440052E__INCLUDED_) #define AFX_UNITOOLMANAGE_H__058665D6_5812_4FE1_8EE2_647FC440052E__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 //#include "unitray_comm.h" class CUniToolManage { public: CUniToolManage (); virtual ~ CUniToolManage (); char *cubridmanager_path; bool bStartVSQL (); bool bStartEasyManage (); bool bCheckInstallVSQL (); bool bCheckInstallEasyManage (); }; #endif // !defined(AFX_UNITOOLMANAGE_H__058665D6_5812_4FE1_8EE2_647FC440052E__INCLUDED_)
/* * Copyright (C) 2008 Tommi Maekitalo * * 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 * is provided AS IS, WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and * NON-INFRINGEMENT. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef ZIM_FILEHEADER_H #define ZIM_FILEHEADER_H #include <zim/zim.h> #include <zim/endian.h> #include <zim/uuid.h> #include <iosfwd> #include <limits> #ifdef _WIN32 #define NOMINMAX #include <windows.h> #undef NOMINMAX #undef max #endif namespace zim { class Fileheader { public: static const size_type zimMagic; static const size_type zimVersion; static const size_type size; private: Uuid uuid; size_type articleCount; offset_type titleIdxPos; offset_type urlPtrPos; offset_type mimeListPos; size_type blobCount; offset_type blobPtrPos; size_type mainPage; size_type layoutPage; offset_type checksumPos; public: Fileheader() : articleCount(0), titleIdxPos(0), urlPtrPos(0), blobCount(0), blobPtrPos(0), mainPage(std::numeric_limits<size_type>::max()), layoutPage(std::numeric_limits<size_type>::max()), checksumPos(std::numeric_limits<offset_type>::max()) {} const Uuid& getUuid() const { return uuid; } void setUuid(const Uuid& uuid_) { uuid = uuid_; } size_type getArticleCount() const { return articleCount; } void setArticleCount(size_type s) { articleCount = s; } offset_type getTitleIdxPos() const { return titleIdxPos; } void setTitleIdxPos(offset_type p) { titleIdxPos = p; } offset_type getUrlPtrPos() const { return urlPtrPos; } void setUrlPtrPos(offset_type p) { urlPtrPos = p; } offset_type getMimeListPos() const { return mimeListPos; } void setMimeListPos(offset_type p) { mimeListPos = p; } size_type getClusterCount() const { return blobCount; } void setClusterCount(size_type s) { blobCount = s; } offset_type getClusterPtrPos() const { return blobPtrPos; } void setClusterPtrPos(offset_type p) { blobPtrPos = p; } bool hasMainPage() const { return mainPage != std::numeric_limits<size_type>::max(); } size_type getMainPage() const { return mainPage; } void setMainPage(size_type s) { mainPage = s; } bool hasLayoutPage() const { return layoutPage != std::numeric_limits<size_type>::max(); } size_type getLayoutPage() const { return layoutPage; } void setLayoutPage(size_type s) { layoutPage = s; } bool hasChecksum() const { return getMimeListPos() >= 80; } offset_type getChecksumPos() const { return hasChecksum() ? checksumPos : 0; } void setChecksumPos(offset_type p) { checksumPos = p; } }; std::ostream& operator<< (std::ostream& out, const Fileheader& fh); std::istream& operator>> (std::istream& in, Fileheader& fh); } #endif // ZIM_FILEHEADER_H
/* **************************************************************************** * eID Middleware Project. * Copyright (C) 2012 FedICT. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version * 3.0 as published by the Free Software Foundation. * * 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 * Lesser 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/. **************************************************************************** */ #ifndef plugin_getreadercount_h #define plugin_getreadercount_h #include "common.h" CK_RV GetTheReaderCount(int* nrofCardReaders, int cardsInserted); #endif
/** * * Phantom OS multithreading library. * * Copyright (C) 2009-2010 Dmitry Zavalishin, dz@dz.ru * * Run queues handling. * * Licensed under CPL 1.0, see LICENSE file. * **/ #include <queue.h> #include <hal.h> #include <malloc.h> #include "thread_private.h" phantom_thread_t * t_dequeue_highest_prio(queue_head_t *queue) { phantom_thread_t *nextt = 0; #if 0 queue_remove_first(queue, nextt, phantom_thread_t *, chain); #else phantom_thread_t *it; unsigned int max = 0; queue_iterate(queue, it, phantom_thread_t *, chain) { assert(it != GET_CURRENT_THREAD()); if (it->priority > max) { max = it->priority; nextt = it; } } if(nextt != 0) queue_remove(queue, nextt, phantom_thread_t *, chain); #endif return nextt; } void t_queue_check(queue_head_t *queue, phantom_thread_t *test) { phantom_thread_t *next; queue_iterate(queue, next, phantom_thread_t *, chain) assert(next != test); }
// // CppParserTestSuite.h // // $Id: //poco/1.3/CppParser/testsuite/src/CppParserTestSuite.h#1 $ // // Definition of the CppParserTestSuite class. // // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #ifndef CppParserTestSuite_INCLUDED #define CppParserTestSuite_INCLUDED #include "CppUnit/TestSuite.h" class CppParserTestSuite { public: static CppUnit::Test* suite(); }; #endif // CppParserTestSuite_INCLUDED
/* Copyright 2007, 2008 Daniel Zerbino (zerbino@ebi.ac.uk) This file is part of Velvet. Velvet 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. Velvet 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 Velvet; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SHORTREADPAIRS_H_ #define _SHORTREADPAIRS_H_ // Original boolean pushNeighboursInterRepeat(Node * node, Node * nodeInterRepeat, Node * oppositeNode, Graph * argGraph); // Original void exploitShortReadPairs(Graph * graph, ReadSet * reads, boolean * dubious, boolean force_jumps); void detachImprobablePairs(ReadSet * sequences, Graph * graph); void handicapNode(Node * node); NodeList *getMarkedNodeList(); #endif
/* * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #import <Foundation/Foundation.h> #import "EC2DescribeImagesResponse.h" #import "EC2ResponseUnmarshaller.h" #import "../AmazonValueUnmarshaller.h" #import "../AmazonBoolValueUnmarshaller.h" #import "../AmazonListUnmarshaller.h" #import "EC2ImageUnmarshaller.h" /** * Describe Images Response Unmarshaller */ @interface EC2DescribeImagesResponseUnmarshaller:EC2ResponseUnmarshaller { EC2DescribeImagesResponse *response; } @property (nonatomic, readonly) EC2DescribeImagesResponse *response; -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict; -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName; @end
//===- include/Core/Instrumentation.h - Instrumentation API ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// Provide an Instrumentation API that optionally uses VTune interfaces. /// //===----------------------------------------------------------------------===// #ifndef LLD_CORE_INSTRUMENTATION_H #define LLD_CORE_INSTRUMENTATION_H #include "llvm/Support/Compiler.h" #include <utility> #ifdef LLD_HAS_VTUNE # include <ittnotify.h> #endif namespace lld { #ifdef LLD_HAS_VTUNE /// A unique global scope for instrumentation data. /// /// Domains last for the lifetime of the application and cannot be destroyed. /// Multiple Domains created with the same name represent the same domain. class Domain { __itt_domain *_domain; public: explicit Domain(const char *name) : _domain(__itt_domain_createA(name)) {} operator __itt_domain *() const { return _domain; } __itt_domain *operator->() const { return _domain; } }; /// A global reference to a string constant. /// /// These are uniqued by the ITT runtime and cannot be deleted. They are not /// specific to a domain. /// /// Prefer reusing a single StringHandle over passing a ntbs when the same /// string will be used often. class StringHandle { __itt_string_handle *_handle; public: StringHandle(const char *name) : _handle(__itt_string_handle_createA(name)) {} operator __itt_string_handle *() const { return _handle; } }; /// A task on a single thread. Nests within other tasks. /// /// Each thread has its own task stack and tasks nest recursively on that stack. /// A task cannot transfer threads. /// /// SBRM is used to ensure task starts and ends are ballanced. The lifetime of /// a task is either the lifetime of this object, or until end is called. class ScopedTask { __itt_domain *_domain; ScopedTask(const ScopedTask &) = delete; ScopedTask &operator=(const ScopedTask &) = delete; public: /// Create a task in Domain \p d named \p s. ScopedTask(const Domain &d, const StringHandle &s) : _domain(d) { __itt_task_begin(d, __itt_null, __itt_null, s); } ScopedTask(ScopedTask &&other) { *this = std::move(other); } ScopedTask &operator=(ScopedTask &&other) { _domain = other._domain; other._domain = nullptr; return *this; } /// Prematurely end this task. void end() { if (_domain) __itt_task_end(_domain); _domain = nullptr; } ~ScopedTask() { end(); } }; /// A specific point in time. Allows metadata to be associated. class Marker { public: Marker(const Domain &d, const StringHandle &s) { __itt_marker(d, __itt_null, s, __itt_scope_global); } }; #else class Domain { public: Domain(const char *name) {} }; class StringHandle { public: StringHandle(const char *name) {} }; class ScopedTask { public: ScopedTask(const Domain &d, const StringHandle &s) {} void end() {} }; class Marker { public: Marker(const Domain &d, const StringHandle &s) {} }; #endif inline const Domain &getDefaultDomain() { static Domain domain("org.llvm.lld"); return domain; } } // end namespace lld. #endif
#ifndef AXIS2_CREATEACCOUNTRESPONSE_H #define AXIS2_CREATEACCOUNTRESPONSE_H /** * axis2_createAccountResponse.h * * This file was auto-generated from WSDL * by the Apache Axis2 version: #axisVersion# #today# */ #include <stdio.h> #include <axiom.h> #include <axutil_utils.h> #include <axiom_soap.h> #include <axis2_client.h> #ifdef __cplusplus extern "C" { #endif #define AXIS2_DEFAULT_DIGIT_LIMIT 64 /** * axis2_createAccountResponse class class */ typedef struct axis2_createAccountResponse axis2_createAccountResponse_t; AXIS2_EXTERN axis2_createAccountResponse_t* AXIS2_CALL axis2_createAccountResponse_create( const axutil_env_t *env ); axis2_status_t AXIS2_CALL axis2_createAccountResponse_free ( axis2_createAccountResponse_t* createAccountResponse, const axutil_env_t *env); axutil_qname_t* AXIS2_CALL axis2_createAccountResponse_get_qname ( axis2_createAccountResponse_t* createAccountResponse, const axutil_env_t *env); axiom_node_t* AXIS2_CALL axis2_createAccountResponse_serialize( axis2_createAccountResponse_t* createAccountResponse, const axutil_env_t *env, axiom_node_t* createAccountResponse_om_node, int has_parent); axis2_status_t AXIS2_CALL axis2_createAccountResponse_deserialize( axis2_createAccountResponse_t* createAccountResponse, const axutil_env_t *env, axiom_node_t* parent); /** * getter for userid. */ axis2_char_t* AXIS2_CALL axis2_createAccountResponse_get_userid( axis2_createAccountResponse_t* createAccountResponse, const axutil_env_t *env); /** * setter for userid */ axis2_status_t AXIS2_CALL axis2_createAccountResponse_set_userid( axis2_createAccountResponse_t* createAccountResponse, const axutil_env_t *env, axis2_char_t* param_userid); #ifdef __cplusplus } #endif #endif /* AXIS2_CREATEACCOUNTRESPONSE_H */
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_COMMON_SYSTEM_TRAY_THROBBER_VIEW_H_ #define ASH_COMMON_SYSTEM_TRAY_THROBBER_VIEW_H_ #include "base/macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/throbber.h" #include "ui/views/view.h" namespace ash { // A SmoothedThrobber with tooltip. class SystemTrayThrobber : public views::SmoothedThrobber { public: SystemTrayThrobber(); ~SystemTrayThrobber() override; void SetTooltipText(const base::string16& tooltip_text); // Overriden from views::View. bool GetTooltipText(const gfx::Point& p, base::string16* tooltip) const override; private: // The current tooltip text. base::string16 tooltip_text_; DISALLOW_COPY_AND_ASSIGN(SystemTrayThrobber); }; // A View containing a SystemTrayThrobber with animation for starting/stopping. class ThrobberView : public views::View { public: ThrobberView(); ~ThrobberView() override; void Start(); void Stop(); void SetTooltipText(const base::string16& tooltip_text); // Overriden from views::View. gfx::Size GetPreferredSize() const override; void Layout() override; bool GetTooltipText(const gfx::Point& p, base::string16* tooltip) const override; private: // Schedules animation for starting/stopping throbber. void ScheduleAnimation(bool start_throbber); SystemTrayThrobber* throbber_; // The current tooltip text. base::string16 tooltip_text_; DISALLOW_COPY_AND_ASSIGN(ThrobberView); }; } // namespace ash #endif // ASH_COMMON_SYSTEM_TRAY_THROBBER_VIEW_H_
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ #define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" #include "chrome/browser/browser_process_platform_part_base.h" namespace base { class CommandLine; } namespace chromeos { class ChromeUserManager; class ProfileHelper; class TimeZoneResolver; } namespace chromeos { namespace system { class AutomaticRebootManager; class DeviceDisablingManager; class DeviceDisablingManagerDefaultDelegate; } } namespace policy { class BrowserPolicyConnector; class BrowserPolicyConnectorChromeOS; } namespace session_manager { class SessionManager; } class Profile; class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase, public base::NonThreadSafe { public: BrowserProcessPlatformPart(); ~BrowserProcessPlatformPart() override; void InitializeAutomaticRebootManager(); void ShutdownAutomaticRebootManager(); void InitializeChromeUserManager(); void DestroyChromeUserManager(); void InitializeDeviceDisablingManager(); void ShutdownDeviceDisablingManager(); void InitializeSessionManager(const base::CommandLine& parsed_command_line, Profile* profile, bool is_running_test); void ShutdownSessionManager(); // Disable the offline interstitial easter egg if the device is enterprise // enrolled. void DisableDinoEasterEggIfEnrolled(); // Returns the SessionManager instance that is used to initialize and // start user sessions as well as responsible on launching pre-session UI like // out-of-box or login. virtual session_manager::SessionManager* SessionManager(); // Returns the ProfileHelper instance that is used to identify // users and their profiles in Chrome OS multi user session. chromeos::ProfileHelper* profile_helper(); chromeos::system::AutomaticRebootManager* automatic_reboot_manager() { return automatic_reboot_manager_.get(); } policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_chromeos(); chromeos::ChromeUserManager* user_manager() { return chrome_user_manager_.get(); } chromeos::system::DeviceDisablingManager* device_disabling_manager() { return device_disabling_manager_.get(); } chromeos::TimeZoneResolver* GetTimezoneResolver(); // Overridden from BrowserProcessPlatformPartBase: void StartTearDown() override; scoped_ptr<policy::BrowserPolicyConnector> CreateBrowserPolicyConnector() override; private: void CreateProfileHelper(); scoped_ptr<session_manager::SessionManager> session_manager_; bool created_profile_helper_; scoped_ptr<chromeos::ProfileHelper> profile_helper_; scoped_ptr<chromeos::system::AutomaticRebootManager> automatic_reboot_manager_; scoped_ptr<chromeos::ChromeUserManager> chrome_user_manager_; scoped_ptr<chromeos::system::DeviceDisablingManagerDefaultDelegate> device_disabling_manager_delegate_; scoped_ptr<chromeos::system::DeviceDisablingManager> device_disabling_manager_; scoped_ptr<chromeos::TimeZoneResolver> timezone_resolver_; DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart); }; #endif // CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_CHROMEOS_H_
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // CRX filesystem is a filesystem that allows an extension to read its own // package directory tree. See ppapi/examples/crxfs for example. // // IMPLEMENTATION // // The implementation involves both browser and renderer. In order to provide // readonly access to CRX filesystem (i.e. extension directory), we create an // "isolated filesystem" pointing to current extension directory in browser. // Then browser grants read permission to renderer, and tells plugin the // filesystem id, or fsid. // // Once the plugin receives the fsid, it creates a PPB_FileSystem and forwards // the fsid to PepperFileSystemHost in order to construct root url. #ifndef PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_ #define PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_ #include <stdint.h> #include <string> #include "base/memory/ref_counted.h" #include "ppapi/proxy/connection.h" #include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/ppapi_proxy_export.h" #include "ppapi/thunk/ppb_isolated_file_system_private_api.h" namespace ppapi { class TrackedCallback; namespace proxy { class ResourceMessageReplyParams; class PPAPI_PROXY_EXPORT IsolatedFileSystemPrivateResource : public PluginResource, public thunk::PPB_IsolatedFileSystem_Private_API { public: IsolatedFileSystemPrivateResource( Connection connection, PP_Instance instance); IsolatedFileSystemPrivateResource(const IsolatedFileSystemPrivateResource&) = delete; IsolatedFileSystemPrivateResource& operator=( const IsolatedFileSystemPrivateResource&) = delete; ~IsolatedFileSystemPrivateResource() override; // Resource overrides. thunk::PPB_IsolatedFileSystem_Private_API* AsPPB_IsolatedFileSystem_Private_API() override; // PPB_IsolatedFileSystem_Private_API implementation. int32_t Open(PP_Instance instance, PP_IsolatedFileSystemType_Private type, PP_Resource* file_system_resource, scoped_refptr<TrackedCallback> callback) override; private: void OnBrowserOpenComplete(PP_IsolatedFileSystemType_Private type, PP_Resource* file_system_resource, scoped_refptr<TrackedCallback> callback, const ResourceMessageReplyParams& params, const std::string& fsid); }; } // namespace proxy } // namespace ppapi #endif // PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file cullableObject.h * @author drose * @date 2002-03-04 */ #ifndef CULLABLEOBJECT_H #define CULLABLEOBJECT_H #include "pandabase.h" #include "geom.h" #include "geomVertexData.h" #include "renderState.h" #include "transformState.h" #include "pointerTo.h" #include "geomNode.h" #include "cullTraverserData.h" #include "pStatCollector.h" #include "deletedChain.h" #include "graphicsStateGuardianBase.h" #include "sceneSetup.h" #include "lightMutex.h" #include "callbackObject.h" #include "geomDrawCallbackData.h" class CullTraverser; class GeomMunger; /** * The smallest atom of cull. This is normally just a Geom and its associated * state, but it also contain a draw callback. */ class EXPCL_PANDA_PGRAPH CullableObject { public: INLINE CullableObject(); INLINE CullableObject(CPT(Geom) geom, CPT(RenderState) state, CPT(TransformState) internal_transform); INLINE CullableObject(const CullableObject &copy); INLINE void operator = (const CullableObject &copy); bool munge_geom(GraphicsStateGuardianBase *gsg, GeomMunger *munger, const CullTraverser *traverser, bool force); INLINE void draw(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread); INLINE bool request_resident() const; INLINE static void flush_level(); INLINE void set_draw_callback(CallbackObject *draw_callback); INLINE void draw_inline(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread); INLINE void draw_callback(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread); public: ALLOC_DELETED_CHAIN(CullableObject); void output(std::ostream &out) const; public: CPT(Geom) _geom; CPT(GeomVertexData) _munged_data; CPT(RenderState) _state; CPT(TransformState) _internal_transform; PT(CallbackObject) _draw_callback; private: bool munge_points_to_quads(const CullTraverser *traverser, bool force); static CPT(RenderState) get_flash_cpu_state(); static CPT(RenderState) get_flash_hardware_state(); private: // This class is used internally by munge_points_to_quads(). class PointData { public: PN_stdfloat _dist; }; class SortPoints { public: INLINE SortPoints(const PointData *array); INLINE bool operator ()(unsigned short a, unsigned short b) const; const PointData *_array; }; // This is a cache of converted vertex formats. class SourceFormat { public: SourceFormat(const GeomVertexFormat *format, bool sprite_texcoord); INLINE bool operator < (const SourceFormat &other) const; CPT(GeomVertexFormat) _format; bool _sprite_texcoord; bool _retransform_sprites; }; typedef pmap<SourceFormat, CPT(GeomVertexFormat) > FormatMap; static FormatMap _format_map; static LightMutex _format_lock; static PStatCollector _munge_pcollector; static PStatCollector _munge_geom_pcollector; static PStatCollector _munge_sprites_pcollector; static PStatCollector _munge_sprites_verts_pcollector; static PStatCollector _munge_sprites_prims_pcollector; static PStatCollector _sw_sprites_pcollector; public: static TypeHandle get_class_type() { return _type_handle; } static void init_type() { register_type(_type_handle, "CullableObject"); } private: static TypeHandle _type_handle; }; INLINE std::ostream &operator << (std::ostream &out, const CullableObject &object) { object.output(out); return out; } #include "cullableObject.I" #endif
/* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { return upeek(tcp->pid, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1; }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_MESSAGE_FILTER_H_ #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_MESSAGE_FILTER_H_ #include "ipc/ipc_channel_proxy.h" namespace base { class MessageLoopProxy; } // namespace base namespace content { class IndexedDBDispatcher; class IndexedDBMessageFilter : public IPC::ChannelProxy::MessageFilter { public: IndexedDBMessageFilter(); // IPC::Listener implementation. virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; protected: virtual ~IndexedDBMessageFilter(); private: void DispatchMessage(const IPC::Message& msg); scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_; DISALLOW_COPY_AND_ASSIGN(IndexedDBMessageFilter); }; } // namespace content #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_
/*++ Copyright (c) 2011 Microsoft Corporation Module Name: sat_elim_eqs.h Abstract: Helper class for eliminating eqs. Author: Leonardo de Moura (leonardo) 2011-05-27. Revision History: --*/ #ifndef SAT_ELIM_EQS_H_ #define SAT_ELIM_EQS_H_ #include"sat_types.h" namespace sat { class solver; class elim_eqs { solver & m_solver; void save_elim(literal_vector const & roots, bool_var_vector const & to_elim); void cleanup_clauses(literal_vector const & roots, clause_vector & cs); void cleanup_bin_watches(literal_vector const & roots); bool check_clauses(literal_vector const & roots) const; public: elim_eqs(solver & s); void operator()(literal_vector const & roots, bool_var_vector const & to_elim); }; }; #endif
/* * Copyright (c) 2014 The FreeBSD Foundation. * All rights reserved. * * Portions of this software were developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. * * 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(s), this list of conditions and the following disclaimer as * the first lines of this file unmodified other than the possible * addition of one or more copyright notices. * 2. Redistributions in binary form must reproduce the above copyright * notice(s), this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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(S) 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. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <signal.h> #include "libc_private.h" __weak_reference(__sys_sigtimedwait, __sigtimedwait); #pragma weak sigtimedwait int sigtimedwait(const sigset_t * __restrict set, siginfo_t * __restrict info, const struct timespec * __restrict t) { return (((int (*)(const sigset_t *, siginfo_t *, const struct timespec *)) __libc_interposing[INTERPOS_sigtimedwait])(set, info, t)); }
// // NSDictionary+Stripe.h // Stripe // // Created by Jack Flintermann on 10/15/15. // Copyright © 2015 Stripe, Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDictionary (Stripe) - (nullable NSDictionary *)stp_dictionaryByRemovingNullsValidatingRequiredFields:(nonnull NSArray *)requiredFields; @end void linkNSDictionaryCategory(void);
// Copyright (c) 2011-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_MACNOTIFICATIONHANDLER_H #define BITCOIN_QT_MACNOTIFICATIONHANDLER_H #include <QObject> /** Macintosh-specific notification handler (supports UserNotificationCenter). */ class MacNotificationHandler : public QObject { Q_OBJECT public: /** shows a macOS 10.8+ UserNotification in the UserNotificationCenter */ void showNotification(const QString &title, const QString &text); /** check if OS can handle UserNotifications */ bool hasUserNotificationCenterSupport(void); static MacNotificationHandler *instance(); }; #endif // BITCOIN_QT_MACNOTIFICATIONHANDLER_H
/* linux/spi/ads7846.h */ /* Touchscreen characteristics vary between boards and models. The * platform_data for the device's "struct device" holds this information. * * It's OK if the min/max values are zero. */ #define MAX_12BIT ((1<<12)-1) enum ads7846_filter { ADS7846_FILTER_OK, ADS7846_FILTER_REPEAT, ADS7846_FILTER_IGNORE, }; enum ads7846_invertion_flags { XY_SWAP = 1 << 1, X_INV = 1 << 2, Y_INV = 1 << 3, }; struct ads7846_platform_data { u16 model; /* 7843, 7845, 7846. */ u16 vref_delay_usecs; /* 0 for external vref; etc */ u16 vref_mv; /* external vref value, milliVolts */ bool keep_vref_on; /* set to keep vref on for differential * measurements as well */ /* Settling time of the analog signals; a function of Vcc and the * capacitance on the X/Y drivers. If set to non-zero, two samples * are taken with settle_delay us apart, and the second one is used. * ~150 uSec with 0.01uF caps. */ u16 settle_delay_usecs; /* If set to non-zero, after samples are taken this delay is applied * and penirq is rechecked, to help avoid false events. This value * is affected by the material used to build the touch layer. */ u16 penirq_recheck_delay_usecs; u16 x_plate_ohms; u16 y_plate_ohms; u16 x_min, x_max; u16 y_min, y_max; u16 pressure_min, pressure_max; u16 debounce_max; /* max number of additional readings * per sample */ u16 debounce_tol; /* tolerance used for filtering */ u16 debounce_rep; /* additional consecutive good readings * required after the first two */ int gpio_pendown; /* the GPIO used to decide the pendown * state if get_pendown_state == NULL */ int inversion_flags; /* X/Y channels inversion / swap flags */ int (*get_pendown_state)(void); int (*filter_init) (struct ads7846_platform_data *pdata, void **filter_data); int (*filter) (void *filter_data, int data_idx, int *val); void (*filter_cleanup)(void *filter_data); void (*filter_flush)(void *filter_data); /* controls enabling/disabling*/ int (*vaux_control)(int vaux_cntrl); #define VAUX_ENABLE 1 #define VAUX_DISABLE 0 };
/* @(#)clnt_simple.c 2.2 88/08/01 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ #if 0 static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro"; #endif /* * clnt_simple.c * Simplified front end to rpc. * * Copyright (C) 1984, Sun Microsystems, Inc. */ #define __FORCE_GLIBC #include <features.h> #include <alloca.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #include "rpc_private.h" #include <sys/socket.h> #include <netdb.h> #include <string.h> libc_hidden_proto(memcpy) libc_hidden_proto(strcmp) libc_hidden_proto(strncpy) libc_hidden_proto(close) libc_hidden_proto(clntudp_create) libc_hidden_proto(gethostbyname_r) struct callrpc_private_s { CLIENT *client; int socket; u_long oldprognum, oldversnum, valid; char *oldhost; }; #ifdef __UCLIBC_HAS_THREADS__ #define callrpc_private (*(struct callrpc_private_s **)&RPC_THREAD_VARIABLE(callrpc_private_s)) #else static struct callrpc_private_s *callrpc_private; #endif int callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, xdrproc_t inproc, const char *in, xdrproc_t outproc, char *out) { struct callrpc_private_s *crp = callrpc_private; struct sockaddr_in server_addr; enum clnt_stat clnt_stat; struct hostent hostbuf, *hp; struct timeval timeout, tottimeout; if (crp == 0) { crp = (struct callrpc_private_s *) calloc (1, sizeof (*crp)); if (crp == 0) return 0; callrpc_private = crp; } if (crp->oldhost == NULL) { crp->oldhost = malloc (256); crp->oldhost[0] = 0; crp->socket = RPC_ANYSOCK; } if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum && strcmp (crp->oldhost, host) == 0) { /* reuse old client */ } else { size_t buflen; char *buffer; int herr; crp->valid = 0; if (crp->socket != RPC_ANYSOCK) { (void) close (crp->socket); crp->socket = RPC_ANYSOCK; } if (crp->client) { clnt_destroy (crp->client); crp->client = NULL; } buflen = 1024; buffer = alloca (buflen); while (gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr) != 0 || hp == NULL) if (herr != NETDB_INTERNAL || errno != ERANGE) return (int) RPC_UNKNOWNHOST; else { /* Enlarge the buffer. */ buflen *= 2; buffer = alloca (buflen); } timeout.tv_usec = 0; timeout.tv_sec = 5; memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); server_addr.sin_family = AF_INET; server_addr.sin_port = 0; if ((crp->client = clntudp_create (&server_addr, (u_long) prognum, (u_long) versnum, timeout, &crp->socket)) == NULL) return (int) get_rpc_createerr().cf_stat; crp->valid = 1; crp->oldprognum = prognum; crp->oldversnum = versnum; (void) strncpy (crp->oldhost, host, 255); crp->oldhost[255] = '\0'; } tottimeout.tv_sec = 25; tottimeout.tv_usec = 0; clnt_stat = clnt_call (crp->client, procnum, inproc, (char *) in, outproc, out, tottimeout); /* * if call failed, empty cache */ if (clnt_stat != RPC_SUCCESS) crp->valid = 0; return (int) clnt_stat; } #ifdef __UCLIBC_HAS_THREADS__ void attribute_hidden __rpc_thread_clnt_cleanup (void) { struct callrpc_private_s *rcp = RPC_THREAD_VARIABLE(callrpc_private_s); if (rcp) { if (rcp->client) CLNT_DESTROY (rcp->client); free (rcp); } } #endif /* __UCLIBC_HAS_THREADS__ */
/* Support for opening stores named in URL syntax. Copyright (C) 2001,02 Free Software Foundation, Inc. This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The GNU Hurd 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, USA. */ #include "store.h" #include <string.h> #include <stdlib.h> /* Similar to store_typed_open, but NAME must be in URL format, i.e. a class name followed by a ':' and any type-specific name. Store classes opened this way must strip off the "class:" prefix. A leading ':' or no ':' at all is invalid syntax. */ error_t store_url_open (const char *name, int flags, const struct store_class *const *classes, struct store **store) { if (name == 0 || name[0] == ':' || strchr (name, ':') == 0) return EINVAL; return store_typed_open (name, flags, classes, store); } error_t store_url_decode (struct store_enc *enc, const struct store_class *const *classes, struct store **store) { const struct store_class *cl; /* This is pretty bogus. We use decode.c's code just to validate the generic format and extract the name from the data. */ struct store dummy, *dummyptr; error_t dummy_create (mach_port_t port, int flags, size_t block_size, const struct store_run *runs, size_t num_runs, struct store **store) { *store = &dummy; return 0; } struct store_enc dummy_enc = *enc; error_t err = store_std_leaf_decode (&dummy_enc, &dummy_create, &dummyptr); if (err) return err; /* Find the class matching this name. */ cl = store_find_class (dummy.name, strchr (dummy.name, ':'), classes); # pragma weak store_module_find_class if (cl == 0 && store_module_find_class) err = store_module_find_class (dummy.name, strchr (dummy.name, ':'), &cl); free (dummy.name); free (dummy.misc); if (cl == 0) return EINVAL; /* Now that we have the class, we just punt to its own decode hook. */ return (!cl->decode ? EOPNOTSUPP : (*cl->decode) (enc, classes, store)); } /* This class is only trivially different from the "typed" class when used by name. Its real purpose is to decode file_get_storage_info results that use the STORAGE_NETWORK type, for which the convention is that the name be in URL format (i.e. "type:something"). */ const struct store_class store_url_open_class = { STORAGE_NETWORK, "url", open: store_url_open, decode: store_url_decode }; STORE_STD_CLASS (url_open);
/* Measure bzero functions. Copyright (C) 2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #define TEST_BZERO #include "bench-memset.c"
#if !defined(_AMDGPU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) #define _AMDGPU_TRACE_H_ #include <linux/stringify.h> #include <linux/types.h> #include <linux/tracepoint.h> #include <drm/drmP.h> #undef TRACE_SYSTEM #define TRACE_SYSTEM amdgpu #define TRACE_INCLUDE_FILE amdgpu_trace TRACE_EVENT(amdgpu_bo_create, TP_PROTO(struct amdgpu_bo *bo), TP_ARGS(bo), TP_STRUCT__entry( __field(struct amdgpu_bo *, bo) __field(u32, pages) ), TP_fast_assign( __entry->bo = bo; __entry->pages = bo->tbo.num_pages; ), TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages) ); TRACE_EVENT(amdgpu_cs, TP_PROTO(struct amdgpu_cs_parser *p, int i), TP_ARGS(p, i), TP_STRUCT__entry( __field(u32, ring) __field(u32, dw) __field(u32, fences) ), TP_fast_assign( __entry->ring = p->ibs[i].ring->idx; __entry->dw = p->ibs[i].length_dw; __entry->fences = amdgpu_fence_count_emitted( p->ibs[i].ring); ), TP_printk("ring=%u, dw=%u, fences=%u", __entry->ring, __entry->dw, __entry->fences) ); TRACE_EVENT(amdgpu_vm_grab_id, TP_PROTO(unsigned vmid, int ring), TP_ARGS(vmid, ring), TP_STRUCT__entry( __field(u32, vmid) __field(u32, ring) ), TP_fast_assign( __entry->vmid = vmid; __entry->ring = ring; ), TP_printk("vmid=%u, ring=%u", __entry->vmid, __entry->ring) ); TRACE_EVENT(amdgpu_vm_bo_update, TP_PROTO(struct amdgpu_bo_va_mapping *mapping), TP_ARGS(mapping), TP_STRUCT__entry( __field(u64, soffset) __field(u64, eoffset) __field(u32, flags) ), TP_fast_assign( __entry->soffset = mapping->it.start; __entry->eoffset = mapping->it.last + 1; __entry->flags = mapping->flags; ), TP_printk("soffs=%010llx, eoffs=%010llx, flags=%08x", __entry->soffset, __entry->eoffset, __entry->flags) ); TRACE_EVENT(amdgpu_vm_set_page, TP_PROTO(uint64_t pe, uint64_t addr, unsigned count, uint32_t incr, uint32_t flags), TP_ARGS(pe, addr, count, incr, flags), TP_STRUCT__entry( __field(u64, pe) __field(u64, addr) __field(u32, count) __field(u32, incr) __field(u32, flags) ), TP_fast_assign( __entry->pe = pe; __entry->addr = addr; __entry->count = count; __entry->incr = incr; __entry->flags = flags; ), TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%08x, count=%u", __entry->pe, __entry->addr, __entry->incr, __entry->flags, __entry->count) ); TRACE_EVENT(amdgpu_vm_flush, TP_PROTO(uint64_t pd_addr, unsigned ring, unsigned id), TP_ARGS(pd_addr, ring, id), TP_STRUCT__entry( __field(u64, pd_addr) __field(u32, ring) __field(u32, id) ), TP_fast_assign( __entry->pd_addr = pd_addr; __entry->ring = ring; __entry->id = id; ), TP_printk("pd_addr=%010Lx, ring=%u, id=%u", __entry->pd_addr, __entry->ring, __entry->id) ); DECLARE_EVENT_CLASS(amdgpu_fence_request, TP_PROTO(struct drm_device *dev, int ring, u32 seqno), TP_ARGS(dev, ring, seqno), TP_STRUCT__entry( __field(u32, dev) __field(int, ring) __field(u32, seqno) ), TP_fast_assign( __entry->dev = dev->primary->index; __entry->ring = ring; __entry->seqno = seqno; ), TP_printk("dev=%u, ring=%d, seqno=%u", __entry->dev, __entry->ring, __entry->seqno) ); DEFINE_EVENT(amdgpu_fence_request, amdgpu_fence_emit, TP_PROTO(struct drm_device *dev, int ring, u32 seqno), TP_ARGS(dev, ring, seqno) ); DEFINE_EVENT(amdgpu_fence_request, amdgpu_fence_wait_begin, TP_PROTO(struct drm_device *dev, int ring, u32 seqno), TP_ARGS(dev, ring, seqno) ); DEFINE_EVENT(amdgpu_fence_request, amdgpu_fence_wait_end, TP_PROTO(struct drm_device *dev, int ring, u32 seqno), TP_ARGS(dev, ring, seqno) ); DECLARE_EVENT_CLASS(amdgpu_semaphore_request, TP_PROTO(int ring, struct amdgpu_semaphore *sem), TP_ARGS(ring, sem), TP_STRUCT__entry( __field(int, ring) __field(signed, waiters) __field(uint64_t, gpu_addr) ), TP_fast_assign( __entry->ring = ring; __entry->waiters = sem->waiters; __entry->gpu_addr = sem->gpu_addr; ), TP_printk("ring=%u, waiters=%d, addr=%010Lx", __entry->ring, __entry->waiters, __entry->gpu_addr) ); DEFINE_EVENT(amdgpu_semaphore_request, amdgpu_semaphore_signale, TP_PROTO(int ring, struct amdgpu_semaphore *sem), TP_ARGS(ring, sem) ); DEFINE_EVENT(amdgpu_semaphore_request, amdgpu_semaphore_wait, TP_PROTO(int ring, struct amdgpu_semaphore *sem), TP_ARGS(ring, sem) ); #endif /* This part must be outside protection */ #undef TRACE_INCLUDE_PATH #define TRACE_INCLUDE_PATH . #include <trace/define_trace.h>
/* * This file is part of the coreboot project. * * Copyright 2015 Google Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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. */ #include <delay.h> #include <soc/addressmap.h> #include <device/i2c.h> #include <soc/clock.h> #include <soc/funitcfg.h> #include <soc/nvidia/tegra/i2c.h> #include <soc/padconfig.h> #include <soc/romstage.h> #include "gpio.h" #include "pmic.h" static const struct pad_config padcfgs[] = { /* AP_SYS_RESET_L - active low*/ PAD_CFG_GPIO_OUT1(SDMMC1_DAT0, PINMUX_PULL_UP), /* WP_L - active low */ PAD_CFG_GPIO_INPUT(GPIO_PK2, PINMUX_PULL_NONE), /* BTN_AP_PWR_L - active low */ PAD_CFG_GPIO_INPUT(BUTTON_POWER_ON, PINMUX_PULL_UP), /* BTN_AP_VOLD_L - active low */ PAD_CFG_GPIO_INPUT(BUTTON_VOL_DOWN, PINMUX_PULL_UP), /* BTN_AP_VOLU_L - active low */ PAD_CFG_GPIO_INPUT(SDMMC1_DAT1, PINMUX_PULL_UP), }; void romstage_mainboard_init(void) { soc_configure_pads(padcfgs, ARRAY_SIZE(padcfgs)); } void mainboard_configure_pmc(void) { } void mainboard_enable_vdd_cpu(void) { /* VDD_CPU is already enabled in bootblock. */ }
/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <sgtty.h> /* Set the terminal parameters associated with FD to *PARAMS. */ int stty (fd, params) int fd; const struct sgttyb *params; { return ioctl (fd, TIOCSETP, (void *) params); }
/****************************************************************************** * * Name: actables.h - ACPI table management * $Revision: 32 $ * *****************************************************************************/ /* * Copyright (C) 2000, 2001 R. Byron Moore * * 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 __ACTABLES_H__ #define __ACTABLES_H__ /* Used in Acpi_tb_map_acpi_table for size parameter if table header is to be used */ #define SIZE_IN_HEADER 0 acpi_status acpi_tb_handle_to_object ( u16 table_id, acpi_table_desc **table_desc); /* * tbconvrt - Table conversion routines */ acpi_status acpi_tb_convert_to_xsdt ( acpi_table_desc *table_info, u32 *number_of_tables); acpi_status acpi_tb_convert_table_fadt ( void); acpi_status acpi_tb_build_common_facs ( acpi_table_desc *table_info); u32 acpi_tb_get_table_count ( RSDP_DESCRIPTOR *RSDP, acpi_table_header *RSDT); /* * tbget - Table "get" routines */ acpi_status acpi_tb_get_table_ptr ( acpi_table_type table_type, u32 instance, acpi_table_header **table_ptr_loc); acpi_status acpi_tb_get_table ( ACPI_PHYSICAL_ADDRESS physical_address, acpi_table_header *buffer_ptr, acpi_table_desc *table_info); acpi_status acpi_tb_verify_rsdp ( ACPI_PHYSICAL_ADDRESS RSDP_physical_address); acpi_status acpi_tb_get_table_facs ( acpi_table_header *buffer_ptr, acpi_table_desc *table_info); ACPI_PHYSICAL_ADDRESS acpi_tb_get_rsdt_address ( void); acpi_status acpi_tb_validate_rsdt ( acpi_table_header *table_ptr); acpi_status acpi_tb_get_table_pointer ( ACPI_PHYSICAL_ADDRESS physical_address, u32 flags, u32 *size, acpi_table_header **table_ptr); /* * tbgetall - Get all firmware ACPI tables */ acpi_status acpi_tb_get_all_tables ( u32 number_of_tables, acpi_table_header *buffer_ptr); /* * tbinstall - Table installation */ acpi_status acpi_tb_install_table ( acpi_table_header *table_ptr, acpi_table_desc *table_info); acpi_status acpi_tb_recognize_table ( acpi_table_header *table_ptr, acpi_table_desc *table_info); acpi_status acpi_tb_init_table_descriptor ( acpi_table_type table_type, acpi_table_desc *table_info); /* * tbremove - Table removal and deletion */ void acpi_tb_delete_acpi_tables ( void); void acpi_tb_delete_acpi_table ( acpi_table_type type); void acpi_tb_delete_single_table ( acpi_table_desc *table_desc); acpi_table_desc * acpi_tb_uninstall_table ( acpi_table_desc *table_desc); void acpi_tb_free_acpi_tables_of_type ( acpi_table_desc *table_info); /* * tbrsd - RSDP, RSDT utilities */ acpi_status acpi_tb_get_table_rsdt ( u32 *number_of_tables); u8 * acpi_tb_scan_memory_for_rsdp ( u8 *start_address, u32 length); acpi_status acpi_tb_find_rsdp ( acpi_table_desc *table_info, u32 flags); /* * tbutils - common table utilities */ acpi_status acpi_tb_map_acpi_table ( ACPI_PHYSICAL_ADDRESS physical_address, u32 *size, acpi_table_header **logical_address); acpi_status acpi_tb_verify_table_checksum ( acpi_table_header *table_header); u8 acpi_tb_checksum ( void *buffer, u32 length); acpi_status acpi_tb_validate_table_header ( acpi_table_header *table_header); #endif /* __ACTABLES_H__ */
/****************************************************************************** * * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * ******************************************************************************/ #ifndef __RTL8712_DEBUGCTRL_BITDEF_H__ #define __RTL8712_DEBUGCTRL_BITDEF_H__ /* */ #define _BIST_RST BIT(0) /* */ #define _LMS_MSK 0x03 /* */ #define _OVSEL_MSK 0x0600 #define _OVSEL_SHT 9 #define _WDGCLR BIT(8) #define _WDGEN_MSK 0x00FF #define _WDGEN_SHT 0 /* */ #define _TXTIMER_MSK 0xF000 #define _TXTIMER_SHT 12 #define _TXNUM_MSK 0x0F00 #define _TXNUM_SHT 8 #define _RXTIMER_MSK 0x00F0 #define _RXTIMER_SHT 4 #define _RXNUM_MSK 0x000F #define _RXNUM_SHT 0 /* */ /* */ #define _TURN1 BIT(0) /* */ /* */ #define _LOCKFLAG1_MSK 0x03 #endif /* */
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AVC_DECODER_H_ #define AVC_DECODER_H_ #include <media/stagefright/MediaBuffer.h> #include <media/stagefright/MediaSource.h> #include <utils/Vector.h> struct tagAVCHandle; namespace android { struct AVCDecoder : public MediaSource, public MediaBufferObserver { AVCDecoder(const sp<MediaSource> &source); virtual status_t start(MetaData *params); virtual status_t stop(); virtual sp<MetaData> getFormat(); virtual status_t read( MediaBuffer **buffer, const ReadOptions *options); virtual void signalBufferReturned(MediaBuffer *buffer); protected: virtual ~AVCDecoder(); private: sp<MediaSource> mSource; bool mStarted; sp<MetaData> mFormat; Vector<MediaBuffer *> mCodecSpecificData; tagAVCHandle *mHandle; Vector<MediaBuffer *> mFrames; MediaBuffer *mInputBuffer; int64_t mAnchorTimeUs; int64_t mNumSamplesOutput; int64_t mPendingSeekTimeUs; MediaSource::ReadOptions::SeekMode mPendingSeekMode; int64_t mTargetTimeUs; bool mSPSSeen; bool mPPSSeen; void addCodecSpecificData(const uint8_t *data, size_t size); static int32_t ActivateSPSWrapper( void *userData, unsigned int sizeInMbs, unsigned int numBuffers); static int32_t BindFrameWrapper( void *userData, int32_t index, uint8_t **yuv); static void UnbindFrame(void *userData, int32_t index); int32_t activateSPS( unsigned int sizeInMbs, unsigned int numBuffers); int32_t bindFrame(int32_t index, uint8_t **yuv); void releaseFrames(); MediaBuffer *drainOutputBuffer(); AVCDecoder(const AVCDecoder &); AVCDecoder &operator=(const AVCDecoder &); }; } // namespace android #endif // AVC_DECODER_H_
/* LUFA Library Copyright (C) Dean Camera, 2014. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * * Header file for ConfigDescriptor.c. */ #ifndef _CONFIGDESCRIPTOR_H_ #define _CONFIGDESCRIPTOR_H_ /* Includes: */ #include <LUFA/Drivers/USB/USB.h> #include "HIDReport.h" /* Macros: */ /** Pipe address for the keyboard report data IN pipe. */ #define KEYBOARD_DATA_IN_PIPE (PIPE_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ enum KeyboardHostWithParser_GetConfigDescriptorDataCodes_t { SuccessfulConfigRead = 0, /**< Configuration Descriptor was processed successfully */ ControlError = 1, /**< A control request to the device failed to complete successfully */ DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */ InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */ NoCompatibleInterfaceFound = 4, /**< A compatible interface with the required endpoints was not found */ }; /* Function Prototypes: */ uint8_t ProcessConfigurationDescriptor(void); uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor); uint8_t DComp_NextKeyboardInterfaceDataEndpoint(void* CurrentDescriptor); uint8_t DComp_NextHID(void* CurrentDescriptor); #endif
/* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. ChibiOS/RT 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. ChibiOS/RT 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/>. */ /** * @file ch.h * @brief ChibiOS/RT main include file. * @details This header includes all the required kernel headers so it is the * only kernel header you usually want to include in your application. * * @addtogroup kernel_info * @details Kernel related info. * @{ */ #ifndef _CH_H_ #define _CH_H_ /** * @brief ChibiOS/RT identification macro. */ #define _CHIBIOS_RT_ /** * @brief Kernel version string. */ #define CH_KERNEL_VERSION "2.5.1unstable" /** * @name Kernel version * @{ */ /** * @brief Kernel version major number. */ #define CH_KERNEL_MAJOR 2 /** * @brief Kernel version minor number. */ #define CH_KERNEL_MINOR 5 /** * @brief Kernel version patch number. */ #define CH_KERNEL_PATCH 1 /** @} */ /** * @name Common constants */ /** * @brief Generic 'false' boolean constant. */ #if !defined(FALSE) || defined(__DOXYGEN__) #define FALSE 0 #endif /** * @brief Generic 'true' boolean constant. */ #if !defined(TRUE) || defined(__DOXYGEN__) #define TRUE (!FALSE) #endif /** * @brief Generic success constant. * @details This constant is functionally equivalent to @p FALSE but more * readable, it can be used as return value of all those functions * returning a @p bool_t as a status indicator. */ #if !defined(CH_SUCCESS) || defined(__DOXYGEN__) #define CH_SUCCESS FALSE #endif /** * @brief Generic failure constant. * @details This constant is functionally equivalent to @p TRUE but more * readable, it can be used as return value of all those functions * returning a @p bool_t as a status indicator. */ #if !defined(CH_FAILED) || defined(__DOXYGEN__) #define CH_FAILED TRUE #endif /** @} */ #include "chconf.h" #include "chtypes.h" #include "chlists.h" #include "chcore.h" #include "chsys.h" #include "chvt.h" #include "chschd.h" #include "chsem.h" #include "chbsem.h" #include "chmtx.h" #include "chcond.h" #include "chevents.h" #include "chmsg.h" #include "chmboxes.h" #include "chmemcore.h" #include "chheap.h" #include "chmempools.h" #include "chthreads.h" #include "chdynamic.h" #include "chregistry.h" #include "chinline.h" #include "chqueues.h" #include "chstreams.h" #include "chfiles.h" #include "chdebug.h" #if !defined(__DOXYGEN__) extern WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE); #endif #ifdef __cplusplus extern "C" { #endif void _idle_thread(void *p); #ifdef __cplusplus } #endif #endif /* _CH_H_ */ /** @} */
// Copyright 2019 Google // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "Crashlytics/Crashlytics/Components/FIRCLSContext.h" __BEGIN_DECLS extern FIRCLSContext _firclsContext; extern dispatch_queue_t _firclsLoggingQueue; extern dispatch_queue_t _firclsBinaryImageQueue; extern dispatch_queue_t _firclsExceptionQueue; #define FIRCLSGetLoggingQueue() (_firclsLoggingQueue) #define FIRCLSGetBinaryImageQueue() (_firclsBinaryImageQueue) #define FIRCLSGetExceptionQueue() (_firclsExceptionQueue) __END_DECLS
/************************************************************* * keywords.h * This file defines the pascal compilation environment * * Copyright (C) 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *************************************************************/ #ifndef __KEYWORDS_H #define __KEYWORDS_H /************************************************************* * Included Files *************************************************************/ #include <nuttx/config.h> #include <nuttx/compiler.h> #include <debug.h> /************************************************************* * Definitions *************************************************************/ #ifndef CONFIG_DEBUG # define CONFIG_DEBUG 0 #endif #ifndef CONFIG_TRACE # define CONFIG_TRACE 0 #endif #ifdef CONFIG_CPP_HAVE_VARARGS # define DEBUG(stream, format, arg...) dbg(format, ##arg) # define TRACE(stream, format, arg...) dbg(format, ##arg) #else # define DEBUG dbg # define TRACE dbg #endif #endif /* __KEYWORDS_H */
/* /% C %/ */ /*********************************************************************** * The WildCard interpreter ************************************************************************ * parameter information file TCLTK.h ************************************************************************ * Description: * This header file is given to makecint by -h option. This header file * is parsed by C preprocessor then by cint. ************************************************************************ * Copyright(c) 1996-1997 Masaharu Goto (MXJ02154@niftyserve.or.jp) * * For the licensing terms see the file COPYING * ************************************************************************/ #ifndef G__TCLTK_H #define G__TCLTK_H #ifdef __MAKECINT__ /************************************************************** * Defining _XLIB_H here prevents reading X11 header files in * tk.h. There are several X11 declarations needed in tk.h though, * the dummy is provided here. **************************************************************/ #define _XLIB_H #ifndef __STDC__ #define __STDC__ #endif typedef int Bool ; typedef struct { } Visual; /* ./tk.h 380 */ typedef unsigned long Window ; /* ./tk.h 382 */ typedef struct { } XWindowChanges ; /* ./tk.h 391 */ typedef struct { } XSetWindowAttributes ; /* ./tk.h 393 */ typedef struct { } XColor ; typedef struct { } XFontStruct ; typedef struct { } Font; /* RH5.1 */ typedef unsigned long Pixmap ; typedef unsigned long Cursor ; typedef unsigned long Colormap; typedef unsigned long Atom ; typedef union _XEvent { } XEvent ; typedef struct {} XPoint ; typedef struct {} XGCValues ; typedef struct _XGC { } *GC ; typedef struct _XDisplay { } Display; /* ./tk.h 377 */ typedef unsigned long Time; #endif /* __MAKECINT__ */ /************************************************************** * include tk.h **************************************************************/ #define XLIB_ILLEGAL_ACCESS #include <tk.h> /************************************************************** * global interpreter object instantiated by Tk in TkInit.c is * exposed to CINT. **************************************************************/ extern Tcl_Interp *interp; /************************************************************** * add #pragma tcl statement in the CINT parser **************************************************************/ #ifndef __MAKECINT__ void G__cinttk_init(); #endif /************************************************************** * WildCard/X11 Event Loop function **************************************************************/ void WildCard_MainLoop(); void WildCard_Exit(); int WildCard_AllocConsole(); int WildCard_FreeConsole(); #ifdef __MAKECINT__ /************************************************************** * following description is optional, hence, cint -c-2 * automatically ignores undefined structs for creating * interface method. **************************************************************/ #pragma link off class Tcl_AsyncHandler_; #pragma link off class Tcl_RegExp_; #pragma link off class Tk_BindingTable_; #pragma link off class Tk_Canvas_; #pragma link off class Tk_ErrorHandler_; #pragma link off class Tk_Image__; #pragma link off class Tk_ImageMaster_; #pragma link off class Tk_TimerToken_; #pragma link off class Tk_Window_; #pragma link off class Tk_3DBorder_; #pragma link off function Tcl_GetCwd; #pragma link off function Tcl_CreatePipeline; #pragma link off function Tk_FileeventCmd; #pragma link off function Tk_CreateMainWindow; #pragma link off function Tk_ChooseFontCmd; /* RH5.1 */ #pragma link off function Tcl_GetErrorLine; #pragma link off function Tcl_GetOriginalCommand; #pragma link off function Tcl_RestartIdleTimer; #pragma link off function Tcl_UpdatePointer; #pragma link off function Tcl_AfterCmd; #pragma link off function Tk_UpdatePointer; /* END RH5.1 */ #ifdef __hpux #pragma link off function Tk_ConfigureFree; #pragma link off function Tk_ApplicationCmd; #endif #endif /* __MAKECINT__ */ #endif /* G__TCLTK_H */ /* * Local Variables: * c-tab-always-indent:nil * c-indent-level:2 * c-continued-statement-offset:2 * c-brace-offset:-2 * c-brace-imaginary-offset:0 * c-argdecl-indent:0 * c-label-offset:-2 * compile-command:"make -k" * End: */
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef ODETIMEKERNEL_H #define ODETIMEKERNEL_H #include "ODEKernel.h" // Forward Declarations class ODETimeKernel; template<> InputParameters validParams<ODETimeKernel>(); /** * Base class for ODEKernels that contribute to the time residual * vector. */ class ODETimeKernel : public ODEKernel { public: ODETimeKernel(const InputParameters & parameters); virtual void computeResidual() override; }; #endif
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / Authoring Tools sub-project * * GPAC 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, or (at your option) * any later version. * * GPAC 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. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef _GF_ISMACRYP_H_ #define _GF_ISMACRYP_H_ #ifdef __cplusplus extern "C" { #endif #include <gpac/isomedia.h> /*loads key and salt from a LOCAL gpac-DRM file (cf MP4Box doc)*/ GF_Err gf_ismacryp_gpac_get_info(u32 stream_id, char *drm_file, char *key, char *salt); /*loads key and salt for MPEG4IP protected files*/ Bool gf_ismacryp_mpeg4ip_get_info(char *kms_uri, char *key, char *salt); enum { /*no selective encryption*/ GF_CRYPT_SELENC_NONE = 0, /*only encrypts RAP samples*/ GF_CRYPT_SELENC_RAP = 1, /*only encrypts non-RAP samples*/ GF_CRYPT_SELENC_NON_RAP = 2, /*selective encryption of random samples*/ GF_CRYPT_SELENC_RAND = 3, /*selective encryption of a random sample in given range*/ GF_CRYPT_SELENC_RAND_RANGE = 4, /*selective encryption of first sample in given range*/ GF_CRYPT_SELENC_RANGE = 5, /*encryption of all samples but the preview range*/ GF_CRYPT_SELENC_PREVIEW = 6, }; typedef struct { /*0: ISMACryp - 1: OMA DRM - 2: CENC CTR - 3: CENC CBC - 4: ADOBE*/ u32 enc_type; u32 trackID; unsigned char key[16]; unsigned char salt[16]; /*the rest is only used for encryption*/ char KMS_URI[5000]; char Scheme_URI[5000]; /*selecive encryption type*/ u32 sel_enc_type; u32 sel_enc_range; /*IPMP signaling: 0: none, 1: IPMP, 2: IPMPX when IPMP signaling is enabled, the OD stream will be updated with IPMP Update commands*/ u32 ipmp_type; /*if not set and IPMP enabled, defaults to TrackID*/ u32 ipmp_desc_id; /*type of box where sample auxiliary informations is saved, or 0 in case of ISMACrypt (it will be written in samples)*/ u32 sai_saved_box_type; /*OMA extensions*/ /*0: none, 1: AES CBC, 2: AES CTR*/ u8 encryption; char TextualHeaders[5000]; u32 TextualHeadersLen; char TransactionID[17]; /*CENC extensions*/ u32 IsEncrypted; u8 IV_size; bin128 default_KID; u32 KID_count; bin128 *KIDs; bin128 *keys; /*IV of first sample in track*/ unsigned char first_IV[16]; u32 defaultKeyIdx; u32 keyRoll; char metadata[5000]; u32 metadata_len; } GF_TrackCryptInfo; #if !defined(GPAC_DISABLE_MCRYPT) && !defined(GPAC_DISABLE_ISOM_WRITE) /*encrypts track - logs, progress: info callbacks, NULL for default*/ GF_Err gf_ismacryp_encrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); /*decrypts track - logs, progress: info callbacks, NULL for default*/ GF_Err gf_ismacryp_decrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); /*Common Encryption*/ /*AES-CTR*/ GF_Err gf_cenc_encrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); GF_Err gf_cenc_decrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); /*AES-CBC*/ GF_Err gf_cbc_encrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); GF_Err gf_cbc_decrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); /*ADOBE*/ GF_Err gf_adobe_encrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); GF_Err gf_adobe_decrypt_track(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); GF_Err (*gf_encrypt_track)(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); GF_Err (*gf_decrypt_track)(GF_ISOFile *mp4, GF_TrackCryptInfo *tci, void (*progress)(void *cbk, u64 done, u64 total), void *cbk); /*decrypt a file @drm_file: location of DRM data (cf MP4Box doc). @LogMsg: redirection for message or NULL for default */ GF_Err gf_decrypt_file(GF_ISOFile *mp4file, const char *drm_file); /*Crypt a the file @drm_file: location of DRM data. @LogMsg: redirection for message or NULL for default */ GF_Err gf_crypt_file(GF_ISOFile *mp4file, const char *drm_file); #endif /*!defined(GPAC_DISABLE_MCRYPT) && !defined(GPAC_DISABLE_ISOM_WRITE)*/ #ifdef __cplusplus } #endif #endif /*_GF_ISMACRYP_H_*/
// // ControlFloor.h // TonicDemo // // Created by Morgan Packard on 3/4/13. // // See LICENSE.txt for license and usage information. // #ifndef __TonicDemo__ControlFloor__ #define __TonicDemo__ControlFloor__ #include "ControlConditioner.h" namespace Tonic{ namespace Tonic_{ class ControlFloor_ : public ControlConditioner_{ inline void computeOutput(const SynthesisContext_ & context){ output_.value = (int)input_.tick(context).value; output_.triggered = input_.tick(context).triggered; } }; } class ControlFloor : public TemplatedControlConditioner<ControlFloor, Tonic_::ControlFloor_> {}; } #endif /* defined(__TonicDemo__ControlFloor__) */
/* Q Light Controller vcxypadfixtureeditor.h Copyright (c) Heikki Junnila Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef VCXYPADFIXTUREEDITOR #define VCXYPADFIXTUREEDITOR #include <QDialog> #include "ui_vcxypadfixtureeditor.h" #include "vcxypadfixture.h" /** @addtogroup ui_vc_props * @{ */ class VCXYPadFixtureEditor : public QDialog, public Ui_VCXYPadFixtureEditor { Q_OBJECT Q_DISABLE_COPY(VCXYPadFixtureEditor) /******************************************************************** * Initialization ********************************************************************/ public: VCXYPadFixtureEditor(QWidget* parent, QList <VCXYPadFixture> fixtures); ~VCXYPadFixtureEditor(); protected slots: void accept(); void slotXMinChanged(int value); void slotXMaxChanged(int value); void slotYMinChanged(int value); void slotYMaxChanged(int value); /******************************************************************** * Fixtures ********************************************************************/ public: QList <VCXYPadFixture> fixtures() const; protected: QList <VCXYPadFixture> m_fixtures; int m_maxXVal, m_maxYVal; }; /** @} */ #endif
/** * FreeRDP: A Remote Desktop Protocol Implementation * FreeRDP Proxy Server * * Copyright 2019 Mati Shabtay <matishabtay@gmail.com> * Copyright 2019 Kobi Mizrachi <kmizrachi18@gmail.com> * Copyright 2019 Idan Freiberg <speidy@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FREERDP_SERVER_PROXY_PFGRAPHICS_H #define FREERDP_SERVER_PROXY_PFGRAPHICS_H #include <freerdp/freerdp.h> #include "pf_client.h" BOOL pf_register_pointer(rdpGraphics* graphics); BOOL pf_register_graphics(rdpGraphics* graphics); #endif /* FREERDP_SERVER_PROXY_PFGRAPHICS_H */
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2014 VMware, Inc. or its affiliates. // // @filename: // CLogicalPartitionSelector.h // // @doc: // Logical partition selector operator. This is used for DML // on partitioned tables //--------------------------------------------------------------------------- #ifndef GPOPT_CLogicalPartitionSelector_H #define GPOPT_CLogicalPartitionSelector_H #include "gpos/base.h" #include "gpopt/metadata/CPartConstraint.h" #include "gpopt/operators/CLogical.h" namespace gpopt { //--------------------------------------------------------------------------- // @class: // CLogicalPartitionSelector // // @doc: // Logical partition selector operator // //--------------------------------------------------------------------------- class CLogicalPartitionSelector : public CLogical { private: // mdid of partitioned table IMDId *m_mdid; // filter expressions corresponding to various levels CExpressionArray *m_pdrgpexprFilters; // oid column - holds the OIDs for leaf parts CColRef *m_pcrOid; public: CLogicalPartitionSelector(const CLogicalPartitionSelector &) = delete; // ctors explicit CLogicalPartitionSelector(CMemoryPool *mp); CLogicalPartitionSelector(CMemoryPool *mp, IMDId *mdid, CExpressionArray *pdrgpexprFilters, CColRef *pcrOid); // dtor ~CLogicalPartitionSelector() override; // ident accessors EOperatorId Eopid() const override { return EopLogicalPartitionSelector; } // operator name const CHAR * SzId() const override { return "CLogicalPartitionSelector"; } // partitioned table mdid IMDId * MDId() const { return m_mdid; } // oid column CColRef * PcrOid() const { return m_pcrOid; } // number of partitioning levels ULONG UlPartLevels() const { return m_pdrgpexprFilters->Size(); } // filter expression for a given level CExpression * PexprPartFilter(ULONG ulLevel) const { return (*m_pdrgpexprFilters)[ulLevel]; } // match function BOOL Matches(COperator *pop) const override; // hash function ULONG HashValue() const override; // sensitivity to order of inputs BOOL FInputOrderSensitive() const override { // operator has one child return false; } // return a copy of the operator with remapped columns COperator *PopCopyWithRemappedColumns(CMemoryPool *mp, UlongToColRefMap *colref_mapping, BOOL must_exist) override; //------------------------------------------------------------------------------------- // Derived Relational Properties //------------------------------------------------------------------------------------- // derive output columns CColRefSet *DeriveOutputColumns(CMemoryPool *mp, CExpressionHandle &exprhdl) override; // derive constraint property CPropConstraint * DerivePropertyConstraint(CMemoryPool *, //mp, CExpressionHandle &exprhdl) const override { return PpcDeriveConstraintPassThru(exprhdl, 0 /*ulChild*/); } // derive max card CMaxCard DeriveMaxCard(CMemoryPool *mp, CExpressionHandle &exprhdl) const override; // derive partition consumer info CPartInfo * DerivePartitionInfo(CMemoryPool *, // mp, CExpressionHandle &exprhdl) const override { return PpartinfoPassThruOuter(exprhdl); } // compute required stats columns of the n-th child CColRefSet * PcrsStat(CMemoryPool *, // mp CExpressionHandle &, // exprhdl CColRefSet *pcrsInput, ULONG // child_index ) const override { return PcrsStatsPassThru(pcrsInput); } //------------------------------------------------------------------------------------- // Transformations //------------------------------------------------------------------------------------- // candidate set of xforms CXformSet *PxfsCandidates(CMemoryPool *mp) const override; // derive key collections CKeyCollection * DeriveKeyCollection(CMemoryPool *, // mp CExpressionHandle &exprhdl) const override { return PkcDeriveKeysPassThru(exprhdl, 0 /* ulChild */); } // derive statistics IStatistics * PstatsDerive(CMemoryPool *, //mp, CExpressionHandle &exprhdl, IStatisticsArray * //stats_ctxt ) const override { return PstatsPassThruOuter(exprhdl); } // stat promise EStatPromise Esp(CExpressionHandle &) const override { return CLogical::EspHigh; } //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- // conversion function static CLogicalPartitionSelector * PopConvert(COperator *pop) { GPOS_ASSERT(nullptr != pop); GPOS_ASSERT(EopLogicalPartitionSelector == pop->Eopid()); return dynamic_cast<CLogicalPartitionSelector *>(pop); } // debug print IOstream &OsPrint(IOstream &) const override; }; // class CLogicalPartitionSelector } // namespace gpopt #endif // !GPOPT_CLogicalPartitionSelector_H // EOF
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2012 EMC Corp. // // @filename: // CXformSubqueryUnnest.h // // @doc: // Base class for subquery unnesting xforms //--------------------------------------------------------------------------- #ifndef GPOPT_CXformSubqueryUnnest_H #define GPOPT_CXformSubqueryUnnest_H #include "gpos/base.h" #include "gpopt/xforms/CXformExploration.h" namespace gpopt { using namespace gpos; //--------------------------------------------------------------------------- // @class: // CXformSubqueryUnnest // // @doc: // Base class for subquery unnesting xforms // //--------------------------------------------------------------------------- class CXformSubqueryUnnest : public CXformExploration { private: protected: // helper for subquery unnesting static CExpression *PexprSubqueryUnnest(CMemoryPool *mp, CExpression *pexpr, BOOL fEnforceCorrelatedApply); // actual transform virtual void Transform(CXformContext *pxfctxt, CXformResult *pxfres, CExpression *pexpr, BOOL fEnforceCorrelatedApply) const; public: CXformSubqueryUnnest(const CXformSubqueryUnnest &) = delete; // ctor explicit CXformSubqueryUnnest(CExpression *pexprPattern) : CXformExploration(pexprPattern) { } // dtor ~CXformSubqueryUnnest() override = default; // compute xform promise for a given expression handle EXformPromise Exfp(CExpressionHandle &exprhdl) const override; // actual transform void Transform(CXformContext *pxfctxt, CXformResult *pxfres, CExpression *pexpr) const override; // is transformation a subquery unnesting (Subquery To Apply) xform? BOOL FSubqueryUnnesting() const override { return true; } }; // class CXformSubqueryUnnest } // namespace gpopt #endif // !GPOPT_CXformSubqueryUnnest_H // EOF
//===---- CGLoopInfo.h - LLVM CodeGen for loop metadata -*- C++ -*---------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This is the internal state used for llvm translation for loop statement // metadata. // //===----------------------------------------------------------------------===// #ifndef CLANG_CODEGEN_CGLOOPINFO_H #define CLANG_CODEGEN_CGLOOPINFO_H #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/Value.h" #include "llvm/Support/Compiler.h" namespace llvm { class BasicBlock; class Instruction; class MDNode; } // end namespace llvm namespace clang { namespace CodeGen { /// \brief Attributes that may be specified on loops. struct LoopAttributes { explicit LoopAttributes(bool IsParallel = false); void clear(); /// \brief Generate llvm.loop.parallel metadata for loads and stores. bool IsParallel; /// \brief Values of llvm.loop.vectorize.enable metadata. enum LVEnableState { VecUnspecified, VecEnable, VecDisable }; /// \brief llvm.loop.vectorize.enable LVEnableState VectorizerEnable; /// \brief llvm.loop.vectorize.width unsigned VectorizerWidth; /// \brief llvm.loop.interleave.count unsigned VectorizerUnroll; }; /// \brief Information used when generating a structured loop. class LoopInfo { public: /// \brief Construct a new LoopInfo for the loop with entry Header. LoopInfo(llvm::BasicBlock *Header, const LoopAttributes &Attrs); /// \brief Get the loop id metadata for this loop. llvm::MDNode *getLoopID() const { return LoopID; } /// \brief Get the header block of this loop. llvm::BasicBlock *getHeader() const { return Header; } /// \brief Get the set of attributes active for this loop. const LoopAttributes &getAttributes() const { return Attrs; } private: /// \brief Loop ID metadata. llvm::MDNode *LoopID; /// \brief Header block of this loop. llvm::BasicBlock *Header; /// \brief The attributes for this loop. LoopAttributes Attrs; }; /// \brief A stack of loop information corresponding to loop nesting levels. /// This stack can be used to prepare attributes which are applied when a loop /// is emitted. class LoopInfoStack { LoopInfoStack(const LoopInfoStack &) LLVM_DELETED_FUNCTION; void operator=(const LoopInfoStack &) LLVM_DELETED_FUNCTION; public: LoopInfoStack() {} /// \brief Begin a new structured loop. The set of staged attributes will be /// applied to the loop and then cleared. void push(llvm::BasicBlock *Header); /// \brief End the current loop. void pop(); /// \brief Return the top loop id metadata. llvm::MDNode *getCurLoopID() const { return getInfo().getLoopID(); } /// \brief Return true if the top loop is parallel. bool getCurLoopParallel() const { return hasInfo() ? getInfo().getAttributes().IsParallel : false; } /// \brief Function called by the CodeGenFunction when an instruction is /// created. void InsertHelper(llvm::Instruction *I) const; /// \brief Set the next pushed loop as parallel. void setParallel(bool Enable = true) { StagedAttrs.IsParallel = Enable; } /// \brief Set the next pushed loop 'vectorizer.enable' void setVectorizerEnable(bool Enable = true) { StagedAttrs.VectorizerEnable = Enable ? LoopAttributes::VecEnable : LoopAttributes::VecDisable; } /// \brief Set the vectorizer width for the next loop pushed. void setVectorizerWidth(unsigned W) { StagedAttrs.VectorizerWidth = W; } /// \brief Set the vectorizer unroll for the next loop pushed. void setVectorizerUnroll(unsigned U) { StagedAttrs.VectorizerUnroll = U; } private: /// \brief Returns true if there is LoopInfo on the stack. bool hasInfo() const { return !Active.empty(); } /// \brief Return the LoopInfo for the current loop. HasInfo should be called /// first to ensure LoopInfo is present. const LoopInfo &getInfo() const { return Active.back(); } /// \brief The set of attributes that will be applied to the next pushed loop. LoopAttributes StagedAttrs; /// \brief Stack of active loops. llvm::SmallVector<LoopInfo, 4> Active; }; } // end namespace CodeGen } // end namespace clang #endif // CLANG_CODEGEN_CGLOOPINFO_H
/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.30 08/16/14 */ /* */ /* ANALYSIS HEADER FILE */ /*******************************************************/ /*************************************************************/ /* Purpose: Analyzes LHS patterns to check for semantic */ /* errors and to determine variable comparisons and other */ /* tests which must be performed either in the pattern or */ /* join networks. */ /* */ /* Principal Programmer(s): */ /* Gary D. Riley */ /* */ /* Contributing Programmer(s): */ /* */ /* Revision History: */ /* */ /* 6.24: Renamed BOOLEAN macro type to intBool. */ /* */ /* 6.30: Join network rework and optimizations. */ /* */ /*************************************************************/ #ifndef _H_analysis #define _H_analysis #ifndef _H_expressn #include "expressn.h" #endif #ifndef _H_reorder #include "reorder.h" #endif #ifdef LOCALE #undef LOCALE #endif #ifdef _ANALYSIS_SOURCE_ #define LOCALE #else #define LOCALE extern #endif /*****************************************************/ /* nandFrame structure: Stores information about the */ /* current position in the nesting of not/and CEs */ /* as the patterns of a rule are analyzed. */ /*****************************************************/ struct nandFrame { int depth; struct lhsParseNode *nandCE; struct nandFrame *next; }; LOCALE intBool VariableAnalysis(void *,struct lhsParseNode *); #endif
// Filename: cppTypedefType.h // Created by: rdb (01Aug14) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // // All use of this software is subject to the terms of the revised BSD // license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // //////////////////////////////////////////////////////////////////// #ifndef CPPTYPEDEFTYPE_H #define CPPTYPEDEFTYPE_H #include "dtoolbase.h" #include "cppType.h" class CPPIdentifier; class CPPInstanceIdentifier; /////////////////////////////////////////////////////////////////// // Class : CPPTypedefType // Description : //////////////////////////////////////////////////////////////////// class CPPTypedefType : public CPPType { public: CPPTypedefType(CPPType *type, const string &name, CPPScope *current_scope); CPPTypedefType(CPPType *type, CPPIdentifier *ident, CPPScope *current_scope); CPPTypedefType(CPPType *type, CPPInstanceIdentifier *ii, CPPScope *current_scope, const CPPFile &file); bool is_scoped() const; CPPScope *get_scope(CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink = NULL) const; virtual string get_simple_name() const; virtual string get_local_name(CPPScope *scope = NULL) const; virtual string get_fully_scoped_name() const; virtual bool is_incomplete() const; virtual bool is_tbd() const; virtual bool is_trivial() const; virtual bool is_fully_specified() const; virtual CPPDeclaration *substitute_decl(SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope); virtual CPPType *resolve_type(CPPScope *current_scope, CPPScope *global_scope); virtual bool is_equivalent(const CPPType &other) const; virtual void output(ostream &out, int indent_level, CPPScope *scope, bool complete) const; virtual SubType get_subtype() const; virtual CPPTypedefType *as_typedef_type(); CPPType *_type; CPPIdentifier *_ident; protected: virtual bool is_equal(const CPPDeclaration *other) const; virtual bool is_less(const CPPDeclaration *other) const; bool _subst_decl_recursive_protect; typedef vector<CPPTypeProxy *> Proxies; Proxies _proxies; }; #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ #define CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ #include "base/memory/weak_ptr.h" #include "gpu/command_buffer/common/mailbox.h" #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" #include "ppapi/shared_impl/resource.h" namespace content { class CommandBufferProxyImpl; class GpuChannelHost; class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared { public: static PP_Resource Create(PP_Instance instance, PP_Resource share_context, const int32_t* attrib_list); static PP_Resource CreateRaw(PP_Instance instance, PP_Resource share_context, const int32_t* attrib_list); // PPB_Graphics3D_API trusted implementation. virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE; virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, int32* id) OVERRIDE; virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, int32_t end) OVERRIDE; virtual gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, int32_t end) OVERRIDE; virtual uint32_t InsertSyncPoint() OVERRIDE; virtual uint32_t InsertFutureSyncPoint() OVERRIDE; virtual void RetireSyncPoint(uint32_t) OVERRIDE; // Binds/unbinds the graphics of this context with the associated instance. // Returns true if binding/unbinding is successful. bool BindToInstance(bool bind); // Returns true if the backing texture is always opaque. bool IsOpaque(); // Notifications about the view's progress painting. See PluginInstance. // These messages are used to send Flush callbacks to the plugin. void ViewInitiatedPaint(); void ViewFlushedPaint(); void GetBackingMailbox(gpu::Mailbox* mailbox, uint32* sync_point) { *mailbox = mailbox_; *sync_point = sync_point_; } int GetCommandBufferRouteId(); GpuChannelHost* channel() { return channel_; } protected: virtual ~PPB_Graphics3D_Impl(); // ppapi::PPB_Graphics3D_Shared overrides. virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; virtual gpu::GpuControl* GetGpuControl() OVERRIDE; virtual int32 DoSwapBuffers() OVERRIDE; private: explicit PPB_Graphics3D_Impl(PP_Instance instance); bool Init(PPB_Graphics3D_API* share_context, const int32_t* attrib_list); bool InitRaw(PPB_Graphics3D_API* share_context, const int32_t* attrib_list); // Notifications received from the GPU process. void OnSwapBuffers(); void OnContextLost(); void OnConsoleMessage(const std::string& msg, int id); // Notifications sent to plugin. void SendContextLost(); // True if context is bound to instance. bool bound_to_instance_; // True when waiting for compositor to commit our backing texture. bool commit_pending_; gpu::Mailbox mailbox_; uint32 sync_point_; bool has_alpha_; scoped_refptr<GpuChannelHost> channel_; CommandBufferProxyImpl* command_buffer_; base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); }; } // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ASH_CROSAPI_TEST_LOCAL_PRINTER_ASH_H_ #define CHROME_BROWSER_ASH_CROSAPI_TEST_LOCAL_PRINTER_ASH_H_ #include "base/memory/scoped_refptr.h" #include "chrome/browser/ash/crosapi/local_printer_ash.h" #include "chromeos/printing/ppd_provider.h" class Profile; // TestLocalPrinterAsh is used to test the LocalPrinterAsh class // with a testing profile and fake ppd provider. class TestLocalPrinterAsh : public crosapi::LocalPrinterAsh { public: TestLocalPrinterAsh(Profile* profile, scoped_refptr<chromeos::PpdProvider> ppd_provider); TestLocalPrinterAsh(const TestLocalPrinterAsh&) = delete; TestLocalPrinterAsh& operator=(const TestLocalPrinterAsh&) = delete; ~TestLocalPrinterAsh() override; private: // crosapi::LocalPrinterAsh: Profile* GetProfile() override; scoped_refptr<chromeos::PpdProvider> CreatePpdProvider( Profile* profile) override; Profile* const profile_; const scoped_refptr<chromeos::PpdProvider> ppd_provider_; }; #endif // CHROME_BROWSER_ASH_CROSAPI_TEST_LOCAL_PRINTER_ASH_H_
#ifndef _NPY_DEPRECATED_API_H #define _NPY_DEPRECATED_API_H #if defined(_WIN32) #define _WARN___STR2__(x) #x #define _WARN___STR1__(x) _WARN___STR2__(x) #define _WARN___LOC__ __FILE__ "("_WARN___STR1__(__LINE__)") : Warning Msg: " #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it by " \ "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION") #elif defined(__GNUC__) #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" #endif /* TODO: How to do this warning message for other compilers? */ /* * This header exists to collect all dangerous/deprecated NumPy API. * * This is an attempt to remove bad API, the proliferation of macros, * and namespace pollution currently produced by the NumPy headers. */ #if defined(NPY_NO_DEPRECATED_API) #error Should never include npy_deprecated_api directly. #endif /* These array flags are deprecated as of NumPy 1.7 */ #define NPY_CONTIGUOUS NPY_ARRAY_C_CONTIGUOUS #define NPY_FORTRAN NPY_ARRAY_F_CONTIGUOUS /* * The consistent NPY_ARRAY_* names which don't pollute the NPY_* * namespace were added in NumPy 1.7. * * These versions of the carray flags are deprecated, but * probably should only be removed after two releases instead of one. */ #define NPY_C_CONTIGUOUS NPY_ARRAY_C_CONTIGUOUS #define NPY_F_CONTIGUOUS NPY_ARRAY_F_CONTIGUOUS #define NPY_OWNDATA NPY_ARRAY_OWNDATA #define NPY_FORCECAST NPY_ARRAY_FORCECAST #define NPY_ENSURECOPY NPY_ARRAY_ENSURECOPY #define NPY_ENSUREARRAY NPY_ARRAY_ENSUREARRAY #define NPY_ELEMENTSTRIDES NPY_ARRAY_ELEMENTSTRIDES #define NPY_ALIGNED NPY_ARRAY_ALIGNED #define NPY_NOTSWAPPED NPY_ARRAY_NOTSWAPPED #define NPY_WRITEABLE NPY_ARRAY_WRITEABLE #define NPY_UPDATEIFCOPY NPY_ARRAY_UPDATEIFCOPY #define NPY_BEHAVED NPY_ARRAY_BEHAVED #define NPY_BEHAVED_NS NPY_ARRAY_BEHAVED_NS #define NPY_CARRAY NPY_ARRAY_CARRAY #define NPY_CARRAY_RO NPY_ARRAY_CARRAY_RO #define NPY_FARRAY NPY_ARRAY_FARRAY #define NPY_FARRAY_RO NPY_ARRAY_FARRAY_RO #define NPY_DEFAULT NPY_ARRAY_DEFAULT #define NPY_IN_ARRAY NPY_ARRAY_IN_ARRAY #define NPY_OUT_ARRAY NPY_ARRAY_OUT_ARRAY #define NPY_INOUT_ARRAY NPY_ARRAY_INOUT_ARRAY #define NPY_IN_FARRAY NPY_ARRAY_IN_FARRAY #define NPY_OUT_FARRAY NPY_ARRAY_OUT_FARRAY #define NPY_INOUT_FARRAY NPY_ARRAY_INOUT_FARRAY #define NPY_UPDATE_ALL NPY_ARRAY_UPDATE_ALL /* This way of accessing the default type is deprecated as of NumPy 1.7 */ #define PyArray_DEFAULT NPY_DEFAULT_TYPE /* These DATETIME bits aren't used internally */ #if PY_VERSION_HEX >= 0x03000000 #define PyDataType_GetDatetimeMetaData(descr) \ ((descr->metadata == NULL) ? NULL : \ ((PyArray_DatetimeMetaData *)(PyCapsule_GetPointer( \ PyDict_GetItemString( \ descr->metadata, NPY_METADATA_DTSTR), NULL)))) #else #define PyDataType_GetDatetimeMetaData(descr) \ ((descr->metadata == NULL) ? NULL : \ ((PyArray_DatetimeMetaData *)(PyCObject_AsVoidPtr( \ PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR))))) #endif /* * Deprecated as of NumPy 1.7, this kind of shortcut doesn't * belong in the public API. */ #define NPY_AO PyArrayObject /* * Deprecated as of NumPy 1.7, an all-lowercase macro doesn't * belong in the public API. */ #define fortran fortran_ /* * Deprecated as of NumPy 1.7, as it is a namespace-polluting * macro. */ #define FORTRAN_IF PyArray_FORTRAN_IF /* Deprecated as of NumPy 1.7, datetime64 uses c_metadata instead */ #define NPY_METADATA_DTSTR "__timeunit__" /* * Deprecated as of NumPy 1.7. * The reasoning: * - These are for datetime, but there's no datetime "namespace". * - They just turn NPY_STR_<x> into "<x>", which is just * making something simple be indirected. */ #define NPY_STR_Y "Y" #define NPY_STR_M "M" #define NPY_STR_W "W" #define NPY_STR_D "D" #define NPY_STR_h "h" #define NPY_STR_m "m" #define NPY_STR_s "s" #define NPY_STR_ms "ms" #define NPY_STR_us "us" #define NPY_STR_ns "ns" #define NPY_STR_ps "ps" #define NPY_STR_fs "fs" #define NPY_STR_as "as" /* * The macros in old_defines.h are Deprecated as of NumPy 1.7 and will be * removed in the next major release. */ #include "old_defines.h" #endif
//********************************************************************** // // ShaderFramework.h // // ½¦ÀÌ´õ µ¥¸ð¸¦ À§ÇÑ C½ºÅ¸ÀÏÀÇ Ãʰ£´Ü ÇÁ·¹ÀÓ¿öÅ©ÀÔ´Ï´Ù. // (½ÇÁ¦ °ÔÀÓÀ» ÄÚµùÇÏ½Ç ¶§´Â Àý´ë ÀÌ·¸°Ô ÇÁ·¹ÀÓ¿öÅ©¸¦ // ÀÛ¼ºÇÏ½Ã¸é ¾ÈµË´Ï´Ù. -_-) // // Author: Pope Kim // //********************************************************************** #pragma once #include <d3d9.h> #include <d3dx9.h> // ---------- ¼±¾ð ------------------------------------ #define WIN_WIDTH 800 #define WIN_HEIGHT 600 // ---------------- ÇÔ¼ö ÇÁ·ÎÅäŸÀÔ ------------------------ // ¸Þ½ÃÁö 󸮱⠰ü·Ã LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); void ProcessInput(HWND hWnd, WPARAM keyPress); // ÃʱâÈ­ °ú·Ã bool InitEverything(HWND hWnd); bool InitD3D(HWND hWnd); bool LoadAssets(); LPD3DXEFFECT LoadShader(const char * filename); LPDIRECT3DTEXTURE9 LoadTexture(const char * filename); LPD3DXMESH LoadModel(const char * filename); // °ÔÀÓ·çÇÁ °ü·Ã void PlayDemo(); void Update(); // ·»´õ¸µ °ü·Ã void RenderFrame(); void RenderScene(); void RenderInfo(); // µÞÁ¤¸® °ü·Ã void Cleanup();
/* * cynapses libc functions * * Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org> * * 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 */ /** * @file c_path.h * * @brief Interface of the cynapses libc path functions * * @defgroup cynPathInternals cynapses libc path functions * @ingroup cynLibraryAPI * * @{ */ #ifndef _C_PATH_H #define _C_PATH_H #include "c_macro.h" #include "c_private.h" /** * @brief Parse directory component. * * dirname breaks a null-terminated pathname string into a directory component. * In the usual case, c_dirname() returns the string up to, but not including, * the final '/'. Trailing '/' characters are not counted as part of the * pathname. The caller must free the memory. * * @param path The path to parse. * * @return The dirname of path or NULL if we can't allocate memory. If path * does not contain a slash, c_dirname() returns the string ".". If * path is the string "/", it returns the string "/". If path is * NULL or an empty string, "." is returned. */ char *c_dirname(const char *path); /** * @brief basename - parse filename component. * * basename breaks a null-terminated pathname string into a filename component. * c_basename() returns the component following the final '/'. Trailing '/' * characters are not counted as part of the pathname. * * @param path The path to parse. * * @return The filename of path or NULL if we can't allocate memory. If path * is a the string "/", basename returns the string "/". If path is * NULL or an empty string, "." is returned. */ char *c_basename (const char *path); /** * @brief parse a uri and split it into components. * * parse_uri parses an uri in the format * * [<scheme>:][//[<user>[:<password>]@]<host>[:<port>]]/[<path>] * * into its compoments. If you only want a special component, * pass NULL for all other components. All components will be allocated if they have * been found. * * @param uri The uri to parse. * @param scheme String for the scheme component * @param user String for the username component * @param passwd String for the password component * @param host String for the password component * @param port Integer for the port * @param path String for the path component with a leading slash. * * @return 0 on success, < 0 on error. */ int c_parse_uri(const char *uri, char **scheme, char **user, char **passwd, char **host, unsigned int *port, char **path); /** * @brief Parts of a path. * * @param directory '\0' terminated path including the final '/' * * @param filename '\0' terminated string * * @param extension '\0' terminated string * */ typedef struct { char * directory; char * filename; char * extension; } C_PATHINFO; /** * @brief c_path_to_UNC converts a unixoid path to UNC format. * * It converts the '/' to '\' and prepends \\?\ to the path. * * A proper windows path has to have a drive letter, otherwise it is not * valid UNC. * * @param str The path to convert * * @return a pointer to the converted string. Caller has to free it. */ const char *c_path_to_UNC(const char *str); /** * @brief c_utf8_path_to_locale converts a unixoid path to the locale aware format * * On windows, it converts to UNC and multibyte. * On Mac, it converts to the correct utf8 using iconv. * On Linux, it returns utf8 * * @param str The path to convert * * @return a pointer to the converted string. Caller has to free it using the * function c_free_locale_string. */ mbchar_t* c_utf8_path_to_locale(const char *str); /** * }@ */ #endif /* _C_PATH_H */
/* * tegra-xotg.h - Nvidia XOTG implementation * * Copyright (c) 2013-2015, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include<linux/usb/otg.h> /* variables set by the user space app */ struct xotg_app_request { int a_bus_drop; int a_bus_req; int b_bus_req; int b_srp_init; }; /* parameters/internal variables/output defined in the OTG spec */ struct xotg_vars { /* B-device state machine parameters */ /* input variables */ int a_bus_resume; int a_bus_suspend; int a_conn; int b_se0_srp; int b_ssend_srp; int b_sess_vld; int power_up; /* internal variables */ int b_srp_done; int b_hnp_en; /* A-device state machine parameters */ /* input variables */ int a_sess_vld; int a_srp_det; int a_vbus_vld; int b_conn; /* internal variables */ int a_set_b_hnp_en; /* will be set by the HCD/usbcore */ int otg_test_device_enumerated; int start_tst_maint_timer; /* non-spec otg driver variables */ int b_srp_initiated; /* Think we do not need the below */ int b_bus_resume; int b_bus_suspend; }; struct xotg_timers { struct timer_list a_wait_vrise_tmr; int a_wait_vrise_tmout; struct timer_list a_wait_vfall_tmr; int a_wait_vfall_tmout; struct timer_list a_wait_bcon_tmr; int a_wait_bcon_tmout; struct timer_list a_aidl_bdis_tmr; int a_aidl_bdis_tmout; struct timer_list a_bidl_adis_tmr; int a_bidl_adis_tmout; struct timer_list b_ase0_brst_tmr; int b_ase0_brst_tmout; /* driver timers */ struct timer_list b_ssend_srp_tmr; int b_ssend_srp_tmout; /* timer used to wait for SRP response */ struct timer_list b_srp_response_wait_tmr; int b_srp_response_wait_tmout; struct timer_list b_srp_done_tmr; int b_srp_done_tmout; struct timer_list a_tst_maint_tmr; int a_tst_maint_tmout; /* test timer */ struct timer_list test_tmr; }; /* nvidia otg controller Structure */ struct xotg { u8 hs_otg_port; u8 ss_otg_port; struct usb_phy phy; struct device *dev; struct platform_device *pdev; spinlock_t lock; spinlock_t vbus_lock; int nv_irq; int usb_irq; int id; /* vbus */ struct regulator *usb_vbus_reg; struct work_struct vbus_work; bool vbus_enabled; /* extcon */ struct extcon_dev *id_extcon_dev; struct notifier_block id_extcon_nb; bool id_grounded; bool device_connected; u32 usb2_id; /* role swap */ struct xotg_app_request xotg_reqs; struct xotg_vars xotg_vars; struct xotg_timers xotg_timer_list; u32 test_timer_timeout; struct work_struct otg_work; struct workqueue_struct *otg_wq; bool vbus_en_started; bool vbus_dis_started; bool vbus_on; unsigned long vbus_on_jiffies; }; /* timer constants, all in ms */ #define TA_VBUS_RISE (100) /* Table 4-1, OTG2.0 */ #define TA_WAIT_BCON (9000) /* Table 5-1, OTG2.0 */ #define TA_AIDL_BDIS (250) /* Table 5-1, OTG2.0 */ #define TA_BIDL_ADIS (155) /* Table 5-1, OTG2.0 */ #define TB_AIDL_BDIS (15000) /* Table 5-1, OTG2.0 */ #define TB_ASE0_BRST (255) /* Table 5-1, OTG2.0 */ #define TB_SE0_SRP (1000) /* Table 5-1, OTG2.0 */ #define TB_SSEND_SRP (1600) /* Table 5-1, OTG2.0 */ #define TB_SRP_FAIL (5500) /* Table 5-1, OTG2.0 */ #define TB_SRP_DONE (100) #define TA_WAIT_VFALL (1000) /* Table 4-1, OTG2.0 */ #define TA_TST_MAINT (9900) /* for communication with xhci driver */ #define XDEV_DISABLED (0x4 << 5) #define XDEV_RXDETECT (0x5 << 5) extern int xotg_debug_level; #define LEVEL_DEBUG 4 #define LEVEL_INFO 3 #define LEVEL_WARNING 2 #define LEVEL_ERROR 1 #define xotg_dbg(dev, fmt, args...) { \ if (xotg_debug_level >= LEVEL_DEBUG) \ dev_info(dev, "%s():%d: " fmt, __func__ , __LINE__, ## args); \ } #define xotg_info(dev, fmt, args...) { \ if (xotg_debug_level >= LEVEL_INFO) \ dev_info(dev, "%s():%d: " fmt, __func__ , __LINE__, ## args); \ } #define xotg_err(dev, fmt, args...) { \ if (xotg_debug_level >= LEVEL_ERROR) \ dev_err(dev, fmt, ## args); \ } #define xotg_warn(dev, fmt, args...) { \ if (xotg_debug_level >= LEVEL_WARNING) \ dev_warn(dev, fmt, ## args); \ } #define xotg_method_entry(dev) xotg_dbg(dev, "enter\n") #define xotg_method_exit(dev) xotg_dbg(dev, "exit\n")
/* $Id: subsidy_base.h 23704 2012-01-01 17:22:32Z alberth $ */ /* * This file is part of OpenTTD. * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>. */ /** @file subsidy_base.h %Subsidy base class. */ #ifndef SUBSIDY_BASE_H #define SUBSIDY_BASE_H #include "cargo_type.h" #include "company_type.h" #include "subsidy_type.h" #include "core/pool_type.hpp" typedef Pool<Subsidy, SubsidyID, 1, 256> SubsidyPool; extern SubsidyPool _subsidy_pool; /** Struct about subsidies, offered and awarded */ struct Subsidy : SubsidyPool::PoolItem<&_subsidy_pool> { CargoID cargo_type; ///< Cargo type involved in this subsidy, CT_INVALID for invalid subsidy byte remaining; ///< Remaining months when this subsidy is valid CompanyByte awarded; ///< Subsidy is awarded to this company; INVALID_COMPANY if it's not awarded to anyone SourceTypeByte src_type; ///< Source of subsidised path (ST_INDUSTRY or ST_TOWN) SourceTypeByte dst_type; ///< Destination of subsidised path (ST_INDUSTRY or ST_TOWN) SourceID src; ///< Index of source. Either TownID or IndustryID SourceID dst; ///< Index of destination. Either TownID or IndustryID /** * We need an (empty) constructor so struct isn't zeroed (as C++ standard states) */ inline Subsidy() { } /** * (Empty) destructor has to be defined else operator delete might be called with NULL parameter */ inline ~Subsidy() { } /** * Tests whether this subsidy has been awarded to someone * @return is this subsidy awarded? */ inline bool IsAwarded() const { return this->awarded != INVALID_COMPANY; } void AwardTo(CompanyID company); }; /** Constants related to subsidies */ static const uint SUBSIDY_OFFER_MONTHS = 12; ///< Duration of subsidy offer static const uint SUBSIDY_CONTRACT_MONTHS = 12; ///< Duration of subsidy after awarding static const uint SUBSIDY_PAX_MIN_POPULATION = 400; ///< Min. population of towns for subsidised pax route static const uint SUBSIDY_CARGO_MIN_POPULATION = 900; ///< Min. population of destination town for cargo route static const uint SUBSIDY_MAX_PCT_TRANSPORTED = 42; ///< Subsidy will be created only for towns/industries with less % transported static const uint SUBSIDY_MAX_DISTANCE = 70; ///< Max. length of subsidised route (DistanceManhattan) #define FOR_ALL_SUBSIDIES_FROM(var, start) FOR_ALL_ITEMS_FROM(Subsidy, subsidy_index, var, start) #define FOR_ALL_SUBSIDIES(var) FOR_ALL_SUBSIDIES_FROM(var, 0) #endif /* SUBSIDY_BASE_H */
#ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" class HelloWorld : public cocos2d::CCLayer { public: // Method 'init' in cocos2d-x returns bool, instead of 'id' in cocos2d-iphone (an object pointer) virtual bool init(); // there's no 'id' in cpp, so we recommend to return the class instance pointer static cocos2d::CCScene* scene(); // a selector callback void menuCloseCallback(CCObject* pSender); // preprocessor macro for "static create()" constructor ( node() deprecated ) CREATE_FUNC(HelloWorld); }; #endif // __HELLOWORLD_SCENE_H__
/* SPDX-License-Identifier: GPL-2.0+ */ /* * (C) Copyright 2018 Cisco Systems, Inc. * * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org> */ #ifndef _BCMSTB_SDHCI_H #define _BCMSTB_SDHCI_H #include <linux/types.h> int bcmstb_sdhci_init(phys_addr_t regbase); #endif /* _BCMSTB_SDHCI_H */
/* silcpurple.h Author: Pekka Riikonen <priikone@silcnet.org> Copyright (C) 2004 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #ifndef SILCPURPLE_H #define SILCPURPLE_H /* Purple includes */ #include "internal.h" #include "account.h" #include "accountopt.h" #include "cmds.h" #include "conversation.h" #include "debug.h" #include "ft.h" #include "notify.h" #include "prpl.h" #include "request.h" #include "roomlist.h" #include "server.h" #include "util.h" /* Default public and private key file names */ #define SILCPURPLE_PUBLIC_KEY_NAME "public_key.pub" #define SILCPURPLE_PRIVATE_KEY_NAME "private_key.prv" /* Default settings for creating key pair */ #define SILCPURPLE_DEF_PKCS "rsa" #define SILCPURPLE_DEF_PKCS_LEN 2048 #define SILCPURPLE_PRVGRP 0x001fffff /* Status IDs */ #define SILCPURPLE_STATUS_ID_OFFLINE "offline" #define SILCPURPLE_STATUS_ID_AVAILABLE "available" #define SILCPURPLE_STATUS_ID_HYPER "hyper" #define SILCPURPLE_STATUS_ID_AWAY "away" #define SILCPURPLE_STATUS_ID_BUSY "busy" #define SILCPURPLE_STATUS_ID_INDISPOSED "indisposed" #define SILCPURPLE_STATUS_ID_PAGE "page" typedef struct { unsigned long id; const char *channel; unsigned long chid; const char *parentch; SilcChannelPrivateKey key; } *SilcPurplePrvgrp; /* The SILC Purple plugin context */ typedef struct SilcPurpleStruct { SilcClient client; SilcClientConnection conn; guint scheduler; PurpleConnection *gc; PurpleAccount *account; unsigned long channel_ids; GList *grps; char *motd; PurpleRoomlist *roomlist; #ifdef HAVE_SILCMIME_H SilcMimeAssembler mimeass; #endif unsigned int detaching : 1; unsigned int resuming : 1; unsigned int roomlist_cancelled : 1; unsigned int chpk : 1; } *SilcPurple; gboolean silcpurple_check_silc_dir(PurpleConnection *gc); void silcpurple_chat_join_done(SilcClient client, SilcClientConnection conn, SilcClientEntry *clients, SilcUInt32 clients_count, void *context); const char *silcpurple_silcdir(void); const char *silcpurple_session_file(const char *account); void silcpurple_verify_public_key(SilcClient client, SilcClientConnection conn, const char *name, SilcSocketType conn_type, unsigned char *pk, SilcUInt32 pk_len, SilcSKEPKType pk_type, SilcVerifyPublicKey completion, void *context); GList *silcpurple_buddy_menu(PurpleBuddy *buddy); void silcpurple_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); void silcpurple_send_buddylist(PurpleConnection *gc); void silcpurple_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); void silcpurple_buddy_keyagr_request(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, const char *hostname, SilcUInt16 port); void silcpurple_idle_set(PurpleConnection *gc, int idle); void silcpurple_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full); char *silcpurple_status_text(PurpleBuddy *b); gboolean silcpurple_ip_is_private(const char *ip); void silcpurple_ftp_send_file(PurpleConnection *gc, const char *name, const char *file); PurpleXfer *silcpurple_ftp_new_xfer(PurpleConnection *gc, const char *name); void silcpurple_ftp_request(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, SilcUInt32 session_id, const char *hostname, SilcUInt16 port); void silcpurple_show_public_key(SilcPurple sg, const char *name, SilcPublicKey public_key, GCallback callback, void *context); void silcpurple_get_info(PurpleConnection *gc, const char *who); SilcAttributePayload silcpurple_get_attr(SilcDList attrs, SilcAttribute attribute); void silcpurple_get_umode_string(SilcUInt32 mode, char *buf, SilcUInt32 buf_size); void silcpurple_get_chmode_string(SilcUInt32 mode, char *buf, SilcUInt32 buf_size); void silcpurple_get_chumode_string(SilcUInt32 mode, char *buf, SilcUInt32 buf_size); GList *silcpurple_chat_info(PurpleConnection *gc); GHashTable *silcpurple_chat_info_defaults(PurpleConnection *gc, const char *chat_name); GList *silcpurple_chat_menu(PurpleChat *); void silcpurple_chat_join(PurpleConnection *gc, GHashTable *data); char *silcpurple_get_chat_name(GHashTable *data); void silcpurple_chat_invite(PurpleConnection *gc, int id, const char *msg, const char *name); void silcpurple_chat_leave(PurpleConnection *gc, int id); int silcpurple_chat_send(PurpleConnection *gc, int id, const char *msg, PurpleMessageFlags flags); void silcpurple_chat_set_topic(PurpleConnection *gc, int id, const char *topic); PurpleRoomlist *silcpurple_roomlist_get_list(PurpleConnection *gc); void silcpurple_roomlist_cancel(PurpleRoomlist *list); void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel, SilcBuffer channel_pubkeys); void silcpurple_parse_attrs(SilcDList attrs, char **moodstr, char **statusstr, char **contactstr, char **langstr, char **devicestr, char **tzstr, char **geostr); #ifdef SILC_ATTRIBUTE_USER_ICON void silcpurple_buddy_set_icon(PurpleConnection *gc, PurpleStoredImage *img); #endif #ifdef HAVE_SILCMIME_H char *silcpurple_file2mime(const char *filename); SilcDList silcpurple_image_message(const char *msg, SilcUInt32 *mflags); #endif #ifdef _WIN32 typedef int uid_t; struct passwd { char *pw_name; /* user name */ char *pw_passwd; /* user password */ int pw_uid; /* user id */ int pw_gid; /* group id */ char *pw_gecos; /* real name */ char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; struct passwd *getpwuid(int uid); int getuid(void); int geteuid(void); #endif #endif /* SILCPURPLE_H */
/* Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ryan S. Arnold <rsa@us.ibm.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <fcntl.h> #include <paths.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/uio.h> /* The purpose of this test is to verify that the INTERNAL_[V]SYSCALL_NCS macros on 64-bit platforms don't cast the return type to (int) which would erroneously sign extend the return value should the high bit of the bottom half of the word be '1'. */ #if 0 /* Used to test the non power-of-2 code path. */ #undef IOV_MAX #define IOV_MAX 1000 #endif /* writev() should report that it has written EXPECTED number of bytes. */ #define EXPECTED ((size_t) INT32_MAX + 1) static int do_test (void) { struct iovec iv[IOV_MAX]; /* POSIX doesn't guarantee that IOV_MAX is pow of 2 but we're optimistic. */ size_t bufsz = EXPECTED / IOV_MAX; size_t bufrem = EXPECTED % IOV_MAX; /* If there's a remainder then IOV_MAX probably isn't a power of 2 and we need to make bufsz bigger so that the last iovec, iv[IOV_MAX-1], is free for the remainder. */ if (bufrem) { bufsz = bufsz + 1; bufrem = EXPECTED - (bufsz * (IOV_MAX - 1)); } /* We writev to /dev/null since we're just testing writev's return value. */ int fd = open (_PATH_DEVNULL, O_WRONLY); if (fd == -1) { printf ("Unable to open /dev/null for writing.\n"); return -1; } iv[0].iov_base = malloc (bufsz); if (iv[0].iov_base == NULL) { printf ("malloc (%zu) failed.\n", bufsz); close (fd); return -1; } iv[0].iov_len = bufsz; /* We optimistically presume that there isn't a remainder and set all iovec instances to the same base and len as the first instance. */ for (int i = 1; i < IOV_MAX; i++) { /* We don't care what the data is so reuse the allocation from iv[0]; */ iv[i].iov_base = iv[0].iov_base; iv[i].iov_len = iv[0].iov_len; } /* If there is a remainder then we correct the last iov_len. */ if (bufrem) iv[IOV_MAX - 1].iov_len = bufrem; /* Write junk to /dev/null with the writev syscall in order to get a return of INT32_MAX+1 bytes to verify that the INTERNAL_SYSCALL wrappers aren't mangling the result if the signbit of a 32-bit number is set. */ ssize_t ret = writev (fd, iv, IOV_MAX); free (iv[0].iov_base); close (fd); if (ret != (ssize_t) EXPECTED) { #ifdef ARTIFICIAL_LIMIT if (ret != (ssize_t) ARTIFICIAL_LIMIT) #endif { printf ("writev() return value: %zd != EXPECTED: %zd\n", ret, EXPECTED); return 1; } } return 0; } /* Time enough for a large writev syscall to complete. */ #define TIMEOUT 20 #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
/* PowerPC-specific implementation of profiling support. Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* We need a special version of the `mcount' function because it has to preserve more registers than your usual function. */ void __mcount_internal (unsigned long frompc, unsigned long selfpc); #define _MCOUNT_DECL(frompc, selfpc) \ void __mcount_internal (unsigned long frompc, unsigned long selfpc) /* Define MCOUNT as empty since we have the implementation in another file. */ #define MCOUNT
/* Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #if !defined _MATH_H && !defined _COMPLEX_H # error "Never use <bits/mathdef.h> directly; include <math.h> instead" #endif /* FIXME! This file describes properties of the compiler, not the machine; it should not be part of libc! FIXME! This file does not deal with the -fshort-double option of gcc! */ #if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF # define _MATH_H_MATHDEF 1 /* PowerPC has both `float' and `double' arithmetic. */ typedef float float_t; typedef double double_t; /* The values returned by `ilogb' for 0 and NaN respectively. */ # define FP_ILOGB0 (-2147483647) # define FP_ILOGBNAN (2147483647) # if !defined _SOFT_FLOAT && !defined __NO_FPRS__ /* The powerpc has a combined multiply/add instruction. */ # define FP_FAST_FMA 1 # define FP_FAST_FMAF 1 # endif #endif /* ISO C99 */
/* Test of <iconv.h> substitute. Copyright (C) 2007-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #if HAVE_ICONV # include <iconv.h> #endif int main () { return 0; }
/*************************************************************************** * Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> * * * * This file is part of the FreeCAD CAx development system. * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef GUI_DOCKWND_PROPERTYVIEW_H #define GUI_DOCKWND_PROPERTYVIEW_H #include "DockWindow.h" #include "Selection.h" class QPixmap; class QTabWidget; namespace App { class PropertyContainer; } namespace Gui { namespace PropertyEditor { class EditableListView; class EditableItem; class PropertyEditor; } // namespace PropertyEditor } // namespace Gui namespace Gui { /** The property view class. */ class PropertyView : public QWidget, public Gui::SelectionObserver { Q_OBJECT public: PropertyView(QWidget *parent=0); virtual ~PropertyView(); Gui::PropertyEditor::PropertyEditor* propertyEditorView; Gui::PropertyEditor::PropertyEditor* propertyEditorData; public Q_SLOTS: /// Stores a preference for the last tab selected void tabChanged(int index); protected: void changeEvent(QEvent *e); private: void onSelectionChanged(const SelectionChanges& msg); private: struct PropInfo; struct PropFind; QTabWidget* tabs; }; namespace DockWnd { /** A dock window with the embedded property view. */ class PropertyDockView : public Gui::DockWindow { Q_OBJECT public: PropertyDockView(Gui::Document* pcDocument, QWidget *parent=0); virtual ~PropertyDockView(); }; } // namespace DockWnd } // namespace Gui #endif // GUI_DOCKWND_PROPERTYVIEW_H
/* ---------------------------------------------------------------------------- */ /* Atmel Microcontroller Software Support */ /* SAM Software Package License */ /* ---------------------------------------------------------------------------- */ /* Copyright (c) 2015, Atmel Corporation */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following condition is met: */ /* */ /* - Redistributions of source code must retain the above copyright notice, */ /* this list of conditions and the disclaimer below. */ /* */ /* Atmel's name may not be used to endorse or promote products derived from */ /* this software without specific prior written permission. */ /* */ /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* ---------------------------------------------------------------------------- */ #ifndef _SAMG54_RTT_COMPONENT_ #define _SAMG54_RTT_COMPONENT_ /* ============================================================================= */ /** SOFTWARE API DEFINITION FOR Real-time Timer */ /* ============================================================================= */ /** \addtogroup SAMG54_RTT Real-time Timer */ /*@{*/ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) /** \brief Rtt hardware registers */ typedef struct { __IO uint32_t RTT_MR; /**< \brief (Rtt Offset: 0x00) Mode Register */ __IO uint32_t RTT_AR; /**< \brief (Rtt Offset: 0x04) Alarm Register */ __I uint32_t RTT_VR; /**< \brief (Rtt Offset: 0x08) Value Register */ __I uint32_t RTT_SR; /**< \brief (Rtt Offset: 0x0C) Status Register */ } Rtt; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ /* -------- RTT_MR : (RTT Offset: 0x00) Mode Register -------- */ #define RTT_MR_RTPRES_Pos 0 #define RTT_MR_RTPRES_Msk (0xffffu << RTT_MR_RTPRES_Pos) /**< \brief (RTT_MR) Real-time Timer Prescaler Value */ #define RTT_MR_RTPRES(value) ((RTT_MR_RTPRES_Msk & ((value) << RTT_MR_RTPRES_Pos))) #define RTT_MR_ALMIEN (0x1u << 16) /**< \brief (RTT_MR) Alarm Interrupt Enable */ #define RTT_MR_RTTINCIEN (0x1u << 17) /**< \brief (RTT_MR) Real-time Timer Increment Interrupt Enable */ #define RTT_MR_RTTRST (0x1u << 18) /**< \brief (RTT_MR) Real-time Timer Restart */ #define RTT_MR_RTTDIS (0x1u << 20) /**< \brief (RTT_MR) Real-time Timer Disable */ #define RTT_MR_RTC1HZ (0x1u << 24) /**< \brief (RTT_MR) Real-Time Clock 1Hz Clock Selection */ /* -------- RTT_AR : (RTT Offset: 0x04) Alarm Register -------- */ #define RTT_AR_ALMV_Pos 0 #define RTT_AR_ALMV_Msk (0xffffffffu << RTT_AR_ALMV_Pos) /**< \brief (RTT_AR) Alarm Value */ #define RTT_AR_ALMV(value) ((RTT_AR_ALMV_Msk & ((value) << RTT_AR_ALMV_Pos))) /* -------- RTT_VR : (RTT Offset: 0x08) Value Register -------- */ #define RTT_VR_CRTV_Pos 0 #define RTT_VR_CRTV_Msk (0xffffffffu << RTT_VR_CRTV_Pos) /**< \brief (RTT_VR) Current Real-time Value */ /* -------- RTT_SR : (RTT Offset: 0x0C) Status Register -------- */ #define RTT_SR_ALMS (0x1u << 0) /**< \brief (RTT_SR) Real-time Alarm Status (cleared on read) */ #define RTT_SR_RTTINC (0x1u << 1) /**< \brief (RTT_SR) Prescaler Roll-over Status (cleared on read) */ /*@}*/ #endif /* _SAMG54_RTT_COMPONENT_ */