text
stringlengths
4
6.14k
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "config.h" #include <glib/gi18n-lib.h> #include <gmodule.h> #include "mate-settings-plugin.h" #include "msd-xrdb-plugin.h" #include "msd-xrdb-manager.h" struct MsdXrdbPluginPrivate { MsdXrdbManager *manager; }; #define MSD_XRDB_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), MSD_TYPE_XRDB_PLUGIN, MsdXrdbPluginPrivate)) MATE_SETTINGS_PLUGIN_REGISTER (MsdXrdbPlugin, msd_xrdb_plugin) static void msd_xrdb_plugin_init (MsdXrdbPlugin *plugin) { plugin->priv = MSD_XRDB_PLUGIN_GET_PRIVATE (plugin); g_debug ("MsdXrdbPlugin initializing"); plugin->priv->manager = msd_xrdb_manager_new (); } static void msd_xrdb_plugin_finalize (GObject *object) { MsdXrdbPlugin *plugin; g_return_if_fail (object != NULL); g_return_if_fail (MSD_IS_XRDB_PLUGIN (object)); g_debug ("MsdXrdbPlugin finalizing"); plugin = MSD_XRDB_PLUGIN (object); g_return_if_fail (plugin->priv != NULL); if (plugin->priv->manager != NULL) { g_object_unref (plugin->priv->manager); } G_OBJECT_CLASS (msd_xrdb_plugin_parent_class)->finalize (object); } static void impl_activate (MateSettingsPlugin *plugin) { gboolean res; GError *error; g_debug ("Activating xrdb plugin"); error = NULL; res = msd_xrdb_manager_start (MSD_XRDB_PLUGIN (plugin)->priv->manager, &error); if (! res) { g_warning ("Unable to start xrdb manager: %s", error->message); g_error_free (error); } } static void impl_deactivate (MateSettingsPlugin *plugin) { g_debug ("Deactivating xrdb plugin"); msd_xrdb_manager_stop (MSD_XRDB_PLUGIN (plugin)->priv->manager); } static void msd_xrdb_plugin_class_init (MsdXrdbPluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass); object_class->finalize = msd_xrdb_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; g_type_class_add_private (klass, sizeof (MsdXrdbPluginPrivate)); } static void msd_xrdb_plugin_class_finalize (MsdXrdbPluginClass *klass) { }
/* Copyright (C) 2002-2011 Karl J. Runge <runge@karlrunge.com> All rights reserved. This file is part of x11vnc. x11vnc 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. x11vnc 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 x11vnc; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA or see <http://www.gnu.org/licenses/>. In addition, as a special exception, Karl J. Runge gives permission to link the code of its release of x11vnc with the OpenSSL project's "OpenSSL" library (or with modified versions of it that use the same license as the "OpenSSL" library), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "OpenSSL". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef _X11VNC_REMOTE_H #define _X11VNC_REMOTE_H /* -- remote.h -- */ extern int send_remote_cmd(char *cmd, int query, int wait); extern int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync, int qdefault); extern void check_black_fb(void); extern int check_httpdir(void); extern void http_connections(int on); extern int remote_control_access_ok(void); extern char *process_remote_cmd(char *cmd, int stringonly); extern char *query_result; #endif /* _X11VNC_REMOTE_H */
/* * Copyright (C) 2013 LG Electronics Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _SLIMPORT_TX_REG_INIT_H_ #define _SLIMPORT_TX_REG_INIT_H_ extern void slimport_tx_link_phy_init(void); #endif /* _SLIMPORT_TX_REG_INIT_H_ */
/* * Copyright (C) 2009 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. */ #import <Foundation/Foundation.h> @class WebFrame; @class WebNavigationDataPrivate; @class WebView; @interface WebNavigationData : NSObject { @private WebNavigationDataPrivate *_private; } - (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource; - (NSString *)url; - (NSString *)title; - (NSURLRequest *)originalRequest; - (NSURLResponse *)response; - (BOOL)hasSubstituteData; - (NSString *)clientRedirectSource; @end
/* SPDX-License-Identifier: GPL-2.0-only */ /* * This file is created based on Intel Alder Lake Processor PCH Datasheet * Document number: 621483 * Chapter number: 13 */ #include <device/device.h> #include <drivers/i2c/designware/dw_i2c.h> #include <soc/pci_devs.h> int dw_i2c_soc_devfn_to_bus(unsigned int devfn) { switch (devfn) { case PCH_DEVFN_I2C0: return 0; case PCH_DEVFN_I2C1: return 1; case PCH_DEVFN_I2C2: return 2; case PCH_DEVFN_I2C3: return 3; case PCH_DEVFN_I2C4: return 4; case PCH_DEVFN_I2C5: return 5; case PCH_DEVFN_I2C6: return 6; case PCH_DEVFN_I2C7: return 7; } return -1; } int dw_i2c_soc_bus_to_devfn(unsigned int bus) { switch (bus) { case 0: return PCH_DEVFN_I2C0; case 1: return PCH_DEVFN_I2C1; case 2: return PCH_DEVFN_I2C2; case 3: return PCH_DEVFN_I2C3; case 4: return PCH_DEVFN_I2C4; case 5: return PCH_DEVFN_I2C5; case 6: return PCH_DEVFN_I2C6; case 7: return PCH_DEVFN_I2C7; } return -1; }
/* * raster-cache-const.h - Raster line cache. * * Written by * Andreas Boose <viceteam@t-online.de> * * This file is part of VICE, the Versatile Commodore Emulator. * See README for copyright notice. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. * */ #ifndef VICE_RASTER_CACHE_CONST_H #define VICE_RASTER_CACHE_CONST_H #include <string.h> #include "types.h" inline static int raster_cache_data_fill_const(uint8_t *dest, const uint8_t data, const unsigned int length, unsigned int *xs, unsigned int *xe, int no_check) { if (no_check) { *xs = 0; *xe = length - 1; memset(dest, data, (size_t)length); return 1; } else { unsigned int x = 0, i; for (i = 0; i < length && dest[i] == data; i++) { /* do nothing */ } if (i < length) { if (*xs > i) { *xs = i; } for (; i < length; i++) { if (dest[i] != data) { dest[i] = data; x = i; } } if (*xe < x) { *xe = x; } return 1; } else { return 0; } } } #endif
/***************************************************************************** * pce * *****************************************************************************/ /***************************************************************************** * File name: src/arch/ibmpc/xms.h * * Created: 2003-09-01 by Hampa Hug <hampa@hampa.ch> * * Copyright: (C) 2003-2010 Hampa Hug <hampa@hampa.ch> * *****************************************************************************/ /***************************************************************************** * This program is free software. You can redistribute it and / or modify it * * under the terms of the GNU General Public License version 2 as published * * by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY, without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * * Public License for more details. * *****************************************************************************/ #ifndef PCE_XMS_H #define PCE_XMS_H 1 #include <cpu/e8086/e8086.h> #include <devices/memory.h> #include <libini/libini.h> #define PCE_XMS_UMB_MAX 256 typedef struct { unsigned long size; unsigned lock; unsigned char *data; } xms_emb_t; typedef struct xms_umb_t { unsigned short segm; unsigned short size; unsigned char alloc; } xms_umb_t; typedef struct { unsigned emb_cnt; xms_emb_t **emb; unsigned long emb_used; unsigned long emb_max; unsigned umb_cnt; xms_umb_t *umb; unsigned short umb_segm; unsigned short umb_used; unsigned short umb_size; mem_blk_t *umbmem; mem_blk_t *hma; int hma_alloc; } xms_t; xms_t *xms_new (ini_sct_t *sct); void xms_del (xms_t *xms); mem_blk_t *xms_get_umb_mem (xms_t *xms); mem_blk_t *xms_get_hma_mem (xms_t *xms); void xms_reset (xms_t *xms); void xms_prt_state (xms_t *xms); void xms_info (xms_t *xms, e8086_t *cpu); void xms_handler (xms_t *xms, e8086_t *cpu); #endif
// Copyright (c) 2012- PPSSPP Project. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 2.0 or later versions. // 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 2.0 for more details. // A copy of the GPL 2.0 should have been included with the program. // If not, see http://www.gnu.org/licenses/ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #pragma once #include "../MIPS.h" #include "../MIPSAnalyst.h" #include "ArmEmitter.h" namespace ArmJitConstants { const ArmGen::ARMReg JITBASEREG = ArmGen::R9; const ArmGen::ARMReg CTXREG = ArmGen::R10; const ArmGen::ARMReg MEMBASEREG = ArmGen::R11; const ArmGen::ARMReg SCRATCHREG1 = ArmGen::R0; const ArmGen::ARMReg SCRATCHREG2 = ArmGen::R14; const ArmGen::ARMReg DOWNCOUNTREG = ArmGen::R7; enum { TOTAL_MAPPABLE_MIPSREGS = 36, }; enum RegMIPSLoc { ML_IMM, ML_ARMREG, // In an arm reg, but as a pre-adjusted pointer, not the actual reg. ML_ARMREG_AS_PTR, // In an arm reg, but also has a known immediate value. ML_ARMREG_IMM, ML_MEM, }; // These collide with something on Blackberry. #undef MAP_NOINIT #undef MAP_READ // Initing is the default so the flag is reversed. enum { MAP_DIRTY = 1, MAP_NOINIT = 2 | MAP_DIRTY, }; } // R1 to R6: mapped MIPS regs // R8 = flags (maybe we could do better here?) // R9 = code pointers // R10 = MIPS context // R11 = base pointer // R14 = scratch (actually LR) typedef int MIPSReg; struct RegARM { MIPSGPReg mipsReg; // if -1, no mipsreg attached. bool isDirty; // Should the register be written back? }; struct RegMIPS { // Where is this MIPS register? ArmJitConstants::RegMIPSLoc loc; // Data (only one of these is used, depending on loc. Could make a union). u32 imm; ArmGen::ARMReg reg; // reg index bool spillLock; // if true, this register cannot be spilled. // If loc == ML_MEM, it's back in its location in the CPU context struct. }; namespace MIPSComp { struct JitOptions; struct JitState; } class ArmRegCache { public: ArmRegCache(MIPSState *mips, MIPSComp::JitState *js, MIPSComp::JitOptions *jo); ~ArmRegCache() {} void Init(ArmGen::ARMXEmitter *emitter); void Start(MIPSAnalyst::AnalysisResults &stats); // Protect the arm register containing a MIPS register from spilling, to ensure that // it's being kept allocated. void SpillLock(MIPSGPReg reg, MIPSGPReg reg2 = MIPS_REG_INVALID, MIPSGPReg reg3 = MIPS_REG_INVALID, MIPSGPReg reg4 = MIPS_REG_INVALID); void ReleaseSpillLock(MIPSGPReg reg); void ReleaseSpillLocks(); void SetImm(MIPSGPReg reg, u32 immVal); bool IsImm(MIPSGPReg reg) const; u32 GetImm(MIPSGPReg reg) const; // Optimally set a register to an imm value (possibly using another register.) void SetRegImm(ArmGen::ARMReg reg, u32 imm); // Returns an ARM register containing the requested MIPS register. ArmGen::ARMReg MapReg(MIPSGPReg reg, int mapFlags = 0); ArmGen::ARMReg MapRegAsPointer(MIPSGPReg reg); // read-only, non-dirty. bool IsMapped(MIPSGPReg reg); bool IsMappedAsPointer(MIPSGPReg reg); void MapInIn(MIPSGPReg rd, MIPSGPReg rs); void MapDirtyIn(MIPSGPReg rd, MIPSGPReg rs, bool avoidLoad = true); void MapDirtyInIn(MIPSGPReg rd, MIPSGPReg rs, MIPSGPReg rt, bool avoidLoad = true); void MapDirtyDirtyIn(MIPSGPReg rd1, MIPSGPReg rd2, MIPSGPReg rs, bool avoidLoad = true); void MapDirtyDirtyInIn(MIPSGPReg rd1, MIPSGPReg rd2, MIPSGPReg rs, MIPSGPReg rt, bool avoidLoad = true); void FlushArmReg(ArmGen::ARMReg r); void FlushR(MIPSGPReg r); void FlushBeforeCall(); void FlushAll(); void DiscardR(MIPSGPReg r); ArmGen::ARMReg R(MIPSGPReg preg); // Returns a cached register, while checking that it's NOT mapped as a pointer ArmGen::ARMReg RPtr(MIPSGPReg preg); // Returns a cached register, while checking that it's mapped as a pointer void SetEmitter(ArmGen::ARMXEmitter *emitter) { emit_ = emitter; } // For better log output only. void SetCompilerPC(u32 compilerPC) { compilerPC_ = compilerPC; } int GetMipsRegOffset(MIPSGPReg r); private: const ArmGen::ARMReg *GetMIPSAllocationOrder(int &count); void MapRegTo(ArmGen::ARMReg reg, MIPSGPReg mipsReg, int mapFlags); int FlushGetSequential(MIPSGPReg startMipsReg, bool allowFlushImm); ArmGen::ARMReg FindBestToSpill(bool unusedOnly, bool *clobbered); MIPSState *mips_; ArmGen::ARMXEmitter *emit_; MIPSComp::JitState *js_; MIPSComp::JitOptions *jo_; u32 compilerPC_; enum { NUM_ARMREG = 16, NUM_MIPSREG = ArmJitConstants::TOTAL_MAPPABLE_MIPSREGS, }; RegARM ar[NUM_ARMREG]; RegMIPS mr[NUM_MIPSREG]; };
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include <string> class CVariant; namespace JSONRPC { enum TransportLayerCapability { Response = 0x1, Announcing = 0x2, FileDownloadRedirect = 0x4, FileDownloadDirect = 0x8 }; #define TRANSPORT_LAYER_CAPABILITY_ALL (Response | Announcing | FileDownloadRedirect | FileDownloadDirect) class ITransportLayer { public: virtual ~ITransportLayer() { }; virtual bool PrepareDownload(const char *path, CVariant &details, std::string &protocol) = 0; virtual bool Download(const char *path, CVariant &result) = 0; virtual int GetCapabilities() = 0; }; }
/********************************************************** * Filename: dsm_pub.h * * Discription: Huawei device state monitor public head file * * Copyright: (C) 2014 huawei. * * Author: w00140597 * **********************************************************/ #ifndef _DSM_PUB_H #define _DSM_PUB_H #include <linux/version.h> #include <linux/kernel.h> #include <linux/workqueue.h> #include <linux/wait.h> extern int debug_output; #define DSM_LOG_DEBUG(format, ...) \ do { \ if (debug_output) \ printk("[DSM] "format,## __VA_ARGS__);\ } while (0) #define DSM_LOG_INFO(format, ...) printk("[DSM] "format,## __VA_ARGS__) #define DSM_LOG_ERR(format, ...) printk("[DSM] "format,## __VA_ARGS__) #define CLIENT_NAME_LEN (32) /*dsm error no define*/ #define DSM_ERR_NO_ERROR (0) #define DSM_ERR_I2C_TIMEOUT (1) #define DSM_ERR_SENSORHUB_IPC_TIMEOUT (20400) struct dsm_client_ops{ int (*poll_state) (void); int (*dump_func) (int type, void *buff, int size); }; struct dsm_dev{ const char *name; struct dsm_client_ops *fops; size_t buff_size; }; struct dsm_client{ char client_name[CLIENT_NAME_LEN]; int client_id; int error_no; unsigned long buff_flag; struct dsm_client_ops *cops; wait_queue_head_t waitq; size_t read_size; size_t used_size; size_t buff_size; u8 dump_buff[]; }; #ifdef CONFIG_HUAWEI_DSM struct dsm_client *dsm_register_client (struct dsm_dev *dev); int dsm_client_ocuppy(struct dsm_client *client); int dsm_client_record(struct dsm_client *client, const char *fmt, ...); int dsm_client_copy(struct dsm_client *client, void *src, int sz); void dsm_client_notify(struct dsm_client *client, int error_no); #else static inline struct dsm_client *dsm_register_client (struct dsm_dev *dev) { return NULL; } static inline int dsm_client_ocuppy(struct dsm_client *client) { return 1; } static inline int dsm_client_record(struct dsm_client *client, const char *fmt, ...) { return 0; } static inline int dsm_client_copy(struct dsm_client *client, void *src, int sz) { return 0; } static inline void dsm_client_notify(struct dsm_client *client, int error_no) { return; } #endif #endif
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ namespace JSONRPC { class IClient { public: virtual ~IClient() { }; virtual int GetPermissionFlags() = 0; virtual int GetAnnouncementFlags() = 0; virtual bool SetAnnouncementFlags(int flags) = 0; }; }
/* vim: set sw=2 :miv */ /* // // BEGIN SONGBIRD GPL // // This file is part of the Songbird web player. // // Copyright(c) 2005-2008 POTI, Inc. // http://songbirdnest.com // // This file may be licensed under the terms of of the // GNU General Public License Version 2 (the "GPL"). // // Software distributed under the License is distributed // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either // express or implied. See the GPL for the specific language // governing rights and limitations. // // You should have received a copy of the GPL along with this // program. If not, go to http://www.gnu.org/licenses/gpl.html // or write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // END SONGBIRD GPL // */ #include <sbIMediacoreTypeSniffer.h> #include <nsIStringEnumerator.h> #include <nsCOMPtr.h> #include <nsHashKeys.h> #include <nsTHashtable.h> #include <prmon.h> #include <sbIMediacoreManager.h> #include <sbIMediacoreFactoryRegistrar.h> class sbMediacoreTypeSniffer : public sbIMediacoreTypeSniffer { public: NS_DECL_ISUPPORTS NS_DECL_SBIMEDIACORETYPESNIFFER sbMediacoreTypeSniffer(); nsresult Init(); private: virtual ~sbMediacoreTypeSniffer(); nsresult GetFileExtensionFromURI(nsIURI* aURI, nsACString& _retval); protected: PRMonitor *mMonitor; nsCOMPtr<sbIMediacoreFactoryRegistrar> mFactoryRegistrar; nsTHashtable<nsCStringHashKey> mAudioExtensions; nsTHashtable<nsCStringHashKey> mVideoExtensions; nsTHashtable<nsCStringHashKey> mImageExtensions; nsTHashtable<nsCStringHashKey> mPlaylistExtensions; nsTHashtable<nsCStringHashKey> mBannedWebExtensions; nsTHashtable<nsCStringHashKey> mAllExtensions; };
/* Copyright (C) 2005-2020 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. GAS 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. GAS 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 GAS; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* The EABI requires the use of VFP. */ #define FPU_DEFAULT FPU_ARCH_VFP #define EABI_DEFAULT EF_ARM_EABI_VER5 #define LOCAL_LABELS_DOLLAR 1 #define LOCAL_LABELS_FB 1 #include "obj-format.h"
////////////////////////////////////////////////////////// // QCADesigner // // Copyright 2002 Konrad Walus // // All Rights Reserved // // Author: Konrad Walus // // Email: qcadesigner@gmail.com // // WEB: http://qcadesigner.ca/ // ////////////////////////////////////////////////////////// //******************************************************// //*********** PLEASE DO NOT REFORMAT THIS CODE *********// //******************************************************// // If your editor wraps long lines disable it or don't // // save the core files that way. Any independent files // // you generate format as you wish. // ////////////////////////////////////////////////////////// // Please use complete names in variables and fucntions // // This will reduce ramp up time for new people trying // // to contribute to the project. // ////////////////////////////////////////////////////////// // This file was contributed by Gabriel Schulhof // // (schulhof@atips.ca). // ////////////////////////////////////////////////////////// // Contents: // // // // The graph dialog. This displays the waveforms and // // the bus values as present in the raw waveform data. // // The bus values are interpreted from the waveform // // data and an (upper,lower) threshhold pair chosen by // // the user. The graph dialog also allows the user to // // load and save simulation data. // // // ////////////////////////////////////////////////////////// #include <gtk/gtk.h> #include "print.h" #include "graph_dialog.h" #include "graph_dialog_data.h" #include "graph_dialog_interface.h" static graph_D graph = {NULL} ; void show_graph_dialog (GtkWindow *parent, SIMULATION_OUTPUT *sim_output, gboolean bOKToFree, gboolean bModal) { int base = 10 ; GRAPH_DIALOG_DATA *gdd = NULL ; double dThreshLower = -0.5, dThreshUpper = 0.5 ; if (NULL == graph.dialog) create_graph_dialog (&graph) ; gtk_window_set_transient_for (GTK_WINDOW (graph.dialog), parent) ; if (NULL != (gdd = g_object_get_data (G_OBJECT (graph.dialog), "graph_dialog_data"))) { dThreshLower = gdd->dHCThreshLower ; dThreshUpper = gdd->dHCThreshUpper ; base = gdd->base ; } g_object_set_data_full (G_OBJECT (graph.dialog), "graph_dialog_data", gdd = graph_dialog_data_new (sim_output, bOKToFree, dThreshLower, dThreshUpper, base), (GDestroyNotify)graph_dialog_data_free) ; apply_graph_dialog_data (&graph, gdd) ; gtk_widget_show (graph.dialog) ; if (bModal) while (GTK_WIDGET_VISIBLE (graph.dialog)) gtk_main_iteration () ; if (NULL != parent) gtk_window_present (parent) ; } void apply_graph_dialog_data (graph_D *dialog, GRAPH_DIALOG_DATA *dialog_data) { GtkWidget *trace_ui_widget = NULL, *trace_drawing_widget = NULL, *trace_ruler_widget = NULL ; int row_type ; GtkTreeIter itr ; int idxTbl = 0 ; GtkRequisition rq ; gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->tview), dialog_data->model) ; gtk_widget_size_request (dialog->tview, &rq) ; gtk_paned_set_position (GTK_PANED (dialog->hpaned), rq.width) ; gtk_tree_view_expand_all (GTK_TREE_VIEW (dialog->tview)) ; if (!gtk_tree_model_get_iter_first (dialog_data->model, &itr)) return ; while (TRUE) { gtk_tree_model_get (dialog_data->model, &itr, BUS_LAYOUT_MODEL_COLUMN_TYPE, &row_type, GRAPH_MODEL_COLUMN_TRACE, &trace_drawing_widget, GRAPH_MODEL_COLUMN_RULER, &trace_ruler_widget, GRAPH_MODEL_COLUMN_UI, &trace_ui_widget, -1) ; attach_graph_widgets (dialog, dialog->table_of_traces, trace_drawing_widget, trace_ruler_widget, trace_ui_widget, idxTbl++) ; g_object_set_data (G_OBJECT (trace_drawing_widget), "label", dialog->lbl_status) ; g_object_set_data (G_OBJECT (trace_drawing_widget), "table", dialog->table_of_traces) ; g_object_set_data (G_OBJECT (trace_drawing_widget), "hscroll", dialog->hscroll) ; g_object_set_data (G_OBJECT (trace_ruler_widget), "label", dialog->lbl_status) ; if (!gtk_tree_model_iter_next_dfs (dialog_data->model, &itr)) break ; } dialog_data->icGraphLines = idxTbl ; }
/* vi: set sw=4 ts=4: */ /* * Mini clear implementation for busybox * * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* no options, no getopt */ #include <stdio.h> #include <stdlib.h> #include "busybox.h" int clear_main(int argc, char **argv) { return printf("\033[H\033[J") != 6; }
/* * BGP Multipath * Copyright (C) 2010 Google Inc. * * This file is part of Quagga * * Quagga is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * Quagga is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; see the file COPYING; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _QUAGGA_BGP_MPATH_H #define _QUAGGA_BGP_MPATH_H /* Supplemental information linked to bgp_path_info for keeping track of * multipath selections, lazily allocated to save memory */ struct bgp_path_info_mpath { /* Points to the first multipath (on bestpath) or the next multipath */ struct bgp_path_info_mpath *mp_next; /* Points to the previous multipath or NULL on bestpath */ struct bgp_path_info_mpath *mp_prev; /* Points to bgp_path_info associated with this multipath info */ struct bgp_path_info *mp_info; /* When attached to best path, the number of selected multipaths */ uint16_t mp_count; /* Flags - relevant as noted. */ uint16_t mp_flags; #define BGP_MP_LB_PRESENT 0x1 /* Link-bandwidth present for >= 1 path */ #define BGP_MP_LB_ALL 0x2 /* Link-bandwidth present for all multipaths */ /* Aggregated attribute for advertising multipath route */ struct attr *mp_attr; /* Cumulative bandiwdth of all multipaths - attached to best path. */ uint64_t cum_bw; }; /* Functions to support maximum-paths configuration */ extern int bgp_maximum_paths_set(struct bgp *, afi_t, safi_t, int, uint16_t, uint16_t); extern int bgp_maximum_paths_unset(struct bgp *, afi_t, safi_t, int); /* Functions used by bgp_best_selection to record current * multipath selections */ extern int bgp_path_info_nexthop_cmp(struct bgp_path_info *bpi1, struct bgp_path_info *bpi2); extern void bgp_mp_list_init(struct list *); extern void bgp_mp_list_clear(struct list *); extern void bgp_mp_list_add(struct list *mp_list, struct bgp_path_info *mpinfo); extern void bgp_mp_dmed_deselect(struct bgp_path_info *dmed_best); extern void bgp_path_info_mpath_update(struct bgp_dest *dest, struct bgp_path_info *new_best, struct bgp_path_info *old_best, struct list *mp_list, struct bgp_maxpaths_cfg *mpath_cfg); extern void bgp_path_info_mpath_aggregate_update(struct bgp_path_info *new_best, struct bgp_path_info *old_best); /* Unlink and free multipath information associated with a bgp_path_info */ extern void bgp_path_info_mpath_dequeue(struct bgp_path_info *path); extern void bgp_path_info_mpath_free(struct bgp_path_info_mpath **mpath); /* Walk list of multipaths associated with a best path */ extern struct bgp_path_info * bgp_path_info_mpath_first(struct bgp_path_info *path); extern struct bgp_path_info * bgp_path_info_mpath_next(struct bgp_path_info *path); /* Accessors for multipath information */ extern uint32_t bgp_path_info_mpath_count(struct bgp_path_info *path); extern struct attr *bgp_path_info_mpath_attr(struct bgp_path_info *path); extern bool bgp_path_info_mpath_chkwtd(struct bgp *bgp, struct bgp_path_info *path); extern uint64_t bgp_path_info_mpath_cumbw(struct bgp_path_info *path); #endif /* _QUAGGA_BGP_MPATH_H */
#include <stdio.h> #include <string.h> #include <meizupshelper.h> static int do_calibrate(void) { return meizu_psh_run_calibration(); } static int do_usage(const char *progname) { fprintf(stderr, "usage: %s <c>\n\n", progname); fprintf(stderr, " c -- run proximity sensor calibration\n"); return 127; } int main(int argc, char *argv[]) { if (argc != 2) { return do_usage(argv[0]); } if (!strcasecmp(argv[1], "c")) { return do_calibrate(); } return do_usage(argv[0]); }
/* * CINELERRA * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef CTIMEBAR_H #define CTIMEBAR_H #include "cwindowgui.inc" #include "timebar.h" class CTimeBar : public TimeBar { public: CTimeBar(MWindow *mwindow, CWindowGUI *gui, int x, int y, int w, int h); int resize_event(); EDL* get_edl(); void draw_time(); void update_preview(); void select_label(double position); CWindowGUI *gui; }; #endif
/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef THINKPAD_X60_DOCK_H #define THINKPAD_X60_DOCK_H int dock_connect(void); void dock_disconnect(void); int dock_present(void); int dlpc_init(void); int legacy_io_present(void); void legacy_io_init(void); #endif
/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2010--2017 R Core Team * * 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, a copy is available at * https://www.R-project.org/Licenses/ */ #define WIN32_LEAN_AND_MEAN 1 #include <windows.h> /* for SetConsoleCtrlHandler */ #include <stdlib.h> /* for exit */ #include <string.h> #include <stdio.h> extern char *getRHOME(int); /* in ../rhome.c */ static void Usage (char *RCMD, char *arch) { fprintf(stderr, "%s %s %s", "Usage:", RCMD, "[command args]\n\n"); fprintf(stderr, "%s%s%s", "where 'command args' can be\n\n", " --arch n for n=i386, x64, 32 or 64\n", " any other arguments listed by "); fprintf(stderr, "%s --arch %s --help\n", RCMD, arch); } #define CMD_LEN 10000 int main (int argc, char **argv) { int cmdarg = 1; int interactive = 0; char arch[10] = R_ARCH, cmd[CMD_LEN], *p; if (argc > 1 && strcmp(argv[1], "--help") == 0) { Usage(argv[0], arch); exit(0); } if (argc > 1 && strcmp(argv[1], "--arch") == 0) { cmdarg = 3; if(argc < 3) { Usage(argv[0], arch); exit(0); } strncpy(arch, argv[2], 10); arch[9] = '\0'; if(strcmp(arch, "32") == 0) strcpy(arch, "i386"); if(strcmp(arch, "64") == 0) strcpy(arch, "x64"); if(strcmp(arch, "i386") && strcmp(arch, "x64")) { fprintf(stderr, "valid values for --arch are i386, x64, 32, 64\n"); exit(1); } } else if ((p = getenv("R_ARCH"))) strncpy(arch, p+1, 10); /* skip leading slash */ if (stricmp(argv[0] + strlen(argv[0]) - 11, "Rscript.exe") == 0 || stricmp(argv[0] + strlen(argv[0]) - 7, "Rscript") == 0) snprintf(cmd, CMD_LEN, "\"\"%s\\bin\\%s\\Rscript.exe\"", getRHOME(2), arch); else { snprintf(cmd, CMD_LEN, "\"\"%s\\bin\\%s\\R.exe\"", getRHOME(2), arch); interactive = 1; } for(int i = cmdarg; i < argc; i++) { if (interactive && !strcmp(argv[i], "CMD")) interactive = 0; strcat(cmd, " "); if(strchr(argv[i], ' ')) { strcat(cmd, "\""); /* We should really escape " here, I believe */ strcat(cmd, argv[i]); strcat(cmd, "\""); } else strcat(cmd, argv[i]); } /* the outermost double quotes are needed for cmd.exe */ strcat(cmd, "\""); if (interactive) /* Ignore Ctrl-C so that Rterm.exe can handle it */ SetConsoleCtrlHandler(NULL, TRUE); exit(system(cmd)); }
/* SERVER_REC definition, used for inheritance */ int type; /* module_get_uniq_id("SERVER", 0) */ int chat_type; /* chat_protocol_lookup(xx) */ int refcount; STRUCT_SERVER_CONNECT_REC *connrec; time_t connect_time; /* connection time */ time_t real_connect_time; /* time when server replied that we really are connected */ char *tag; /* tag name for addressing server */ char *nick; /* current nick */ unsigned int connected:1; /* Connected to server */ unsigned int disconnected:1; /* Disconnected, waiting for refcount to drop zero */ unsigned int connection_lost:1; /* Connection lost unintentionally */ unsigned int session_reconnect:1; /* Connected to this server with /UPGRADE */ unsigned int no_reconnect:1; /* Don't reconnect to server */ NET_SENDBUF_REC *handle; int readtag; /* input tag */ /* for net_connect_nonblock() */ GIOChannel *connect_pipe[2]; int connect_tag; int connect_pid; RAWLOG_REC *rawlog; LINEBUF_REC *buffer; /* receive buffer */ GHashTable *module_data; char *version; /* server version */ char *away_reason; char *last_invite; /* channel where you were last invited */ unsigned int server_operator:1; unsigned int usermode_away:1; unsigned int banned:1; /* not allowed to connect to this server */ unsigned int dns_error:1; /* DNS said the host doesn't exist */ GTimeVal lag_sent; /* 0 or time when last lag query was sent to server */ time_t lag_last_check; /* last time we checked lag */ int lag; /* server lag in milliseconds */ GSList *channels; GSList *queries; /* -- support for multiple server types -- */ /* -- must not be NULL: -- */ /* join to a number of channels, channels are specified in `data' separated with commas. there can exist other information after first space like channel keys etc. */ void (*channels_join)(SERVER_REC *server, const char *data, int automatic); /* returns true if `flag' indicates a nick flag (op/voice/halfop) */ int (*isnickflag)(SERVER_REC *server, char flag); /* returns true if `data' indicates a channel */ int (*ischannel)(SERVER_REC *server, const char *data); /* returns all nick flag characters in order op, voice, halfop. If some of them aren't supported '\0' can be used. */ const char *(*get_nick_flags)(SERVER_REC *server); /* send public or private message to server */ void (*send_message)(SERVER_REC *server, const char *target, const char *msg, int target_type); /* -- Default implementations are used if NULL -- */ CHANNEL_REC *(*channel_find_func)(SERVER_REC *server, const char *name); QUERY_REC *(*query_find_func)(SERVER_REC *server, const char *nick); int (*mask_match_func)(const char *mask, const char *data); /* returns true if `msg' was meant for `nick' */ int (*nick_match_msg)(const char *nick, const char *msg); #undef STRUCT_SERVER_CONNECT_REC
/* * Copyright 2008, 2009 Chris Young <chris@unsatisfactorysoftware.co.uk> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * * NetSurf is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * NetSurf is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <proto/exec.h> #include "utils/errors.h" #include "desktop/mouse.h" #include "desktop/gui_window.h" #include "amiga/history.h" #include "amiga/tree.h" #include "amiga/tree.h" void ami_global_history_initialise(void) { global_history_window = ami_tree_create(TREE_HISTORY, NULL); if(!global_history_window) return; } void ami_global_history_free() { ami_tree_destroy(global_history_window); global_history_window = NULL; }
/* * Copyright (C) 2012 ProFUSION embedded systems * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> #include <errno.h> #include <dirent.h> #include <fcntl.h> #include <dlfcn.h> #include <limits.h> #include <stdlib.h> #include <stdarg.h> #include <stddef.h> #include <string.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> /* kmod_elf_get_section() is not exported, we need the private header */ #include <libkmod-private.h> /* FIXME: hack, change name so we don't clash */ #undef ERR #include "mkdir.h" #include "testsuite.h" #include "stripped-module.h" struct mod { struct mod *next; int ret; int errcode; char name[]; }; static struct mod *modules; static bool need_init = true; static struct kmod_ctx *ctx; static void parse_retcodes(struct mod *_modules, const char *s) { const char *p; if (s == NULL) return; for (p = s;;) { struct mod *mod; const char *modname; char *end; size_t modnamelen; int ret, errcode; long l; modname = p; if (modname == NULL || modname[0] == '\0') break; modnamelen = strcspn(s, ":"); if (modname[modnamelen] != ':') break; p = modname + modnamelen + 1; if (p == NULL) break; l = strtol(p, &end, 0); if (end == p || *end != ':') break; ret = (int) l; p = end + 1; l = strtol(p, &end, 0); if (*end == ':') p = end + 1; else if (*end != '\0') break; errcode = (int) l; mod = malloc(sizeof(*mod) + modnamelen + 1); if (mod == NULL) break; memcpy(mod->name, modname, modnamelen); mod->name[modnamelen] = '\0'; mod->ret = ret; mod->errcode = errcode; mod->next = _modules; _modules = mod; } } static int write_one_line_file(const char *fn, const char *line, int len) { FILE *f; int r; assert(fn); assert(line); f = fopen(fn, "we"); if (!f) return -errno; errno = 0; if (fputs(line, f) < 0) { r = -errno; goto finish; } fflush(f); if (ferror(f)) { if (errno != 0) r = -errno; else r = -EIO; } else r = 0; finish: fclose(f); return r; } static int create_sysfs_files(const char *modname) { char buf[PATH_MAX]; const char *sysfsmod = "/sys/module/"; int len = strlen(sysfsmod); memcpy(buf, sysfsmod, len); strcpy(buf + len, modname); len += strlen(modname); assert(mkdir_p(buf, 0755) >= 0); strcpy(buf + len, "/initstate"); return write_one_line_file(buf, "live\n", strlen("live\n")); } static struct mod *find_module(struct mod *_modules, const char *modname) { struct mod *mod; for (mod = _modules; mod != NULL; mod = mod->next) { if (strcmp(mod->name, modname) == 0) return mod; } return NULL; } static void init_retcodes(void) { const char *s; if (!need_init) return; need_init = false; s = getenv(S_TC_INIT_MODULE_RETCODES); if (s == NULL) { fprintf(stderr, "TRAP init_module(): missing export %s?\n", S_TC_INIT_MODULE_RETCODES); } ctx = kmod_new(NULL, NULL); parse_retcodes(modules, s); } static inline bool module_is_inkernel(const char *modname) { struct kmod_module *mod; int state; bool ret; if (kmod_module_new_from_name(ctx, modname, &mod) < 0) return false; state = kmod_module_get_initstate(mod); if (state == KMOD_MODULE_LIVE || state == KMOD_MODULE_BUILTIN) ret = true; else ret = false; kmod_module_unref(mod); return ret; } TS_EXPORT long init_module(void *mem, unsigned long len, const char *args); /* * Default behavior is to try to mimic init_module behavior inside the kernel. * If it is a simple test that you know the error code, set the return code * in TESTSUITE_INIT_MODULE_RETCODES env var instead. * * The exception is when the module name is not find in the memory passed. * This is because we want to be able to pass dummy modules (and not real * ones) and it still work. */ long init_module(void *mem, unsigned long len, const char *args) { const char *modname; struct kmod_elf *elf; struct mod *mod; const void *buf; uint64_t bufsize; int err; init_retcodes(); elf = kmod_elf_new(mem, len); if (elf == NULL) return 0; err = kmod_elf_get_section(elf, ".gnu.linkonce.this_module", &buf, &bufsize); kmod_elf_unref(elf); /* * We couldn't find the module's name inside the ELF file. Just exit * as if it was successful */ if (err < 0) return 0; modname = (char *)buf + offsetof(struct module, name); mod = find_module(modules, modname); if (mod != NULL) { errno = mod->errcode; err = mod->ret; } else if (module_is_inkernel(modname)) { err = -1; errno = EEXIST; } else err = 0; if (err == 0) create_sysfs_files(modname); return err; } /* the test is going away anyway, but lets keep valgrind happy */ void free_resources(void) __attribute__((destructor)); void free_resources(void) { while (modules) { struct mod *mod = modules->next; free(modules); modules = mod; } if (ctx) kmod_unref(ctx); }
/* * linux/include/asm-arm/cpu-multi32.h * * Copyright (C) 2000 Russell King * Modified by Hyok S. Choi, 2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <asm/page.h> struct mm_struct; /* * Don't change this structure - ASM code * relies on it. */ extern struct processor { /* MISC * get data abort address/flags */ void (*_data_abort)(unsigned long pc); /* * Set up any processor specifics */ void (*_proc_init)(void); /* * Disable any processor specifics */ void (*_proc_fin)(void); /* * Special stuff for a reset */ void (*reset)(unsigned long addr) __attribute__((noreturn)); /* * Idle the processor */ int (*_do_idle)(void); /* * Processor architecture specific */ /* * clean a virtual address range from the * D-cache without flushing the cache. */ void (*dcache_clean_area)(void *addr, int size); /* * Set the page table */ void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm); #ifdef CONFIG_MMU /* * Set a PTE */ void (*set_pte)(pte_t *ptep, pte_t pte); #endif } processor; #define cpu_proc_init() processor._proc_init() #define cpu_proc_fin() processor._proc_fin() #define cpu_reset(addr) processor.reset(addr) #define cpu_do_idle() processor._do_idle() #define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz) #ifdef CONFIG_MMU #define cpu_set_pte(ptep, pte) processor.set_pte(ptep, pte) #endif #define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
/* * TAP-Win32 -- A kernel driver to provide virtual tap device functionality * on Windows. Originally derived from the CIPE-Win32 * project by Damion K. Wilson, with extensive modifications by * James Yonan. * * All source code which derives from the CIPE-Win32 project is * Copyright (C) Damion K. Wilson, 2003, and is released under the * GPL version 2 (see below). * * All other source code is Copyright (C) 2002-2005 OpenVPN Solutions LLC, * and is released under the GPL version 2 (see below). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ //=============================================== // This file is included both by OpenVPN and // the TAP-Win32 driver and contains definitions // common to both. //=============================================== #include <windows.h> #include <stdlib.h> #include <winioctl.h> #define TAP_WIN32_MIN_MAJOR 9 #define TAP_WIN32_MIN_MINOR 0 //============= // TAP IOCTLs //============= #define TAP_CONTROL_CODE(request,method) \ CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) // Present in 8.1 #define TAP_IOCTL_GET_MAC TAP_CONTROL_CODE (1, METHOD_BUFFERED) #define TAP_IOCTL_GET_VERSION TAP_CONTROL_CODE (2, METHOD_BUFFERED) #define TAP_IOCTL_GET_MTU TAP_CONTROL_CODE (3, METHOD_BUFFERED) #define TAP_IOCTL_GET_INFO TAP_CONTROL_CODE (4, METHOD_BUFFERED) #define TAP_IOCTL_CONFIG_POINT_TO_POINT TAP_CONTROL_CODE (5, METHOD_BUFFERED) #define TAP_IOCTL_SET_MEDIA_STATUS TAP_CONTROL_CODE (6, METHOD_BUFFERED) #define TAP_IOCTL_CONFIG_DHCP_MASQ TAP_CONTROL_CODE (7, METHOD_BUFFERED) #define TAP_IOCTL_GET_LOG_LINE TAP_CONTROL_CODE (8, METHOD_BUFFERED) #define TAP_IOCTL_CONFIG_DHCP_SET_OPT TAP_CONTROL_CODE (9, METHOD_BUFFERED) // Added in 8.2 /* obsoletes TAP_IOCTL_CONFIG_POINT_TO_POINT */ #define TAP_IOCTL_CONFIG_TUN TAP_CONTROL_CODE (10, METHOD_BUFFERED) //================= // Registry keys //================= #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" //====================== // Filesystem prefixes //====================== #define USERMODEDEVICEDIR "\\\\.\\Global\\" #define SYSDEVICEDIR "\\Device\\" #define USERDEVICEDIR "\\DosDevices\\Global\\" #define TAPSUFFIX ".tap" //========================================================= // TAP_COMPONENT_ID -- This string defines the TAP driver // type -- different component IDs can reside in the system // simultaneously. //========================================================= #define TAP_COMPONENT_ID "tap0901"
/* @(#)e_scalb.c 5.1 93/09/24 */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ #if defined(LIBM_SCCS) && !defined(lint) static char rcsid[] = "$NetBSD: e_scalb.c,v 1.6 1995/05/10 20:46:09 jtc Exp $"; #endif /* * __ieee754_scalb(x, fn) is provide for * passing various standard test suite. One * should use scalbn() instead. */ #include <fenv.h> #include "math.h" #include "math_private.h" #ifdef _SCALB_INT #ifdef __STDC__ double __ieee754_scalb(double x, int fn) #else double __ieee754_scalb(x,fn) double x; int fn; #endif #else #ifdef __STDC__ double __ieee754_scalb(double x, double fn) #else double __ieee754_scalb(x,fn) double x, fn; #endif #endif { #ifdef _SCALB_INT return __scalbn(x,fn); #else if (__isnan(x)||__isnan(fn)) return x*fn; if (!__finite(fn)) { if(fn>0.0) return x*fn; else if (x == 0) return x; else if (!__finite (x)) { # ifdef FE_INVALID feraiseexcept (FE_INVALID); # endif return __nan (""); } else return x/(-fn); } if (__rint(fn)!=fn) { # ifdef FE_INVALID feraiseexcept (FE_INVALID); # endif return __nan (""); } if ( fn > 65000.0) return __scalbn(x, 65000); if (-fn > 65000.0) return __scalbn(x,-65000); return __scalbn(x,(int)fn); #endif }
/**************************************************************************** * Ralink Tech Inc. * Taiwan, R.O.C. * * (c) Copyright 2010, Ralink Technology, Inc. * * All rights reserved. Ralink's source code is an unpublished work and the * use of a copyright notice does not imply otherwise. This source code * contains confidential trade secret material of Ralink Tech. Any attemp * or participation in deciphering, decoding, reverse engineering or in any * way altering the source code is stricitly prohibited, unless the prior * written consent of Ralink Technology, Inc. is obtained. ***************************************************************************/ /**************************************************************************** Abstract: All Related Structure & Definition for UBICOM platform. Only used in UTIL module. ***************************************************************************/ #ifndef __VR_UBICOM_H__ #define __VR_UBICOM_H__ #ifdef PLATFORM_UBM_IPX8 #include <asm/cachectl.h> #undef RTMP_UTIL_DCACHE_FLUSH #define RTMP_UTIL_DCACHE_FLUSH(__AddrStart, __Size) \ flush_dcache_range((ULONG)(__AddrStart), \ (ULONG)(((UCHAR *)(__AddrStart)) + __Size - 1)) #endif /* PLATFORM_UBM_IPX8 */ #endif /* __VR_UBICOM_H__ */ /* End of vrut_ubm.h */
#ifndef __COLORMAP2_H__ #define __COLORMAP2_H__ #include "ViewerLib.h" #ifndef _REAL_ #define _REAL_ typedef float real; #endif #define MAX_COL_NUMBER 256 #define MIN_COL_NUMBER 2 enum { WHITE, BLACK, RED, BLUE, YELLOW, GREEN, GREY1, GREY2, GREY3 }; /*enum { BLACK, WHITE, RED, BLUE, YELLOW, GREEN, GREY1, GREY2, GREY3 };*/ /*int ViewColGetPixel_ (int);*/ int ViewColBwGetPixel_ (int); int ViewColNoBwGetPixel_ (int); int ViewColGetPixelByName_ (char *); int get_number_of_colors_ (); int get_number_of_grey_scales_ (); int get_depth_ (); int ViewColGetNumberOfColors_ (); int ViewColBwGetNumberOfColors_ (); /*int ViewColGetForegroundPixel_ ();*/ int ViewColGetBackgroundPixel_ (); int set_colormap_TclCmd_ (ClientData,Tcl_Interp *,int,char**); void init_colormap_ (Tk_Window); int ViewColConvertToPixelInit_ (real,real); unsigned long ViewColLogConvertToPixel_ (real); unsigned long ViewColLinConvertToPixel_ (real); unsigned long ViewColDisConvertToPixel_ (real); void ViewColConvertHighlight_ (real); unsigned long get_grey_intensity_ (int grey_number); unsigned long get_color_intensity_ (int color_number); unsigned long get_color_by_name_ (Tk_Window, char *name); #endif
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_MODULES_UTILITY_SOURCE_CODER_H_ #define WEBRTC_MODULES_UTILITY_SOURCE_CODER_H_ #include "webrtc/base/scoped_ptr.h" #include "webrtc/common_types.h" #include "webrtc/modules/audio_coding/main/include/audio_coding_module.h" #include "webrtc/typedefs.h" namespace webrtc { class AudioFrame; class AudioCoder : public AudioPacketizationCallback { public: AudioCoder(uint32_t instanceID); ~AudioCoder(); int32_t SetEncodeCodec(const CodecInst& codecInst); int32_t SetDecodeCodec(const CodecInst& codecInst); int32_t Decode(AudioFrame& decodedAudio, uint32_t sampFreqHz, const int8_t* incomingPayload, size_t payloadLength); int32_t PlayoutData(AudioFrame& decodedAudio, uint16_t& sampFreqHz); int32_t Encode(const AudioFrame& audio, int8_t* encodedData, size_t& encodedLengthInBytes); protected: int32_t SendData(FrameType frameType, uint8_t payloadType, uint32_t timeStamp, const uint8_t* payloadData, size_t payloadSize, const RTPFragmentationHeader* fragmentation) override; private: rtc::scoped_ptr<AudioCodingModule> _acm; CodecInst _receiveCodec; uint32_t _encodeTimestamp; int8_t* _encodedData; size_t _encodedLengthInBytes; uint32_t _decodeTimestamp; }; } // namespace webrtc #endif // WEBRTC_MODULES_UTILITY_SOURCE_CODER_H_
/* * This file is part of the coreboot project. * * Copyright (C) 2007-2009 coresystems GmbH * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org> * Copyright (C) 2013 Vladimir Serbinenko <phcoder@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; version 2 of * the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301 USA */ #include <console/console.h> #include <device/device.h> #include <arch/io.h> #include <delay.h> #include <device/pci_def.h> #include <device/pci_ops.h> #include <device/pci_ids.h> #include <arch/io.h> #include <northbridge/intel/nehalem/nehalem.h> #include <southbridge/intel/bd82x6x/pch.h> #include <ec/acpi/ec.h> #include <pc80/mc146818rtc.h> #include "hda_verb.h" #include <arch/x86/include/arch/acpigen.h> #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE #include <x86emu/regs.h> #include <arch/interrupt.h> #endif #include <pc80/keyboard.h> #include <cpu/x86/lapic.h> #include <device/pci.h> #include <smbios.h> static acpi_cstate_t cst_entries[] = { {1, 1, 1000, {0x7f, 1, 2, {0}, 1, 0}}, {2, 1, 500, {0x01, 8, 0, {0}, DEFAULT_PMBASE + LV2, 0}}, {2, 17, 250, {0x01, 8, 0, {0}, DEFAULT_PMBASE + LV3, 0}}, }; int get_cst_entries(acpi_cstate_t ** entries) { *entries = cst_entries; return ARRAY_SIZE(cst_entries); } #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE static int int15_handler(void) { switch ((X86_EAX & 0xffff)) { /* Get boot display. */ case 0x5f35: X86_EAX = 0x5f; /* The flags are: 1 - VGA 4 - DisplayPort 8 - LCD */ X86_ECX = 0x8; return 1; case 0x5f40: X86_EAX = 0x5f; X86_ECX = 0x2; return 1; default: printk(BIOS_WARNING, "Unknown INT15 function %04x!\n", X86_EAX & 0xffff); return 0; } } #endif /* Audio Setup */ extern const u32 *cim_verb_data; extern u32 cim_verb_data_size; static void verb_setup(void) { cim_verb_data = mainboard_cim_verb_data; cim_verb_data_size = sizeof(mainboard_cim_verb_data); } static void mainboard_enable(device_t dev) { u16 pmbase; printk(BIOS_SPEW, "starting SPI configuration\n"); /* Configure SPI. */ RCBA32(0x3800) = 0x07ff0500; RCBA32(0x3804) = 0x3f046008; RCBA32(0x3808) = 0x0058efc0; RCBA32(0x384c) = 0x92000000; RCBA32(0x3850) = 0x00000a0b; RCBA32(0x3858) = 0x07ff0500; RCBA32(0x385c) = 0x04ff0003; RCBA32(0x3860) = 0x00020001; RCBA32(0x3864) = 0x00000fff; RCBA32(0x3874) = 0; RCBA32(0x3890) = 0xf8400000; RCBA32(0x3894) = 0x143b5006; RCBA32(0x3898) = 0x05200302; RCBA32(0x389c) = 0x0601209f; RCBA32(0x38b0) = 0x00000004; RCBA32(0x38b4) = 0x03040002; RCBA32(0x38c0) = 0x00000007; RCBA32(0x38c8) = 0x00002005; RCBA32(0x38c4) = 0x00802005; RCBA32(0x3804) = 0x3f04e008; printk(BIOS_SPEW, "SPI configured\n"); int i; const u8 dmp[256] = { 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x89, 0xe4, 0x30, 0x00, 0x40, 0x14, 0x00, 0x00, 0x00, 0x11, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x01, 0x04, 0x00, 0x08, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0x07, 0x09, 0x09, 0xf0, 0x00, 0x00, 0xf0, 0xa9, 0x00, 0x00, 0x06, 0x00, 0x00, 0xff, 0x00, 0x00, 0x01, 0x00, 0x04, 0xff, 0xff, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0b, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x28, 0x1b, 0x21, 0x00, 0x2c, 0x3b, 0x13, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x5a, 0x57, 0x5c, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x52, 0x10, 0x52, 0x10, 0x64, 0x00, 0x00, 0x00, 0x74, 0x30, 0x00, 0x60, 0x00, 0x00, 0xaf, 0x0b, 0x30, 0x45, 0x2e, 0x30, 0x38, 0x41, 0x43, 0x2e, 0x30, 0x31, 0x2e, 0x31, 0x36, 0x20, 0x00, 0x00, }; for (i = 0; i < 256; i++) ec_write (i, dmp[i]); pmbase = pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x1f, 0)), PMBASE) & 0xff80; printk(BIOS_SPEW, " ... pmbase = 0x%04x\n", pmbase); outl(0, pmbase + SMI_EN); enable_lapic(); pci_write_config32(dev_find_slot(0, PCI_DEVFN(0x1f, 0)), GPIO_BASE, DEFAULT_GPIOBASE | 1); pci_write_config8(dev_find_slot(0, PCI_DEVFN(0x1f, 0)), GPIO_CNTL, 0x10); #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE /* Install custom int15 handler for VGA OPROM */ mainboard_interrupt_handlers(0x15, &int15_handler); #endif /* This sneaked in here, because EasyNote has no SuperIO chip. */ pc_keyboard_init(); verb_setup(); } struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, };
/* * linux/fs/bad_inode.c * * Copyright (C) 1997, Stephen Tweedie * * Provide stub functions for unreadable inodes */ #include <linux/fs.h> #include <linux/stat.h> #include <linux/sched.h> #include <linux/poll.h> static loff_t bad_file_llseek(struct file *file, loff_t offset, int origin) { return -EIO; } static ssize_t bad_file_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos) { return -EIO; } static ssize_t bad_file_write(struct file *filp, const char __user *buf, size_t siz, loff_t *ppos) { return -EIO; } static int bad_file_readdir(struct file *filp, void *dirent, filldir_t filldir) { return -EIO; } static unsigned int bad_file_poll(struct file *filp, poll_table *wait) { return POLLERR; } static int bad_file_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { return -EIO; } static int bad_file_mmap(struct file *file, struct vm_area_struct *vma) { return -EIO; } static int bad_file_open(struct inode *inode, struct file *filp) { return -EIO; } static int bad_file_flush(struct file *file) { return -EIO; } static int bad_file_release(struct inode *inode, struct file *filp) { return -EIO; } static int bad_file_fsync(struct file *file, struct dentry *dentry, int datasync) { return -EIO; } static int bad_file_fasync(int fd, struct file *filp, int on) { return -EIO; } static int bad_file_lock(struct file *file, int cmd, struct file_lock *fl) { return -EIO; } /* * The follow_link operation is special: it must behave as a no-op * so that a bad root inode can at least be unmounted. To do this * we must dput() the base and return the dentry with a dget(). */ static int bad_follow_link(struct dentry *dent, struct nameidata *nd) { return vfs_follow_link(nd, ERR_PTR(-EIO)); } static struct file_operations bad_file_ops = { llseek: bad_file_llseek, read: bad_file_read, write: bad_file_write, readdir: bad_file_readdir, poll: bad_file_poll, ioctl: bad_file_ioctl, mmap: bad_file_mmap, open: bad_file_open, flush: bad_file_flush, release: bad_file_release, fsync: bad_file_fsync, fasync: bad_file_fasync, lock: bad_file_lock, }; static int bad_inode_create (struct inode *dir, struct dentry *dentry, int mode) { return -EIO; } static struct dentry *bad_inode_lookup(struct inode *dir, struct dentry *dentry) { return ERR_PTR(-EIO); } static int bad_inode_link (struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) { return -EIO; } static int bad_inode_unlink(struct inode *dir, struct dentry *dentry) { return -EIO; } static int bad_inode_symlink (struct inode *dir, struct dentry *dentry, const char *symname) { return -EIO; } static int bad_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode) { return -EIO; } static int bad_inode_rmdir (struct inode *dir, struct dentry *dentry) { return -EIO; } static int bad_inode_mknod (struct inode *dir, struct dentry *dentry, int mode, int rdev) { return -EIO; } static int bad_inode_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { return -EIO; } static int bad_inode_readlink(struct dentry *dentry, char __user *buffer, int buflen) { return -EIO; } static int bad_inode_permission(struct inode *inode, int mask) { return -EIO; } static int bad_inode_revalidate(struct dentry *dentry) { return -EIO; } struct inode_operations bad_inode_ops = { create: bad_inode_create, lookup: bad_inode_lookup, link: bad_inode_link, unlink: bad_inode_unlink, symlink: bad_inode_symlink, mkdir: bad_inode_mkdir, rmdir: bad_inode_rmdir, mknod: bad_inode_mknod, rename: bad_inode_rename, readlink: bad_inode_readlink, follow_link: bad_follow_link, /* truncate returns void */ permission: bad_inode_permission, revalidate: bad_inode_revalidate, }; /* * When a filesystem is unable to read an inode due to an I/O error in * its read_inode() function, it can call make_bad_inode() to return a * set of stubs which will return EIO errors as required. * * We only need to do limited initialisation: all other fields are * preinitialised to zero automatically. */ /** * make_bad_inode - mark an inode bad due to an I/O error * @inode: Inode to mark bad * * When an inode cannot be read due to a media or remote network * failure this function makes the inode "bad" and causes I/O operations * on it to fail from this point on. */ void make_bad_inode(struct inode * inode) { inode->i_mode = S_IFREG; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_op = &bad_inode_ops; inode->i_fop = &bad_file_ops; } /* * This tests whether an inode has been flagged as bad. The test uses * &bad_inode_ops to cover the case of invalidated inodes as well as * those created by make_bad_inode() above. */ /** * is_bad_inode - is an inode errored * @inode: inode to test * * Returns true if the inode in question has been marked as bad. */ int is_bad_inode(struct inode * inode) { return (inode->i_op == &bad_inode_ops); }
/* * Copyright (C) 2015 Stuart Howarth <showarth@marxoft.co.uk> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 3, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef CATEGORIESDIALOG_H #define CATEGORIESDIALOG_H #include "dialog.h" class CategoryModel; class QTreeView; class QModelIndex; class CategoriesDialog : public Dialog { Q_OBJECT public: explicit CategoriesDialog(QWidget *parent = 0); private Q_SLOTS: void editCategory(const QModelIndex &index); void removeCategory(); void showNewCategoryDialog(); private: CategoryModel *m_model; QTreeView *m_view; }; #endif // CATEGORIESDIALOG_H
/* This source file is part of Rigs of Rods Copyright 2005-2012 Pierre-Michel Ricordel Copyright 2007-2012 Thomas Fischer Copyright 2013-2017 Petr Ohlidal & contributors For more information, see http://www.rigsofrods.org/ Rigs of Rods is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation. Rigs of Rods 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 Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ /// @file /// @author Thomas Fischer /// @date 30th of April 2010 // created on 31th of July 2009 by Thomas Fischer #pragma once #include <angelscript.h> #include <Ogre.h> #include "RoRPrerequisites.h" // This function will register the following objects with the scriptengine: // - Ogre::Vector3 // - Ogre::Radian // - Ogre::Degree // - Ogre::Quaternion void registerOgreObjects(AngelScript::asIScriptEngine* engine); // The following functions shouldn't be called directly! // Use the registerOgreObjects function above instead. void registerOgreVector3(AngelScript::asIScriptEngine* engine); void registerOgreRadian(AngelScript::asIScriptEngine* engine); void registerOgreDegree(AngelScript::asIScriptEngine* engine); void registerOgreQuaternion(AngelScript::asIScriptEngine* engine);
#ifndef EXT_UNAME_H #define EXT_UNAME_H #define LINUX_UTSNAME_LENGTH 65 struct linux_utsname { char sysname[LINUX_UTSNAME_LENGTH]; char nodename[LINUX_UTSNAME_LENGTH]; char release[LINUX_UTSNAME_LENGTH]; char version[LINUX_UTSNAME_LENGTH]; char machine[LINUX_UTSNAME_LENGTH]; char domainname[LINUX_UTSNAME_LENGTH]; }; int __linux_uname(struct linux_utsname* p); #endif
/* * This file is part of Cleanflight. * * Cleanflight is free software. You can redistribute * this software and/or modify this software under the terms of the * GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. * * Cleanflight 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 software. * * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #if defined(REVOLTOSD) #define TARGET_BOARD_IDENTIFIER "ROSD" #define USBD_PRODUCT_STRING "RevoltOSD" #else #define TARGET_BOARD_IDENTIFIER "RVLT" #define USBD_PRODUCT_STRING "Revolt" #endif #define DEFAULT_MIXER MIXER_QUADX_1234 #define LED0_PIN PB5 #define USE_BEEPER #define BEEPER_PIN PB4 #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON #define USE_TRANSPONDER #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_UART SERIAL_PORT_USART1 #define USE_TARGET_CONFIG #define INVERTER_PIN_UART1 PC0 /*----------Spi Config--------*/ #define USE_SPI #define USE_SPI_DEVICE_1 #define SPI1_NSS_PIN PA4 #define SPI1_SCK_PIN PA5 #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 #define USE_SPI_DEVICE_2 #define SPI2_NSS_PIN PB12 #define SPI2_SCK_PIN PB13 #define SPI2_MISO_PIN PB14 #define SPI2_MOSI_PIN PB15 #define USE_SPI_DEVICE_3 #define SPI3_NSS_PIN PB3 #define SPI3_SCK_PIN PC10 #define SPI3_MISO_PIN PC11 #define SPI3_MOSI_PIN PC12 /*----------I2C Config--------*/ #define USE_I2C #define USE_I2C_DEVICE_1 #define I2C_DEVICE (I2CDEV_1) #define I2C1_SCL PB8 #define I2C1_SDA PB9 /*----------Gyro Config--------*/ #define USE_GYRO #define USE_ACC #define USE_GYRO_SPI_MPU6500 #define USE_ACC_SPI_MPU6500 #define GYRO_1_CS_PIN PA4 #define GYRO_1_SPI_INSTANCE SPI1 #define GYRO_1_ALIGN CW0_DEG #define USE_EXTI #define USE_GYRO_EXTI #define GYRO_1_EXTI_PIN PC4 #define USE_MPU_DATA_READY_SIGNAL /*----------Flash Config--------*/ #define FLASH_CS_PIN PB3 #if defined(REVOLTOSD) #define FLASH_SPI_INSTANCE SPI2 #else #define FLASH_SPI_INSTANCE SPI3 #endif #define USE_FLASHFS #define USE_FLASH_M25P16 #if defined(REVOLTOSD) /*----------OSD Config--------*/ #define USE_MAX7456 #define MAX7456_SPI_INSTANCE SPI2 #define MAX7456_SPI_CS_PIN PD2 #endif /*----------Uart Config--------*/ #define USE_UART1 #define UART1_RX_PIN PA10 #define UART1_TX_PIN PA9 #define USE_UART3 #define UART3_RX_PIN PB11 #define UART3_TX_PIN PB10 #define USE_UART4 #define UART4_RX_PIN PA1 #define UART4_TX_PIN PA0 #define USE_UART6 #define UART6_RX_PIN PC7 #define UART6_TX_PIN PC6 #define USE_SOFTSERIAL1 #define USE_SOFTSERIAL2 #define SERIAL_PORT_COUNT 7 //VCP, USART1, USART3, UART4, USART6, SOFTSERIAL x 2 #define USE_ESCSERIAL #define ESCSERIAL_TIMER_TX_PIN PC6 // UART 6 /*----------ADC Config--------*/ #define USE_ADC #define CURRENT_METER_ADC_PIN PC1 #define VBAT_ADC_PIN PC2 #define USE_VCP #define USE_USB_DETECT #define USB_DETECT_PIN PC5 #define TARGET_IO_PORTA 0xffff #define TARGET_IO_PORTB 0xffff #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) #define USABLE_TIMER_CHANNEL_COUNT 6 #define USED_TIMERS ( TIM_N(2) | TIM_N(4) | TIM_N(8) | TIM_N(11) )
/* xoreos - A reimplementation of BioWare's Aurora engine * * xoreos is the legal property of its developers, whose names * can be found in the AUTHORS file distributed with this source * distribution. * * xoreos 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. * * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>. */ /** @file * The notification manager, handling all notifications. */ #ifndef EVENTS_NOTIFICATIONS_H #define EVENTS_NOTIFICATIONS_H #include <list> #include "src/common/types.h" #include "src/common/singleton.h" #include "src/common/mutex.h" #include "src/events/types.h" namespace Events { class Notifyable; /** The notification manager, handling all notifications. * * Notifications are handed out to all classes of the Notifyable type for * special backend code that need to be reacted to by the client game code. * * One example would be a change in the display resolution: GUI elements with * an affinity to a screen edge or corner need to told that this change * occurred, so that they can reposition themselves to the new coordinates. */ class NotificationManager : public Common::Singleton<NotificationManager> { public: NotificationManager(); ~NotificationManager(); void init(); /** Notify all Notifyables that the screen size changed. */ void resized(int oldWidth, int oldHeight, int newWidth, int newHeight); /** Notify all Notifyables that the camera moved. */ void cameraMoved(); private: Common::Mutex _mutex; std::list<Notifyable *> _notifyables; std::list<Notifyable *>::iterator registerNotifyable(Notifyable &notifyable); void unregisterNotifyable(const std::list<Notifyable *>::iterator &it); friend class Notifyable; }; } // End of namespace Events /** Shortcut for accessing the notification manager. */ #define NotificationMan Events::NotificationManager::instance() #endif // EVENTS_NOTIFICATIONS_H
//***************************************************************************** // // json.h - The parsing function headers for JSON data from the web server. // // Copyright (c) 2014-2017 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Texas Instruments (TI) is supplying this software for use solely and // exclusively on TI's microcontroller products. The software is owned by // TI and/or its suppliers, and is protected under applicable copyright // laws. You may not combine this software with "viral" open-source // software in order to form a larger program. // // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL // DAMAGES, FOR ANY REASON WHATSOEVER. // // This is part of revision 2.1.4.178 of the EK-TM4C1294XL Firmware Package. // //***************************************************************************** #ifndef __JSON_H__ #define __JSON_H__ #ifndef JSON_H_ #define JSON_H_ #define INVALID_INT ((int32_t)(0x80000000)) extern int32_t JSONParseCurrent(uint32_t ui32Index, tWeatherReport *psWeatherReport, struct pbuf *psBuf); extern int32_t JSONParseForecast(uint32_t ui32Index, tWeatherReport *psWeatherReport, struct pbuf *psBuf); #endif #endif
/* * ccnSim is a scalable chunk-level simulator for Content Centric * Networks (CCN), that we developed in the context of ANR Connect * (http://www.anr-connect.org/) * * People: * Giuseppe Rossini (lead developer, mailto giuseppe.rossini@enst.fr) * Raffaele Chiocchetti (developer, mailto raffaele.chiocchetti@gmail.com) * Dario Rossi (occasional debugger, mailto dario.rossi@enst.fr) * * 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 R_CACHE_H_ #define R_CACHE_H_ #include "base_cache.h" #include <boost/unordered_map.hpp> #include <omnetpp.h> #include <deque> using namespace std; using boost::unordered_map; /* Random cache: new elements are pushed back in the cache when the cache is not * full. Otherwise an element is randomly replaced by the incoming one. */ class random_cache: public base_cache{ protected: virtual void initialize(); //Polymorphic functions bool data_lookup(chunk_t); void data_store(chunk_t); bool full(); //Deprecated bool warmup(); private: deque<chunk_t> deq; unordered_map<chunk_t, bool> cache; }; #endif
/****************************************************************************** * * Copyright (C) 2013 T Dispatch Ltd * * Licensed under the GPL License, Version 3.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.gnu.org/licenses/gpl-3.0.html * * 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. * ****************************************************************************** * * @author Marcin Orlowski <marcin.orlowski@webnet.pl> * ****/ #import <UIKit/UIKit.h> #import "LocationSelectionBaseViewController.h" @interface LocationSelectionListViewController : LocationSelectionBaseViewController @property (strong) NSArray* places; @end
/* ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "ch.h" #include "hal.h" #define DAC_BUFFER_SIZE 360 /* * DAC test buffer (sine wave). */ static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { 2047, 2082, 2118, 2154, 2189, 2225, 2260, 2296, 2331, 2367, 2402, 2437, 2472, 2507, 2542, 2576, 2611, 2645, 2679, 2713, 2747, 2780, 2813, 2846, 2879, 2912, 2944, 2976, 3008, 3039, 3070, 3101, 3131, 3161, 3191, 3221, 3250, 3278, 3307, 3335, 3362, 3389, 3416, 3443, 3468, 3494, 3519, 3544, 3568, 3591, 3615, 3637, 3660, 3681, 3703, 3723, 3744, 3763, 3782, 3801, 3819, 3837, 3854, 3870, 3886, 3902, 3917, 3931, 3944, 3958, 3970, 3982, 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4062, 4068, 4074, 4078, 4082, 4086, 4089, 4091, 4092, 4093, 4094, 4093, 4092, 4091, 4089, 4086, 4082, 4078, 4074, 4068, 4062, 4056, 4049, 4041, 4033, 4024, 4014, 4004, 3993, 3982, 3970, 3958, 3944, 3931, 3917, 3902, 3886, 3870, 3854, 3837, 3819, 3801, 3782, 3763, 3744, 3723, 3703, 3681, 3660, 3637, 3615, 3591, 3568, 3544, 3519, 3494, 3468, 3443, 3416, 3389, 3362, 3335, 3307, 3278, 3250, 3221, 3191, 3161, 3131, 3101, 3070, 3039, 3008, 2976, 2944, 2912, 2879, 2846, 2813, 2780, 2747, 2713, 2679, 2645, 2611, 2576, 2542, 2507, 2472, 2437, 2402, 2367, 2331, 2296, 2260, 2225, 2189, 2154, 2118, 2082, 2047, 2012, 1976, 1940, 1905, 1869, 1834, 1798, 1763, 1727, 1692, 1657, 1622, 1587, 1552, 1518, 1483, 1449, 1415, 1381, 1347, 1314, 1281, 1248, 1215, 1182, 1150, 1118, 1086, 1055, 1024, 993, 963, 933, 903, 873, 844, 816, 787, 759, 732, 705, 678, 651, 626, 600, 575, 550, 526, 503, 479, 457, 434, 413, 391, 371, 350, 331, 312, 293, 275, 257, 240, 224, 208, 192, 177, 163, 150, 136, 124, 112, 101, 90, 80, 70, 61, 53, 45, 38, 32, 26, 20, 16, 12, 8, 5, 3, 2, 1, 0, 1, 2, 3, 5, 8, 12, 16, 20, 26, 32, 38, 45, 53, 61, 70, 80, 90, 101, 112, 124, 136, 150, 163, 177, 192, 208, 224, 240, 257, 275, 293, 312, 331, 350, 371, 391, 413, 434, 457, 479, 503, 526, 550, 575, 600, 626, 651, 678, 705, 732, 759, 787, 816, 844, 873, 903, 933, 963, 993, 1024, 1055, 1086, 1118, 1150, 1182, 1215, 1248, 1281, 1314, 1347, 1381, 1415, 1449, 1483, 1518, 1552, 1587, 1622, 1657, 1692, 1727, 1763, 1798, 1834, 1869, 1905, 1940, 1976, 2012 }; /* * DAC streaming callback. */ size_t nx = 0, ny = 0, nz = 0; static void end_cb1(DACDriver *dacp, const dacsample_t *buffer, size_t n) { (void)dacp; nz++; if (dac_buffer == buffer) { nx += n; } else { ny += n; } if ((nz % 1000) == 0) { palTogglePad(GPIOD, GPIOD_LED3); } } /* * DAC error callback. */ static void error_cb1(DACDriver *dacp, dacerror_t err) { (void)dacp; (void)err; chSysHalt("DAC failure"); } static const DACConfig dac1cfg1 = { init: 2047U, datamode: DAC_DHRM_12BIT_RIGHT }; static const DACConversionGroup dacgrpcfg1 = { num_channels: 1U, end_cb: end_cb1, error_cb: error_cb1, trigger: DAC_TRG(0) }; /* * GPT2 configuration. */ static const GPTConfig gpt6cfg1 = { frequency: 1000000U, callback: NULL, cr2: TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */ dier: 0U }; /* * Application entry point. */ int main(void) { /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); /* * Starting DAC1 driver, setting up the output pin as analog as suggested * by the Reference Manual. */ palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG); dacStart(&DACD1, &dac1cfg1); /* * Starting GPT6 driver, it is used for triggering the DAC. */ gptStart(&GPTD6, &gpt6cfg1); /* * Starting a continuous conversion. */ dacStartConversion(&DACD1, &dacgrpcfg1, dac_buffer, DAC_BUFFER_SIZE); gptStartContinuous(&GPTD6, 2U); /* * Normal main() thread activity, if the button is pressed then the DAC * transfer is stopped. */ while (true) { if (palReadPad(GPIOA, GPIOA_BUTTON)) { gptStopTimer(&GPTD6); dacStopConversion(&DACD1); } chThdSleepMilliseconds(500); } return 0; }
#include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <signal.h> pid_t pidFils; main(){ int j; int k; int NB_FILS = 2; int NB_NIV=4; int ancetres[NB_NIV]; /* On boucle pour générer les niveaux */ for (j=0; j<NB_NIV-1;j++) { /* on boucle pour générer les deux fils */ for(k=0; k<NB_FILS;k++) { pidFils = fork(); if (pidFils==0) { ancetres[j]=getppid(); break; } } if (pidFils!=0) break; } /* ------------ code du fils ----------------- */ int i; printf("Processus %d, de niveau %d, j'ai %d ancêtres qui sont : ", getpid(), j,j); for(i = 0; i < j;i++) { printf("%d\t ", ancetres[i]); } printf("\n"); sleep(1); }
#include <signal.h> void sigchld(int signal);
/* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Concatenate two arbitrary file names. Copyright (C) 1996-2007, 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; 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/>. */ /* Written by Jim Meyering. */ #include <config.h> /* Specification. */ #include "filenamecat.h" #include <stdlib.h> #include <string.h> #include "dirname.h" #if ! HAVE_MEMPCPY && ! defined mempcpy # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) #endif /* Return the longest suffix of F that is a relative file name. If it has no such suffix, return the empty string. */ static char const * _GL_ATTRIBUTE_PURE longest_relative_suffix (char const *f) { for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++) continue; return f; } /* Concatenate two file name components, DIR and ABASE, in newly-allocated storage and return the result. The resulting file name F is such that the commands "ls F" and "(cd DIR; ls BASE)" refer to the same file, where BASE is ABASE with any file system prefixes and leading separators removed. Arrange for a directory separator if necessary between DIR and BASE in the result, removing any redundant separators. In any case, if BASE_IN_RESULT is non-NULL, set *BASE_IN_RESULT to point to the copy of ABASE in the returned concatenation. However, if ABASE begins with more than one slash, set *BASE_IN_RESULT to point to the sole corresponding slash that is copied into the result buffer. Return NULL if malloc fails. */ char * mfile_name_concat (char const *dir, char const *abase, char **base_in_result) { char const *dirbase = last_component (dir); size_t dirbaselen = base_len (dirbase); size_t dirlen = dirbase - dir + dirbaselen; size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1])); char const *base = longest_relative_suffix (abase); size_t baselen = strlen (base); char *p_concat = malloc (dirlen + needs_separator + baselen + 1); char *p; if (p_concat == NULL) return NULL; p = mempcpy (p_concat, dir, dirlen); *p = DIRECTORY_SEPARATOR; p += needs_separator; if (base_in_result) *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase); p = mempcpy (p, base, baselen); *p = '\0'; return p_concat; }
/* This file is part of Telegram Desktop, the official desktop version of Telegram messaging app, see https://telegram.org Telegram Desktop 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. It 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. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once #include "types.h" namespace _local_inner { class Manager : public QObject { Q_OBJECT public: Manager(); void writeMap(bool fast); void writingMap(); void writeLocations(bool fast); void writingLocations(); void finish(); public slots: void mapWriteTimeout(); void locationsWriteTimeout(); private: QTimer _mapWriteTimer; QTimer _locationsWriteTimer; }; } namespace Local { void start(); void stop(); void readSettings(); void writeSettings(); void writeUserSettings(); void writeMtpData(); void reset(); bool checkPasscode(const QByteArray &passcode); void setPasscode(const QByteArray &passcode); enum ClearManagerTask { ClearManagerAll = 0xFFFF, ClearManagerDownloads = 0x01, ClearManagerStorage = 0x02, }; struct ClearManagerData; class ClearManager : public QObject { Q_OBJECT public: ClearManager(); bool addTask(int task); bool hasTask(ClearManagerTask task); void start(); ~ClearManager(); public slots: void onStart(); signals: void succeed(int task, void *manager); void failed(int task, void *manager); private: ClearManagerData *data; }; enum ReadMapState { ReadMapFailed = 0, ReadMapDone = 1, ReadMapPassNeeded = 2, }; ReadMapState readMap(const QByteArray &pass); int32 oldMapVersion(); struct MessageDraft { MessageDraft(MsgId replyTo = 0, QString text = QString(), bool previewCancelled = false) : replyTo(replyTo), text(text), previewCancelled(previewCancelled) { } MsgId replyTo; QString text; bool previewCancelled; }; void writeDraft(const PeerId &peer, const MessageDraft &draft); MessageDraft readDraft(const PeerId &peer); void writeDraftPositions(const PeerId &peer, const MessageCursor &cur); MessageCursor readDraftPositions(const PeerId &peer); bool hasDraftPositions(const PeerId &peer); void writeFileLocation(MediaKey location, const FileLocation &local); FileLocation readFileLocation(MediaKey location, bool check = true); void writeImage(const StorageKey &location, const ImagePtr &img); void writeImage(const StorageKey &location, const StorageImageSaved &jpeg, bool overwrite = true); StorageImageSaved readImage(const StorageKey &location); int32 hasImages(); qint64 storageImagesSize(); void writeStickerImage(const StorageKey &location, const QByteArray &data, bool overwrite = true); QByteArray readStickerImage(const StorageKey &location); int32 hasStickers(); qint64 storageStickersSize(); void writeAudio(const StorageKey &location, const QByteArray &data, bool overwrite = true); QByteArray readAudio(const StorageKey &location); int32 hasAudios(); qint64 storageAudiosSize(); void writeStickers(); void readStickers(); void writeBackground(int32 id, const QImage &img); bool readBackground(); void writeRecentHashtags(); void readRecentHashtags(); void addSavedPeer(PeerData *peer, const QDateTime &position); void removeSavedPeer(PeerData *peer); void readSavedPeers(); };
//***************************************************************************** // // systick.h - Prototypes for the SysTick driver. // // Copyright (c) 2005-2015 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the // distribution. // // Neither the name of Texas Instruments Incorporated nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // This is part of revision 2.1.2.111 of the Tiva Peripheral Driver Library. // //***************************************************************************** #ifndef __DRIVERLIB_SYSTICK_H__ #define __DRIVERLIB_SYSTICK_H__ //***************************************************************************** // // If building with a C++ compiler, make all of the definitions in this header // have a C binding. // //***************************************************************************** #ifdef __cplusplus extern "C" { #endif //***************************************************************************** // // Prototypes for the APIs. // //***************************************************************************** extern void SysTickEnable(void); extern void SysTickDisable(void); extern void SysTickIntRegister(void (*pfnHandler)(void)); extern void SysTickIntUnregister(void); extern void SysTickIntEnable(void); extern void SysTickIntDisable(void); extern void SysTickPeriodSet(uint32_t ui32Period); extern uint32_t SysTickPeriodGet(void); extern uint32_t SysTickValueGet(void); //***************************************************************************** // // Mark the end of the C bindings section for C++ compilers. // //***************************************************************************** #ifdef __cplusplus } #endif #endif // __DRIVERLIB_SYSTICK_H__
/* * ciaaAOUT.h * * Created on: Jun 23, 2014 * Author: pablo */ #ifndef CIAAAOUT_H_ #define CIAAAOUT_H_ #include "chip.h" void ciaaAOUTInit(void); void ciaaAOUTSet(float level); #endif /* CIAAAOUT_H_ */
/* * Copyright 2012-2017 Kai Pastor * * This file is part of OpenOrienteering. * * OpenOrienteering 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. * * OpenOrienteering 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 OpenOrienteering. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OPENORIENTEERING_MAPPER_RESOURCE_H #define OPENORIENTEERING_MAPPER_RESOURCE_H namespace OpenOrienteering { namespace MapperResource { /** * Initializes QDir::searchPaths for Mapper resource prefixes. * * This function registers the prefixes "data" and "doc" with paths leading * to possible locations in the build dir (development build only), application * bundle (Android, macOS, Windows), system (Linux) and Qt resource system. * Thus resource lookup may either iterate explicitly over * QDir::searchPaths("PREFIX"), or directly access resources using * QFile("PREFIX:name"). */ void setSeachPaths(); } // namespace MapperResource } // namespace OpenOrienteering #endif
/*********************************************************************/ /* */ /* Optimized BLAS libraries */ /* By Kazushige Goto <kgoto@tacc.utexas.edu> */ /* */ /* Copyright (c) The University of Texas, 2009. All rights reserved. */ /* UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING */ /* THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE, */ /* NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY */ /* THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF */ /* TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO */ /* THE USE OF THE SOFTWARE OR DOCUMENTATION. */ /* Under no circumstances shall University be liable for incidental, */ /* special, indirect, direct or consequential damages or loss of */ /* profits, interruption of business, or related expenses which may */ /* arise from use of Software or Documentation, including but not */ /* limited to those resulting from defects in Software and/or */ /* Documentation, or loss or inaccuracy of data of any kind. */ /*********************************************************************/ #include <stdio.h> #include "common.h" static FLOAT dm1 = -1.; #ifndef COMPLEX #define TRSM_KERNEL TRSM_KERNEL_LT #else #define TRSM_KERNEL TRSM_KERNEL_LC #undef SYRK_KERNEL_U #ifdef XDOUBLE #define SYRK_KERNEL_U xherk_kernel_UC #elif defined(DOUBLE) #define SYRK_KERNEL_U zherk_kernel_UC #else #define SYRK_KERNEL_U cherk_kernel_UC #endif #endif #if 0 #undef GEMM_P #undef GEMM_Q #undef GEMM_R #define GEMM_P 8 #define GEMM_Q 20 #define GEMM_R 64 #endif #define GEMM_PQ MAX(GEMM_P, GEMM_Q) #define REAL_GEMM_R (GEMM_R - GEMM_PQ) #if 0 #define SHARED_ARRAY #define SA aa #else #undef SHARED_ARRAY #define SA sa #endif blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, FLOAT *sb, BLASLONG myid) { BLASLONG n, lda; FLOAT *a; BLASLONG info; BLASLONG bk, blocking; BLASLONG is, min_i; BLASLONG jjs, min_jj; BLASLONG range_N[2]; BLASLONG j, js, min_j; #ifdef SHARED_ARRAY FLOAT *aa; #endif FLOAT *sb2 = (FLOAT *)((((BLASLONG)sb + GEMM_PQ * GEMM_Q * COMPSIZE * SIZE + GEMM_ALIGN) & ~GEMM_ALIGN) + GEMM_OFFSET_B); n = args -> n; a = (FLOAT *)args -> a; lda = args -> lda; if (range_n) { n = range_n[1] - range_n[0]; a += range_n[0] * (lda + 1) * COMPSIZE; } if (n <= DTB_ENTRIES / 2) { info = POTF2_U(args, NULL, range_n, sa, sb, 0); return info; } blocking = GEMM_Q; if (n <= 4 * GEMM_Q) blocking = (n + 3) / 4; for (j = 0; j < n; j += blocking) { bk = n - j; if (bk > blocking) bk = blocking; if (!range_n) { range_N[0] = j; range_N[1] = j + bk; } else { range_N[0] = range_n[0] + j; range_N[1] = range_n[0] + j + bk; } info = CNAME(args, NULL, range_N, sa, sb, 0); if (info) return info + j; if (n - j - bk > 0) { TRSM_IUNCOPY(bk, bk, a + (j + j * lda) * COMPSIZE, lda, 0, sb); for(js = j + bk; js < n; js += REAL_GEMM_R) { min_j = n - js; if (min_j > REAL_GEMM_R) min_j = REAL_GEMM_R; for(jjs = js; jjs < js + min_j; jjs += GEMM_UNROLL_N){ min_jj = min_j + js - jjs; if (min_jj > GEMM_UNROLL_N) min_jj = GEMM_UNROLL_N; GEMM_ONCOPY(bk, min_jj, a + (j + jjs * lda) * COMPSIZE, lda, sb2 + bk * (jjs - js) * COMPSIZE); for (is = 0; is < bk; is += GEMM_P) { min_i = bk - is; if (min_i > GEMM_P) min_i = GEMM_P; TRSM_KERNEL (min_i, min_jj, bk, dm1, #ifdef COMPLEX ZERO, #endif sb + bk * is * COMPSIZE, sb2 + bk * (jjs - js) * COMPSIZE, a + (j + is + jjs * lda) * COMPSIZE, lda, is); } } for (is = j + bk; is < js + min_j; is += min_i) { min_i = js + min_j - is; if (min_i >= GEMM_P * 2) { min_i = GEMM_P; } else if (min_i > GEMM_P) { min_i = (min_i / 2 + GEMM_UNROLL_MN - 1) & ~(GEMM_UNROLL_MN - 1); } #ifdef SHARED_ARRAY if ((is >= js) && (is + min_i <= js + min_j)) { aa = sb2 + bk * (is - js) * COMPSIZE; } else { GEMM_INCOPY(bk, min_i, a + (j + is * lda) * COMPSIZE, lda, sa); aa = sa; } #else GEMM_INCOPY(bk, min_i, a + (j + is * lda) * COMPSIZE, lda, sa); #endif SYRK_KERNEL_U(min_i, min_j, bk, dm1, SA, sb2, a + (is + js * lda) * COMPSIZE, lda, is - js); } } } } return 0; }
/* Cuberok * Copyright (C) 2009 Vasiliy Makarov <drmoriarty.0@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this software; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef PLAYER_PHONON_H #define PLAYER_PHONON_H #include <QtCore> #include "player.h" //#include "main.h" #include <phonon/audiooutput.h> #include <phonon/seekslider.h> #include <phonon/mediaobject.h> #include <phonon/volumeslider.h> #include <phonon/backendcapabilities.h> class PlayerPhonon : public Player { Q_OBJECT Q_INTERFACES(Player) public: PlayerPhonon(); ~PlayerPhonon(); virtual bool prepare(); virtual bool ready(); virtual bool canOpen(QString mime); virtual bool open(QUrl fname, long start = 0, long length = 0); virtual bool play(); virtual bool stop(); virtual bool setPause(bool p); virtual bool close(); virtual bool setPosition(double pos); virtual double getPosition(); virtual int volume(); virtual void setVolume(int v); virtual bool playing(); virtual int weight(); virtual QString name(); int repeat_mode; int shuffle_mode; private: qint64 Pstart, Plength, _pos; bool needPos, needPlay; QMap<QString, QString> mimeTypes; Phonon::AudioOutput *audioOutput; Phonon::MediaObject *mediaObject; Phonon::MediaObject *metaInformationResolver; Phonon::MediaSource source; private slots: void stateChanged(Phonon::State newState, Phonon::State oldState); void tick(qint64 time); void sourceChanged(const Phonon::MediaSource &source); void metaStateChanged(Phonon::State newState, Phonon::State oldState); void aboutToFinish(); void sourceFinished(); }; #endif // PLAYER_PHONON_H
/* --COPYRIGHT--,BSD * Copyright (c) 2016, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * --/COPYRIGHT--*/ //****************************************************************************** //! //! CRC - Build Signature and Rebuild to test. //! //! The CRC is first used to build a signature using a seed and multiple data //! values. This signature is considered as the checksum and can be sent by a //! UART connection along with the data to verify the correct data has been //! sent. The second half of this program is used to test the CRC checksum of //! the data that has been created, by recreating the same checksum and //! comparing it to the first checksum. If the two checksum are equal, then //! P1.0 is set and the LED is turned on. Breakpoints can be set before the //! CRC_setData() function to observe the CRC register values and see the //! subsequent signatures before/after each data set. //! //! Tested On: MSP430F5529,MSP430FR5739 //! ----------------- //! /|\| | //! | | | //! --|RST | //! | P1.0|--> LED //! | | //! //! //! This example uses the following peripherals and I/O signals. You must //! review these and change as needed for your own board: //! - CRC peripheral //! - GPIO Port peripheral //! //! This example uses the following interrupt handlers. To use this example //! in your own application you must add these interrupt handlers to your //! vector table. //! - NONE //! //****************************************************************************** #include "driverlib.h" void main(void) { uint16_t crcSeed = 0xBEEF; uint16_t data[] = {0x0123, 0x4567, 0x8910, 0x1112, 0x1314}; uint16_t crcResult; uint8_t i; //Stop WDT WDT_A_hold(WDT_A_BASE); //Set P1.0 as an output GPIO_setAsOutputPin( GPIO_PORT_P1, GPIO_PIN0); //Set the CRC seed CRC_setSeed(CRC_BASE, crcSeed); for(i = 0; i < 5; i++) { //Add all of the values into the CRC signature CRC_set16BitData(CRC_BASE, data[i]); } //Save the current CRC signature checksum to be compared for later crcResult = CRC_getResult(CRC_BASE); //*** Test the CRC ***// //Reset the CRC Signature and set the same seed CRC_setSeed(CRC_BASE, crcSeed); for(i = 0; i < 5; i++) { //Add all of the values into the CRC signature CRC_set16BitData(CRC_BASE, data[i]); } //Compare the 2 CRC Resulting Signature Checksums if(crcResult == CRC_getResult(CRC_BASE)) { //set P1.0 GPIO_setOutputHighOnPin( GPIO_PORT_P1, GPIO_PIN0); } //Enter LPM4, interrupts enabled __bis_SR_register(LPM4_bits); __no_operation(); }
/* * FilterShader.h * * Created on: 01/02/2010 * Author: victor */ #ifndef FILTERSHADER_H_ #define FILTERSHADER_H_ #include "../ProceduralRule.h" #include "FilterProceduralRule.h" class FilterShader : public ProceduralRule<'FSHD'>, public FilterProceduralRule { int shaderId; public: FilterShader() : FilterProceduralRule(4), shaderId(0) { } void parseFromIffStream(engine::util::IffStream* iffStream) { uint32 version = iffStream->getNextFormType(); iffStream->openForm(version); switch (version) { case '0000': parseFromIffStream(iffStream, Version<'0000'>()); break; default: System::out << "unknown FilterShader version 0x" << hex << version << endl; break; } iffStream->closeForm(version); } void parseFromIffStream(engine::util::IffStream* iffStream, Version<'0000'>) { informationHeader.readObject(iffStream); iffStream->openChunk('DATA'); shaderId = iffStream->getInt(); iffStream->closeChunk('DATA'); } }; #endif /* FILTERSHADER_H_ */
/*------------------------------------------------------------------ * mem_primitives_lib.h - Unguarded Memory Copy Routines * * October 2008, Bo Berry * * Copyright (c) 2008-2011 by Cisco Systems, Inc * All rights reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. *------------------------------------------------------------------ */ #ifndef __MEM_PRIMITIVES_LIB_H__ #define __MEM_PRIMITIVES_LIB_H__ #include "safeclib_private.h" /* * These are prototypes for _unguarded_ memory routines. The caller must * validate all parameters prior to invocation. Useful for diagnostics * and system initialization processing. */ /* moves (handles overlap) memory */ extern void mem_prim_move(void *dest, const void *src, uint32_t length); /* uint8_t moves (handles overlap) memory */ extern void mem_prim_move8(uint8_t *dest, const uint8_t *src, uint32_t length); /* uint16_t moves (handles overlap) memory */ extern void mem_prim_move16(uint16_t *dest, const uint16_t *src, uint32_t length); /* uint32_t moves (handles overlap) memory */ extern void mem_prim_move32(uint32_t *dest, const uint32_t *src, uint32_t length); /* set bytes */ extern void mem_prim_set(void *dest, uint32_t dmax, uint8_t value); /* set uint16_ts */ extern void mem_prim_set16(uint16_t *dest, uint32_t dmax, uint16_t value); /* set uint32_ts */ extern void mem_prim_set32(uint32_t *dest, uint32_t dmax, uint32_t value); #endif /* __MEM_PRIMITIVES_LIB_H__ */
/* * opencog/ocaml/CamlWrap.h * * OCaml wrappers for the AtomSpace -- core functions. * * Copyright (c) 2021 Linas Vepstas <linas@linas.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _CAML_WRAP_H_ #define _CAML_WRAP_H_ #include <caml/mlvalues.h> #undef Atom #include <opencog/atoms/value/Value.h> #include <opencog/atoms/base/Handle.h> using namespace opencog; extern "C" { CAMLprim value NewNode(value, Type); CAMLprim value NewLink(value, Type); CAMLprim void print_atomspace(void); CAMLprim value atom_to_sexpr(value); CAMLprim value atom_string_printer(value); CAMLprim value execute(value); CAMLprim value evaluate(value); } value tag_to_value(const ValuePtr& pa); ValuePtr value_to_tag(value); std::string oc_to_caml_str(const Handle& h, const std::string& indent=empty_string); std::string oc_to_caml_str(const ValuePtr& vp, const std::string& indent=empty_string); #endif // _CAML_WRAP_H_
/* * Copyright (C) 1998, 2000-2007, 2010, 2011, 2012, 2013 SINTEF ICT, * Applied Mathematics, Norway. * * Contact information: E-mail: tor.dokken@sintef.no * SINTEF ICT, Department of Applied Mathematics, * P.O. Box 124 Blindern, * 0314 Oslo, Norway. * * This file is part of GoTools. * * GoTools 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. * * GoTools 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 GoTools. If not, see * <http://www.gnu.org/licenses/>. * * In accordance with Section 7(b) of the GNU Affero General Public * License, a covered work must retain the producer line in every data * file that is created or manipulated using GoTools. * * Other Usage * You can be released from the requirements of the license by purchasing * a commercial license. Buying such a license is mandatory as soon as you * develop commercial activities involving the GoTools library without * disclosing the source code of your own applications. * * This file may be used in accordance with the terms contained in a * written agreement between you and SINTEF ICT. */ #ifndef _EVALSURFACE_H #define _EVALSURFACE_H #include "GoTools/utils/Point.h" #include <iostream> namespace Go { /// This is the abstract base class of a curve type that can be evaluated. /// Representing the exact geometry, typically used when iteratively /// approximating the curve. class EvalSurface { public: /// virtual destructor ensures save inheritance virtual ~EvalSurface(); /// Evaluate a point on the surface for a given parameter /// \param t the parameter for which to evaluate the curve. /// \return the evaluated point virtual Point eval( double u, double v) const = 0; /// Evaluate a point and a certain number of derivatives /// on the surface for a given parameter. /// \param t the parameter for which to evaluate the curve. /// \param n the number of derivatives (0 or more) /// \retval der pointer to an array of Points where the /// result will be written. The position will be stored /// first, then the first derivative (tangent), then the /// second, etc.. /// \b NB: For most (all) derived classes of 'EvalSurface', /// the implementation actually only supports the computation of /// one derivative, i.e. if n > 1, only one derivative will be /// computed anyway. virtual void eval( double u, double v, int n, Point der[]) const = 0; // n = order of diff /// Get the start parameter of the curve. /// \return the start parameter of the curve. virtual double start_u() const =0; virtual double start_v() const =0; /// Get the end parameter of the curve. /// \return the end parameter of the curve. virtual double end_u() const =0; virtual double end_v() const =0; /// Get the dimension of the space in which the curve lies. /// \return the space dimension of the curve. virtual int dim() const = 0; /// Check if the curve, evaluated at a given parameter, approximates /// a given position within a given tolerance. /// \param par the parameter at which to check the curve /// \param approxpos the position we want to check whether or not the curve /// approximates for parameter 'par'. /// \param tol1 approximation tolerance. /// \param tol2 another approximation tolerance (its use is defined by some of /// the derived classes. /// \return 'true' if the curve approximates the point at the parameter, 'false' /// otherwise. virtual bool approximationOK(double par_u, double par_v, Point approxpos, double tol1, double tol2) const = 0; /// Closest point using general algorithm void closestPoint(const Point& pt, double& clo_u, double& clo_v, Point& clo_pt, double& clo_dist, double epsilon, int maxiter, double *seed) const; // Debug virtual void write(std::ostream& out) const; private: void s1773(const double ppoint[],double aepsge, double estart[],double eend[],double enext[], double gpos[], Point& ppoint2, int maxiter, int *jstat) const; void s1773_s9corr(double gd[],double acoef1,double acoef2, double astart1,double aend1,double astart2, double aend2) const; void s1773_s9dir(double *cdist,double *cdiff1,double *cdiff2, double PS[],const double *eval1, Point eval2[], double aepsge, int idim,int *jstat) const; }; } #endif // _EVALSURFACE_H
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool. If making changes by // hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // #ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_ #pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED #include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDownloadItemCallbackCppToC : public CefCppToC<CefDownloadItemCallbackCppToC, CefDownloadItemCallback, cef_download_item_callback_t> { public: explicit CefDownloadItemCallbackCppToC(CefDownloadItemCallback* cls); virtual ~CefDownloadItemCallbackCppToC() {} }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_
/* * This file is part of Cockpit. * * Copyright (C) 2016 Red Hat, Inc. * * Cockpit 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. * * Cockpit 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 Cockpit; If not, see <http://www.gnu.org/licenses/>. */ #ifndef __COCKPIT_AUTH_OPTIONS_H__ #define __COCKPIT_AUTH_OPTIONS_H__ #include <gio/gio.h> #define SSH_SECTION "Ssh-Login" G_BEGIN_DECLS typedef struct { const gchar *remote_peer; const gchar *auth_type; } CockpitAuthOptions; CockpitAuthOptions * cockpit_auth_options_from_env (gchar **env); gchar ** cockpit_auth_options_to_env (CockpitAuthOptions *options, gchar **env); typedef struct { const gchar *knownhosts_data; const gchar *knownhosts_file; const gchar *command; const gchar *krb5_ccache_name; gboolean allow_unknown_hosts; gboolean supports_hostkey_prompt; gboolean ignore_hostkey; guint agent_fd; } CockpitSshOptions; CockpitSshOptions * cockpit_ssh_options_from_env (gchar **env); gchar ** cockpit_ssh_options_to_env (CockpitSshOptions *options, gchar **env); G_END_DECLS #endif
/* * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /*************************************************************************** * Desc: Test program for the Player C client * Author: Andrew Howard * Date: 23 May 2002 # CVS: $Id: test.h 8106 2009-07-23 19:14:37Z thjc $ **************************************************************************/ #ifndef TEST_H #define TEST_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "playerc.h" // Message macros #define TEST(msg) (1 ? printf(msg " ... "), fflush(stdout) : 0) #define TEST1(msg, a) (1 ? printf(msg " ... ", a), fflush(stdout) : 0) #define PASS() (1 ? printf("pass\n"), fflush(stdout) : 0) #define FAIL() (1 ? printf("\033[41mfail\033[0m\n%s\n", playerc_error_str()), fflush(stdout) : 0) // Basic test for proxies extern int test_aio(playerc_client_t *client, int index); extern int test_blobfinder(playerc_client_t *client, int index); extern int test_camera(playerc_client_t *client, int index); extern int test_dio(playerc_client_t *client, int index); extern int test_graphics2d(playerc_client_t *client, int index); extern int test_graphics3d(playerc_client_t *client, int index); extern int test_gripper(playerc_client_t *client, int index); extern int test_imu(playerc_client_t *client, int index); extern int test_laser(playerc_client_t *client, int index); extern int test_log(playerc_client_t *client, int index); extern int test_map(playerc_client_t *client, int index); extern int test_position2d(playerc_client_t *client, int index); extern int test_position3d(playerc_client_t *client, int index); extern int test_power(playerc_client_t *client, int index); extern int test_ptz(playerc_client_t *client, int index); extern int test_rfid(playerc_client_t *client, int index); extern int test_simulation(playerc_client_t *client, int index); extern int test_sonar(playerc_client_t *client, int index); extern int test_speech(playerc_client_t *client, int index); extern int test_wsn(playerc_client_t *client, int index); #if 0 // Basic test for BPS device.i extern int test_bps(playerc_client_t *client, int index); // Basic broadcast test extern int test_broadcast(playerc_client_t *client, int index); // Basic test for GPS device.i extern int test_gps(playerc_client_t *client, int index); // Basic localization test extern int test_localize(playerc_client_t *client, int index); // Basic test for the LBD (laser beacon detector) device. // REMOVE? int test_lbd(playerc_client_t *client, int index); // Basic localization test int test_localize(playerc_client_t *client, int index); // Basic test for truth device. extern int test_truth(playerc_client_t *client, int index); // Basic vision test. extern int test_vision(playerc_client_t *client, int index); // Basic comms device test extern int test_comms(playerc_client_t *client, int index); // Basic test for the laser beacon device. extern int test_fiducial(playerc_client_t *client, int index); // Basic test for wifi device. extern int test_wifi(playerc_client_t *client, int index); #endif #endif // TEST_H
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qbs. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QBS_PROCESSRESULT_H #define QBS_PROCESSRESULT_H #include "qbs_export.h" #include <QtCore/qshareddata.h> #include <QtCore/qmetatype.h> #include <QtCore/qprocess.h> #include <QtCore/qstringlist.h> QT_BEGIN_NAMESPACE class QJsonObject; QT_END_NAMESPACE namespace qbs { namespace Internal { class ProcessCommandExecutor; class ProcessResultPrivate; } class QBS_EXPORT ProcessResult { friend class qbs::Internal::ProcessCommandExecutor; public: ProcessResult(); ProcessResult(const ProcessResult &other); ProcessResult &operator=(const ProcessResult &other); ~ProcessResult(); QJsonObject toJson() const; bool success() const; QString executableFilePath() const; QStringList arguments() const; QString workingDirectory() const; QProcess::ProcessError error() const; int exitCode() const; QStringList stdOut() const; QStringList stdErr() const; private: QExplicitlySharedDataPointer<Internal::ProcessResultPrivate> d; }; } // namespace qbs Q_DECLARE_METATYPE(qbs::ProcessResult) #endif // QBS_PROCESSRESULT_H
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $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$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef SHAREDENUMS_H #define SHAREDENUMS_H #include "shared_global_p.h" QT_BEGIN_NAMESPACE namespace qdesigner_internal { // Validation mode of text property line edits enum TextPropertyValidationMode { // Allow for multiline editing using literal "\n". ValidationMultiLine, // Allow for HTML rich text including multiline editing using literal "\n". ValidationRichText, // Validate a stylesheet ValidationStyleSheet, // Single line mode, suppresses newlines ValidationSingleLine, // Allow only for identifier characters ValidationObjectName, // Allow only for identifier characters and colons ValidationObjectNameScope, // URL ValidationURL }; // Container types enum ContainerType { // A container with pages, at least one of which one must always be present (for example, QTabWidget) PageContainer, // Mdi type container. All pages may be deleted, no concept of page order MdiContainer, // Wizard container WizardContainer }; enum AuxiliaryItemDataRoles { // item->flags while being edited ItemFlagsShadowRole = 0x13370551 }; } QT_END_NAMESPACE #endif // SHAREDENUMS_H
/***************************************************************************** * Project: RooFit * * Package: RooFitCore * * File: $Id: RooArgList.h,v 1.14 2007/05/11 09:11:30 verkerke Exp $ * Authors: * * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * * * * Copyright (c) 2000-2005, Regents of the University of California * * and Stanford University. All rights reserved. * * * * Redistribution and use in source and binary forms, * * with or without modification, are permitted according to the terms * * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * *****************************************************************************/ #ifndef ROO_ARG_LIST #define ROO_ARG_LIST #include "RooAbsCollection.h" class RooArgList : public RooAbsCollection { public: // Constructors, assignment etc. RooArgList(); RooArgList(const RooArgSet& set) ; explicit RooArgList(const TCollection& tcoll, const char* name="") ; explicit RooArgList(const char *name); /// Construct a (non-owning) RooArgList from one or more /// RooFit objects. /// \param arg A RooFit object to be put in the set. /// \param varsOrName Arbitrary number of /// - RooFit objects deriving from RooAbsArg. /// - A c-string to name the set. template<typename... Arg_t> RooArgList(const RooAbsArg& arg, const Arg_t&... argsOrName) /*NB: Making this a delegating constructor led to linker errors with MSVC*/ { processArg(arg); // Expand parameter pack in C++ 11 way: int dummy[] = { 0, (processArg(argsOrName), 0) ... }; (void)dummy; }; /// Construct from iterators. /// \tparam Iterator_t An iterator pointing to RooFit objects or references thereof. /// \param beginIt Iterator to first element to add. /// \param end Iterator to end of range to be added. /// \param name Optional name of the collection. template<typename Iterator_t, typename value_type = typename std::iterator_traits<Iterator_t>::value_type, typename = std::enable_if<std::is_convertible<const value_type*, const RooAbsArg*>::value> > RooArgList(Iterator_t beginIt, Iterator_t endIt, const char* name="") : RooArgList(name) { for (auto it = beginIt; it != endIt; ++it) { add(*it); } } virtual ~RooArgList(); // Create a copy of an existing list. New variables cannot be added // to a copied list. The variables in the copied list are independent // of the original variables. RooArgList(const RooArgList& other, const char *name=""); virtual TObject* clone(const char* newname) const { return new RooArgList(*this,newname); } virtual TObject* create(const char* newname) const { return new RooArgList(newname); } RooArgList& operator=(const RooArgList& other) { RooAbsCollection::operator=(other) ; return *this ; } /// Return object at given index, or nullptr if index is out of range inline RooAbsArg* at(Int_t idx) const { if (idx >= static_cast<Int_t>(_list.size())) return nullptr; return _list[idx]; } // I/O streaming interface (machine readable) virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ; virtual void writeToStream(std::ostream& os, Bool_t compact) ; /// Access element by index. RooAbsArg& operator[](Int_t idx) const { assert(0 <= idx && idx < static_cast<Int_t>(_list.size())); return *_list[idx]; } private: void processArg(const RooAbsArg& arg) { add(arg); } void processArg(const char* name) { _name = name; } ClassDef(RooArgList,1) // Ordered list of RooAbsArg objects }; #endif
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2009 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" #include "SDL_fbvideo.h" /* Variables and functions exported by SDL_sysevents.c to other parts of the native video subsystem (SDL_sysvideo.c) */ extern int FB_OpenKeyboard(_THIS); extern void FB_CloseKeyboard(_THIS); extern int FB_OpenMouse(_THIS); extern void FB_CloseMouse(_THIS); extern int FB_EnterGraphicsMode(_THIS); extern int FB_InGraphicsMode(_THIS); extern void FB_LeaveGraphicsMode(_THIS); extern void FB_InitOSKeymap(_THIS); extern void FB_PumpEvents(_THIS); /* vi: set ts=4 sw=4 expandtab: */
/************************************************************************** ** ** Copyright (c) 2014 Lorenz Haas ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H #define BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H #include <coreplugin/dialogs/ioptionspage.h> #include <utils/qtcoverride.h> #include <QPointer> #include <QWidget> namespace Beautifier { namespace Internal { namespace Uncrustify { class UncrustifySettings; namespace Ui { class UncrustifyOptionsPage; } class UncrustifyOptionsPageWidget : public QWidget { Q_OBJECT public: explicit UncrustifyOptionsPageWidget(UncrustifySettings *settings, QWidget *parent = 0); virtual ~UncrustifyOptionsPageWidget(); QString searchKeywords() const; void restore(); void apply(); private: Ui::UncrustifyOptionsPage *ui; UncrustifySettings *m_settings; }; class UncrustifyOptionsPage : public Core::IOptionsPage { Q_OBJECT public: explicit UncrustifyOptionsPage(UncrustifySettings *settings, QObject *parent = 0); QWidget *widget() QTC_OVERRIDE; void apply() QTC_OVERRIDE; void finish() QTC_OVERRIDE; bool matches(const QString &searchKeywords) const QTC_OVERRIDE; private: QPointer<UncrustifyOptionsPageWidget> m_widget; UncrustifySettings *m_settings; QString m_searchKeywords; }; } // namespace Uncrustify } // namespace Internal } // namespace Beautifier #endif // BEAUTIFIER_UNCRUSTIFYOPTIONSPAGE_H
/* * $Id: binio.h,v 1.8 2002/02/28 21:55:48 spoel Exp $ * * This source code is part of * * G R O M A C S * * GROningen MAchine for Chemical Simulations * * VERSION 3.1 * Copyright (c) 1991-2001, University of Groningen, The Netherlands * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * If you want to redistribute modifications, please consider that * scientific software is very special. Version control is crucial - * bugs must be traceable. We will be happy to consider code for * inclusion in the official distribution, but derived work must not * be called official GROMACS. Details are found in the README & COPYING * files - if they are missing, get the official version at www.gromacs.org. * * To help us fund GROMACS development, we humbly ask that you cite * the papers on the package - you can find them in the top README file. * * For more info, check our website at http://www.gromacs.org * * And Hey: * Grunge ROck MAChoS */ #ifndef _binio_h #define _binio_h static char *SRCID_binio_h = "$Id: binio.h,v 1.8 2002/02/28 21:55:48 spoel Exp $"; #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include "sysstuff.h" #include "fatal.h" /* * Module to binary write and read. * * @ * @@@ @@ @ * @ @ * @ @ @ @@@ @@ @@@ @@ @@ @@@ @@ @@ @@ @@ * @ @ @ @ @ @@ @ @@ @ @ @@ @ @ @@ * @ @ @ @ @ @ @ @ @ @ @ @ @ * @@ @@ @@@@@ @ @ @ @ @ @ @ @ * @ @ @ @ @ @ @ @ @ @ @ @ * @ @ @ @@ @ @ @ @ @ @ @ @@ * @ @ @@@ @@ @@@@ @@@ @@@ @@@@@ @@@ @@@ @@ @ * @ * @ * @@@ * * Use this module only to write and read simple types or array(s) * of simple types. STRUCTURES ARE DEFINITELY NOT ALLOWED. */ #define nblockwrite(fp,nelem,data) \ _blockwrite(fp,nelem,sizeof(*data),(data),#data,__FILE__,__LINE__) #define blockwrite(fp,data) \ _blockwrite(fp,1,sizeof(data),&(data),#data,__FILE__,__LINE__) #define cblockwrite(fp,ptr,nchars) \ _blockwrite(fp,1,(nchars),(ptr),#ptr,__FILE__,__LINE__) #define nblockread(fp,nelem,data) \ _blockread(fp,nelem,sizeof(*data),(data),#data,__FILE__,__LINE__) #define blockread(fp,data) \ _blockread(fp,1,sizeof(data),&(data),#data,__FILE__,__LINE__) #define cblockread(fp,ptr,nchars) \ _blockread(fp,1,(nchars),(ptr),#ptr,__FILE__,__LINE__) extern void _blockwrite(FILE *fp,int nelem,int size,void *data, char *what,char *file,int line); extern void _blockread(FILE *fp,int nelem,int size,void *data, char *what,char *file,int line); #endif /* _binio_h */
/* Definitions for getting information about a filesystem. Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SYS_STATFSBSD_H #define _SYS_STATFSBSD_H 1 #include <features.h> /* Get the system-specific definition of `struct statfs'. */ #include <bits/statfsbsd.h> __BEGIN_DECLS /* Return information about the filesystem on which FILE resides. */ #ifndef __USE_FILE_OFFSET64 extern int statfsbsd (__const char *__file, struct statfsbsd *__buf) __THROW; #else # ifdef __REDIRECT extern int __REDIRECT (statfsbsd, (__const char *__file, struct statfsbsd *__buf) __THROW, statfsbsd64); # else # define statfsbsd statfsbsd64 # endif #endif #ifdef __USE_LARGEFILE64 extern int statfsbsd64 (__const char *__file, struct statfsbsd64 *__buf) __THROW; #endif /* Return information about the filesystem containing the file FILDES refers to. */ #ifndef __USE_FILE_OFFSET64 extern int fstatfsbsd (int __fildes, struct statfsbsd *__buf) __THROW; #else # ifdef __REDIRECT extern int __REDIRECT (fstatfsbsd, (int __fildes, struct statfsbsd *__buf) __THROW, fstatfsbsd64); # else # define fstatfsbsd fstatfsbsd64 # endif #endif #ifdef __USE_LARGEFILE64 extern int fstatfsbsd64 (int __fildes, struct statfsbsd64 *__buf) __THROW; #endif __END_DECLS #endif /* sys/statfsbsd.h */
/* This file was generated by upbc (the upb compiler) from the input * file: * * envoy/service/discovery/v3/discovery.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPBDEFS_H_ #define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPBDEFS_H_ #include "upb/def.h" #include "upb/port_def.inc" #ifdef __cplusplus extern "C" { #endif #include "upb/def.h" #include "upb/port_def.inc" extern _upb_DefPool_Init envoy_service_discovery_v3_discovery_proto_upbdefinit; UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DiscoveryRequest_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DiscoveryRequest"); } UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DiscoveryResponse_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DiscoveryResponse"); } UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DeltaDiscoveryRequest_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DeltaDiscoveryRequest"); } UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DeltaDiscoveryRequest.InitialResourceVersionsEntry"); } UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DeltaDiscoveryResponse_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DeltaDiscoveryResponse"); } UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_Resource_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.Resource"); } UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_Resource_CacheControl_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.Resource.CacheControl"); } #ifdef __cplusplus } /* extern "C" */ #endif #include "upb/port_undef.inc" #endif /* ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPBDEFS_H_ */
// Copyright 2014 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // Specific inlined methods for boolean decoder [VP8GetBit() ...] // This file should be included by the .c sources that actually need to call // these methods. // // Author: Skal (pascal.massimino@gmail.com) #ifndef WEBP_UTILS_BIT_READER_INL_H_ #define WEBP_UTILS_BIT_READER_INL_H_ #ifdef HAVE_CONFIG_H #include "../webp/config.h" #endif #include <string.h> // for memcpy #include "../dsp/dsp.h" #include "./bit_reader.h" #include "./endian_inl.h" #ifdef __cplusplus extern "C" { #endif //------------------------------------------------------------------------------ // Derived type lbit_t = natural type for memory I/O #if (BITS > 32) typedef uint64_t lbit_t; #elif (BITS > 16) typedef uint32_t lbit_t; #elif (BITS > 8) typedef uint16_t lbit_t; #else typedef uint8_t lbit_t; #endif extern const uint8_t kVP8Log2Range[128]; extern const uint8_t kVP8NewRange[128]; // special case for the tail byte-reading void VP8LoadFinalBytes(VP8BitReader* const br); //------------------------------------------------------------------------------ // Inlined critical functions // makes sure br->value_ has at least BITS bits worth of data static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE void VP8LoadNewBytes(VP8BitReader* const br) { assert(br != NULL && br->buf_ != NULL); // Read 'BITS' bits at a time if possible. if (br->buf_ < br->buf_max_) { // convert memory type to register type (with some zero'ing!) bit_t bits; #if defined(WEBP_USE_MIPS32) // This is needed because of un-aligned read. lbit_t in_bits; lbit_t* p_buf_ = (lbit_t*)br->buf_; __asm__ volatile( ".set push \n\t" ".set at \n\t" ".set macro \n\t" "ulw %[in_bits], 0(%[p_buf_]) \n\t" ".set pop \n\t" : [in_bits]"=r"(in_bits) : [p_buf_]"r"(p_buf_) : "memory", "at" ); #else lbit_t in_bits; memcpy(&in_bits, br->buf_, sizeof(in_bits)); #endif br->buf_ += BITS >> 3; #if !defined(WORDS_BIGENDIAN) #if (BITS > 32) bits = BSwap64(in_bits); bits >>= 64 - BITS; #elif (BITS >= 24) bits = BSwap32(in_bits); bits >>= (32 - BITS); #elif (BITS == 16) bits = BSwap16(in_bits); #else // BITS == 8 bits = (bit_t)in_bits; #endif // BITS > 32 #else // WORDS_BIGENDIAN bits = (bit_t)in_bits; if (BITS != 8 * sizeof(bit_t)) bits >>= (8 * sizeof(bit_t) - BITS); #endif br->value_ = bits | (br->value_ << BITS); br->bits_ += BITS; } else { VP8LoadFinalBytes(br); // no need to be inlined } } // Read a bit with proba 'prob'. Speed-critical function! static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) { // Don't move this declaration! It makes a big speed difference to store // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't // alter br->range_ value. range_t range = br->range_; if (br->bits_ < 0) { VP8LoadNewBytes(br); } { const int pos = br->bits_; const range_t split = (range * prob) >> 8; const range_t value = (range_t)(br->value_ >> pos); #if defined(__arm__) || defined(_M_ARM) // ARM-specific const int bit = ((int)(split - value) >> 31) & 1; if (value > split) { range -= split + 1; br->value_ -= (bit_t)(split + 1) << pos; } else { range = split; } #else // faster version on x86 int bit; // Don't use 'const int bit = (value > split);", it's slower. if (value > split) { range -= split + 1; br->value_ -= (bit_t)(split + 1) << pos; bit = 1; } else { range = split; bit = 0; } #endif if (range <= (range_t)0x7e) { const int shift = kVP8Log2Range[range]; range = kVP8NewRange[range]; br->bits_ -= shift; } br->range_ = range; return bit; } } // simplified version of VP8GetBit() for prob=0x80 (note shift is always 1 here) static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) { if (br->bits_ < 0) { VP8LoadNewBytes(br); } { const int pos = br->bits_; const range_t split = br->range_ >> 1; const range_t value = (range_t)(br->value_ >> pos); const int32_t mask = (int32_t)(split - value) >> 31; // -1 or 0 br->bits_ -= 1; br->range_ += mask; br->range_ |= 1; br->value_ -= (bit_t)((split + 1) & mask) << pos; return (v ^ mask) - mask; } } #ifdef __cplusplus } // extern "C" #endif #endif // WEBP_UTILS_BIT_READER_INL_H_
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/core/client/AWSError.h> #include <aws/core/client/CoreErrors.h> #include <aws/kinesis-video-media/KinesisVideoMedia_EXPORTS.h> namespace Aws { namespace KinesisVideoMedia { enum class KinesisVideoMediaErrors { //From Core// ////////////////////////////////////////////////////////////////////////////////////////// INCOMPLETE_SIGNATURE = 0, INTERNAL_FAILURE = 1, INVALID_ACTION = 2, INVALID_CLIENT_TOKEN_ID = 3, INVALID_PARAMETER_COMBINATION = 4, INVALID_QUERY_PARAMETER = 5, INVALID_PARAMETER_VALUE = 6, MISSING_ACTION = 7, // SDK should never allow MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow MISSING_PARAMETER = 9, // SDK should never allow OPT_IN_REQUIRED = 10, REQUEST_EXPIRED = 11, SERVICE_UNAVAILABLE = 12, THROTTLING = 13, VALIDATION = 14, ACCESS_DENIED = 15, RESOURCE_NOT_FOUND = 16, UNRECOGNIZED_CLIENT = 17, MALFORMED_QUERY_STRING = 18, SLOW_DOWN = 19, REQUEST_TIME_TOO_SKEWED = 20, INVALID_SIGNATURE = 21, SIGNATURE_DOES_NOT_MATCH = 22, INVALID_ACCESS_KEY_ID = 23, REQUEST_TIMEOUT = 24, NETWORK_CONNECTION = 99, UNKNOWN = 100, /////////////////////////////////////////////////////////////////////////////////////////// CLIENT_LIMIT_EXCEEDED= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1, CONNECTION_LIMIT_EXCEEDED, INVALID_ARGUMENT, INVALID_ENDPOINT, NOT_AUTHORIZED }; class AWS_KINESISVIDEOMEDIA_API KinesisVideoMediaError : public Aws::Client::AWSError<KinesisVideoMediaErrors> { public: KinesisVideoMediaError() {} KinesisVideoMediaError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<KinesisVideoMediaErrors>(rhs) {} KinesisVideoMediaError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<KinesisVideoMediaErrors>(rhs) {} KinesisVideoMediaError(const Aws::Client::AWSError<KinesisVideoMediaErrors>& rhs) : Aws::Client::AWSError<KinesisVideoMediaErrors>(rhs) {} KinesisVideoMediaError(Aws::Client::AWSError<KinesisVideoMediaErrors>&& rhs) : Aws::Client::AWSError<KinesisVideoMediaErrors>(rhs) {} template <typename T> T GetModeledError(); }; namespace KinesisVideoMediaErrorMapper { AWS_KINESISVIDEOMEDIA_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName); } } // namespace KinesisVideoMedia } // namespace Aws
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SYZYGY_REFINERY_PROCESS_STATE_LAYER_DATA_H_ #define SYZYGY_REFINERY_PROCESS_STATE_LAYER_DATA_H_ #include <vector> #include "base/md5.h" #include "base/containers/hash_tables.h" #include "base/strings/string_piece.h" #include "syzygy/pe/pe_file.h" namespace refinery { // Empty shell. class NoData { }; // An abstracted module identifier. This has a one-to-one mapping to platform // specific module identifiers, eg {size, checksum, timstamp} on Windows. Note // that multiple instances of the same module may be mapped at different // addresses in a process state. typedef uint32_t ModuleId; const ModuleId kNoModuleId = static_cast<ModuleId>(-1); struct PESignatureHasher { public: std::size_t operator()(pe::PEFile::Signature const& s) const; }; // Data relevant to a process state's module layer. class ModuleLayerData { public: using Signatures = std::vector<pe::PEFile::Signature>; ModuleLayerData(); // Find the module id corresponding to a signature. // @param signature the module's signature. // @returns the corresponding module id, or kNoModuleId if the signature is // unknown. ModuleId Find(const pe::PEFile::Signature& signature) const; // Find the module id corresponding to a signature if it exists, otherwise // index the signature and return the newly assigned module id. // @param signature the module's signature. // @returns the corresponding module id. ModuleId FindOrIndex(const pe::PEFile::Signature& signature); // Find and return the signature corresponding to a module @p id. // @param id the module identifier. // @param signature on success, contains the signature corresponding to module // @p id. // @returns true on success, false otherwise. bool Find(ModuleId id, pe::PEFile::Signature* signature) const; const Signatures& signatures() const { return signatures_; } private: std::unordered_map<pe::PEFile::Signature, ModuleId, PESignatureHasher> signature_to_id_; Signatures signatures_; }; } // namespace refinery #endif // SYZYGY_REFINERY_PROCESS_STATE_LAYER_DATA_H_
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "api/ecu.h" #include "core/flowfiles.h" #include <unistd.h> #include <errno.h> #include <limits.h> #include <signal.h> #include <sys/stat.h> #include <stdlib.h> #include <string.h> #include <stdio.h> int main(int argc, char** argv) { if (argc < 7) { printf("Error: must run ./tailfile_delimited <file> <interval> <delimiter> <hostname> <tcp port number> <nifi port uuid>\n"); exit(1); } tailfile_input_params input_params = init_logaggregate_input(argv); uint64_t intrvl = 0; uint64_t port_num = 0; if (validate_input_params(&input_params, &intrvl, &port_num) < 0) { return 1; } setup_signal_action(); nifi_proc_params params = setup_nifi_processor(&input_params, "TailFileDelimited", on_trigger_tailfiledelimited); set_standalone_property(params.processor, "file_path", input_params.file); set_standalone_property(params.processor, "delimiter", input_params.delimiter); struct CRawSiteToSiteClient * client = createClient(input_params.instance, port_num, input_params.nifi_port_uuid); char uuid_str[37]; get_proc_uuid_from_processor(params.processor, uuid_str); while (!stopped) { flow_file_record * new_ff = invoke(params.processor); struct processor_params * pp = NULL; HASH_FIND_STR(procparams, uuid_str, pp); if (pp) { transmit_payload(client, pp->ff_list, 1); delete_completed_flow_files_from_proc(uuid_str); } free_flowfile(new_ff); sleep(intrvl); } printf("tailfile delimited processor stopped\n"); if (client) { destroyClient(client); } clear_content_repo(params.instance); delete_all_flow_files_from_proc(uuid_str); free_standalone_processor(params.processor); free_instance(params.instance); free_proc_params(uuid_str); return 0; }
/* -*- 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/. */ // IWYU pragma: private, include "nsHTMLTags.h" /****** This file contains the list of all HTML tags See nsHTMLTags.h for access to the enum values for tags It is designed to be used as inline input to nsHTMLTags.cpp and nsHTMLContentSink *only* through the magic of C preprocessing. All entries must be enclosed in the macro HTML_TAG which will have cruel and unusual things done to it It is recommended (but not strictly necessary) to keep all entries in alphabetical order The first argument to HTML_TAG is both the enum identifier of the property and the string value. The second argument is the "creator" method of the form NS_New$TAGNAMEElement, that will be used by nsHTMLContentSink.cpp to create a content object for a tag of that type. Use NOTUSED, if the particular tag has a non-standard creator. The HTML_OTHER macro is for values in the nsHTMLTag enum that are not strictly tags. Entries *must* use only lowercase characters. Don't forget to update /editor/libeditor/html/nsHTMLEditUtils.cpp as well. ** Break these invariants and bad things will happen. ** ******/ HTML_TAG(a, Anchor) HTML_HTMLELEMENT_TAG(abbr) HTML_HTMLELEMENT_TAG(acronym) HTML_HTMLELEMENT_TAG(address) HTML_TAG(applet, SharedObject) HTML_TAG(area, Area) HTML_HTMLELEMENT_TAG(article) HTML_HTMLELEMENT_TAG(aside) #if defined(MOZ_MEDIA) HTML_TAG(audio, Audio) #endif HTML_HTMLELEMENT_TAG(b) HTML_TAG(base, Shared) HTML_TAG(basefont, Span) HTML_HTMLELEMENT_TAG(bdo) HTML_TAG(bgsound, Span) HTML_HTMLELEMENT_TAG(big) HTML_HTMLELEMENT_TAG(blink) HTML_TAG(blockquote, Shared) HTML_TAG(body, Body) HTML_TAG(br, BR) HTML_TAG(button, Button) HTML_TAG(canvas, Canvas) HTML_TAG(caption, TableCaption) HTML_HTMLELEMENT_TAG(center) HTML_HTMLELEMENT_TAG(cite) HTML_HTMLELEMENT_TAG(code) HTML_TAG(col, TableCol) HTML_TAG(colgroup, TableCol) HTML_TAG(datalist, DataList) HTML_HTMLELEMENT_TAG(dd) HTML_TAG(del, Mod) HTML_HTMLELEMENT_TAG(dfn) HTML_TAG(dir, Shared) HTML_TAG(div, Div) HTML_TAG(dl, SharedList) HTML_HTMLELEMENT_TAG(dt) HTML_HTMLELEMENT_TAG(em) HTML_TAG(embed, SharedObject) HTML_TAG(fieldset, FieldSet) HTML_HTMLELEMENT_TAG(figcaption) HTML_HTMLELEMENT_TAG(figure) HTML_TAG(font, Font) HTML_HTMLELEMENT_TAG(footer) HTML_TAG(form, Form) HTML_TAG(frame, Frame) HTML_TAG(frameset, FrameSet) HTML_TAG(h1, Heading) HTML_TAG(h2, Heading) HTML_TAG(h3, Heading) HTML_TAG(h4, Heading) HTML_TAG(h5, Heading) HTML_TAG(h6, Heading) HTML_TAG(head, Shared) HTML_HTMLELEMENT_TAG(header) HTML_HTMLELEMENT_TAG(hgroup) HTML_TAG(hr, HR) HTML_TAG(html, Shared) HTML_HTMLELEMENT_TAG(i) HTML_TAG(iframe, IFrame) HTML_TAG(image, Span) HTML_TAG(img, Image) HTML_TAG(input, Input) HTML_TAG(ins, Mod) HTML_HTMLELEMENT_TAG(kbd) HTML_TAG(keygen, Span) HTML_TAG(label, Label) HTML_TAG(legend, Legend) HTML_TAG(li, LI) HTML_TAG(link, Link) HTML_HTMLELEMENT_TAG(listing) HTML_TAG(map, Map) HTML_HTMLELEMENT_TAG(mark) HTML_TAG(marquee, Div) HTML_TAG(menu, Menu) HTML_TAG(menuitem, MenuItem) HTML_TAG(meta, Meta) HTML_TAG(meter, Meter) HTML_TAG(multicol, Span) HTML_HTMLELEMENT_TAG(nav) HTML_HTMLELEMENT_TAG(nobr) HTML_HTMLELEMENT_TAG(noembed) HTML_HTMLELEMENT_TAG(noframes) HTML_HTMLELEMENT_TAG(noscript) HTML_TAG(object, Object) HTML_TAG(ol, SharedList) HTML_TAG(optgroup, OptGroup) HTML_TAG(option, Option) HTML_TAG(output, Output) HTML_TAG(p, Paragraph) HTML_TAG(param, Shared) HTML_HTMLELEMENT_TAG(plaintext) HTML_TAG(pre, Pre) HTML_TAG(progress, Progress) HTML_TAG(q, Shared) HTML_HTMLELEMENT_TAG(s) HTML_HTMLELEMENT_TAG(samp) HTML_TAG(script, Script) HTML_HTMLELEMENT_TAG(section) HTML_TAG(select, Select) HTML_HTMLELEMENT_TAG(small) #if defined(MOZ_MEDIA) HTML_TAG(source, Source) #endif HTML_TAG(span, Span) HTML_HTMLELEMENT_TAG(strike) HTML_HTMLELEMENT_TAG(strong) HTML_TAG(style, Style) HTML_HTMLELEMENT_TAG(sub) HTML_HTMLELEMENT_TAG(sup) HTML_TAG(table, Table) HTML_TAG(tbody, TableSection) HTML_TAG(td, TableCell) HTML_TAG(textarea, TextArea) HTML_TAG(tfoot, TableSection) HTML_TAG(th, TableCell) HTML_TAG(thead, TableSection) HTML_TAG(title, Title) HTML_TAG(tr, TableRow) HTML_HTMLELEMENT_TAG(tt) HTML_HTMLELEMENT_TAG(u) HTML_TAG(ul, SharedList) HTML_HTMLELEMENT_TAG(var) #if defined(MOZ_MEDIA) HTML_TAG(video, Video) #endif HTML_HTMLELEMENT_TAG(wbr) HTML_HTMLELEMENT_TAG(xmp) /* These are not for tags. But they will be included in the nsHTMLTag enum anyway */ HTML_OTHER(text) HTML_OTHER(whitespace) HTML_OTHER(newline) HTML_OTHER(comment) HTML_OTHER(entity) HTML_OTHER(doctypeDecl) HTML_OTHER(markupDecl) HTML_OTHER(instruction)
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/securityhub/SecurityHub_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace SecurityHub { namespace Model { /** * <p>Details about an override action for a rule.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/WafOverrideAction">AWS * API Reference</a></p> */ class AWS_SECURITYHUB_API WafOverrideAction { public: WafOverrideAction(); WafOverrideAction(Aws::Utils::Json::JsonView jsonValue); WafOverrideAction& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline const Aws::String& GetType() const{ return m_type; } /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline void SetType(const Aws::String& value) { m_typeHasBeenSet = true; m_type = value; } /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline void SetType(Aws::String&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline void SetType(const char* value) { m_typeHasBeenSet = true; m_type.assign(value); } /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline WafOverrideAction& WithType(const Aws::String& value) { SetType(value); return *this;} /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline WafOverrideAction& WithType(Aws::String&& value) { SetType(std::move(value)); return *this;} /** * <p> <code>COUNT</code> overrides the action specified by the individual rule * within a <code>RuleGroup</code> .</p> <p>If set to <code>NONE</code>, the rule's * action takes place.</p> */ inline WafOverrideAction& WithType(const char* value) { SetType(value); return *this;} private: Aws::String m_type; bool m_typeHasBeenSet; }; } // namespace Model } // namespace SecurityHub } // namespace Aws
// // Licensed to Green Energy Corp (www.greenenergycorp.com) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. Green Enery Corp 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 __TLS_BASE_H_ #define __TLS_BASE_H_ #include <opendnp3/APL/Types.h> #include <opendnp3/APL/Uncopyable.h> #include <string> namespace apl { namespace dnp { class TransportLayer; /** Base class for all TransportLayerStates (TLS) */ class TLS_Base { public: virtual void Send(const boost::uint8_t*, size_t, TransportLayer*); virtual void HandleReceive(const boost::uint8_t*, size_t, TransportLayer*); // TPDU failure/success handlers virtual void HandleSendSuccess(TransportLayer*); virtual void HandleSendFailure(TransportLayer*); virtual void LowerLayerUp(TransportLayer*); virtual void LowerLayerDown(TransportLayer*); virtual std::string Name() const = 0; }; } } #endif
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/databrew/GlueDataBrew_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace GlueDataBrew { namespace Model { class AWS_GLUEDATABREW_API StartProjectSessionResult { public: StartProjectSessionResult(); StartProjectSessionResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); StartProjectSessionResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The name of the project to be acted upon.</p> */ inline const Aws::String& GetName() const{ return m_name; } /** * <p>The name of the project to be acted upon.</p> */ inline void SetName(const Aws::String& value) { m_name = value; } /** * <p>The name of the project to be acted upon.</p> */ inline void SetName(Aws::String&& value) { m_name = std::move(value); } /** * <p>The name of the project to be acted upon.</p> */ inline void SetName(const char* value) { m_name.assign(value); } /** * <p>The name of the project to be acted upon.</p> */ inline StartProjectSessionResult& WithName(const Aws::String& value) { SetName(value); return *this;} /** * <p>The name of the project to be acted upon.</p> */ inline StartProjectSessionResult& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** * <p>The name of the project to be acted upon.</p> */ inline StartProjectSessionResult& WithName(const char* value) { SetName(value); return *this;} /** * <p>A system-generated identifier for the session.</p> */ inline const Aws::String& GetClientSessionId() const{ return m_clientSessionId; } /** * <p>A system-generated identifier for the session.</p> */ inline void SetClientSessionId(const Aws::String& value) { m_clientSessionId = value; } /** * <p>A system-generated identifier for the session.</p> */ inline void SetClientSessionId(Aws::String&& value) { m_clientSessionId = std::move(value); } /** * <p>A system-generated identifier for the session.</p> */ inline void SetClientSessionId(const char* value) { m_clientSessionId.assign(value); } /** * <p>A system-generated identifier for the session.</p> */ inline StartProjectSessionResult& WithClientSessionId(const Aws::String& value) { SetClientSessionId(value); return *this;} /** * <p>A system-generated identifier for the session.</p> */ inline StartProjectSessionResult& WithClientSessionId(Aws::String&& value) { SetClientSessionId(std::move(value)); return *this;} /** * <p>A system-generated identifier for the session.</p> */ inline StartProjectSessionResult& WithClientSessionId(const char* value) { SetClientSessionId(value); return *this;} private: Aws::String m_name; Aws::String m_clientSessionId; }; } // namespace Model } // namespace GlueDataBrew } // namespace Aws
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/devicefarm/DeviceFarm_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace DeviceFarm { namespace Model { enum class DevicePlatform { NOT_SET, ANDROID_, IOS }; namespace DevicePlatformMapper { AWS_DEVICEFARM_API DevicePlatform GetDevicePlatformForName(const Aws::String& name); AWS_DEVICEFARM_API Aws::String GetNameForDevicePlatform(DevicePlatform value); } // namespace DevicePlatformMapper } // namespace Model } // namespace DeviceFarm } // namespace Aws
/* * 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 #ifdef _MSC_VER //disable windows complaining about max template size. #pragma warning (disable : 4503) #endif // _MSC_VER #if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32) #ifdef _MSC_VER #pragma warning(disable : 4251) #endif // _MSC_VER #ifdef USE_IMPORT_EXPORT #ifdef AWS_APPSTREAM_EXPORTS #define AWS_APPSTREAM_API __declspec(dllexport) #else #define AWS_APPSTREAM_API __declspec(dllimport) #endif /* AWS_APPSTREAM_EXPORTS */ #else #define AWS_APPSTREAM_API #endif // USE_IMPORT_EXPORT #else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32) #define AWS_APPSTREAM_API #endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
//===- PTXRegisterInfo.h - PTX Register Information Impl --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the PTX implementation of the MRegisterInfo class. // //===----------------------------------------------------------------------===// #ifndef PTX_REGISTER_INFO_H #define PTX_REGISTER_INFO_H #include "llvm/Support/ErrorHandling.h" #include "llvm/ADT/BitVector.h" #define GET_REGINFO_HEADER #include "PTXGenRegisterInfo.inc" namespace llvm { class PTXTargetMachine; class MachineFunction; struct PTXRegisterInfo : public PTXGenRegisterInfo { private: const TargetInstrInfo &TII; public: PTXRegisterInfo(PTXTargetMachine &TM, const TargetInstrInfo &tii); virtual const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const { static const unsigned CalleeSavedRegs[] = { 0 }; return CalleeSavedRegs; // save nothing } virtual BitVector getReservedRegs(const MachineFunction &MF) const { BitVector Reserved(getNumRegs()); return Reserved; // reserve no regs } virtual void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, RegScavenger *RS = NULL) const; virtual unsigned getFrameRegister(const MachineFunction &MF) const { llvm_unreachable("PTX does not have a frame register"); return 0; } }; // struct PTXRegisterInfo } // namespace llvm #endif // PTX_REGISTER_INFO_H
/* * Copyright (C) 2009 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 UserContentURLPattern_h #define UserContentURLPattern_h #include <wtf/Vector.h> #include <wtf/text/WTFString.h> namespace WebCore { class URL; class UserContentURLPattern { public: UserContentURLPattern() : m_invalid(true), m_matchSubdomains(false) { } UserContentURLPattern(const String& pattern) : m_matchSubdomains(false) { m_invalid = !parse(pattern); } bool isValid() const { return !m_invalid; } WEBCORE_EXPORT bool matches(const URL&) const; const String& scheme() const { return m_scheme; } const String& host() const { return m_host; } const String& path() const { return m_path; } bool matchSubdomains() const { return m_matchSubdomains; } static bool matchesPatterns(const URL&, const Vector<String>& whitelist, const Vector<String>& blacklist); private: WEBCORE_EXPORT bool parse(const String& pattern); bool matchesHost(const URL&) const; bool matchesPath(const URL&) const; bool m_invalid; String m_scheme; String m_host; String m_path; bool m_matchSubdomains; }; } // namespace WebCore #endif // UserContentURLPattern_h
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Author: Xu Peilin (xupeilin@baidu.com) #ifndef BAIDU_COMMON_TPRINTER_H_ #define BAIDU_COMMON_TPRINTER_H_ #include <stdint.h> #include <string> #include <vector> namespace baidu { namespace common { using std::string; class TPrinter { public: typedef std::vector<string> Line; typedef std::vector<Line> Table; TPrinter(); TPrinter(int cols); ~TPrinter(); bool AddRow(const std::vector<string>& cols); bool AddRow(int argc, ...); bool AddRow(const std::vector<int64_t>& cols); void Print(bool has_head = true); string ToString(bool has_head = true); void Reset(); void Reset(int cols); static string RemoveSubString(const string& input, const string& substr); private: static const uint32_t kMaxColWidth = 50; size_t _cols; std::vector<int> _col_width; Table _table; }; } // namespace common } // namespace baidu #endif // BAIDU_COMMON_TPRINTER_H_
/* * This software is distributed under BSD 3-clause license (see LICENSE file). * * Authors: Fernando Iglesias, Yuyu Zhang, Bjoern Esser */ #ifndef _STRUCTUREDDATA_H__ #define _STRUCTUREDDATA_H__ #include <shogun/lib/config.h> #include <shogun/base/SGObject.h> #include <shogun/lib/StructuredDataTypes.h> namespace shogun { /** @brief Base class of the components of StructuredLabels */ class CStructuredData : public CSGObject { public: /** default constructor */ CStructuredData(); /** destructor */ virtual ~CStructuredData(); /** @return object name */ virtual const char* get_name() const { return "StructuredData"; } /** get structured data type * * @return structured data type (a sequence, a tree, a graph, ...) */ virtual EStructuredDataType get_structured_data_type() const; }; } /* namespace shogun */ #endif /* _STRUCTUREDDATA_H__ */
/* * Copyright (C) 2014 Etnaviv Project * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Authors: * Christian Gmeiner <christian.gmeiner@gmail.com> */ #include <stdlib.h> #include <linux/stddef.h> #include <linux/types.h> #include <errno.h> #include <sys/mman.h> #include <fcntl.h> #include <unistd.h> #include <pthread.h> #include <xf86drm.h> #include <xf86atomic.h> #include "etnaviv_priv.h" #include "etnaviv_drmif.h" static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER; drm_public struct etna_device *etna_device_new(int fd) { struct etna_device *dev = calloc(sizeof(*dev), 1); if (!dev) return NULL; atomic_set(&dev->refcnt, 1); dev->fd = fd; dev->handle_table = drmHashCreate(); dev->name_table = drmHashCreate(); etna_bo_cache_init(&dev->bo_cache); return dev; } /* like etna_device_new() but creates it's own private dup() of the fd * which is close()d when the device is finalized. */ drm_public struct etna_device *etna_device_new_dup(int fd) { int dup_fd = dup(fd); struct etna_device *dev = etna_device_new(dup_fd); if (dev) dev->closefd = 1; else close(dup_fd); return dev; } drm_public struct etna_device *etna_device_ref(struct etna_device *dev) { atomic_inc(&dev->refcnt); return dev; } static void etna_device_del_impl(struct etna_device *dev) { etna_bo_cache_cleanup(&dev->bo_cache, 0); drmHashDestroy(dev->handle_table); drmHashDestroy(dev->name_table); if (dev->closefd) close(dev->fd); free(dev); } drm_private void etna_device_del_locked(struct etna_device *dev) { if (!atomic_dec_and_test(&dev->refcnt)) return; etna_device_del_impl(dev); } drm_public void etna_device_del(struct etna_device *dev) { if (!atomic_dec_and_test(&dev->refcnt)) return; pthread_mutex_lock(&table_lock); etna_device_del_impl(dev); pthread_mutex_unlock(&table_lock); } drm_public int etna_device_fd(struct etna_device *dev) { return dev->fd; }
#ifndef __IQM_H__ #define __IQM_H__ #define IQM_MAGIC "INTERQUAKEMODEL" #define IQM_VERSION 2 struct iqmheader { char magic[16]; unsigned int version; unsigned int filesize; unsigned int flags; unsigned int num_text, ofs_text; unsigned int num_meshes, ofs_meshes; unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays; unsigned int num_triangles, ofs_triangles, ofs_adjacency; unsigned int num_joints, ofs_joints; unsigned int num_poses, ofs_poses; unsigned int num_anims, ofs_anims; unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds; unsigned int num_comment, ofs_comment; unsigned int num_extensions, ofs_extensions; }; struct iqmmesh { unsigned int name; unsigned int material; unsigned int first_vertex, num_vertexes; unsigned int first_triangle, num_triangles; }; enum { IQM_POSITION = 0, IQM_TEXCOORD = 1, IQM_NORMAL = 2, IQM_TANGENT = 3, IQM_BLENDINDEXES = 4, IQM_BLENDWEIGHTS = 5, IQM_COLOR = 6, IQM_CUSTOM = 0x10 }; enum { IQM_BYTE = 0, IQM_UBYTE = 1, IQM_SHORT = 2, IQM_USHORT = 3, IQM_INT = 4, IQM_UINT = 5, IQM_HALF = 6, IQM_FLOAT = 7, IQM_DOUBLE = 8, }; struct iqmtriangle { unsigned int vertex[3]; }; struct iqmadjacency { unsigned int triangle[3]; }; struct iqmjoint { unsigned int name; int parent; float translate[3], rotate[4], scale[3]; }; struct iqmpose { int parent; unsigned int mask; float channeloffset[10]; float channelscale[10]; }; struct iqmanim { unsigned int name; unsigned int first_frame, num_frames; float framerate; unsigned int flags; }; enum { IQM_LOOP = 1<<0 }; struct iqmvertexarray { unsigned int type; unsigned int flags; unsigned int format; unsigned int size; unsigned int offset; }; struct iqmbounds { float bbmin[3], bbmax[3]; float xyradius, radius; }; #endif
/* * The Biomechanical ToolKit * Copyright (c) 2009-2014, Arnaud Barré * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name(s) of the copyright holders nor the names * of its contributors may be used to endorse or promote products * derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __btkCodamotionFileIOUtils_h #define __btkCodamotionFileIOUtils_h #include "btkAcquisition.h" #include "btkException.h" #include "btkMetaDataUtils.h" #include "Open3DMotion/MotionFile/MotionFileFormat.h" #include "Open3DMotion/MotionFile/MotionFileFormatList.h" #include "Open3DMotion/MotionFile/MotionFileHandler.h" #include "Open3DMotion/OpenORM/TreeValue.h" #include "Open3DMotion/OpenORM/Mappings/RichBinary/BinMemFactoryDefault.h" #include "Open3DMotion/Biomechanics/Trial/TSFactory.h" #include <fstream> namespace btk { class CodamotionFileIOException : public Exception { public: explicit CodamotionFileIOException(const std::string& msg) : Exception(msg) {}; virtual ~CodamotionFileIOException() throw() {}; }; void FillAcquisitionFromOpen3DMotion_p(Acquisition::Pointer output, const std::string& filename, std::ifstream& ifs, Open3DMotion::MotionFileHandler& handler, const Open3DMotion::MotionFileFormatList& formatlist); }; #endif // __btkCodamotionFileIOUtils_h
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2019, Image Engine Design Inc. All rights reserved. // Copyright (c) 2015, Nvizible Ltd. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef GAFFERIMAGE_FLATIMAGESOURCE_H #define GAFFERIMAGE_FLATIMAGESOURCE_H #include "GafferImage/ImageNode.h" namespace GafferImage { /// The FlatImageSource is a base class for several nodes which produce flat /// images. It takes care of returning flat values for the plugs used by /// deep images. class GAFFERIMAGE_API FlatImageSource : public ImageNode { public : FlatImageSource( const std::string &name=defaultName<FlatImageSource>() ); ~FlatImageSource() override; GAFFER_GRAPHCOMPONENT_DECLARE_TYPE( GafferImage::FlatImageSource, FlatImageSourceTypeId, ImageNode ); protected : Gaffer::ValuePlug::CachePolicy computeCachePolicy( const Gaffer::ValuePlug *output ) const override; void hashDeep( const GafferImage::ImagePlug *parent, const Gaffer::Context *context, IECore::MurmurHash &h ) const override; bool computeDeep( const Gaffer::Context *context, const ImagePlug *parent ) const override; void hashSampleOffsets( const GafferImage::ImagePlug *parent, const Gaffer::Context *context, IECore::MurmurHash &h ) const override; IECore::ConstIntVectorDataPtr computeSampleOffsets( const Imath::V2i &tileOrigin, const Gaffer::Context *context, const ImagePlug *parent ) const override; }; IE_CORE_DECLAREPTR( FlatImageSource ) } // namespace GafferImage #endif // GAFFERIMAGE_FLATIMAGESOURCE_H
/* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #define BSD 211 /* 2.11 * 100, as cpp doesn't do floats */ #ifndef offsetof #define offsetof(type, member) ((size_t)(&((type *)0)->member)) #endif /* * Machine type dependent parameters. */ #include <machine/machparam.h> /* * Machine-independent constants */ #ifndef NMOUNT #define NMOUNT 2 /* number of mountable file systems */ #endif #define MAXUPRC 20 /* max processes per user */ #define NOFILE 30 /* max open files per process */ #define NCARGS 5120 /* # characters in exec arglist */ #define NGROUPS 16 /* max number groups */ #define NOGROUP 65535 /* marker for empty group set member */ /* * Priorities */ #define PSWP 0 #define PINOD 10 #define PRIBIO 20 #define PRIUBA 24 #define PZERO 25 #define PPIPE 26 #define PSOCK 26 #define PWAIT 30 #define PLOCK 35 #define PPAUSE 40 #define PUSER 50 #define NZERO 0 #define PRIMASK 0xff #define PCATCH 0x100 /* * Signals */ #include <sys/signal.h> #define NBPW sizeof(int) /* number of bytes in an integer */ #ifndef NULL #define NULL 0 #endif #define CMASK 026 /* default mask for file creation */ #define NODEV (dev_t)(-1) /* CBLOCK is the size of a clist block, must be power of 2 */ #define CBLOCK 32 #define CBSIZE (CBLOCK - sizeof(struct cblock *)) /* data chars/clist */ #define CROUND (CBLOCK - 1) /* clist rounding */ #include <sys/types.h> /* * File system parameters and macros. * * The file system is made out of blocks of most MAXBSIZE units. */ #define MAXBSIZE 1024 /* * MAXPATHLEN defines the longest permissable path length * after expanding symbolic links. It is used to allocate * a temporary buffer from the buffer pool in which to do the * name expansion, hence should be a power of two, and must * be less than or equal to MAXBSIZE. * MAXSYMLINKS defines the maximum number of symbolic links * that may be expanded in a path name. It should be set high * enough to allow all legitimate uses, but halt infinite loops * reasonably quickly. */ #define MAXPATHLEN 256 #define MAXSYMLINKS 8 /* * Macros for fast min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* * Macros for counting and rounding. */ #ifndef howmany # define howmany(x,y) (((x)+((y)-1))/(y)) #endif #define roundup(x,y) ((((x)+((y)-1))/(y))*(y)) /* * Maximum size of hostname recognized and stored in the kernel. */ #define MAXHOSTNAMELEN 64 #if defined(KERNEL) && defined(INET) # include <machine/net_mac.h> #endif /* * MAXMEM is the maximum core per process is allowed. First number is Kb. */ #define MAXMEM (96*1024) /* * Max length of a user login name. */ #define MAXLOGNAME 16
/* * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, 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 COMPUTER, 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 InsertParagraphSeparatorCommand_h #define InsertParagraphSeparatorCommand_h #include "core/editing/commands/CompositeEditCommand.h" namespace blink { class EditingStyle; class InsertParagraphSeparatorCommand final : public CompositeEditCommand { public: static PassRefPtrWillBeRawPtr<InsertParagraphSeparatorCommand> create(Document& document, bool useDefaultParagraphElement = false, bool pasteBlockquoteIntoUnquotedArea = false) { return adoptRefWillBeNoop(new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement, pasteBlockquoteIntoUnquotedArea)); } DECLARE_VIRTUAL_TRACE(); private: InsertParagraphSeparatorCommand(Document&, bool useDefaultParagraphElement, bool pasteBlockquoteIntoUnquotedArea); void doApply(EditingState*) override; void calculateStyleBeforeInsertion(const Position&); void applyStyleAfterInsertion(Element* originalEnclosingBlock, EditingState*); void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock, WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors); PassRefPtrWillBeRawPtr<Element> cloneHierarchyUnderNewBlock(const WillBeHeapVector<RefPtrWillBeMember<Element>>& ancestors, PassRefPtrWillBeRawPtr<Element> blockToInsert, EditingState*); bool shouldUseDefaultParagraphElement(Element*) const; bool preservesTypingStyle() const override; RefPtrWillBeMember<EditingStyle> m_style; bool m_mustUseDefaultParagraphElement; bool m_pasteBlockquoteIntoUnquotedArea; }; } // namespace blink #endif
/** * @file ethloopControl.c * @provides ethloopControl * * $Id: ethloopControl.c 2077 2009-09-24 23:58:54Z mschul $ */ /* Embedded Xinu, Copyright (C) 2009. All rights reserved. */ #include <stddef.h> #include <bufpool.h> #include <device.h> #include <ethernet.h> #include <ethloop.h> #include <interrupt.h> #include <network.h> #include <stdlib.h> /** * Control function for ethloop devices. * @param devptr ethloop device table entry * @param func control function to execute * @param arg1 first argument for the control function * @param arg2 second argument for the control function * @return the result of the control function */ devcall ethloopControl(device *devptr, int func, long arg1, long arg2) { struct ethloop *elpptr; struct netaddr *addr; uchar old; irqmask im; char *buf; char *hold; int holdlen; elpptr = &elooptab[devptr->minor]; im = disable(); if (ELOOP_STATE_ALLOC != elpptr->state) { restore(im); return SYSERR; } switch (func) { /* Get link header length. */ case NET_GET_LINKHDRLEN: restore(im); return ETH_HDR_LEN; /* Get MAC address from card. */ case NET_GET_HWADDR: restore(im); addr = (struct netaddr *)arg1; addr->type = NETADDR_ETHERNET; addr->len = ETH_ADDR_LEN; addr->addr[0] = 0xAA; addr->addr[1] = 0xBB; addr->addr[2] = 0xCC; addr->addr[3] = 0xDD; addr->addr[4] = 0xEE; addr->addr[5] = 0xFF; break; /* Get broadcast MAC address. */ case NET_GET_HWBRC: restore(im); addr = (struct netaddr *)arg1; addr->type = NETADDR_ETHERNET; addr->len = ETH_ADDR_LEN; addr->addr[0] = 0xFF; addr->addr[1] = 0xFF; addr->addr[2] = 0xFF; addr->addr[3] = 0xFF; addr->addr[4] = 0xFF; addr->addr[5] = 0xFF; break; /* Get MTU. */ case NET_GET_MTU: restore(im); return ELOOP_MTU; /* Get next packet off hold queue */ case ELOOP_CTRL_GETHOLD: buf = (char *)arg1; /* Wait for held packet */ wait(elpptr->hsem); /* Get and clear held packet */ hold = elpptr->hold; holdlen = elpptr->holdlen; elpptr->hold = NULL; elpptr->holdlen = 0; restore(im); /* Copy held packet to buffer */ if (arg2 < holdlen) { holdlen = arg2; } memcpy(buf, hold, holdlen); /* Free hold buffer */ buffree(hold); return holdlen; /* Set flags */ case ELOOP_CTRL_SETFLAG: old = elpptr->flags & arg1; elpptr->flags |= (arg1); restore(im); return old; /* Clear flags */ case ELOOP_CTRL_CLRFLAG: old = elpptr->flags & arg1; elpptr->flags &= ~(arg1); restore(im); return old; default: restore(im); return SYSERR; } restore(im); return OK; }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ #define REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "remoting/host/win/worker_process_launcher.h" class FilePath; namespace base { class SingleThreadTaskRunner; } // namespace base namespace IPC { class Listener; class Message; } // namespace base namespace remoting { // Implements logic for launching and monitoring a worker process in a different // session. class WtsSessionProcessDelegate : public WorkerProcessLauncher::Delegate { public: WtsSessionProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, const FilePath& binary_path, uint32 session_id, bool launch_elevated, const std::string& channel_security); ~WtsSessionProcessDelegate(); // IPC::Sender implementation. virtual bool Send(IPC::Message* message) OVERRIDE; // WorkerProcessLauncher::Delegate implementation. virtual DWORD GetProcessId() const OVERRIDE; virtual bool IsPermanentError(int failure_count) const OVERRIDE; virtual void KillProcess(DWORD exit_code) OVERRIDE; virtual bool LaunchProcess( IPC::Listener* delegate, base::win::ScopedHandle* process_exit_event_out) OVERRIDE; private: // The actual implementation resides in WtsSessionProcessDelegate::Core class. class Core; scoped_refptr<Core> core_; DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); }; } // namespace remoting #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include <stdint.h> #include <windows.h> #include <wchar.h> #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <limits.h> #include <string.h> #include <float.h> #include <share.h> #include <cstdlib> #include <intrin.h> #if COR_JIT_EE_VERSION <= 460 #include "corjithost.h" #include "jithost.h" #endif #include "jit.h" #include "iallocator.h" #include "hashbv.h" #include "compiler.h" #include "dataflow.h" #include "block.h" #include "jiteh.h" #include "rationalize.h" #include "jitstd.h" #include "ssaconfig.h" #include "blockset.h" #include "bitvec.h" #include "inline.h"
/** * \file * * \brief Configuration File for SAM4L-EK Board. * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_BOARD_H_INCLUDED #define CONF_BOARD_H_INCLUDED /* Auto-initialize USART GPIOs when board_init() is called */ //#define CONF_BOARD_COM_PORT /* Enable EIC for PB0 */ #define CONF_BOARD_EIC /* Enable USB interface (USB) */ #define CONF_BOARD_USB_PORT /* ID detect enabled, uncomment it if jumper PB05/USB set */ #define CONF_BOARD_USB_ID_DETECT /* Host VBUS control enabled, uncomment it if jumper PC08/USB set */ #define CONF_BOARD_USB_VBUS_CONTROL /* Host VBUS control enabled, uncomment it if jumper PC08/USB set */ #define CONF_BOARD_USB_VBUS_ERR_DETECT /* Enable USART to control Board Monitoring */ //#define CONF_BOARD_BM_USART /* Initialize the LCD Backlight */ #define CONF_BOARD_BL #endif /* CONF_BOARD_H_INCLUDED */
#include <stdio.h> struct vec2 { double X, Y; }; void print(struct vec2 S) { printf("%f, %f\n", S.X, S.Y); } int main() { struct vec2 U; U.X = .5; U.Y = 1.2; print(U); return 0; }
/* $Header$ * * Copyright (c) 1989, Larry Wall * * You may distribute under the terms of the GNU General Public License * as specified in the README file that comes with the perl 3.0 kit. * * $Log$ * Revision 1.2 2004/09/01 14:33:24 criswell * Migrating test suite out of the source tree. * * Revision 1.1 2004/02/17 22:21:15 criswell * Initial commit of the perl Malloc Benchmark. I've cheated a little by * generating the yacc output files and committing them directly, but it was * easier than disabling the Bison Voodoo that gets executed by default. * * Revision 4.0 91/03/20 01:03:32 lwall * 4.0 baseline. * */ #include "EXTERN.h" #include "perl.h" STR * afetch(ar,key,lval) register ARRAY *ar; int key; int lval; { STR *str; if (key < 0 || key > ar->ary_fill) { if (lval && key >= 0) { if (ar->ary_flags & ARF_REAL) str = Str_new(5,0); else str = str_mortal(&str_undef); (void)astore(ar,key,str); return str; } else return &str_undef; } if (!ar->ary_array[key]) { if (lval) { str = Str_new(6,0); (void)astore(ar,key,str); return str; } return &str_undef; } return ar->ary_array[key]; } bool astore(ar,key,val) register ARRAY *ar; int key; STR *val; { int retval; if (key < 0) return FALSE; if (key > ar->ary_max) { int newmax; if (ar->ary_alloc != ar->ary_array) { retval = ar->ary_array - ar->ary_alloc; Copy(ar->ary_array, ar->ary_alloc, ar->ary_max+1, STR*); Zero(ar->ary_alloc+ar->ary_max+1, retval, STR*); ar->ary_max += retval; ar->ary_array -= retval; if (key > ar->ary_max - 10) { newmax = key + ar->ary_max; goto resize; } } else { if (ar->ary_alloc) { newmax = key + ar->ary_max / 5; resize: Renew(ar->ary_alloc,newmax+1, STR*); Zero(&ar->ary_alloc[ar->ary_max+1], newmax - ar->ary_max, STR*); } else { newmax = key < 4 ? 4 : key; Newz(2,ar->ary_alloc, newmax+1, STR*); } ar->ary_array = ar->ary_alloc; ar->ary_max = newmax; } } if ((ar->ary_flags & ARF_REAL) && ar->ary_fill < key) { while (++ar->ary_fill < key) { if (ar->ary_array[ar->ary_fill] != Nullstr) { str_free(ar->ary_array[ar->ary_fill]); ar->ary_array[ar->ary_fill] = Nullstr; } } } retval = (ar->ary_array[key] != Nullstr); if (retval && (ar->ary_flags & ARF_REAL)) str_free(ar->ary_array[key]); ar->ary_array[key] = val; return retval; } ARRAY * anew(stab) STAB *stab; { register ARRAY *ar; New(1,ar,1,ARRAY); ar->ary_magic = Str_new(7,0); ar->ary_alloc = ar->ary_array = 0; str_magic(ar->ary_magic, stab, '#', Nullch, 0); ar->ary_max = ar->ary_fill = -1; ar->ary_flags = ARF_REAL; return ar; } ARRAY * afake(stab,size,strp) STAB *stab; register int size; register STR **strp; { register ARRAY *ar; New(3,ar,1,ARRAY); New(4,ar->ary_alloc,size+1,STR*); Copy(strp,ar->ary_alloc,size,STR*); ar->ary_array = ar->ary_alloc; ar->ary_magic = Str_new(8,0); str_magic(ar->ary_magic, stab, '#', Nullch, 0); ar->ary_fill = size - 1; ar->ary_max = size - 1; ar->ary_flags = 0; while (size--) { (*strp++)->str_pok &= ~SP_TEMP; } return ar; } void aclear(ar) register ARRAY *ar; { register int key; if (!ar || !(ar->ary_flags & ARF_REAL) || ar->ary_max < 0) return; if (key = ar->ary_array - ar->ary_alloc) { ar->ary_max += key; ar->ary_array -= key; } for (key = 0; key <= ar->ary_max; key++) str_free(ar->ary_array[key]); ar->ary_fill = -1; Zero(ar->ary_array, ar->ary_max+1, STR*); } void afree(ar) register ARRAY *ar; { register int key; if (!ar) return; if (key = ar->ary_array - ar->ary_alloc) { ar->ary_max += key; ar->ary_array -= key; } if (ar->ary_flags & ARF_REAL) { for (key = 0; key <= ar->ary_max; key++) str_free(ar->ary_array[key]); } str_free(ar->ary_magic); Safefree(ar->ary_alloc); Safefree(ar); } bool apush(ar,val) register ARRAY *ar; STR *val; { return astore(ar,++(ar->ary_fill),val); } STR * apop(ar) register ARRAY *ar; { STR *retval; if (ar->ary_fill < 0) return Nullstr; retval = ar->ary_array[ar->ary_fill]; ar->ary_array[ar->ary_fill--] = Nullstr; return retval; } aunshift(ar,num) register ARRAY *ar; register int num; { register int i; register STR **sstr,**dstr; if (num <= 0) return; if (ar->ary_array - ar->ary_alloc >= num) { ar->ary_max += num; ar->ary_fill += num; while (num--) *--ar->ary_array = Nullstr; } else { (void)astore(ar,ar->ary_fill+num,(STR*)0); /* maybe extend array */ dstr = ar->ary_array + ar->ary_fill; sstr = dstr - num; #ifdef BUGGY_MSC5 # pragma loop_opt(off) /* don't loop-optimize the following code */ #endif /* BUGGY_MSC5 */ for (i = ar->ary_fill; i >= 0; i--) { *dstr-- = *sstr--; #ifdef BUGGY_MSC5 # pragma loop_opt() /* loop-optimization back to command-line setting */ #endif /* BUGGY_MSC5 */ } Zero(ar->ary_array, num, STR*); } } STR * ashift(ar) register ARRAY *ar; { STR *retval; if (ar->ary_fill < 0) return Nullstr; retval = *ar->ary_array; *(ar->ary_array++) = Nullstr; ar->ary_max--; ar->ary_fill--; return retval; } int alen(ar) register ARRAY *ar; { return ar->ary_fill; } afill(ar, fill) register ARRAY *ar; int fill; { if (fill < 0) fill = -1; if (fill <= ar->ary_max) ar->ary_fill = fill; else (void)astore(ar,fill,Nullstr); }
// // LFXBinaryTypes.h // LIFX SDK // // Created by Nick Forge on 14/03/2014. // Copyright (c) 2014 LIFX Labs. All rights reserved. // #import <Foundation/Foundation.h> #import "LFXTypes.h" #import "LXProtocol.h" /* Contains types used in the LIFX Binary Protocol */ // Tag Fields typedef uint64_t tagField_t; // Protocol Power Level (0-65535) <-> LFXPowerState uint16_t LFXProtocolPowerLevelFromLFXPowerState(LFXPowerState powerState); LFXPowerState LFXPowerStateFromLFXProtocolPowerLevel(uint16_t powerLevel); // Protocol Duration (ms) <-> NSTimeInterval NSTimeInterval NSTimeIntervalFromLFXProtocolDuration(uint32_t duration); uint32_t LFXProtocolDurationFromNSTimeInterval(NSTimeInterval timeInterval); // Protocol Unix Time (ns) <-> NSDate NSDate *NSDateFromLFXProtocolUnixTime(uint64_t protocolUnixTime); uint64_t LFXProtocolUnixTimeFromNSDate(NSDate *date); // Firmware Versions NSString *NSStringFromLFXProtocolFirmwareVersionUInt32(uint32_t version); NSDate *NSDateFromLFXProtocolFirmwareBuild(uint64_t build); // Protocol HSBK Color (LXProtocolLightHsbk) <-> LFXHSBKColor LFXHSBKColor *LFXHSBKColorFromLXProtocolLightHsbk(LXProtocolLightHsbk *protocolHsbk); LXProtocolLightHsbk *LXProtocolLightHsbkFromLFXHSBKColor(LFXHSBKColor *color);
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtPositioning 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 QGEORECTANGLE_P_H #define QGEORECTANGLE_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qgeoshape_p.h" #include "qgeocoordinate.h" QT_BEGIN_NAMESPACE class QGeoRectanglePrivate : public QGeoShapePrivate { public: QGeoRectanglePrivate(); QGeoRectanglePrivate(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight); QGeoRectanglePrivate(const QGeoRectanglePrivate &other); ~QGeoRectanglePrivate(); bool isValid() const; bool isEmpty() const; bool contains(const QGeoCoordinate &coordinate) const; void extendShape(const QGeoCoordinate &coordinate); QGeoShapePrivate *clone() const; bool operator==(const QGeoShapePrivate &other) const; QGeoCoordinate topLeft; QGeoCoordinate bottomRight; }; QT_END_NAMESPACE #endif
#ifndef RHO_MEMORY__ #define RHO_MEMORY__ #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE 1 #endif //_CRT_SECURE_NO_DEPRECATE //#ifndef __APPLE__ //#if defined( _WIN32_WCE ) && !defined(WCE_PLATFORM_MC3000C50B) && !defined (WCE_PLATFORM_WT41N0) #if 0 #include <stdlib.h> #ifndef _RHO_NO_MEMDEFINES #undef _CRTDBG_MAP_ALLOC #if (defined( _WIN32_WCE ) || defined( WIN32 )) && !defined( _SIZE_T_DEFINED) typedef unsigned int size_t; #define _SIZE_T_DEFINED 1 #endif #if defined(__SYMBIAN32__) && !defined( _SIZE_T_DECLARED) typedef unsigned int size_t; #define _SIZE_T_DECLARED 1 #endif #if defined(__APPLE__) && !defined( _SIZE_T) typedef unsigned int size_t; #define _SIZE_T 1 #endif #ifdef __cplusplus extern "C" { #endif void rho_free(void *); void * rho_malloc(size_t); void * rho_calloc(size_t num, size_t size); size_t rho_msize(void *); void * rho_realloc(void *, size_t); char * rho_strdup(const char *); wchar_t * rho_wcsdup(const wchar_t * str); void sys_free(void *); #ifdef __cplusplus } #endif #undef free #undef malloc #undef calloc #undef _msize #undef realloc #undef strdup #undef _strdup #undef _wcsdup //#define _recalloc(p, n, s) rho_realloc(p, n*s) #define free(p) rho_free(p) #define malloc(s) rho_malloc(s) #define calloc(num, size) rho_calloc(num,size) #define _msize( p) rho_msize(p) #define realloc(p, s) rho_realloc(p,s) #define strdup(s) rho_strdup(s) #define _strdup(s) rho_strdup(s) #define _wcsdup(s) rho_wcsdup(s) #ifndef __SYMBIAN32__ #ifdef __cplusplus void* cpp_alloc(size_t size, bool nothrow); #include <new> #ifndef __THROW #define __THROW throw() #endif inline void* operator new(size_t size) { void* p = cpp_alloc(size, false); return p; } inline void operator delete(void* p) __THROW { rho_free(p); } inline void* operator new[](size_t size) { void* p = cpp_alloc(size, false); return p; } inline void operator delete[](void* p) __THROW { rho_free(p); } /* #ifndef __NOTHROW_T_DEFINED #define __NOTHROW_T_DEFINED namespace std { struct nothrow_t {}; extern const nothrow_t nothrow; }; #endif //__NOTHROW_T_DEFINED */ inline void operator delete(void* p, const std::nothrow_t&) __THROW { rho_free(p); } inline void* operator new[](size_t size, const std::nothrow_t&) __THROW { void* p = cpp_alloc(size, true); return p; } inline void operator delete[](void* p, const std::nothrow_t&) __THROW { rho_free(p); } inline void* operator new(size_t size, const std::nothrow_t&) __THROW { void* p = cpp_alloc(size, true); return p; } #endif// __cplusplus #endif #endif //_RHO_NO_MEMDEFINES #else #define sys_free free //#endif// _WIN32_WCE #endif #endif // RHO_MEMORY__
/** * \file * * \brief SAMG55 clock configuration. * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_CLOCK_H_INCLUDED #define CONF_CLOCK_H_INCLUDED // ===== System Clock (MCK) Source Options //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_RC //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_XTAL //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_BYPASS //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_8M_RC //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_16M_RC //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_24M_RC //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_XTAL //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_BYPASS #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK // ===== System Clock (MCK) Prescaler Options (Fmck = Fsys / (SYSCLK_PRES)) #define CONFIG_SYSCLK_PRES SYSCLK_PRES_1 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_2 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_4 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_8 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_16 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_32 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_64 //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_3 // ===== PLL0 (A) Options (Fpll = (Fclk * PLL_mul) / PLL_div) // Use mul and div effective values here. #define CONFIG_PLL0_SOURCE PLL_SRC_SLCK_XTAL #define CONFIG_PLL0_MUL 3662 #define CONFIG_PLL0_DIV 1 // ===== Target frequency (System clock) // - External XTAL frequency: 32768Hz // - System clock source: SLCK XTAL // - System clock prescaler: 1 (divided by 1) // - PLLA source: SLCK_XTAL // - PLLA output: SLCK_XTAL * 3662 / 1 // - System clock: SLCK_XTAL * 3662 / 1 = 120MHz #endif /* CONF_CLOCK_H_INCLUDED */
/* * phy.h -- generic phy header file * * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com * * Author: Kishon Vijay Abraham I <kishon@ti.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifndef __DRIVERS_PHY_H #define __DRIVERS_PHY_H #include <linux/err.h> #include <of.h> #include <regulator.h> struct phy; /** * struct phy_ops - set of function pointers for performing phy operations * @init: operation to be performed for initializing phy * @exit: operation to be performed while exiting * @power_on: powering on the phy * @power_off: powering off the phy * @owner: the module owner containing the ops */ struct phy_ops { int (*init)(struct phy *phy); int (*exit)(struct phy *phy); int (*power_on)(struct phy *phy); int (*power_off)(struct phy *phy); struct usb_phy *(*to_usbphy)(struct phy *phy); }; /** * struct phy_attrs - represents phy attributes * @bus_width: Data path width implemented by PHY */ struct phy_attrs { u32 bus_width; }; /** * struct phy - represents the phy device * @dev: phy device * @id: id of the phy device * @ops: function pointers for performing phy operations * @mutex: mutex to protect phy_ops * @init_count: used to protect when the PHY is used by multiple consumers * @power_count: used to protect when the PHY is used by multiple consumers * @phy_attrs: used to specify PHY specific attributes */ struct phy { struct device_d dev; int id; const struct phy_ops *ops; int init_count; int power_count; struct phy_attrs attrs; struct regulator *pwr; }; /** * struct phy_provider - represents the phy provider * @dev: phy provider device * @owner: the module owner having of_xlate * @of_xlate: function pointer to obtain phy instance from phy pointer * @list: to maintain a linked list of PHY providers */ struct phy_provider { struct device_d *dev; struct list_head list; struct phy * (*of_xlate)(struct device_d *dev, struct of_phandle_args *args); }; /** * struct phy_consumer - represents the phy consumer * @dev_name: the device name of the controller that will use this PHY device * @port: name given to the consumer port */ struct phy_consumer { const char *dev_name; const char *port; }; /** * struct phy_init_data - contains the list of PHY consumers * @num_consumers: number of consumers for this PHY device * @consumers: list of PHY consumers */ struct phy_init_data { unsigned int num_consumers; struct phy_consumer *consumers; }; #define PHY_CONSUMER(_dev_name, _port) \ { \ .dev_name = _dev_name, \ .port = _port, \ } #define to_phy(dev) (container_of((dev), struct phy, dev)) #define of_phy_provider_register(dev, xlate) \ __of_phy_provider_register((dev), (xlate)) static inline void phy_set_drvdata(struct phy *phy, void *data) { phy->dev.priv = data; } static inline void *phy_get_drvdata(struct phy *phy) { return phy->dev.priv; } #if IS_ENABLED(CONFIG_GENERIC_PHY) int phy_init(struct phy *phy); int phy_exit(struct phy *phy); int phy_power_on(struct phy *phy); int phy_power_off(struct phy *phy); static inline int phy_get_bus_width(struct phy *phy) { return phy->attrs.bus_width; } static inline void phy_set_bus_width(struct phy *phy, int bus_width) { phy->attrs.bus_width = bus_width; } struct phy *phy_get(struct device_d *dev, const char *string); struct phy *phy_optional_get(struct device_d *dev, const char *string); struct phy *of_phy_get_by_phandle(struct device_d *dev, const char *phandle, u8 index); void phy_put(struct phy *phy); struct phy *of_phy_get(struct device_node *np, const char *con_id); struct phy *phy_create(struct device_d *dev, struct device_node *node, const struct phy_ops *ops); void phy_destroy(struct phy *phy); struct phy_provider *__of_phy_provider_register(struct device_d *dev, struct phy * (*of_xlate)(struct device_d *dev, struct of_phandle_args *args)); void of_phy_provider_unregister(struct phy_provider *phy_provider); struct usb_phy *phy_to_usbphy(struct phy *phy); struct phy *phy_get_by_index(struct device_d *dev, int index); #else static inline int phy_init(struct phy *phy) { if (!phy) return 0; return -ENOSYS; } static inline int phy_exit(struct phy *phy) { if (!phy) return 0; return -ENOSYS; } static inline int phy_power_on(struct phy *phy) { if (!phy) return 0; return -ENOSYS; } static inline int phy_power_off(struct phy *phy) { if (!phy) return 0; return -ENOSYS; } static inline int phy_get_bus_width(struct phy *phy) { return -ENOSYS; } static inline void phy_set_bus_width(struct phy *phy, int bus_width) { return; } static inline struct phy *phy_get(struct device_d *dev, const char *string) { return ERR_PTR(-ENOSYS); } static inline struct phy *phy_optional_get(struct device_d *dev, const char *string) { return ERR_PTR(-ENOSYS); } static inline struct phy *of_phy_get_by_phandle(struct device_d *dev, const char *phandle, u8 index) { return ERR_PTR(-ENOSYS); } static inline void phy_put(struct phy *phy) { } static inline struct phy *of_phy_get(struct device_node *np, const char *con_id) { return ERR_PTR(-ENOSYS); } static inline struct phy *phy_create(struct device_d *dev, struct device_node *node, const struct phy_ops *ops) { return ERR_PTR(-ENOSYS); } static inline void phy_destroy(struct phy *phy) { } static inline struct phy_provider *__of_phy_provider_register( struct device_d *dev, struct phy * (*of_xlate)( struct device_d *dev, struct of_phandle_args *args)) { return ERR_PTR(-ENOSYS); } static inline void of_phy_provider_unregister(struct phy_provider *phy_provider) { } static inline struct usb_phy *phy_to_usbphy(struct phy *phy) { return NULL; } static inline struct phy *phy_get_by_index(struct device_d *dev, int index) { return ERR_PTR(-ENODEV); } #endif #endif /* __DRIVERS_PHY_H */
/* This testcase is part of GDB, the GNU debugger. Copyright 2010-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <signal.h> #include <assert.h> #include <string.h> #include <unistd.h> #ifndef SA_SIGINFO # error "SA_SIGINFO is required for this test" #endif static int callme (void) { return 42; } static int pass (void) { return 1; } static int fail (void) { return 1; } static void handler (int sig, siginfo_t *siginfo, void *context) { assert (sig == SIGUSR1); assert (siginfo->si_signo == SIGUSR1); if (siginfo->si_pid == getpid ()) pass (); else fail (); } int main (void) { struct sigaction sa; int i; callme (); memset (&sa, 0, sizeof (sa)); sa.sa_sigaction = handler; sa.sa_flags = SA_SIGINFO; i = sigemptyset (&sa.sa_mask); assert (i == 0); i = sigaction (SIGUSR1, &sa, NULL); assert (i == 0); i = raise (SIGUSR1); assert (i == 0); sleep (600); return 0; }
#import <Foundation/Foundation.h> @interface TGModernCache : NSObject - (instancetype)initWithPath:(NSString *)path size:(NSUInteger)size; - (void)setValue:(NSData *)value forKey:(NSData *)key; - (void)getValueForKey:(NSData *)key completion:(void (^)(NSData *))completion; - (NSData *)getValueForKey:(NSData *)key; - (bool)containsValueForKey:(NSData *)key; @end
/* Copyright (c) 2000, 2001, 2005-2007 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include "myisamdef.h" /* ** Find current row with read on position or read on key ** If inx >= 0 find record using key ** Return values: ** 0 = Ok. ** HA_ERR_KEY_NOT_FOUND = Row is deleted ** HA_ERR_END_OF_FILE = End of file */ int mi_rsame(MI_INFO *info, uchar *record, int inx) { DBUG_ENTER("mi_rsame"); if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx)) { DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX); } if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED) { DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND); /* No current record */ } info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); /* Read row from data file */ if (fast_mi_readinfo(info)) DBUG_RETURN(my_errno); if (inx >= 0) { info->lastinx=inx; info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record, info->lastpos); if (info->s->concurrent_insert) rw_rdlock(&info->s->key_root_lock[inx]); VOID(_mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY, SEARCH_SAME, info->s->state.key_root[inx])); if (info->s->concurrent_insert) rw_unlock(&info->s->key_root_lock[inx]); } if (!(*info->read_record)(info,info->lastpos,record)) DBUG_RETURN(0); if (my_errno == HA_ERR_RECORD_DELETED) my_errno=HA_ERR_KEY_NOT_FOUND; DBUG_RETURN(my_errno); } /* mi_rsame */
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #if defined(_WIN32) || defined(_WIN64) || defined(__MWERKS__) #define IMF_TMP_DIR "" #else #define IMF_TMP_DIR "/var/tmp/" #endif