text
stringlengths
4
6.14k
/* * This file is part of OpenTTD. * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. */ /** @file misc_widget.h Types related to the misc widgets. */ #ifndef WIDGETS_MISC_WIDGET_H #define WIDGETS_MISC_WIDGET_H /** Widgets of the #LandInfoWindow class. */ enum LandInfoWidgets { WID_LI_LOCATION, ///< Scroll to location. WID_LI_BACKGROUND, ///< Background of the window. }; /** Widgets of the #TooltipsWindow class. */ enum ToolTipsWidgets { WID_TT_BACKGROUND, ///< Background of the window. }; /** Widgets of the #AboutWindow class. */ enum AboutWidgets { WID_A_SCROLLING_TEXT, ///< The actually scrolling text. WID_A_WEBSITE, ///< URL of OpenTTD website. WID_A_COPYRIGHT, ///< Copyright string }; /** Widgets of the #QueryStringWindow class. */ enum QueryStringWidgets { WID_QS_CAPTION, ///< Caption of the window. WID_QS_TEXT, ///< Text of the query. WID_QS_WARNING, ///< Warning label about password security WID_QS_DEFAULT, ///< Default button. WID_QS_CANCEL, ///< Cancel button. WID_QS_OK, ///< OK button. }; /** Widgets of the #QueryWindow class. */ enum QueryWidgets { WID_Q_CAPTION, ///< Caption of the window. WID_Q_TEXT, ///< Text of the query. WID_Q_NO, ///< Yes button. WID_Q_YES, ///< No button. }; /** Widgets of the #TextfileWindow class. */ enum TextfileWidgets { WID_TF_CAPTION, ///< The caption of the window. WID_TF_WRAPTEXT, ///< Whether or not to wrap the text. WID_TF_BACKGROUND, ///< Panel to draw the textfile on. WID_TF_VSCROLLBAR, ///< Vertical scrollbar to scroll through the textfile up-and-down. WID_TF_HSCROLLBAR, ///< Horizontal scrollbar to scroll through the textfile left-to-right. }; #endif /* WIDGETS_MISC_WIDGET_H */
/* * crtc-cmdline-options.h - A line-based CRTC emulation (under construction). * * Written by * Ettore Perazzoli <ettore@comm2000.it> * Andre Fachat <fachat@physik.tu-chemnitz.de> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * 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 VICE_CRTC_CMDLINE_OPTIONS_H #define VICE_CRTC_CMDLINE_OPTIONS_H #endif
/* * * This source code is part of * * G R O M A C S * * GROningen MAchine for Chemical Simulations * * VERSION 3.2.0 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others. * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team, * check out http://www.gromacs.org for more information. * 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. * * If you want to redistribute modifications, please consider that * scientific software is very special. Version control is crucial - * bugs must be traceable. We will be happy to consider code for * inclusion in the official distribution, but derived work must not * be called official GROMACS. Details are found in the README & COPYING * files - if they are missing, get the official version at www.gromacs.org. * * To help us fund GROMACS development, we humbly ask that you cite * the papers on the package - you can find them in the top README file. * * For more info, check our website at http://www.gromacs.org * * And Hey: * Gromacs Runs On Most of All Computer Systems */ #ifndef _partdec_h #define _partdec_h #include "vsite.h" #ifdef __cplusplus extern "C" { #endif #define GMX_LEFT 0 /* channel to the left processor */ #define GMX_RIGHT 1 /* channel to the right processor */ /* These are the good old ring communication routines */ void gmx_tx(const t_commrec *cr,int dir,void *buf,int bufsize); /* * Asynchronously sends bufsize bytes from the buffer pointed to by buf * over the communication channel, identified by chan. The buffer becomes * available after a successful call of gmx_tx_wait(dir). */ void gmx_tx_wait(const t_commrec *cr, int dir); /* * Waits until the asynchronous send operation associated with chan has * succeeded. This makes the buffer of the send operation available to * the sending process. */ void gmx_rx(const t_commrec *cr,int dir,void *buf,int bufsize); /* * Asynchronously receives bufsize bytes in the buffer pointed to by buf * from communication channel identified by chan. The buffer becomes * available after a successful call of gmx_rx_wait(chan). */ void gmx_rx_wait(const t_commrec *cr, int dir); /* * Waits until the asynchronous receive operation, associated with chan, * has succeeded. This makes the buffer of the receive operation * available to the receiving process. */ void gmx_left_right(int nnodes,int nodeid, int *left,int *right); /* Get left and right proc id. */ void gmx_tx_rx(const t_commrec *cr, int send_dir,void *send_buf,int send_bufsize, int recv_dir,void *recv_buf,int recv_bufsize); /* Communicate simultaneously left and right */ void gmx_tx_rx_real(const t_commrec *cr, int send_dir,real *send_buf,int send_bufsize, int recv_dir,real *recv_buf,int recv_bufsize); /* Communicate simultaneously left and right, reals only */ void gmx_wait(const t_commrec *cr, int dir_send, int dir_recv); /* Wait for communication to finish */ void pd_move_f(const t_commrec *cr,rvec f[],t_nrnb *nrnb); /* Sum the forces over the nodes */ int *pd_cgindex(const t_commrec *cr); int *pd_index(const t_commrec *cr); int pd_shift(const t_commrec *cr); int pd_bshift(const t_commrec *cr); void pd_cg_range(const t_commrec *cr,int *cg0,int *cg1); /* Get the range for the home charge groups */ void pd_at_range(const t_commrec *cr,int *at0,int *at1); /* Get the range for the home particles */ gmx_localtop_t *split_system(FILE *log, gmx_mtop_t *mtop,t_inputrec *inputrec, t_commrec *cr); /* Split the system over N processors. */ gmx_bool setup_parallel_vsites(t_idef *idef,t_commrec *cr, t_comm_vsites *vsitecomm); t_state *partdec_init_local_state(t_commrec *cr,t_state *state_global); /* Generate a local state struct from the global one */ void pd_get_constraint_range(gmx_partdec_p_t pd,int *start,int *natoms); int * pd_constraints_nlocalatoms(gmx_partdec_p_t pd); /* Move x0 and also x1 if x1!=NULL */ void pd_move_x_constraints(t_commrec * cr, rvec * x0, rvec * x1); #ifdef __cplusplus } #endif #endif
/* * This file is part of the coreboot project. * * 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. */ #include <console/console.h> #include <arch/io.h> #include <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> /* * Functions for accessing PCI configuration space with mmconf accesses */ #define PCI_MMIO_ADDR(SEGBUS, DEVFN, WHERE, MASK) \ ((void *)(((uintptr_t)CONFIG_MMCONF_BASE_ADDRESS |\ (((SEGBUS) & 0xFFF) << 20) |\ (((DEVFN) & 0xFF) << 12) |\ ((WHERE) & 0xFFF)) & ~MASK)) static uint8_t pci_mmconf_read_config8(struct bus *pbus, int bus, int devfn, int where) { return read8(PCI_MMIO_ADDR(bus, devfn, where, 0)); } static uint16_t pci_mmconf_read_config16(struct bus *pbus, int bus, int devfn, int where) { return read16(PCI_MMIO_ADDR(bus, devfn, where, 1)); } static uint32_t pci_mmconf_read_config32(struct bus *pbus, int bus, int devfn, int where) { return read32(PCI_MMIO_ADDR(bus, devfn, where, 3)); } static void pci_mmconf_write_config8(struct bus *pbus, int bus, int devfn, int where, uint8_t value) { write8(PCI_MMIO_ADDR(bus, devfn, where, 0), value); } static void pci_mmconf_write_config16(struct bus *pbus, int bus, int devfn, int where, uint16_t value) { write16(PCI_MMIO_ADDR(bus, devfn, where, 1), value); } static void pci_mmconf_write_config32(struct bus *pbus, int bus, int devfn, int where, uint32_t value) { write32(PCI_MMIO_ADDR(bus, devfn, where, 3), value); } const struct pci_bus_operations pci_ops_mmconf = { .read8 = pci_mmconf_read_config8, .read16 = pci_mmconf_read_config16, .read32 = pci_mmconf_read_config32, .write8 = pci_mmconf_write_config8, .write16 = pci_mmconf_write_config16, .write32 = pci_mmconf_write_config32, };
/* * linux/arch/arm/mach-tcc892x/io.c * * Author: <linux@telechips.com> * Created: November, 2011 * Description: TCC892x mapping code * * Copyright (C) Telechips, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/bootmem.h> #include <linux/init.h> #include <linux/memblock.h> #include <asm/tlb.h> #include <asm/mach/map.h> #include <asm/io.h> #include <mach/bsp.h> #include <plat/pmap.h> #include <mach/tca_ckc.h> #ifdef CONFIG_CACHE_L2X0 #include <asm/hardware/cache-l2x0.h> #endif void __cpu_early_init(void); #if defined(__TODO__) extern void IO_UTIL_ReadECID(void); #endif /* * The machine specific code may provide the extra mapping besides the * default mapping provided here. */ static struct map_desc tcc8920_io_desc[] __initdata = { { .virtual = 0xF0000000, .pfn = __phys_to_pfn(0xF0000000), //Internel SRAM .length = 0x00100000, .type = MT_MEMORY_TCC }, { .virtual = 0xF1000000, .pfn = __phys_to_pfn(0x70000000), //Graphic Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF2000000, .pfn = __phys_to_pfn(0x71000000), //HSIO Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF3000000, .pfn = __phys_to_pfn(0x72000000), //Display Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF4000000, .pfn = __phys_to_pfn(0x73000000), //Memory Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF5000000, .pfn = __phys_to_pfn(0x74000000), //SMU Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF6000000, .pfn = __phys_to_pfn(0x75000000), //Video Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF7000000, .pfn = __phys_to_pfn(0x76000000), //IO Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF8000000, .pfn = __phys_to_pfn(0x77000000), //CPU Bus .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xF9000000, .pfn = __phys_to_pfn(0x78000000), //DAP(Debug) .length = 0x01000000, .type = MT_DEVICE }, { .virtual = 0xFA000000, .pfn = __phys_to_pfn(0x60000000), //L2Cache .length = 0x01000000, .type = MT_DEVICE }, }; void __init tcc_reserve_sdram(void) { pmap_t pmap; if (pmap_get_info("total", &pmap)) { if (memblock_remove(pmap.base, pmap.size) == 0) { printk(KERN_DEBUG "Total reserved memory: base=0x%x, size=0x%x\n", pmap.base, pmap.size); } else { printk(KERN_ERR "Can't reserve memory (base=0x%x, size=0x%x)\n", pmap.base, pmap.size); } } } /* * Maps common IO regions for tcc892x. */ void __init tcc_map_common_io(void) { iotable_init(tcc8920_io_desc, ARRAY_SIZE(tcc8920_io_desc)); /* Normally devicemaps_init() would flush caches and tlb after * mdesc->map_io(), but we must also do it here because of the CPU * revision check below. */ local_flush_tlb_all(); flush_cache_all(); __cpu_early_init(); #ifdef CONFIG_CACHE_L2X0 // Way size = 16KB, Associativity = 16Way l2x0_init(0xFA000000, 0x70130001, ~0x022C0000); #endif #if defined(__TODO__) IO_UTIL_ReadECID(); #endif // tcc_reserve_sdram(); // XXX tca_ckc_init(); }
// // Copyright (C) 2015 OpenSim Ltd. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program; if not, see <http://www.gnu.org/licenses/>. // #ifndef __INET_DELAYEDINITIALIZER_H #define __INET_DELAYEDINITIALIZER_H #include <functional> namespace inet { // this is a singleton template <typename T> class INET_API DelayedInitializer { private: mutable T *t = nullptr; bool constructed; const std::function <T *()> initializer; public: DelayedInitializer(const std::function <T *()> initializer) : constructed(true), initializer(initializer) {} ~DelayedInitializer() { delete t; } const T *operator&() const { if (!constructed) { fprintf(stderr, "Cannot dereference DelayedInitializer<%s> before it is completely constructed\n", typeid(t).name()); abort(); } if (t == nullptr) t = initializer(); return t; } }; } /* namespace inet */ #endif // ifndef __INET_DELAYEDINITIALIZER_H
/**************************************************************************** * * Copyright (C) 2005 - 2013 by Vivante Corp. * * 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 "gc_hal_kernel_qnx.h" gctINT gckMATH_ModuloInt( IN gctINT X, IN gctINT Y ) { if(Y ==0) {return 0;} else {return X % Y;} }
#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../defines.h" #include "defines.h" #ifdef GB #include "../opcodes_gb.c" #endif #ifdef Z80 #include "../opcodes_z80.c" #endif #ifdef MCS6502 #include "../opcodes_6502.c" #endif #ifdef WDC65C02 #include "../opcodes_65c02.c" #endif #ifdef MCS6510 #include "../opcodes_6510.c" #endif #ifdef W65816 #include "../opcodes_65816.c" #endif #ifdef SPC700 #include "../opcodes_spc700.c" #endif /* this program is used to print the opcodes */ int main(int argc, char *argv[]) { int i; i = 0; while (TRUE) { printf("%s\n", opt_table[i].op); i++; if (opt_table[i].type == -1) break; } return 0; }
#include "io_internal.h" void io_finishandshutdown(void) { iarray_free(&io_fds); array_reset(&io_pollfds); }
/*************************************************************************** * * * 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. * * * * copyright (C) 2003-2007 * * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * ***************************************************************************/ #ifndef UMLPACKAGELIST_H #define UMLPACKAGELIST_H #include <qlist.h> class UMLPackage; typedef QList<UMLPackage*> UMLPackageList; typedef QListIterator<UMLPackage*> UMLPackageListIt; #endif
/* vi: set sw=8 ts=8: */ /* * Various assmbly language/system dependent hacks that are required * so that we can minimize the amount of platform specific code. */ /* Define this if the system uses RELOCA. */ #undef ELF_USES_RELOCA #define ARCH_NUM 3 #define DT_MIPS_GOTSYM_IDX (DT_NUM + OS_NUM) #define DT_MIPS_LOCAL_GOTNO_IDX (DT_NUM + OS_NUM +1) #define DT_MIPS_SYMTABNO_IDX (DT_NUM + OS_NUM +2) #define ARCH_DYNAMIC_INFO(dpnt, dynamic, debug_addr) \ do { \ if (dpnt->d_tag == DT_MIPS_GOTSYM) \ dynamic[DT_MIPS_GOTSYM_IDX] = dpnt->d_un.d_val; \ else if(dpnt->d_tag == DT_MIPS_LOCAL_GOTNO) \ dynamic[DT_MIPS_LOCAL_GOTNO_IDX] = dpnt->d_un.d_val; \ else if(dpnt->d_tag == DT_MIPS_SYMTABNO) \ dynamic[DT_MIPS_SYMTABNO_IDX] = dpnt->d_un.d_val; \ else if (dpnt->d_tag == DT_MIPS_RLD_MAP) \ *(Elf32_Addr *)(dpnt->d_un.d_ptr) = (Elf32_Addr) debug_addr; \ } while (0) /* Initialization sequence for the application/library GOT. */ #define INIT_GOT(GOT_BASE,MODULE) \ do { \ unsigned long i; \ \ /* Check if this is the dynamic linker itself */ \ if (MODULE->libtype == program_interpreter) \ continue; \ \ /* Fill in first two GOT entries according to the ABI */ \ GOT_BASE[0] = (unsigned long) _dl_linux_resolve; \ GOT_BASE[1] = (unsigned long) MODULE; \ \ /* Add load address displacement to all local GOT entries */ \ i = 2; \ while (i < MODULE->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]) \ GOT_BASE[i++] += (unsigned long) MODULE->loadaddr; \ \ } while (0) /* Here we define the magic numbers that this dynamic loader should accept */ #define MAGIC1 EM_MIPS #define MAGIC2 EM_MIPS_RS3_LE /* Used for error messages */ #define ELF_TARGET "MIPS" unsigned long _dl_linux_resolver(unsigned long sym_index, unsigned long old_gpreg); struct elf_resolve; void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy); #define do_rem(result, n, base) ((result) = (n) % (base)) /* 4096 bytes alignment */ #define PAGE_ALIGN 0xfffff000 #define ADDR_ALIGN 0xfff #define OFFS_ALIGN 0x7ffff000 #define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT /* MIPS does not have COPY relocs */ #define DL_NO_COPY_RELOCS
/* SPDX-License-Identifier: LGPL-2.1+ */ #include "conf-parser.h" #include "macvlan-util.h" #include "string-table.h" static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = { [NETDEV_MACVLAN_MODE_PRIVATE] = "private", [NETDEV_MACVLAN_MODE_VEPA] = "vepa", [NETDEV_MACVLAN_MODE_BRIDGE] = "bridge", [NETDEV_MACVLAN_MODE_PASSTHRU] = "passthru", [NETDEV_MACVLAN_MODE_SOURCE] = "source", }; DEFINE_STRING_TABLE_LOOKUP(macvlan_mode, MacVlanMode);
/* Lepton EDA Schematic Capture * Copyright (C) 1998-2010 Ales Hvezda * * 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 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. */ /*! * \file gschem_bin.h * * \brief */ #define GSCHEM_TYPE_BIN (gschem_bin_get_type()) #define GSCHEM_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSCHEM_TYPE_BIN, GschemBin)) #define GSCHEM_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSCHEM_TYPE_BIN, GschemBinClass)) #define GSCHEM_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSCHEM_TYPE_BIN)) #define GSCHEM_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSCHEM_TYPE_BIN, GschemBinClass)) typedef struct _GschemBinClass GschemBinClass; typedef struct _GschemBin GschemBin; struct _GschemBinClass { GtkBinClass parent_class; }; struct _GschemBin { GtkBin parent_instance; }; GType gschem_bin_get_type (void); GschemBin* gschem_bin_new ();
#include <linux/module.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/gpio.h> #include <linux/err.h> #include <linux/delay.h> #define TEGRA_GPIO_PP0 120 #define TEGRA_GPIO_PP2 122 #define WWAN_MU736_RESET TEGRA_GPIO_PP0 #define WWAN_MU736_POWER_ON TEGRA_GPIO_PP2 static struct regulator *vdd_modem_3v3; static int bowser_wwan_probe(struct platform_device *dev) { int ret = 0; /* Get resource */ vdd_modem_3v3 = regulator_get(NULL, "vdd_modem_3v3"); if (IS_ERR_OR_NULL(vdd_modem_3v3)) { printk(KERN_ERR "Fail to get regulator vdd_modem_3v3\n"); ret = PTR_ERR(vdd_modem_3v3); vdd_modem_3v3 = NULL; return ret; } ret = gpio_request(WWAN_MU736_POWER_ON, "modem_power_on"); if (ret) { printk(KERN_ERR "Fail to request gpio TEGRA_GPIO_PP2\n"); return ret; } ret = gpio_request(WWAN_MU736_RESET, "modem_reset"); if (ret) { printk(KERN_ERR "Fail to request gpio TEGRA_GPIO_PP0\n"); return ret; } /* Power on sequence */ regulator_enable(vdd_modem_3v3); msleep(50); gpio_direction_output(WWAN_MU736_RESET, 1); msleep(5); gpio_direction_output(WWAN_MU736_POWER_ON, 1); return ret; } static int bowser_wwan_shutdown(struct platform_device *dev){ /* Power off sequence */ gpio_direction_output(WWAN_MU736_POWER_ON, 0); msleep(510); gpio_direction_output(WWAN_MU736_RESET, 0); return 0; } static struct platform_driver bowser_wwan_platform_driver = { .probe = bowser_wwan_probe, .shutdown = bowser_wwan_shutdown, .driver = { .name = "bowser_wwan", } }; static void __init bowser_wwan_init(void) { int ret = 0; ret = platform_driver_register(&bowser_wwan_platform_driver); if (ret) printk(KERN_ERR "Fail to register bowser wwan platform driver\n"); return ret; } static void __exit bowser_wwan_exit(void) { platform_driver_unregister(&bowser_wwan_platform_driver); } module_init(bowser_wwan_init); module_exit(bowser_wwan_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Chris Cheng <chris.cheng@quantatw.com>"); MODULE_DESCRIPTION("Bowser WWAN driver");
#ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H #ifndef _LIBC #error bits/kernel_stat.h is for internal uClibc use only! #endif /* This file provides whatever this particular arch's kernel thinks * struct stat should look like... It turns out each arch has a * different opinion on the subject... */ struct kernel_stat { unsigned long st_dev; unsigned long st_ino; unsigned short st_mode; unsigned short st_nlink; unsigned short st_uid; unsigned short st_gid; unsigned short st_rdev; unsigned short __pad2; unsigned long st_size; unsigned long st_blksize; unsigned long st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; unsigned long __unused4; unsigned long __unused5; }; struct kernel_stat64 { unsigned long long st_dev; unsigned char __pad0[4]; #define _HAVE_STAT64___ST_INO unsigned long __st_ino; unsigned int st_mode; unsigned int st_nlink; unsigned long st_uid; unsigned long st_gid; unsigned short st_rdev; unsigned char __pad3[10]; long long st_size; unsigned long st_blksize; unsigned long st_blocks; /* Number 512-byte blocks allocated. */ unsigned long __pad4; /* future possible st_blocks high bits */ struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; unsigned long long st_ino; }; #endif /* _BITS_STAT_STRUCT_H */
/* _FORTIFY_SOURCE wrapper for openat. Copyright (C) 2013-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <fcntl.h> #include <stdio.h> int __openat_2 (int fd, const char *file, int oflag) { if (__OPEN_NEEDS_MODE (oflag)) __fortify_fail ("invalid openat call: O_CREAT or O_TMPFILE without mode"); return __openat (fd, file, oflag); }
// ****************************************************************** // * // * This file is part of the Cxbx project. // * // * Cxbx and Cxbe are free software; you can redistribute them // * and/or modify them 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 recieved 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., // * 59 Temple Place - Suite 330, Bostom, MA 02111-1307, USA. // * // * (c) 2002-2003 Aaron Robinson <caustik@caustik.com> // * (c) 2016 Luke Usher <luke.usher@outlook.com> // * All rights reserved // * // ****************************************************************** #ifndef EMUX86_H #define EMUX86_H #include "Cxbx.h" #include <cstdint> #include <windows.h> #define EMUX86_EFLAG_CF 0 #define EMUX86_EFLAG_PF 2 #define EMUX86_EFLAG_AF 4 #define EMUX86_EFLAG_ZF 6 #define EMUX86_EFLAG_SF 7 #define EMUX86_EFLAG_TF 8 #define EMUX86_EFLAG_IF 9 #define EMUX86_EFLAG_DF 10 #define EMUX86_EFLAG_OF 11 #define EMUX86_EFLAG_IOPL1 12 #define EMUX86_EFLAG_IOPL2 13 #define EMUX86_EFLAG_NT 14 #define EMUX86_EFLAG_RF 16 #define EMUX86_EFLAG_VM 17 #define EMUX86_EFLAG_AC 18 #define EMUX86_EFLAG_VIF 19 #define EMUX86_EFLAG_VIP 20 #define EMUX86_EFLAG_ID 21 void EmuX86_Init(); int EmuX86_OpcodeSize(uint8_t *Eip); bool EmuX86_DecodeException(LPEXCEPTION_POINTERS e); uint32_t EmuX86_IORead(xbox::addr_xt addr, int size); void EmuX86_IOWrite(xbox::addr_xt addr, uint32_t value, int size); uint32_t EmuX86_Read(xbox::addr_xt addr, int size); void EmuX86_Write(xbox::addr_xt addr, uint32_t value, int size); #endif
/* * Copyright (C) 2012 Samsung Electronics * * 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 DeviceProximityEvent_h #define DeviceProximityEvent_h #if ENABLE(PROXIMITY_EVENTS) #include "Event.h" namespace WebCore { struct DeviceProximityEventInit : public EventInit { DeviceProximityEventInit() : value(std::numeric_limits<double>::infinity()) , min(-std::numeric_limits<double>::infinity()) , max(std::numeric_limits<double>::infinity()) { // Default value of bubbles is true by the Proximity Events spec. // http://www.w3.org/TR/proximity/#deviceproximityevent-interface bubbles = true; }; double value; double min; double max; }; class DeviceProximityEvent : public Event { public: ~DeviceProximityEvent() { } static Ref<DeviceProximityEvent> create() { return adoptRef(*new DeviceProximityEvent()); } static Ref<DeviceProximityEvent> create(const AtomicString& eventType, const double value, const double min, const double max) { return adoptRef(*new DeviceProximityEvent(eventType, value, min, max)); } static Ref<DeviceProximityEvent> create(const AtomicString& type, const DeviceProximityEventInit& initializer) { return adoptRef(*new DeviceProximityEvent(type, initializer)); } double value() { return m_value; } double min() { return m_min; } double max() { return m_max; } virtual EventInterface eventInterface() const { return DeviceProximityEventInterfaceType; } private: DeviceProximityEvent(); DeviceProximityEvent(const AtomicString& eventType, const double value, const double min, const double max); DeviceProximityEvent(const AtomicString& eventType, const DeviceProximityEventInit&); double m_value; double m_min; double m_max; }; } // namespace WebCore #endif // DeviceProximityEvent_h #endif // PROXIMITY_EVENTS
/* wimax_compact_dlmap_ie_decoder.h * Declarations of routines exported by WiMax HARQ Map Message decoder * * Copyright (c) 2007 by Intel Corporation. * * Author: Lu Pan <lu.pan@intel.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1999 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef _WIMAX_COMPACT_DLMAP_IE_DECODER_H_ #define _WIMAX_COMPACT_DLMAP_IE_DECODER_H_ extern guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset); #endif /* _WIMAX_COMPACT_DLMAP_IE_DECODER_H_ */
/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LUA_PASSWD_H #define _LUA_PASSWD_H #include "apr.h" #include "apr_lib.h" #include "apr_strings.h" #include "apr_errno.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_version.h" #if !APR_VERSION_AT_LEAST(2,0,0) #include "apu_version.h" #endif #define MAX_PASSWD_LEN 256 #define ALG_APMD5 0 #define ALG_APSHA 1 #define ALG_BCRYPT 2 #define ALG_CRYPT 3 #define BCRYPT_DEFAULT_COST 5 #define ERR_FILEPERM 1 #define ERR_SYNTAX 2 #define ERR_PWMISMATCH 3 #define ERR_INTERRUPTED 4 #define ERR_OVERFLOW 5 #define ERR_BADUSER 6 #define ERR_INVALID 7 #define ERR_RANDOM 8 #define ERR_GENERAL 9 #define ERR_ALG_NOT_SUPP 10 #if defined(WIN32) || defined(NETWARE) #define CRYPT_ALGO_SUPPORTED 0 #define PLAIN_ALGO_SUPPORTED 1 #else #define CRYPT_ALGO_SUPPORTED 1 #define PLAIN_ALGO_SUPPORTED 0 #endif #if APR_VERSION_AT_LEAST(2,0,0) || \ (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 5) #define BCRYPT_ALGO_SUPPORTED 1 #else #define BCRYPT_ALGO_SUPPORTED 0 #endif typedef struct passwd_ctx passwd_ctx; struct passwd_ctx { apr_pool_t *pool; const char *errstr; char *out; apr_size_t out_len; char *passwd; int alg; int cost; }; /* * The following functions return zero on success; otherwise, one of * the ERR_* codes is returned and an error message is stored in ctx->errstr. */ /* * Make a password record from the given information. */ int mk_password_hash(passwd_ctx *ctx); #endif /* _LUA_PASSWD_H */
/* radare - LGPL - Copyright 2013-2015 - xvilka */ #include <r_types.h> #include <r_util.h> #include <r_lib.h> #include <r_bin.h> #include "te/te_specs.h" #include "te/te.h" static int check(RBinFile *arch); static int check_bytes(const ut8 *buf, ut64 length); static Sdb* get_sdb (RBinObject *o) { if (!o) return NULL; struct r_bin_te_obj_t *bin = (struct r_bin_te_obj_t *) o->bin_obj; if (bin && bin->kv) return bin->kv; return NULL; } static void * load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){ struct r_bin_te_obj_t *res = NULL; RBuffer *tbuf = NULL; if (!buf || sz == 0 || sz == UT64_MAX) return NULL; tbuf = r_buf_new(); r_buf_set_bytes (tbuf, buf, sz); res = r_bin_te_new_buf (tbuf); if (res) sdb_ns_set (sdb, "info", res->kv); r_buf_free (tbuf); return res; } static int load(RBinFile *arch) { const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL; ut64 sz = arch ? r_buf_size (arch->buf): 0; if (!arch || !arch->o) return R_FALSE; arch->o->bin_obj = load_bytes (arch, bytes, sz, arch->o->loadaddr, arch->sdb); return arch->o->bin_obj ? R_TRUE: R_FALSE; } static int destroy(RBinFile *arch) { r_bin_te_free ((struct r_bin_te_obj_t*)arch->o->bin_obj); return R_TRUE; } static ut64 baddr(RBinFile *arch) { return r_bin_te_get_image_base (arch->o->bin_obj); } static RBinAddr* binsym(RBinFile *arch, int type) { RBinAddr *ret = NULL; switch (type) { case R_BIN_SYM_MAIN: if (!(ret = R_NEW (RBinAddr))) return NULL; ret->paddr = ret->vaddr = r_bin_te_get_main_paddr (arch->o->bin_obj); break; } return ret; } static RList* entries(RBinFile *arch) { RList* ret; RBinAddr *ptr = NULL; RBinAddr *entry = NULL; if (!(ret = r_list_new ())) return NULL; ret->free = free; if (!(entry = r_bin_te_get_entrypoint (arch->o->bin_obj))) return ret; if ((ptr = R_NEW (RBinAddr))) { ptr->paddr = entry->paddr; ptr->vaddr = entry->vaddr; r_list_append (ret, ptr); } free (entry); return ret; } static RList* sections(RBinFile *arch) { RList *ret = NULL; RBinSection *ptr = NULL; struct r_bin_te_section_t *sections = NULL; int i; if (!(ret = r_list_new ())) return NULL; ret->free = free; if (!(sections = r_bin_te_get_sections(arch->o->bin_obj))) { free (ret); return NULL; } for (i = 0; !sections[i].last; i++) { if (!(ptr = R_NEW0 (RBinSection))) break; if (sections[i].name[sizeof (sections[i].name)-1]) { memcpy (ptr->name, sections[i].name, sizeof (sections[i].name)); ptr->name[sizeof (sections[i].name)] = 0; } else strncpy (ptr->name, (char*)sections[i].name, R_BIN_SIZEOF_STRINGS); ptr->size = sections[i].size; ptr->vsize = sections[i].vsize; ptr->paddr = sections[i].paddr; ptr->vaddr = sections[i].vaddr; ptr->srwx = 0; if (R_BIN_TE_SCN_IS_EXECUTABLE (sections[i].flags)) ptr->srwx |= 0x1; if (R_BIN_TE_SCN_IS_WRITABLE (sections[i].flags)) ptr->srwx |= 0x2; if (R_BIN_TE_SCN_IS_READABLE (sections[i].flags)) ptr->srwx |= 0x4; if (R_BIN_TE_SCN_IS_SHAREABLE (sections[i].flags)) ptr->srwx |= 0x8; /* All TE files have _TEXT_RE section, which is 16-bit, because of * CPU start in this mode */ if (!strncmp(ptr->name, "_TEXT_RE", 8)) ptr->bits = 16; r_list_append (ret, ptr); } free (sections); return ret; } static RBinInfo* info(RBinFile *arch) { RBinInfo *ret = R_NEW0 (RBinInfo); if (!ret) return NULL; ret->file = strdup (arch->file); ret->bclass = strdup ("TE"); ret->rclass = strdup ("te"); ret->os = r_bin_te_get_os (arch->o->bin_obj); ret->arch = r_bin_te_get_arch (arch->o->bin_obj); ret->machine = r_bin_te_get_machine (arch->o->bin_obj); ret->subsystem = r_bin_te_get_subsystem (arch->o->bin_obj); ret->type = strdup ("EXEC (Executable file)"); ret->bits = r_bin_te_get_bits (arch->o->bin_obj); ret->big_endian = 1; ret->dbg_info = 0; ret->has_va = R_TRUE; sdb_num_set (arch->sdb, "te.bits", ret->bits, 0); return ret; } static int check(RBinFile *arch) { const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL; ut64 sz = arch ? r_buf_size (arch->buf): 0; return check_bytes (bytes, sz); } static int check_bytes(const ut8 *buf, ut64 length) { if (buf && length > 2) if (!memcmp (buf, "\x56\x5a", 2)) return R_TRUE; return R_FALSE; } RBinPlugin r_bin_plugin_te = { .name = "te", .desc = "TE bin plugin", // Terse Executable format .license = "LGPL3", .init = NULL, .fini = NULL, .get_sdb = &get_sdb, .load = &load, .load_bytes = &load_bytes, .destroy = &destroy, .check = &check, .check_bytes = check_bytes, .baddr = &baddr, .boffset = NULL, .binsym = &binsym, .entries = &entries, .sections = &sections, .symbols = NULL, // TE doesn't have exports data directory .imports = NULL, // TE doesn't have imports data directory .strings = NULL, .info = &info, .fields = NULL, .libs = NULL, // TE doesn't have imports data directory .relocs = NULL, .dbginfo = NULL, .write = NULL, .minstrlen = 4, .create = NULL, }; #ifndef CORELIB struct r_lib_struct_t radare_plugin = { .type = R_LIB_TYPE_BIN, .data = &r_bin_plugin_te }; #endif
/*** * * Copyright (c) 1996-2002, Valve LLC. All rights reserved. * * This product contains software technology licensed from Id * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. * All Rights Reserved. * * Use, distribution, and modification of this source code and/or resulting * object code is restricted to non-commercial enhancements to products from * Valve LLC. All other use, distribution, or modification is prohibited * without written permission from Valve LLC. * ****/ #if !defined ( EVENT_APIH ) #define EVENT_APIH #ifdef _WIN32 #ifndef __MINGW32__ #pragma once #endif /* not __MINGW32__ */ #endif #define EVENT_API_VERSION 1 typedef struct event_api_s { int version; void ( *EV_PlaySound ) ( int ent, float *origin, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); void ( *EV_StopSound ) ( int ent, int channel, const char *sample ); int ( *EV_FindModelIndex )( const char *pmodel ); int ( *EV_IsLocal ) ( int playernum ); int ( *EV_LocalPlayerDucking ) ( void ); void ( *EV_LocalPlayerViewheight ) ( float * ); void ( *EV_LocalPlayerBounds ) ( int hull, float *mins, float *maxs ); int ( *EV_IndexFromTrace) ( struct pmtrace_s *pTrace ); struct physent_s *( *EV_GetPhysent ) ( int idx ); void ( *EV_SetUpPlayerPrediction ) ( int dopred, int bIncludeLocalClient ); void ( *EV_PushPMStates ) ( void ); void ( *EV_PopPMStates ) ( void ); void ( *EV_SetSolidPlayers ) (int playernum); void ( *EV_SetTraceHull ) ( int hull ); void ( *EV_PlayerTrace ) ( float *start, float *end, int traceFlags, int ignore_pe, struct pmtrace_s *tr ); void ( *EV_WeaponAnimation ) ( int sequence, int body ); unsigned short ( *EV_PrecacheEvent ) ( int type, const char* psz ); void ( *EV_PlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); const char *( *EV_TraceTexture ) ( int ground, float *vstart, float *vend ); void ( *EV_StopAllSounds ) ( int entnum, int entchannel ); void ( *EV_KillEvents ) ( int entnum, const char *eventname ); } event_api_t; extern event_api_t eventapi; #endif
/* * FrameP.h - Private definitions for Frame widget * * Author: Vladimir Romanovski * * Date: Mon Feb 27, 1995 */ /*********************************************************************** * * Frame Widget Private Data * ***********************************************************************/ #ifndef _XawFrameP_h #define _XawFrameP_h #include <X11/ConstrainP.h> #include "3d.h" #include "ContainerP.h" #include "Frame.h" #define FRAME(w) ((FrameWidget)(w))->frame /* New fields for the Frame widget class record */ typedef struct _FrameClassPart{ XtPointer extension; } FrameClassPart; typedef struct _FrameClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; ContainerClassPart container_class; FrameClassPart frame_class; } FrameClassRec; /* New fields for the frame widget. */ typedef struct _FramePart { /* Constraint contstraint resources */ Dimension h_space; Dimension v_space; XawFrameType frame_type; int x_fraction; int y_fraction; XawLayoutPolicy policy; char *label; XFontStruct *font; Boolean caption; XtJustify justify; unsigned char encoding; /* Private resources. */ Dimension preferred_width; Dimension preferred_height; GC gc; } FramePart; typedef struct _FrameRec{ CorePart core; CompositePart composite; ConstraintPart constraint; ContainerPart container; FramePart frame; } FrameRec; typedef struct _FrameConstraintsPart { /* Constraint contstraint resources */ int left; int right; int top; int bottom; /* Private contstraint resources. */ } FrameConstraintsPart; typedef struct _FrameConstraintsRec { FrameConstraintsPart frame; } FrameConstraintsRec, *FrameConstraints; extern FrameClassRec frameClassRec; #endif /* _XawFrameP_h */
/** * Copyright (c) 2015-present, Parse, LLC. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import <Foundation/Foundation.h> #import <Parse/PFUserAuthenticationDelegate.h> @class BFTask PF_GENERIC(__covariant BFGenericType); @class PF_Twitter; NS_ASSUME_NONNULL_BEGIN extern NSString *const PFTwitterUserAuthenticationType; @interface PFTwitterAuthenticationProvider : NSObject <PFUserAuthenticationDelegate> @property (nonatomic, strong, readonly) PF_Twitter *twitter; - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithTwitter:(PF_Twitter *)twitter NS_DESIGNATED_INITIALIZER; + (instancetype)providerWithTwitter:(PF_Twitter *)twitter; - (BFTask *)authenticateAsync; - (NSDictionary *)authDataWithTwitterId:(NSString *)twitterId screenName:(NSString *)screenName authToken:(NSString *)authToken secret:(NSString *)authTokenSecret; @end NS_ASSUME_NONNULL_END
/** * @file contain.h * @brief Implements pseudo object oriented features. * @note Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef HAVE_CONTAIN_H #define HAVE_CONTAIN_H #include <stddef.h> /* * This macro borrowed from the Linux kernel. */ #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type, member) ); \ }) #endif
/* $NetBSD: ipsec_strerror.c,v 1.6 2010/04/07 14:53:52 vanhu Exp $ */ /* $KAME: ipsec_strerror.c,v 1.7 2000/07/30 00:45:12 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project 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 PROJECT 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 PROJECT 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <sys/types.h> #include <sys/param.h> #include <string.h> #include PATH_IPSEC_H #include "ipsec_strerror.h" int __ipsec_errcode; static const char *ipsec_errlist[] = { "Success", /*EIPSEC_NO_ERROR*/ "Not supported", /*EIPSEC_NOT_SUPPORTED*/ "Invalid argument", /*EIPSEC_INVAL_ARGUMENT*/ "Invalid sadb message", /*EIPSEC_INVAL_SADBMSG*/ "Invalid version", /*EIPSEC_INVAL_VERSION*/ "Invalid security policy", /*EIPSEC_INVAL_POLICY*/ "Invalid address specification", /*EIPSEC_INVAL_ADDRESS*/ "Invalid ipsec protocol", /*EIPSEC_INVAL_PROTO*/ "Invalid ipsec mode", /*EIPSEC_INVAL_MODE*/ "Invalid ipsec level", /*EIPSEC_INVAL_LEVEL*/ "Invalid SA type", /*EIPSEC_INVAL_SATYPE*/ "Invalid message type", /*EIPSEC_INVAL_MSGTYPE*/ "Invalid extension type", /*EIPSEC_INVAL_EXTTYPE*/ "Invalid algorithm type", /*EIPSEC_INVAL_ALGS*/ "Invalid key length", /*EIPSEC_INVAL_KEYLEN*/ "Invalid address family", /*EIPSEC_INVAL_FAMILY*/ "Invalid prefix length", /*EIPSEC_INVAL_PREFIXLEN*/ "Invalid direction", /*EIPSEC_INVAL_DIR*/ "SPI range violation", /*EIPSEC_INVAL_SPI*/ "No protocol specified", /*EIPSEC_NO_PROTO*/ "No algorithm specified", /*EIPSEC_NO_ALGS*/ "No buffers available", /*EIPSEC_NO_BUFS*/ "Must get supported algorithms list first", /*EIPSEC_DO_GET_SUPP_LIST*/ "Protocol mismatch", /*EIPSEC_PROTO_MISMATCH*/ "Family mismatch", /*EIPSEC_FAMILY_MISMATCH*/ "Too few arguments", /*EIPSEC_FEW_ARGUMENTS*/ NULL, /*EIPSEC_SYSTEM_ERROR*/ "Priority offset not in valid range [-2147483647, 2147483648]", /*EIPSEC_INVAL_PRIORITY_OFFSET*/ "Priority offset from base not in valid range [0, 1073741823] for negative offsets and [0, 1073741824] for positive offsets", /* EIPSEC_INVAL_PRIORITY_OFFSET */ "Policy priority not compiled in", /*EIPSEC_PRIORITY_NOT_COMPILED*/ "Unknown error", /*EIPSEC_MAX*/ }; const char *ipsec_strerror(void) { if (__ipsec_errcode < 0 || __ipsec_errcode > EIPSEC_MAX) __ipsec_errcode = EIPSEC_MAX; return ipsec_errlist[__ipsec_errcode]; } void __ipsec_set_strerror(const char *str) { __ipsec_errcode = EIPSEC_SYSTEM_ERROR; ipsec_errlist[EIPSEC_SYSTEM_ERROR] = str; return; }
/* XMMS2 - X Music Multiplexer System * Copyright (C) 2003-2011 XMMS2 Team * * PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!! * * 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. */ #include "xmms/xmms_xformplugin.h" #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include "browse.h" gboolean xmms_file_browse (xmms_xform_t *xform, const gchar *url, xmms_error_t *error) { GDir *dir; GError *err = NULL; const gchar *d, *tmp; struct stat st; tmp = url + 7; dir = g_dir_open (tmp, 0, &err); if (!dir) { xmms_error_set (error, XMMS_ERROR_NOENT, err->message); return FALSE; } while ((d = g_dir_read_name (dir))) { guint32 flags = 0; const char *entry; int ret; gchar *t = g_build_filename (tmp, d, NULL); ret = stat (t, &st); g_free (t); entry = d; if (ret) { continue; } if (S_ISDIR (st.st_mode)) { flags |= XMMS_XFORM_BROWSE_FLAG_DIR; } xmms_xform_browse_add_entry (xform, entry, flags); if (!S_ISDIR (st.st_mode)) { xmms_xform_browse_add_entry_property_int (xform, "size", st.st_size); } } g_dir_close (dir); return TRUE; }
/* * Copyright (C) 2011 Igalia S.L. * * Contact: Iago Toral Quiroga <itoral@igalia.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /* * This module provides helper functions to use Range Values easily. * Inspired by libsoup's soup-value-utils: * http://git.gnome.org/browse/libsoup/tree/libsoup/soup-value-utils.c * */ #include <grl-range-value.h> #include <grl-value-helper.h> G_DEFINE_BOXED_TYPE (GrlRangeValue, grl_range_value, (GBoxedCopyFunc) grl_range_value_dup, (GBoxedFreeFunc) grl_range_value_free) GrlRangeValue * grl_range_value_new (GValue *min, GValue *max) { GrlRangeValue *range; range = g_slice_new0 (GrlRangeValue); if (min) { range->min = grl_g_value_dup (min); } if (max) { range->max = grl_g_value_dup (max); } return range; } void grl_range_value_free (GrlRangeValue *range) { g_clear_pointer (&range->min, grl_g_value_free); g_clear_pointer (&range->max, grl_g_value_free); g_slice_free (GrlRangeValue, range); } /** * grl_range_value_hashtable_new: * * Returns: (transfer full) (element-type gpointer GrlRangeValue): a #GHashTable */ GHashTable * grl_range_value_hashtable_new (void) { return g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)grl_range_value_free); } GrlRangeValue * grl_range_value_dup (const GrlRangeValue *range) { return grl_range_value_new (range->min, range->max); } void grl_range_value_hashtable_insert (GHashTable *hash_table, gpointer key, GValue *min, GValue *max) { GrlRangeValue *range = grl_range_value_new (min, max); g_hash_table_insert (hash_table, key, range); }
/************************************************************************* Copyright (C) 2010 Nokia Corporation. These OHM Modules are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *************************************************************************/ #ifndef __OHM_VIDEOEP_RESOLVER_H__ #define __OHM_VIDEOEP_RESOLVER_H__ #include <stdint.h> #include "data-types.h" /* hack to avoid multiple includes */ typedef struct _OhmPlugin OhmPlugin; void resolver_init(OhmPlugin *); void resolver_exit(OhmPlugin *); int resolver_execute(const char *, int, const char **, videoep_arg_t **); #endif /* __OHM_VIDEOEP_RESOLVER_H__ */ /* * Local Variables: * c-basic-offset: 4 * indent-tabs-mode: nil * End: * vim:set expandtab shiftwidth=4: */
/* * Copyright (C) 2013 Bastien Nocera <hadess@hadess.net> * * Authors: Bastien Nocera <hadess@hadess.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include <gdk-pixbuf/gdk-pixbuf.h> #ifdef THUMBNAILER_RETURNS_PIXBUF #ifdef THUMBNAILER_RETURNS_DATA #error "Only one of THUMBNAILER_RETURNS_PIXBUF or THUMBNAILER_RETURNS_DATA must be set" #else GdkPixbuf * file_to_pixbuf (const char *path, guint destination_size, GError **error); #endif #elif THUMBNAILER_RETURNS_DATA char * file_to_data (const char *path, gsize *ret_length, GError **error); #else #error "One of THUMBNAILER_RETURNS_PIXBUF or THUMBNAILER_RETURNS_DATA must be set" #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef RENDERNODEINSTANCESERVER_H #define RENDERNODEINSTANCESERVER_H #include "qt4nodeinstanceserver.h" namespace QmlDesigner { class Qt4RenderNodeInstanceServer : public Qt4NodeInstanceServer { Q_OBJECT public: explicit Qt4RenderNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); void createScene(const CreateSceneCommand &command); void clearScene(const ClearSceneCommand &command); void completeComponent(const CompleteComponentCommand &command); void changeState(const ChangeStateCommand &command); void removeSharedMemory(const RemoveSharedMemoryCommand &command); protected: void collectItemChangesAndSendChangeCommands(); private: QSet<ServerNodeInstance> m_dirtyInstanceSet; }; } // namespace QmlDesigner #endif // RENDERNODEINSTANCESERVER_H
/* specfunc/gsl_sf_dilog.h * * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004 Gerard Jungman * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Author: G. Jungman */ #ifndef __GSL_SF_DILOG_H__ #define __GSL_SF_DILOG_H__ #include "gsl_sf_result.h" #undef __BEGIN_DECLS #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS /* empty */ # define __END_DECLS /* empty */ #endif __BEGIN_DECLS /* Real part of DiLogarithm(x), for real argument. * In Lewin's notation, this is Li_2(x). * * Li_2(x) = - Re[ Integrate[ Log[1-s] / s, {s, 0, x}] ] * * The function in the complex plane has a branch point * at z = 1; we place the cut in the conventional way, * on [1, +infty). This means that the value for real x > 1 * is a matter of definition; however, this choice does not * affect the real part and so is not relevant to the * interpretation of this implemented function. */ int gsl_sf_dilog_e(const double x, gsl_sf_result * result); double gsl_sf_dilog(const double x); /* DiLogarithm(z), for complex argument z = x + i y. * Computes the principal branch. * * Recall that the branch cut is on the real axis with x > 1. * The imaginary part of the computed value on the cut is given * by -Pi*log(x), which is the limiting value taken approaching * from y < 0. This is a conventional choice, though there is no * true standardized choice. * * Note that there is no canonical way to lift the defining * contour to the full Riemann surface because of the appearance * of a "hidden branch point" at z = 0 on non-principal sheets. * Experts will know the simple algebraic prescription for * obtaining the sheet they want; non-experts will not want * to know anything about it. This is why GSL chooses to compute * only on the principal branch. */ int gsl_sf_complex_dilog_xy_e( const double x, const double y, gsl_sf_result * result_re, gsl_sf_result * result_im ); /* DiLogarithm(z), for complex argument z = r Exp[i theta]. * Computes the principal branch, thereby assuming an * implicit reduction of theta to the range (-2 pi, 2 pi). * * If theta is identically zero, the imaginary part is computed * as if approaching from y > 0. For other values of theta no * special consideration is given, since it is assumed that * no other machine representations of multiples of pi will * produce y = 0 precisely. This assumption depends on some * subtle properties of the machine arithmetic, such as * correct rounding and monotonicity of the underlying * implementation of sin() and cos(). * * This function is ok, but the interface is confusing since * it makes it appear that the branch structure is resolved. * Furthermore the handling of values close to the branch * cut is subtle. Perhap this interface should be deprecated. */ int gsl_sf_complex_dilog_e( const double r, const double theta, gsl_sf_result * result_re, gsl_sf_result * result_im ); /* Spence integral; spence(s) := Li_2(1-s) * * This function has a branch point at 0; we place the * cut on (-infty,0). Because of our choice for the value * of Li_2(z) on the cut, spence(s) is continuous as * s approaches the cut from above. In other words, * we define spence(x) = spence(x + i 0+). */ int gsl_sf_complex_spence_xy_e( const double x, const double y, gsl_sf_result * real_sp, gsl_sf_result * imag_sp ); __END_DECLS #endif /* __GSL_SF_DILOG_H__ */
#ifndef UNITTEST_TESTRUNNER_H #define UNITTEST_TESTRUNNER_H #include "Test.h" #include "TestList.h" #include "CurrentTest.h" namespace UnitTest { class TestReporter; class TestResults; class Timer; UNITTEST_LINKAGE int RunAllTests(); struct True { bool operator()(const Test* const) const { return true; } }; class UNITTEST_LINKAGE TestRunner { public: explicit TestRunner(TestReporter& reporter); ~TestRunner(); template< class Predicate > int RunTestsIf(TestList const& list, char const* suiteName, const Predicate& predicate, int maxTestTimeInMs) const { Test* curTest = list.GetHead(); while (curTest != 0) { if (IsTestInSuite(curTest, suiteName) && predicate(curTest)) RunTest(m_result, curTest, maxTestTimeInMs); curTest = curTest->m_nextTest; } return Finish(); } TestResults* GetTestResults(); private: TestReporter* m_reporter; TestResults* m_result; Timer* m_timer; int Finish() const; bool IsTestInSuite(const Test* const curTest, char const* suiteName) const; void RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const; }; } #endif
/* * Copyright (c) 2010, Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. * * This file is part of the Contiki operating system. * */ #include <net/l2_buf.h> #include "contiki/mac/mac.h" #define DEBUG 0 #include "contiki/ip/uip-debug.h" #if UIP_LOGGING #include <stdio.h> void uip_log(char *msg); #define UIP_LOG(m) uip_log(m) #else #define UIP_LOG(m) #endif #if NET_MAC_CONF_STATS net_mac_stats_t net_mac_stats = {0}; #endif /* NET_MAC_CONF_STATS */ /*---------------------------------------------------------------------------*/ void mac_call_sent_callback(struct net_buf *buf, mac_callback_t sent, void *ptr, int status, int num_tx) { PRINTF("buf %p mac_callback_t %p ptr %p status %d num_tx %d\n", buf, (void *)sent, ptr, status, num_tx); switch(status) { case MAC_TX_COLLISION: PRINTF("mac: collision after %d tx\n", num_tx); break; case MAC_TX_NOACK: PRINTF("mac: noack after %d tx\n", num_tx); break; case MAC_TX_OK: PRINTF("mac: sent after %d tx\n", num_tx); break; default: PRINTF("mac: error %d after %d tx\n", status, num_tx); } if(sent) { #if NET_MAC_CONF_STATS net_mac_stats.bytes_sent += uip_pkt_buflen(buf); #endif sent(buf, ptr, status, num_tx); } } /*---------------------------------------------------------------------------*/
/********************************************************************** *< FILE: IDX9PixelShader.h DESCRIPTION: DirectX 9 Pixel Shader Interface Definition CREATED BY: Nikolai Sander and Norbert Jeske HISTORY: Created 9/27/00 *> Copyright (c) 2000, All Rights Reserved. **********************************************************************/ #pragma once #include "baseinterface.h" #include <d3dx9.h> // forward declarations class ID3D9GraphicsWindow; class IDX9VertexShader; class Material; class INode; #define DX9_PIXEL_SHADER_INTERFACE_ID Interface_ID(0x544218fd, 0x7b344bc9) class IDX9PixelShader : public BaseInterface { public: virtual Interface_ID GetID() { return DX9_PIXEL_SHADER_INTERFACE_ID; } // Confirm that the Direct3D Device can handle this PixelShader virtual HRESULT ConfirmDevice(ID3D9GraphicsWindow *gw) = 0; // Confirm that an associated VertexShader will work with this PixelShader virtual HRESULT ConfirmVertexShader(IDX9VertexShader *pvs) = 0; // Load PixelShader instructions and textures. PixelShader instructions // should be loaded once and shared among all the nodes using this // PixelShader. In addition, any textures necessary for the PixelShader // effect should be loaded once and shared among all the nodes using this // PixelShader. virtual HRESULT Initialize(Material *mtl, INode *node) = 0; // Number of passes for the effect this PixelShader creates. Note that // this value will depend on the hardware currently in use. virtual int GetNumMultiPass() = 0; // Retrieve the PixelShader handle for the specified pass for use in GFX virtual LPDIRECT3DPIXELSHADER9 GetPixelShaderHandle(int numPass) = 0; // Set the PixelShader for the specified pass. This call will be made at // least once per object to set the per object data for the PixelShader // such as the PixelShader constants. virtual HRESULT SetPixelShader(ID3D9GraphicsWindow *gw, int numPass) = 0; };
/* ssl/s23_lib.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <stdio.h> #include <openssl/objects.h> #include "ssl_locl.h" #define clear_sys_error() { errno=0; } long ssl23_default_timeout(void) { return (300); } int ssl23_num_ciphers(void) { return (ssl3_num_ciphers() #ifndef OPENSSL_NO_SSL2 + ssl2_num_ciphers() #endif ); } const SSL_CIPHER *ssl23_get_cipher(unsigned int u) { unsigned int uu = ssl3_num_ciphers(); if (u < uu) return (ssl3_get_cipher(u)); else #ifndef OPENSSL_NO_SSL2 return (ssl2_get_cipher(u - uu)); #else return (NULL); #endif } /* * This function needs to check if the ciphers required are actually * available */ const SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) { const SSL_CIPHER *cp; cp = ssl3_get_cipher_by_char(p); #ifndef OPENSSL_NO_SSL2 if (cp == NULL) cp = ssl2_get_cipher_by_char(p); #endif return (cp); } int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; /* We can write SSLv2 and SSLv3 ciphers */ /* but no ECC ciphers */ if (c->algorithm_mkey == SSL_kECDHr || c->algorithm_mkey == SSL_kECDHe || c->algorithm_mkey == SSL_kEECDH || c->algorithm_auth == SSL_aECDH || c->algorithm_auth == SSL_aECDSA) return 0; if (p != NULL) { l = c->id; p[0] = ((unsigned char)(l >> 16L)) & 0xFF; p[1] = ((unsigned char)(l >> 8L)) & 0xFF; p[2] = ((unsigned char)(l)) & 0xFF; } return (3); } int ssl23_read(SSL *s, void *buf, int len) { int n; clear_sys_error(); if (SSL_in_init(s) && (!s->in_handshake)) { n = s->handshake_func(s); if (n < 0) return (n); if (n == 0) { SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE); return (-1); } return (SSL_read(s, buf, len)); } else { ssl_undefined_function(s); return (-1); } } int ssl23_peek(SSL *s, void *buf, int len) { int n; clear_sys_error(); if (SSL_in_init(s) && (!s->in_handshake)) { n = s->handshake_func(s); if (n < 0) return (n); if (n == 0) { SSLerr(SSL_F_SSL23_PEEK, SSL_R_SSL_HANDSHAKE_FAILURE); return (-1); } return (SSL_peek(s, buf, len)); } else { ssl_undefined_function(s); return (-1); } } int ssl23_write(SSL *s, const void *buf, int len) { int n; clear_sys_error(); if (SSL_in_init(s) && (!s->in_handshake)) { n = s->handshake_func(s); if (n < 0) return (n); if (n == 0) { SSLerr(SSL_F_SSL23_WRITE, SSL_R_SSL_HANDSHAKE_FAILURE); return (-1); } return (SSL_write(s, buf, len)); } else { ssl_undefined_function(s); return (-1); } }
/* * Copyright (c) 2009-2021, Google LLC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Google LLC 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 Google LLC 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 UPB_JSONENCODE_H_ #define UPB_JSONENCODE_H_ #include "upb/def.h" #ifdef __cplusplus extern "C" { #endif enum { /* When set, emits 0/default values. TODO(haberman): proto3 only? */ upb_JsonEncode_EmitDefaults = 1, /* When set, use normal (snake_caes) field names instead of JSON (camelCase) names. */ upb_JsonEncode_UseProtoNames = 2 }; /* Encodes the given |msg| to JSON format. The message's reflection is given in * |m|. The symtab in |symtab| is used to find extensions (if NULL, extensions * will not be printed). * * Output is placed in the given buffer, and always NULL-terminated. The output * size (excluding NULL) is returned. This means that a return value >= |size| * implies that the output was truncated. (These are the same semantics as * snprintf()). */ size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, const upb_DefPool* ext_pool, int options, char* buf, size_t size, upb_Status* status); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* UPB_JSONENCODE_H_ */
/** * @file * MDNS responder */ /* * Copyright (c) 2015 Verisure Innovation AB * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. * * Author: Erik Ekman <erik@kryo.se> * */ #ifndef LWIP_HDR_APPS_MDNS_H #define LWIP_HDR_APPS_MDNS_H #include "lwip/apps/mdns_opts.h" #include "lwip/netif.h" #ifdef __cplusplus extern "C" { #endif #if LWIP_MDNS_RESPONDER enum mdns_sd_proto { DNSSD_PROTO_UDP = 0, DNSSD_PROTO_TCP = 1 }; #define MDNS_PROBING_CONFLICT 0 #define MDNS_PROBING_SUCCESSFUL 1 #define MDNS_LABEL_MAXLEN 63 struct mdns_host; struct mdns_service; /** Callback function to add text to a reply, called when generating the reply */ typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata); /** Callback function to let application know the result of probing network for name * uniqueness, called with result MDNS_PROBING_SUCCESSFUL if no other node claimed * use for the name for the netif or a service and is safe to use, or MDNS_PROBING_CONFLICT * if another node is already using it and mdns is disabled on this interface */ typedef void (*mdns_name_result_cb_t)(struct netif* netif, u8_t result); void mdns_resp_init(void); void mdns_resp_register_name_result_cb(mdns_name_result_cb_t cb); err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl); err_t mdns_resp_remove_netif(struct netif *netif); err_t mdns_resp_rename_netif(struct netif *netif, const char *hostname); s8_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata); err_t mdns_resp_del_service(struct netif *netif, s8_t slot); err_t mdns_resp_rename_service(struct netif *netif, s8_t slot, const char *name); err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len); void mdns_resp_restart(struct netif *netif); void mdns_resp_announce(struct netif *netif); /** * @ingroup mdns * Announce IP settings have changed on netif. * Call this in your callback registered by netif_set_status_callback(). * No need to call this function when LWIP_NETIF_EXT_STATUS_CALLBACK==1, * this handled automatically for you. * @param netif The network interface where settings have changed. */ #define mdns_resp_netif_settings_changed(netif) mdns_resp_announce(netif) #endif /* LWIP_MDNS_RESPONDER */ #ifdef __cplusplus } #endif #endif /* LWIP_HDR_APPS_MDNS_H */
/* * Copyright 2013 MongoDB, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "mongoc-prelude.h" #ifndef MONGOC_READ_PREFS_PRIVATE_H #define MONGOC_READ_PREFS_PRIVATE_H #include <bson/bson.h> #include "mongoc-cluster-private.h" #include "mongoc-read-prefs.h" BSON_BEGIN_DECLS struct _mongoc_read_prefs_t { mongoc_read_mode_t mode; bson_t tags; int64_t max_staleness_seconds; bson_t hedge; }; typedef struct _mongoc_assemble_query_result_t { bson_t *assembled_query; bool query_owned; mongoc_query_flags_t flags; } mongoc_assemble_query_result_t; #define ASSEMBLE_QUERY_RESULT_INIT \ { \ NULL, false, MONGOC_QUERY_NONE \ } const char * _mongoc_read_mode_as_str (mongoc_read_mode_t mode); void assemble_query (const mongoc_read_prefs_t *read_prefs, const mongoc_server_stream_t *server_stream, const bson_t *query_bson, mongoc_query_flags_t initial_flags, mongoc_assemble_query_result_t *result); void assemble_query_result_cleanup (mongoc_assemble_query_result_t *result); bool _mongoc_read_prefs_validate (const mongoc_read_prefs_t *read_prefs, bson_error_t *error); #define IS_PREF_PRIMARY(_pref) \ (!(_pref) || ((_pref)->mode == MONGOC_READ_PRIMARY)) BSON_END_DECLS #endif /* MONGOC_READ_PREFS_PRIVATE_H */
#ifndef SGX_SYSSENDFILE_UTIL_H #define SGX_SYSSENDFILE_UTIL_H #include <proxy/sgx_syssendfile_t.h> ssize_t sgx_wrapper_sendfile (int out_fd, int in_fd, off_t *offset, size_t count) { ssize_t retval; ocall_sendfile(&retval, out_fd, in_fd, offset, count); return retval; } #define sendfile(A, B, C, D) sgx_wrapper_sendfile(A, B, C, D) #endif
#ifndef HEADER_CURL_TOOL_CB_PRG_H #define HEADER_CURL_TOOL_CB_PRG_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "tool_setup.h" #define CURL_PROGRESS_STATS 0 /* default progress display */ #define CURL_PROGRESS_BAR 1 struct ProgressData { int calls; curl_off_t prev; struct timeval prevtime; int width; FILE *out; /* where to write everything to */ curl_off_t initial_size; unsigned int tick; int bar; int barmove; }; void progressbarinit(struct ProgressData *bar, struct OperationConfig *config); /* ** callback for CURLOPT_PROGRESSFUNCTION */ int tool_progress_cb(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow); #endif /* HEADER_CURL_TOOL_CB_PRG_H */
/* * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef COMMON_AUDIO_BLOCKER_H_ #define COMMON_AUDIO_BLOCKER_H_ #include <memory> #include "common_audio/audio_ring_buffer.h" #include "common_audio/channel_buffer.h" namespace webrtc { // The callback function to process audio in the time domain. Input has already // been windowed, and output will be windowed. The number of input channels // must be >= the number of output channels. class BlockerCallback { public: virtual ~BlockerCallback() {} virtual void ProcessBlock(const float* const* input, size_t num_frames, size_t num_input_channels, size_t num_output_channels, float* const* output) = 0; }; // The main purpose of Blocker is to abstract away the fact that often we // receive a different number of audio frames than our transform takes. For // example, most FFTs work best when the fft-size is a power of 2, but suppose // we receive 20ms of audio at a sample rate of 48000. That comes to 960 frames // of audio, which is not a power of 2. Blocker allows us to specify the // transform and all other necessary processing via the Process() callback // function without any constraints on the transform-size // (read: |block_size_|) or received-audio-size (read: |chunk_size_|). // We handle this for the multichannel audio case, allowing for different // numbers of input and output channels (for example, beamforming takes 2 or // more input channels and returns 1 output channel). Audio signals are // represented as deinterleaved floats in the range [-1, 1]. // // Blocker is responsible for: // - blocking audio while handling potential discontinuities on the edges // of chunks // - windowing blocks before sending them to Process() // - windowing processed blocks, and overlap-adding them together before // sending back a processed chunk // // To use blocker: // 1. Impelment a BlockerCallback object |bc|. // 2. Instantiate a Blocker object |b|, passing in |bc|. // 3. As you receive audio, call b.ProcessChunk() to get processed audio. // // A small amount of delay is added to the first received chunk to deal with // the difference in chunk/block sizes. This delay is <= chunk_size. // // Ownership of window is retained by the caller. That is, Blocker makes a // copy of window and does not attempt to delete it. class Blocker { public: Blocker(size_t chunk_size, size_t block_size, size_t num_input_channels, size_t num_output_channels, const float* window, size_t shift_amount, BlockerCallback* callback); ~Blocker(); void ProcessChunk(const float* const* input, size_t chunk_size, size_t num_input_channels, size_t num_output_channels, float* const* output); size_t initial_delay() const { return initial_delay_; } private: const size_t chunk_size_; const size_t block_size_; const size_t num_input_channels_; const size_t num_output_channels_; // The number of frames of delay to add at the beginning of the first chunk. const size_t initial_delay_; // The frame index into the input buffer where the first block should be read // from. This is necessary because shift_amount_ is not necessarily a // multiple of chunk_size_, so blocks won't line up at the start of the // buffer. size_t frame_offset_; // Since blocks nearly always overlap, there are certain blocks that require // frames from the end of one chunk and the beginning of the next chunk. The // input and output buffers are responsible for saving those frames between // calls to ProcessChunk(). // // Both contain |initial delay| + |chunk_size| frames. The input is a fairly // standard FIFO, but due to the overlap-add it's harder to use an // AudioRingBuffer for the output. AudioRingBuffer input_buffer_; ChannelBuffer<float> output_buffer_; // Space for the input block (can't wrap because of windowing). ChannelBuffer<float> input_block_; // Space for the output block (can't wrap because of overlap/add). ChannelBuffer<float> output_block_; std::unique_ptr<float[]> window_; // The amount of frames between the start of contiguous blocks. For example, // |shift_amount_| = |block_size_| / 2 for a Hann window. size_t shift_amount_; BlockerCallback* callback_; }; } // namespace webrtc #endif // COMMON_AUDIO_BLOCKER_H_
#import <IOKit/IOKitLib.h> #import "QCInspector.h" @class GFList; @interface QCHIDInputUI : QCInspector { IBOutlet NSPopUpButton *deviceMenu; // 28 = 0x1c IBOutlet NSTableView *elementsTableView; // 32 = 0x20 GFList *_allElements; // 36 = 0x24 IBOutlet NSMutableArray *_elements; // 40 = 0x28 unsigned int _addNotification; // 44 = 0x2c unsigned int _removeNotification; // 48 = 0x30 IONotificationPortRef _notificationPort; // 52 = 0x34 CFRunLoopSourceRef _runLoopSource; // 56 = 0x38 } + (id)viewNibName; - (void)_updateUI; - (void)_setupUI; - (void)setupViewForPatch:(id)fp8; - (void)resetView; - (void)updateDevice:(id)fp8; - (NSInteger)numberOfRowsInTableView:(NSTableView*)fp8; - (id)tableView:(NSTableView*)fp8 objectValueForTableColumn:(NSTableColumn*)fp12 row:(NSInteger)fp16; - (void)tableView:(NSTableView*)fp8 setObjectValue:(id)fp12 forTableColumn:(NSTableColumn*)fp16 row:(NSInteger)fp20; @end
/*- * Copyright (c) 2006 Verdens Gang AS * Copyright (c) 2006-2014 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland <martin@varnish-software.com> * * 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 THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "config.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include "vsb.h" #include "vas.h" #include "vxp.h" static void vxp_add_token(struct vxp *vxp, unsigned tok, const char *b, const char *e) { struct token *t; t = vxp_Alloc(vxp, sizeof *t); AN(t); t->tok = tok; t->b = b; t->e = e; if (vxp->t != NULL) VTAILQ_INSERT_AFTER(&vxp->tokens, vxp->t, t, list); else VTAILQ_INSERT_TAIL(&vxp->tokens, t, list); vxp->t = t; } static int vxp_decstr(struct vxp *vxp, int quoted) { const char *b, *e, *p; char *s; unsigned l; int esc = 0; assert(vxp->t->tok == VAL); b = vxp->t->b; e = vxp->t->e; if (quoted) { assert(e - b >= 2); b++; e--; } l = e - b; s = vxp->t->dec = vxp_Alloc(vxp, l + 1); AN(vxp->t->dec); for (p = b; p < e; p++) { if (!esc && *p == '\\') { esc = 1; continue; } esc = 0; *s++ = *p; } *s = '\0'; if (esc || p != e) { VSB_printf(vxp->sb, "Syntax error "); vxp_ErrWhere(vxp, vxp->t, -1); return (1); } return (0); } /* * Build a token list */ void vxp_Lexer(struct vxp *vxp) { const char *p, *q; unsigned u; char quote; for (p = vxp->b; p < vxp->e; ) { /* Skip any whitespace */ if (isspace(*p)) { p++; continue; } /* Match for the fixed tokens */ u = vxp_fixed_token(p, &q); if (u != 0) { AN(q); vxp_add_token(vxp, u, p, q); p = q; continue; } /* Match quoted strings */ if (*p == '"' || *p == '\'') { quote = *p; for (q = p + 1; q < vxp->e; q++) { if (q[-1] == '\\') continue; if (*q == quote) { q++; quote = '\0'; break; } } vxp_add_token(vxp, VAL, p, q); if (quote != '\0') { VSB_printf(vxp->sb, "Unterminated string "); vxp_ErrWhere(vxp, vxp->t, q - p - 1); return; } if (vxp_decstr(vxp, 1)) return; p = q; continue; } /* Match bareword */ if (isword(*p)) { for (q = p; q < vxp->e; q++) if (!isword(*q)) break; vxp_add_token(vxp, VAL, p, q); if (vxp_decstr(vxp, 0)) return; p = q; continue; } /* Error */ vxp_add_token(vxp, EOI, p, p + 1); VSB_printf(vxp->sb, "Syntax error "); vxp_ErrWhere(vxp, vxp->t, q - p); return; } /* Finished */ vxp_add_token(vxp, EOI, vxp->e, vxp->e); } #ifdef VXP_DEBUG void vxp_PrintTokens(const struct vxp *vxp) { struct token *t; fprintf(stderr, "Token list:\n"); fprintf(stderr, " %-5s %-20s %s\n", "TOK", "SUBSTR", "DECODED"); VTAILQ_FOREACH(t, &vxp->tokens, list) { fprintf(stderr, " "); fprintf(stderr, "%-5s", vxp_tnames[t->tok]); fprintf(stderr, " %-20.*s", (unsigned)(t->e - t->b), t->b); if (t->dec) fprintf(stderr, " '%s'", t->dec); fprintf(stderr, "\n"); } fprintf(stderr, "\n"); } #endif /* VXP_DEBUG */
/******************************************************************************* * @file * @purpose * @version 0.1 *------------------------------------------------------------------------------ * Copyright (C) 2011 Gumstix Inc. * All rights reserved. * * Contributer(s): * Neil MacMunn <neil@gumstix.com> *------------------------------------------------------------------------------ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ #ifndef ___LPC17XX_CAN_H__ #define ___LPC17XX_CAN_H__ #include "lpc_types.h" int _CAN_SetCommand(uint8_t * args); int _CAN_IRQCmd(uint8_t * args); int _FCAN_ReadObj(uint8_t * args); int _CAN_Init(uint8_t * args); int _CAN_ModeConfig(uint8_t * args); int _CAN_LoadExplicitEntry(uint8_t * args); int _CAN_LoadFullCANEntry(uint8_t * args); int _CAN_IntGetStatus(uint8_t * args); int _CAN_SetAFMode(uint8_t * args); int _CAN_SendMsg(uint8_t * args); int _CAN_LoadGroupEntry(uint8_t * args); int _CAN_SetupAFLUT(uint8_t * args); int _CAN_GetCTRLStatus(uint8_t * args); int _CAN_DeInit(uint8_t * args); int _CAN_ReceiveMsg(uint8_t * args); int _CAN_FullCANPendGetStatus(uint8_t * args); int _CAN_GetCRStatus(uint8_t * args); int _CAN_RemoveEntry(uint8_t * args); int _CAN_FullCANIntGetStatus(uint8_t * args); int _SFF_Entry_malloc(uint8_t * args); int _SFF_Entry_controller(uint8_t * args); int _SFF_Entry_disable(uint8_t * args); int _SFF_Entry_id_11(uint8_t * args); int _CAN_MSG_Type_malloc(uint8_t * args); int _CAN_MSG_Type_id(uint8_t * args); int _CAN_MSG_Type_dataA(uint8_t * args); int _CAN_MSG_Type_dataB(uint8_t * args); int _CAN_MSG_Type_len(uint8_t * args); int _CAN_MSG_Type_format(uint8_t * args); int _CAN_MSG_Type_type(uint8_t * args); int _CAN_ERROR_malloc(uint8_t * args); int _CAN_AFMODE_Type_malloc(uint8_t * args); int _CAN_CR_STS_Type_malloc(uint8_t * args); int _CAN_CTRL_STS_Type_malloc(uint8_t * args); int _AFLUT_ENTRY_Type_malloc(uint8_t * args); int _CAN_ID_FORMAT_Type_malloc(uint8_t * args); int _FullCAN_Entry_malloc(uint8_t * args); int _FullCAN_Entry_controller(uint8_t * args); int _FullCAN_Entry_disable(uint8_t * args); int _FullCAN_Entry_id_11(uint8_t * args); int _EFF_GPR_Entry_malloc(uint8_t * args); int _EFF_GPR_Entry_controller1(uint8_t * args); int _EFF_GPR_Entry_controller2(uint8_t * args); int _EFF_GPR_Entry_lowerEID(uint8_t * args); int _EFF_GPR_Entry_upperEID(uint8_t * args); int _CAN_INT_EN_Type_malloc(uint8_t * args); int _CAN_PinCFG_Type_malloc(uint8_t * args); int _CAN_PinCFG_Type_RD(uint8_t * args); int _CAN_PinCFG_Type_TD(uint8_t * args); int _CAN_FRAME_Type_malloc(uint8_t * args); int _FullCAN_IC_Type_malloc(uint8_t * args); int _SFF_GPR_Entry_malloc(uint8_t * args); int _SFF_GPR_Entry_controller1(uint8_t * args); int _SFF_GPR_Entry_disable1(uint8_t * args); int _SFF_GPR_Entry_lowerID(uint8_t * args); int _SFF_GPR_Entry_controller2(uint8_t * args); int _SFF_GPR_Entry_disable2(uint8_t * args); int _SFF_GPR_Entry_upperID(uint8_t * args); int _CAN_MODE_Type_malloc(uint8_t * args); int _EFF_Entry_malloc(uint8_t * args); int _EFF_Entry_controller(uint8_t * args); int _EFF_Entry_ID_29(uint8_t * args); int _AF_SectionDef_malloc(uint8_t * args); int _AF_SectionDef_FullCAN_Sec(uint8_t * args); int _AF_SectionDef_FC_NumEntry(uint8_t * args); int _AF_SectionDef_SFF_Sec(uint8_t * args); int _AF_SectionDef_SFF_NumEntry(uint8_t * args); int _AF_SectionDef_SFF_GPR_Sec(uint8_t * args); int _AF_SectionDef_SFF_GPR_NumEntry(uint8_t * args); int _AF_SectionDef_EFF_Sec(uint8_t * args); int _AF_SectionDef_EFF_NumEntry(uint8_t * args); int _AF_SectionDef_EFF_GPR_Sec(uint8_t * args); int _AF_SectionDef_EFF_GPR_NumEntry(uint8_t * args); #endif
// -*- tab-width:4 ; indent-tabs-mode:nil -*- #ifndef HRE_RUNTIME_H #define HRE_RUNTIME_H #include <unistd.h> #include <hre/user.h> /** \file runtime.h \brief Process architecture independent RunTime utilities. */ /** * Open the given library, abort on failure. */ extern void *RTdlopen (const char *name); /** * Resolve the symbol with respect to the given library. * The libname argument is for error messages only. */ extern void *RTdlsym (const char *libname, void *handle, const char *symbol); extern void *RTtrydlsym (void *handle, const char *symbol); typedef struct { char* key; int val; } si_map_entry; /** \brief Find the value for a given key, or -1 if it does not exist. */ extern int linear_search(si_map_entry map[],const char*key); /** \brief Find the key name for a given option, or "not found" if it does not exist. */ extern char *key_search(si_map_entry map[],const int val); /** \defgroup rt_timer Simple time measuring functions.*/ /*@{*/ /// Opaque type for a timer. typedef struct timer *rt_timer_t; /// Create a new timer. extern rt_timer_t RTcreateTimer(); /// Destroy a timer. extern void RTdeleteTimer(rt_timer_t timer); /// Set time used to 0. extern void RTresetTimer(rt_timer_t timer); /// Start the stop-watch running. extern void RTstartTimer(rt_timer_t timer); /// Reset and Start the stop-watch running. extern void RTrestartTimer(rt_timer_t timer); /// Stop the stopwatch running. extern void RTstopTimer(rt_timer_t timer); /// Report the time accumulated in this timer. extern void RTprintTimer(log_t log,rt_timer_t timer,char *msg, ...); /// Return the real time as a float. extern float RTrealTime(rt_timer_t timer); /*}@*/ /** \defgroup rt_sysinfo Functions for retrieving system information. */ /*@{*/ /// Get the number of CPUs. extern int RTnumCPUs(); /// Get the amount of memory. extern size_t RTmemSize(); /// Get the cache line size. extern int RTcacheLineSize(); /*}@*/ #endif
/*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYASYNCRUNNABLE_H_ #define BERRYASYNCRUNNABLE_H_ #include <Poco/ActiveRunnable.h> namespace berry { /** * This class can be used to call a method asynchronously from the UI thread using * the Display::AsyncExec(Poco::Runnable*) method. * */ template <class ArgType, class OwnerType> class AsyncRunnable : public Poco::ActiveRunnableBase { public: typedef void (OwnerType::*Callback)(const ArgType&); AsyncRunnable(OwnerType* pOwner, Callback method, const ArgType& arg): _pOwner(pOwner), _method(method), _arg(arg) { poco_check_ptr (pOwner); } void run() { ActiveRunnableBase::Ptr guard(this, false); // ensure automatic release when done (_pOwner->*_method)(_arg); } private: OwnerType* _pOwner; Callback _method; ArgType _arg; }; } #endif /* BERRYASYNCRUNNABLE_H_ */
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file pt_EggVertex.h * @author drose * @date 2001-02-22 */ #ifndef PT_EGGVERTEX_H #define PT_EGGVERTEX_H #include "pandabase.h" #include "eggVertex.h" #include "pointerTo.h" /** * A PT(EggVertex). This is defined here solely we can explicitly export the * template class. It's not strictly necessary, but it doesn't hurt. */ EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, PointerToBase<EggVertex>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, PointerTo<EggVertex>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, ConstPointerTo<EggVertex>) typedef PointerTo<EggVertex> PT_EggVertex; typedef ConstPointerTo<EggVertex> CPT_EggVertex; // Tell GCC that we'll take care of the instantiation explicitly here. #ifdef __GNUC__ #pragma interface #endif #endif
/*********************************************************************************************************************** ** ** Copyright (c) 2011, 2014 ETH Zurich ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without modification, are permitted provided that the ** following conditions are met: ** ** * Redistributions of source code must retain the above copyright notice, this list of conditions and the following ** disclaimer. ** * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the ** following disclaimer in the documentation and/or other materials provided with the distribution. ** * Neither the name of the ETH Zurich 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. ** ***********************************************************************************************************************/ #pragma once #include "selftest_api.h" #include "TestBase.h" #include "TestResults.h" namespace SelfTest { /** * The TestManager class manages test registrations and execution for each plug-in. * * @param T * The plug-in class for this plug-in. This is the class that implements the EnvisionPlugin interface. * It is necessary that each plug-in has its own instantiation of the TestManager, since this manager * contains a list of all test cases that the plug-in has. */ template<typename T> class TestManager { public: /** * Adds a new test to the list of tests. * * @param test * The constructor of the test class that implements this test. * * @param name * The name of this test. */ static void add(TestBase::TestConstructor test, const QString &name); /** * Runs all tests registered for this plug-in. */ static TestResults runAllTests(); /** * Runs the specified test for this plug-in. * * @param name * The string id of the test to run. */ static TestResults runTest(const QString &name); private: /** * This is a static class. Object of this class can not be created. */ TestManager(); /** * A list of all test constructors. Test classes are not created unless requested. */ static QMap<QString, TestBase::TestConstructor>* testConstructors; }; template<typename T> inline void TestManager<T>::add(TestBase::TestConstructor test, const QString& name) { static QMap<QString, TestBase::TestConstructor> constructors; testConstructors = &constructors; testConstructors->insert(name, test); } template<typename T> inline TestResults TestManager<T>::runAllTests() { TestResults testRes; if (testConstructors) for (QMap<QString, TestBase::TestConstructor>::iterator testConstructor = testConstructors->begin(); testConstructor != testConstructors->end(); testConstructor++) { TestBase* test = (*testConstructor)(); test->run(testRes); SAFE_DELETE(test); } return testRes; } template<typename T> inline TestResults TestManager<T>::runTest(const QString& name) { TestResults testRes; if (testConstructors->contains(name)) { TestBase* test = testConstructors->value(name)(); test->run(testRes); SAFE_DELETE(test); } return testRes; } template<typename T> inline TestManager<T>::TestManager() { } template<typename T> QMap<QString, TestBase::TestConstructor>* TestManager<T>::testConstructors = nullptr; }
/* dhcp.h - Definitions related to DHCP */ #define DHCP #define DHCP_RETRY 5 #define DHCP_PADDING 0 #define DHCP_SUBNET_MASK 1 #define DHCP_ROUTER 3 #define DHCP_DNS_SERVER 6 #define DHCP_DOMAIN_NAME 15 #define DHCP_VENDER_OPTIONS 43 #define DHCP_REQUESTED_IP 50 #define DHCP_IP_ADDR_LEASE_TIME 51 #define DHCP_OPTION_OVERLOAD 52 #define DHCP_MESSAGE_TYPE 53 #define DHCP_SERVER_ID 54 #define DHCP_PARAMETER_REQUEST_LIST 55 #define DHCP_MESSAGE 56 #define DHCP_MAXIMUM_DHCP_MESSAGE_SIZE 57 #define DHCP_RENEWAL_TIME_VALUE 58 #define DHCP_REBINDING_TIME_VALUE 59 #define DHCP_VENDOR_CLASS_ID 60 #define DHCP_CLIENT_ID 61 #define DHCP_TFTP_SERVER_NAME 66 #define DHCP_BOOTFILE_NAME 67 #define DHCP_CLIENT_SYS_ARCH 93 #define DHCP_CLIENT_NET_ID 94 #define DHCP_CLIENT_MACHINE_ID 97 #define DHCP_MESSAGE_END 255 #pragma pack(2) struct dhcpmsg { byte dc_bop; /* DHCP bootp op 1=req 2=reply */ byte dc_htype; /* DHCP hardware type */ byte dc_hlen; /* DHCP hardware address length */ byte dc_hops; /* DHCP hop count */ uint32 dc_xid; /* DHCP xid */ uint16 dc_secs; /* DHCP seconds */ uint16 dc_flags; /* DHCP flags */ uint32 dc_cip; /* DHCP client IP address */ uint32 dc_yip; /* DHCP your IP address */ uint32 dc_sip; /* DHCP server IP address */ uint32 dc_gip; /* DHCP gateway IP address */ byte dc_chaddr[16]; /* DHCP client hardware address */ union { byte dc_bootp[192]; /* DHCP bootp area (zero) */ struct { byte sname[64]; /* TFTP Server Name */ byte bootfile[128]; /* TFTP File name */ }; }; uint32 dc_cookie; /* DHCP cookie */ byte dc_opt[1024]; /* DHCP options area (large */ /* enough to hold more than */ /* reasonable options */ }; #pragma pack() void dump_dhcp_msg(const struct dhcpmsg* dmsg, uint32 dmsg_size); int32 build_dhcp_discover(struct dhcpmsg* dmsg); int32 build_dhcp_request(struct dhcpmsg* dmsg, const struct dhcpmsg* dmsg_offer, uint32 dsmg_offer_size); extern bpid32 netbufpool; /* ID of net packet buffer pool */
/* * Hypothesis.h * * Created on: 24 Oct 2015 * Author: hieu */ #pragma once #include <iostream> #include <cstddef> #include "FF/FFState.h" #include "Scores.h" namespace Moses2 { class ManagerBase; class Scores; class HypothesisBase { public: virtual ~HypothesisBase() { } inline ManagerBase &GetManager() const { return *m_mgr; } template<typename T> const T &Cast() const { return static_cast<const T&>(*this); } const Scores &GetScores() const { return *m_scores; } Scores &GetScores() { return *m_scores; } const FFState *GetState(size_t ind) const { return m_ffStates[ind]; } FFState *GetState(size_t ind) { return m_ffStates[ind]; } virtual size_t hash() const; virtual size_t hash(size_t seed) const; virtual bool operator==(const HypothesisBase &other) const; virtual SCORE GetFutureScore() const = 0; virtual void EvaluateWhenApplied() = 0; virtual std::string Debug(const System &system) const = 0; protected: ManagerBase *m_mgr; Scores *m_scores; FFState **m_ffStates; HypothesisBase(MemPool &pool, const System &system); }; //////////////////////////////////////////////////////////////////////////////////// class HypothesisFutureScoreOrderer { public: bool operator()(const HypothesisBase* a, const HypothesisBase* b) const { return a->GetFutureScore() > b->GetFutureScore(); } }; }
// // LGPlusButtonsViewShared.h // LGPlusButtonsView // // // The MIT License (MIT) // // Copyright (c) 2015 Grigory Lutkov <Friend.LGA@gmail.com> // (https://github.com/Friend-LGA/LGPlusButtonsView) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // #import <UIKit/UIKit.h> #import "LGPlusButtonsView.h" #define kLGPlusButtonsViewMargin 4.f @interface LGPlusButtonsViewShared : NSObject + (NSString *)stringFromOrientation:(LGPlusButtonsViewOrientation)orientation; + (NSString *)stringFromState:(UIControlState)state; + (NSString *)stringFromState:(UIControlState)state andOrientation:(LGPlusButtonsViewOrientation)orientation; + (UIImage *)image1x1WithColor:(UIColor *)color; @end
#include <stdio.h> int main() { int age = 10; int height = 72; printf("I am %d years old.\n", age); printf("I am %d inches tall.\n", height); return 0; }
/* * Copyright 2010 Igor Nikitin * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Author: Igor Nikitin <igor_nikitin@valentina-db.com> */ #include "cairo-test.h" #define HEIGHT 15 #define WIDTH 40 static void background (cairo_t *cr) { cairo_set_source_rgb( cr, 0, 0, 0 ); cairo_paint (cr); } static void text (cairo_t *cr) { cairo_move_to (cr, 0, 12); cairo_set_source_rgb (cr, 1, 1, 1); cairo_show_text (cr, "CAIRO"); } static cairo_test_status_t top (cairo_t *cr, int width, int height) { background (cr); cairo_rectangle (cr, 0, 0, WIDTH, 5); cairo_clip (cr); text (cr); return CAIRO_TEST_SUCCESS; } static cairo_test_status_t bottom (cairo_t *cr, int width, int height) { background (cr); cairo_rectangle (cr, 0, HEIGHT-5, WIDTH, 5); cairo_clip (cr); text (cr); return CAIRO_TEST_SUCCESS; } static cairo_test_status_t left (cairo_t *cr, int width, int height) { background (cr); cairo_rectangle (cr, 0, 0, 10, HEIGHT); cairo_clip (cr); text (cr); return CAIRO_TEST_SUCCESS; } static cairo_test_status_t right (cairo_t *cr, int width, int height) { background (cr); cairo_rectangle (cr, WIDTH-10, 0, 10, HEIGHT); cairo_clip (cr); text (cr); return CAIRO_TEST_SUCCESS; } CAIRO_TEST (partial_clip_text_top, "Tests drawing text through a single, partial clip.", "clip, text", /* keywords */ NULL, /* requirements */ WIDTH, HEIGHT, NULL, top) CAIRO_TEST (partial_clip_text_bottom, "Tests drawing text through a single, partial clip.", "clip, text", /* keywords */ NULL, /* requirements */ WIDTH, HEIGHT, NULL, bottom) CAIRO_TEST (partial_clip_text_left, "Tests drawing text through a single, partial clip.", "clip, text", /* keywords */ NULL, /* requirements */ WIDTH, HEIGHT, NULL, left) CAIRO_TEST (partial_clip_text_right, "Tests drawing text through a single, partial clip.", "clip, text", /* keywords */ NULL, /* requirements */ WIDTH, HEIGHT, NULL, right)
#import <UIKit/UIKit.h> @interface EventsViewController : UITableViewController { } @property (nonatomic, retain) NSArray *events; - (IBAction)refresh; @end
/*************************************************************************/ /* input_map.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef INPUT_MAP_H #define INPUT_MAP_H #include "core/input/input_event.h" #include "core/object/class_db.h" #include "core/object/object.h" #include "core/templates/ordered_hash_map.h" class InputMap : public Object { GDCLASS(InputMap, Object); public: /** * A special value used to signify that a given Action can be triggered by any device */ static int ALL_DEVICES; struct Action { int id; float deadzone; List<Ref<InputEvent>> inputs; }; private: static InputMap *singleton; mutable OrderedHashMap<StringName, Action> input_map; OrderedHashMap<String, List<Ref<InputEvent>>> default_builtin_cache; List<Ref<InputEvent>>::Element *_find_event(Action &p_action, const Ref<InputEvent> &p_event, bool p_exact_match = false, bool *p_pressed = nullptr, float *p_strength = nullptr, float *p_raw_strength = nullptr) const; Array _action_get_events(const StringName &p_action); Array _get_actions(); String _suggest_actions(const StringName &p_action) const; protected: static void _bind_methods(); public: static _FORCE_INLINE_ InputMap *get_singleton() { return singleton; } bool has_action(const StringName &p_action) const; List<StringName> get_actions() const; void add_action(const StringName &p_action, float p_deadzone = 0.5); void erase_action(const StringName &p_action); float action_get_deadzone(const StringName &p_action); void action_set_deadzone(const StringName &p_action, float p_deadzone); void action_add_event(const StringName &p_action, const Ref<InputEvent> &p_event); bool action_has_event(const StringName &p_action, const Ref<InputEvent> &p_event); void action_erase_event(const StringName &p_action, const Ref<InputEvent> &p_event); void action_erase_events(const StringName &p_action); const List<Ref<InputEvent>> *action_get_events(const StringName &p_action); bool event_is_action(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match = false) const; bool event_get_action_status(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match = false, bool *p_pressed = nullptr, float *p_strength = nullptr, float *p_raw_strength = nullptr) const; const OrderedHashMap<StringName, Action> &get_action_map() const; void load_from_project_settings(); void load_default(); String get_builtin_display_name(const String &p_name) const; // Use an Ordered Map so insertion order is preserved. We want the elements to be 'grouped' somewhat. const OrderedHashMap<String, List<Ref<InputEvent>>> &get_builtins(); InputMap(); }; #endif // INPUT_MAP_H
/* * Arduino JSON library * Benoit Blanchon 2014 - MIT License */ #pragma once #ifndef ARDUINO #include <stddef.h> #include <stdint.h> // This class reproduces Arduino's Print class Print { public: virtual size_t write(uint8_t) = 0; size_t print(const char[]); size_t print(double, int = 2); size_t print(long); size_t println(); }; #else #include <Print.h> #endif
/* * Copyright (C) 2017 Team Kodi * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this Program; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #pragma once #include "games/controllers/ControllerTypes.h" #include "input/joysticks/IInputHandler.h" namespace KODI { namespace GAME { class CGameClient; class CInputSink : public JOYSTICK::IInputHandler { public: explicit CInputSink(CGameClient &m_gameClient); virtual ~CInputSink() = default; // Implementation of IInputHandler virtual std::string ControllerID(void) const override; virtual bool HasFeature(const std::string& feature) const override { return true; } virtual bool AcceptsInput(const std::string& feature) const override; virtual bool OnButtonPress(const std::string& feature, bool bPressed) override; virtual void OnButtonHold(const std::string& feature, unsigned int holdTimeMs) override { } virtual bool OnButtonMotion(const std::string& feature, float magnitude, unsigned int motionTimeMs) override; virtual bool OnAnalogStickMotion(const std::string& feature, float x, float y, unsigned int motionTimeMs) override; virtual bool OnAccelerometerMotion(const std::string& feature, float x, float y, float z) override; private: const CGameClient &m_gameClient; const ControllerPtr m_controller; }; } }
/* * scpu64meminit.h -- Initialize C64 memory. * * Written by * Kajtar Zsolt <soci@c64.rulez.org> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * 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 VICE_SCPU64MEMINIT_H #define VICE_SCPU64MEMINIT_H extern void scpu64meminit(void); #endif
/* * AssocSM.h * * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name Texas Instruments nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** \file AssocSM.h * \brief 802.11 Association SM * * \see assocSM.c */ /***************************************************************************/ /* */ /* MODULE: AssocSM.h */ /* PURPOSE: 802.11 Association SM */ /* */ /***************************************************************************/ #ifndef _ASSOC_SM_H #define _ASSOC_SM_H #include "fsm.h" #include "mlmeApi.h" /* Constants */ #define MAX_ASSOC_MSG_LENGTH (512 + RSN_MAX_GENERIC_IE_LENGTH) #define ASSOC_SM_CAP_ESS_MODE 0x0001 #define ASSOC_SM_CAP_IBSS_MODE 0x0002 #define ASSOC_SM_CAP_CF_POLLABLE 0x0004 #define ASSOC_SM_CAP_CF_POLL_REQ 0x0008 #define ASSOC_SM_CAP_PIVACY 0x0010 #define ASSOC_SM_CAP_SHORT_PREAMBLE 0x0020 #define ASSOC_SM_CAP_PBCC 0x0040 #define ASSOC_SM_CAP_CH_AGILITY 0x0080 /* Enumerations */ /* state machine states */ typedef enum { ASSOC_SM_STATE_IDLE = 0, ASSOC_SM_STATE_WAIT = 1, ASSOC_SM_STATE_ASSOC = 2 } assoc_smStates_t; /* State machine inputs */ typedef enum { ASSOC_SM_EVENT_START = 0, ASSOC_SM_EVENT_STOP = 1, ASSOC_SM_EVENT_SUCCESS = 2, ASSOC_SM_EVENT_FAIL = 3, ASSOC_SM_EVENT_TIMEOUT = 4, ASSOC_SM_EVENT_MAX_RETRY = 5 } assoc_smEvents_t; /* Typedefs */ typedef struct { fsm_stateMachine_t *pAssocSm; TI_UINT32 timeout; TI_UINT8 currentState; TI_UINT32 maxCount; TI_UINT8 retryCount; TI_UINT32 assocRejectCount; TI_UINT32 assocTimeoutCount; char *pChalange; TI_UINT8 assocRespBuffer[MAX_ASSOC_MSG_LENGTH]; TI_UINT32 assocRespLen; TI_UINT8 assocReqBuffer[MAX_ASSOC_MSG_LENGTH]; TI_UINT32 assocReqLen; TI_BOOL reAssocResp; TI_BOOL reAssoc; TI_BOOL disAssoc; /* When set dissasociation frame will be sent. */ TI_HANDLE hMlme; TI_HANDLE hSiteMgr; TI_HANDLE hCtrlData; TI_HANDLE hTWD; TI_HANDLE hRsn; TI_HANDLE hReport; TI_HANDLE hOs; TI_HANDLE hRegulatoryDomain; TI_HANDLE hXCCMngr; TI_HANDLE hQosMngr; TI_HANDLE hMeasurementMgr; TI_HANDLE hApConn; TI_HANDLE hTimer; TI_HANDLE hStaCap; TI_HANDLE hSme; TI_HANDLE hAssocSmTimer; } assoc_t; /* Structures */ /* External data definitions */ /* External functions definitions */ /* Function prototypes */ TI_STATUS assoc_start(TI_HANDLE hAssoc); TI_STATUS reassoc_start(TI_HANDLE hAssoc); TI_STATUS assoc_stop(TI_HANDLE hAssoc); TI_STATUS assoc_recv(TI_HANDLE hAssoc, mlmeFrameInfo_t *pFrame); TI_STATUS assoc_setDisAssocFlag(TI_HANDLE hAssoc, TI_BOOL disAsoccFlag); TI_STATUS assoc_smCapBuild(assoc_t *pCtx, TI_UINT16 *cap); /* local functions */ TI_STATUS assoc_saveAssocRespMessage(assoc_t *pAssocSm, TI_UINT8 *pAssocBuffer, TI_UINT32 length); #endif
#undef CONFIG_WAN
/* Radial transform. */ /* Copyright (C) 2004 University of Texas at Austin 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 <rsf.h> int main(int argc, char* argv[]) { bool inv; int nt, nx, nv, it, ix, iv, nw, n3, i3, ntr, ntm, im; float *trace=NULL, *modl=NULL, *r=NULL; float vmin, vmax, dv, dx, x0, t0, t, dt, tp, xp; char *unit=NULL, *space=NULL, *time=NULL; size_t len; sf_bands spl=NULL; sf_file in, out; sf_init (argc,argv); in = sf_input("in"); out = sf_output("out"); if (!sf_getbool("inv",&inv)) inv=false; /* if y, do inverse transform */ if (!sf_getint("nw",&nw)) nw=2; /* accuracy level */ if (!sf_histint(in,"n2",&nt)) sf_error("No n2= in input"); if (!sf_histfloat(in,"d2",&dt)) sf_error("No d2= in input"); if (!sf_histfloat(in,"o2",&t0)) sf_error("No o2= in input"); if (!sf_getfloat("tp",&tp)) tp=t0; if (!sf_getfloat("xp",&xp)) xp=0.; if (inv) { if (!sf_histint(in,"n1",&nv)) sf_error("No n1= in input"); if (!sf_histfloat(in,"d1",&dv)) sf_error("No d1= in input"); if (!sf_histfloat(in,"o1",&vmin)) sf_error("No o1= in input"); if (!sf_getint("nx",&nx) && !sf_histint(in,"nx",&nx)) sf_error("Need nx="); /* number of offsets (if inv=y) */ if (!sf_getfloat("x0",&x0) && !sf_histfloat(in,"x0",&x0)) sf_error("Need x0="); /* offset origin (if inv=y) */ if (!sf_getfloat("dx",&dx) && !sf_histfloat(in,"dx",&dx)) sf_error("Need dx="); /* offset sampling (if inv=y) */ sf_putint(out,"n1",nx); sf_putfloat(out,"d1",dx); sf_putfloat(out,"o1",x0); sf_putstring(out,"label1","Offset"); if (NULL != (unit=sf_histstring(in,"unit1"))) { space=strchr(unit,'/'); if (*space == '\0') sf_putstring(out,"unit1",unit); } if (nw > 2) spl = sf_spline_init (nw, nv); ntr = nv; ntm = nx; } else { if (!sf_histint(in,"n1",&nx)) sf_error("No n1= in input"); if (!sf_histfloat(in,"d1",&dx)) sf_error("No d1= in input"); if (!sf_histfloat(in,"o1",&x0)) sf_error("No o1= in input"); if (!sf_getint("nv",&nv)) sf_error("Need nv="); /* number of velocities (if inv=n) */ if (!sf_getfloat("vmin",&vmin)) sf_error("Need vmin="); /* minimum velocity (if inv=n) */ if (!sf_getfloat("vmax",&vmax)) sf_error("Need vmax="); /* maximum velocity (if inv=n) */ dv = (vmax - vmin)/(nv-1.); sf_putint(out,"n1",nv); sf_putfloat(out,"d1",dv); sf_putfloat(out,"o1",vmin); sf_putstring(out,"label1","Velocity"); if (NULL != (time = sf_histstring(in,"unit2")) && NULL != (space = sf_histstring(in,"unit1"))) { len = strlen(time)+strlen(space)+2; unit = sf_charalloc(len); snprintf(unit,len,"%s/%s",space,time); sf_putstring(out,"unit1",unit); free(time); free(space); } sf_putint(out,"nx",nx); sf_putfloat(out,"x0",x0); sf_putfloat(out,"dx",dx); if (nw > 2) spl = sf_spline_init (nw, nx); ntr = nx; ntm = nv; } n3 = sf_leftsize(in,2); trace = sf_floatalloc(ntr); modl = sf_floatalloc(ntm); r = sf_floatalloc(ntm); for (i3=0; i3 < n3; i3++) { for (it=0; it < nt; it++) { t = t0 + it*dt; sf_floatread (trace,ntr,in); if (nw > 2) sf_banded_solve (spl,trace); if (t > tp) { if (inv) { for (ix=0; ix < nx; ix++) { r[ix] = (x0-xp+ix*dx)/(t-tp); } sf_int1_init (r, vmin, dv, nv, sf_spline_int, nw, nx, 0.0); } else { for (iv=0; iv < nv; iv++) { r[iv] = xp+(vmin+iv*dv)*(t-tp); } sf_int1_init (r, x0, dx, nx, sf_spline_int, nw, nv, 0.0); } sf_int1_lop (false,false,ntr,ntm,trace,modl); } else { for (im=0; im < ntm; im++) { modl[im] = 0.; } } sf_floatwrite (modl,ntm,out); } } exit(0); }
/* * wslua_proto_expert.c * * Wireshark's interface to the Lua Programming Language * * (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org> * (c) 2008, Balint Reczey <balint.reczey@ericsson.com> * (c) 2011, Stig Bjorlykke <stig@bjorlykke.org> * (c) 2014, Hadriel Kaplan <hadrielk@yahoo.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * 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 "config.h" #include "wslua.h" /* WSLUA_CONTINUE_MODULE Proto */ WSLUA_CLASS_DEFINE(ProtoExpert,FAIL_ON_NULL("null ProtoExpert"),NOP); /* A Protocol expert info field, to be used when adding items to the dissection tree. @since 1.11.3 */ WSLUA_CONSTRUCTOR ProtoExpert_new(lua_State* L) { /* Creates a new `ProtoExpert` object to be used for a protocol's expert information notices. @since 1.11.3 */ #define WSLUA_ARG_ProtoExpert_new_ABBR 1 /* Filter name of the expert info field (the string that is used in filters). */ #define WSLUA_ARG_ProtoExpert_new_TEXT 2 /* The default text of the expert field. */ #define WSLUA_ARG_ProtoExpert_new_GROUP 3 /* Expert group type: one of: `expert.group.CHECKSUM`, `expert.group.SEQUENCE`, `expert.group.RESPONSE_CODE`, `expert.group.REQUEST_CODE`, `expert.group.UNDECODED`, `expert.group.REASSEMBLE`, `expert.group.MALFORMED`, `expert.group.DEBUG`, `expert.group.PROTOCOL`, `expert.group.SECURITY`, `expert.group.COMMENTS_GROUP` or `expert.group.DECRYPTION`. */ #define WSLUA_ARG_ProtoExpert_new_SEVERITY 4 /* Expert severity type: one of: `expert.severity.COMMENT`, `expert.severity.CHAT`, `expert.severity.NOTE`, `expert.severity.WARN`, or `expert.severity.ERROR`. */ ProtoExpert pe = NULL; const gchar* abbr = wslua_checkstring_only(L,WSLUA_ARG_ProtoExpert_new_ABBR); const gchar* text = wslua_checkstring_only(L,WSLUA_ARG_ProtoExpert_new_TEXT); int group = (int)luaL_checkinteger(L, WSLUA_ARG_ProtoExpert_new_GROUP); int severity = (int)luaL_checkinteger(L, WSLUA_ARG_ProtoExpert_new_SEVERITY); if (!abbr[0]) { luaL_argerror(L, WSLUA_ARG_ProtoExpert_new_ABBR, "Empty field name abbrev"); return 0; } if (proto_check_field_name(abbr)) { luaL_argerror(L, WSLUA_ARG_ProtoExpert_new_ABBR, "Invalid char in abbrev"); return 0; } if (proto_registrar_get_byname(abbr)) { luaL_argerror(L, WSLUA_ARG_ProtoExpert_new_ABBR, "This abbrev already exists"); return 0; } switch (group) { case PI_CHECKSUM: case PI_SEQUENCE: case PI_RESPONSE_CODE: case PI_REQUEST_CODE: case PI_UNDECODED: case PI_REASSEMBLE: case PI_MALFORMED: case PI_DEBUG: case PI_PROTOCOL: case PI_SECURITY: case PI_COMMENTS_GROUP: case PI_DECRYPTION: break; default: luaL_argerror(L, WSLUA_ARG_ProtoExpert_new_GROUP, "Group must be one of expert.group.*"); return 0; } switch (severity) { case PI_COMMENT: case PI_CHAT: case PI_NOTE: case PI_WARN: case PI_ERROR: break; default: luaL_argerror(L, WSLUA_ARG_ProtoExpert_new_SEVERITY, "Severity must be one of expert.severity.*"); return 0; } pe = g_new(wslua_expert_field_t,1); pe->ids.ei = EI_INIT_EI; pe->ids.hf = EI_INIT_HF; pe->abbrev = g_strdup(abbr); pe->text = g_strdup(text); pe->group = group; pe->severity = severity; pushProtoExpert(L,pe); WSLUA_RETURN(1); /* The newly created `ProtoExpert` object. */ } WSLUA_METAMETHOD ProtoExpert__tostring(lua_State* L) { /* Returns a string with debugging information about a `ProtoExpert` object. @since 1.11.3 */ ProtoExpert pe = toProtoExpert(L,1); if (!pe) { lua_pushstring(L,"ProtoExpert pointer is NULL!"); } else { lua_pushfstring(L, "ProtoExpert: ei=%d, hf=%d, abbr=%s, text=%s, group=%d, severity=%d", pe->ids.ei, pe->ids.hf, pe->abbrev, pe->text, pe->group, pe->severity); } return 1; } static int ProtoExpert__gc(lua_State* L) { ProtoExpert pe = toProtoExpert(L,1); if (pe->ids.hf == -2) { /* Only free unregistered and deregistered ProtoExpert */ g_free(pe); } return 0; } WSLUA_METHODS ProtoExpert_methods[] = { WSLUA_CLASS_FNREG(ProtoExpert,new), { NULL, NULL } }; WSLUA_META ProtoExpert_meta[] = { WSLUA_CLASS_MTREG(ProtoExpert,tostring), { NULL, NULL } }; int ProtoExpert_register(lua_State* L) { WSLUA_REGISTER_CLASS(ProtoExpert); return 0; } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
#ifndef GAMESMODEL_H #define GAMESMODEL_H #include <QAbstractTableModel> #include <QSortFilterProxyModel> #include <QList> #include <QSet> #include "gametypemap.h" #include "pb/serverinfo_game.pb.h" class GamesModel : public QAbstractTableModel { Q_OBJECT private: QList<ServerInfo_Game> gameList; QMap<int, QString> rooms; QMap<int, GameTypeMap> gameTypes; static const int NUM_COLS = 8; static const int SECS_PER_MIN = 60; static const int SECS_PER_TEN_MIN = 600; static const int SECS_PER_HOUR = 3600; public: static const int SORT_ROLE = Qt::UserRole+1; GamesModel(const QMap<int, QString> &_rooms, const QMap<int, GameTypeMap> &_gameTypes, QObject *parent = 0); int rowCount(const QModelIndex &parent = QModelIndex()) const { return parent.isValid() ? 0 : gameList.size(); } int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return NUM_COLS; } QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; const QString getGameCreatedString(const int secs) const; const ServerInfo_Game &getGame(int row); /** * Update game list with a (possibly new) game. */ void updateGameList(const ServerInfo_Game &game); int roomColIndex() { return 0; } int startTimeColIndex() { return 1; } const QMap<int, GameTypeMap> &getGameTypes() { return gameTypes; } }; class ServerInfo_User; class GamesProxyModel : public QSortFilterProxyModel { Q_OBJECT private: bool ownUserIsRegistered; bool showBuddiesOnlyGames; bool unavailableGamesVisible; bool showPasswordProtectedGames; QString gameNameFilter, creatorNameFilter; QSet<int> gameTypeFilter; int maxPlayersFilterMin, maxPlayersFilterMax; static const int DEFAULT_MAX_PLAYERS_MAX = 99; public: GamesProxyModel(QObject *parent = 0, bool _ownUserIsRegistered = false); bool getShowBuddiesOnlyGames() const {return showBuddiesOnlyGames; } void setShowBuddiesOnlyGames(bool _showBuddiesOnlyGames); bool getUnavailableGamesVisible() const { return unavailableGamesVisible; } void setUnavailableGamesVisible(bool _unavailableGamesVisible); bool getShowPasswordProtectedGames() const { return showPasswordProtectedGames; } void setShowPasswordProtectedGames(bool _showPasswordProtectedGames); QString getGameNameFilter() const { return gameNameFilter; } void setGameNameFilter(const QString &_gameNameFilter); QString getCreatorNameFilter() const { return creatorNameFilter; } void setCreatorNameFilter(const QString &_creatorNameFilter); QSet<int> getGameTypeFilter() const { return gameTypeFilter; } void setGameTypeFilter(const QSet<int> &_gameTypeFilter); int getMaxPlayersFilterMin() const { return maxPlayersFilterMin; } int getMaxPlayersFilterMax() const { return maxPlayersFilterMax; } void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax); void resetFilterParameters(); void loadFilterParameters(const QMap<int, QString> &allGameTypes); void saveFilterParameters(const QMap<int, QString> &allGameTypes); protected: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; }; #endif
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2015. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation, either version 3 or (at your option) any * * later version. This program is distributed without any warranty. See * * the file COPYING.gpl-v3 for details. * \*************************************************************************/ /* Solution for Exercise 13-4 */ /* mix23_linebuff.c Illustrates the impact of stdio buffering when using stdio library functions and I/O system calls to work on the same file. Observe the difference in output when running this program with output directed to a terminal and again with output directed to a file. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { printf("If I had more time, \n"); write(STDOUT_FILENO, "I would have written you a shorter letter.\n", 43); exit(EXIT_SUCCESS); }
/* Test re_search with dotless i. Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <locale.h> #include <regex.h> #include <string.h> int main (void) { struct re_pattern_buffer r; struct re_registers s; setlocale (LC_ALL, "en_US.UTF-8"); memset (&r, 0, sizeof (r)); memset (&s, 0, sizeof (s)); re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | RE_ICASE); re_compile_pattern ("insert into", 11, &r); re_search (&r, "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK", 15, 0, 15, &s); return 0; }
/* Multiple versions of ceilf. Copyright (C) 2013-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <math.h> #include <math_ldbl_opt.h> #include <shlib-compat.h> #include "init-arch.h" extern __typeof (__ceilf) __ceilf_ppc32 attribute_hidden; extern __typeof (__ceilf) __ceilf_power5plus attribute_hidden; libc_ifunc (__ceilf, (hwcap & PPC_FEATURE_POWER5_PLUS) ? __ceilf_power5plus : __ceilf_ppc32); weak_alias (__ceilf, ceilf)
/* * Copyright (C) 2009 Lorenzo Bettini <http://www.lorenzobettini.it> * See COPYING file that comes with this distribution */ #ifndef FINDFORM_H #define FINDFORM_H #include <QWidget> #include <QTextCursor> #include "findreplace_global.h" #include "findreplaceform.h" /** * The form for the find dialog (it is basically the same * as FindReplaceForm without the replace related widgets). */ class FINDREPLACESHARED_EXPORT FindForm : public FindReplaceForm { Q_OBJECT public: FindForm(QWidget *parent = 0); ~FindForm(); /** * Writes the state of the form to the passed settings. * @param settings * @param prefix the prefix to insert in the settings */ virtual void writeSettings(QSettings &settings, const QString &prefix = "FindDialog"); /** * Reads the state of the form from the passed settings. * @param settings * @param prefix the prefix to look for in the settings */ virtual void readSettings(QSettings &settings, const QString &prefix = "FindDialog"); protected: void changeEvent(QEvent *e); }; #endif // FINDFORM_H
/* coolant_control.c - coolant control methods Part of Grbl Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC Grbl 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. Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>. */ #include "grbl.h" void coolant_init() { COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT); // Configure as output pin #ifdef ENABLE_M7 COOLANT_MIST_DDR |= (1 << COOLANT_MIST_BIT); #endif coolant_stop(); } // Returns current coolant output state. Overrides may alter it from programmed state. uint8_t coolant_get_state() { uint8_t cl_state = COOLANT_STATE_DISABLE; #ifdef INVERT_COOLANT_FLOOD_PIN if (bit_isfalse(COOLANT_FLOOD_PORT,(1 << COOLANT_FLOOD_BIT))) { #else if (bit_istrue(COOLANT_FLOOD_PORT,(1 << COOLANT_FLOOD_BIT))) { #endif cl_state |= COOLANT_STATE_FLOOD; } #ifdef ENABLE_M7 #ifdef INVERT_COOLANT_MIST_PIN if (bit_isfalse(COOLANT_MIST_PORT,(1 << COOLANT_MIST_BIT))) { #else if (bit_istrue(COOLANT_MIST_PORT,(1 << COOLANT_MIST_BIT))) { #endif cl_state |= COOLANT_STATE_MIST; } #endif return(cl_state); } // Directly called by coolant_init(), coolant_set_state(), and mc_reset(), which can be at // an interrupt-level. No report flag set, but only called by routines that don't need it. void coolant_stop() { #ifdef INVERT_COOLANT_FLOOD_PIN COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT); #else COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT); #endif #ifdef ENABLE_M7 #ifdef INVERT_COOLANT_MIST_PIN COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT); #else COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT); #endif #endif } // Main program only. Immediately sets flood coolant running state and also mist coolant, // if enabled. Also sets a flag to report an update to a coolant state. // Called by coolant toggle override, parking restore, parking retract, sleep mode, g-code // parser program end, and g-code parser coolant_sync(). void coolant_set_state(uint8_t mode) { if (sys.abort) { return; } // Block during abort. if (mode & COOLANT_FLOOD_ENABLE) { #ifdef INVERT_COOLANT_FLOOD_PIN COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT); #else COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT); #endif } else { #ifdef INVERT_COOLANT_FLOOD_PIN COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT); #else COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT); #endif } #ifdef ENABLE_M7 if (mode & COOLANT_MIST_ENABLE) { #ifdef INVERT_COOLANT_MIST_PIN COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT); #else COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT); #endif } else { #ifdef INVERT_COOLANT_MIST_PIN COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT); #else COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT); #endif } #endif sys.report_ovr_counter = 0; // Set to report change immediately } // G-code parser entry-point for setting coolant state. Forces a planner buffer sync and bails // if an abort or check-mode is active. void coolant_sync(uint8_t mode) { if (sys.state == STATE_CHECK_MODE) { return; } protocol_buffer_synchronize(); // Ensure coolant turns on when specified in program. coolant_set_state(mode); }
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers /***************************************************************************** * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. * * OpenRCT2 is the work of many authors, a full list can be found in contributors.md * For more information, visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 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. * * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion #pragma once #include <string> #include "common.h" enum class DIRBASE : sint32 { RCT1, // Base directory for original RollerCoaster Tycoon 1 content. RCT2, // Base directory for original RollerCoaster Tycoon 2 content. OPENRCT2, // Base directory for OpenRCT2 installation. USER, // Base directory for OpenRCT2 user content. }; constexpr sint32 DIRBASE_COUNT = 4; using DIRBASE_VALUES = std::string[DIRBASE_COUNT]; enum class DIRID { DATA, // Contains g1.dat, music etc. LANDSCAPE, // Contains scenario editor landscapes (SC6). LANGUAGE, // Contains language packs. LOG_CHAT, // Contains chat logs. LOG_SERVER, // Contains server logs. NETWORK_KEY, // Contains the user's public and private keys. OBJECT, // Contains objects. SAVE, // Contains saved games (SV6). SCENARIO, // Contains scenarios (SC6). SCREENSHOT, // Contains screenshots. SEQUENCE, // Contains title sequences. SHADER, // Contains OpenGL shaders. THEME, // Contains interface themes. TRACK, // Contains track designs. }; enum class PATHID { CONFIG, // Main configuration (config.ini). CONFIG_KEYBOARD, // Keyboard shortcuts. (hotkeys.cfg) CACHE_OBJECTS, // Object repository cache (objects.idx). CACHE_TRACKS, // Track repository cache (tracks.idx). NETWORK_GROUPS, // Server groups with permissions (groups.json). NETWORK_SERVERS, // Saved servers (servers.cfg). NETWORK_USERS, // Users and their groups (users.json). SCORES, // Scenario scores (highscores.dat). SCORES_LEGACY, // Scenario scores, legacy (scores.dat). SCORES_RCT2, // Scenario scores, rct2 (\Saved Games\scores.dat). }; /** * Interface for retrieving paths and other environment related things. */ interface IPlatformEnvironment { virtual ~IPlatformEnvironment() = default; virtual std::string GetDirectoryPath(DIRBASE base, DIRID did) const abstract; virtual std::string GetFilePath(PATHID pathid) const abstract; }; IPlatformEnvironment * CreatePlatformEnvironment(DIRBASE_VALUES basePaths);
/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a zlib-style license that can * be found in the License.txt file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // HTTP utils // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- #ifndef ZenLib_Server_Http_UtilsH #define ZenLib_Server_Http_UtilsH //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include <string> #include <ctime> #include <map> #include <vector> //--------------------------------------------------------------------------- namespace ZenLib { namespace Format { namespace Http { //*************************************************************************** // //*************************************************************************** //--------------------------------------------------------------------------- // Character manipulation unsigned char Char2Hex (unsigned char Char); wchar_t Char2Hex (wchar_t Char); std::string Hex2Char (unsigned char Char); #ifndef WSTRING_MISSING std::wstring Hex2Char (wchar_t Char); #endif //WSTRING_MISSING //--------------------------------------------------------------------------- // URL manipulation std::string URL_Encoded_Encode (const std::string& URL); #ifndef WSTRING_MISSING std::wstring URL_Encoded_Encode (const std::wstring& URL); #endif //WSTRING_MISSING std::string URL_Encoded_Decode (const std::string& URL); #ifndef WSTRING_MISSING std::wstring URL_Encoded_Decode (const std::wstring& URL); #endif //WSTRING_MISSING //--------------------------------------------------------------------------- // Cleanup void TrimLeft (std::string& String, char ToTrim); } //Namespace } //Namespace } //Namespace #endif //ZENLIB_SERVER_HTTP_UTILS
/** ****************************************************************************** * * @file plugindialog.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup CorePlugin Core Plugin * @{ * @brief The Core GCS plugin *****************************************************************************/ /* * 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, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef PLUGINDIALOG_H #define PLUGINDIALOG_H #include <QDialog> QT_BEGIN_NAMESPACE class QPushButton; QT_END_NAMESPACE namespace ExtensionSystem { class PluginSpec; class PluginView; } namespace Core { namespace Internal { class PluginDialog : public QDialog { Q_OBJECT public: explicit PluginDialog(QWidget *parent); private slots: void updateButtons(); void openDetails(); void openDetails(ExtensionSystem::PluginSpec *spec); void openErrorDetails(); private: ExtensionSystem::PluginView *m_view; QPushButton *m_detailsButton; QPushButton *m_errorDetailsButton; QPushButton *m_closeButton; }; } // namespace Internal } // namespace Core #endif // PLUGINDIALOG_H
/* =========================================================================== Copyright (c) 2010-2014 Darkstar Dev Teams This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ This file is part of DarkStar-server source code. =========================================================================== */ #ifndef _CCHOCOBODIGGINGPACKET_H #define _CCHOCOBODIGGINGPACKET_H #include "../../common/cbasetypes.h" #include "basic.h" /************************************************************************ * * * * * * ************************************************************************/ class CCharEntity; class CChocoboDiggingPacket : public CBasicPacket { public: CChocoboDiggingPacket(CCharEntity* PChar); }; #endif
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "common.h" #include "seafile-session.h" #include "fs-mgr.h" #include "seaf-tree-walk.h" #include "utils.h" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> void fill_tree_descriptor(const char *repo_id, int version, struct tree_desc *desc, const char *root_id) { SeafDir *dir; if (!root_id) { desc->tree = NULL; return; } dir = seaf_fs_manager_get_seafdir_sorted (seaf->fs_mgr, repo_id, version, root_id); if (!dir) { g_warning ("Failed to fill tree descriptor with %s.\n", root_id); desc->tree = NULL; } desc->tree = dir; } char *make_traverse_path(char *path, const struct traverse_info *info, const struct name_entry *n) { int len = n->pathlen; int pathlen = info->pathlen; path[pathlen + len] = 0; for (;;) { memcpy(path + pathlen, n->path, len); if (!pathlen) break; path[--pathlen] = '/'; n = &info->name; len = n->pathlen; info = info->prev; pathlen -= len; } return path; } int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info) { struct name_entry *entries = g_new0 (struct name_entry, n); GList **ptrs = g_new0 (GList *, n); int i; SeafDirent *dent; char *first_name; gboolean done; unsigned long mask = 0, dirmask = 0; int error = 0, ret; for (i = 0; i < n; ++i) { if (t[i].tree) ptrs[i] = t[i].tree->entries; else ptrs[i] = NULL; } while (1) { first_name = NULL; mask = dirmask = 0; memset (entries, 0, sizeof(entries[0])*n); done = TRUE; /* Find the "largest" name, assuming dirents are sorted. */ for (i = 0; i < n; ++i) { if (ptrs[i] != NULL) { done = FALSE; dent = ptrs[i]->data; if (!first_name) first_name = dent->name; else if (strcmp(dent->name, first_name) > 0) first_name = dent->name; } } if (done) break; /* * Setup name entries for all names that equals first_name */ for (i = 0; i < n; ++i) { if (ptrs[i] != NULL) { dent = ptrs[i]->data; if (strcmp(first_name, dent->name) == 0) { mask |= 1 << i; /* We treat empty dirs as a file. */ if (S_ISDIR(dent->mode) && memcmp (dent->id, EMPTY_SHA1, 40) != 0) dirmask |= 1 << i; hex_to_rawdata (dent->id, entries[i].sha1, 20); entries[i].path = dent->name; entries[i].pathlen = dent->name_len; entries[i].mode = dent->mode; entries[i].mtime = dent->mtime; if (S_ISREG(dent->mode)) { entries[i].modifier = dent->modifier; } ptrs[i] = ptrs[i]->next; } } } ret = info->fn (n, mask, dirmask, entries, info); if (ret < 0) { error = ret; } } g_free (entries); g_free (ptrs); return error; }
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * empathy-ft-handler.h - Header for EmpathyFTHandler * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Author: Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> */ /* empathy-ft-handler.h */ #ifndef INCLUDED_TUBES_FILE_TRANSFER_HELPER_H #define INCLUDED_TUBES_FILE_TRANSFER_HELPER_H #include <config_lgpl.h> #include <glib-object.h> #include <gio/gio.h> #include <telepathy-glib/contact.h> #include <telepathy-glib/file-transfer-channel.h> G_BEGIN_DECLS #define EMPATHY_TYPE_FT_HANDLER empathy_ft_handler_get_type() #define EMPATHY_FT_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandler)) #define EMPATHY_FT_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass)) #define EMPATHY_IS_FT_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_FT_HANDLER)) #define EMPATHY_IS_FT_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), EMPATHY_TYPE_FT_HANDLER)) #define EMPATHY_FT_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EMPATHY_TYPE_FT_HANDLER, EmpathyFTHandlerClass)) typedef struct _EmpathyFTHandlerPriv EmpathyFTHandlerPriv; typedef struct { GObject parent; EmpathyFTHandlerPriv *priv; } EmpathyFTHandler; typedef struct { GObjectClass parent_class; } EmpathyFTHandlerClass; #define EMPATHY_FT_ERROR_QUARK g_quark_from_static_string ("EmpathyFTError") typedef enum { EMPATHY_FT_ERROR_FAILED, EMPATHY_FT_ERROR_HASH_MISMATCH, EMPATHY_FT_ERROR_TP_ERROR, EMPATHY_FT_ERROR_SOCKET, EMPATHY_FT_ERROR_NOT_SUPPORTED, EMPATHY_FT_ERROR_INVALID_SOURCE_FILE, EMPATHY_FT_ERROR_EMPTY_SOURCE_FILE } EmpathyFTErrorEnum; /** * EmpathyFTHandlerReadyCallback: * @handler: the handler which is now ready * @error: a #GError if the operation failed, or %NULL * @user_data: user data passed to the callback */ typedef void (* EmpathyFTHandlerReadyCallback) (EmpathyFTHandler *handler, GError *error, gpointer user_data); GType empathy_ft_handler_get_type (void); /* public methods */ void empathy_ft_handler_new_outgoing ( TpAccount *account, TpContact *contact, GFile *source, gint64 action_time, EmpathyFTHandlerReadyCallback callback, gpointer user_data); void empathy_ft_handler_set_service_name ( EmpathyFTHandler *self, const gchar *service_name); void empathy_ft_handler_set_description ( EmpathyFTHandler *self, const gchar *description); void empathy_ft_handler_new_incoming (TpFileTransferChannel *channel, EmpathyFTHandlerReadyCallback callback, gpointer user_data); void empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler, GFile *destination); void empathy_ft_handler_start_transfer (EmpathyFTHandler *handler); void empathy_ft_handler_cancel_transfer (EmpathyFTHandler *handler); /* properties of the transfer */ const char * empathy_ft_handler_get_filename (EmpathyFTHandler *handler); const char * empathy_ft_handler_get_content_type (EmpathyFTHandler *handler); TpContact * empathy_ft_handler_get_contact (EmpathyFTHandler *handler); GFile * empathy_ft_handler_get_gfile (EmpathyFTHandler *handler); const char *empathy_ft_handler_get_description(EmpathyFTHandler*); gboolean empathy_ft_handler_get_use_hash (EmpathyFTHandler *handler); gboolean empathy_ft_handler_is_incoming (EmpathyFTHandler *handler); guint64 empathy_ft_handler_get_transferred_bytes (EmpathyFTHandler *handler); guint64 empathy_ft_handler_get_total_bytes (EmpathyFTHandler *handler); gboolean empathy_ft_handler_is_completed (EmpathyFTHandler *handler); gboolean empathy_ft_handler_is_cancelled (EmpathyFTHandler *handler); G_END_DECLS #endif // INCLUDED_TUBES_FILE_TRANSFER_HELPER_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* Copyright (C) 1996-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. 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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ #include <netdb.h> #define LOOKUP_TYPE struct servent #define FUNCTION_NAME getservbyname #define DATABASE_NAME services #define ADD_PARAMS const char *name, const char *proto #define ADD_VARIABLES name, proto /* We are nscd, so we don't want to be talking to ourselves. */ #undef USE_NSCD #include "../nss/getXXbyYY_r.c"
/** ****************************************************************************** * * @file systemhealthgadgetconfiguration.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup SystemHealthPlugin System Health Plugin * @{ * @brief The System Health gadget plugin *****************************************************************************/ /* * 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, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SYSTEMHEALTHGADGETCONFIGURATION_H #define SYSTEMHEALTHGADGETCONFIGURATION_H #include <coreplugin/iuavgadgetconfiguration.h> using namespace Core; /* This is a generic system health gadget displaying system alarms for one or more components. */ class SystemHealthGadgetConfiguration : public IUAVGadgetConfiguration { Q_OBJECT public: explicit SystemHealthGadgetConfiguration(QString classId, QSettings* qSettings = 0, QObject *parent = 0); //set system health configuration functions void setSystemFile(QString filename){systemFile=filename;} //get dial configuration functions QString getSystemFile() {return systemFile;} void saveConfig(QSettings* settings) const; IUAVGadgetConfiguration *clone(); private: // systemFile contains the source SVG: QString systemFile; }; #endif // SYSTEMHEALTHGADGETCONFIGURATION_H
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-UE-Variables" * found in "36331-c10.asn" * `asn1c -S /usr/local/share/asn1c -fcompound-names -fskeletons-copy -gen-PER` */ #include "VarLogMeasReport-r11.h" static int memb_traceRecordingSessionRef_r10_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size == 2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static int memb_tce_Id_r10_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size == 1)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static asn_per_constraints_t asn_PER_memb_traceRecordingSessionRef_r10_constr_3 GCC_NOTUSED = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 0, 0, 2, 2 } /* (SIZE(2..2)) */, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_tce_Id_r10_constr_4 GCC_NOTUSED = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 0, 0, 1, 1 } /* (SIZE(1..1)) */, 0, 0 /* No PER value map */ }; static asn_TYPE_member_t asn_MBR_VarLogMeasReport_r11_1[] = { { ATF_NOFLAGS, 0, offsetof(struct VarLogMeasReport_r11, traceReference_r10), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_TraceReference_r10, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "traceReference-r10" }, { ATF_NOFLAGS, 0, offsetof(struct VarLogMeasReport_r11, traceRecordingSessionRef_r10), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_traceRecordingSessionRef_r10_constraint_1, &asn_PER_memb_traceRecordingSessionRef_r10_constr_3, 0, "traceRecordingSessionRef-r10" }, { ATF_NOFLAGS, 0, offsetof(struct VarLogMeasReport_r11, tce_Id_r10), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_tce_Id_r10_constraint_1, &asn_PER_memb_tce_Id_r10_constr_4, 0, "tce-Id-r10" }, { ATF_NOFLAGS, 0, offsetof(struct VarLogMeasReport_r11, plmn_IdentityList_r11), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PLMN_IdentityList3_r11, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "plmn-IdentityList-r11" }, { ATF_NOFLAGS, 0, offsetof(struct VarLogMeasReport_r11, absoluteTimeInfo_r10), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AbsoluteTimeInfo_r10, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "absoluteTimeInfo-r10" }, { ATF_NOFLAGS, 0, offsetof(struct VarLogMeasReport_r11, logMeasInfoList_r10), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_LogMeasInfoList2_r10, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "logMeasInfoList-r10" }, }; static ber_tlv_tag_t asn_DEF_VarLogMeasReport_r11_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VarLogMeasReport_r11_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* traceReference-r10 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* traceRecordingSessionRef-r10 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* tce-Id-r10 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* plmn-IdentityList-r11 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* absoluteTimeInfo-r10 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* logMeasInfoList-r10 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VarLogMeasReport_r11_specs_1 = { sizeof(struct VarLogMeasReport_r11), offsetof(struct VarLogMeasReport_r11, _asn_ctx), asn_MAP_VarLogMeasReport_r11_tag2el_1, 6, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_VarLogMeasReport_r11 = { "VarLogMeasReport-r11", "VarLogMeasReport-r11", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_VarLogMeasReport_r11_tags_1, sizeof(asn_DEF_VarLogMeasReport_r11_tags_1) /sizeof(asn_DEF_VarLogMeasReport_r11_tags_1[0]), /* 1 */ asn_DEF_VarLogMeasReport_r11_tags_1, /* Same as above */ sizeof(asn_DEF_VarLogMeasReport_r11_tags_1) /sizeof(asn_DEF_VarLogMeasReport_r11_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_VarLogMeasReport_r11_1, 6, /* Elements count */ &asn_SPC_VarLogMeasReport_r11_specs_1 /* Additional specs */ };
/* * Broadcom Proprietary and Confidential. Copyright 2016 Broadcom * All Rights Reserved. * * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation; * the contents of this file may not be disclosed to third parties, copied * or duplicated in any form, in whole or in part, without the prior * written permission of Broadcom Corporation. */ #pragma once #include <stdint.h> #include "wiced_result.h" #ifdef __cplusplus extern "C" { #endif /****************************************************** * Macros ******************************************************/ /****************************************************** * Constants ******************************************************/ /****************************************************** * Enumerations ******************************************************/ /****************************************************** * Type Definitions ******************************************************/ /****************************************************** * Structures ******************************************************/ typedef /*@abstract@*/ /*@immutable@*/ struct { uint8_t* buffer; uint32_t size; volatile uint32_t head; /* Read from */ volatile uint32_t tail; /* Write to */ } wiced_ring_buffer_t; /****************************************************** * Global Variables ******************************************************/ /****************************************************** * Function Declarations ******************************************************/ /* Ring Buffer API */ wiced_result_t ring_buffer_init ( /*@out@*/ wiced_ring_buffer_t* ring_buffer, /*@keep@*/ uint8_t* buffer, uint32_t buffer_size ); wiced_result_t ring_buffer_deinit ( wiced_ring_buffer_t* ring_buffer ); uint32_t ring_buffer_write ( wiced_ring_buffer_t* ring_buffer, const uint8_t* data, uint32_t data_length ); uint32_t ring_buffer_used_space ( wiced_ring_buffer_t* ring_buffer ); uint32_t ring_buffer_free_space ( wiced_ring_buffer_t* ring_buffer ); wiced_result_t ring_buffer_get_data ( wiced_ring_buffer_t* ring_buffer, uint8_t** data, uint32_t* contiguous_bytes ); wiced_result_t ring_buffer_consume ( wiced_ring_buffer_t* ring_buffer, uint32_t bytes_consumed ); wiced_result_t ring_buffer_read ( wiced_ring_buffer_t* ring_buffer, uint8_t* data, uint32_t data_length, uint32_t* number_of_bytes_read ); #ifdef __cplusplus } /* extern "C" */ #endif
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef SSHERRORS_P_H #define SSHERRORS_P_H namespace QSsh { enum SshError { SshNoError, SshSocketError, SshTimeoutError, SshProtocolError, SshHostKeyError, SshKeyFileError, SshAuthenticationError, SshClosedByServerError, SshInternalError }; } // namespace QSsh #endif // SSHERRORS_P_H
///////////////////////////////////////////////////////////////////////// // $Id: amigagui.h 11073 2012-03-03 12:41:24Z vruppert $ ///////////////////////////////////////////////////////////////////////// #include <exec/types.h> #include <exec/exec.h> #include <proto/exec.h> #include <proto/dos.h> #include <proto/intuition.h> #include <proto/asl.h> #include <proto/graphics.h> #include <proto/cybergraphics.h> #include <proto/diskfont.h> #include <proto/gadtools.h> #include <proto/iffparse.h> #include <diskfont/diskfont.h> #include <intuition/intuitionbase.h> #include <intuition/pointerclass.h> #include <devices/input.h> #include <devices/inputevent.h> #include <graphics/gfxbase.h> #include <graphics/videocontrol.h> #include <cybergraphx/cybergraphics.h> #include <libraries/gadtools.h> #define FULL(x) (x*0x01010101) #define ID_FTXT MAKE_ID('F','T','X','T') #define ID_CHRS MAKE_ID('C','H','R','S') void check_toolbar(void); struct IntuitionBase *IntuitionBase; struct GfxBase *GfxBase; struct Library *KeymapBase; struct Library *GadToolsBase; struct Library *CyberGfxBase; struct Library *AslBase; struct Library *DiskfontBase; struct Library *IFFParseBase; struct Screen *screen = NULL, *pub_screen = NULL; struct Window *window = NULL; struct TextFont *vgafont; struct IOStdReq *inputReqBlk = NULL; struct MsgPort *inputPort = NULL; struct Interrupt *inputHandler = NULL; int input_error = -1; LONG pmap[256]; ULONG cmap[256]; static UWORD *emptypointer; char verstr[256]; struct TextAttr vgata = { "vga.font", 16, NULL }; struct Image bx_header_image[BX_MAX_PIXMAPS]; struct Gadget *bx_header_gadget[BX_MAX_PIXMAPS], *bx_glistptr = NULL, *bx_gadget_handle; static unsigned bx_image_entries = 0, bx_headerbar_entries = 0; static unsigned bx_bordertop, bx_borderleft, bx_borderright, bx_borderbottom, bx_headerbar_y, mouse_button_state = 0, bx_headernext_left, bx_headernext_right, bx_mouseX, bx_mouseY; static LONG apen = -1, black = -1, white = -1; BOOL bx_xchanged = FALSE; void *vi; extern "C" { void dprintf(char *, ...) __attribute__ ((format (printf, 1, 2)));} int w = 648, h = 480, d = 8; char HandlerName[]="Bochs InputHandler"; const unsigned char raw_to_bochs [130] = { BX_KEY_GRAVE, BX_KEY_1, /*1*/ BX_KEY_2, BX_KEY_3, BX_KEY_4, BX_KEY_5, BX_KEY_6, BX_KEY_7, BX_KEY_8, BX_KEY_9, BX_KEY_0, /*10*/ BX_KEY_MINUS, BX_KEY_EQUALS, BX_KEY_BACKSLASH, 0, BX_KEY_KP_INSERT, BX_KEY_Q, BX_KEY_W, BX_KEY_E, BX_KEY_R, BX_KEY_T, /*20*/ BX_KEY_Y, BX_KEY_U, BX_KEY_I, BX_KEY_O, BX_KEY_P, BX_KEY_LEFT_BRACKET, BX_KEY_RIGHT_BRACKET, 0, BX_KEY_KP_END, BX_KEY_KP_DOWN, /*30*/ BX_KEY_KP_PAGE_DOWN, BX_KEY_A, BX_KEY_S, BX_KEY_D, BX_KEY_F, BX_KEY_G, BX_KEY_H, BX_KEY_J, BX_KEY_K, BX_KEY_L, /*40*/ BX_KEY_SEMICOLON, BX_KEY_SINGLE_QUOTE, 0, 0, BX_KEY_KP_LEFT, BX_KEY_KP_5, BX_KEY_KP_RIGHT, 0, BX_KEY_Z, BX_KEY_X, /*50*/ BX_KEY_C, BX_KEY_V, BX_KEY_B, BX_KEY_N, BX_KEY_M, BX_KEY_COMMA, BX_KEY_PERIOD, BX_KEY_SLASH, 0, BX_KEY_KP_DELETE, /*60*/ BX_KEY_KP_HOME, BX_KEY_KP_UP, BX_KEY_KP_PAGE_UP, BX_KEY_SPACE, BX_KEY_BACKSPACE, BX_KEY_TAB, BX_KEY_KP_ENTER, BX_KEY_ENTER, BX_KEY_ESC, BX_KEY_DELETE, /*70*/ BX_KEY_INSERT, BX_KEY_PAGE_UP, BX_KEY_PAGE_DOWN, BX_KEY_KP_SUBTRACT, BX_KEY_F11, BX_KEY_UP, BX_KEY_DOWN, BX_KEY_RIGHT, BX_KEY_LEFT, BX_KEY_F1, /*80*/ BX_KEY_F2, BX_KEY_F3, BX_KEY_F4, BX_KEY_F5, BX_KEY_F6, BX_KEY_F7, BX_KEY_F8, BX_KEY_F9, BX_KEY_F10, 0, /*90*/ 0, BX_KEY_KP_DIVIDE, BX_KEY_KP_MULTIPLY, BX_KEY_KP_ADD, BX_KEY_MENU, BX_KEY_SHIFT_L, BX_KEY_SHIFT_R, BX_KEY_CAPS_LOCK, BX_KEY_CTRL_L, BX_KEY_ALT_L, /*100*/ BX_KEY_ALT_R, BX_KEY_WIN_L, BX_KEY_WIN_R, 0, 0, 0, BX_KEY_SCRL_LOCK, BX_KEY_PRINT, BX_KEY_NUM_LOCK, BX_KEY_PAUSE, /*110*/ BX_KEY_F12, BX_KEY_HOME, BX_KEY_END, BX_KEY_INT_STOP, BX_KEY_INT_FAV, BX_KEY_INT_BACK, BX_KEY_INT_FORWARD, BX_KEY_INT_HOME, BX_KEY_INT_SEARCH };
/* * This file is part of wysiwidi * * Copyright (C) 2014 Intel Corporation. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #ifndef OPTIONS_H_ #define OPTIONS_H_ #include "message.h" namespace wfd { class Options: public Request { public: explicit Options(const std::string& request_uri); ~Options() override; std::string ToString() const override; }; } // namespace wfd #endif // OPTIONS_H_
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2014. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU Affero General Public License as published * * by the Free Software Foundation, either version 3 or (at your option) * * any later version. This program is distributed without any warranty. * * See the file COPYING.agpl-v3 for details. * \*************************************************************************/ /* Listing 54-3 */ /* pshm_read.c Usage: pshm_read shm-name Copy the contents of the POSIX shared memory object named in 'name' to stdout. See also pshm_write.c. */ #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> #include "tlpi_hdr.h" int main(int argc, char *argv[]) { int fd; char *addr; struct stat sb; if (argc != 2 || strcmp(argv[1], "--help") == 0) usageErr("%s shm-name\n", argv[0]); fd = shm_open(argv[1], O_RDONLY, 0); /* Open existing object */ if (fd == -1) errExit("shm_open"); /* Use shared memory object size as length argument for mmap() and as number of bytes to write() */ if (fstat(fd, &sb) == -1) errExit("fstat"); addr = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (addr == MAP_FAILED) errExit("mmap"); if (close(fd) == -1) /* 'fd' is no longer needed */ errExit("close"); write(STDOUT_FILENO, addr, sb.st_size); printf("\n"); exit(EXIT_SUCCESS); }
/*++ Copyright © Microsoft Corporation. All rights reserved. Module Name: WBEMIDL.H Abstract: Include file for all WBEM related interface definitions. To be included in projects that use any WBEM interfaces. History: --*/ #ifndef __WBEMIDL_H_ #define __WBEMIDL_H_ #include <wbemcli.h> #include <wbemprov.h> #include <wbemtran.h> #include <wbemdisp.h> #endif
/* ANTLR attribute definition -- long integers * * SOFTWARE RIGHTS * * We reserve no LEGAL rights to the Purdue Compiler Construction Tool * Set (PCCTS) -- PCCTS is in the public domain. An individual or * company may do whatever they wish with source code distributed with * PCCTS or the code generated by PCCTS, including the incorporation of * PCCTS, or its output, into commerical software. * * We encourage users to develop software with PCCTS. However, we do ask * that credit is given to us for developing PCCTS. By "credit", * we mean that if you incorporate our source code into one of your * programs (commercial product, research project, or otherwise) that you * acknowledge this fact somewhere in the documentation, research report, * etc... If you like PCCTS and have developed a nice tool with the * output, please mention that you developed it using PCCTS. In * addition, we ask that this header remain intact in our source code. * As long as these guidelines are kept, we expect to continue enhancing * this system and expect to make other tools available as they are * completed. * * ANTLR 1.33 * Terence Parr * Parr Research Corporation * with Purdue University and AHPCRC, University of Minnesota * 1989-1998 */ #ifndef ZZINT_H #define ZZINT_H typedef long Attrib; #define zzcr_attr(a,tok,t) *(a) = atol(t); #endif
/* ``The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved via the world wide web at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Initial Developer of the Original Code is Ericsson Utvecklings AB. * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings * AB. All Rights Reserved.'' * * $Id$ */ #ifndef TESTCASE_DRIVER_H__ #define TESTCASE_DRIVER_H__ #include "erl_driver.h" #include <stdlib.h> typedef struct { char *testcase_name; char *command; int command_len; void *extra; } TestCaseState_t; #define ASSERT_CLNUP(TCS, B, CLN) \ do { \ if (!(B)) { \ CLN; \ testcase_assertion_failed((TCS), __FILE__, __LINE__, #B); \ } \ } while (0) #define ASSERT(TCS, B) ASSERT_CLNUP(TCS, B, (void) 0) void testcase_printf(TestCaseState_t *tcs, char *frmt, ...); void testcase_succeeded(TestCaseState_t *tcs, char *frmt, ...); void testcase_skipped(TestCaseState_t *tcs, char *frmt, ...); void testcase_failed(TestCaseState_t *tcs, char *frmt, ...); int testcase_assertion_failed(TestCaseState_t *tcs, char *file, int line, char *assertion); void *testcase_alloc(size_t size); void *testcase_realloc(void *ptr, size_t size); void testcase_free(void *ptr); char *testcase_name(void); void testcase_run(TestCaseState_t *tcs); void testcase_cleanup(TestCaseState_t *tcs); #endif
/* mbed Microcontroller Library * Copyright (c) 2015 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "mbed_assert.h" #include "spi_api.h" #include <math.h> #include "cmsis.h" #include "pinmap.h" #include "clk_freqs.h" #include "PeripheralPins.h" void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel) { // determine the SPI to use SPIName spi_mosi = (SPIName)pinmap_peripheral(mosi, PinMap_SPI_MOSI); SPIName spi_miso = (SPIName)pinmap_peripheral(miso, PinMap_SPI_MISO); SPIName spi_sclk = (SPIName)pinmap_peripheral(sclk, PinMap_SPI_SCLK); SPIName spi_ssel = (SPIName)pinmap_peripheral(ssel, PinMap_SPI_SSEL); SPIName spi_data = (SPIName)pinmap_merge(spi_mosi, spi_miso); SPIName spi_cntl = (SPIName)pinmap_merge(spi_sclk, spi_ssel); obj->spi = (SPI_Type*)pinmap_merge(spi_data, spi_cntl); MBED_ASSERT((int)obj->spi != NC); SIM->SCGC5 |= SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK; SIM->SCGC6 |= SIM_SCGC6_SPI0_MASK; obj->spi->MCR &= ~(SPI_MCR_MDIS_MASK | SPI_MCR_HALT_MASK); //obj->spi->MCR |= SPI_MCR_DIS_RXF_MASK | SPI_MCR_DIS_TXF_MASK; // not halt in the debug mode obj->spi->SR |= SPI_SR_EOQF_MASK; // pin out the spi pins pinmap_pinout(mosi, PinMap_SPI_MOSI); pinmap_pinout(miso, PinMap_SPI_MISO); pinmap_pinout(sclk, PinMap_SPI_SCLK); if (ssel != NC) { pinmap_pinout(ssel, PinMap_SPI_SSEL); } } void spi_free(spi_t *obj) { // [TODO] } void spi_format(spi_t *obj, int bits, int mode, int slave) { MBED_ASSERT((bits > 4) || (bits < 16)); MBED_ASSERT((mode >= 0) && (mode <= 3)); uint8_t polarity = (mode & 0x2) ? 1 : 0; uint8_t phase = (mode & 0x1) ? 1 : 0; uint8_t old_polarity = (obj->spi->CTAR[0] & SPI_CTAR_CPOL_MASK) != 0; // set master/slave if (slave) { obj->spi->MCR &= ~SPI_MCR_MSTR_MASK; } else { obj->spi->MCR |= (1UL << SPI_MCR_MSTR_SHIFT); } // CTAR0 is used obj->spi->CTAR[0] &= ~(SPI_CTAR_CPHA_MASK | SPI_CTAR_CPOL_MASK | SPI_CTAR_FMSZ_MASK); obj->spi->CTAR[0] |= (polarity << SPI_CTAR_CPOL_SHIFT) | (phase << SPI_CTAR_CPHA_SHIFT) | ((bits - 1) << SPI_CTAR_FMSZ_SHIFT); //If clk idle state was changed, start a dummy transmission //This is a 'feature' in DSPI: https://community.freescale.com/thread/105526 if ((old_polarity != polarity) && (slave == 0)) { //Start transfer (CS should be high, so shouldn't matter) spi_master_write(obj, 0xFFFF); } } static const uint8_t baudrate_prescaler[] = {2,3,5,7}; static const uint16_t baudrate_scaler[] = {2,4,6,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768}; void spi_frequency(spi_t *obj, int hz) { uint32_t f_error = 0; uint32_t p_error = 0xffffffff; uint32_t ref = 0; uint32_t br = 0; uint32_t ref_spr = 0; uint32_t ref_prescaler = 0; uint32_t ref_dr = 0; // bus clk uint32_t PCLK = bus_frequency(); for (uint32_t i = 0; i < 4; i++) { for (br = 0; br <= 15; br++) { for (uint32_t dr = 0; dr < 2; dr++) { ref = (PCLK * (1U + dr) / baudrate_prescaler[i]) / baudrate_scaler[br]; if (ref > (uint32_t)hz) continue; f_error = hz - ref; if (f_error < p_error) { ref_spr = br; ref_prescaler = i; ref_dr = dr; p_error = f_error; } } } } // set PBR and BR obj->spi->CTAR[0] &= ~(SPI_CTAR_PBR_MASK | SPI_CTAR_BR_MASK | SPI_CTAR_DBR_MASK); obj->spi->CTAR[0] |= (ref_prescaler << SPI_CTAR_PBR_SHIFT) | (ref_spr << SPI_CTAR_BR_SHIFT) | (ref_dr << SPI_CTAR_DBR_SHIFT); } static inline int spi_writeable(spi_t *obj) { return (obj->spi->SR & SPI_SR_TFFF_MASK) ? 1 : 0; } static inline int spi_readable(spi_t *obj) { return (obj->spi->SR & SPI_SR_RFDF_MASK) ? 1 : 0; } int spi_master_write(spi_t *obj, int value) { //clear RX buffer flag obj->spi->SR |= SPI_SR_RFDF_MASK; // wait tx buffer empty while(!spi_writeable(obj)); obj->spi->PUSHR = SPI_PUSHR_TXDATA(value & 0xffff) /*| SPI_PUSHR_EOQ_MASK*/; // wait rx buffer full while (!spi_readable(obj)); return obj->spi->POPR; } int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length) { int total = (tx_length > rx_length) ? tx_length : rx_length; for (int i = 0; i < total; i++) { char out = (i < tx_length) ? tx_buffer[i] : 0xff; char in = spi_master_write(obj, out); if (i < rx_length) { rx_buffer[i] = in; } } return total; } int spi_slave_receive(spi_t *obj) { return spi_readable(obj); } int spi_slave_read(spi_t *obj) { obj->spi->SR |= SPI_SR_RFDF_MASK; return obj->spi->POPR; } void spi_slave_write(spi_t *obj, int value) { while (!spi_writeable(obj)); }
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LE_FX_ENGINE_DSP_CORE_BASIC_INL_H_ #define LE_FX_ENGINE_DSP_CORE_BASIC_INL_H_ #include <math.h> namespace le_fx { namespace sigmod { template <typename T> int SearchIndex(const T x_data[], T x, int start_index, int end_index) { int start = start_index; int end = end_index; while (end > start + 1) { int i = (end + start) / 2; if (x_data[i] > x) { end = i; } else { start = i; } } return start; } } // namespace sigmod } // namespace le_fx #endif // LE_FX_ENGINE_DSP_CORE_BASIC_INL_H_
/* SmartSync.h SmartSync Created by Kevin Hawkins on Thu Mar 19 15:37:11 PDT 2015. Copyright (c) 2015, salesforce.com, inc. All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of salesforce.com, inc. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import <SmartSync/SFMruSyncDownTarget.h> #import <SmartSync/SFObject.h> #import <SmartSync/SFObjectType.h> #import <SmartSync/SFObjectTypeLayout.h> #import <SmartSync/SFSmartSyncCacheManager.h> #import <SmartSync/SFSmartSyncConstants.h> #import <SmartSync/SFSmartSyncMetadataManager.h> #import <SmartSync/SFSmartSyncNetworkUtils.h> #import <SmartSync/SFSmartSyncObjectUtils.h> #import <SmartSync/SFSmartSyncPersistableObject.h> #import <SmartSync/SFSmartSyncSoqlBuilder.h> #import <SmartSync/SFSmartSyncSoslBuilder.h> #import <SmartSync/SFSmartSyncSoslReturningBuilder.h> #import <SmartSync/SFSmartSyncSyncManager.h> #import <SmartSync/SFSoqlSyncDownTarget.h> #import <SmartSync/SFSoslSyncDownTarget.h> #import <SmartSync/SFSyncDownTarget.h> #import <SmartSync/SFSyncOptions.h> #import <SmartSync/SFSyncState.h> #import <SmartSync/SFSyncTarget.h> #import <SmartSync/SFSyncUpTarget.h>
#ifndef _PARROTOS_INTRIN_H_ #define _PARROTOS_INTRIN_H_ #include <VP_Os/elinux/intrin.h> #endif // ! _PARROTOS_INTRIN_H_
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "nffs_test_utils.h" TEST_CASE(nffs_test_large_unlink) { /* It should not be necessary to initialize this array, but the libgcc * version of strcmp triggers a "Conditional jump or move depends on * uninitialised value(s)" valgrind warning. */ char filename[256] = { 0 }; int rc; int i; int j; int k; static char file_contents[1024 * 4]; /*** Setup. */ nffs_config.nc_num_inodes = 1024; nffs_config.nc_num_blocks = 1024; rc = nffs_init(); TEST_ASSERT(rc == 0); rc = nffs_format(nffs_current_area_descs); TEST_ASSERT(rc == 0); for (i = 0; i < 5; i++) { snprintf(filename, sizeof filename, "/dir0_%d", i); rc = fs_mkdir(filename); TEST_ASSERT(rc == 0); for (j = 0; j < 5; j++) { snprintf(filename, sizeof filename, "/dir0_%d/dir1_%d", i, j); rc = fs_mkdir(filename); TEST_ASSERT(rc == 0); for (k = 0; k < 5; k++) { snprintf(filename, sizeof filename, "/dir0_%d/dir1_%d/file2_%d", i, j, k); nffs_test_util_create_file(filename, file_contents, sizeof file_contents); } } for (j = 0; j < 15; j++) { snprintf(filename, sizeof filename, "/dir0_%d/file1_%d", i, j); nffs_test_util_create_file(filename, file_contents, sizeof file_contents); } } for (i = 0; i < 5; i++) { snprintf(filename, sizeof filename, "/dir0_%d", i); rc = fs_unlink(filename); TEST_ASSERT(rc == 0); } /* The entire file system should be empty. */ struct nffs_test_file_desc *expected_system = (struct nffs_test_file_desc[]) { { .filename = "", .is_dir = 1, } }; nffs_test_assert_system(expected_system, nffs_current_area_descs); }
/* * Copyright 2017 Google Inc. * Copyright 2020 The Open GEE Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Helper functions for doing calculations on quadtree addresses. #ifndef GEO_EARTH_ENTERPRISE_SRC_FUSION_PORTABLEGLOBE_QUADTREE_QTUTILS_H_ #define GEO_EARTH_ENTERPRISE_SRC_FUSION_PORTABLEGLOBE_QUADTREE_QTUTILS_H_ #include <string> #include <vector> #include "common/khTypes.h" #include <cstdint> namespace fusion_portableglobe { const double PI = 3.14159265358979; const std::uint32_t MAX_LEVEL = 24; const double MAX_MERCATOR_LATITUDE = 85.051128779806589; /** * Fills in all of the mercator addresses that correspond to nodes that touch * the lat/lng bounding box of the node specifed by the given * plate carree address. */ void ConvertFlatToMercatorQtAddresses( std::string flat_qtaddress, std::vector<std::string>* mercator_qtaddresses); /** * Returns the y position on a grid at given depth corresponding * to the given latitude. */ std::uint32_t LatToYPos(double lat, std::uint32_t z, bool is_mercator); /** * Returns the normalized, linear y associated with the given latitude. * Y is in the range of (-pi, pi) for latitudes in the * range of (-MAX_MERCATOR_LATITUDE, MAX_MERCATOR_LATITUDE). */ double MercatorLatToY(double lat); /** * Returns the latitude associated with the given normalized, linear y. * Y is in the range of (-pi, pi) for latitudes in the * range of (-MAX_MERCATOR_LATITUDE, MAX_MERCATOR_LATITUDE). */ double MercatorYToLat(double y); /** * Returns the position on a Mercator grid at given depth (z) corresponding * to the normalized, linear y value. * Y is in the range (-pi, pi) and return value is in * the range [0, 2^z-1]. */ std::uint32_t YToYPos(double y, std::uint32_t z); /** * Returns the latitude that will appear half way between the two given * latitudes on a Mercator map. */ double BisectLatitudes(double south, double north, bool is_mercator); /** * Helper for converting from map space to qtnode address. * @param x Requested column for map tile. * @param y Requested row for map tile. * @param z Requested zoom level for map. */ std::string ConvertToQtNode(std::uint32_t x, std::uint32_t y, std::uint32_t z); /** * Helper for converting to map space from a qtnode address. * @param qtnode Quadtree address to be converted to map coordinates. * @param x Column for map tile. * @param y Row for map tile. * @param z Zoom level for map. */ void ConvertFromQtNode(const std::string& qtnode, std::uint32_t* x, std::uint32_t* y, std::uint32_t* z); } // namespace fusion_portableglobe #endif // GEO_EARTH_ENTERPRISE_SRC_FUSION_PORTABLEGLOBE_QUADTREE_QTUTILS_H_
/*++ Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: DxeIpl.c Abstract: DXE Initial Program Load PPI GUID as defined in Tiano --*/ #include "Tiano.h" #include "PeiBind.h" #include "PeiApi.h" #include EFI_PPI_DEFINITION (DxeIpl) EFI_GUID gEfiDxeIplPpiGuid = EFI_DXE_IPL_PPI_GUID; EFI_GUID_STRING(&gEfiDxeIplPpiGuid, "DxeIpl", "DXE IPL PPI");
/* Copyright (c) 2012-2016 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ #pragma once #include "support/Any.h" namespace antlr4 { namespace tree { /// An interface to access the tree of <seealso cref="RuleContext"/> objects created /// during a parse that makes the data structure look like a simple parse tree. /// This node represents both internal nodes, rule invocations, /// and leaf nodes, token matches. /// /// The payload is either a <seealso cref="Token"/> or a <seealso cref="RuleContext"/> object. // ml: This class unites 4 Java classes: RuleNode, ParseTree, SyntaxTree and Tree. class ANTLR4CPP_PUBLIC ParseTree { public: ParseTree(); virtual ~ParseTree() {} /// The parent of this node. If the return value is null, then this /// node is the root of the tree. ParseTree *parent; /// If we are debugging or building a parse tree for a visitor, /// we need to track all of the tokens and rule invocations associated /// with this rule's context. This is empty for parsing w/o tree constr. /// operation because we don't the need to track the details about /// how we parse this rule. // ml: memory is not managed here, but by the owning class. This is just for the structure. std::vector<ParseTree *> children; /// Print out a whole tree, not just a node, in LISP format /// {@code (root child1 .. childN)}. Print just a node if this is a leaf. virtual std::string toStringTree() = 0; virtual std::string toString() = 0; /// Specialize toStringTree so that it can print out more information /// based upon the parser. virtual std::string toStringTree(Parser *parser) = 0; virtual bool operator == (const ParseTree &other) const; /// The <seealso cref="ParseTreeVisitor"/> needs a double dispatch method. // ml: This has been changed to use Any instead of a template parameter, to avoid the need of a virtual template function. virtual antlrcpp::Any accept(ParseTreeVisitor *visitor) = 0; /// Return the combined text of all leaf nodes. Does not get any /// off-channel tokens (if any) so won't return whitespace and /// comments if they are sent to parser on hidden channel. virtual std::string getText() = 0; /** * Return an {@link Interval} indicating the index in the * {@link TokenStream} of the first and last token associated with this * subtree. If this node is a leaf, then the interval represents a single * token and has interval i..i for token index i. * * <p>An interval of i..i-1 indicates an empty interval at position * i in the input stream, where 0 &lt;= i &lt;= the size of the input * token stream. Currently, the code base can only have i=0..n-1 but * in concept one could have an empty interval after EOF. </p> * * <p>If source interval is unknown, this returns {@link Interval#INVALID}.</p> * * <p>As a weird special case, the source interval for rules matched after * EOF is unspecified.</p> */ virtual misc::Interval getSourceInterval() = 0; }; // A class to help managing ParseTree instances without the need of a shared_ptr. class ANTLR4CPP_PUBLIC ParseTreeTracker { public: template<typename T, typename ... Args> T* createInstance(Args&& ... args) { static_assert(std::is_base_of<ParseTree, T>::value, "Argument must be a parse tree type"); T* result = new T(args...); _allocated.push_back(result); return result; } void reset() { for (auto entry : _allocated) delete entry; _allocated.clear(); } private: std::vector<ParseTree *> _allocated; }; } // namespace tree } // namespace antlr4
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ASH_LOGIN_TEST_USER_POLICY_MIXIN_H_ #define CHROME_BROWSER_ASH_LOGIN_TEST_USER_POLICY_MIXIN_H_ #include <memory> #include <string> #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/test/scoped_policy_update.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/test/policy_builder.h" namespace ash { class EmbeddedPolicyTestServerMixin; // Mixin for setting up user policy for a test user. // Currently supports setting cached user policy and optionally user policy // served by local or embedded policy test server.. // NOTE: This mixin will set up in-memory FakeSessionManagerClient during setup. class UserPolicyMixin : public InProcessBrowserTestMixin { public: UserPolicyMixin(InProcessBrowserTestMixinHost* mixin_host, const AccountId& account_id); UserPolicyMixin(InProcessBrowserTestMixinHost* mixin_host, const AccountId& account_id, EmbeddedPolicyTestServerMixin* policy_server); UserPolicyMixin(const UserPolicyMixin&) = delete; UserPolicyMixin& operator=(const UserPolicyMixin&) = delete; ~UserPolicyMixin() override; // InProcessBrowserTestMixin: void SetUpInProcessBrowserTestFixture() override; // Returns a ScopedUserPolicyUpdate object that will update the cached policy // values as it goes out of scope. Calling this will ensure that the cached // policy blob is set (even if policy remains empty when ScopedPolicyUpdate is // done). // // If called during setup, before steps that initialize session manager, // policy change will be deferred until session manager initialization. std::unique_ptr<ScopedUserPolicyUpdate> RequestPolicyUpdate(); private: // Creates a file containing public policy signing key that will be used to // verify cached user policy. Cached policy will get rejected by chrome if // this step is skipped. void SetUpUserKeysFile(const std::string& user_key_bits); // Sets policy blobs in the fake session manager client. void SetUpPolicy(); // The account ID of the user whose policy is set up by the mixin. AccountId account_id_; // Whether the mixin should set up policy blobs during setup. // Set in RequestCachedPolicyUpdate() is used during test setup (before // SetUpInProcessBrowserTestFixture()). bool set_policy_in_setup_ = false; // Whether the mixin initialized fake session manager client. bool session_manager_initialized_ = false; // Policy server that can optionally be passed into UserPolicyMixin. If set // user policy changes done by RequestPolicyUpdate() will also be forwarded // to the policy server. EmbeddedPolicyTestServerMixin* embedded_policy_server_ = nullptr; policy::UserPolicyBuilder user_policy_builder_; base::WeakPtrFactory<UserPolicyMixin> weak_factory_{this}; }; } // namespace ash // TODO(https://crbug.com/1164001): remove after //chrome/browser/chromeos // source migration is finished. namespace chromeos { using ::ash::UserPolicyMixin; } #endif // CHROME_BROWSER_ASH_LOGIN_TEST_USER_POLICY_MIXIN_H_
/* * Copyright (C) 2011 Apple Inc. All Rights Reserved. * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) * * 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 WebSocketServerConnection_h #define WebSocketServerConnection_h #if ENABLE(INSPECTOR_SERVER) #include <WebCore/SocketStreamHandleClient.h> #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> #include <wtf/Vector.h> #include <wtf/text/WTFString.h> namespace WebCore { class HTTPHeaderMap; class HTTPRequest; class SocketStreamHandle; } namespace WebKit { class WebSocketServer; class WebSocketServerClient; class WebSocketServerConnection : public WebCore::SocketStreamHandleClient { public: enum WebSocketServerMode { HTTP, WebSocket }; WebSocketServerConnection(WebSocketServerClient*, WebSocketServer*); virtual ~WebSocketServerConnection(); unsigned identifier() const { return m_identifier; } void setIdentifier(unsigned id) { m_identifier = id; } void setSocketHandle(PassRefPtr<WebCore::SocketStreamHandle>); // Sending data over the connection. void sendWebSocketMessage(const String& message); void sendHTTPResponseHeader(int statusCode, const String& statusText, const WebCore::HTTPHeaderMap& headerFields); void sendRawData(const char* data, size_t length); // Terminating the connection. void shutdownNow(); void shutdownAfterSendOrNow(); // SocketStreamHandleClient implementation. virtual void didCloseSocketStream(WebCore::SocketStreamHandle*); virtual void didReceiveSocketStreamData(WebCore::SocketStreamHandle*, const char* data, int length); virtual void didUpdateBufferedAmount(WebCore::SocketStreamHandle*, size_t bufferedAmount); virtual void didFailSocketStream(WebCore::SocketStreamHandle*, const WebCore::SocketStreamError&); private: // HTTP Mode. void readHTTPMessage(); // WebSocket Mode. void upgradeToWebSocketServerConnection(PassRefPtr<WebCore::HTTPRequest>); void readWebSocketFrames(); bool readWebSocketFrame(); protected: unsigned m_identifier; Vector<char> m_bufferedData; WebSocketServerMode m_mode; RefPtr<WebCore::SocketStreamHandle> m_socket; WebSocketServer* m_server; WebSocketServerClient* m_client; bool m_shutdownAfterSend; }; } #endif // ENABLE(INSPECTOR_SERVER) #endif // WebSocketServerConnection_h
#include "erfa.h" double eraSp00(double date1, double date2) /* ** - - - - - - - - ** e r a S p 0 0 ** - - - - - - - - ** ** The TIO locator s', positioning the Terrestrial Intermediate Origin ** on the equator of the Celestial Intermediate Pole. ** ** Given: ** date1,date2 double TT as a 2-part Julian Date (Note 1) ** ** Returned (function value): ** double the TIO locator s' in radians (Note 2) ** ** Notes: ** ** 1) The TT date date1+date2 is a Julian Date, apportioned in any ** convenient way between the two arguments. For example, ** JD(TT)=2450123.7 could be expressed in any of these ways, ** among others: ** ** date1 date2 ** ** 2450123.7 0.0 (JD method) ** 2451545.0 -1421.3 (J2000 method) ** 2400000.5 50123.2 (MJD method) ** 2450123.5 0.2 (date & time method) ** ** The JD method is the most natural and convenient to use in ** cases where the loss of several decimal digits of resolution ** is acceptable. The J2000 method is best matched to the way ** the argument is handled internally and will deliver the ** optimum resolution. The MJD method and the date & time methods ** are both good compromises between resolution and convenience. ** ** 2) The TIO locator s' is obtained from polar motion observations by ** numerical integration, and so is in essence unpredictable. ** However, it is dominated by a secular drift of about ** 47 microarcseconds per century, which is the approximation ** evaluated by the present function. ** ** Reference: ** ** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003), ** IERS Technical Note No. 32, BKG (2004) ** ** Copyright (C) 2013-2017, NumFOCUS Foundation. ** Derived, with permission, from the SOFA library. See notes at end of file. */ { double t, sp; /* Interval between fundamental epoch J2000.0 and current date (JC). */ t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC; /* Approximate s'. */ sp = -47e-6 * t * ERFA_DAS2R; return sp; } /*---------------------------------------------------------------------- ** ** ** Copyright (C) 2013-2017, NumFOCUS Foundation. ** All rights reserved. ** ** This library is derived, with permission, from the International ** Astronomical Union's "Standards of Fundamental Astronomy" library, ** available from http://www.iausofa.org. ** ** The ERFA version is intended to retain identical functionality to ** the SOFA library, but made distinct through different function and ** file names, as set out in the SOFA license conditions. The SOFA ** original has a role as a reference standard for the IAU and IERS, ** and consequently redistribution is permitted only in its unaltered ** state. The ERFA version is not subject to this restriction and ** therefore can be included in distributions which do not support the ** concept of "read only" software. ** ** Although the intent is to replicate the SOFA API (other than ** replacement of prefix names) and results (with the exception of ** bugs; any that are discovered will be fixed), SOFA is not ** responsible for any errors found in this version of the library. ** ** If you wish to acknowledge the SOFA heritage, please acknowledge ** that you are using a library derived from SOFA, rather than SOFA ** itself. ** ** ** TERMS AND CONDITIONS ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions ** are met: ** ** 1 Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** ** 2 Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** ** 3 Neither the name of the Standards Of Fundamental Astronomy Board, ** the International Astronomical Union 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. ** */
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SIGNIN_PUBLIC_IDENTITY_MANAGER_PRIMARY_ACCOUNT_CHANGE_EVENT_H_ #define COMPONENTS_SIGNIN_PUBLIC_IDENTITY_MANAGER_PRIMARY_ACCOUNT_CHANGE_EVENT_H_ #include "build/build_config.h" #include "components/signin/public/base/consent_level.h" #include "components/signin/public/identity_manager/account_info.h" #if BUILDFLAG(IS_ANDROID) #include "base/android/scoped_java_ref.h" #endif namespace signin { class PrimaryAccountChangeEvent { public: // Used to denote the type of the change event. enum class Type { // No change. kNone = 0, // Primary account set or changed. kSet = 1, // Primary account cleared. kCleared = 2 }; struct State { State(); State(const State& other); State(CoreAccountInfo account_info, ConsentLevel consent_level); ~State(); State& operator=(const State& other); CoreAccountInfo primary_account; ConsentLevel consent_level = ConsentLevel::kSignin; }; PrimaryAccountChangeEvent(); PrimaryAccountChangeEvent(State previous_state, State current_state); ~PrimaryAccountChangeEvent(); // Returns primary account change event type for the corresponding // consent_level. There can be 3 different event types. // kNone - No change in primary account for the given consent_level. // kSet - A new primary account is set or changed for the given consent_level. // kCleared - The primary account set for the consent level is cleared. Type GetEventTypeFor(ConsentLevel consent_level) const; const State& GetPreviousState() const; const State& GetCurrentState() const; private: State previous_state_, current_state_; }; bool operator==(const PrimaryAccountChangeEvent::State& lhs, const PrimaryAccountChangeEvent::State& rhs); bool operator==(const PrimaryAccountChangeEvent& lhs, const PrimaryAccountChangeEvent& rhs); std::ostream& operator<<(std::ostream& os, const PrimaryAccountChangeEvent::State& state); std::ostream& operator<<(std::ostream& os, const PrimaryAccountChangeEvent& event); #if BUILDFLAG(IS_ANDROID) base::android::ScopedJavaLocalRef<jobject> ConvertToJavaPrimaryAccountChangeEvent( JNIEnv* env, const PrimaryAccountChangeEvent& event_details); #endif } // namespace signin #endif // COMPONENTS_SIGNIN_PUBLIC_IDENTITY_MANAGER_PRIMARY_ACCOUNT_CHANGE_EVENT_H_
/***************************************************************/ /*** Psyco equivalent of methodobject.h ***/ /***************************************************************/ #ifndef _PSY_METHODOBJECT_H #define _PSY_METHODOBJECT_H #include "pobject.h" #include "pabstract.h" #define CFUNC_m_ml DEF_FIELD(PyCFunctionObject, PyMethodDef*, m_ml, OB_type) #define CFUNC_m_self DEF_FIELD(PyCFunctionObject, PyObject*, m_self, CFUNC_m_ml) #define iCFUNC_M_ML FIELD_INDEX(CFUNC_m_ml) #define iCFUNC_M_SELF FIELD_INDEX(CFUNC_m_self) #define CFUNC_TOTAL FIELDS_TOTAL(CFUNC_m_self) EXTERNFN vinfo_t* PsycoCFunction_Call(PsycoObject* po, vinfo_t* func, vinfo_t* tuple, vinfo_t* kw); /***************************************************************/ /*** Virtual-time object builder ***/ /* not-yet-computed C method objects, with a m_ml and m_self field. Usually not computed at all, but if it needs be, will call PyCFunction_New(). */ EXTERNVAR source_virtual_t psyco_computed_cfunction; PSY_INLINE vinfo_t* PsycoCFunction_New(PsycoObject* po, PyMethodDef* ml, vinfo_t* self) { vinfo_t* result = vinfo_new(VirtualTime_New(&psyco_computed_cfunction)); result->array = array_new(CFUNC_TOTAL); result->array->items[iOB_TYPE] = vinfo_new(CompileTime_New((long)(&PyCFunction_Type))); result->array->items[iCFUNC_M_ML] = vinfo_new(CompileTime_New((long) ml)); vinfo_incref(self); result->array->items[iCFUNC_M_SELF] = self; return result; } #endif /* _PSY_METHODOBJECT_H */
/* include/version.h */ #define CONFIG_SND_VERSION "1.0.25" #define CONFIG_SND_DATE ""