text
stringlengths
4
6.14k
/* * Generated by asn1c-0.9.22 (http://lionet.info/asn1c) * From ASN.1 module "CryptographicMessageSyntax2004" * found in "lpa2.asn1" * `asn1c -S/skeletons` */ #ifndef _UnauthAttributes_H_ #define _UnauthAttributes_H_ #include <asn_application.h> /* Including external dependencies */ #include <asn_SET_OF.h> #include <constr_SET_OF.h> #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct CMSAttribute; /* UnauthAttributes */ typedef struct UnauthAttributes { A_SET_OF(struct CMSAttribute) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } UnauthAttributes_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_UnauthAttributes; #ifdef __cplusplus } #endif /* Referred external types */ #include "CMSAttribute.h" #endif /* _UnauthAttributes_H_ */
#ifndef TCPCONNECTION_HACK_H_ #define TCPCONNECTION_HACK_H_ #include <omnetpp.h> #include "TCPConnection.h" #include "ReaSEDefs.h" /** * @brief Extends the original TCP implementation by limited number of open * TCP connections * * This class is derived from the original TCPConnection class. * The extension allows for simulation of a limited number of open TCP * connections per host system. Thus, overload situations at endsystems * can be simulated, too. * * @class TCPConnection_hack */ class REASE_API TCPConnection_hack : public TCPConnection { protected: /// @brief state variable: Worker thread or not? bool worker; public: TCPConnection_hack(TCP *mod, int appGateIndex, int connId):TCPConnection(mod, appGateIndex, connId) {this->worker = false;}; ~TCPConnection_hack(); protected: /// @brief Process incoming TCP segment TCPEventCode processSegmentInListen(TCPSegment *tcpseg, IPvXAddress src, IPvXAddress dest); /// @brief Sets this TCPConnection to the state of a worker thread void setWorkerThread() { this->worker = true; }; /// @brief Returns if this connections is a worker thread or not bool isWorkerThread() { return worker; }; /// @brief Clone a listening connection. Used for forking. TCPConnection *cloneListeningConnection(); /// @brief Implements the slightly changed TCP state machine bool performStateTransition(const TCPEventCode& event); }; #endif /*TCPCONNECTION_HACK_H_*/
/* * File: dyn_SWI.h * Author: xxxajk@gmail.com * * Created on December 5, 2014, 9:12 AM * * 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 DYN_SWI_H #define DYN_SWI_H // Not actually required for compile... #if defined(ARDUINO) #include <Arduino.h> #endif #if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) #if defined(ARDUINO_ARCH_PIC32) #include <p32xxxx.h> #endif #ifdef __cplusplus #if defined(true) #undef true #endif #if defined(false) #undef false #endif #endif #if defined(ARDUINO_spresense_ast) #define SWI_IRQ_NUM 666 // because this board is totally evil. #elif defined(ARDUINO_ARCH_PIC32) #ifndef SWI_IRQ_NUM #if defined(_DSPI0_IPL_ISR) #define SWI_IPL _DSPI0_IPL_ISR #define SWI_VECTOR _DSPI0_ERR_IRQ #define SWI_IRQ_NUM _DSPI0_ERR_IRQ #elif defined(_PMP_ERROR_IRQ) #define SWI_IRQ_NUM _PMP_ERROR_IRQ #define SWI_VECTOR _PMP_VECTOR #else #error SWI_IRQ_NUM and SWI_VECTOR need a definition #endif #ifdef __cplusplus extern "C" { void #if defined(__PIC32MZXX__) __attribute__((nomips16,at_vector(SWI_VECTOR),interrupt(SWI_IPL))) #else __attribute__((interrupt(),nomips16)) #endif softISR(void); } #endif #endif #elif !defined(NVIC_NUM_INTERRUPTS) // Assume CMSIS #define __USE_CMSIS_VECTORS__ #if defined(NUMBER_OF_INT_VECTORS) #define NVIC_NUM_INTERRUPTS (NUMBER_OF_INT_VECTORS-16) #else #define NVIC_NUM_INTERRUPTS ((int)PERIPH_COUNT_IRQn) #endif #define VECTORTABLE_SIZE (NVIC_NUM_INTERRUPTS+16) #define VECTORTABLE_ALIGNMENT (0x100ul) #define NVIC_GET_ACTIVE(n) NVIC_GetActive((IRQn_Type)n) #define NVIC_GET_PENDING(n) NVIC_GetPendingIRQ((IRQn_Type)n) #define NVIC_SET_PENDING(n) NVIC_SetPendingIRQ((IRQn_Type)n) #define NVIC_ENABLE_IRQ(n) NVIC_EnableIRQ((IRQn_Type)n) #define NVIC_SET_PRIORITY(n ,p) NVIC_SetPriority((IRQn_Type)n, (uint32_t) p) //extern "C" { // extern uint32_t _VectorsRam[VECTORTABLE_SIZE] __attribute__((aligned(VECTORTABLE_ALIGNMENT))); //} #ifndef SWI_IRQ_NUM #if defined(__SAM3X8E__) && defined(_VARIANT_ARDUINO_DUE_X_) // DUE // Choices available: // HSMCI_IRQn Multimedia Card Interface (HSMCI) // EMAC_IRQn Ethernet MAC (EMAC) // EMAC is not broken out on the official DUE, but is on clones. // SPI0_IRQn Serial Peripheral Interface (SPI0) // SPI0_IRQn seems to be the best choice, as long as nobody uses an ISR based master #define SWI_IRQ_NUM SPI0_IRQn #elif defined(ARDUINO_SAMD_ZERO) // Just use sercom4's unused IRQ vector. #define SWI_IRQ_NUM I2S_IRQn //#define SWI_IRQ_NUM SERCOM4_IRQn #endif #endif #ifndef SWI_IRQ_NUM #error SWI_IRQ_NUM not defined (CMSIS) #endif #elif defined(CORE_TEENSY) #ifndef NVIC_GET_ACTIVE #define NVIC_GET_ACTIVE(n) (*((volatile uint32_t *)0xE000E300 + ((n) >> 5)) & (1 << ((n) & 31))) #endif #ifndef NVIC_GET_PENDING #define NVIC_GET_PENDING(n) (*((volatile uint32_t *)0xE000E200 + ((n) >> 5)) & (1 << ((n) & 31))) #ifndef SWI_IRQ_NUM #if defined(__MK20DX256__) #define SWI_IRQ_NUM 17 #elif defined(__MK20DX128__) #define SWI_IRQ_NUM 5 #elif defined(__MKL26Z64__) #define SWI_IRQ_NUM 4 #elif defined(__MK66FX1M0__) #define SWI_IRQ_NUM 30 #elif defined(__MK64FX512__) #define SWI_IRQ_NUM 30 #elif defined(__IMXRT1052__) || defined(__IMXRT1062__) #define SWI_IRQ_NUM 71 #else #error Do not know how to relocate IRQ vectors for this pjrc product #endif #endif #endif #else // Not CMSIS or PJRC CORE_TEENSY or PIC32 or SPRESENSE #error Do not know how to relocate IRQ vectors or perform SWI #endif // SWI_IRQ_NUM #ifndef SWI_IRQ_NUM #error SWI_IRQ_NUM not defined #else /** * Use this class to extend your class, in order to provide * a C++ context callable SWI. */ class dyn_SWI { public: /** * Override this method with your code. */ virtual void dyn_SWISR(void) { }; }; extern int exec_SWI(const dyn_SWI* klass); #include "SWI_INLINE.h" // IMPORTANT! Define this so that you do NOT end up with a NULL stub! #define SWI_NO_STUB #endif /* SWI_IRQ_NUM */ #endif /* __arm__ */ // if no SWI for CPU (e.g. AVR) make a void stub. #ifndef SWI_NO_STUB #define Init_dyn_SWI() (void(0)) #if !defined(DDSB) #define DDSB() (void(0)) #endif #endif #endif /* DYN_SWI_H */
#ifndef CREGSHD61700WIDGET_H #define CREGSHD61700WIDGET_H #include <QWidget> #include "ui/cregcpu.h" class CCPU; namespace Ui { class Cregshd61700Widget; } class Cregshd61700Widget : public CregCPU { Q_OBJECT public: explicit Cregshd61700Widget(CPObject *parent = 0,CCPU *pCPU = 0); ~Cregshd61700Widget(); void refresh(); private: Ui::Cregshd61700Widget *ui; }; #endif // CREGSHD61700WIDGET_H
/***************************************************************************** Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2018, 2020, MariaDB Corporation. 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 Street, Fifth Floor, Boston, MA 02110-1335 USA *****************************************************************************/ /**************************************************//** @file include/row0types.h Row operation global types Created 12/27/1996 Heikki Tuuri *******************************************************/ #pragma once #include "buf0types.h" struct plan_t; struct upd_t; struct upd_field_t; struct upd_node_t; struct del_node_t; struct ins_node_t; struct sel_node_t; struct open_node_t; struct fetch_node_t; struct row_printf_node_t; struct sel_buf_t; struct undo_node_t; struct purge_node_t; struct row_ext_t; /** Buffer for logging modifications during online index creation */ struct row_log_t; /* MySQL data types */ struct TABLE; /** Purge virtual column node information. */ struct purge_vcol_info_t { private: /** Is there a possible need to evaluate virtual columns? */ bool requested; /** Do we have to evaluate virtual columns (using mariadb_table)? */ bool used; /** True if it is used for the first time. */ bool first_use; /** MariaDB table opened for virtual column computation. */ TABLE* mariadb_table; public: /** Default constructor */ purge_vcol_info_t() : requested(false), used(false), first_use(false), mariadb_table(NULL) {} /** Reset the state. */ void reset() { requested = false; used = false; first_use = false; mariadb_table = NULL; } /** Validate the virtual column information. @return true if the mariadb table opened successfully or doesn't try to calculate virtual column. */ bool validate() const { return !used || mariadb_table; } /** @return the table handle for evaluating virtual columns */ TABLE* table() const { return mariadb_table; } /** Set the table handle for evaluating virtual columns. @param[in] table table handle */ void set_table(TABLE* table) { ut_ad(!table || is_first_fetch()); mariadb_table = table; } /** Note that virtual column information may be needed. */ void set_requested() { ut_ad(!used); ut_ad(!first_use); ut_ad(!mariadb_table); requested = true; } /** @return whether the virtual column information may be needed */ bool is_requested() const { return requested; } /** Note that the virtual column information is needed. */ void set_used() { ut_ad(requested); if (first_use) { first_use = false; ut_ad(used); return; } if (!used) { first_use = used = true; } } /** @return whether the virtual column information is needed */ bool is_used() const { ut_ad(!first_use || used); ut_ad(!used || requested); ut_ad(used || !mariadb_table); return used; } /** Check whether it fetches mariadb table for the first time. @return true if first time tries to open mariadb table. */ bool is_first_fetch() const { ut_ad(!first_use || used); ut_ad(!used || requested); ut_ad(used || !mariadb_table); return first_use; } };
/* * Omnima MiniEMBWiFi board support * * Copyright (C) 2011 Johnathan Boyce <jon.boyce@globalreach.eu.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. */ #include <linux/init.h> #include <linux/platform_device.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/mtd/physmap.h> #include <linux/gpio.h> #include <asm/mach-ralink/machine.h> #include <asm/mach-ralink/dev-gpio-buttons.h> #include <asm/mach-ralink/dev-gpio-leds.h> #include <asm/mach-ralink/rt305x.h> #include <asm/mach-ralink/rt305x_regs.h> #include "devices.h" #define OMNI_EMB_GPIO_BUTTON_RESET 12 /* active low */ #define OMNI_EMB_KEYS_POLL_INTERVAL 20 #define OMNI_EMB_KEYS_DEBOUNCE_INTERVAL (3 * OMNI_EMB_KEYS_POLL_INTERVAL) #define OMNI_EMB_GPIO_LED_STATUS 9 #define OMNI_EMB_GPIO_LED_WLAN 14 static struct mtd_partition emb_partitions[] = { { .name = "uboot", .offset = 0, .size = 0x030000, }, { .name = "uboot-config", .offset = 0x030000, .size = 0x040000, .mask_flags = MTD_WRITEABLE, }, { .name = "factory", .offset = 0x040000, .size = 0x050000, .mask_flags = MTD_WRITEABLE, }, { .name = "linux", .offset = 0x050000, .size = 0x100000, }, { .name = "rootfs", .offset = 0x150000, .size = 0x6B0000, }, { .name = "firmware", .offset = 0x050000, .size = 0x7B0000, } }; static struct gpio_led omni_emb_leds_gpio[] __initdata = { { .name = "emb:green:status", .gpio = OMNI_EMB_GPIO_LED_STATUS, .active_low = 1, }, { .name = "emb:green:wlan", .gpio = OMNI_EMB_GPIO_LED_WLAN, .active_low = 1, } }; static struct gpio_keys_button omni_emb_gpio_buttons[] __initdata = { { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, .debounce_interval = OMNI_EMB_KEYS_DEBOUNCE_INTERVAL, .gpio = OMNI_EMB_GPIO_BUTTON_RESET, .active_low = 1, } }; static void __init omni_emb_init(void) { rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW; rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT); ramips_register_gpio_leds(-1, ARRAY_SIZE(omni_emb_leds_gpio), omni_emb_leds_gpio); ramips_register_gpio_buttons(-1, OMNI_EMB_KEYS_POLL_INTERVAL, ARRAY_SIZE(omni_emb_gpio_buttons), omni_emb_gpio_buttons); rt305x_flash0_data.nr_parts = ARRAY_SIZE(emb_partitions); rt305x_flash0_data.parts = emb_partitions; rt305x_register_flash(0); rt305x_register_ethernet(); rt305x_register_wifi(); rt305x_register_wdt(); rt305x_register_usb(); } MIPS_MACHINE(RAMIPS_MACH_OMNI_EMB, "OMNI-EMB", "Omnima MiniEMBWiFi", omni_emb_init);
/* -*- Mode:C++; c-file-style:"microsoft"; indent-tabs-mode:nil; -*- */ #ifndef __TOCINO_ROUTER_H__ #define __TOCINO_ROUTER_H__ #include "ns3/object.h" #include "ns3/ptr.h" #include "tocino-misc.h" namespace ns3 { class Packet; class TocinoNetDevice; class TocinoRx; // ISSUE-REVIEW: consider moving this to its own file struct TocinoRoute { TocinoOutputPort outputPort; TocinoInputVC inputVC; TocinoOutputVC outputVC; TocinoRoute() : outputPort( TOCINO_INVALID_PORT ) , inputVC( TOCINO_INVALID_VC ) , outputVC( TOCINO_INVALID_VC ) {} TocinoRoute( TocinoOutputPort op, TocinoInputVC ivc, TocinoOutputVC ovc ) : outputPort( op ) , inputVC( ivc ) , outputVC( ovc ) {} bool operator==( const TocinoRoute& other ) const { if( other.outputPort != outputPort ) return false; if( other.inputVC != inputVC ) return false; if( other.outputVC != outputVC ) return false; return true; } bool operator!=( const TocinoRoute& other ) const { return !( *this == other ); } }; const TocinoRoute TOCINO_INVALID_ROUTE( TOCINO_INVALID_PORT, TOCINO_INVALID_VC, TOCINO_INVALID_VC ); struct TocinoRouter : public Object { static TypeId GetTypeId( void ); // ISSUE-REVIEW: // Ideally we'd only have only the route function // as a part of this abstract interface. Anything that // can take a flit and produce a route should be a legit // router. If today's TocinoRx needs more, maybe he // should include a polymorphic downcast to a subclass? // // RELATED-ISSUE-REVIEW: // Do we really want to *require* that Route be a const // function? I mean it's fine if an implementation wants // to do this, but it shouldn't be required. But, how // the hell do you define an abstract base class where // derived classes can choose? virtual void Initialize( const TocinoNetDevice*, const TocinoInputPort ) = 0; virtual TocinoRoute Route( Ptr<const Packet> ) const = 0; }; } #endif //__TOCINO_ROUTER_H__
/**************************************************************************** This file is part of Knuckle Cracker binary diff utility. Copyright (C) 2004 Stanislaw Y. Pusep This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. E-Mail: cr@cker.com.br Site: http://sysd.org/ ****************************************************************************/ #include "escape.h" int ascdigit(char chr, int base) { int x; chr = crk_tolower(chr); if (chr >= '0' && chr <= '9') x = (chr - '0'); else if (chr >= 'a' && chr <= 'f') x = (chr - 'a') + 10; else return -1; if (x < base) return x; else return -1; } int asc2chr(char *str, int base, unsigned char *result) { int i, j; int x; int pow = 1; int num = 0; int max = 0; int len = strlen(str); switch (base) { case 0x02: max = 7; break; case 0x08: max = 2; break; case 0x0a: max = 2; break; case 0x10: max = 1; break; } if (max > len) max = len; for (i = max, j = 0; i >= 0; i--, j++) { x = ascdigit(str[i], base); if (x != -1) { num += pow * x; pow *= base; } else { num = 0; pow = 1; j = -1; } } if (j > 0) { *result = num > 0xff ? 0xff : (unsigned char) num; return j - 1; } else return -1; } int crk_uncescape(char *str, char *buf, int buflen) { char *p; char x; int i, len; for (p = str, i = 0; *p != '\0' && i < buflen; p++, i++) { if (*p == '\\') { p++; x = '\0'; switch (*p) { /* octal */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': if ((len = asc2chr(p, 8, &x)) >= 0) p += len; else continue; break; /* hex */ case 'x': p ++; if ((len = asc2chr(p, 16, &x)) >= 0) p += len; else { p -= 2; buf[i] = '\\'; continue; } break; /* binary */ case '!': p ++; if ((len = asc2chr(p, 2, &x)) >= 0) p += len; else { p -= 2; buf[i] = '\\'; continue; } break; /* common escapes */ case '\\': x = '\\'; break; case '"': x = '"'; break; case 't': x = 0x09; break; case 'n': x = 0x0a; break; case 'r': x = 0x0d; break; case 'f': x = 0x0c; break; case 'b': x = 0x08; break; case 'a': x = 0x07; break; case 'e': x = 0x1b; break; /* asshole-proof */ default: buf[i] = *p; continue; } buf[i] = x; } else { buf[i] = *p; } } return i; } char *crk_cescape(unsigned char *buf, int buflen) { int i, len = (buflen + 1) * 4; unsigned char x, y[5], z, *str = (char *) malloc(len); char *fmt; memset(str, '\0', len); for (i = 0; i < buflen; i++) { memset(y, '\0', sizeof(y)); y[0] = '\\'; x = buf[i]; // next character if (i + 1 < buflen) z = buf[i + 1]; else z = 0; switch (x) { case '\\': y[1] = '\\'; break; case '"': y[1] = '"'; break; case 0x09: y[1] = 't'; break; case 0x0a: y[1] = 'n'; break; case 0x0d: y[1] = 'r'; break; case 0x0c: y[1] = 'f'; break; case 0x08: y[1] = 'b'; break; case 0x07: y[1] = 'a'; break; case 0x1b: y[1] = 'e'; break; default: // printable ASCII if (x >= 32 && x <= 126) y[0] = x; else { if (x < 8) // oct, pad if necessary fmt = crk_isodigit(z) ? "\\%03o" : "\\%o"; else // hex, pad if necessary fmt = crk_isxdigit(z) ? "\\x%02x" : "\\x%x"; sprintf(y, fmt, x); } } strcat(str, y); } return str; }
/** ****************************************************************************** * @file LwIP/LwIP_HTTP_Server_Netconn_RTOS/Inc/stm32f4xx_it.h * @author MCD Application Team * @version V1.0.1 * @date 09-October-2015 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void EXTI9_5_IRQHandler(void); void ETH_IRQHandler(void); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* Pencil - Traditional Animation Software Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon Copyright (C) 2012-2018 Matthew Chiawen Chang 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 DOUBLEPROGRESSDIALOG_H #define DOUBLEPROGRESSDIALOG_H #include <QDialog> #include <QProgressBar> namespace Ui { class DoubleProgressDialog; } class DoubleProgressDialog : public QDialog { Q_OBJECT public: explicit DoubleProgressDialog(QWidget *parent = 0); ~DoubleProgressDialog(); QString getStatus(); void setStatus(QString msg); class ProgressBarControl { public: ProgressBarControl(QProgressBar *b); float getMin() { return min; } void setMin(float minimum); float getMax() { return max; } void setMax(float maximum); void setRange(float minimum, float maximum) { setMin(minimum); setMax(maximum); } float getValue() { return val; } void setValue(float value); int getPrecision(); void setPrecision(int e); private: QProgressBar *bar; float min = 0, max = 1, val = 0; int convertUnits(float value); int unitFactor = 100; }; ProgressBarControl *major, *minor; signals: void canceled(); private: Ui::DoubleProgressDialog *ui; }; #endif // DOUBLEPROGRESSDIALOG_H
/* * Copyright (c) 2011-2012 NVIDIA CORPORATION. All rights reserved. * * NVIDIA Corporation and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an express * license agreement from NVIDIA Corporation is strictly prohibited. */ #include "nvodm_pmu.h" #include "nvodm_pmu_cardhu.h" #include "nvassert.h" NvBool CardhuPmuGetAcLineStatus( NvOdmPmuDeviceHandle hDevice, NvOdmPmuAcLineStatus *pStatus) { NV_ASSERT(hDevice); NV_ASSERT(pStatus); // NOTE: Not implemented completely as it is only for bootloader. *pStatus = NvOdmPmuAcLine_Online; return NV_TRUE; } NvBool CardhuPmuGetBatteryStatus( NvOdmPmuDeviceHandle hDevice, NvOdmPmuBatteryInstance batteryInst, NvU8 *pStatus) { NV_ASSERT(hDevice); NV_ASSERT(pStatus); NV_ASSERT(batteryInst <= NvOdmPmuBatteryInst_Num); // NOTE: Not implemented completely as it is only for bootloader. *pStatus = NVODM_BATTERY_STATUS_NO_BATTERY; return NV_TRUE; } NvBool CardhuPmuGetBatteryData( NvOdmPmuDeviceHandle hDevice, NvOdmPmuBatteryInstance batteryInst, NvOdmPmuBatteryData *pData) { NvOdmPmuBatteryData batteryData; batteryData.batteryLifePercent = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryLifeTime = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryVoltage = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryCurrent = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryAverageCurrent = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryAverageInterval = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryMahConsumed = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryTemperature = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batteryVoltage = NVODM_BATTERY_DATA_UNKNOWN; batteryData.batterySoc = NVODM_BATTERY_DATA_UNKNOWN; NV_ASSERT(hDevice); NV_ASSERT(pData); NV_ASSERT(batteryInst <= NvOdmPmuBatteryInst_Num); // NOTE: Not implemented completely as it is only for bootloader. *pData = batteryData; return NV_TRUE; } void CardhuPmuGetBatteryFullLifeTime( NvOdmPmuDeviceHandle hDevice, NvOdmPmuBatteryInstance batteryInst, NvU32 *pLifeTime) { *pLifeTime = NVODM_BATTERY_DATA_UNKNOWN; } void CardhuPmuGetBatteryChemistry( NvOdmPmuDeviceHandle hDevice, NvOdmPmuBatteryInstance batteryInst, NvOdmPmuBatteryChemistry *pChemistry) { *pChemistry = NvOdmPmuBatteryChemistry_LION; } NvBool CardhuPmuSetChargingCurrent( NvOdmPmuDeviceHandle hDevice, NvOdmPmuChargingPath chargingPath, NvU32 chargingCurrentLimitMa, NvOdmUsbChargerType ChargerType) { NV_ASSERT(hDevice); // NOTE: Not implemented completely as it is only for bootloader. return NV_TRUE; } void CardhuPmuInterruptHandler( NvOdmPmuDeviceHandle hDevice) { // NOTE: Not implemented completely as it is only for bootloader. } NvBool CardhuPmuReadRtc( NvOdmPmuDeviceHandle hDevice, NvU32 *Count) { // NOTE: Not implemented completely as it is only for bootloader. *Count = 0; return NV_FALSE; } NvBool CardhuPmuWriteRtc( NvOdmPmuDeviceHandle hDevice, NvU32 Count) { // NOTE: Not implemented completely as it is only for bootloader. return NV_FALSE; } NvBool CardhuPmuIsRtcInitialized( NvOdmPmuDeviceHandle hDevice) { // NOTE: Not implemented completely as it is only for bootloader. return NV_FALSE; }
// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*- // // Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com> // (C) 2014-2016 Gunter Königsmann <wxMaxima@physikbuch.de> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // SPDX-License-Identifier: GPL-2.0+ #ifndef SUBCELL_H #define SUBCELL_H #include "Cell.h" class SubCell : public Cell { public: SubCell(Cell *parent, Configuration **config, CellPointers *cellPointers); ~SubCell(); std::list<Cell *> GetInnerCells(); Cell *Copy(); void SetBase(Cell *base); void SetIndex(Cell *index); void RecalculateHeight(int fontsize); void RecalculateWidths(int fontsize); virtual void Draw(wxPoint point); wxString ToString(); wxString ToMatlab(); wxString ToTeX(); wxString ToMathML(); wxString ToOMML(); wxString ToXML(); protected: Cell *m_baseCell; Cell *m_indexCell; }; #endif // SUBCELL_H
/* Copyright (C) * 2011 - Michael.Kang blackfin.kang@gmail.com * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #ifndef __ARM_DYNCOM_RUN__ #define __ARM_DYNCOM_RUN__ #include "arm/skyeye_common/skyeye_types.h" void switch_mode(arm_core_t *core, uint32_t mode); /* FIXME, we temporarily think thumb instruction is always 16 bit */ static inline u32 GET_INST_SIZE(arm_core_t* core) { return core->TFlag? 2 : 4; } /** * @brief Read R15 and forced R15 to wold align, used address calculation * * @param core * @param Rn * * @return */ static inline addr_t CHECK_READ_REG15_WA(arm_core_t* core, int Rn) { return (Rn == 15)? ((core->Reg[15] & ~0x3) + GET_INST_SIZE(core) * 2) : core->Reg[Rn]; } /** * @brief Read R15, used to data processing with pc * * @param core * @param Rn * * @return */ static inline u32 CHECK_READ_REG15(arm_core_t* core, int Rn) { return (Rn == 15)? ((core->Reg[15] & ~0x1) + GET_INST_SIZE(core) * 2) : core->Reg[Rn]; } #endif
#ifndef SELECTTARGETDLG_H #define SELECTTARGETDLG_H #include <wx/dialog.h> class cbProject; class ProjectBuildTarget; class SelectTargetDlg : public wxDialog { public: SelectTargetDlg(wxWindow* parent, cbProject* project, int selected = 0); ~SelectTargetDlg(); void EndModal(int retCode); int GetSelection() const { return m_Selected; } ProjectBuildTarget* GetSelectionTarget(); private: void OnListboxSelection(wxCommandEvent& event); void OnListboxDClick(wxCommandEvent& event); void OnCheckboxSelection(wxCommandEvent& event); void OnHostApplicationButtonClick(wxCommandEvent& event); void UpdateSelected(); cbProject* m_pProject; int m_Selected; DECLARE_EVENT_TABLE() }; #endif // SELECTTARGETDLG_H
/** * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved. * * This file is part of the KGantt library. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef KGANTTCONSTRAINTGRAPHICSITEM_H #define KGANTTCONSTRAINTGRAPHICSITEM_H #include <QGraphicsItem> #include "kganttconstraint.h" namespace KGantt { class GraphicsScene; class KGANTT_EXPORT ConstraintGraphicsItem : public QGraphicsItem { public: enum { Type = UserType + 43 }; explicit ConstraintGraphicsItem( const Constraint& c, QGraphicsItem* parent = 0, GraphicsScene* scene = 0 ); virtual ~ConstraintGraphicsItem(); /*reimp*/ int type() const; /*reimp (non virtual)*/GraphicsScene* scene() const; /*reimp*/ QString ganttToolTip() const; /*reimp*/ QRectF boundingRect() const; /*reimp*/ void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 ); inline const Constraint& constraint() const { return m_constraint; } Constraint proxyConstraint() const; void setStart( const QPointF& start ); inline QPointF start() const { return m_start; } void setEnd( const QPointF& end ); inline QPointF end() const { return m_end; } void updateItem( const QPointF& start,const QPointF& end ); private: Constraint m_constraint; QPointF m_start; QPointF m_end; }; } #endif /* KGANTTCONSTRAINTGRAPHICSITEM_H */
#ifndef BACKPASS_H #define BACKPASS_H #include "iLQG.h" int back_pass(tOptSet *o); #endif /* BACKPASS_H */
/* cptpg.c Copyright (c) J.J. Green 2016 */ #include <btrace.h> #include <cpt.h> #include <cptread.h> #include "cptpg.h" #include "pg.h" static int cptpg_convert(cpt_t*, pg_t*, cptpg_opt_t); extern int cptpg(const char *infile, const char *outfile, cptpg_opt_t opt) { cpt_t *cpt; int err = 1; if ((cpt = cpt_new()) != NULL) { if (cpt_read(infile, cpt) == 0) { pg_t *pg; if ((pg = pg_new()) != NULL) { if (cptpg_convert(cpt, pg, opt) == 0) { if (pg_write(pg, outfile) == 0) err = 0; else btrace("error writing pg"); } else btrace("failed to convert cpt to svg"); pg_destroy(pg); } else btrace("failed to allocate pg"); } else btrace("failed to load cpt from %s", (infile ? infile : "<stdin>")); cpt_destroy(cpt); } else btrace("failed to create cpt struct"); if (err) btrace("failed to write svg to %s", (outfile ? outfile : "<stdout>")); return err; } static int cptpg_convert(cpt_t *cpt, pg_t *pg, cptpg_opt_t opt) { pg_set_percentage(pg, opt.percentage); /* check we have at least one cpt segment */ if (cpt->segment == NULL) { btrace("cpt has no segments"); return 1; } /* get the colour model */ switch (cpt->model) { case model_rgb: case model_hsv: break; case model_hsvp: btrace("conversion of colour model %s not implemented", model_name(cpt->model)); return 1; default: btrace("unknown colour model"); return 1; } /* convert cpt segments to svg stops*/ int m = 0, n; cpt_seg_t *seg; for (n = 0, seg = cpt->segment ; seg ; seg = seg->rseg) { cpt_sample_t lsmp, rsmp; rgb_t rcol, lcol; filltype_t type; lsmp = seg->lsmp; rsmp = seg->rsmp; if (lsmp.fill.type != rsmp.fill.type) { btrace("sorry, can't convert mixed fill types"); return 1; } type = lsmp.fill.type; switch (type) { case fill_colour: switch (cpt->model) { case model_rgb: lcol = lsmp.fill.u.colour.rgb; rcol = rsmp.fill.u.colour.rgb; break; case model_hsv: if (hsv_to_rgb(lsmp.fill.u.colour.hsv, &lcol) != 0 || hsv_to_rgb(rsmp.fill.u.colour.hsv, &rcol) != 0) { btrace("failed conversion of HSV to RGB"); return 1; } break; case model_hsvp: /* not reached (see above) */ btrace("conversion not implemented"); return 1; default: return 1; } break; case fill_grey: case fill_hatch: case fill_file: case fill_empty: btrace("fill type not implemented yet"); return 1; default: btrace("strange fill type"); return 1; } /* always insert the left colour */ if (pg_push(pg, lsmp.val, lcol, 255) == 0) m++; else { btrace("error adding stop for segment %i left", n); return 1; } /* if there is a segment to the right, and if its left segment is the same colour at the our right segment then dont insert it. Otherwise do. */ if ( ! ((seg->rseg) && fill_eq(rsmp.fill, seg->rseg->lsmp.fill, cpt->model))) { if (pg_push(pg, rsmp.val, rcol, 255) == 0) m++; else { btrace("error adding stop for segment %i right", n); return 1; } } n++; } if (opt.verbose) printf("converted %i segments to %i stops", n, m); return 0; }
/** * @file */ /* Copyright (C) 2002-2011 UFO: Alien Invasion. 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 E_EVENT_INVAMMO_H_ #define E_EVENT_INVAMMO_H_ #include "../../e_main.h" void CL_InvAmmo(const eventRegister_t *self, dbuffer *msg); #endif
/* * Common tx4927 irq handler * * Author: MontaVista Software, Inc. * source@mvista.com * * 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/init.h> #include <linux/interrupt.h> <<<<<<< HEAD #include <linux/irq.h> ======= >>>>>>> 296c66da8a02d52243f45b80521febece5ed498a #include <asm/irq_cpu.h> #include <asm/txx9/tx4927.h> void __init tx4927_irq_init(void) { int i; mips_cpu_irq_init(); txx9_irq_init(TX4927_IRC_REG & 0xfffffffffULL); <<<<<<< HEAD irq_set_chained_handler(MIPS_CPU_IRQ_BASE + TX4927_IRC_INT, ======= set_irq_chained_handler(MIPS_CPU_IRQ_BASE + TX4927_IRC_INT, >>>>>>> 296c66da8a02d52243f45b80521febece5ed498a handle_simple_irq); /* raise priority for errors, timers, SIO */ txx9_irq_set_pri(TX4927_IR_ECCERR, 7); txx9_irq_set_pri(TX4927_IR_WTOERR, 7); txx9_irq_set_pri(TX4927_IR_PCIERR, 7); txx9_irq_set_pri(TX4927_IR_PCIPME, 7); for (i = 0; i < TX4927_NUM_IR_TMR; i++) txx9_irq_set_pri(TX4927_IR_TMR(i), 6); for (i = 0; i < TX4927_NUM_IR_SIO; i++) txx9_irq_set_pri(TX4927_IR_SIO(i), 5); }
/* * Copyright (C) 2013 Jolla Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * */ #ifndef PROVISIONINGSERVICE_H #define PROVISIONINGSERVICE_H #include <QObject> class ProvisioningService : public QObject { Q_OBJECT public: explicit ProvisioningService(QObject *parent = 0); void Notify(const QByteArray &header, const QByteArray &body); public slots: private: /* * Decode WBXML to Prov 1.0 XML */ bool decodeWBXML(const QByteArray &wbxml, QByteArray &xml); /* * Parse PROV 1.0 data, return all found Access Point Names */ QStringList Parse(const QByteArray &doc); }; #endif // PROVISIONINGSERVICE_H
/* Reentrant versions of read system call. */ #include <reent.h> #include <unistd.h> #include <_syslist.h> /* Some targets provides their own versions of this functions. Those targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */ #ifdef _REENT_ONLY #ifndef REENTRANT_SYSCALLS_PROVIDED #define REENTRANT_SYSCALLS_PROVIDED #endif #endif #ifndef REENTRANT_SYSCALLS_PROVIDED /* We use the errno variable used by the system dependent layer. */ #undef errno extern int errno; /* FUNCTION <<_read_r>>---Reentrant version of read INDEX _read_r ANSI_SYNOPSIS #include <reent.h> _ssize_t _read_r(struct _reent *<[ptr]>, int <[fd]>, void *<[buf]>, size_t <[cnt]>); TRAD_SYNOPSIS #include <reent.h> _ssize_t _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>) struct _reent *<[ptr]>; int <[fd]>; char *<[buf]>; size_t <[cnt]>; DESCRIPTION This is a reentrant version of <<read>>. It takes a pointer to the global data block, which holds <<errno>>. */ _ssize_t _read_r (ptr, fd, buf, cnt) struct _reent *ptr; int fd; _PTR buf; size_t cnt; { _ssize_t ret; errno = 0; if ((ret = (_ssize_t)_read (fd, buf, cnt)) == -1 && errno != 0) ptr->_errno = errno; return ret; } #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
/* -*- C++ -*- */ //============================================================================= /** * @file QoS_Session.h * * @author Vishal Kachroo <vishal@cs.wustl.edu> */ //============================================================================= #ifndef ACE_QOS_SESSION_H #define ACE_QOS_SESSION_H #include /**/ "ace/pre.h" #include "ACE_QoS_Export.h" #include "ace/INET_Addr.h" #include "ace/OS_QoS.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_SOCK; class ACE_QoS_Manager; typedef int ACE_Protocol_ID; // IPPROTO_UDP or IPPROTO_TCP. /** * @class ACE_QoS_Session * * @brief A QoS Session object. * * This class defines the interface for a QoS Session. It abstracts the * notion of QoS on different platforms and presents a simple, easy-to-use * API. Current [RAPI,GQoS] and future implementations will conform to this * interface. */ class ACE_QoS_Export ACE_QoS_Session { public: enum RSVP_Event_Type { RSVP_PATH_EVENT, RSVP_RESV_EVENT, RSVP_RESV_CONFIRM, RSVP_RESV_ERROR, RSVP_PATH_ERROR }; /// A flag to indicate if this endpoint is a sender or a receiver or /// both. enum ACE_End_Point_Type { ACE_QOS_SENDER, ACE_QOS_RECEIVER, ACE_QOS_BOTH }; /// to shutup g++. virtual ~ACE_QoS_Session (void) {}; /// Open a QoS session [dest IP, dest port, Protocol ID]. virtual int open (ACE_INET_Addr dest_addr, ACE_Protocol_ID protocol_id) = 0; /// Close the QoS Session. virtual int close (void) = 0; /// Returns the QoS in the current session. virtual ACE_QoS qos () const = 0; /// Set QoS for the current session. The qos manager is used to /// confirm if this QoS session was subscribed to by the socket. virtual int qos (ACE_SOCK *socket, ACE_QoS_Manager *qos_manager, const ACE_QoS &ace_qos) = 0; /** * Sets the QoS for this session object to ace_qos. Does not * interfere with the QoS in the underlying socket. This call is * useful to update the QoS object when the underlying socket QoS is * being set through a mechanism other than the previous qos () * method e.g. inside the dgram_mcast.subscribe () where the QoS for * the socket is set through ACE_OS::join_leaf (). */ virtual void qos (const ACE_QoS &ace_qos) = 0; /** * This is called from handle_qos () method of the the QoS Event * Handler. Invoking this method is an indication of a QoS event * occurring, that may have resulted in a change of QoS for the * underlying session. This method updates the QoS object associated * with this session. */ virtual int update_qos (void) = 0; /// Get/Set methods for the flags_. virtual ACE_End_Point_Type flags () const = 0; virtual void flags (const ACE_End_Point_Type flags) = 0; /// Get the session id. virtual int session_id () const = 0; /// Set the session id. virtual void session_id (const int session_id) = 0; /// Get the file descriptor on which RSVP events will occur. virtual ACE_HANDLE rsvp_events_handle (void) = 0; virtual void rsvp_event_type (RSVP_Event_Type event_type) = 0; ///Set the RAPI event that last occurred virtual RSVP_Event_Type rsvp_event_type (void) = 0; ///Get the RAPI event that last occurred /// Get the destination address for this session. virtual ACE_INET_Addr dest_addr () const = 0; /// Set the destination address for this session. virtual void dest_addr (const ACE_INET_Addr &dest_addr) = 0; /// Get the source port for this session. virtual u_short source_port () const = 0; /// Set the source port for this session. virtual void source_port (const u_short &source_port) = 0; //Set the source host virtual ACE_INET_Addr* source_addr () const = 0; /// Set the source port for this session. virtual void source_addr (ACE_INET_Addr* source_addr) = 0; /** * Returns the version of the underlying RSVP implementation. Is * meaningful only when the underlying implementation has * versioning. */ virtual int version (void) = 0; protected: /// Source port if this is a Sender session. Used for rapi_sender (). u_short source_port_; /// session id for the session. int session_id_; /// Destination address for this session. ACE_INET_Addr dest_addr_; /// Source address for this session. ACE_INET_Addr* src_addr_; /// Is this a TCP or a UDP session. ACE_Protocol_ID protocol_id_; /// QoS for this session. ACE_QoS qos_; /// Specifies if this is a sending/receiving/both session. ACE_End_Point_Type flags_; RSVP_Event_Type rsvp_event_type_; //Has the last rsvp event that occurred }; ACE_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* ACE_QOS_SESSION_H */
#ifndef UITEXTBOX_H #define UITEXTBOX_H #include "uiwidget.h" class UISprite; class UITextBox : public UIWidget { public: UITextBox(void); virtual ~UITextBox(void); virtual void Release(); virtual void LoadContent(ID3D10Device * graphicsdevice); virtual void XmlRead(TiXmlElement * element); virtual void Draw(ID3D10Device * graphicsdevice); virtual void Initialise(); virtual void Reset(); virtual void Update() override; virtual void OnFocus() override; virtual void OnLoseFocus() override; std::string GetText() const { return mText; } void SetText(const std::string text); void SetIsEditable(bool editable); void UpdateMetadata(const std::string & key, const std::string & value); std::string GetMetadataValue(const std::string & key); protected: virtual void OnPressDown() override; virtual void OnPressUp() override; void ProcessEditInput(); UISprite * mBackgroundImage; Vector2 mFocusDimensions; Vector2 mNormalDimensions; bool mInEditMode = false; bool mEditFadeUp = false; std::string mText; std::string mDisplayText; bool mIsEditable = true; std::map<std::string, std::string> mMetadata; }; #endif
#include <string.h> #include "hazard.h" #include <hzfxpc.h> #include <hzfxpi.h> #include <hzfxpf.h> #include <hzfskp.h> void vput_d(char *spcnam,char *varnam,int misval,int delval, double minval, double maxval,size_t spclen){ char spcprt[18]; if(*varnam==' ') return; CLEAR(spcprt); memcpy(spcprt,spcnam,spclen); hzfxpc(spcprt,18,26); hzfxpc(varnam,8,-3); hzfxpi(misval,5,-6); hzfxpi(delval,5,-5); if(minval!=Machine->absMax || maxval!=Machine->absMin) { hzfxpf(minval,12,99,-9); hzfxpf(maxval,12,99,-3); } hzfskp(1); }
/* This file is part of the Yzis libraries * Copyright (C) 2005 Loic Pauleve <panard@inzenet.org> * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef YZ_FONT_H #define YZ_FONT_H #include "yzismacros.h" /** * A text font * * Holds font properties like bold, italic, underline... */ class YZIS_EXPORT YFont { public : enum Weight { Light, Normal, DemiBold, Bold, Black }; YFont(); void setWeight( int weight ); void setItalic( bool enable ); void setUnderline( bool enable ); void setOverline( bool enable ); void setStrikeOut( bool enable ); bool bold() const; int weight() const; bool italic() const; bool underline() const; bool overline() const; bool strikeOut() const; bool operator!=( const YFont& color ) const; bool operator==( const YFont& color ) const; YFont& operator=( const YFont& color ); private : int m_weight; bool m_italic; bool m_underline; bool m_overline; bool m_strikeOut; }; #endif
#ifndef GAUSSTUBE_H #define GAUSSTUBE_H #include "../../util/inc/vector3.h" #include "../include/vertexfunctionelement.h" namespace vertex_lcfi { class Track; class TrackState; namespace ZVTOP { //!Gaussian tube component of the vertex function /*! Gaussian Tube in detector space (usually representing a track) The track position and size are determined by the position and covariance matrix of a given Track by: \f[ V(\mathbf{r})=e^{-0.5rV^{-1}r^{T}} \f] where r is the vector from to query point to the closest point on the track and V is the covariance matrix of the track. (Both in rPhi,z space) <br>Note this is a deliberatly unnormalised gaussian. <br>The Track is not modified at any point by this class <br>This guassian tube makes its own trackstate object from the track given at construction which it uses to perform the calculation. \author Ben Jeffery (b.jeffery1@physics.ox.ac.uk) \version 0.1 \date 20/09/05 */ class GaussTube : public VertexFunctionElement { public: //!Construct from a Track, makes a trackstate for its own use. /*! As a trackstate is made from the track, note that any changes to the track will not propogate to the tube. \param Track Track that forms the guassian tube */ GaussTube(Track* Track); //! Delete tube and trackstate used ~GaussTube(); //!Calculate the value of the tube at point /*! Swims the track to the point of closest approach and calculate the tube value. \param Point Vector3 of the spacial point \return Value of tube at point */ double valueAt(const Vector3 & Point) const; private: TrackState* _TrackState; }; } } #endif //GAUSSTUBE_H
/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * $Id$ * * Copyright (C) 2002 Linus Nielsen Feltzing * * 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef CONFIGFILE_H #define CONFIGFILE_H #define TYPE_INT 1 #define TYPE_ENUM 2 #define TYPE_STRING 3 #define TYPE_BOOL 4 struct configdata { int type; /* See TYPE_ macros above */ int min; /* Min value for integers, should be 0 for enums */ int max; /* Max value for integers, value count for enums, buffer size for strings */ union { int *int_p; bool *bool_p; char *string; }; /* Pointer to value, a union of the possible types */ char *name; /* Pointer to the name of the item */ char **values; /* List of strings for enums, NULL if not enum */ }; /* configfile_save - Given configdata entries this function will create a config file with these entries, destroying any previous config file of the same name */ int configfile_save(const char *filename, struct configdata *cfg, int num_items, int version); int configfile_load(const char *filename, struct configdata *cfg, int num_items, int min_version); /* configfile_get_value - Given a key name, this function will return the integer value for that key. Input: filename = config file filename name = (name/value) pair name entry Return: value if (name/value) pair is found -1 if entry is not found */ int configfile_get_value(const char* filename, const char* name); /* configure_update_entry - Given a key name and integer value this function will update the entry if found, or add it if not found. Input: filename = config file filename name = (name/value) pair name entry val = new value for (name/value) pair Return: 1 if the (name/value) pair was found and updated with the new value 0 if the (name/value) pair was added as a new entry -1 if error */ int configfile_update_entry(const char* filename, const char* name, int val); #endif
/* * Copyright (c) 2018 - 2028 MaiKe Labs * * Library for STS3x digital temperature sensor * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef __STS3X_H__ #define __STS3X_H__ #include <Arduino.h> //#define DEBUG 1 #ifdef DEBUG #define INFO(x) Serial.println(x) #else #define INFO(x) #endif #define STS3X_ADDR_LOW 0x4A #define STS3X_ADDR_HIGH 0x4B #define CLEAR_STATUS 0x3041 #define SOFT_RESET 0x30A2 #define READ_HIGH_RES 0x2C06 #define READ_MEDIUM_RES 0x2C0D #define READ_LOW_RES 0x2C0F #define R_HIGH_ALERT_SET 0xE11F #define R_HIGH_ALERT_CLR 0xE114 #define R_LOW_ALERT_SET 0xE102 #define R_LOW_ALERT_CLR 0xE109 #define W_HIGH_ALERT_SET 0x611D #define W_HIGH_ALERT_CLR 0x6116 #define W_LOW_ALERT_SET 0x610B #define W_LOW_ALERT_CLR 0x6100 float sts3x_get_temp(void); void sts3x_show_alert(); uint8_t sts3x_reset(void); uint8_t sts3x_init(uint8_t scl, uint8_t sda); #endif
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "Engine.h" #include "Runtime/UMG/Public/UMG.h" #include "Runtime/UMG/Public/UMGStyle.h" #include "Runtime/UMG/Public/Slate/SObjectWidget.h" #include "Runtime/UMG/Public/IUMGModule.h" #include "Runtime/UMG/Public/Blueprint/UserWidget.h"
/* Copyright (C) 2009 - 2010 ScriptDevZero <http://github.com/scriptdevzero/scriptdevzero> * 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 */ void AddSC_custom_creatures(); void AddSC_zero_creatures(); // used to call all scripts void AddSC_zero_scripts();
#ifndef HASHCONTROLLER_H #define HASHCONTROLLER_H #include "LazyInstance.h" #include <CriticalSection.h> ////////////////////////////////////////////////////////////////////////// // // HashController is a global instance controller that calculates // hash for the currently playback video file. // class HashController: public LazyInstanceImpl<HashController> { public: HashController(void); // Returning current file hash, will automatically calculate if it's not done std::wstring GetSPHash(const wchar_t* filename); std::wstring GetMD5Hash(const wchar_t* filename); std::wstring GetMD5Hash(const char* data, int len); std::wstring GetVersionHash(const wchar_t* filename); private: CriticalSection m_cs; std::wstring m_filename; std::wstring m_hash; }; #endif // HASHCONTROLLER_H
#ifndef MENU_H #define MENU_H #include <stdio.h> #include <signal.h> #include <errno.h> #include <unistd.h> #include <sys/ioctl.h> #include <pwd.h> #include <time.h> #include "common.h" #include "play_list.h" void init_menu(); void init_handle_key(int up, int down, int left, int right); int show_menu(char userKey); /* * 居中显示字符串 */ void print_center_string(char *str); #endif
#ifndef __LIBWZD_SFV_INDICATORS_H__ #define __LIBWZD_SFV_INDICATORS_H__ #include "libwzd_sfv_main.h" /** Converts cookies in incomplete indicators */ char *c_incomplete_indicator(const char * indicator, const char * currentdir , wzd_context_t * context); /** Converts cookies in complete indicators and create the full path + bar */ char *c_complete_indicator(const char * indicator, const char * currentdir, wzd_release_stats * stats); /** updates complete bar (erasing preceding one if existing) Making fully complete bar also if complete (for both .diz and .zip) */ void sfv_update_completebar(wzd_release_stats * stats, const char *directory, wzd_context_t *context); #endif /* __LIBWZD_SFV_INDICATORS_H__*/
/* -*- mode: c; tab-width: 4; indent-tabs-mode: n; c-basic-offset: 4 -*- * * $Id: nb_kernel_pf_113.h,v 1.1 2004/12/26 19:24:27 lindahl Exp $ * * This file is part of Gromacs Copyright (c) 1991-2004 * David van der Spoel, Erik Lindahl, University of Groningen. * * 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. * * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org * * And Hey: * Gnomes, ROck Monsters And Chili Sauce */ #ifndef _NB_KERNEL_PF_113_H_ #define _NB_KERNEL_PF_113_H_ /* This header is never installed, so we can use config.h */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <types/simple.h> /*! \file nb_kernel_pf_113.h * \brief Nonbonded kernel 113 (Coul + LJ, TIP4p) * * \internal */ #ifdef __cplusplus extern "C" { #endif #if 0 } #endif /*! \brief Nonbonded kernel 113 with forces. * * \internal Generated at compile time in either C or Fortran * depending on configuration settings. The name of * the function in C is nb_kernel_pf_113. For Fortran the * name mangling depends on the compiler, but in Gromacs * you can handle it automatically with the macro * F77_OR_C_FUNC_(nb_kernel_pf_113,NB_KERNEL_PF_113), which * expands to the correct identifier. * * <b>Coulomb interaction:</b> Standard 1/r <br> * <b>VdW interaction:</b> Lennard-Jones <br> * <b>Water optimization:</b> TIP4p - other atoms <br> * <b>Forces calculated:</b> Yes <br> * * \note All level1 and level2 nonbonded kernels use the same * call sequence. Parameters are documented in nb_kernel_pf_.h */ void F77_OR_C_FUNC_(nb_kernel_pf_113,NB_KERNEL_PF_113) (int * nri, int iinr[], int jindex[], int jjnr[], int shift[], real shiftvec[], real fshift[], int gid[], real pos[], real faction[], real charge[], real * facel, real * krf, real * crf, real Vc[], int type[], int * ntype, real vdwparam[], real Vvdw[], real * tabscale, real VFtab[], real invsqrta[], real dvda[], real * gbtabscale, real GBtab[], int * nthreads, int * count, void * mtx, int * outeriter, int * inneriter, real work[], real forcemat[], int fmindex[], char interaction[], int ncol[], int * max_col, int fmatoms[]); /*! \brief Nonbonded kernel 113 without forces. * * \internal Generated at compile time in either C or Fortran * depending on configuration settings. The name of * the function in C is nb_kernel_pf_113. For Fortran the * name mangling depends on the compiler, but in Gromacs * you can handle it automatically with the macro * F77_OR_C_FUNC_(nb_kernel_pf_113,NB_KERNEL_PF_113), which * expands to the correct identifier. * * <b>Coulomb interaction:</b> Standard 1/r <br> * <b>VdW interaction:</b> Lennard-Jones <br> * <b>Water optimization:</b> TIP4p - other atoms <br> * <b>Forces calculated:</b> No <br> * * \note All level1 and level2 nonbonded kernels use the same * call sequence. Parameters are documented in nb_kernel_pf_.h */ void F77_OR_C_FUNC_(nb_kernel_pf_113nf,NB_KERNEL_PF_113NF) (int * nri, int iinr[], int jindex[], int jjnr[], int shift[], real shiftvec[], real fshift[], int gid[], real pos[], real faction[], real charge[], real * facel, real * krf, real * crf, real Vc[], int type[], int * ntype, real vdwparam[], real Vvdw[], real * tabscale, real VFtab[], real invsqrta[], real dvda[], real * gbtabscale, real GBtab[], int * nthreads, int * count, void * mtx, int * outeriter, int * inneriter, real work[], real forcemat[], int fmindex[], char interaction[], int ncol[], int * max_col, int fmatoms[]); #ifdef __cplusplus } #endif #endif /* _NB_KERNEL_PF_113_H_ */
// 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 PAPPI_TESTS_TEST_NET_ADDRESS_PRIVATE_H_ #define PAPPI_TESTS_TEST_NET_ADDRESS_PRIVATE_H_ #include <string> #include "ppapi/tests/test_case.h" class TestNetAddressPrivate : public TestCase { public: explicit TestNetAddressPrivate(TestingInstance* instance); virtual bool Init(); virtual void RunTests(const std::string& filter); private: std::string TestAreEqual(); std::string TestAreHostsEqual(); std::string TestDescribe(); std::string TestReplacePort(); std::string TestGetAnyAddress(); std::string TestDescribeIPv6(); std::string TestGetFamily(); std::string TestGetPort(); std::string TestGetAddress(); std::string TestGetScopeID(); }; #endif
/* ***** BEGIN LICENSE BLOCK ***** * This file is part of Natron <http://www.natron.fr/>, * Copyright (C) 2016 INRIA and Alexandre Gauthier-Foichat * * Natron 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. * * Natron 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 Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html> * ***** END LICENSE BLOCK ***** */ #ifndef KEYHELPER_H #define KEYHELPER_H // ***** BEGIN PYTHON BLOCK ***** // from <https://docs.python.org/3/c-api/intro.html#include-files>: // "Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included." #include <Python.h> // ***** END PYTHON BLOCK ***** #include <string> #include "Engine/Hash64.h" #include "Engine/CacheEntryHolder.h" #include "Engine/EngineFwd.h" NATRON_NAMESPACE_ENTER; /** @brief Helper class that represents a Key in the cache. A key is a set * of 1 or more parameters that represent a "unique" element in the cache. * To create your own key you must derive this class and provide a HashType. * The HashType is a value that will serve as a hash key and it will be computed * the first time the getHash() function is called. * If you need to notify the cache that the key have changed, call resetHash() * and the next call to the getHash() function will compute the hash for you. * * Thread safety: This function is not thread-safe itself but it is used only * by the CacheEntryHelper class which itself is used only by the cache which * is thread-safe. * * Important: In order to compile this class must be boost::serializable, see * FrameEntry.h or Image.h for an example on how to serialize a KeyHelper instance. * * Maybe should we move this class as an internal class of CacheEntryHelper to prevent elsewhere * usages. **/ template<typename HashType> class KeyHelper { public: typedef HashType hash_type; /** * @brief Constructs an empty key. This constructor is used by boost::serialization. **/ KeyHelper() : _holderID(), _hash(), _hashComputed(false) { } KeyHelper(const CacheEntryHolder* holder) : _holderID(), _hash(), _hashComputed(false) { if (holder) { _holderID = holder->getCacheID(); } } /** * @brief Constructs a key from an already existing hash key. **/ // KeyHelper(hash_type hashValue): _hashComputed(true), _hash(hashValue){} /** * @brief Constructs a key from an already existing hash key. This is similar than the * constructor above but takes in parameter another key. **/ KeyHelper(const KeyHelper & other) : _holderID( other.getCacheHolderID() ) , _hash( other.getHash() ) , _hashComputed(true) { } virtual ~KeyHelper() { } hash_type getHash() const { if (!_hashComputed) { computeHashKey(); _hashComputed = true; } return _hash; } void resetHash() const { _hashComputed = false; } const std::string& getCacheHolderID() const { return _holderID; } protected: /*for now HashType can only be 64 bits...the implementation should fill the Hash64 using the append function with the values contained in the derived class.*/ virtual void fillHash(Hash64* hash) const = 0; private: void computeHashKey() const { Hash64 hash; fillHash(&hash); hash.computeHash(); _hash = hash.value(); } protected: std::string _holderID; private: mutable hash_type _hash; mutable bool _hashComputed; }; NATRON_NAMESPACE_EXIT; #endif // KEYHELPER_H
// // RECommonFunctions.h // REFrostedViewController // // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) // // 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. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #ifndef REUIKitIsFlatModeFunction #define REUIKitIsFlatModeFunction BOOL REUIKitIsFlatMode(); #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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL_H_ #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL_H_ #include "chrome/browser/chromeos/input_method/candidate_window_controller.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "chrome/browser/chromeos/input_method/candidate_window_view.h" #include "chrome/browser/chromeos/input_method/infolist_window_view.h" #include "ui/base/ime/chromeos/ibus_bridge.h" namespace views { class Widget; } namespace chromeos { namespace input_method { class CandidateWindow; class DelayableWidget; class ModeIndicatorController; class CandidateWindowControllerImpl : public CandidateWindowController, public CandidateWindowView::Observer, public IBusPanelCandidateWindowHandlerInterface { public: CandidateWindowControllerImpl(); virtual ~CandidateWindowControllerImpl(); virtual void AddObserver( CandidateWindowController::Observer* observer) OVERRIDE; virtual void RemoveObserver( CandidateWindowController::Observer* observer) OVERRIDE; virtual void Hide() OVERRIDE; protected: static gfx::Point GetInfolistWindowPosition( const gfx::Rect& candidate_window_rect, const gfx::Rect& screen_rect, const gfx::Size& infolist_winodw_size); static void ConvertLookupTableToInfolistEntry( const CandidateWindow& candidate_window, std::vector<InfolistWindowView::Entry>* infolist_entries, size_t* focused_index); static bool ShouldUpdateInfolist( const std::vector<InfolistWindowView::Entry>& old_entries, size_t old_focused_index, const std::vector<InfolistWindowView::Entry>& new_entries, size_t new_focused_index); private: virtual void OnCandidateCommitted(int index) OVERRIDE; virtual void OnCandidateWindowOpened() OVERRIDE; virtual void OnCandidateWindowClosed() OVERRIDE; void CreateView(); virtual void SetCursorBounds(const gfx::Rect& cursor_bounds, const gfx::Rect& composition_head) OVERRIDE; virtual void UpdateAuxiliaryText(const std::string& utf8_text, bool visible) OVERRIDE; virtual void UpdateLookupTable(const CandidateWindow& candidate_window, bool visible) OVERRIDE; virtual void UpdatePreeditText(const std::string& utf8_text, unsigned int cursor, bool visible) OVERRIDE; virtual void FocusStateChanged(bool is_focused) OVERRIDE; void UpdateInfolistBounds(); CandidateWindowView* candidate_window_view_; scoped_ptr<views::Widget> frame_; scoped_ptr<DelayableWidget> infolist_window_; scoped_ptr<ModeIndicatorController> mode_indicator_controller_; std::vector<InfolistWindowView::Entry> latest_infolist_entries_; size_t latest_infolist_focused_index_; ObserverList<CandidateWindowController::Observer> observers_; DISALLOW_COPY_AND_ASSIGN(CandidateWindowControllerImpl); }; #endif } }
/* @(#) $Id: ./src/os_crypto/md5_sha1/md5_sha1_op.c, 2011/09/08 dcid Exp $ */ /* Copyright (C) 2009 Trend Micro Inc. * All right reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public * License (version 2) as published by the FSF - Free Software * Foundation */ #include <stdio.h> #include <string.h> #include "md5_sha1_op.h" #include "../md5/md5.h" #include "../sha1/sha.h" int OS_MD5_SHA1_File(char * fname, char *md5output, char *sha1output) { int n; FILE *fp; unsigned char buf[2048 +2]; unsigned char sha1_digest[SHA_DIGEST_LENGTH]; unsigned char md5_digest[16]; SHA_CTX sha1_ctx; MD5_CTX md5_ctx; /* Clearing the memory. */ md5output[0] = '\0'; sha1output[0] = '\0'; buf[2048 +1] = '\0'; fp = fopen(fname,"rb"); if(!fp) return(-1); /* Initializing both hashes */ MD5Init(&md5_ctx); SHA1_Init(&sha1_ctx); /* Updating for each one. */ while((n = fread(buf, 1, 2048, fp)) > 0) { buf[n] = '\0'; SHA1_Update(&sha1_ctx, buf, (unsigned long)n); MD5Update(&md5_ctx, buf, n); } SHA1_Final(&(sha1_digest[0]), &sha1_ctx); MD5Final(md5_digest, &md5_ctx); /* Setting output for md5. */ for(n = 0;n < 16; n++) { snprintf(md5output, 3, "%02x", md5_digest[n]); md5output+=2; } /* Setting output for sha1. */ for (n = 0; n<SHA_DIGEST_LENGTH; n++) { snprintf(sha1output, 3, "%02x", sha1_digest[n]); sha1output+=2; } /* Closing it */ fclose(fp); return(0); } /* EOF */
#pragma once #ifdef _WINDOWS #define GLEW_STATIC #include <gl/glew.h> #else #endif #include <string> using namespace std; extern void mglCheckErrors(const char* place = nullptr); extern void mglCheckErrorsC(const char* place = nullptr); extern void mglCheckErrors(const string& s); extern void mglCheckErrorsC(const string& s);
/** * @file * This file is part of the Xenomai project. * * @note Copyright (C) 2007 Philippe Gerum <rpm@xenomai.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _UITRON_PPD_H #define _UITRON_PPD_H #include <nucleus/pod.h> #include <nucleus/ppd.h> #ifndef CONFIG_XENO_OPT_DEBUG_UITRON #define CONFIG_XENO_OPT_DEBUG_UITRON 0 #endif typedef struct ui_resource_holder { xnshadow_ppd_t ppd; #define ppd2rholder(a) container_of(a, struct ui_resource_holder, ppd) xnqueue_t flgq; xnqueue_t mbxq; xnqueue_t semq; } ui_rholder_t; extern ui_rholder_t __ui_global_rholder; #ifdef CONFIG_XENO_OPT_PERVASIVE extern int __ui_muxid; static inline ui_rholder_t *ui_get_rholder(void) { xnshadow_ppd_t *ppd = xnshadow_ppd_get(__ui_muxid); if (ppd == NULL) return &__ui_global_rholder; return ppd2rholder(ppd); } #else /* !CONFIG_XENO_OPT_PERVASIVE */ static inline ui_rholder_t *ui_get_rholder(void) { return &__ui_global_rholder; } #endif /* !CONFIG_XENO_OPT_PERVASIVE */ #if XENO_DEBUG(UITRON) #define __ui_trace_release(__name, __obj, __err) \ xnprintf("uITRON: cleaning up %s \"%s\" (ret=%d).\n", \ __name, (__obj)->name, __err) #else /* !XENO_DEBUG(NATIVE) */ #define __ui_trace_release(__name, __obj, __err) #endif /* !XENO_DEBUG(NATIVE) */ #define ui_flush_rq(__type, __rq, __name) \ do { \ ER del_##__name(ID id); \ xnholder_t *holder, *nholder; \ __type *obj; \ ER err; \ spl_t s; \ xnlock_get_irqsave(&nklock, s); \ nholder = getheadq(__rq); \ while ((holder = nholder) != NULL) { \ nholder = nextq((__rq), holder); \ xnlock_put_irqrestore(&nklock, s); \ obj = rlink2##__name(holder); \ err = del_##__name((obj)->id); \ __ui_trace_release(#__name, obj, err); \ if (unlikely(err)) { \ if ((__rq) != &__ui_global_rholder.__name##q) { \ xnlock_get_irqsave(&nklock, s); \ nholder = popq((rq), holder); \ appendq(&__ui_global_rholder.__name##q, holder); \ obj->rqueue = &__ui_global_rholder.__name##q; \ } \ } else \ xnlock_get_irqsave(&nklock, s); \ } \ xnlock_put_irqrestore(&nklock, s); \ } while(0) #endif /* !_UITRON_PPD_H */
/** ****************************************************************************** * @file TIM/TIM_PWMInput/Inc/main.h * @author MCD Application Team * @version V1.2.3 * @date 09-October-2015 * @brief Header for main.c module ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stm324xg_eval.h" #include "stm32f4xx_hal.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* User can use this section to tailor TIMx instance used and associated resources */ /* Definition for TIMx clock resources */ #define TIMx TIM4 #define TIMx_CLK_ENABLE() __HAL_RCC_TIM4_CLK_ENABLE() /* Definition for TIMx Pins */ #define TIMx_CHANNEL_GPIO_PORT() __HAL_RCC_GPIOB_CLK_ENABLE() #define GPIO_PORT GPIOB #define GPIO_PIN_CHANNEL2 GPIO_PIN_7 #define GPIO_AF_TIMx GPIO_AF2_TIM4 /* Definition for TIMx's NVIC */ #define TIMx_IRQn TIM4_IRQn #define TIMx_IRQHandler TIM4_IRQHandler /* Exported functions ------------------------------------------------------- */ #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// CHDK palette colors for the a700 // Define color values as needed in this file. // Values not defined here will be set to default values in core/gui_draw.h // See comments in core/gui_draw.h for more details on CHDK color definitions. // #define COLOR_WHITE 0x11 // #define COLOR_RED 0x22 // #define COLOR_GREY 0x3F // #define COLOR_GREEN 0x55 // #define COLOR_BLUE_LT 0xDD // #define COLOR_BLUE 0xDF // #define COLOR_YELLOW 0xEE // #define COLOR_GREY_DK 0x44 // #define COLOR_RED_DK 0x2E // #define COLOR_RED_LT 0x21 // #define COLOR_GREY_LT 0x1F // Override histogram colors if needed // #define COLOR_REC_MAGENTA 0x66 // #define COLOR_PLY_MAGENTA 0xE2 // #define COLOR_PLY_BLUE 0xCC // #define COLOR_PLY_CYAN 0x99 // #define COLOR_PLY_YELLOW 0x66
/*************************************************************************** application: : Oxygen begin : September 2002 copyright : ( C ) 2002 by Carsten Niehaus email : cniehaus@handhelds.org **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * ( at your option ) any later version. * * * **************************************************************************/ #ifndef _OXYFRAME_H #define _OXYFRAME_H #include <qlabel.h> class OxyFrame : public QLabel { Q_OBJECT public: OxyFrame( QWidget *parent=0, const char *name=0, QString symbol="" ); void mousePressEvent( QMouseEvent *); QString N; signals: /* * this signal emits the name (the element-number) */ void num(QString); }; #endif
/* This file is auto generated, version 2 */ /* SMP PREEMPT */ #define UTS_MACHINE "arm" #define UTS_VERSION "#2 SMP PREEMPT Wed Nov 5 23:41:24 KST 2014" #define LINUX_COMPILE_BY "count" #define LINUX_COMPILE_HOST "count-System-Product-Name" #define LINUX_COMPILER "gcc version 4.4.3 (GCC) "
#include <linux/slab.h> #include <linux/time.h> #include <linux/string.h> #include <sound/core.h> #include <sound/minors.h> #include <sound/info.h> #include <sound/version.h> #include <linux/utsname.h> #include <linux/mutex.h> #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) static DEFINE_MUTEX(strings); static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT]; static struct snd_info_entry *snd_sndstat_proc_entry; int snd_oss_info_register(int dev, int num, char *string) { char *x; if (snd_BUG_ON(dev < 0 || dev >= SNDRV_OSS_INFO_DEV_COUNT)) return -ENXIO; if (snd_BUG_ON(num < 0 || num >= SNDRV_CARDS)) return -ENXIO; mutex_lock(&strings); if (string == NULL) { if ((x = snd_sndstat_strings[num][dev]) != NULL) { kfree(x); x = NULL; } } else { x = kstrdup(string, GFP_KERNEL); if (x == NULL) { mutex_unlock(&strings); return -ENOMEM; } } snd_sndstat_strings[num][dev] = x; mutex_unlock(&strings); return 0; } EXPORT_SYMBOL(snd_oss_info_register); static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int dev) { int idx, ok = -1; char *str; snd_iprintf(buf, "\n%s:", id); mutex_lock(&strings); for (idx = 0; idx < SNDRV_CARDS; idx++) { str = snd_sndstat_strings[idx][dev]; if (str) { if (ok < 0) { snd_iprintf(buf, "\n"); ok++; } snd_iprintf(buf, "%i: %s\n", idx, str); } } mutex_unlock(&strings); if (ok < 0) snd_iprintf(buf, " NOT ENABLED IN CONFIG\n"); return ok; } static void snd_sndstat_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { snd_iprintf(buffer, "Sound Driver:3.8.1a-980706 (ALSA v" CONFIG_SND_VERSION " emulation code)\n"); snd_iprintf(buffer, "Kernel: %s %s %s %s %s\n", init_utsname()->sysname, init_utsname()->nodename, init_utsname()->release, init_utsname()->version, init_utsname()->machine); snd_iprintf(buffer, "Config options: 0\n"); snd_iprintf(buffer, "\nInstalled drivers: \n"); snd_iprintf(buffer, "Type 10: ALSA emulation\n"); snd_iprintf(buffer, "\nCard config: \n"); snd_card_info_read_oss(buffer); snd_sndstat_show_strings(buffer, "Audio devices", SNDRV_OSS_INFO_DEV_AUDIO); snd_sndstat_show_strings(buffer, "Synth devices", SNDRV_OSS_INFO_DEV_SYNTH); snd_sndstat_show_strings(buffer, "Midi devices", SNDRV_OSS_INFO_DEV_MIDI); snd_sndstat_show_strings(buffer, "Timers", SNDRV_OSS_INFO_DEV_TIMERS); snd_sndstat_show_strings(buffer, "Mixers", SNDRV_OSS_INFO_DEV_MIXERS); } int snd_info_minor_register(void) { struct snd_info_entry *entry; memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings)); if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) { entry->c.text.read = snd_sndstat_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); entry = NULL; } } snd_sndstat_proc_entry = entry; return 0; } int snd_info_minor_unregister(void) { snd_info_free_entry(snd_sndstat_proc_entry); snd_sndstat_proc_entry = NULL; return 0; } #endif /* CONFIG_SND_OSSEMUL */
/* * $Id: ci.h,v 1.6 2003/01/30 17:21:16 obi Exp $ * * (C) 2002 by Andreas Oberritter <obi@tuxbox.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef __ci_h__ #define __ci_h__ #include <vector> class CCaDescriptor { private: unsigned descriptor_tag : 8; unsigned descriptor_length : 8; unsigned CA_system_ID : 16; unsigned reserved1 : 3; unsigned CA_PID : 13; std::vector <unsigned char> private_data_byte; public: CCaDescriptor(const unsigned char * const buffer); unsigned writeToBuffer(unsigned char * const buffer); unsigned getLength(void) { return descriptor_length + 2; } }; /* * children of this class need to delete all * CCaDescriptors in their destructors */ class CCaTable { private: std::vector <CCaDescriptor *> ca_descriptor; protected: CCaTable(void) { info_length = 0; }; ~CCaTable(void); unsigned getLength(void) { return info_length + 2; } unsigned writeToBuffer(unsigned char * const buffer); public: unsigned reserved2 : 4; unsigned info_length : 12; void addCaDescriptor(const unsigned char * const buffer); }; class CEsInfo : public CCaTable { protected: unsigned getLength(void) { return CCaTable::getLength() + 3; } unsigned writeToBuffer(unsigned char * const buffer); public: unsigned stream_type : 8; unsigned reserved1 : 3; unsigned elementary_PID : 13; friend class CCaPmt; }; class CCaPmt : public CCaTable { protected: unsigned ca_pmt_length; public: ~CCaPmt(void); unsigned getLength(void); unsigned writeToBuffer(unsigned char * const buffer); unsigned ca_pmt_list_management : 8; unsigned program_number : 16; unsigned reserved1 : 2; unsigned version_number : 5; unsigned current_next_indicator : 1; std::vector<CEsInfo *> es_info; }; #endif /* __ci_h__ */
/* version.c -- Version handling. * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson * * This file is part of GNU SASL Library. * * GNU SASL 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. * * GNU SASL 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 License along with GNU SASL Library; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "internal.h" #include <string.h> /* for strverscmp */ /** * gsasl_check_version: * @req_version: version string to compare with, or NULL. * * Check library version. * * See %GSASL_VERSION for a suitable @req_version string. * * Return value: Check that the the version of the library is at * minimum the one given as a string in @req_version and return the * actual version string of the library; return %NULL if the * condition is not met. If %NULL is passed to this function no * check is done and only the version string is returned. **/ const char * gsasl_check_version (const char *req_version) { if (!req_version || strverscmp (req_version, GSASL_VERSION) <= 0) return GSASL_VERSION; return NULL; }
/* <<<<<<< HEAD * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND 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, DIRECT, 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. */ /* ======= >>>>>>> 8f21ba79e30f047f727d3b9dd531267c1db2a838 * Copyright (c) 2012, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND 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, DIRECT, 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. */ /* * * Airgo Networks, Inc proprietary. All rights reserved. * This file dphHashTable.h contains the definition of the scheduler class. * * Author: Sandesh Goel * Date: 02/25/02 * History:- * Date Modified by Modification Information * -------------------------------------------------------------------- * */ #ifndef __DPH_HASH_TABLE_H__ #define __DPH_HASH_TABLE_H__ #include "aniGlobal.h" /// Compare MAC addresses, return true if same static inline tANI_U8 dphCompareMacAddr(tANI_U8 addr1[], tANI_U8 addr2[]) { <<<<<<< HEAD ======= #if ((defined(ANI_PPC)) && defined(ANI_OS_TYPE_RTAI_LINUX)) /* * Optimized comparison to take advantage of unaligned memory accesses * supported by the CPU. * This needs to be reviewed if the CPU changes. */ return (((*((tANI_U32 *) addr1) - *((tANI_U32 *) addr2)) | (*((tANI_U16 *) &(addr1[4])) - *((tANI_U16 *) &(addr2[4])))) == 0); #else >>>>>>> 8f21ba79e30f047f727d3b9dd531267c1db2a838 return((addr1[0] == addr2[0]) && (addr1[1] == addr2[1]) && (addr1[2] == addr2[2]) && (addr1[3] == addr2[3]) && (addr1[4] == addr2[4]) && (addr1[5] == addr2[5])); <<<<<<< HEAD ======= #endif >>>>>>> 8f21ba79e30f047f727d3b9dd531267c1db2a838 } /// Hash table class typedef struct { /// The hash table itself tpDphHashNode *pHashTable; /// The state array tDphHashNode *pDphNodeArray; tANI_U16 size; } dphHashTableClass; /// The hash table object extern dphHashTableClass dphHashTable; /// Print MAC addresse extern void dphPrintMacAddr(struct sAniSirGlobal *pMac, tANI_U8 addr[], tANI_U32); tpDphHashNode dphLookupHashEntry(tpAniSirGlobal pMac, tANI_U8 staAddr[], tANI_U16 *pStaId, dphHashTableClass* pDphHashTable); tpDphHashNode dphLookupAssocId(tpAniSirGlobal pMac, tANI_U16 staIdx, tANI_U16* assocId, dphHashTableClass* pDphHashTable); /// Get a pointer to the hash node extern tpDphHashNode dphGetHashEntry(tpAniSirGlobal pMac, tANI_U16 staId, dphHashTableClass* pDphHashTable); /// Add an entry to the hash table extern tpDphHashNode dphAddHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId, dphHashTableClass* pDphHashTable); /// Delete an entry from the hash table extern tSirRetStatus dphDeleteHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId, dphHashTableClass* pDphHashTable); void dphHashTableClassInit(tpAniSirGlobal pMac, dphHashTableClass* pDphHashTable); /// Initialize STA state extern tpDphHashNode dphInitStaState(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId, tANI_U8 validStaIdx, dphHashTableClass* pDphHashTable); #endif
/* $Id: PGMGst.h $ */ /** @file * VBox - Page Manager / Monitor, Guest Paging Template. */ /* * Copyright (C) 2006-2007 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ /******************************************************************************* * Internal Functions * *******************************************************************************/ RT_C_DECLS_BEGIN /* r3 */ PGM_GST_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0); PGM_GST_DECL(int, Enter)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3); PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta); PGM_GST_DECL(int, Exit)(PVMCPU pVCpu); /* all */ PGM_GST_DECL(int, GetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys); PGM_GST_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask); PGM_GST_DECL(int, GetPDE)(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE); RT_C_DECLS_END /** * Initializes the guest bit of the paging mode data. * * @returns VBox status code. * @param pVM Pointer to the VM. * @param fResolveGCAndR0 Indicate whether or not GC and Ring-0 symbols can be resolved now. * This is used early in the init process to avoid trouble with PDM * not being initialized yet. */ PGM_GST_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0) { Assert(pModeData->uGstType == PGM_GST_TYPE); /* Ring-3 */ pModeData->pfnR3GstRelocate = PGM_GST_NAME(Relocate); pModeData->pfnR3GstExit = PGM_GST_NAME(Exit); pModeData->pfnR3GstGetPDE = PGM_GST_NAME(GetPDE); pModeData->pfnR3GstGetPage = PGM_GST_NAME(GetPage); pModeData->pfnR3GstModifyPage = PGM_GST_NAME(ModifyPage); if (fResolveGCAndR0) { int rc; #if PGM_SHW_TYPE != PGM_TYPE_AMD64 /* No AMD64 for traditional virtualization, only VT-x and AMD-V. */ /* GC */ rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(GetPage), &pModeData->pfnRCGstGetPage); AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_GST_NAME_RC_STR(GetPage), rc), rc); rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(ModifyPage), &pModeData->pfnRCGstModifyPage); AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_GST_NAME_RC_STR(ModifyPage), rc), rc); rc = PDMR3LdrGetSymbolRC(pVM, NULL, PGM_GST_NAME_RC_STR(GetPDE), &pModeData->pfnRCGstGetPDE); AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_GST_NAME_RC_STR(GetPDE), rc), rc); #endif /* Not AMD64 shadow paging. */ /* Ring-0 */ rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(GetPage), &pModeData->pfnR0GstGetPage); AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_GST_NAME_R0_STR(GetPage), rc), rc); rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(ModifyPage), &pModeData->pfnR0GstModifyPage); AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_GST_NAME_R0_STR(ModifyPage), rc), rc); rc = PDMR3LdrGetSymbolR0(pVM, NULL, PGM_GST_NAME_R0_STR(GetPDE), &pModeData->pfnR0GstGetPDE); AssertMsgRCReturn(rc, ("%s -> rc=%Rrc\n", PGM_GST_NAME_R0_STR(GetPDE), rc), rc); } return VINF_SUCCESS; } /** * Enters the guest mode. * * @returns VBox status code. * @param pVCpu Pointer to the VMCPU. * @param GCPhysCR3 The physical address from the CR3 register. */ PGM_GST_DECL(int, Enter)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3) { /* * Map and monitor CR3 */ int rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVCpu, GCPhysCR3); return rc; } /** * Relocate any GC pointers related to guest mode paging. * * @returns VBox status code. * @param pVCpu Pointer to the VMCPU. * @param offDelta The relocation offset. */ PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta) { pVCpu->pgm.s.pGst32BitPdRC += offDelta; for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->pgm.s.apGstPaePDsRC); i++) { pVCpu->pgm.s.apGstPaePDsRC[i] += offDelta; } pVCpu->pgm.s.pGstPaePdptRC += offDelta; return VINF_SUCCESS; } /** * Exits the guest mode. * * @returns VBox status code. * @param pVCpu Pointer to the VMCPU. */ PGM_GST_DECL(int, Exit)(PVMCPU pVCpu) { int rc; rc = PGM_BTH_PFN(UnmapCR3, pVCpu)(pVCpu); return rc; }
/* * Copyright 2012, 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. */ #include <unistd.h> #include <sys/socket.h> #include <sys/linux-syscalls.h> #include <socket_portable.h> #if SOCK_STREAM==SOCK_STREAM_PORTABLE #error Bad build environment #endif static inline int mips_change_type(int type) { switch (type) { case SOCK_STREAM_PORTABLE: return SOCK_STREAM; case SOCK_DGRAM_PORTABLE: return SOCK_DGRAM; case SOCK_RAW_PORTABLE: return SOCK_RAW; case SOCK_RDM_PORTABLE: return SOCK_RDM; case SOCK_SEQPACKET_PORTABLE: return SOCK_SEQPACKET; case SOCK_PACKET_PORTABLE: return SOCK_PACKET; } return type; } extern int socket(int, int, int); int socket_portable(int domain, int type, int protocol) { return socket(domain, mips_change_type(type), protocol); }
//----------------------------------------------------------------------------- // File: SingleIndrectInterfaceEditor.h //----------------------------------------------------------------------------- // Project: Kactus 2 // Author: Esko Pekkarinen // Date: 03.08.2017 // // Description: // Editor for a single indirect interface within a component. //----------------------------------------------------------------------------- #ifndef SINGLEINDRECTINTERFACEEDITOR_H #define SINGLEINDRECTINTERFACEEDITOR_H #include <editors/ComponentEditor/ParameterItemEditor.h> #include <common/widgets/nameGroupEditor/namegroupeditor.h> #include <QComboBox> #include <QWidget> class BridgesEditor; class Component; class ExpressionFormatter; class LibraryInterface; class IndirectInterface; class IndirectInterfaceValidator; class ReferenceSelector; class ParameterGroupBox; class ParameterFinder; class BusInterfaceInterface; //----------------------------------------------------------------------------- //! Editor for a single indirect interface within a component. //----------------------------------------------------------------------------- class SingleIndirectInterfaceEditor : public ParameterItemEditor { Q_OBJECT public: /*! * The constructor.. * * @param [in] indirectInterface The indirect interface to edit. * @param [in] validator Validator for the indirect interface. * @param [in] component The component containing the indirect interface. * @param [in] library The available IP-XACT library. * @param [in] finder Finder for available parameters for the indirect interface. * @param [in] formatter Formatter for expressions. * @param [in] parent The parent widget. */ SingleIndirectInterfaceEditor(QSharedPointer<IndirectInterface> indirectInterface, QSharedPointer<IndirectInterfaceValidator> validator, QSharedPointer<Component> component, LibraryInterface* library, QSharedPointer<ParameterFinder> finder, QSharedPointer<ExpressionFormatter> formatter, BusInterfaceInterface* busInterface, QWidget* parent); /*! * The destructor. */ virtual ~SingleIndirectInterfaceEditor(); /*! * Refreshes the information in the editor. */ virtual void refresh(); protected: /*! * Called when the editor is shown. */ void showEvent(QShowEvent* event); private slots: /*! * Called when the indirect address reference has changed. */ void onIndirectAddressChanged(); /*! * Called when the indirect ddatareference has changed. */ void onIndirectDataChanged(); /*! * Called when the bits in lau has changed. */ void onBitsInLauChanged(); /*! * Called when the endianness has changed. */ void onEndiannessChanged(); /*! * Called when the indirect memory map has changed. */ void onMemoryMapChanged(); /*! * Handle the selection of memory map. * * @param [in] checked Flag for enabling memory map. */ void onMemoryMapSelected(bool checked); /*! * Handle the selection of transparent bridges. * * @param [in] checked Flag for enabling transparent bridges. */ void onTransparentBridgeSelected(bool checked); private: // Disable copying. SingleIndirectInterfaceEditor(SingleIndirectInterfaceEditor const& rhs); SingleIndirectInterfaceEditor& operator=(SingleIndirectInterfaceEditor const& rhs); //! Changes the address reference editor text color to red when invalid and black when valid. void setAddressReferenceColorByValidity(); //! Changes the data reference editor text color to red when invalid and black when valid. void setDataReferenceColorByValidity(); //! Changes the memory map reference editor text color to red when invalid and black when valid. void setMemoryMapColorByValidity(); /*! * Finds all the available field references. * * @return The available field references in the current component. */ QStringList findAvailableReferences() const; //! Sets the editor layout. void setupLayout(); //----------------------------------------------------------------------------- // Data. //----------------------------------------------------------------------------- //! The indirect interface being edited. QSharedPointer<IndirectInterface> indirectInterface_; //! The validator for the indirect interface. QSharedPointer<IndirectInterfaceValidator> validator_; //! The component containing the indirect interface. QSharedPointer<Component> component_; //! Editor for indirect interface name group. NameGroupEditor* nameEditor_; //! Selection editor for address reference. ReferenceSelector* addressSelector_; //! Selection editor for data reference. ReferenceSelector* dataSelector_; //! Editor for indirect interface bits in lau. QLineEdit* bitsInLauEditor_; //! Selection editor for endianness. QComboBox* endiannessSelector_; QGroupBox* memoryMapBox_; //! Selection editor for memory map reference. ReferenceSelector* memoryMapSelector_; //! Editor for transparent bridges. BridgesEditor* transparentBridgesEditor_; //! Editor for indirect interface parameters. ParameterGroupBox* parametersEditor_; }; #endif // SINGLEINDRECTINTERFACEEDITOR_H
/*File: pcb.h - Builder design pattern example - product 'pcb' class declaration*/
/***************************************************************************** * npovlc.h: deprecated APIs implemented in late XPCOM interface ***************************************************************************** * Copyright (C) 2002-2006 the VideoLAN team * * Authors: Damien Fouilleul <damien.fouilleul@laposte.net> * * 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. *****************************************************************************/ /* ** defined runtime script objects */ #include "nporuntime.h" class VlcNPObject: public RuntimeNPObject { protected: friend class RuntimeNPClass<VlcNPObject>; VlcNPObject(NPP instance, const NPClass *aClass) : RuntimeNPObject(instance, aClass) {}; virtual ~VlcNPObject() {}; static const int propertyCount; static const NPUTF8 * const propertyNames[]; static const int methodCount; static const NPUTF8 * const methodNames[]; virtual InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant &result); };
/* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_ #define COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_ #include "common_audio/smoothing_filter.h" #include "test/gmock.h" namespace webrtc { class MockSmoothingFilter : public SmoothingFilter { public: MOCK_METHOD1(AddSample, void(float)); MOCK_METHOD0(GetAverage, absl::optional<float>()); MOCK_METHOD1(SetTimeConstantMs, bool(int)); }; } // namespace webrtc #endif // COMMON_AUDIO_MOCKS_MOCK_SMOOTHING_FILTER_H_
/* * lib/x25_sr.c This file contains an implementation of the "X.25" * route change support functions. * * Author: Stephane Fillod, <sfillod@charybde.gyptis.frmug.org> * based on inet_sr.c * * 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. */ #include "config.h" #include <asm/types.h> #include <sys/param.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <linux/x25.h> #include <ctype.h> #include <errno.h> #include <netdb.h> #include <resolv.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <unistd.h> #include "net-support.h" #include "pathnames.h" #include "intl.h" #include "util.h" #include "net-features.h" extern struct aftype x25_aftype; static int skfd = -1; static int usage(const int rc) { fprintf(stderr,"Usage: x25_route [-v] del Target[/mask] [dev] If\n"); fprintf(stderr," x25_route [-v] add Target[/mask] [dev] If\n"); return(rc); } static int X25_setroute(int action, int options, char **args) { struct x25_route_struct rt; struct sockaddr_storage sas; struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)&sas; char target[128]; signed int sigdigits; if (*args == NULL) return usage(E_OPTERR); safe_strncpy(target, *args++, sizeof(target)); /* Clean out the x25_route_struct structure. */ memset((char *) &rt, 0, sizeof(rt)); if ((sigdigits = x25_aftype.input(0, target, &sas)) < 0) { x25_aftype.herror(target); return (E_LOOKUP); } rt.sigdigits=sigdigits; /* this works with 2.4 and 2.6 headers struct x25_address vs. typedef */ memcpy(&rt.address, &sx25->sx25_addr, sizeof(sx25->sx25_addr)); while (*args) { if (!strcmp(*args,"device") || !strcmp(*args,"dev")) { args++; if (!*args) return usage(E_OPTERR); } else if (args[1]) return usage(E_OPTERR); if (rt.device[0]) return usage(E_OPTERR); safe_strncpy(rt.device, *args, sizeof(rt.device)); args++; } if (rt.device[0]=='\0') return usage(E_OPTERR); /* sanity checks.. */ if (rt.sigdigits > 15) { fprintf(stderr, _("route: bogus netmask %d\n"), rt.sigdigits); return usage(E_OPTERR); } if (rt.sigdigits > strlen(rt.address.x25_addr)) { fprintf(stderr, _("route: netmask doesn't match route address\n")); return usage(E_OPTERR); } /* Create a socket to the X25 kernel. */ if ((skfd = socket(AF_X25, SOCK_SEQPACKET, 0)) < 0) { perror("socket"); return(E_SOCK); } /* Tell the kernel to accept this route. */ if (action==RTACTION_DEL) { if (ioctl(skfd, SIOCDELRT, &rt) < 0) { perror("SIOCDELRT"); close(skfd); return(E_SOCK); } } else { if (ioctl(skfd, SIOCADDRT, &rt) < 0) { perror("SIOCADDRT"); close(skfd); return(E_SOCK); } } /* Close the socket. */ (void) close(skfd); return(0); } int X25_rinput(int action, int options, char **args) { if (action == RTACTION_FLUSH) { fprintf(stderr,"Flushing `x25' routing table not supported\n"); return usage(E_OPTERR); } if (options & FLAG_CACHE) { fprintf(stderr,"Modifying `x25' routing cache not supported\n"); return usage(E_OPTERR); } if (action == RTACTION_HELP) return usage(E_USAGE); return(X25_setroute(action, options, args)); }
/************************************************************ vidhrdw\starwars.h This file is Copyright 1997, Steve Baines. Release 1.0 (21 July 1997) See drivers\starwars.c for notes ************************************************************/ #define VECMEM_TYPE unsigned char #define X_RES 800 /* Used to define game window size */ #define Y_RES 600 #define VECDEBUG 0 /* If 1 then log operation of vector unit */ #define TEXTMODE 0 /* Text only test mode. Runs as usual but just reports */ /* what would be happening rather than actually doing it */ void vector_engine(VECMEM_TYPE *, long, short, short); void starwars_set_palette(unsigned char *, unsigned char *,const unsigned char *); int starwars_interrupt(void); int starwars_vh_start(void); void starwars_vh_stop(void); void starwars_vh_screenrefresh(struct osd_bitmap *); void init_display(void); void draw_vector(short, short, short, short, short, short, char);
//Header #ifndef Casa_Este_h_ #define Casa_Este_h_ //Incluyo las librerias necesarias #include <editor/casa_fantasmas.h> #include <editor/punto.h> /* CLASE CASA ESTE: Clase que representa una casa de fantasmas con orientacion ESTE. Hereda de CasaFantasmas. */ class CasaEste : public CasaFantasmas { public: /* Constructor: Inicializa una casa este con las posiciones pasadas por parametros. */ CasaEste (int pos_x, int pos_y); /* Get Ruta Imagen: Devuelve una cadena con la ruta donde se encuentra la imagen que representa al elemento */ virtual char* get_ruta_imagen(); }; #endif
/* ** Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved. ** Copyright (C) 2005-2013 Sourcefire, Inc. ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License Version 2 as ** published by the Free Software Foundation. You may not use, modify or ** distribute this program under any other version of the GNU General ** Public 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __HTTP_COMMON_H__ #define __HTTP_COMMON_H__ #include <sys/types.h> #include <inttypes.h> #include "sf_multi_mpse.h" #include "sf_mlmp.h" #include "commonAppMatcher.h" typedef enum { SINGLE, SKYPE_URL, SKYPE_VERSION, BT_ANNOUNCE, BT_OTHER, /* HOST_HEADER, CONTENT_TYPE_HEADER, SERVER_HEADER, */ USER_AGENT_HEADER } DHPSequence; typedef struct { DHPSequence seq; tAppId service_id; tAppId client_app; tAppId payload; int pattern_size; uint8_t *pattern; tAppId appId; } DetectorHTTPPattern; typedef struct HTTPListElementStruct { DetectorHTTPPattern detectorHTTPPattern; struct HTTPListElementStruct* next; } HTTPListElement; #define APPL_VERSION_LENGTH 40 typedef struct { uint32_t service_id; uint32_t client_app; uint32_t payload; tAppId appId; tMlpPattern query; } tUrlUserData; typedef struct { struct { tMlpPattern host; tMlpPattern path; tMlpPattern scheme; } patterns; tUrlUserData userData; } DetectorAppUrlPattern; typedef struct DetectorAppUrlListStruct { DetectorAppUrlPattern **urlPattern; size_t usedCount; size_t allocatedCount; } DetectorAppUrlList; typedef struct _HttpPatternLists { HTTPListElement* hostPayloadPatternList; HTTPListElement* urlPatternList; HTTPListElement* clientAgentPatternList; HTTPListElement* contentTypePatternList; DetectorAppUrlList appUrlList; DetectorAppUrlList RTMPUrlList; } HttpPatternLists; /**url parts extracted from http headers. * "http" */ typedef struct { tMlpPattern host; /*from host header */ tMlpPattern path; /*from GET/POST request */ tMlpPattern scheme; /*hardcoded to "http:" */ tMlpPattern query; /*query match for version number */ } tUrlStruct; typedef struct _HostUrlDetectorPattern { tMlpPattern host; tMlpPattern path; tMlpPattern query; uint32_t payload_id; uint32_t service_id; uint32_t client_id; tAppId appId; DHPSequence seq; struct _HostUrlDetectorPattern *next; } HostUrlDetectorPattern; extern HttpPatternLists httpPatternLists; extern tAppId getAppIdByHttpUrl( tUrlStruct *url, tUrlUserData **rnaData); #endif
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ #pragma once #include <folly/Expected.h> #include <folly/Range.h> #include <cstdint> #include <vector> namespace facebook::eden { /** * Options type for GlobMatcher::create(). Multiple values can be OR'd together. * DEFAULT should be used to signal no options should be enabled. */ enum class GlobOptions : uint32_t { DEFAULT = 0x00, IGNORE_DOTFILES = 0x01, }; GlobOptions operator|(GlobOptions a, GlobOptions b); GlobOptions& operator|=(GlobOptions& a, GlobOptions b); bool operator&(GlobOptions a, GlobOptions b); /** * GlobMatcher performs matching of filename glob patterns. * * This aims to be 100% compatible with the syntax used in gitignore files. * * This code is optimized for loading glob patterns once, and then repeatedly * matching on them. It does some basic pre-processing of the glob pattern, * allowing it to perform matches more efficiently. (In basic benchmarks I * have run it ranges from 50% to 100% faster than the wildmatch() * implementation used by git, depending on the pattern.) */ class GlobMatcher { public: /** * Default constructor for GlobMatcher. * * This will create a GlobMatcher that only matches the empty string. * Use GlobMatcher::create() to initialize a normal glob matcher. The * default constructor is provided primarily if you want to initialize the * object later by move-assigning it from the result of create(). */ GlobMatcher(); ~GlobMatcher(); GlobMatcher(GlobMatcher&&) = default; GlobMatcher& operator=(GlobMatcher&&) = default; GlobMatcher(const GlobMatcher&) = default; GlobMatcher& operator=(const GlobMatcher&) = default; /** * Create a GlobMatcher object from a glob pattern. * * Returns a GlobMatcher, or a string describing why the glob pattern was * invalid. This function may also throw std::bad_alloc if memory allocation * fails. */ static folly::Expected<GlobMatcher, std::string> create( folly::StringPiece glob, GlobOptions options); /** * Match a string against this glob pattern. * * Returns true if the text matches the pattern, or false otherwise. * The entire text must match the pattern. (If a only substring matches the * pattern this method will still return false.) */ bool match(folly::StringPiece text) const; private: explicit GlobMatcher(std::vector<uint8_t> pattern); static folly::Expected<size_t, std::string> parseBracketExpr( folly::StringPiece glob, size_t idx, std::vector<uint8_t>* pattern); static bool addCharClass( folly::StringPiece charClass, std::vector<uint8_t>* pattern); /** * Returns true if the trailing section of the input text (starting at * textIdx) is a mattern for the trailing portion of the pattern buffer * (starting at patternIdx). */ bool tryMatchAt(folly::StringPiece text, size_t textIdx, size_t patternIdx) const; /** * Check to see if the given character matches the character class opcode * starting at the specified index in the pattern buffer. * * Returns true if the character matches, and false otherwise. * * The patternIdx argument is updated to point to the next opcode after this * character calss. */ bool charClassMatch(uint8_t ch, size_t* patternIdx) const; /** * pattern_ is a pre-processed version of the glob pattern. * * This consists of a list of opcodes. * * TODO: It's perhaps worth doing some small-string optimization here. * In practice, over 90% of our gitignore patterns are less than 24 bytes. * It would probably be better to just store them inline here in this case, * rather than heap-allocating them in a vector. */ std::vector<uint8_t> pattern_; }; } // namespace facebook::eden
/* Meta information about GNU libunistring. Copyright (C) 2009-2010 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _UNISTRING_VERSION_H #define _UNISTRING_VERSION_H /* Get LIBUNISTRING_DLL_VARIABLE. */ #include <unistring/woe32dll.h> #ifdef __cplusplus extern "C" { #endif /* Version number: (major<<16) + (minor<<8) + subminor except that for versions <= 0.9.3 the value was 0x000009. */ #define _LIBUNISTRING_VERSION 0x000904 extern LIBUNISTRING_DLL_VARIABLE const int _libunistring_version; /* Likewise */ #ifdef __cplusplus } #endif #endif /* _UNISTRING_VERSION_H */
/* * 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 Library 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. */ // // Class: GUIRoster // Created by: Kent Gustavsson <nedo80@gmail.com> // Created on: Thu Aug 31 12:39:29 2006 // #ifndef _GUIROSTER_H_ #define _GUIROSTER_H_ #include <gtk/gtk.h> #include <glade/glade.h> #include "RosterItem.h" #include <Woklib/WLSignal.h> #include <Woklib/WoklibPlugin.h> #include <Woklib/WokXMLTag.h> using namespace Woklib; class GUIRoster : public WoklibPlugin { public: GUIRoster(WLSignal *wls); ~GUIRoster(); void CreateWid(); int AddItem(WokXMLTag *tag); int UpdateItem(WokXMLTag *tag); int RemoveItem(WokXMLTag *tag); int Close(WokXMLTag *tag); int GUIWindowInit(WokXMLTag *tag); static void DragGet(GtkWidget *wgt, GdkDragContext *context, GtkSelectionData *selection, guint info, guint time, GUIRoster *c); static int row_activated (GtkTreeView *treeview, GtkTreePath *arg1, GtkTreeViewColumn *arg2, GUIRoster *c); static gboolean popup_menu(GtkTreeView *tree_view, GdkEventButton *event, GUIRoster *c); static gboolean MouseMotion (GtkWidget *treeview, GdkEventMotion *event, GUIRoster *c); static gboolean MouseLeave(GtkWidget *treeview, GdkEventCrossing *event, GUIRoster *c); static void SizeChange(GtkWidget *widget, GtkAllocation *requisition, GUIRoster *c); void SetHover (gchar *hid); void CleanHover (); protected: gchar *hoverid; std::map <std::string, RosterItem*> item; RosterItem *root; GladeXML *xml; GtkWidget *mainwindowplug; WokXMLTag *inittag; GtkTreeViewColumn *pre_pix_column; GtkTreeViewColumn *text_column; GtkTreeViewColumn *post_pix_column; }; #endif //_GUIROSTER_H_
/* * Digital Beep Input Interface for HD-audio codec * * Author: Matthew Ranostay <mranostay@embeddedalley.com> * Copyright (c) 2008 Embedded Alley Solutions Inc * * This driver 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 driver is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <linux/input.h> #include <linux/pci.h> #include <linux/workqueue.h> #include <sound/core.h> #include "hda_beep.h" enum { DIGBEEP_HZ_STEP = 46875, /* 46.875 Hz */ DIGBEEP_HZ_MIN = 93750, /* 93.750 Hz */ DIGBEEP_HZ_MAX = 12000000, /* 12 KHz */ }; static void snd_hda_generate_beep(struct work_struct *work) { struct hda_beep *beep = container_of(work, struct hda_beep, beep_work); struct hda_codec *codec = beep->codec; if (!beep->enabled) return; /* generate tone */ snd_hda_codec_write_cache(codec, beep->nid, 0, AC_VERB_SET_BEEP_CONTROL, beep->tone); } static int snd_hda_beep_event(struct input_dev *dev, unsigned int type, unsigned int code, int hz) { struct hda_beep *beep = input_get_drvdata(dev); switch (code) { case SND_BELL: if (hz) hz = 1000; case SND_TONE: hz *= 1000; /* fixed point */ hz = hz - DIGBEEP_HZ_MIN; if (hz < 0) hz = 0; /* turn off PC beep*/ else if (hz >= (DIGBEEP_HZ_MAX - DIGBEEP_HZ_MIN)) hz = 0xff; else { hz /= DIGBEEP_HZ_STEP; hz++; } break; default: return -1; } beep->tone = hz; /* schedule beep event */ schedule_work(&beep->beep_work); return 0; } int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) { struct input_dev *input_dev; struct hda_beep *beep; int err; beep = kzalloc(sizeof(*beep), GFP_KERNEL); if (beep == NULL) return -ENOMEM; snprintf(beep->phys, sizeof(beep->phys), "card%d/codec#%d/beep0", codec->bus->card->number, codec->addr); input_dev = input_allocate_device(); if (!input_dev) { kfree(beep); return -ENOMEM; } /* setup digital beep device */ input_dev->name = "HDA Digital PCBeep"; input_dev->phys = beep->phys; input_dev->id.bustype = BUS_PCI; input_dev->id.vendor = codec->vendor_id >> 16; input_dev->id.product = codec->vendor_id & 0xffff; input_dev->id.version = 0x01; input_dev->evbit[0] = BIT_MASK(EV_SND); input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); input_dev->event = snd_hda_beep_event; input_dev->dev.parent = &codec->bus->pci->dev; input_set_drvdata(input_dev, beep); err = input_register_device(input_dev); if (err < 0) { input_free_device(input_dev); kfree(beep); return err; } /* enable linear scale */ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_2, 0x01); beep->nid = nid; beep->dev = input_dev; beep->codec = codec; beep->enabled = 1; codec->beep = beep; INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); return 0; } EXPORT_SYMBOL_HDA(snd_hda_attach_beep_device); void snd_hda_detach_beep_device(struct hda_codec *codec) { struct hda_beep *beep = codec->beep; if (beep) { cancel_work_sync(&beep->beep_work); flush_scheduled_work(); input_unregister_device(beep->dev); kfree(beep); } } EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device);
/* FreeS/WAN IPsec starter (starter.c) * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security * * 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: starterlog.c,v 1.3 2004/04/18 03:09:27 mcr Exp $ */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <stdio.h> #include <syslog.h> #include "openswan.h" #include "constants.h" #include "starterlog.h" #define BUFF_SIZE 16384 /** * TODO: * o use syslog option in config file */ static int _debug = 0; static int _console = 0; static int _syslog = 0; static void do_print_info (int level, const char *buff) { if ((!_debug) && (level == LOG_LEVEL_DEBUG)) return; if (_console) { if (level == LOG_LEVEL_ERR) fprintf(stderr, "%s\n", buff); else fprintf(stdout, "%s\n", buff); } if (_syslog) { if (level == LOG_LEVEL_ERR) syslog(LOG_ERR, "%s\n", buff); else syslog(LOG_INFO, "%s\n", buff); } } static void log_info_multiline (int level, const char *buff) { char *copy, *b, *ptr, *end; if (!buff) return; if ((!_debug) && (level == LOG_LEVEL_DEBUG)) return; copy = strdup(buff); if (!copy) return; end = copy + strlen(copy); for (ptr=copy,b=copy;ptr<=end;ptr++) { if (*ptr == '\n') *ptr='\0'; if (*ptr == '\0') { if (b!=end) do_print_info(level, b); b = ptr+1; } } free(copy); } void starter_log (int level, const char *fmt, ...) { va_list args; static char buff[BUFF_SIZE]; if ((!_debug) && (level == LOG_LEVEL_DEBUG)) return; va_start (args, fmt); vsnprintf(buff, BUFF_SIZE-1, fmt, args); buff[BUFF_SIZE-1] = '\0'; log_info_multiline (level, buff); va_end(args); } void starter_use_log (int debug, int console, int syslog) { _debug = debug; _console = console; if (syslog != _syslog) { if (syslog) { openlog("ipsec_starter", LOG_PID, LOG_USER); } else { closelog(); } _syslog = syslog; } } void passert_fail(const char *pred_str, const char *file_str, unsigned long line_no) { static int dying_breath = FALSE; /* we will get a possibly unplanned prefix. Hope it works */ starter_log(LOG_LEVEL_INFO, "ASSERTION FAILED at %s:%lu: %s", file_str, line_no, pred_str); if (!dying_breath) { dying_breath = TRUE; } abort(); /* exiting correctly doesn't always work */ }
#ifndef _IMAGE_H_ #define _IMAGE_H_ #include "imgstore.h" #define PurpleImage PurpleStoredImage #define purple_image_new_from_file(p, e) purple_imgstore_new_from_file(p) #define purple_image_new_from_data(d, l) purple_imgstore_add(d, l, NULL) #define purple_image_get_path purple_imgstore_get_filename #define purple_image_get_data_size purple_imgstore_get_size #define purple_image_get_data purple_imgstore_get_data #define purple_image_get_extension purple_imgstore_get_extension static inline const gchar * purple_image_get_mimetype(PurpleImage *image) { const gchar *extension = purple_image_get_extension(image); if (purple_strequal(extension, "jpg") || purple_strequal(extension, "jpeg")) { return "image/jpeg"; } else if (purple_strequal(extension, "png")) { return "image/png"; } else if (purple_strequal(extension, "gif")) { return "image/gif"; } return "image/*"; } #endif /* _IMAGE_H_ */
#ifndef DATABASE_H #define DATABASE_H #include <QWidget> class database : public QWidget { Q_OBJECT public: explicit database(QWidget *parent = 0); signals: public slots: QString connect(); void dbclose(); QString login(QString user,QString pass); QString createdb(QString dbname,QString pass); QString loaddb(QString dbname,QString pass); QList<QStringList> loaddata(); QString insertdata(QString dbname,QString name,QString uname,QString pass,QString url,QString date); void setdb(QString dbname); QStringList dblist(); QString updateData(QString cname,QString name,QString uname,QString pass,QString url,QString date); QString deleteEntity(QString entyName); QString checkPass(QString dbname,QString pass); QString changePass(QString dbname,QString olPass,QString nePass); QString changeMasterPass(QString name,QString olPass,QString nePass); QString addMasterUser(QString uname,QString pass); QString createMaster(); }; #endif // DATABASE_H
/* * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group * Portions Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * src/backend/port/dynloader/netbsd.c * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; #endif /* LIBC_SCCS and not lint */ #include "postgres.h" #include <nlist.h> #include <link.h> #include <dlfcn.h> #include "dynloader.h" static char error_message[BUFSIZ]; char * BSD44_derived_dlerror(void) { static char ret[BUFSIZ]; strcpy(ret, error_message); error_message[0] = 0; return (ret[0] == 0) ? NULL : ret; } void * BSD44_derived_dlopen(const char *file, int num) { #if !defined(HAVE_DLOPEN) snprintf(error_message, sizeof(error_message), "dlopen (%s) not supported", file); return NULL; #else void *vp; if ((vp = dlopen((char *) file, num)) == NULL) snprintf(error_message, sizeof(error_message), "dlopen (%s) failed: %s", file, dlerror()); return vp; #endif } void * BSD44_derived_dlsym(void *handle, const char *name) { #if !defined(HAVE_DLOPEN) snprintf(error_message, sizeof(error_message), "dlsym (%s) failed", name); return NULL; #else void *vp; #ifndef __ELF__ char buf[BUFSIZ]; if (*name != '_') { snprintf(buf, sizeof(buf), "_%s", name); name = buf; } #endif /* !__ELF__ */ if ((vp = dlsym(handle, (char *) name)) == NULL) snprintf(error_message, sizeof(error_message), "dlsym (%s) failed", name); return vp; #endif } void BSD44_derived_dlclose(void *handle) { #if defined(HAVE_DLOPEN) dlclose(handle); #endif }
/* * Copyright 2015 MongoDB, Inc. * * 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 "bson-version.h" #include "bson-version-functions.h" /** * bson_get_major_version: * * Helper function to return the runtime major version of the library. */ int bson_get_major_version (void) { return BSON_MAJOR_VERSION; } /** * bson_get_minor_version: * * Helper function to return the runtime minor version of the library. */ int bson_get_minor_version (void) { return BSON_MINOR_VERSION; } /** * bson_get_micro_version: * * Helper function to return the runtime micro version of the library. */ int bson_get_micro_version (void) { return BSON_MICRO_VERSION; } /** * bson_get_version: * * Helper function to return the runtime string version of the library. */ const char * bson_get_version (void) { return BSON_VERSION_S; } /** * bson_check_version: * * True if libmongoc's version is greater than or equal to the required * version. */ bool bson_check_version (int required_major, int required_minor, int required_micro) { return BSON_CHECK_VERSION(required_major, required_minor, required_micro); }
#include "../../../../../src/location/maps/qgeorouteparser_p_p.h"
/** ****************************************************************************** * @file usbd_cdc_interface.h * @author Central LAB * @version V1.0.0 * @date 21-Nov-2016 * @brief Header for usbd_cdc_interface.c file. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics International N.V. * All rights reserved.</center></h2> * * Redistribution and use in source and binary forms, with or without * modification, are permitted, provided that the following conditions are met: * * 1. Redistribution 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 other * contributors to this software may be used to endorse or promote products * derived from this software without specific written permission. * 4. This software, including modifications and/or derivative works of this * software, must execute solely and exclusively on microcontroller or * microprocessor devices manufactured by or for STMicroelectronics. * 5. Redistribution and use of this software other than as permitted under * this license is void and will automatically terminate your rights under * this license. * * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USBD_CDC_IF_H #define __USBD_CDC_IF_H /* Includes ------------------------------------------------------------------*/ #include "usbd_cdc.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ #define USB_RxBufferDim 2048 /* Definition for TIMx clock resources */ #define TIMx TIM3 #define TIMx_CLK_ENABLE __HAL_RCC_TIM3_CLK_ENABLE #define TIMx_FORCE_RESET() __HAL_RCC_USART3_FORCE_RESET() #define TIMx_RELEASE_RESET() __HAL_RCC_USART3_RELEASE_RESET() /* Definition for TIMx's NVIC */ #define TIMx_IRQn TIM3_IRQn #define TIMx_IRQHandler TIM3_IRQHandler /* Periodically, the state of the buffer "UserTxBuffer" is checked. The period depends on CDC_POLLING_INTERVAL */ #define CDC_POLLING_INTERVAL 5 /* in ms. The max is 65 and the min is 1 */ extern USBD_CDC_ItfTypeDef USBD_CDC_fops; /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ uint8_t CDC_Fill_Buffer(uint8_t* Buf, uint32_t TotalLen); #endif /* __USBD_CDC_IF_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#ifndef _GRID_H_ #define _GRID_H_ /////////////////////////////////////////////////////////////////////////////////////////////// // INCLUDE: /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// // C - standard: #include <math.h> /////////////////////////////////// // Cuda related: #include <cuda_runtime_api.h> /////////////////////////////////// // My files: #include "config.h" #include "my_include\common\defined.h" #include "my_include\common\print\print.h" #include "my_include\common\errchk.h" #include "my_include\common\types\data\data.h" /////////////////////////////////// // External: #include <BETTER_ENUM\BETTER_ENUM.h> /////////// /////////////////////////////////////////////////////////////////////////////////////////////// // AUXILIARY TYPES: /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// // Enums: enum GridAxes { x, y, z }; BETTER_ENUM(GridParams, int, nx, x0, dx, ny, y0, dy, nz, z0, dz, dt, PARAM_COUNT ) /////////// /////////////////////////////////////////////////////////////////////////////////////////////// // AUXILIARY FUNCTIONS: /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// // read params from file: template<class Value_T> Value_T read_gridParam(const char* path, GridParams param, bool& success); /////////// /////////////////////////////////////////////////////////////////////////////////////////////// // CLASS INFO: /////////////////////////////////////////////////////////////////////////////////////////////// class Grid { /////////////////////////////////// // Member variables: Private // /////////////////////////////////// private: /////////////////////////////////// // Member variables: Public // /////////////////////////////////// public: // Grid params: const int nx; const Data x0; const Data dx; const int ny; const Data y0; const Data dy; const int nz; const Data z0; const Data dz; const Data dt; public: // Class errors: static int const errVal; /////////////////////////////////// // Member functions: Private // /////////////////////////////////// private: /////////////////////////////////// // Member functions: Public // /////////////////////////////////// public: Grid(int _nx, int _ny, int _nz, Data _dx, Data _dy, Data _dz, Data _dt); Grid(Data _x0, Data _y0, Data _z0, int _nx, int _ny, int _nz, Data _dt); Grid(Data _x0, Data _y0, Data _z0, Data _dx, Data _dy, Data _dz, Data _dt); ~Grid(); }; /////////// #endif
#ifndef TODOC_H #define TODOC_H #include <stdbool.h> #include "tasks.h" #define DEBUG_PRINT(v, fmt, ...) \ if (options.debuglevel >= v) \ fprintf(stderr, "debug%d: %s(): " fmt "\n", v, __FUNCTION__, __VA_ARGS__); #define DEBUG_1(fmt, ...) DEBUG_PRINT(1, fmt, __VA_ARGS__) #define DEBUG_2(fmt, ...) DEBUG_PRINT(2, fmt, __VA_ARGS__) #define DEBUG_3(fmt, ...) DEBUG_PRINT(3, fmt, __VA_ARGS__) #define BUFSZ 256 /* Today in form YYYY-mm-dd */ char today[DATESZ]; struct options { char todocdir[BUFSZ]; /* -D */ bool testmode; /* -T */ /* -a sets next three to true */ bool show_finished; /* -! */ bool show_nodate; /* -* */ bool show_future; /* -f */; bool show_past; /* -p */ bool show_today; /* -t */ int debuglevel; /* -v */ }; extern struct options options; #endif /* !TODOC_H */
#ifndef __HEXFILE_H__ #define __HEXFILE_H__ #include <stdint.h> #include "nrf24le1.h" #define SPI_SPARE 3 struct firmware{ uint16_t start,end; char reset[3]; uint8_t number; char data[SPI_SPARE+FLASH_SZ]; //except the reset vector, 3 bytes for spi transfer }; int hexfile_read(struct firmware * fw, char *fn); int firmware_compare(struct firmware *fw1, struct firmware *fw2); #endif
/* * generalFunctions.h * * Created: 12/01/2015 23:16:52 * Author: */ #ifndef GENERALFUNCTIONS_H_ #define GENERALFUNCTIONS_H_ #define WIDTH (8 * sizeof(crc)) #define TOPBIT (1 << (WIDTH - 1)) crc crcSlow(uint8_t const message[], int nBytes) { crc remainder = 0; /* * Perform modulo-2 division, a byte at a time. */ for (int byte = 0; byte < nBytes; ++byte) { /* * Bring the next byte into the remainder. */ remainder ^= (message[byte] << (WIDTH - 8)); /* * Perform modulo-2 division, a bit at a time. */ for (uint8_t bit = 8; bit > 0; --bit) { /* * Try to divide the current data bit. */ if (remainder & TOPBIT) { remainder = (remainder << 1) ^ POLYNOMIAL; } else { remainder = (remainder << 1); } } } /* * The final remainder is the CRC result. */ return (remainder); } /* crcSlow() */ #endif /* GENERALFUNCTIONS_H_ */
/**************************************************************************** ** ** Wrimo is a prose writing tool ** ** Copyright (c) 2013 J. Knight ** Contact http://mtvee.github.io/wrimo ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program. If not, see http://www.gnu.org/licenses/. ** ****************************************************************************/ #ifndef NAMEGENDIALOG_H #define NAMEGENDIALOG_H #include <QDialog> #include <QStringList> namespace Ui { class NameGenDialog; } class NameGenDialog : public QDialog { Q_OBJECT public: explicit NameGenDialog(QWidget *parent = 0); ~NameGenDialog(); public slots: void generate(); private: Ui::NameGenDialog *ui; QStringList fnames; QStringList lnames; }; #endif // NAMEGENDIALOG_H
/* Unix SMB/CIFS implementation. DNS query too for Samba with socketwrapper support Copyright (C) 2012 Kai Blin <kai@samba.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 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 "includes.h" #include <talloc.h> #include <tevent.h> #include "lib/util/samba_util.h" #include "librpc/ndr/libndr.h" #include "librpc/gen_ndr/ndr_dns.h" #include "libcli/dns/libdns.h" static void usage(void) { printf("Usage: samba-dig <dns-server-ip> <data> <record-type>\n\n"); } static struct dns_name_packet *make_name_packet(TALLOC_CTX *mem_ctx, uint16_t operation) { struct dns_name_packet *packet = talloc_zero(mem_ctx, struct dns_name_packet); if (packet == NULL) { return NULL; } packet->id = random(); packet->operation |= operation | DNS_FLAG_RECURSION_DESIRED; return packet; } #define QTYPE_MAP(type) if (strncmp(type_string, #type , strlen( #type )) == 0) \ return DNS_QTYPE_ ## type ; static enum dns_qtype parse_qtype(const char *type_string) { QTYPE_MAP(AAAA); QTYPE_MAP(A); QTYPE_MAP(SOA); QTYPE_MAP(PTR); return -1; } #undef QTYPE_MAP static struct dns_name_question *make_question(TALLOC_CTX *mem_ctx, const char *name, enum dns_qtype type) { struct dns_name_question *question = talloc(mem_ctx, struct dns_name_question); if (question == NULL) { return NULL; } question->name = talloc_strdup(question, name); question->question_type = type; question->question_class = DNS_QCLASS_IN; return question; } int main(int argc, char **argv) { TALLOC_CTX *mem_ctx = talloc_init("samba-dig"); struct tevent_context *ev; struct dns_name_packet *dns_packet, *in_packet; struct dns_name_question *question; enum dns_qtype type; enum ndr_err_code ndr_err; struct tevent_req *req; WERROR w_err; DATA_BLOB out, in; int ret = 0; if (argc < 4) { usage(); exit(1); } ev = tevent_context_init(mem_ctx); setup_logging("samba-dig", DEBUG_STDERR); debug_parse_levels("1"); DEBUG(1,("Querying %s for %s %s\n", argv[1], argv[2], argv[3])); dns_packet = make_name_packet(mem_ctx, DNS_OPCODE_QUERY); type = parse_qtype(argv[3]); if (type == -1) { DEBUG(0, ("Invalid DNS_QTYPE %s\n", argv[3])); ret = 1; goto error; } question = make_question(dns_packet, argv[2], type); dns_packet->qdcount = 1; dns_packet->questions = question; NDR_PRINT_DEBUG(dns_name_packet, dns_packet); ndr_err = ndr_push_struct_blob(&out, mem_ctx, dns_packet, (ndr_push_flags_fn_t)ndr_push_dns_name_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0, ("Failed to marshall dns_name_packet: %d\n", ndr_err)); ret = 1; goto error; } req = dns_udp_request_send(mem_ctx, ev, argv[1], out.data, out.length); if (req == NULL) { DEBUG(0, ("Failed to allocate memory for tevent_req\n")); ret = 1; goto error; } if (!tevent_req_poll(req, ev)) { DEBUG(0, ("Error sending dns request\n")); ret = 1; goto error; } w_err = dns_udp_request_recv(req, mem_ctx, &in.data, &in.length); if (!W_ERROR_IS_OK(w_err)) { DEBUG(0, ("Error receiving dns request: %s\n", win_errstr(w_err))); ret = 1; goto error; } in_packet = talloc(mem_ctx, struct dns_name_packet); ndr_err = ndr_pull_struct_blob(&in, in_packet, in_packet, (ndr_pull_flags_fn_t)ndr_pull_dns_name_packet); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { DEBUG(0, ("Failed to unmarshall dns_name_packet: %d\n", ndr_err)); ret = 1; goto error; } NDR_PRINT_DEBUG(dns_name_packet, in_packet); error: talloc_free(mem_ctx); return ret; }
/* * Copyright (c) 2010-2020 Belledonne Communications SARL. * * This file is part of linphone-iphone * * 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/>. */ #import <UIKit/UIKit.h> #import "UICompositeView.h" #import "TPMultiLayoutViewController.h" #import "UIRoundedImageView.h" #include "LinphoneManager.h" @protocol IncomingCallViewDelegate <NSObject> - (void)incomingCallAccepted:(LinphoneCall *)call evenWithVideo:(BOOL)video; - (void)incomingCallDeclined:(LinphoneCall *)call; - (void)incomingCallAborted:(LinphoneCall *)call; @end @interface CallIncomingView : TPMultiLayoutViewController <UICompositeViewDelegate> { } @property(nonatomic) Boolean earlyMedia; @property(weak, nonatomic) IBOutlet UILabel *nameLabel; @property(nonatomic, strong) IBOutlet UILabel *addressLabel; @property(nonatomic, strong) IBOutlet UIRoundedImageView *avatarImage; @property(nonatomic, assign) LinphoneCall *call; @property(nonatomic, strong) id<IncomingCallViewDelegate> delegate; @property(weak, nonatomic) IBOutlet UIView *tabVideoBar; @property(weak, nonatomic) IBOutlet UIView *tabBar; @property (weak, nonatomic) IBOutlet UIView *earlyMediaView; - (IBAction)onAcceptClick:(id)event; - (IBAction)onDeclineClick:(id)event; - (IBAction)onAcceptAudioOnlyClick:(id)sender; @end
/* sysprof-capture.h * * Copyright © 2018 Christian Hergert <chergert@redhat.com> * * This file 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 file 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 General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SYSPROF_CAPTURE_H #define SYSPROF_CAPTURE_H #include <glib-object.h> G_BEGIN_DECLS #define SYSPROF_INSIDE # include "sp-address.h" # include "sp-clock.h" # include "sp-error.h" # include "sysprof-version.h" # include "capture/sp-capture-condition.h" # include "capture/sp-capture-cursor.h" # include "capture/sp-capture-reader.h" # include "capture/sp-capture-writer.h" #undef SYSPROF_INSIDE G_END_DECLS #endif /* SYSPROF_CAPTURE_H */
/* base64_dec.c */ /* * This file is part of the ARM-Crypto-Lib. * Copyright (C) 2006-2010 Daniel Otte (daniel.otte@rub.de) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 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/>. */ /** * base64 decoder (RFC3548) * Author: Daniel Otte * License: GPLv3 * * */ #include <stdint.h> #include "base64_dec.h" /* #define USE_GCC_EXTENSION */ #ifdef USE_GCC_EXTENSION static int ascii2bit6(char a){ switch(a){ case 'A'...'Z': return a-'A'; case 'a'...'z': return a-'a'+26; case '0'...'9': return a-'0'+52; case '+': case '-': return 62; case '/': case '_': return 63; default: return -1; } } #else static uint8_t ascii2bit6(char a){ int r; switch(a>>4){ case 0x5: case 0x4: r=a-'A'; if(r<0 || r>25){ return -1; } else { return r; } case 0x7: case 0x6: r=a-'a'; if(r<0 || r>25){ return -1; } else { return r+26; } break; case 0x3: if(a>'9') return -1; return a-'0'+52; default: break; } switch (a){ case '+': case '-': return 62; case '/': case '_': return 63; default: return 0xff; } } #endif int base64_binlength(char* str, uint8_t strict){ int l=0; uint8_t term=0; for(;;){ if(*str=='\0') break; if(*str=='\n' || *str=='\r'){ str++; continue; } if(*str=='='){ term++; str++; if(term==2){ break; } continue; } if(term) return -1; if(ascii2bit6(*str)==-1){ if(strict) return -1; } else { l++; } str++; } switch(term){ case 0: if(l%4!=0) return -1; return l/4*3; case 1: if(l%4!=3) return -1; return (l+1)/4*3-1; case 2: if(l%4!=2) return -1; return (l+2)/4*3-2; default: return -1; } } /* |543210543210543210543210| |765432107654321076543210| . . . . |54321054|32105432|10543210| |76543210|76543210|76543210| */ int base64dec(void* dest, const char* b64str, uint8_t strict){ uint8_t buffer[4]; uint8_t idx=0; uint8_t term=0; for(;;){ buffer[idx]= ascii2bit6(*b64str); if(buffer[idx]==0xFF){ if(*b64str=='='){ term++; b64str++; if(term==2) goto finalize; /* definitly the end */ }else{ if(*b64str == '\0'){ goto finalize; /* definitly the end */ }else{ if(*b64str == '\r' || *b64str == '\n' || !(strict)){ b64str++; /* charcters that we simply ignore */ }else{ return -1; } } } }else{ if(term) return -1; /* this happens if we get a '=' in the stream */ idx++; b64str++; } if(idx==4){ ((uint8_t*)dest)[0] = buffer[0]<<2 | buffer[1]>>4; ((uint8_t*)dest)[1] = buffer[1]<<4 | buffer[2]>>2; ((uint8_t*)dest)[2] = buffer[2]<<6 | buffer[3]; dest = (uint8_t*)dest +3; idx=0; } } finalize: /* the final touch */ if(idx==0) return 0; if(term==1){ ((uint8_t*)dest)[0] = buffer[0]<<2 | buffer[1]>>4; ((uint8_t*)dest)[1] = buffer[1]<<4 | buffer[2]>>2; return 0; } if(term==2){ ((uint8_t*)dest)[0] = buffer[0]<<2 | buffer[1]>>4; return 0; } return -1; }
// This file is part of Aspect-Oriented-IP. // // Aspect-Oriented-IP 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. // // Aspect-Oriented-IP 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 Aspect-Oriented-IP. If not, see <http://www.gnu.org/licenses/>. // // Copyright (C) 2011 Christoph Borchert #ifndef __IPSTACK_RINGBUFFER_H__ #define __IPSTACK_RINGBUFFER_H__ #include "util/ipstack_inttypes.h" #include "RingbufferBase.h" #include "IPStack_Config.h" namespace ipstack { template<typename tBASE, unsigned tBUFFERSIZE> class BasicRingbuffer : public tBASE { // limit actual buffer size to [2...255] (8 bit) enum { BUFFERSIZE = (tBUFFERSIZE < 2) ? 2 : ((tBUFFERSIZE > 255) ? 255 : tBUFFERSIZE) }; void* buffer[BUFFERSIZE]; uint8_t inpos_; uint8_t outpos_; public: BasicRingbuffer() : inpos_(0), outpos_(0) {} void put(void* val) volatile __attribute__ ((noinline)) { if (((inpos_ + 1) % BUFFERSIZE) != outpos_) { buffer[inpos_] = val; inpos_ = (inpos_ + 1) % BUFFERSIZE; } else { // buffer full! } } void* get() volatile __attribute__ ((noinline)) { if (outpos_ != inpos_) { void* val = buffer[outpos_]; outpos_ = (outpos_ + 1) % BUFFERSIZE; return val; } else { return 0; } } /*bool isEmpty() volatile const { return outpos_ == inpos_ ? true : false; }*/ bool isFull() volatile const __attribute__ ((noinline)) { return ((inpos_ + 1) % BUFFERSIZE) != outpos_ ? false : true; } }; template<unsigned tGENERIC=0> class RingbufferType { public: typedef BasicRingbuffer<EmptyRingbufferBase, PACKET_LIMIT> Packetbuffer; }; template<> // template specialization for '1' class RingbufferType<1> { public: typedef PolymorphRingbufferBase Packetbuffer; }; // The 'Packetbuffer' type used everywhere typedef RingbufferType<MEMORY_GENERIC>::Packetbuffer Packetbuffer; // only used for the API template<uint8_t tBUFFERSIZE, unsigned tGENERIC=0> class PacketbufferAPI { public: typedef Packetbuffer Type; }; template<uint8_t tBUFFERSIZE> class PacketbufferAPI<tBUFFERSIZE, 1> { public: typedef BasicRingbuffer<PolymorphRingbufferBase, tBUFFERSIZE> Type; }; } //namespace ipstack #endif // __IPSTACK_RINGBUFFER_H__
#define _GNU_SOURCE #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <dlfcn.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include "udpguard.h" int socket(int domain, int type, int protocol) { typeof(socket) *original_socket; original_socket = dlsym(RTLD_NEXT, "socket"); return handleSocket(original_socket, domain, type, protocol); } int bind(int fd, const struct sockaddr *__restrict addr, socklen_t len) { typeof(bind) *original_bind; original_bind = dlsym(RTLD_NEXT, "bind"); return handleBind(original_bind, fd, addr, len); } int connect(int sd, const struct sockaddr *__restrict addr, socklen_t len){ typeof(connect) *original_connect; original_connect = dlsym(RTLD_NEXT, "connect"); return handleConnect(original_connect, sd, addr, len); } int close(int fd) { typeof(close) *original_close; original_close = dlsym(RTLD_NEXT, "close"); return handleClose(original_close, fd); } ssize_t recvfrom(int fd, void *__restrict buf, size_t n, int flags, struct sockaddr *__restrict addr, socklen_t *__restrict addr_len) { typeof(recvfrom) *original_recvfrom; original_recvfrom = dlsym(RTLD_NEXT, "recvfrom"); return handleRecvfrom(original_recvfrom, fd, buf, n, flags, addr, addr_len); }
// This file was generated based on /usr/local/share/uno/Packages/Uno.Net.Http/1.3.2/UriScheme.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Int.h> namespace g{ namespace Uno{ namespace Net{ namespace Http{ // public enum UriSchemeType :6 uEnumType* UriSchemeType_typeof(); }}}} // ::g::Uno::Net::Http
/* * (C) 2003-2006 Gabest * (C) 2006-2014 see Authors.txt * * This file is part of WinnerMediaPlayer. * * WinnerMediaPlayer 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. * * WinnerMediaPlayer 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/>. * */ #pragma once // TODO: remove this when it's fixed in MSVC // Work around warning C4005: 'XXXX' : macro redefinition #pragma warning(push) #pragma warning(disable: 4005) #include <stdint.h> #pragma warning(pop) #pragma pack(1) class CIfo { public: CIfo(); bool OpenFile (LPCTSTR strFile); bool SaveFile (LPCTSTR strFile); bool RemoveUOPs(); ~CIfo(void); private : typedef struct { uint16_t id : 16; // Language uint16_t : 16; // don't know uint32_t start : 32; // Start of unit } pgci_sub_t; typedef struct { uint8_t hour; uint8_t minute; uint8_t second; uint8_t frame_u; // The two high bits are the frame rate. } dvd_time_t; typedef uint8_t command_data_t[8]; #define COMMAND_DATA_SIZE 8 typedef struct { // PGC Command Table uint16_t nr_of_pre; uint16_t nr_of_post; uint16_t nr_of_cell; uint16_t tbl_len; command_data_t *pre_commands; command_data_t *post_commands; command_data_t *cell_commands; } pgc_command_tbl_t; #define PGC_COMMAND_TBL_SIZE 8 typedef uint8_t pgc_program_map_t; typedef struct { // Cell Playback Information uint8_t chain_info : 8; // 0x5e 0xde(2 angles, no overlay), 0x5f 0x9f 0x9f 0xdf(4 angles overlay), 0x2 0xa 0x8(1 angle) uint8_t foo; // parental control ?? uint8_t still_time; uint8_t cell_cmd; dvd_time_t playback_time; uint32_t vobu_start; // 1st vobu start uint32_t ilvu_end; uint32_t vobu_last_start; uint32_t vobu_last_end; } ifo_pgci_caddr_t; typedef struct { // Cell Position Information uint16_t vob_id : 16; // Video Object Identifier uint8_t foo : 8; // Unknown uint8_t cell_id : 8; // Cell Identifier } ifo_pgc_cpos_t; #ifndef CLUT_T #define CLUT_T typedef struct { // CLUT == Color LookUp Table uint8_t foo : 8; // UNKNOWN: 0x00? uint8_t y : 8; uint8_t cr : 8; uint8_t cb : 8; } clut_t; #endif typedef struct { // Audio Status #if BYTE_ORDER == BIG_ENDIAN uint8_t available : 1; uint8_t link : 7; #else uint8_t link : 7; uint8_t available : 1; #endif uint8_t foo : 8; // UNKNOWN } audio_status_t; typedef struct { // Subpicture status #if BYTE_ORDER == BIG_ENDIAN uint8_t available : 1; uint8_t format4_3 : 7; #else uint8_t format4_3 : 7; uint8_t available : 1; #endif uint8_t wide : 8; uint8_t letter : 8; uint8_t pan : 8; } subp_status_t; typedef struct { // Program Chain Information uint16_t zero_1; uint8_t nr_of_programs; uint8_t nr_of_cells; dvd_time_t playback_time; uint32_t prohibited_ops; // New type? audio_status_t audio_status[8]; subp_status_t subp_status[32]; uint16_t next_pgc_nr; uint16_t prev_pgc_nr; uint16_t goup_pgc_nr; uint8_t still_time; uint8_t pg_playback_mode; clut_t clut[16]; uint16_t pgc_command_tbl_offset; uint16_t pgc_program_map_offset; uint16_t cell_playback_tbl_offset; uint16_t cell_position_tbl_offset; pgc_command_tbl_t *pgc_command_tbl; pgc_program_map_t *pgc_program_map; ifo_pgci_caddr_t *cell_playback_tbl; ifo_pgc_cpos_t *cell_position_tbl; } pgc_t; #define PGC_SIZE 236 typedef struct { uint16_t num : 16; // number of entries uint16_t : 16; // UNKNOWN uint32_t len : 32; // length of table } ifo_hdr_t; typedef struct { #if BYTE_ORDER == BIG_ENDIAN uint16_t foo1 : 4; // don't know uint8_t menu_id : 4; // 0=off, 3=root, 4=spu, // 5=audio, 6=angle, 7=ptt #else uint8_t menu_id : 4; // 0=off, 3=root, 4=spu, // 5=audio, 6=angle, 7=ptt uint16_t foo1 : 4; // don't know #endif uint16_t foo2 : 8; // don't know uint16_t bar : 16; // don't know uint32_t start : 32; // Start of unit } lu_sub_t; BYTE* m_pBuffer; DWORD m_dwSize; ifo_hdr_t* m_pPGCI; ifo_hdr_t* m_pPGCIT; bool IsVTS(); bool IsVMG(); pgc_t* GetFirstPGC(); pgc_t* GetPGCI(const int title, const ifo_hdr_t* hdr); int GetMiscPGCI (ifo_hdr_t *hdr, int title, uint8_t **ptr); void RemovePgciUOPs (uint8_t *ptr); };
/* ------------------------------------------------ Copyright (C) 2015 by Jorge C. Valverde-Rebaza Email: jvalverr@icmc.usp.br This file is part of LPsource. LPsource 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. LPsource 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 LPsource. If not, see <http://www.gnu.org/licenses/>. ------------------------------------------------ */ #ifndef STRUCTURES_H_INCLUDED #define STRUCTURES_H_INCLUDED #include <vector> using std::vector; using std::pair; typedef unsigned int index_v; typedef unsigned int index_g; const long INV_LONG = -1; const double INF_P = 990000; const unsigned int MAX_GROUP_SIZE = 8000000; /******************************************************/ /***************** Node of a network **************/ /********************************************************/ struct Node{ vector<index_v> Neighbors; //list of indexes of neighborhood of the node vector<double> Weights; //list of weights of relationships between the node and their neighbors vector<index_g> Groups; //list of labels of groups to which the node belong to }; /******************************************************/ /********** Link between a pair of nodes **********/ /********************************************************/ struct Link{ index_v indexVertex1; index_v indexVertex2; double score; bool classLink; //0 = non-existent, 1 = existent }; /******************************************************/ /** List of Indexes of Users belonging to the group ***/ /*******************************************************/ struct Group{ index_g idGroup; vector<index_v> Users; }; struct linkCompareByNode1{ bool operator() (const Link& link1, const Link& link2 )const { return (link1.indexVertex1 < link2.indexVertex1); } }; struct linkCompareByNode2{ bool operator() (const Link& link1, const Link& link2 )const { return (link1.indexVertex2 < link2.indexVertex2); } }; struct scoreLinkCompare{ bool operator() (const Link& link1, const Link& link2 )const { return (link1.score > link2.score); } }; #endif // STRUCTURES_H_INCLUDED
#ifndef __IMU_H__ #define __IMU_H__ #define PI 3.141592654f #define PPI 6.283185307f #define Kp 1.6f #define Ki 0.001f #define halfT 0.002f #define gyro_denominator 1834 // 65.5*28=1834 #define PI 3.141592654f #define PPI 6.283185307f #define R2D 57.29577951 #define GLSB 65.5 #define ALSB 8192 typedef struct _euler{ double roll; double pitch; double yaw; }EULER_Def; typedef struct _quat{ double q0; double q1; double q2; double q3; }QUAT_Def; typedef struct _imu{ int16_t gx; int16_t gy; int16_t gz; int16_t ax; int16_t ay; int16_t az; int16_t mx; int16_t my; int16_t mz; int16_t alt; int16_t alt_init; int16_t heading; uint16_t press; uint16_t temp; }IMU_Def; void quat_init(IMU_Def *imu,QUAT_Def *quat,EULER_Def *euler); void imu_read(IMU_Def *imu); void imu_update(IMU_Def *imu,QUAT_Def *quat,EULER_Def *euler); extern IMU_Def imu; extern QUAT_Def quat; extern EULER_Def euler; #endif
/* * font.h * * Copyright (C) 2010 Pranananda Deva * * This file is part of pdfreflow. * * Pdfreflow 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. * * Pdfreflow 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 pdfreflow. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INCLUDED_FONT_H #define INCLUDED_FONT_H struct Atom; /* * font_add * Add a font to the global table. */ void font_add(char *id, int size, char *family, char *color); /* * font_size * returns the size of a font, the id of the font is an atom */ int font_size(struct Atom *id); /* * font_family * returns the family of a font, the id of the font is an atom */ char *font_family(struct Atom *id); /* * font_printfonts * print all the fonts in the document */ void font_printfonts(); struct Atom *font_printstr(struct Atom *id); struct Atom *font_fromprintstr(struct Atom *printstr); #endif /* INCLUDED_FONT_H */
#ifndef _ROS_realsense_camera_IMUInfo_h #define _ROS_realsense_camera_IMUInfo_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "std_msgs/Header.h" namespace realsense_camera { class IMUInfo : public ros::Msg { public: std_msgs::Header header; float data[12]; float noise_variances[3]; float bias_variances[3]; IMUInfo(): header(), data(), noise_variances(), bias_variances() { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; offset += this->header.serialize(outbuffer + offset); for( uint8_t i = 0; i < 12; i++){ offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); } for( uint8_t i = 0; i < 3; i++){ offset += serializeAvrFloat64(outbuffer + offset, this->noise_variances[i]); } for( uint8_t i = 0; i < 3; i++){ offset += serializeAvrFloat64(outbuffer + offset, this->bias_variances[i]); } return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; offset += this->header.deserialize(inbuffer + offset); for( uint8_t i = 0; i < 12; i++){ offset += deserializeAvrFloat64(inbuffer + offset, &(this->data[i])); } for( uint8_t i = 0; i < 3; i++){ offset += deserializeAvrFloat64(inbuffer + offset, &(this->noise_variances[i])); } for( uint8_t i = 0; i < 3; i++){ offset += deserializeAvrFloat64(inbuffer + offset, &(this->bias_variances[i])); } return offset; } const char * getType(){ return "realsense_camera/IMUInfo"; }; const char * getMD5(){ return "b8a77fbb6e4146ae79c8a943413e4f62"; }; }; } #endif
//===- Verifier.h - LLVM IR Verifier ----------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the function verifier interface, that can be used for some // sanity checking of input to the system, and for checking that transformations // haven't done something bad. // // Note that this does not provide full 'java style' security and verifications, // instead it just tries to ensure that code is well formed. // // To see what specifically is checked, look at the top of Verifier.cpp // //===----------------------------------------------------------------------===// #ifndef LLVM_IR_VERIFIER_H #define LLVM_IR_VERIFIER_H #include "llvm/ADT/StringRef.h" #include "llvm/IR/PassManager.h" #include <string> namespace llvm { class Function; class FunctionPass; class ModulePass; class Module; class raw_ostream; /// \brief Check a function for errors, useful for use when debugging a /// pass. /// /// If there are no errors, the function returns false. If an error is found, /// a message describing the error is written to OS (if non-null) and true is /// returned. bool verifyFunction(const Function &F, raw_ostream *OS = nullptr); /// \brief Check a module for errors. /// /// If there are no errors, the function returns false. If an error is found, /// a message describing the error is written to OS (if non-null) and true is /// returned. bool verifyModule(const Module &M, raw_ostream *OS = nullptr); /// \brief Create a verifier pass. /// /// Check a module or function for validity. This is essentially a pass wrapped /// around the above verifyFunction and verifyModule routines and /// functionality. When the pass detects a verification error it is always /// printed to stderr, and by default they are fatal. You can override that by /// passing \c false to \p FatalErrors. /// /// Note that this creates a pass suitable for the legacy pass manager. It has /// nothing to do with \c VerifierPass. FunctionPass *createVerifierPass(bool FatalErrors = true); class VerifierPass : public PassInfoMixin<VerifierPass> { bool FatalErrors; public: explicit VerifierPass(bool FatalErrors = true) : FatalErrors(FatalErrors) {} PreservedAnalyses run(Module &M); PreservedAnalyses run(Function &F); }; } // End llvm namespace #endif
#if !defined __OBJPROPGENRESOURCE__ #define __OBJPROPGENRESOURCE__ #include "ObjPropGenBase.h" class CObjPropGenResource : public CObjPropGenBase { public: CObjPropGenResource(DIALOGTYPE DialogType, CPropertySheetBase *PropertySheet); ~CObjPropGenResource(); // CString m_Type; protected: virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); virtual BOOL OnKillActive(); }; #endif
#ifndef VOICE_H #define VOICE_H #include <QObject> #include <QtCore> #include "JasonQt/JasonQt_Vop.h" #include "QDBusInterface" #include "QDBusMessage" #include "headers/dbusaudiosource.h" class Voice: public QObject { Q_OBJECT public: Voice(); QString backText; QTimer *timer = new QTimer(this); QTime *time = new QTime(); float volume; int switchValue; ~Voice(); signals: void sig(QVariant str_num); void send_time(); void start_time(); void start(); void end(); public slots: void inputFinish(); void startInput(); void handleMeterVolumeChanged(const QDBusMessage &msg); void startVoice(); private: JasonQt_Vop::BaiduVop m_baiduVop; DBusAudioSource *m_defaultSource = nullptr; QDBusInterface *m_dbusMeter = nullptr; QTimer *m_meterTimer = nullptr; }; #endif // VOICE_H
/* * Copyright (C) 2011, David Consuegra * * This file is part of Haywire * * Haywire 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. * Haywire 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 Haywire. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> #include <stdlib.h> #include "apacheLogParser.h" #include "appstate.h" #include "loglist.h" haywire_state app; int main(int argv, char *args[]) { app = default_state; if (!parse_arguments(&app, argv, args)) print_usage(); logfile *log = app.log; logerror *err = log->errors; size_t filename_len = 256; char *filename = malloc(filename_len); while(err != NULL) { logerror_nicepath(err, app.relative_path, &filename, &filename_len); printf("%d %s: %s:%d (%d times)\n", err->type, err->msg, filename, err->linenr, err->count); logerror_occurrence *occ = err->latest_occurrence; while(occ != NULL) { printf("\t%s", get_log_time(occ)); if (occ->referer != NULL) { printf(" referer: %s", occ->referer); } if (occ->stack_trace != NULL) { printf("\n Stack trace: %s", occ->stack_trace); } printf("\n"); occ = occ->prev; } err = err->next; } logfile_close(log); exit(EXIT_SUCCESS); }
/** * ex027_geo2json.c * * Created by Billy Wilson Arante <arantebillywilson@gmail.com> * Last updated on 2017/05/17 PHT * * Attribution to "Head First C" * Created by David Griffiths & Dawn Griffiths */ #include <stdio.h> int main() { float latitude; float longitude; char info[80]; int started = 0; puts("data=["); while (scanf("%f, %f, %79[^\n]", &latitude, &longitude, info) == 3) { if (started) printf(",\n"); else started = 1; /* Data validation */ if ((latitude < -90) || (latitude > 90)) { /* Stops parsing and displays error message */ fprintf(stderr, "%s %f\n", "Invalid latitude:", latitude); return 2; } if ((longitude < -180) || (longitude > 180)) { /* Stops parsing and displays error message */ fprintf(stderr, "%s %f\n", "Invalid longitude:", longitude); return 2; } printf("{latitude: %f, longitude: %f, info: '%s'}", latitude, longitude, info); } puts("\n]"); return 0; }
// // NSNull+Safe.h // coastline2 // // Created by wangyuanou on 14-1-25. // Copyright (c) 2014年 mixbus. All rights reserved. // #import <Foundation/Foundation.h> @interface NSNull (Safe) -(unsigned int) length; -(unsigned int) count; -(int) intValue; -(float) floatValue; - (id)valueForKey:(NSString *)key; - (id)objectAtIndex:(NSUInteger)index; - (id)objectForKey:(id)aKey; @end
/* * This file is part of ku. * * Copyright 2013 Marc-Antoine Perennou <Marc-Antoine@Perennou.com> * * ku 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. * * ku 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 ku. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __KU_SYMBOL_PRIVATE_H__ #define __KU_SYMBOL_PRIVATE_H__ #include "ku-symbol.h" struct _KuSymbol { KuSymbolType type; KuString *name; }; #endif /*__KU_SYMBOL_PRIVATE_H__*/
#ifndef ENET_H #define ENET_H #include <stdint.h> // extern volatile uint8_t* messages; void enet_init(); typedef enum { ENET_LINK_DOWN, ENET_LINK_UP } enet_link_status_t; enet_link_status_t enet_get_link_status(); void enet_send_udp_ucast(const uint8_t *dest_mac, const uint32_t dest_ip, const uint16_t dest_port, const uint32_t source_ip, const uint16_t source_port, const uint8_t *payload, const uint16_t payload_len); void enet_send_udp_mcast(const uint32_t mcast_ip, const uint16_t mcast_port, const uint8_t *payload, const uint16_t payload_len); void enet_write_phy_reg(const uint8_t reg_idx, const uint16_t reg_val); uint_fast8_t enet_process_rx_ring(); void enet_send_state(volatile uint8_t *, uint16_t msgLen); #endif
/* =========================================================================== Copyright (c) 2010-2014 Darkstar Dev Teams 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/ This file is part of DarkStar-server source code. =========================================================================== */ #ifndef _PACKETSYSTEM_H #define _PACKETSYSTEM_H #include "../common/cbasetypes.h" #include "entities/charentity.h" struct map_session_data_t; extern uint8 PacketSize[512]; extern void(*PacketParser[512])(map_session_data_t*, CCharEntity*, int8*); void PrintPacket(int8* data); void PacketParserInitialize(); bool ProcessPacket(uint16 size, uint16 type); #endif
/* * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. * Copyright (c) 2006 Christian Walter <wolti@sil.at> * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * File: $Id: mbconfig.h,v 1.15 2010/06/06 13:54:40 wolti Exp $ */ #ifndef _MB_CONFIG_H #define _MB_CONFIG_H #ifdef __cplusplus PR_BEGIN_EXTERN_C #endif /* ----------------------- Defines ------------------------------------------*/ /*! \defgroup modbus_cfg Modbus Configuration * * Most modules in the protocol stack are completly optional and can be * excluded. This is specially important if target resources are very small * and program memory space should be saved.<br> * * All of these settings are available in the file <code>mbconfig.h</code> */ /*! \addtogroup modbus_cfg * @{ */ /*! \brief If Modbus ASCII support is enabled. */ #define MB_ASCII_ENABLED ( 1 ) /*! \brief If Modbus RTU support is enabled. */ #define MB_RTU_ENABLED ( 1 ) /*! \brief If Modbus TCP support is enabled. */ #define MB_TCP_ENABLED ( 1 ) /*! \brief The character timeout value for Modbus ASCII. * * The character timeout value is not fixed for Modbus ASCII and is therefore * a configuration option. It should be set to the maximum expected delay * time of the network. */ #define MB_ASCII_TIMEOUT_SEC ( 1 ) /*! \brief Timeout to wait in ASCII prior to enabling transmitter. * * If defined the function calls vMBPortSerialDelay with the argument * MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS to allow for a delay before * the serial transmitter is enabled. This is required because some * targets are so fast that there is no time between receiving and * transmitting the frame. If the master is to slow with enabling its * receiver then he will not receive the response correctly. */ #ifndef MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS #define MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ( 0 ) #endif /*! \brief Maximum number of Modbus functions codes the protocol stack * should support. * * The maximum number of supported Modbus functions must be greater than * the sum of all enabled functions in this file and custom function * handlers. If set to small adding more functions will fail. */ #define MB_FUNC_HANDLERS_MAX ( 16 ) /*! \brief Number of bytes which should be allocated for the <em>Report Slave ID * </em>command. * * This number limits the maximum size of the additional segment in the * report slave id function. See eMBSetSlaveID( ) for more information on * how to set this value. It is only used if MB_FUNC_OTHER_REP_SLAVEID_ENABLED * is set to <code>1</code>. */ #define MB_FUNC_OTHER_REP_SLAVEID_BUF ( 32 ) /*! \brief If the <em>Report Slave ID</em> function should be enabled. */ #define MB_FUNC_OTHER_REP_SLAVEID_ENABLED ( 1 ) /*! \brief If the <em>Read Input Registers</em> function should be enabled. */ #define MB_FUNC_READ_INPUT_ENABLED ( 1 ) /*! \brief If the <em>Read Holding Registers</em> function should be enabled. */ #define MB_FUNC_READ_HOLDING_ENABLED ( 1 ) /*! \brief If the <em>Write Single Register</em> function should be enabled. */ #define MB_FUNC_WRITE_HOLDING_ENABLED ( 1 ) /*! \brief If the <em>Write Multiple registers</em> function should be enabled. */ #define MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED ( 1 ) /*! \brief If the <em>Read Coils</em> function should be enabled. */ #define MB_FUNC_READ_COILS_ENABLED ( 1 ) /*! \brief If the <em>Write Coils</em> function should be enabled. */ #define MB_FUNC_WRITE_COIL_ENABLED ( 1 ) /*! \brief If the <em>Write Multiple Coils</em> function should be enabled. */ #define MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED ( 1 ) /*! \brief If the <em>Read Discrete Inputs</em> function should be enabled. */ #define MB_FUNC_READ_DISCRETE_INPUTS_ENABLED ( 1 ) /*! \brief If the <em>Read/Write Multiple Registers</em> function should be enabled. */ #define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 ) /*! @} */ #ifdef __cplusplus PR_END_EXTERN_C #endif #endif
/* This source file is part of Rigs of Rods Copyright 2005-2012 Pierre-Michel Ricordel Copyright 2007-2012 Thomas Fischer For more information, see http://www.rigsofrods.com/ Rigs of Rods is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation. Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __PointColDetector_H__ #define __PointColDetector_H__ #include "RoRPrerequisites.h" #include "Ogre.h" #include <vector> using namespace Ogre; using namespace std; #include "Beam.h" typedef struct _pointid { int nodeid; int truckid; } pointid_t; typedef struct _refelem { pointid_t* pidref; float* point; } refelem_t; typedef struct _kdnode { float min; int end; float max; refelem_t* ref; float middle; int begin; } kdnode_t; class PointColDetector { public: std::vector< Vector3 > *object_list; std::vector< pointid_t* > hit_list; int hit_count; PointColDetector(std::vector< Vector3 > &o_list); PointColDetector(); ~PointColDetector(); void reset(); void update(); void update(Beam** trucks, const int numtrucks); void update_structures(); void update_structures_for_contacters(Beam** trucks, const int numtrucks); void querybb(const Vector3 &bmin, const Vector3 &bmax); void query(const Vector3 &vec1, const Vector3 &vec2, const Vector3 &vec3, float enlargeBB=0.0f); void query(const Vector3 &vec1, const Vector3 &vec2, const float enlargeBB=0.0f); inline void calc_bounding_box(Vector3 &bmin, Vector3 &bmax, const Vector3 &vec1, const Vector3 &vec2, const Vector3 &vec3, const float enlargeBB=0.0f); inline void calc_bounding_box(Vector3 &bmin, Vector3 &bmax, const Vector3 &vec1, const Vector3 &vec2, const float enlargeBB=0.0f); private: int object_list_size; refelem_t *ref_list; pointid_t *pointid_list; std::vector< kdnode_t > kdtree; Vector3 bbmin; Vector3 bbmax; inline void queryrec(int kdindex, int axis); void build_kdtree(int begin, int end, int axis, int index); void build_kdtree_incr(int axis, int index); void partintwo(const int start, const int median, const int end, const int axis, float &minex, float &maxex); }; #endif
///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) Statoil ASA // // ResInsight 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. // // ResInsight 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 at <http://www.gnu.org/licenses/gpl.html> // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "cvfObject.h" #include <QString> #include <map> class RigAllanDiagramData : public cvf::Object { public: RigAllanDiagramData(); ~RigAllanDiagramData() override; const std::map<std::pair<int, int>, int>& formationCombinationToCategory() { return m_formationCombinationToCategory; } std::pair<int, int> formationIndexCombinationFromCategory( int category ) { for ( auto it : m_formationCombinationToCategory ) { if ( it.second == category ) { return it.first; } } return std::make_pair( -1, -1 ); } void setFormationCombinationToCategorymap( const std::map<std::pair<int, int>, int>& mapping ) { m_formationCombinationToCategory = mapping; } private: std::map<std::pair<int, int>, int> m_formationCombinationToCategory; };
/* SoftTH, Software multihead solution for Direct3D Copyright (C) 2005-2012 Keijo Ruotsalainen, www.kegetys.fi This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _SHCOPY_FILE_H_ #define _SHCOPY_FILE_H_ #include <d3d9.h> #define SHCOPY_DITHER "DITHER" class shCopy { public: shCopy(IDirect3DDevice9 *device, char *shaderSrc); ~shCopy(); bool surfCopyShader(IDirect3DTexture9 *src, IDirect3DSurface9 *dst); bool surfCopyShader(IDirect3DTexture9 *src, IDirect3DTexture9 *dst); private: bool createTextureFromRawData(void *src, int width, int height, int bpp, D3DFORMAT fmt, IDirect3DTexture9 **tex); bool isDither; IDirect3DDevice9 *dev; LPDIRECT3DPIXELSHADER9 pshader; IDirect3DStateBlock9 *defaultState; IDirect3DStateBlock9 *sblock; IDirect3DTexture9 *texDither, *texDitherRamp; }; #endif