text
stringlengths
4
6.14k
/******************************************************************************* * This file is part of OpenWSN, the Open Wireless Sensor Network Platform. * * Copyright (C) 2005-2010 zhangwei(TongJi University) * * OpenWSN is a free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 or (at your option) any later version. * * OpenWSN 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. * * For non-opensource or commercial applications, please choose commercial license. * Refer to OpenWSN site http://code.google.com/p/openwsn/ for more detail. * * For other questions, you can contact the author through email openwsn#gmail.com * or the mailing address: Dr. Wei Zhang, Dept. of Control, Dianxin Hall, TongJi * University, 4800 Caoan Road, Shanghai, China. Zip: 201804 * ******************************************************************************/ #ifndef _HAL_SYSTICKER_H_3214_ #define _HAL_SYSTICKER_H_3214_ #include "hal_configall.h" #include "hal_foundation.h" #include "../rtl/rtl_time.h" /******************************************************************************* * hal_systicker * TiSysTimer is used by and should used by the osx kernel only. It drives the osx * kernel to run. Besides the TiSysTimer, the osx kernel can also be drived by * a infinite loop. * * @author zhangwei in 2006.10 * @modified by zhangwei on 2009.05.20 * - revision * * @modified by openwsn in 2010.11 * - upgraded the former module hal_systimer as hal_systicker. Now it's the ticker * component to generate pulse to drive the osx kernel to run. ******************************************************************************/ /* #ifdef CONFIG_TARGETBOARD_GAINZ #define tm_value_t uintx #else #define tm_value_t uintx #endif */ #ifdef __cplusplus extern "C" { #endif /******************************************************************************* * Q: what is TiSysTimer used for? * R: support Embedded OS or hardware drived schedulers * * Q: why not using a TiTimerAdapter instead of a new TiSysTimer * R: the TiSysTimer is usually much simpler than TiTimeAdapter. it doesn't need * multi-channel and capture support. a simple TiSysTimer will make the upper layer * embedded os more easier to port to other platforms. * * Q: what's Tick? * R: Tick is an time unit. The system timer generates an expire event every tick * ******************************************************************************/ // this implements the TiBasicTimerInterface which is used to drive the OS and // some simple timer requirements. #define tm_value_t uint16 typedef struct{ uint8 state; //uint8 prescale_selector; //uint16 prescale; TiSystemTime time;//todo Ŀǰµ¥Î»Ó¦¸ÃÊÇms tm_value_t interval; uint16 reginterval; TiFunEventHandler listener; void * lisowner; //uint16 TCCR; uint8 TCCR;//todo uint16 OCR3; }TiSysTimer; // will be upgraded to TiTickerAdapter TiSysTimer * systm_construct( char * buf, uint8 size ); void systm_destroy( TiSysTimer * timer ); TiSysTimer * systm_open( TiSysTimer * timer, tm_value_t interval, TiFunEventHandler listener, void * lisowner ); void systm_close( TiSysTimer * timer ); void systm_start( TiSysTimer * timer ); void systm_stop( TiSysTimer * timer ); bool systm_expired( TiSysTimer * timer ); // TiBasicTimerInterface * ticker_basicinterface( TiTimerAdapter * timer, TiBasicTimerInterface * intf ); #ifdef __cplusplus } #endif #endif /* _HAL_SYSTICKER_H_3214_ */
/***************************************************************************** * Copyright 2008 - 2009 Broadcom Corporation. All rights reserved. * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2, available at * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a * license other than the GPL, without Broadcom's express prior written * consent. *****************************************************************************/ #if CONFIG_BCM_POWER_MANAGER // Power Management custom platform implementation /* ---- Include Files ---------------------------------------------------- */ #include <linux/types.h> #include <linux/delay.h> #include <linux/broadcom/pm_platforms.h> #include <linux/broadcom/pmu_chip.h> #include <linux/broadcom/pmu_bcm59040.h> /* ---- Private Function Prototypes -------------------------------------- */ /* ---- Platform Definition Table ---------------------------------------- */ static PM_Platform __initdata bcm94760_platform = { name: "BCM94760", pmu_chip: PMU_BCM59040, battery_voltage_adc_channel: 3, battery_temperature_adc_channel: 2, battery_early_shutoff: 0, battery_charging_only: 1, battery_temp_high_limit:178, battery_temp_low_limit:31, detect: NULL, extra_init: NULL, components: { // Terminator [0] = { id: PM_NUM_COMPONENTS } }, regulators: { // Terminator [0] = { id: -1 } }, batteryleveltable: { { adc_output: 0xb0, voltage: 3500, }, { adc_output: 0xb6, voltage: 3600, }, { adc_output: 0xbc, voltage: 3720, }, { adc_output: 0xc3, voltage: 3800, }, { adc_output: 0xc9, voltage: 3950, }, }, }; static int __init register_bcm94760_platform( void ) { pm_register_platform( &bcm94760_platform ); return 0; } subsys_initcall( register_bcm94760_platform ); #endif
/*-- Baum --*/ #strict 2 #include TREE func CanHouseZapNest() { return true; } func CreateZapNestVertex() { return AddVertex(-8+Random(16),13); } func TreeType() { return "deciduous"; }
/* * IEEE754 floating point * double precision internal header file */ /* * MIPS floating point support * Copyright (C) 1994-2000 Algorithmics Ltd. * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope 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 "ieee754int.h" #define assert(expr) ((void)0) /* 3bit extended double precision sticky right shift */ #define XDPSRS(v,rs) \ ((rs > (DP_MBITS+3))?1:((v) >> (rs)) | ((v) << (64-(rs)) != 0)) #define XDPSRSX1() \ (xe++, (xm = (xm >> 1) | (xm & 1))) #define XDPSRS1(v) \ (((v) >> 1) | ((v) & 1)) /* convert denormal to normalized with extended exponent */ #define DPDNORMx(m,e) \ while( (m >> DP_MBITS) == 0) { m <<= 1; e--; } #define DPDNORMX DPDNORMx(xm, xe) #define DPDNORMY DPDNORMx(ym, ye) static inline ieee754dp builddp(int s, int bx, u64 m) { ieee754dp r; assert((s) == 0 || (s) == 1); assert((bx) >= DP_EMIN - 1 + DP_EBIAS && (bx) <= DP_EMAX + 1 + DP_EBIAS); assert(((m) >> DP_MBITS) == 0); r.parts.sign = s; r.parts.bexp = bx; r.parts.mant = m; return r; } extern int ieee754dp_isnan(ieee754dp); extern int ieee754dp_issnan(ieee754dp); extern int ieee754si_xcpt(int, const char *, ...); extern s64 ieee754di_xcpt(s64, const char *, ...); extern ieee754dp ieee754dp_xcpt(ieee754dp, const char *, ...); extern ieee754dp ieee754dp_nanxcpt(ieee754dp, const char *, ...); extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp); extern ieee754dp ieee754dp_format(int, int, u64); #define DPNORMRET2(s, e, m, name, a0, a1) \ { \ ieee754dp V = ieee754dp_format(s, e, m); \ if(TSTX()) \ return ieee754dp_xcpt(V, name, a0, a1); \ else \ return V; \ } #define DPNORMRET3(s, e, m, name, a0, a1, a2) \ { \ ieee754dp V = ieee754dp_format(s, e, m); \ if(TSTX()) \ return ieee754dp_xcpt(V, name, a0, a1, a2); \ else \ return V; \ } #define DPNORMRET1(s, e, m, name, a0) DPNORMRET2(s, e, m, name, a0, a0)
/* Copyright 1999-2003 Red Hat, Inc. * * This software may be freely redistributed under the terms of the GNU * public license. * * 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 _KUDZU_PARALLEL_H_ #define _KUDZU_PARALLEL_H_ #include "device.h" struct parallelDevice { /* common fields */ struct device *next; /* next device in list */ int index; enum deviceClass type; /* type */ enum deviceBus bus; /* bus it's attached to */ char * device; /* device file associated with it */ char * driver; /* driver to load, if any */ char * desc; /* a description */ int detached; void * classprivate; /* parallel-specific fields */ struct parallelDevice *(*newDevice) (struct parallelDevice *dev); void (*freeDevice) (struct parallelDevice *dev); void (*writeDevice) (FILE *file, struct parallelDevice *dev); int (*compareDevice) (struct parallelDevice *dev1, struct parallelDevice *dev2); /* These are more printer-specific than parallel specific. */ /* However, we can't autoprobe other printers well, so here it stays. */ char *pnpmodel; char *pnpmfr; char *pnpmodes; char *pnpdesc; }; struct parallelDevice *parallelNewDevice(struct parallelDevice *dev); struct device *parallelProbe(enum deviceClass probeClass, int probeFlags, struct device *devlist); #endif
/** ****************************************************************************** * @file USB_Host/HID_RTOS/Inc/lcd_log_conf.h * @author MCD Application Team * @version V1.0.1 * @date 09-October-2015 * @brief LCD Log configuration file. ****************************************************************************** * @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 __LCD_LOG_CONF_H #define __LCD_LOG_CONF_H /* Includes ------------------------------------------------------------------*/ #include "stm32469i_discovery_lcd.h" #include "stm32469i_discovery.h" #include <stdio.h> /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Define the LCD default text color */ #define LCD_LOG_DEFAULT_COLOR LCD_COLOR_WHITE /* Comment the line below to disable the scroll back and forward features */ #define LCD_SCROLL_ENABLED 1 #define LCD_LOG_USE_OS 1 #define LCD_LOG_HEADER_FONT Font16 #define LCD_LOG_FOOTER_FONT Font16 #define LCD_LOG_TEXT_FONT Font16 /* Define the LCD LOG Color */ #define LCD_LOG_BACKGROUND_COLOR LCD_COLOR_BLACK #define LCD_LOG_TEXT_COLOR LCD_COLOR_WHITE #define LCD_LOG_SOLID_BACKGROUND_COLOR LCD_COLOR_BLUE #define LCD_LOG_SOLID_TEXT_COLOR LCD_COLOR_WHITE /* Define the cache depth */ #define CACHE_SIZE 100 #define YWINDOW_SIZE 10 #if (YWINDOW_SIZE > 14) #error "Wrong YWINDOW SIZE" #endif /* Redirect the printf to the LCD */ #ifdef __GNUC__ /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */ #define LCD_LOG_PUTCHAR int __io_putchar(int ch) #else #define LCD_LOG_PUTCHAR int fputc(int ch, FILE *f) #endif /* __GNUC__ */ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #endif /* __LCD_LOG_CONF_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * servsock.h - simple wrapper to QServerSocket * Copyright (C) 2003 Justin Karneges * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef CS_SERVSOCK_H #define CS_SERVSOCK_H #include <QTcpServer> // CS_NAMESPACE_BEGIN class ServSock : public QObject { Q_OBJECT public: ServSock(QObject *parent=0); ~ServSock(); bool isActive() const; bool listen(quint16 port); void stop(); int port() const; QHostAddress address() const; signals: void connectionReady(int); private slots: void sss_connectionReady(int); private: class Private; Private *d; }; class ServSockSignal : public QTcpServer { Q_OBJECT public: ServSockSignal(QObject *parent = 0); signals: void connectionReady(int); protected: // reimplemented void incomingConnection(int socketDescriptor); }; // CS_NAMESPACE_END #endif
/* * linux/include/asm-arm/arch-omap/dmtimer.h * * OMAP Dual-Mode Timers * * Copyright (C) 2005 Nokia Corporation * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> * PWM and clock framwork support by Timo Teras. * * 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 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 * 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. */ #ifndef __ASM_ARCH_DMTIMER_H #define __ASM_ARCH_DMTIMER_H /* clock sources */ #define OMAP_TIMER_SRC_SYS_CLK 0x00 #define OMAP_TIMER_SRC_32_KHZ 0x01 #define OMAP_TIMER_SRC_EXT_CLK 0x02 /* timer interrupt enable bits */ #define OMAP_TIMER_INT_CAPTURE (1 << 2) #define OMAP_TIMER_INT_OVERFLOW (1 << 1) #define OMAP_TIMER_INT_MATCH (1 << 0) /* trigger types */ #define OMAP_TIMER_TRIGGER_NONE 0x00 #define OMAP_TIMER_TRIGGER_OVERFLOW 0x01 #define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02 struct omap_dm_timer; struct clk; int omap_dm_timer_init(void); u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg); void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg, u32 value); struct omap_dm_timer *omap_dm_timer_request(void); struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); void __iomem *omap_dm_timer_iobase(struct omap_dm_timer *timer); void omap_dm_timer_free(struct omap_dm_timer *timer); void omap_dm_timer_enable(struct omap_dm_timer *timer); void omap_dm_timer_disable(struct omap_dm_timer *timer); int omap_dm_timer_get_irq(struct omap_dm_timer *timer); u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer); void omap_dm_timer_trigger(struct omap_dm_timer *timer); void omap_dm_timer_start(struct omap_dm_timer *timer); void omap_dm_timer_stop(struct omap_dm_timer *timer); void omap_dm_timer_post_start(struct omap_dm_timer *timer); void omap_dm_timer_post_stop(struct omap_dm_timer *timer); void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value); void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value); void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match); void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger); void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler); void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value); unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer); void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value); unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value); int omap_dm_timers_active(void); #endif /* __ASM_ARCH_DMTIMER_H */
#if defined(SYS_WINDOWS) # include <windows.h> # if !defined(__ITaskbarList3_FWD_DEFINED__) # define __ITaskbarList3_FWD_DEFINED__ typedef interface ITaskbarList3 ITaskbarList3; # endif // __ITaskbarList3_FWD_DEFINED__ # if !defined(__ITaskbarList3_INTERFACE_DEFINED__) # define __ITaskbarList3_INTERFACE_DEFINED__ #ifndef GUID_SECT #if defined (__GNUC__) && (__GNUC__ <= 2 && __GNUC_MINOR__ < 95) #define GUID_SECT __attribute__ ((section (GUID_SECTION))) #else #define GUID_SECT #endif #endif #ifndef GUID_EXT #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus)) #define GUID_EXT EXTERN_C #else #define GUID_EXT #endif #endif GUID_EXT const GUID MTX_CLSID_TaskbarList; static const GUID IID_ITaskbarList3 = { 0xea1afb91, 0x9e28, 0x4b86, { 0x90, 0xE9, 0x9e, 0x9f, 0x8a, 0x5e, 0xef, 0xaf } }; enum TBPFLAG { TBPF_NOPROGRESS = 0x00, TBPF_INDETERMINATE = 0x01, TBPF_NORMAL = 0x02, TBPF_ERROR = 0x04, TBPF_PAUSED = 0x08 }; struct ITaskbarList3Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )(ITaskbarList3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )(ITaskbarList3 * This); ULONG ( STDMETHODCALLTYPE *Release )(ITaskbarList3 * This); HRESULT ( STDMETHODCALLTYPE *HrInit )(ITaskbarList3 * This); HRESULT ( STDMETHODCALLTYPE *AddTab )(ITaskbarList3 * This, /* [in] */ HWND hwnd); HRESULT ( STDMETHODCALLTYPE *DeleteTab )(ITaskbarList3 * This, /* [in] */ HWND hwnd); HRESULT ( STDMETHODCALLTYPE *ActivateTab )(ITaskbarList3 * This, /* [in] */ HWND hwnd); HRESULT ( STDMETHODCALLTYPE *SetActiveAlt )(ITaskbarList3 * This, /* [in] */ HWND hwnd); HRESULT ( STDMETHODCALLTYPE *MarkFullscreenWindow )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ BOOL fFullscreen); HRESULT ( STDMETHODCALLTYPE *SetProgressValue )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ ULONGLONG ullCompleted, /* [in] */ ULONGLONG ullTotal); HRESULT ( STDMETHODCALLTYPE *SetProgressState )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ TBPFLAG tbpFlags); HRESULT ( STDMETHODCALLTYPE *RegisterTab )(ITaskbarList3 * This, /* [in] */ HWND hwndTab, /* [in] */ HWND hwndMDI); HRESULT ( STDMETHODCALLTYPE *UnregisterTab )(ITaskbarList3 * This, /* [in] */ HWND hwndTab); HRESULT ( STDMETHODCALLTYPE *SetTabOrder )(ITaskbarList3 * This, /* [in] */ HWND hwndTab, /* [in] */ HWND hwndInsertBefore); HRESULT ( STDMETHODCALLTYPE *SetTabActive )(ITaskbarList3 * This, /* [in] */ HWND hwndTab, /* [in] */ HWND hwndMDI, /* [in] */ DWORD dwReserved); HRESULT ( STDMETHODCALLTYPE *ThumbBarAddButtons )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ UINT cButtons, /* [size_is][in] */ /* LPTHUMBBUTTON */ void * pButton); HRESULT ( STDMETHODCALLTYPE *ThumbBarUpdateButtons )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ UINT cButtons, /* [size_is][in] */ /* LPTHUMBBUTTON */ void * pButton); HRESULT ( STDMETHODCALLTYPE *ThumbBarSetImageList )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ /* HIMAGELIST */ void * himl); HRESULT ( STDMETHODCALLTYPE *SetOverlayIcon )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ HICON hIcon, /* [string][unique][in] */ LPCWSTR pszDescription); HRESULT ( STDMETHODCALLTYPE *SetThumbnailTooltip )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [string][unique][in] */ LPCWSTR pszTip); HRESULT ( STDMETHODCALLTYPE *SetThumbnailClip )(ITaskbarList3 * This, /* [in] */ HWND hwnd, /* [in] */ RECT *prcClip); END_INTERFACE }; interface ITaskbarList3 { const struct ITaskbarList3Vtbl *lpVtbl; }; #endif // __ITaskbarList3_INTERFACE_DEFINED__ #endif // SYS_WINDOWS
/* * drivers/switch/switch_gpio.c * * Copyright (C) 2008 Google, Inc. * Author: Mike Lockwood <lockwood@android.com> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/switch.h> #include <linux/workqueue.h> #include <linux/gpio.h> struct hall_switch_data { struct switch_dev sdev; unsigned gpio; const char *name_on; const char *name_off; const char *state_on; const char *state_off; int irq; struct work_struct work; }; static void hall_switch_work(struct work_struct *work) { int state; struct hall_switch_data *data = container_of(work, struct hall_switch_data, work); state = gpio_get_value(data->gpio); printk("hall_switch_work() %d\n", state); switch_set_state(&data->sdev, state); } static irqreturn_t hall_irq_handler(int irq, void *dev_id) { struct hall_switch_data *switch_data = (struct hall_switch_data *)dev_id; schedule_work(&switch_data->work); return IRQ_HANDLED; } static ssize_t switch_hall_print_state(struct switch_dev *sdev, char *buf) { struct hall_switch_data *switch_data = container_of(sdev, struct hall_switch_data, sdev); const char *state; if (switch_get_state(sdev)) state = switch_data->state_on; else state = switch_data->state_off; if (state) return sprintf(buf, "%s\n", state); return -1; } static int hall_switch_probe(struct platform_device *pdev) { //struct gpio_switch_platform_data *pdata = pdev->dev.platform_data; struct hall_switch_data *switch_data; int ret = 0; //if (!pdata) // return -EBUSY; switch_data = kzalloc(sizeof(struct hall_switch_data), GFP_KERNEL); if (!switch_data) return -ENOMEM; switch_data->sdev.name = "hall"; switch_data->gpio = 69;//pdata->gpio; //switch_data->name_on = pdata->name_on; //switch_data->name_off = pdata->name_off; //switch_data->state_on = pdata->state_on; //switch_data->state_off = pdata->state_off; switch_data->sdev.print_state = switch_hall_print_state; ret = switch_dev_register(&switch_data->sdev); if (ret < 0) goto err_switch_dev_register; ret = gpio_request(switch_data->gpio, switch_data->sdev.name); if (ret < 0) goto err_request_gpio; ret = gpio_direction_input(switch_data->gpio); if (ret < 0) goto err_set_gpio_input; INIT_WORK(&switch_data->work, hall_switch_work); switch_data->irq = gpio_to_irq(switch_data->gpio); if (switch_data->irq < 0) { ret = switch_data->irq; goto err_detect_irq_num_failed; } ret = request_irq(switch_data->irq, hall_irq_handler, IRQF_TRIGGER_MASK, switch_data->sdev.name, switch_data); if (ret < 0) goto err_request_irq; enable_irq_wake(switch_data->irq); /* Perform initial detection */ hall_switch_work(&switch_data->work); return 0; err_request_irq: err_detect_irq_num_failed: err_set_gpio_input: gpio_free(switch_data->gpio); err_request_gpio: switch_dev_unregister(&switch_data->sdev); err_switch_dev_register: kfree(switch_data); return ret; } static int __devexit hall_switch_remove(struct platform_device *pdev) { struct hall_switch_data *switch_data = platform_get_drvdata(pdev); cancel_work_sync(&switch_data->work); gpio_free(switch_data->gpio); switch_dev_unregister(&switch_data->sdev); kfree(switch_data); return 0; } #ifdef CONFIG_OF static struct of_device_id hall_match_table[] = { { .compatible = "qcom,hall",}, { }, }; #else #define hall_match_table NULL #endif MODULE_DEVICE_TABLE(of, hall_match_table); static struct platform_driver hall_switch_driver = { .probe = hall_switch_probe, .remove = __devexit_p(hall_switch_remove), .driver = { .name = "hall", .owner = THIS_MODULE, .of_match_table = hall_match_table, }, }; static int __init hall_switch_init(void) { return platform_driver_register(&hall_switch_driver); } static void __exit hall_switch_exit(void) { platform_driver_unregister(&hall_switch_driver); } module_init(hall_switch_init); module_exit(hall_switch_exit); MODULE_AUTHOR("Lenovo"); MODULE_DESCRIPTION("CAP Sensor driver"); MODULE_LICENSE("GPL");
/* * $Id: poke.c 9686 2012-09-16 08:14:35Z andijahja $ */ /* * File......: POKE.C * Author....: Ted Means * CIS ID....: 73067,3332 * * This is an original work by Ted Means and is placed in the * public domain. * * Modification history: * --------------------- * * Rev 1.3 07 Feb 1994 20:13:22 GLENN * Ted re-wrote to make it CPMI compliant. * * Rev 1.2 15 Aug 1991 23:08:20 GLENN * Forest Belt proofread/edited/cleaned up doc * * Rev 1.1 14 Jun 1991 19:53:48 GLENN * Minor edit to file header * * Rev 1.0 01 Apr 1991 01:02:54 GLENN * Nanforum Toolkit * * */ /* $DOC$ * $FUNCNAME$ * FT_POKE() * $CATEGORY$ * DOS/BIOS * $ONELINER$ * Write a byte to a specified memory location * $SYNTAX$ * FT_POKE( <nSegment>, <nOffset>, <nValue> ) -> lResult * $ARGUMENTS$ * <nSegment> is the segment of the desired memory address. * * <nOffset> is the offset of the desired memory address. * * <nValue> is the value to write to the desired memory address. * $RETURNS$ * <lResult> will be .T. if all parameters were valid and the function was * able to write the desired byte. * <lResult> will be .F. if invalid parameters were passed. * $DESCRIPTION$ * Use this function if you have a need to change the value at a specific * memory location. The function will write the specified byte to the * specified address. The value must be passed as a numeric; if the byte * you wish to use is stored as a character, use the Asc() function * to convert it. * * This function was written for version 5.1 of MicroSoft C. You may * have to modify the source code to use another compiler. * $EXAMPLES$ * FT_POKE( 0, 1047, 64) // Turn CapsLock on * $END$ */ #include <extend.api> #include <cpmi.h> #define FP_SEG( fp ) ( *( ( unsigned int * ) &( fp ) + 1 ) ) #define FP_OFF( fp ) ( *( ( unsigned int * ) &( fp ) ) ) HB_FUNC( FT_POKE ) { auto unsigned int ProtMode = hb_cpmiIsProtected(); auto unsigned char * bytePtr; if( ( PCOUNT >= 3 ) && ( ISNUM( 1 ) ) && ( ISNUM( 2 ) ) && ( ISNUM( 3 ) ) ) { FP_SEG( bytePtr ) = _parni( 1 ); FP_OFF( bytePtr ) = _parni( 2 ); if( ProtMode ) { FP_SEG( bytePtr ) = hb_cpmiProtectedPtr( bytePtr, 1 ); FP_OFF( bytePtr ) = 0; if( FP_SEG( bytePtr ) == 0 ) goto Bogus; } *bytePtr = ( unsigned char ) _parni( 3 ); if( ProtMode ) hb_cpmiFreeSelector( FP_SEG( bytePtr ) ); _retl( TRUE ); } else Bogus: _retl( FALSE ); return; }
#include "seatest.h" #include <ctype.h> /* isdigit() */ #include "../../src/utils/macros.h" static int less_than_5(int x) { return x < 5; } void test_all_all_are_true(void) { assert_int_equal(1, ALL(less_than_5, 1, -2, 3)); assert_int_equal(1, ALL(isdigit, '1', '9')); } void test_all_all_are_false(void) { assert_int_equal(0, ALL(less_than_5, 10, 20, 30)); } void test_all_one_is_true(void) { assert_int_equal(0, ALL(less_than_5, 10, 0, 30)); assert_int_equal(0, ALL(isdigit, 'z', '9')); } void test_none_all_are_true(void) { assert_int_equal(0, NONE(less_than_5, 1, -2, 3)); assert_int_equal(0, NONE(isdigit, '1', '9')); } void test_none_all_are_false(void) { assert_int_equal(1, NONE(less_than_5, 10, 20, 30)); assert_int_equal(1, NONE(isdigit, 'z', 'a')); } void test_none_one_is_true(void) { assert_int_equal(0, NONE(less_than_5, 10, 0, 30)); } void test_any_all_are_true(void) { assert_int_equal(1, ANY(less_than_5, 1, -2, 3)); } void test_any_all_are_false(void) { assert_int_equal(0, ANY(less_than_5, 10, 20, 30)); assert_int_equal(0, ANY(isdigit, 'z', 'a')); } void test_any_one_is_true(void) { assert_int_equal(1, ANY(less_than_5, 10, 0, 30)); assert_int_equal(1, ANY(isdigit, 'z', '9')); } void functional_tests(void) { test_fixture_start(); run_test(test_all_all_are_true); run_test(test_all_all_are_false); run_test(test_all_one_is_true); run_test(test_none_all_are_true); run_test(test_none_all_are_false); run_test(test_none_one_is_true); run_test(test_any_all_are_true); run_test(test_any_all_are_false); run_test(test_any_one_is_true); test_fixture_end(); } /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set cinoptions+=t0 : */
/* Launchy: Application Launcher Copyright (C) 2007-2010 Josh Karlin, Simon Capewell 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 LAUNCHYWIDGET_H #define LAUNCHYWIDGET_H #include <QSystemTrayIcon> #include "plugin_handler.h" #include "platform_util.h" #include "common/catalog.h" #include "catalog_builder.h" #include "icon_delegate.h" #include "icon_extractor.h" #include "common/globals.h" #include "InputDataList.h" #include "CommandHistory.h" #include "CharLineEdit.h" #include "LineEditMenu.h" #include "CharListWidget.h" #include "AnimationLabel.h" #include "Fader.h" class QPushButton; // class QNetworkRequest; enum CommandFlag { None = 0, ShowView = 1, ShowOptions = 2, ResetPosition = 4, ResetSkin = 8, Rescan = 16, Exit = 32 }; Q_DECLARE_FLAGS(CommandFlags, CommandFlag) Q_DECLARE_OPERATORS_FOR_FLAGS(CommandFlags) class LaunchyWidget : public QWidget { Q_OBJECT // Enable signals and slots public: LaunchyWidget(CommandFlags command); ~LaunchyWidget(); void executeStartupCommand(int command); Catalog* catalog; PluginHandler plugins; void showLaunchy(bool noFade); void showTrayIcon(); void setSuggestionListMode(int mode); bool setHotkey(QKeySequence); bool setAlwaysShow(bool); bool setAlwaysTop(bool); void setSkin(const QString& name); void loadOptions(); int getHotkey() const; void startUpdateTimer(); protected: void paintEvent(QPaintEvent* event); public slots: void focusInEvent(QFocusEvent* event); void focusOutEvent(QFocusEvent* event); void mousePressEvent(QMouseEvent* event); void mouseMoveEvent(QMouseEvent* event); void mouseReleaseEvent(QMouseEvent* event); void contextMenuEvent(QContextMenuEvent* event); void showOptionsDialog(); void onHotkey(); void dropTimeout(); void setOpaqueness(int level); void httpGetFinished(bool result); void catalogProgressUpdated(int); void catalogBuilt(); void buildCatalog(); void inputMethodEvent(QInputMethodEvent* event); void keyPressEvent(QKeyEvent* event); void inputKeyPressEvent(QKeyEvent* event); void alternativesRowChanged(int index); void alternativesKeyPressEvent(QKeyEvent* event); void setFadeLevel(double level); void showLaunchy(); void iconExtracted(int index, QString path, QIcon icon); void trayIconActivated(QSystemTrayIcon::ActivationReason reason); void reloadSkin(); protected: void saveSettings(); private: void createActions(); void applySkin(const QString& name); void closeEvent(QCloseEvent* event); void hideLaunchy(bool noFade = false); void updateVersion(int oldVersion); void checkForUpdate(); void shouldDonate(); void updateAlternatives(bool resetSelection = true); void showAlternatives(); void hideAlternatives(); void parseInput(const QString& text); void updateOutputWidgets(bool resetAlternativesSelection = true); void searchOnInput(); void loadPosition(QPoint pt); void savePosition(); void doTab(); void doBackTab(); void doEnter(); void processKey(); void launchItem(CatItem& item); void addToHistory(QList<InputData>& item); void startDropTimer(); QString currentSkin; Fader* fader; QPixmap* frameGraphic; QSystemTrayIcon* trayIcon; CharLineEdit* input; QLabel* output; QLabel* outputIcon; CharListWidget* alternatives; QRect alternativesRect; QPushButton* optionsButton; QPushButton* closeButton; QScrollBar* altScroll; QLabel* alternativesPath; AnimationLabel* workingAnimation; QAction* actShow; QAction* actRebuild; QAction* actReloadSkin; QAction* actOptions; QAction* actExit; QTimer* updateTimer; QTimer* dropTimer; QThread builderThread; IconExtractor iconExtractor; QIcon* condensedTempIcon; CatItem outputItem; QList<CatItem> searchResults; InputDataList inputData; CommandHistory history; bool alwaysShowLaunchy; bool dragging; QPoint dragStartPoint; bool menuOpen; bool optionsOpen; IconDelegate* listDelegate; QAbstractItemDelegate* defaultListDelegate; // QNetworkRequest *http; QBuffer *verBuffer; QBuffer *counterBuffer; }; #endif
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netinet/in.h> #include <libnetfilter_log/libnetfilter_log.h> static int print_pkt(struct nflog_data *ldata) { struct nfulnl_msg_packet_hdr *ph = nflog_get_msg_packet_hdr(ldata); uint32_t mark = nflog_get_nfmark(ldata); uint32_t indev = nflog_get_indev(ldata); uint32_t outdev = nflog_get_outdev(ldata); char *prefix = nflog_get_prefix(ldata); char *payload; int payload_len = nflog_get_payload(ldata, &payload); if (ph) { printf("hw_protocol=0x%04x hook=%u ", ntohs(ph->hw_protocol), ph->hook); } printf("mark=%u ", mark); if (indev > 0) printf("indev=%u ", indev); if (outdev > 0) printf("outdev=%u ", outdev); if (prefix) { printf("prefix=\"%s\" ", prefix); } if (payload_len >= 0) printf("payload_len=%d ", payload_len); fputc('\n', stdout); return 0; } static int cb(struct nflog_g_handle *gh, struct nfgenmsg *nfmsg, struct nflog_data *nfa, void *data) { print_pkt(nfa); return 0; } int main(int argc, char **argv) { struct nflog_handle *h; struct nflog_g_handle *qh; struct nflog_g_handle *qh100; int rv, fd; char buf[4096]; h = nflog_open(); if (!h) { fprintf(stderr, "error during nflog_open()\n"); exit(1); } printf("unbinding existing nf_log handler for AF_INET (if any)\n"); if (nflog_unbind_pf(h, AF_INET) < 0) { fprintf(stderr, "error nflog_unbind_pf()\n"); exit(1); } printf("binding nfnetlink_log to AF_INET\n"); if (nflog_bind_pf(h, AF_INET) < 0) { fprintf(stderr, "error during nflog_bind_pf()\n"); exit(1); } printf("binding this socket to group 0\n"); qh = nflog_bind_group(h, 0); if (!qh) { fprintf(stderr, "no handle for grup 0\n"); exit(1); } printf("binding this socket to group 100\n"); qh100 = nflog_bind_group(h, 100); if (!qh100) { fprintf(stderr, "no handle for group 100\n"); exit(1); } printf("setting copy_packet mode\n"); if (nflog_set_mode(qh, NFULNL_COPY_PACKET, 0xffff) < 0) { fprintf(stderr, "can't set packet copy mode\n"); exit(1); } fd = nflog_fd(h); printf("registering callback for group 0\n"); nflog_callback_register(qh, &cb, NULL); printf("going into main loop\n"); while ((rv = recv(fd, buf, sizeof(buf), 0)) && rv >= 0) { printf("pkt received (len=%u)\n", rv); /* handle messages in just-received packet */ nflog_handle_packet(h, buf, rv); } printf("unbinding from group 100\n"); nflog_unbind_group(qh100); printf("unbinding from group 0\n"); nflog_unbind_group(qh); #ifdef INSANE /* norally, applications SHOULD NOT issue this command, * since it detaches other programs/sockets from AF_INET, too ! */ printf("unbinding from AF_INET\n"); nflog_unbind_pf(h, AF_INET); #endif printf("closing handle\n"); nflog_close(h); return EXIT_SUCCESS; }
#ifndef _PASSIVESOCK_H #define _PASSIVESOCK_H #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <netdb.h> #define PASSIVE_ERROR -1 int passivesock(const char * ipNumner,const char *service, const char *transport, int qlen); int passiveTCP(const char * ipNumner,const char *service, int qlen); int passiveUDP(const char * ipNumner,const char *service); #endif
/* Integrity checks for ekg2 API * (c) 2011 Michał Górny */ #include "ekg2.h" #include <stdio.h> void add_recode_tests(void); PLUGIN_DEFINE(check, PLUGIN_UI, NULL); static void simple_errprint(const gchar *out) { fputs(out, stderr); } EXPORT int check_plugin_init(int prio) { int argc = 0; char **argv = { NULL }; g_set_print_handler(simple_errprint); g_set_printerr_handler(simple_errprint); g_log_set_default_handler(g_log_default_handler, NULL); g_test_init(&argc, &argv, NULL); add_recode_tests(); g_test_run(); ekg_exit(); g_assert_not_reached(); } static int check_plugin_destroy(void) { return 0; }
#include "cpuminer-config.h" #include "miner.h" #include <memory.h> #include "ramhog.h" #include "pbkdf2.c" typedef struct { uint64_t s[64]; uint8_t p; uint64_t last; } xorshift_ctx; static inline uint64_t xorshift_next(xorshift_ctx *pctx) { uint64_t s0 = pctx->s[ pctx->p ]; uint64_t s1 = pctx->s[ pctx->p = ( pctx->p + 1 ) & 63 ]; s1 ^= s1 << 25; // a s1 ^= s1 >> 3; // b s0 ^= s0 >> 49; // c pctx->s[ pctx->p ] = s0 ^ s1; return ( pctx->s[ pctx->p ] = s0 ^ s1 ) * 8372773778140471301LL; } static void xorshift_pbkdf2_seed(xorshift_ctx *ctx, const uint8_t *seed, size_t seedlen, const uint8_t *salt, size_t saltlen) { uint64_t fullSeed[65]; PBKDF2_SHA256(seed, seedlen, salt, saltlen, 128, (uint8_t *)fullSeed, sizeof(uint64_t)*65); memcpy(ctx->s, &fullSeed[0], sizeof(uint64_t)*64); ctx->p = (uint8_t)(fullSeed[16] & 63); } int ramhog_gen_pad(uint8_t thr_id, const uint8_t *input, size_t input_size, uint32_t C, uint32_t padIndex, uint64_t *padOut) { xorshift_ctx ctx; uint32_t chunk; xorshift_pbkdf2_seed(&ctx, input, input_size, (uint8_t *)&padIndex, 4); padOut[0] = xorshift_next(&ctx); padOut[1] = xorshift_next(&ctx); for (chunk=2; chunk < C; chunk++) { if(work_restart[thr_id].restart == 1) return 1; padOut[chunk] = xorshift_next(&ctx); if (!(padOut[chunk] & 511)) padOut[chunk] ^= padOut[xorshift_next(&ctx) % (chunk/2) + chunk/2]; } return 0; } int ramhog_run_iterations(uint8_t thr_id, const uint8_t *input, size_t input_size, uint8_t *output, size_t output_size, uint32_t N, uint32_t C, uint32_t I, uint64_t **scratchpads) { xorshift_ctx ctx; uint32_t i, padIndex; uint64_t X; uint64_t finalChunks[N * 32]; uint64_t finalSalt[32] = {N, C, I, input_size, output_size}; if(work_restart[thr_id].restart == 1) return 1; for (padIndex=0; padIndex < N; padIndex++) { memcpy(&finalChunks[padIndex * 32], &scratchpads[padIndex][C - 1 - 32], sizeof(uint64_t) * 32); } xorshift_pbkdf2_seed(&ctx, input, input_size, (uint8_t *)&finalChunks[0], sizeof(uint64_t) * N); X = xorshift_next(&ctx); if(work_restart[thr_id].restart == 1) return 1; for (i=0; i < I - (32 - 5); i++) { X = scratchpads[(X & 0xffffffff00000000L) & (N - 1)][(X & 0x00000000ffffffffL) % C] ^ xorshift_next(&ctx); if(work_restart[thr_id].restart == 1) return 1; } for (i=5; i < 32; i++) { X = scratchpads[(X & 0xffffffff00000000L) & (N - 1)][(X & 0x00000000ffffffffL) % C] ^ xorshift_next(&ctx); finalSalt[i] = X; if(work_restart[thr_id].restart == 1) return 1; } PBKDF2_SHA256(input, input_size, (uint8_t *)finalSalt, sizeof(uint64_t)*32, 1, (uint8_t *)output, output_size); if(work_restart[thr_id].restart == 1) return 1; return 0; }
#ifndef JNLPRINCIPAL_H #define JNLPRINCIPAL_H #include "Windows.h" #include "jnlregistro.h" #include "jnlsobre.h" #include "jnlconfiguracao.h" #include <QMainWindow> #include <QDateTime> #include <QMessageBox> #include <QCheckBox> #include <QRadioButton> #include <QTranslator> #include <QSettings> namespace Ui { class jnlPrincipal; } class jnlPrincipal : public QMainWindow { Q_OBJECT public: explicit jnlPrincipal(QWidget *parent = 0); ~jnlPrincipal(); private: QDateTime dataHora; QMessageBox dlgExcessao; Ui::jnlPrincipal *ui; jnlRegistro* jnlReg = NULL; jnlSobre* jnlSbr = NULL; jnlConfiguracao* jnlConfig = NULL; QCheckBox* cmVariavel = NULL; int destInt = 1; QString idiomaAtual = "pt"; QString camIdioma = NULL; QTranslator tradutor; QTranslator tradutorQt; QSettings* confProg; void copiamatriz(); void lerconf(); protected: handle_t porta; COMMTIMEOUTS tempos; DCB configuracao; DWORD taxaCom = 19200; BYTE tamByte = 8; BYTE paridade = NOPARITY; BYTE bitParada = ONESTOPBIT; unsigned char pacotao[18][30]; unsigned char pacotaoAntigo[18][30]; bool confMsgLida = false; unsigned long tamanho_escrito,tamanho_lido; protected slots: int fecharAplicacao(); void changeEvent(QEvent* evento); private slots: void on_btInCon_clicked(); void mensagem_pronto(); void abre_docWiki(); void on_btEncCon_clicked(); void on_btEnviar_clicked(); void alteraSaida(); void alteraDest(); void enviaAlterado(); void define_saidas(); void lerIdioma(const QString& idioma); void on_cmEnvioAuto_toggled(bool checked); void defineConf(DWORD taxaComC, BYTE tamByteC, BYTE paridadeC, BYTE bitParadaC, QString idioma, bool salva); void on_btEnviaPerson_clicked(); signals: void regErro(int erro); void regErro(QString erro); void mudanca_de_idioma(); void enviaConfig(int taxaComConf, int tamByteConf, int paridadeConf, int stopBitConf); void config_in(QString taxaComConf, QString tamByteConf, int paridadeConf, int stopBitConf, QString idiomaC); }; #endif // JNLPRINCIPAL_H
// Copyright (c) 2013 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), // and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); 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. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL: https://github.com/CGAL/cgal/blob/releases/CGAL-4.14.1/STL_Extension/include/CGAL/result_of.h $ // $Id: result_of.h a472c24 %aI Andreas Fabri // SPDX-License-Identifier: LGPL-3.0+ // // // Author(s) : Sebastien Loriot <sebastien.loriot@cgal.org> #ifndef CGAL_RESULT_OF_H #define CGAL_RESULT_OF_H #include <CGAL/config.h> #include <CGAL/disable_warnings.h> // Address the warning C4003: not enough actual parameters for macro 'BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY' // result_of.hpp includes files from boost/preprocessor // This concerns boost 1_65_1 #if defined(BOOST_MSVC) # pragma warning(push) # pragma warning(disable: 4003) #endif #include <boost/utility/result_of.hpp> #if defined(BOOST_MSVC) # pragma warning(pop) #endif #include <boost/version.hpp> namespace CGAL{ // Even if for now we use the tr1 result_of implementation, we use the cpp11 // namespace since in the future, that's the decltype version that will be used namespace cpp11{ template<typename F> struct result_of { // from boost 1.44 release note https://www.boost.org/users/history/version_1_44_0.html : // New template boost::tr1_result_of that implements the TR1 ResultOf protocol even if boost::result_of uses the C++0x decltype-based implementation. #if BOOST_VERSION < 104400 typedef typename boost::result_of<F>::type type; #else typedef typename boost::tr1_result_of<F>::type type; #endif }; } } #include <CGAL/enable_warnings.h> #endif //CGAL_RESULT_OF_H
/* * Copyright (C) 2008 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ScrollbarThemeGtk_h #define ScrollbarThemeGtk_h #include "ScrollbarThemeComposite.h" #include <wtf/glib/GRefPtr.h> namespace WebCore { class Scrollbar; class ScrollbarThemeGtk final : public ScrollbarThemeComposite { public: virtual ~ScrollbarThemeGtk(); virtual bool hasButtons(Scrollbar&) override { return true; } virtual bool hasThumb(Scrollbar&) override; virtual IntRect backButtonRect(Scrollbar&, ScrollbarPart, bool) override; virtual IntRect forwardButtonRect(Scrollbar&, ScrollbarPart, bool) override; virtual IntRect trackRect(Scrollbar&, bool) override; #ifndef GTK_API_VERSION_2 ScrollbarThemeGtk(); using ScrollbarThemeComposite::thumbRect; IntRect thumbRect(Scrollbar&, const IntRect& unconstrainedTrackRect); virtual bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect) override; virtual void paintScrollbarBackground(GraphicsContext&, Scrollbar&) override; virtual void paintTrackBackground(GraphicsContext&, Scrollbar&, const IntRect&) override; virtual void paintThumb(GraphicsContext&, Scrollbar&, const IntRect&) override; virtual void paintButton(GraphicsContext&, Scrollbar&, const IntRect&, ScrollbarPart) override; virtual ScrollbarButtonPressAction handleMousePressEvent(Scrollbar&, const PlatformMouseEvent&, ScrollbarPart) override; virtual int scrollbarThickness(ScrollbarControlSize) override; virtual int minimumThumbLength(Scrollbar&) override; // TODO: These are the default GTK+ values. At some point we should pull these from the theme itself. virtual double initialAutoscrollTimerDelay() override { return 0.20; } virtual double autoscrollTimerDelay() override { return 0.02; } virtual void themeChanged() override; virtual bool usesOverlayScrollbars() const override { return m_usesOverlayScrollbars; } // When using overlay scrollbars, always invalidate the whole scrollbar when entering/leaving. virtual bool invalidateOnMouseEnterExit() override { return m_usesOverlayScrollbars; } private: void updateThemeProperties(); enum class StyleContextMode { Layout, Paint }; GRefPtr<GtkStyleContext> getOrCreateStyleContext(Scrollbar* = nullptr, StyleContextMode = StyleContextMode::Layout); IntSize buttonSize(Scrollbar&); struct Properties { int thumbFatness; int troughBorderWidth; int stepperSize; int stepperSpacing; gboolean troughUnderSteppers; }; GRefPtr<GtkStyleContext> m_cachedStyleContext; Properties m_cachedProperties; int m_minThumbLength; gboolean m_hasForwardButtonStartPart; gboolean m_hasForwardButtonEndPart; gboolean m_hasBackButtonStartPart; gboolean m_hasBackButtonEndPart; bool m_usesOverlayScrollbars { false }; #endif // GTK_API_VERSION_2 }; } #endif
/* * Copyright (c) 2003-2006 Erez Zadok * Copyright (c) 2003-2006 Charles P. Wright * Copyright (c) 2005-2006 Josef Sipek * Copyright (c) 2005 Arun M. Krishnakumar * Copyright (c) 2005-2006 David P. Quigley * Copyright (c) 2003-2004 Mohammad Nayyer Zubair * Copyright (c) 2003 Puja Gupta * Copyright (c) 2003 Harikesavan Krishnan * Copyright (c) 2003-2006 Stony Brook University * Copyright (c) 2003-2006 The Research Foundation of State University of New York * * For specific licensing information, see the COPYING file distributed with * this package. * * This Copyright notice must be kept intact and distributed with all sources. */ /* * $Id: unionfs_1_1_5.patch,v 1.2 2006/10/16 23:50:22 polk Exp $ */ /* * Copyright (c) 2003-2005 Erez Zadok * Copyright (c) 2003-2005 Charles P. Wright * Copyright (c) 2003-2005 Mohammad Nayyer Zubair * Copyright (c) 2003-2005 Puja Gupta * Copyright (c) 2003-2005 Harikesavan Krishnan * Copyright (c) 2003-2005 Stony Brook University * Copyright (c) 2003-2005 The Research Foundation of State University of New York * * For specific licensing information, see the COPYING file distributed with * this package. * * This Copyright notice must be kept intact and distributed with all sources. */ #include <sys/ioctl.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <stdio.h> #include <errno.h> #include <sys/sysmacros.h> /* * This function will take a patch and check it against /proc/mounts to * find its mount point. If uniononly is set then it will make sure its * a unionf mount point. This function assumes the both options and actual_path * are valid and not null; */ int find_union(const char *path, char **options, char **actual_path, int uniononly) { FILE *f = NULL; char *s = NULL; char *s2 = NULL; char *p; char *q; int candidate = 0; int mallocsize = 1024; /* Just a reasonable starting value. */ retry: if (*options) { free(*options); *options = NULL; } if (*actual_path) { free(*actual_path); *actual_path = NULL; } if (f) { fclose(f); f = NULL; } s2 = realloc(s, mallocsize); if (!s2) { fprintf(stderr, "realloc(%d): %s\n", mallocsize, strerror(errno)); goto out; } s = s2; f = fopen("/proc/mounts", "r"); if (!f) { fprintf(stderr, "fopen(/proc/mounts): %s\n", strerror(errno)); goto out; } while (fgets(s, mallocsize, f)) { int testcan; /* If we don't have enough information, we should remalloc it. */ if (strlen(s) == (mallocsize - 1)) { mallocsize *= 2; goto retry; } p = strchr(s, ' '); if (!p) continue; p++; q = strchr(p, ' '); if (!q) continue; *q++ = '\0'; testcan = strlen(p); if (testcan <= candidate) { continue; } if (!strncmp(path, p, testcan)) { if (*actual_path) { free(*actual_path); } *actual_path = strdup(p); if (!*actual_path) { fprintf(stderr, "strdup: %s\n", strerror(errno)); goto out; } p = strchr(q, ' '); if (!p) continue; *p++ = '\0'; if (uniononly) { if (strcmp(q, "unionfs")) { candidate = 0; continue; } } candidate = testcan; q = strrchr(p, ' '); if (!q) continue; *q = '\0'; q = strrchr(p, ' '); if (!q) continue; *q = '\0'; if (*options) { free(*options); } *options = strdup(p); if (!*options) { fprintf(stderr, "strdup: %s\n", strerror(errno)); goto out; } } } out: if (s) free(s); if (f) fclose(f); if (*options) { return 0; } errno = -ENOENT; return -1; } /** * Takes the device and creates an fsid from it by placing major in the first * int and minor in the second. */ void fillfsid(dev_t dev, fsid_t * fsid) { ((unsigned int *)fsid)[0] = major(dev); ((unsigned int *)fsid)[1] = minor(dev); } int mkfsid(char *path, fsid_t * fsid) { int err = 0; char *actual_path = NULL; char *options = NULL; struct stat stat_struct; memset(&stat_struct, 0, sizeof(struct stat)); err = find_union(path, &options, &actual_path, 0); if (err) { printf("find_union failed:\n"); goto out; } err = stat(actual_path, &stat_struct); if (err) { perror("Couldent stat path: "); goto out; } fillfsid(stat_struct.st_dev, fsid); out: return err; } /* * * vim:shiftwidth=8 * vim:tabstop=8 * * For Emacs: * Local variables: * c-basic-offset: 8 * c-comment-only-line-offset: 0 * c-offsets-alist: ((statement-block-intro . +) (knr-argdecl-intro . 0) * (substatement-open . 0) (label . 0) (statement-cont . +)) * indent-tabs-mode: t * tab-width: 8 * End: */
/*************************************************************************** * This file is part of KDevelop * * Copyright 2007 Andreas Pakulat <apaku@gmx.de> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 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 Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PROJECTBUILDSETMODEL_H #define PROJECTBUILDSETMODEL_H #include "projectexport.h" #include <QAbstractTableModel> #include <QStringList> class KConfigGroup; namespace KDevelop { class ProjectBaseItem; class ICore; class IProject; class ISession; class KDEVPLATFORMPROJECT_EXPORT BuildItem { public: BuildItem(); explicit BuildItem( const QStringList& itemPath ); BuildItem( const BuildItem& rhs ); explicit BuildItem( KDevelop::ProjectBaseItem* ); void initializeFromItem( KDevelop::ProjectBaseItem* item ); KDevelop::ProjectBaseItem* findItem() const; BuildItem& operator=( const BuildItem& ); QString itemName() const; QStringList itemPath() const { return m_itemPath; } QString itemProject() const; private: QStringList m_itemPath; }; bool operator==( const BuildItem& rhs, const BuildItem& lhs ); class KDEVPLATFORMPROJECT_EXPORT ProjectBuildSetModel : public QAbstractTableModel { Q_OBJECT public: ProjectBuildSetModel( QObject* parent ); QVariant data( const QModelIndex&, int role = Qt::DisplayRole ) const; QVariant headerData( int, Qt::Orientation, int role = Qt::DisplayRole ) const; int rowCount( const QModelIndex& = QModelIndex() ) const; int columnCount( const QModelIndex& = QModelIndex() ) const; void loadFromSession( ISession* session ); void storeToSession( ISession* session ); void addProjectItem( KDevelop::ProjectBaseItem* ); bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ); void moveRowsUp( int row, int count ); void moveRowsDown( int row, int count ); void moveRowsToTop( int row, int count ); void moveRowsToBottom( int row, int count ); QList<BuildItem> items(); public slots: void saveToProject( KDevelop::IProject* ) const; void loadFromProject( KDevelop::IProject* ); void projectClosed( KDevelop::IProject* ); private: QList<BuildItem> m_items; QList< QStringList > m_orderingCache; int findInsertionPlace( const QStringList& itemPath ); void removeItemsWithCache( const QList<int>& itemIndices ); void insertItemWithCache( const KDevelop::BuildItem& item ); void insertItemsOverrideCache( int index, const QList<KDevelop::BuildItem>& items ); }; } #endif //kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; indent-mode cstyle;
/* Owl PDF viewer * * Copyright (c) 2009 Zoltan Kovacs, Peter Szilagyi * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _CONFIG_CONFIG_H_ #define _CONFIG_CONFIG_H_ const char* get_config_directory( void ); int init_config( void ); #endif /* _CONFIG_CONFIG_H_ */
/* * This file is part of the coreboot project. * * Copyright (C) 2012 ChromeOS Authors * * 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 RMODULE_H #define RMODULE_H #include <stdint.h> #include <stddef.h> #include <string.h> #include <commonlib/rmodule-defs.h> enum { RMODULE_TYPE_SMM, RMODULE_TYPE_SIPI_VECTOR, RMODULE_TYPE_STAGE, RMODULE_TYPE_VBOOT, }; struct rmodule; /* Public API for loading rmdoules. */ int rmodule_parse(void *ptr, struct rmodule *m); void *rmodule_parameters(const struct rmodule *m); void *rmodule_entry(const struct rmodule *m); int rmodule_entry_offset(const struct rmodule *m); int rmodule_memory_size(const struct rmodule *m); int rmodule_load(void *loc, struct rmodule *m); int rmodule_load_alignment(const struct rmodule *m); /* rmodule_calc_region() calculates the region size, offset to place an * rmodule in memory, and load address offset based off of a region allocator * with an alignment of region_alignment. This function helps place an rmodule * in the same location in ram it will run from. The offset to place the * rmodule into the region allocated of size region_size is returned. The * load_offset is the address to load and relocate the rmodule. * region_alignment must be a power of 2. */ int rmodule_calc_region(unsigned int region_alignment, size_t rmodule_size, size_t *region_size, int *load_offset); /* Support for loading rmodule stages. This API is only available when * using dynamic cbmem because it uses the dynamic cbmem API to obtain * the backing store region for the stage. */ struct prog; struct rmod_stage_load { uint32_t cbmem_id; struct prog *prog; }; /* Both of the following functions return 0 on success, -1 on error. */ int rmodule_stage_load(struct rmod_stage_load *rsl); struct rmodule { void *location; struct rmodule_header *header; const void *payload; int payload_size; void *relocations; }; #if IS_ENABLED(CONFIG_RELOCATABLE_MODULES) /* Rmodules have an entry point of named _start. */ #define RMODULE_ENTRY(entry_) \ void _start(void *) __attribute__((alias (STRINGIFY(entry_)))) #else #define RMODULE_ENTRY(entry_) #endif #endif /* RMODULE_H */
// // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005-2014 Simon Howard // Copyright(C) 2016-2022 Julian Nechaevsky // // 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. // // DESCRIPTION: // Created by a sound utility. // Kept as a sample, DOOM2 sounds. // #include <stdlib.h> #include "doomtype.h" #include "sounds.h" // // Information about all the music // #define MUSIC(name) \ { name, 0, NULL, NULL } musicinfo_t S_music[] = { MUSIC(NULL), MUSIC("e1m1"), MUSIC("e1m2"), MUSIC("e1m3"), MUSIC("e1m4"), MUSIC("e1m5"), MUSIC("e1m6"), MUSIC("e1m7"), MUSIC("e1m8"), MUSIC("e1m9"), MUSIC("e2m1"), MUSIC("e2m2"), MUSIC("e2m3"), MUSIC("e2m4"), MUSIC("e2m5"), MUSIC("e2m6"), MUSIC("e2m7"), MUSIC("e2m8"), MUSIC("e2m9"), MUSIC("e3m1"), MUSIC("e3m2"), MUSIC("e3m3"), MUSIC("e3m4"), MUSIC("e3m5"), MUSIC("e3m6"), MUSIC("e3m7"), MUSIC("e3m8"), MUSIC("e3m9"), // [crispy] support dedicated music tracks for the 4th episode MUSIC("e4m1"), MUSIC("e4m2"), MUSIC("e4m3"), MUSIC("e4m4"), MUSIC("e4m5"), MUSIC("e4m6"), MUSIC("e4m7"), MUSIC("e4m8"), MUSIC("e4m9"), // [crispy] Sigil MUSIC("e5m1"), MUSIC("e5m2"), MUSIC("e5m3"), MUSIC("e5m4"), MUSIC("e5m5"), MUSIC("e5m6"), MUSIC("e5m7"), MUSIC("e5m8"), MUSIC("e5m9"), MUSIC("inter"), MUSIC("intro"), MUSIC("bunny"), MUSIC("victor"), MUSIC("introa"), MUSIC("runnin"), MUSIC("stalks"), MUSIC("countd"), MUSIC("betwee"), MUSIC("doom"), MUSIC("the_da"), MUSIC("shawn"), MUSIC("ddtblu"), MUSIC("in_cit"), MUSIC("dead"), MUSIC("stlks2"), MUSIC("theda2"), MUSIC("doom2"), MUSIC("ddtbl2"), MUSIC("runni2"), MUSIC("dead2"), MUSIC("stlks3"), MUSIC("romero"), MUSIC("shawn2"), MUSIC("messag"), MUSIC("count2"), MUSIC("ddtbl3"), MUSIC("ampie"), MUSIC("theda3"), MUSIC("adrian"), MUSIC("messg2"), MUSIC("romer2"), MUSIC("tense"), MUSIC("shawn3"), MUSIC("openin"), MUSIC("evil"), MUSIC("ultima"), MUSIC("read_m"), MUSIC("dm2ttl"), MUSIC("dm2int") }; // // Information about all the sfx // #define SOUND(name, priority) \ { NULL, name, priority, NULL, -1, -1, 0, 0, -1, NULL } #define SOUND_LINK(name, priority, link_id, pitch, volume) \ { NULL, name, priority, &S_sfx[link_id], pitch, volume, 0, 0, -1, NULL } sfxinfo_t S_sfx[] = { // S_sfx[0] needs to be a dummy for odd reasons. SOUND("none", 0), SOUND("pistol", 64), SOUND("shotgn", 64), SOUND("sgcock", 64), SOUND("dshtgn", 64), SOUND("dbopn", 64), SOUND("dbcls", 64), SOUND("dbload", 64), SOUND("plasma", 64), SOUND("bfg", 64), SOUND("sawup", 64), SOUND("sawidl", 118), SOUND("sawful", 64), SOUND("sawhit", 64), SOUND("rlaunc", 64), SOUND("rxplod", 70), SOUND("firsht", 70), SOUND("firxpl", 70), SOUND("pstart", 100), SOUND("pstop", 100), SOUND("doropn", 100), SOUND("dorcls", 100), SOUND("stnmov", 119), SOUND("swtchn", 78), SOUND("swtchx", 78), SOUND("plpain", 96), SOUND("dmpain", 96), SOUND("popain", 96), SOUND("vipain", 96), SOUND("mnpain", 96), SOUND("pepain", 96), SOUND("slop", 78), SOUND("itemup", 78), SOUND("wpnup", 78), SOUND("oof", 96), SOUND("telept", 32), SOUND("posit1", 98), SOUND("posit2", 98), SOUND("posit3", 98), SOUND("bgsit1", 98), SOUND("bgsit2", 98), SOUND("sgtsit", 98), SOUND("cacsit", 98), SOUND("brssit", 94), SOUND("cybsit", 92), SOUND("spisit", 90), SOUND("bspsit", 90), SOUND("kntsit", 90), SOUND("vilsit", 90), SOUND("mansit", 90), SOUND("pesit", 90), SOUND("sklatk", 70), SOUND("sgtatk", 70), SOUND("skepch", 70), SOUND("vilatk", 70), SOUND("claw", 70), SOUND("skeswg", 70), SOUND("pldeth", 32), SOUND("pdiehi", 32), SOUND("podth1", 70), SOUND("podth2", 70), SOUND("podth3", 70), SOUND("bgdth1", 70), SOUND("bgdth2", 70), SOUND("sgtdth", 70), SOUND("cacdth", 70), SOUND("skldth", 70), SOUND("brsdth", 32), SOUND("cybdth", 32), SOUND("spidth", 32), SOUND("bspdth", 32), SOUND("vildth", 32), SOUND("kntdth", 32), SOUND("pedth", 32), SOUND("skedth", 32), SOUND("posact", 120), SOUND("bgact", 120), SOUND("dmact", 120), SOUND("bspact", 100), SOUND("bspwlk", 100), SOUND("vilact", 100), SOUND("noway", 78), SOUND("barexp", 60), SOUND("punch", 64), SOUND("hoof", 70), SOUND("metal", 70), SOUND_LINK("chgun", 64, sfx_pistol, 150, 0), SOUND("tink", 60), SOUND("bdopn", 100), SOUND("bdcls", 100), SOUND("itmbk", 100), SOUND("flame", 32), SOUND("flamst", 32), SOUND("getpow", 60), SOUND("bospit", 70), SOUND("boscub", 70), SOUND("bossit", 70), SOUND("bospn", 70), SOUND("bosdth", 70), SOUND("manatk", 70), SOUND("mandth", 70), SOUND("sssit", 70), SOUND("ssdth", 70), SOUND("keenpn", 70), SOUND("keendt", 70), SOUND("skeact", 70), SOUND("skesit", 70), SOUND("skeatk", 70), SOUND("radio", 60), SOUND("slop2", 78), SOUND("swtchw", 78), // [crispy] additional BOOM and MBF states, sprites and code pointers SOUND("dgsit", 98), SOUND("dgatk", 70), SOUND("dgact", 120), SOUND("dgdth", 70), SOUND("dgpain", 96), // [crispy] play DSSECRET if available SOUND("secret", 60), };
/* GPL (c) 2017, thorsten.johannvorderbrueggen@t-online.de This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include <libgame.h> #define PROGNAME "use game_obj_data_t for game objects" #define SPRITE_SHEET "animate-alpha.png" #define RENDER_ALL() do { \ render_window(); \ } while (0) #define HANDLE_EVENTS() do { \ handle_events(); \ } while (0) #define UPDATE_ALL() do { \ update_all(); \ } while (0) /* main window and renderer*/ SDL_Window *window; SDL_Renderer *renderer; /* the global state -> true still running, false quit */ bool running = false; /* all game objects */ #define MAX_NUM_OBJ 10 game_obj_data_t *static_obj_array[MAX_NUM_OBJ + 1]; game_obj_data_t *moving_obj_array[MAX_NUM_OBJ + 1]; /* size of window */ spread_t screen = { .w = 1024, .h = 768}; /* * do all init stuff */ void init_game(void) { window = setup_main_window(PROGNAME, &screen, 0); if (window == NULL) exit(EXIT_FAILURE); color_t background; background.r = 100; background.g = 100; background.b = 100; background.a = 255; renderer = setup_renderer(window, &background); if (renderer == NULL) exit(EXIT_FAILURE); } void init_game_objects(void) { memset(static_obj_array, 0, MAX_NUM_OBJ); memset(moving_obj_array, 0, MAX_NUM_OBJ); SDL_Texture *texture = load_texture(SPRITE_SHEET, renderer); if (texture == NULL) exit(EXIT_FAILURE); /* static objects */ game_obj_data_t *t = alloc_game_data_object(0, 0, 128, 82, texture); if (t == NULL) exit(EXIT_FAILURE); else static_obj_array[0] = t; t = alloc_game_data_object(screen.w, 100, 128, 82, texture); if (t == NULL) exit(EXIT_FAILURE); else static_obj_array[1] = t; /* flip this object */ static_obj_array[1]->flip = SDL_FLIP_HORIZONTAL; static_obj_array[2] = NULL; /* moving objects */ t = alloc_game_data_object(200, 200, 128, 82, texture); if (t == NULL) exit(EXIT_FAILURE); else moving_obj_array[0] = t; moving_obj_array[1] = NULL; } /* * cleanup all create game objects */ void cleanup_game_object(void) { int i = 0; while (static_obj_array[i]) free_game_data_object(static_obj_array[i++]); i = 0; while (moving_obj_array[i]) free_game_data_object(moving_obj_array[i++]); } /* * render all parts */ void render_window(void) { /* clear rendering target to the drawing color */ int err = SDL_RenderClear(renderer); if (err < 0) fprintf(stderr, "could not set clear rendering target (%s)\n", SDL_GetError()); int i = 0; while (static_obj_array[i]) draw_object(static_obj_array[i++], renderer); i = 0; while (moving_obj_array[i]) draw_object(moving_obj_array[i++], renderer); /* bring everthing to the window -> now we see the changes */ SDL_RenderPresent(renderer); } /* * update all needed stuff */ void update_all(void) { /* static cat top left */ if (get_object_pos_x(static_obj_array[0]) > screen.w) clear_object_pos_x(static_obj_array[0]); vector2d_t velo = {.x = 1, .y = 0}; set_object_velo(static_obj_array[0], &velo); /* static cat in the middle */ if (get_object_pos_x(static_obj_array[1]) == 0) set_object_pos_x(static_obj_array[1], screen.w); vector2d_t velo_2 = {.x = -1, .y = 0}; set_object_velo(static_obj_array[1], &velo_2); /* running cat stuff */ unsigned char act_frame = (SDL_GetTicks() / 100) % 6; int i = 0; while (moving_obj_array[i]) set_object_frame(moving_obj_array[i++], act_frame); } /* * handle supported events */ void handle_events(void) { SDL_Event e; if (SDL_PollEvent(&e)) { switch(e.type) { case SDL_QUIT: printf("an actual SDL_QUIT event occured\n"); running = false; break; default: printf("an actual unsupported event occured %d\n", e.type); break; } } } /* * ----------------------------------------------------------------------------- */ int main(void) { init_game(); init_game_objects(); /* init done */ running = true; uint32_t frame_start, frame_time; uint32_t delay_time = 1000.0f / FPS; while (running) { frame_start = SDL_GetTicks(); HANDLE_EVENTS(); UPDATE_ALL(); RENDER_ALL(); frame_time = SDL_GetTicks() - frame_start; if (frame_time < delay_time) SDL_Delay(delay_time - frame_time); else printf("underrun -> try to reduce FPS?\n"); } cleanup_game_object(); cleanup_main_window(window, renderer); exit(EXIT_SUCCESS); }
/*--------------------------------------------------------------------*/ /*--- Linux-variant specific syscalls stuff. ---*/ /*--- priv_syswrap-linux.h ---*/ /*--------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. Copyright (C) 2000-2009 Julian Seward jseward@acm.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. The GNU General Public License is contained in the file COPYING. */ #ifndef __PRIV_SYSWRAP_LINUX_VARIANTS_H #define __PRIV_SYSWRAP_LINUX_VARIANTS_H /* requires #include "priv_types_n_macros.h" */ /* --------------------------------------------------------------- BProc wrappers ------------------------------------------------------------ */ #define TId ThreadId #define UW UWord #define SR SysRes /* Return 0 means hand to kernel, non-0 means fail w/ that value. */ extern Int ML_(linux_variant_PRE_sys_bproc)( UW, UW, UW, UW, UW, UW ); extern void ML_(linux_variant_POST_sys_bproc)( UW, UW, UW, UW, UW, UW ); #undef TId #undef UW #undef SR #endif // __PRIV_SYSWRAP_LINUX_VARIANTS_H /*--------------------------------------------------------------------*/ /*--- end priv_syswrap-linux-variants.h ---*/ /*--------------------------------------------------------------------*/
#include "types.h" #define mix(a, b, c) \ do { \ a = a - b; a = a - c; a = a ^ (c >> 13); \ b = b - c; b = b - a; b = b ^ (a << 8); \ c = c - a; c = c - b; c = c ^ (b >> 13); \ a = a - b; a = a - c; a = a ^ (c >> 12); \ b = b - c; b = b - a; b = b ^ (a << 16); \ c = c - a; c = c - b; c = c ^ (b >> 5); \ a = a - b; a = a - c; a = a ^ (c >> 3); \ b = b - c; b = b - a; b = b ^ (a << 10); \ c = c - a; c = c - b; c = c ^ (b >> 15); \ } while (0) unsigned ceph_str_hash_rjenkins(const char *str, unsigned length) { const unsigned char *k = (const unsigned char *)str; __u32 a, b, c; /* the internal state */ __u32 len; /* how many key bytes still need mixing */ /* Set up the internal state */ len = length; a = 0x9e3779b9; /* the golden ratio; an arbitrary value */ b = a; c = 0; /* variable initialization of internal state */ /* handle most of the key */ while (len >= 12) { a = a + (k[0] + ((__u32)k[1] << 8) + ((__u32)k[2] << 16) + ((__u32)k[3] << 24)); b = b + (k[4] + ((__u32)k[5] << 8) + ((__u32)k[6] << 16) + ((__u32)k[7] << 24)); c = c + (k[8] + ((__u32)k[9] << 8) + ((__u32)k[10] << 16) + ((__u32)k[11] << 24)); mix(a, b, c); k = k + 12; len = len - 12; } /* handle the last 11 bytes */ c = c + length; switch (len) { /* all the case statements fall through */ case 11: c = c + ((__u32)k[10] << 24); case 10: c = c + ((__u32)k[9] << 16); case 9: c = c + ((__u32)k[8] << 8); /* the first byte of c is reserved for the length */ case 8: b = b + ((__u32)k[7] << 24); case 7: b = b + ((__u32)k[6] << 16); case 6: b = b + ((__u32)k[5] << 8); case 5: b = b + k[4]; case 4: a = a + ((__u32)k[3] << 24); case 3: a = a + ((__u32)k[2] << 16); case 2: a = a + ((__u32)k[1] << 8); case 1: a = a + k[0]; /* case 0: nothing left to add */ } mix(a, b, c); return c; } unsigned ceph_str_hash_linux(const char *str, unsigned length) { unsigned long hash = 0; unsigned char c; while (length--) { c = *str++; hash = (hash + (c << 4) + (c >> 4)) * 11; } return hash; } unsigned ceph_str_hash(int type, const char *s, unsigned len) { switch (type) { case CEPH_STR_HASH_LINUX: return ceph_str_hash_linux(s, len); case CEPH_STR_HASH_RJENKINS: return ceph_str_hash_rjenkins(s, len); default: return -1; } } const char *ceph_str_hash_name(int type) { switch (type) { case CEPH_STR_HASH_LINUX: return "linux"; case CEPH_STR_HASH_RJENKINS: return "rjenkins"; default: return "unknown"; } }
/* ** Copyright 2000-2002 Double Precision, Inc. See COPYING for ** distribution information. */ #include "rfc2045_config.h" #include "rfc2045.h" #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <sys/types.h> #include <sys/stat.h> static const char rcsid[]="$Id: rfc2045header.c,v 1.1.1.1 2003/05/07 02:14:11 lfan Exp $"; struct rfc2045headerinfo { int fd; char *headerbuf; size_t headerbufsize; char readbuf[1024]; char *readptr; size_t readleft; size_t headerleft; } ; struct rfc2045headerinfo *rfc2045header_start(int fd, struct rfc2045 *rfcp) { off_t start_pos, dummy, start_body; struct rfc2045headerinfo *p; if (rfcp) { rfc2045_mimepos(rfcp, &start_pos, &dummy, &start_body, &dummy, &dummy); } else { struct stat stat_buf; if (fstat(fd, &stat_buf) < 0) return (NULL); start_pos=0; start_body=stat_buf.st_size; } if (lseek(fd, start_pos, SEEK_SET) == -1) return (NULL); p=(struct rfc2045headerinfo *)calloc(sizeof(struct rfc2045headerinfo), 1); if (!p) return (NULL); p->fd=fd; p->headerleft=start_body - start_pos; return (p); } void rfc2045header_end(struct rfc2045headerinfo *p) { if (p->headerbuf) free(p->headerbuf); free(p); } static int fill(struct rfc2045headerinfo *p) { int n; if (p->headerleft == 0) return (-1); n=sizeof(p->readbuf); if (n > p->headerleft) n=p->headerleft; n=read(p->fd, p->readbuf, n); if (n <= 0) { p->headerleft=0; p->readleft=0; return (-1); } p->readptr=p->readbuf; p->readleft = n; p->headerleft -= n; return ((int)(unsigned char)p->readbuf[0]); } #define PEEK(p) ((p)->readleft ? (int)(unsigned char)*p->readptr:fill(p)) int rfc2045header_get(struct rfc2045headerinfo *p, char **header, char **value, int flags) { int c=PEEK(p); int isnl=0; size_t n=0; char *s, *t; if (c == -1 || c == '\r' || c == '\n') { *header=*value=NULL; return (0); } for (;;) { if (n >= p->headerbufsize) { size_t n=p->headerbufsize += 256; char *s= p->headerbuf ? realloc(p->headerbuf, n): malloc(n); if (!s) return (-1); p->headerbuf=s; p->headerbufsize=n; } c=PEEK(p); if (c < 0) break; if (isnl) { if (!isspace(c) || c == '\n' || c == '\r') break; isnl=0; } if (c == '\n') isnl=1; if ((c == '\n' || c == '\r') && (flags & RFC2045H_KEEPNL) == 0) c=' '; p->headerbuf[n++]=c; --p->readleft; ++p->readptr; } p->headerbuf[n]=0; *header= *value= p->headerbuf; while (**value) { if (**value == ':') { **value=0; ++*value; while (**value && isspace((int)(unsigned char)**value)) ++*value; break; } if (!(flags & RFC2045H_NOLC)) { if (**value >= 'A' && **value <= 'Z') **value += 'a' - 'A'; } ++*value; } s=strrchr( *value, '\n'); if (s && *s && s[1] == 0) *s=0; s=strrchr( *value, '\r'); if (s && *s && s[1] == 0) *s=0; for (s=t=*value; *s; ) if (!isspace((int)(unsigned char)*s++)) t=s; *t=0; return (0); }
#ifndef SAMSUNGSMARTTVWEBPLUGIN_H #define SAMSUNGSMARTTVWEBPLUGIN_H #include "stbpluginobject.h" #include "samsungsmarttvwebplugin_global.h" #include <QObject> #include <QUrl> #include <datasourcefactory.h> #include <gui.h> namespace yasem { class Profile; class AbstractWebPage; class SAMSUNGSMARTTVWEBPLUGINSHARED_EXPORT SamsungSmartTvWebPlugin: public PluginQObject, public Plugin, public StbPluginObject { Q_OBJECT Q_PLUGIN_METADATA(IID "com.mvas.yasem.SamsungSmartTvWebPlugin/1.0" FILE "metadata.json") Q_INTERFACES(yasem::Plugin yasem::StbPluginObject) Q_CLASSINFO("author", "Maxim Vasilchuk") Q_CLASSINFO("description", "Samsung Smart TV plugin for YASEM") public: SamsungSmartTvWebPlugin(); // Plugin interface public: PluginErrorCodes initialize(); PluginErrorCodes deinitialize(); QUrl handleUrl(QUrl &url); virtual Profile* createProfile(const QString &id) ; QString getProfileClassId(); QString getIcon(const QSize &size); public slots: bool receiveKeyCode(RC_KEY keyCode); QString name(); protected: bool created; void resetObjects(AbstractWebPage* page); void applyFixes(); // StbProfilePlugin interface public: void initObject(AbstractWebPage* page); // StbPlugin interface // Plugin interface public: void register_dependencies(); void register_roles(); }; } #endif // SAMSUNGSMARTTVWEBPLUGIN_H
/* Copyright (C) * 2016 - John Melton, G0ORX/N6LYT * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #include <gtk/gtk.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "new_menu.h" #include "bandstack_menu.h" #include "band.h" #include "bandstack.h" #include "filter.h" #include "radio.h" #include "receiver.h" #include "vfo.h" #include "button_text.h" static GtkWidget *parent_window=NULL; static GtkWidget *dialog=NULL; static GtkWidget *last_bandstack; static void cleanup() { if(dialog!=NULL) { gtk_widget_destroy(dialog); dialog=NULL; sub_menu=NULL; active_menu=NO_MENU; } } static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { cleanup(); return TRUE; } static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) { cleanup(); return FALSE; } static gboolean bandstack_select_cb (GtkWidget *widget, gpointer data) { int b=GPOINTER_TO_UINT(data); if (active_receiver->id == 0) { // // vfo_bandstack_changed() calls vfo_save_bandstack(), so the frequency/mode // of the previous "current" bandstack will be overwritten with the // current frequency/mode, which should be reflected by the button text. // char label[32]; snprintf(label,32,"%lld %s",vfo[0].frequency,mode_string[vfo[0].mode]); gtk_button_set_label(GTK_BUTTON(last_bandstack), label); } set_button_text_color(last_bandstack,"black"); last_bandstack=widget; set_button_text_color(last_bandstack,"orange"); vfo_bandstack_changed(b); return FALSE; } void bandstack_menu(GtkWidget *parent) { int i; parent_window=parent; dialog=gtk_dialog_new(); gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window)); //gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE); char title[64]; sprintf(title,"piHPSDR - Band Stack (RX %d VFO %s)",active_receiver->id,active_receiver->id==0?"A":"B"); gtk_window_set_title(GTK_WINDOW(dialog),title); g_signal_connect (dialog, "delete_event", G_CALLBACK (delete_event), NULL); GdkRGBA color; color.red = 1.0; color.green = 1.0; color.blue = 1.0; color.alpha = 1.0; gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color); GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog)); GtkWidget *grid=gtk_grid_new(); gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE); gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE); gtk_grid_set_column_spacing (GTK_GRID(grid),5); gtk_grid_set_row_spacing (GTK_GRID(grid),5); GtkWidget *close_b=gtk_button_new_with_label("Close"); g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL); gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1); BAND *band=band_get_band(vfo[active_receiver->id].band); BANDSTACK *bandstack=band->bandstack; char label[32]; int row=1; int col=0; for(i=0;i<bandstack->entries;i++) { BANDSTACK_ENTRY *entry=&bandstack->entry[i]; sprintf(label,"%lld %s",entry->frequency,mode_string[entry->mode]); GtkWidget *b=gtk_button_new_with_label(label); set_button_text_color(b,"black"); //gtk_widget_override_font(b, pango_font_description_from_string("Arial 20")); if(i==vfo[active_receiver->id].bandstack) { set_button_text_color(b,"orange"); last_bandstack=b; } gtk_widget_show(b); gtk_grid_attach(GTK_GRID(grid),b,col,row,1,1); g_signal_connect(b,"clicked",G_CALLBACK(bandstack_select_cb),(gpointer)(long)i); col++; if(col>=5) { col=0; row++; } } gtk_container_add(GTK_CONTAINER(content),grid); sub_menu=dialog; gtk_widget_show_all(dialog); }
/* options.h */ #ifndef _OPTIONS_H #define _OPTIONS_H #include "packet.h" #define TYPE_MASK 0x0F enum { OPTION_IP=1, OPTION_IP_PAIR, OPTION_STRING, OPTION_BOOLEAN, OPTION_U8, OPTION_U16, OPTION_S16, OPTION_U32, OPTION_S32 }; #define OPTION_REQ 0x10 /* have the client request this option */ #define OPTION_LIST 0x20 /* There can be a list of 1 or more of these */ struct dhcp_option { char name[10]; char flags; unsigned char code; }; extern struct dhcp_option options[]; extern int option_lengths[]; unsigned char *get_option(struct dhcpMessage *packet, int code); int end_option(unsigned char *optionptr); int add_option_string(unsigned char *optionptr, unsigned char *string); int add_simple_option(unsigned char *optionptr, unsigned char code, u_int32_t data); struct option_set *find_option(struct option_set *opt_list, char code); void attach_option(struct option_set **opt_list, struct dhcp_option *option, char *buffer, int length); #endif
/* * * Iter Vehemens ad Necem (IVAN) * Copyright (C) Timo Kiviluoto * Released under the GNU General * Public License * * See LICENSING which should be included * along with this file for more details * */ #ifndef __DUNGEON_H__ #define __DUNGEON_H__ #include "v2.h" class level; class outputfile; class inputfile; class dungeonscript; class levelscript; class festring; class dungeon { public: dungeon() = default; dungeon(int); ~dungeon(); truth PrepareLevel(int, truth = true); void SaveLevel(cfestring&, int, truth = true); level* LoadLevel(cfestring&, int); level* GetLevel(int I) const { return Level[I]; } int GetLevels() const; void Save(outputfile&) const; void Load(inputfile&); void SetIndex(int What) { Index = What; } int GetIndex() const { return Index; } const levelscript* GetLevelScript(int); v2 GetWorldMapPos() { return WorldMapPos; } void SetWorldMapPos(v2 What) { WorldMapPos = What; } festring GetLevelDescription(int); festring GetShortLevelDescription(int); level* LoadLevel(inputfile&, int); truth IsGenerated(int I) const { return Generated[I]; } void SetIsGenerated(int I, truth What) { Generated[I] = What; } int GetLevelTeleportDestination(int) const; void PrepareMusic(int); private: void Initialize(); const dungeonscript* DungeonScript; level** Level; int Index; truth* Generated; v2 WorldMapPos; }; outputfile& operator<<(outputfile&, const dungeon*); inputfile& operator>>(inputfile&, dungeon*&); #endif
/* This file is (C) copyright 2001-2004 Software Improvements, Pty 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <unistd.h> #include <common/voter_electorate.h> #include <common/cursor.h> #include <common/ballot_contents.h> #include "accumulate_preferences.h" #include "message.h" #include "image.h" #include "get_rotation.h" #include "main_screen.h" #include "initiate_session.h" #include "draw_group_entry.h" void show_ballot(const struct electorate *electorate, const struct ballot_contents *bc); extern void display_screen(const struct electorate *electorate, const struct ballot_contents *bc); extern void get_dummy_rotation(const struct electorate *elec); /* DDS3.2.6: Display Acknowledgement Screen */ void display_ack_screen(void) { struct image *image; unsigned int language; language = get_language(); /* Draw background */ paste_image(0, 0, get_message(language, MSG_BACKGROUND)); /* Draw acknowledgement in centre of screen */ image = get_message(language, MSG_ACKNOWLEDGEMENT); paste_image((get_screen_width()-image_width(image))/2, (get_screen_height()-image_height(image))/2, image); } void show_ballot(const struct electorate *electorate, const struct ballot_contents *bc) { const struct cursor default_cursor = { .group_index = 0, .screen_candidate_index = -1 }; get_dummy_rotation(electorate); clear_screen(); display_screen(electorate, bc); draw_group_entry(default_cursor, YES, false); }
/** * @file * @version 1.0 * @author Junzhi Liu * @date 31-Octobor-2011 * * @brief Green Ampt Method to calculate infiltration and excess precipitation * */ #ifndef SEIMS_STORM_GA_INCLUDE #define SEIMS_STORM_GA_INCLUDE #include <string> #include "SimulationModule.h" using namespace std; class ExcessRunoff : public SimulationModule { public: ExcessRunoff(void); ~ExcessRunoff(void); virtual void Set1DData(const char* key, int n, float* data); virtual void Get1DData(const char* key, int* n, float **data); virtual void SetValue(const char* key, float value); virtual int Execute(void); private: /** * @brief check the input data. Make sure all the input data is available. * * @return bool The validity of the input data. */ bool CheckInputData(void); /** * @brief check the input size. Make sure all the input data have same dimension. * * @param key: The key of the input data * @param n: The input data dimension * @return bool The validity of the dimension */ bool CheckInputSize(const char*,int n); ///** //* @brief check the output data. Make sure all the output data is available. //* //* @param output1: the output variable PE //* @param output2: the next output variable infiltration //* @return bool The validity of the output data. //*/ //bool CheckOutputData(float* output1, float* output2); void clearInputs(void); string getDate(time_t* date); private: /// time step(seconds) float m_dt; /// maximum temperature float *m_tMax; /// minimum temperature float *m_tMin; /// snow fall temperature float m_tSnow; /// snow melt threshold temperature float m_t0; /// snow melt from the snow melt module (mm) float* m_snowMelt; /// snow accumulation from the snow balance module (mm) at t+1 timestep float* m_snowAccu; /// threshold soil freezing temperature (¡æ) float m_tFrozen; /// frozen soil moisture relative to saturation above which no infiltration occur (m3/m3) float m_sFrozen; /// soil temperature obtained from the soil temperature module (¡æ) float* m_soilTemp; /// count of valid cells int m_nCells; /// precipitation of each cell float *m_pNet; /// soil porosity float *m_porosity; /// field capacity float *m_fieldCap; /// soil moisture float *m_soilMoisture; /// root depth float *m_rootDepth; /// depression storage -- SD(t-1) from the depression storage module float* m_sd; /// parameters used in GA method /// saturated hydraulic conductivity from parameter database (m/s) float *m_ks; /// initial soil moisture float *m_initSoilMoisture; // output /// the excess precipitation (mm) of the total nCells float* m_pe; /// infiltration map of watershed (mm) of the total nCells float* m_infil; }; #endif
#undef NDEBUG #ifndef _minunit_h #define _minunit_h #include <stdio.h> #include "dbg.h" #include <stdlib.h> #define mu_suite_start() char *message = NULL #define mu_assert(test, message) if (!(test)) { log_err(message); return message; } #define mu_run_test(test) debug("\n-----%s", " " #test); \ message = test(); tests_run++; if (message) return message; #define RUN_TESTS(name) int main(int argc, char *argv[]) {\ argc = 1; \ debug("----- RUNNING: %s", argv[0]);\ printf("----\nRUNNING: %s\n", argv[0]);\ char *result = name();\ if (result != 0) {\ printf("FAILED: %s\n", result);\ }\ else {\ printf("ALL TESTS PASSED\n");\ }\ printf("Tests run: %d\n", tests_run);\ exit(result != 0);\ } int tests_run; #endif
// // FullSizePhotoViewController.h // FRPExample // // Created by Ahmet Karalar on 30/12/14. // Copyright (c) 2014 Ahmet Karalar. All rights reserved. // #import <UIKit/UIKit.h> @protocol FullSizePhotoViewControllerDelegate; @interface FullSizePhotoViewController : UIViewController @property (nonatomic, readonly) NSArray *photoModelArray; @property (nonatomic, weak) id<FullSizePhotoViewControllerDelegate> delegate; - (instancetype)initWithPhotoModels:(NSArray *)photoModelArray currentPhotoIndex:(NSInteger)index; @end @protocol FullSizePhotoViewControllerDelegate <NSObject> - (void)userDidScroll:(FullSizePhotoViewController *)viewController toPhotoAtIndex:(NSInteger)index; @end
/* This file is part of the KDE project Copyright (C) 2003 Simon Hausmann <hausmann@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef IDENTIFIER_H #define IDENTIFIER_H #include <tqstring.h> #include <tqvaluelist.h> #include <tqmap.h> #include "value.h" namespace KSim { namespace Snmp { class Identifier { public: friend class PDU; struct Data; enum PrintFlags { PrintAscii, PrintNumeric }; Identifier(); Identifier( Data *data ); Identifier( const Identifier &rhs ); Identifier &operator=( const Identifier &rhs ); ~Identifier(); static Identifier fromString( const TQString &name, bool *ok = 0 ); TQString toString( PrintFlags flags = PrintAscii ) const; bool isNull() const; bool operator==( const Identifier &rhs ) const; bool operator!=( const Identifier &rhs ) const { return !operator==( rhs ); } bool operator<( const Identifier &rhs ) const; private: Data *d; }; typedef TQValueList<Identifier> IdentifierList; typedef TQMap<Identifier, Value> ValueMap; } } #endif // IDENTIFIER_H /* vim: et sw=4 ts=4 */
#ifndef __FTP_PLUGIN_PROGRESS #define __FTP_PLUGIN_PROGRESS /* * TrafficInformation */ #define FTP_PROGRESS_MAGIC MK_ID( 'F','P','g',1 ) typedef void (WINAPI *Pg_ResumeFile_t)(HANDLE Object, LPCSTR LocalFileName); typedef void (WINAPI *Pg_Resume_t)(HANDLE Object, int64_t size); typedef BOOL (WINAPI *Pg_Callback_t)(HANDLE Object, int Size); typedef void (WINAPI *Pg_Init_t)(HANDLE Object, HANDLE Connection,int tMsg,int OpMode,FP_SizeItemList* il); typedef void (WINAPI *Pg_InitFile_t)(HANDLE Object, int64_t sz, LPCSTR SrcName, LPCSTR DestName); typedef void (WINAPI *Pg_Skip_t)(HANDLE Object); typedef void (WINAPI *Pg_Waiting_t)(HANDLE Object, time_t paused); typedef void (WINAPI *Pg_SetConn_t)(HANDLE Object,HANDLE Connection); struct ProgressInterface: public FTPPluginInterface { FTP_CreateObject_t CreateObject; FTP_DestroyObject_t DestroyObject; Pg_ResumeFile_t ResumeFile; Pg_Resume_t Resume; Pg_Callback_t Callback; Pg_Init_t Init; Pg_InitFile_t InitFile; Pg_Skip_t Skip; Pg_Waiting_t Waiting; Pg_SetConn_t SetConnection; }; #endif
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PPAPI_PROXY_NET_ADDRESS_RESOURCE_H_ #define PPAPI_PROXY_NET_ADDRESS_RESOURCE_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ppapi/c/private/ppb_net_address_private.h" #include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/ppapi_proxy_export.h" #include "ppapi/thunk/ppb_net_address_api.h" namespace ppapi { namespace proxy { class PPAPI_PROXY_EXPORT NetAddressResource : public PluginResource, public thunk::PPB_NetAddress_API { public: NetAddressResource(Connection connection, PP_Instance instance, const PP_NetAddress_IPv4& ipv4_addr); NetAddressResource(Connection connection, PP_Instance instance, const PP_NetAddress_IPv6& ipv6_addr); NetAddressResource(Connection connection, PP_Instance instance, const PP_NetAddress_Private& private_addr); virtual ~NetAddressResource(); virtual thunk::PPB_NetAddress_API* AsPPB_NetAddress_API() OVERRIDE; virtual PP_NetAddress_Family GetFamily() OVERRIDE; virtual PP_Var DescribeAsString(PP_Bool include_port) OVERRIDE; virtual PP_Bool DescribeAsIPv4Address( PP_NetAddress_IPv4* ipv4_addr) OVERRIDE; virtual PP_Bool DescribeAsIPv6Address( PP_NetAddress_IPv6* ipv6_addr) OVERRIDE; virtual const PP_NetAddress_Private& GetNetAddressPrivate() OVERRIDE; private: PP_NetAddress_Private address_; DISALLOW_COPY_AND_ASSIGN(NetAddressResource); }; } } #endif
/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com> * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include <bluetooth/hci.h> #include <bluetooth/hci_lib.h> /* When all services should trust a remote device */ #define GLOBAL_TRUST "[all]" /* * Scanning modes, used by DEV_SET_MODE * off: remote devices are not allowed to find or connect to this device * connectable: remote devices are allowed to connect, but they are not * allowed to find it. * discoverable: remote devices are allowed to connect and find this device * limited: limited discoverable - GIAC + IAC enabled and set limited * bit on device class. */ #define MODE_OFF 0x00 #define MODE_CONNECTABLE 0x01 #define MODE_DISCOVERABLE 0x02 #define MODE_LIMITED 0x03 #define MODE_UNKNOWN 0xff #define HCID_DEFAULT_DISCOVERABLE_TIMEOUT 180 /* 3 minutes */ /* Timeout for hci_send_req (milliseconds) */ #define HCI_REQ_TIMEOUT 5000 struct main_opts { char host_name[40]; unsigned long flags; char *name; uint32_t class; uint16_t pageto; uint32_t discovto; uint32_t pairto; uint16_t link_mode; uint16_t link_policy; gboolean remember_powered; gboolean reverse_sdp; gboolean name_resolv; gboolean debug_keys; gboolean attrib_server; uint8_t scan; uint8_t mode; uint8_t discov_interval; char deviceid[15]; /* FIXME: */ int sock; }; enum { HCID_SET_NAME, HCID_SET_CLASS, HCID_SET_PAGETO, HCID_SET_DISCOVTO, }; extern struct main_opts main_opts; char *expand_name(char *dst, int size, char *str, int dev_id); void hci_req_queue_remove(int dev_id, bdaddr_t *dba); void start_security_manager(int hdev); void stop_security_manager(int hdev); void btd_start_exit_timer(void); void btd_stop_exit_timer(void); void set_pin_length(bdaddr_t *sba, int length); gboolean plugin_init(GKeyFile *config); void plugin_cleanup(void); void rfkill_init(void); void rfkill_exit(void); void __probe_servers(const char *adapter); void __remove_servers(const char *adapter); static inline int ignore_device(struct hci_dev_info *di) { return hci_test_bit(HCI_RAW, &di->flags) || di->type >> 4 != HCI_BREDR; }
/* spi flash reader & writer */ #ifndef __SPIDEV_DRIVER_H__ #define __SPIDEV_DRIVER_H__ #include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <getopt.h> #include <fcntl.h> #include <sys/ioctl.h> #include <linux/ioctl.h> #include <sys/stat.h> #include <linux/types.h> #include <linux/spi/spidev.h> #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #define TRANSFER_BYTE(b) transfer(fd ,b,b,1) #define BUFFER_SIZE 2052 #define INS_BUF_LEN 10 #define VERBOSE 1 #define W25_SECTOR_SIZE 4096 #define W25_PAGE_SIZE 256 #define OK 1 //指令定义 #define Write_Enable 0x06 //写使能 #define Write_Enable_Volatile_SR 0x50 //易失性寄存器写使能 #define Write_Disable 0x04 //写禁止 #define Read_SR1 0x05 //读状态寄存器1 #define Read_SR2 0x35 //读状态寄存器2 #define Write_Status_Register 0x01 //写状态寄存器 #define Read_Data 0x03 //读数据 #define Page_Program 0x02 //页编程命令 #define Sector_Erase 0x20 //扇区擦除 #define Block_Erase_32K 0x52 //32K块擦除 #define Block_Erase_64K 0xd8 //64K块擦除 #define Chip_Erase 0xc7 //芯片擦除 0x60 #define Power_Down 0xB9 //Power_Down模式 #define Release_Power_Down 0xab //恢复power_down模式 #define Read_Chip_ID 0x90 //读取设备ID #define Read_Jedec_Id 0x9f #define Dummy 0xff #define WINBOND_FLASH 0xef extern void pabort(const char *s); extern const char *device ; extern uint32_t mode; extern uint8_t bits ; extern char *input_file; extern char *output_file; extern uint32_t speed ; extern uint16_t delay; extern int verbose; extern char* backup_file; extern char *read_addr_arg; /* uint8_t default_tx[BUFFER_SIZE]; uint8_t default_rx[BUFFER_SIZE] ; */ // char *input_tx; extern void hex_dump(const void *src, size_t length, size_t line_size, char *prefix); /* * Unescape - process hexadecimal escape character * converts shell input "\x23" -> 0x23 */ extern int unescape(char *_dst, char *_src, size_t len); extern void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len); //extern void print_usage(const char *prog); //extern void parse_opts(int argc, char *argv[]); extern void transfer_escaped_string(int fd, char *str); extern void backup_chip(int fd , char *out_file, uint32_t flash_size_byte , uint8_t addr_len); /** * \brief get the busy status of flash * * \param [in] fd Parameter_Description * \return value of busy bit of status register * * \details Details */ extern int is_flash_busy(int fd); /** * \brief Read data from flash * * \param [in] fd spi device file descriptor * \param [in] addr address for reading data 3/4 byte * \param [in] len Data length in byte * \param [in] addr_len Address length 3 or 4 only * \param [in] out_file File name for save the data which read from flash * \param [in] buffer Buffer pointer for save the data which read from flash * \return nothing returns * * \details Details */ extern void read_addr(int fd, uint32_t addr, uint32_t len, uint8_t addr_len, char* out_file, uint8_t* buffer ); extern void write_chip(); extern int page_program(int fd, uint32_t addr, uint8_t addr_len, uint8_t * data, uint16_t data_len ); extern void sector_erase(int fd, uint32_t addr, uint8_t addr_len); /** * \brief Send Write_Enable byte to flash * * \param [in] fd Parameter_Description * \return useless * * \details Details */ extern int write_enable(int fd); extern int makeup_instruction(uint8_t ins, uint32_t addr, uint8_t addr_len, uint8_t *buffer); extern int write_addr(int fd, uint32_t addr, uint8_t addr_len, uint8_t * data, uint32_t data_len); extern int sector_program(int fd, uint32_t addr, uint8_t addr_len, uint8_t * data); typedef struct { uint8_t byte0; uint8_t byte1; uint8_t byte2; uint8_t byte3; } fourbyte; #endif
// // LASecurityClient.h // LightApiClient // // Created by Developer iOS on 6/13/13. // Copyright (c) 2013 BitBlox. All rights reserved. // #import <Foundation/Foundation.h> @protocol LASecurityProvider <NSObject> /*! @function secureRequest: @abstract secures the provided request. @param request the request to secure */ -(void)secureRequest:(NSMutableURLRequest*)request; /*! @function loginUser:username:password:callback @abstract Logs a user in with a username/password @param username username @param password password @param callback the completion callback */ -(void)loginUser:(NSString*)username password:(NSString*)password callback:(void(^)(NSString* username, NSError *error))callback; /*! @function logout @abstract Logs a user out */ -(void)logout; /*! @function loginUser:username:password:callback @abstract Logs a user in with a username/password @param username username @param password password @param callback the completion callback */ -(void)refreshCredentialToQueue:(NSOperationQueue*)queue completionCallback:(void(^)(NSString* username, NSError *error))callback; -(BOOL)requiresLogin; -(BOOL)requiresRefresh; -(NSString*)currentUser; @end
//======================================================================================== // // $HeadURL: svn://localhost/izine/iZinePlns/Codebase/trunk/iZinePublish/SDK/Public/IZP_MessageID.h $ // $Revision: 3572 $ // $Date: 2011-08-11 08:47:35 +0200 (Thu, 11 Aug 2011) $ // $Author: aman.alam $ // // Creator: Raj Kumar Sehrawat // Created: 13-5-2011 // Copyright: 2008-2011 iZine Publish. All rights reserved. // // Description: //======================================================================================== #ifndef _h_IZP_MessageID_ #define _h_IZP_MessageID_ #pragma once // Message IDs: DECLARE_PMID(kMessageIDSpace, kZPLogin_BeforeLoginMsg, kIZPPrefix + 0 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_AuthenticationInProgressMsg, kIZPPrefix + 1 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_AuthenticationDoneMsg, kIZPPrefix + 2 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_ConfigDataFetchingMsg, kIZPPrefix + 3 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_ConfigDataFetchedMsg, kIZPPrefix + 4 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_BeforeLoggedInMsg, kIZPPrefix + 5 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_LoggedInMsg, kIZPPrefix + 6 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_BeforeLogoutMsg, kIZPPrefix + 7 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_NotLoggedInMsg, kIZPPrefix + 8 ) DECLARE_PMID(kMessageIDSpace, kZPLogin_CanLogoutMsg, kIZPPrefix + 9 ) //Send by WSResponseHandler if the response is not handled explicitly. // Changed by is the AZPSoapResponse *. DECLARE_PMID(kMessageIDSpace, kZPWSResponseAvailable, kIZPPrefix + 30 ) DECLARE_PMID(kMessageIDSpace, kZPAppStateChanged, kIZPPrefix + 40 ) //Send by Title Mgr DECLARE_PMID(kMessageIDSpace, kZPTitleListWillChange, kIZPPrefix + 50 ) DECLARE_PMID(kMessageIDSpace, kZPTitleListChanged, kIZPPrefix + 51 ) //Send by TitleStatus Mgr with protocol IZPTitleStatusMgr::kDefaultIID & by StatusList with protocol IZPStatusList::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPTitleStatusListWillChange, kIZPPrefix + 52 ) DECLARE_PMID(kMessageIDSpace, kZPTitleStatusListChanged, kIZPPrefix + 53 ) //Send by Edition Mgr with protocol IZPEditionMgr::kDefaultIID & by EditionList with protocol IZPEditionList::kDefaultIID //Changed by is the edition list pointer which was changed. Can be nil if msg is sent by mgr. DECLARE_PMID(kMessageIDSpace, kZPEditionListWillChange, kIZPPrefix + 54 ) DECLARE_PMID(kMessageIDSpace, kZPEditionListChanged, kIZPPrefix + 55 ) //Send by AssetList with protocol IZPAssetList::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPAssetListWillChangeMsg, kIZPPrefix + 56 ) DECLARE_PMID(kMessageIDSpace, kZPAssetListChangedMsg, kIZPPrefix + 57 ) //Send by dbAsset with protocol IZPDataName, changed by is PMString new name DECLARE_PMID(kMessageIDSpace, kZPDataNameWillChangeMsg, kIZPPrefix + 70 ) //Send by dbAsset with protocol IZPDataName DECLARE_PMID(kMessageIDSpace, kZPDataNameChangedMsg, kIZPPrefix + 71 ) //Send by AssetInfo with protocol IZPAssetInfo::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPAssetInfoChangedMsg, kIZPPrefix + 72 ) //Send by AssetLockInfo with protocol IZPAssetLockInfo::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPAssetLockInfoChangedMsg, kIZPPrefix + 73 ) //Send by CZPModifyAssetLocalInfoCmd with protocol IZPAssetLocalInfo::kDefaultIID //Changed by is the command that changed. DECLARE_PMID(kMessageIDSpace, kZPAssetLocalInfoChangedMsg, kIZPPrefix + 74 ) //Send by TaskStatus Mgr with protocol IZPTaskStatusMgr::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPTaskStatusListWillChange, kIZPPrefix + 80 ) DECLARE_PMID(kMessageIDSpace, kZPTaskStatusListChanged, kIZPPrefix + 81 ) //Send by User Mgr with protocol IZPUserMgr::kDefaultIID & by UserList with protocol IZPUserList::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPUserListWillChangeMsg, kIZPPrefix + 82 ) DECLARE_PMID(kMessageIDSpace, kZPUserListChangedMsg, kIZPPrefix + 83 ) //Send by Task Mgr with protocol IZPTaskMgr::kDefaultIID & by TaskList with protocol IZPTaskList::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPTaskListWillChangeMsg, kIZPPrefix + 84 ) DECLARE_PMID(kMessageIDSpace, kZPTaskListChangedMsg, kIZPPrefix + 85 ) //Send by TaskInfo with protocol IZPTaskInfo::kDefaultIID //Send by TaskMgr with protocol IZPTaskMgr::kDefaultIID, changed by is IStringData * of dbTaskID, used where multiple object listening is not required. DECLARE_PMID(kMessageIDSpace, kZPTaskInfoChangedMsg, kIZPPrefix + 86 ) //Send by TaskCategory Mgr with protocol IZPTaskCategoryMgr::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPTaskCategoryListWillChange, kIZPPrefix + 87 ) DECLARE_PMID(kMessageIDSpace, kZPTaskCategoryListChanged, kIZPPrefix + 88 ) //Send by Preview Mgr with protocol IZPPreviewMgr::kDefaultIID DECLARE_PMID(kMessageIDSpace, kZPAssetThumbnailAvailableMsg, kIZPPrefix + 100 ) #endif //_h_IZP_MessageID_
/* This file is part of the KDE project Copyright (C) 2000, 2005 Alexander Neundorf <neundorf@kde.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 __SMBRODLG_H #define __SMBRODLG_H #include <qwidget.h> #include <qlineedit.h> #include <qcheckbox.h> #include <kcmodule.h> class KComboBox; class SMBRoOptions : public KCModule { Q_OBJECT public: SMBRoOptions(QWidget *parent = 0); ~SMBRoOptions(); virtual void load(); virtual void save(); virtual void defaults(); QString quickHelp() const; private slots: void changed(); private: QLineEdit *m_userLe; QLineEdit *m_passwordLe; // QLineEdit *m_workgroupLe; //currently unused, Alex // QCheckBox *m_showHiddenShares; //currently unused, Alex // KComboBox *m_encodingList; //currently unused }; #endif
#ifndef CBMSTSHODOCORRELATIONS_H #define CBMSTSHODOCORRELATIONS_H #include "FairTask.h" class TClonesArray; class TH2F; class CbmStsHodoCorrelations : public FairTask { public: /** Default constructor **/ CbmStsHodoCorrelations(); /** Destructor **/ ~CbmStsHodoCorrelations(); /** Initiliazation of task at the beginning of a run **/ virtual InitStatus Init(); /** ReInitiliazation of task when the runID changes **/ virtual InitStatus ReInit(); /** Executed for each event. **/ virtual void Exec(Option_t* opt); /** Load the parameter container from the runtime database **/ virtual void SetParContainers(); /** Finish task called at the end of the run **/ virtual void Finish(); private: /** Input array from previous already existing data level **/ // TClonesArray* fStsDigi; /** Output array to new data level**/ TClonesArray* fHodoCluster; TH2F* hodo1_pos_sts0; TH2F* hodo2_pos_sts0; TH2F* hodo1_pos_sts1; TH2F* hodo2_pos_sts1; TH2F* hodo1_pos_sts2; TH2F* hodo2_pos_sts2; CbmStsHodoCorrelations(const CbmStsHodoCorrelations&); CbmStsHodoCorrelations operator=(const CbmStsHodoCorrelations&); ClassDef(CbmStsHodoCorrelations,1); }; #endif
/* * %kadu copyright begin% * Copyright 2012 Bartosz Brachaczek (b.brachaczek@gmail.com) * Copyright 2009, 2010, 2011, 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) * %kadu copyright end% * * 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/>. */ #pragma once #include "buddies/buddy-list.h" class KADUAPI OpenChatWithRunner { public: virtual ~OpenChatWithRunner() { } virtual BuddyList matchingContacts(const QString &query) = 0; };
/* * dw9712.c - focuser driver * * Copyright (c) 2011, NVIDIA, All Rights Reserved. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ #include <linux/delay.h> #include <linux/fs.h> #include <linux/i2c.h> #include <linux/miscdevice.h> #include <linux/regulator/consumer.h> #include <linux/slab.h> #include <linux/uaccess.h> #include <media/dw9712.h> #include <linux/gpio.h> #if defined(CONFIG_REGULATOR_CAM_SUBPMIC_LP8720) #include <linux/regulator/lp8720.h> extern void subpm_set_output(subpm_output_enum outnum, int onoff); extern void subpm_output_enable(void); #endif #define POS_LOW (100) #define POS_HIGH (900) #define SETTLETIME_MS 100 #define FOCAL_LENGTH (4.49f) #define FNUMBER (2.8f) #define DW9712_MAX_RETRIES (3) #define IMX111_VCM_PWD_GPIO 83 //TEGRA_GPIO_PK03 struct dw9712_info { struct i2c_client *i2c_client; struct dw9712_config config; }; static struct dw9712_info *info; static int dw9712_write(struct i2c_client *client, u16 value) { int count; struct i2c_msg msg[1]; unsigned char data[2]; int retry = 0; if (!client->adapter) return -ENODEV; data[0] = value >> 8; data[1] = value & 0xff; msg[0].addr = client->addr; msg[0].flags = 0; msg[0].len = ARRAY_SIZE(data); msg[0].buf = data; do { count = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg)); if (count == ARRAY_SIZE(msg)) return 0; retry++; pr_err("dw9712: i2c transfer failed, retrying %x\n", value); msleep(1); } while (retry <= DW9712_MAX_RETRIES); return -EIO; } static int dw9712_set_position(struct dw9712_info *info, u32 position) { int err; u16 value; u8 *ptr = (u8 *)&value; pr_info("%s %d\n", __func__, position); if (position < info->config.pos_low || position > info->config.pos_high){ pr_err(" !! RETURN !! position = %d, info->config.pos_low = %d, info->config.pos_high = %d\n", position, info->config.pos_low, info->config.pos_high); return -EINVAL; } value = 0x0; ptr[1] = (u8)((position>>4) & 0x3F); ptr[0] = (u8)(((position & 0xf) << 4) | 0xe); // Bit 0-1: set delay time. Bit 2-3: set incre err = dw9712_write(info->i2c_client, value); if (err) { pr_err("[CAM] DW9712: %s: set position failed\n", __func__); } return err; } static long dw9712_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct dw9712_info *info = file->private_data; int ret; pr_info("%s\n", __func__); switch (cmd) { case DW9712_IOCTL_GET_CONFIG: { if (copy_to_user((void __user *) arg, &info->config, sizeof(info->config))) { pr_err("%s: 0x%x\n", __func__, __LINE__); return -EFAULT; } break; } case DW9712_IOCTL_SET_POSITION: ret = dw9712_set_position(info, (u32) arg); return ret; default: return -EINVAL; } return 0; } static int dw9712_power_on(void) { #if defined(CONFIG_REGULATOR_CAM_SUBPMIC_LP8720) pr_info("LP8720 CamPMIC Focuser Power ON ++\n"); subpm_set_output(LDO5,1); subpm_output_enable(); mdelay(20); #endif return 0; } static int dw9712_power_off(void) { #if defined(CONFIG_REGULATOR_CAM_SUBPMIC_LP8720) pr_info("LP8720 CamPMIC Focuser Power OFF ++\n"); subpm_set_output(LDO5,0); subpm_output_enable(); udelay(10); #endif return 0; } static int dw9712_open(struct inode *inode, struct file *file) { pr_info("%s\n", __func__); dw9712_power_on(); file->private_data = info; return 0; } int dw9712_release(struct inode *inode, struct file *file) { pr_info("%s\n", __func__); file->private_data = NULL; dw9712_power_off(); return 0; } static const struct file_operations dw9712_fileops = { .owner = THIS_MODULE, .open = dw9712_open, .unlocked_ioctl = dw9712_ioctl, .release = dw9712_release, }; static struct miscdevice dw9712_device = { .minor = MISC_DYNAMIC_MINOR, .name = "dw9712", .fops = &dw9712_fileops, }; static int dw9712_probe(struct i2c_client *client, const struct i2c_device_id *id) { int err; pr_info("%s\n", __func__); info = kzalloc(sizeof(struct dw9712_info), GFP_KERNEL); if (!info) { pr_err("dw9712: Unable to allocate memory!\n"); return -ENOMEM; } err = misc_register(&dw9712_device); if (err) { pr_err("dw9712: Unable to register misc device!\n"); kfree(info); return err; } info->i2c_client = client; info->config.settle_time = SETTLETIME_MS; info->config.focal_length = FOCAL_LENGTH; info->config.fnumber = FNUMBER; info->config.pos_low = POS_LOW; info->config.pos_high = POS_HIGH; i2c_set_clientdata(client, info); return 0; } static int dw9712_remove(struct i2c_client *client) { struct dw9712_info *info; pr_info("%s\n", __func__); info = i2c_get_clientdata(client); misc_deregister(&dw9712_device); kfree(info); return 0; } static const struct i2c_device_id dw9712_id[] = { { "dw9712", 0 }, { }, }; MODULE_DEVICE_TABLE(i2c, dw9712_id); static struct i2c_driver dw9712_i2c_driver = { .driver = { .name = "dw9712", .owner = THIS_MODULE, }, .probe = dw9712_probe, .remove = dw9712_remove, .id_table = dw9712_id, }; static int __init dw9712_init(void) { pr_info("dw9712 sensor driver loading\n"); i2c_add_driver(&dw9712_i2c_driver); return 0; } static void __exit dw9712_exit(void) { i2c_del_driver(&dw9712_i2c_driver); } module_init(dw9712_init); module_exit(dw9712_exit);
#pragma once class Object; class ObjPhysics; #include <fstream> #include "Errors.h" #include <SDL/SDL.h> #include <GL/glew.h> #include <vector> #include <map> using namespace std; class ObjLoader { public: ObjLoader(); float *calculateNormal(float *ptr_coord1, float *ptr_coord2, float *ptr_coord3); int load(char *ptr_fileName); void Draw(ObjPhysics*, int); void Release(); float *ptr_normals; float *ptr_facesTriangles; float *ptr_vertexBuffer; long _totalConnectedPoints; long _totalConnectedTriangles; bool fallMove; };
#ifndef _CHAINE_H_ #define _CHAINE_H_ #include <stdlib.h> #include <stdio.h> #include <string.h> //retourne la position du caractère chrSep dans la chaine strSource //ou -1 si celui-ci n'est pas présent dans la chaine int strchrind(char * strSource,char chrSep); // permet d'insérer la chaine pointée par "strBetween" juste avant le premier séparateur "chrSep" // dans la chaine strSource. Le tout est pointé par "pstrDestination" une autre chaine // qui aura du être allouée avant d'être appelée dans cette fonction. void strcpybtw(char ** pstrDestination, char * strSource,char * strBetween,char chrSep); #endif
// // MyChannelDetailContentTableViewCell.h // DaQingZao // // Created by 吴启飞 on 15/4/7. // Copyright (c) 2015年 吴启飞. All rights reserved. // #import <UIKit/UIKit.h> @interface MyChannelDetailContentTableViewCell : UITableViewCell @property (nonatomic, weak) IBOutlet UIButton *playButton; @property (nonatomic, weak) IBOutlet UILabel *channelTitle; @property (nonatomic, weak) IBOutlet UILabel *createTime; @property (nonatomic, weak) IBOutlet UILabel *totalTime; @property (nonatomic, weak) IBOutlet UIButton *downloadChannelButton; @property (nonatomic, weak) IBOutlet UIButton *chooseChannelButton; @property (nonatomic, weak) IBOutlet UIProgressView *downloadProgress; @property (nonatomic,strong) SongEntity *songEntity; @property (nonatomic,assign) NSInteger sceneIndex; @end
/* Task_exit_extension * * This routine is the task exitted user extension. * * Input parameters: NONE * * Output parameters: NONE * * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * $Id$ */ #include "system.h" void Task_exit_extension( rtems_tcb *running_task ) { if ( task_number( running_task->Object.id ) > 0 ) { puts_nocr( "RTEMS_TASK_EXITTED - extension invoked for " ); put_name( Task_name[ task_number( running_task->Object.id ) ], TRUE ); } puts("*** END OF TEST 7 ***" ); rtems_test_exit( 0 ); }
/* * Xournal++ * * A link destination in a PDF Document * * @author Xournal++ Team * https://github.com/xournalpp/xournalpp * * @license GNU GPLv2 or later */ #pragma once #include <StringUtils.h> #include <gtk/gtk.h> typedef struct _LinkDest XojLinkDest; typedef struct _LinkDestClass XojLinkDestClass; class LinkDestination { public: LinkDestination(); virtual ~LinkDestination(); public: size_t getPdfPage(); void setPdfPage(size_t page); void setExpand(bool expand); bool getExpand(); bool shouldChangeLeft(); bool shouldChangeZoom(); bool shouldChangeTop(); double getZoom(); double getLeft(); double getTop(); void setChangeLeft(double left); void setChangeZoom(double zoom); void setChangeTop(double top); void setName(string name); string getName(); private: XOJ_TYPE_ATTRIB; size_t page; bool expand; double left; double top; double zoom; bool changeLeft; bool changeZoom; bool changeTop; string name; }; struct _LinkDest { GObject base_instance; LinkDestination* dest; }; enum { DOCUMENT_LINKS_COLUMN_NAME, DOCUMENT_LINKS_COLUMN_LINK, DOCUMENT_LINKS_COLUMN_EXPAND, DOCUMENT_LINKS_COLUMN_PAGE_NUMBER }; #define TYPE_LINK_DEST (link_dest_get_type()) #define LINK_DEST(object) (G_TYPE_CHECK_INSTANCE_CAST((object), TYPE_LINK_DEST, XojLinkDest)) #define LINK_DEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_LINK_DEST, XojLinkDestClass)) #define IS_LINK_DEST(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), TYPE_LINK_DEST)) #define IS_LINK_DEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_LINK_DEST)) #define LINK_DEST_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), TYPE_LINK_DEST, XojLinkDestClass)) GType link_dest_get_type(void) G_GNUC_CONST; XojLinkDest* link_dest_new();
/* * gexiv2-preview-image.h * * Author(s) * Jim Nelson <jim@yorba.org> * * This is free software. See COPYING for details. */ #ifndef __GEXIV2_PREVIEW_IMAGE_H__ #define __GEXIV2_PREVIEW_IMAGE_H__ #include <glib-object.h> #include <gio/gio.h> G_BEGIN_DECLS #define GEXIV2_TYPE_PREVIEW_IMAGE \ (gexiv2_preview_image_get_type ()) #define GEXIV2_PREVIEW_IMAGE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEXIV2_TYPE_PREVIEW_IMAGE, GExiv2PreviewImage)) #define GEXIV2_IS_PREVIEW_IMAGE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEXIV2_TYPE_PREVIEW_IMAGE)) #define GEXIV2_PREVIEW_IMAGE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), GEXIV2_TYPE_PREVIEW_IMAGE, GExiv2PreviewImageClass)) #define GEXIV2_IS_PREVIEW_IMAGE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GEXIV2_TYPE_PREVIEW_IMAGE)) #define GEXIV2_PREVIEW_IMAGE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GEXIV2_TYPE_PREVIEW_IMAGE, GExiv2PreviewImageClass)) #define GEXIV2_PREVIEW_IMAGE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GEXIV2_TYPE_PREVIEW_IMAGE, GExiv2PreviewImagePrivate)) typedef struct _GExiv2PreviewImage GExiv2PreviewImage; typedef struct _GExiv2PreviewImageClass GExiv2PreviewImageClass; typedef struct _GExiv2PreviewImagePrivate GExiv2PreviewImagePrivate; struct _GExiv2PreviewImage { GObject parent_instance; /*< private >*/ GExiv2PreviewImagePrivate *priv; }; struct _GExiv2PreviewImageClass { GObjectClass parent_class; }; /* basic functions */ GType gexiv2_preview_image_get_type (void); /** * gexiv2_preview_image_free: * * Releases the preview image and all associated memory. */ void gexiv2_preview_image_free (GExiv2PreviewImage *self); /* preview image properties */ /** * gexiv2_preview_image_get_data: * @size: (out) (skip): The size of the buffer holding the data * * Returns: (transfer none) (array length=size): The raw image data */ const guint8* gexiv2_preview_image_get_data (GExiv2PreviewImage *self, guint32 *size); /** * gexiv2_preview_image_get_mime_type: * * Returns: (transfer-none): The preview image's MIME type. */ const gchar* gexiv2_preview_image_get_mime_type (GExiv2PreviewImage *self); /** * gexiv2_preview_image_get_extension: * * Returns: (transfer-none): The preview image's recommended file extension. */ const gchar* gexiv2_preview_image_get_extension (GExiv2PreviewImage *self); /** * gexiv2_preview_image_get_width: * * Returns: The preview image's display width in pixels. */ guint32 gexiv2_preview_image_get_width (GExiv2PreviewImage *self); /** * gexiv2_preview_image_get_height: * * Returns: The preview image's display height in pixels. */ guint32 gexiv2_preview_image_get_height (GExiv2PreviewImage *self); /** * gexiv2_preview_image_write_file: * @path: (in): The file path to write the preview image to. * * Returns: The number of bytes written to the file. */ glong gexiv2_preview_image_write_file (GExiv2PreviewImage *self, const gchar *path); G_END_DECLS #endif /* __GEXIV2_PREVIEW_IMAGE_H__ */
#ifndef _GSB_FORM_H #define _GSB_FORM_H (1) #include <gtk/gtk.h> /* START_INCLUDE_H */ /* END_INCLUDE_H */ /** returned values want ask for the origin * must be < 0 because 0 and more are reserved for account numbers */ enum origin_values { ORIGIN_VALUE_OTHER = -3, ORIGIN_VALUE_HOME, ORIGIN_VALUE_SCHEDULED }; /* START_DECLARATION */ gboolean gsb_form_allocate_size ( GtkWidget *table, GtkAllocation *allocation, gpointer null ); gboolean gsb_form_button_press_event ( GtkWidget *entry, GdkEventButton *ev, gint *ptr_origin ); gboolean gsb_form_change_sensitive_buttons ( gboolean sensitive ); void gsb_form_check_auto_separator ( GtkWidget *entry ); gboolean gsb_form_clean ( gint account_number ); void gsb_form_create_widgets ( void ); gboolean gsb_form_entry_get_focus ( GtkWidget *entry ); gboolean gsb_form_entry_lose_focus ( GtkWidget *entry, GdkEventFocus *ev, gint *ptr_origin ); gboolean gsb_form_escape_form ( void ); gboolean gsb_form_fill_by_transaction ( gint transaction_number, gint is_transaction, gboolean grab_focus ); void gsb_form_fill_element ( gint element_number, gint account_number, gint transaction_number, gboolean is_transaction ); gboolean gsb_form_fill_from_account ( gint account_number ); gboolean gsb_form_finish_edition ( void ); gint gsb_form_get_account_number ( void ); gint gsb_form_get_element_expandable ( gint element_number ); GtkWidget *gsb_form_get_element_widget_from_list ( gint element_number, GSList *list ); GtkWidget *gsb_form_get_form_widget ( void ); gint gsb_form_get_origin ( void ); GtkWidget *gsb_form_get_scheduler_part ( void ); gboolean gsb_form_is_visible ( void ); gboolean gsb_form_key_press_event ( GtkWidget *widget, GdkEventKey *ev, gint *ptr_origin ); GtkWidget *gsb_form_new ( void ); gboolean gsb_form_set_expander_visible ( gboolean visible, gboolean transactions_list ); gboolean gsb_form_set_sensitive ( gboolean split, gboolean split_child); gboolean gsb_form_show ( gboolean show ); gboolean gsb_form_switch_expander ( void ); /* END_DECLARATION */ #endif
// Copyright 2015 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <string> #include "InputCommon/ControllerEmu/ControllerEmu.h" struct KeyboardStatus; namespace ControllerEmu { class ControlGroup; class Buttons; } enum class KeyboardGroup { Kb0x, Kb1x, Kb2x, Kb3x, Kb4x, Kb5x, Options }; class GCKeyboard : public ControllerEmu::EmulatedController { public: explicit GCKeyboard(unsigned int index); KeyboardStatus GetInput() const; std::string GetName() const override; ControllerEmu::ControlGroup* GetGroup(KeyboardGroup group); void LoadDefaults(const ControllerInterface& ciface) override; private: ControllerEmu::Buttons* m_keys0x; ControllerEmu::Buttons* m_keys1x; ControllerEmu::Buttons* m_keys2x; ControllerEmu::Buttons* m_keys3x; ControllerEmu::Buttons* m_keys4x; ControllerEmu::Buttons* m_keys5x; ControllerEmu::ControlGroup* m_options; const unsigned int m_index; };
/**************************************************************************** * VCGLib o o * * Visual and Computer Graphics Library o o * * _ O _ * * Copyright(C) 2004 \/)\/ * * Visual Computing Lab /\/| * * ISTI - Italian National Research Council | * * \ * * All rights reserved. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; 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 (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * ****************************************************************************/ #include <common/filterparameter.h> #include <../edit_align/align/AlignPair.h> #include <vcg/simplex/face/base.h> class AlignParameter { public: //translates the filter parameters into align parameters static void buildAlignParameters(RichParameterSet &fps, vcg::AlignPair::Param &app); //translates the align parameters into filter parameters static void buildRichParameterSet(vcg::AlignPair::Param &app, RichParameterSet &fps); private: //no need to have an instance of this class AlignParameter(); };
#ifndef __MIKOOS_PRINTK_H #define __MIKOOS_PRINTK_H #include <mikoOS/stdarg.h> extern void printk(char *format, ...) __attribute__((format(printf, 1, 2))); extern void cls(void); #endif // __MIKOOS_PRINTK_H
#ifndef GSCRIPT_SCRIPT_H #define GSCRIPT_SCRIPT_H #include <moo/unit-tests.h> #include <QObject> #include <QVariant> #include <QScriptEngine> namespace ggap { class Worksheet; } namespace gs { class Session; class Canvas; class CanvasWindow; class Form; class ScriptRunner : public QObject { Q_OBJECT MOO_DECLARE_UNIT_TESTS() bool runScript(const QString &script, const QString &filename, QString *error = 0); protected: virtual void setupEngine(QScriptEngine &engine, QScriptValue &global_obj); public: ScriptRunner(QObject *parent = 0); ~ScriptRunner(); bool runScript(const QString &script, QString *error = 0); bool runFile(const QString &filename, QString *error = 0); }; class SessionScript : public ScriptRunner { Q_OBJECT MOO_DECLARE_UNIT_TESTS() protected: Session *session; void setupEngine(QScriptEngine &engine, QScriptValue &global_obj); public: SessionScript(Session *session, QObject *parent = 0); ~SessionScript(); Q_INVOKABLE void sendResult(int requestId, const QVariant &value); static void postSignal(Session *session, int objId, const QString &signalName, int requestId, const QString &funcName, const QVariant &funcData); }; class WorksheetScript : public SessionScript { Q_OBJECT MOO_DECLARE_UNIT_TESTS() ggap::Worksheet *ws; protected: void setupEngine(QScriptEngine &engine, QScriptValue &global_obj); public: WorksheetScript(ggap::Worksheet *ws, Session *session, QObject *parent = 0); ~WorksheetScript(); //Q_INVOKABLE void embedObject(int id, const QVariantMap &params = QVariantMap()); Q_INVOKABLE bool openUrl(const QString &url); }; void registerMetaTypes(QScriptEngine *engine); void setupInstance(QObject *obj, Session *session); void addScriptHelpers(QScriptEngine &engine, QScriptValue &globalObj, Session *session); void setObjectProperties(QObject *object, const QVariantMap &props); class ScriptHelper : public QObject { private: Session *_session; public: ScriptHelper(Session *session) : _session(session) { } Session *session() const { return _session; } }; template<typename HelperType> inline void addScriptHelper(QScriptEngine &engine, QScriptValue &globalObj, Session *session, const QString &objName) { globalObj.setProperty(objName, engine.newQObject(new HelperType(session), QScriptEngine::ScriptOwnership)); } } // namespace gs #endif // GSCRIPT_SCRIPT_H
#ifndef _NET_XIA_HID_H #define _NET_XIA_HID_H #include <linux/netdevice.h> #include <linux/netlink.h> #include <net/xia_list_fib.h> /* Host Principal */ #define XIDTYPE_HID (__cpu_to_be32(0x11)) struct rtnl_xia_hid_hdw_addrs { __u16 hha_len; __u8 hha_addr_len; __u8 hha_ha[MAX_ADDR_LEN]; int hha_ifindex; }; static inline int RTHA_OK(struct rtnl_xia_hid_hdw_addrs *rtha, int len) { return len >= 0 && (unsigned)len >= sizeof(*rtha) && rtha->hha_len <= (unsigned)len; } static inline struct rtnl_xia_hid_hdw_addrs *RTHA_NEXT( struct rtnl_xia_hid_hdw_addrs *rtha) { return (struct rtnl_xia_hid_hdw_addrs *) (((char *)rtha) + NLMSG_ALIGN(rtha->hha_len)); } #ifdef __KERNEL__ #include <linux/timer.h> #include <linux/rtnetlink.h> #include <net/xia_fib.h> #include <net/xia_route.h> /* * HID context */ struct xip_hid_ctx { struct xip_ppal_ctx ctx; /* Simplify scanning network devices. */ struct net *net; /* NWP's state per struct net. */ atomic_t to_announce; atomic_t announced; atomic_t me; /* Number of local HIDs in ctx.xpc_xtbl. */ struct timer_list announce_timer; }; static inline struct xip_hid_ctx *ctx_hid(struct xip_ppal_ctx *ctx) { return likely(ctx) ? container_of(ctx, struct xip_hid_ctx, ctx) : NULL; } extern int hid_vxt; extern const struct xia_ppal_rt_iops *hid_rt_iops; /* * Neighborhood Watch Protocol (NWP) * * Exported by nwp.c */ /* * Neighbor Table */ /* Hardware Address. */ struct hrdw_addr { struct fib_xid_hid_main *mhid; struct list_head ha_list; struct list_head hdev_list; struct net_device *dev; struct xip_dst_anchor anchor; struct rcu_head rcu_head; /* Since @ha is at the end of struct hrdw_addr, one doesn't need to * enforce alignment, otherwise use the following line: * u8 ha[ALIGN(MAX_ADDR_LEN, sizeof(long))]; */ u8 ha[MAX_ADDR_LEN]; }; struct fib_xid_hid_main { struct list_head xhm_haddrs; atomic_t xhm_refcnt; bool xhm_dead; /* WARNING: @xhm_common is of variable size, and * MUST be the last member of the struct. */ struct fib_xid xhm_common; }; static inline struct fib_xid_hid_main *fxid_mhid(struct fib_xid *fxid) { return likely(fxid) ? container_of(fxid, struct fib_xid_hid_main, xhm_common) : NULL; } static inline void mhid_hold(struct fib_xid_hid_main *mhid) { atomic_inc(&mhid->xhm_refcnt); } /* Don't call this function directly, call mhid_put() instead. */ void mhid_finish_destroy(struct fib_xid_hid_main *mhid); static inline void mhid_put(struct fib_xid_hid_main *mhid) { if (atomic_dec_and_test(&mhid->xhm_refcnt)) mhid_finish_destroy(mhid); } int insert_neigh(struct xip_hid_ctx *hid_ctx, const char *id, struct net_device *dev, const u8 *lladdr, u32 rtnl_flags); int remove_neigh(struct fib_xid_table *xtbl, const char *id, struct net_device *dev, const u8 *lladdr); void main_free_hid(struct fib_xid_table *xtbl, struct fib_xid *fxid); /* * HID Device */ struct hid_dev { /* These fields are inspired by struct in_device. */ struct net_device *dev; atomic_t refcnt; int dead; struct rcu_head rcu_head; atomic_t neigh_cnt; spinlock_t neigh_lock; /* Lock for the neighs list. */ struct list_head neighs; }; static inline struct hid_dev *__hid_dev_get_rcu(const struct net_device *dev) { return rcu_dereference(dev->hid_ptr); } static inline struct hid_dev *hid_dev_get(const struct net_device *dev) { struct hid_dev *hdev; rcu_read_lock(); hdev = __hid_dev_get_rcu(dev); if (hdev) atomic_inc(&hdev->refcnt); rcu_read_unlock(); return hdev; } static inline struct hid_dev *__hid_dev_get_rtnl(const struct net_device *dev) { return rtnl_dereference(dev->hid_ptr); } void hid_dev_finish_destroy(struct hid_dev *hdev); static inline void hid_dev_put(struct hid_dev *hdev) { if (atomic_dec_and_test(&hdev->refcnt)) hid_dev_finish_destroy(hdev); } static inline void hid_dev_hold(struct hid_dev *hdev) { atomic_inc(&hdev->refcnt); } /* * Loading/unloading */ int hid_nwp_init(void); void hid_nwp_exit(void); int hid_init_hid_state(struct xip_hid_ctx *hid_ctx); void hid_release_hid_state(struct xip_hid_ctx *hid_ctx); #endif /* __KERNEL__ */ #endif /* _NET_XIA_HID_H */
/* * * Copyright (C) 2009 Gulessoft , Inc. * Written by Guo Hongruan (guo.hongruan@gulessoft.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. */ #include <linux/types.h> void * memset(void * s, int c, size_t count) { void *xs = s; size_t temp; if (!count) return xs; c &= 0xff; c |= c << 8; c |= c << 16; if ((long) s & 1) { char *cs = s; *cs++ = c; s = cs; count--; } if (count > 2 && (long) s & 2) { short *ss = s; *ss++ = c; s = ss; count -= 2; } temp = count >> 2; if (temp) { long *ls = s; for (; temp; temp--) *ls++ = c; s = ls; } if (count & 2) { short *ss = s; *ss++ = c; s = ss; } if (count & 1) { char *cs = s; *cs = c; } return xs; }
#ifndef VHDLJJPARSER_H #define VHDLJJPARSER_H #include "parserintf.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <ctype.h> #include <qarray.h> #include <qcstringlist.h> #include <qfile.h> #include <qdict.h> #include <string> #include "types.h" #include "entry.h" #include "vhdldocgen.h" #include "vhdlcode.h" #include "memberlist.h" #include "config.h" enum { GEN_SEC=0x1, PARAM_SEC,CONTEXT_SEC,PROTECTED_SEC } ; void parserVhdlfile(const char* inputBuffer); class Entry; class ClassSDict; class FileStorage; class ClassDef; class MemberDef; struct VhdlConfNode; /** \brief VHDL parser using state-based lexical scanning. * * This is the VHDL language parser for doxygen. */ class VHDLLanguageScanner : public ParserInterface { public: virtual ~VHDLLanguageScanner() {} void startTranslationUnit(const char *) {} void finishTranslationUnit() {} void parseInput(const char * fileName, const char *fileBuf, Entry *root, bool sameTranslationUnit, QStrList &filesInSameTranslationUnit); void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE ); bool needsPreprocessing(const QCString &) { return TRUE; } void resetCodeParserState(){}; void parsePrototype(const char *text); }; struct VhdlConfNode { VhdlConfNode(const char* a,const char* b,const char* config,const char* cs,bool leaf) { arch=a; // architecture e.g. for iobuffer arch=arch.lower(); binding=b; // binding e.g. use entiy work.xxx(bev) binding=binding.lower(); confVhdl=config; // configuration foo is bar compSpec=cs; isInlineConf=false; // primary configuration? isLeaf=leaf; }; QCString confVhdl; QCString arch; QCString binding; QCString compSpec; int level; bool isLeaf; bool isInlineConf; }; void vhdlscanFreeScanner(); QList<VhdlConfNode>& getVhdlConfiguration(); QList<Entry>& getVhdlInstList(); #endif
#ifndef JMYEXCEL_H #define JMYEXCEL_H #include "jmyoffice_global.h" #include <QObject> // - class JMyExcel - class JMyExcelPrivate; class JTableView; class QTabWidget; struct JFileNameInfo; class JMYOFFICE_EXPORT JMyExcel : public QObject { Q_OBJECT public: bool create(); bool saveAs(const QString &filePath); bool close(); bool show(bool enabled = true); bool setTitle(const JFileNameInfo &fileNameInfo, int columnCount); bool setSheetTitle(int index, const QString &text, int columnCount); bool setSiftArea(const JTableView *tableView); bool setSiftRestrain(const JTableView *tableView); bool setRecordData(const QTabWidget *tabWidget); bool saveBaseLineToSql(const QString &filePath); bool readBaseLine(const QString &filePath, QList<QVector<QPointF> > &groupsData); bool readBaseLine(QList<QVector<QPointF> > &groupsData); Q_SIGNALS: public Q_SLOTS: private: explicit JMyExcel(QObject *parent = 0); ~JMyExcel(); private: Q_DISABLE_COPY(JMyExcel) J_DECLARE_PRIVATE(JMyExcel) J_DECLARE_SINGLE_INSTANCE(JMyExcel) }; #endif // JMYEXCEL_H
/* I2C transfers from user space via the i2c chardev driver * * Copyright (c) 2010 LeapFrog Enterprises Inc. * * Andrey Yurovsky <ayurovsky@leapfrog.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. */ #ifndef __USER_I2C_H__ #define __USER_I2C_H__ #include <stdint.h> int i2c_read(unsigned chan, uint8_t addr, uint8_t reg, uint8_t *buf, unsigned count); int i2c_write(unsigned chan, uint8_t addr, uint8_t reg, uint8_t *buf, unsigned count); #endif /* __USER_I2C_H__ */
/* * tegra_soc.h -- SoC audio for tegra * * (c) 2010-2011 Nvidia Graphics Pvt. Ltd. * http://www.nvidia.com * * Copyright 2007 Wolfson Microelectronics PLC. * Author: Graeme Gregory * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * */ #ifndef __TEGRA_AUDIO__ #define __TEGRA_AUDIO__ #include <linux/init.h> #include <linux/module.h> #include <linux/device.h> #include <linux/delay.h> #include <linux/clk.h> #include <linux/jiffies.h> #include <linux/io.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/dma-mapping.h> #include <linux/kthread.h> #include <linux/moduleparam.h> #include <linux/timer.h> #include <linux/interrupt.h> #include <linux/i2c.h> #include <linux/tegra_audio.h> #include <linux/regulator/consumer.h> #include <mach/iomap.h> #include <mach/tegra2_i2s.h> #include <mach/spdif.h> #include <mach/irqs.h> #include <mach/pinmux.h> #include <mach/audio.h> #include <mach/tegra_das.h> #include <mach/dma.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/initval.h> #include <sound/soc.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc-dapm.h> #include <sound/soc-dai.h> #include <sound/tlv.h> #include <asm/io.h> #include <asm/mach-types.h> #include <asm/hardware/scoop.h> #include <linux/switch.h> #define STATE_INIT 0 #define STATE_ABORT 1 #define STATE_EXIT 2 #define STATE_EXITED 3 #define STATE_INVALID 4 #define I2S_I2S_FIFO_TX_BUSY I2S_I2S_STATUS_FIFO1_BSY #define I2S_I2S_FIFO_TX_QS I2S_I2S_STATUS_QS_FIFO1 #define I2S_I2S_FIFO_RX_BUSY I2S_I2S_STATUS_FIFO2_BSY #define I2S_I2S_FIFO_RX_QS I2S_I2S_STATUS_QS_FIFO2 #define I2S1_CLK 11289600 #define I2S2_CLK 2000000 #define TEGRA_DEFAULT_SR 44100 #define TEGRA_SAMPLE_RATES \ (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) #define TEGRA_VOICE_SAMPLE_RATES SNDRV_PCM_RATE_8000 #define DMA_STEP_SIZE_MIN 8 #define DMA_REQ_QCOUNT 2 #define TEGRA_AUDIO_OFF 0x0 #define TEGRA_HEADPHONE 0x1 #define TEGRA_LINEOUT 0x2 #define TEGRA_SPK 0x4 #define TEGRA_EAR_SPK 0x8 #define TEGRA_INT_MIC 0x10 #define TEGRA_EXT_MIC 0x20 #define TEGRA_LINEIN 0x40 #define TEGRA_HEADSET 0x80 struct tegra_dma_channel; struct tegra_runtime_data { struct snd_pcm_substream *substream; int size; int dma_pos; struct tegra_dma_req dma_req[DMA_REQ_QCOUNT]; int dma_reqid_head; int dma_reqid_tail; volatile int state; int period_index; int dma_state; struct tegra_dma_channel *dma_chan; }; struct tegra_audio_data { struct snd_soc_codec *codec; struct clk *dap_mclk; bool init_done; int play_device; int capture_device; bool is_call_mode; int codec_con; }; struct wired_jack_conf { int hp_det_n; int en_mic_int; int en_mic_ext; int cdc_irq; int en_spkr; const char *spkr_amp_reg; struct regulator *amp_reg; int amp_reg_enabled; }; struct headset_data { struct switch_dev sdev; struct input_dev *input; unsigned int irq; struct hrtimer timer; ktime_t debouncing_time; }; void tegra_ext_control(struct snd_soc_codec *codec, int new_con); int tegra_controls_init(struct snd_soc_codec *codec); int tegra_jack_init(struct snd_soc_codec *codec); void tegra_jack_exit(void); void tegra_jack_resume(void); void tegra_switch_set_state(int state); void setup_i2s_dma_request(struct snd_pcm_substream *substream, struct tegra_dma_req *req, void (*dma_callback)(struct tegra_dma_req *req), void *dma_data); void setup_spdif_dma_request(struct snd_pcm_substream *substream, struct tegra_dma_req *req, void (*dma_callback)(struct tegra_dma_req *req), void *dma_data); #endif
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ /* * (C) 2011 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ #include "mpiimpl.h" /* -- Begin Profiling Symbol Block for routine MPI_T_pvar_get_num */ #if defined(HAVE_PRAGMA_WEAK) #pragma weak MPI_T_pvar_get_num = PMPI_T_pvar_get_num #elif defined(HAVE_PRAGMA_HP_SEC_DEF) #pragma _HP_SECONDARY_DEF PMPI_T_pvar_get_num MPI_T_pvar_get_num #elif defined(HAVE_PRAGMA_CRI_DUP) #pragma _CRI duplicate MPI_T_pvar_get_num as PMPI_T_pvar_get_num #endif /* -- End Profiling Symbol Block */ /* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build the MPI routines */ #ifndef MPICH_MPI_FROM_PMPI #undef MPI_T_pvar_get_num #define MPI_T_pvar_get_num PMPI_T_pvar_get_num /* any non-MPI functions go here, especially non-static ones */ #undef FUNCNAME #define FUNCNAME MPIR_T_pvar_get_num_impl #undef FCNAME #define FCNAME MPIU_QUOTE(FUNCNAME) int MPIR_T_pvar_get_num_impl(int *num_pvar) { int mpi_errno = MPI_SUCCESS; /* no performance vars implemented at the moment */ mpi_errno = MPIR_T_get_num_pvars(num_pvar); if (mpi_errno) MPIU_ERR_POP(mpi_errno); fn_exit: return mpi_errno; fn_fail: goto fn_exit; } #endif /* MPICH_MPI_FROM_PMPI */ #undef FUNCNAME #define FUNCNAME MPI_T_pvar_get_num #undef FCNAME #define FCNAME MPIU_QUOTE(FUNCNAME) /*@ MPI_T_pvar_get_num - XXX description here Output Parameters: . num_pvar - returns number of performance variables (integer) .N ThreadSafe .N Fortran .N Errors @*/ int MPI_T_pvar_get_num(int *num_pvar) { int mpi_errno = MPI_SUCCESS; MPID_MPI_STATE_DECL(MPID_STATE_MPI_T_PVAR_GET_NUM); MPIU_THREAD_CS_ENTER(ALLFUNC,); MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_T_PVAR_GET_NUM); /* Validate parameters, especially handles needing to be converted */ # ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS { /* TODO more checks may be appropriate */ if (mpi_errno != MPI_SUCCESS) goto fn_fail; } MPID_END_ERROR_CHECKS } # endif /* HAVE_ERROR_CHECKING */ /* Convert MPI object handles to object pointers */ /* Validate parameters and objects (post conversion) */ # ifdef HAVE_ERROR_CHECKING { MPID_BEGIN_ERROR_CHECKS { MPIR_ERRTEST_ARGNULL(num_pvar, "num_pvar", mpi_errno); /* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */ } MPID_END_ERROR_CHECKS } # endif /* HAVE_ERROR_CHECKING */ /* ... body of routine ... */ mpi_errno = MPIR_T_pvar_get_num_impl(num_pvar); if (mpi_errno) MPIU_ERR_POP(mpi_errno); /* ... end of body of routine ... */ fn_exit: MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_T_PVAR_GET_NUM); MPIU_THREAD_CS_EXIT(ALLFUNC,); return mpi_errno; fn_fail: /* --BEGIN ERROR HANDLING-- */ # ifdef HAVE_ERROR_CHECKING { mpi_errno = MPIR_Err_create_code( mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_t_pvar_get_num", "**mpi_t_pvar_get_num %p", num_pvar); } # endif mpi_errno = MPIR_Err_return_comm(NULL, FCNAME, mpi_errno); goto fn_exit; /* --END ERROR HANDLING-- */ }
#ifndef _PREPARE_H_ #define _PREPARE_H_ #include <stdio.h> #include "spectrum.h" #include "cvector.h" void SetEnergyBins(const int min_energy_exp, dCVector* pEnergy, dCVector* pEnergyWidth); void SetDeltaG(const dCVector* pEnergy, dCVector* pDeltaG); void GetModeOfInput(FILE* input, int* pInputMethodSwitch); void BasicParameterInput(FILE* input, const int argc, int* pMinEnergyExp, int* pNumSmallSteps, double* pConvergeParameter, double* pStartingRedshift, double* pStartingDistanceInMpc); void InteractionParameterInput(FILE* input, const int argc, int* pSynchrotronSwitch, double* pB_0, int* pTauNeutrinoMassSwitch, int* pICSSwitch, int* pPPSwitch, int* pTPPSwitch, int* pDPPSwitch, int* pPPPSwitch, int* pNPPSwitch, int* pNeutronDecaySwitch, int* pNucleonToSecondarySwitch, int* pNeutrinoNeutrinoSwitch); void ModelParameterInput(FILE* input, const int argc, int* pSourceTypeSwitch, double* pMinDistance, double* pBrightPhaseExp, int* pModelTypeSwitch); /* CHANGE (Guenter; 7/20/1998): BrightPhaseExp added */ void PrepareSpectra(const int sourceTypeSwitch, const Spectrum* pQ_0, Spectrum* pSpectrum, Spectrum* pSpectrumNew, Spectrum* pDerivative); void ComputeTotalInitialContent(const dCVector* pEnergy, const Spectrum* pQ_0, double* initialPhotonEnergy, double* initialLeptonEnergy, double* initialNucleonEnergy, double* initialNeutrinoEnergy, double* initialTotalEnergy, double* initialPhotonNumber, double* initialLeptonNumber, double* initialNucleonNumber, double* initialNeutrinoNumber, double* initialTotalNumber); void ComputeContinuousEnergyLoss(const int synchrotronSwitch, const dCVector* synchrotronLoss, const dCVector* otherLoss, dCVector* continuousLoss); #endif
/* * Copyright (c) 2011 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. */ // This file includes specific signal processing tools used in vad_core.c. #ifndef COMMON_AUDIO_VAD_VAD_SP_H_ #define COMMON_AUDIO_VAD_VAD_SP_H_ #include "common_audio/vad/vad_core.h" // Downsamples the signal by a factor 2, eg. 32->16 or 16->8. // // Inputs: // - signal_in : Input signal. // - in_length : Length of input signal in samples. // // Input & Output: // - filter_state : Current filter states of the two all-pass filters. The // |filter_state| is updated after all samples have been // processed. // // Output: // - signal_out : Downsampled signal (of length |in_length| / 2). void WebRtcVad_Downsampling(const int16_t* signal_in, int16_t* signal_out, int32_t* filter_state, size_t in_length); // Updates and returns the smoothed feature minimum. As minimum we use the // median of the five smallest feature values in a 100 frames long window. // As long as |handle->frame_counter| is zero, that is, we haven't received any // "valid" data, FindMinimum() outputs the default value of 1600. // // Inputs: // - feature_value : New feature value to update with. // - channel : Channel number. // // Input & Output: // - handle : State information of the VAD. // // Returns: // : Smoothed minimum value for a moving window. int16_t WebRtcVad_FindMinimum(VadInstT* handle, int16_t feature_value, int channel); #endif // COMMON_AUDIO_VAD_VAD_SP_H_
// // XTBJpegLoader.h // XTBook // // Created by Kawada Tomoaki on 7/29/11. // Copyright 2011 Nexhawks. All rights reserved. // #pragma once #include "XTBStream.h" class jpeg_decoder; class XTBRichgelJpegStream; class XTBJpegLoader{ XTBStream *m_stream; XTBRichgelJpegStream *m_stream2; jpeg_decoder *m_decoder; void convert888To565(uint16_t *dest, const uint8_t *src, size_t pixels, int y); void convert8To565(uint16_t *dest, const uint8_t *src, size_t pixels, int y); public: static bool probe(XTBStream *); XTBJpegLoader(XTBStream *); ~XTBJpegLoader(); twDC *image(); };
/* * Copyright (C) 2014 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup examples * @{ * * @file * @brief Hello World application * * @author Kaspar Schleiser <kaspar@schleiser.de> * @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de> * * @} */ #include <stdio.h> #include "board.h" #include "periph_conf.h" #include "periph/gpio.h" #include "xtimer.h" #include "net/gnrc/netif.h" #include "net/gnrc/netapi.h" #include "net/netopt.h" /* static kernel_pid_t ifpid = 0; static netopt_state_t state; */ int main(void) { puts("Hello World!"); printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD); printf("This board features a(n) %s MCU.\n", RIOT_MCU); #ifdef MODULE_PM_LAYERED printf("MODULE_PM_LAYERED enabled\n"); #endif #ifdef MODULE_PERIPH_LLWU printf("MODULE_PERIPH_LLWU enabled \n"); #endif #ifdef KINETIS_HAVE_LPUART printf("KINETIS_HAVE_LPUART\n"); #endif #ifdef KINETIS_HAVE_UART printf("KINETIS_HAVE_UART\n"); #endif #ifdef UART0 printf("UART0 defined\n"); #endif #ifdef LPUART0 printf("LPUART0 defined\n"); #endif LED0_ON; LED1_OFF; /* initialize Network */ /* uint8_t t= 5; LED0_ON; LED1_OFF; while (t-->0) { LED0_TOGGLE; LED1_TOGGLE; xtimer_sleep(1); } LED0_OFF; LED1_OFF; gnrc_netif_t *iff = NULL; iff = gnrc_netif_iter (iff); ifpid = iff->pid; state = NETOPT_STATE_OFF; gnrc_netapi_set (ifpid, NETOPT_STATE, 0, &state , sizeof (state)); */ while(1){ LED0_TOGGLE; LED1_TOGGLE; xtimer_sleep(1); } return 0; }
// // NSArray+Globbing.h // ATVFiles // // Created by Eric Steil III on 4/8/07. // Copyright (C) 2007-2008 Eric Steil III // // 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 <Cocoa/Cocoa.h> @interface NSArray (Globbing) +(NSArray *)pathsMatchingPattern:(NSString *)pattern; @end
#ifndef INCLUDED_volk_32fc_deinterleave_real_64f_a16_H #define INCLUDED_volk_32fc_deinterleave_real_64f_a16_H #include <inttypes.h> #include <stdio.h> #ifdef LV_HAVE_SSE2 #include <emmintrin.h> /*! \brief Deinterleaves the complex vector into I vector data \param complexVector The complex input vector \param iBuffer The I buffer output data \param num_points The number of complex data values to be deinterleaved */ static inline void volk_32fc_deinterleave_real_64f_a16_sse2(double* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){ unsigned int number = 0; const float* complexVectorPtr = (float*)complexVector; double* iBufferPtr = iBuffer; const unsigned int halfPoints = num_points / 2; __m128 cplxValue, fVal; __m128d dVal; for(;number < halfPoints; number++){ cplxValue = _mm_load_ps(complexVectorPtr); complexVectorPtr += 4; // Arrange in i1i2i1i2 format fVal = _mm_shuffle_ps(cplxValue, cplxValue, _MM_SHUFFLE(2,0,2,0)); dVal = _mm_cvtps_pd(fVal); _mm_store_pd(iBufferPtr, dVal); iBufferPtr += 2; } number = halfPoints * 2; for(; number < num_points; number++){ *iBufferPtr++ = (double)*complexVectorPtr++; complexVectorPtr++; } } #endif /* LV_HAVE_SSE */ #ifdef LV_HAVE_GENERIC /*! \brief Deinterleaves the complex vector into I vector data \param complexVector The complex input vector \param iBuffer The I buffer output data \param num_points The number of complex data values to be deinterleaved */ static inline void volk_32fc_deinterleave_real_64f_a16_generic(double* iBuffer, const lv_32fc_t* complexVector, unsigned int num_points){ unsigned int number = 0; const float* complexVectorPtr = (float*)complexVector; double* iBufferPtr = iBuffer; for(number = 0; number < num_points; number++){ *iBufferPtr++ = (double)*complexVectorPtr++; complexVectorPtr++; } } #endif /* LV_HAVE_GENERIC */ #endif /* INCLUDED_volk_32fc_deinterleave_real_64f_a16_H */
/* * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved. * * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ /** * @file * * Processor stats for Posix systems. * */ #ifndef MCA_PSTAT_LINUX_EXPORT_H #define MCA_PSTAT_LINUX_EXPORT_H #include "opal_config.h" #include "opal/mca/mca.h" #include "opal/mca/pstat/pstat.h" BEGIN_C_DECLS /** * Globally exported variable */ OPAL_DECLSPEC extern const opal_pstat_base_component_t mca_pstat_linux_component; OPAL_DECLSPEC extern const opal_pstat_base_module_t opal_pstat_linux_module; END_C_DECLS #endif /* MCA_PSTAT_LINUX_EXPORT_H */
/* * * This file is part of Tulip (www.tulip-software.org) * * Authors: David Auber and the Tulip development Team * from LaBRI, University of Bordeaux * * Tulip 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. * * Tulip 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. * */ ///@cond DOXYGEN_HIDDEN #ifndef BMDLIST_H #define BMDLIST_H #ifndef DOXYGEN_NOTFOR_USER #include <cassert> #include <tulip/BmdLink.h> namespace tlp { template <typename TYPE> class BmdList { public: typedef tlp::BmdLink<TYPE> BMDTYPE; BmdList(); virtual ~BmdList(); BMDTYPE *firstItem(); BMDTYPE *lastItem(); TYPE entry(BMDTYPE *it); int size(); BMDTYPE *nextItem(BMDTYPE *p, BMDTYPE *predP); BMDTYPE *predItem(BMDTYPE *p, BMDTYPE *succP); BMDTYPE *cyclicPred(BMDTYPE *it, BMDTYPE *succIt); BMDTYPE *cyclicSucc(BMDTYPE *it, BMDTYPE *predIt); BMDTYPE *push(const TYPE &a); BMDTYPE *append(const TYPE &a); TYPE delItem(BMDTYPE *it); TYPE pop(); TYPE popBack(); void reverse(); void conc(BmdList<TYPE> &l); void clear(); void swap(BmdList<TYPE> &l); private: BMDTYPE *head; BMDTYPE *tail; int count; }; #include <tulip/cxx/BmdList.cxx> template<typename TYPE> struct BmdListIt : public Iterator<TYPE> { BmdListIt(BmdList<TYPE> &bmdList):bmdList(bmdList) { pos = bmdList.firstItem(); pred = 0; } bool hasNext() { return pos!=0; } TYPE next() { TYPE val = pos->getData(); tlp::BmdLink< TYPE > *tmp = pos; pos = bmdList.nextItem(pos, pred); pred = tmp; return val; } private: tlp::BmdLink< TYPE > *pos; tlp::BmdLink< TYPE > *pred; BmdList<TYPE> &bmdList; }; template<typename TYPE> struct BmdListRevIt : public Iterator<TYPE> { BmdListRevIt(BmdList<TYPE> &bmdList):bmdList(bmdList) { pos = bmdList.lastItem(); suc = 0; } bool hasNext() { return pos!=0; } TYPE next() { TYPE val = pos->getData(); tlp::BmdLink< TYPE > *tmp = pos; pos = bmdList.predItem(pos, suc); suc = tmp; return val; } private: tlp::BmdLink< TYPE > *pos; tlp::BmdLink< TYPE > *suc; BmdList<TYPE> &bmdList; }; } #endif #endif ///@endcond
/****************************************************************************/ /// @file TraCIServerAPI_VehicleType.h /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 /// @version $Id: TraCIServerAPI_VehicleType.h 22608 2017-01-17 06:28:54Z behrisch $ /// // APIs for getting/setting vehicle type values via TraCI /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO 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. // /****************************************************************************/ #ifndef TraCIServerAPI_VehicleType_h #define TraCIServerAPI_VehicleType_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif #ifndef NO_TRACI #include "TraCIException.h" #include "TraCIServer.h" #include <foreign/tcpip/storage.h> // =========================================================================== // class definitions // =========================================================================== /** * @class TraCIServerAPI_VehicleType * @brief APIs for getting/setting vehicle type values via TraCI */ class TraCIServerAPI_VehicleType { public: /** @brief Processes a get value command (Command 0xa5: Get Vehicle Type Variable) * * @param[in] server The TraCI-server-instance which schedules this request * @param[in] inputStorage The storage to read the command from * @param[out] outputStorage The storage to write the result to */ static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage); /** @brief Processes a value request for the given type * * @param[in] variable The type variable asked for * @param[in] v The vehicle type to get the value from * @param[out] tempMsg The storage to write the result to */ static bool getVariable(const int variable, const MSVehicleType& v, tcpip::Storage& tempMsg); /** @brief Processes a set value command (Command 0xc5: Change Vehicle Type State) * * @param[in] server The TraCI-server-instance which schedules this request * @param[in] inputStorage The storage to read the command from * @param[out] outputStorage The storage to write the result to */ static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage); /** @brief Processes a set value for the given type */ static bool setVariable(const int cmd, const int variable, MSVehicleType& v, TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage); private: /// @brief invalidated copy constructor TraCIServerAPI_VehicleType(const TraCIServerAPI_VehicleType& s); /// @brief invalidated assignment operator TraCIServerAPI_VehicleType& operator=(const TraCIServerAPI_VehicleType& s); }; #endif #endif /****************************************************************************/
/* * i18n.h * * Created: 18.07.2015 22:54:53 * Author: Trol */ #ifndef I18N_H_ #define I18N_H_ #define DEFSTR(name, string) const char name[] PROGMEM = string; DEFSTR(STR_UNKNOWN_OR_FAILED, "Unknown"); DEFSTR(STR_APPNAME, "IC-TESTER"); DEFSTR(STR_VERSION, "Version 0.6"); DEFSTR(STR_AUTODETECT, "Detect & Test"); DEFSTR(STR_CUSTOM_TEST, "Custom test"); DEFSTR(STR_MEM_TEST, "Memory test"); DEFSTR(STR_ABOUT, "About"); DEFSTR(STR_INSERT_CHIP, "Plug chip and"); DEFSTR(STR_AND_PRESS_BUTTON, "press \"Test\""); DEFSTR(STR_TESTING, "Testing..."); DEFSTR(STR_BACK, "Back"); DEFSTR(STR_SETUP, "setup"); DEFSTR(STR_EXIT, "exit"); DEFSTR(STR_OUT, "out"); DEFSTR(STR_RU5, "ÐÓ5"); DEFSTR(STR_RU7, "ÐÓ7"); DEFSTR(STR_CHIP, "Chip:"); DEFSTR(STR_NONE, "none"); DEFSTR(STR_4164, "4164"); DEFSTR(STR_41256, "41256"); DEFSTR(STR_DIP_8, "DIP-8"); DEFSTR(STR_DIP_14, "DIP-14"); DEFSTR(STR_DIP_16, "DIP-16"); DEFSTR(STR_DIP_20, "DIP-20"); DEFSTR(STR_TTL, "TTL"); DEFSTR(STR_CMOS, "CMOS"); DEFSTR(STR_COPYRIGHT_DATE, "(c) 2015"); DEFSTR(STR_COPYRIGHT_NAME, "Oleg Trifonov"); DEFSTR(STR_COPYRIGHT_NAME_2, "Sergey Bagan"); // #endif /* I18N_H_ */
/* * * Copyright (c) 1998-9 * Dr John Maddock * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Dr John Maddock makes no representations * about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. * */ /* * FILE re_coll.h * VERSION 2.12 * This is an internal header file, do not include directly */ #ifndef RE_COLL_H #define RE_COLL_H #ifndef JM_CFG_H #include <jm/jm_cfg.h> #endif #ifndef RE_STR_H #include <re_str.h> #endif JM_NAMESPACE(__JM) JM_IX_DECL bool RE_CALL re_lookup_def_collate_name(re_str<char>& buf, const char* name); void RE_CALL re_init_collate(); void RE_CALL re_free_collate(); void RE_CALL re_update_collate(); JM_IX_DECL bool RE_CALL __re_lookup_collate(re_str<char>& buf, const char* p); inline bool RE_CALL re_lookup_collate(re_str<char>& buf, const char* first, const char* last) { re_str<char> s(first, last); return __re_lookup_collate(buf, s.c_str()); } #ifndef JM_NO_WCSTRING JM_IX_DECL bool RE_CALL re_lookup_collate(re_str<wchar_t>& out, const wchar_t* first, const wchar_t* last); #endif JM_END_NAMESPACE #endif
/* * noumd.c is part of host2ms * Copyright (C) 2008 Poison * * 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/>. */ /* * Description: * Author: Poison <hbpoison@gmail.com> * Date Created: 2008-04-03 */ #include <pspkernel.h> #include <pspumd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "utils.h" #include "log.h" #include "umd.h" char * umd_executable[] = { "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", "disc0:/PSP_GAME/SYSDIR/BOOT.BIN", }; int mode = 0, executable = 0; void initUmdImageDriver() { CfwConfig config; memset( &config, 0, sizeof( CfwConfig ) ); getCfwConfig( &config ); mode = config.umdmode; executable = config.executebootbin; log( "umdmode %d exec %d\n", mode, executable ); switch ( mode ) { case MODE_MARCH33: { sceIoDelDrv( "isofs" ); killModule( "sceIsofs_driver" ); if ( !findProc( "pspMarch33_Driver", NULL, 0xcee8593c ) ) { sceIoDelDrv( "umd" ); } killModule( "pspMarch33_Driver" ); killSema( "Semaphore", "MediaManSema" ); break; } case MODE_NP9660: { sceIoDelDrv( "isofs" ); killModule( "sceIsofs_driver" ); sceIoDelDrv( "umd" ); killThread( "Thread", "SceNpUmdMount" ); killEventHandler( "SceUmdMedia" ); killModule( "sceNp9660_driver" ); killEventFlag( "EventFlag", "SceUmdManState" ); killEventFlag( "EventFlag", "SceMediaManUser" ); break; } } } void mountUmdImage( char * file ) { switch ( mode ) { case MODE_UMD: { mountUmdFromFile( file, 0, 0 ); break; } case MODE_OE_LEGACY: { mountUmdFromFile( file, 1, 1 ); break; } case MODE_MARCH33: { setInitApitype( 0x120 ); setInitFileName( file ); setUmdFile( file ); loadStartModule( "flash0:/kd/march33.prx", 0, NULL ); loadStartModule( "flash0:/kd/isofs.prx", 0, NULL ); break; } case MODE_NP9660: { setInitApitype( 0x120 ); setInitFileName( file ); setUmdFile( file ); loadStartModule( "flash0:/kd/mgr.prx", 0, NULL ); loadStartModule( "flash0:/kd/npdrm.prx", 0, NULL ); loadStartModule( "flash0:/kd/galaxy.prx", 0, NULL ); loadStartModule( "flash0:/kd/np9660.prx", 0, NULL ); loadStartModule( "flash0:/kd/isofs.prx", 0, NULL ); break; } } int stat = sceUmdCheckMedium(); if ( stat == 0 ) { log( "no media\n" ); sceUmdWaitDriveStat( UMD_WAITFORDISC ); } sceUmdActivate( 1, "disc0:" ); sceUmdWaitDriveStat( UMD_WAITFORINIT ); } int launchUmdImage() { int modid = sceKernelLoadModuleForLoadExecVSHDisc( umd_executable[executable], 0, NULL ); log( "load %s modid %08x\n", umd_executable[executable], modid ); if ( modid >= 0 ) { int status, len = strlen( umd_executable[executable] ) + 1; modid = sceKernelStartModule( modid, len, ( void * )umd_executable[executable], &status, NULL ); log( "start ret %08x\n", modid ); } return modid; }
/* This file is part of punani-strike * Copyright (c) 2011 Gianni Tedesco * Released under the terms of GPLv3 */ #include <punani/punani.h> #include <punani/vec.h> #include <punani/renderer.h> #include <punani/light.h> #include <punani/asset.h> #include <punani/blob.h> #include <punani/punani_gl.h> #include <math.h> #include "list.h" #include "assetfile.h" static LIST_HEAD(assets); static unsigned int num_indices(struct _asset_file *f) { unsigned int i, ret = 0; for(i = 0; i < f->f_hdr->h_num_assets; i++) { const struct asset_desc *d = f->f_desc + i; assert(!(d->a_num_idx % 3)); ret += d->a_num_idx; } return ret; } static struct _asset_file *do_open(const char *fn) { struct _asset_file *f = NULL; const uint8_t *end; f = calloc(1, sizeof(*f)); if ( NULL == f ) goto out; f->f_buf = blob_from_file(fn, &f->f_sz); if ( NULL == f->f_buf ) goto out_free; end = f->f_buf + f->f_sz; f->f_hdr = (struct assetfile_hdr *)f->f_buf; f->f_desc = (struct asset_desc *)(f->f_buf + sizeof(*f->f_hdr)); if ( f->f_hdr->h_magic != ASSETFILE_MAGIC ) { con_printf("asset: %s: bad magic\n", fn); goto out_free_blob; } f->f_verts = (struct asset_vbo *)(f->f_buf + sizeof(*f->f_hdr) + sizeof(*f->f_desc) * f->f_hdr->h_num_assets); f->f_idx_begin = (idx_t *)(f->f_verts + f->f_hdr->h_verts); if ( (uint8_t *)f->f_idx_begin > end ) goto out_free_blob; f->f_db = calloc(f->f_hdr->h_num_assets, sizeof(*f->f_db)); if ( NULL == f->f_db ) goto out_free_blob; f->f_name = strdup(fn); if ( NULL == f->f_name ) goto out_free_db; f->f_verts_ex = calloc(3 * sizeof(*f->f_verts_ex), 2 * f->f_hdr->h_verts); if ( NULL == f->f_verts_ex ) goto out_free_name; f->f_num_indices = num_indices(f); f->f_shadow_indices = /* two caps for each asset */ f->f_hdr->h_num_assets * 6 + /* plus 6 triangles for each triangle */ f->f_num_indices * 6; f->f_idx_shadow = calloc(sizeof(*f->f_verts_ex), f->f_shadow_indices); if ( NULL == f->f_idx_shadow ) goto out_free_verts_ex; /* success */ f->f_ref = 1; list_add_tail(&f->f_list, &assets); goto out; out_free_verts_ex: free(f->f_verts_ex); out_free_name: free(f->f_name); out_free_db: free(f->f_db); out_free_blob: blob_free((void *)f->f_buf, f->f_sz); out_free: free(f); f = NULL; out: return f; } static asset_file_t ref(asset_file_t f) { f->f_ref++; return f; } asset_file_t asset_file_open(const char *fn) { struct _asset_file *f; list_for_each_entry(f, &assets, f_list) { if ( !strcmp(f->f_name, fn) ) return ref(f); } return do_open(fn); } static void unref(asset_file_t f) { if ( f ) { f->f_ref--; if ( !f->f_ref) { glDeleteBuffers(1, &f->f_vbo_geom); glDeleteBuffers(1, &f->f_ibo_geom); glDeleteBuffers(1, &f->f_vbo_shadow); glDeleteBuffers(1, &f->f_ibo_shadow); blob_free((void *)f->f_buf, f->f_sz); list_del(&f->f_list); free(f->f_idx_shadow); free(f->f_verts_ex); free(f->f_name); free(f->f_db); free(f); } } } void asset_file_close(asset_file_t f) { unref(f); } static const struct asset_desc *find_asset(asset_file_t f, const char *name) { const struct asset_desc *ptr; unsigned int i, n; ptr = f->f_desc; n = f->f_hdr->h_num_assets; while(n) { int cmp; i = n / 2; cmp = strncmp(name, (char *)ptr[i].a_name, ASSET_NAMELEN); if ( cmp < 0 ) { n = i; }else if ( cmp > 0 ) { ptr = ptr + (i + 1); n = n - (i + 1); }else{ return ptr + i; } } return NULL; } asset_t asset_file_get(asset_file_t f, const char *name) { const struct asset_desc *d; struct _asset *a = NULL; unsigned int idx; d = find_asset(f, name); if ( NULL == d) { con_printf("asset: lookup failed: %s\n", name); goto out; } idx = d - f->f_desc; assert(idx < f->f_hdr->h_num_assets); /* cache hit */ if ( f->f_db[idx] ) { f->f_db[idx]->a_ref++; ref(f); return f->f_db[idx]; } a = calloc(1, sizeof(*a)); if ( NULL == a ) goto out; a->a_indices = f->f_idx_begin + d->a_off; if ( (uint8_t *)(a->a_indices + d->a_num_idx) > (f->f_buf + f->f_sz) ) goto out_free; /* success */ f->f_db[idx] = a; a->a_idx = idx; a->a_owner = ref(f); a->a_ref = 1; f->f_shadows_dirty = 1; goto out; out_free: free(a); a = NULL; out: return a; } void asset_put(asset_t a) { if ( a ) { a->a_ref--; if ( !a->a_ref ) { a->a_owner->f_db[a->a_idx] = NULL; unref(a->a_owner); free(a); } } } void assets_recalc_shadow_vols(light_t l) { struct _asset_file *f; list_for_each_entry(f, &assets, f_list) { f->f_shadows_dirty = 1; } } void asset_file_dirty_shadows(asset_file_t f) { f->f_shadows_dirty = 1; } float asset_radius(asset_t a) { struct _asset_file *f = a->a_owner; const struct asset_desc *d = f->f_desc + a->a_idx; return d->a_radius; } void asset_mins(asset_t a, vec3_t mins) { struct _asset_file *f = a->a_owner; const struct asset_desc *d = f->f_desc + a->a_idx; v_copy(mins, d->a_mins); } void asset_maxs(asset_t a, vec3_t maxs) { struct _asset_file *f = a->a_owner; const struct asset_desc *d = f->f_desc + a->a_idx; v_copy(maxs, d->a_maxs); } int asset_collide_line(asset_t a, const vec3_t start, const vec3_t end, vec3_t hit) { struct _asset_file *f = a->a_owner; const struct asset_desc *d = f->f_desc + a->a_idx; if ( collide_box_line(d->a_mins, d->a_maxs, start, end, hit) ) { //printf("Collide %s!!\n", d->a_name); return 1; } return 0; } #define SQUARE(x) ((x) * (x)) int asset_collide_sphere(asset_t a, const vec3_t c, float r) { struct _asset_file *f = a->a_owner; const struct asset_desc *d = f->f_desc + a->a_idx; unsigned int i; float dmin = 0.0, r2 = SQUARE(r); for(i = 0; i < 3; i++) { if( c[i] < d->a_mins[i] ) dmin += SQUARE(c[i] - d->a_mins[i]); else if( c[i] > d->a_maxs[i] ) dmin += SQUARE(c[i] - d->a_maxs[i]); } return (dmin <= r2); } int asset_sweep(asset_t a, const struct obb *sweep, vec2_t times) { struct _asset_file *f = a->a_owner; const struct asset_desc *d = f->f_desc + a->a_idx; struct obb obb; obb_from_aabb(&obb, d->a_mins, d->a_maxs); return collide_obb(&obb, sweep, times); }
/* Case-insensitive string comparison function. Copyright (C) 1998-1999, 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2005, based on earlier glibc code. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include <string.h> #include <ctype.h> #include <limits.h> #include "mbuiter.h" #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) /* Compare the character strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. Note: This function may, in multibyte locales, return 0 for strings of different lengths! */ int mbscasecmp (const char *s1, const char *s2) { if (s1 == s2) return 0; /* Be careful not to look at the entire extent of s1 or s2 until needed. This is useful because when two strings differ, the difference is most often already in the very few first characters. */ if (MB_CUR_MAX > 1) { mbui_iterator_t iter1; mbui_iterator_t iter2; mbui_init (iter1, s1); mbui_init (iter2, s2); while (mbui_avail (iter1) && mbui_avail (iter2)) { int cmp = mb_casecmp (mbui_cur (iter1), mbui_cur (iter2)); if (cmp != 0) return cmp; mbui_advance (iter1); mbui_advance (iter2); } if (mbui_avail (iter1)) /* s2 terminated before s1. */ return 1; if (mbui_avail (iter2)) /* s1 terminated before s2. */ return -1; return 0; } else { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; do { c1 = TOLOWER (*p1); c2 = TOLOWER (*p2); if (c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); if (UCHAR_MAX <= INT_MAX) return c1 - c2; else /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); } }
/////////////////////////////////////////////////////////////////////////////// // // // This file is part of QJackAudio. // // Copyright (C) 2014 Jacob Dawid, jacob@omg-it.works // // // // QJackAudio 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. // // // // QJackAudio 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 QJackAudio. If not, see <http://www.gnu.org/licenses/>. // // // // It is possible to obtain a closed-source license of QJackAudio. // // If you're interested, contact me at: jacob@omg-it.works // // // /////////////////////////////////////////////////////////////////////////////// #ifndef ABOUTDIALOG_H #define ABOUTDIALOG_H // Qt includes #include <QDialog> namespace Ui { class AboutDialog; } class AboutDialog : public QDialog { Q_OBJECT public: explicit AboutDialog(QWidget *parent = 0); ~AboutDialog(); public slots: void on_visitQJackAudioPushButton_clicked(); void on_visitMx2482PushButton_clicked(); void on_closePushButton_clicked(); private: Ui::AboutDialog *ui; }; #endif // ABOUTDIALOG_H
/* * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu) * * This file is part of cppfontconfig. * * cppfontconfig 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. * * cppfontconfig 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 cppfontconfig. If not, see <http://www.gnu.org/licenses/>. */ /** * @file include/cppfontconfig/Atomic.h * * \date Jul 22, 2012 * \author Josh Bialkowski (jbialk@mit.edu) * \brief */ #ifndef CPPFONTCONFIG_ATOMIC_H_ #define CPPFONTCONFIG_ATOMIC_H_ #include <fontconfig/fontconfig.h> #include <cpp_fontconfig/common.h> #include <cpp_fontconfig/RefPtr.h> namespace fontconfig { class Atomic; /// Used for locking access to configuration files. Provides a safe way to /// update configuration files. /** * These functions provide a safe way to update configuration files, allowing * ongoing reading of the old configuration file while locked for writing and * ensuring that a consistent and complete version of the configuration file * is always available. */ class AtomicDelegate { private: FcAtomic* m_ptr; /// wrap constructor /** * wraps the pointer with this interface, does nothing else, only * called by RefPtr<Atomic> */ explicit AtomicDelegate(FcAtomic* ptr): m_ptr(ptr) {} /// not copy-constructable AtomicDelegate( const AtomicDelegate& other ); /// not assignable AtomicDelegate& operator=( const AtomicDelegate& other ); public: friend class RefPtr<Atomic>; AtomicDelegate* operator->(){ return this; } const AtomicDelegate* operator->() const { return this; } /// lock a file /** * Attempts to lock the file referenced by atomic. Returns FcFalse if * the file is already locked, else returns FcTrue and leaves the * file locked. */ bool lock (); /// return new temporary file name /** * Returns the filename for writing a new version of the file * referenced by atomic. */ Char8_t* newFile(); /// return original file name /** * Returns the file referenced by atomic. */ Char8_t* origFile(); /// replace original with new /** * Replaces the original file referenced by atomic with the new file. * Returns FcFalse if the file cannot be replaced due to permission * issues in the filesystem. Otherwise returns FcTrue. */ bool replaceOrig(); /// delete new file /** * Deletes the new file. Used in error recovery to back out changes. */ void deleteNew(); /// unlock a file /** * Unlocks the file. */ void unlock(); /// destroy an FcAtomic object /** * Destroys atomic. */ void destroy(); }; /// traits class for FcAtomic wrapper /// Used for locking access to configuration files. Provides a safe way to /// update configuration files. /** * @note FcAtomic objects are not reference counted. Be sure to call destroy() * on the last reference to an atomic object */ struct Atomic { typedef AtomicDelegate Delegate; typedef FcAtomic* Storage; typedef FcAtomic* cobjptr; /// create an FcAtomic object /** * Creates a data structure containing data needed to control access * to file. Writing is done to a separate file. Once that file is * complete, the original configuration file is atomically replaced * so that reading process always see a consistent and complete file * without the need to lock for reading. */ static RefPtr<Atomic> create (const Char8_t *file); }; } // namespace fontconfig #endif // ATOMIC_H_
/* * gVirtuS -- A GPGPU transparent virtualization component. * * Copyright (C) 2009-2010 The University of Napoli Parthenope at Naples. * * This file is part of gVirtuS. * * gVirtuS 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. * * gVirtuS 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 gVirtuS; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Written by: Giuseppe Coviello <giuseppe.coviello@uniparthenope.it>, * Department of Applied Science */ /** * @file ConfigFile.h * @author Giuseppe Coviello <giuseppe.coviello@uniparthenope.it> * @date Thu Oct 1 12:56:07 2009 * * @brief * * */ #ifndef _CONFIGFILE_H #define _CONFIGFILE_H #include <string> #include <vector> #include <map> /** * ConfigFile is the object that parses the .properties config file * and exposes it to the application as a collection of key(s) and values(s). */ class ConfigFile { public: ConfigFile(const char * filename); virtual ~ConfigFile(); bool HasKey(const std::string & key) const; const std::string Get(const std::string & key) const; const std::string Get_IPs(const std::string & key,const int index) ;//Sandy void Dump(); static int Get_gpuNum(void); private: std::map<std::string, std::string> mValues; std::vector<std::string> mIPaddrs; //Sandy 2016.03.11 static int backend_gpu; //Sandy 2016.04.14 标识一共使用多少个后端GPU }; #endif /* _CONFIGFILE_H */
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <ctype.h> #define MAXLINES 5000 #define MAXLINE 1000 #define issymbol(c) (!isupper(c) && !islower(c) && !isblank(c) && !isdigit(c)) char *lineptr[MAXLINES]; int readlines(char *lineptr[], int nlines); void writelines(char *lineptr[], int nlines); void my_qsort(void *v[], int left, int right, int (*comp)(void *, void *, ...)) { int i, last; void swap(void *v[], int, int); if (left >= right) return; swap(v, left, (left + right)/2); last = left; for (i = left+1; i <= right; i++) if ((*comp)(v[i], v[left]) < 0) swap(v, ++last, i); swap(v, left, last); my_qsort(v, left, last-1, comp); my_qsort(v, last+1, right, comp); } /* Comparison functions */ int numcmp(char *s1, char *s2, ...) { double v1, v2; v1 = atof(s1); v2 = atof(s2); if (v1 < v2) return -1; else if (v1 > v2) return 1; else return 0; } int reverse_order(void *v1, void *v2, ...) { static int (*original)(void *, void *, ...) = NULL; if (!v1 && !v2) { va_list argp; va_start(argp, v2); original = va_arg(argp, int (*)(void*, void*, ...)); va_end(argp); return 0; } return -(*original)(v1, v2); } int strcmp_wrapper(char *v1, char *v2, ...) { return strcmp(v1, v2); } int strcasecmp_wrapper(char *s1, char *s2, ...) { return strcasecmp(s1, s2); } int dcmp(char *s1, char *s2, ...) { int i = 0, j = 0; for (; s1[i] && issymbol((unsigned char) s1[i]); i++); for (; s2[j] && issymbol((unsigned char) s2[j]); j++); while(s1[i] == s2[j]) { if (s1[i] == '\0') return 0; while (s1[++i] && issymbol((unsigned char) s1[i])); while (s2[++j] && issymbol((unsigned char) s2[j])); } return s1[i]-s2[j]; } int dcasecmp(char *s1, char *s2, ...) { int i = 0, j = 0; for (; s1[i] && issymbol((unsigned char) s1[i]); i++); for (; s2[j] && issymbol((unsigned char) s2[j]); j++); while(tolower((unsigned char) s1[i]) == tolower((unsigned char) s2[j])) { if (s1[i] == '\0') return 0; while (s1[++i] && issymbol((unsigned char) s1[i])); while (s2[++j] && issymbol((unsigned char) s2[j])); } return s1[i]-s2[j]; } /* End of comparison functions */ int main(int argc, char *argv[]) { int nlines; int i, fold = 0, dir = 0, num = 0, reverse = 0; int (*comp_function)(void *, void *, ...) = (int (*)(void*, void*, ...)) strcmp_wrapper; /* Read arguments */ for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-n") == 0) { num = 1; } else if (strcmp(argv[i], "-r") == 0) { reverse = 1; } else if (strcmp(argv[i], "-f") == 0) { fold = 1; } else if (strcmp(argv[i], "-d") == 0) { dir = 1; } } /* Search for non-sense combined options */ if (num && (fold || dir)) { printf("Warning: overriding -f and -d with -n\n"); } /* Process arguments */ if (fold && dir) { comp_function = (int (*)(void*, void*, ...)) dcasecmp; } else if (fold) { comp_function = (int (*)(void*, void*, ...)) strcasecmp_wrapper; } else if (dir) { comp_function = (int (*)(void*, void*, ...)) dcmp; } /* num overrides -f and -d */ if (num) { comp_function = (int (*)(void*, void*, ...)) numcmp; } if (reverse) { /* Initialize reverser... */ reverse_order(NULL, NULL, comp_function); /* ... and set new comp_function */ comp_function = reverse_order; } if ((nlines = readlines(lineptr, MAXLINES)) >= 0) { my_qsort((void **) lineptr, 0, nlines-1, comp_function); writelines(lineptr, nlines); return 0; } else { printf("input too big to sort\n"); return 1; } } void swap(void *v[], int i, int j) { void *temp; temp = v[i]; v[i] = v[j]; v[j] = temp; } int readlines(char *lineptr[], int maxlines) { int len, nlines; char *p, line[MAXLINE]; int my_getline(char [], int); nlines = 0; while ((len = my_getline(line, MAXLINE)) > 0) if (nlines >= maxlines || (p = malloc(len)) == NULL) return -1; else { line[len-1] = '\0'; strcpy(p, line); lineptr[nlines++] = p; } return nlines; } void writelines(char *lineptr[], int nlines) { while (nlines-- > 0) printf("%s\n", *lineptr++); } int my_getline(char s[], int lim) { int c, i; for (i = 0; i < lim-1 && (c = getchar()) != EOF && c != '\n'; ++i) s[i] = c; if (c == '\n') { s[i] = c; ++i; } s[i] = '\0'; return i; }
/* $License: Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved. See included License.txt for License information. $ */ #include "mltypes.h" #include "string.h" #ifndef INV_STORAGE_MANAGER_H__ #define INV_STORAGE_MANAGER_H__ #ifdef __cplusplus extern "C" { #endif inv_error_t inv_register_load_store( inv_error_t (*load_func)(const unsigned char *data), inv_error_t (*save_func)(unsigned char *data), size_t size, unsigned int key); void inv_init_storage_manager(void); inv_error_t inv_get_mpl_state_size(size_t *size); inv_error_t inv_load_mpl_states(const unsigned char *data, size_t len); inv_error_t inv_save_mpl_states(unsigned char *data, size_t len); #ifdef __cplusplus } #endif #endif /* INV_STORAGE_MANAGER_H__ */
/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a BSD-style license that can * be found in the License.html file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Information about PGS files // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- #ifndef MediaInfo_File_Eia708H #define MediaInfo_File_Eia708H //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/File__Analyze.h" #include <vector> #include <string> //--------------------------------------------------------------------------- namespace MediaInfoLib { //*************************************************************************** // Class File_Eia708 //*************************************************************************** class File_Eia708 : public File__Analyze { public : //In int8u cc_type; float64 AspectRatio; //Constructor/Destructor File_Eia708(); ~File_Eia708(); private : //Streams management void Streams_Fill(); void Streams_Finish(); //Buffer - Synchro bool Synchronize(); bool Synched_Test(); //Buffer - Global void Read_Buffer_Init(); void Read_Buffer_Continue(); void Read_Buffer_Unsynched(); //Buffer - Per element void Header_Parse(); void Data_Parse(); //Temp struct character { wchar_t Value; int8u Attribute; character() : Value(L' '), Attribute(0x00) { } }; struct window { enum scroll_direction { Scroll_Direction_Unknown, Scroll_Direction_LeftToRight, Scroll_Direction_RightToLeft, Scroll_Direction_TopToBottom, }; bool visible; scroll_direction Scroll_Direction; int8u row_count; int8u column_count; bool relative_positioning; int8u anchor_vertical; int8u anchor_horizontal; struct data { vector<vector<character> > CC; int8u Window_x; //x of the Windows, relative to the global area int8u Window_y; int8u x; int8u y; data() { Window_x=0; Window_y=0; x=0; y=0; } }; data Minimal; //In characters int8u PenSize; window() { visible=false; Scroll_Direction=Scroll_Direction_Unknown; row_count=(int8u)-1; column_count=(int8u)-1; relative_positioning=false; anchor_vertical=(int8u)-1; anchor_horizontal=(int8u)-1; PenSize=1; //Standard } }; struct stream { std::vector<window*> Windows; struct data { vector<vector<character> > CC; }; data Minimal; int8u WindowID; stream() { WindowID=(int8u)-1; } ~stream() { for (size_t Pos=0; Pos<Windows.size(); Pos++) delete Windows[Pos]; //Windows[Pos]=NULL; } }; std::vector<stream*> Streams; int8u service_number; int8u block_size; bool HasContent; int64u DataDetected; //1 service per bit //Elements void NUL(); //NUL void ETX(); //End Of Text void BS(); //Backspace void FF(); //Form Feed void CR(); //Carriage Return void HCR(); //Horizontal Carriage Return void CWx(int8u WindowID); //SetCurrentWindow void CLW(); //ClearWindows void DSW(); //DisplayWindows void HDW(); //HideWindows void TGW(); //ToggleWindows void DLW(); //DeleteWindows void DLY(); //Delay void DLC(); //Delay Cancel void RST(); //Reset void SPA(); //SetPenAttributes void SPC(); //SetPenColor void SPL(); //SetPenLocation void SWA(); //SetWindowAttributes void DFx(int8u WindowID); //DefineWindow //Temp bool StandAloneCommand; //If this is a command simulated from another command //Helpers void Service(); void Character_Fill(wchar_t Character); void HasChanged(); void Window_HasChanged(); void Illegal(int8u Size, int8u cc_data_1, int8u cc_data_2=(int8u)-1, int8u cc_data_3=(int8u)-1, int8u cc_data_4=(int8u)-1, int8u cc_data_5=(int8u)-1, int8u cc_data_6=(int8u)-1); }; } //NameSpace #endif
/* * delta.h defines api for defs to use xdelta functions * Copyright (C) 2009 Patrick Stetter <chipmaster32@gmail.com> * Copyright (C) 2009 Corey McClymonds <galeru@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 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 DELTA_H #define DELTA_H #include <sys/stat.h> #include <unistd.h> #include <stdio.h> /* * Encodes the differences from an original Source File, an In File with changes * to an OutFile that will become a delta file with a defs header */ int xdelta_encode(const char* OutFileName, FILE* InFile, FILE* SrcFile, FILE* OutFile); /* * xDelta Link Routine * ------------------- * * Create firm link of f1 at f2 * Routine handles all file I/O * Return 0 for success, otherwise -errno */ int xdelta_link(const char *f1, const char *f2); /* * xDelta Read Routine * ------------------- * * Decode necessary window(s) * Write to buffer * Returns bytes read for success, otherwise -errno */ int xdelta_read(const char *file, const char* parent, size_t bytes, off_t offset, char *buffer); /* * xDelta Write Routine * -------------------- * * Do a full decode * Write appropriate changes * Do an encode * Returns bytes written for success, otherwise -errno */ int xdelta_write(const char *file, const char *buf, size_t size, off_t offset, int childc, char **childv, char *parent); /* * xDelta Promote Routine * ---------------------- * * First child is promoted to parent * Decode first child * Write back to child file * Other children are made children of new parent * Decode other children * Encode with new parent */ int xdelta_promote(const char *file, int childc, char **childv); /* * xDelta Truncate Routine * ----------------------- * * If it's a child * Do a full decode * Truncate * Do an encode * Return 0 on success, -1 on error setting errno * * If it's a parent * Decode all children * Truncate Parent * Encode all children * Return 0 on success, -1 on error setting errno */ int xdelta_truncate(const char *file, off_t size, char *parent, int childc, char **childv); #endif /* DELTA_H */
/** * This file is part of RagEmu. * http://ragemu.org - https://github.com/RagEmu/PreRenewal * * Copyright (C) 2016 RagEmu Dev Team * Copyright (C) 2014-2015 Hercules Dev Team * * RagEmu 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/>. */ /// Base author: Haru <haru@dotalux.com> /// mapquit() script command #include "common/ragemu.h" #include "map/map.h" #include "map/script.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "script_mapquit", // Plugin name SERVER_TYPE_MAP, // Which server types this plugin works with? "0.1", // Plugin version HPM_VERSION, // HPM Version (don't change, macro is automatically updated) }; BUILDIN(mapquit) { if (script_hasdata(st, 2)) { map->retval = script_getnum(st, 2); } map->do_shutdown(); return true; } HPExport void server_preinit(void) { } HPExport void plugin_init(void) { addScriptCommand("mapquit", "?", mapquit); }
const unsigned char PROGMEM logo [] = { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x6,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x14,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x2e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x36,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x7e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x7e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x66,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x16,0x6c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x12,0x1a,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x12,0x1b,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0xd2,0x6,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x7f,0xf2,0x6c,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x60,0xd2,0x69,0x98,0x36,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x60,0x32,0x69,0x98,0x34,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x6f,0xf2,0x68,0xd8,0x34,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x6c,0x2,0x68,0x58,0x34,0x0,0x10,0x0,0x0,0x18,0x0,0x0,0x0,0x10,0x0,0x0, 0x6c,0x2,0x68,0x58,0x34,0x0,0x10,0x0,0x0,0x18,0x0,0x0,0x0,0x10,0x0,0x0, 0x6c,0x2,0x68,0x58,0x34,0x0,0x10,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x0, 0x6c,0x2,0x68,0x58,0x34,0x0,0x10,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x0, 0x6c,0x2,0x6c,0x58,0x34,0x7f,0x11,0xf8,0x0,0x7e,0x0,0xfe,0x3f,0x10,0x0,0xfc, 0x6c,0x2,0x6c,0x58,0x34,0x7f,0x13,0xfc,0xfe,0x7e,0x7c,0xfe,0x7f,0x93,0xfd,0xfe, 0x6c,0x2,0x6c,0x58,0x34,0x61,0x13,0xc,0x80,0x18,0x40,0x82,0x61,0x93,0x1,0x80, 0x6c,0x2,0x6c,0x58,0x34,0x61,0x13,0xc,0x80,0x18,0x40,0x82,0x61,0x93,0x1,0x80, 0x6c,0x6,0x6c,0x58,0x34,0x7f,0x13,0xfc,0x80,0x18,0x40,0x82,0x61,0x93,0x1,0xfe, 0x6f,0xcc,0x6c,0x48,0x34,0x7f,0x13,0xf8,0x80,0x18,0x40,0x82,0x61,0x93,0x0,0xfe, 0x67,0xdc,0x6c,0x6f,0xf4,0x60,0x13,0x0,0x80,0x18,0x40,0x82,0x61,0x93,0x0,0x6, 0x60,0x18,0x6c,0x30,0x4,0x60,0x13,0x0,0x80,0x18,0x40,0x82,0x61,0x93,0x0,0x6, 0x7f,0xf0,0x7c,0x3f,0xe4,0x7e,0x13,0xf0,0xfe,0x18,0x40,0xfe,0x61,0x93,0xfc,0x7e, 0x3f,0xe0,0x60,0x0,0x24,0x7e,0x13,0xf0,0xfe,0x18,0x40,0xfe,0x61,0x13,0xfc,0x7e, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xff,0xe4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xff,0xe4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x1f,0xfc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x3f,0xfc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x60,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 };
/* * String Vector functions modeled after glibc argv_* functions * * Copyright Volker Lendecke <vl@samba.org> 2014 * * 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 _STRV_H_ #define _STRV_H_ #include "talloc.h" int strv_add(TALLOC_CTX *mem_ctx, char **strv, const char *string); int strv_addn(TALLOC_CTX *mem_ctx, char **strv, const char *src, size_t srclen); int strv_append(TALLOC_CTX *mem_ctx, char **strv, const char *src); char *strv_next(char *strv, const char *entry); char *strv_find(char *strv, const char *entry); size_t strv_count(char *strv); void strv_delete(char **strv, char *entry); #endif
/* This file is part of Darling. Copyright (C) 2021 Lubos Dolezel Darling 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. Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface IMKUIScrubberView : NSObject @end
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef struct{ struct item* next; struct item* prev; int value; }item; item* create_item(int value){ item* it = (item *)malloc(sizeof(item)); it->prev = NULL; it->next = NULL; it->value = value; return it; } item* q_front(bool update, item* it){ static item* front = NULL; if(update) front = it; return front; } item* get_front(){ return q_front(false, NULL); } item* set_front(item* it){ return q_front(true, it); } item* q_back(bool update, item* it){ static item* back = NULL; if(update) back = it; return back; } item* get_back(){ return q_back(false, NULL); } item* set_back(item* it){ return q_back(true, it); } bool is_empty(){ if(get_front() == NULL && get_back() == NULL) return true; return false; } void enqueue(int val){ item* it = create_item(val); if(is_empty()){ set_back(it); set_front(it); } else{ get_back()->prev = it; it->next = get_back(); set_back(it); } } void dequeue(){ if(!is_empty()){ item* temp = get_front(); if(get_back()!=get_front()){ set_front(get_front()->prev); get_front()->next = NULL; } free(temp); } } int peek(){ int value = -1; if(get_front() != NULL){ value = get_front()->value; } return value; } int main(){ int arr[] = {1,2,3,4,5}; for(int i=0; i<5; i++){ enqueue(arr[i]); printf("%d\n", peek()); } printf("\nafter dequeue\n"); for(int i=0; i<5; i++){ printf("%d\n", peek()); dequeue(); } return 0; }
/* * Copyright (C) 2015 Andrei Karas * * This file is part of Paranoid null checker. * * 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 * 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 NODES_EXPR_GTEXPRNODE_H #define NODES_EXPR_GTEXPRNODE_H #include "nodes/base/expr.h" #include <string> struct GtExprNode : public ExprNode { GtExprNode() : ExprNode() { } }; #endif // NODES_EXPR_GTEXPRNODE_H
#ifndef __ERROR_H__ #define __ERROR_H__ // В ходе выполнения программы возникла неизвестная ошибка. #define EFSPR_ERROR_UNKNOWN 0 // Ошибка при сканировании логического диска. #define EFSPR_ERROR_SCAN 1 // Один или несколько типов файлов ключей не найдены. #define EFSPR_ERROR_SEARCH_KEYS 2 // Ошибка на этапе поиска зашифрованных файлов. #define EFSPR_ERROR_SEARCH_FILES 3 // Ошибка на этапе фильтрации списка зашифрованных файлов. #define EFSPR_ERROR_FILTER 4 // Пользователь с указанным именем уже существует. #define EFSPR_ERROR_USER_EXISTS 5 // Ошибка на этапе формирования наборов ключей. #define EFSPR_ERROR_SET_KEYS 6 // Ошибка на этапе подготовки к восстановлению профиля пользователя. #define EFSPR_ERROR_PREPRP 7 // Ошибка при восстановлении профиля. #define EFSPR_ERROR_RECPROF 8 // Ошибка на этапе создания подкаталогов в профиле пользователя. #define EFSPR_ERROR_SUBDIR 9 // Ошибка при копировании файлов ключей. #define EFSPR_ERROR_COPY_KEYS 10 // Удачное завершение операции. #define EFSPR_ERROR_SUCCESS 11 // Не выполнена перезагрузка. #define EFSPR_ERROR_NO_REBOOT 12 LPCWSTR lpUnknownError = L"В ходе выполнения программы возникла неизвестная ошибка."; LPCWSTR lpScanError = L"Ошибка при сканировании логического диска.\n\ Дальнейшее выполнение программы невозможно."; LPCWSTR lpSearchKeysError = L"Один или несколько типов файлов ключей не найдены.\n\ Дальнейшее восстановление профиля невозможно."; LPCWSTR lpSearchFilesError = L"Ошибка на этапе поиска зашифрованных файлов."; LPCWSTR lpFilterError = L"Ошибка на этапе фильтрации списка зашифрованных файлов."; LPCWSTR lpUserExistsError = L"Пользователь с таким именем уже существует.\nДальнейшее выполнение программы невозможно."; LPCWSTR lpSetKeysError = L"Ошибка на этапе формирования наборов ключей."; LPCWSTR lpPreprpError = L"Ошибка на этапе подготовки к восстановлению профиля пользователя."; LPCWSTR lpRecProfError = L"Ошибка при восстановлении профиля."; LPCWSTR lpSubDirError = L"Ошибка на этапе создания подкаталогов в профиле пользователя."; LPCWSTR lpCopyKeysError = L"Ошибка при копировании файлов ключей."; LPCWSTR lpNoRebootError = L"Восстановление профиля невозможно, т.к. \ не была выполнена \nперезагрузка компьютера.\n\ Пожалуйста, перезагрузите компьютер, и повторите запуск программы."; #endif __ERROR_H__
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/Celestial.framework/Celestial */ #import <Foundation/NSObject.h> @class NSArray; @interface AVCamera : NSObject { } @property(readonly, retain) NSArray* capabilities; @end
// A raytracer program for rendering photorealistic images // Copyright 2016, 2018 Matthias von Laer // // This program is released under the GNU GPLv3. // 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 #include "plane.h" #include "vector.h" class Ray { private: Vector p; Vector u; public: Ray(){} Ray(const Vector& v1, const Vector& v2) {p = v1; u = v2.normalized();} const Ray operator+(const Vector &vector) const {return Ray(p+vector, u);} bool intersect(const Plane &plane, double &intersection_distance) const; Vector origin()const {return p;} Vector direction()const {return u;} void set_origin(const Vector &v) {p = v;} void set_direction(const Vector &v) {u = v.normalized();} };
#ifndef __HMC5883_H__ #define __HMC5883_H__ #define HMC5883_ADDR 0x3c // 8bit // #define HMC5883_ADDR 0x1e // 7bit #define HMC5883_REG 0x03 #define HMC5883L_OFFSET_X (0) #define HMC5883L_OFFSET_Y (0) #define HMC5883L_GAIN_X 1 #define HMC5883L_GAIN_Y 1 typedef struct hmc5883_t{ int16_t mx; int16_t my; int16_t mz; float heading; }HMC5883_Def; void hmc5883_init(void); void hmc5883_read(HMC5883_Def* compass); #endif
/* $XFree86: xc/programs/xterm/wcwidth.h,v 1.4 2002/09/30 00:39:07 dickey Exp $ */ #ifndef included_wcwidth_h #define included_wcwidth_h 1 #include <stddef.h> extern int mk_wcswidth(const wchar_t * pwcs, size_t n); extern int mk_wcswidth_cjk(const wchar_t * pwcs, size_t n); extern int mk_wcwidth(wchar_t ucs); extern int mk_wcwidth_cjk(wchar_t ucs); extern int wcswidth(const wchar_t * pwcs, size_t n); extern int wcswidth_cjk(const wchar_t * pwcs, size_t n); #endif /* included_wcwidth_h */
/*! * \file ddns.h * * \author Lubos Slovak <lubos.slovak@nic.cz> * \author Jan Kadlec <jan.kadlec@nic.cz> * * \brief Dynamic updates processing. * * \addtogroup ddns * @{ */ /* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> 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 _KNOT_DDNS_H_ #define _KNOT_DDNS_H_ #include "knot/updates/changesets.h" #include "knot/zone/zone.h" #include "libknot/packet/pkt.h" #include "libknot/dname.h" /*! * \brief Checks update prerequisite section. * * \param query DNS message containing the update. * \param zone Zone to be checked. * \param rcode Returned DNS RCODE. * * \return KNOT_E* */ int knot_ddns_process_prereqs(const knot_pkt_t *query, const knot_zone_contents_t *zone, uint16_t *rcode); /*! * \brief Processes DNS update and creates a changeset out of it. Zone is left * intact. * * \param zone Zone to be updated. * \param query DNS message containing the update. * \param changeset Output changeset. * \param rcode Output DNS RCODE. * \param new_serial New serial to use for updated zone. * * \return KNOT_E* */ int knot_ddns_process_update(const knot_zone_contents_t *zone, const knot_pkt_t *query, knot_changeset_t *changeset, uint16_t *rcode, uint32_t new_serial); #endif /* _KNOT_DDNS_H_ */ /*! @} */
/* * Platformer Game Engine by Wohlstand, a free platform for game making * Copyright (c) 2014-2019 Vitaly Novichkov <admin@wohlnet.ru> * * 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 * 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/>. */ #pragma once #ifndef CUSTOM_DATA_H #define CUSTOM_DATA_H #include <QPixmap> #include <QImage> #include <PGE_File_Formats/npc_filedata.h> #include <data_configs/obj_npc.h> struct UserIMGs { QPixmap image; QImage mask; unsigned long id; }; struct UserNPCs { bool withImg; QPixmap image; QImage mask; unsigned long id; bool withTxt; NPCConfigFile sets; obj_npc merged; }; struct UserBGs { QPixmap image; QPixmap second_image; unsigned long id; unsigned int q;//0 - only first; 1 - only second; 2 - fitst and seconf }; /// /// \brief The CustomDirManager class This is a capturer of custom files from level/world custom directories /// class CustomDirManager { public: CustomDirManager(); CustomDirManager(QString path, QString name); /// /// \brief getCustomFile Get custom file path if exist. /// \param name Target file name which need to found /// \return empty string if not exist /// QString getCustomFile(QString name, bool ignoreDefaultDirectory=false); QStringList getCustomFiles(QString nameBase, QStringList extensions, bool ignoreDefaultDirectory = false); void setCustomDirs(QString path, QString name); void setDefaultDir(QString dPath); void createDirIfNotExsist(); void import(QStringList &files, bool local = true); private: QString dirEpisode; QString dirCustom; QString defaultDirectory; }; #endif // CUSTOM_DATA_H