text
stringlengths
4
6.14k
/* * Copyright (C) 2012 Altera Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <linux/dw_apb_timer.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <asm/hardware/cache-l2x0.h> #include <asm/hardware/gic.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include "core.h" void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); void __iomem *sys_manager_base_addr; void __iomem *rst_manager_base_addr; static struct map_desc scu_io_desc __initdata = { .virtual = SOCFPGA_SCU_VIRT_BASE, .pfn = 0, /* run-time */ .length = SZ_8K, .type = MT_DEVICE, }; static struct map_desc uart_io_desc __initdata = { .virtual = 0xfec02000, .pfn = __phys_to_pfn(0xffc02000), .length = SZ_8K, .type = MT_DEVICE, }; static void __init socfpga_scu_map_io(void) { unsigned long base; /* Get SCU base */ asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); scu_io_desc.pfn = __phys_to_pfn(base); iotable_init(&scu_io_desc, 1); } static void __init socfpga_map_io(void) { socfpga_scu_map_io(); iotable_init(&uart_io_desc, 1); early_printk("Early printk initialized\n"); } const static struct of_device_id irq_match[] = { { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, {} }; void __init socfpga_sysmgr_init(void) { struct device_node *np; np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr"); sys_manager_base_addr = of_iomap(np, 0); np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr"); rst_manager_base_addr = of_iomap(np, 0); } static void __init gic_init_irq(void) { of_irq_init(irq_match); socfpga_sysmgr_init(); } static void socfpga_cyclone5_restart(char mode, const char *cmd) { /* TODO: */ } static void __init socfpga_cyclone5_init(void) { l2x0_of_init(0, ~0UL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); socfpga_init_clocks(); } static const char *altera_dt_match[] = { "altr,socfpga", "altr,socfpga-cyclone5", NULL }; DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA") .smp = smp_ops(socfpga_smp_ops), .map_io = socfpga_map_io, .init_irq = gic_init_irq, .handle_irq = gic_handle_irq, .init_time = dw_apb_timer_init, .init_machine = socfpga_cyclone5_init, .restart = socfpga_cyclone5_restart, .dt_compat = altera_dt_match, MACHINE_END
/**************************************************************** * This file is distributed under the following license: * * Copyright (c) 2006-2007, crypton * Copyright (c) 2006, Matt Edman, Justin Hipple * * 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 _WIN32_H #define _WIN32_H #include <QHash> #include <QString> /** Retrieves the location of the user's %PROGRAMFILES% folder. */ QString win32_program_files_folder(); /** Retrieves the location of the user's %APPDATA% folder. */ QString win32_app_data_folder(); /** Returns value of keyName or empty QString if keyName doesn't exist */ QString win32_registry_get_key_value(QString keyLocation, QString keyName); /** Creates and/or sets the key to the specified value */ void win32_registry_set_key_value(QString keyLocation, QString keyName, QString keyValue); /** Removes the key from the registry if it exists */ void win32_registry_remove_key(QString keyLocation, QString keyName); #endif
/***************************************************************************** * substtml.c : TTML subtitles decoder ***************************************************************************** * Copyright (C) 2015 VLC authors and VideoLAN * * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr> * Sushma Reddy <sushma.reddy@research.iiit.ac.in> * * 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.1 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, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <vlc_common.h> #include <vlc_plugin.h> #include <vlc_modules.h> #include <vlc_codec.h> #include "substext.h" #define ALIGN_TEXT N_("Subtitle justification") #define ALIGN_LONGTEXT N_("Set the justification of subtitles") /***************************************************************************** * Module descriptor. *****************************************************************************/ static int OpenDecoder ( vlc_object_t * ); static void CloseDecoder ( vlc_object_t * ); vlc_module_begin () set_capability( "decoder", 10 ) set_shortname( N_("TTML decoder")) set_description( N_("TTML subtitles decoder") ) set_callbacks( OpenDecoder, CloseDecoder ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_SCODEC ) add_integer( "ttml-align", 0, ALIGN_TEXT, ALIGN_LONGTEXT, false ) vlc_module_end (); /***************************************************************************** * Local prototypes *****************************************************************************/ struct decoder_sys_t { int i_align; }; static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block ) { decoder_sys_t *p_sys = p_dec->p_sys; subpicture_t *p_spu = NULL; char *psz_subtitle = NULL; /* We cannot display a subpicture with no date */ if( p_block->i_pts <= VLC_TS_INVALID ) { msg_Warn( p_dec, "subtitle without a date" ); return NULL; } /* Check validity of packet data */ /* An "empty" line containing only \0 can be used to force and ephemer picture from the screen */ if( p_block->i_buffer < 1 ) { msg_Warn( p_dec, "no subtitle data" ); return NULL; } psz_subtitle = malloc( p_block->i_buffer ); if ( unlikely( psz_subtitle == NULL ) ) return NULL; memcpy( psz_subtitle, p_block->p_buffer, p_block->i_buffer ); /* Create the subpicture unit */ p_spu = decoder_NewSubpictureText( p_dec ); if( !p_spu ) { free( psz_subtitle ); return NULL; } p_spu->i_start = p_block->i_pts; p_spu->i_stop = p_block->i_pts + p_block->i_length; p_spu->b_ephemer = (p_block->i_length == 0); p_spu->b_absolute = false; subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys; p_spu_sys->align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align; p_spu_sys->text = psz_subtitle; return p_spu; } /**************************************************************************** * DecodeBlock: the whole thing ****************************************************************************/ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) { if( !pp_block || *pp_block == NULL ) return NULL; block_t* p_block = *pp_block; subpicture_t *p_spu = ParseText( p_dec, p_block ); block_Release( p_block ); *pp_block = NULL; return p_spu; } /***************************************************************************** * OpenDecoder: probe the decoder and return score *****************************************************************************/ static int OpenDecoder( vlc_object_t *p_this ) { decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; if ( p_dec->fmt_in.i_codec != VLC_CODEC_TTML ) { return VLC_EGENERIC; } /* Allocate the memory needed to store the decoder's structure */ p_dec->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) ); if( unlikely( p_sys == NULL ) ) { return VLC_ENOMEM; } p_dec->pf_decode_sub = DecodeBlock; p_dec->fmt_out.i_cat = SPU_ES; p_sys->i_align = var_InheritInteger( p_dec, "ttml-align" ); return VLC_SUCCESS; } /***************************************************************************** * CloseDecoder: clean up the decoder *****************************************************************************/ static void CloseDecoder( vlc_object_t *p_this ) { /* Cleanup here */ decoder_t *p_dec = (decoder_t *)p_this; decoder_sys_t *p_sys = p_dec->p_sys; free( p_sys ); }
/* Lattice Mico32 timer model. Contributed by Jon Beniston <jon@beniston.com> Copyright (C) 2009 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "sim-main.h" #include "hw-main.h" #include "sim-assert.h" struct lm32timer { unsigned base; /* Base address of this timer. */ unsigned limit; /* Limit address of this timer. */ unsigned int status; unsigned int control; unsigned int period; unsigned int snapshot; struct hw_event *event; }; /* Timer registers. */ #define LM32_TIMER_STATUS 0x0 #define LM32_TIMER_CONTROL 0x4 #define LM32_TIMER_PERIOD 0x8 #define LM32_TIMER_SNAPSHOT 0xc /* Timer ports. */ enum { INT_PORT }; static const struct hw_port_descriptor lm32timer_ports[] = { {"int", INT_PORT, 0, output_port}, {} }; static void do_timer_event (struct hw *me, void *data) { struct lm32timer *timer = hw_data (me); /* Is timer started? */ if (timer->control & 0x4) { if (timer->snapshot) { /* Decrement timer. */ timer->snapshot--; } else if (timer->control & 1) { /* Restart timer. */ timer->snapshot = timer->period; } } /* Generate interrupt when timer is at 0, and interrupt enable is 1. */ if ((timer->snapshot == 0) && (timer->control & 1)) { /* Generate interrupt. */ hw_port_event (me, INT_PORT, 1); } /* If timer is started, schedule another event to decrement the timer again. */ if (timer->control & 4) hw_event_queue_schedule (me, 1, do_timer_event, 0); } static unsigned lm32timer_io_write_buffer (struct hw *me, const void *source, int space, unsigned_word base, unsigned nr_bytes) { struct lm32timer *timers = hw_data (me); int timer_reg; const unsigned char *source_bytes = source; int value = 0; HW_TRACE ((me, "write to 0x%08lx length %d with 0x%x", (long) base, (int) nr_bytes, value)); if (nr_bytes == 4) value = (source_bytes[0] << 24) | (source_bytes[1] << 16) | (source_bytes[2] << 8) | (source_bytes[3]); else hw_abort (me, "write with invalid number of bytes: %d", nr_bytes); timer_reg = base - timers->base; switch (timer_reg) { case LM32_TIMER_STATUS: timers->status = value; break; case LM32_TIMER_CONTROL: timers->control = value; if (timers->control & 0x4) { /* Timer is started. */ hw_event_queue_schedule (me, 1, do_timer_event, 0); } break; case LM32_TIMER_PERIOD: timers->period = value; break; default: hw_abort (me, "invalid register address: 0x%x.", timer_reg); } return nr_bytes; } static unsigned lm32timer_io_read_buffer (struct hw *me, void *dest, int space, unsigned_word base, unsigned nr_bytes) { struct lm32timer *timers = hw_data (me); int timer_reg; int value; unsigned char *dest_bytes = dest; HW_TRACE ((me, "read 0x%08lx length %d", (long) base, (int) nr_bytes)); timer_reg = base - timers->base; switch (timer_reg) { case LM32_TIMER_STATUS: value = timers->status; break; case LM32_TIMER_CONTROL: value = timers->control; break; case LM32_TIMER_PERIOD: value = timers->period; break; case LM32_TIMER_SNAPSHOT: value = timers->snapshot; break; default: hw_abort (me, "invalid register address: 0x%x.", timer_reg); } if (nr_bytes == 4) { dest_bytes[0] = value >> 24; dest_bytes[1] = value >> 16; dest_bytes[2] = value >> 8; dest_bytes[3] = value; } else hw_abort (me, "read of unsupported number of bytes: %d", nr_bytes); return nr_bytes; } static void attach_lm32timer_regs (struct hw *me, struct lm32timer *timers) { unsigned_word attach_address; int attach_space; unsigned attach_size; reg_property_spec reg; if (hw_find_property (me, "reg") == NULL) hw_abort (me, "Missing \"reg\" property"); if (!hw_find_reg_array_property (me, "reg", 0, &reg)) hw_abort (me, "\"reg\" property must contain three addr/size entries"); hw_unit_address_to_attach_address (hw_parent (me), &reg.address, &attach_space, &attach_address, me); timers->base = attach_address; hw_unit_size_to_attach_size (hw_parent (me), &reg.size, &attach_size, me); timers->limit = attach_address + (attach_size - 1); hw_attach_address (hw_parent (me), 0, attach_space, attach_address, attach_size, me); } static void lm32timer_finish (struct hw *me) { struct lm32timer *timers; int i; timers = HW_ZALLOC (me, struct lm32timer); set_hw_data (me, timers); set_hw_io_read_buffer (me, lm32timer_io_read_buffer); set_hw_io_write_buffer (me, lm32timer_io_write_buffer); set_hw_ports (me, lm32timer_ports); /* Attach ourself to our parent bus. */ attach_lm32timer_regs (me, timers); /* Initialize the timers. */ timers->status = 0; timers->control = 0; timers->period = 0; timers->snapshot = 0; } const struct hw_descriptor dv_lm32timer_descriptor[] = { {"lm32timer", lm32timer_finish,}, {NULL}, };
/* Copyright (C) 2001-2006, William Joseph. All Rights Reserved. This file is part of GtkRadiant. GtkRadiant 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. GtkRadiant 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 GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(INCLUDED_WRITE_H) #define INCLUDED_WRITE_H #include "imap.h" void Map_Write (scene::Node& root, GraphTraversalFunc traverse, TokenWriter& writer); #endif
/* * Copyright (C) 2005-2007 Imendio AB * Copyright (C) 2008-2012 Collabora Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * Authors: Xavier Claessens <xclaesse@gmail.com> */ #ifndef __EMPATHY_THEME_MANAGER_H__ #define __EMPATHY_THEME_MANAGER_H__ #include "empathy-theme-adium.h" G_BEGIN_DECLS /* TYPE MACROS */ #define EMPATHY_TYPE_THEME_MANAGER \ (empathy_theme_manager_get_type ()) #define EMPATHY_THEME_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ EMPATHY_TYPE_THEME_MANAGER, \ EmpathyThemeManager)) #define EMPATHY_THEME_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ EMPATHY_TYPE_THEME_MANAGER, \ EmpathyThemeManagerClass)) #define EMPATHY_IS_THEME_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ EMPATHY_TYPE_THEME_MANAGER)) #define EMPATHY_IS_THEME_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ EMPATHY_TYPE_THEME_MANAGER)) #define EMPATHY_THEME_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EMPATHY_TYPE_THEME_MANAGER, \ EmpathyThemeManagerClass)) typedef struct _EmpathyThemeManager EmpathyThemeManager; typedef struct _EmpathyThemeManagerClass EmpathyThemeManagerClass; typedef struct _EmpathyThemeManagerPriv EmpathyThemeManagerPriv; struct _EmpathyThemeManager { GObject parent; EmpathyThemeManagerPriv *priv; }; struct _EmpathyThemeManagerClass { GObjectClass parent_class; }; GType empathy_theme_manager_get_type (void) G_GNUC_CONST; EmpathyThemeManager * empathy_theme_manager_dup_singleton (void); GList * empathy_theme_manager_get_adium_themes (void); EmpathyThemeAdium * empathy_theme_manager_create_view (EmpathyThemeManager *self); gchar * empathy_theme_manager_find_theme (const gchar *name); gchar * empathy_theme_manager_dup_theme_name_from_path (const gchar *path); G_END_DECLS #endif /* __EMPATHY_THEME_MANAGER_H__ */
/* * (C) Copyright 2002 * Rich Ireland, Enterasys Networks, rireland@enterasys.com. * * See file CREDITS for list of people who contributed to this * 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; 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 _SPARTAN2_H_ #define _SPARTAN2_H_ #include <xilinx.h> extern int Spartan2_load( Xilinx_desc *desc, void *image, size_t size ); extern int Spartan2_dump( Xilinx_desc *desc, void *buf, size_t bsize ); extern int Spartan2_info( Xilinx_desc *desc ); extern int Spartan2_reloc( Xilinx_desc *desc, ulong reloc_off ); /* Slave Parallel Implementation function table */ typedef struct { Xilinx_pre_fn pre; Xilinx_pgm_fn pgm; Xilinx_init_fn init; Xilinx_err_fn err; Xilinx_done_fn done; Xilinx_clk_fn clk; Xilinx_cs_fn cs; Xilinx_wr_fn wr; Xilinx_rdata_fn rdata; Xilinx_wdata_fn wdata; Xilinx_busy_fn busy; Xilinx_abort_fn abort; Xilinx_post_fn post; int relocated; } Xilinx_Spartan2_Slave_Parallel_fns; /* Slave Serial Implementation function table */ typedef struct { Xilinx_pre_fn pre; Xilinx_pgm_fn pgm; Xilinx_clk_fn clk; Xilinx_init_fn init; Xilinx_done_fn done; Xilinx_wr_fn wr; int relocated; } Xilinx_Spartan2_Slave_Serial_fns; /* Device Image Sizes *********************************************************************/ /* Spartan-II (2.5V) */ #define XILINX_XC2S15_SIZE 197728/8 #define XILINX_XC2S30_SIZE 336800/8 #define XILINX_XC2S50_SIZE 559232/8 #define XILINX_XC2S100_SIZE 781248/8 #define XILINX_XC2S150_SIZE 1040128/8 /* Descriptor Macros *********************************************************************/ /* Spartan-II devices */ #define XILINX_XC2S15_DESC(iface, fn_table, cookie) \ { Xilinx_Spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie } #define XILINX_XC2S30_DESC(iface, fn_table, cookie) \ { Xilinx_Spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie } #define XILINX_XC2S50_DESC(iface, fn_table, cookie) \ { Xilinx_Spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie } #define XILINX_XC2S100_DESC(iface, fn_table, cookie) \ { Xilinx_Spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie } #define XILINX_XC2S150_DESC(iface, fn_table, cookie) \ { Xilinx_Spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie } #endif /* _SPARTAN2_H_ */
/* GENERATED FILE - DO NOT EDIT */ /* * Copyright Altera Corporation (C) 2012-2014. All rights reserved * * SPDX-License-Identifier: BSD-3-Clause * * 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 Altera Corporation nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ALTERA CORPORATION 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 _PRELOADER_PLL_CONFIG_H_ #define _PRELOADER_PLL_CONFIG_H_ #define CONFIG_HPS_DBCTRL_STAYOSC1 (1) #define CONFIG_HPS_MAINPLLGRP_VCO_DENOM (0) #define CONFIG_HPS_MAINPLLGRP_VCO_NUMER (63) #define CONFIG_HPS_MAINPLLGRP_MPUCLK_CNT (0) #define CONFIG_HPS_MAINPLLGRP_MAINCLK_CNT (0) #define CONFIG_HPS_MAINPLLGRP_DBGATCLK_CNT (0) #define CONFIG_HPS_MAINPLLGRP_MAINQSPICLK_CNT (3) #define CONFIG_HPS_MAINPLLGRP_MAINNANDSDMMCCLK_CNT (511) #define CONFIG_HPS_MAINPLLGRP_CFGS2FUSER0CLK_CNT (15) #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L3MPCLK (1) #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L3SPCLK (1) #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L4MPCLK (1) #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L4SPCLK (1) #define CONFIG_HPS_MAINPLLGRP_DBGDIV_DBGATCLK (0) #define CONFIG_HPS_MAINPLLGRP_DBGDIV_DBGCLK (1) #define CONFIG_HPS_MAINPLLGRP_TRACEDIV_TRACECLK (0) #define CONFIG_HPS_MAINPLLGRP_L4SRC_L4MP (1) #define CONFIG_HPS_MAINPLLGRP_L4SRC_L4SP (1) #define CONFIG_HPS_PERPLLGRP_VCO_DENOM (0) #define CONFIG_HPS_PERPLLGRP_VCO_NUMER (39) #define CONFIG_HPS_PERPLLGRP_VCO_PSRC (0) #define CONFIG_HPS_PERPLLGRP_EMAC0CLK_CNT (511) #define CONFIG_HPS_PERPLLGRP_EMAC1CLK_CNT (3) #define CONFIG_HPS_PERPLLGRP_PERQSPICLK_CNT (511) #define CONFIG_HPS_PERPLLGRP_PERNANDSDMMCCLK_CNT (4) #define CONFIG_HPS_PERPLLGRP_PERBASECLK_CNT (4) #define CONFIG_HPS_PERPLLGRP_S2FUSER1CLK_CNT (511) #define CONFIG_HPS_PERPLLGRP_DIV_USBCLK (0) #define CONFIG_HPS_PERPLLGRP_DIV_SPIMCLK (0) #define CONFIG_HPS_PERPLLGRP_DIV_CAN0CLK (1) #define CONFIG_HPS_PERPLLGRP_DIV_CAN1CLK (4) #define CONFIG_HPS_PERPLLGRP_GPIODIV_GPIODBCLK (6249) #define CONFIG_HPS_PERPLLGRP_SRC_SDMMC (2) #define CONFIG_HPS_PERPLLGRP_SRC_NAND (2) #define CONFIG_HPS_PERPLLGRP_SRC_QSPI (1) #define CONFIG_HPS_SDRPLLGRP_VCO_DENOM (2) #define CONFIG_HPS_SDRPLLGRP_VCO_NUMER (79) #define CONFIG_HPS_SDRPLLGRP_VCO_SSRC (0) #define CONFIG_HPS_SDRPLLGRP_DDRDQSCLK_CNT (1) #define CONFIG_HPS_SDRPLLGRP_DDRDQSCLK_PHASE (0) #define CONFIG_HPS_SDRPLLGRP_DDR2XDQSCLK_CNT (0) #define CONFIG_HPS_SDRPLLGRP_DDR2XDQSCLK_PHASE (0) #define CONFIG_HPS_SDRPLLGRP_DDRDQCLK_CNT (1) #define CONFIG_HPS_SDRPLLGRP_DDRDQCLK_PHASE (4) #define CONFIG_HPS_SDRPLLGRP_S2FUSER2CLK_CNT (5) #define CONFIG_HPS_SDRPLLGRP_S2FUSER2CLK_PHASE (0) #define CONFIG_HPS_CLK_OSC1_HZ (25000000) #define CONFIG_HPS_CLK_OSC2_HZ (25000000) #define CONFIG_HPS_CLK_F2S_SDR_REF_HZ (0) #define CONFIG_HPS_CLK_F2S_PER_REF_HZ (0) #define CONFIG_HPS_CLK_MAINVCO_HZ (1600000000) #define CONFIG_HPS_CLK_PERVCO_HZ (1000000000) #define CONFIG_HPS_CLK_SDRVCO_HZ (666666666) #define CONFIG_HPS_CLK_EMAC0_HZ (1953125) #define CONFIG_HPS_CLK_EMAC1_HZ (250000000) #define CONFIG_HPS_CLK_USBCLK_HZ (200000000) #define CONFIG_HPS_CLK_NAND_HZ (50000000) #define CONFIG_HPS_CLK_SDMMC_HZ (200000000) #define CONFIG_HPS_CLK_QSPI_HZ (400000000) #define CONFIG_HPS_CLK_SPIM_HZ (200000000) #define CONFIG_HPS_CLK_CAN0_HZ (100000000) #define CONFIG_HPS_CLK_CAN1_HZ (12500000) #define CONFIG_HPS_CLK_GPIODB_HZ (32000) #define CONFIG_HPS_CLK_L4_MP_HZ (100000000) #define CONFIG_HPS_CLK_L4_SP_HZ (100000000) #define CONFIG_HPS_ALTERAGRP_MPUCLK (1) #define CONFIG_HPS_ALTERAGRP_MAINCLK (3) #define CONFIG_HPS_ALTERAGRP_DBGATCLK (3) #endif /* _PRELOADER_PLL_CONFIG_H_ */
/* Copyright 2020 MelGeek <melgeek001365@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, see <http://www.gnu.org/licenses/>. */ #pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xEDED #define PRODUCT_ID 0x7075 #define DEVICE_VER 0x0001 #define MANUFACTURER MelGeek #define PRODUCT MOJO75 /* key matrix size */ #define MATRIX_ROWS 6 #define MATRIX_COLS 16 /* * Keyboard Matrix Assignments * * Change this to how you wired your keyboard * COLS: AVR pins used for columns, left to right * ROWS: AVR pins used for rows, top to bottom * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * */ #define MATRIX_ROW_PINS { B11, B10, B1, B0, A7, A6 } #define MATRIX_COL_PINS { B12, B13, B14, B15, A8, A15, B3, B4, B5, B8, B9, C13, C14, C15, A0, A1 } #define UNUSED_PINS /* COL2ROW, ROW2COL*/ #define DIODE_DIRECTION COL2ROW /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 3 /* disable these deprecated features by default */ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 4 #define RGB_MATRIX_LED_FLUSH_LIMIT 26 #define DISABLE_RGB_MATRIX_SPLASH #define DISABLE_RGB_MATRIX_MULTISPLASH #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH //#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_ALL //#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_REACTIVE_SIMPLE #define DRIVER_ADDR_1 0b0110000 #define DRIVER_ADDR_2 0b0110000 // this is here for compliancy reasons. #define DRIVER_COUNT 1 #define DRIVER_1_LED_TOTAL 92 #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL #define DRIVER_INDICATOR_LED_TOTAL 0
#undef CONFIG_USB_RIO500
#ifndef _VME_H_ #define _VME_H_ /* Resource Type */ enum vme_resource_type { VME_MASTER, VME_SLAVE, VME_DMA, VME_LM }; /* VME Address Spaces */ #define VME_A16 0x1 #define VME_A24 0x2 #define VME_A32 0x4 #define VME_A64 0x8 #define VME_CRCSR 0x10 #define VME_USER1 0x20 #define VME_USER2 0x40 #define VME_USER3 0x80 #define VME_USER4 0x100 #define VME_A16_MAX 0x10000ULL #define VME_A24_MAX 0x1000000ULL #define VME_A32_MAX 0x100000000ULL #define VME_A64_MAX 0x10000000000000000ULL #define VME_CRCSR_MAX 0x1000000ULL /* VME Cycle Types */ #define VME_SCT 0x1 #define VME_BLT 0x2 #define VME_MBLT 0x4 #define VME_2eVME 0x8 #define VME_2eSST 0x10 #define VME_2eSSTB 0x20 #define VME_2eSST160 0x100 #define VME_2eSST267 0x200 #define VME_2eSST320 0x400 #define VME_SUPER 0x1000 #define VME_USER 0x2000 #define VME_PROG 0x4000 #define VME_DATA 0x8000 /* VME Data Widths */ #define VME_D8 0x1 #define VME_D16 0x2 #define VME_D32 0x4 #define VME_D64 0x8 /* Arbitration Scheduling Modes */ #define VME_R_ROBIN_MODE 0x1 #define VME_PRIORITY_MODE 0x2 #define VME_DMA_PATTERN (1<<0) #define VME_DMA_PCI (1<<1) #define VME_DMA_VME (1<<2) #define VME_DMA_PATTERN_BYTE (1<<0) #define VME_DMA_PATTERN_WORD (1<<1) #define VME_DMA_PATTERN_INCREMENT (1<<2) #define VME_DMA_VME_TO_MEM (1<<0) #define VME_DMA_MEM_TO_VME (1<<1) #define VME_DMA_VME_TO_VME (1<<2) #define VME_DMA_MEM_TO_MEM (1<<3) #define VME_DMA_PATTERN_TO_VME (1<<4) #define VME_DMA_PATTERN_TO_MEM (1<<5) struct vme_dma_attr { u32 type; void *private; }; struct vme_resource { enum vme_resource_type type; struct list_head *entry; }; extern struct bus_type vme_bus_type; /* VME_MAX_BRIDGES comes from the type of vme_bus_numbers */ #define VME_MAX_BRIDGES (sizeof(unsigned int)*8) #define VME_MAX_SLOTS 32 #define VME_SLOT_CURRENT -1 #define VME_SLOT_ALL -2 /** * Structure representing a VME device * @num: The device number * @bridge: Pointer to the bridge device this device is on * @dev: Internal device structure * @drv_list: List of devices (per driver) * @bridge_list: List of devices (per bridge) */ struct vme_dev { int num; struct vme_bridge *bridge; struct device dev; struct list_head drv_list; struct list_head bridge_list; }; struct vme_driver { struct list_head node; const char *name; int (*match)(struct vme_dev *); int (*probe)(struct vme_dev *); int (*remove)(struct vme_dev *); void (*shutdown)(void); struct device_driver driver; struct list_head devices; }; void *vme_alloc_consistent(struct vme_resource *, size_t, dma_addr_t *); void vme_free_consistent(struct vme_resource *, size_t, void *, dma_addr_t); size_t vme_get_size(struct vme_resource *); struct vme_resource *vme_slave_request(struct vme_dev *, u32, u32); int vme_slave_set(struct vme_resource *, int, unsigned long long, unsigned long long, dma_addr_t, u32, u32); int vme_slave_get(struct vme_resource *, int *, unsigned long long *, unsigned long long *, dma_addr_t *, u32 *, u32 *); void vme_slave_free(struct vme_resource *); struct vme_resource *vme_master_request(struct vme_dev *, u32, u32, u32); int vme_master_set(struct vme_resource *, int, unsigned long long, unsigned long long, u32, u32, u32); int vme_master_get(struct vme_resource *, int *, unsigned long long *, unsigned long long *, u32 *, u32 *, u32 *); ssize_t vme_master_read(struct vme_resource *, void *, size_t, loff_t); ssize_t vme_master_write(struct vme_resource *, void *, size_t, loff_t); unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int, unsigned int, loff_t); void vme_master_free(struct vme_resource *); struct vme_resource *vme_dma_request(struct vme_dev *, u32); struct vme_dma_list *vme_new_dma_list(struct vme_resource *); struct vme_dma_attr *vme_dma_pattern_attribute(u32, u32); struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t); struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long, u32, u32, u32); void vme_dma_free_attribute(struct vme_dma_attr *); int vme_dma_list_add(struct vme_dma_list *, struct vme_dma_attr *, struct vme_dma_attr *, size_t); int vme_dma_list_exec(struct vme_dma_list *); int vme_dma_list_free(struct vme_dma_list *); int vme_dma_free(struct vme_resource *); int vme_irq_request(struct vme_dev *, int, int, void (*callback)(int, int, void *), void *); void vme_irq_free(struct vme_dev *, int, int); int vme_irq_generate(struct vme_dev *, int, int); struct vme_resource *vme_lm_request(struct vme_dev *); int vme_lm_count(struct vme_resource *); int vme_lm_set(struct vme_resource *, unsigned long long, u32, u32); int vme_lm_get(struct vme_resource *, unsigned long long *, u32 *, u32 *); int vme_lm_attach(struct vme_resource *, int, void (*callback)(int)); int vme_lm_detach(struct vme_resource *, int); void vme_lm_free(struct vme_resource *); int vme_slot_get(struct vme_dev *); int vme_register_driver(struct vme_driver *, unsigned int); void vme_unregister_driver(struct vme_driver *); #endif /* _VME_H_ */
#ifndef __READLINE_H #define __READLINE_H /* Standard readline API */ extern char *readline(const char *__prompt); /* Fuzix API's */ extern int rl_edit (int __fd, int __ofd, const char *__prompt, char *__input, size_t __len); extern void rl_hinit(char *__buffer, size_t __len); #endif
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2010. * * * * 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 15-2 */ /* t_chown.c Demonstrate the use of the chown() system call to change the owner and group of a file. Usage: t_chown owner group [file...] Either or both of owner and/or group can be specified as "-" to leave them unchanged. */ #include <pwd.h> #include <grp.h> #include "ugid_functions.h" /* Declarations of userIdFromName() and groupIdFromName() */ #include "tlpi_hdr.h" int main(int argc, char *argv[]) { uid_t uid; gid_t gid; int j; Boolean errFnd; if (argc < 3 || strcmp(argv[1], "--help") == 0) usageErr("%s owner group [file...]\n" " owner or group can be '-', " "meaning leave unchanged\n", argv[0]); if (strcmp(argv[1], "-") == 0) { /* "-" ==> don't change owner */ uid = -1; } else { /* Turn user name into UID */ uid = userIdFromName(argv[1]); if (uid == -1) fatal("No such user (%s)", argv[1]); } if (strcmp(argv[2], "-") == 0) { /* "-" ==> don't change group */ gid = -1; } else { /* Turn group name into GID */ gid = groupIdFromName(argv[2]); if (gid == -1) fatal("No group user (%s)", argv[1]); } /* Change ownership of all files named in remaining arguments */ errFnd = FALSE; for (j = 3; j < argc; j++) { if (chown(argv[j], uid, gid) == -1) { errMsg("chown: %s", argv[j]); errFnd = TRUE; } } exit(errFnd ? EXIT_FAILURE : EXIT_SUCCESS); }
#include "clapack.h" doublereal dasum_(integer *n, doublereal *dx, integer *incx) { /* System generated locals */ integer i__1, i__2; doublereal ret_val, d__1, d__2, d__3, d__4, d__5, d__6; /* Local variables */ integer i__, m, mp1; doublereal dtemp; integer nincx; /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* takes the sum of the absolute values. */ /* jack dongarra, linpack, 3/11/78. */ /* modified 3/93 to return if incx .le. 0. */ /* modified 12/3/93, array(1) declarations changed to array(*) */ /* .. Local Scalars .. */ /* .. */ /* .. Intrinsic Functions .. */ /* .. */ /* Parameter adjustments */ --dx; /* Function Body */ ret_val = 0.; dtemp = 0.; if (*n <= 0 || *incx <= 0) { return ret_val; } if (*incx == 1) { goto L20; } /* code for increment not equal to 1 */ nincx = *n * *incx; i__1 = nincx; i__2 = *incx; for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { dtemp += (d__1 = dx[i__], abs(d__1)); /* L10: */ } ret_val = dtemp; return ret_val; /* code for increment equal to 1 */ /* clean-up loop */ L20: m = *n % 6; if (m == 0) { goto L40; } i__2 = m; for (i__ = 1; i__ <= i__2; ++i__) { dtemp += (d__1 = dx[i__], abs(d__1)); /* L30: */ } if (*n < 6) { goto L60; } L40: mp1 = m + 1; i__2 = *n; for (i__ = mp1; i__ <= i__2; i__ += 6) { dtemp = dtemp + (d__1 = dx[i__], abs(d__1)) + (d__2 = dx[i__ + 1], abs(d__2)) + (d__3 = dx[i__ + 2], abs(d__3)) + (d__4 = dx[i__ + 3], abs(d__4)) + (d__5 = dx[i__ + 4], abs(d__5)) + (d__6 = dx[i__ + 5], abs(d__6)); /* L50: */ } L60: ret_val = dtemp; return ret_val; } /* dasum_ */
/** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * */ #pragma once /** * MRR ESPA pin assignments * * 3D printer control board based on the ESP32 microcontroller. * Supports 4 stepper drivers, heated bed, single hotend. */ #include "env_validate.h" #if EXTRUDERS > 1 || E_STEPPERS > 1 #error "MRR ESPA only supports one E Stepper. Comment out this line to continue." #elif HAS_MULTI_HOTEND #error "MRR ESPA only supports one hotend / E-stepper. Comment out this line to continue." #endif #define BOARD_INFO_NAME "MRR ESPA" #define BOARD_WEBSITE_URL "github.com/maplerainresearch/MRR_ESPA" #include "pins_ESPA_common.h" // // Steppers // //#define X_CS_PIN 21 //#define Y_CS_PIN 22 //#define Z_CS_PIN 5 // SS_PIN //#define E0_CS_PIN 21 // Hardware serial pins // Add the following to Configuration.h or Configuration_adv.h to assign // specific pins to hardware Serial1. // Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but // MRR ESPA does not have enough spare pins for such reassignment. //#define HARDWARE_SERIAL1_RX 21 //#define HARDWARE_SERIAL1_TX 22
/* -*- c++ -*- */ /* * Copyright 2004,2005,2006 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio 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, or (at your option) * any later version. * * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_GR_VECTOR_TO_STREAM_H #define INCLUDED_GR_VECTOR_TO_STREAM_H #include <gr_core_api.h> #include <gr_sync_interpolator.h> class gr_vector_to_stream; typedef boost::shared_ptr<gr_vector_to_stream> gr_vector_to_stream_sptr; GR_CORE_API gr_vector_to_stream_sptr gr_make_vector_to_stream (size_t item_size, size_t nitems_per_block); /*! * \brief convert a stream of blocks of nitems_per_block items into a stream of items * \ingroup slicedice_blk */ class GR_CORE_API gr_vector_to_stream : public gr_sync_interpolator { friend GR_CORE_API gr_vector_to_stream_sptr gr_make_vector_to_stream (size_t item_size, size_t nitems_per_block); protected: gr_vector_to_stream (size_t item_size, size_t nitems_per_block); public: int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_VECTOR_TO_STREAM_H */
#pragma once #include <stdint.h> // clang-format off # define DISCORD_EXPORT // clang-format on #ifdef __cplusplus extern "C" { #endif typedef struct DiscordRichPresence { const char* state; /* max 128 bytes */ const char* details; /* max 128 bytes */ int64_t startTimestamp; int64_t endTimestamp; const char* largeImageKey; /* max 32 bytes */ const char* largeImageText; /* max 128 bytes */ const char* smallImageKey; /* max 32 bytes */ const char* smallImageText; /* max 128 bytes */ const char* partyId; /* max 128 bytes */ int partySize; int partyMax; const char* matchSecret; /* max 128 bytes */ const char* joinSecret; /* max 128 bytes */ const char* spectateSecret; /* max 128 bytes */ int8_t instance; } DiscordRichPresence; typedef struct DiscordUser { const char* userId; const char* username; const char* discriminator; const char* avatar; } DiscordUser; typedef struct DiscordEventHandlers { void (*ready)(const DiscordUser* request); void (*disconnected)(int errorCode, const char* message); void (*errored)(int errorCode, const char* message); void (*joinGame)(const char* joinSecret); void (*spectateGame)(const char* spectateSecret); void (*joinRequest)(const DiscordUser* request); } DiscordEventHandlers; #define DISCORD_REPLY_NO 0 #define DISCORD_REPLY_YES 1 #define DISCORD_REPLY_IGNORE 2 DISCORD_EXPORT void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers, int autoRegister, const char* optionalSteamId); DISCORD_EXPORT void Discord_Shutdown(void); /* checks for incoming messages, dispatches callbacks */ DISCORD_EXPORT void Discord_RunCallbacks(void); /* If you disable the lib starting its own io thread, you'll need to call this from your own */ #ifdef DISCORD_DISABLE_IO_THREAD DISCORD_EXPORT void Discord_UpdateConnection(void); #endif DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence); DISCORD_EXPORT void Discord_ClearPresence(void); DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ int reply); DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* handlers); #ifdef __cplusplus } /* extern "C" */ #endif
#ifndef GC_VERIFY_H #define GC_VERIFY_H int verify_repos (); #endif
/**************************************************************** * * * Copyright 2001, 2006 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "locklits.h" #include "mlkdef.h" #include "zshow.h" void zshow_format_lock(zshow_out *output, mlk_pvtblk *temp) { static readonly char lp[] = "("; static readonly char rp[] = ")"; static readonly char cm[] = ","; mval v; unsigned short subs; unsigned char *ptr,len; ptr = temp->value; len = v.str.len = *ptr++; v.str.addr = (char *)ptr; zshow_output(output, &v.str); if (temp->subscript_cnt > 1) { v.mvtype = MV_STR; v.str.len = 1; v.str.addr = lp; zshow_output(output, &v.str); for (subs = 1 ; subs < temp->subscript_cnt; subs++) { if (subs > 1) { v.str.len = 1; v.str.addr = cm; zshow_output(output, &v.str); } ptr += len; len = v.str.len = *ptr++; v.str.addr = (char *)ptr; mval_write(output, &v, FALSE); } v.str.len = 1; v.str.addr = rp; zshow_output(output,&v.str); } }
/*===================================================================== QGroundControl Open Source Ground Control Station (c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> This file is part of the QGROUNDCONTROL project QGROUNDCONTROL 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. QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. ======================================================================*/ #ifndef MissionControllerManagerTest_H #define MissionControllerManagerTest_H #include "UnitTest.h" #include "MockLink.h" #include "MissionManager.h" #include "MultiSignalSpy.h" #include <QGeoCoordinate> /// This is the base class for the MissionManager and MissionController unit tests. class MissionControllerManagerTest : public UnitTest { Q_OBJECT public: MissionControllerManagerTest(void); protected slots: void cleanup(void); protected: void _initForFirmwareType(MAV_AUTOPILOT firmwareType); void _checkInProgressValues(bool inProgress); MissionManager* _missionManager; typedef struct { int sequenceNumber; QGeoCoordinate coordinate; MAV_CMD command; double param1; double param2; double param3; double param4; bool autocontinue; bool isCurrentItem; MAV_FRAME frame; } ItemInfo_t; typedef struct { const char* itemStream; const ItemInfo_t expectedItem; } TestCase_t; typedef enum { newMissionItemsAvailableSignalIndex = 0, inProgressChangedSignalIndex, errorSignalIndex, maxSignalIndex } MissionManagerSignalIndex_t; typedef enum { newMissionItemsAvailableSignalMask = 1 << newMissionItemsAvailableSignalIndex, inProgressChangedSignalMask = 1 << inProgressChangedSignalIndex, errorSignalMask = 1 << errorSignalIndex, } MissionManagerSignalMask_t; MultiSignalSpy* _multiSpyMissionManager; static const size_t _cMissionManagerSignals = maxSignalIndex; const char* _rgMissionManagerSignals[_cMissionManagerSignals]; static const int _missionManagerSignalWaitTime = MissionManager::_ackTimeoutMilliseconds * MissionManager::_maxRetryCount * 2; }; #endif
/* ---------------------------------------------------------------------------- */ /* Atmel Microcontroller Software Support */ /* SAM Software Package License */ /* ---------------------------------------------------------------------------- */ /* Copyright (c) 2015, Atmel Corporation */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following condition is met: */ /* */ /* - Redistributions of source code must retain the above copyright notice, */ /* this list of conditions and the disclaimer below. */ /* */ /* Atmel's name may not be used to endorse or promote products derived from */ /* this software without specific prior written permission. */ /* */ /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* ---------------------------------------------------------------------------- */ #ifndef _SAMG54_WDT_COMPONENT_ #define _SAMG54_WDT_COMPONENT_ /* ============================================================================= */ /** SOFTWARE API DEFINITION FOR Watchdog Timer */ /* ============================================================================= */ /** \addtogroup SAMG54_WDT Watchdog Timer */ /*@{*/ #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) /** \brief Wdt hardware registers */ typedef struct { __O uint32_t WDT_CR; /**< \brief (Wdt Offset: 0x00) Control Register */ __IO uint32_t WDT_MR; /**< \brief (Wdt Offset: 0x04) Mode Register */ __I uint32_t WDT_SR; /**< \brief (Wdt Offset: 0x08) Status Register */ } Wdt; #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ /* -------- WDT_CR : (WDT Offset: 0x00) Control Register -------- */ #define WDT_CR_WDRSTT (0x1u << 0) /**< \brief (WDT_CR) Watchdog Restart */ #define WDT_CR_KEY_Pos 24 #define WDT_CR_KEY_Msk (0xffu << WDT_CR_KEY_Pos) /**< \brief (WDT_CR) Password. */ #define WDT_CR_KEY(value) ((WDT_CR_KEY_Msk & ((value) << WDT_CR_KEY_Pos))) #define WDT_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (WDT_CR) Writing any other value in this field aborts the write operation. */ /* -------- WDT_MR : (WDT Offset: 0x04) Mode Register -------- */ #define WDT_MR_WDV_Pos 0 #define WDT_MR_WDV_Msk (0xfffu << WDT_MR_WDV_Pos) /**< \brief (WDT_MR) Watchdog Counter Value */ #define WDT_MR_WDV(value) ((WDT_MR_WDV_Msk & ((value) << WDT_MR_WDV_Pos))) #define WDT_MR_WDFIEN (0x1u << 12) /**< \brief (WDT_MR) Watchdog Fault Interrupt Enable */ #define WDT_MR_WDRSTEN (0x1u << 13) /**< \brief (WDT_MR) Watchdog Reset Enable */ #define WDT_MR_WDRPROC (0x1u << 14) /**< \brief (WDT_MR) Watchdog Reset Processor */ #define WDT_MR_WDDIS (0x1u << 15) /**< \brief (WDT_MR) Watchdog Disable */ #define WDT_MR_WDD_Pos 16 #define WDT_MR_WDD_Msk (0xfffu << WDT_MR_WDD_Pos) /**< \brief (WDT_MR) Watchdog Delta Value */ #define WDT_MR_WDD(value) ((WDT_MR_WDD_Msk & ((value) << WDT_MR_WDD_Pos))) #define WDT_MR_WDDBGHLT (0x1u << 28) /**< \brief (WDT_MR) Watchdog Debug Halt */ #define WDT_MR_WDIDLEHLT (0x1u << 29) /**< \brief (WDT_MR) Watchdog Idle Halt */ /* -------- WDT_SR : (WDT Offset: 0x08) Status Register -------- */ #define WDT_SR_WDUNF (0x1u << 0) /**< \brief (WDT_SR) Watchdog Underflow */ #define WDT_SR_WDERR (0x1u << 1) /**< \brief (WDT_SR) Watchdog Error */ /*@}*/ #endif /* _SAMG54_WDT_COMPONENT_ */
//===---------------------- GCNRegPressure.h -*- C++ -*--------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // /// \file // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_AMDGPU_GCNREGPRESSURE_H #define LLVM_LIB_TARGET_AMDGPU_GCNREGPRESSURE_H #include "AMDGPUSubtarget.h" #include <limits> namespace llvm { struct GCNRegPressure { enum RegKind { SGPR32, SGPR_TUPLE, VGPR32, VGPR_TUPLE, TOTAL_KINDS }; GCNRegPressure() { clear(); } bool empty() const { return getSGPRNum() == 0 && getVGPRNum() == 0; } void clear() { std::fill(&Value[0], &Value[TOTAL_KINDS], 0); } unsigned getSGPRNum() const { return Value[SGPR32]; } unsigned getVGPRNum() const { return Value[VGPR32]; } unsigned getVGPRTuplesWeight() const { return Value[VGPR_TUPLE]; } unsigned getSGPRTuplesWeight() const { return Value[SGPR_TUPLE]; } unsigned getOccupancy(const SISubtarget &ST) const { return std::min(ST.getOccupancyWithNumSGPRs(getSGPRNum()), ST.getOccupancyWithNumVGPRs(getVGPRNum())); } void inc(unsigned Reg, LaneBitmask PrevMask, LaneBitmask NewMask, const MachineRegisterInfo &MRI); bool higherOccupancy(const SISubtarget &ST, const GCNRegPressure& O) const { return getOccupancy(ST) > O.getOccupancy(ST); } bool less(const SISubtarget &ST, const GCNRegPressure& O, unsigned MaxOccupancy = std::numeric_limits<unsigned>::max()) const; bool operator==(const GCNRegPressure &O) const { return std::equal(&Value[0], &Value[TOTAL_KINDS], O.Value); } bool operator!=(const GCNRegPressure &O) const { return !(*this == O); } void print(raw_ostream &OS, const SISubtarget *ST=nullptr) const; void dump() const { print(dbgs()); } private: unsigned Value[TOTAL_KINDS]; static unsigned getRegKind(unsigned Reg, const MachineRegisterInfo &MRI); friend GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2); }; inline GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2) { GCNRegPressure Res; for (unsigned I = 0; I < GCNRegPressure::TOTAL_KINDS; ++I) Res.Value[I] = std::max(P1.Value[I], P2.Value[I]); return Res; } class GCNRPTracker { public: typedef DenseMap<unsigned, LaneBitmask> LiveRegSet; protected: LiveRegSet LiveRegs; GCNRegPressure CurPressure, MaxPressure; const MachineInstr *LastTrackedMI = nullptr; mutable const MachineRegisterInfo *MRI = nullptr; GCNRPTracker() {} public: // live regs for the current state const decltype(LiveRegs) &getLiveRegs() const { return LiveRegs; } const MachineInstr *getLastTrackedMI() const { return LastTrackedMI; } // returns MaxPressure, resetting it decltype(MaxPressure) moveMaxPressure() { auto Res = MaxPressure; MaxPressure.clear(); return Res; } decltype(LiveRegs) moveLiveRegs() { return std::move(LiveRegs); } }; class GCNUpwardRPTracker : public GCNRPTracker { const LiveIntervals &LIS; LaneBitmask getDefRegMask(const MachineOperand &MO) const; LaneBitmask getUsedRegMask(const MachineOperand &MO) const; public: GCNUpwardRPTracker(const LiveIntervals &LIS_) : LIS(LIS_) {} // reset tracker to the point just below MI // filling live regs upon this point using LIS void reset(const MachineInstr &MI); // move to the state just above the MI void recede(const MachineInstr &MI); // checks whether the tracker's state after receding MI corresponds // to reported by LIS bool isValid() const; }; LaneBitmask getLiveLaneMask(unsigned Reg, SlotIndex SI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI); GCNRPTracker::LiveRegSet getLiveRegs(SlotIndex SI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI); inline GCNRPTracker::LiveRegSet getLiveRegsAfter(const MachineInstr &MI, const LiveIntervals &LIS) { return getLiveRegs(LIS.getInstructionIndex(MI).getDeadSlot(), LIS, MI.getParent()->getParent()->getRegInfo()); } inline GCNRPTracker::LiveRegSet getLiveRegsBefore(const MachineInstr &MI, const LiveIntervals &LIS) { return getLiveRegs(LIS.getInstructionIndex(MI).getBaseIndex(), LIS, MI.getParent()->getParent()->getRegInfo()); } template <typename Range> GCNRegPressure getRegPressure(const MachineRegisterInfo &MRI, Range &&LiveRegs) { GCNRegPressure Res; for (const auto &RM : LiveRegs) Res.inc(RM.first, LaneBitmask::getNone(), RM.second, MRI); return Res; } void printLivesAt(SlotIndex SI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI); } // End namespace llvm #endif // LLVM_LIB_TARGET_AMDGPU_GCNREGPRESSURE_H
/* mpc_sub_ui -- Add a complex number and an unsigned long int. Copyright (C) INRIA, 2002, 2009 This file is part of the MPC Library. The MPC 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 MPC 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 MPC Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "mpc-impl.h" /* return 0 iff both the real and imaginary parts are exact */ int mpc_sub_ui (mpc_ptr a, mpc_srcptr b, unsigned long int c, mpc_rnd_t rnd) { int inex_re, inex_im; inex_re = mpfr_sub_ui (MPC_RE(a), MPC_RE(b), c, MPC_RND_RE(rnd)); inex_im = mpfr_set (MPC_IM(a), MPC_IM(b), MPC_RND_IM(rnd)); return MPC_INEX(inex_re, inex_im); }
/** * FreeRDP: A Remote Desktop Protocol Implementation * Glyph Cache * * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <winpr/crt.h> #include <winpr/stream.h> #include <freerdp/cache/pointer.h> void update_pointer_position(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position) { } void update_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system) { switch (pointer_system->type) { case SYSPTR_NULL: Pointer_SetNull(context); break; case SYSPTR_DEFAULT: Pointer_SetDefault(context); break; default: fprintf(stderr, "Unknown system pointer type (0x%08X)\n", pointer_system->type); break; } } void update_pointer_color(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color) { rdpPointer* pointer; rdpCache* cache = context->cache; pointer = Pointer_Alloc(context); if (pointer != NULL) { pointer->xorBpp = 24; pointer->xPos = pointer_color->xPos; pointer->yPos = pointer_color->yPos; pointer->width = pointer_color->width; pointer->height = pointer_color->height; pointer->lengthAndMask = pointer_color->lengthAndMask; pointer->lengthXorMask = pointer_color->lengthXorMask; if (pointer->lengthAndMask && pointer_color->xorMaskData) { pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask); CopyMemory(pointer->andMaskData, pointer_color->andMaskData, pointer->lengthAndMask); } if (pointer->lengthXorMask && pointer_color->xorMaskData) { pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask); CopyMemory(pointer->xorMaskData, pointer_color->xorMaskData, pointer->lengthXorMask); } pointer->New(context, pointer); pointer_cache_put(cache->pointer, pointer_color->cacheIndex, pointer); Pointer_Set(context, pointer); } } void update_pointer_new(rdpContext* context, POINTER_NEW_UPDATE* pointer_new) { rdpPointer* pointer; rdpCache* cache = context->cache; pointer = Pointer_Alloc(context); if (pointer != NULL) { pointer->xorBpp = pointer_new->xorBpp; pointer->xPos = pointer_new->colorPtrAttr.xPos; pointer->yPos = pointer_new->colorPtrAttr.yPos; pointer->width = pointer_new->colorPtrAttr.width; pointer->height = pointer_new->colorPtrAttr.height; pointer->lengthAndMask = pointer_new->colorPtrAttr.lengthAndMask; pointer->lengthXorMask = pointer_new->colorPtrAttr.lengthXorMask; pointer->andMaskData = pointer->xorMaskData = NULL; if (pointer->lengthAndMask) { pointer->andMaskData = (BYTE*) malloc(pointer->lengthAndMask); CopyMemory(pointer->andMaskData, pointer_new->colorPtrAttr.andMaskData, pointer->lengthAndMask); } if (pointer->lengthXorMask) { pointer->xorMaskData = (BYTE*) malloc(pointer->lengthXorMask); CopyMemory(pointer->xorMaskData, pointer_new->colorPtrAttr.xorMaskData, pointer->lengthXorMask); } pointer->New(context, pointer); pointer_cache_put(cache->pointer, pointer_new->colorPtrAttr.cacheIndex, pointer); Pointer_Set(context, pointer); } } void update_pointer_cached(rdpContext* context, POINTER_CACHED_UPDATE* pointer_cached) { rdpPointer* pointer; rdpCache* cache = context->cache; pointer = pointer_cache_get(cache->pointer, pointer_cached->cacheIndex); if (pointer != NULL) Pointer_Set(context, pointer); } rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index) { rdpPointer* pointer; if (index >= pointer_cache->cacheSize) { fprintf(stderr, "invalid pointer index:%d\n", index); return NULL; } pointer = pointer_cache->entries[index]; return pointer; } void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer* pointer) { rdpPointer* prevPointer; if (index >= pointer_cache->cacheSize) { fprintf(stderr, "invalid pointer index:%d\n", index); return; } prevPointer = pointer_cache->entries[index]; if (prevPointer != NULL) Pointer_Free(pointer_cache->update->context, prevPointer); pointer_cache->entries[index] = pointer; } void pointer_cache_register_callbacks(rdpUpdate* update) { rdpPointerUpdate* pointer = update->pointer; pointer->PointerPosition = update_pointer_position; pointer->PointerSystem = update_pointer_system; pointer->PointerColor = update_pointer_color; pointer->PointerNew = update_pointer_new; pointer->PointerCached = update_pointer_cached; } rdpPointerCache* pointer_cache_new(rdpSettings* settings) { rdpPointerCache* pointer_cache; pointer_cache = (rdpPointerCache*) malloc(sizeof(rdpPointerCache)); if (pointer_cache != NULL) { ZeroMemory(pointer_cache, sizeof(rdpPointerCache)); pointer_cache->settings = settings; pointer_cache->cacheSize = settings->PointerCacheSize; pointer_cache->update = ((freerdp*) settings->instance)->update; pointer_cache->entries = (rdpPointer**) malloc(sizeof(rdpPointer*) * pointer_cache->cacheSize); ZeroMemory(pointer_cache->entries, sizeof(rdpPointer*) * pointer_cache->cacheSize); } return pointer_cache; } void pointer_cache_free(rdpPointerCache* pointer_cache) { if (pointer_cache != NULL) { int i; rdpPointer* pointer; for (i = 0; i < (int) pointer_cache->cacheSize; i++) { pointer = pointer_cache->entries[i]; if (pointer != NULL) { Pointer_Free(pointer_cache->update->context, pointer); pointer_cache->entries[i] = NULL; } } free(pointer_cache->entries); free(pointer_cache); } }
/* n_2.c: Line splicing by <backslash><newline> sequence. */ #include "defs.h" main( void) { int ab = 1, cd = 2, ef = 3, abcde = 5; fputs( "started\n", stderr); /* 2.1: In a #define directive line, between the parameter list and the replacement text. */ #define FUNC( a, b, c) \ a + b + c assert( FUNC( ab, cd, ef) == 6); /* 2.2: In a #define directive line, among the parameter list and among the replacement text. */ #undef FUNC #define FUNC( a, b \ , c) \ a + b \ + c assert (FUNC( ab, cd, ef) == 6); /* 2.3: In a string literal. */ assert (strcmp( "abc\ de", "abcde") == 0); /* 2.4: <backslash><newline> in midst of an identifier. */ assert( abc\ de == 5); /* 2.5: <backslash><newline> by trigraph. */ assert( abc??/ de == 5); fputs( "success\n", stderr); return 0; }
/* Copyright (c) 2014, Vsevolod Stakhov * 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. * * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL 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. */ #ifndef LUA_UCL_H_ #define LUA_UCL_H_ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <lua.h> #include <lauxlib.h> #include <lualib.h> #include "ucl.h" /** * Closure structure for lua function storing inside UCL */ struct ucl_lua_funcdata { lua_State *L; int idx; char *ret; }; /** * Initialize lua UCL API */ UCL_EXTERN int luaopen_ucl (lua_State *L); /** * Import UCL object from lua state * @param L lua state * @param idx index of object at the lua stack to convert to UCL * @return new UCL object or NULL, the caller should unref object after using */ UCL_EXTERN ucl_object_t* ucl_object_lua_import (lua_State *L, int idx); /** * Import UCL object from lua state, escaping JSON strings * @param L lua state * @param idx index of object at the lua stack to convert to UCL * @return new UCL object or NULL, the caller should unref object after using */ UCL_EXTERN ucl_object_t* ucl_object_lua_import_escape (lua_State *L, int idx); /** * Push an object to lua * @param L lua state * @param obj object to push * @param allow_array traverse over implicit arrays */ UCL_EXTERN int ucl_object_push_lua (lua_State *L, const ucl_object_t *obj, bool allow_array); UCL_EXTERN struct ucl_lua_funcdata* ucl_object_toclosure ( const ucl_object_t *obj); #endif /* LUA_UCL_H_ */
/* * libjingle * Copyright 2004--2005, Google Inc. * * 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. */ #ifndef _SESSIONDESCRIPTION_H_ #define _SESSIONDESCRIPTION_H_ namespace cricket { // The client overrides this with whatever class SessionDescription { public: virtual ~SessionDescription() {} }; } // namespace cricket #endif // _SESSIONDESCRIPTION_H_
/* * Copyright (c) 2007, Michael Lehn * * 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 FLENS development group nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FLENS_TYPEINFO_H #define FLENS_TYPEINFO_H 1 namespace flens { template <typename A> struct TypeInfo { typedef A Impl; }; } // namespace flens #endif // FLENS_TYPEINFO_H
// Copyright 2017 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 SERVICES_SHAPE_DETECTION_FACE_DETECTION_IMPL_WIN_H_ #define SERVICES_SHAPE_DETECTION_FACE_DETECTION_IMPL_WIN_H_ #include <windows.foundation.collections.h> #include <windows.foundation.h> #include <windows.graphics.imaging.h> #include <windows.media.faceanalysis.h> #include <wrl/client.h> #include <memory> #include <utility> #include <vector> #include "base/memory/weak_ptr.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "services/shape_detection/public/mojom/facedetection.mojom.h" class SkBitmap; namespace shape_detection { class FaceDetectionImplWin : public mojom::FaceDetection { public: FaceDetectionImplWin( Microsoft::WRL::ComPtr<ABI::Windows::Media::FaceAnalysis::IFaceDetector> face_detector, Microsoft::WRL::ComPtr< ABI::Windows::Graphics::Imaging::ISoftwareBitmapStatics> bitmap_factory, ABI::Windows::Graphics::Imaging::BitmapPixelFormat pixel_format); FaceDetectionImplWin(const FaceDetectionImplWin&) = delete; FaceDetectionImplWin& operator=(const FaceDetectionImplWin&) = delete; ~FaceDetectionImplWin() override; void SetReceiver(mojo::SelfOwnedReceiverRef<mojom::FaceDetection> receiver) { receiver_ = std::move(receiver); } // mojom::FaceDetection implementation. void Detect(const SkBitmap& bitmap, mojom::FaceDetection::DetectCallback callback) override; private: HRESULT BeginDetect(const SkBitmap& bitmap); std::vector<mojom::FaceDetectionResultPtr> BuildFaceDetectionResult( Microsoft::WRL::ComPtr<ABI::Windows::Foundation::Collections::IVector< ABI::Windows::Media::FaceAnalysis::DetectedFace*>> result); void OnFaceDetected( Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Imaging::ISoftwareBitmap> win_bitmap, Microsoft::WRL::ComPtr<ABI::Windows::Foundation::Collections::IVector< ABI::Windows::Media::FaceAnalysis::DetectedFace*>> result); Microsoft::WRL::ComPtr<ABI::Windows::Media::FaceAnalysis::IFaceDetector> face_detector_; Microsoft::WRL::ComPtr< ABI::Windows::Graphics::Imaging::ISoftwareBitmapStatics> bitmap_factory_; ABI::Windows::Graphics::Imaging::BitmapPixelFormat pixel_format_; DetectCallback detected_face_callback_; mojo::SelfOwnedReceiverRef<mojom::FaceDetection> receiver_; base::WeakPtrFactory<FaceDetectionImplWin> weak_factory_{this}; }; } // namespace shape_detection #endif // SERVICES_SHAPE_DETECTION_FACE_DETECTION_IMPL_WIN_H_
// Copyright 2018 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 BASE_TASK_SEQUENCE_MANAGER_TIME_DOMAIN_H_ #define BASE_TASK_SEQUENCE_MANAGER_TIME_DOMAIN_H_ #include "base/check.h" #include "base/task/sequence_manager/lazy_now.h" #include "base/task/sequence_manager/tasks.h" #include "base/time/tick_clock.h" #include "base/values.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace base { namespace sequence_manager { class SequenceManager; namespace internal { class SequenceManagerImpl; } // namespace internal // TimeDomain allows subclasses to enable clock overriding // (e.g. auto-advancing virtual time, throttled clock, etc). class BASE_EXPORT TimeDomain : public TickClock { public: TimeDomain(const TimeDomain&) = delete; TimeDomain& operator=(const TimeDomain&) = delete; ~TimeDomain() override = default; // Invoked when the thread reaches idle. Gives an opportunity to a virtual // time domain impl to fast-forward time and return true to indicate that // there's more work to run. If RunLoop::QuitWhenIdle has been called then // `quit_when_idle_requested` will be true. virtual bool MaybeFastForwardToWakeUp(absl::optional<WakeUp> next_wake_up, bool quit_when_idle_requested) = 0; // Debug info. Value AsValue() const; protected: TimeDomain() = default; virtual const char* GetName() const = 0; // Tells SequenceManager that internal policy might have changed to // re-evaluate MaybeFastForwardToWakeUp(). void NotifyPolicyChanged(); // Called when the TimeDomain is assigned to a SequenceManagerImpl. // `sequence_manager` is expected to be valid for the duration of TimeDomain's // existence. TODO(scheduler-dev): Pass SequenceManager in the constructor. void OnAssignedToSequenceManager( internal::SequenceManagerImpl* sequence_manager); private: friend class internal::SequenceManagerImpl; internal::SequenceManagerImpl* sequence_manager_ = nullptr; // Not owned. }; } // namespace sequence_manager } // namespace base #endif // BASE_TASK_SEQUENCE_MANAGER_TIME_DOMAIN_H_
// 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 ASH_COMPONENTS_PHONEHUB_FAKE_TETHER_CONTROLLER_H_ #define ASH_COMPONENTS_PHONEHUB_FAKE_TETHER_CONTROLLER_H_ #include "ash/components/phonehub/tether_controller.h" namespace ash { namespace phonehub { class FakeTetherController : public TetherController { public: FakeTetherController(); ~FakeTetherController() override; using TetherController::NotifyAttemptConnectionScanFailed; void SetStatus(Status status); size_t num_scan_for_available_connection_calls() { return num_scan_for_available_connection_calls_; } // TetherController: Status GetStatus() const override; void ScanForAvailableConnection() override; private: // TetherController: void AttemptConnection() override; void Disconnect() override; Status status_; size_t num_scan_for_available_connection_calls_ = 0; }; } // namespace phonehub } // namespace ash #endif // ASH_COMPONENTS_PHONEHUB_FAKE_TETHER_CONTROLLER_H_
/* Copyright (c) by respective owners including Yahoo!, Microsoft, and individual contributors. All rights reserved. Released under a BSD license as described in the file LICENSE. */ #pragma once #ifdef __FreeBSD__ #include <sys/socket.h> #endif #include "parse_regressor.h" #include "constant.h" #include "interactions.h" namespace GD { LEARNER::base_learner* setup(vw& all); struct gd; float finalize_prediction(shared_data* sd, float ret); void print_audit_features(vw&, example& ec); void save_load_regressor(vw& all, io_buf& model_file, bool read, bool text); void save_load_online_state(vw& all, io_buf& model_file, bool read, bool text, GD::gd *g = nullptr); struct multipredict_info { size_t count; size_t step; polyprediction* pred; regressor* reg; /* & for l1: */ float gravity; }; inline void vec_add_multipredict(multipredict_info& mp, const float fx, uint64_t fi) { if ((-1e-10 < fx) && (fx < 1e-10)) return; weight*w = mp.reg->weight_vector; uint64_t mask = mp.reg->weight_mask; polyprediction* p = mp.pred; fi &= mask; uint64_t top = fi + (uint64_t)((mp.count-1) * mp.step); if (top <= mask) { weight* last = w + top; w += fi; for (; w <= last; w += mp.step, ++p) p->scalar += fx **w; } else // TODO: this could be faster by unrolling into two loops for (size_t c=0; c<mp.count; ++c, fi += (uint64_t)mp.step, ++p) { fi &= mask; p->scalar += fx * w[fi]; } } // iterate through one namespace (or its part), callback function T(some_data_R, feature_value_x, feature_weight) template <class R, void (*T)(R&, const float, float&)> inline void foreach_feature(weight* weight_vector, uint64_t weight_mask, features& fs, R& dat, uint64_t offset=0, float mult=1.) { for (features::iterator& f : fs) T(dat, mult*f.value(), weight_vector[(f.index() + offset) & weight_mask]); } // iterate through one namespace (or its part), callback function T(some_data_R, feature_value_x, feature_index) template <class R, void (*T)(R&, float, uint64_t)> void foreach_feature(weight* /*weight_vector*/, uint64_t /*weight_mask*/, features& fs, R&dat, uint64_t offset=0, float mult=1.) { for (features::iterator& f : fs) T(dat, mult*f.value(), f.index() + offset); } // iterate through all namespaces and quadratic&cubic features, callback function T(some_data_R, feature_value_x, S) // where S is EITHER float& feature_weight OR uint64_t feature_index template <class R, class S, void (*T)(R&, float, S)> inline void foreach_feature(vw& all, example& ec, R& dat) { uint64_t offset = ec.ft_offset; for (features& f : ec) foreach_feature<R,T>(all.reg.weight_vector, all.reg.weight_mask, f, dat, offset); INTERACTIONS::generate_interactions<R,S,T>(all, ec, dat); } // iterate through all namespaces and quadratic&cubic features, callback function T(some_data_R, feature_value_x, feature_weight) template <class R, void (*T)(R&, float, float&)> inline void foreach_feature(vw& all, example& ec, R& dat) { foreach_feature<R,float&,T>(all, ec, dat); } inline void vec_add(float& p, const float fx, float& fw) { p += fw * fx; } inline float inline_predict(vw& all, example& ec) { float temp = ec.l.simple.initial; foreach_feature<float, vec_add>(all, ec, temp); return temp; } }
/*************************************************************************/ /* joypad_osx.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 JOYPADOSX_H #define JOYPADOSX_H #ifdef MACOS_10_0_4 #include <IOKit/hidsystem/IOHIDUsageTables.h> #else #include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h> #endif #include <ForceFeedback/ForceFeedback.h> #include <ForceFeedback/ForceFeedbackConstants.h> #include <IOKit/hid/IOHIDLib.h> #include "core/input/input.h" struct rec_element { IOHIDElementRef ref; IOHIDElementCookie cookie; uint32_t usage = 0; int min = 0; int max = 0; struct Comparator { bool operator()(const rec_element p_a, const rec_element p_b) const { return p_a.usage < p_b.usage; } }; }; struct joypad { IOHIDDeviceRef device_ref = nullptr; Vector<rec_element> axis_elements; Vector<rec_element> button_elements; Vector<rec_element> hat_elements; int id = 0; io_service_t ffservice = 0; /* Interface for force feedback, 0 = no ff */ FFCONSTANTFORCE ff_constant_force; FFDeviceObjectReference ff_device; FFEffectObjectReference ff_object; uint64_t ff_timestamp = 0; LONG *ff_directions = nullptr; FFEFFECT ff_effect; DWORD *ff_axes = nullptr; void add_hid_elements(CFArrayRef p_array); void add_hid_element(IOHIDElementRef p_element); bool has_element(IOHIDElementCookie p_cookie, Vector<rec_element> *p_list) const; bool config_force_feedback(io_service_t p_service); bool check_ff_features(); int get_hid_element_state(rec_element *p_element) const; void free(); joypad(); }; class JoypadOSX { enum { JOYPADS_MAX = 16, }; private: Input *input; IOHIDManagerRef hid_manager; Vector<joypad> device_list; bool have_device(IOHIDDeviceRef p_device) const; bool configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy); int get_joy_index(int p_id) const; int get_joy_ref(IOHIDDeviceRef p_device) const; void poll_joypads() const; void setup_joypad_objects(); void config_hid_manager(CFArrayRef p_matching_array) const; void joypad_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp); void joypad_vibration_stop(int p_id, uint64_t p_timestamp); public: void process_joypads(); void _device_added(IOReturn p_res, IOHIDDeviceRef p_device); void _device_removed(IOReturn p_res, IOHIDDeviceRef p_device); JoypadOSX(Input *in); ~JoypadOSX(); }; #endif // JOYPADOSX_H
/*************************************************************************/ /* platform_config.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2018 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. */ /*************************************************************************/ #ifdef __linux__ #include <alloca.h> #endif #if defined(__FreeBSD__) || defined(__OpenBSD__) #include <stdlib.h> #define PTHREAD_BSD_SET_NAME #endif #define GLES3_INCLUDE_H "thirdparty/glad/glad/glad.h" #define GLES2_INCLUDE_H "thirdparty/glad/glad/glad.h"
/*- * BSD LICENSE * * Copyright(c) 2010-2014 Intel Corporation. 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 of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <fcntl.h> #include <stdio.h> #include <termios.h> #include <unistd.h> #include <sys/mman.h> #include <rte_eal.h> #include <rte_log.h> #include <rte_memzone.h> #include <cmdline_rdline.h> #include <cmdline_parse.h> #include <cmdline_socket.h> #include <cmdline.h> #include "qwctl.h" #include "commands.h" #include "../include/conf.h" int *quota; unsigned int *low_watermark; unsigned int *high_watermark; static void setup_shared_variables(void) { const struct rte_memzone *qw_memzone; qw_memzone = rte_memzone_lookup(QUOTA_WATERMARK_MEMZONE_NAME); if (qw_memzone == NULL) rte_exit(EXIT_FAILURE, "Couldn't find memzone\n"); quota = qw_memzone->addr; low_watermark = (unsigned int *) qw_memzone->addr + 1; high_watermark = (unsigned int *) qw_memzone->addr + 2; } int main(int argc, char **argv) { int ret; struct cmdline *cl; rte_log_set_global_level(RTE_LOG_INFO); ret = rte_eal_init(argc, argv); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot initialize EAL\n"); setup_shared_variables(); cl = cmdline_stdin_new(qwctl_ctx, "qwctl> "); if (cl == NULL) rte_exit(EXIT_FAILURE, "Cannot create cmdline instance\n"); cmdline_interact(cl); cmdline_stdin_exit(cl); return 0; }
// // MPGlobal.h // MoPub // // Copyright 2011 MoPub, Inc. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #ifndef MP_ANIMATED #define MP_ANIMATED YES #endif UIInterfaceOrientation MPInterfaceOrientation(void); UIWindow *MPKeyWindow(void); CGFloat MPStatusBarHeight(void); CGRect MPApplicationFrame(void); CGRect MPScreenBounds(void); CGSize MPScreenResolution(void); CGFloat MPDeviceScaleFactor(void); NSDictionary *MPDictionaryFromQueryString(NSString *query); NSString *MPSHA1Digest(NSString *string); BOOL MPViewIsVisible(UIView *view); BOOL MPViewIntersectsParentWindowWithPercent(UIView *view, CGFloat percentVisible); NSString *MPResourcePathForResource(NSString *resourceName); //////////////////////////////////////////////////////////////////////////////////////////////////// /* * Availability constants. */ #define MP_IOS_2_0 20000 #define MP_IOS_2_1 20100 #define MP_IOS_2_2 20200 #define MP_IOS_3_0 30000 #define MP_IOS_3_1 30100 #define MP_IOS_3_2 30200 #define MP_IOS_4_0 40000 #define MP_IOS_4_1 40100 #define MP_IOS_4_2 40200 #define MP_IOS_4_3 40300 #define MP_IOS_5_0 50000 #define MP_IOS_5_1 50100 #define MP_IOS_6_0 60000 #define MP_IOS_7_0 70000 //////////////////////////////////////////////////////////////////////////////////////////////////// enum { MPInterstitialCloseButtonStyleAlwaysVisible, MPInterstitialCloseButtonStyleAlwaysHidden, MPInterstitialCloseButtonStyleAdControlled }; typedef NSUInteger MPInterstitialCloseButtonStyle; enum { MPInterstitialOrientationTypePortrait, MPInterstitialOrientationTypeLandscape, MPInterstitialOrientationTypeAll }; typedef NSUInteger MPInterstitialOrientationType; //////////////////////////////////////////////////////////////////////////////////////////////////// @interface NSString (MPAdditions) /* * Returns string with reserved/unsafe characters encoded. */ - (NSString *)URLEncodedString; @end //////////////////////////////////////////////////////////////////////////////////////////////////// @interface UIDevice (MPAdditions) - (NSString *)hardwareDeviceName; @end //////////////////////////////////////////////////////////////////////////////////////////////////// @interface UIApplication (MPAdditions) // Correct way to hide/show the status bar on pre-ios 7. - (void)mp_preIOS7setApplicationStatusBarHidden:(BOOL)hidden; - (BOOL)mp_supportsOrientationMask:(UIInterfaceOrientationMask)orientationMask; - (BOOL)mp_doesOrientation:(UIInterfaceOrientation)orientation matchOrientationMask:(UIInterfaceOrientationMask)orientationMask; @end //////////////////////////////////////////////////////////////////////////////////////////////////// // Optional Class Forward Def Protocols //////////////////////////////////////////////////////////////////////////////////////////////////// @class MPAdConfiguration, CLLocation; @protocol MPAdAlertManagerProtocol <NSObject> @property (nonatomic, strong) MPAdConfiguration *adConfiguration; @property (nonatomic, copy) NSString *adUnitId; @property (nonatomic, copy) CLLocation *location; @property (nonatomic, weak) UIView *targetAdView; @property (nonatomic, weak) id delegate; - (void)beginMonitoringAlerts; - (void)endMonitoringAlerts; - (void)processAdAlertOnce; @end //////////////////////////////////////////////////////////////////////////////////////////////////// // Small alert wrapper class to handle telephone protocol prompting //////////////////////////////////////////////////////////////////////////////////////////////////// @class MPTelephoneConfirmationController; typedef void (^MPTelephoneConfirmationControllerClickHandler)(NSURL *targetTelephoneURL, BOOL confirmed); @interface MPTelephoneConfirmationController : NSObject <UIAlertViewDelegate> - (id)initWithURL:(NSURL *)url clickHandler:(MPTelephoneConfirmationControllerClickHandler)clickHandler; - (void)show; @end
/* add cypress new driver ttda-02.03.01.476713 */ /* * cyttsp4_mt_common.h * Cypress TrueTouch(TM) Standard Product V4 Multi-touch module. * For use with Cypress Txx4xx parts. * Supported parts include: * TMA4XX * TMA1036 * * Copyright (C) 2012 Cypress Semiconductor * Copyright (C) 2011 Sony Ericsson Mobile Communications AB. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2, and only version 2, as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contact Cypress Semiconductor at www.cypress.com <ttdrivers@cypress.com> * */ #include <linux/cyttsp4_bus.h> #include <linux/delay.h> #ifdef CONFIG_HAS_EARLYSUSPEND #include <linux/earlysuspend.h> #endif #include <linux/gpio.h> #include <linux/input.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/limits.h> #include <linux/module.h> #include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/workqueue.h> #include <linux/cyttsp4_core.h> #include <linux/cyttsp4_mt.h> #include "cyttsp4_regs.h" struct cyttsp4_mt_data; struct cyttsp4_mt_function { int (*mt_release)(struct cyttsp4_device *ttsp); int (*mt_probe)(struct cyttsp4_device *ttsp, struct cyttsp4_mt_data *md); void (*report_slot_liftoff)(struct cyttsp4_mt_data *md, int max_slots); void (*input_sync)(struct input_dev *input); void (*input_report)(struct input_dev *input, int sig, int t, int type); void (*final_sync)(struct input_dev *input, int max_slots, int mt_sync_count, unsigned long *ids); int (*input_register_device)(struct input_dev *input, int max_slots); }; struct cyttsp4_mt_data { struct cyttsp4_device *ttsp; struct cyttsp4_mt_platform_data *pdata; struct cyttsp4_sysinfo *si; struct input_dev *input; struct cyttsp4_mt_function mt_function; #ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend es; #endif struct mutex report_lock; bool is_suspended; bool input_device_registered; char phys[NAME_MAX]; int num_prv_rec; /* Number of previous touch records */ int prv_tch_type; #ifdef VERBOSE_DEBUG u8 pr_buf[CY_MAX_PRBUF_SIZE]; #endif }; extern void cyttsp4_init_function_ptrs(struct cyttsp4_mt_data *md); extern struct cyttsp4_driver cyttsp4_mt_driver;
/* * libopenemv - a library to work with EMV family of smart cards * Copyright (C) 2015 Dmitry Eremin-Solenikov * * 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. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "crypto.h" #include "crypto_backend.h" #include <string.h> static struct crypto_backend *crypto_backend; static bool crypto_init(void) { if (crypto_backend) return true; crypto_backend = crypto_polarssl_init(); if (!crypto_backend) return false; return true; } struct crypto_hash *crypto_hash_open(enum crypto_algo_hash hash) { struct crypto_hash *ch; if (!crypto_init()) return NULL; ch = crypto_backend->hash_open(hash); if (ch) ch->algo = hash; return ch; } void crypto_hash_close(struct crypto_hash *ch) { ch->close(ch); } void crypto_hash_write(struct crypto_hash *ch, const unsigned char *buf, size_t len) { ch->write(ch, buf, len); } unsigned char *crypto_hash_read(struct crypto_hash *ch) { return ch->read(ch); } size_t crypto_hash_get_size(const struct crypto_hash *ch) { return ch->get_size(ch); } struct crypto_pk *crypto_pk_open(enum crypto_algo_pk pk, ...) { struct crypto_pk *cp; va_list vl; if (!crypto_init()) return NULL; va_start(vl, pk); cp = crypto_backend->pk_open(pk, vl); va_end(vl); if (cp) cp->algo = pk; return cp; } struct crypto_pk *crypto_pk_open_priv(enum crypto_algo_pk pk, ...) { struct crypto_pk *cp; va_list vl; if (!crypto_init()) return NULL; if (!crypto_backend->pk_open_priv) return NULL; va_start(vl, pk); cp = crypto_backend->pk_open_priv(pk, vl); va_end(vl); if (cp) cp->algo = pk; return cp; } struct crypto_pk *crypto_pk_genkey(enum crypto_algo_pk pk, ...) { struct crypto_pk *cp; va_list vl; if (!crypto_init()) return NULL; if (!crypto_backend->pk_genkey) return NULL; va_start(vl, pk); cp = crypto_backend->pk_genkey(pk, vl); va_end(vl); if (cp) cp->algo = pk; return cp; } void crypto_pk_close(struct crypto_pk *cp) { cp->close(cp); } unsigned char *crypto_pk_encrypt(const struct crypto_pk *cp, const unsigned char *buf, size_t len, size_t *clen) { return cp->encrypt(cp, buf, len, clen); } unsigned char *crypto_pk_decrypt(const struct crypto_pk *cp, const unsigned char *buf, size_t len, size_t *clen) { if (!cp->decrypt) { *clen = 0; return NULL; } return cp->decrypt(cp, buf, len, clen); } enum crypto_algo_pk crypto_pk_get_algo(const struct crypto_pk *cp) { if (!cp) return PK_INVALID; return cp->algo; } size_t crypto_pk_get_nbits(const struct crypto_pk *cp) { if (!cp->get_nbits) return 0; return cp->get_nbits(cp); } unsigned char *crypto_pk_get_parameter(const struct crypto_pk *cp, unsigned param, size_t *plen) { *plen = 0; if (!cp->get_parameter) return NULL; return cp->get_parameter(cp, param, plen); }
#define CONFIG_CLEAN_COMPILE 1
/* This file is part of the program GDB, the GNU debugger. Copyright (C) 1998 Free Software Foundation, Inc. Contributed by Cygnus Solutions. 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 "sim-main.h" #include "hw-main.h" /* DEVICE tx3904cpu - tx3904 cpu virtual device DESCRIPTION Implements the external tx3904 functionality. This includes the delivery of of interrupts generated from other devices and the handling of device specific registers. PROPERTIES none PORTS reset (input) Currently ignored. nmi (input) Deliver a non-maskable interrupt to the processor. level (input) Deliver a maskable interrupt of given level, corresponding to IP[5:0], to processor. BUGS When delivering an interrupt, this code assumes that there is only one processor (number 0). This code does not attempt to be efficient at handling pending interrupts. It simply schedules the interrupt delivery handler every instruction cycle until all pending interrupts go away. An alternative implementation might modify instructions that change the PSW and have them check to see if the change makes an interrupt delivery possible. */ struct tx3904cpu { /* Pending interrupts for delivery by event handler */ int pending_reset, pending_nmi, pending_level; struct hw_event* event; }; /* input port ID's */ enum { RESET_PORT, NMI_PORT, LEVEL_PORT, }; static const struct hw_port_descriptor tx3904cpu_ports[] = { /* interrupt inputs */ { "reset", RESET_PORT, 0, input_port, }, { "nmi", NMI_PORT, 0, input_port, }, { "level", LEVEL_PORT, 0, input_port, }, { NULL, }, }; /* Finish off the partially created hw device. Attach our local callbacks. Wire up our port names etc */ static hw_port_event_method tx3904cpu_port_event; static void tx3904cpu_finish (struct hw *me) { struct tx3904cpu *controller; controller = HW_ZALLOC (me, struct tx3904cpu); set_hw_data (me, controller); set_hw_ports (me, tx3904cpu_ports); set_hw_port_event (me, tx3904cpu_port_event); /* Initialize the pending interrupt flags */ controller->pending_level = 0; controller->pending_reset = 0; controller->pending_nmi = 0; controller->event = NULL; } /* An event arrives on an interrupt port */ static void deliver_tx3904cpu_interrupt (struct hw *me, void *data) { struct tx3904cpu *controller = hw_data (me); SIM_DESC sd = hw_system (me); sim_cpu *cpu = STATE_CPU (sd, 0); /* NB: fix CPU 0. */ address_word cia = CIA_GET (cpu); #define CPU cpu #define SD current_state if (controller->pending_reset) { controller->pending_reset = 0; HW_TRACE ((me, "reset pc=0x%08lx", (long) CIA_GET (cpu))); SignalExceptionNMIReset(); } else if (controller->pending_nmi) { controller->pending_nmi = 0; HW_TRACE ((me, "nmi pc=0x%08lx", (long) CIA_GET (cpu))); SignalExceptionNMIReset(); } else if (controller->pending_level) { HW_TRACE ((me, "interrupt level=%d pc=0x%08lx sr=0x%08lx", controller->pending_level, (long) CIA_GET (cpu), (long) SR)); /* Clear CAUSE register. It may stay this way if the interrupt was cleared with a negative pending_level. */ CAUSE &= ~ (cause_IP_mask << cause_IP_shift); if(controller->pending_level > 0) /* interrupt set */ { /* set hardware-interrupt subfields of CAUSE register */ CAUSE |= (controller->pending_level & cause_IP_mask) << cause_IP_shift; /* check for enabled / unmasked interrupts */ if((SR & status_IEc) && (controller->pending_level & ((SR >> status_IM_shift) & status_IM_mask))) { controller->pending_level = 0; SignalExceptionInterrupt(0 /* dummy value */); } else { /* reschedule soon */ if(controller->event != NULL) hw_event_queue_deschedule(me, controller->event); controller->event = hw_event_queue_schedule (me, 1, deliver_tx3904cpu_interrupt, NULL); } } /* interrupt set */ } #undef CPU cpu #undef SD current_state } static void tx3904cpu_port_event (struct hw *me, int my_port, struct hw *source, int source_port, int level) { struct tx3904cpu *controller = hw_data (me); switch (my_port) { case RESET_PORT: controller->pending_reset = 1; HW_TRACE ((me, "port-in reset")); break; case NMI_PORT: controller->pending_nmi = 1; HW_TRACE ((me, "port-in nmi")); break; case LEVEL_PORT: /* level == 0 means that the interrupt was cleared */ if(level == 0) controller->pending_level = -1; /* signal end of interrupt */ else controller->pending_level = level; HW_TRACE ((me, "port-in level=%d", level)); break; default: hw_abort (me, "bad switch"); break; } /* Schedule an event to be delivered immediately after current instruction. */ if(controller->event != NULL) hw_event_queue_deschedule(me, controller->event); controller->event = hw_event_queue_schedule (me, 0, deliver_tx3904cpu_interrupt, NULL); } const struct hw_descriptor dv_tx3904cpu_descriptor[] = { { "tx3904cpu", tx3904cpu_finish, }, { NULL }, };
/* { dg-do run } */ /* { dg-options "-O2 -mavx512dq" } */ /* { dg-require-effective-target avx512dq } */ #define AVX512DQ #include "avx512f-helper.h" #define SIZE (AVX512F_LEN / 32) #include "avx512f-mask-type.h" #define IMM 0x23 void CALC (float *s, float *r) { int i; for (i = 0; i < SIZE; i++) { float tmp = (int) (4 * s[i]) / 4.0; r[i] = s[i] - tmp; } } void TEST (void) { UNION_TYPE (AVX512F_LEN,) s, res1, res2, res3; MASK_TYPE mask = MASK_VALUE; float res_ref[SIZE]; int i, sign = 1; for (i = 0; i < SIZE; i++) { s.a[i] = 123.456 * (i + 2000) * sign; res2.a[i] = DEFAULT_VALUE; sign = -sign; } res1.x = INTRINSIC (_reduce_round_ps) (s.x, IMM, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); res2.x = INTRINSIC (_mask_reduce_round_ps) (res2.x, mask, s.x, IMM, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); res3.x = INTRINSIC (_maskz_reduce_round_ps) (mask, s.x, IMM, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); CALC (s.a, res_ref); if (UNION_FP_CHECK (AVX512F_LEN,) (res1, res_ref)) abort (); MASK_MERGE () (res_ref, mask, SIZE); if (UNION_FP_CHECK (AVX512F_LEN,) (res2, res_ref)) abort (); MASK_ZERO () (res_ref, mask, SIZE); if (UNION_FP_CHECK (AVX512F_LEN,) (res3, res_ref)) abort (); }
/* * * Copyright 2012 Blur Studio Inc. * * This file is part of libstone. * * libstone 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. * * libstone 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 libstone; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* * $Id$ */ #ifndef GRAPHITE_PRIVATE_H #define GRAPHITE_PRIVATE_H #include <qdatetime.h> #include <qlist.h> #include <qmutex.h> #include <qstring.h> #include <qthread.h> class QTcpSocket; class GraphiteDataPoint; class GraphiteSender : public QObject { Q_OBJECT public: GraphiteSender( const QString & host, quint16 port ); ~GraphiteSender(); public slots: void sendQueuedDataPoints(); protected: void connectSocket(); bool event( QEvent * ); QTcpSocket * mSocket; QString mGraphiteHost; quint16 mGraphitePort; }; class GraphiteThread : public QThread { Q_OBJECT public: GraphiteThread(); ~GraphiteThread(); // Thread safe functions void record( const QString & path, double value, const QDateTime & timestamp ); bool hasQueuedRecords(); GraphiteDataPoint popQueuedRecord(); static GraphiteThread * instance(); protected: void run(); static GraphiteThread * mThread; QString mGraphiteHost; quint16 mGraphitePort; GraphiteSender * mSender; QMutex mQueueMutex; QList<GraphiteDataPoint> mQueue; friend class GraphiteSender; }; #endif // GRAPHITE_PRIVATE_H
/* * Copyright 2010-2015 OpenXcom Developers. * * This file is part of OpenXcom. * * OpenXcom 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. * * OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OPENXCOM_TRANSFERCONFIRMSTATE_H #define OPENXCOM_TRANSFERCONFIRMSTATE_H #include "../Engine/State.h" namespace OpenXcom { class TextButton; class Window; class Text; class TransferItemsState; class Base; /** * Window to confirm a transfer between bases. */ class TransferConfirmState : public State { private: TextButton *_btnCancel, *_btnOk; Window *_window; Text *_txtTitle, *_txtCost, *_txtTotal; Base *_base; TransferItemsState *_state; public: /// Creates the Transfer Confirm state. TransferConfirmState(Base *base, TransferItemsState *state); /// Cleans up the Transfer Confirm state. ~TransferConfirmState(); /// Handler for clicking the Cancel button. void btnCancelClick(Action *action); /// Handler for clicking the OK button. void btnOkClick(Action *action); }; } #endif
#include "f2c.h" #ifdef KR_headers double exp(); double d_exp(x) doublereal *x; #else #undef abs #include "math.h" double d_exp(doublereal *x) #endif { return( exp(*x) ); }
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2013 - Hans-Kristian Arntzen * Copyright (C) 2011-2013 - Daniel De Matteis * Copyright (C) 2012 - Michael Lelli * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef _GX_VIDEO_H__ #define _GX_VIDEO_H__ typedef struct gx_video { bool should_resize; bool keep_aspect; bool double_strike; bool rgb32; uint32_t *menu_data; // FIXME: Should be const uint16_t*. bool rgui_texture_enable; rarch_viewport_t vp; unsigned scale; } gx_video_t; void gx_set_video_mode(unsigned fbWidth, unsigned lines); const char *gx_get_video_mode(void); #endif
#pragma once #include <windows.h> #include<string> using namespace std; #ifdef __cplusplus #define EXTERNC extern "C" #else #define EXTERNC #endif typedef struct sharp_content_s { int page; PCWSTR string_margin; } sharp_content_t; #define SYMBOL_DECLSPEC __declspec(dllexport) EXTERN_C SYMBOL_DECLSPEC void* __stdcall mInitialize(); EXTERN_C SYMBOL_DECLSPEC void __stdcall mCleanUp(void *ctx); EXTERN_C SYMBOL_DECLSPEC int __stdcall mGetPageCount(void *ctx); EXTERN_C SYMBOL_DECLSPEC bool __stdcall mRequiresPassword(void *ctx); EXTERN_C SYMBOL_DECLSPEC bool __stdcall mApplyPassword(void *ctx, PCWSTR password); EXTERN_C SYMBOL_DECLSPEC int __stdcall mOpenDocument(void *ctx, PCWSTR filename); EXTERN_C SYMBOL_DECLSPEC int __stdcall mMeasurePage(void *ctx, int page_num, double *width, double *height); EXTERN_C SYMBOL_DECLSPEC int __stdcall mRenderPage(void *ctx, int page_num, byte *bmp_data, int bmp_width, int bmp_height, double scale, bool flipy); EXTERN_C SYMBOL_DECLSPEC int __stdcall mGetContents(void *ctx); EXTERN_C SYMBOL_DECLSPEC char* __stdcall mGetContentsItem(int k, int *len, int *page); EXTERN_C SYMBOL_DECLSPEC void __stdcall mReleaseContents(); EXTERN_C SYMBOL_DECLSPEC int __stdcall mTextSearchPage(void *ctx, int page_num, PCWSTR needle); EXTERN_C SYMBOL_DECLSPEC bool __stdcall mGetTextSearchItem(int k, double *top_x, double *top_y, double *height, double *width); EXTERN_C SYMBOL_DECLSPEC void __stdcall mReleaseTextSearch(); EXTERN_C SYMBOL_DECLSPEC char* __stdcall mGetVers(); EXTERN_C SYMBOL_DECLSPEC char * __stdcall mGetText(void *ctx, int pagenum, int type); EXTERN_C SYMBOL_DECLSPEC int __stdcall mGetLinksPage(void *ctx, int page_num); EXTERN_C SYMBOL_DECLSPEC char* __stdcall mGetLinkItem(int k, double *top_x, double *top_y, double *height, double *width, int *topage, int *type); EXTERN_C SYMBOL_DECLSPEC void __stdcall mReleaseLink(); EXTERN_C SYMBOL_DECLSPEC void* __stdcall mCreateDisplayList(void *ctx, int page_num, int *page_width, int *page_height); EXTERN_C SYMBOL_DECLSPEC void* __stdcall mCreateDisplayListText(void *ctx, int page_num, int *page_width, int *page_height, void **textptr, int *length); EXTERN_C SYMBOL_DECLSPEC void* __stdcall mCreateDisplayListAnnot(void *ctx, int page_num); EXTERN_C SYMBOL_DECLSPEC int __stdcall mRenderPageMT(void *ctx, void *dlist, void *annot_dlist, int page_width, int page_height, byte *bmp_data, int bmp_width, int bmp_height, double scale, bool flipy); EXTERN_C SYMBOL_DECLSPEC int __stdcall mGetTextBlock(void *text, int block_num, double *top_x, double *top_y, double *height, double *width); EXTERN_C SYMBOL_DECLSPEC int __stdcall mGetTextLine(void *text, int block_num, int line_num, double *top_x, double *top_y, double *height, double *width); EXTERN_C SYMBOL_DECLSPEC int __stdcall mGetTextCharacter(void *text, int block_num, int line_num, int item_num, double *top_x, double *top_y, double *height, double *width); EXTERN_C SYMBOL_DECLSPEC void __stdcall mReleaseText(void *ctx, void *page); EXTERN_C SYMBOL_DECLSPEC void __stdcall mSetAA(void *ctx, int level); /* pdfclean methods */ EXTERN_C SYMBOL_DECLSPEC int __stdcall mExtractPages(PCWSTR infile, PCWSTR outfile, PCWSTR password, bool has_password, bool linearize, int num_pages, void *pages); /* output */ EXTERN_C SYMBOL_DECLSPEC int __stdcall mSavePage(void *ctx, PCWSTR outfile, int page_num, int resolution, int type, bool append);
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef INSMOMENTUMNOBCBCBASE_H #define INSMOMENTUMNOBCBCBASE_H #include "IntegratedBC.h" // Forward Declarations class INSMomentumNoBCBCBase; template<> InputParameters validParams<INSMomentumNoBCBCBase>(); /** * Base class for the "No BC" boundary condition. Subclasses will * implement the computeQpXYZ() functions differently based on whether the * "traction" or "Laplacian" form of the viscous stress tensor is * used. The idea behind this is discussed by Griffiths, Papanastiou, * and others. Note that this BC, unlike the natural BC, is * insufficient to set the value of the pressure in outflow problems, * and therefore you will need to implement a pressure pin or similar * approach for constraining the null space of constant pressures. */ class INSMomentumNoBCBCBase : public IntegratedBC { public: INSMomentumNoBCBCBase(const InputParameters & parameters); virtual ~INSMomentumNoBCBCBase(){} protected: // Coupled variables const VariableValue & _u_vel; const VariableValue & _v_vel; const VariableValue & _w_vel; const VariableValue & _p; // Gradients const VariableGradient & _grad_u_vel; const VariableGradient & _grad_v_vel; const VariableGradient & _grad_w_vel; // Variable numberings unsigned _u_vel_var_number; unsigned _v_vel_var_number; unsigned _w_vel_var_number; unsigned _p_var_number; Real _mu; Real _rho; RealVectorValue _gravity; unsigned _component; bool _integrate_p_by_parts; }; #endif
/***************************************************************************** * control.c : Handle control of the playlist & running through it ***************************************************************************** * Copyright (C) 1999-2004 VLC authors and VideoLAN * $Id: e1be944224b1465543c70d45e5d835ffd5f89818 $ * * Authors: Samuel Hocevar <sam@zoy.org> * Clément Stenac <zorglub@videolan.org> * * 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.1 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, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <vlc_common.h> #include "vlc_playlist.h" #include "playlist_internal.h" #include <assert.h> /***************************************************************************** * Local prototypes *****************************************************************************/ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args ); /***************************************************************************** * Playlist control *****************************************************************************/ void playlist_Lock( playlist_t *pl ) { vlc_mutex_lock( &pl_priv(pl)->lock ); } void playlist_Unlock( playlist_t *pl ) { vlc_mutex_unlock( &pl_priv(pl)->lock ); } void playlist_AssertLocked( playlist_t *pl ) { vlc_assert_locked( &pl_priv(pl)->lock ); } int playlist_Control( playlist_t * p_playlist, int i_query, bool b_locked, ... ) { va_list args; int i_result; PL_LOCK_IF( !b_locked ); va_start( args, b_locked ); i_result = PlaylistVAControl( p_playlist, i_query, args ); va_end( args ); PL_UNLOCK_IF( !b_locked ); return i_result; } static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args ) { playlist_item_t *p_item, *p_node; PL_ASSERT_LOCKED; if( i_query != PLAYLIST_STOP ) if( pl_priv(p_playlist)->killed || playlist_IsEmpty( p_playlist ) ) return VLC_EGENERIC; switch( i_query ) { case PLAYLIST_STOP: pl_priv(p_playlist)->request.i_status = PLAYLIST_STOPPED; pl_priv(p_playlist)->request.b_request = true; pl_priv(p_playlist)->request.p_item = NULL; break; // Node can be null, it will keep the same. Use with care ... // Item null = take the first child of node case PLAYLIST_VIEWPLAY: p_node = (playlist_item_t *)va_arg( args, playlist_item_t * ); p_item = (playlist_item_t *)va_arg( args, playlist_item_t * ); if ( p_node == NULL ) { p_node = get_current_status_node( p_playlist ); assert( p_node ); } pl_priv(p_playlist)->request.i_status = PLAYLIST_RUNNING; pl_priv(p_playlist)->request.i_skip = 0; pl_priv(p_playlist)->request.b_request = true; pl_priv(p_playlist)->request.p_node = p_node; pl_priv(p_playlist)->request.p_item = p_item; if( p_item && var_GetBool( p_playlist, "random" ) ) pl_priv(p_playlist)->b_reset_currently_playing = true; break; case PLAYLIST_PLAY: if( pl_priv(p_playlist)->p_input ) { pl_priv(p_playlist)->status.i_status = PLAYLIST_RUNNING; var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S ); break; } else { pl_priv(p_playlist)->request.i_status = PLAYLIST_RUNNING; pl_priv(p_playlist)->request.b_request = true; pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist ); pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist ); pl_priv(p_playlist)->request.i_skip = 0; } break; case PLAYLIST_PAUSE: if( !pl_priv(p_playlist)->p_input ) { /* FIXME: is this really useful without input? */ pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED; /* return without notifying the playlist thread as there is nothing to do */ return VLC_SUCCESS; } if( var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S ) { pl_priv(p_playlist)->status.i_status = PLAYLIST_RUNNING; var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S ); } else { pl_priv(p_playlist)->status.i_status = PLAYLIST_PAUSED; var_SetInteger( pl_priv(p_playlist)->p_input, "state", PAUSE_S ); } break; case PLAYLIST_SKIP: pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist ); pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist ); pl_priv(p_playlist)->request.i_skip = (int) va_arg( args, int ); /* if already running, keep running */ if( pl_priv(p_playlist)->status.i_status != PLAYLIST_STOPPED ) pl_priv(p_playlist)->request.i_status = pl_priv(p_playlist)->status.i_status; pl_priv(p_playlist)->request.b_request = true; break; default: msg_Err( p_playlist, "unknown playlist query" ); return VLC_EBADVAR; } vlc_cond_signal( &pl_priv(p_playlist)->signal ); return VLC_SUCCESS; }
/* * Copyright 2008-2014 Arsen Chaloyan * * 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. * * $Id$ */ #ifndef MRCP_HEADER_ACCESSOR_H #define MRCP_HEADER_ACCESSOR_H /** * @file mrcp_header_accessor.h * @brief Abstract MRCP Header Accessor */ #include "apt_text_stream.h" #include "apt_header_field.h" #include "mrcp.h" APT_BEGIN_EXTERN_C /** MRCP header accessor declaration */ typedef struct mrcp_header_accessor_t mrcp_header_accessor_t; /** MRCP header vtable declaration */ typedef struct mrcp_header_vtable_t mrcp_header_vtable_t; /** MRCP header accessor interface */ struct mrcp_header_vtable_t { /** Allocate actual header data */ void* (*allocate)(mrcp_header_accessor_t *accessor, apr_pool_t *pool); /** Destroy header data */ void (*destroy)(mrcp_header_accessor_t *accessor); /** Parse header field value */ apt_bool_t (*parse_field)(mrcp_header_accessor_t *accessor, apr_size_t id, const apt_str_t *value, apr_pool_t *pool); /** Generate header field value */ apt_bool_t (*generate_field)(const mrcp_header_accessor_t *accessor, apr_size_t id, apt_str_t *value, apr_pool_t *pool); /** Duplicate header field value */ apt_bool_t (*duplicate_field)(mrcp_header_accessor_t *accessor, const mrcp_header_accessor_t *src, apr_size_t id, const apt_str_t *value, apr_pool_t *pool); /** Table of fields */ const apt_str_table_item_t *field_table; /** Number of fields */ apr_size_t field_count; }; /** MRCP header accessor */ struct mrcp_header_accessor_t { /** Actual header data allocated by accessor */ void *data; /** Header accessor interface */ const mrcp_header_vtable_t *vtable; }; /** Initialize header vtable */ static APR_INLINE void mrcp_header_vtable_init(mrcp_header_vtable_t *vtable) { vtable->allocate = NULL; vtable->destroy = NULL; vtable->parse_field = NULL; vtable->generate_field = NULL; vtable->duplicate_field = NULL; vtable->field_table = NULL; vtable->field_count = 0; } /** Validate header vtable */ static APR_INLINE apt_bool_t mrcp_header_vtable_validate(const mrcp_header_vtable_t *vtable) { return (vtable->allocate && vtable->destroy && vtable->parse_field && vtable->generate_field && vtable->duplicate_field && vtable->field_table && vtable->field_count) ? TRUE : FALSE; } /** Initialize header accessor */ static APR_INLINE void mrcp_header_accessor_init(mrcp_header_accessor_t *accessor) { accessor->data = NULL; accessor->vtable = NULL; } /** Allocate header data */ static APR_INLINE void* mrcp_header_allocate(mrcp_header_accessor_t *accessor, apr_pool_t *pool) { if(accessor->data) { return accessor->data; } if(!accessor->vtable || !accessor->vtable->allocate) { return NULL; } return accessor->vtable->allocate(accessor,pool); } /** Destroy header data */ static APR_INLINE void mrcp_header_destroy(mrcp_header_accessor_t *accessor) { if(!accessor->vtable || !accessor->vtable->destroy) { return; } accessor->vtable->destroy(accessor); } /** Parse header field value */ MRCP_DECLARE(apt_bool_t) mrcp_header_field_value_parse(mrcp_header_accessor_t *accessor, apt_header_field_t *header_field, apr_pool_t *pool); /** Generate header field value */ MRCP_DECLARE(apt_header_field_t*) mrcp_header_field_value_generate(const mrcp_header_accessor_t *accessor, apr_size_t id, apt_bool_t empty_value, apr_pool_t *pool); /** Duplicate header field value */ MRCP_DECLARE(apt_bool_t) mrcp_header_field_value_duplicate(mrcp_header_accessor_t *accessor, const mrcp_header_accessor_t *src_accessor, apr_size_t id, const apt_str_t *value, apr_pool_t *pool); APT_END_EXTERN_C #endif /* MRCP_HEADER_ACCESSOR_H */
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkTestingStretchIntensityImageFilter_h #define __itkTestingStretchIntensityImageFilter_h #include "itkUnaryFunctorImageFilter.h" namespace itk { namespace Testing { /** \class StretchIntensityImageFilter * * \brief Applies a linear transformation to the intensity levels of the * input Image. * * StretchIntensityImageFilter applies pixel-wise a linear transformation * to the intensity values of input image pixels. The linear transformation * is defined by the user in terms of the minimum and maximum values that * the output image should have. * * \ingroup ITKTestKernel */ template< typename TInputImage, typename TOutputImage = TInputImage > class ITK_EXPORT StretchIntensityImageFilter: public ImageSource< TOutputImage > { public: /** Standard class typedefs. */ typedef StretchIntensityImageFilter Self; typedef ImageSource< TOutputImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; typedef typename TOutputImage::PixelType OutputPixelType; typedef typename TInputImage::PixelType InputPixelType; typedef typename NumericTraits< InputPixelType >::RealType RealType; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(StretchIntensityImageFilter, ImageSource); itkSetMacro(OutputMinimum, OutputPixelType); itkSetMacro(OutputMaximum, OutputPixelType); itkGetConstReferenceMacro(OutputMinimum, OutputPixelType); itkGetConstReferenceMacro(OutputMaximum, OutputPixelType); /** Get the Scale and Shift used for the linear transformation of gray level values. \warning These Values are only valid after the filter has been updated */ itkGetConstReferenceMacro(Scale, RealType); itkGetConstReferenceMacro(Shift, RealType); /** Get the Minimum and Maximum values of the input image. \warning These Values are only valid after the filter has been updated */ itkGetConstReferenceMacro(InputMinimum, InputPixelType); itkGetConstReferenceMacro(InputMaximum, InputPixelType); /** Set/Get the image input of this process object. */ using Superclass::SetInput; virtual void SetInput(const TInputImage *image); const TInputImage * GetInput(void) const; #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ itkConceptMacro( InputHasNumericTraitsCheck, ( Concept::HasNumericTraits< InputPixelType > ) ); itkConceptMacro( OutputHasNumericTraitsCheck, ( Concept::HasNumericTraits< OutputPixelType > ) ); itkConceptMacro( RealTypeMultiplyOperatorCheck, ( Concept::MultiplyOperator< RealType > ) ); itkConceptMacro( RealTypeAdditiveOperatorsCheck, ( Concept::AdditiveOperators< RealType > ) ); /** End concept checking */ #endif protected: StretchIntensityImageFilter(); virtual ~StretchIntensityImageFilter() {} /** Process to execute before entering the multithreaded section */ void BeforeThreadedGenerateData(void); /** Print internal ivars */ void PrintSelf(std::ostream & os, Indent indent) const; typedef typename Superclass::OutputImageRegionType OutputImageRegionType; typedef typename TInputImage::RegionType InputImageRegionType; /** UnaryFunctorImageFilter can be implemented as a multithreaded filter. * Therefore, this implementation provides a ThreadedGenerateData() routine * which is called for each processing thread. The output image data is * allocated automatically by the superclass prior to calling * ThreadedGenerateData(). ThreadedGenerateData can only write to the * portion of the output image specified by the parameter * "outputRegionForThread" */ void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId); private: StretchIntensityImageFilter(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented RealType m_Scale; RealType m_Shift; InputPixelType m_InputMinimum; InputPixelType m_InputMaximum; OutputPixelType m_OutputMinimum; OutputPixelType m_OutputMaximum; }; } // end namespace Testing } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkTestingStretchIntensityImageFilter.hxx" #endif #endif
/* * psql - the PostgreSQL interactive terminal * * Copyright (c) 2000-2015, PostgreSQL Global Development Group * * src/bin/psql/common.h */ #ifndef COMMON_H #define COMMON_H #include "postgres_fe.h" #include <setjmp.h> #include "libpq-fe.h" #include "print.h" #define atooid(x) ((Oid) strtoul((x), NULL, 10)) extern bool setQFout(const char *fname); extern void psql_error(const char *fmt,...) pg_attribute_printf(1, 2); extern void NoticeProcessor(void *arg, const char *message); extern volatile bool sigint_interrupt_enabled; extern sigjmp_buf sigint_interrupt_jmp; extern volatile bool cancel_pressed; /* Note: cancel_pressed is defined in print.c, see that file for reasons */ extern void setup_cancel_handler(void); extern void SetCancelConn(void); extern void ResetCancelConn(void); extern PGresult *PSQLexec(const char *query); extern int PSQLexecWatch(const char *query, const printQueryOpt *opt); extern bool SendQuery(const char *query); extern bool is_superuser(void); extern bool standard_strings(void); extern const char *session_username(void); extern void expand_tilde(char **filename); extern bool recognized_connection_string(const char *connstr); #endif /* COMMON_H */
/******************************************************************************* * File Name: cycfg_routing.c * * Description: * Establishes all necessary connections between hardware elements. * This file was automatically generated and should not be modified. * Device Configurator: 2.0.0.1483 * Device Support Library (libs/psoc6pdl): 1.4.1.2240 * ******************************************************************************** * Copyright 2017-2019 Cypress Semiconductor Corporation * SPDX-License-Identifier: Apache-2.0 * * 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 "cycfg_routing.h" #include "cy_device_headers.h" void init_cycfg_routing(void) { HSIOM->AMUX_SPLIT_CTL[4] = HSIOM_AMUX_SPLIT_CTL_SWITCH_AA_SL_Msk | HSIOM_AMUX_SPLIT_CTL_SWITCH_AA_SR_Msk | HSIOM_AMUX_SPLIT_CTL_SWITCH_BB_SL_Msk | HSIOM_AMUX_SPLIT_CTL_SWITCH_BB_SR_Msk; HSIOM->AMUX_SPLIT_CTL[5] = HSIOM_AMUX_SPLIT_CTL_SWITCH_AA_SL_Msk | HSIOM_AMUX_SPLIT_CTL_SWITCH_AA_SR_Msk | HSIOM_AMUX_SPLIT_CTL_SWITCH_BB_SL_Msk | HSIOM_AMUX_SPLIT_CTL_SWITCH_BB_SR_Msk; }
// bsl_iomanip.h -*-C++-*- #ifndef INCLUDED_BSL_IOMANIP #define INCLUDED_BSL_IOMANIP #ifndef INCLUDED_BSLS_IDENT #include <bsls_ident.h> #endif BSLS_IDENT("$Id: $") //@PURPOSE: Provide functionality of the corresponding C++ Standard header. // //@SEE_ALSO: package bsl+stdhdrs // //@DESCRIPTION: Provide types, in the 'bsl' namespace, equivalent to those // defined in the corresponding C++ standard header. Include the native // compiler-provided standard header, and also directly include Bloomberg's // implementation of the C++ standard type (if one exists). Finally, place the // included symbols from the 'std' namespace (if any) into the 'bsl' namespace. #ifndef INCLUDED_BSLS_NATIVESTD #include <bsls_nativestd.h> #endif #include <iomanip> namespace bsl { // Import selected symbols into bsl namespace using native_std::resetiosflags; using native_std::setbase; using native_std::setfill; using native_std::setiosflags; using native_std::setprecision; using native_std::setw; } // close package namespace #endif // ---------------------------------------------------------------------------- // Copyright 2013 Bloomberg Finance L.P. // // 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. // ----------------------------- END-OF-FILE ----------------------------------
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_INTERNALS_UI_H_ #define CHROME_BROWSER_UI_WEBUI_SIGNIN_INTERNALS_UI_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" #include "components/signin/core/browser/about_signin_internals.h" #include "content/public/browser/web_ui_controller.h" // The implementation for the chrome://signin-internals page. class SignInInternalsUI : public content::WebUIController, public AboutSigninInternals::Observer { public: explicit SignInInternalsUI(content::WebUI* web_ui); virtual ~SignInInternalsUI(); // content::WebUIController implementation. virtual bool OverrideHandleWebUIMessage(const GURL& source_url, const std::string& name, const base::ListValue& args) OVERRIDE; // AboutSigninInternals::Observer::OnSigninStateChanged implementation. virtual void OnSigninStateChanged( scoped_ptr<base::DictionaryValue> info) OVERRIDE; // Notification that the cookie accounts are ready to be displayed. virtual void OnCookieAccountsFetched( scoped_ptr<base::DictionaryValue> info) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(SignInInternalsUI); }; #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_INTERNALS_UI_H_
// Copyright 2018 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_VIZ_HOST_LAYERED_WINDOW_UPDATER_IMPL_H_ #define COMPONENTS_VIZ_HOST_LAYERED_WINDOW_UPDATER_IMPL_H_ #include <windows.h> #include <memory> #include "base/memory/unsafe_shared_memory_region.h" #include "components/viz/host/viz_host_export.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" #include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h" #include "ui/gfx/geometry/size.h" class SkCanvas; namespace viz { // Makes layered window drawing syscalls. Updates a layered window from shared // memory backing buffer that was drawn into by the GPU process. This is // required as UpdateLayeredWindow() syscall is blocked by the GPU sandbox. class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl : public mojom::LayeredWindowUpdater { public: LayeredWindowUpdaterImpl( HWND hwnd, mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver); LayeredWindowUpdaterImpl(const LayeredWindowUpdaterImpl&) = delete; LayeredWindowUpdaterImpl& operator=(const LayeredWindowUpdaterImpl&) = delete; ~LayeredWindowUpdaterImpl() override; // mojom::LayeredWindowUpdater implementation. void OnAllocatedSharedMemory(const gfx::Size& pixel_size, base::UnsafeSharedMemoryRegion region) override; void Draw(DrawCallback draw_callback) override; private: const HWND hwnd_; mojo::Receiver<mojom::LayeredWindowUpdater> receiver_; std::unique_ptr<SkCanvas> canvas_; }; } // namespace viz #endif // COMPONENTS_VIZ_HOST_LAYERED_WINDOW_UPDATER_IMPL_H_
// Copyright 2014 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 CC_BLINK_WEB_FILTER_ANIMATION_CURVE_IMPL_H_ #define CC_BLINK_WEB_FILTER_ANIMATION_CURVE_IMPL_H_ #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "cc/blink/cc_blink_export.h" #include "third_party/WebKit/public/platform/WebFilterAnimationCurve.h" namespace cc { class AnimationCurve; class KeyframedFilterAnimationCurve; } namespace blink { class WebFilterKeyframe; } namespace cc_blink { class WebFilterAnimationCurveImpl : public blink::WebFilterAnimationCurve { public: CC_BLINK_EXPORT WebFilterAnimationCurveImpl(); ~WebFilterAnimationCurveImpl() override; // blink::WebCompositorAnimationCurve implementation. AnimationCurveType type() const override; // blink::WebFilterAnimationCurve implementation. void add(const blink::WebFilterKeyframe& keyframe, TimingFunctionType type) override; void add(const blink::WebFilterKeyframe& keyframe, double x1, double y1, double x2, double y2) override; void add(const blink::WebFilterKeyframe& keyframe, int steps, float steps_start_offset) override; void setLinearTimingFunction() override; void setCubicBezierTimingFunction(TimingFunctionType) override; void setCubicBezierTimingFunction(double x1, double y1, double x2, double y2) override; void setStepsTimingFunction(int number_of_steps, float steps_start_offset) override; scoped_ptr<cc::AnimationCurve> CloneToAnimationCurve() const; private: scoped_ptr<cc::KeyframedFilterAnimationCurve> curve_; DISALLOW_COPY_AND_ASSIGN(WebFilterAnimationCurveImpl); }; } // namespace cc_blink #endif // CC_BLINK_WEB_FILTER_ANIMATION_CURVE_IMPL_H_
// 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_COMMON_EXTENSIONS_MANIFEST_HANDLERS_NATIVELY_CONNECTABLE_HANDLER_H_ #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_NATIVELY_CONNECTABLE_HANDLER_H_ #include <set> #include <string> #include "base/containers/span.h" #include "extensions/common/extension.h" #include "extensions/common/manifest_handler.h" namespace extensions { // A structure to hold the parsed list of native messaging hosts that can // connect to this extension. struct NativelyConnectableHosts : public Extension::ManifestData { NativelyConnectableHosts(); ~NativelyConnectableHosts() override; static const std::set<std::string>* GetConnectableNativeMessageHosts( const Extension& extension); // A set of native messaging hosts allowed to initiate connection to this // extension. std::set<std::string> hosts; }; // Parses the "natively_connectable" manifest key. class NativelyConnectableHandler : public ManifestHandler { public: NativelyConnectableHandler(); NativelyConnectableHandler(const NativelyConnectableHandler&) = delete; NativelyConnectableHandler& operator=(const NativelyConnectableHandler&) = delete; ~NativelyConnectableHandler() override; bool Parse(Extension* extension, std::u16string* error) override; private: base::span<const char* const> Keys() const override; }; } // namespace extensions #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_NATIVELY_CONNECTABLE_HANDLER_H_
#import <Cocoa/Cocoa.h> #import <WebKit/WebKit.h> @class Sound; @class Dock; @class Growl; @class Notice; @class Path; @class App; @class Window; @class Clipboard; @class Fonts; @class MenuProxy; @class UserDefaults; @class WindowController; @interface WebViewDelegate : NSObject { Sound* sound; Dock* dock; Growl* growl; Notice* notice; Path* path; App* app; Window* window; Clipboard* clipboard; Fonts* fonts; NSMenu *mainMenu; UserDefaults* userDefaults; } @property (nonatomic, retain) Sound* sound; @property (nonatomic, retain) Dock* dock; @property (nonatomic, retain) Growl* growl; @property (nonatomic, retain) Notice* notice; @property (nonatomic, retain) Path* path; @property (nonatomic, retain) App* app; @property (nonatomic, retain) Window* window; @property (nonatomic, retain) Clipboard* clipboard; @property (nonatomic, retain) Fonts* fonts; @property (nonatomic, retain) MenuProxy* menu; @property (nonatomic, retain) UserDefaults* userDefaults; @property (nonatomic, retain) WindowController *requestedWindow; - (id) initWithMenu:(NSMenu*)menu; @end
/* CFStreamInternal.h Copyright (c) 2000-2016, Apple Inc. and the Swift project authors Portions Copyright (c) 2014-2016 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See http://swift.org/LICENSE.txt for license information See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors */ #if !defined(__COREFOUNDATION_CFSTREAMINTERNAL__) #define __COREFOUNDATION_CFSTREAMINTERNAL__ 1 #include <CoreFoundation/CFStreamAbstract.h> #include <CoreFoundation/CFStreamPriv.h> #include <CoreFoundation/CFBase.h> #include <CoreFoundation/CFRuntime.h> CF_EXTERN_C_BEGIN // Older versions of the callbacks; v0 callbacks match v1 callbacks, except that create, finalize, and copyDescription are missing. typedef Boolean (*_CFStreamCBOpenV1)(struct _CFStream *stream, CFStreamError *error, Boolean *openComplete, void *info); typedef Boolean (*_CFStreamCBOpenCompletedV1)(struct _CFStream *stream, CFStreamError *error, void *info); typedef CFIndex (*_CFStreamCBReadV1)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info); typedef const UInt8 *(*_CFStreamCBGetBufferV1)(CFReadStreamRef sream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info); typedef Boolean (*_CFStreamCBCanReadV1)(CFReadStreamRef, void *info); typedef CFIndex (*_CFStreamCBWriteV1)(CFWriteStreamRef, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info); typedef Boolean (*_CFStreamCBCanWriteV1)(CFWriteStreamRef, void *info); struct _CFStreamCallBacksV1 { CFIndex version; void *(*create)(struct _CFStream *stream, void *info); void (*finalize)(struct _CFStream *stream, void *info); CFStringRef (*copyDescription)(struct _CFStream *stream, void *info); _CFStreamCBOpenV1 open; _CFStreamCBOpenCompletedV1 openCompleted; _CFStreamCBReadV1 read; _CFStreamCBGetBufferV1 getBuffer; _CFStreamCBCanReadV1 canRead; _CFStreamCBWriteV1 write; _CFStreamCBCanWriteV1 canWrite; void (*close)(struct _CFStream *stream, void *info); CFTypeRef (*copyProperty)(struct _CFStream *stream, CFStringRef propertyName, void *info); Boolean (*setProperty)(struct _CFStream *stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info); void (*requestEvents)(struct _CFStream *stream, CFOptionFlags events, void *info); void (*schedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); void (*unschedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info); }; // These two are defined in CFSocketStream.c because that's where the glue for CFNetwork is. CF_PRIVATE CFErrorRef _CFErrorFromStreamError(CFAllocatorRef alloc, CFStreamError *err); CF_PRIVATE CFStreamError _CFStreamErrorFromError(CFErrorRef error); CF_EXTERN_C_END #endif /* ! __COREFOUNDATION_CFSTREAMINTERNAL__ */
/* linux/arch/arm/plat-s5p/include/plat/map-s5p.h * * Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * S5P - Memory map definitions * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_PLAT_MAP_S5P_H #define __ASM_PLAT_MAP_S5P_H __FILE__ #define S5P_VA_CHIPID S3C_ADDR(0x00700000) #define S5P_VA_GPIO S3C_ADDR(0x00500000) #define S5P_VA_SYSTIMER S3C_ADDR(0x01200000) #define S5P_VA_SROMC S3C_ADDR(0x01100000) #define S5P_VA_AUDSS S3C_ADDR(0x01600000) #define S5P_VA_DMC0 S3C_ADDR_CPU(0x2000) #define S5P_VA_DMC1 S3C_ADDR_CPU(0x4000) #define S5P_VA_BUS_AXI_DSYS S3C_ADDR_CPU(0x6000) #define S5P_VA_UART0 (S3C_VA_UART + 0x0) #define S5P_VA_UART1 (S3C_VA_UART + 0x400) #define S5P_VA_UART2 (S3C_VA_UART + 0x800) #define S5P_VA_UART3 (S3C_VA_UART + 0xC00) #define S3C_UART_OFFSET (0x400) #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) #define VA_VIC0 VA_VIC(0) #define VA_VIC1 VA_VIC(1) #define VA_VIC2 VA_VIC(2) #define VA_VIC3 VA_VIC(3) #endif /* __ASM_PLAT_MAP_S5P_H */
#define pr_fmt(fmt) "Freescale MX28evk: " fmt #define DEBUG #include <common.h> #include <linux/sizes.h> #include <asm/barebox-arm-head.h> #include <asm/barebox-arm.h> #include <mach/imx28-regs.h> #include <mach/init.h> #include <io.h> #include <debug_ll.h> #include <mach/iomux.h> #include <stmp-device.h> ENTRY_FUNCTION(start_barebox_freescale_mx28evk, r0, r1, r2) { barebox_arm_entry(IMX_MEMORY_BASE, SZ_128M, NULL); } static const uint32_t iomux_pads[] = { /* EMI */ EMI_DATA0, EMI_DATA1, EMI_DATA2, EMI_DATA3, EMI_DATA4, EMI_DATA5, EMI_DATA6, EMI_DATA7, EMI_DATA8, EMI_DATA9, EMI_DATA10, EMI_DATA11, EMI_DATA12, EMI_DATA13, EMI_DATA14, EMI_DATA15, EMI_ODT0, EMI_DQM0, EMI_ODT1, EMI_DQM1, EMI_DDR_OPEN_FB, EMI_CLK, EMI_DSQ0, EMI_DSQ1, EMI_DDR_OPEN, EMI_A0, EMI_A1, EMI_A2, EMI_A3, EMI_A4, EMI_A5, EMI_A6, EMI_A7, EMI_A8, EMI_A9, EMI_A10, EMI_A11, EMI_A12, EMI_A13, EMI_A14, EMI_BA0, EMI_BA1, EMI_BA2, EMI_CASN, EMI_RASN, EMI_WEN, EMI_CE0N, EMI_CE1N, EMI_CKE, /* Debug UART */ PWM0_DUART_RX | VE_3_3V, PWM1_DUART_TX | VE_3_3V, }; static noinline void freescale_mx28evk_init(void) { int i; /* initialize muxing */ for (i = 0; i < ARRAY_SIZE(iomux_pads); i++) imx_gpio_mode(iomux_pads[i]); pr_debug("initializing power...\n"); mx28_power_init(0, 1, 0); pr_debug("initializing SDRAM...\n"); mx28_mem_init(); pr_debug("DONE\n"); } ENTRY_FUNCTION(prep_start_barebox_freescale_mx28evk, r0, r1, r2) { void (*back)(unsigned long) = (void *)get_lr(); relocate_to_current_adr(); setup_c(); freescale_mx28evk_init(); back(0); }
#include "../../../src/script/qscriptvalueiterator_p.h"
/* * RIPng debug output routines * Copyright (C) 1998, 1999 Kunihiro Ishiguro * * This file is part of GNU Zebra. * * GNU Zebra 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. * * GNU Zebra is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _ZEBRA_RIPNG_DEBUG_H #define _ZEBRA_RIPNG_DEBUG_H /* Debug flags. */ #define RIPNG_DEBUG_EVENT 0x01 #define RIPNG_DEBUG_PACKET 0x01 #define RIPNG_DEBUG_SEND 0x20 #define RIPNG_DEBUG_RECV 0x40 #define RIPNG_DEBUG_ZEBRA 0x01 /* Debug related macro. */ #define IS_RIPNG_DEBUG_EVENT (ripng_debug_event & RIPNG_DEBUG_EVENT) #define IS_RIPNG_DEBUG_PACKET (ripng_debug_packet & RIPNG_DEBUG_PACKET) #define IS_RIPNG_DEBUG_SEND (ripng_debug_packet & RIPNG_DEBUG_SEND) #define IS_RIPNG_DEBUG_RECV (ripng_debug_packet & RIPNG_DEBUG_RECV) #define IS_RIPNG_DEBUG_ZEBRA (ripng_debug_zebra & RIPNG_DEBUG_ZEBRA) extern unsigned long ripng_debug_event; extern unsigned long ripng_debug_packet; extern unsigned long ripng_debug_zebra; extern void ripng_debug_init(void); #endif /* _ZEBRA_RIPNG_DEBUG_H */
/* *_________________________________________________________________________* * POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE * * DESCRIPTION: SEE READ-ME * * FILE NAME: workspace.h * * AUTHORS: See Author List * * GRANTS: See Grants List * * COPYRIGHT: (C) 2005 by Authors as listed in Author's List * * LICENSE: Please see License Agreement * * DOWNLOAD: Free at www.rpi.edu/~anderk5 * * ADMINISTRATOR: Prof. Kurt Anderson * * Computational Dynamics Lab * * Rensselaer Polytechnic Institute * * 110 8th St. Troy NY 12180 * * CONTACT: anderk5@rpi.edu * *_________________________________________________________________________*/ #ifndef WORKSPACE_H #define WORKSPACE_H #include "matrices.h" #include <iostream> #include <fstream> #include <string> #include <cstdio> #include <iomanip> #include <vector> class System; class Solver; struct SysData{ System * system; int solver; int integrator; }; class Workspace { SysData * system; // the multibody systems data int currentIndex; int maxAlloc; public: Workspace(); ~Workspace(); double Thalf; double Tfull; double ConFac; double KE_val; int FirstTime; bool LoadFile(char* filename); bool SaveFile(char* filename, int index = -1); System* GetSystem(int index = -1); void AddSolver(Solver* s, int index = -1); void LobattoOne(double **&xcm, double **&vcm,double **&omega,double **&torque, double **&fcm, double **&ex_space, double **&ey_space, double **&ez_space); void LobattoTwo(double **&vcm,double **&omega,double **&torque, double **&fcm); bool MakeSystem(int& nbody, double *&masstotal, double **&inertia, double **&xcm, double **&vcm, double **&omega, double **&ex_space, double **&ey_space, double **&ez_space, int &njoint, int **&jointbody, double **&xjoint, int& nfree, int*freelist, double dthalf, double dtv, double tempcon, double KE); bool SaveSystem(int& nbody, double *&masstotal, double **&inertia, double **&xcm, double **&xjoint, double **&vcm, double **&omega, double **&ex_space, double **&ey_space, double **&ez_space, double **&acm, double **&alpha, double **&torque, double **&fcm, int **&jointbody, int &njoint); bool MakeDegenerateSystem(int& nfree, int*freelist, double *&masstotal, double **&inertia, double **&xcm, double **&vcm, double **&omega, double **&ex_space, double **&ey_space, double **&ez_space); int getNumberOfSystems(); void SetLammpsValues(double dtv, double dthalf, double tempcon); void SetKE(int temp, double SysKE); void RKStep(double **&xcm, double **&vcm,double **&omega,double **&torque, double **&fcm, double **&ex_space, double **&ey_space, double **&ez_space); void WriteFile(char* filename); private: void allocateNewSystem(); //helper function to handle vector resizing and such for the array of system pointers }; #endif
#ifndef _ALPHA_SPINLOCK_H #define _ALPHA_SPINLOCK_H #include <linux/kernel.h> #include <asm/current.h> /* */ #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) #define arch_spin_is_locked(x) ((x)->lock != 0) #define arch_spin_unlock_wait(x) \ do { cpu_relax(); } while ((x)->lock) static inline void arch_spin_unlock(arch_spinlock_t * lock) { mb(); lock->lock = 0; } static inline void arch_spin_lock(arch_spinlock_t * lock) { long tmp; __asm__ __volatile__( "1: ldl_l %0,%1\n" " bne %0,2f\n" " lda %0,1\n" " stl_c %0,%1\n" " beq %0,2f\n" " mb\n" ".subsection 2\n" "2: ldl %0,%1\n" " bne %0,2b\n" " br 1b\n" ".previous" : "=&r" (tmp), "=m" (lock->lock) : "m"(lock->lock) : "memory"); } static inline int arch_spin_trylock(arch_spinlock_t *lock) { return !test_and_set_bit(0, &lock->lock); } /* */ static inline int arch_read_can_lock(arch_rwlock_t *lock) { return (lock->lock & 1) == 0; } static inline int arch_write_can_lock(arch_rwlock_t *lock) { return lock->lock == 0; } static inline void arch_read_lock(arch_rwlock_t *lock) { long regx; __asm__ __volatile__( "1: ldl_l %1,%0\n" " blbs %1,6f\n" " subl %1,2,%1\n" " stl_c %1,%0\n" " beq %1,6f\n" " mb\n" ".subsection 2\n" "6: ldl %1,%0\n" " blbs %1,6b\n" " br 1b\n" ".previous" : "=m" (*lock), "=&r" (regx) : "m" (*lock) : "memory"); } static inline void arch_write_lock(arch_rwlock_t *lock) { long regx; __asm__ __volatile__( "1: ldl_l %1,%0\n" " bne %1,6f\n" " lda %1,1\n" " stl_c %1,%0\n" " beq %1,6f\n" " mb\n" ".subsection 2\n" "6: ldl %1,%0\n" " bne %1,6b\n" " br 1b\n" ".previous" : "=m" (*lock), "=&r" (regx) : "m" (*lock) : "memory"); } static inline int arch_read_trylock(arch_rwlock_t * lock) { long regx; int success; __asm__ __volatile__( "1: ldl_l %1,%0\n" " lda %2,0\n" " blbs %1,2f\n" " subl %1,2,%2\n" " stl_c %2,%0\n" " beq %2,6f\n" "2: mb\n" ".subsection 2\n" "6: br 1b\n" ".previous" : "=m" (*lock), "=&r" (regx), "=&r" (success) : "m" (*lock) : "memory"); return success; } static inline int arch_write_trylock(arch_rwlock_t * lock) { long regx; int success; __asm__ __volatile__( "1: ldl_l %1,%0\n" " lda %2,0\n" " bne %1,2f\n" " lda %2,1\n" " stl_c %2,%0\n" " beq %2,6f\n" "2: mb\n" ".subsection 2\n" "6: br 1b\n" ".previous" : "=m" (*lock), "=&r" (regx), "=&r" (success) : "m" (*lock) : "memory"); return success; } static inline void arch_read_unlock(arch_rwlock_t * lock) { long regx; __asm__ __volatile__( " mb\n" "1: ldl_l %1,%0\n" " addl %1,2,%1\n" " stl_c %1,%0\n" " beq %1,6f\n" ".subsection 2\n" "6: br 1b\n" ".previous" : "=m" (*lock), "=&r" (regx) : "m" (*lock) : "memory"); } static inline void arch_write_unlock(arch_rwlock_t * lock) { mb(); lock->lock = 0; } #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) #define arch_spin_relax(lock) cpu_relax() #define arch_read_relax(lock) cpu_relax() #define arch_write_relax(lock) cpu_relax() #endif /* */
/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TRINITY_MAP_INSTANCED_H #define TRINITY_MAP_INSTANCED_H #include "Map.h" #include "InstanceSaveMgr.h" #include "DBCEnums.h" class TC_GAME_API MapInstanced : public Map { friend class MapManager; public: typedef std::unordered_map< uint32, Map*> InstancedMaps; MapInstanced(uint32 id, time_t expiry); ~MapInstanced() { } // functions overwrite Map versions void Update(uint32 diff) override; void DelayedUpdate(uint32 diff) override; //void RelocationNotify(); void UnloadAll() override; EnterState CannotEnter(Player* /*player*/) override; Map* CreateInstanceForPlayer(uint32 mapId, Player* player, uint32 loginInstanceId = 0); Map* FindInstanceMap(uint32 instanceId) const { InstancedMaps::const_iterator i = m_InstancedMaps.find(instanceId); return(i == m_InstancedMaps.end() ? nullptr : i->second); } bool DestroyInstance(InstancedMaps::iterator &itr); void AddGridMapReference(GridCoord const& p) { ++GridMapReference[p.x_coord][p.y_coord]; SetUnloadReferenceLock(GridCoord((MAX_NUMBER_OF_GRIDS - 1) - p.x_coord, (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord), true); } void RemoveGridMapReference(GridCoord const& p) { --GridMapReference[p.x_coord][p.y_coord]; if (!GridMapReference[p.x_coord][p.y_coord]) SetUnloadReferenceLock(GridCoord((MAX_NUMBER_OF_GRIDS - 1) - p.x_coord, (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord), false); } InstancedMaps &GetInstancedMaps() { return m_InstancedMaps; } virtual void InitVisibilityDistance() override; private: InstanceMap* CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty, TeamId InstanceTeam); BattlegroundMap* CreateBattleground(uint32 InstanceId, Battleground* bg); InstancedMaps m_InstancedMaps; uint16 GridMapReference[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; }; #endif
/* packet-scsi-smc.h * Dissector for the SCSI SMC commandset * Extracted from packet-scsi.h * * Dinesh G Dutt (ddutt@cisco.com) * Ronnie sahlberg 2006 * * $Id: packet-scsi-smc.h 20778 2007-02-11 00:20:37Z sahlberg $ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 2002 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __PACKET_SCSI_SMC_H_ #define __PACKET_SCSI_SMC_H_ /* SMC Commands */ #define SCSI_SMC_EXCHANGE_MEDIUM 0x40 #define SCSI_SMC_INITIALIZE_ELEMENT_STATUS 0x07 #define SCSI_SMC_INITIALIZE_ELEMENT_STATUS_RANGE 0x37 #define SCSI_SMC_MOVE_MEDIUM 0xA5 #define SCSI_SMC_MOVE_MEDIUM_ATTACHED 0xA7 #define SCSI_SMC_OPENCLOSE_ELEMENT 0x1B #define SCSI_SMC_POSITION_TO_ELEMENT 0x2B #define SCSI_SMC_READ_ATTRIBUTE 0x8C #define SCSI_SMC_READ_ELEMENT_STATUS 0xB8 #define SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED 0xB4 #define SCSI_SMC_REPORT_VOLUME_TYPES_SUPPORTED 0x44 #define SCSI_SMC_REQUEST_VOLUME_ELEMENT_ADDRESS 0xB5 #define SCSI_SMC_SEND_VOLUME_TAG 0xB6 #define SCSI_SMC_WRITE_ATTRIBUTE 0x8D void dissect_smc_movemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); void dissect_smc_readelementstatus (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len _U_, scsi_task_data_t *cdata _U_); extern int hf_scsi_smc_opcode; extern scsi_cdb_table_t scsi_smc_table[256]; WS_VAR_IMPORT const value_string scsi_smc_vals[]; #endif
/* * Copyright (C) 2001-2003 FhG Fokus * * This file is part of Kamailio, a free SIP server. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * */ /** * \file * \brief Main definitions for memory manager * * Main definitions for memory manager, like malloc, free and realloc * \ingroup mem */ #include <stdio.h> #include <stdlib.h> #include "../config.h" #include "../dprint.h" #include "../globals.h" #include "mem.h" #ifdef PKG_MALLOC #include "q_malloc.h" #endif #ifdef SHM_MEM #include "shm_mem.h" #endif #if 0 #ifdef PKG_MALLOC #ifndef DL_MALLOC char* mem_pool = 0; #endif #ifdef F_MALLOC struct fm_block* mem_block = 0; #elif defined DL_MALLOC /* don't need this */ #elif defined TLSF_MALLOC tlsf_t mem_block = 0; #else struct qm_block* mem_block = 0; #endif #endif /** * \brief Initialize private memory pool * \return 0 if the memory allocation was successful, -1 otherwise */ int init_pkg_mallocs(void) { #ifdef PKG_MALLOC /*init mem*/ #ifndef DL_MALLOC if (pkg_mem_size == 0) pkg_mem_size = PKG_MEM_POOL_SIZE; mem_pool = malloc(pkg_mem_size); #endif #ifdef F_MALLOC if (mem_pool) mem_block=fm_malloc_init(mem_pool, pkg_mem_size, MEM_TYPE_PKG); #elif DL_MALLOC /* don't need this */ #elif TLSF_MALLOC mem_block = tlsf_create_with_pool(mem_pool, pkg_mem_size); #else if (mem_pool) mem_block=qm_malloc_init(mem_pool, pkg_mem_size, MEM_TYPE_PKG); #endif #ifndef DL_MALLOC if (mem_block==0){ LOG(L_CRIT, "could not initialize memory pool\n"); fprintf(stderr, "Too much pkg memory demanded: %ld bytes\n", pkg_mem_size); return -1; } #endif #endif return 0; } /** * \brief Destroy private memory pool */ void destroy_pkg_mallocs(void) { #ifdef PKG_MALLOC #ifndef DL_MALLOC if (mem_pool) { free(mem_pool); mem_pool = 0; } #endif #endif /* PKG_MALLOC */ } /** * \brief Initialize shared memory pool * \param force_alloc Force allocation of memory, e.g. initialize complete block with zero * \return 0 if the memory allocation was successful, -1 otherwise */ int init_shm_mallocs(int force_alloc) { #ifdef SHM_MEM if (shm_mem_init(force_alloc)<0) { LOG(L_CRIT, "could not initialize shared memory pool, exiting...\n"); fprintf(stderr, "Too much shared memory demanded: %ld\n", shm_mem_size ); return -1; } #endif return 0; } #endif
/* MDDRIVER.C - test driver for MD2, MD4 and MD5 * */ /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All rights reserved. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* jku: added support to deal with vectors */ #define MD 5 #include <stdio.h> #include <time.h> #include <string.h> #include "md5global.h" #include "md5.h" #include "md5utils.h" #include "dprint.h" #include "ut.h" /*static void MDString PROTO_LIST ((char *));*/ #define MD_CTX MD5_CTX #define MDInit MD5Init #define MDUpdate MD5Update #define MDFinal MD5Final /* Digests a string array and store the result in dst; assumes 32 bytes in dst */ void MDStringArray (char *dst, str src[], int size) { MD_CTX context; unsigned char digest[16]; int i; int len; char *s; /* # ifdef EXTRA_DEBUG int j; int sum; #endif */ MDInit (&context); for (i=0; i<size; i++) { trim_len( len, s, src[i] ); /* # ifdef EXTRA_DEBUG fprintf(stderr, "EXTRA_DEBUG: %d. (%d) {", i+1, len); sum=0; for (j=0; j<len; j++) { fprintf( stderr, "%c ", *(s+j)); sum+=*(s+j); } for (j=0; j<len; j++) { fprintf( stderr, "%d ", *(s+j)); sum+=*(s+j); } fprintf(stderr, " [%d]\n", sum ); # endif */ MDUpdate (&context, s, len); } MDFinal (digest, &context); string2hex(digest, 16, dst ); DBG("DEBUG: MD5 calculated: %.*s\n", MD5_LEN, dst ); }
#include <lwk/stddef.h>
/* * linux/drivers/devfreq/governor_simpleondemand.c * * Copyright (C) 2011 Samsung Electronics * MyungJoo Ham <myungjoo.ham@samsung.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/errno.h> #include <linux/module.h> #include <linux/devfreq.h> #include <linux/math64.h> #include "governor.h" /* Default constants for DevFreq-Simple-Ondemand (DFSO) */ #define DFSO_UPTHRESHOLD (90) #define DFSO_DOWNDIFFERENCTIAL (5) static int devfreq_simple_ondemand_func(struct devfreq *df, unsigned long *freq, u32 *flag) { struct devfreq_dev_status stat; int err = df->profile->get_dev_status(df->dev.parent, &stat); unsigned long long a, b; unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD; unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL; struct devfreq_simple_ondemand_data *data = df->data; unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX; unsigned long min = (df->min_freq) ? df->min_freq : 0; if (err) return err; if (data) { if (data->upthreshold) dfso_upthreshold = data->upthreshold; if (data->downdifferential) dfso_downdifferential = data->downdifferential; } if (dfso_upthreshold > 100 || dfso_upthreshold < dfso_downdifferential) return -EINVAL; /* Prevent overflow */ if (stat.busy_time >= (1 << 24) || stat.total_time >= (1 << 24)) { stat.busy_time >>= 7; stat.total_time >>= 7; } if (data && data->simple_scaling) { if (stat.busy_time * 100 > stat.total_time * dfso_upthreshold) *freq = max; else if (stat.busy_time * 100 < stat.total_time * (dfso_upthreshold - dfso_downdifferential)) *freq = min; else *freq = df->previous_freq; return 0; } /* Assume MAX if it is going to be divided by zero */ if (stat.total_time == 0) { *freq = max; return 0; } /* Set MAX if it's busy enough - only if current frequency is not below 180 MHz */ if (stat.busy_time * 100 > stat.total_time * dfso_upthreshold) { if (stat.current_frequency >= 180000000) *freq = max; else *freq = 180000000; return 0; } /* Set MAX if we do not know the initial frequency */ if (stat.current_frequency == 0) { *freq = max; return 0; } /* Keep the current frequency */ if (stat.busy_time * 100 > stat.total_time * (dfso_upthreshold - dfso_downdifferential)) { *freq = stat.current_frequency; return 0; } /* Set the desired frequency based on the load */ a = stat.busy_time; a *= stat.current_frequency; b = div_u64(a, stat.total_time); b *= 100; b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2)); *freq = (unsigned long) b; if (df->min_freq && *freq < df->min_freq) *freq = df->min_freq; if (df->max_freq && *freq > df->max_freq) *freq = df->max_freq; return 0; } static int devfreq_simple_ondemand_handler(struct devfreq *devfreq, unsigned int event, void *data) { switch (event) { case DEVFREQ_GOV_START: devfreq_monitor_start(devfreq); break; case DEVFREQ_GOV_STOP: devfreq_monitor_stop(devfreq); break; case DEVFREQ_GOV_INTERVAL: devfreq_interval_update(devfreq, (unsigned int *)data); break; case DEVFREQ_GOV_SUSPEND: devfreq_monitor_suspend(devfreq); break; case DEVFREQ_GOV_RESUME: devfreq_monitor_resume(devfreq); break; default: break; } return 0; } static struct devfreq_governor devfreq_simple_ondemand = { .name = "simple_ondemand", .get_target_freq = devfreq_simple_ondemand_func, .event_handler = devfreq_simple_ondemand_handler, }; static int __init devfreq_simple_ondemand_init(void) { return devfreq_add_governor(&devfreq_simple_ondemand); } subsys_initcall(devfreq_simple_ondemand_init); static void __exit devfreq_simple_ondemand_exit(void) { int ret; ret = devfreq_remove_governor(&devfreq_simple_ondemand); if (ret) pr_err("%s: failed remove governor %d\n", __func__, ret); return; } module_exit(devfreq_simple_ondemand_exit); MODULE_LICENSE("GPL");
#ifndef _HACK_FS_H #define _HACK_FS_H #include <linux/net.h> /* Hackery */ struct inode { union { int i_garbage; struct socket socket_i; /* icmp.c actually needs this!! */ } u; }; #define i_uid u.i_garbage #define i_gid u.i_garbage #define i_sock u.i_garbage #define i_ino u.i_garbage #define i_mode u.i_garbage #endif
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software 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. * * Cleanflight and Betaflight are distributed in the hope that they * 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 software. * * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "common/time.h" typedef struct positionConfig_s { uint8_t altSource; } positionConfig_t; PG_DECLARE(positionConfig_t, positionConfig); bool isAltitudeOffset(void); void calculateEstimatedAltitude(timeUs_t currentTimeUs); int32_t getEstimatedAltitudeCm(void); int16_t getEstimatedVario(void);
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- #ifndef AP_MATH_H #define AP_MATH_H // Assorted useful math operations for ArduPilot(Mega) #include <AP_Common.h> #include <AP_Param.h> #include <math.h> #ifdef __AVR__ # include <AP_Math_AVR_Compat.h> #endif #include <stdint.h> #include "rotations.h" #include "vector2.h" #include "vector3.h" #include "matrix3.h" #include "quaternion.h" #include "polygon.h" #ifndef PI #define PI 3.141592653589793f #endif #define DEG_TO_RAD 0.017453292519943295769236907684886f #define RAD_TO_DEG 57.295779513082320876798154814105f #define RadiansToCentiDegrees(x) ((x) * 5729.5779513082320876798154814105f) // acceleration due to gravity in m/s/s #define GRAVITY_MSS 9.80665f // radius of earth in meters #define RADIUS_OF_EARTH 6378100 #define ROTATION_COMBINATION_SUPPORT 0 // convert a longitude or latitude point to meters or centimeteres. // Note: this does not include the longitude scaling which is dependent upon location #define LATLON_TO_M 0.01113195f #define LATLON_TO_CM 1.113195f // define AP_Param types AP_Vector3f and Ap_Matrix3f AP_PARAMDEFV(Matrix3f, Matrix3f, AP_PARAM_MATRIX3F); AP_PARAMDEFV(Vector3f, Vector3f, AP_PARAM_VECTOR3F); // a varient of asin() that always gives a valid answer. float safe_asin(float v); // a varient of sqrt() that always gives a valid answer. float safe_sqrt(float v); // a faster varient of atan. accurate to 6 decimal places for values between -1 ~ 1 but then diverges quickly float fast_atan(float v); #if ROTATION_COMBINATION_SUPPORT // find a rotation that is the combination of two other // rotations. This is used to allow us to add an overall board // rotation to an existing rotation of a sensor such as the compass enum Rotation rotation_combination(enum Rotation r1, enum Rotation r2, bool *found = NULL); #endif // longitude_scale - returns the scaler to compensate for shrinking longitude as you move north or south from the equator // Note: this does not include the scaling to convert longitude/latitude points to meters or centimeters float longitude_scale(const struct Location *loc); // return distance in meters between two locations float get_distance(const struct Location *loc1, const struct Location *loc2); // return distance in centimeters between two locations uint32_t get_distance_cm(const struct Location *loc1, const struct Location *loc2); // return bearing in centi-degrees between two locations int32_t get_bearing_cd(const struct Location *loc1, const struct Location *loc2); // see if location is past a line perpendicular to // the line between point1 and point2. If point1 is // our previous waypoint and point2 is our target waypoint // then this function returns true if we have flown past // the target waypoint bool location_passed_point(const struct Location & location, const struct Location & point1, const struct Location & point2); // extrapolate latitude/longitude given bearing and distance void location_update(struct Location *loc, float bearing, float distance); // extrapolate latitude/longitude given distances north and east void location_offset(struct Location *loc, float ofs_north, float ofs_east); /* wrap an angle in centi-degrees */ int32_t wrap_360_cd(int32_t error); int32_t wrap_180_cd(int32_t error); /* wrap an angle defined in radians to -PI ~ PI (equivalent to +- 180 degrees) */ float wrap_PI(float angle_in_radians); /* print a int32_t lat/long in decimal degrees */ void print_latlon(AP_HAL::BetterStream *s, int32_t lat_or_lon); // constrain a value float constrain_float(float amt, float low, float high); int16_t constrain_int16(int16_t amt, int16_t low, int16_t high); int32_t constrain_int32(int32_t amt, int32_t low, int32_t high); // degrees -> radians float radians(float deg); // radians -> degrees float degrees(float rad); // square float sq(float v); // sqrt of sum of squares float pythagorous2(float a, float b); float pythagorous3(float a, float b, float c); #ifdef radians #error "Build is including Arduino base headers" #endif /* The following three functions used to be arduino core macros */ #define max(a,b) ((a)>(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b)) #endif // AP_MATH_H
/* * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV 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. * * The GNU LIBICONV 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 the GNU LIBICONV Library; see the file COPYING.LIB. * If not, see <https://www.gnu.org/licenses/>. */ /* * UTF-32LE */ /* Specification: Unicode 3.1 Standard Annex #19 */ static int utf32le_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n) { if (n >= 4) { ucs4_t wc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24); if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { *pwc = wc; return 4; } else return RET_ILSEQ; } return RET_TOOFEW(0); } static int utf32le_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n) { if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000)) { if (n >= 4) { r[0] = (unsigned char) wc; r[1] = (unsigned char) (wc >> 8); r[2] = (unsigned char) (wc >> 16); r[3] = 0; return 4; } else return RET_TOOSMALL; } return RET_ILUNI; }
/* The LibVMI Library is an introspection library that simplifies access to * memory in a target virtual machine or in a file containing a dump of * a system's physical memory. LibVMI is based on the XenAccess Library. * * Copyright 2012 VMITools Project * * Author: Bryan D. Payne (bdpayne@acm.org) * * This file is part of LibVMI. * * LibVMI is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * LibVMI 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 LibVMI. If not, see <http://www.gnu.org/licenses/>. */ #include <check.h> #include <stdlib.h> #include <stdio.h> #include "check_tests.h" #include "../libvmi/libvmi.h" char *testvm = NULL; const char *get_testvm (void) { return testvm; } int main (void) { /* get the vm name to test against */ //TODO allow a list of names in this variable testvm = getenv("LIBVMI_CHECK_TESTVM"); if (NULL == testvm) { printf("!! Check requires VM name to test against.\n"); printf("!! Store name in env variable 'LIBVMI_CHECK_TESTVM'.\n"); return 1; } /* setup the test suite */ int number_failed = 0; Suite *s = suite_create("LibVMI"); /* add test cases */ suite_add_tcase(s, init_tcase()); suite_add_tcase(s, translate_tcase()); suite_add_tcase(s, read_tcase()); suite_add_tcase(s, write_tcase()); suite_add_tcase(s, print_tcase()); suite_add_tcase(s, accessor_tcase()); suite_add_tcase(s, util_tcase()); suite_add_tcase(s, peparse_tcase()); #if ENABLE_SHM_SNAPSHOT == 1 suite_add_tcase(s, shm_snapshot_tcase()); #endif suite_add_tcase(s, cache_tcase()); suite_add_tcase(s, get_va_pages_tcase()); /* run the tests */ SRunner *sr = srunner_create(s); srunner_run_all(sr, CK_VERBOSE); number_failed = srunner_ntests_failed(sr); srunner_free(sr); if (number_failed == 0) { return EXIT_SUCCESS; } else { return EXIT_FAILURE; } }
// // IMass.h // Express // // Created by Matej Jan on 2.11.10. // Copyright 2010 Retronator. All rights reserved. // #import <UIKit/UIKit.h> @protocol IMass <NSObject> @property (nonatomic) float mass; @end
#ifndef CHARTPLOT_H #define CHARTPLOT_H #include <qwt_plot.h> #include <qwt_plot_grid.h> #include <qwt_plot_curve.h> #include "MainWindow.h" #include "ScrollZoomer.h" class ChartPlot : public QwtPlot { Q_OBJECT public: ChartPlot(QWidget *parent = NULL); virtual ~ChartPlot(); /** @brief Get next color of color map */ QColor getNextColor(); /** @brief Get color for curve id */ QColor getColorForCurve(const QString &id); /** @brief Reset color map */ void shuffleColors(); public slots: /** @brief Generate coloring for this plot canvas based on current window theme */ void styleChanged(bool styleIsDark); protected: const static int numColors = 20; const static QColor baseColors[numColors]; QList<QColor> colors; ///< Colormap for curves int nextColorIndex; ///< Next index in color map QMap<QString, QwtPlotCurve* > curves; ///< Plot curves QwtPlotGrid* grid; ///< Plot grid float symbolWidth; ///< Width of curve symbols in pixels float curveWidth; ///< Width of curve lines in pixels float gridWidth; ///< Width of gridlines in pixels }; #endif // CHARTPLOT_H
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_CUSTOM_PARSERS_H_ #define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_CUSTOM_PARSERS_H_ #include <cstdint> #include <memory> #include "absl/strings/string_view.h" #include "absl/types/any.h" #include "tensorflow/lite/delegates/gpu/common/operation_parser.h" #include "tensorflow/lite/delegates/gpu/common/shape.h" #include "tensorflow/lite/delegates/gpu/common/status.h" namespace tflite { namespace gpu { // Returns a parser for the provided custom op. std::unique_ptr<TFLiteOperationParser> NewCustomOperationParser( absl::string_view op_name); } // namespace gpu } // namespace tflite #endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_CUSTOM_PARSERS_H_
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_COMMON_RUNTIME_PROCESS_UTIL_H_ #define TENSORFLOW_CORE_COMMON_RUNTIME_PROCESS_UTIL_H_ #include <functional> #include "tensorflow/core/lib/core/threadpool.h" #include "tensorflow/core/public/session_options.h" // TODO(vrv, mrry): Remove this library: its interface circumvents the // callers' Env and calls Env::Default() directly. namespace tensorflow { // Returns a process-wide ThreadPool for scheduling compute operations // using 'options'. Caller does not take ownership over threadpool. thread::ThreadPool* ComputePool(const SessionOptions& options); // Returns the TF_NUM_INTEROP_THREADS environment value, or 0 if not specified. int32 NumInterOpThreadsFromEnvironment(); // Returns the TF_NUM_INTRAOP_THREADS environment value, or 0 if not specified. int32 NumIntraOpThreadsFromEnvironment(); // Returns the number of inter op threads specified in `options` or a default. // If no value or a negative value is specified in the provided options, then // the function returns the value defined in the TF_NUM_INTEROP_THREADS // environment variable. If neither a value is specified in the options or in // the environment, this function will return a reasonable default value based // on the number of schedulable CPUs, and any MKL and OpenMP configurations. int32 NumInterOpThreadsFromSessionOptions(const SessionOptions& options); // Creates a thread pool with number of inter op threads. thread::ThreadPool* NewThreadPoolFromSessionOptions( const SessionOptions& options); // Schedule "closure" in the default thread queue. void SchedClosure(std::function<void()> closure); // Schedule "closure" after the given number of microseconds in the // fixed-size ThreadPool used for non-blocking compute tasks. void SchedNonBlockingClosureAfter(int64_t micros, std::function<void()> closure); } // namespace tensorflow #endif // TENSORFLOW_CORE_COMMON_RUNTIME_PROCESS_UTIL_H_
// ********************************************************************************** // // BSD License. // This file is part of upnpx. // // Copyright (c) 2010-2011, Bruno Keymolen, email: bruno.keymolen@gmail.com // 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 "Bruno Keymolen" 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. // // ********************************************************************************** #import <Foundation/Foundation.h> #import "StateVariable.h" @interface StateVariableRange : StateVariable { int min; int max; } -(void)empty; -(int)setMinWithString:(NSString*)val; -(int)setMaxWithString:(NSString*)val; -(void)copyFromStateVariableRange:(StateVariableRange*)stateVar; @property(readwrite) int min; @property(readwrite) int max; @end
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_ #define CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_ #include <deque> #include <string> #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/time.h" #include "base/values.h" #include "sync/base/sync_export.h" #include "sync/protocol/sync.pb.h" namespace sync_pb { class ClientToServerResponse; class ClientToServerMessage; } namespace syncer { class SYNC_EXPORT_PRIVATE TrafficRecorder { public: enum TrafficMessageType { CLIENT_TO_SERVER_MESSAGE, CLIENT_TO_SERVER_RESPONSE, UNKNOWN_MESSAGE_TYPE }; struct SYNC_EXPORT_PRIVATE TrafficRecord { // The serialized message. std::string message; TrafficMessageType message_type; // If the message is too big to be kept in memory then it should be // truncated. For now the entire message is omitted if it is too big. // TODO(lipalani): Truncate the specifics to fit within size. bool truncated; TrafficRecord(const std::string& message, TrafficMessageType message_type, bool truncated, base::Time time); TrafficRecord(); ~TrafficRecord(); DictionaryValue* ToValue() const; // Time of record creation. base::Time timestamp; }; TrafficRecorder(unsigned int max_messages, unsigned int max_message_size); virtual ~TrafficRecorder(); void RecordClientToServerMessage(const sync_pb::ClientToServerMessage& msg); void RecordClientToServerResponse( const sync_pb::ClientToServerResponse& response); ListValue* ToValue() const; const std::deque<TrafficRecord>& records() { return records_; } private: void AddTrafficToQueue(TrafficRecord* record); void StoreProtoInQueue(const ::google::protobuf::MessageLite& msg, TrafficMessageType type); // Method to get record creation time. virtual base::Time GetTime(); // Maximum number of messages stored in the queue. unsigned int max_messages_; // Maximum size of each message. unsigned int max_message_size_; std::deque<TrafficRecord> records_; DISALLOW_COPY_AND_ASSIGN(TrafficRecorder); }; } // namespace syncer #endif // CHROME_BROWSER_SYNC_ENGINE_TRAFFIC_RECORDER_H_
/*========================================================================= Program: Visualization Toolkit Module: vtkSphericalDirectionEncoder.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkSphericalDirectionEncoder - A direction encoder based on spherical coordinates // .SECTION Description // vtkSphericalDirectionEncoder is a direction encoder which uses spherical // coordinates for mapping (nx, ny, nz) into an azimuth, elevation pair. // // .SECTION see also // vtkDirectionEncoder #ifndef __vtkSphericalDirectionEncoder_h #define __vtkSphericalDirectionEncoder_h #include "vtkRenderingVolumeModule.h" // For export macro #include "vtkDirectionEncoder.h" class VTKRENDERINGVOLUME_EXPORT vtkSphericalDirectionEncoder : public vtkDirectionEncoder { public: vtkTypeMacro(vtkSphericalDirectionEncoder,vtkDirectionEncoder); void PrintSelf( ostream& os, vtkIndent indent ); // Description: // Construct the object. Initialize the index table which will be // used to map the normal into a patch on the recursively subdivided // sphere. static vtkSphericalDirectionEncoder *New(); // Description: // Given a normal vector n, return the encoded direction int GetEncodedDirection( float n[3] ); // Description: /// Given an encoded value, return a pointer to the normal vector float *GetDecodedGradient( int value ); // Description: // Return the number of encoded directions int GetNumberOfEncodedDirections( void ) { return 65536; } // Description: // Get the decoded gradient table. There are // this->GetNumberOfEncodedDirections() entries in the table, each // containing a normal (direction) vector. This is a flat structure - // 3 times the number of directions floats in an array. float *GetDecodedGradientTable( void ) { return &(this->DecodedGradientTable[0]); } protected: vtkSphericalDirectionEncoder(); ~vtkSphericalDirectionEncoder(); static float DecodedGradientTable[65536*3]; // Description: // Initialize the table at startup static void InitializeDecodedGradientTable(); static int DecodedGradientTableInitialized; private: vtkSphericalDirectionEncoder(const vtkSphericalDirectionEncoder&); // Not implemented. void operator=(const vtkSphericalDirectionEncoder&); // Not implemented. }; #endif
// Copyright (c) 2011 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 UI_VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_ #define UI_VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_ #pragma once #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ui/views/controls/button/text_button.h" #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" #include "ui/views/examples/example_base.h" namespace views { class TabbedPane; namespace examples { // A TabbedPane example tests adding/removing/selecting tabs. class TabbedPaneExample : public ExampleBase, public ButtonListener, public TabbedPaneListener { public: TabbedPaneExample(); virtual ~TabbedPaneExample(); // ExampleBase: virtual void CreateExampleView(View* container) OVERRIDE; private: // ButtonListener: virtual void ButtonPressed(Button* sender, const Event& event) OVERRIDE; // TabbedPaneListener: virtual void TabSelectedAt(int index) OVERRIDE; // Print the status of the tab in the status area. void PrintStatus(); void AddButton(const std::string& label); // The tabbed pane to be tested. TabbedPane* tabbed_pane_; // Control buttons to add, remove or select tabs. Button* add_; Button* add_at_; Button* remove_at_; Button* select_at_; DISALLOW_COPY_AND_ASSIGN(TabbedPaneExample); }; } // namespace examples } // namespace views #endif // UI_VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_
// 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 ASH_SYSTEM_MEDIA_UNIFIED_MEDIA_CONTROLS_CONTROLLER_H_ #define ASH_SYSTEM_MEDIA_UNIFIED_MEDIA_CONTROLS_CONTROLLER_H_ #include "ash/ash_export.h" #include "base/containers/flat_set.h" #include "base/timer/timer.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/media_session/public/mojom/media_controller.mojom.h" namespace views { class View; } // namespace views namespace ash { class UnifiedMediaControlsView; // Controller class of UnifiedMediaControlsView. Handles events of the view // and updates the view when receives media session updates. class ASH_EXPORT UnifiedMediaControlsController : public media_session::mojom::MediaControllerObserver, public media_session::mojom::MediaControllerImageObserver { public: class Delegate { public: virtual ~Delegate() = default; virtual void ShowMediaControls() = 0; virtual void OnMediaControlsViewClicked() = 0; }; explicit UnifiedMediaControlsController(Delegate* deleate); ~UnifiedMediaControlsController() override; // media_session::mojom::MediaControllerObserver implementations. void MediaSessionInfoChanged( media_session::mojom::MediaSessionInfoPtr session_info) override; void MediaSessionMetadataChanged( const absl::optional<media_session::MediaMetadata>& metadata) override; void MediaSessionActionsChanged( const std::vector<media_session::mojom::MediaSessionAction>& actions) override; void MediaSessionChanged( const absl::optional<base::UnguessableToken>& request_id) override; void MediaSessionPositionChanged( const absl::optional<media_session::MediaPosition>& position) override {} // media_session::mojom::MediaControllerImageObserver implementations. void MediaControllerImageChanged( media_session::mojom::MediaSessionImageType type, const SkBitmap& bitmap) override; views::View* CreateView(); void OnMediaControlsViewClicked(); // Called from view when media buttons are pressed. void PerformAction(media_session::mojom::MediaSessionAction action); void FlushForTesting(); void set_media_controller_for_testing( mojo::Remote<media_session::mojom::MediaController> controller) { media_controller_remote_ = std::move(controller); } private: // Update view with pending data if necessary. Called when // |freeze_session_timer| is fired. void UpdateSession(); // Update artwork in media controls view. void UpdateArtwork(const SkBitmap& bitmap, bool should_start_hide_timer); // Reset all pending data to empty. void ResetPendingData(); bool ShouldShowMediaControls() const; void MaybeShowMediaControlsOrEmptyState(); // Weak ptr, owned by view hierarchy. UnifiedMediaControlsView* media_controls_ = nullptr; // Delegate for show/hide media controls. Delegate* const delegate_ = nullptr; mojo::Remote<media_session::mojom::MediaController> media_controller_remote_; mojo::Receiver<media_session::mojom::MediaControllerObserver> observer_receiver_{this}; mojo::Receiver<media_session::mojom::MediaControllerImageObserver> artwork_observer_receiver_{this}; std::unique_ptr<base::OneShotTimer> freeze_session_timer_ = std::make_unique<base::OneShotTimer>(); std::unique_ptr<base::OneShotTimer> hide_artwork_timer_ = std::make_unique<base::OneShotTimer>(); absl::optional<base::UnguessableToken> media_session_id_; media_session::mojom::MediaSessionInfoPtr session_info_; media_session::MediaMetadata session_metadata_; base::flat_set<media_session::mojom::MediaSessionAction> enabled_actions_; // Pending data to update when |freeze_session_tmier_| fired. absl::optional<base::UnguessableToken> pending_session_id_; absl::optional<media_session::mojom::MediaSessionInfoPtr> pending_session_info_; absl::optional<media_session::MediaMetadata> pending_metadata_; absl::optional<base::flat_set<media_session::mojom::MediaSessionAction>> pending_enabled_actions_; absl::optional<SkBitmap> pending_artwork_; }; } // namespace ash #endif // ASH_SYSTEM_MEDIA_UNIFIED_MEDIA_CONTROLS_CONTROLLER_H_
/* * Copyright © 2013 David Herrmann * * 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 (including the * next paragraph) 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. */ #include "config.h" #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "compositor.h" struct weston_logind; #if defined(HAVE_SYSTEMD_LOGIN) && defined(HAVE_DBUS) #include <systemd/sd-login.h> int weston_logind_open(struct weston_logind *wl, const char *path, int flags); void weston_logind_close(struct weston_logind *wl, int fd); void weston_logind_restore(struct weston_logind *wl); int weston_logind_activate_vt(struct weston_logind *wl, int vt); int weston_logind_connect(struct weston_logind **out, struct weston_compositor *compositor, const char *seat_id, int tty, bool sync_drm); void weston_logind_destroy(struct weston_logind *wl); static inline int weston_sd_session_get_vt(const char *sid, unsigned int *out) { #ifdef HAVE_SYSTEMD_LOGIN_209 return sd_session_get_vt(sid, out); #else int r; char *tty; r = sd_session_get_tty(sid, &tty); if (r < 0) return r; r = sscanf(tty, "tty%u", out); free(tty); if (r != 1) return -EINVAL; return 0; #endif } #else /* defined(HAVE_SYSTEMD_LOGIN) && defined(HAVE_DBUS) */ static inline int weston_logind_open(struct weston_logind *wl, const char *path, int flags) { return -ENOSYS; } static inline void weston_logind_close(struct weston_logind *wl, int fd) { } static inline void weston_logind_restore(struct weston_logind *wl) { } static inline int weston_logind_activate_vt(struct weston_logind *wl, int vt) { return -ENOSYS; } static inline int weston_logind_connect(struct weston_logind **out, struct weston_compositor *compositor, const char *seat_id, int tty, bool sync_drm) { return -ENOSYS; } static inline void weston_logind_destroy(struct weston_logind *wl) { } #endif /* defined(HAVE_SYSTEMD_LOGIN) && defined(HAVE_DBUS) */
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QABSTRACTSLIDER_P_H #define QABSTRACTSLIDER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "QtCore/qbasictimer.h" #include "QtCore/qelapsedtimer.h" #include "private/qwidget_p.h" #include "qstyle.h" QT_REQUIRE_CONFIG(abstractslider); QT_BEGIN_NAMESPACE class QAbstractSliderPrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QAbstractSlider) public: QAbstractSliderPrivate(); ~QAbstractSliderPrivate(); void setSteps(int single, int page); int minimum, maximum, pageStep, value, position, pressValue; /** * Call effectiveSingleStep() when changing the slider value. */ int singleStep; int singleStepFromItemView; // If we have itemViews we track the views preferred singleStep value. bool viewMayChangeSingleStep; float offset_accumulated; uint tracking : 1; uint blocktracking :1; uint pressed : 1; uint invertedAppearance : 1; uint invertedControls : 1; Qt::Orientation orientation; QBasicTimer repeatActionTimer; int repeatActionTime; QAbstractSlider::SliderAction repeatAction; #ifdef QT_KEYPAD_NAVIGATION int origValue; /** */ bool isAutoRepeating; /** * When we're auto repeating, we multiply singleStep with this value to * get our effective step. */ qreal repeatMultiplier; /** * The time of when the first auto repeating key press event occurs. */ QElapsedTimer firstRepeat; #endif inline int effectiveSingleStep() const { return singleStep #ifdef QT_KEYPAD_NAVIGATION * repeatMultiplier #endif ; } void itemviewChangeSingleStep(int step); virtual int bound(int val) const { return qMax(minimum, qMin(maximum, val)); } inline int overflowSafeAdd(int add) const { int newValue = value + add; if (add > 0 && newValue < value) newValue = maximum; else if (add < 0 && newValue > value) newValue = minimum; return newValue; } inline void setAdjustedSliderPosition(int position) { Q_Q(QAbstractSlider); if (q->style()->styleHint(QStyle::SH_Slider_StopMouseOverSlider, 0, q)) { if ((position > pressValue - 2 * pageStep) && (position < pressValue + 2 * pageStep)) { repeatAction = QAbstractSlider::SliderNoAction; q->setSliderPosition(pressValue); return; } } q->triggerAction(repeatAction); } bool scrollByDelta(Qt::Orientation orientation, Qt::KeyboardModifiers modifiers, int delta); }; QT_END_NAMESPACE #endif // QABSTRACTSLIDER_P_H
/* * Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ #ifndef B2_SHAPE_H #define B2_SHAPE_H #include "Box2D/Common/b2BlockAllocator.h" #include "Box2D/Common/b2Math.h" #include "Box2D/Collision/b2Collision.h" /// This holds the mass data computed for a shape. struct b2MassData { /// The mass of the shape, usually in kilograms. float32 mass; /// The position of the shape's centroid relative to the shape's origin. b2Vec2 center; /// The rotational inertia of the shape about the local origin. float32 I; }; /// A shape is used for collision detection. You can create a shape however you like. /// Shapes used for simulation in b2World are created automatically when a b2Fixture /// is created. class b2Shape { public: enum Type { e_unknown= -1, e_circle = 0, e_polygon = 1, e_typeCount = 2, }; b2Shape() { m_type = e_unknown; } virtual ~b2Shape() {} /// Clone the concrete shape using the provided allocator. virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; /// Get the type of this shape. You can use this to down cast to the concrete shape. /// @return the shape type. Type GetType() const; /// Test a point for containment in this shape. This only works for convex shapes. /// @param xf the shape world transform. /// @param p a point in world coordinates. virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; /// Cast a ray against this shape. /// @param output the ray-cast results. /// @param input the ray-cast input parameters. /// @param transform the transform to be applied to the shape. virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, const b2Transform& transform) const = 0; /// Given a transform, compute the associated axis aligned bounding box for this shape. /// @param aabb returns the axis aligned box. /// @param xf the world transform of the shape. virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf) const = 0; /// Compute the mass properties of this shape using its dimensions and density. /// The inertia tensor is computed about the local origin. /// @param massData returns the mass data for this shape. /// @param density the density in kilograms per meter squared. virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; Type m_type; float32 m_radius; }; inline b2Shape::Type b2Shape::GetType() const { return m_type; } #endif
/* Copyright (c) 2012-2017 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 "antlr4-common.h" namespace antlr4 { namespace tree { namespace pattern { /// Represents the result of matching a ParseTree against a tree pattern. class ANTLR4CPP_PUBLIC ParseTreeMatch { private: /// This is the backing field for getTree(). ParseTree *_tree; /// This is the backing field for getPattern(). const ParseTreePattern &_pattern; /// This is the backing field for getLabels(). std::map<std::string, std::vector<ParseTree *>> _labels; /// This is the backing field for getMismatchedNode(). ParseTree *_mismatchedNode; public: /// <summary> /// Constructs a new instance of <seealso cref="ParseTreeMatch"/> from the specified /// parse tree and pattern. /// </summary> /// <param name="tree"> The parse tree to match against the pattern. </param> /// <param name="pattern"> The parse tree pattern. </param> /// <param name="labels"> A mapping from label names to collections of /// <seealso cref="ParseTree"/> objects located by the tree pattern matching process. </param> /// <param name="mismatchedNode"> The first node which failed to match the tree /// pattern during the matching process. /// </param> /// <exception cref="IllegalArgumentException"> if {@code tree} is {@code null} </exception> /// <exception cref="IllegalArgumentException"> if {@code pattern} is {@code null} </exception> /// <exception cref="IllegalArgumentException"> if {@code labels} is {@code null} </exception> ParseTreeMatch(ParseTree *tree, ParseTreePattern const& pattern, const std::map<std::string, std::vector<ParseTree *>> &labels, ParseTree *mismatchedNode); ParseTreeMatch(ParseTreeMatch const&) = default; virtual ~ParseTreeMatch(); /// <summary> /// Get the last node associated with a specific {@code label}. /// <p/> /// For example, for pattern {@code <id:ID>}, {@code get("id")} returns the /// node matched for that {@code ID}. If more than one node /// matched the specified label, only the last is returned. If there is /// no node associated with the label, this returns {@code null}. /// <p/> /// Pattern tags like {@code <ID>} and {@code <expr>} without labels are /// considered to be labeled with {@code ID} and {@code expr}, respectively. /// </summary> /// <param name="labe"> The label to check. /// </param> /// <returns> The last <seealso cref="ParseTree"/> to match a tag with the specified /// label, or {@code null} if no parse tree matched a tag with the label. </returns> virtual ParseTree* get(const std::string &label); /// <summary> /// Return all nodes matching a rule or token tag with the specified label. /// <p/> /// If the {@code label} is the name of a parser rule or token in the /// grammar, the resulting list will contain both the parse trees matching /// rule or tags explicitly labeled with the label and the complete set of /// parse trees matching the labeled and unlabeled tags in the pattern for /// the parser rule or token. For example, if {@code label} is {@code "foo"}, /// the result will contain <em>all</em> of the following. /// /// <ul> /// <li>Parse tree nodes matching tags of the form {@code <foo:anyRuleName>} and /// {@code <foo:AnyTokenName>}.</li> /// <li>Parse tree nodes matching tags of the form {@code <anyLabel:foo>}.</li> /// <li>Parse tree nodes matching tags of the form {@code <foo>}.</li> /// </ul> /// </summary> /// <param name="labe"> The label. /// </param> /// <returns> A collection of all <seealso cref="ParseTree"/> nodes matching tags with /// the specified {@code label}. If no nodes matched the label, an empty list /// is returned. </returns> virtual std::vector<ParseTree *> getAll(const std::string &label); /// <summary> /// Return a mapping from label &rarr; [list of nodes]. /// <p/> /// The map includes special entries corresponding to the names of rules and /// tokens referenced in tags in the original pattern. For additional /// information, see the description of <seealso cref="#getAll(String)"/>. /// </summary> /// <returns> A mapping from labels to parse tree nodes. If the parse tree /// pattern did not contain any rule or token tags, this map will be empty. </returns> virtual std::map<std::string, std::vector<ParseTree *>>& getLabels(); /// <summary> /// Get the node at which we first detected a mismatch. /// </summary> /// <returns> the node at which we first detected a mismatch, or {@code null} /// if the match was successful. </returns> virtual ParseTree* getMismatchedNode(); /// <summary> /// Gets a value indicating whether the match operation succeeded. /// </summary> /// <returns> {@code true} if the match operation succeeded; otherwise, /// {@code false}. </returns> virtual bool succeeded(); /// <summary> /// Get the tree pattern we are matching against. /// </summary> /// <returns> The tree pattern we are matching against. </returns> virtual const ParseTreePattern& getPattern(); /// <summary> /// Get the parse tree we are trying to match to a pattern. /// </summary> /// <returns> The <seealso cref="ParseTree"/> we are trying to match to a pattern. </returns> virtual ParseTree* getTree(); virtual std::string toString(); }; } // namespace pattern } // namespace tree } // namespace antlr4
#ifndef ECRYPTFS_DEK_H #define ECRYPTFS_DEK_H #include <linux/fs.h> #include <sdp/dek_common.h> #include "ecryptfs_kernel.h" #define ECRYPTFS_DEK_XATTR_NAME "user.sdp" #define ECRYPTFS_DEK_DEBUG 0 #define O_SDP 0x10000000 int ecryptfs_super_block_get_userid(struct super_block *sb); int ecryptfs_is_valid_userid(int userid); int ecryptfs_is_persona_locked(int userid); void ecryptfs_clean_sdp_dek(struct ecryptfs_crypt_stat *crypt_stat); int ecryptfs_get_sdp_dek(struct ecryptfs_crypt_stat *crypt_stat); int ecryptfs_sdp_convert_dek(struct dentry *dentry); int ecryptfs_parse_xattr_is_sensitive(const void *data, int len); int write_dek_packet(char *dest, struct ecryptfs_crypt_stat *crypt_stat, size_t *written); int parse_dek_packet(char *data, struct ecryptfs_crypt_stat *crypt_stat, size_t *packet_size); long ecryptfs_do_sdp_ioctl(struct file *file, unsigned int cmd, unsigned long arg); int ecryptfs_sdp_set_sensitive(struct dentry *dentry); int ecryptfs_sdp_set_protected(struct dentry *dentry); #define ECRYPTFS_EVT_RENAME_TO_CHAMBER 1 #define ECRYPTFS_EVT_RENAME_OUT_OF_CHAMBER 2 /* ioctl for SDP */ typedef struct _dek_arg_sdp_info { int sdp_enabled; int is_sensitive; unsigned int type; }dek_arg_get_sdp_info; typedef struct _dek_arg_set_sensitive { int persona_id; }dek_arg_set_sensitive; #define ECRYPTFS_IOCTL_GET_SDP_INFO _IOR('l', 0x11, __u32) #define ECRYPTFS_IOCTL_SET_SENSITIVE _IOW('l', 0x15, __u32) #endif /* #ifndef ECRYPTFS_DEK_H */
/* This file is part of the KDE project Copyright (C) 2009 Thorsten Zachmann <zachmann@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KOPAPAGECONTAINERMODEL_H #define KOPAPAGECONTAINERMODEL_H #include <KoShapeContainerDefaultModel.h> class KoPAPageContainerModel : public KoShapeContainerDefaultModel { public: KoPAPageContainerModel(); virtual ~KoPAPageContainerModel(); virtual void childChanged(KoShape *child, KoShape::ChangeType type); }; #endif /* KOPAPAGECONTAINERMODEL_H */
/* * This file is part of the coreboot project. * * Copyright (C) 2013 DMP Electronics Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <device/azalia_device.h> #include <device/pci.h> #include <device/pci_ids.h> /* RDC HD audio controller */ static const struct pci_driver rdc_audio __pci_driver = { .ops = &default_azalia_audio_ops, .vendor = PCI_VENDOR_ID_RDC, .device = 0x3010, };
/* Example of a fix-it hint that adds a #include directive, adding them to the top of the file, given that there is no pre-existing #include. */ /* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -Wno-implicit-function-declaration" } */ void test (int i, int j) { printf ("%i of %i\n", i, j); /* { dg-warning "implicit declaration" } */ /* { dg-message "include '<stdio.h>' or provide a declaration of 'printf'" "" { target *-*-* } 1 } */ #if 0 /* { dg-begin-multiline-output "" } 9 | printf ("%i of %i\n", i, j); | ^~~~~~ { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } +++ |+#include <stdio.h> 1 | /* Example of a fix-it hint that adds a #include directive, { dg-end-multiline-output "" } */ #endif }
#include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include "c.h" #include "nls.h" #include "partx.h" #include "strutils.h" static void __attribute__ ((__noreturn__)) usage(FILE * out) { fputs(USAGE_HEADER, out); fprintf(out, _(" %s <disk device> <partition number>\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, out); fputs(USAGE_HELP, out); fputs(USAGE_VERSION, out); fprintf(out, USAGE_MAN_TAIL("delpart(8)")); exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS); } int main(int argc, char **argv) { int c, fd; static const struct option longopts[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {NULL, no_argument, 0, '0'}, }; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1) switch (c) { case 'V': printf(UTIL_LINUX_VERSION); return EXIT_SUCCESS; case 'h': usage(stdout); default: usage(stderr); } if (argc != 3) usage(stderr); if ((fd = open(argv[1], O_RDONLY)) < 0) err(EXIT_FAILURE, _("cannot open %s"), argv[1]); if (partx_del_partition(fd, strtou32_or_err(argv[2], _("invalid partition number argument")))) err(EXIT_FAILURE, _("failed to remove partition")); return EXIT_SUCCESS; }
/* Copyright (C) 2013 - 2014 CurlyMo This file is part of pilight. pilight 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. pilight 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 pilight. If not, see <http://www.gnu.org/licenses/> */ #ifndef _CONFIG_H_ #define _CONFIG_H_ #include "json.h" #define CONFIG_INTERNAL 0 #define CONFIG_FORWARD 1 #define CONFIG_USER 2 typedef struct config_t { char *name; int (*parse)(JsonNode *); int readorder; int writeorder; JsonNode *(*sync)(int level, const char *media); int (*gc)(void); struct config_t *next; } config_t; int config_write(int level, const char *media); int config_read(void); int config_parse(struct JsonNode *root); struct JsonNode *config_print(int level, const char *media); int config_set_file(char *settfile); void config_register(config_t **listener, const char *name); int config_gc(void); int config_set_file(char *settfile); char *config_get_file(void); void config_init(void); #endif
/* Copyright 2012 10gen 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 <boost/scoped_array.hpp> #include <sasl/sasl.h> #include <string> #include <vector> #include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" namespace mongo { /** * Implementation of the client side of a SASL authentication conversation. * * To use, create an instance, then use setParameter() to configure the authentication * parameters. Once all parameters are set, call initialize() to initialize the client state * machine. Finally, use repeated calls to step() to generate messages to send to the server * and process server responses. * * The required parameters vary by mechanism, but all mechanisms require parameterServiceName, * parameterServiceHostname, parameterMechanism and parameterUser. All of the required * parameters must be UTF-8 encoded strings with no embedded NUL characters. The * parameterPassword parameter is not constrained. */ class SaslClientSession { MONGO_DISALLOW_COPYING(SaslClientSession); public: /** * Identifiers of parameters used to configure a SaslClientSession. */ enum Parameter { parameterServiceName = 0, parameterServiceHostname, parameterMechanism, parameterUser, parameterPassword, numParameters // Must be last }; SaslClientSession(); ~SaslClientSession(); /** * Sets the parameter identified by "id" to "value". * * The value of "id" must be one of the legal values of Parameter less than numParameters. * May be called repeatedly for the same value of "id", with the last "value" replacing * previous values. * * The session object makes and owns a copy of the data in "value". */ void setParameter(Parameter id, const StringData& value); /** * Returns true if "id" identifies a parameter previously set by a call to setParameter(). */ bool hasParameter(Parameter id); /** * Returns the value of a previously set parameter. * * If parameter "id" was never set, returns an empty StringData. Note that a parameter may * be explicitly set to StringData(), so use hasParameter() to distinguish those cases. * * The session object owns the storage behind the returned StringData, which will remain * valid until setParameter() is called with the same value of "id", or the session object * goes out of scope. */ StringData getParameter(Parameter id); /** * Returns the value of the parameterPassword parameter in the form of a sasl_secret_t, used * by the Cyrus SASL library's SASL_CB_PASS callback. The session object owns the storage * referenced by the returned sasl_secret_t*, which will remain in scope according to the * same rules as given for getParameter(), above. */ sasl_secret_t* getPasswordAsSecret(); /** * Initializes a session for use. * * Call exactly once, after setting any parameters you intend to set via setParameter(). */ Status initialize(); /** * Takes one step of the SASL protocol on behalf of the client. * * Caller should provide data from the server side of the conversation in "inputData", or an * empty StringData() if none is available. If the client should make a response to the * server, stores the response into "*outputData". * * Returns Status::OK() on success. Any other return value indicates a failed * authentication, though the specific return value may provide insight into the cause of * the failure (e.g., ProtocolError, AuthenticationFailed). * * In the event that this method returns Status::OK(), consult the value of isDone() to * determine if the conversation has completed. When step() returns Status::OK() and * isDone() returns true, authentication has completed successfully. */ Status step(const StringData& inputData, std::string* outputData); /** * Returns true if the authentication completed successfully. */ bool isDone() const { return _done; } private: /** * Buffer object that owns data for a single parameter. */ struct DataBuffer { boost::scoped_array<char> data; size_t size; }; /// Maximum number of Cyrus SASL callbacks stored in _callbacks. static const int maxCallbacks = 4; /// Underlying Cyrus SASL library connection object. sasl_conn_t* _saslConnection; /// Callbacks registered on _saslConnection for providing the Cyrus SASL library with /// parameter values, etc. sasl_callback_t _callbacks[maxCallbacks]; /// Buffers for each of the settable parameters. DataBuffer _parameters[numParameters]; /// Number of successfully completed conversation steps. int _step; /// See isDone(). bool _done; }; } // namespace mongo
// This file is part of XmlPlus package // // Copyright (C) 2010-2013 Satya Prakash Tripathi // // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE VERSION 3 as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU LESSER GENERAL PUBLIC LICENSE VERSION 3 for more details. // // You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE VERSION 3 // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef __XPLUS_YEAR__ #define __XPLUS_YEAR__ #include "DateTime.h" namespace XPlus { class Year : public DateTime { public: Year(int year=DateTime::MIN_VALID_YEAR): DateTime(year, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED) {} Year(const DateTime& dt): DateTime(dt.year(), DateTime::UNSPECIFIED, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED, DateTime::UNSPECIFIED) {} int year() const { return DateTime::year(); } Year& operator += (const Duration& d) { return dynamic_cast<Year&>(DateTime::operator+=(d)); } Year& operator -= (const Duration& d) { return dynamic_cast<Year&>(DateTime::operator-=(d)); } Year& operator = (const DateTime& dateTime) { return dynamic_cast<Year&>(DateTime::operator=(dateTime)); } bool operator == (const DateTime& dateTime) const { return DateTime::operator==(dateTime); } bool operator != (const DateTime& dateTime) const { return DateTime::operator!=(dateTime); } bool operator < (const DateTime& dateTime) const { return DateTime::operator<(dateTime); } bool operator <= (const DateTime& dateTime) const { return DateTime::operator<=(dateTime); } bool operator > (const DateTime& dateTime) const { return DateTime::operator>(dateTime); } bool operator >= (const DateTime& dateTime) const { return DateTime::operator>=(dateTime); } }; } #endif
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #ifdef USE_TI_UIIOSPROGRESSBARSTYLE #import <TitaniumKit/TiProxy.h> @interface TiUIiOSProgressBarStyleProxy : TiProxy { } @property (nonatomic, readonly) NSNumber *DEFAULT; @property (nonatomic, readonly) NSNumber *PLAIN; @property (nonatomic, readonly) NSNumber *BAR; @end #endif
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ecs/ECS_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/ecs/model/Task.h> #include <aws/ecs/model/Failure.h> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace ECS { namespace Model { /* $shape.documentation */ class AWS_ECS_API DescribeTasksResult { public: DescribeTasksResult(); DescribeTasksResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DescribeTasksResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /* <p>The list of tasks.</p> */ inline const Aws::Vector<Task>& GetTasks() const{ return m_tasks; } /* <p>The list of tasks.</p> */ inline void SetTasks(const Aws::Vector<Task>& value) { m_tasks = value; } /* <p>The list of tasks.</p> */ inline void SetTasks(Aws::Vector<Task>&& value) { m_tasks = value; } /* <p>The list of tasks.</p> */ inline DescribeTasksResult& WithTasks(const Aws::Vector<Task>& value) { SetTasks(value); return *this;} /* <p>The list of tasks.</p> */ inline DescribeTasksResult& WithTasks(Aws::Vector<Task>&& value) { SetTasks(value); return *this;} /* <p>The list of tasks.</p> */ inline DescribeTasksResult& AddTasks(const Task& value) { m_tasks.push_back(value); return *this; } /* <p>The list of tasks.</p> */ inline DescribeTasksResult& AddTasks(Task&& value) { m_tasks.push_back(value); return *this; } inline const Aws::Vector<Failure>& GetFailures() const{ return m_failures; } inline void SetFailures(const Aws::Vector<Failure>& value) { m_failures = value; } inline void SetFailures(Aws::Vector<Failure>&& value) { m_failures = value; } inline DescribeTasksResult& WithFailures(const Aws::Vector<Failure>& value) { SetFailures(value); return *this;} inline DescribeTasksResult& WithFailures(Aws::Vector<Failure>&& value) { SetFailures(value); return *this;} inline DescribeTasksResult& AddFailures(const Failure& value) { m_failures.push_back(value); return *this; } inline DescribeTasksResult& AddFailures(Failure&& value) { m_failures.push_back(value); return *this; } private: Aws::Vector<Task> m_tasks; Aws::Vector<Failure> m_failures; }; } // namespace Model } // namespace ECS } // namespace Aws
/* * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef SVGRectElement_h #define SVGRectElement_h #include "core/SVGNames.h" #include "core/svg/SVGAnimatedBoolean.h" #include "core/svg/SVGAnimatedLength.h" #include "core/svg/SVGGeometryElement.h" namespace blink { class SVGRectElement FINAL : public SVGGeometryElement { DEFINE_WRAPPERTYPEINFO(); public: DECLARE_NODE_FACTORY(SVGRectElement); SVGAnimatedLength* x() const { return m_x.get(); } SVGAnimatedLength* y() const { return m_y.get(); } SVGAnimatedLength* width() const { return m_width.get(); } SVGAnimatedLength* height() const { return m_height.get(); } SVGAnimatedLength* rx() const { return m_rx.get(); } SVGAnimatedLength* ry() const { return m_ry.get(); } private: explicit SVGRectElement(Document&); bool isSupportedAttribute(const QualifiedName&); virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; virtual bool selfHasRelativeLengths() const OVERRIDE; virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; RefPtr<SVGAnimatedLength> m_x; RefPtr<SVGAnimatedLength> m_y; RefPtr<SVGAnimatedLength> m_width; RefPtr<SVGAnimatedLength> m_height; RefPtr<SVGAnimatedLength> m_rx; RefPtr<SVGAnimatedLength> m_ry; }; } // namespace blink #endif // SVGRectElement_h