text
stringlengths
4
6.14k
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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. * * $URL$ * $Id$ * */ /** * @file * Sound decoder used in engines: * - saga * - sci * - sword1 */ #ifndef SOUND_AIFF_H #define SOUND_AIFF_H #include "common/scummsys.h" #include "common/types.h" namespace Common { class SeekableReadStream; } namespace Audio { class SeekableAudioStream; /** * Try to load an AIFF from the given seekable stream. Returns true if * successful. In that case, the stream's seek position will be set to the * start of the audio data, and size, rate and flags contain information * necessary for playback. Currently this function only supports uncompressed * raw PCM data as well as IMA ADPCM. */ extern bool loadAIFFFromStream(Common::SeekableReadStream &stream, int &size, int &rate, byte &flags); /** * Try to load an AIFF from the given seekable stream and create an AudioStream * from that data. * * This function uses loadAIFFFromStream() internally. * * @param stream the SeekableReadStream from which to read the AIFF data * @param disposeAfterUse whether to delete the stream after use * @return a new SeekableAudioStream, or NULL, if an error occurred */ SeekableAudioStream *makeAIFFStream( Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse); } // End of namespace Audio #endif
/* spaces_dash.c */ #include <ctype.h> void spaces_dash (char *str, int n) { int i; for ( i = 0; i < n; i++) { if (str[i] == ' ' ) { str[i] += 13; // asci(dash) - asci(spaces) = 45 - 32 = 13 } } }
/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ #include <u.h> #include <libc.h> void main(int argc, char *argv[]) { ulong num = 1; int i; if (argc > 1) num = strtoul(argv[1], 0, 0); print("Try to malloc %ulld bytes in %ld loops\n", num*0x200000ULL, num); for(i = 0; i < num; i++) if (sbrk(0x200000) == nil){ print("%d sbrk failed\n", i); break; } print("Did it\n"); while(1); } /* 6c bigloop.c; 6l -o bigloop bigloop.6 */
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2022 UniPro <ugene@unipro.ru> * http://ugene.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef _U2_SPADES_SUPPORT_H_ #define _U2_SPADES_SUPPORT_H_ #include "U2Core/ExternalToolRegistry.h" namespace U2 { class SpadesSupport : public ExternalTool { Q_OBJECT public: /** Registers SPAdes tool in UGENE. */ static void checkIn(); static const QString ET_SPADES; static const QString ET_SPADES_ID; private: SpadesSupport(); }; } // namespace U2 #endif // _U2_SPADES_SUPPORT_H_
/* * Linux/PA-RISC Project (http://www.parisc-linux.org/) * * Floating-point emulation code * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * BEGIN_DESC * * File: * @(#) pa/spmath/sfsqrt.c $Revision: 573 $ * * Purpose: * Single Floating-point Square Root * * External Interfaces: * sgl_fsqrt(srcptr,nullptr,dstptr,status) * * Internal Interfaces: * * Theory: * <<please update with a overview of the operation of this file>> * * END_DESC */ #include "float.h" #include "sgl_float.h" /* * Single Floating-point Square Root */ /*ARGSUSED*/ unsigned int sgl_fsqrt( sgl_floating_point *srcptr, unsigned int *nullptr, sgl_floating_point *dstptr, unsigned int *status) { register unsigned int src, result; register int src_exponent; register unsigned int newbit, sum; register boolean guardbit = FALSE, even_exponent; src = *srcptr; /* * check source operand for NaN or infinity */ if ((src_exponent = Sgl_exponent(src)) == SGL_INFINITY_EXPONENT) { /* * is signaling NaN? */ if (Sgl_isone_signaling(src)) { /* trap if INVALIDTRAP enabled */ if (Is_invalidtrap_enabled()) return(INVALIDEXCEPTION); /* make NaN quiet */ Set_invalidflag(); Sgl_set_quiet(src); } /* * Return quiet NaN or positive infinity. * Fall thru to negative test if negative infinity. */ if (Sgl_iszero_sign(src) || Sgl_isnotzero_mantissa(src)) { *dstptr = src; return(NOEXCEPTION); } } /* * check for zero source operand */ if (Sgl_iszero_exponentmantissa(src)) { *dstptr = src; return(NOEXCEPTION); } /* * check for negative source operand */ if (Sgl_isone_sign(src)) { /* trap if INVALIDTRAP enabled */ if (Is_invalidtrap_enabled()) return(INVALIDEXCEPTION); /* make NaN quiet */ Set_invalidflag(); Sgl_makequietnan(src); *dstptr = src; return(NOEXCEPTION); } /* * Generate result */ if (src_exponent > 0) { even_exponent = Sgl_hidden(src); Sgl_clear_signexponent_set_hidden(src); } else { /* normalize operand */ Sgl_clear_signexponent(src); src_exponent++; Sgl_normalize(src,src_exponent); even_exponent = src_exponent & 1; } if (even_exponent) { /* exponent is even */ /* Add comment here. Explain why odd exponent needs correction */ Sgl_leftshiftby1(src); } /* * Add comment here. Explain following algorithm. * * Trust me, it works. * */ Sgl_setzero(result); newbit = 1 << SGL_P; while (newbit && Sgl_isnotzero(src)) { Sgl_addition(result,newbit,sum); if(sum <= Sgl_all(src)) { /* update result */ Sgl_addition(result,(newbit<<1),result); Sgl_subtract(src,sum,src); } Sgl_rightshiftby1(newbit); Sgl_leftshiftby1(src); } /* correct exponent for pre-shift */ if (even_exponent) { Sgl_rightshiftby1(result); } /* check for inexact */ if (Sgl_isnotzero(src)) { if (!even_exponent && Sgl_islessthan(result,src)) Sgl_increment(result); guardbit = Sgl_lowmantissa(result); Sgl_rightshiftby1(result); /* now round result */ switch (Rounding_mode()) { case ROUNDPLUS: Sgl_increment(result); break; case ROUNDNEAREST: /* stickybit is always true, so guardbit * is enough to determine rounding */ if (guardbit) { Sgl_increment(result); } break; } /* increment result exponent by 1 if mantissa overflowed */ if (Sgl_isone_hiddenoverflow(result)) src_exponent+=2; if (Is_inexacttrap_enabled()) { Sgl_set_exponent(result, ((src_exponent-SGL_BIAS)>>1)+SGL_BIAS); *dstptr = result; return(INEXACTEXCEPTION); } else Set_inexactflag(); } else { Sgl_rightshiftby1(result); } Sgl_set_exponent(result,((src_exponent-SGL_BIAS)>>1)+SGL_BIAS); *dstptr = result; return(NOEXCEPTION); }
/* * (C) Copyright 2009 * Stefano Babic, DENX Software Engineering, sbabic@denx.de. * * 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 _IMXIMAGE_H_ #define _IMXIMAGE_H_ #define MAX_HW_CFG_SIZE 60 /* Max number of registers imx can set */ #define MAX_EXP_SIZE 4 #define APP_CODE_BARKER 0xB1 #define DCD_BARKER 0xB17219E9 #define HEADER_OFFSET 0x400 #define CMD_DATA_STR "DATA" #define FLASH_OFFSET_STANDARD 0x400 #define FLASH_OFFSET_NAND FLASH_OFFSET_STANDARD #define FLASH_OFFSET_SD FLASH_OFFSET_STANDARD #define FLASH_OFFSET_SPI FLASH_OFFSET_STANDARD #define FLASH_OFFSET_ONENAND 0x100 enum imximage_cmd { CMD_INVALID, CMD_BOOT_FROM, CMD_DATA }; enum imximage_fld_types { CFG_INVALID = -1, CFG_COMMAND, CFG_REG_SIZE, CFG_REG_ADDRESS, CFG_REG_VALUE }; typedef struct { uint8_t rsa_exponent[MAX_EXP_SIZE]; /* RSA public exponent */ uint8_t *rsa_modulus; /* RSA modulus pointer */ uint16_t exponent_size; /* Exponent size (bytes) */ uint16_t modulus_size; /* Modulus size (bytes) */ uint8_t init_flag; /* key initialized */ } hab_rsa_public_key; typedef struct { uint32_t type; /* Type of pointer (byte, halfword, word, wait/read) */ uint32_t addr; /* Address to write to */ uint32_t value; /* Data to write */ } dcd_type_addr_data_t; typedef struct { uint32_t barker; /* Barker for sanity check */ uint32_t length; /* Device configuration length (without preamble) */ } dcd_preamble_t; typedef struct { dcd_preamble_t preamble; dcd_type_addr_data_t addr_data[MAX_HW_CFG_SIZE]; } dcd_t; typedef struct { uint32_t app_code_jump_vector; uint32_t app_code_barker; uint32_t app_code_csf; uint32_t dcd_ptr_ptr; hab_rsa_public_key *super_root_key; uint32_t dcd_ptr; uint32_t app_dest_ptr; } flash_header_t; typedef struct { uint32_t length; /* Length of data to be read from flash */ } flash_cfg_parms_t; struct imx_header { flash_header_t fhdr; dcd_t dcd_table; flash_cfg_parms_t ext_header; uint32_t flash_offset; }; struct reg_config { uint32_t raddr; uint32_t rdata; }; #endif /* _IMXIMAGE_H_ */
#ifndef _RP_KQUEUE_H_ #define _RP_KQUEUE_H_ #include <sys/types.h> #include <sys/event.h> #include "rp_event.h" typedef struct { int kqfd; struct kevent *events; } rp_kqueue_data_t; rp_event_handler_t *rp_kqueue_init(rp_event_handler_t *eh); int rp_kqueue_add(struct rp_event_handler *eh, int sockfd, rp_event_t *e); int rp_kqueue_del(struct rp_event_handler *eh, int sockfd, rp_event_t *e); void rp_kqueue_wait(struct rp_event_handler *eh, struct timeval *timeout); #endif /* _RP_KQUEUE_H_ */
#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <stdarg.h> #include "config.h" #ifndef HAVE_SYS_ERRLIST_DECLARED /* RHLinux defines this in stdio.h -- not very std. */ extern char *sys_errlist[]; /* builtin list of text error messages */ #endif /* die() - print an error message and exit */ /* notes: prints text message from errno */ /* parameters just like printf() */ void die(char *format, ...) { va_list parms; va_start(parms, format); printf("Fatal error: "); vprintf(format, parms); printf(errno ? " (%s)\n" : "\n", strerror(errno)); exit(1); }
/* this file is part of evince, a gnome document viewer * * Copyright (C) 2010 Jose Aliste * * Author: * Jose Aliste <jose.aliste@gmail.com> * * Evince 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. * * Evince 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 EV_WINDOW_DBUS_H #define EV_WINDOW_DBUS_H #include <glib.h> #include <gtk/gtk.h> #include "ev-link.h" G_BEGIN_DECLS typedef struct _EvWindowDBus EvWindowDBus; typedef struct _EvWindowDBusClass EvWindowDBusClass; typedef struct _EvWindowDBusPrivate EvWindowDBusPrivate; #define EV_TYPE_WINDOW_DBUS (ev_window_dbus_get_type()) #define EV_WINDOW_DBUS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_WINDOW_DBUS, EvWindowDBus)) #define EV_WINDOW_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_WINDOW_DBUS, EvWindowDBusClass)) #define EV_IS_WINDOW_DBUS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_WINDOW_DBUS)) #define EV_IS_WINDOW_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_WINDOW_DBUS)) #define EV_WINDOW_DBUS_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_WINDOW_DBUS, EvWindowDBusClass)) struct _EvWindowDBus { EvWindow base_instance; }; struct _EvWindowDBusClass { EvWindowClass base_class; }; GType ev_window_dbus_get_type (void) G_GNUC_CONST; GtkWidget *ev_window_dbus_new (void); G_END_DECLS #endif /* !EV_WINDOW_DBUS_H */
/* * Open Firm Accounting * A double-entry accounting application for professional services. * * Copyright (C) 2014-2020 Pierre Wieser (see AUTHORS) * * Open Firm Accounting 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. * * Open Firm Accounting 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 Open Firm Accounting; see the file COPYING. If not, * see <http://www.gnu.org/licenses/>. * * Authors: * Pierre Wieser <pwieser@trychlos.org> */ #ifndef __OFA_MYSQL_DOSSIER_BIN_H__ #define __OFA_MYSQL_DOSSIER_BIN_H__ /** * SECTION: ofa_mysql_dossier_bin * @short_description: #ofaMysql class definition. * * Let the user enter connection informations. * * Development rules: * - type: bin (parent='top') * - validation: yes (has 'my-ibin-changed' signal) * - settings: no * - current: no */ #include <gtk/gtk.h> #include "api/ofa-idbdossier-meta-def.h" #include "mysql/ofa-mysql-dbprovider.h" G_BEGIN_DECLS #define OFA_TYPE_MYSQL_DOSSIER_BIN ( ofa_mysql_dossier_bin_get_type()) #define OFA_MYSQL_DOSSIER_BIN( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, OFA_TYPE_MYSQL_DOSSIER_BIN, ofaMysqlDossierBin )) #define OFA_MYSQL_DOSSIER_BIN_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, OFA_TYPE_MYSQL_DOSSIER_BIN, ofaMysqlDossierBinClass )) #define OFA_IS_MYSQL_DOSSIER_BIN( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, OFA_TYPE_MYSQL_DOSSIER_BIN )) #define OFA_IS_MYSQL_DOSSIER_BIN_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), OFA_TYPE_MYSQL_DOSSIER_BIN )) #define OFA_MYSQL_DOSSIER_BIN_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), OFA_TYPE_MYSQL_DOSSIER_BIN, ofaMysqlDossierBinClass )) typedef struct { /*< public members >*/ GtkBin parent; } ofaMysqlDossierBin; typedef struct { /*< public members >*/ GtkBinClass parent; } ofaMysqlDossierBinClass; GType ofa_mysql_dossier_bin_get_type ( void ) G_GNUC_CONST; ofaMysqlDossierBin *ofa_mysql_dossier_bin_new ( ofaMysqlDBProvider *provider, const gchar *settings_prefix, guint rule ); const gchar *ofa_mysql_dossier_bin_get_host ( ofaMysqlDossierBin *bin ); guint ofa_mysql_dossier_bin_get_port ( ofaMysqlDossierBin *bin ); const gchar *ofa_mysql_dossier_bin_get_socket ( ofaMysqlDossierBin *bin ); void ofa_mysql_dossier_bin_set_dossier_meta( ofaMysqlDossierBin *bin, ofaIDBDossierMeta *dossier_meta ); G_END_DECLS #endif /* __OFA_MYSQL_DOSSIER_BIN_H__ */
/* roadmap_tile_storage.c - Tile persistency. * * LICENSE: * * Copyright 2009 Ehud Shabtai. * * This file is part of Waze. * * Waze 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. * * Waze 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 Waze; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <stdio.h> #include <stdarg.h> #include <string.h> #include <stdlib.h> #include "roadmap_tile_storage.h" #include "roadmap.h" #include "roadmap_file.h" #include "roadmap_path.h" #include "roadmap_locator.h" static const char * get_tile_filename (int fips, int tile_index, int create_path) { const char *map_path = roadmap_db_map_path (); char name[30]; char path[512]; static char filename[512]; if (tile_index == -1) { /* Global square id */ const char *suffix = "index"; static char name[512]; snprintf (name, sizeof (name), "%05d_%s%s", fips, suffix, ROADMAP_DATA_TYPE); roadmap_path_format (filename, sizeof (filename), map_path, name); return filename; } #ifdef J2ME snprintf (filename, sizeof (filename), "recordstore://map%05d.%d:1", fips, tile_index); #else snprintf (path, sizeof (path), "%05d", fips); roadmap_path_format (path, sizeof (path), map_path, path); if (create_path) roadmap_path_create (path); snprintf (name, sizeof (name), "%02x", tile_index >> 24); roadmap_path_format (path, sizeof (path), path, name); if (create_path) roadmap_path_create (path); snprintf (name, sizeof (name), "%02x", (tile_index >> 16) & 255); roadmap_path_format (path, sizeof (path), path, name); if (create_path) roadmap_path_create (path); snprintf (name, sizeof (name), "%02x", (tile_index >> 8) & 255); roadmap_path_format (path, sizeof (path), path, name); if (create_path) roadmap_path_create (path); snprintf (name, sizeof (name), "%05d_%08x%s", fips, tile_index, ROADMAP_DATA_TYPE); roadmap_path_format (filename, sizeof (filename), path, name); #endif return filename; } int roadmap_tile_store (int fips, int tile_index, void *data, size_t size) { int res = 0; RoadMapFile file = roadmap_file_open(get_tile_filename(fips, tile_index, 1), "w"); if (ROADMAP_FILE_IS_VALID(file)) { res = (roadmap_file_write(file, data, size) != (int)size); roadmap_file_close(file); } else { res = -1; roadmap_log(ROADMAP_ERROR, "Can't save tile data for %d", tile_index); } return res; } void roadmap_tile_remove (int fips, int tile_index) { roadmap_file_remove(NULL, get_tile_filename(fips, tile_index, 0)); } int roadmap_tile_load (int fips, int tile_index, void **base, size_t *size) { RoadMapFile file; int res; const char *full_name = get_tile_filename(fips, tile_index, 0); file = roadmap_file_open (full_name, "r"); if (!ROADMAP_FILE_IS_VALID(file)) { return -1; } #ifdef J2ME *size = favail(file); #else *size = roadmap_file_length (NULL, full_name); #endif *base = malloc (*size); res = roadmap_file_read (file, *base, *size); roadmap_file_close (file); if (res != (int)*size) { free (*base); return -1; } return 0; }
//@+leo-ver=4-thin //@+node:gan0ling.20140624153650.1477:@shadow ds1624.c //@@language c //@@tabwidth -4 //@+others //@+node:gan0ling.20140624184821.3310:ds1624 declarations /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. * * The information contained herein is property of Nordic Semiconductor ASA. * Terms and conditions of usage are described in detail in NORDIC * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. * * Licensees are granted free, non-transferable use of the information. NO * WARRANTY of ANY KIND is provided. This heading must NOT be removed from * the file. * */ #include "ds1624.h" #include "twi_master.h" #include "nrf_delay.h" /*lint ++flb "Enter library region" */ #define DS1634_BASE_ADDRESS 0x90 //!< 4 MSBs of the DS1624 TWI address #define DS1624_ONESHOT_MODE 0x01 //!< Bit in configuration register for 1-shot mode #define DS1624_CONVERSION_DONE 0x80 //!< Bit in configuration register to indicate completed temperature conversion static uint8_t m_device_address; //!< Device address in bits [7:1] const uint8_t command_access_memory = 0x17; //!< Reads or writes to 256-byte EEPROM memory const uint8_t command_access_config = 0xAC; //!< Reads or writes configuration data to configuration register const uint8_t command_read_temp = 0xAA; //!< Reads last converted temperature value from temperature register const uint8_t command_start_convert_temp = 0xEE; //!< Initiates temperature conversion. const uint8_t command_stop_convert_temp = 0x22; //!< Halts temperature conversion. //@-node:gan0ling.20140624184821.3310:ds1624 declarations //@+node:gan0ling.20140624184821.3311:ds1624_config_read /** * @brief Function for reading the current configuration of the sensor. * * @return uint8_t Zero if communication with the sensor failed. Contents (always non-zero) of configuration register (@ref DS1624_ONESHOT_MODE and @ref DS1624_CONVERSION_DONE) if communication succeeded. */ static uint8_t ds1624_config_read(void) { uint8_t config = 0; // Write: command protocol if (twi_master_transfer(m_device_address, (uint8_t*)&command_access_config, 1, TWI_DONT_ISSUE_STOP)) { if (twi_master_transfer(m_device_address | TWI_READ_BIT, &config, 1, TWI_ISSUE_STOP)) // Read: current configuration { // Read succeeded, configuration stored to variable "config" } else { // Read failed config = 0; } } return config; } //@-node:gan0ling.20140624184821.3311:ds1624_config_read //@+node:gan0ling.20140624184821.3312:ds1624_init bool ds1624_init(uint8_t device_address) { bool transfer_succeeded = true; m_device_address = DS1634_BASE_ADDRESS + (uint8_t)(device_address << 1); uint8_t config = ds1624_config_read(); if (config != 0) { // Configure DS1624 for 1SHOT mode if not done so already. if (!(config & DS1624_ONESHOT_MODE)) { uint8_t data_buffer[2]; data_buffer[0] = command_access_config; data_buffer[1] = DS1624_ONESHOT_MODE; transfer_succeeded &= twi_master_transfer(m_device_address, data_buffer, 2, TWI_ISSUE_STOP); } } else { transfer_succeeded = false; } return transfer_succeeded; } //@-node:gan0ling.20140624184821.3312:ds1624_init //@+node:gan0ling.20140624184821.3313:ds1624_start_temp_conversion bool ds1624_start_temp_conversion(void) { return twi_master_transfer(m_device_address, (uint8_t*)&command_start_convert_temp, 1, TWI_ISSUE_STOP); } //@-node:gan0ling.20140624184821.3313:ds1624_start_temp_conversion //@+node:gan0ling.20140624184821.3314:ds1624_is_temp_conversion_done bool ds1624_is_temp_conversion_done(void) { uint8_t config = ds1624_config_read(); if (config & DS1624_CONVERSION_DONE) { return true; } else { return false; } } //@-node:gan0ling.20140624184821.3314:ds1624_is_temp_conversion_done //@+node:gan0ling.20140624184821.3315:ds1624_temp_read bool ds1624_temp_read(int8_t *temperature_in_celcius, int8_t *temperature_fraction) { bool transfer_succeeded = false; // Write: Begin read temperature command if (twi_master_transfer(m_device_address, (uint8_t*)&command_read_temp, 1, TWI_DONT_ISSUE_STOP)) { uint8_t data_buffer[2]; // Read: 2 temperature bytes to data_buffer if (twi_master_transfer(m_device_address | TWI_READ_BIT, data_buffer, 2, TWI_ISSUE_STOP)) { *temperature_in_celcius = (int8_t)data_buffer[0]; *temperature_fraction = (int8_t)data_buffer[1]; transfer_succeeded = true; } } return transfer_succeeded; } //@-node:gan0ling.20140624184821.3315:ds1624_temp_read //@-others /*lint --flb "Leave library region" */ //@-node:gan0ling.20140624153650.1477:@shadow ds1624.c //@-leo
/* * CVCMIServer.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include "../lib/serializer/Connection.h" #include "../lib/StartInfo.h" #include <boost/program_options.hpp> class CMapInfo; struct CPackForLobby; class CGameHandler; struct SharedMemory; struct StartInfo; struct LobbyInfo; class PlayerSettings; class PlayerColor; template<typename T> class CApplier; class CBaseForServerApply; class CBaseForGHApply; enum class EServerState : ui8 { LOBBY, GAMEPLAY_STARTING, GAMEPLAY, GAMEPLAY_ENDED, SHUTDOWN }; class CVCMIServer : public LobbyInfo { std::atomic<bool> restartGameplay; // FIXME: this is just a hack std::shared_ptr<boost::asio::io_service> io; std::shared_ptr<TAcceptor> acceptor; std::shared_ptr<TSocket> upcomingConnection; std::list<std::unique_ptr<CPackForLobby>> announceQueue; boost::recursive_mutex mx; std::shared_ptr<CApplier<CBaseForServerApply>> applier; std::unique_ptr<boost::thread> announceLobbyThread; public: std::shared_ptr<CGameHandler> gh; std::atomic<EServerState> state; ui16 port; boost::program_options::variables_map cmdLineOptions; std::set<std::shared_ptr<CConnection>> connections; std::atomic<int> currentClientId; std::atomic<ui8> currentPlayerId; std::shared_ptr<CConnection> hostClient; CVCMIServer(boost::program_options::variables_map & opts); ~CVCMIServer(); void run(); void prepareToStartGame(); void startGameImmidiately(); void startAsyncAccept(); void connectionAccepted(const boost::system::error_code & ec); void threadHandleClient(std::shared_ptr<CConnection> c); void threadAnnounceLobby(); void handleReceivedPack(std::unique_ptr<CPackForLobby> pack); void announcePack(std::unique_ptr<CPackForLobby> pack); bool passHost(int toConnectionId); void announceTxt(const std::string & txt, const std::string & playerName = "system"); void addToAnnounceQueue(std::unique_ptr<CPackForLobby> pack); void setPlayerConnectedId(PlayerSettings & pset, ui8 player) const; void updateStartInfoOnMapChange(std::shared_ptr<CMapInfo> mapInfo, std::shared_ptr<CMapGenOptions> mapGenOpt = {}); void clientConnected(std::shared_ptr<CConnection> c, std::vector<std::string> & names, std::string uuid, StartInfo::EMode mode); void clientDisconnected(std::shared_ptr<CConnection> c); void updateAndPropagateLobbyState(); // Work with LobbyInfo void setPlayer(PlayerColor clickedColor); void optionNextHero(PlayerColor player, int dir); //dir == -1 or +1 int nextAllowedHero(PlayerColor player, int min, int max, int incl, int dir); bool canUseThisHero(PlayerColor player, int ID); std::vector<int> getUsedHeroes(); void optionNextBonus(PlayerColor player, int dir); //dir == -1 or +1 void optionNextCastle(PlayerColor player, int dir); //dir == -1 or + // Campaigns void setCampaignMap(int mapId); void setCampaignBonus(int bonusId); ui8 getIdOfFirstUnallocatedPlayer() const; #ifdef VCMI_ANDROID static void create(); #endif };
#ifndef __TIME_H__ #define __TIME_H__ #ifdef __cplusplus extern "C" { #endif #include <unistd.h> #include <time.h> unsigned long millis(void); unsigned long micros(void); void delay(unsigned long); void delayMicroseconds(unsigned int us); int timeInit(void); #ifdef __cplusplus } #endif #endif /* __TIME_H__ */
/* miktex/Trace/TraceCallback.h: -*- C++ -*- Copyright (C) 1996-2016 Christian Schenk This file is part of the MiKTeX Trace Library. The MiKTeX Trace Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The MiKTeX Trace 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 General Public License for more details. You should have received a copy of the GNU General Public License along with the MiKTeX Trace Library; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined(_MSC_VER) # pragma once #endif #if !defined(C603C4D3DC8B49F7BF8E691D3A08A925) #define C603C4D3DC8B49F7BF8E691D3A08A925 #include "config.h" #include <string> MIKTEX_TRACE_BEGIN_NAMESPACE; class MIKTEXNOVTABLE TraceCallback { public: struct TraceMessage { TraceMessage(const std::string & streamName, const std::string & facility, const std::string & message) : streamName(streamName), facility(facility), message(message) { } std::string streamName; std::string facility; std::string message; }; public: virtual void MIKTEXTHISCALL Trace(const TraceMessage & traceMessage) = 0; }; MIKTEX_TRACE_END_NAMESPACE; #endif
/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp <dok@directfb.org>, Andreas Hundt <andi@fischlustig.de>, Sven Neumann <neo@directfb.org>, Ville Syrjälä <syrjala@sci.fi> and Claudio Ciccani <klan@users.sf.net>. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __CORE_PARTS_H__ #define __CORE_PARTS_H__ #include <fusion/types.h> #include <fusion/lock.h> #include <directfb.h> #include <core/coretypes.h> #include <core/coredefs.h> typedef DFBResult (*CoreInitialize)( CoreDFB *core, void *data_local, void *data_shared ); typedef DFBResult (*CoreJoin) ( CoreDFB *core, void *data_local, void *data_shared ); typedef DFBResult (*CoreShutdown) ( void *data_local, bool emergency ); typedef DFBResult (*CoreLeave) ( void *data_local, bool emergency ); typedef DFBResult (*CoreSuspend) ( void *data_local ); typedef DFBResult (*CoreResume) ( void *data_local ); typedef struct { const char *name; int size_local; int size_shared; CoreInitialize Initialize; CoreJoin Join; CoreShutdown Shutdown; CoreLeave Leave; CoreSuspend Suspend; CoreResume Resume; void *data_local; void *data_shared; bool initialized; } CorePart; DFBResult dfb_core_part_initialize( CoreDFB *core, CorePart *core_part ); DFBResult dfb_core_part_join ( CoreDFB *core, CorePart *core_part ); DFBResult dfb_core_part_shutdown ( CoreDFB *core, CorePart *core_part, bool emergency ); DFBResult dfb_core_part_leave ( CoreDFB *core, CorePart *core_part, bool emergency ); #define DFB_CORE_PART(part,Type) \ \ static DFBResult dfb_##part##_initialize( CoreDFB *core, \ DFB##Type *local, \ DFB##Type##Shared *shared ); \ \ static DFBResult dfb_##part##_join ( CoreDFB *core, \ DFB##Type *local, \ DFB##Type##Shared *shared ); \ \ static DFBResult dfb_##part##_shutdown ( DFB##Type *local, \ bool emergency ); \ \ static DFBResult dfb_##part##_leave ( DFB##Type *local, \ bool emergency ); \ \ static DFBResult dfb_##part##_suspend ( DFB##Type *local ); \ \ static DFBResult dfb_##part##_resume ( DFB##Type *local ); \ \ CorePart dfb_##part = { \ .name = #part, \ \ .size_local = sizeof(DFB##Type), \ .size_shared = sizeof(DFB##Type##Shared), \ \ .Initialize = (void*)dfb_##part##_initialize, \ .Join = (void*)dfb_##part##_join, \ .Shutdown = (void*)dfb_##part##_shutdown, \ .Leave = (void*)dfb_##part##_leave, \ .Suspend = (void*)dfb_##part##_suspend, \ .Resume = (void*)dfb_##part##_resume, \ } #endif
/* * * * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 only, 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 version 2 for more details (a copy is * included at /legal/license.txt). * * You should have received a copy of the GNU General Public License * version 2 along with this work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 or visit www.sun.com if you need additional * information or have any questions. */ #include <string.h> #include <stdio.h> #include "gxj_font_bitmap.c.0" #define BUFY 20 #define BUFX 20 char buf[BUFY][BUFX]; unsigned char BitMask[8] = {0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x1}; int width; int height; static void drawChar(unsigned char c, unsigned char *fontbitmap, unsigned long mapLen, int fontWidth, int fontHeight) { int i; int j; int xDest; int yDest; unsigned long byteIndex; int bitOffset; unsigned long pixelIndex; unsigned char bitmapByte; unsigned long firstPixelIndex = (FONT_DATA * 8) + (c * fontHeight * fontWidth); memset(buf,' ',sizeof(buf)); for (i = 0; i < fontHeight; i++) { for (j = 0; j < fontWidth; j++) { pixelIndex = firstPixelIndex + (i * fontWidth) + j; byteIndex = pixelIndex / 8; if (byteIndex >= mapLen) { break; } bitmapByte = fontbitmap[byteIndex]; bitOffset = pixelIndex % 8; /* we don't draw "background" pixels, only foreground */ if ((bitmapByte & BitMask[bitOffset]) != 0) { buf[j][i]='*'; } } } printf("#----------\n"); printf(": %x\n",c); printf("#----------\n"); for(i=0;i<fontHeight;i++) { for(j=0;j<fontWidth;j++) { printf("%c",buf[j][i]); } printf(".\n"); } printf("#----------\n"); } int main() { width = TheFontBitmap[FONT_WIDTH]; height = TheFontBitmap[FONT_HEIGHT]; printf("# Font parameters:\n"); printf("# width height ascent descent leading\n"); printf("@ %i %i %i %i %i\n",width, height,TheFontBitmap[FONT_ASCENT],TheFontBitmap[FONT_DESCENT],TheFontBitmap[FONT_LEADING]); int lastchar = (sizeof(TheFontBitmap)-FONT_DATA)*8 / (width*height); int i; for(i=0;i<lastchar;i++) { drawChar(i,TheFontBitmap,sizeof(TheFontBitmap),width,height); } }
/* disasm_bfd.c * Simple program to test disassembly of BFD symbol */ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <opdis/opdis.h> static int print_insn( opdis_insn_t * insn, void * arg ) { const char * filename = (const char *) arg; printf( "%08X [%s:%X]\t%s\n", (unsigned int) insn->vma, filename, (unsigned int) insn->offset, insn->ascii ); return 1; } static void store_insn( const opdis_insn_t * insn, void * arg ) { opdis_insn_tree_t tree = (opdis_insn_tree_t) arg; opdis_insn_t * i = opdis_insn_dupe( insn ); opdis_insn_tree_add( tree, i ); } static asymbol * find_in_symtab( asymbol ** syms, unsigned int num_syms, const char * name ) { unsigned int i; symbol_info info; asymbol * sym = NULL; for ( i = 0; i < num_syms; i++ ) { bfd_symbol_info( syms[i], &info ); if ( strcmp( info.name, name ) ) { continue; } sym = malloc( sizeof(asymbol) ); if ( sym ) { memcpy( sym, syms[i], sizeof(asymbol) ); break; } } return sym; } static asymbol * find_bfd_symbol( bfd * abfd, const char * name ) { size_t size; unsigned int num; asymbol ** syms, *s = NULL; if (! bfd_get_file_flags(abfd) & HAS_SYMS ) { return; } /* check dynamic symtab first */ size = bfd_get_dynamic_symtab_upper_bound( abfd ); if ( size > 0 ) { syms = (asymbol **) malloc(size); if ( syms ) { num = bfd_canonicalize_dynamic_symtab( abfd, syms ); s = find_in_symtab( syms, num, name ); free(syms); } } if ( s ) { return s; } /* check regular symtab */ size = bfd_get_symtab_upper_bound( abfd ); if ( size > 0 ) { syms = (asymbol **) malloc(size); if ( syms ) { num = bfd_canonicalize_symtab( abfd, syms ); s = find_in_symtab( syms, num, name ); free(syms); } } return s; } static int disassemble_file( const char * name, const char * symbol ) { int rv; opdis_t o; bfd * abfd; asymbol * sym; opdis_insn_tree_t tree; abfd = bfd_openr( name, NULL ); if (! abfd ) { printf( "Unable to open file %s: %s\n", name, strerror(errno) ); return -1; } if ( bfd_get_flavour( abfd ) == bfd_target_unknown_flavour ) { printf( "BFD does not recognize file format for %s\n", name ); bfd_close( abfd ); return -2; } sym = find_bfd_symbol( abfd, symbol ); if (! sym ) { printf( "%s does not contain symbol '%s'\n", name, symbol ); return -3; } o = opdis_init_from_bfd( abfd ); tree = opdis_insn_tree_init( 1 ); opdis_set_display( o, store_insn, tree ); rv = opdis_disasm_bfd_symbol( o, sym ); opdis_insn_tree_foreach( tree, print_insn, (void *) name ); opdis_insn_tree_free( tree ); opdis_term( o ); free( sym ); bfd_close( abfd ); return (rv > 0) ? 0 : -2; } int main( int argc, char ** argv ) { if ( argc < 3 ) { printf( "Usage: %s file name\n", argv[0] ); return 1; } return disassemble_file( argv[1], argv[2] ); }
/* This file is part of the KDE project * Copyright (C) 2007 Thomas Zander <zander@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 INSERTINLINEOBJECTACTIONBASE_H #define INSERTINLINEOBJECTACTIONBASE_H #include <QAction> class KoCanvasBase; class KoInlineObject; /** * helper class */ class InsertInlineObjectActionBase : public QAction { Q_OBJECT public: InsertInlineObjectActionBase(KoCanvasBase *canvas, const QString &name); virtual ~InsertInlineObjectActionBase(); private Q_SLOTS: void activated(); protected: virtual KoInlineObject *createInlineObject() = 0; KoCanvasBase *m_canvas; }; #endif
/* * Copyright (C) 1996-2015 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #ifndef SQUID_WORDLIST_H #define SQUID_WORDLIST_H #include "globals.h" #include "profiler/Profiler.h" #include "SBufList.h" /** A list of C-strings * * \deprecated use SBufList instead */ class wordlist { MEMPROXY_CLASS(wordlist); friend char *wordlistChopHead(wordlist **); public: wordlist() : key(nullptr), next(nullptr) {} // create a new wordlist node, with a copy of k as key explicit wordlist(const char *k) : key(xstrdup(k)), next(nullptr) {} wordlist(const wordlist &) = delete; wordlist &operator=(const wordlist &) = delete; char *key; wordlist *next; private: // does not free data members. ~wordlist() = default; }; class MemBuf; /** Add a null-terminated c-string to a wordlist * * \deprecated use SBufList.push_back(SBuf(word)) instead */ const char *wordlistAdd(wordlist **, const char *); /** Concatenate a wordlist * * \deprecated use SBufListContainerJoin(SBuf()) from SBufAlgos.h instead */ void wordlistCat(const wordlist *, MemBuf *); /** append a wordlist to another * * \deprecated use SBufList.merge(otherwordlist) instead */ void wordlistAddWl(wordlist **, wordlist *); /** Concatenate the words in a wordlist * * \deprecated use SBufListContainerJoin(SBuf()) from SBufAlgos.h instead */ void wordlistJoin(wordlist **, wordlist **); /// destroy a wordlist void wordlistDestroy(wordlist **); /** Remove and destroy the first element while preserving and returning its key * * \note the returned key must be freed by the caller using safe_free * \note wl is altered so that it points to the second element * \return nullptr if pointed-to wordlist is nullptr. */ char *wordlistChopHead(wordlist **); /// convert a wordlist to a SBufList SBufList ToSBufList(wordlist *); #endif /* SQUID_WORDLIST_H */
#ifndef LOGLOADER_H #define LOGLOADER_H #include "utility.h" #include "logworker.h" #include <QObject> #include <QTextStream> class LogLoader : public QObject { Q_OBJECT //Constructor public: LogLoader(QObject *parent); ~LogLoader(); //Variables private: QString logPath; qint64 logSize; LogWorker *logWorker; bool firstRun; int updateTime; //Metodos private: qint64 getLogFileSize(); bool isLogReset(); void checkFirstRun(); void createFileWatcher(); void readSettings(); void readLogPath(); void readLogConfigPath(); QString createDefaultLogConfig(); void checkLogConfig(QString logConfig); void checkLogConfigOption(QString option, QString &data, QTextStream &stream); void workerFinished(); public: void init(qint64 &logSize); //Signals signals: void seekChanged(qint64 logSeek); void synchronized(); void pLog(QString line); void pDebug(QString line, DebugLevel debugLevel=Normal, QString file="LogLoader"); //LogWorker signal reemit void newLogLineRead(QString line, qint64 numLine); //Slots private slots: void updateSeek(qint64 logSeek); void sendLogWorker(); //LogWorker signal reemit void emitNewLogLineRead(QString line, qint64 numLine); }; #endif // LOGLOADER_H
/* $Id: iommu_common.h,v 1.1.1.1 2010/04/09 09:38:59 feiyan Exp $ * iommu_common.h: UltraSparc SBUS/PCI common iommu declarations. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) */ #include <linux/kernel.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/mm.h> #include <asm/iommu.h> #include <asm/scatterlist.h> /* * These give mapping size of each iommu pte/tlb. */ #define IO_PAGE_SHIFT 13 #define IO_PAGE_SIZE (1UL << IO_PAGE_SHIFT) #define IO_PAGE_MASK (~(IO_PAGE_SIZE-1)) #define IO_PAGE_ALIGN(addr) (((addr)+IO_PAGE_SIZE-1)&IO_PAGE_MASK) #define IO_TSB_ENTRIES (128*1024) #define IO_TSB_SIZE (IO_TSB_ENTRIES * 8) /* * This is the hardwired shift in the iotlb tag/data parts. */ #define IOMMU_PAGE_SHIFT 13 /* You are _strongly_ advised to enable the following debugging code * any time you make changes to the sg code below, run it for a while * with filesystems mounted read-only before buying the farm... -DaveM */ #undef VERIFY_SG #ifdef VERIFY_SG extern void verify_sglist(struct scatterlist *sg, int nents, iopte_t *iopte, int npages); #endif /* Two addresses are "virtually contiguous" if and only if: * 1) They are equal, or... * 2) They are both on a page boundary */ #define VCONTIG(__X, __Y) (((__X) == (__Y)) || \ (((__X) | (__Y)) << (64UL - PAGE_SHIFT)) == 0UL) extern unsigned long prepare_sg(struct scatterlist *sg, int nents);
#include <linux/module.h> #include <linux/vermagic.h> #include <linux/compiler.h> MODULE_INFO(vermagic, VERMAGIC_STRING); __visible struct module __this_module __attribute__((section(".gnu.linkonce.this_module"))) = { .name = KBUILD_MODNAME, .init = init_module, #ifdef CONFIG_MODULE_UNLOAD .exit = cleanup_module, #endif .arch = MODULE_ARCH_INIT, }; MODULE_INFO(intree, "Y"); static const struct modversion_info ____versions[] __used __attribute__((section("__versions"))) = { { 0xb95b937f, __VMLINUX_SYMBOL_STR(module_layout) }, { 0x8a45d207, __VMLINUX_SYMBOL_STR(v4l2_ctrl_cluster) }, { 0x51eafc8e, __VMLINUX_SYMBOL_STR(param_ops_int) }, { 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) }, { 0x22a3d284, __VMLINUX_SYMBOL_STR(gspca_dev_probe) }, { 0x337af589, __VMLINUX_SYMBOL_STR(v4l2_ctrl_new_std) }, { 0x96cc1a34, __VMLINUX_SYMBOL_STR(_mutex_unlock) }, { 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) }, { 0x60ee9172, __VMLINUX_SYMBOL_STR(param_ops_bool) }, { 0x149ed814, __VMLINUX_SYMBOL_STR(kthread_create_on_node) }, { 0xa45c59bf, __VMLINUX_SYMBOL_STR(gspca_disconnect) }, { 0x52362185, __VMLINUX_SYMBOL_STR(v4l2_ctrl_new_std_menu) }, { 0x5197cd8d, __VMLINUX_SYMBOL_STR(usb_deregister) }, { 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) }, { 0xb99f8fc3, __VMLINUX_SYMBOL_STR(kthread_stop) }, { 0x71c90087, __VMLINUX_SYMBOL_STR(memcmp) }, { 0x81c0ddfb, __VMLINUX_SYMBOL_STR(usb_control_msg) }, { 0xee58e636, __VMLINUX_SYMBOL_STR(v4l2_ctrl_new_custom) }, { 0xd62c833f, __VMLINUX_SYMBOL_STR(schedule_timeout) }, { 0xe91483a6, __VMLINUX_SYMBOL_STR(v4l2_ctrl_auto_cluster) }, { 0x6843c593, __VMLINUX_SYMBOL_STR(wake_up_process) }, { 0x9670af2c, __VMLINUX_SYMBOL_STR(gspca_debug) }, { 0x1450e799, __VMLINUX_SYMBOL_STR(gspca_frame_add) }, { 0xed4c54a6, __VMLINUX_SYMBOL_STR(v4l2_ctrl_handler_init_class) }, { 0x43d1951f, __VMLINUX_SYMBOL_STR(usb_register_driver) }, { 0xbf562cb0, __VMLINUX_SYMBOL_STR(_mutex_lock_interruptible) }, }; static const char __module_depends[] __used __attribute__((section(".modinfo"))) = "depends=videodev,gspca_main"; MODULE_ALIAS("usb:v0402p5602d*dc*dsc*dp*ic*isc*ip*in*"); MODULE_INFO(srcversion, "6F2D847A4350E12BFDAA77F");
/* Copyright (C) 2005-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2005. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <tst-stack-align.h> #include <unistd.h> static int res, fds[2], result; static bool test_destructors; extern void in_dso (int *, bool *, int *); static void __attribute__ ((constructor)) con (void) { res = TEST_STACK_ALIGN () ? -1 : 1; } static void __attribute__ ((destructor)) des (void) { if (!test_destructors) return; char c = TEST_STACK_ALIGN () ? 'B' : 'A'; write (fds[1], &c, 1); } static int do_test (void) { if (!res) { puts ("binary's constructor has not been run"); result = 1; } else if (res != 1) { puts ("binary's constructor has been run without sufficient alignment"); result = 1; } if (TEST_STACK_ALIGN ()) { puts ("insufficient stack alignment in do_test"); result = 1; } in_dso (&result, &test_destructors, &fds[1]); if (pipe (fds) < 0) { printf ("couldn't create pipe: %m\n"); return 1; } pid_t pid = fork (); if (pid < 0) { printf ("fork failed: %m\n"); return 1; } if (!pid) { close (fds[0]); test_destructors = true; exit (0); } close (fds[1]); unsigned char c; ssize_t len; int des_seen = 0, dso_des_seen = 0; while ((len = TEMP_FAILURE_RETRY (read (fds[0], &c, 1))) > 0) { switch (c) { case 'B': puts ("insufficient alignment in binary's destructor"); result = 1; /* FALLTHROUGH */ case 'A': des_seen++; break; case 'D': puts ("insufficient alignment in DSO destructor"); result = 1; /* FALLTHROUGH */ case 'C': dso_des_seen++; break; default: printf ("unexpected character %x read from pipe", c); result = 1; break; } } close (fds[0]); if (des_seen != 1) { printf ("binary destructor run %d times instead of once\n", des_seen); result = 1; } if (dso_des_seen != 1) { printf ("DSO destructor run %d times instead of once\n", dso_des_seen); result = 1; } int status; pid_t termpid; termpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0)); if (termpid == -1) { printf ("waitpid failed: %m\n"); result = 1; } else if (termpid != pid) { printf ("waitpid returned %ld != %ld\n", (long int) termpid, (long int) pid); result = 1; } else if (!WIFEXITED (status) || WEXITSTATUS (status)) { puts ("child hasn't exited with exit status 0"); result = 1; } return result; } #include <support/test-driver.c>
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License 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. * */ // #if defined(CONFIG_LGE_MIPI_JDI_PANEL) int unblank_required; //to judge if unblank is required or not static int touch_driver_registered; struct mdss_panel_data *cp_pdata; #endif //
/* This file is part of the KDE project Copyright (C) 2003-2010 Jarosław Staniek <staniek@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 DBCREATION_TEST_H #define DBCREATION_TEST_H int dbCreationTest() { /* if (conn->databaseExists(db_name)) { if (!conn->dropDatabase(db_name)) { conn->debugError(); return 1; } qDebug() << "DB '" << db_name << "' dropped"; } if (!conn->createDatabase(db_name)) { conn->debugError(); return 1; } qDebug() << "DB '" << db_name << "' created"; if (!conn->useDatabase(db_name)) { conn->debugError(); return 1; }*/ /* KDbCursor *cursor = conn->executeQuery( "select * from osoby", KDbCursor::Buffered ); qDebug()<<"executeQuery() = "<<!!cursor; if (cursor) { qDebug()<<"Cursor::moveLast() ---------------------"; qDebug()<<"-- Cursor::moveLast() == " << cursor->moveLast(); cursor->moveLast(); qDebug()<<"Cursor::moveFirst() ---------------------"; qDebug()<<"-- Cursor::moveFirst() == " << cursor->moveFirst(); */ /* qDebug()<<"Cursor::moveNext() == "<<cursor->moveNext(); qDebug()<<"Cursor::moveNext() == "<<cursor->moveNext(); qDebug()<<"Cursor::moveNext() == "<<cursor->moveNext(); qDebug()<<"Cursor::moveNext() == "<<cursor->moveNext(); qDebug()<<"Cursor::eof() == "<<cursor->eof();*/ // conn->deleteCursor(cursor); // } return 0; } #endif
#ifndef INTERACTIVESMTPSERVER_H #define INTERACTIVESMTPSERVER_H /* -*- c++ -*- interactivesmtpserver.h Code based on the serverSocket example by Jesper Pedersen. This file is part of the testsuite of kio_smtp, the KDE SMTP kioslave. Copyright (c) 2004 Marc Mutz <mutz@kde.org> 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. 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 In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include <qwidget.h> static QString err2str( int err ) { switch ( err ) { case QSocket::ErrConnectionRefused: return "Connection refused"; case QSocket::ErrHostNotFound: return "Host not found"; case QSocket::ErrSocketRead: return "Failed to read from socket"; default: return "Unknown error"; } } static QString escape( QString s ) { return s .replace( '&', "&amp;" ) .replace( '>', "&gt;" ) .replace( '<', "&lt;" ) .replace( '"', "&quot;" ) ; } static QString trim( const QString & s ) { if ( s.endsWith( "\r\n" ) ) return s.left( s.length() - 2 ); if ( s.endsWith( "\r" ) || s.endsWith( "\n" ) ) return s.left( s.length() - 1 ); return s; } class InteractiveSMTPServerWindow : public QWidget { Q_OBJECT public: InteractiveSMTPServerWindow( QSocket * socket, QWidget * parent=0, const char * name=0, WFlags f=0 ); ~InteractiveSMTPServerWindow(); public slots: void slotSendResponse(); void slotDisplayClient( const QString & s ) { mTextEdit->append( "C:" + escape(s) ); } void slotDisplayServer( const QString & s ) { mTextEdit->append( "S:" + escape(s) ); } void slotDisplayMeta( const QString & s ) { mTextEdit->append( "<font color=\"red\">" + escape(s) + "</font>" ); } void slotReadyRead() { while ( mSocket->canReadLine() ) slotDisplayClient( trim( mSocket->readLine() ) ); } void slotError( int err ) { slotDisplayMeta( QString( "E: %1 (%2)" ).arg( err2str( err ) ).arg( err ) ); } void slotConnectionClosed() { slotDisplayMeta( "Connection closed by peer" ); } void slotCloseConnection() { mSocket->close(); } private: QSocket * mSocket; QTextEdit * mTextEdit; QLineEdit * mLineEdit; }; class InteractiveSMTPServer : public QServerSocket { Q_OBJECT public: InteractiveSMTPServer( QObject * parent=0 ); ~InteractiveSMTPServer() {} /*! \reimp */ void newConnection( int fd ) { QSocket * socket = new QSocket(); socket->setSocket( fd ); InteractiveSMTPServerWindow * w = new InteractiveSMTPServerWindow( socket ); w->show(); } }; #endif
/* GIMP - The GNU Image Manipulation Program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * gimpcanvascursor.h * Copyright (C) 2010 Michael Natterer <mitch@gimp.org> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __GIMP_CANVAS_CURSOR_H__ #define __GIMP_CANVAS_CURSOR_H__ #include "gimpcanvasitem.h" #define GIMP_TYPE_CANVAS_CURSOR (gimp_canvas_cursor_get_type ()) #define GIMP_CANVAS_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CANVAS_CURSOR, GimpCanvasCursor)) #define GIMP_CANVAS_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CANVAS_CURSOR, GimpCanvasCursorClass)) #define GIMP_IS_CANVAS_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CANVAS_CURSOR)) #define GIMP_IS_CANVAS_CURSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CANVAS_CURSOR)) #define GIMP_CANVAS_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CANVAS_CURSOR, GimpCanvasCursorClass)) typedef struct _GimpCanvasCursor GimpCanvasCursor; typedef struct _GimpCanvasCursorClass GimpCanvasCursorClass; struct _GimpCanvasCursor { GimpCanvasItem parent_instance; }; struct _GimpCanvasCursorClass { GimpCanvasItemClass parent_class; }; GType gimp_canvas_cursor_get_type (void) G_GNUC_CONST; GimpCanvasItem * gimp_canvas_cursor_new (GimpDisplayShell *shell); void gimp_canvas_cursor_set_coords (GimpCanvasCursor *cursor, gdouble x, gdouble y); #endif /* __GIMP_CANVAS_CURSOR_H__ */
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "SoapyReceiverImpl.h" #import "FFT.h" #import "DSP.h"
/* * Copyright (C) 2010 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * 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/>. * * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> */ #include <gtk/gtk.h> #include <core/core.h> #include <X11/Xatom.h> #include <X11/Xproto.h> #include <core/pluginclasshandler.h> #include "gtkloader_options.h" class GTKLoaderScreen : public PluginClassHandler <GTKLoaderScreen, CompScreen>, public GtkloaderOptions { public: GTKLoaderScreen(CompScreen*); }; class GTKLoaderPluginVTable : public CompPlugin::VTableForScreen <GTKLoaderScreen> { public: bool init(); };
/* This file is part of HSPlasma. * * HSPlasma 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. * * HSPlasma 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 HSPlasma. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _PLFADEOPACITYMOD_H #define _PLFADEOPACITYMOD_H #include "PRP/Modifier/plModifier.h" class HSPLASMA_EXPORT plFadeOpacityMod : public plSingleModifier { CREATABLE(plFadeOpacityMod, kFadeOpacityMod, plSingleModifier) public: enum { kBoundsCenter = 0x1 }; protected: float fFadeUp, fFadeDown; public: plFadeOpacityMod() : fFadeUp(), fFadeDown() { fFlags.setName(kBoundsCenter, "kBoundsCenter"); } void read(hsStream* S, plResManager* mgr) HS_OVERRIDE; void write(hsStream* S, plResManager* mgr) HS_OVERRIDE; protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; public: float getFadeUp() const { return fFadeUp; } float getFadeDown() const { return fFadeDown; } void setFadeUp(float fade) { fFadeUp = fade; } void setFadeDown(float fade) { fFadeDown = fade; } }; #endif
/* * Copyright © 2014 Simple Entertainment Limited * * This file is part of The Simplicity Engine. * * The Simplicity Engine 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. * * The Simplicity Engine 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 The Simplicity Engine. If not, see * <http://www.gnu.org/licenses/>. */ #ifndef COMPOSITEENGINE_H_ #define COMPOSITEENGINE_H_ #include "Engine.h" namespace simplicity { /** * <p> * An engine that is composed of several other engines i.e. the composite design pattern. The member functions from * Engine are delegated to the contained engines. * </p> */ class SIMPLE_API CompositeEngine : public Engine { public: /** * <p> * Adds an engine. * </p> * * @param engine The engine to be added. */ virtual void addEngine(std::unique_ptr<Engine> engine) = 0; /** * <p> * Retrieves the engines contained in this engine. * </p> * * @return The engines contained in this engine. */ virtual const std::vector<std::unique_ptr<Engine>>& getEngines() const = 0; /** * <p> * Removes an engine. * </p> * * @param engine The engine to be removed. * * @return The removed engine. */ virtual std::unique_ptr<Engine> removeEngine(Engine& engine) = 0; }; } #endif /* COMPOSITEENGINE_H_ */
/* * Darmix-Core Copyright (C) 2013 Deremix * Integrated Files: CREDITS.md and LICENSE.md */ #ifndef OUTDOOR_PVP_TF_ #define OUTDOOR_PVP_TF_ #include "OutdoorPvP.h" const uint8 OutdoorPvPTFBuffZonesNum = 5; const uint32 OutdoorPvPTFBuffZones[OutdoorPvPTFBuffZonesNum] = { 3519 /*Terokkar Forest*/, 3791 /*Sethekk Halls*/, 3789 /*Shadow Labyrinth*/, 3792 /*Mana-Tombs*/, 3790 /*Auchenai Crypts*/ }; // locked for 6 hours after capture const uint32 TF_LOCK_TIME = 3600 * 6 * 1000; // update lock timer every 1/4 minute (overkill, but this way it's sure the timer won't "jump" 2 minutes at once.) const uint32 TF_LOCK_TIME_UPDATE = 15000; // blessing of auchindoun #define TF_CAPTURE_BUFF 33377 const uint32 TF_ALLY_QUEST = 11505; const uint32 TF_HORDE_QUEST = 11506; enum OutdoorPvPTF_TowerType { TF_TOWER_NW = 0, TF_TOWER_N, TF_TOWER_NE, TF_TOWER_SE, TF_TOWER_S, TF_TOWER_NUM }; const go_type TFCapturePoints[TF_TOWER_NUM] = { {183104,530,-3081.65f,5335.03f,17.1853f,-2.14675f,0.0f,0.0f,0.878817f,-0.477159f}, {183411,530,-2939.9f,4788.73f,18.987f,2.77507f,0.0f,0.0f,0.983255f,0.182236f}, {183412,530,-3174.94f,4440.97f,16.2281f,1.86750f,0.0f,0.0f,0.803857f,0.594823f}, {183413,530,-3603.31f,4529.15f,20.9077f,0.994838f,0.0f,0.0f,0.477159f,0.878817f}, {183414,530,-3812.37f,4899.3f,17.7249f,0.087266f,0.0f,0.0f,0.043619f,0.999048f} }; struct tf_tower_world_state { uint32 n; uint32 h; uint32 a; }; const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM] = { {0xa79,0xa7a,0xa7b}, {0xa7e,0xa7d,0xa7c}, {0xa82,0xa81,0xa80}, {0xa88,0xa87,0xa86}, {0xa85,0xa84,0xa83} }; const uint32 TFTowerPlayerEnterEvents[TF_TOWER_NUM] = { 12226, 12497, 12486, 12499, 12501 }; const uint32 TFTowerPlayerLeaveEvents[TF_TOWER_NUM] = { 12225, 12496, 12487, 12498, 12500 }; enum TFWorldStates { TF_UI_TOWER_SLIDER_POS = 0xa41, TF_UI_TOWER_SLIDER_N = 0xa40, TF_UI_TOWER_SLIDER_DISPLAY = 0xa3f, TF_UI_TOWER_COUNT_H = 0xa3e, TF_UI_TOWER_COUNT_A = 0xa3d, TF_UI_TOWERS_CONTROLLED_DISPLAY = 0xa3c, TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 0x9d0, TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 0x9ce, TF_UI_LOCKED_TIME_HOURS = 0x9cd, TF_UI_LOCKED_DISPLAY_NEUTRAL = 0x9cc, TF_UI_LOCKED_DISPLAY_HORDE = 0xad0, TF_UI_LOCKED_DISPLAY_ALLIANCE = 0xacf }; enum TFTowerStates { TF_TOWERSTATE_N = 1, TF_TOWERSTATE_H = 2, TF_TOWERSTATE_A = 4 }; class OPvPCapturePointTF : public OPvPCapturePoint { public: OPvPCapturePointTF(OutdoorPvP * pvp, OutdoorPvPTF_TowerType type); bool Update(uint32 diff); void ChangeState(); void SendChangePhase(); void FillInitialWorldStates(WorldPacket & data); // used when player is activated/inactivated in the area bool HandlePlayerEnter(Player* plr); void HandlePlayerLeave(Player* plr); void UpdateTowerState(); protected: OutdoorPvPTF_TowerType m_TowerType; uint32 m_TowerState; }; class OutdoorPvPTF : public OutdoorPvP { friend class OPvPCapturePointTF; public: OutdoorPvPTF(); bool SetupOutdoorPvP(); void HandlePlayerEnterZone(Player* plr, uint32 zone); void HandlePlayerLeaveZone(Player* plr, uint32 zone); bool Update(uint32 diff); void FillInitialWorldStates(WorldPacket &data); void SendRemoveWorldStates(Player* plr); private: bool m_IsLocked; uint32 m_LockTimer; uint32 m_LockTimerUpdate; uint32 m_AllianceTowersControlled; uint32 m_HordeTowersControlled; uint32 hours_left, second_digit, first_digit; }; #endif
// This file was generated based on /usr/local/share/uno/Packages/UnoCore/1.3.2/Source/Uno/UX/FileSource.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.h> namespace g{namespace Uno{namespace IO{struct BinaryReader;}}} namespace g{namespace Uno{namespace IO{struct MemoryStream;}}} namespace g{namespace Uno{namespace UX{struct StreamExtensions;}}} namespace g{ namespace Uno{ namespace UX{ // internal static class StreamExtensions :45 // { uClassType* StreamExtensions_typeof(); void StreamExtensions__ReadAllBytes_fn(::g::Uno::IO::BinaryReader* reader, uArray** __retval); void StreamExtensions__ToArray_fn(::g::Uno::IO::MemoryStream* memoryStream, uArray** __retval); struct StreamExtensions : uObject { static uArray* ReadAllBytes(::g::Uno::IO::BinaryReader* reader); static uArray* ToArray(::g::Uno::IO::MemoryStream* memoryStream); }; // } }}} // ::g::Uno::UX
#ifndef _BASIS_H_ #define _BASIS_H_ #include "bem2d_defs.h" namespace bem2d { class Basis { public: virtual complex operator()(double t) const=0; virtual ~Basis(); }; typedef boost::shared_ptr<Basis> pBasis; } #endif // _BASIS_H_
#include "Collider.h" Collider::Collider() {} Collider::~Collider() {}
/* * (C) 2003-2006 Gabest * (C) 2006-2014 see Authors.txt * * This file is part of WinnerMediaPlayer. * * WinnerMediaPlayer is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * WinnerMediaPlayer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once class __declspec(uuid("96F3E0BE-1BA4-4E79-973D-191FE425C86B")) CDeinterlacerFilter : public CTransformFilter { protected: HRESULT CheckConnect(PIN_DIRECTION dir, IPin* pPin); HRESULT CheckInputType(const CMediaType* mtIn); HRESULT CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut); HRESULT Transform(IMediaSample* pIn, IMediaSample* pOut); HRESULT DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties); HRESULT GetMediaType(int iPosition, CMediaType* pmt); public: CDeinterlacerFilter(LPUNKNOWN punk, HRESULT* phr); };
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef AVATAREXAMPLE_P_H #define AVATAREXAMPLE_P_H #include <QObject> #include <QPixmap> //![0] // avatarExample.h class AvatarExample : public QObject { Q_OBJECT Q_PROPERTY(QPixmap avatar READ avatar WRITE setAvatar NOTIFY avatarChanged) public: AvatarExample(QObject *parent = 0) : QObject(parent), m_value(100, 100) { m_value.fill(Qt::blue); } ~AvatarExample() {} QPixmap avatar() const { return m_value; } void setAvatar(QPixmap v) { m_value = v; emit avatarChanged(); } signals: void avatarChanged(); private: QPixmap m_value; }; //![0] #endif
//============== IV: Multiplayer - http://code.iv-multiplayer.com ============== // // File: CObjectManager.h // Project: Client.Core // Author(s): jenksta // mabako // License: See LICENSE in root directory // //============================================================================== #pragma once #include "CNetworkEntityManager.h" #include "CObject.h" class CObjectManager : public CNetworkEntityManager<CObject, MAX_OBJECTS> { public: void Process(); };
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // // XAudioRecorderViewController_Privates.h // xFaceLib // // #ifdef __XCaptureExt__ #import "XAudioRecorderViewController.h" #import "XCaptureExt.h" @class XExtensionResult; @interface XAudioRecorderViewController () @property (nonatomic) CaptureError errorCode; @property (nonatomic, strong) XJsCallback* jsCallback; @property (nonatomic, copy) NSNumber* duration; @property (nonatomic, strong) XCaptureExt* captureCommand; @property (nonatomic, strong) UIBarButtonItem* doneButton; @property (nonatomic, strong) UIView* recordingView; @property (nonatomic, strong) UIButton* recordButton; @property (nonatomic, strong) UIImage* recordImage; @property (nonatomic, strong) UIImage* stopRecordImage; @property (nonatomic, strong) UILabel* timerLabel; @property (nonatomic, strong) AVAudioRecorder* avRecorder; @property (nonatomic, strong) AVAudioSession* avSession; @property (nonatomic, strong) XExtensionResult* result; @property (nonatomic, strong) NSTimer* timer; @property (nonatomic) BOOL isTimed; /** 传入图片资源的名称,返回相应设备该使用的资源图片. @param resource 图片资源的名称 @return 返回正确的图片资源字串 */ - (NSString*) resolveImageResource:(NSString*)resource; /** Record Button 事件的处理;录音的Start 和 Stop @param sender 消息发送 */ - (void) processButton: (id) sender; /* 停止录音,并进行相关的清理工作 */ - (void) stopRecordingCleanup; /** Done Button pressed 解除AudioView @param sender 消息发送 */ - (void) dismissAudioView: (id) sender; /** 格式时间串 @param interval 时间 @return 返回格式化后的时间串 */ - (NSString *) formatTime: (int) interval; /** 更新时间显示 */ - (void) updateTime; /** 创建AVAudioRecorder对象,为录音进行初始化工作 @param filePath 用保存录音数据的文件的完整路径 */ - (void) createAudioRecorder:(NSString*)filePath; /** 开始音频录制 */ - (void) beginAudioRecord; /** 生成存储录音文件的完整路径,录音文件的名字以时间命名 @return 录音文件的完整路径 */ - (NSString*) generateFilePath; @end #endif
/* * Copyright (c) 2010 Erin Catto http://www.box2d.org * * 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_GROWABLE_STACK_H #define B2_GROWABLE_STACK_H #include "b2Settings.h" #include <cstring> /// This is a growable LIFO stack with an initial capacity of N. /// If the stack size exceeds the initial capacity, the heap is used /// to increase the size of the stack. template <typename T, juce::int32 N> class b2GrowableStack { public: b2GrowableStack() { m_stack = m_array; m_count = 0; m_capacity = N; } ~b2GrowableStack() { if (m_stack != m_array) { b2Free(m_stack); m_stack = NULL; } } void Push(const T& element) { if (m_count == m_capacity) { T* old = m_stack; m_capacity *= 2; m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); std::memcpy(m_stack, old, m_count * sizeof(T)); if (old != m_array) { b2Free(old); } } m_stack[m_count] = element; ++m_count; } T Pop() { b2Assert(m_count > 0); --m_count; return m_stack[m_count]; } juce::int32 GetCount() { return m_count; } private: T* m_stack; T m_array[N]; juce::int32 m_count; juce::int32 m_capacity; }; #endif
#include <stdlib.h> #include <stdio.h> #include <syscall.h> #include <string.h> int main(int argc, char* argv[], char* envp[]) { if (argc == 3) printf("%s\n",argv[2]); if (argc == 4) printf("%s %s\n",argv[2],argv[3]); if (argc == 5) printf("%s %s %s\n",argv[2],argv[3],argv[4]); exit(0); }
#include <linux/module.h> #include <linux/init.h> #include <linux/input.h> #include <linux/version.h> #include <linux/proc_fs.h> #include <asm/uaccess.h> #define PROCNAME "driver/altsysrq" static struct input_dev *g_dev = NULL; static int altsysrq_register_device(struct input_dev **pdev) { struct input_dev *dev; int ret; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) dev = (struct input_dev *)input_allocate_device(); if (!dev) { return -ENOMEM; } #else dev = kmalloc(sizeof(struct input_dev), GFP_KERNEL); if (!dev) { return -ENOMEM; } memset(dev, 0, sizeof(struct input_dev)); init_input_dev(dev); #endif dev->evbit[0] = BIT(EV_KEY); set_bit(KEY_LEFTALT, dev->keybit); set_bit(KEY_SYSRQ, dev->keybit); set_bit(KEY_C, dev->keybit); ret = input_register_device(dev); if (ret) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) input_free_device(dev); #else kfree(dev); #endif return ret; } *pdev = dev; return 0; } static void altsysrq_unregister_device(struct input_dev *dev) { input_unregister_device(dev); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18) input_free_device(dev); #else kfree(dev); #endif } static void altsysrq_input_altsysrq_event(struct input_dev *dev, int key) { input_event(dev, EV_KEY, KEY_LEFTALT, 1); input_event(dev, EV_KEY, KEY_SYSRQ, 1); input_event(dev, EV_KEY, key, 1); input_sync(dev); input_event(dev, EV_KEY, key, 0); input_event(dev, EV_KEY, KEY_SYSRQ, 0); input_event(dev, EV_KEY, KEY_LEFTALT, 0); } static ssize_t altsysrq_write_proc(struct file *filep, const char __user *buf, size_t len, loff_t *data) { char c; printk("altsysrq_write_proc...\n"); if (copy_from_user(&c, buf, 1)) return -EFAULT; switch (c) { case 'c': altsysrq_input_altsysrq_event(g_dev, KEY_C); break; } return 1; } static const struct file_operations altsysrq_proc_fops = { .owner = THIS_MODULE, .read = NULL, .write = altsysrq_write_proc, }; static int __init altsysrq_init(void) { int result; struct proc_dir_entry *entry; printk("altsysrq_init...\n"); result = altsysrq_register_device(&g_dev); if (result < 0) { return result; } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) entry = create_proc_entry(PROCNAME, S_IWUGO, NULL); if (!entry) { altsysrq_unregister_device(g_dev); return -EBUSY; } entry->write_proc = altsysrq_write_proc; #else if ((entry = proc_create_data(PROCNAME, S_IWUGO, NULL, &altsysrq_proc_fops, NULL)) == NULL) { altsysrq_unregister_device(g_dev); return -ENOMEM; } #endif return 0; } static void __exit altsysrq_exit(void) { //printk("altsysrq_exit...\n"); remove_proc_entry(PROCNAME, NULL); altsysrq_unregister_device(g_dev); g_dev = NULL; } module_init(altsysrq_init); module_exit(altsysrq_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("altsysrq");
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === * * Copyright 2010-2011, Leo Franchi <lfranchi@kde.org> * * Tomahawk 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. * * Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>. */ #ifndef XSPFUPDATER_H #define XSPFUPDATER_H #include "PlaylistUpdaterInterface.h" class QTimer; namespace Tomahawk { class XspfUpdater : public PlaylistUpdaterInterface { Q_OBJECT public: XspfUpdater( const playlist_ptr& pl, const QString& xspfUrl ); XspfUpdater( const playlist_ptr& pl, int interval, bool autoUpdate, const QString& xspfUrl ); explicit XspfUpdater( const playlist_ptr& pl ); // used by factory virtual ~XspfUpdater(); virtual QString type() const { return "xspf"; } public slots: void updateNow(); protected: void loadFromSettings( const QString& group ); void saveToSettings( const QString& group ) const; virtual void removeFromSettings(const QString& group) const; private slots: void playlistLoaded( const QList<Tomahawk::query_ptr> & ); private: QString m_url; }; } #endif // XSPFUPDATER_H
//===-- asan_thread.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // ASan-private header for asan_thread.cc. //===----------------------------------------------------------------------===// #ifndef ASAN_THREAD_H #define ASAN_THREAD_H #include "asan_allocator.h" #include "asan_internal.h" #include "asan_fake_stack.h" #include "asan_stats.h" #include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_thread_registry.h" namespace __asan { const u32 kInvalidTid = 0xffffff; // Must fit into 24 bits. const u32 kMaxNumberOfThreads = (1 << 22); // 4M class AsanThread; // These objects are created for every thread and are never deleted, // so we can find them by tid even if the thread is long dead. class AsanThreadContext : public ThreadContextBase { public: explicit AsanThreadContext(int tid) : ThreadContextBase(tid), announced(false), destructor_iterations(kPthreadDestructorIterations), stack_id(0), thread(0) { } bool announced; u8 destructor_iterations; u32 stack_id; AsanThread *thread; void OnCreated(void *arg); void OnFinished(); }; // AsanThreadContext objects are never freed, so we need many of them. COMPILER_CHECK(sizeof(AsanThreadContext) <= 256); // AsanThread are stored in TSD and destroyed when the thread dies. class AsanThread { public: static AsanThread *Create(thread_callback_t start_routine, void *arg); static void TSDDtor(void *tsd); void Destroy(); void Init(); // Should be called from the thread itself. thread_return_t ThreadStart(uptr os_id); uptr stack_top() { return stack_top_; } uptr stack_bottom() { return stack_bottom_; } uptr stack_size() { return stack_size_; } uptr tls_begin() { return tls_begin_; } uptr tls_end() { return tls_end_; } u32 tid() { return context_->tid; } AsanThreadContext *context() { return context_; } void set_context(AsanThreadContext *context) { context_ = context; } const char *GetFrameNameByAddr(uptr addr, uptr *offset, uptr *frame_pc); bool AddrIsInStack(uptr addr) { return addr >= stack_bottom_ && addr < stack_top_; } void DeleteFakeStack(int tid) { if (!fake_stack_) return; FakeStack *t = fake_stack_; fake_stack_ = 0; SetTLSFakeStack(0); t->Destroy(tid); } bool has_fake_stack() { return (reinterpret_cast<uptr>(fake_stack_) > 1); } FakeStack *fake_stack() { if (!__asan_option_detect_stack_use_after_return) return 0; if (!has_fake_stack()) return AsyncSignalSafeLazyInitFakeStack(); return fake_stack_; } // True is this thread is currently unwinding stack (i.e. collecting a stack // trace). Used to prevent deadlocks on platforms where libc unwinder calls // malloc internally. See PR17116 for more details. bool isUnwinding() const { return unwinding_; } void setUnwinding(bool b) { unwinding_ = b; } AsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; } AsanStats &stats() { return stats_; } private: // NOTE: There is no AsanThread constructor. It is allocated // via mmap() and *must* be valid in zero-initialized state. void SetThreadStackAndTls(); void ClearShadowForThreadStackAndTLS(); FakeStack *AsyncSignalSafeLazyInitFakeStack(); AsanThreadContext *context_; thread_callback_t start_routine_; void *arg_; uptr stack_top_; uptr stack_bottom_; // stack_size_ == stack_top_ - stack_bottom_; // It needs to be set in a async-signal-safe manner. uptr stack_size_; uptr tls_begin_; uptr tls_end_; FakeStack *fake_stack_; AsanThreadLocalMallocStorage malloc_storage_; AsanStats stats_; bool unwinding_; }; // ScopedUnwinding is a scope for stacktracing member of a context class ScopedUnwinding { public: explicit ScopedUnwinding(AsanThread *t) : thread(t) { t->setUnwinding(true); } ~ScopedUnwinding() { thread->setUnwinding(false); } private: AsanThread *thread; }; struct CreateThreadContextArgs { AsanThread *thread; StackTrace *stack; }; // Returns a single instance of registry. ThreadRegistry &asanThreadRegistry(); // Must be called under ThreadRegistryLock. AsanThreadContext *GetThreadContextByTidLocked(u32 tid); // Get the current thread. May return 0. AsanThread *GetCurrentThread(); void SetCurrentThread(AsanThread *t); u32 GetCurrentTidOrInvalid(); AsanThread *FindThreadByStackAddress(uptr addr); // Used to handle fork(). void EnsureMainThreadIDIsCorrect(); } // namespace __asan #endif // ASAN_THREAD_H
/* Copyright (C) 2015 Frank Büttner frank@familie-büttner.de This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/> */ #ifndef MELDUNG_H #define MELDUNG_H #include <QtCore> #include <syslog.h> class Meldung { public: Meldung(); Meldung(const QString& id,const QString &text) { K_ID=id; K_Text=text; K_Prioritaet=LOG_INFO; } Meldung(const QString& id,const QString &text,const int &prioritaet) :Meldung(id,text) { K_Prioritaet=prioritaet; } static const QString Textprio(const int &prio) { QString Rueckgabe; switch (prio) { case LOG_EMERG: Rueckgabe=QObject::tr("Notfall"); break; case LOG_ALERT: Rueckgabe=QObject::tr("Alarm"); break; case LOG_CRIT: Rueckgabe=QObject::tr("Kritisch"); break; case LOG_ERR: Rueckgabe=QObject::tr("Fehler"); break; case LOG_WARNING: Rueckgabe=QObject::tr("Warnung"); break; case LOG_NOTICE: Rueckgabe=QObject::tr("Hinweis"); break; case LOG_INFO: Rueckgabe=QObject::tr("Information"); break; case LOG_DEBUG: Rueckgabe=QObject::tr("Debug"); break; default: Rueckgabe=QObject::tr("Unbekannt"); break; } return Rueckgabe; } const QString &TextHolen() const {return K_Text;} const QString &IDHolen() const {return K_ID;} const int &PrioritaetHolen() const {return K_Prioritaet;} private: QString K_ID; QString K_Text; int K_Prioritaet; }; inline static QDebug operator<<(QDebug debug, const Meldung &m) { QDebugStateSaver saver(debug); debug.nospace() << '(' << m.IDHolen() << ", " << m.TextHolen() << ", "<< Meldung::Textprio(m.PrioritaetHolen())<<')'; return debug; } #endif // MELDUNG_H
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * setup.h * Copyright (C) ddt Aug 8, 2013 <ddt@ddt.cz> * * protodoctor 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. * * protodoctor 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/>. */ /* * manage ~/.protodoctor * - configuration and history */ #ifndef SETUP_H_ #define SETUP_H_ //#define EXIT_SUCCESS 1 //#define EXIT_FAILURE 0 #define DEF_HISTORY 10 #define DEF_TAB 0 /* timeout in microseconds [usec] */ #define DEF_TCP_TIMEOUT 200000 #define ROOT_XML "protodoctor" #define GUI_XML "gui" #define HTTP_XML "http" #define SMTP_XML "smtp" #define POP3_XML "pop3" #define IMAP_XML "imap" #define DTD_XML "protodoctor.dtd" #define IP_LEN 15 struct Setup_http { char *name; char ip[IP_LEN+1]; int port; int ssl; struct Setup_http *next; }; struct Setup_smtp { char *name; char ip[IP_LEN+1]; char *from; char *rcpt; char *login; char *pass; int port; int ssl; int tls; struct Setup_smtp *next; }; struct Setup_pop3 { char *name; char ip[IP_LEN+1]; char *login; char *pass; int port; int ssl; struct Setup_pop3 *next; }; struct Setup_imap { char *name; char ip[IP_LEN+1]; char *login; char *pass; int port; int ssl; struct Setup_imap *next; }; struct Setup { int tab; int tcp_timeout; int hist; struct Setup_http *http_first; struct Setup_http *http_last; struct Setup_smtp *smtp_first; struct Setup_smtp *smtp_last; struct Setup_pop3 *pop3_first; struct Setup_pop3 *pop3_last; struct Setup_imap *imap_first; struct Setup_imap *imap_last; }; #define SETUP_FILE "./protodoctor.xml" extern struct Setup s; void Setup_Init(); void Setup_Finish(); int SaveParameter(char *module, char *parameter, char *value); int GetTCPTimeout(); /* HTTP */ struct Setup_http *FindHTTPServer(char *p_sn); int AddHTTPServer(char *p_sn, char *p_ip, int p_port, int p_ssl); int SetHTTPServer(char *p_sn, char *p_ip, int p_port, int p_ssl); void DeleteHTTPServer(char *sn); /* POP3 */ struct Setup_pop3 *FindPOP3Server(char *p_sn); int AddPOP3Server(char *p_sn, char *p_ip, int p_port, int p_ssl, char *p_login, char *p_pass); int SetPOP3Server(char *p_sn, char *p_ip, int p_port, int p_ssl, char *p_login, char *p_pass); void DeletePOP3Server(char *sn); /* IMAP */ struct Setup_imap *FindIMAPServer(char *p_sn); int AddIMAPServer(char *p_sn, char *p_ip, int p_port, int p_ssl, char *p_login, char *p_pass); int SetIMAPServer(char *p_sn, char *p_ip, int p_port, int p_ssl, char *p_login, char *p_pass); void DeleteIMAPServer(char *sn); struct Setup GetSetup(void); #endif /* SETUP_H_ */
#ifndef LAND_H #define LAND_H // include(s) oder #include <string> // weitere Angaben using namespace std; class Land { private: // Attribute /** Der Name des Landes */ string landesname; public: // Konstruktoren Land(); Land(const string ein_landesname); virtual ~Land(); Land(const Land& original); Land & operator=(const Land& ein_land); // Methoden string liefere_landesname() const; }; // eventuell Deklaration // weiterer Funktionen #endif /* LAND_H */
#ifndef __PY_VECTOR_BASE__ #define __PY_VECTOR_BASE__ #include <vector> #include <algorithm> using namespace std; template <typename T> static vector<T> * py_vector_new() { return new vector<T>; } template <typename T> static void py_vector_delete(vector<T> * pvector) { delete pvector; } template <typename T> static size_t py_vector_size(vector<T> * pvector){ return pvector->size(); } template <typename T> static T py_vector_at(vector<T> * pvector, size_t index) { return pvector->at(index); } template <typename T> static void py_vector_set(vector<T> * pvector, size_t index, T value) { pvector->at(index) = value; } template <typename T> void py_vector_push_back(vector<T> * pvector, T number) { pvector->push_back(number); } template <typename T> void py_vector_insert(vector<T> * pvector, size_t index, T value) { pvector->insert(pvector->begin() + index, value); } template <typename T> void py_vector_erase(vector<T> * pvector, size_t index) { pvector->erase(pvector->begin() + index); } template <typename T> void py_vector_erase(vector<T> * pvector, size_t begin, size_t end) { pvector->erase(pvector->begin() + begin, pvector->begin() + end); } template <typename T> int py_vector_find(vector<T> * pvector, T value) { typename vector<T>::iterator it; it = find(pvector->begin(), pvector->end(), value); if( it == pvector->end() ) return -1; else return it - pvector->begin(); // index } template <typename T> T py_vector_pop_back(vector<T> * pvector) { T back = pvector->back(); pvector->pop_back(); return back; } template <typename T> size_t py_vector_count(vector<T> * pvector, T value) { return count(pvector->begin(), pvector->end(), value); } template <typename T> void py_vector_sort(vector<T> * pvector) { return stable_sort(pvector->begin(), pvector->end()); } template <typename T> void py_vector_reverse(vector<T> * pvector) { return reverse(pvector->begin(), pvector->end()); } template <typename T> int py_vector_equal(vector<T> * pvector, vector<T> * pother) { return *pvector == *pother; } #endif
/* -*- c++ -*- */ /* * Copyright 2004 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. */ // WARNING: this file is machine generated. Edits will be over written #ifndef INCLUDED_TRELLIS_PCCC_DECODER_COMBINED_FS_H #define INCLUDED_TRELLIS_PCCC_DECODER_COMBINED_FS_H #include <trellis_api.h> #include "fsm.h" #include "interleaver.h" #include <gr_block.h> #include <vector> #include "calc_metric.h" #include "siso_type.h" class trellis_pccc_decoder_combined_fs; typedef boost::shared_ptr<trellis_pccc_decoder_combined_fs> trellis_pccc_decoder_combined_fs_sptr; TRELLIS_API trellis_pccc_decoder_combined_fs_sptr trellis_make_pccc_decoder_combined_fs ( const fsm &FSMo, int STo0, int SToK, const fsm &FSMi, int STi0, int STiK, const interleaver &INTERLEAVER, int blocklength, int repetitions, trellis_siso_type_t SISO_TYPE, // perform "min-sum" or "sum-product" combining int D, const std::vector<float> &TABLE, trellis_metric_type_t METRIC_TYPE, float scaling ); /*! * \ingroup coding_blk */ class TRELLIS_API trellis_pccc_decoder_combined_fs : public gr_block { fsm d_FSMo; int d_STo0; int d_SToK; fsm d_FSMi; int d_STi0; int d_STiK; interleaver d_INTERLEAVER; int d_blocklength; int d_repetitions; trellis_siso_type_t d_SISO_TYPE; int d_D; std::vector<float> d_TABLE; trellis_metric_type_t d_METRIC_TYPE; float d_scaling; std::vector<float> d_buffer; friend TRELLIS_API trellis_pccc_decoder_combined_fs_sptr trellis_make_pccc_decoder_combined_fs ( const fsm &FSMo, int STo0, int SToK, const fsm &FSMi, int STi0, int STiK, const interleaver &INTERLEAVER, int blocklength, int repetitions, trellis_siso_type_t SISO_TYPE, int D, const std::vector<float> &TABLE, trellis_metric_type_t METRIC_TYPE, float scaling ); trellis_pccc_decoder_combined_fs ( const fsm &FSMo, int STo0, int SToK, const fsm &FSMi, int STi0, int STiK, const interleaver &INTERLEAVER, int blocklength, int repetitions, trellis_siso_type_t SISO_TYPE, int D, const std::vector<float> &TABLE, trellis_metric_type_t METRIC_TYPE, float scaling ); public: fsm FSM1 () const { return d_FSMo; } fsm FSM2 () const { return d_FSMi; } int ST10 () const { return d_STo0; } int ST1K () const { return d_SToK; } int ST20 () const { return d_STi0; } int ST2K () const { return d_STiK; } interleaver INTERLEAVER () const { return d_INTERLEAVER; } int blocklength () const { return d_blocklength; } int repetitions () const { return d_repetitions; } int D () const { return d_D; } std::vector<float> TABLE () const { return d_TABLE; } trellis_metric_type_t METRIC_TYPE () const { return d_METRIC_TYPE; } trellis_siso_type_t SISO_TYPE () const { return d_SISO_TYPE; } float scaling () const { return d_scaling; } void set_scaling (float scaling); void forecast (int noutput_items, gr_vector_int &ninput_items_required); int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif
/* Quarn OS Copyright (C) 2014 Paweł Dziepak This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _VMEM_H #define _VMEM_H #include <sys/types.h> int vmem_alloc_page(uintptr_t* page, unsigned flags); void vmem_free_page(uintptr_t page); int vmem_alloc(uintptr_t* start, uintptr_t size, unsigned flags); void vmem_free(uintptr_t start); void vmem_init(void); #endif
/* textdefs.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com Copyright (C) 2010 Gil Dabah This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/> */ #ifndef TEXTDEFS_H #define TEXTDEFS_H #include "../config.h" #include "wstring.h" #define PLUS_DISP_CHR '+' #define MINUS_DISP_CHR '-' #define OPEN_CHR '[' #define CLOSE_CHR ']' #define SP_CHR ' ' #define SEG_OFF_CHR ':' /* Naming Convention: * get - returns a pointer to a string. * str - concatenates to string. * hex - means the function is used for hex dump (number is padded to required size) - Little Endian output. * code - means the function is used for disassembled instruction - Big Endian output. * off - means the function is used for 64bit offset - Big Endian output. * h - '0x' in front of the string. * b - byte * dw - double word (can be used for word also) * qw - quad word * all numbers are in HEX. */ extern int8_t TextBTable[256][4]; void _FASTCALL_ str_hex_b(_WString* s, unsigned int x); void _FASTCALL_ str_code_hb(_WString* s, unsigned int x); void _FASTCALL_ str_code_hdw(_WString* s, uint32_t x); void _FASTCALL_ str_code_hqw(_WString* s, uint8_t src[8]); #ifdef SUPPORT_64BIT_OFFSET void _FASTCALL_ str_off64(_WString* s, OFFSET_INTEGER x); #endif #endif /* TEXTDEFS_H */
/* Copyright (C) 2017-2022 Topological Manifold 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/>. */ #pragma once #include <src/numerical/vector.h> namespace ns::geometry { // a * x + b template <std::size_t N, typename T> struct Constraint final { Vector<N, T> a; T b; }; template <std::size_t N, typename T, std::size_t COUNT, std::size_t COUNT_EQ> struct Constraints final { std::array<Constraint<N, T>, COUNT> c; std::array<Constraint<N, T>, COUNT_EQ> c_eq; }; template <std::size_t N, typename T, std::size_t COUNT> struct Constraints<N, T, COUNT, 0> final { std::array<Constraint<N, T>, COUNT> c; }; }
/** * goiovalues - Guns of Icarus Online damage simulator * Copyright (C) 2016 Dominique Lasserre * * This file is part of goiovalues. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef FIRE_H_ #define FIRE_H_ #include "./goioactor.h" #include "./exceptions.h" namespace goio { class Fire : public GoioActor { private: static constexpr double firetick = 0.001; protected: void accept(ToolDispatcher&, const Tool*, bool) override { assert(false); } public: Fire() : GoioActor("", CmpType::HULL) {} static Health get_fire_dmg(GoioObj* obj, Time time); // throws NonPositiveTime DmgState burn(GoioObj* obj, Time); static inline Time get_firetick() { return Time(firetick); } TimeFunc get_time_func(const GoioObj* obj, Time, bool&) override; int get_buff_value() const override { return -1; } void reset_modifiers() override {} }; } // namespace goio #endif // FIRE_H_
// Copyright (C) 2004 Id Software, Inc. // /* sys_event.h Event are used for scheduling tasks and for linking script commands. */ #ifndef __SYS_EVENT_H__ #define __SYS_EVENT_H__ #define D_EVENT_MAXARGS 8 // if changed, enable the CREATE_EVENT_CODE define in Event.cpp to generate switch statement for idClass::ProcessEventArgPtr. // running the game will then generate c:\doom\base\events.txt, the contents of which should be copied into the switch statement. #define D_EVENT_VOID ( ( char )0 ) #define D_EVENT_INTEGER 'd' #define D_EVENT_FLOAT 'f' #define D_EVENT_VECTOR 'v' #define D_EVENT_STRING 's' #define D_EVENT_ENTITY 'e' #define D_EVENT_ENTITY_NULL 'E' // event can handle NULL entity pointers #define D_EVENT_TRACE 't' #define MAX_EVENTS 4096 class idClass; class idTypeInfo; class idEventDef { private: const char *name; const char *formatspec; unsigned int formatspecIndex; int returnType; int numargs; size_t argsize; int argOffset[ D_EVENT_MAXARGS ]; int eventnum; const idEventDef *next; static idEventDef *eventDefList[MAX_EVENTS]; static int numEventDefs; public: idEventDef( const char *command, const char *formatspec = NULL, char returnType = 0 ); const char *GetName( void ) const; const char *GetArgFormat( void ) const; unsigned int GetFormatspecIndex( void ) const; char GetReturnType( void ) const; int GetEventNum( void ) const; int GetNumArgs( void ) const; size_t GetArgSize( void ) const; int GetArgOffset( int arg ) const; static int NumEventCommands( void ); static const idEventDef *GetEventCommand( int eventnum ); static const idEventDef *FindEvent( const char *name ); }; class idSaveGame; class idRestoreGame; class idEvent { private: const idEventDef *eventdef; byte *data; int time; idClass *object; const idTypeInfo *typeinfo; idLinkList<idEvent> eventNode; static idDynamicBlockAlloc<byte, 16 * 1024, 256> eventDataAllocator; public: static bool initialized; ~idEvent(); static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args ); static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, int data[ D_EVENT_MAXARGS ] ); void Free( void ); void Schedule( idClass *object, const idTypeInfo *cls, int time ); byte *GetData( void ); static void CancelEvents( const idClass *obj, const idEventDef *evdef = NULL ); static void ClearEventList( void ); static void ServiceEvents( void ); static void Init( void ); static void Shutdown( void ); // save games static void Save( idSaveGame *savefile ); // archives object for save game file static void Restore( idRestoreGame *savefile ); // unarchives object from save game file static void SaveTrace( idSaveGame *savefile, const trace_t &trace ); static void RestoreTrace( idRestoreGame *savefile, trace_t &trace ); }; /* ================ idEvent::GetData ================ */ ID_INLINE byte *idEvent::GetData( void ) { return data; } /* ================ idEventDef::GetName ================ */ ID_INLINE const char *idEventDef::GetName( void ) const { return name; } /* ================ idEventDef::GetArgFormat ================ */ ID_INLINE const char *idEventDef::GetArgFormat( void ) const { return formatspec; } /* ================ idEventDef::GetFormatspecIndex ================ */ ID_INLINE unsigned int idEventDef::GetFormatspecIndex( void ) const { return formatspecIndex; } /* ================ idEventDef::GetReturnType ================ */ ID_INLINE char idEventDef::GetReturnType( void ) const { return returnType; } /* ================ idEventDef::GetNumArgs ================ */ ID_INLINE int idEventDef::GetNumArgs( void ) const { return numargs; } /* ================ idEventDef::GetArgSize ================ */ ID_INLINE size_t idEventDef::GetArgSize( void ) const { return argsize; } /* ================ idEventDef::GetArgOffset ================ */ ID_INLINE int idEventDef::GetArgOffset( int arg ) const { assert( ( arg >= 0 ) && ( arg < D_EVENT_MAXARGS ) ); return argOffset[ arg ]; } /* ================ idEventDef::GetEventNum ================ */ ID_INLINE int idEventDef::GetEventNum( void ) const { return eventnum; } #endif /* !__SYS_EVENT_H__ */
#ifndef __eeprom_h__ #define __eeprom_h__ #define kEEPROMPage 0x7F #define kEEPROMOffset 0xFE00 //valid for pic24f16ka101 enum { kEEPROMEraseWord = 0x4058, kEEPROMWriteWord = 0x4004 }; void eeprom_write(unsigned int offset, unsigned int value); unsigned int eeprom_read(unsigned int offset); #endif
#ifndef DesignerPlugin_H #define DesignerPlugin_H #include <QDesignerCustomWidgetInterface> /** The DesignerPlugin creates a Qt designer plugin of the AlgorithmSelectorWidget. @author Martyn Gigg, Tessella plc @date 03/08/2009 Copyright &copy; 2010 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source This file is part of Mantid. Mantid 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. Mantid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. File change history is stored at: <https://github.com/mantidproject/mantid> */ class DesignerPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: // ==== Methods you must overridde ========== /// Returns a pointer to a newly constructed widget for this plugin wraps QWidget *createWidget(QWidget *parent) override = 0; /// Returns the fully-qualified class name QString name() const override = 0; // ==== Optionally overridden methods ========== /// Returns a tool tip for the widget QString toolTip() const override; /// Returns the include file that appears at the top of the generated .h file QString includeFile() const override; /// Returns the XML that defines the widget and its properties QString domXml() const override; /// Default constructor DesignerPlugin(QObject *parent = nullptr); /// Initialize the plugin void initialize(QDesignerFormEditorInterface *core) override; /// Returns if the plugin is initliaized bool isInitialized() const override; /// Returns if this plugins is able to contain other widgets bool isContainer() const override; /// Returns the group name within the designer QString group() const override; /// Returns the icon to use QIcon icon() const override; /// Returns a short description of the widget QString whatsThis() const override; private: std::string getShortName() const; /// Are we initialized? bool m_initialized; }; #endif
#include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> static char *whom = "world"; module_param(whom, charp, S_IRUGO); static int __init hello_init(void) { printk(KERN_ALERT "Hello, %s\n", whom); return 0; } static void __exit hello_exit(void) { printk(KERN_ALERT "Goodbye, %s\n", whom); } module_init(hello_init); module_exit(hello_exit); MODULE_AUTHOR("BingSong Si <sibingsong@gmail.com>"); MODULE_DESCRIPTION("A simple hello world module"); MODULE_LICENSE("GPL");
/***************************************************************************** * Copyright 2015-2020 Alexander Barthel alex@littlenavmap.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. *****************************************************************************/ #ifndef ABSTRACTLNMACTIONSCONTROLLER_H #define ABSTRACTLNMACTIONSCONTROLLER_H #include "webapi/abstractactionscontroller.h" namespace atools { namespace geo { class Pos; } namespace fs { namespace util { class MorseCode; } namespace sc { class SimConnectData; } } namespace sql { class SqlRecord; } } namespace InfoBuilderTypes { class AirportAdminNames; } namespace ageo = atools::geo; namespace map { class MapAirport; class WeatherContext; } class NavApp; class MapQuery; class WaypointTrackQuery; class InfoQuery; class AirportQuery; class MainWindow; using atools::fs::util::MorseCode; using atools::sql::SqlRecord; using InfoBuilderTypes::AirportAdminNames; using atools::geo::Pos; using atools::fs::sc::SimConnectData; /** * @brief The base class for all Little Navmap API action controllers */ class AbstractLnmActionsController : public AbstractActionsController { Q_OBJECT Q_ENUMS(AirportQueryType) public: Q_INVOKABLE AbstractLnmActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder); virtual ~AbstractLnmActionsController(); enum AirportQueryType { SIM, NAV }; protected: // Main LNM objects NavApp* getNavApp(); MapQuery* getMapQuery(); WaypointTrackQuery* getWaypointTrackQuery(); InfoQuery* getInfoQuery(); AirportQuery* getAirportQuery(AirportQueryType type); MainWindow* getMainWindow(); MorseCode* getMorseCode(); // Common LNM model interface map::MapAirport getAirportByIdent(QByteArray ident); map::WeatherContext getWeatherContext(map::MapAirport& airport); const SqlRecord* getAirportInformation(int id); const AirportAdminNames getAirportAdminNames(map::MapAirport& airport); int getTransitionAltitude(map::MapAirport& airport); const QTime getSunset(const SqlRecord& airportInformation); const QTime getSunrise(const SqlRecord& airportInformation); const QTime getSunset(const Pos& pos); const QTime getSunrise(const Pos& pos); const QDateTime getActiveDateTime(); const QString getActiveDateTimeSource(); const SimConnectData getSimConnectData(); private: MorseCode* morseCode; QTime calculateSunriseSunset(const Pos& pos, float zenith); Pos getPosFromAirportInformation(const SqlRecord& airportInformation); }; #endif // ABSTRACTLNMACTIONSCONTROLLER_H
/* Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com This file is part of EigenD. EigenD 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. EigenD 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 EigenD. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __ALPHA1_USB__ #define __ALPHA1_USB__ #include <picross/pic_stdint.h> #ifdef __cplusplus extern "C" { #endif #define BCTALPHA1_USBVENDOR 0x049f #define BCTALPHA1_USBPRODUCT 0x505a #define BCTALPHA1_INTERFACE 0 #define BCTALPHA1_MSGTYPE_NULL 1 #define BCTALPHA1_MSGTYPE_KEYDOWN 3 #define BCTALPHA1_MSGTYPE_RAW 4 #define BCTALPHA1_MSGTYPE_PROCESSED 5 #define BCTALPHA1_HEADER_SIZE 2 #define BCTALPHA1_PAYLOAD_KEYDOWN 9 #define BCTALPHA1_PAYLOAD_PROCESSED 4 #define BCTALPHA1_PAYLOAD_RAW 5 #define BCTALPHA1_MSGSIZE_KEYDOWN (BCTALPHA1_HEADER_SIZE+BCTALPHA1_PAYLOAD_KEYDOWN) #define BCTALPHA1_MSGSIZE_PROCESSED (BCTALPHA1_HEADER_SIZE+BCTALPHA1_PAYLOAD_PROCESSED) #define BCTALPHA1_MSGSIZE_RAW (BCTALPHA1_HEADER_SIZE+BCTALPHA1_PAYLOAD_RAW) struct pik_msg_t { uint8_t type; uint8_t frame; uint16_t timestamp; uint16_t payload[0]; }; #define BCTALPHA1_MSG_RAW_KEY 0 #define BCTALPHA1_MSG_RAW_I0 1 #define BCTALPHA1_MSG_RAW_I1 2 #define BCTALPHA1_MSG_RAW_I2 3 #define BCTALPHA1_MSG_RAW_I3 4 #define BCTALPHA1_MSG_PROCESSED_KEY 0 #define BCTALPHA1_MSG_PROCESSED_P 1 #define BCTALPHA1_MSG_PROCESSED_R 2 #define BCTALPHA1_MSG_PROCESSED_Y 3 #define BCTALPHA1_CALTABLE_POINTS 30 #define BCTALPHA1_CALTABLE_SIZE (2+BCTALPHA1_CALTABLE_POINTS) #define BCTALPHA1_CALTABLE_MIN 0 #define BCTALPHA1_CALTABLE_MAX 1 #define BCTALPHA1_CALTABLE_DATA 2 #define BCTALPHA1_USBENDPOINT_SENSOR_NAME 0x83 #define BCTALPHA1_USBENDPOINT_SENSOR_SIZE 512 #define BCTALPHA1_USBENDPOINT_SENSOR_FREQ 1 #define BCTALPHA1_USBCOMMAND_SETLED_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_SETLED_REQ 0xb0 #define BCTALPHA1_USBCOMMAND_START_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_START_REQ 0xb1 #define BCTALPHA1_USBCOMMAND_SETRAW_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_SETRAW_REQ 0xb3 #define BCTALPHA1_USBCOMMAND_SETCOOKED_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_SETCOOKED_REQ 0xb4 #define BCTALPHA1_USBCOMMAND_CALDATA_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_CALDATA_REQ 0xb5 #define BCTALPHA1_USBCOMMAND_CALWRITE_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_CALWRITE_REQ 0xb6 #define BCTALPHA1_USBCOMMAND_CALCLEAR_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_CALCLEAR_REQ 0xb8 #define BCTALPHA1_USBCOMMAND_STOP_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_STOP_REQ 0xbb #define BCTALPHA1_USBCOMMAND_TEMP_REQTYPE 0x40 #define BCTALPHA1_USBCOMMAND_TEMP_REQ 0xc0 #ifdef __cplusplus } #endif #endif
//LCD Functions Developed by electroSome //LCD Module Connections extern bit RS; extern bit EN; extern bit D0; extern bit D1; extern bit D2; extern bit D3; extern bit D4; extern bit D5; extern bit D6; extern bit D7; //End LCD Module Connections void Lcd_Delay(int a) { int j; int i; for(i=0;i<a;i++) { for(j=0;j<100;j++) { } } } //LCD 8 Bit Interfacing Functions void Lcd8_Port(char a) { if(a & 1) D0 = 1; else D0 = 0; if(a & 2) D1 = 1; else D1 = 0; if(a & 4) D2 = 1; else D2 = 0; if(a & 8) D3 = 1; else D3 = 0; if(a & 16) D4 = 1; else D4 = 0; if(a & 32) D5 = 1; else D5 = 0; if(a & 64) D6 = 1; else D6 = 0; if(a & 128) D7 = 1; else D7 = 0; } void Lcd8_Cmd(char a) { RS = 0; // => RS = 0 Lcd8_Port(a); //Data transfer EN = 1; // => E = 1 Lcd_Delay(5); EN = 0; // => E = 0 } Lcd8_Clear() { Lcd8_Cmd(1); } void Lcd8_Set_Cursor(char a, char b) { if(a == 1) Lcd8_Cmd(0x80 + b); else if(a == 2) Lcd8_Cmd(0xC0 + b); } void Lcd8_Init() { Lcd8_Port(0x00); RS = 0; Lcd_Delay(200); ///////////// Reset process from datasheet ///////// Lcd8_Cmd(0x30); Lcd_Delay(50); Lcd8_Cmd(0x30); Lcd_Delay(110); Lcd8_Cmd(0x30); ///////////////////////////////////////////////////// Lcd8_Cmd(0x38); //function set Lcd8_Cmd(0x0C); //display on,cursor off,blink off Lcd8_Cmd(0x01); //clear display Lcd8_Cmd(0x06); //entry mode, set increment } void Lcd8_Write_Char(char a) { RS = 1; // => RS = 1 Lcd8_Port(a); //Data transfer EN = 1; // => E = 1 Lcd_Delay(5); EN = 0; // => E = 04 } void Lcd8_Write_String(char *a) { int i; for(i=0;a[i]!='\0';i++) Lcd8_Write_Char(a[i]); } void Lcd8_Shift_Right() { Lcd8_Cmd(0x1C); } void Lcd8_Shift_Left() { Lcd8_Cmd(0x18); } //End LCD 8 Bit Interfacing Functions //LCD 4 Bit Interfacing Functions void Lcd4_Port(char a) { if(a & 1) D4 = 1; else D4 = 0; if(a & 2) D5 = 1; else D5 = 0; if(a & 4) D6 = 1; else D6 = 0; if(a & 8) D7 = 1; else D7 = 0; } void Lcd4_Cmd(char a) { RS = 0; // => RS = 0 Lcd4_Port(a); EN = 1; // => E = 1 Lcd_Delay(5); EN = 0; // => E = 0 } Lcd4_Clear() { Lcd4_Cmd(0); Lcd4_Cmd(1); } void Lcd4_Set_Cursor(char a, char b) { char temp,z,y; if(a == 1) { temp = 0x80 + b; z = temp>>4; y = (0x80+b) & 0x0F; Lcd4_Cmd(z); Lcd4_Cmd(y); } else if(a == 2) { temp = 0xC0 + b; z = temp>>4; y = (0xC0+b) & 0x0F; Lcd4_Cmd(z); Lcd4_Cmd(y); } } void Lcd4_Init() { Lcd4_Port(0x00); Lcd_Delay(200); ///////////// Reset process from datasheet ///////// Lcd4_Cmd(0x03); Lcd_Delay(50); Lcd4_Cmd(0x03); Lcd_Delay(110); Lcd4_Cmd(0x03); ///////////////////////////////////////////////////// Lcd4_Cmd(0x02); Lcd4_Cmd(0x02); Lcd4_Cmd(0x08); Lcd4_Cmd(0x00); Lcd4_Cmd(0x0C); Lcd4_Cmd(0x00); Lcd4_Cmd(0x06); } void Lcd4_Write_Char(char a) { char temp,y; temp = a&0x0F; y = a&0xF0; RS = 1; // => RS = 1 Lcd4_Port(y>>4); //Data transfer EN = 1; Lcd_Delay(5); EN = 0; Lcd4_Port(temp); EN = 1; Lcd_Delay(5); EN = 0; } void Lcd4_Write_String(char *a) { int i; for(i=0;a[i]!='\0';i++) Lcd4_Write_Char(a[i]); } void Lcd4_Shift_Right() { Lcd4_Cmd(0x01); Lcd4_Cmd(0x0C); } void Lcd4_Shift_Left() { Lcd4_Cmd(0x01); Lcd4_Cmd(0x08); } //End LCD 4 Bit Interfacing Functions
/* DreamChess ** ** DreamChess is the legal property of its developers, whose names are too ** numerous to list here. Please refer to the COPYRIGHT file distributed ** with this source distribution. ** ** 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/>. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif /* HAVE_CONFIG_H */ #ifdef COMM_PIPE_WIN32 #include <windows.h> #include <stdio.h> #include "pipe_win32.h" #include "debug.h" #include "dreamchess.h" static int init_ok = 0; static HANDLE hProcess; int comm_init(char *engine) { HANDLE to_child_rd, to_child_wr, to_child_wr_dup, from_child_rd, from_child_wr, from_child_rd_dup, h_stdout; SECURITY_ATTRIBUTES sa_attr; PROCESS_INFORMATION proc_info; STARTUPINFO start_info; /* Make pipe handles inherited. */ sa_attr.nLength = sizeof(SECURITY_ATTRIBUTES); sa_attr.bInheritHandle = TRUE; sa_attr.lpSecurityDescriptor = NULL; /* Get the STDOUT handle. */ h_stdout = GetStdHandle(STD_OUTPUT_HANDLE); /* Create a pipe for input from child. */ if (!CreatePipe(&from_child_rd, &from_child_wr, &sa_attr, 0)) { DBG_ERROR("failed to create stdout pipe"); exit(1); } /* Make a non-inheritable copy of the read handle and close the original ** one. */ if (!DuplicateHandle(GetCurrentProcess(), from_child_rd, GetCurrentProcess(), &from_child_rd_dup, 0, FALSE, DUPLICATE_SAME_ACCESS)) { DBG_ERROR("failed to duplicate read handle"); exit(1); } CloseHandle(from_child_rd); /* Create a pipe for output to child. */ if (! CreatePipe(&to_child_rd, &to_child_wr, &sa_attr, 0)) { DBG_ERROR("failed to create stdin pipe"); exit(1); } /* Make a non-inheritable copy of the write handle and close the original ** one. */ if (!DuplicateHandle(GetCurrentProcess(), to_child_wr, GetCurrentProcess(), &to_child_wr_dup, 0, FALSE, DUPLICATE_SAME_ACCESS)) { DBG_ERROR("failed to duplicate write handle"); exit(1); } CloseHandle(to_child_wr); /* Create child process. */ ZeroMemory(&proc_info, sizeof(PROCESS_INFORMATION)); ZeroMemory(&start_info, sizeof(STARTUPINFO)); start_info.cb = sizeof(STARTUPINFO); start_info.hStdError = from_child_wr; start_info.hStdOutput = from_child_wr; start_info.hStdInput = to_child_rd; start_info.dwFlags |= STARTF_USESTDHANDLES; if (!CreateProcess(NULL, engine, NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &start_info, &proc_info)) { DBG_ERROR("failed to create child process"); init_ok = 0; return 1; } hProcess = proc_info.hProcess; /* Close unneeded handle. */ CloseHandle(proc_info.hThread); pipe_win32_init(from_child_rd_dup, to_child_wr_dup, 0); init_ok = 1; return 0; } void comm_exit(void) { if (init_ok) { DBG_LOG("waiting for engine to exit"); if (WaitForSingleObject(hProcess, INFINITE) != WAIT_FAILED) { DBG_LOG("engine exitted succesfully"); CloseHandle(hProcess); } else { DBG_ERROR("error while waiting for engine to quit"); exit(1); } pipe_win32_exit(); } } void comm_send_str(char *str) { if (init_ok) pipe_win32_send(str); } char *comm_poll(void) { if (init_ok) { DWORD exit; int error; GetExitCodeProcess(hProcess, &exit); if (exit == STILL_ACTIVE) { char *retval = pipe_win32_poll(&error); if (!error) return retval; } else { DBG_ERROR("engine process has terminated"); } pipe_win32_exit(); init_ok = 0; game_set_engine_error(1); } return NULL; } #endif /* COMM_PIPE_WIN32 */
#include <stdio.h> void main() { int sum = 0; int i = 0, j = 0; int range = 1; int factor = 1; for(range = 1; range <= 1000; range++) { sum = 0; i = range; factor = 2; while(factor <= i) { if(0 == i % factor) { i = i / factor; sum = sum + factor; } else { factor++; } } if(range == sum + 1) printf("%-3d",range); } printf("\n"); }
/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. * * The information contained herein is property of Nordic Semiconductor ASA. * Terms and conditions of usage are described in detail in NORDIC * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. * * Licensees are granted free, non-transferable use of the information. NO * WARRANTY of ANY KIND is provided. This heading must NOT be removed from * the file. * */ /** * @addtogroup ser_codecs Serialization codecs * @ingroup ble_sdk_lib_serialization */ /** * @addtogroup ser_app_s110_codecs Application s110 codecs * @ingroup ser_codecs */ /**@file * * @defgroup soc_app SOC Application command request encoders and command response decoders * @{ * @ingroup ser_app_s110_codecs * * @brief SOC Application command request encoders and command response decoders. */ #ifndef NRF_SOC_APP_H__ #define NRF_SOC_APP_H__ #include <stdint.h> /**@brief Encodes @ref sd_power_system_off command request. * * @sa @ref nrf51_sd_power_off for packet format. * * @param[in] p_buf Pointer to buffer where encoded data command will be returned. * @param[in,out] p_buf_len \c in: size of p_buf buffer. \c out: Length of encoded command packet. * * @retval NRF_SUCCESS Encoding success. * @retval NRF_ERROR_NULL Encoding failure. NULL pointer supplied. * @retval NRF_ERROR_INVALID_LENGTH Encoding failure. Incorrect buffer length. */ uint32_t power_system_off_req_enc(uint8_t * const p_buf, uint32_t * const p_buf_len); /**@brief Encodes @ref sd_temp_get command request. * * @sa @ref nrf51_sd_temp_get for packet format. @ref temp_get_rsp_dec for command response decoder. * * @param[in] p_temp Pointer to result of temperature measurement. * @param[in] p_buf Pointer to buffer where encoded data command will be returned. * @param[in,out] p_buf_len \c in: size of p_buf buffer. \c out: Length of encoded command packet. * * @retval NRF_SUCCESS Encoding success. * @retval NRF_ERROR_NULL Encoding failure. NULL pointer supplied. * @retval NRF_ERROR_INVALID_LENGTH Encoding failure. Incorrect buffer length. */ uint32_t temp_get_req_enc(int32_t const * const p_temp, uint8_t * const p_buf, uint32_t * const p_buf_len); /**@brief Decodes response to @ref sd_temp_get command. * * @sa @ref nrf51_temp_get_encoding for packet format, * @ref temp_get_req_enc for command request encoder. * * @param[in] p_buf Pointer to beginning of command response packet. * @param[in] packet_len Length (in bytes) of response packet. * @param[out] p_result_code Command result code. * @param[out] p_temp Pointer to result of temperature measurement. * * @return NRF_SUCCESS Version information stored successfully. * @retval NRF_ERROR_INVALID_LENGTH Decoding failure. Incorrect buffer length. * @retval NRF_ERROR_DATA_SIZE Decoding failure. Length of \p p_event is too small to * hold decoded event. */ uint32_t temp_get_rsp_dec(uint8_t const * const p_buf, uint32_t packet_len, uint32_t * const p_result_code, int32_t * const p_temp); /** @} */ #endif // NRF_SOC_APP_H__
/* Copyright 2016,王思远 <darknightghost.cn@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #define BG_BLACK 40 #define BG_RED 41 #define BG_WHITE 47 #define FG_BLACK 30 #define FG_BRIGHT_RED 31 #define FG_BRIGHT_WHITE 37
#ifndef HIENA_FILE_BUILTIN_H #define HIENA_FILE_BUILTIN_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../../cosmos/cosmos_module.h" struct cosmos_module cosmos_file_builtin; #endif /*! HIENA_FILE_BUILTIN_H */
/*======================================================================= XYZ load / save plugin for the GIMP Copyright 2013 - Mathew Velasquez (Adapted from the WebP plugin by Nathan Osman) 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 "read-xyz.h" #include <string.h> #include <stdlib.h> #include <libgimp/gimp.h> #include <zlib.h> #include <glib/gstdio.h> int read_xyz(const gchar *filename) { FILE *file; void *compressed_data, * uncompressed_data; long int size_dest, size_src; int width, height; gint32 new_image_id, new_layer_id; GimpDrawable *drawable; GimpPixelRgn rgn; // Try to open the file file = g_fopen(filename, "rb"); if (!file) goto error; // Read the header char header[4]; if (fread(header, 4, 1, file) != 1) goto error; // Compare the header static char xyz_header[4] = {'X', 'Y', 'Z', '1'}; if (memcmp(xyz_header, header, 4)) goto error; // Read the width and height width = 0; height = 0; if (fread(&width, 2, 1, file) != 1) goto error; if (fread(&height, 2, 1, file) != 1) goto error; // Get the file size fseek(file, 0, SEEK_END); size_src = ftell(file) - 8; fseek(file, 8, SEEK_SET); // Now prepare a buffer of that size // and read the data. compressed_data = malloc(size_src); if (fread(compressed_data, size_src, 1, file) != 1) goto error; // Close the file fclose(file); file = NULL; // Uncompress the data size_dest = 256*3 + width * height; uncompressed_data = malloc(size_dest); if (uncompress((Bytef *)uncompressed_data, (uLongf *)&size_dest, (Bytef *)compressed_data, (uLongf)size_src) != Z_OK) goto error; // Now create the new indexed image. new_image_id = gimp_image_new(width, height, GIMP_INDEXED); // Add the palette gimp_image_set_colormap(new_image_id, uncompressed_data, 256); // Create the new layer new_layer_id = gimp_layer_new(new_image_id, "Background", width, height, GIMP_INDEXED_IMAGE, 100, GIMP_NORMAL_MODE); // Get the drawable for the layer drawable = gimp_drawable_get(new_layer_id); // Get a pixel region from the layer gimp_pixel_rgn_init(&rgn, drawable, 0, 0, width, height, TRUE, FALSE); // Now FINALLY set the pixel data gimp_pixel_rgn_set_rect(&rgn, uncompressed_data + 256*3, 0, 0, width, height); // We're done with the drawable gimp_drawable_flush(drawable); gimp_drawable_detach(drawable); // Free the image data free(compressed_data); free(uncompressed_data); // Add the layer to the image gimp_image_add_layer(new_image_id, new_layer_id, 0); // Set the filename gimp_image_set_filename(new_image_id, filename); return new_image_id; error: if (file) fclose(file); return -1; }
/********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ /* */ #include "ngspice.h" #include "cswdefs.h" #include "sperror.h" #include "suffix.h" int CSWmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) { CSWmodel **model = (CSWmodel**)inModel; CSWmodel *modfast = (CSWmodel*)kill; CSWinstance *here; CSWinstance *prev = NULL; CSWmodel **oldmod; oldmod = model; for( ; *model ; model = &((*model)->CSWnextModel)) { if( (*model)->CSWmodName == modname || (modfast && *model == modfast) ) goto delgot; oldmod = model; } return(E_NOMOD); delgot: *oldmod = (*model)->CSWnextModel; /* cut deleted device out of list */ for(here = (*model)->CSWinstances ; here ; here = here->CSWnextInstance) { if(prev) FREE(prev); prev = here; } if(prev) FREE(prev); FREE(*model); return(OK); }
/** ****************************************************************************** * * @file quanton.h * @author Tau Labs, http://taulabs.org, Copyright (C) 2013 * * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup Boards_Quantec Quantec boards support Plugin * @{ * @brief Plugin to support boards by Quantec Networks GmbH *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef QUANTON_H #define QUANTON_H #include <coreplugin/iboardtype.h> class IBoardType; class Quanton : public Core::IBoardType { public: Quanton(); virtual ~Quanton(); virtual QString shortName(); virtual QString boardDescription(); virtual bool queryCapabilities(BoardCapabilities capability); virtual QStringList getSupportedProtocols(); virtual QPixmap getBoardPicture(); virtual QString getHwUAVO(); virtual int queryMaxGyroRate(); virtual QStringList getAdcNames(); }; #endif // QUANTON_H
#ifndef __LOCAL_GL_H__ #define __LOCAL_GL_H__ #include <SDL.h> void draw_quads(float[], int); void gl_resize(int, int); int gl_init(SDL_Window *window, int, int); int gl_drawscene(); GLuint gl_new_buffer_object(GLenum type, GLsizeiptr size, const GLvoid *data); GLuint gl_new_program_from_files(const char *vfile, const char *ffile); #endif
/* * PairedEndRead.h * * Created on: Mar 27, 2015 * Author: qy2 */ #include "Config.h" #include "QueryRead.h" #include "SubjectRead.h" #ifndef PAIREDENDREAD_H_ #define PAIREDENDREAD_H_ class PairedEndQueryAlignment; class CountMatrix; class QueryRead; class PairedEndRead { public: PairedEndRead(); ~PairedEndRead(); omp_lock_t lock; QueryRead * leftRead; //r1 QueryRead * rightRead; //r2 // Two bits are used to represent the orientation of the reads in a matepair. // 0 = 00 means the reverse of r1 and the reverse of r2 are matepairs. // 1 = 01 means the reverse of r1 and the forward of r2 are matepairs. // 2 = 10 means the forward of r1 and the reverse of r2 are matepairs. // 3 = 11 means the forward of r1 and the forward of r2 are matepairs. UINT8 orientation; string mergedSequence; vector<PairedEndQueryAlignment*>* pairEndAlignmentList; //+ATCG : the gap seqence is ATCG, no overlap between paired end reads; -ATCG: the two paired end reads are overlapped, // only + or - means the gap length is 0. map<string, int>* gapstringfrequencymap; map<int, CountMatrix*>* sizeToMatrix; map<int, int>* sizeToCount; void clearCountMatrix(); void clearPairEndAlignmentList(); void cleargapstringfrequencymap(); bool addToPairAlignmentList(PairedEndQueryAlignment* pairedAlign); void initializeCountMatrix(); bool insertMatrixToMap(int readDepthCutoff); bool insertgapstringfrequencymap(); bool insertgapstringfrequencymap(string gapstring); bool reconstructSequence(int readDepthCutoff, double recallpercentage); bool reconstructSequencefromGapSeq(int readDepthCutoff, double recallpercentage); }; //in PairedEndQueryAlignment, the paired end query reads are always forward, from left read to the right read //subject read therefore can be either forward or reverse class PairedEndQueryAlignment { public: PairedEndQueryAlignment(PairedEndRead* pairEndRead,SubjectRead* subjectRead); ~PairedEndQueryAlignment(); int subjectStart; int left_queryEnd; int subjectEnd; int right_queryStart; int right_queryEnd; PairedEndRead* pairEndRead; SubjectRead* subjectRead; bool subjectReadOrientation;//true:forward, false: reverse }; class CountMatrix { public: CountMatrix(int rowSize, int ColumnSize); ~CountMatrix(); int matrixRowSize; int matrixColumnSize; vector<vector<UINT16>*>* matrixdata; bool addACTGCount(string sequence); bool addACTGCount(string sequence, int frequency); bool addACTGCount(PairedEndQueryAlignment* pairedEndQueryAlignment); }; #endif /* PAIREDENDREAD_H_ */
/* dtls -- a very basic DTLS implementation * * Copyright (C) 2011--2014 Olaf Bergmann <bergmann@tzi.org> * * 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 _DTLS_SESSION_H_ #define _DTLS_SESSION_H_ #include <string.h> #include "dtls_config.h" #include "tinydtls.h" #include "global.h" #ifdef WITH_CONTIKI #include "ip/uip.h" typedef struct { unsigned char size; uip_ipaddr_t addr; unsigned short port; int ifindex; } session_t; #else /* WITH_CONTIKI */ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> #endif #ifdef HAVE_WINSOCK2_H #include <winsock2.h> #endif #ifdef HAVE_WS2TCPIP_H #include <ws2tcpip.h> #endif #include <stdint.h> typedef struct { socklen_t size; /**< size of addr */ #ifdef _MSC_VER __declspec(align(8)) #endif union { struct sockaddr sa; struct sockaddr_storage st; struct sockaddr_in sin; struct sockaddr_in6 sin6; } addr; uint8_t ifindex; } session_t; #endif /* WITH_CONTIKI */ /** * Resets the given session_t object @p sess to its default * values. In particular, the member rlen must be initialized to the * available size for storing addresses. * * @param sess The session_t object to initialize. */ void dtls_session_init(session_t *sess); /** * Compares the given session objects. This function returns @c 0 * when @p a and @p b differ, @c 1 otherwise. */ int dtls_session_equals(const session_t *a, const session_t *b); #endif /* _DTLS_SESSION_H_ */
// // kernel.h // // Circle - A C++ bare metal environment for Raspberry Pi // Copyright (C) 2014-2017 R. Stange <rsta2@o2online.de> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef _kernel_h #define _kernel_h #include <circle/actled.h> #include <circle/koptions.h> #include <circle/devicenameservice.h> #include <circle/screen.h> #include <circle/serial.h> #include <circle/exceptionhandler.h> #include <circle/interrupt.h> #include <circle/timer.h> #include <circle/logger.h> #include <circle/sched/scheduler.h> #include <vc4/vchiq/vchiqdevice.h> #include <vc4/sound/vchiqsounddevice.h> #include <circle/types.h> enum TShutdownMode { ShutdownNone, ShutdownHalt, ShutdownReboot }; class CKernel { public: CKernel (void); ~CKernel (void); boolean Initialize (void); TShutdownMode Run (void); private: // do not change this order CActLED m_ActLED; CKernelOptions m_Options; CDeviceNameService m_DeviceNameService; CScreenDevice m_Screen; CSerialDevice m_Serial; CExceptionHandler m_ExceptionHandler; CInterruptSystem m_Interrupt; CTimer m_Timer; CLogger m_Logger; CScheduler m_Scheduler; CVCHIQDevice m_VCHIQ; CVCHIQSoundDevice m_VCHIQSound; }; #endif
/* Remote CL Copyright (C) 2013 Paweł Dziepak This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CL_UTILS_H #define CL_UTILS_H #include "common/opencl.h" struct client_state; enum cl_utils_kernel { CL_UTILS_CLEAR_BUFFER, CL_UTILS_COUNT }; struct cl_utils { cl_program programs[CL_UTILS_COUNT]; cl_kernel kernels[CL_UTILS_COUNT]; }; int cl_utils_init(struct client_state* state, cl_device_id device_id); int cl_utils_destroy(struct client_state* state); int cl_utils_clear_buffer(struct client_state* state, cl_mem buffer, int size); #endif
/***************************************************************************** * Copyright (C) 2004-2015 The PyKEP development team, * * Advanced Concepts Team (ACT), European Space Agency (ESA) * * http://keptoolbox.sourceforge.net/index.html * * http://keptoolbox.sourceforge.net/credits.html * * * * act@esa.int * * * * 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 KEP_TOOLBOX_IC2PAR_H #define KEP_TOOLBOX_IC2PAR_H #include <cmath> namespace kep_toolbox { template<class vettore3D, class vettore6D> void ic2par(const vettore3D& r0, const vettore3D& v0, const double &mu, vettore6D& E) { double k[3]; double h[3]; double Dum_Vec[3]; double n[3]; double evett[3]; double p = 0.0; double temp =0.0; double R0, ni; int i; ///1 - We compute h: the orbital angular momentum vector h[0] = r0[1]*v0[2] - r0[2]*v0[1]; h[1] = r0[2]*v0[0] - r0[0]*v0[2]; h[2] = r0[0]*v0[1] - r0[1]*v0[0]; ///2 - We compute p: the orbital parameter p = h[0]*h[0] + h[1]*h[1] + h[2]*h[2]; p /= mu; //3 - We compute n: the vector of the node line //This operation is singular when inclination is zero, in which case the orbital parameters //are not defined k[0] = 0; k[1] = 0; k[2] = 1; n[0] = k[1]*h[2] - k[2]*h[1]; n[1] = k[2]*h[0] - k[0]*h[2]; n[2] = k[0]*h[1] - k[1]*h[0]; temp = sqrt(n[0]*n[0] + n[1]*n[1] +n[2]*n[2]); for (i=0; i<3; i++) n[i] /= temp; //4 - We compute evett: the eccentricity vector //This operation is singular when eccentricity is zero, in which case the orbital parameters //are not defined R0 = sqrt(r0[0]*r0[0] + r0[1]*r0[1] +r0[2]*r0[2]); Dum_Vec[0] = v0[1]*h[2] - v0[2]*h[1]; Dum_Vec[1] = v0[2]*h[0] - v0[0]*h[2]; Dum_Vec[2] = v0[0]*h[1] - v0[1]*h[0]; for (i=0; i<3; i++) evett[i] = Dum_Vec[i]/mu - r0[i]/R0; //The eccentricity is calculated and stored as the second orbital element E[1] = sqrt(evett[0]*evett[0] + evett[1]*evett[1] +evett[2]*evett[2]); //The semi-major axis is calculated and stored as the first orbital element E[0] = p/(1-E[1]*E[1]); //Inclination is calculated and stored as the third orbital element E[2] = acos( h[2]/sqrt(h[0]*h[0] + h[1]*h[1] +h[2]*h[2]) ); //Argument of pericentrum is calculated and stored as the fifth orbital element temp = 0.0; for (i=0; i<3; i++) temp+=n[i]*evett[i]; E[4] = acos(temp/E[1]); if (evett[2] < 0) E[4] = 2*M_PI - E[4]; //Argument of longitude is calculated and stored as the fourth orbital element E[3] = acos(n[0]); if (n[1] < 0) E[3] = 2*M_PI-E[3]; temp = 0.0; for (i=0; i<3; i++) temp+=evett[i]*r0[i]; //4 - We compute ni: the true anomaly (in 0, 2*PI) ni = acos(temp/E[1]/R0); temp = 0.0; for (i=0; i<3; i++) temp+=r0[i]*v0[i]; if (temp<0.0) ni = 2*M_PI - ni; //Eccentric anomaly or the gudermannian is calculated and stored as the sixth orbital element if (E[1]<1.0) E[5] = 2.0*atan(sqrt((1-E[1])/(1+E[1]))*tan(ni/2.0)); // algebraic kepler's equation else E[5] =2.0*atan(sqrt((E[1]-1)/(E[1]+1))*tan(ni/2.0)); // algebraic equivalent of kepler's equation in terms of the Gudermannian return; } } #endif // KEP_TOOLBOX_IC2PAR_H
/* File: widget.h Time-stamp: <2011-06-17 15:32:27 gawen> Copyright (C) 2010 David Hauweele <david@hauweele.net> Copyright (C) 2008,2009 Craig Harding <craigwharding@gmail.com> Wolter Hellmund <wolterh@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _WIDGET_H_ #define _WIDGET_H_ #include "common.h" #include "gtk.h" struct widget { BEGIN_PBAR_WIDGET; /* icon and status */ GtkWidget *icon; GtkWidget *icon_eventbox; GtkWidget *status; GtkWidget *status_menu; /* mood */ GtkWidget *mood; GtkWidget *mood_menu; /* nickname */ GtkWidget *name_label; GtkWidget *name_eventbox; GtkWidget *name_entry; /* personal message */ GtkWidget *pm_label; GtkWidget *pm_eventbox; GtkWidget *pm_entry; GtkWidget *hbox; /* contains the widget */ gboolean installed; /* widget installed or not */ gboolean hover_name; /* name hovered or not */ gboolean hover_pm; /* pm hovered or not */ /* avoid setting status and name twice with focus-out-event */ gboolean name_entry_activated; gboolean pm_entry_activated; /* avoid activating entry with dialog */ gboolean name_dialog; gboolean pm_dialog; /* attributes state for attributes dialogs */ gboolean mood_message; gboolean current_song; gboolean song_title; gboolean song_album; gboolean game_name; gboolean office_app; gboolean pm_message; /* references */ unsigned int icon_ref; unsigned int status_ref; unsigned int mood_ref; unsigned int name_ref; unsigned int pm_ref; unsigned int mood_message_ref; unsigned int current_song_ref; unsigned int song_title_ref; unsigned int game_name_ref; unsigned int office_app_ref; }; extern struct widget *bar; void create_widget(); void reset_widget(); void destroy_widget(); void init_widget(); void create_name_dialog(); void create_pm_dialog(); void update_available_features(PurpleAccount *acct, gboolean enable); void check_available_features(); void update_available_widgets(); void widget_set_all_sensitive(gboolean sensitive); void set_widget_name(const gchar *markup, const gchar *name); void set_widget_pm(const gchar *markup, const gchar *pm); void set_widget_status(const gchar *stock); void set_widget_mood(const gchar *path); void set_widget_icon(GdkPixbuf *icon); void set_widget_name_justify(int justify); void set_widget_pm_justify(int justify); void set_widget_entry_frame(gboolean use_frame); void set_statusbox_visible(gboolean visible); gboolean get_widget_name_hover_state(); gboolean get_widget_pm_hover_state(); #endif /* _WIDGET_H_ */
/* WinKexec: kexec for Windows * Copyright (C) 2008-2009 John Stumpo * * 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 "string.h" int memcmp(const void* a, const void* b, size_t len) { const unsigned char* c = a; const unsigned char* d = b; size_t i; for (i = 0; i < len; i++) if (c[i] != d[i]) return c[i] - d[i]; return 0; } void* memmove(void* dest, const void* src, size_t len) { const unsigned char* a = src; unsigned char* b = dest; size_t i; if (b < a) { for (i = 0; i < len; i++) b[i] = a[i]; } else { for (i = len; i > 0; i--) b[i-1] = a[i-1]; } return dest; }
/* * pixiewps: bruteforce the wps pin exploiting the low or non-existing entropy of some APs (pixie dust attack). * All credits for the research go to Dominique Bongard. * * Special thanks to: datahead, soxrok2212 * * Copyright (c) 2015, wiire <wi7ire@gmail.com> * Version: 1.1 * * DISCLAIMER: This tool was made for educational purposes only. * The author is NOT responsible for any misuse or abuse. * * 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/>. * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. */ #ifndef _UTILS_H #define _UTILS_H /* Converts an hex string to a byte array */ int hex_string_to_byte_array(char *in, unsigned char *out, int n_len) { int i, j, o; int len = strlen(in); int b_len = n_len * 2 + n_len - 1; if (len != n_len * 2 && len != b_len) return 1; for (i = 0; i < n_len; i++) { o = 0; for (j = 0; j < 2; j++) { o <<= 4; if (*in >= 'A' && *in <= 'F') *in += 'a'-'A'; if (*in >= '0' && *in <= '9') o += *in - '0'; else if (*in >= 'a' && *in <= 'f') o += *in - 'a' + 10; else return 1; in++; }; *out++ = o; if (len == b_len) { if (*in == ':' || *in == '-' || *in == ' ' || *in == 0) in++; else return 1; } } return 0; }; /* Converts a string into an integer */ int get_int(char *in, int *out) { int i, o = 0, len = strlen(in); for (i = 0; i < len; i++) { if ('0' <= *in && *in <= '9') o = o * 10 + *in - '0'; else return 1; in++; }; *out = o; return 0; }; /* Converts an unsigned integer to a char array without termination */ void uint_to_char_array(unsigned int num, int len, unsigned char *dst) { unsigned int mul = 1; while (len--) { dst[len] = (num % (mul * 10) / mul) + '0'; mul *= 10; } } /* Prints a byte array in hexadecimal */ void byte_array_print(unsigned char *buffer, unsigned int length) { unsigned int i; for (i = 0; i < length; i++) { printf("%02x", buffer[i]); if (i != length - 1) printf(":"); } } #endif /* _UTILS_H */
#include "..\MP101\MP101.h" #include "..\Sensor\Sensor.h" // Smart Head is based on MP101 class to control Motor head Bescor MP-101 Motorized Pan & Tilt Head and Sensor class SmartHead{ public: MP101 mp101; Sensor sns; int amove=0; // automatic moving int move_flag=0; // current state // Constructor define variables SmartHead(); // Remember current position (to measure angles from it) void SetPosition(); // Return to set position void ReturnToPos(); // Define rotation angles void SetRotation(float hAng, float vAng); // get remaining angle void GetRotation(float *hAng, float *vAng); // get rotated angle (from set position) void GetAngle(float *hAng, float *vAng); // get last rotated angle (from set beginning of movement) void GetLastAngle(float *hAng, float *vAng); // Move head - override function of MP101 adding sensor call // hspeed + right - left 0-99 // vspeed + up - down 0-99 void move(int ,int); // move to define position (set by SetRotation) void move(); // Programming Head // stop head for milliseconds void AddProgram(int delay); // move head to angle void AddProgram(float hAng, float vAng); // press shooter for time void AddProgramShoot(int delay); // Reset Program void ResetProgram(); // start program void StartProgram(int delay); private: // current angle from beginning of movement float c_vang, c_hang; // current angle from SetPosition float p_vang, p_hang; //remaining angle from SetRotation float r_vang, r_hang; // Program structure struct ProgramStep { int type; // type 0-pending, 1-shooting, 2-moving int time; // time milliseconds float va; // vertical angle float ha; // horizontal angle }; ProgramStep Prog[20]; // max 20 step int pstep=0; // program steps int cstep=0; // current step };
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _SOCKET_H_ #define _SOCKET_H_ #include "cbasetypes.h" #ifdef WIN32 #define WIN32_LEAN_AND_MEAN // otherwise winsock2.h includes full windows.h #include <winsock2.h> typedef long in_addr_t; #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> // has FD_* and select, according to POSIX.1-2001 #endif #ifdef HAVE_NET_SOCKET_H #include <net/socket.h> // BeOS #endif #endif #include <time.h> #define FIFOSIZE_SERVERLINK 256*1024 // socket I/O macros #define WFIFOHEAD(fd, size) do{ if((fd) && session[fd]->wdata_size + (size) > session[fd]->max_wdata ) realloc_writefifo(fd, size); }while(0) #define RFIFOP(fd,pos) (session[fd]->rdata + session[fd]->rdata_pos + (pos)) #define WFIFOP(fd,pos) (session[fd]->wdata + session[fd]->wdata_size + (pos)) #define RFIFOB(fd,pos) (*(uint8*)RFIFOP(fd,pos)) #define WFIFOB(fd,pos) (*(uint8*)WFIFOP(fd,pos)) #define RFIFOW(fd,pos) (*(uint16*)RFIFOP(fd,pos)) #define WFIFOW(fd,pos) (*(uint16*)WFIFOP(fd,pos)) #define RFIFOL(fd,pos) (*(uint32*)RFIFOP(fd,pos)) #define WFIFOL(fd,pos) (*(uint32*)WFIFOP(fd,pos)) #define RFIFOQ(fd,pos) (*(uint64*)RFIFOP(fd,pos)) #define WFIFOQ(fd,pos) (*(uint64*)WFIFOP(fd,pos)) #define RFIFOSPACE(fd) (session[fd]->max_rdata - session[fd]->rdata_size) #define WFIFOSPACE(fd) (session[fd]->max_wdata - session[fd]->wdata_size) #define RFIFOREST(fd) (session[fd]->flag.eof ? 0 : session[fd]->rdata_size - session[fd]->rdata_pos) #define RFIFOFLUSH(fd) \ do { \ if(session[fd]->rdata_size == session[fd]->rdata_pos){ \ session[fd]->rdata_size = session[fd]->rdata_pos = 0; \ } else { \ session[fd]->rdata_size -= session[fd]->rdata_pos; \ memmove(session[fd]->rdata, session[fd]->rdata+session[fd]->rdata_pos, session[fd]->rdata_size); \ session[fd]->rdata_pos = 0; \ } \ } while(0) #define RFIFO2PTR(fd) (void*)(session[fd]->rdata + session[fd]->rdata_pos) // buffer I/O macros #define RBUFP(p,pos) (((uint8*)(p)) + (pos)) #define RBUFB(p,pos) (*(uint8*)RBUFP((p),(pos))) #define RBUFW(p,pos) (*(uint16*)RBUFP((p),(pos))) #define RBUFL(p,pos) (*(uint32*)RBUFP((p),(pos))) #define RBUFQ(p,pos) (*(uint64*)RBUFP((p),(pos))) #define WBUFP(p,pos) (((uint8*)(p)) + (pos)) #define WBUFB(p,pos) (*(uint8*)WBUFP((p),(pos))) #define WBUFW(p,pos) (*(uint16*)WBUFP((p),(pos))) #define WBUFL(p,pos) (*(uint32*)WBUFP((p),(pos))) #define WBUFQ(p,pos) (*(uint64*)WBUFP((p),(pos))) #define TOB(n) ((uint8)((n)&UINT8_MAX)) #define TOW(n) ((uint16)((n)&UINT16_MAX)) #define TOL(n) ((uint32)((n)&UINT32_MAX)) // Struct declaration typedef int (*RecvFunc)(int fd); typedef int (*SendFunc)(int fd); typedef int (*ParseFunc)(int fd); struct socket_data { struct { unsigned char eof : 1; unsigned char server : 1; unsigned char ping : 2; } flag; uint32 client_addr; // remote client address uint8 *rdata, *wdata; size_t max_rdata, max_wdata; size_t rdata_size, wdata_size; size_t rdata_pos; time_t rdata_tick; // time of last recv (for detecting timeouts); zero when timeout is disabled RecvFunc func_recv; SendFunc func_send; ParseFunc func_parse; void* session_data; // stores application-specific data related to the session }; // Data prototype declaration extern struct socket_data* session[FD_SETSIZE]; extern int fd_max; extern time_t last_tick; extern time_t stall_time; ////////////////////////////////// // some checking on sockets extern bool session_isValid(int fd); extern bool session_isActive(int fd); ////////////////////////////////// // Function prototype declaration int make_listen_bind(uint32 ip, uint16 port); int make_connection(uint32 ip, uint16 port); int realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size); int realloc_writefifo(int fd, size_t addition); int WFIFOSET(int fd, size_t len); int RFIFOSKIP(int fd, size_t len); int do_sockets(int next); void do_close(int fd); void socket_init(void); void socket_final(void); extern void flush_fifo(int fd); extern void flush_fifos(void); extern void set_nonblocking(int fd, unsigned long yes); void set_defaultparse(ParseFunc defaultparse); // hostname/ip conversion functions uint32 host2ip(const char* hostname); const char* ip2str(uint32 ip, char ip_str[16]); uint32 str2ip(const char* ip_str); #define CONVIP(ip) ((ip)>>24)&0xFF,((ip)>>16)&0xFF,((ip)>>8)&0xFF,((ip)>>0)&0xFF #define MAKEIP(a,b,c,d) (uint32)( ( ( (a)&0xFF ) << 24 ) | ( ( (b)&0xFF ) << 16 ) | ( ( (c)&0xFF ) << 8 ) | ( ( (d)&0xFF ) << 0 ) ) uint16 ntows(uint16 netshort); int socket_getips(uint32* ips, int max); extern uint32 addr_[16]; // ip addresses of local host (host byte order) extern int naddr_; // # of ip addresses void set_eof(int fd); /// Use a shortlist of sockets instead of iterating all sessions for sockets /// that have data to send or need eof handling. /// Adapted to use a static array instead of a linked list. /// /// @author Buuyo-tama #define SEND_SHORTLIST #ifdef SEND_SHORTLIST // Add a fd to the shortlist so that it'll be recognized as a fd that needs // sending done on it. void send_shortlist_add_fd(int fd); // Do pending network sends (and eof handling) from the shortlist. void send_shortlist_do_sends(); #endif #endif /* _SOCKET_H_ */
#ifndef _VGVEC3_H_INCLUDED_ #define _VGVEC3_H_INCLUDED_ /********************************************************************** *< vgVec3.h: Èýάµã»òÏòÁ¿µÄÊý¾Ý½á¹¹ÉùÃ÷ Ö÷ÒªÄÚÈÝÊÇ£º µã½á¹¹Ìå *> **********************************************************************/ ////////////////////////////////////////////////////////////////////////// // µã½á¹¹ // class CVector2 // class CVector3 namespace vgMath { struct CVector2 { float x,y; }; struct CVector3 { union{ struct{float x, y, z;}; float vert[3]; }; CVector3(float xRef , float yRef, float zRef) :x(xRef), y(yRef), z(zRef) { } CVector3(float xRef = 0.0f) :x(xRef), y(xRef), z(xRef) { } CVector3(CVector3& pointRef) { *this = pointRef; } CVector3& operator=(CVector3& pointRef) { x = pointRef.x; y = pointRef.y; z = pointRef.z; return *this; } void narrow(CVector3& pointRef); void enlarge(CVector3& pointRef); friend CVector3 operator + (CVector3& point1, CVector3& point2); friend CVector3 operator * (CVector3& point1, float scaleRef); float length(); friend CVector3 subVector(CVector3 vPoint1, CVector3 vPoint2); friend float dotProduct(CVector3 vVector1, CVector3 vVector2); friend CVector3 crossProduct(CVector3 vVector1, CVector3 vVector2); CVector3 normalize(); CVector3 formatAsVG(); };// class CVector3 }// namespace vgMath #endif //_VGVEC3_H_INCLUDED_
//VIDEC_DVC.h #ifndef __VIDEC_DVC_H__ #define __VIDEC_DVC_H__ #include "VIDEC.h" class VIDEC_DVCCallback { public: VIDEC_DVCCallback(void){}; virtual~VIDEC_DVCCallback(void){}; public: virtual void OnVIDEC_DVCCallbackImage(VIDEC_Image*pImage)=0; virtual void OnVIDEC_DVCCallbackVideoStreamData(unsigned char*pData,int nLen,int nKeyFrame,int nWidth,int nHeight)=0; }; class VIDEC_DVC { public: VIDEC_DVC(void){}; virtual~VIDEC_DVC(void){}; public: virtual int Open(int nDevID,int nFrameRate,int nBitrate,int nBitrateControlType,int nResolution)=0; virtual void Close(void)=0; virtual int RequestKeyFrame(void)=0; virtual int SetParams(int nFrameRate,int nBitrate,int nBitrateControlType,int nResolution)=0; static int Init(void); static void Terminate(void); static int GetDevCount(void); static int GetDevName(int nDevID,char*szName,int nMaxCount); static int GetDevType(int nDevID,VIDEC_DEV_TYPE&nDevType);//SD HD VGA static bool HasAudioInput(int nDevID); static bool SupportHardwareEncoding(int nDevID); static VIDEC_DVC*Create(VIDEC_DVCCallback&rCallback); virtual int SendData(const char*pData,int nLen)=0; }; #endif
#ifdef PLATFORM_HAS_TLB /* * Copyright (C) 2012,2016 * "Mu Lei" known as "NalaGinrut" <NalaGinrut@gmail.com> * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <osconfig.h> #include <tlb.h> /* <Discription>: * Flushes all TLB entries (including those that refer to global pages, * that is, pages whose Global flag is set). * * <Usage>: * Changing the kernel page table entries. */ void flush_tlb_all() {} /* <Discription>: * Flushes all TLB entries in a given range of linear addresses * (including those that refer to global pages). * * <Usage>: * Changing a range of kernel page table entries. */ void flush_tlb_kernel_range(void *start ,void *end) {} /* <Discription>: * Flushes all TLB entries of the non-global pages owned by the current process. * * <Usage>: * Performing a process switch. */ void flush_tlb() {} /* <Discription>: * Flushes all TLB entries of the non-global pages owned by a given process. * * <Usage>: * Forking a new process. */ void flush_tlb_mm(void *who) {} /* <Discription>: * Flushes the TLB entries corresponding to a Releasing a linear linear * address interval of a given process. * * <Usage>: * address interval of a process */ void flush_tlb_range(void *who ,void *range) {} /* <Discription>: * Flushes the TLB entries of a given contiguous subset of page tables of * a given process. * * <Usage>: * Releasing some page tables of a process. */ void flush_tlb_pgtables(void *who ,void *pt) {} /* <Discription>: * Flushes the TLB of a single Page Table entry of a given process. * * <Usage>: * Processing a Page Fault. */ void flush_tlb_page(void *who) {} #endif // End of PLATFORM_HAS_TLB;
/* * TEsTris * * Created by Simon Busard on 22.08.2007 * * config.h * -------- * Prototype - Game configuration functions */ /* * Copyright (C) 2008 Busard Simon * * 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 __CONFIG__ #define __CONFIG__ #include "constants.h" // Define table of possible configurations // First element is command string, // Second element is config to set, // Third element is default value #define CONF_TBL_L 29 #define CONF_TBL_NAMES { "disp_bloc_width", \ "disp_bloc_height", \ "disp_blocs_space", \ "disp_panel_width", \ "disp_panel_height", \ "disp_windows_width", \ "show_next_piece", \ "show_colors", \ "show_ghost", \ "show_highscores", \ "set_number_highscores",\ "set_lines_by_level", \ "set_score_coefficient",\ "set_blinks_lines", \ "set_blinks_delay", \ "set_init_interval", \ "set_interval_coefficient", \ "set_key_repeat_delay", \ "set_key_repeat_interv",\ "set_speed_cmd_interv", \ "set_nb_undo", \ "set_music_enabled", \ "set_music_id", \ "set_music_initial_volume", \ "use_undo", \ "use_speed_cmd", \ "enable_auto_pause", \ "enable_mouse", \ "enable_dynamic_panel" } #define CONF_TBL_VALUES { &(BLC_L), \ &(BLC_H), \ &(BLC_SP), \ &(PNL_LB), \ &(PNL_HB), \ &(WIN_L), \ &(SHOW_NEXT_PC),\ &(SHOW_COLORS), \ &(SHOW_GHOST), \ &(SHOW_HGSCRS), \ &(NB_HGSCRS), \ &(LN_BY_LVL), \ &(SC_COEF), \ &(LN_NBCLIC), \ &(LN_DELAY), \ &(INTERV), \ &(INTERV_COEF), \ &(TCH1), \ &(TCH2), \ &(TCHSHIFT), \ &(NB_UNDO), \ &(PLAY_MUSIC), \ &(MUSIC_ID), \ &(MUSIC_INIT_VOL), \ &(USE_UNDO), \ &(USE_SHIFT), \ &(ENABLE_AUTOPAUSE),\ &(ENABLE_MOUSE),\ &(ENABLE_DYNPNL)} #define CONF_TBL_DEFAULT { DEF_BLC_L, \ DEF_BLC_H, \ DEF_BLC_SP, \ DEF_PNL_LB, \ DEF_PNL_HB, \ DEF_WIN_L, \ DEF_SHOW_NEXT_PC, \ DEF_SHOW_COLORS, \ DEF_SHOW_GHOST, \ DEF_SHOW_HGSCRS, \ DEF_NB_HGSCRS, \ DEF_LN_BY_LVL, \ DEF_SC_COEF, \ DEF_LN_NBCLIC, \ DEF_LN_DELAY, \ DEF_INTERV, \ DEF_INTERV_COEF, \ DEF_TCH1, \ DEF_TCH2, \ DEF_TCHSHIFT, \ DEF_NB_UNDO, \ DEF_PLAY_MUSIC, \ DEF_MUSIC_ID, \ DEF_MUSIC_INIT_VOL, \ DEF_USE_UNDO, \ DEF_USE_SHIFT, \ DEF_ENABLE_AUTOPAUSE, \ DEF_ENABLE_MOUSE, \ DEF_ENABLE_DYNPNL } /* * Load configuration stocked in file TEsTris.conf in config */ void conf_load(struct Var_conf *config); #endif
/* * hal_timer.h * * Copyright (c) ${year}, Diego F. Asanza. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA * * Created on January 23, 2015, 8:30 PM */ #ifndef HAL_TIMER_H #define HAL_TIMER_H #ifdef __cplusplus extern "C" { #endif typedef void (*hal_timer_callback)(void); void hal_timer_init(int period_us, hal_timer_callback callback); #ifdef __cplusplus } #endif #endif /* HAL_TIMER_H */
/* Copyright (c) 1998 - 2021 ILK - Tilburg University CLST - Radboud University CLiPS - University of Antwerp This file is part of timbl timbl 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. timbl 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/>. For questions and suggestions, see: https://github.com/LanguageMachines/timbl/issues or send mail to: lamasoftware (at ) science.ru.nl */ #ifndef TIMBL_STRING_OPS_H #define TIMBL_STRING_OPS_H #include <string> #include <vector> #include <sstream> #include <exception> #include <stdexcept> namespace Timbl { bool compare_nocase( const std::string&, const std::string& ); bool compare_nocase_n( const std::string&, const std::string& ); std::string StrToCode( const std::string&, bool=true ); std::string CodeToStr( const std::string& ); std::string correct_path( const std::string&, const std::string&, bool = true ); } #endif
/* * Copyright (C) Cybernetica * * Research/Commercial License Usage * Licensees holding a valid Research License or Commercial License * for the Software may use this file according to the written * agreement between you and Cybernetica. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl-3.0.html. * * For further information, please contact us at sharemind@cyber.ee. */ #ifndef LOGHARD_PRIORITY_H #define LOGHARD_PRIORITY_H #include "PriorityC.h" #include <boost/any.hpp> #include <string> #include <vector> namespace LogHard { /// \todo Use syslog levels enum class Priority : unsigned { Fatal = LOGHARD_PRIORITY_FATAL, Error = LOGHARD_PRIORITY_ERROR, Warning = LOGHARD_PRIORITY_WARNING, Normal = LOGHARD_PRIORITY_NORMAL, Debug = LOGHARD_PRIORITY_DEBUG, FullDebug = LOGHARD_PRIORITY_FULLDEBUG }; } /* namespace LogHard { */ namespace boost { // For use with boost::program_options: void validate(boost::any & v, std::vector<std::string> const & values, LogHard::Priority * target_type, int); } /* namespace boost { */ #endif /* LOGHARD_PRIORITY_H */
/** Copyright 2011-2022 Rajesh Jayaprakash <rajesh.jayaprakash@pm.me> This file is part of pLisp. pLisp 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. pLisp 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 pLisp. If not, see <http://www.gnu.org/licenses/>. **/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> /** commands to build .so file: gcc -c -fPIC test_so.c -o test_so.o gcc -shared -W1,-soname,libtest.so -o libtest.so test_so.o **/ int fn_ret_int(int i, double f, char c, char *s) { printf("entering funtion1\n"); printf("%d\n",i); printf("%lf\n",f); printf("%c\n",c); printf("%s\n",s); printf("exiting function1\n"); return i * i; } double fn_ret_float(int i, double f, char c, char *s) { printf("%d\n",i); printf("%lf\n",f); printf("%c\n",c); printf("%s\n",s); printf("%lf\n", f + f); printf("exiting fn_ret_float\n"); return f+f; } char fn_ret_char(int i, double f, char c, char *s) { printf("%d\n",i); printf("%lf\n",f); printf("%c\n",c); printf("%s\n",s); return c; } char *fn_ret_char_ptr(int i, double f, char c, char *s) { printf("%d\n",i); printf("%lf\n",f); printf("%c\n",c); printf("%s\n",s); char *ret = (char *)malloc(10 * sizeof(char)); memset(ret, 'a', 10); //ret[10] = (char)NULL; ret[10] = '\0'; return ret; } int fn_arg_int_ptr(int *i) { printf("passed value is %d\n", *i); *i = 100; return 0; } //int fn_arg_float_ptr(float *f) int fn_arg_float_ptr(double *f) { printf("passed value is %lf\n", *f); *f = 100.97; return 0; } int fn_arg_char_ptr(char *str) { printf("passed value is %s\n", str); char *ptr = NULL; for(ptr=str; *ptr; ptr++) *ptr=toupper(*ptr); return 0; } void function_ret_void(int i, double f, char c, char *s) { printf("%d\n",i); printf("%lf\n",f); printf("%c\n",c); printf("%s\n",s); return; }
/***************************************************************************** * * param_strings.h * * PHASEX: [P]hase [H]armonic [A]dvanced [S]ynthesis [EX]periment * * Copyright (C) 1999-2013 William Weston <whw@linuxmail.org> * * PHASEX 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. * * PHASEX 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 PHASEX. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ #ifndef _PHASEX_PARAM_STRINGS_H_ #define _PHASEX_PARAM_STRINGS_H_ /* lists of parameter value names */ extern char *rate_names[]; extern char *keymode_names[]; extern char *keyfollow_names[]; extern char *mod_names[]; extern char *fm_mod_names[]; extern char *wave_names[]; extern char *filter_mode_names[]; extern char *filter_type_names[]; extern char *freq_base_names[]; extern char *mod_type_names[]; extern char *lfo_names[]; extern char *velo_lfo_names[]; extern char *polarity_names[]; extern char *sign_names[]; extern char *boolean_names[]; extern char *midi_ch_names[]; /* lists of label strings for parameter values in GUI */ extern const char *midi_ch_labels[]; extern const char *on_off_labels[]; extern const char *freq_base_labels[]; extern const char *mod_type_labels[]; extern const char *keymode_labels[]; extern const char *keyfollow_labels[]; extern const char *mod_labels[]; extern const char *fm_mod_labels[]; extern const char *velo_lfo_labels[]; extern const char *polarity_labels[]; extern const char *sign_labels[]; extern const char *wave_labels[]; extern const char *filter_mode_labels[]; extern const char *filter_type_labels[]; extern const char *lfo_labels[]; extern const char *rate_labels[]; #endif /* _PHASEX_PARAM_STRINGS_H_ */
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * * 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 RPNG_H__ #define RPNG_H__ #include <stdint.h> #include "../../boolean.h" #ifdef HAVE_CONFIG_H #include "../../config.h" #endif #ifdef __cplusplus extern "C" { #endif bool rpng_load_image_argb(const char *path, uint32_t **data, unsigned *width, unsigned *height); #ifdef HAVE_ZLIB_DEFLATE bool rpng_save_image_argb(const char *path, const uint32_t *data, unsigned width, unsigned height, unsigned pitch); bool rpng_save_image_bgr24(const char *path, const uint8_t *data, unsigned width, unsigned height, unsigned pitch); #endif #ifdef __cplusplus } #endif #endif
#include<xinu.h> /* * Given a full path of a directory ,creates that directory * assumes all the parent directories already exist * e.g. if call is like mkdir("/a/b/c)" then /a/b should * already exist. If it doesn't exist or 'c' already exists * then return SYSERR. */ status mkdir(char *path) { char pathTokens[LF_PATH_DEPTH][LF_NAME_LEN]; /*Find out how deeply the directory is nested * e.g. /a/b/c is at depht 3. */ int pathDepth = tokenize(path,pathTokens); if (pathDepth == SYSERR) { return SYSERR; } if (1 == pathDepth && PATH_SEPARATOR==pathTokens[0][0]) { return SYSERR; } wait(lfDirCblkMutex); /* * initialize lfltabl[Nlfl+1] and lfltab[Nlfl] to * parent directory and to parent's parent directory */ if (mvdir(pathTokens,pathDepth-1) == SYSERR) { signal(lfDirCblkMutex); return SYSERR; } struct lflcblk * dirCblk = &lfltab[Nlfl+1]; /*last entry is used for modifying the directory in which file is getting created.*/ struct lflcblk* parentDirCblk = &lfltab[Nlfl]; /*second last entry is used for parent of the directory in which file is getting created*/ struct dentry devPtr; struct dentry parentDevPtr; struct ldentry tempDirEntry; struct ldentry*dirEntry = &tempDirEntry; char*dirName = pathTokens[pathDepth-1]; uint32 replacePos = 0; bool8 isRPosInitialized = 0; devPtr.dvminor=Nlfl+1; parentDevPtr.dvminor=Nlfl; /* Go throuh all the entries in the parent directory to find out whethere any * of them is free. If none found then add an entry at the end. */ while(lflRead(&devPtr,(char*)dirEntry,sizeof(struct ldentry)) == sizeof(struct ldentry)) { if (!dirEntry->ld_used) { if (!isRPosInitialized) { replacePos = dirCblk->lfpos - sizeof(struct ldentry); isRPosInitialized = 1; } continue; } if (strcmp(dirEntry->ld_name,dirName) && dirEntry->ld_used) { dirCblk->lfstate = LF_FREE; parentDirCblk->lfstate = LF_FREE; signal(lfDirCblkMutex); return SYSERR; } } /* * Replace an existing unused directory entry */ if (isRPosInitialized) { lflSeek(&devPtr,replacePos); } /* * Create a new dir entry */ if (SYSERR == touchdir(dirName,LF_TYPE_DIR,dirEntry,isRPosInitialized)) { signal(lfDirCblkMutex); return SYSERR; } signal(lfDirCblkMutex); return OK; }
#ifndef EX7_53_H #define EX7_53_H class Debug { public: constexpr Debug(bool b = true) : hw(b), io(b), other(b) { } constexpr Debug(bool h, bool i, bool o): hw(h), io(i), other(o) { } constexpr bool any() { return hw || io || other; } void set_hw(bool b) { hw = b; } void set_io(bool b) { io= b; } void set_other(bool b) { other= b; } private: bool hw; bool io; bool other; }; #endif
/* Liquid War 6 is a unique multiplayer wargame. Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Christian Mauduit <ufoot@ufoot.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Liquid War 6 homepage : http://www.gnu.org/software/liquidwar6/ Contact author : ufoot@ufoot.org */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <math.h> #include "gui.h" /** * lw6gui_smoother_init * * @sys_context: global system context * @smoother: the structure to initialize * @value: the value to use for now * @duration: the duration of a standard move, in ticks (msec) * * Initializes a smoother object, with a default value. The important point * is the duration which will condition all the behavior of the object. * * Return value: none. */ void lw6gui_smoother_init (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, float value, int duration) { memset (smoother, 0, sizeof (lw6gui_smoother_t)); lw6gui_smoother_immediate_force (sys_context, smoother, value); smoother->duration = lw6sys_imax (1, duration); } /** * lw6gui_smoother_immediate_force * * @sys_context: global system context * @smoother: the structure to use * @value: the target value * * Forces a smoother object to immediately point on a value. * * Return value: none. */ void lw6gui_smoother_immediate_force (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, float value) { smoother->s1 = 0.0f; smoother->y1 = value; smoother->y2 = value; smoother->t1 = 0L; } /** * lw6gui_smoother_set_target * * @sys_context: global system context * @smoother: the structure to use * @value: the target value * @now: the current timestamp * * Sets a new target, will automatically calculate current speed to smooth * the next returned values. * * Return value: none. */ void lw6gui_smoother_set_target (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, float value, int64_t now) { float y = 0.0f; float s = 0.0f; if (smoother->y2 != value) { if (smoother->t1 > 0) { lw6sys_math_poly_wy1y2s1 (sys_context, &y, &s, now - smoother->t1, smoother->duration, smoother->y1, smoother->y2, smoother->s1); smoother->y1 = y; smoother->s1 = s; } else { smoother->y1 = smoother->y2; smoother->s1 = 0.0f; } smoother->y2 = value; smoother->t1 = now; } } /** * lw6gui_smoother_get_value * * @sys_context: global system context * @smoother: the structure to use * @now: the current timestamp * * Returns the current value of the smoother. * * Return value: a float. */ float lw6gui_smoother_get_value (lw6sys_context_t * sys_context, const lw6gui_smoother_t * smoother, int64_t now) { float ret = 0.0f; if (smoother->t1 > 0) { lw6sys_math_poly_wy1y2s1 (sys_context, &ret, NULL, now - smoother->t1, smoother->duration, smoother->y1, smoother->y2, smoother->s1); } else { ret = smoother->y2; } return ret; } /** * lw6gui_smoother_fix_overflow * * @sys_context: global system context * @smoother: object to modify * @step: step size, typically twice the map size * * Companion function of @lw6pil_coords_fix_x10, this one will fix * a smoother target to avoid crazy scrolls when cursor is on a map * edge. * * Return value: none. */ void lw6gui_smoother_fix_overflow (lw6sys_context_t * sys_context, lw6gui_smoother_t * smoother, int step) { float delta = 0.0f; int changed = 0; float value; float closest; value = smoother->y1; closest = smoother->y2; if (value > closest) { delta = fabs (value - closest); while (delta > fabs ((value - step) - closest)) { value -= step; delta = fabs (value - closest); changed = 1; } } if (value < closest) { delta = fabs (value - closest); while (delta > fabs ((value + step) - closest)) { value += step; delta = fabs (value - closest); changed = 1; } } if (changed) { smoother->y1 = value; lw6gui_smoother_set_target (sys_context, smoother, closest, smoother->t1); } }
#include <stdlib.h> #include <string.h> #include <sys/reent.h> #include "sys_state.h" #include "lwp_threads.h" int libc_reentrant; struct _reent libc_globl_reent; extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); int __libc_create_hook(lwp_cntrl *curr_thr,lwp_cntrl *create_thr) { create_thr->libc_reent = NULL; return 1; } int __libc_start_hook(lwp_cntrl *curr_thr,lwp_cntrl *start_thr) { struct _reent *ptr; ptr = (struct _reent*)calloc(1,sizeof(struct _reent)); if(!ptr) abort(); _REENT_INIT_PTR((ptr)); start_thr->libc_reent = ptr; return 1; } int __libc_delete_hook(lwp_cntrl *curr_thr, lwp_cntrl *delete_thr) { struct _reent *ptr; if(curr_thr==delete_thr) ptr = _REENT; else ptr = (struct _reent*)delete_thr->libc_reent; if(ptr && ptr!=&libc_globl_reent) { _reclaim_reent(ptr); free(ptr); } delete_thr->libc_reent = 0; if(curr_thr==delete_thr) _REENT = 0; return 1; } void __libc_init(int reentrant) { libc_globl_reent = (struct _reent)_REENT_INIT((libc_globl_reent)); _REENT = &libc_globl_reent; if(reentrant) { __lwp_thread_setlibcreent((void*)&_REENT); libc_reentrant = reentrant; } } void __libc_wrapup() { if(!__sys_state_up(__sys_state_get())) return; if(_REENT!=&libc_globl_reent) { _wrapup_reent(&libc_globl_reent); _REENT = &libc_globl_reent; } }
/************************************************************************/ /* */ /* FramepaC -- frame manipulation in C++ */ /* Version 1.99 */ /* by Ralf Brown <ralf@cs.cmu.edu> */ /* */ /* File frctype.h character-manipulation functions */ /* LastEdit: 09apr10 */ /* */ /* (c) Copyright 1994,1995,1996,1997,1998,1999,2001,2003,2006,2008, */ /* 2010 Ralf Brown */ /* 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 3. */ /* */ /* 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 (file COPYING) along with this program. If not, see */ /* http://www.gnu.org/licenses/ */ /* */ /************************************************************************/ #ifndef __FRCTYPE_H_INCLUDED #define __FRCTYPE_H_INCLUDED #include "frcommon.h" // for FrChar16 //---------------------------------------------------------------------- extern const unsigned char FramepaC_toupper_table[] ; #define Fr_toupper(c) (FramepaC_toupper_table[(unsigned char)c]) extern const unsigned char FramepaC_tolower_table[] ; #define Fr_tolower(c) (FramepaC_tolower_table[(unsigned char)c]) extern const unsigned char FramepaC_ispunct_table[] ; #define Fr_ispunct(c) (FramepaC_ispunct_table[(unsigned char)c]) extern const unsigned char FramepaC_isdigit_table[] ; #define Fr_isdigit(c) (FramepaC_isdigit_table[(unsigned char)c]) extern const unsigned char FramepaC_isspace_table[] ; #define Fr_isspace(c) (FramepaC_isspace_table[(unsigned char)c]) extern const unsigned char FramepaC_isalpha_table[] ; extern const unsigned char FramepaC_isalpha_table_EUC[] ; extern const unsigned char FramepaC_isalpha_table_raw[] ; #define Fr_isalpha(c) (FramepaC_isalpha_table[(unsigned char)c]) extern const unsigned char FramepaC_islower_table[] ; #define Fr_islower(c) (FramepaC_islower_table[(unsigned char)c]) extern const unsigned char FramepaC_isupper_table[] ; #define Fr_isupper(c) (FramepaC_isupper_table[(unsigned char)c]) extern const unsigned char FramepaC_unaccent_table_Latin1[] ; #define Fr_unaccent_Latin1(c)(FramepaC_unaccent_table_Latin1[(unsigned char)c]) extern const unsigned char FramepaC_unaccent_table_Latin2[] ; #define Fr_unaccent_Latin2(c)(FramepaC_unaccent_table_Latin2[(unsigned char)c]) //---------------------------------------------------------------------- #if defined(FrDEFAULT_CHARSET_Latin1) #define Fr_unaccent(c) Fr_unaccent_Latin1(c) #else #define Fr_unaccent(c) Fr_unaccent_Latin2(c) #endif //---------------------------------------------------------------------- // Support for 16-bit characters //---------------------------------------------------------------------- int _Fr_iswalpha(FrChar16 c) ; int _Fr_iswdigit(FrChar16 c) ; int _Fr_iswspace(FrChar16 c) ; int _Fr_iswlower(FrChar16 c) ; int _Fr_iswupper(FrChar16 c) ; FrChar16 _Fr_towlower(FrChar16 c) ; FrChar16 _Fr_towupper(FrChar16 c) ; #define Fr_is8bit(c) ((unsigned)(c) < 0x0100) inline int Fr_iswdigit(FrChar16 c) { return c >= '0' && c <= '9' ; } inline int Fr_iswspace(FrChar16 c) { return Fr_is8bit(c) ? Fr_isspace(c) : _Fr_iswspace(c) ; } inline int Fr_iswalpha(FrChar16 c) { return Fr_is8bit(c) ? Fr_isalpha(c) : _Fr_iswalpha(c) ; } inline int Fr_iswlower(FrChar16 c) { return Fr_is8bit(c) ? Fr_islower(c) : _Fr_iswlower(c) ; } inline int Fr_iswupper(FrChar16 c) { return Fr_is8bit(c) ? Fr_isupper(c) : _Fr_iswupper(c) ; } inline FrChar16 Fr_towlower(FrChar16 c) { return (FrChar16)(Fr_is8bit(c) ? Fr_tolower(c) : _Fr_towlower(c)) ; } inline FrChar16 Fr_towupper(FrChar16 c) { return (FrChar16)(Fr_is8bit(c) ? Fr_toupper(c) : _Fr_towupper(c)) ; } //---------------------------------------------------------------------- enum FrCharEncoding { FrChEnc_Latin1, FrChEnc_Latin2, FrChEnc_Unicode, FrChEnc_EUC, FrChEnc_RawOctets, FrChEnc_User, FrChEnc_UTF8 // UTF-8 encoded Unicode; acts essentially like EUC } ; typedef uint32_t FrChar_t ; typedef unsigned char const *FrCasemapTable ; //---------------------------------------------------------------------- int Fr_stricmp(const char *s1, const char *s2) ; int Fr_stricmp(const char *s1, const char *s2, const unsigned char *charmap) ; FrCharEncoding FrParseCharEncoding(const char *enc_name) ; const char *FrCharEncodingName(FrCharEncoding enc) ; #endif /* !__FRCTYPE_H_INCLUDED */ // end of frctype.h //
// Mantid Repository : https://github.com/mantidproject/mantid // // Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, // NScD Oak Ridge National Laboratory, European Spallation Source // & Institut Laue - Langevin // SPDX - License - Identifier: GPL - 3.0 + /*========================================================================= Program: Visualization Toolkit Module: AlignedThreeSliceFilter.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. =========================================================================*/ /** * @class AlignedThreeSliceFilter * @brief Cut vtkDataSet along 3 planes * * AlignedThreeSliceFilter is a filter that slice the input data using 3 plane *cut. * Each axis cut could embed several slices by providing several values. * As output you will find 4 output ports. * The output ports are defined as follow: * - 0: Merge of all the cutter output * - 1: Output of the first internal vtkCutter filter * - 2: Output of the second internal vtkCutter filter * - 3: Output of the third internal vtkCutter filter */ #ifndef AlignedThreeSliceFilter_h #define AlignedThreeSliceFilter_h #include "vtkPVClientServerCoreRenderingModule.h" //needed for exports #include "vtkThreeSliceFilter.h" class VTK_EXPORT AlignedThreeSliceFilter : public vtkThreeSliceFilter { public: vtkTypeMacro(AlignedThreeSliceFilter, vtkThreeSliceFilter); /** * Construct with user-specified implicit function; initial value of 0.0; and * generating cut scalars turned off. */ static AlignedThreeSliceFilter *New(); protected: AlignedThreeSliceFilter(); ~AlignedThreeSliceFilter() override; private: AlignedThreeSliceFilter(const AlignedThreeSliceFilter &) VTK_DELETE_FUNCTION; void operator=(const AlignedThreeSliceFilter &) VTK_DELETE_FUNCTION; }; #endif
#pragma once #include <DirectXMath.h> struct Transform { DirectX::XMFLOAT3 position; DirectX::XMFLOAT3 rotation; DirectX::XMFLOAT3 scale; };
#ifndef STATISTICMODEL_H #define STATISTICMODEL_H #endif // STATISTICMODEL_H
/** ****************************************************************************** * @file USB_Device/DualCore_Standalone/Inc/usbd_desc.h * @author MCD Application Team * @version V1.3.0 * @date 17-February-2017 * @brief Header for usbd_desc.c module ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics International N.V. * All rights reserved.</center></h2> * * Redistribution and use in source and binary forms, with or without * modification, are permitted, provided that the following conditions are met: * * 1. Redistribution of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of other * contributors to this software may be used to endorse or promote products * derived from this software without specific written permission. * 4. This software, including modifications and/or derivative works of this * software, must execute solely and exclusively on microcontroller or * microprocessor devices manufactured by or for STMicroelectronics. * 5. Redistribution and use of this software other than as permitted under * this license is void and will automatically terminate your rights under * this license. * * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USBD_DESC_H #define __USBD_DESC_H /* Includes ------------------------------------------------------------------*/ #include "usbd_hid_desc.h" #include "usbd_cdc_desc.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ #endif /* __USBD_DESC_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * signal.c * * Created on: Dec 6, 2013 * Author: reboot */ #include <glutil.h> #include <glc.h> #include "config.h" #include "signal_t.h" #include <t_glob.h> #include <l_error.h> #include <stdio.h> #include <signal.h> #include <unistd.h> #ifdef _G_SSYS_THREAD #include <pthread.h> #include <thread.h> #endif void sig_handler_null (int signal) { return; } #include <unistd.h> #include <sys/syscall.h> int setup_sighandlers (void) { struct sigaction sa = { { 0 } }, sa_c = { { 0 } }, sa_e = { { 0 } }; int r = 0; sa.sa_handler = sig_handler; sa.sa_flags = SA_RESTART; sa_c.sa_sigaction = child_sig_handler; sa_c.sa_flags = SA_RESTART | SA_SIGINFO; sa_e.sa_sigaction = sighdl_error; sa_e.sa_flags = SA_RESTART | SA_SIGINFO; sigfillset (&sa.sa_mask); sigfillset (&sa_c.sa_mask); sigemptyset (&sa_e.sa_mask); r += sigaction (SIGINT, &sa, NULL); r += sigaction (SIGQUIT, &sa, NULL); r += sigaction (SIGABRT, &sa, NULL); r += sigaction (SIGTERM, &sa, NULL); //r += sigaction(SIGIO, &sa, NULL); /*r += sigaction(SIGUSR1, &sa, NULL); r += sigaction(SIGUSR2, &sa, NULL);*/ r += sigaction (SIGCHLD, &sa_c, NULL); r += sigaction (SIGSEGV, &sa_e, NULL); r += sigaction (SIGILL, &sa_e, NULL); r += sigaction (SIGFPE, &sa_e, NULL); r += sigaction (SIGBUS, &sa_e, NULL); r += sigaction (SIGTRAP, &sa_e, NULL); r += sigaction (SIGPIPE, &sa, NULL); signal (SIGKILL, sig_handler); return r; } void child_sig_handler (int signal, siginfo_t * si, void *p) { switch (si->si_code) { case CLD_KILLED: fprintf (stderr, "NOTICE: child process caught SIGINT\n"); break; case CLD_EXITED: break; default: if (gfl & F_OPT_VERBOSE3) { fprintf (stderr, "NOTICE: child caught signal: %d\n", si->si_code); } break; } } void sig_handler (int signal) { switch (signal) { case SIGUSR1: break; case SIGUSR2: break; case SIGTERM: fprintf (stderr, "NOTICE: caught SIGTERM, terminating gracefully\n"); g_send_gkill (); break; case SIGINT: ; if (gfl & F_OPT_KILL_GLOBAL) { fprintf (stderr, "WARNING: forcefully terminating process\n"); _exit (0); } else { #ifdef _G_SSYS_NET fprintf (stderr, "NOTICE: caught SIGINT, signaling global kill..\n"); #endif g_send_gkill (); } break; case SIGPIPE: if ((gfl & F_OPT_PS_LOGGING) && -1 != fd_log&& (log_st.st_mode & S_IFMT) == S_IFIFO) { fprintf (stderr, "NOTICE: caught SIGPIPE, releasing log fifo descriptor..\n"); close (fd_log); fd_log = -1; } break; default: //usleep(SIG_BREAK_TIMEOUT_NS); fprintf (stderr, "NOTICE: caught signal %d\n", signal); break; } }