text
stringlengths 4
6.14k
|
|---|
/*
chronyd/chronyc - Programs for keeping computer clocks accurate.
**********************************************************************
* Copyright (C) Richard P. Curnow 1997-2002
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
**********************************************************************
=======================================================================
Header for pktlength.c, routines for working out the expected length
of a network command/reply packet.
*/
#ifndef GOT_PKTLENGTH_H
#define GOT_PKTLENGTH_H
#include "candm.h"
extern int PKL_CommandLength(CMD_Request *r);
extern int PKL_CommandPaddingLength(CMD_Request *r);
extern int PKL_ReplyLength(CMD_Reply *r);
#endif /* GOT_PKTLENGTH_H */
|
/*--------------------------------------------------------------------*/
/*--- User-mode execve. pub_core_ume.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2000-2015 Julian Seward
jseward@acm.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.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __PUB_CORE_UME_H
#define __PUB_CORE_UME_H
#include "pub_core_basics.h" // VG_ macro
//--------------------------------------------------------------------
// PURPOSE: This module implements user-mode execve, ie. program loading
// and exec'ing.
//--------------------------------------------------------------------
/*------------------------------------------------------------*/
/*--- Loading files ---*/
/*------------------------------------------------------------*/
// Info needed to load and run a program. IN/INOUT/OUT refers to the
// inputs/outputs of do_exec().
typedef
struct {
const HChar** argv; // IN: the original argv
Addr exe_base; // INOUT: lowest (allowed) address of exe
Addr exe_end; // INOUT: highest (allowed) address
#if !defined(VGO_darwin)
Addr phdr; // OUT: address phdr was mapped at
Int phnum; // OUT: number of phdrs
UInt stack_prot; // OUT: stack permissions
PtrdiffT interp_offset; // OUT: relocation offset for ld.so
#else
Addr stack_start; // OUT: address of start of stack segment (hot)
Addr stack_end; // OUT: address of end of stack segment (cold)
Addr text; // OUT: address of executable's Mach header
Bool dynamic; // OUT: False iff executable is static
HChar* executable_path; // OUT: path passed to execve()
#endif
#if defined(VGO_solaris)
Addr init_thrptr; // OUT: architecture-specific user per-thread location
Bool real_phdr_present; // OUT: PT_PHDR found, include phdr in auxv
Bool ldsoexec; // OUT: the program is the runtime linker itself
#endif
#if defined(VGO_linux)
// INOUT: architecture-specific ELF loading state
struct vki_arch_elf_state *arch_elf_state;
#endif
Addr entry; // OUT: entrypoint in main executable
Addr init_ip; // OUT: address of first instruction to execute
Addr brkbase; // OUT: base address of brk segment
Addr init_toc; // OUT: address of table-of-contents, on
// platforms for which that makes sense
// (ppc64-linux only)
// These are the extra args added by #! scripts
HChar* interp_name; // OUT: the interpreter name
HChar* interp_args; // OUT: the args for the interpreter
}
ExeInfo;
// Do a number of appropriate checks to see if the file looks executable by
// the kernel: ie. it's a file, it's readable and executable, and it's in
// either binary or "#!" format. On success, 'out_fd' gets the fd of the file
// if it's non-NULL. Otherwise the fd is closed.
extern SysRes VG_(pre_exec_check)(const HChar* exe_name, Int* out_fd,
Bool allow_setuid);
// Does everything short of actually running 'exe': finds the file,
// checks execute permissions, sets up interpreter if program is a script,
// reads headers, maps file into memory, and returns important info about
// the program.
extern Int VG_(do_exec)(const HChar* exe, ExeInfo* info);
#endif /* __PUB_CORE_UME_H */
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
|
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __REALMSOCKET_H__
#define __REALMSOCKET_H__
#include <ace/Synch_Traits.h>
#include <ace/Svc_Handler.h>
#include <ace/SOCK_Stream.h>
#include <ace/Message_Block.h>
#include <ace/Basic_Types.h>
class RealmSocket : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
{
private:
typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> Base;
public:
class Session
{
public:
Session(void);
virtual ~Session(void);
virtual void OnRead(void) = 0;
virtual void OnAccept(void) = 0;
virtual void OnClose(void) = 0;
};
RealmSocket(void);
virtual ~RealmSocket(void);
size_t recv_len(void) const;
bool recv_soft(char *buf, size_t len);
bool recv(char *buf, size_t len);
void recv_skip(size_t len);
bool send(const char *buf, size_t len);
const std::string& getRemoteAddress(void) const;
const uint16 getRemotePort(void) const;
virtual int open(void *);
virtual int close(int);
virtual int handle_input(ACE_HANDLE = ACE_INVALID_HANDLE);
virtual int handle_output(ACE_HANDLE = ACE_INVALID_HANDLE);
virtual int handle_close(ACE_HANDLE = ACE_INVALID_HANDLE, ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK);
void set_session(Session* session);
private:
ssize_t noblk_send(ACE_Message_Block &message_block);
ACE_Message_Block input_buffer_;
Session* session_;
std::string _remoteAddress;
uint16 _remotePort;
};
#endif /* __REALMSOCKET_H__ */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef ZVISION_MENU_H
#define ZVISION_MENU_H
#include "graphics/surface.h"
#include "common/rect.h"
#include "zvision/zvision.h"
#include "zvision/scripting/script_manager.h"
namespace ZVision {
enum menuBar {
kMenubarExit = 0x1,
kMenubarSettings = 0x2,
kMenubarRestore = 0x4,
kMenubarSave = 0x8,
kMenubarItems = 0x100,
kMenubarMagic = 0x200
};
class MenuHandler {
public:
MenuHandler(ZVision *engine);
virtual ~MenuHandler() {};
virtual void onMouseMove(const Common::Point &Pos) {};
virtual void onMouseDown(const Common::Point &Pos) {};
virtual void onMouseUp(const Common::Point &Pos) {};
virtual void process(uint32 deltaTimeInMillis) {};
void setEnable(uint16 flags) {
menuBarFlag = flags;
}
uint16 getEnable() {
return menuBarFlag;
}
protected:
uint16 menuBarFlag;
ZVision *_engine;
};
class MenuZGI: public MenuHandler {
public:
MenuZGI(ZVision *engine);
~MenuZGI();
void onMouseMove(const Common::Point &Pos);
void onMouseUp(const Common::Point &Pos);
void process(uint32 deltaTimeInMillis);
private:
Graphics::Surface menuback[3][2];
Graphics::Surface menubar[4][2];
Graphics::Surface *items[50][2];
uint itemId[50];
Graphics::Surface *magic[12][2];
uint magicId[12];
int menuMouseFocus;
bool inmenu;
int mouseOnItem;
bool scrolled[3];
int16 scrollPos[3];
bool clean;
bool redraw;
};
class MenuNemesis: public MenuHandler {
public:
MenuNemesis(ZVision *engine);
~MenuNemesis();
void onMouseMove(const Common::Point &Pos);
void onMouseUp(const Common::Point &Pos);
void process(uint32 deltaTimeInMillis);
private:
Graphics::Surface but[4][6];
Graphics::Surface menubar;
bool inmenu;
int mouseOnItem;
bool scrolled;
int16 scrollPos;
bool redraw;
int frm;
int16 delay;
};
}
#endif
|
// -*- C++ -*-
//=============================================================================
/**
* @file Sample_History.h
*
* $Id: Sample_History.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Carlos O'Ryan <coryan@uci.edu>
*/
//=============================================================================
#ifndef ACE_SAMPLE_HISTORY_H
#define ACE_SAMPLE_HISTORY_H
#include /**/ "ace/pre.h"
#include /**/ "ace/config-all.h"
#include "ace/Basic_Types.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Basic_Stats;
/// Save multiple samples in an array
/**
* Save multiple samples (usually latency numbers), into an array, and
* later print them in several formats.
*/
class ACE_Export ACE_Sample_History
{
public:
/// Constructor
/**
* The number of samples is pre-allocated, and cannot changes once
* the class is initialized.
*/
ACE_Sample_History (size_t max_samples);
/// Destructor
~ACE_Sample_History (void);
/// Record one sample.
/**
* Return 0 on success, -1 if the sample could not be stored
*/
int sample (ACE_UINT64 value);
/// Returns the maximum number of samples
size_t max_samples (void) const;
/// Returns the current number of samples
size_t sample_count (void) const;
/// Dump all the samples
/**
* Prints out all the samples, using @a msg as a prefix for each
* message.
*/
void dump_samples (const ACE_TCHAR *msg,
ACE_UINT32 scale_factor) const;
/// Collect the summary for all the samples
void collect_basic_stats (ACE_Basic_Stats &) const;
/// Get a sample
ACE_UINT64 get_sample (size_t i) const;
private:
/// The maximum number of samples
size_t max_samples_;
/// The current number of samples
size_t sample_count_;
/// The samples
ACE_UINT64 *samples_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/Sample_History.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
#endif /* ACE_SAMPLE_HISTORY_H */
|
// -*- C++ -*-
//=============================================================================
/**
* @file TLI.h
*
* $Id: TLI.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Doug Schmidt
*/
//=============================================================================
#ifndef ACE_TLI_H
#define ACE_TLI_H
#include /**/ "ace/pre.h"
#include "ace/config-lite.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/OS_TLI.h"
#if defined (ACE_HAS_TLI)
#include "ace/IPC_SAP.h"
#include "ace/Addr.h"
#include "ace/os_include/os_fcntl.h"
// There's not a universal device name for TLI devices. If the platform
// needs something other than /dev/tcp, it needs to be set up in the config.h
// file as ACE_TLI_TCP_DEVICE.
#ifndef ACE_TLI_TCP_DEVICE
#define ACE_TLI_TCP_DEVICE "/dev/tcp"
#endif
// There's not a universal device name for XTI/ATM devices. If the platform
// needs something other than /dev/xtisvc0, it needs to be set up in the
// config.h file as ACE_XTI_ATM_DEVICE. This may be FORE vendor specific and
// there may be no good default.
#ifndef ACE_XTI_ATM_DEVICE
#define ACE_XTI_ATM_DEVICE "/dev/xtisvc0"
#endif
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_TLI
*
* @brief Defines the member functions for the base class of the
* ACE_TLI abstraction.
*/
class ACE_Export ACE_TLI : public ACE_IPC_SAP
{
public:
// = Initialization and termination methods.
/// Initialize a TLI endpoint.
ACE_HANDLE open (const char device[],
int oflag = O_RDWR,
struct t_info *info = 0);
/// Close a TLI endpoint and release resources.
int close (void);
/// Set underlying protocol options.
int set_option (int level, int option, void *optval, int optlen);
/// Get underlying protocol options.
int get_option (int level, int option, void *optval, int &optlen);
// = Calls to underlying TLI operations.
int look (void) const;
int rcvdis (struct t_discon * = 0) const;
int snddis (struct t_call * = 0) const;
int sndrel (void) const;
int rcvrel (void) const;
/// Return our local endpoint address.
int get_local_addr (ACE_Addr &) const;
/// Dump the state of an object.
void dump (void) const;
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
protected:
// = Ensure we are an abstract class.
/// Default constructor.
ACE_TLI (void);
/// Destructor.
~ACE_TLI (void);
/// Initialize a TLI endpoint.
ACE_TLI (const char device[], int oflag = O_RDWR, struct t_info *info = 0);
private:
#if defined (ACE_HAS_SVR4_TLI)
// XTI/TLI option management.
struct t_optmgmt so_opt_req;
struct t_optmgmt so_opt_ret;
#endif /* ACE_HAS_SVR4_TLI */
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/TLI.inl"
#endif /* __ACE_INLINE__ */
#endif /* ACE_HAS_TLI */
#include /**/ "ace/post.h"
#endif /* ACE_TLI_H */
|
/*
* Copyright (c) 2007-2008 Atheros Communications, Inc.
* All rights reserved.
*
*/
#ifndef _HSL_DEV_H
#define _HSL_DEV_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "hsl_api.h"
#include "ssdk_init.h"
#define HSL_DEV_ID_CHECK(dev_id) \
do { \
if (dev_id >= SW_MAX_NR_DEV) \
return SW_OUT_OF_RANGE; \
} while (0)
typedef struct {
a_uint32_t dev_id;
a_uint8_t cpu_port_nr;
a_uint8_t nr_ports;
a_uint8_t nr_phy;
a_uint8_t nr_queue;
a_uint16_t nr_vlans;
a_bool_t hw_vlan_query;
hsl_acl_func_t acl_func;
hsl_init_mode cpu_mode;
} hsl_dev_t;
hsl_dev_t *hsl_dev_ptr_get(a_uint32_t dev_id);
hsl_acl_func_t *hsl_acl_ptr_get(a_uint32_t dev_id);
sw_error_t
hsl_dev_init(a_uint32_t dev_id, ssdk_init_cfg * cfg);
sw_error_t
hsl_dev_reduced_init(a_uint32_t dev_id, hsl_init_mode cpu_mode,
hsl_access_mode reg_mode);
sw_error_t
hsl_ssdk_cfg(a_uint32_t dev_id, ssdk_cfg_t *ssdk_cfg);
sw_error_t
hsl_dev_cleanup(void);
sw_error_t
hsl_access_mode_set(a_uint32_t dev_id, hsl_access_mode reg_mode);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _HSL_DEV_H */
|
/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
* GPL HEADER END
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2012, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
* /lnet/selftest/conrpc.h
*
* Console rpc
*
* Author: Liang Zhen <liang@whamcloud.com>
*/
#ifndef __LST_CONRPC_H__
#define __LST_CONRPC_H__
#ifdef __KERNEL__
#include <libcfs/libcfs.h>
#include <lnet/lnet.h>
#include <lnet/lib-types.h>
#include <lnet/lnetst.h>
#include "rpc.h"
#include "selftest.h"
/* Console rpc and rpc transaction */
#define LST_TRANS_TIMEOUT 30
#define LST_TRANS_MIN_TIMEOUT 3
#define LST_VALIDATE_TIMEOUT(t) MIN(MAX(t, LST_TRANS_MIN_TIMEOUT), LST_TRANS_TIMEOUT)
#define LST_PING_INTERVAL 8
struct lstcon_rpc_trans;
struct lstcon_tsb_hdr;
struct lstcon_test;
struct lstcon_node;
typedef struct lstcon_rpc {
struct list_head crp_link; /* chain on rpc transaction */
srpc_client_rpc_t *crp_rpc; /* client rpc */
struct lstcon_node *crp_node; /* destination node */
struct lstcon_rpc_trans *crp_trans; /* conrpc transaction */
unsigned int crp_posted:1; /* rpc is posted */
unsigned int crp_finished:1; /* rpc is finished */
unsigned int crp_unpacked:1; /* reply is unpacked */
/** RPC is embedded in other structure and can't free it */
unsigned int crp_embedded:1;
int crp_status; /* console rpc errors */
cfs_time_t crp_stamp; /* replied time stamp */
} lstcon_rpc_t;
typedef struct lstcon_rpc_trans {
/* link chain on owner list */
struct list_head tas_olink;
/* link chain on global list */
struct list_head tas_link;
/* operation code of transaction */
int tas_opc;
/* features mask is uptodate */
unsigned tas_feats_updated;
/* test features mask */
unsigned tas_features;
wait_queue_head_t tas_waitq; /* wait queue head */
atomic_t tas_remaining; /* # of un-scheduled rpcs */
struct list_head tas_rpcs_list; /* queued requests */
} lstcon_rpc_trans_t;
#define LST_TRANS_PRIVATE 0x1000
#define LST_TRANS_SESNEW (LST_TRANS_PRIVATE | 0x01)
#define LST_TRANS_SESEND (LST_TRANS_PRIVATE | 0x02)
#define LST_TRANS_SESQRY 0x03
#define LST_TRANS_SESPING 0x04
#define LST_TRANS_TSBCLIADD (LST_TRANS_PRIVATE | 0x11)
#define LST_TRANS_TSBSRVADD (LST_TRANS_PRIVATE | 0x12)
#define LST_TRANS_TSBRUN (LST_TRANS_PRIVATE | 0x13)
#define LST_TRANS_TSBSTOP (LST_TRANS_PRIVATE | 0x14)
#define LST_TRANS_TSBCLIQRY 0x15
#define LST_TRANS_TSBSRVQRY 0x16
#define LST_TRANS_STATQRY 0x21
typedef int (* lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *);
typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *,
lstcon_rpc_ent_t __user *);
int lstcon_sesrpc_prep(struct lstcon_node *nd, int transop,
unsigned version, lstcon_rpc_t **crpc);
int lstcon_dbgrpc_prep(struct lstcon_node *nd,
unsigned version, lstcon_rpc_t **crpc);
int lstcon_batrpc_prep(struct lstcon_node *nd, int transop, unsigned version,
struct lstcon_tsb_hdr *tsb, lstcon_rpc_t **crpc);
int lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned version,
struct lstcon_test *test, lstcon_rpc_t **crpc);
int lstcon_statrpc_prep(struct lstcon_node *nd, unsigned version,
lstcon_rpc_t **crpc);
void lstcon_rpc_put(lstcon_rpc_t *crpc);
int lstcon_rpc_trans_prep(struct list_head *translist,
int transop, lstcon_rpc_trans_t **transpp);
int lstcon_rpc_trans_ndlist(struct list_head *ndlist,
struct list_head *translist, int transop,
void *arg, lstcon_rpc_cond_func_t condition,
lstcon_rpc_trans_t **transpp);
void lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans,
lstcon_trans_stat_t *stat);
int lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
struct list_head __user *head_up,
lstcon_rpc_readent_func_t readent);
void lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error);
void lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans);
void lstcon_rpc_trans_addreq(lstcon_rpc_trans_t *trans, lstcon_rpc_t *req);
int lstcon_rpc_trans_postwait(lstcon_rpc_trans_t *trans, int timeout);
int lstcon_rpc_pinger_start(void);
void lstcon_rpc_pinger_stop(void);
void lstcon_rpc_cleanup_wait(void);
int lstcon_rpc_module_init(void);
void lstcon_rpc_module_fini(void);
#endif
#endif
|
/* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation
Version 1.0
RFCNB Utility Defines
Copyright (C) Richard Sharpe 1996
Copyright 2006 The FreeRADIUS server project
*/
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeradius-devel/ident.h>
RCSIDH(rfcnb_util_h, "$Id$")
void RFCNB_CvtPad_Name(char *name1, char *name2);
void RFCNB_AName_To_NBName(char *AName, char *NBName);
void RFCNB_NBName_To_AName(char *NBName, char *AName);
void RFCNB_Print_Hex(FILE *fd, struct RFCNB_Pkt *pkt, int Offset, int Len);
struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n);
void RFCNB_Print_Pkt(FILE *fd, char *dirn, struct RFCNB_Pkt *pkt, int len);
int RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP);
int RFCNB_Close(int socket);
int RFCNB_IP_Connect(struct in_addr Dest_IP, int port);
int RFCNB_Session_Req(struct RFCNB_Con *con,
char *Called_Name,
char *Calling_Name,
BOOL *redirect,
struct in_addr *Dest_IP,
int * port);
|
/*
* Apple MJPEG-B decoder
* Copyright (c) 2002 Alex Beregszaszi
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file mjpegbdec.c
* Apple MJPEG-B decoder.
*/
#include "avcodec.h"
#include "mjpeg.h"
#include "mjpegdec.h"
static int mjpegb_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
MJpegDecodeContext *s = avctx->priv_data;
const uint8_t *buf_end, *buf_ptr;
AVFrame *picture = data;
GetBitContext hgb; /* for the header */
uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
uint32_t field_size, sod_offs;
buf_ptr = buf;
buf_end = buf + buf_size;
read_header:
/* reset on every SOI */
s->restart_interval = 0;
s->restart_count = 0;
s->mjpb_skiptosod = 0;
init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8);
skip_bits(&hgb, 32); /* reserved zeros */
if (get_bits_long(&hgb, 32) != MKBETAG('m','j','p','g'))
{
av_log(avctx, AV_LOG_WARNING, "not mjpeg-b (bad fourcc)\n");
return 0;
}
field_size = get_bits_long(&hgb, 32); /* field size */
av_log(avctx, AV_LOG_DEBUG, "field size: 0x%x\n", field_size);
skip_bits(&hgb, 32); /* padded field size */
second_field_offs = get_bits_long(&hgb, 32);
av_log(avctx, AV_LOG_DEBUG, "second field offs: 0x%x\n", second_field_offs);
dqt_offs = get_bits_long(&hgb, 32);
av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%x\n", dqt_offs);
if (dqt_offs)
{
init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
s->start_code = DQT;
ff_mjpeg_decode_dqt(s);
}
dht_offs = get_bits_long(&hgb, 32);
av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%x\n", dht_offs);
if (dht_offs)
{
init_get_bits(&s->gb, buf_ptr+dht_offs, (buf_end - (buf_ptr+dht_offs))*8);
s->start_code = DHT;
ff_mjpeg_decode_dht(s);
}
sof_offs = get_bits_long(&hgb, 32);
av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%x\n", sof_offs);
if (sof_offs)
{
init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8);
s->start_code = SOF0;
if (ff_mjpeg_decode_sof(s) < 0)
return -1;
}
sos_offs = get_bits_long(&hgb, 32);
av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%x\n", sos_offs);
sod_offs = get_bits_long(&hgb, 32);
av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs);
if (sos_offs)
{
// init_get_bits(&s->gb, buf+sos_offs, (buf_end - (buf+sos_offs))*8);
init_get_bits(&s->gb, buf_ptr+sos_offs, field_size*8);
s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
s->start_code = SOS;
ff_mjpeg_decode_sos(s);
}
if (s->interlaced) {
s->bottom_field ^= 1;
/* if not bottom field, do not output image yet */
if (s->bottom_field != s->interlace_polarity && second_field_offs)
{
buf_ptr = buf + second_field_offs;
second_field_offs = 0;
goto read_header;
}
}
//XXX FIXME factorize, this looks very similar to the EOI code
*picture= s->picture;
*data_size = sizeof(AVFrame);
if(!s->lossless){
picture->quality= FFMAX3(s->qscale[0], s->qscale[1], s->qscale[2]);
picture->qstride= 0;
picture->qscale_table= s->qscale_table;
memset(picture->qscale_table, picture->quality, (s->width+15)/16);
if(avctx->debug & FF_DEBUG_QP)
av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", picture->quality);
picture->quality*= FF_QP2LAMBDA;
}
return buf_ptr - buf;
}
AVCodec mjpegb_decoder = {
"mjpegb",
CODEC_TYPE_VIDEO,
CODEC_ID_MJPEGB,
sizeof(MJpegDecodeContext),
ff_mjpeg_decode_init,
NULL,
ff_mjpeg_decode_end,
mjpegb_decode_frame,
CODEC_CAP_DR1,
NULL,
.long_name = "Apple MJPEG-B",
};
|
/** @file
* DBGF - Debugger Facility, selector interface partly shared with SELM.
*/
/*
* Copyright (C) 2006-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___VBox_vmm_dbgfsel_h
#define ___VBox_vmm_dbgfsel_h
#include <VBox/types.h>
#include <iprt/x86.h>
/** @addtogroup grp_dbgf
* @{ */
/**
* Selector information structure.
*/
typedef struct DBGFSELINFO
{
/** The base address.
* For gate descriptors, this is the target address. */
RTGCPTR GCPtrBase;
/** The limit (-1).
* For gate descriptors, this is set to zero. */
RTGCUINTPTR cbLimit;
/** The raw descriptor. */
union
{
X86DESC Raw;
X86DESC64 Raw64;
} u;
/** The selector. */
RTSEL Sel;
/** The target selector for a gate.
* This is 0 if non-gate descriptor. */
RTSEL SelGate;
/** Flags. */
uint32_t fFlags;
} DBGFSELINFO;
/** Pointer to a SELM selector information struct. */
typedef DBGFSELINFO *PDBGFSELINFO;
/** Pointer to a const SELM selector information struct. */
typedef const DBGFSELINFO *PCDBGFSELINFO;
/** @name DBGFSELINFO::fFlags
* @{ */
/** The CPU is in real mode. */
#define DBGFSELINFO_FLAGS_REAL_MODE RT_BIT_32(0)
/** The CPU is in protected mode. */
#define DBGFSELINFO_FLAGS_PROT_MODE RT_BIT_32(1)
/** The CPU is in long mode. */
#define DBGFSELINFO_FLAGS_LONG_MODE RT_BIT_32(2)
/** The selector is a hyper selector. */
#define DBGFSELINFO_FLAGS_HYPER RT_BIT_32(3)
/** The selector is a gate selector. */
#define DBGFSELINFO_FLAGS_GATE RT_BIT_32(4)
/** The selector is invalid. */
#define DBGFSELINFO_FLAGS_INVALID RT_BIT_32(5)
/** The selector not present. */
#define DBGFSELINFO_FLAGS_NOT_PRESENT RT_BIT_32(6)
/** @} */
/**
* Tests whether the selector info describes an expand-down selector or now.
*
* @returns true / false.
* @param pSelInfo The selector info.
*/
DECLINLINE(bool) DBGFSelInfoIsExpandDown(PCDBGFSELINFO pSelInfo)
{
return (pSelInfo)->u.Raw.Gen.u1DescType
&& ((pSelInfo)->u.Raw.Gen.u4Type & (X86_SEL_TYPE_DOWN | X86_SEL_TYPE_CODE)) == X86_SEL_TYPE_DOWN;
}
VMMR3DECL(int) DBGFR3SelInfoValidateCS(PCDBGFSELINFO pSelInfo, RTSEL SelCPL);
/** @} */
#endif
|
/* MIPS16 syscall wrappers.
Copyright (C) 2013-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
#include <mips16-syscall.h>
#undef __mips16_syscall4
long long __nomips16
__mips16_syscall4 (long a0, long a1, long a2, long a3,
long number)
{
union __mips16_syscall_return ret;
ret.reg.v0 = INTERNAL_SYSCALL_MIPS16 (number, ret.reg.v1, 4,
a0, a1, a2, a3);
return ret.val;
}
|
/*
* Copyright 2008-2013 Various Authors
* Copyright 2005 Timo Hirvonen
*
* 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 "file.h"
#include "xmalloc.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
ssize_t read_all(int fd, void *buf, size_t count)
{
char *buffer = buf;
ssize_t pos = 0;
do {
ssize_t rc;
rc = read(fd, buffer + pos, count - pos);
if (rc == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
return -1;
}
if (rc == 0) {
/* eof */
break;
}
pos += rc;
} while (count - pos > 0);
return pos;
}
ssize_t write_all(int fd, const void *buf, size_t count)
{
const char *buffer = buf;
int count_save = count;
do {
int rc;
rc = write(fd, buffer, count);
if (rc == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
return -1;
}
buffer += rc;
count -= rc;
} while (count > 0);
return count_save;
}
char *mmap_file(const char *filename, ssize_t *size)
{
struct stat st;
char *buf;
int fd;
fd = open(filename, O_RDONLY);
if (fd == -1)
goto err;
if (fstat(fd, &st) == -1)
goto close_err;
/* can't mmap empty files */
buf = NULL;
if (st.st_size) {
buf = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (buf == MAP_FAILED)
goto close_err;
}
close(fd);
*size = st.st_size;
return buf;
close_err:
close(fd);
err:
*size = -1;
return NULL;
}
void buffer_for_each_line(const char *buf, int size,
int (*cb)(void *data, const char *line),
void *data)
{
char *line = NULL;
int line_size = 0, pos = 0;
while (pos < size) {
int end, len;
end = pos;
while (end < size && buf[end] != '\n')
end++;
len = end - pos;
if (end > pos && buf[end - 1] == '\r')
len--;
if (len >= line_size) {
line_size = len + 1;
line = xrenew(char, line, line_size);
}
memcpy(line, buf + pos, len);
line[len] = 0;
pos = end + 1;
if (cb(data, line))
break;
}
free(line);
}
void buffer_for_each_line_reverse(const char *buf, int size,
int (*cb)(void *data, const char *line),
void *data)
{
char *line = NULL;
int line_size = 0, end = size - 1;
while (end >= 0) {
int pos, len;
if (end > 1 && buf[end] == '\n' && buf[end - 1] == '\r')
end--;
pos = end;
while (pos > 0 && buf[pos - 1] != '\n')
pos--;
len = end - pos;
if (len >= line_size) {
line_size = len + 1;
line = xrenew(char, line, line_size);
}
memcpy(line, buf + pos, len);
line[len] = 0;
end = pos - 1;
if (cb(data, line))
break;
}
free(line);
}
int file_for_each_line(const char *filename,
int (*cb)(void *data, const char *line),
void *data)
{
char *buf;
ssize_t size;
buf = mmap_file(filename, &size);
if (size == -1)
return -1;
if (buf) {
buffer_for_each_line(buf, size, cb, data);
munmap(buf, size);
}
return 0;
}
|
/* Zero store backend
Copyright (C) 1995,96,97,99,2000,01, 02 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
The GNU Hurd 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, USA. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sys/mman.h>
#include "store.h"
static error_t
zero_read (struct store *store,
store_offset_t addr, size_t index, size_t amount, void **buf,
size_t *len)
{
if (*len < amount)
{
*buf = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
if (*buf == MAP_FAILED)
return errno;
*len = amount;
return 0;
}
else
memset (*buf, 0, amount);
*len = amount;
return 0;
}
static error_t
zero_write (struct store *store,
store_offset_t addr, size_t index, const void *buf, size_t len,
size_t *amount)
{
return 0;
}
static error_t
zero_set_size (struct store *store, size_t newsize)
{
return EOPNOTSUPP;
}
/* Modify SOURCE to reflect those runs in RUNS, and return it in STORE. */
error_t
zero_remap (struct store *source,
const struct store_run *runs, size_t num_runs,
struct store **store)
{
/* Because all blocks are the same, a zero store always contains just one
run; here we simply count up the number of blocks specified by RUNS, and
modify SOURCE's one run to reflect that. */
int i;
store_offset_t length = 0, old_length = source->runs[0].length;
for (i = 0; i < num_runs; i++)
if (runs[i].start < 0 || runs[i].start + runs[i].length >= old_length)
return EINVAL;
else
length += runs[i].length;
source->runs[0].length = length;
*store = source;
return 0;
}
error_t
zero_allocate_encoding (const struct store *store, struct store_enc *enc)
{
enc->num_ints += 2;
enc->num_offsets += 1;
return 0;
}
error_t
zero_encode (const struct store *store, struct store_enc *enc)
{
enc->ints[enc->cur_int++] = store->class->id;
enc->ints[enc->cur_int++] = store->flags;
enc->offsets[enc->cur_offset++] = store->size;
return 0;
}
error_t
zero_decode (struct store_enc *enc, const struct store_class *const *classes,
struct store **store)
{
store_offset_t size;
int type, flags;
if (enc->cur_int + 2 > enc->num_ints
|| enc->cur_offset + 1 > enc->num_offsets)
return EINVAL;
type = enc->ints[enc->cur_int++];
flags = enc->ints[enc->cur_int++];
size = enc->offsets[enc->cur_offset++];
return store_zero_create (size, flags, store);
}
static error_t
zero_open (const char *name, int flags,
const struct store_class *const *classes,
struct store **store)
{
if (name)
{
char *end;
store_offset_t size = strtoull (name, &end, 0);
if (end == name || end == NULL)
return EINVAL;
switch (*end)
{
case 'b':
size *= 512;
break;
case 'k':
case 'K':
size *= 1024;
break;
case 'm':
case 'M':
size *= 1024 * 1024;
break;
case 'g':
case 'G':
size *= 1024 * 1024 * 1024;
break;
}
return store_zero_create (size, flags, store);
}
else
{
store_offset_t max_offs = ~((store_offset_t)1
<< (CHAR_BIT * sizeof (store_offset_t) - 1));
return store_zero_create (max_offs, flags, store);
}
}
static error_t
zero_validate_name (const char *name, const struct store_class *const *classes)
{
if (name)
{
char *end;
strtoul (name, &end, 0);
return end == name ? EINVAL : 0;
}
else
return 0; /* `maximum size' */
}
static error_t
zero_map (const struct store *store, vm_prot_t prot, mach_port_t *memobj)
{
*memobj = MACH_PORT_NULL;
return 0;
}
const struct store_class
store_zero_class =
{
STORAGE_ZERO, "zero", zero_read, zero_write, zero_set_size,
zero_allocate_encoding, zero_encode, zero_decode,
0, 0, 0, 0, zero_remap, zero_open, zero_validate_name,
zero_map
};
STORE_STD_CLASS (zero);
/* Return a new zero store SIZE bytes long in STORE. */
error_t
store_zero_create (store_offset_t size, int flags, struct store **store)
{
struct store_run run = { 0, size };
return
_store_create (&store_zero_class, MACH_PORT_NULL,
flags | STORE_INNOCUOUS, 1, &run, 1, 0, store);
}
|
#pragma once
#include "levinson.h"
//void promicro_bootloader_jmp(bool program);
#include "quantum.h"
#ifdef USE_I2C
#include <stddef.h>
#ifdef __AVR__
#include <avr/io.h>
#include <avr/interrupt.h>
#endif
#endif
#define LAYOUT( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ L30, L31, L32, L33, L34, L35 }, \
{ R05, R04, R03, R02, R01, R00 }, \
{ R15, R14, R13, R12, R11, R10 }, \
{ R25, R24, R23, R22, R21, R20 }, \
{ R35, R34, R33, R32, R31, R30 } \
}
#define LAYOUT_ortho_4x12 LAYOUT
|
/*
* Point.h
*
* Author: ROBOTIS
*
*/
#ifndef _POINT_H_
#define _POINT_H_
namespace Robot
{
class Point2D
{
private:
protected:
public:
double X;
double Y;
Point2D();
Point2D(double x, double y);
Point2D(const Point2D &point);
~Point2D();
static double Distance(Point2D &pt1, Point2D &pt2);
Point2D & operator = (const Point2D &point);
Point2D & operator += (const Point2D &point);
Point2D & operator -= (const Point2D &point);
Point2D & operator += (double value);
Point2D & operator -= (double value);
Point2D & operator *= (double value);
Point2D & operator /= (double value);
Point2D operator + (const Point2D &point);
Point2D operator - (const Point2D &point);
Point2D operator + (double value) const;
Point2D operator - (double value) const;
Point2D operator * (double value) const;
Point2D operator / (double value) const;
};
class Point3D
{
private:
protected:
public:
double X;
double Y;
double Z;
Point3D();
Point3D(double x, double y, double z);
Point3D(const Point3D &point);
~Point3D();
static double Distance(Point3D &pt1, Point3D &pt2);
Point3D & operator = (Point3D &point);
Point3D & operator += (Point3D &point);
Point3D & operator -= (Point3D &point);
Point3D & operator += (double value);
Point3D & operator -= (double value);
Point3D & operator *= (double value);
Point3D & operator /= (double value);
Point3D operator + (Point3D &point);
Point3D operator - (Point3D &point);
Point3D operator + (double value);
Point3D operator - (double value);
Point3D operator * (double value);
Point3D operator / (double value);
};
}
#endif
|
// 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 CONTENT_PUBLIC_COMMON_URL_FETCHER_H_
#define CONTENT_PUBLIC_COMMON_URL_FETCHER_H_
#include "base/optional.h"
#include "content/common/content_export.h"
namespace net {
class URLFetcher;
} // namespace
namespace url {
class Origin;
} // namespace
namespace content {
// Mark URLRequests started by the URLFetcher to stem from the given render
// frame.
CONTENT_EXPORT void AssociateURLFetcherWithRenderFrame(
net::URLFetcher* url_fetcher,
const base::Optional<url::Origin>& initiator,
int render_process_id,
int render_frame_id);
} // namespace content
#endif // CONTENT_PUBLIC_COMMON_URL_FETCHER_H_
|
/*
Fontname: -Adobe-Courier-Bold-R-Normal--14-100-100-100-M-90-ISO10646-1
Copyright: Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
Capital A Height: 9, '1' Height: 10
Calculated Max Values w=10 h=13 x= 3 y= 7 dx= 9 dy= 0 ascent=11 len=20
Font Bounding box w=13 h=21 x=-2 y=-6
Calculated Min Values x=-1 y=-3 dx= 0 dy= 0
Pure Font ascent = 9 descent=-3
X Font ascent =10 descent=-3
Max Font ascent =11 descent=-3
*/
#include "u8g.h"
const u8g_fntpgm_uint8_t u8g_font_courB10r[1551] U8G_FONT_SECTION("u8g_font_courB10r") = {
0,13,21,254,250,9,1,222,4,32,32,127,253,11,253,10,
253,0,0,0,9,0,1,2,9,9,9,3,0,192,192,192,
192,192,128,0,192,192,5,4,4,9,2,6,216,216,216,72,
7,11,11,9,1,255,40,40,40,254,40,40,254,40,40,40,
40,6,12,12,9,1,255,48,48,124,204,192,240,60,12,204,
248,48,48,7,10,10,9,1,0,96,144,146,108,16,96,152,
36,36,24,7,8,8,9,1,0,56,96,96,48,122,204,204,
118,2,4,4,9,3,5,192,192,192,64,4,11,11,9,2,
254,48,96,96,192,192,192,192,192,96,96,48,4,11,11,9,
2,254,192,96,96,48,48,48,48,48,96,96,192,5,5,5,
9,2,4,32,168,248,112,216,7,7,7,9,1,1,16,16,
16,254,16,16,16,3,4,4,9,2,254,96,96,192,128,6,
1,1,9,1,4,252,2,2,2,9,3,0,192,192,7,12,
12,9,0,254,6,6,12,12,24,24,48,48,96,96,192,192,
7,10,10,9,1,0,56,108,198,198,198,198,198,198,108,56,
6,10,10,9,2,0,48,240,48,48,48,48,48,48,48,252,
6,10,10,9,1,0,120,204,204,12,12,24,48,96,192,252,
6,10,10,9,1,0,120,204,12,12,56,12,12,12,204,120,
7,10,10,9,1,0,12,28,60,44,76,204,140,254,12,30,
6,10,10,9,1,0,252,192,192,248,204,12,12,12,204,120,
6,10,10,9,1,0,60,96,192,216,236,204,204,204,204,120,
6,10,10,9,1,0,252,140,12,24,24,24,24,48,48,48,
6,10,10,9,1,0,120,204,204,204,120,204,204,204,204,120,
6,10,10,9,1,0,120,204,204,204,204,204,124,12,24,240,
2,7,7,9,3,0,192,192,0,0,0,192,192,3,9,9,
9,2,254,96,96,0,0,0,96,96,192,128,8,7,7,9,
0,1,7,28,112,192,112,28,7,7,4,4,9,1,2,254,
0,0,254,8,7,7,9,1,1,224,56,14,3,14,56,224,
6,9,9,9,1,0,248,204,140,12,56,48,0,48,48,7,
9,9,9,1,0,120,196,156,180,164,180,158,192,120,9,9,
18,9,0,0,124,0,28,0,54,0,54,0,34,0,99,0,
127,0,99,0,247,128,8,9,9,9,0,0,254,99,99,99,
126,99,99,99,254,7,9,9,9,1,0,58,102,198,192,192,
192,192,102,60,8,9,9,9,0,0,252,102,99,99,99,99,
99,102,252,8,9,9,9,0,0,255,99,99,104,120,104,99,
99,255,8,9,9,9,0,0,255,99,99,104,120,104,96,96,
248,9,9,18,9,0,0,61,0,103,0,195,0,192,0,192,
0,207,128,195,0,99,0,63,0,9,9,18,9,0,0,247,
128,99,0,99,0,99,0,127,0,99,0,99,0,99,0,247,
128,6,9,9,9,1,0,252,48,48,48,48,48,48,48,252,
9,9,18,9,0,0,31,128,6,0,6,0,6,0,6,0,
198,0,198,0,198,0,124,0,9,9,18,9,0,0,247,0,
102,0,108,0,120,0,124,0,102,0,102,0,99,0,243,128,
8,9,9,9,0,0,248,96,96,96,96,99,99,99,255,9,
9,18,9,0,0,227,128,99,0,119,0,119,0,107,0,107,
0,99,0,99,0,247,128,9,9,18,9,0,0,231,128,99,
0,115,0,115,0,107,0,107,0,103,0,103,0,243,0,8,
9,9,9,0,0,60,102,195,195,195,195,195,102,60,8,9,
9,9,0,0,254,99,99,99,102,124,96,96,248,8,11,11,
9,0,254,60,102,195,195,195,195,195,102,60,25,110,9,9,
18,9,0,0,254,0,99,0,99,0,99,0,102,0,124,0,
102,0,99,0,243,128,7,9,9,9,1,0,122,206,198,224,
124,14,198,230,188,8,9,9,9,0,0,255,219,219,24,24,
24,24,24,60,9,9,18,9,0,0,247,128,99,0,99,0,
99,0,99,0,99,0,99,0,99,0,62,0,9,9,18,9,
0,0,247,128,99,0,99,0,99,0,54,0,54,0,54,0,
28,0,28,0,9,9,18,9,0,0,247,128,99,0,107,0,
107,0,107,0,119,0,119,0,99,0,99,0,8,9,9,9,
0,0,231,102,102,60,24,60,102,102,231,10,9,18,9,255,
0,243,192,97,128,51,0,51,0,30,0,12,0,12,0,12,
0,63,0,7,9,9,9,1,0,254,198,204,24,24,48,102,
198,254,4,11,11,9,2,254,240,192,192,192,192,192,192,192,
192,192,240,7,12,12,9,1,254,192,192,96,96,48,48,24,
24,12,12,6,6,4,11,11,9,2,254,240,48,48,48,48,
48,48,48,48,48,240,5,4,4,9,2,5,32,112,216,136,
9,1,2,9,0,254,255,128,3,2,2,9,2,7,192,96,
8,7,7,9,0,0,124,6,6,126,198,206,119,8,10,10,
9,0,0,224,96,96,110,115,99,99,99,115,238,8,7,7,
9,0,0,61,103,195,192,192,99,62,8,10,10,9,0,0,
14,6,6,118,206,198,198,198,206,119,8,7,7,9,0,0,
60,102,195,255,192,103,62,7,10,10,9,1,0,30,48,48,
252,48,48,48,48,48,252,8,10,10,9,0,253,119,206,198,
198,198,206,118,6,6,124,9,10,20,9,0,0,224,0,96,
0,96,0,110,0,115,0,99,0,99,0,99,0,99,0,247,
128,6,10,10,9,1,0,48,48,0,240,48,48,48,48,48,
252,5,13,13,9,1,253,24,24,0,120,24,24,24,24,24,
24,24,24,240,8,10,10,9,0,0,224,96,96,103,108,120,
120,108,102,231,6,10,10,9,1,0,240,48,48,48,48,48,
48,48,48,252,9,7,14,9,0,0,223,0,109,128,109,128,
109,128,109,128,109,128,237,128,9,7,14,9,0,0,238,0,
115,0,99,0,99,0,99,0,99,0,247,128,8,7,7,9,
0,0,60,102,195,195,195,102,60,8,10,10,9,0,253,238,
115,99,99,99,115,110,96,96,240,8,10,10,9,0,253,119,
206,198,198,198,206,118,6,6,15,7,7,7,9,1,0,238,
112,96,96,96,96,252,7,7,7,9,1,0,126,198,192,124,
6,198,252,7,9,9,9,1,0,96,96,252,96,96,96,96,
102,60,9,7,14,9,0,0,231,0,99,0,99,0,99,0,
99,0,103,0,59,128,9,7,14,9,0,0,247,128,99,0,
99,0,54,0,54,0,28,0,28,0,10,7,14,9,255,0,
225,192,109,128,109,128,109,128,45,0,51,0,51,0,8,7,
7,9,0,0,231,102,60,24,60,102,231,9,10,20,9,0,
253,227,128,99,0,99,0,54,0,54,0,28,0,28,0,24,
0,24,0,124,0,6,7,7,9,1,0,252,140,24,48,96,
196,252,4,11,11,9,2,254,48,96,96,96,96,192,96,96,
96,96,48,2,11,11,9,3,254,192,192,192,192,192,192,192,
192,192,192,192,4,11,11,9,2,254,192,96,96,96,96,48,
96,96,96,96,192,6,3,3,9,1,3,100,252,152,255};
|
/*****************************************************************************
** $Source: /cygdrive/d/Private/_SVNROOT/bluemsx/blueMSX/Src/Input/MsxMouse.h,v $
**
** $Revision: 1.3 $
**
** $Date: 2008-03-30 18:38:40 $
**
** More info: http://www.bluemsx.com
**
** Copyright (C) 2003-2006 Daniel Vik
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
******************************************************************************
*/
#ifndef MSX_MOUSE_H
#define MSX_MOUSE_H
#include "MsxTypes.h"
#include "MsxJoystickDevice.h"
typedef struct MsxMouse MsxMouse;
MsxJoystickDevice* msxMouseCreate();
#endif
|
/* ////////////////////////////////////////////////////////////
File Name: yswin32bitmap.h
Copyright (c) 2015 Soji Yamakawa. All rights reserved.
http://www.ysflight.com
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//////////////////////////////////////////////////////////// */
#ifndef YSBITMAPWIN___IS_INCLUDED
#define YSBITMAPWIN___IS_INCLUDED
/* { */
#include "ysbitmap.h"
HBITMAP YsCreateWin32BitmapFromYsBitmap(HDC bmpDc,const YsBitmap &ysBmp); // HDC bmpDc must be created by CreateCompatibleDC
/* } */
#endif
|
#include <verifier-builtins.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TRIGGER_INV_BUG 1
#define DLL_NULL ((dll_item_t *) 0)
typedef struct dll dll_t;
typedef struct dll_item dll_item_t;
struct dll {
size_t size;
dll_item_t *beg;
dll_item_t *end;
};
struct dll_item {
dll_item_t *next;
dll_item_t *prev;
};
#define DLL_ASSERT_NON_EMPTY(list) \
assert(!dll_empty(list))
#define DLL_DIE do { \
/* this call should never return */ \
dll_die(__FUNCTION__); \
abort(); \
} while (0)
#define DLL_ZNEW(type) \
((type *) calloc(1, sizeof(type)))
#define DLL_SET_IF_NULL(dst, src) \
if (!(dst)) dst = (src)
void dll_die(const char *msg)
{
#if VERBOSE
fprintf(stderr, "!!! %s\n", msg);
#else
(void) msg;
#endif
abort();
}
static dll_item_t* create_item(void)
{
dll_item_t *item = DLL_ZNEW(dll_item_t);
if (!item)
DLL_DIE;
return item;
}
void dll_init(dll_t *list)
{
memset(list, '\0', sizeof *list);
}
void dll_destroy(dll_t *list)
{
/* destroy items in reverse order */
dll_item_t *item = list->end;
while (item) {
dll_item_t *prev = item->prev;
free(item);
item = prev;
}
dll_init(list);
}
int dll_empty(dll_t *list)
{
return !(list->beg);
}
size_t dll_size(dll_t *list)
{
return list->size;
}
dll_item_t* dll_beg(dll_t *list)
{
return list->beg;
}
dll_item_t* dll_end(dll_t *list)
{
return list->end;
}
dll_item_t* dll_next(dll_item_t *item)
{
return item->next;
}
dll_item_t* dll_prev(dll_item_t *item)
{
return item->prev;
}
dll_item_t* dll_push_back(dll_t *list)
{
dll_item_t *item = create_item();
if ((item->prev = list->end))
item->prev->next = item;
DLL_SET_IF_NULL(list->beg, item);
list->end = item;
list->size ++;
return item;
}
dll_item_t* dll_push_front(dll_t *list)
{
dll_item_t *item = create_item();
if ((item->next = list->beg))
item->next->prev = item;
list->beg = item;
DLL_SET_IF_NULL(list->end, item);
list->size ++;
return item;
}
void dll_pop_back(dll_t *list)
{
DLL_ASSERT_NON_EMPTY(list);
dll_item_t *item = list->end;
if ((list->end = item->prev))
list->end->next = DLL_NULL;
else
list->beg = DLL_NULL;
list->size --;
free(item);
}
void dll_pop_front(dll_t *list)
{
DLL_ASSERT_NON_EMPTY(list);
dll_item_t *item = list->beg;
if ((list->beg = item->next))
list->beg->prev = DLL_NULL;
else
list->end = DLL_NULL;
list->size --;
free(item);
}
dll_item_t* dll_insert_after(dll_t *list, dll_item_t *item)
{
dll_item_t *new_item = create_item();
new_item->next = item->next;
new_item->prev = item;
if (item->next)
item->next->prev = new_item;
else
list->end = new_item;
item->next = new_item;
list->size ++;
return new_item;
}
dll_item_t* dll_insert_before(dll_t *list, dll_item_t *item)
{
dll_item_t *new_item = create_item();
new_item->next = item;
new_item->prev = item->prev;
if (item->prev)
item->prev->next = new_item;
else
list->beg = new_item;
item->prev = new_item;
list->size ++;
return new_item;
}
void dll_remove(dll_t *list, dll_item_t *item)
{
if (!item)
return;
if (item->next)
item->next->prev = item->prev;
else
list->end = item->prev;
if (item->prev)
item->prev->next = item->next;
else
list->beg = item->next;
list->size --;
free(item);
}
#ifndef VERBOSE
# define VERBOSE 0
#endif
static void chk_msg(const char *msg)
{
#if VERBOSE
fprintf(stderr, "--- checking: %s\n", msg);
#else
(void) msg;
#endif
}
static void chk_dll_size(dll_t *list, size_t size)
{
(void) list;
(void) size;
}
int main()
{
chk_msg("dll_init");
dll_t list;
dll_init(&list);
chk_dll_size(&list, 0);
chk_msg("dll_push_back");
dll_push_back(&list);
chk_dll_size(&list, 1);
chk_msg("dll_push_front");
dll_push_front(&list);
chk_dll_size(&list, 2);
chk_msg("dll_destroy");
dll_destroy(&list);
chk_dll_size(&list, 0);
chk_msg("dll_push_front");
dll_push_front(&list);
chk_dll_size(&list, 1);
chk_msg("dll_pop_back");
dll_pop_back(&list);
chk_dll_size(&list, 0);
chk_msg("dll_destroy");
dll_destroy(&list);
chk_dll_size(&list, 0);
chk_msg("dll_destroy");
dll_destroy(&list);
chk_dll_size(&list, 0);
chk_msg("dll_push_back");
dll_item_t *item = dll_push_back(&list);
chk_dll_size(&list, 1);
chk_msg("dll_insert_before");
item = dll_insert_before(&list, item);
chk_dll_size(&list, 2);
chk_msg("dll_insert_after");
item = dll_insert_after(&list, item);
chk_dll_size(&list, 3);
#if TRIGGER_INV_BUG
chk_msg("dll_remove");
dll_remove(&list, dll_next(dll_prev(dll_prev(dll_end(&list)))));
chk_dll_size(&list, 2);
#endif
chk_msg("dll_pop_front");
dll_pop_front(&list);
chk_dll_size(&list, 1);
#if TRIGGER_INV_BUG
chk_msg("dll_remove");
dll_remove(&list, dll_beg(&list));
chk_dll_size(&list, 0);
#endif
__VERIFIER_plot(NULL);
return 0;
}
/**
* @file test-0174.c
*
* @brief modification of test-0014 using calloc() and memset()
*
* @attention
* This description is automatically imported from tests/predator-regre/README.
* Any changes made to this comment will be thrown away on the next import.
*/
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "36331-c10.asn"
* `asn1c -S /usr/local/share/asn1c -fcompound-names -fskeletons-copy -gen-PER`
*/
#include "CSI-ProcessToReleaseList-r11.h"
static asn_per_constraints_t asn_PER_type_CSI_ProcessToReleaseList_r11_constr_1 GCC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_CSI_ProcessToReleaseList_r11_1[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
0,
&asn_DEF_CSI_ProcessId_r11,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
""
},
};
static ber_tlv_tag_t asn_DEF_CSI_ProcessToReleaseList_r11_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_CSI_ProcessToReleaseList_r11_specs_1 = {
sizeof(struct CSI_ProcessToReleaseList_r11),
offsetof(struct CSI_ProcessToReleaseList_r11, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
asn_TYPE_descriptor_t asn_DEF_CSI_ProcessToReleaseList_r11 = {
"CSI-ProcessToReleaseList-r11",
"CSI-ProcessToReleaseList-r11",
SEQUENCE_OF_free,
SEQUENCE_OF_print,
SEQUENCE_OF_constraint,
SEQUENCE_OF_decode_ber,
SEQUENCE_OF_encode_der,
SEQUENCE_OF_decode_xer,
SEQUENCE_OF_encode_xer,
SEQUENCE_OF_decode_uper,
SEQUENCE_OF_encode_uper,
0, /* Use generic outmost tag fetcher */
asn_DEF_CSI_ProcessToReleaseList_r11_tags_1,
sizeof(asn_DEF_CSI_ProcessToReleaseList_r11_tags_1)
/sizeof(asn_DEF_CSI_ProcessToReleaseList_r11_tags_1[0]), /* 1 */
asn_DEF_CSI_ProcessToReleaseList_r11_tags_1, /* Same as above */
sizeof(asn_DEF_CSI_ProcessToReleaseList_r11_tags_1)
/sizeof(asn_DEF_CSI_ProcessToReleaseList_r11_tags_1[0]), /* 1 */
&asn_PER_type_CSI_ProcessToReleaseList_r11_constr_1,
asn_MBR_CSI_ProcessToReleaseList_r11_1,
1, /* Single element */
&asn_SPC_CSI_ProcessToReleaseList_r11_specs_1 /* Additional specs */
};
|
/*
* ARM11MPCore internal peripheral emulation.
*
* Copyright (c) 2006-2007 CodeSourcery.
* Written by Paul Brook
*
* This code is licensed under the GPL.
*/
/* ??? The MPCore TRM says the on-chip controller has 224 external IRQ lines
(+ 32 internal). However my test chip only exposes/reports 32.
More importantly Linux falls over if more than 32 are present! */
#define GIC_NIRQ 64
#include "mpcore.c"
/* Dummy PIC to route IRQ lines. The baseboard has 4 independent IRQ
controllers. The output of these, plus some of the raw input lines
are fed into a single SMP-aware interrupt controller on the CPU. */
typedef struct {
SysBusDevice busdev;
SysBusDevice *priv;
qemu_irq cpuic[32];
qemu_irq rvic[4][64];
uint32_t num_cpu;
} mpcore_rirq_state;
/* Map baseboard IRQs onto CPU IRQ lines. */
static const int mpcore_irq_map[32] = {
-1, -1, -1, -1, 1, 2, -1, -1,
-1, -1, 6, -1, 4, 5, -1, -1,
-1, 14, 15, 0, 7, 8, -1, -1,
-1, -1, -1, -1, 9, 3, -1, -1,
};
static void mpcore_rirq_set_irq(void *opaque, int irq, int level)
{
mpcore_rirq_state *s = (mpcore_rirq_state *)opaque;
int i;
for (i = 0; i < 4; i++) {
qemu_set_irq(s->rvic[i][irq], level);
}
if (irq < 32) {
irq = mpcore_irq_map[irq];
if (irq >= 0) {
qemu_set_irq(s->cpuic[irq], level);
}
}
}
static void mpcore_rirq_map(SysBusDevice *dev, target_phys_addr_t base)
{
mpcore_rirq_state *s = FROM_SYSBUS(mpcore_rirq_state, dev);
sysbus_mmio_map(s->priv, 0, base);
}
static void mpcore_rirq_unmap(SysBusDevice *dev, target_phys_addr_t base)
{
/* nothing to do */
}
static int realview_mpcore_init(SysBusDevice *dev)
{
mpcore_rirq_state *s = FROM_SYSBUS(mpcore_rirq_state, dev);
DeviceState *gic;
DeviceState *priv;
int n;
int i;
priv = qdev_create(NULL, "arm11mpcore_priv");
qdev_prop_set_uint32(priv, "num-cpu", s->num_cpu);
qdev_init_nofail(priv);
s->priv = sysbus_from_qdev(priv);
sysbus_pass_irq(dev, s->priv);
for (i = 0; i < 32; i++) {
s->cpuic[i] = qdev_get_gpio_in(priv, i);
}
/* ??? IRQ routing is hardcoded to "normal" mode. */
for (n = 0; n < 4; n++) {
gic = sysbus_create_simple("realview_gic", 0x10040000 + n * 0x10000,
s->cpuic[10 + n]);
for (i = 0; i < 64; i++) {
s->rvic[n][i] = qdev_get_gpio_in(gic, i);
}
}
qdev_init_gpio_in(&dev->qdev, mpcore_rirq_set_irq, 64);
sysbus_init_mmio_cb2(dev, mpcore_rirq_map, mpcore_rirq_unmap);
return 0;
}
static SysBusDeviceInfo mpcore_rirq_info = {
.init = realview_mpcore_init,
.qdev.name = "realview_mpcore",
.qdev.size = sizeof(mpcore_rirq_state),
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("num-cpu", mpcore_rirq_state, num_cpu, 1),
DEFINE_PROP_END_OF_LIST(),
}
};
static SysBusDeviceInfo mpcore_priv_info = {
.init = mpcore_priv_init,
.qdev.name = "arm11mpcore_priv",
.qdev.size = sizeof(mpcore_priv_state),
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("num-cpu", mpcore_priv_state, num_cpu, 1),
DEFINE_PROP_END_OF_LIST(),
}
};
static void arm11mpcore_register_devices(void)
{
sysbus_register_withprop(&mpcore_rirq_info);
sysbus_register_withprop(&mpcore_priv_info);
}
device_init(arm11mpcore_register_devices)
|
/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
* *
* Additional permission under GNU AGPL version 3 section 7 *
* *
* If you modify this program, or any covered work, by linking or *
* combining it with the OpenSSL project's OpenSSL library (or a *
* modified version of that library), containing parts covered by the *
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
* permission to convey the resulting work. *
* Corresponding Source for a non-source form of such a combination *
* shall include the source code for the parts of OpenSSL used as well *
* as that of the covered work. *
*****************************************************************************/
#ifndef STARTNETWORKGAMEDIALOGIMPL_H
#define STARTNETWORKGAMEDIALOGIMPL_H
#ifdef GUI_800x480
#include "ui_startnetworkgamedialog_800x480.h"
#else
#include "ui_startnetworkgamedialog.h"
#endif
#include <QtGui>
#include <QtCore>
#include "gametableimpl.h"
class Session;
class ConfigFile;
class ChatTools;
class startWindowImpl;
class startNetworkGameDialogImpl: public QDialog, public Ui::startNetworkGameDialog
{
Q_OBJECT
public:
startNetworkGameDialogImpl(startWindowImpl *parent = 0, ConfigFile *config = 0);
void setSession(boost::shared_ptr<Session> session);
public slots:
void setMyW ( gameTableImpl* theValue ) {
myW = theValue;
}
ChatTools *getMyChat() {
return myChat;
}
void startGame();
void cancel();
void refresh(int actionID);
void accept();
void reject();
void joinedNetworkGame(unsigned playerId, QString playerName, bool admin);
void addConnectedPlayer(unsigned playerId, QString playerName, bool admin);
void updatePlayer(unsigned playerId, QString newPlayerName);
void removePlayer(unsigned playerId, QString playerName);
void newGameAdmin(unsigned playerId, QString playerName);
void gameCreated(unsigned gameId);
void playerSelected(QTreeWidgetItem*, QTreeWidgetItem*);
void kickPlayer();
void checkPlayerQuantity();
void clearDialog();
void keyPressEvent ( QKeyEvent*);
bool eventFilter(QObject *obj, QEvent *event);
void setMaxPlayerNumber ( int theValue ) {
maxPlayerNumber = theValue;
label_maxPlayerNumber->setText(QString::number(theValue,10));
}
int getMaxPlayerNumber() const {
return maxPlayerNumber;
}
int exec();
private:
gameTableImpl* myW;
startWindowImpl* myStartWindow;
int maxPlayerNumber;
int keyUpDownChatCounter;
unsigned myPlayerId;
bool isAdmin;
ConfigFile *myConfig;
boost::shared_ptr<Session> mySession;
ChatTools *myChat;
};
#endif
|
#ifndef C_ASSERTIONS_HEADER
#define C_ASSERTIONS_HEADER
#include <cgreen/constraint.h>
#include <inttypes.h>
#ifdef __cplusplus
#error "Should only be included when not compiling in C++ mode. Include cpp_assertions.h instead."
#endif
#define assert_that_constraint(actual, constraint) assert_that_(__FILE__, __LINE__, #actual, (intptr_t)actual, constraint)
// this isn't declared in assertions.h because you can't have overloads for an extern "C"-declared function, so it seems
void assert_that_(const char *file, int line, const char *actual_string, intptr_t actual, Constraint *constraint);
#endif
|
// -*- Mode:C++ -*-
/************************************************************************\
* *
* This file is part of AVANGO. *
* *
* Copyright 2007 - 2010 Fraunhofer-Gesellschaft zur Foerderung der *
* angewandten Forschung (FhG), Munich, Germany. *
* *
* AVANGO is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, version 3. *
* *
* AVANGO 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 Lesser General Public *
* License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. *
* *
\************************************************************************/
#ifndef shade_types_float_H
#define shade_types_float_H shade_types_float_H
#include "../TypeBase.h"
#include "FloatAccessor.h"
namespace shade
{
template<class Qualifier = Type> class float_ : public TypeBase<float_<Qualifier>, Qualifier>, public types::FloatAccessor
{
public:
float_(void);
float_(float v);
template<class Q> void copy_value(const float_<Q>& source);
/*virtual*/ void set(float v);
/*virtual*/ void get(float& v) const;
/*virtual*/ void upload_uniform(boost::shared_ptr<GLSLWrapper>, shade::Type::LinkIndex) const;
/*virtual*/ std::string get_constructor_str(void) const;
/*virtual*/ std::string get_constructor_str(boost::shared_ptr<Type::State> state) const;
/*virtual*/ std::string get_uniq_id(void) const;
/*virtual*/ void generate_constructor(formatter::Generator& generator) const;
private:
float m_value;
};
}
#include "impl/float_impl.cpp"
#endif /* shade_types_float_H */
|
// -*- Mode:C++ -*-
/************************************************************************\
* *
* This file is part of Avango. *
* *
* Copyright 1997 - 2008 Fraunhofer-Gesellschaft zur Foerderung der *
* angewandten Forschung (FhG), Munich, Germany. *
* *
* Avango is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, version 3. *
* *
* Avango 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 Lesser General Public *
* License along with Avango. If not, see <http://www.gnu.org/licenses/>. *
* *
* Avango is a trademark owned by FhG. *
* *
\************************************************************************/
#if !defined(AV_WINDOWS_SPECIFIC_OSG_H)
#define AV_WINDOWS_SPECIFIC_OSG_H
/**
* \file
* \ingroup av_osg
*/
#if defined(_MSC_VER)
#if defined(AV_OSG_LIBRARY)
#define AV_OSG_DLL __declspec( dllexport )
#else
#define AV_OSG_DLL __declspec( dllimport )
#endif
#else
#define AV_OSG_DLL
#endif // #if defined(_MSC_VER)
#endif // #if !defined(AV_WINDOWS_SPECIFIC_OSG_H)
|
#include "includes.h"
DWORD
VMCADCEGetErrorCode(
dcethread_exc* pDceException
)
{
DWORD dwError = 0;
dwError = dcethread_exc_getstatus (pDceException);
//FixME AnuE - find right mapping/move to common gobuild component
// dwError = 1703;
return dwError;
}
DWORD
VMCAMapDCEErrorCode(
DWORD dwError
)
{
//FixME AnuE - find right mapping/move to common gobuild component
// return(dwError = 1703);
return dwError;
}
|
/*******************************************************************************
License:
This software and/or related materials was developed at the National Institute
of Standards and Technology (NIST) by employees of the Federal Government
in the course of their official duties. Pursuant to title 17 Section 105
of the United States Code, this software is not subject to copyright
protection and is in the public domain.
This software and/or related materials have been determined to be not subject
to the EAR (see Part 734.3 of the EAR for exact details) because it is
a publicly available technology and software, and is freely distributed
to any interested party with no licensing requirements. Therefore, it is
permissible to distribute this software as a free download from the internet.
Disclaimer:
This software and/or related materials was developed to promote biometric
standards and biometric technology testing for the Federal Government
in accordance with the USA PATRIOT Act and the Enhanced Border Security
and Visa Entry Reform Act. Specific hardware and software products identified
in this software were used in order to perform the software development.
In no case does such identification imply recommendation or endorsement
by the National Institute of Standards and Technology, nor does it imply that
the products and equipment identified are necessarily the best available
for the purpose.
This software and/or related materials are provided "AS-IS" without warranty
of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
licensed product, however used. In no event shall NIST be liable for any
damages and/or costs, including but not limited to incidental or consequential
damages of any kind, including economic damage or injury to property and lost
profits, regardless of whether NIST shall be advised, have reason to know,
or in fact shall know of the possibility.
By using this software, you agree to bear all risk relating to quality,
use and performance of the software and/or related materials. You agree
to hold the Government harmless from any claim arising from your use
of the software.
*******************************************************************************/
/* Changed each _( to plain (. GTC 14 July 1995. */
/* UPDATED: 03/14/2005 by MDG */
/* cfftf.f -- translated by f2c (version of 15 October 1990 19:58:17).
You must link the resulting object file with the libraries:
-lF77 -lI77 -lm -lc (in that order)
*/
#include "f2c.h"
extern /* Subroutine */ int cfftf1(int *, real *, real *, real *,
int *);
/* Subroutine */ int cfftf(int *n, real *c, real *wsave)
{
static int iw1, iw2;
/* ***BEGIN PROLOGUE CFFTF */
/* ***DATE WRITTEN 790601 (YYMMDD) */
/* ***REVISION DATE 800626 (YYMMDD) */
/* ***CATEGORY NO. J1A2 */
/* ***KEYWORDS FOURIER TRANSFORM */
/* ***AUTHOR SWARZTRAUBER, P. N., (NCAR) */
/* ***PURPOSE Forward transform of a complex, periodic sequence. */
/* ***DESCRIPTION */
/* Subroutine CFFTF computes the forward complex discrete Fourier */
/* transform (the Fourier analysis). Equivalently, CFFTF computes */
/* the Fourier coefficients of a complex periodic sequence. */
/* The transform is defined below at output parameter C. */
/* The transform is not normalized. To obtain a normalized transform */
/* the output must be divided by N. Otherwise a call of CFFTF */
/* followed by a call of CFFTB will multiply the sequence by N. */
/* The array WSAVE which is used by subroutine CFFTF must be */
/* initialized by calling subroutine CFFTI(N,WSAVE). */
/* Input Parameters */
/* N the length of the complex sequence C. The method is */
/* more efficient when N is the product of small primes. */
/* C a complex array of length N which contains the sequence */
/* WSAVE a real work array which must be dimensioned at least 4*N+15 */
/* in the program that calls CFFTF. The WSAVE array must be */
/* initialized by calling subroutine CFFTI(N,WSAVE), and a */
/* different WSAVE array must be used for each different */
/* value of N. This initialization does not have to be */
/* repeated so long as N remains unchanged. Thus subsequent */
/* transforms can be obtained faster than the first. */
/* The same WSAVE array can be used by CFFTF and CFFTB. */
/* Output Parameters */
/* C for J=1,...,N */
/* C(J)=the sum from K=1,...,N of */
/* C(K)*EXP(-I*J*K*2*PI/N) */
/* where I=SQRT(-1) */
/* WSAVE contains initialization calculations which must not be */
/* destroyed between calls of subroutine CFFTF or CFFTB */
/* ***REFERENCES (NONE) */
/* ***ROUTINES CALLED CFFTF1 */
/* ***END PROLOGUE CFFTF */
/* ***FIRST EXECUTABLE STATEMENT CFFTF */
/* Parameter adjustments */
--wsave;
--c;
/* Function Body */
if (*n == 1) {
return 0;
}
iw1 = *n + *n + 1;
iw2 = iw1 + *n + *n;
cfftf1(n, &c[1], &wsave[1], &wsave[iw1], (int *)&wsave[iw2]);
return 0;
} /* cfftf_ */
|
// Copyright 2014 Hazy Research (http://i.stanford.edu/hazy)
//
// 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 _GLM_DENSE_SGD_H
#define _GLM_DENSE_SGD_H
#include "common.h"
#include "engine/dimmwitted_dense.h"
/**
* \brief A model object. This model contains
* two elements: (1) p: the pointers
* to the paramters, and (2) n: the number
* of paramters that this model contains.
*
* Note that, to use PerNode and PerCore
* strategy, this object needs to have a copy
* constructor.
*
*/
class GLMModelExample{
public:
double * const p;
int n;
GLMModelExample(int _n):
n(_n), p(new double[_n]){}
GLMModelExample( const GLMModelExample& other ) :
n(other.n), p(new double[other.n]){
for(int i=0;i<n;i++){
p[i] = other.p[i];
}
}
};
/**
* \brief The function that takes input a series of models,
* and update one of them according to others. You
* need to register this one if you want to use
* PerNode and PerCore strategy.
*/
void f_lr_modelavg(GLMModelExample** const p_models, /**< set of models*/
int nreplicas, /**< number of models in the above set */
int ireplica /**< id of the model that needs updates*/
){
GLMModelExample * p_model = p_models[ireplica];
double sum = 0.0;
for(int i=0;i<p_model->n;i++){
sum = 0.0;
for(int j=0;j<nreplicas;j++){
sum += p_models[j]->p[i];
}
(p_model->p)[i] = sum/nreplicas; // update the ireplica'th model by
// the average.
}
}
/**
* \brief One example of the function that can be register to
* Row-wise access (DW_ROW). This function takes as input
* one row of the data (ex), and the current model,
* returns the loss.
*/
double f_lr_loss(const DenseVector<double>* const ex, GLMModelExample* const p_model){
double * model = p_model->p;
double label = ex->p[ex->n-1];
double dot = 0.0;
for(int i=0;i<ex->n-1;i++){
dot += ex->p[i] * model[i];
}
return - label * dot + log(exp(dot) + 1.0);
}
/**
* \brief One example of the function that can be register to
* Row-wise access (DW_ROW). This function takes as input
* one row of the data (ex), and the current model (p_model),
* and update the model with the gradient.
*
*/
double f_lr_grad(const DenseVector<double>* const ex, GLMModelExample* const p_model){
double * model = p_model->p;
double label = ex->p[ex->n-1];
double dot = 0.0;
for(int i=0;i<ex->n-1;i++){
dot += ex->p[i] * model[i];
}
const double d = exp(-dot);
const double Z = 0.00001 * (-label + 1.0/(1.0+d));
for(int i=0;i<ex->n-1;i++){
model[i] -= ex->p[i] * Z;
}
return 1.0;
}
/**
* \brief One example main entry of how to use DimmWitted.
* The application is Stochastic Gradient Descent (SGD)
* with Row-wise Access.
*
* \tparam MODELREPL Model replication strategy.
* \tparam DATAREPL Data replication strategy.
*/
template<ModelReplType MODELREPL, DataReplType DATAREPL>
double test_glm_dense_sgd(){
// First, create a synthetic data set.
// Given nexp examples and nfeat features,
// this data set contains nexp rows, and
// nfeat + 1 columns, where the last column
// is the label that we want to train on.
//
long nexp = 100000; // number of rows
long nfeat = 1024; // number of features
double ** examples = new double* [nexp]; // pointers to each row
double * content = new double[nexp*(nfeat+1)]; // buffer to actually hold objects
for(long i=0;i<nexp;i++){
examples[i] = &content[i*(nfeat+1)];
for(int j=0;j<nfeat;j++){
examples[i][j] = 1;
}
examples[i][nfeat] = drand48() > 0.8 ? 0 : 1.0; // randomly generate labels
// with 80% 1 and 20% 0.
}
// Second, create a model and initialize it
// with all zeros.
//
GLMModelExample model(nfeat);
for(int i=0;i<model.n;i++){
model.p[i] = 0.0;
}
// Thrid, create a DenseDimmWitted object because the synthetic data set
// we created is dense. This object has multiple templates,
// - double: the type of the data (type of elements in ``examples'')
// - GLMModelExample: the type of the model
// - MODELREPL: Model replication strategy
// - DATAREPL: Data replication strategy
// - DW_ROW: Access method
//
DenseDimmWitted<double, GLMModelExample, MODELREPL, DATAREPL, DW_ROW>
dw(examples, nexp, nfeat+1, &model);
// Fourth, register functions.
//
unsigned int f_handle_grad = dw.register_row(f_lr_grad);
unsigned int f_handle_loss = dw.register_row(f_lr_loss);
dw.register_model_avg(f_handle_grad, f_lr_modelavg);
dw.register_model_avg(f_handle_loss, f_lr_modelavg);
// Last, run 10 epochs, for each epoch
// 1. calculate the loss
// 2. sum the model (only for getting statistics)
// 3. update the model
//
double sum = 0.0;
for(int i_epoch=0;i_epoch<10;i_epoch++){
double loss = dw.exec(f_handle_loss)/nexp;
sum = 0.0;
for(int i=0;i<nfeat;i++){
sum += model.p[i];
}
std::cout.precision(8);
std::cout << sum << " loss=" << loss << std::endl;
Timer t;
dw.exec(f_handle_grad);
double data_byte = 1.0 * sizeof(double) * nexp * nfeat;
double te = t.elapsed();
double throughput_gb = data_byte / te / 1024 / 1024 / 1024;
std::cout << "TIME=" << te << " secs" << " THROUGHPUT=" << throughput_gb << " GB/sec." << std::endl;
}
// Return the sum of the model. This value should be
// around 1.3-1.4 for this example.
//
return sum;
}
#endif
|
//
// MPURL.h
//
// Copyright 2018-2020 Twitter, Inc.
// Licensed under the MoPub SDK License Agreement
// http://www.mopub.com/legal/sdk-license-agreement/
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
MoPub-specific URL object to include passing along a POST request payload.
*/
@interface MPURL : NSURL
/**
Dictionary of data that will be represented as JSON in the POST request body.
@c NSJSONSerialization will be used to perform the serialization of the data
into JSON; as such the only objects that are supported are: @c NSString,
@c NSNumber, @c NSArray, @c NSDictionary, and @c NSNull.
@note Keys and values will not be URL encoded.
*/
@property (nonatomic, strong, readonly) NSMutableDictionary<NSString *, NSObject *> * postData;
/**
Initialize with a valid URL string with the string arguments to contain any percent
escape codes that are necessary. It is an error for URLString to be nil.
@param URLString Valid URL string with percent escaped arguments.
@return MoPub object representation of the URL.
*/
- (instancetype _Nullable)initWithString:(NSString * _Nullable)URLString;
/**
Initialize with a valid URL string with the string arguments to contain any percent
escape codes that are necessary. It is an error for URLString to be nil.
@param URLString Valid URL string with percent escaped arguments.
@return MoPub object representation of the URL.
*/
+ (instancetype _Nullable)URLWithString:(NSString * _Nullable)URLString;
/**
Initialize with a URL components and optional POST data.
@param components Components of the URL.
@param postData Optional POST data to include with the URL. The values should not be URL encoded,
and only supports the following JSON-serializable types: @c NSString, @c NSNumber, @c NSDictionary,
and @c NSArray.
@return MoPub object representation of the URL.
*/
+ (instancetype _Nullable)URLWithComponents:(NSURLComponents * _Nullable)components postData:(NSDictionary<NSString *, NSObject *> * _Nullable)postData;
/**
Attempts to retrieve the value for the POST data key as a @c NSArray.
@param key POST data key.
@return The value of the POST data key cast into a @c NSArray; otherwise @c nil.
*/
- (NSArray * _Nullable)arrayForPOSTDataKey:(NSString *)key;
/**
Attempts to retrieve the value for the POST data key as a @c NSDictionary.
@param key POST data key.
@return The value of the POST data key cast into a @c NSDictionary; otherwise @c nil.
*/
- (NSDictionary * _Nullable)dictionaryForPOSTDataKey:(NSString *)key;
/**
Attempts to retrieve the value for the POST data key as a @c NSNumber.
@param key POST data key.
@return The value of the POST data key cast into a @c NSNumber; otherwise @c nil.
*/
- (NSNumber * _Nullable)numberForPOSTDataKey:(NSString *)key;
/**
Attempts to retrieve the value for the POST data key as a @c NSString.
@param key POST data key.
@return The value of the POST data key cast into a @c NSString; otherwise @c nil.
*/
- (NSString * _Nullable)stringForPOSTDataKey:(NSString *)key;
@end
NS_ASSUME_NONNULL_END
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* interface for HTML client-side image maps */
#ifndef nsIImageMap_h___
#define nsIImageMap_h___
#include "nsISupports.h"
class nsIContent;
struct nsRect;
#define NS_IIMAGEMAP_IID \
{ 0x2fca3d7e, 0x5b1f, 0x4ecf, \
{ 0xb5, 0x7a, 0x84, 0x24, 0x97, 0x81, 0x2e, 0x62 } }
class nsIImageMap : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIMAGEMAP_IID)
NS_IMETHOD GetBoundsForAreaContent(nsIContent *aContent,
nsRect& aBounds) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIImageMap, NS_IIMAGEMAP_IID)
#endif /* nsIImageMap_h___ */
|
/*! \file components/cost_evaluators/time.h
\brief The cost evaluator based on the execution time
This file implements the smp_cost_evaluator_time class that computes the
cost of the trajectory based on the time it takes to execute it.
*/
#ifndef _SMP_COST_EVALUATOR_TIME_H_
#define _SMP_COST_EVALUATOR_TIME_H_
#include <smp/components/cost_evaluators/base.h>
namespace smp {
//! The cost evaluator class based on the trajectory execution time
/*!
This class computes the cost of a trajectory according to the time
it takes to execute that particular trajectory.
\ingroup cost_evaluators
*/
template< class typeparams >
class cost_evaluator_time : public cost_evaluator_base<typeparams> {
typedef typename typeparams::state state_t;
typedef typename typeparams::input input_t;
typedef typename typeparams::vertex_data vertex_data_t;
typedef typename typeparams::edge_data edge_data_t;
typedef vertex<typeparams> vertex_t;
typedef edge<typeparams> edge_t;
typedef trajectory<typeparams> trajectory_t;
public:
int ce_update_vertex_cost (vertex_t *vertex_in);
int ce_update_edge_cost (edge_t *edge_in);
double evaluate_cost_trajectory (state_t *state_initial_in,
trajectory_t *trajectory_in,
state_t *state_final_in = 0);
};
}
#endif
|
/*
* _READMAT_C_
*
* HMC-SIM SPMV MATRIX UTILITY FUNCTIONS
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "spmv.h"
/* ------------------------------------------------- ALLOCATE MEMORY */
/*
* allocates the csr spmv structure
*
*/
static int allocate_memory( struct csr_t *mat, int nzero, int ncols, int nrows )
{
if( mat == NULL ){
return -1;
}
mat->vals = NULL;
mat->cols = NULL;
mat->rows = NULL;
mat->x_vect = NULL;
mat->vals = malloc( nzero * sizeof( uint64_t ) );
if( mat->vals == NULL ){
printf( "ERROR : could not allocate vals array\n" );
return -1;
}
mat->cols = malloc( nzero * sizeof( uint64_t ) );
if( mat->cols == NULL ){
printf( "ERROR : could not allocate cols array\n" );
free( mat->vals );
return -1;
}
mat->rows = malloc( (nrows+1) * sizeof( uint64_t ) );
if( mat->rows == NULL ){
printf( "ERROR : could not allocate rows array\n" );
free( mat->vals );
free( mat->cols );
return -1;
}
mat->x_vect = malloc( ncols * sizeof( uint64_t ) );
if( mat->x_vect == NULL ){
printf( "ERROR : could not allocate x_vect array\n" );
free( mat->vals );
free( mat->rows );
free( mat->cols );
return -1;
}
return 0;
}
/* ------------------------------------------------- GENMAT */
/*
* generates a sample, synthetic matrix
*
*/
extern int genmat( int nzero, int nrows, int ncols, struct csr_t *mat )
{
/* vars */
int i = 0;
int j = 0;
int tmp_i = 0;
int tmp_j = 0;
int tmp_v = 0;
int first = 0;
uint64_t **t = NULL;
/* ---- */
/* alloate the temp matrix */
t = malloc( sizeof( uint64_t * ) * nrows );
if( t == NULL ){
printf( "ERROR : could not allocate temp matrix\n" );
return -1;
}
for( i = 0; i < nrows; i++ ){
t[i] = malloc( sizeof( uint64_t ) * ncols );
for( j = 0; j < ncols; j++ ){
t[i][j] = 0x00ll;
}
}
for( i=0; i<nzero; i++ ){
tmp_i = rand() % (nrows-1);
tmp_j = rand() % (ncols-1);
tmp_v = rand()+1; /* ensure we have a nonzero value */
t[tmp_i][tmp_j] = tmp_v;
}
/* allocate csr */
if( allocate_memory( mat, nzero, ncols, nrows ) != 0 ){
printf( "ERROR : could not allocate memory\n" );
for( i=0; i<nrows; i++ ){
free( t[i] );
}
free( t );
return -1;
}
/*
* convert the dense matrix to csr
*
*/
for( i=0; i<nrows; i++ ){
for( j=0; j<ncols; j++ ){
if( t[i][j] != 0x00ll ){
/*
* we found a hit, record it
*
*/
/* values */
mat->vals[tmp_i] = t[i][j];
/* columns */
mat->cols[tmp_i] = j;
/* row start */
if( first == 0 ){
mat->rows[tmp_j] = tmp_i;
tmp_j++;
first = 1;
}
tmp_i++;
}
}
first = 0;
}
/* last value */
mat->rows[nrows] = mat->vals[nzero-1];
/* free the matrix */
for( i=0; i<nrows; i++ ){
free( t[i] );
}
free( t );
/* allocate the vector */
mat->x_vect = malloc( sizeof( uint64_t ) * ncols );
if( mat->x_vect == NULL ){
printf( "ERROR : could not allocate vector\n" );
return -1;
}
/* randomly generate the input vector */
for( i = 0; i < ncols; i ++ ){
mat->x_vect[i] = rand();
}
return 0;
}
/* ------------------------------------------------- READMAT */
/*
* reads an interprets the spmv input file
*
*/
extern int readmat( char *matfile, struct csr_t *mat )
{
/* vars */
FILE *infile = NULL;
/* ---- */
if( matfile == NULL ){
return -1;
}else if( mat == NULL ){
return -1;
}
infile = fopen( matfile, "r" );
if( infile == NULL ){
printf( "ERROR : could not open matfile at %s\n", matfile );
return -1;
}
fclose( infile );
return 0;
}
/* EOF */
|
#pragma once
#include "stdafx.h"
typedef NTSTATUS(WINAPI *tNtQuerySecurityObject)(HANDLE, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, ULONG, PULONG);
BOOL AttackPO_BAD0B0B0(HANDLE hDevice);
|
#define ZLONG
#include <../Source/umfpack_numeric.c>
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_BASE_CDM_PROMISE_H_
#define MEDIA_BASE_CDM_PROMISE_H_
#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
#include "media/base/media_export.h"
#include "media/base/media_keys.h"
namespace media {
// Interface for promises being resolved/rejected in response to various
// session actions. These may be called synchronously or asynchronously.
// The promise must be resolved or rejected exactly once. It is expected that
// the caller free the promise once it is resolved/rejected.
//
// This is only the base class, as parameter to resolve() varies.
class MEDIA_EXPORT CdmPromise {
public:
// A superset of media::MediaKeys::Exception for UMA reporting.
enum ResultCodeForUMA {
SUCCESS,
NOT_SUPPORTED_ERROR,
INVALID_STATE_ERROR,
INVALID_ACCESS_ERROR,
QUOTA_EXCEEDED_ERROR,
UNKNOWN_ERROR,
CLIENT_ERROR,
OUTPUT_ERROR,
NUM_RESULT_CODES
};
enum ResolveParameterType {
VOID_TYPE,
STRING_TYPE,
KEY_IDS_VECTOR_TYPE
};
typedef base::Callback<void(MediaKeys::Exception exception_code,
uint32 system_code,
const std::string& error_message)>
PromiseRejectedCB;
virtual ~CdmPromise();
// Used to indicate that the operation failed. |exception_code| must be
// specified. |system_code| is a Key System-specific value for the error
// that occurred, or 0 if there is no associated status code or such status
// codes are not supported by the Key System. |error_message| is optional.
virtual void reject(MediaKeys::Exception exception_code,
uint32 system_code,
const std::string& error_message);
virtual ResolveParameterType GetResolveParameterType() const = 0;
protected:
CdmPromise();
CdmPromise(PromiseRejectedCB reject_cb);
// If constructed with a |uma_name| (which must be the name of a
// CdmPromiseResult UMA), CdmPromise will report the promise result (success
// or rejection code).
CdmPromise(PromiseRejectedCB reject_cb, const std::string& uma_name);
PromiseRejectedCB reject_cb_;
// Keep track of whether the promise hasn't been resolved or rejected yet.
bool is_pending_;
// UMA to report result to.
std::string uma_name_;
DISALLOW_COPY_AND_ASSIGN(CdmPromise);
};
// Specialization for no parameter to resolve().
template <>
class MEDIA_EXPORT CdmPromiseTemplate<void> : public CdmPromise {
public:
CdmPromiseTemplate(base::Callback<void(void)> resolve_cb,
PromiseRejectedCB rejected_cb);
CdmPromiseTemplate(base::Callback<void(void)> resolve_cb,
PromiseRejectedCB rejected_cb,
const std::string& uma_name);
virtual ~CdmPromiseTemplate();
virtual void resolve();
virtual ResolveParameterType GetResolveParameterType() const OVERRIDE;
protected:
// Allow subclasses to completely override the implementation.
CdmPromiseTemplate();
private:
base::Callback<void(void)> resolve_cb_;
DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate);
};
template <>
class MEDIA_EXPORT CdmPromiseTemplate<std::string> : public CdmPromise {
public:
CdmPromiseTemplate(base::Callback<void(const std::string&)> resolve_cb,
PromiseRejectedCB rejected_cb);
CdmPromiseTemplate(base::Callback<void(const std::string&)> resolve_cb,
PromiseRejectedCB rejected_cb,
const std::string& uma_name);
virtual ~CdmPromiseTemplate();
virtual void resolve(const std::string& result);
virtual ResolveParameterType GetResolveParameterType() const OVERRIDE;
protected:
// Allow subclasses to completely override the implementation.
// TODO(jrummell): Remove when derived class SessionLoadedPromise
// (in ppapi_decryptor.cc) is no longer needed.
CdmPromiseTemplate();
private:
base::Callback<void(const std::string&)> resolve_cb_;
DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate);
};
template <>
class MEDIA_EXPORT CdmPromiseTemplate<KeyIdsVector> : public CdmPromise {
public:
CdmPromiseTemplate(base::Callback<void(const KeyIdsVector&)> resolve_cb,
PromiseRejectedCB rejected_cb);
CdmPromiseTemplate(base::Callback<void(const KeyIdsVector&)> resolve_cb,
PromiseRejectedCB rejected_cb,
const std::string& uma_name);
virtual ~CdmPromiseTemplate();
virtual void resolve(const KeyIdsVector& result);
virtual ResolveParameterType GetResolveParameterType() const OVERRIDE;
private:
base::Callback<void(const KeyIdsVector&)> resolve_cb_;
DISALLOW_COPY_AND_ASSIGN(CdmPromiseTemplate);
};
} // namespace media
#endif // MEDIA_BASE_CDM_PROMISE_H_
|
/* Copyright (c) 2014 The Chromium OS 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 __CROS_EC_ACCELGYRO_H
#define __CROS_EC_ACCELGYRO_H
#include "motion_sense.h"
/* Header file for accelerometer / gyro drivers. */
/* Number of counts from accelerometer that represents 1G acceleration. */
#define ACCEL_G 1024
struct accelgyro_drv {
/**
* Initialize accelerometers.
* @s Pointer to sensor data pointer. Sensor data will be
* allocated on success.
* @return EC_SUCCESS if successful, non-zero if error.
*/
int (*init)(const struct motion_sensor_t *s);
/**
* Read all three accelerations of an accelerometer. Note that all
* three accelerations come back in counts, where ACCEL_G can be used
* to convert counts to engineering units.
* @s Pointer to sensor data.
* @v Vector to store acceleration (in units of counts).
* @return EC_SUCCESS if successful, non-zero if error.
*/
int (*read)(const struct motion_sensor_t *s, vector_3_t v);
/**
* Setter and getter methods for the sensor range. The sensor range
* defines the maximum value that can be returned from read(). As the
* range increases, the resolution gets worse.
* @s Pointer to sensor data.
* @range Range (Units are +/- G's for accel, +/- deg/s for gyro)
* @rnd Rounding flag. If true, it rounds up to nearest valid
* value. Otherwise, it rounds down.
* @return EC_SUCCESS if successful, non-zero if error.
*/
int (*set_range)(const struct motion_sensor_t *s,
int range,
int rnd);
int (*get_range)(const struct motion_sensor_t *s,
int *range);
/**
* Setter and getter methods for the sensor resolution.
* @s Pointer to sensor data.
* @range Resolution (Units are number of bits)
* param rnd Rounding flag. If true, it rounds up to nearest valid
* value. Otherwise, it rounds down.
* @return EC_SUCCESS if successful, non-zero if error.
*/
int (*set_resolution)(const struct motion_sensor_t *s,
int res,
int rnd);
int (*get_resolution)(const struct motion_sensor_t *s,
int *res);
/**
* Setter and getter methods for the sensor output data range. As the
* ODR increases, the LPF roll-off frequency also increases.
* @s Pointer to sensor data.
* @rate Output data rate (units are milli-Hz)
* @rnd Rounding flag. If true, it rounds up to nearest valid
* value. Otherwise, it rounds down.
* @return EC_SUCCESS if successful, non-zero if error.
*/
int (*set_data_rate)(const struct motion_sensor_t *s,
int rate,
int rnd);
int (*get_data_rate)(const struct motion_sensor_t *s,
int *rate);
#ifdef CONFIG_ACCEL_INTERRUPTS
/**
* Setup a one-time accel interrupt. If the threshold is low enough, the
* interrupt may trigger due simply to noise and not any real motion.
* If the threshold is 0, the interrupt will fire immediately.
* @s Pointer to sensor data.
* @threshold Threshold for interrupt in units of counts.
*/
int (*set_interrupt)(const struct motion_sensor_t *s,
unsigned int threshold);
#endif
};
#endif /* __CROS_EC_ACCELGYRO_H */
|
/*
Copyright (c) 2013, Lunar Workshop, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
This product includes software developed by Lunar Workshop, Inc.
4. Neither the name of the Lunar Workshop 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 LUNAR WORKSHOP 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 LUNAR WORKSHOP BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "vector.h"
// Plane class defined by a normal vector which should aways be unit length and a "distance" to the origin.
// Also can be thought of as ax + by + cz + d = 0, the equation of a plane in 3D space, where a b and c are the x, y, z of the normal n.
class CPlane
{
public:
void Normalize()
{
// It helps a ton if our planes are normalized, meaning n is unit length.
// To normalize the plane, we do this operation:
// s(ax + by + cz + d) = s(0)
// We calculate s by using 1/|n|, and it gets us the number we must scale n by to make it unit length.
// Notice how d needs to be scaled also.
float flScale = 1/n.Length();
n.x *= flScale;
n.y *= flScale;
n.z *= flScale;
d *= flScale;
}
public:
Vector n; // The normal
float d; // The "distance" to the origin.
};
|
#include "../../src/gui/painting/qpolygon.h"
|
/**********************************************************************
* $Id: cpl_error.h,v 1.20 2006/03/07 22:05:32 fwarmerdam Exp $
*
* Name: cpl_error.h
* Project: CPL - Common Portability Library
* Purpose: CPL Error handling
* Author: Daniel Morissette, danmo@videotron.ca
*
**********************************************************************
* Copyright (c) 1998, Daniel Morissette
*
* 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.
**********************************************************************
*
* $Log: cpl_error.h,v $
* Revision 1.20 2006/03/07 22:05:32 fwarmerdam
* fix up docs a bit
*
* Revision 1.19 2005/08/31 03:32:13 fwarmerdam
* fixed void arg list
*
* Revision 1.18 2005/08/25 18:05:36 fwarmerdam
* Added void in empty arg lists.
*
* Revision 1.17 2005/04/04 15:23:31 fwarmerdam
* some functions now CPL_STDCALL
*
* Revision 1.16 2001/11/02 22:07:58 warmerda
* added logging error handler
*
* Revision 1.15 2001/01/19 21:16:41 warmerda
* expanded tabs
*
* Revision 1.14 2000/11/30 17:30:10 warmerda
* added CPLGetLastErrorType
*
* Revision 1.13 2000/08/24 18:08:17 warmerda
* made default and quiet error handlers public on windows
*
* Revision 1.12 2000/06/26 21:44:07 warmerda
* added CPLE_UserInterrupt for progress terminations
*
* Revision 1.11 2000/03/31 14:11:55 warmerda
* added CPLErrorV
*
* Revision 1.10 2000/01/10 17:35:45 warmerda
* added push down stack of error handlers
*
* Revision 1.9 1999/07/23 14:27:47 warmerda
* CPLSetErrorHandler returns old handler
*
* Revision 1.8 1999/05/20 14:59:05 warmerda
* added CPLDebug()
*
* Revision 1.7 1999/05/20 02:54:38 warmerda
* Added API documentation
*
* Revision 1.6 1999/02/17 05:40:47 danmo
* Fixed CPLAssert() macro to work with EGCS.
*
* Revision 1.5 1999/01/11 15:34:29 warmerda
* added reserved range comment
*
* Revision 1.4 1998/12/15 19:02:27 warmerda
* Avoid use of errno as a variable
*
* Revision 1.3 1998/12/06 22:20:42 warmerda
* Added error code.
*
* Revision 1.2 1998/12/06 02:52:52 warmerda
* Implement assert support
*
* Revision 1.1 1998/12/03 18:26:02 warmerda
* New
*
**********************************************************************/
#ifndef _CPL_ERROR_H_INCLUDED_
#define _CPL_ERROR_H_INCLUDED_
#include "cpl_port.h"
/*=====================================================================
Error handling functions (cpl_error.c)
=====================================================================*/
/**
* \file cpl_error.h
*
* CPL error handling services.
*/
CPL_C_START
typedef enum
{
CE_None = 0,
CE_Debug = 1,
CE_Warning = 2,
CE_Failure = 3,
CE_Fatal = 4
} CPLErr;
void CPL_DLL CPLError(CPLErr eErrClass, int err_no, const char *fmt, ...);
void CPL_DLL CPLErrorV(CPLErr, int, const char *, va_list );
void CPL_DLL CPL_STDCALL CPLErrorReset( void );
int CPL_DLL CPL_STDCALL CPLGetLastErrorNo( void );
CPLErr CPL_DLL CPL_STDCALL CPLGetLastErrorType( void );
const char CPL_DLL * CPL_STDCALL CPLGetLastErrorMsg( void );
typedef void (CPL_STDCALL *CPLErrorHandler)(CPLErr, int, const char*);
void CPL_DLL CPL_STDCALL CPLLoggingErrorHandler( CPLErr, int, const char * );
void CPL_DLL CPL_STDCALL CPLDefaultErrorHandler( CPLErr, int, const char * );
void CPL_DLL CPL_STDCALL CPLQuietErrorHandler( CPLErr, int, const char * );
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandler(CPLErrorHandler);
void CPL_DLL CPL_STDCALL CPLPushErrorHandler( CPLErrorHandler );
void CPL_DLL CPL_STDCALL CPLPopErrorHandler();
void CPL_DLL CPL_STDCALL CPLDebug( const char *, const char *, ... );
void CPL_DLL CPL_STDCALL _CPLAssert( const char *, const char *, int );
#ifdef DEBUG
# define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))
#else
# define CPLAssert(expr)
#endif
CPL_C_END
/* ==================================================================== */
/* Well known error codes. */
/* ==================================================================== */
#define CPLE_None 0
#define CPLE_AppDefined 1
#define CPLE_OutOfMemory 2
#define CPLE_FileIO 3
#define CPLE_OpenFailed 4
#define CPLE_IllegalArg 5
#define CPLE_NotSupported 6
#define CPLE_AssertionFailed 7
#define CPLE_NoWriteAccess 8
#define CPLE_UserInterrupt 9
/* 100 - 299 reserved for GDAL */
#endif /* _CPL_ERROR_H_INCLUDED_ */
|
/* vi: set sw=4 ts=4: */
/* nohup - invoke a utility immune to hangups.
*
* Busybox version based on nohup specification at
* http://www.opengroup.org/onlinepubs/007904975/utilities/nohup.html
*
* Copyright 2006 Rob Landley <rob@landley.net>
* Copyright 2006 Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
//config:config NOHUP
//config: bool "nohup"
//config: default y
//config: help
//config: run a command immune to hangups, with output to a non-tty.
//applet:IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_NOHUP) += nohup.o
//usage:#define nohup_trivial_usage
//usage: "PROG ARGS"
//usage:#define nohup_full_usage "\n\n"
//usage: "Run PROG immune to hangups, with output to a non-tty"
//usage:
//usage:#define nohup_example_usage
//usage: "$ nohup make &"
#include "libbb.h"
/* Compat info: nohup (GNU coreutils 6.8) does this:
# nohup true
nohup: ignoring input and appending output to `nohup.out'
# nohup true 1>/dev/null
nohup: ignoring input and redirecting stderr to stdout
# nohup true 2>zz
# cat zz
nohup: ignoring input and appending output to `nohup.out'
# nohup true 2>zz 1>/dev/null
# cat zz
nohup: ignoring input
# nohup true </dev/null 1>/dev/null
nohup: redirecting stderr to stdout
# nohup true </dev/null 2>zz 1>/dev/null
# cat zz
(nothing)
#
*/
int nohup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int nohup_main(int argc UNUSED_PARAM, char **argv)
{
const char *nohupout;
char *home;
xfunc_error_retval = 127;
if (!argv[1]) {
bb_show_usage();
}
/* If stdin is a tty, detach from it. */
if (isatty(STDIN_FILENO)) {
/* bb_error_msg("ignoring input"); */
close(STDIN_FILENO);
xopen(bb_dev_null, O_RDONLY); /* will be fd 0 (STDIN_FILENO) */
}
nohupout = "nohup.out";
/* Redirect stdout to nohup.out, either in "." or in "$HOME". */
if (isatty(STDOUT_FILENO)) {
close(STDOUT_FILENO);
if (open(nohupout, O_CREAT|O_WRONLY|O_APPEND, S_IRUSR|S_IWUSR) < 0) {
home = getenv("HOME");
if (home) {
nohupout = concat_path_file(home, nohupout);
xopen3(nohupout, O_CREAT|O_WRONLY|O_APPEND, S_IRUSR|S_IWUSR);
} else {
xopen(bb_dev_null, O_RDONLY); /* will be fd 1 */
}
}
bb_error_msg("appending output to %s", nohupout);
}
/* If we have a tty on stderr, redirect to stdout. */
if (isatty(STDERR_FILENO)) {
/* if (stdout_wasnt_a_tty)
bb_error_msg("redirecting stderr to stdout"); */
dup2(STDOUT_FILENO, STDERR_FILENO);
}
signal(SIGHUP, SIG_IGN);
argv++;
BB_EXECVP_or_die(argv);
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Licensed under the MIT License. See LICENSE.txt in the project root for license information.
#pragma once
namespace canvas
{
class MockD2DStrokeStyle : public RuntimeClass<
RuntimeClassFlags<ClassicCom>,
ChainInterfaces<ID2D1StrokeStyle1, ID2D1StrokeStyle, ID2D1Resource >>
{
public:
//
// ID2D1StrokeStyle
//
IFACEMETHODIMP_(D2D1_CAP_STYLE) GetStartCap() CONST
{
Assert::Fail(L"Unexpected call to GetStartCap");
return static_cast<D2D1_CAP_STYLE>(0);
}
IFACEMETHODIMP_(D2D1_CAP_STYLE) GetEndCap() CONST
{
Assert::Fail(L"Unexpected call to GetEndCap");
return static_cast<D2D1_CAP_STYLE>(0);
}
IFACEMETHODIMP_(D2D1_CAP_STYLE) GetDashCap(
) CONST
{
Assert::Fail(L"Unexpected call to GetDashCap");
return static_cast<D2D1_CAP_STYLE>(0);
}
IFACEMETHODIMP_(FLOAT) GetMiterLimit() CONST
{
Assert::Fail(L"Unexpected call to GetMiterLimit");
return 0.0f;
}
IFACEMETHODIMP_(D2D1_LINE_JOIN) GetLineJoin() CONST
{
Assert::Fail(L"Unexpected call to GetLineJoin");
return static_cast<D2D1_LINE_JOIN>(0);
}
IFACEMETHODIMP_(FLOAT) GetDashOffset() CONST
{
Assert::Fail(L"Unexpected call to GetDashOffset");
return 0.0f;
}
IFACEMETHODIMP_(D2D1_DASH_STYLE) GetDashStyle() CONST
{
Assert::Fail(L"Unexpected call to GetDashStyle");
return static_cast<D2D1_DASH_STYLE>(0);
}
IFACEMETHODIMP_(UINT32) GetDashesCount() CONST
{
Assert::Fail(L"Unexpected call to GetDashesCount");
return 0;
}
IFACEMETHODIMP_(void) GetDashes(
_Out_writes_(dashesCount) FLOAT *dashes,
UINT32 dashesCount
) CONST
{
Assert::Fail(L"Unexpected call to GetDashes");
}
//
// ID2D1StrokeStyle1
//
IFACEMETHODIMP_(D2D1_STROKE_TRANSFORM_TYPE) GetStrokeTransformType() CONST
{
Assert::Fail(L"Unexpected call to GetStrokeTransformType");
return static_cast<D2D1_STROKE_TRANSFORM_TYPE>(0);
}
//
// ID2D1Resource
//
IFACEMETHODIMP_(void) GetFactory(ID2D1Factory **factory) const override
{
Assert::Fail(L"Unexpected call to GetFactory");
}
};
}
|
/*
* Copyright (C) 2015-2017 Socionext Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <linux/io.h>
#include "../init.h"
#include "../sc-regs.h"
void uniphier_pro5_dram_clk_init(void)
{
u32 tmp;
/*
* deassert reset
* UMCA2: Ch1 (DDR3)
* UMCA1, UMC31: Ch0 (WIO1)
* UMCA0, UMC30: Ch0 (WIO0)
*/
tmp = readl(SC_RSTCTRL4);
tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 |
SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 |
SC_RSTCTRL4_NRST_UMC31 | SC_RSTCTRL4_NRST_UMC30;
writel(tmp, SC_RSTCTRL4);
readl(SC_RSTCTRL4); /* dummy read */
/* provide clocks */
tmp = readl(SC_CLKCTRL4);
tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC1 |
SC_CLKCTRL4_CEN_UMC0;
writel(tmp, SC_CLKCTRL4);
readl(SC_CLKCTRL4); /* dummy read */
}
|
/*
---------------------------------------------------------------------------------
oooo
`888
oooo d8b .ooooo. oooo ooo 888 oooo oooo
`888""8P d88' `88b `88b..8P' 888 `888 `888
888 888 888 Y888' 888 888 888
888 888 888 .o8"'88b 888 888 888
d888b `Y8bod8P' o88' 888o o888o `V88V"V8P'
www.roxlu.com
www.apollomedia.nl
www.twitter.com/roxlu
---------------------------------------------------------------------------------
*/
#ifndef ROXLU_AMF_TYPE_H
#define ROXLU_AMF_TYPE_H
#include <stdint.h>
#define AMF0_TYPE_NUMBER 0x00
#define AMF0_TYPE_BOOLEAN 0x01
#define AMF0_TYPE_STRING 0x02
#define AMF0_TYPE_OBJECT 0x03
#define AMF0_TYPE_MOVIECLIP 0x04
#define AMF0_TYPE_NULL 0x05
#define AMF0_TYPE_UNDEFINED 0x06
#define AMF0_TYPE_REFERENCE 0x07
#define AMF0_TYPE_ECMA_ARRAY 0x08
#define AMF0_TYPE_OBJECT_END 0x09
#define AMF0_TYPE_STRICT_ARRAY 0x0A
#define AMF0_TYPE_DATE 0x0B
#define AMF0_TYPE_LONG_STRING 0x0C
#define AMF0_TYPE_UNSUPPORTED 0x0D
#define AMF0_TYPE_RECORDSET 0x0E
#define AMF0_TYPE_XML 0x0F
#define AMF0_TYPE_TYPED_OBJECT 0x10
class BitStream;
struct AMFType {
AMFType(uint8_t type, BitStream& bs);
virtual ~AMFType();
virtual void read() = 0;
virtual void write() = 0;
virtual void print() = 0;
uint8_t type;
BitStream& bs;
};
#endif
|
/*
* Copyright (c) 2013 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifndef RTEMS_SCORE_ARMV4_H
#define RTEMS_SCORE_ARMV4_H
#include <rtems/score/cpu.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef ARM_MULTILIB_ARCH_V4
void bsp_interrupt_dispatch( void );
void _ARMV4_Exception_interrupt( void );
typedef void ARMV4_Exception_abort_handler( CPU_Exception_frame *frame );
void _ARMV4_Exception_data_abort_set_handler(
ARMV4_Exception_abort_handler handler
);
void _ARMV4_Exception_data_abort( void );
void _ARMV4_Exception_prefetch_abort_set_handler(
ARMV4_Exception_abort_handler handler
);
void _ARMV4_Exception_prefetch_abort( void );
void _ARMV4_Exception_undef_default( void );
void _ARMV4_Exception_swi_default( void );
void _ARMV4_Exception_data_abort_default( void );
void _ARMV4_Exception_pref_abort_default( void );
void _ARMV4_Exception_reserved_default( void );
void _ARMV4_Exception_irq_default( void );
void _ARMV4_Exception_fiq_default( void );
static inline uint32_t _ARMV4_Status_irq_enable( void )
{
uint32_t arm_switch_reg;
uint32_t psr;
RTEMS_COMPILER_MEMORY_BARRIER();
__asm__ volatile (
ARM_SWITCH_TO_ARM
"mrs %[psr], cpsr\n"
"bic %[arm_switch_reg], %[psr], #0x80\n"
"msr cpsr, %[arm_switch_reg]\n"
ARM_SWITCH_BACK
: [arm_switch_reg] "=&r" (arm_switch_reg), [psr] "=&r" (psr)
);
return psr;
}
static inline void _ARMV4_Status_restore( uint32_t psr )
{
ARM_SWITCH_REGISTERS;
__asm__ volatile (
ARM_SWITCH_TO_ARM
"msr cpsr, %[psr]\n"
ARM_SWITCH_BACK
: ARM_SWITCH_OUTPUT
: [psr] "r" (psr)
);
RTEMS_COMPILER_MEMORY_BARRIER();
}
#endif /* ARM_MULTILIB_ARCH_V4 */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RTEMS_SCORE_ARMV4_H */
|
/* The IGEN simulator generator for GDB, the GNU Debugger.
Copyright 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Andrew Cagney.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
void print_idecode_issue_function_header
(lf *file,
const char *processor,
function_decl_type decl_type, int nr_prefetched_words);
void print_idecode_globals (lf *file);
void print_idecode_lookups
(lf *file, gen_entry *table, cache_entry *cache_rules);
void print_idecode_body (lf *file, gen_entry *table, const char *result);
/* Output code to do any final checks on the decoded instruction.
This includes things like verifying any on decoded fields have the
correct value and checking that (for floating point) floating point
hardware isn't disabled */
extern void print_idecode_validate
(lf *file, insn_entry * instruction, insn_opcodes *opcode_paths);
|
/*
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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
*/
/// \addtogroup realmd
/// @{
/// \file
#ifndef _AUTHSOCKET_H
#define _AUTHSOCKET_H
#include "Common.h"
#include "Auth/BigNumber.h"
#include "Auth/Sha1.h"
#include "ByteBuffer.h"
#include "BufferedSocket.h"
/// Handle login commands
class AuthSocket: public BufferedSocket
{
public:
const static int s_BYTE_SIZE = 32;
AuthSocket();
~AuthSocket();
void OnAccept() override;
void OnRead() override;
void SendProof(Sha1Hash sha);
void LoadRealmlist(ByteBuffer &pkt, uint32 acctid);
bool _HandleLogonChallenge();
bool _HandleLogonProof();
bool _HandleReconnectChallenge();
bool _HandleReconnectProof();
bool _HandleRealmList();
//data transfer handle for patch
bool _HandleXferResume();
bool _HandleXferCancel();
bool _HandleXferAccept();
void _SetVSFields(const std::string& rI);
private:
BigNumber N, s, g, v;
BigNumber b, B;
BigNumber K;
BigNumber _reconnectProof;
bool _authed;
std::string _login;
std::string _safelogin;
// Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ
// between enUS and enGB, which is important for the patch system
std::string _localizationName;
std::string _os;
uint16 _build;
AccountTypes _accountSecurityLevel;
ACE_HANDLE patch_;
void InitPatch();
};
#endif
/// @}
|
/*
* include/asm-sh/io_bigsur.h
*
* By Dustin McIntire (dustin@sensoria.com) (c)2001
* Derived from io_hd64465.h, which bore the message:
* By Greg Banks <gbanks@pocketpenguins.com>
* (c) 2000 PocketPenguins Inc.
* and from io_hd64461.h, which bore the message:
* Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
*
* May be copied or modified under the terms of the GNU General Public
* License. See linux/COPYING for more information.
*
* IO functions for a Hitachi Big Sur Evaluation Board.
*/
#ifndef _ASM_SH_IO_BIGSUR_H
#define _ASM_SH_IO_BIGSUR_H
#include <linux/types.h>
#include <asm/io_generic.h>
extern unsigned char bigsur_inb(unsigned long port);
extern unsigned short bigsur_inw(unsigned long port);
extern unsigned int bigsur_inl(unsigned long port);
extern void bigsur_outb(unsigned char value, unsigned long port);
extern void bigsur_outw(unsigned short value, unsigned long port);
extern void bigsur_outl(unsigned int value, unsigned long port);
extern unsigned char bigsur_inb_p(unsigned long port);
extern void bigsur_outb_p(unsigned char value, unsigned long port);
extern void bigsur_insb(unsigned long port, void *addr, unsigned long count);
extern void bigsur_insw(unsigned long port, void *addr, unsigned long count);
extern void bigsur_insl(unsigned long port, void *addr, unsigned long count);
extern void bigsur_outsb(unsigned long port, const void *addr, unsigned long count);
extern void bigsur_outsw(unsigned long port, const void *addr, unsigned long count);
extern void bigsur_outsl(unsigned long port, const void *addr, unsigned long count);
extern unsigned long bigsur_isa_port2addr(unsigned long offset);
extern int bigsur_irq_demux(int irq);
extern void bigsur_init_pci(void);
/* Provision for generic secondary demux step -- used by PCMCIA code */
extern void bigsur_register_irq_demux(int irq,
int (*demux)(int irq, void *dev), void *dev);
extern void bigsur_unregister_irq_demux(int irq);
/* Set this variable to 1 to see port traffic */
extern int bigsur_io_debug;
/* Map a range of ports to a range of kernel virtual memory. */
extern void bigsur_port_map(u32 baseport, u32 nports, u32 addr, u8 shift);
extern void bigsur_port_unmap(u32 baseport, u32 nports);
#define mach_port_map bigsur_port_map
#define mach_port_unmap bigsur_port_unmap
#endif /* _ASM_SH_IO_BIGSUR_H */
#ifdef __WANT_IO_DEF
# define __inb bigsur_inb
# define __inw bigsur_inw
# define __inl bigsur_inl
# define __outb bigsur_outb
# define __outw bigsur_outw
# define __outl bigsur_outl
# define __inb_p bigsur_inb_p
# define __inw_p bigsur_inw
# define __inl_p bigsur_inl
# define __outb_p bigsur_outb_p
# define __outw_p bigsur_outw
# define __outl_p bigsur_outl
# define __insb bigsur_insb
# define __insw bigsur_insw
# define __insl bigsur_insl
# define __outsb bigsur_outsb
# define __outsw bigsur_outsw
# define __outsl bigsur_outsl
# define __readb generic_readb
# define __readw generic_readw
# define __readl generic_readl
# define __writeb generic_writeb
# define __writew generic_writew
# define __writel generic_writel
# define __isa_port2addr bigsur_isa_port2addr
# define __ioremap generic_ioremap
# define __iounmap generic_iounmap
#endif
|
#ifndef __TXL_GATE_DTBINDING_H
#define __TXL_GATE_DTBINDING_H
/*0x50*/
#define GCLK_IDX_DDR 0
#define GCLK_IDX_DOS 1
#define GCLK_IDX_RESERVED0 2
#define GCLK_IDX_RESERVED1 3
#define GCLK_IDX_AHB_BRIDGE_ABD 4
#define GCLK_IDX_ISA 5
#define GCLK_IDX_PL310_CBUS 6
#define GCLK_IDX__1200XXX 7
#define GCLK_IDX_SPICC 8
#define GCLK_IDX_I2C 9
#define GCLK_IDX_SAR_ADC 10
#define GCLK_IDX_SMART_CARD_MPEG_DOMAIN 11
#define GCLK_IDX_RANDOM_NUM_GEN 12
#define GCLK_IDX_UART0 13
#define GCLK_IDX_SDHC_ABD 14
#define GCLK_IDX_STREAM 15
#define GCLK_IDX_ASYNC_FIFO 16
#define GCLK_IDX_SDIO_ABD 17
#define GCLK_IDX_AUD_BUF_ABD 18
#define GCLK_IDX_HIU_PARSER 19
#define GCLK_IDX_RESERVED2 20
#define GCLK_IDX_HDMI_RX_ABD 21
#define GCLK_IDX_RESERVED3 22
#define GCLK_IDX_ASSIST_MISC 23
#define GCLK_IDX_EMMCA 24
#define GCLK_IDX_EMMCB 25
#define GCLK_IDX_EMMCC 26
#define GCLK_IDX_DMA 27
#define GCLK_IDX_ACODEC 28
#define GCLK_IDX_RESERVED9 29
#define GCLK_IDX_SPI 30
/*0x51*/
#define GCLK_IDX_RESERVED11 32
#define GCLK_IDX_RESERVED12 33
#define GCLK_IDX_AUD_IN 34
#define GCLK_IDX_ETHERNET 35
#define GCLK_IDX_DEMUX 36
#define GCLK_IDX_RESERVED13 37
#define GCLK_IDX_AIU_AI_TOP_GLUE 38
#define GCLK_IDX_AIU_IEC958 39
#define GCLK_IDX_AIU_I2S_OUT 40
#define GCLK_IDX_AIU_AMCLK_MEASURE 41
#define GCLK_IDX_AIU_AIFIFO2 42
#define GCLK_IDX_AIU_AUD_MIXER 43
#define GCLK_IDX_AIU_MIXER_REG 44
#define GCLK_IDX_AIU_ADC 45
#define GCLK_IDX_BLK_MOV 46
#define GCLK_IDX_AIU_TOP_LEVEL 47
#define GCLK_IDX_UART1 48
#define GCLK_IDX_RESERVED14 49
#define GCLK_IDX_CSI_DIG_CLKIN_ABD 50
#define GCLK_IDX_RESERVED15 51
#define GCLK_IDX_GE2D 52
#define GCLK_IDX_USB0 53
#define GCLK_IDX_USB1 54
#define GCLK_IDX_RESET 55
#define GCLK_IDX_NAND_ABD 56
#define GCLK_IDX_HIU_PARSER_TOP 57
#define GCLK_IDX_USB_GENERAL 58
#define GCLK_IDX_RESERVED16 59
#define GCLK_IDX_RESERVED17 60
#define GCLK_IDX_AHB_ARB0 61
#define GCLK_IDX_EFUSE 62
#define GCLK_IDX_ROM_CLK 63
/*******0x52********/
#define GCLK_IDX_RESERVED18 64
#define GCLK_IDX_AHB_DATA_BUS 65
#define GCLK_IDX_AHB_CONTROL_BUS 66
#define GCLK_IDX_HDMI_INTR_SYNC 67
#define GCLK_IDX_HDMI_PCLK 68
#define GCLK_IDX_PDM 69
#define GCLK_IDX_BT656 70
#define GCLK_IDX_BT656_2 71
#define GCLK_IDX_MISC_USB1_TO_DDR 72
#define GCLK_IDX_MISC_USB0_TO_DDR 73
#define GCLK_IDX_AIU_PCLK 74
#define GCLK_IDX_MMC_PCLK 75
#define GCLK_IDX_MISC_DVIN 76
#define GCLK_IDX_RESERVED22 77
#define GCLK_IDX_RESERVED23 78
#define GCLK_IDX_UART2 79
#define GCLK_IDX_RESERVED24 80
#define GCLK_IDX_RESERVED25 81
#define GCLK_IDX_RESERVED26 82
#define GCLK_IDX_RESERVED27 83
#define GCLK_IDX_RESERVED28 84
#define GCLK_IDX_UART3 85
#define GCLK_IDX_SARADC 86
#define GCLK_IDX_RESERVED30 87
#define GCLK_IDX_RESERVED31 88
#define GCLK_IDX_VPU_INTR 89
#define GCLK_IDX_SECURE_AHP_APB3 90
#define GCLK_IDX_RESERVED32 91
#define GCLK_IDX_RESERVED33 92
#define GCLK_IDX_CLK81_TO_A9_ABD 93
#define GCLK_IDX_GIC 94
#define GCLK_IDX_RESERVED35 95
/*0x1053 all reserved*/
/*****54***********/
#define GCLK_IDX_RESERVED36 (96+32)
#define GCLK_IDX_VCLK2_VENCI (97+32)
#define GCLK_IDX_VCLK2_VENCI1 (98+32)
#define GCLK_IDX_VCLK2_VENCP (99+32)
#define GCLK_IDX_VCLK2_VENCP1 (100+32)
#define GCLK_IDX_VCLK2_VENCT (101+32)
#define GCLK_IDX_VCLK2_VENCT1 (102+32)
#define GCLK_IDX_VCLK2_OTHER (103+32)
#define GCLK_IDX_VCLK2_ENCI (104+32)
#define GCLK_IDX_VCLK2_ENCP (105+32)
#define GCLK_IDX_DAC_CLK (106+32)
#define GCLK_IDX_RESERVED37 (107+32)
#define GCLK_IDX_RESERVED38 (108+32)
#define GCLK_IDX_RESERVED39 (109+32)
#define GCLK_IDX_AIU_AOCLK (110+32)
#define GCLK_IDX_RESERVED40 (111+32)
#define GCLK_IDX_AIU_ICE958_AMCLK (112+32)
#define GCLK_IDX_RESERVED41 (113+32)
#define GCLK_IDX_RESERVED42 (114+32)
#define GCLK_IDX_RESERVED43 (115+32)
#define GCLK_IDX_ENC480P (116+32)
#define GCLK_IDX_RANDOM_NUM_GEN1 (117+32)
#define GCLK_IDX_VCLK2_ENCT (118+32)
#define GCLK_IDX_VCLK2_ENCL (119+32)
#define GCLK_IDX_MMC_CLK (120+32)
#define GCLK_IDX_VCLK2_VENCL (121+32)
#define GCLK_IDX_VCLK2_OTHER1 (122+32)
#define GCLK_IDX_RESERVED44 (123+32)
#define GCLK_IDX_RESERVED45 (124+32)
#define GCLK_IDX_RESERVED46 (125+32)
#define GCLK_IDX_RESERVED47 (126+32)
#define GCLK_IDX_EDP_CLK_ABD (127+32)
/*************0x1055***************/
#define GCLK_IDX_AO_CPU (128+32)
#define GCLK_IDX_AHB_SRAM (129+32)
#define GCLK_IDX_AHB_BUS (130+32)
#define GCLK_IDX_AO_REGS (131+32)
#define GCLK_IDX_AO_I2C (132+32)
#endif
|
/*
* heavily based on code from Gedit
*
* Copyright (C) 2002-2005 Paolo Maggi
*
* 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.
*
* The Rhythmbox authors hereby grant permission for non-GPL compatible
* GStreamer plugins to be used and distributed together with GStreamer
* and Rhythmbox. This permission is above and beyond the permissions granted
* by the GPL license by which Rhythmbox is covered. If you modify this code
* you may extend this exception to your version of the code, but you are not
* obligated to do so. If you do not wish to do so, delete this exception
* statement from your 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.
*/
#ifndef __RB_PLUGIN_MANAGER_H__
#define __RB_PLUGIN_MANAGER_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define RB_TYPE_PLUGIN_MANAGER (rb_plugin_manager_get_type())
#define RB_PLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), RB_TYPE_PLUGIN_MANAGER, RBPluginManager))
#define RB_PLUGIN_MANAGER_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), RB_TYPE_PLUGIN_MANAGER, RBPluginManager const))
#define RB_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), RB_TYPE_PLUGIN_MANAGER, RBPluginManagerClass))
#define RB_IS_PLUGIN_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), RB_TYPE_PLUGIN_MANAGER))
#define RB_IS_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RB_TYPE_PLUGIN_MANAGER))
#define RB_PLUGIN_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), RB_TYPE_PLUGIN_MANAGER, RBPluginManagerClass))
/* Private structure type */
typedef struct _RBPluginManagerPrivate RBPluginManagerPrivate;
/*
* Main object structure
*/
typedef struct
{
GtkVBox vbox;
/*< private > */
RBPluginManagerPrivate *priv;
} RBPluginManager;
/*
* Class definition
*/
typedef struct
{
GtkVBoxClass parent_class;
} RBPluginManagerClass;
/*
* Public methods
*/
GType rb_plugin_manager_get_type (void) G_GNUC_CONST;
GtkWidget *rb_plugin_manager_new (void);
G_END_DECLS
#endif /* __RB_PLUGIN_MANAGER_H__ */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef BACKENDS_PLATFORM_IOS7_IOS7_COMMON_H
#define BACKENDS_PLATFORM_IOS7_IOS7_COMMON_H
#include "graphics/surface.h"
// #define ENABLE_IOS7_SCALERS
enum InputEvent {
kInputMouseDown,
kInputMouseUp,
kInputMouseDragged,
kInputMouseSecondDragged,
kInputMouseSecondDown,
kInputMouseSecondUp,
kInputOrientationChanged,
kInputKeyPressed,
kInputApplicationSuspended,
kInputApplicationResumed,
kInputSwipe,
kInputTap
};
enum ScreenOrientation {
kScreenOrientationPortrait,
kScreenOrientationLandscape,
kScreenOrientationFlippedLandscape
};
enum UIViewSwipeDirection {
kUIViewSwipeUp = 1,
kUIViewSwipeDown = 2,
kUIViewSwipeLeft = 4,
kUIViewSwipeRight = 8
};
enum UIViewTapDescription {
kUIViewTapSingle = 1,
kUIViewTapDouble = 2
};
enum GraphicsModes {
kGraphicsModeNone = 1,
kGraphicsMode2xSaI,
kGraphicsModeSuper2xSaI,
kGraphicsModeSuperEagle,
kGraphicsModeAdvMame2x,
kGraphicsModeAdvMame3x,
kGraphicsModeHQ2x,
kGraphicsModeHQ3x,
kGraphicsModeTV2x,
kGraphicsModeDotMatrix
};
struct VideoContext {
VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false),
overlayWidth(), overlayHeight(), mouseX(), mouseY(),
mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(),
mouseIsVisible(), graphicsMode(kGraphicsModeNone), filtering(false), shakeOffsetY() {
}
// Game screen state
bool asprectRatioCorrection;
uint screenWidth, screenHeight;
Graphics::Surface screenTexture;
// Overlay state
bool overlayVisible;
uint overlayWidth, overlayHeight;
Graphics::Surface overlayTexture;
// Mouse cursor state
uint mouseX, mouseY;
int mouseHotspotX, mouseHotspotY;
uint mouseWidth, mouseHeight;
bool mouseIsVisible;
Graphics::Surface mouseTexture;
// Misc state
GraphicsModes graphicsMode;
bool filtering;
int shakeOffsetY;
};
struct InternalEvent {
InternalEvent() : type(), value1(), value2() {}
InternalEvent(InputEvent t, int v1, int v2) : type(t), value1(v1), value2(v2) {}
InputEvent type;
int value1, value2;
};
// On the ObjC side
extern int iOS7_argc;
extern char **iOS7_argv;
void iOS7_updateScreen();
bool iOS7_fetchEvent(InternalEvent *event);
bool iOS7_isBigDevice();
void iOS7_buildSharedOSystemInstance();
void iOS7_main(int argc, char **argv);
const char *iOS7_getDocumentsDir();
bool iOS7_touchpadModeEnabled();
uint getSizeNextPOT(uint size);
#endif
|
/*
pr41750.c from the execute part of the gcc torture tests.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma std_c99
#endif
/* PR 41750 - IPA-SRA used to pass hash->sgot by value rather than by
reference. */
struct bfd_link_hash_table
{
int hash;
};
struct foo_link_hash_table
{
struct bfd_link_hash_table root;
int *dynobj;
int *sgot;
};
struct foo_link_info
{
struct foo_link_hash_table *hash;
};
extern void abort (void);
int
foo_create_got_section (int *abfd, struct foo_link_info *info)
{
info->hash->sgot = abfd;
return 1;
}
static int *
get_got (int *abfd, struct foo_link_info *info,
struct foo_link_hash_table *hash)
{
int *got;
int *dynobj;
got = hash->sgot;
if (!got)
{
dynobj = hash->dynobj;
if (!dynobj)
hash->dynobj = dynobj = abfd;
if (!foo_create_got_section (dynobj, info))
return 0;
got = hash->sgot;
}
return got;
}
int *
elf64_ia64_check_relocs (int *abfd, struct foo_link_info *info)
{
return get_got (abfd, info, info->hash);
}
struct foo_link_info link_info;
struct foo_link_hash_table hash;
int abfd;
void
testTortureExecute (void)
{
link_info.hash = &hash;
if (elf64_ia64_check_relocs (&abfd, &link_info) != &abfd)
ASSERT (0);
return;
}
|
#undef CONFIG_USB_LCD
|
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*
* @(#)extern.h 8.3 (Berkeley) 6/4/94
*/
#include "../btree/extern.h"
#define __rec_close __kdb2_rec_close
#define __rec_delete __kdb2_rec_delete
#define __rec_dleaf __kdb2_rec_dleaf
#define __rec_fd __kdb2_rec_fd
#define __rec_fmap __kdb2_rec_fmap
#define __rec_fout __kdb2_rec_fout
#define __rec_fpipe __kdb2_rec_fpipe
#define __rec_get __kdb2_rec_get
#define __rec_iput __kdb2_rec_iput
#define __rec_put __kdb2_rec_put
#define __rec_ret __kdb2_rec_ret
#define __rec_search __kdb2_rec_search
#define __rec_seq __kdb2_rec_seq
#define __rec_sync __kdb2_rec_sync
#define __rec_vmap __kdb2_rec_vmap
#define __rec_vout __kdb2_rec_vout
#define __rec_vpipe __kdb2_rec_vpipe
int __rec_close __P((DB *));
int __rec_delete __P((const DB *, const DBT *, u_int));
int __rec_dleaf __P((BTREE *, PAGE *, u_int32_t));
int __rec_fd __P((const DB *));
int __rec_fmap __P((BTREE *, recno_t));
int __rec_fout __P((BTREE *));
int __rec_fpipe __P((BTREE *, recno_t));
int __rec_get __P((const DB *, const DBT *, DBT *, u_int));
int __rec_iput __P((BTREE *, recno_t, const DBT *, u_int));
int __rec_put __P((const DB *dbp, DBT *, const DBT *, u_int));
int __rec_ret __P((BTREE *, EPG *, recno_t, DBT *, DBT *));
EPG *__rec_search __P((BTREE *, recno_t, enum SRCHOP));
int __rec_seq __P((const DB *, DBT *, DBT *, u_int));
int __rec_sync __P((const DB *, u_int));
int __rec_vmap __P((BTREE *, recno_t));
int __rec_vout __P((BTREE *));
int __rec_vpipe __P((BTREE *, recno_t));
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtSCriptTools module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** 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 http://www.qt.io/terms-conditions. For further
** information use the contact form at http://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 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSCRIPTBREAKPOINTSMODEL_P_H
#define QSCRIPTBREAKPOINTSMODEL_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 <QtCore/qabstractitemmodel.h>
#include "qscriptbreakpointdata_p.h"
QT_BEGIN_NAMESPACE
class QScriptDebuggerJobSchedulerInterface;
class QScriptDebuggerCommandSchedulerInterface;
class QScriptBreakpointsModelPrivate;
class Q_AUTOTEST_EXPORT QScriptBreakpointsModel
: public QAbstractItemModel
{
Q_OBJECT
public:
QScriptBreakpointsModel(QScriptDebuggerJobSchedulerInterface *jobScheduler,
QScriptDebuggerCommandSchedulerInterface *commandScheduler,
QObject *parent = 0);
~QScriptBreakpointsModel();
void setBreakpoint(const QScriptBreakpointData &data);
void setBreakpointData(int id, const QScriptBreakpointData &data);
void deleteBreakpoint(int id);
void addBreakpoint(int id, const QScriptBreakpointData &data);
void modifyBreakpoint(int id, const QScriptBreakpointData &data);
void removeBreakpoint(int id);
int breakpointIdAt(int row) const;
QScriptBreakpointData breakpointDataAt(int row) const;
QScriptBreakpointData breakpointData(int id) const;
int resolveBreakpoint(qint64 scriptId, int lineNumber) const;
int resolveBreakpoint(const QString &fileName, int lineNumber) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &child) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
QVariant headerData(int section, Qt::Orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
private:
Q_DECLARE_PRIVATE(QScriptBreakpointsModel)
Q_DISABLE_COPY(QScriptBreakpointsModel)
};
QT_END_NAMESPACE
#endif
|
/* -*- c++ -*- */
/*
* Copyright 2008,2009,2013 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_GR_WAVFILE_SINK_H
#define INCLUDED_GR_WAVFILE_SINK_H
#include <gnuradio/blocks/api.h>
#include <gnuradio/blocks/wavfile.h>
#include <gnuradio/sync_block.h>
namespace gr {
namespace blocks {
/*!
* \brief Write stream to a Microsoft PCM (.wav) file.
* \ingroup audio_blk
*
* \details
* Values must be floats within [-1;1].
* Check gr_make_wavfile_sink() for extra info.
*/
class BLOCKS_API wavfile_sink : virtual public sync_block
{
public:
// gr::blocks::wavfile_sink::sptr
typedef std::shared_ptr<wavfile_sink> sptr;
/*
* \param filename The .wav file to be opened
* \param n_channels Number of channels (2 = stereo or I/Q output)
* \param sample_rate Sample rate [S/s]
* \param format Output format (WAV, FLAC, Ogg Vorbis, RF64)
* \param subformat Bits per sample
* \param append Append to existing file
*/
static sptr make(const char* filename,
int n_channels,
unsigned int sample_rate,
wavfile_format_t format,
wavfile_subformat_t subformat,
bool append = false);
/*!
* \brief Opens a new file and writes a WAV header. Thread-safe.
*/
virtual bool open(const char* filename) = 0;
/*!
* \brief Closes the currently active file and completes the WAV
* header. Thread-safe.
*/
virtual void close() = 0;
/*!
* \brief Set the sample rate. This will not affect the WAV file
* currently opened. Any following open() calls will use this new
* sample rate.
*/
virtual void set_sample_rate(unsigned int sample_rate) = 0;
/*!
* \brief Set bits per sample. This will not affect the WAV file
* currently opened (see set_sample_rate()). If the value is
* neither 8 nor 16, the call is ignored and the current value
* is kept.
*/
virtual void set_bits_per_sample(int bits_per_sample) = 0;
/*!
* \brief Enable appending to an existing file instead of
* creating it. This will not affect the WAV file currently
* opened (see set_sample_rate()).
*/
virtual void set_append(bool append) = 0;
};
} /* namespace blocks */
} /* namespace gr */
#endif /* INCLUDED_GR_WAVFILE_SINK_H */
|
//===-- llvm/MC/MCInst.h - MCInst class -------------------------*- 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 declaration of the MCInst and MCOperand classes, which
// is the basic representation used to represent low-level machine code
// instructions.
//
//===----------------------------------------------------------------------===//
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
#ifndef CS_MCINST_H
#define CS_MCINST_H
#include "include/capstone/capstone.h"
typedef struct MCInst MCInst;
typedef struct cs_struct cs_struct;
typedef struct MCOperand MCOperand;
/// MCOperand - Instances of this class represent operands of the MCInst class.
/// This is a simple discriminated union.
struct MCOperand {
enum {
kInvalid = 0, ///< Uninitialized.
kRegister, ///< Register operand.
kImmediate, ///< Immediate operand.
kFPImmediate, ///< Floating-point immediate operand.
} MachineOperandType;
unsigned char Kind;
union {
unsigned RegVal;
int64_t ImmVal;
double FPImmVal;
};
};
bool MCOperand_isValid(const MCOperand *op);
bool MCOperand_isReg(const MCOperand *op);
bool MCOperand_isImm(const MCOperand *op);
bool MCOperand_isFPImm(const MCOperand *op);
bool MCOperand_isInst(const MCOperand *op);
/// getReg - Returns the register number.
unsigned MCOperand_getReg(const MCOperand *op);
/// setReg - Set the register number.
void MCOperand_setReg(MCOperand *op, unsigned Reg);
int64_t MCOperand_getImm(MCOperand *op);
void MCOperand_setImm(MCOperand *op, int64_t Val);
double MCOperand_getFPImm(const MCOperand *op);
void MCOperand_setFPImm(MCOperand *op, double Val);
const MCInst *MCOperand_getInst(const MCOperand *op);
void MCOperand_setInst(MCOperand *op, const MCInst *Val);
// create Reg operand in the next slot
void MCOperand_CreateReg0(MCInst *inst, unsigned Reg);
// create Reg operand use the last-unused slot
MCOperand *MCOperand_CreateReg1(MCInst *inst, unsigned Reg);
// create Imm operand in the next slot
void MCOperand_CreateImm0(MCInst *inst, int64_t Val);
// create Imm operand in the last-unused slot
MCOperand *MCOperand_CreateImm1(MCInst *inst, int64_t Val);
/// MCInst - Instances of this class represent a single low-level machine
/// instruction.
struct MCInst {
unsigned OpcodePub;
uint8_t size; // number of operands
bool has_imm; // indicate this instruction has an X86_OP_IMM operand - used for ATT syntax
uint8_t op1_size; // size of 1st operand - for X86 Intel syntax
unsigned Opcode;
MCOperand Operands[48];
cs_insn *flat_insn; // insn to be exposed to public
uint64_t address; // address of this insn
cs_struct *csh; // save the main csh
uint8_t x86opsize; // opsize for [mem] operand
// (Optional) instruction prefix, which can be up to 4 bytes.
// A prefix byte gets value 0 when irrelevant.
// This is copied from cs_x86 struct
uint8_t x86_prefix[4];
uint8_t imm_size; // immediate size for X86_OP_IMM operand
bool writeback; // writeback for ARM
// operand access index for list of registers sharing the same access right (for ARM)
uint8_t ac_idx;
uint8_t popcode_adjust; // Pseudo X86 instruction adjust
char assembly[8]; // for special instruction, so that we dont need printer
unsigned char evm_data[32]; // for EVM PUSH operand
uint8_t xAcquireRelease; // X86 xacquire/xrelease
};
void MCInst_Init(MCInst *inst);
void MCInst_clear(MCInst *inst);
// do not free operand after inserting
void MCInst_insert0(MCInst *inst, int index, MCOperand *Op);
void MCInst_setOpcode(MCInst *inst, unsigned Op);
unsigned MCInst_getOpcode(const MCInst*);
void MCInst_setOpcodePub(MCInst *inst, unsigned Op);
unsigned MCInst_getOpcodePub(const MCInst*);
MCOperand *MCInst_getOperand(MCInst *inst, unsigned i);
unsigned MCInst_getNumOperands(const MCInst *inst);
// This addOperand2 function doesnt free Op
void MCInst_addOperand2(MCInst *inst, MCOperand *Op);
#endif
|
/*
Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
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.
MagickCore token methods.
*/
#ifndef _MAGICKCORE_TOKEN_H
#define _MAGICKCORE_TOKEN_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/*
Typedef declarations.
*/
typedef struct _TokenInfo
TokenInfo;
extern MagickExport int
Tokenizer(TokenInfo *,const unsigned int,char *,const size_t,const char *,
const char *,const char *,const char *,const char,char *,int *,char *);
extern MagickExport MagickBooleanType
GlobExpression(const char *,const char *,const MagickBooleanType),
IsGlob(const char *),
IsMagickTrue(const char *);
extern MagickExport TokenInfo
*AcquireTokenInfo(void),
*DestroyTokenInfo(TokenInfo *);
extern MagickExport void
GetMagickToken(const char *,const char **,char *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
|
/* strerror.c - Describing an error code.
Copyright (C) 2003 g10 Code GmbH
This file is part of libgpg-error.
libgpg-error 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.
libgpg-error 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 libgpg-error; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <gpg-error.h>
#include "gettext.h"
#include "err-codes.h"
/* Return a pointer to a string containing a description of the error
code in the error value ERR. This function is not thread-safe. */
const char *
_gpg_strerror (gpg_error_t err)
{
gpg_err_code_t code = gpg_err_code (err);
if (code & GPG_ERR_SYSTEM_ERROR)
{
int no = gpg_err_code_to_errno (code);
if (no)
return strerror (no);
else
code = GPG_ERR_UNKNOWN_ERRNO;
}
return dgettext (PACKAGE, msgstr + msgidx[msgidxof (code)]);
}
#ifdef HAVE_STRERROR_R
#ifdef STRERROR_R_CHAR_P
/* The GNU C library and probably some other systems have this weird
variant of strerror_r. */
/* Return a dynamically allocated string in *STR describing the system
error NO. If this call succeeds, return 1. If this call fails due
to a resource shortage, set *STR to NULL and return 1. If this
call fails because the error number is not valid, don't set *STR
and return 0. */
static int
system_strerror_r (int no, char *buf, size_t buflen)
{
char *errstr;
errstr = strerror_r (no, buf, buflen);
if (errstr != buf)
{
size_t errstr_len = strlen (errstr) + 1;
size_t cpy_len = errstr_len < buflen ? errstr_len : buflen;
memcpy (buf, errstr, cpy_len);
return cpy_len == errstr_len ? 0 : ERANGE;
}
else
{
/* We can not tell if the buffer was large enough, but we can
try to make a guess. */
if (strlen (buf) + 1 >= buflen)
return ERANGE;
return 0;
}
}
#else /* STRERROR_R_CHAR_P */
/* Now the POSIX version. */
static int
system_strerror_r (int no, char *buf, size_t buflen)
{
return strerror_r (no, buf, buflen);
}
#endif /* STRERROR_R_CHAR_P */
#else /* HAVE_STRERROR_H */
/* Without strerror_r(), we can still provide a non-thread-safe
version. Maybe we are even lucky and the system's strerror() is
already thread-safe. */
static int
system_strerror_r (int no, char *buf, size_t buflen)
{
char *errstr = strerror (no);
if (!errstr)
{
int saved_errno = errno;
if (saved_errno != EINVAL)
snprintf (buf, buflen, "strerror failed: %i\n", errno);
return saved_errno;
}
else
{
size_t errstr_len = strlen (errstr) + 1;
size_t cpy_len = errstr_len < buflen ? errstr_len : buflen;
memcpy (buf, errstr, cpy_len);
return cpy_len == errstr_len ? 0 : ERANGE;
}
}
#endif
/* Return the error string for ERR in the user-supplied buffer BUF of
size BUFLEN. This function is, in contrast to gpg_strerror,
thread-safe if a thread-safe strerror_r() function is provided by
the system. If the function succeeds, 0 is returned and BUF
contains the string describing the error. If the buffer was not
large enough, ERANGE is returned and BUF contains as much of the
beginning of the error string as fits into the buffer. */
int
_gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen)
{
gpg_err_code_t code = gpg_err_code (err);
const char *errstr;
size_t errstr_len;
size_t cpy_len;
if (code & GPG_ERR_SYSTEM_ERROR)
{
int no = gpg_err_code_to_errno (code);
if (no)
{
int system_err = system_strerror_r (no, buf, buflen);
if (system_err != EINVAL)
{
if (buflen)
buf[buflen - 1] = '\0';
return system_err;
}
}
code = GPG_ERR_UNKNOWN_ERRNO;
}
errstr = dgettext (PACKAGE, msgstr + msgidx[msgidxof (code)]);
errstr_len = strlen (errstr) + 1;
cpy_len = errstr_len < buflen ? errstr_len : buflen;
memcpy (buf, errstr, cpy_len);
if (buflen)
buf[buflen - 1] = '\0';
return cpy_len == errstr_len ? 0 : ERANGE;
}
|
#ifndef _ASM_X86_TYPES_H
#define _ASM_X86_TYPES_H
#define dma_addr_t dma_addr_t
#include <asm-generic/types.h>
#endif /* _ASM_X86_TYPES_H */
|
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACORE_CONFUSEDGENERATOR_H
#define ACORE_CONFUSEDGENERATOR_H
#include "MovementGenerator.h"
#include "Timer.h"
#define MAX_CONF_WAYPOINTS 24 //! Allows a twelve second confusion if i_nextMove always is the absolute minimum timer.
template<class T>
class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator<T> >
{
public:
explicit ConfusedMovementGenerator() : i_nextMoveTime(1) {}
void DoInitialize(T*);
void DoFinalize(T*);
void DoReset(T*);
bool DoUpdate(T*, uint32);
MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; }
private:
void _InitSpecific(T*, bool&, bool&);
TimeTracker i_nextMoveTime;
float i_waypoints[MAX_CONF_WAYPOINTS + 1][3];
uint32 i_nextMove;
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://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 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef HIGHLIGHTDEFINITIONHANDLER_H
#define HIGHLIGHTDEFINITIONHANDLER_H
#include <QString>
#include <QSharedPointer>
#include <QStack>
#include <QXmlDefaultHandler>
namespace TextEditor {
namespace Internal {
class KeywordList;
class Context;
class Rule;
class HighlightDefinition;
class HighlightDefinitionHandler : public QXmlDefaultHandler
{
public:
HighlightDefinitionHandler(const QSharedPointer<HighlightDefinition> &definition);
~HighlightDefinitionHandler();
bool startDocument();
bool endDocument();
bool startElement(const QString &namespaceURI, const QString &localName,
const QString &qName, const QXmlAttributes &atts);
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
bool characters(const QString &ch);
private:
void listElementStarted(const QXmlAttributes &atts);
void itemElementStarted();
void contextElementStarted(const QXmlAttributes &atts);
void itemDataElementStarted(const QXmlAttributes &atts) const;
void commentElementStarted(const QXmlAttributes &atts) const;
void keywordsElementStarted(const QXmlAttributes &atts) const;
void foldingElementStarted(const QXmlAttributes &atts) const;
void ruleElementStarted(const QXmlAttributes &atts, const QSharedPointer<Rule> &rule);
// Specific rules.
void detectCharStarted(const QXmlAttributes &atts);
void detect2CharsStarted(const QXmlAttributes &atts);
void anyCharStarted(const QXmlAttributes &atts);
void stringDetectedStarted(const QXmlAttributes &atts);
void regExprStarted(const QXmlAttributes &atts);
void keywordStarted(const QXmlAttributes &atts);
void intStarted(const QXmlAttributes &atts);
void floatStarted(const QXmlAttributes &atts);
void hlCOctStarted(const QXmlAttributes &atts);
void hlCHexStarted(const QXmlAttributes &atts);
void hlCStringCharStarted(const QXmlAttributes &atts);
void hlCCharStarted(const QXmlAttributes &atts);
void rangeDetectStarted(const QXmlAttributes &atts);
void lineContinue(const QXmlAttributes &atts);
void includeRulesStarted(const QXmlAttributes &atts);
void detectSpacesStarted(const QXmlAttributes &atts);
void detectIdentifier(const QXmlAttributes &atts);
void processIncludeRules() const;
void processIncludeRules(const QSharedPointer<Context> &context) const;
QSharedPointer<HighlightDefinition> m_definition;
bool m_processingKeyword;
QString m_currentKeyword;
QSharedPointer<KeywordList> m_currentList;
QSharedPointer<Context> m_currentContext;
QStack<QSharedPointer<Rule> > m_currentRule;
bool m_initialContext;
};
} // namespace Internal
} // namespace TextEditor
#endif // HIGHLIGHTDEFINITIONHANDLER_H
|
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXDE-Qt - a lightweight, Qt based, desktop toolset
* http://razor-qt.org
* http://lxqt.org
*
* Copyright: 2011 Razor team
* 2014 LXQt team
* Authors:
* Alexander Sokoloff <sokoloff.a@gmail.com>
* Kuzma Shapran <kuzma.shapran@gmail.com>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#ifndef LXQTTASKBUTTON_H
#define LXQTTASKBUTTON_H
#include <QToolButton>
#include <QProxyStyle>
#include "../panel/ilxqtpanel.h"
class QPainter;
class QPalette;
class QMimeData;
class LXQtTaskGroup;
class LXQtTaskBar;
class LeftAlignedTextStyle : public QProxyStyle
{
using QProxyStyle::QProxyStyle;
public:
virtual void drawItemText(QPainter * painter, const QRect & rect, int flags
, const QPalette & pal, bool enabled, const QString & text
, QPalette::ColorRole textRole = QPalette::NoRole) const override;
};
class LXQtTaskButton : public QToolButton
{
Q_OBJECT
Q_PROPERTY(Qt::Corner origin READ origin WRITE setOrigin)
public:
explicit LXQtTaskButton(const WId window, LXQtTaskBar * taskBar, QWidget *parent = 0);
virtual ~LXQtTaskButton();
bool isApplicationHidden() const;
bool isApplicationActive() const;
WId windowId() const { return mWindow; }
bool hasUrgencyHint() const { return mUrgencyHint; }
void setUrgencyHint(bool set);
bool isOnDesktop(int desktop) const;
bool isOnCurrentScreen() const;
bool isMinimized() const;
void updateText();
Qt::Corner origin() const;
virtual void setAutoRotation(bool value, ILXQtPanel::Position position);
LXQtTaskBar * parentTaskBar() const {return mParentTaskBar;}
void refreshIconGeometry(QRect const & geom);
static QString mimeDataFormat() { return QLatin1String("lxqt/lxqttaskbutton"); }
/*! \return true if this buttom received DragEnter event (and no DragLeave event yet)
* */
bool hasDragAndDropHover() const;
public slots:
void raiseApplication();
void minimizeApplication();
void maximizeApplication();
void deMaximizeApplication();
void shadeApplication();
void unShadeApplication();
void closeApplication();
void moveApplicationToDesktop();
void setApplicationLayer();
void setOrigin(Qt::Corner);
void updateIcon();
protected:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dragMoveEvent(QDragMoveEvent * event);
virtual void dragLeaveEvent(QDragLeaveEvent *event);
virtual void dropEvent(QDropEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
virtual void contextMenuEvent(QContextMenuEvent *event);
void paintEvent(QPaintEvent *);
void setWindowId(WId wid) {mWindow = wid;}
virtual QMimeData * mimeData();
static bool sDraggging;
inline ILXQtPanelPlugin * plugin() const { return mPlugin; }
private:
WId mWindow;
bool mUrgencyHint;
QPoint mDragStartPosition;
Qt::Corner mOrigin;
QPixmap mPixmap;
bool mDrawPixmap;
LXQtTaskBar * mParentTaskBar;
ILXQtPanelPlugin * mPlugin;
// Timer for when draggind something into a button (the button's window
// must be activated so that the use can continue dragging to the window
QTimer * mDNDTimer;
private slots:
void activateWithDraggable();
signals:
void dropped(QObject * dragSource, QPoint const & pos);
void dragging(QObject * dragSource, QPoint const & pos);
};
typedef QHash<WId,LXQtTaskButton*> LXQtTaskButtonHash;
#endif // LXQTTASKBUTTON_H
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** 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.
**
** 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.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef IMPORT_H
#define IMPORT_H
#include <QString>
#include <QStringList>
#include "corelib_global.h"
namespace QmlDesigner {
class CORESHARED_EXPORT Import
{
public:
static Import createLibraryImport(const QString &url, const QString &version = QString(), const QString &alias = QString(), const QStringList &importPaths = QStringList());
static Import createFileImport(const QString &file, const QString &version = QString(), const QString &alias = QString(), const QStringList &importPaths = QStringList());
static Import empty();
bool isEmpty() const { return m_url.isEmpty() && m_file.isEmpty(); }
bool isFileImport() const { return m_url.isEmpty() && !m_file.isEmpty(); }
bool isLibraryImport() const { return !m_url.isEmpty() && m_file.isEmpty(); }
bool hasVersion() const { return !m_version.isEmpty(); }
bool hasAlias() const { return !m_alias.isEmpty(); }
QString url() const { return m_url; }
QString file() const { return m_file; }
QString version() const { return m_version; }
QString alias() const { return m_alias; }
QStringList importPaths() const { return m_importPathList; }
QString toString(bool addSemicolon = false, bool skipAlias = false) const;
bool operator==(const Import &other) const;
private:
Import(const QString &url, const QString &file, const QString &version, const QString &alias, const QStringList &importPaths);
private:
QString m_url;
QString m_file;
QString m_version;
QString m_alias;
QStringList m_importPathList;
};
CORESHARED_EXPORT uint qHash(const Import &import);
} // namespace QmlDesigner
#endif // IMPORT_H
|
extern const unsigned char FMDBVersionString[];
extern const double FMDBVersionNumber;
const unsigned char FMDBVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:FMDB PROJECT:Pods-1" "\n";
const double FMDBVersionNumber __attribute__ ((used)) = (double)1.;
|
/*
* Copyright (C) 2002-2007 Akira Nukada. All rights reserved.
* Copyright (C) 2002-2007 The SSI Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE SSI PROJECT ``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 SSI PROJECT BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "libfftss.h"
static inline void kern_r4_fma_n_f(double *restrict o0,
double *restrict o1,
double *restrict o2,
double *restrict o3,
double *i0,
double *i1,
double *i2,
double *i3,
double *w,
double *w2,
long bsize, long blocks)
{
long i, j;
for (i = 0; i < blocks; i++) {
double wr1, wi1;
double wr2, wi2;
double wr3, wi13;
wr1 = w[2 * i * bsize]; wi1 = w[2 * i * bsize + 1];
wr2 = w[4 * i * bsize]; wi2 = w[4 * i * bsize + 1];
wr3 = w2[2 * i * bsize]; wi13 = w2[2 * i * bsize + 1];
for (j = 0; j < bsize; j++) {
double pr1, pi1;
double pr2, pi2;
double pr3, pi3;
double qr0, qi0;
double qr1, qi1;
double qr2, qi2;
double qr3, qi3;
pr1 = i1[2 * j] * wr1 + i1[2 * j + 1];
pi1 = i1[2 * j + 1] * wr1 - i1[2 * j];
pr2 = i2[2 * j] * wr2 + i2[2 * j + 1];
pi2 = i2[2 * j + 1] * wr2 - i2[2 * j];
pr3 = i3[2 * j] * wr3 + i3[2 * j + 1];
pi3 = i3[2 * j + 1] * wr3 - i3[2 * j];
qr0 = i0[2 * j] + pr2 * wi2; qr2 = i0[2 * j] - pr2 * wi2;
qi0 = i0[2 * j + 1] + pi2 * wi2; qi2 = i0[2 * j + 1] - pi2 * wi2;
qr1 = pr1 + pr3 * wi13; qr3 = pr1 - pr3 * wi13;
qi1 = pi1 + pi3 * wi13; qi3 = pi1 - pi3 * wi13;
o0[2 * j] = qr0 + qr1 * wi1; o0[2 * j + 1] = qi0 + qi1 * wi1;
o2[2 * j] = qr0 - qr1 * wi1; o2[2 * j + 1] = qi0 - qi1 * wi1;
o1[2 * j] = qr2 + qi3 * wi1; o1[2 * j + 1] = qi2 - qr3 * wi1;
o3[2 * j] = qr2 - qi3 * wi1; o3[2 * j + 1] = qi2 + qr3 * wi1;
}
i0 += 8 * bsize; i1 += 8 * bsize;
i2 += 8 * bsize; i3 += 8 * bsize;
o0 += 2 * bsize; o1 += 2 * bsize;
o2 += 2 * bsize; o3 += 2 * bsize;
}
}
static inline void kern_r4_fma_n_b(double *restrict o0,
double *restrict o1,
double *restrict o2,
double *restrict o3,
double *i0,
double *i1,
double *i2,
double *i3,
double *w,
double *w2,
long bsize, long blocks)
{
long i, j;
for (i = 0; i < blocks; i++) {
double wr1, wi1;
double wr2, wi2;
double wr3, wi13;
wr1 = w[2 * i * bsize]; wi1 = w[2 * i * bsize + 1];
wr2 = w[4 * i * bsize]; wi2 = w[4 * i * bsize + 1];
wr3 = w2[2 * i * bsize]; wi13 = w2[2 * i * bsize + 1];
for (j = 0; j < bsize; j++) {
double pr1, pi1;
double pr2, pi2;
double pr3, pi3;
double qr0, qi0;
double qr1, qi1;
double qr2, qi2;
double qr3, qi3;
pr1 = i1[2 * j] * wr1 - i1[2 * j + 1];
pi1 = i1[2 * j] + i1[2 * j + 1] * wr1;
pr2 = i2[2 * j] * wr2 - i2[2 * j + 1];
pi2 = i2[2 * j] + i2[2 * j + 1] * wr2;
pr3 = i3[2 * j] * wr3 - i3[2 * j + 1];
pi3 = i3[2 * j] + i3[2 * j + 1] * wr3;
qr0 = i0[2 * j] + pr2 * wi2; qr2 = i0[2 * j] - pr2 * wi2;
qi0 = i0[2 * j + 1] + pi2 * wi2; qi2 = i0[2 * j + 1] - pi2 * wi2;
qr1 = pr1 + pr3 * wi13; qr3 = pr1 - pr3 * wi13;
qi1 = pi1 + pi3 * wi13; qi3 = pi1 - pi3 * wi13;
o0[2 * j] = qr0 + qr1 * wi1; o0[2 * j + 1] = qi0 + qi1 * wi1;
o2[2 * j] = qr0 - qr1 * wi1; o2[2 * j + 1] = qi0 - qi1 * wi1;
o1[2 * j] = qr2 - qi3 * wi1; o1[2 * j + 1] = qi2 + qr3 * wi1;
o3[2 * j] = qr2 + qi3 * wi1; o3[2 * j + 1] = qi2 - qr3 * wi1;
}
i0 += 8 * bsize; i1 += 8 * bsize;
i2 += 8 * bsize; i3 += 8 * bsize;
o0 += 2 * bsize; o1 += 2 * bsize;
o2 += 2 * bsize; o3 += 2 * bsize;
}
}
void fftss_r4_fma_n_f(double *in, double *out, double *w,
long bsize, long blocks)
{
kern_r4_fma_n_f(out, out + bsize * blocks * 2,
out + bsize * blocks * 4, out + bsize * blocks * 6,
in, in + bsize * 2,
in + bsize * 4, in + bsize * 6,
w, w + bsize * blocks * 6, bsize, blocks);
}
void fftss_r4_fma_n_b(double *in, double *out, double *w,
long bsize, long blocks)
{
kern_r4_fma_n_b(out, out + bsize * blocks * 2,
out + bsize * blocks * 4, out + bsize * blocks * 6,
in, in + bsize * 2,
in + bsize * 4, in + bsize * 6,
w, w + bsize * blocks * 6, bsize, blocks);
}
|
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#include <pthread.h>
#include <AudioToolbox/AudioToolbox.h>
#define LOG_QUEUED_BUFFERS 0
#define kNumAQBufs 16 // Number of audio queue buffers we allocate.
// Needs to be big enough to keep audio pipeline
// busy (non-zero number of queued buffers) but
// not so big that audio takes too long to begin
// (kNumAQBufs * kAQBufSize of data must be
// loaded before playback will start).
//
// Set LOG_QUEUED_BUFFERS to 1 to log how many
// buffers are queued at any time -- if it drops
// to zero too often, this value may need to
// increase. Min 3, typical 8-24.
#define kAQDefaultBufSize 2048 // Number of bytes in each audio queue buffer
// Needs to be big enough to hold a packet of
// audio from the audio file. If number is too
// large, queuing of audio before playback starts
// will take too long.
// Highly compressed files can use smaller
// numbers (512 or less). 2048 should hold all
// but the largest packets. A buffer size error
// will occur if this number is too small.
#define kAQMaxPacketDescs 512 // Number of packet descriptions in our array
typedef enum
{
AS_INITIALIZED = 0,
AS_STARTING_FILE_THREAD = 1, // 启动线程
AS_WAITING_FOR_DATA = 2, // 准备数据
AS_FLUSHING_EOF = 3, // 数据准备完毕
AS_WAITING_FOR_QUEUE_TO_START = 4, // 排队播放
AS_PLAYING = 5, // 正在播放
AS_BUFFERING = 6, // 网络不好,自动缓冲
AS_PAUSED = 7, // 手动暂停
AS_STOPPING = 8, // 即将停止,自动提醒
AS_STOPPED = 9, // 已停止播放
} AudioStreamerState;
typedef enum
{
AS_NO_STOP = 0,
AS_STOPPING_EOF,
AS_STOPPING_USER_ACTION,
AS_STOPPING_ERROR,
AS_STOPPING_TEMPORARILY
} AudioStreamerStopReason;
typedef enum
{
AS_NO_ERROR = 0,
AS_NETWORK_CONNECTION_FAILED,
AS_FILE_STREAM_GET_PROPERTY_FAILED,
AS_FILE_STREAM_SEEK_FAILED,
AS_FILE_STREAM_PARSE_BYTES_FAILED,
AS_FILE_STREAM_OPEN_FAILED,
AS_FILE_STREAM_CLOSE_FAILED,
AS_AUDIO_DATA_NOT_FOUND,
AS_AUDIO_QUEUE_CREATION_FAILED,
AS_AUDIO_QUEUE_BUFFER_ALLOCATION_FAILED,
AS_AUDIO_QUEUE_ENQUEUE_FAILED,
AS_AUDIO_QUEUE_ADD_LISTENER_FAILED,
AS_AUDIO_QUEUE_REMOVE_LISTENER_FAILED,
AS_AUDIO_QUEUE_START_FAILED,
AS_AUDIO_QUEUE_PAUSE_FAILED,
AS_AUDIO_QUEUE_BUFFER_MISMATCH,
AS_AUDIO_QUEUE_DISPOSE_FAILED,
AS_AUDIO_QUEUE_STOP_FAILED,
AS_AUDIO_QUEUE_FLUSH_FAILED,
AS_AUDIO_STREAMER_FAILED,
AS_GET_AUDIO_TIME_FAILED,
AS_AUDIO_BUFFER_TOO_SMALL
} AudioStreamerErrorCode;
extern NSString * const ASStatusChangedNotification;
@interface AudioStreamer : NSObject
{
NSURL *url;
//
// Special threading consideration:
// The audioQueue property should only ever be accessed inside a
// synchronized(self) block and only *after* checking that ![self isFinishing]
//
AudioQueueRef audioQueue;
AudioFileStreamID audioFileStream; // the audio file stream parser
AudioStreamBasicDescription asbd; // description of the audio
NSThread *internalThread; // the thread where the download and
// audio file stream parsing occurs
AudioQueueBufferRef audioQueueBuffer[kNumAQBufs]; // audio queue buffers
AudioStreamPacketDescription packetDescs[kAQMaxPacketDescs]; // packet descriptions for enqueuing audio
unsigned int fillBufferIndex; // the index of the audioQueueBuffer that is being filled
UInt32 packetBufferSize;
size_t bytesFilled; // how many bytes have been filled
size_t packetsFilled; // how many packets have been filled
bool inuse[kNumAQBufs]; // flags to indicate that a buffer is still in use
NSInteger buffersUsed;
NSDictionary *httpHeaders;
AudioStreamerState state;
AudioStreamerStopReason stopReason;
AudioStreamerErrorCode errorCode;
OSStatus err;
bool discontinuous; // flag to indicate middle of the stream
pthread_mutex_t queueBuffersMutex; // a mutex to protect the inuse flags
pthread_cond_t queueBufferReadyCondition; // a condition varable for handling the inuse flags
CFReadStreamRef stream;
NSNotificationCenter *notificationCenter;
UInt32 bitRate; // Bits per second in the file
NSInteger dataOffset; // Offset of the first audio packet in the stream
NSInteger fileLength; // Length of the file in bytes
NSInteger seekByteOffset; // Seek offset within the file in bytes
UInt64 audioDataByteCount; // Used when the actual number of audio bytes in
// the file is known (more accurate than assuming
// the whole file is audio)
UInt64 processedPacketsCount; // number of packets accumulated for bitrate estimation
UInt64 processedPacketsSizeTotal; // byte size of accumulated estimation packets
double seekTime;
BOOL seekWasRequested;
double requestedSeekTime;
double sampleRate; // Sample rate of the file (used to compare with
// samples played by the queue for current playback
// time)
double packetDuration; // sample rate times frames per packet
double lastProgress; // last calculated progress point
#if TARGET_OS_IPHONE
BOOL pausedByInterruption;
#endif
}
@property AudioStreamerErrorCode errorCode;
@property (readonly) AudioStreamerState state;
@property (readonly) double progress;
@property (readonly) double duration;
@property (readwrite) UInt32 bitRate;
@property (readonly) NSDictionary *httpHeaders;
- (id)initWithURL:(NSURL *)aURL;
- (void)start;
- (void)stop;
- (void)pause;
- (BOOL)isFinishing;
- (BOOL)isPlaying;
- (BOOL)isPaused;
- (BOOL)isWaiting;
- (BOOL)isIdle;
- (void)seekToTime:(double)newSeekTime;
- (double)calculatedBitRate;
- (NSString *)currentTime;
- (NSString *)totalTime;
@end
|
// Copyright 2015 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 IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_TEST_UTIL_H_
#define IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_TEST_UTIL_H_
#include <memory>
#include "components/browser_sync/profile_sync_service.h"
namespace ios {
class ChromeBrowserState;
}
namespace syncer {
class SyncClient;
}
namespace web {
class BrowserState;
}
// Helper method for constructing ProfileSyncService mocks. If |sync_client|
// is null, a fresh one is created.
browser_sync::ProfileSyncService::InitParams
CreateProfileSyncServiceParamsForTest(
std::unique_ptr<syncer::SyncClient> sync_client,
ios::ChromeBrowserState* browser_state);
// Helper routine to be used in conjunction with
// BrowserStateKeyedServiceFactory::SetTestingFactory().
std::unique_ptr<KeyedService> BuildMockProfileSyncService(
web::BrowserState* context);
#endif // IOS_CHROME_BROWSER_SYNC_IOS_CHROME_PROFILE_SYNC_TEST_UTIL_H_
|
// Copyright 2016 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 AcceptLanguagesResolver_h
#define AcceptLanguagesResolver_h
#include "platform/PlatformExport.h"
#include "wtf/text/WTFString.h"
#include <unicode/uscript.h>
namespace blink {
class LayoutLocale;
class PLATFORM_EXPORT AcceptLanguagesResolver {
public:
static void acceptLanguagesChanged(const String&);
static const LayoutLocale* localeForHan();
static const LayoutLocale* localeForHanFromAcceptLanguages(const String&);
};
} // namespace blink
#endif // AcceptLanguagesResolver_h
|
// Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef XWALK_RUNTIME_BROWSER_UI_NATIVE_APP_WINDOW_VIEWS_H_
#define XWALK_RUNTIME_BROWSER_UI_NATIVE_APP_WINDOW_VIEWS_H_
#include <string>
#include "xwalk/runtime/browser/ui/native_app_window.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/views/views_delegate.h"
namespace views {
class WebView;
}
namespace xwalk {
class TopViewLayout;
class NativeAppWindowViews : public NativeAppWindow,
public views::WidgetObserver,
public views::WidgetDelegateView {
public:
explicit NativeAppWindowViews(const NativeAppWindow::CreateParams& params);
~NativeAppWindowViews() override;
virtual void Initialize();
// NativeAppWindow implementation.
gfx::NativeWindow GetNativeWindow() const override;
void UpdateIcon(const gfx::Image& icon) override;
void UpdateTitle(const base::string16& title) override;
gfx::Rect GetRestoredBounds() const override;
gfx::Rect GetBounds() const override;
void SetBounds(const gfx::Rect& bounds) override;
void Focus() override;
void Show() override;
void Hide() override;
void Maximize() override;
void Minimize() override;
void SetFullscreen(bool fullscreen) override;
void Restore() override;
void FlashFrame(bool flash) override;
void Close() override;
bool IsActive() const override;
bool IsMaximized() const override;
bool IsMinimized() const override;
bool IsFullscreen() const override;
views::Widget* GetWidget() override;
const views::Widget* GetWidget() const override;
bool PlatformHandleContextMenu(
const content::ContextMenuParams& params) override;
protected:
TopViewLayout* top_view_layout();
const NativeAppWindow::CreateParams& create_params() const {
return create_params_;
}
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
content::WebContents* web_contents_;
views::WebView* web_view_;
NativeAppWindowDelegate* delegate_;
private:
// WidgetDelegate implementation.
views::View* GetInitiallyFocusedView() override;
views::View* GetContentsView() override;
base::string16 GetWindowTitle() const override;
void DeleteDelegate() override;
gfx::ImageSkia GetWindowAppIcon() override;
gfx::ImageSkia GetWindowIcon() override;
bool ShouldShowWindowTitle() const override;
void SaveWindowPlacement(
const gfx::Rect& bounds, ui::WindowShowState show_state) override;
bool GetSavedWindowPlacement(const views::Widget* widget,
gfx::Rect* bounds, ui::WindowShowState* show_state) const override;
bool CanResize() const override;
bool CanMaximize() const override;
bool CanMinimize() const override;
#if defined(OS_WIN)
views::NonClientFrameView* CreateNonClientFrameView(
views::Widget* widget) override;
#endif
// views::View implementation.
void ChildPreferredSizeChanged(views::View* child) override;
void OnFocus() override;
gfx::Size GetMaximumSize() const override;
gfx::Size GetMinimumSize() const override;
// views::WidgetObserver implementation.
void OnWidgetClosing(views::Widget* widget) override;
void OnWidgetCreated(views::Widget* widget) override;
void OnWidgetDestroying(views::Widget* widget) override;
void OnWidgetDestroyed(views::Widget* widget) override;
void OnWidgetBoundsChanged(
views::Widget* widget, const gfx::Rect& new_bounds) override;
NativeAppWindow::CreateParams create_params_;
views::Widget* window_;
base::string16 title_;
gfx::Image icon_;
bool is_fullscreen_;
gfx::Size minimum_size_;
gfx::Size maximum_size_;
bool resizable_;
DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews);
};
} // namespace xwalk
#endif // XWALK_RUNTIME_BROWSER_UI_NATIVE_APP_WINDOW_VIEWS_H_
|
/*
* Copyright (c) 2014, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the Ford Motor Company nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
#include <stdint.h>
#include <ostream>
#include <string>
#include <vector>
#include "protocol/rpc_type.h"
namespace utils {
class BitStream;
}
namespace protocol_handler {
// Applink Protocolv5 4.1.2 Protocol Payload Binary header
struct ProtocolPayloadHeaderV2 {
ProtocolPayloadHeaderV2()
: rpc_type(kRpcTypeReserved)
, rpc_function_id(0)
, correlation_id(0)
, json_size(0) {}
RpcType rpc_type;
uint32_t rpc_function_id;
uint32_t correlation_id;
uint32_t json_size;
};
// Applink Protocolv5 4.1.1 Protocol Message Payload
struct ProtocolPayloadV2 {
ProtocolPayloadHeaderV2 header;
std::string json;
std::vector<uint8_t> data;
};
// Procedures that extract and validate defined protocol structures from
// a bit stream.
// If error during parsing is detected, bit stream is marked as invalid
void Extract(utils::BitStream* bs, ProtocolPayloadHeaderV2* headerv2);
void Extract(utils::BitStream* bs,
ProtocolPayloadV2* payload,
size_t payload_size);
std::ostream& operator<<(std::ostream& os,
const ProtocolPayloadHeaderV2& payload_header);
std::ostream& operator<<(std::ostream& os, const ProtocolPayloadV2& payload);
// Add for tests
size_t ProtocolPayloadV2SizeBits();
} // namespace protocol_handler
#endif /* SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_ \
*/
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Designer 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 CUSTOMWIDGET_H
#define CUSTOMWIDGET_H
#include "extension.h"
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtGui/QIcon>
QT_BEGIN_NAMESPACE
class QWidget;
class QDesignerFormEditorInterface;
class QDesignerCustomWidgetInterface
{
public:
virtual ~QDesignerCustomWidgetInterface() {}
virtual QString name() const = 0;
virtual QString group() const = 0;
virtual QString toolTip() const = 0;
virtual QString whatsThis() const = 0;
virtual QString includeFile() const = 0;
virtual QIcon icon() const = 0;
virtual bool isContainer() const = 0;
virtual QWidget *createWidget(QWidget *parent) = 0;
virtual bool isInitialized() const { return false; }
virtual void initialize(QDesignerFormEditorInterface *core) { Q_UNUSED(core); }
virtual QString domXml() const
{
return QString::fromUtf8("<widget class=\"%1\" name=\"%2\"/>")
.arg(name()).arg(name().toLower());
}
virtual QString codeTemplate() const { return QString(); }
};
#define QDesignerCustomWidgetInterface_iid "org.qt-project.QDesignerCustomWidgetInterface"
Q_DECLARE_INTERFACE(QDesignerCustomWidgetInterface, QDesignerCustomWidgetInterface_iid)
class QDesignerCustomWidgetCollectionInterface
{
public:
virtual ~QDesignerCustomWidgetCollectionInterface() {}
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const = 0;
};
#define QDesignerCustomWidgetCollectionInterface_iid "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface"
Q_DECLARE_INTERFACE(QDesignerCustomWidgetCollectionInterface, QDesignerCustomWidgetCollectionInterface_iid)
QT_END_NAMESPACE
#endif // CUSTOMWIDGET_H
|
#include <math.h>
float remainderf(float x, float y)
{
unsigned short fpsr;
// fprem1 does not introduce excess precision into x
do __asm__ ("fprem1; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y));
while (fpsr & 0x400);
return x;
}
weak_alias(remainderf, dremf);
|
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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 _BASICLIGHTMANAGER_H_
#define _BASICLIGHTMANAGER_H_
#ifndef _LIGHTMANAGER_H_
#include "lighting/lightManager.h"
#endif
#ifndef _TDICTIONARY_H_
#include "core/util/tDictionary.h"
#endif
#ifndef _GFXSHADER_H_
#include "gfx/gfxShader.h"
#endif
#ifndef _SIMOBJECT_H_
#include "console/simObject.h"
#endif
#ifndef _TSINGLETON_H_
#include "core/util/tSingleton.h"
#endif
class AvailableSLInterfaces;
class GFXShaderConstHandle;
class RenderPrePassMgr;
class PlatformTimer;
class blTerrainSystem;
class BasicLightManager : public LightManager
{
typedef LightManager Parent;
// For access to protected constructor.
friend class ManagedSingleton<BasicLightManager>;
public:
// LightManager
virtual bool isCompatible() const;
virtual void activate( SceneManager *sceneManager );
virtual void deactivate();
virtual void setLightInfo(ProcessedMaterial* pmat, const Material* mat, const SceneData& sgData, const SceneRenderState *state, U32 pass, GFXShaderConstBuffer* shaderConsts);
virtual bool setTextureStage(const SceneData& sgData, const U32 currTexFlag, const U32 textureSlot, GFXShaderConstBuffer* shaderConsts, ShaderConstHandles* handles) { return false; }
static F32 getShadowFilterDistance() { return smProjectedShadowFilterDistance; }
protected:
// LightManager
virtual void _addLightInfoEx( LightInfo *lightInfo ) { }
virtual void _initLightFields() { }
void _onPreRender( SceneManager *sceneManger, const SceneRenderState *state );
// These are protected because we're a singleton and
// no one else should be creating us!
BasicLightManager();
virtual ~BasicLightManager();
SimObjectPtr<RenderPrePassMgr> mPrePassRenderBin;
struct LightingShaderConstants
{
bool mInit;
GFXShaderRef mShader;
GFXShaderConstHandle *mLightPosition;
GFXShaderConstHandle *mLightDiffuse;
GFXShaderConstHandle *mLightAmbient;
GFXShaderConstHandle *mLightInvRadiusSq;
GFXShaderConstHandle *mLightSpotDir;
GFXShaderConstHandle *mLightSpotAngle;
GFXShaderConstHandle *mLightSpotFalloff;
LightingShaderConstants();
~LightingShaderConstants();
void init( GFXShader *shader );
void _onShaderReload();
};
typedef Map<GFXShader*, LightingShaderConstants*> LightConstantMap;
LightConstantMap mConstantLookup;
GFXShaderRef mLastShader;
LightingShaderConstants* mLastConstants;
/// Statics used for light manager/projected shadow metrics.
static U32 smActiveShadowPlugins;
static U32 smShadowsUpdated;
static U32 smElapsedUpdateMs;
/// This is used to determine the distance
/// at which the shadow filtering PostEffect
/// will be enabled for ProjectedShadow.
static F32 smProjectedShadowFilterDistance;
/// A timer used for tracking update time.
PlatformTimer *mTimer;
blTerrainSystem* mTerrainSystem;
public:
// For ManagedSingleton.
static const char* getSingletonName() { return "BasicLightManager"; }
};
#define BLM ManagedSingleton<BasicLightManager>::instance()
#endif // _BASICLIGHTMANAGER_H_
|
#undef GSL_FLOAT
#undef GSL_DOUBLE
#undef GSL_LONG_DOUBLE
#define GSL_DOUBLE
|
/*
* tcp.c TCP-specific functions.
*
* Version: $Id$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright (C) 2009 Dante http://dante.net
*/
RCSID("$Id$")
#include <freeradius-devel/libradius.h>
#ifdef WITH_TCP
RADIUS_PACKET *fr_tcp_recv(int sockfd, int flags)
{
RADIUS_PACKET *packet = rad_alloc(NULL, false);
if (!packet) return NULL;
packet->sockfd = sockfd;
if (fr_tcp_read_packet(packet, flags) != 1) {
rad_free(&packet);
return NULL;
}
return packet;
}
/*
* Receives a packet, assuming that the RADIUS_PACKET structure
* has been filled out already.
*
* This ASSUMES that the packet is allocated && fields
* initialized.
*
* This ASSUMES that the socket is marked as O_NONBLOCK, which
* the function above does set, if your system supports it.
*
* Calling this function MAY change sockfd,
* if src_ipaddr.af == AF_UNSPEC.
*/
int fr_tcp_read_packet(RADIUS_PACKET *packet, int flags)
{
ssize_t len;
/*
* No data allocated. Read the 4-byte header into
* a temporary buffer.
*/
if (!packet->data) {
int packet_len;
len = recv(packet->sockfd, packet->vector + packet->data_len,
4 - packet->data_len, 0);
if (len == 0) return -2; /* clean close */
#ifdef ECONNRESET
if ((len < 0) && (errno == ECONNRESET)) { /* forced */
return -2;
}
#endif
if (len < 0) {
fr_strerror_printf("Error receiving packet: %s",
fr_syserror(errno));
return -1;
}
packet->data_len += len;
if (packet->data_len < 4) { /* want more data */
return 0;
}
packet_len = (packet->vector[2] << 8) | packet->vector[3];
if (packet_len < RADIUS_HDR_LEN) {
fr_strerror_printf("Discarding packet: Smaller than RFC minimum of 20 bytes");
return -1;
}
/*
* If the packet is too big, then the socket is bad.
*/
if (packet_len > MAX_PACKET_LEN) {
fr_strerror_printf("Discarding packet: Larger than RFC limitation of 4096 bytes");
return -1;
}
packet->data = talloc_array(packet, uint8_t, packet_len);
if (!packet->data) {
fr_strerror_printf("Out of memory");
return -1;
}
packet->data_len = packet_len;
packet->partial = 4;
memcpy(packet->data, packet->vector, 4);
}
/*
* Try to read more data.
*/
len = recv(packet->sockfd, packet->data + packet->partial,
packet->data_len - packet->partial, 0);
if (len == 0) return -2; /* clean close */
#ifdef ECONNRESET
if ((len < 0) && (errno == ECONNRESET)) { /* forced */
return -2;
}
#endif
if (len < 0) {
fr_strerror_printf("Error receiving packet: %s", fr_syserror(errno));
return -1;
}
packet->partial += len;
if (packet->partial < packet->data_len) {
return 0;
}
/*
* See if it's a well-formed RADIUS packet.
*/
if (!rad_packet_ok(packet, flags, NULL)) {
return -1;
}
/*
* Explicitly set the VP list to empty.
*/
packet->vps = NULL;
if (fr_debug_lvl) {
char ip_buf[128], buffer[256];
if (packet->src_ipaddr.af != AF_UNSPEC) {
inet_ntop(packet->src_ipaddr.af,
&packet->src_ipaddr.ipaddr,
ip_buf, sizeof(ip_buf));
snprintf(buffer, sizeof(buffer), "host %s port %d",
ip_buf, packet->src_port);
} else {
snprintf(buffer, sizeof(buffer), "socket %d",
packet->sockfd);
}
}
return 1; /* done reading the packet */
}
#endif /* WITH_TCP */
|
/*
Copyright (c) 2000, Red Hat, Inc.
This file is part of Source-Navigator.
Source-Navigator 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.
Source-Navigator 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 Source-Navigator; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
*/
/*
* stack.c
*
* Copyright (C) 1998 Cygnus Solutions
*
* Description:
* Implementation of routines for implementing a simple stack symbol table.
*/
#include <stddef.h>
#include <stdlib.h>
#include <tcl.h>
#include "stack.h"
struct stacknode {
struct symbol sym;
struct stacknode * next;
};
static struct stacknode * base = NULL;
static struct stacknode * current = NULL;
int
push_symbol(struct symbol sym)
{
int first_run = 0;
struct stacknode ** ptr;
if (base == NULL)
{
ptr = &base;
first_run = 1;
}
else
{
ptr = ¤t->next;
}
*ptr = ckalloc(sizeof(struct stacknode));
if (*ptr == NULL)
{
return -1;
}
(*ptr)->sym.name = ckalloc(strlen(sym.name) + 1);
(void) strcpy((*ptr)->sym.name, sym.name);
(*ptr)->sym.type = dontcare;
(*ptr)->next = NULL;
/* Cater for the initial condition. */
current = (first_run) ? base : current->next;
return 0;
}
int
find_symbol(char * name)
{
struct stacknode * ptr = base;
while (ptr != NULL)
{
if (strcmp(ptr->sym.name, name) == 0)
{
return 1;
}
ptr = ptr->next;
}
return 0;
}
static int
recursively_destroy_stack(struct stacknode * ptr)
{
struct stacknode * next;
if (ptr == NULL)
{
return 0;
}
else
{
next = ptr->next;
ckfree(ptr->sym.name);
ckfree(ptr);
return recursively_destroy_stack(next);
}
}
int
destroy_stack()
{
return recursively_destroy_stack(base);
}
|
/* Init
*
* This routine is the initialization task for this test program.
* It is a user initialization task and has the responsibility for creating
* and starting the tasks that make up the test. If the time of day
* clock is required for the test, it should also be set to a known
* value by this function.
*
* Input parameters:
* argument - task argument
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define CONFIGURE_INIT
#include "system.h"
rtems_task Init(
rtems_task_argument argument
)
{
rtems_status_code status;
puts( "\n\n*** TEST 14 ***" );
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
status = rtems_task_create(
Task_name[ 1 ],
4,
RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 1 ]
);
directive_failed( status, "rtems_task_create of TA1" );
status = rtems_task_create(
Task_name[ 2 ],
4,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[ 2 ]
);
directive_failed( status, "rtems_task_create of TA2" );
status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
directive_failed( status, "rtems_task_start of TA1" );
status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
directive_failed( status, "rtems_task_start of TA2" );
Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
directive_failed( status, "rtems_timer_create of TM1" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
|
#include "user_interface.h"
#include "spi_flash.h"
#include "ets_sys.h"
#include "c_types.h"
#include "driver/uart.h"
#include "flash_param.h"
#define FLASH_PARAM_START_SECTOR 0x3C
#define FLASH_PARAM_SECTOR (FLASH_PARAM_START_SECTOR + 0)
#define FLASH_PARAM_ADDR (SPI_FLASH_SEC_SIZE * FLASH_PARAM_SECTOR)
static int flash_param_loaded = 0;
static flash_param_t flash_param;
void ICACHE_FLASH_ATTR flash_param_read(flash_param_t *flash_param) {
spi_flash_read(FLASH_PARAM_ADDR, (uint32 *)flash_param, sizeof(flash_param_t));
}
void ICACHE_FLASH_ATTR flash_param_write(flash_param_t *flash_param) {
ETS_UART_INTR_DISABLE();
spi_flash_erase_sector(FLASH_PARAM_SECTOR);
spi_flash_write(FLASH_PARAM_ADDR, (uint32 *) flash_param, sizeof(flash_param_t));
ETS_UART_INTR_ENABLE();
}
flash_param_t *ICACHE_FLASH_ATTR flash_param_get(void) {
if (!flash_param_loaded) {
flash_param_read(&flash_param);
flash_param_loaded = 1;
}
return &flash_param;
}
int ICACHE_FLASH_ATTR flash_param_set(void) {
flash_param_write(&flash_param);
flash_param_t tmp;
flash_param_read(&tmp);
if (memcmp(&tmp, &flash_param, sizeof(flash_param_t)) != 0) {
return 0;
}
return 1;
}
void ICACHE_FLASH_ATTR flash_param_init_defaults(void) {
flash_param_t *flash_param = flash_param_get();
flash_param->magic = FLASH_PARAM_MAGIC;
flash_param->version = FLASH_PARAM_VERSION;
flash_param->baud = 115200;
flash_param->port = 23;
flash_param->uartconf0 = CALC_UARTMODE(EIGHT_BITS, NONE_BITS, ONE_STOP_BIT);
flash_param_set();
}
flash_param_t* ICACHE_FLASH_ATTR flash_param_init(void) {
flash_param_t *flash_param = flash_param_get();
if (flash_param->magic != FLASH_PARAM_MAGIC || flash_param->version != FLASH_PARAM_VERSION) {
flash_param_init_defaults();
}
return flash_param;
}
|
#ifndef WAIT_H
#define WAIT_H
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__AVR__)
# include <util/delay.h>
# define wait_ms(ms) _delay_ms(ms)
# define wait_us(us) _delay_us(us)
#elif defined(PROTOCOL_CHIBIOS)
# include "ch.h"
# define wait_ms(ms) chThdSleepMilliseconds(ms)
# define wait_us(us) chThdSleepMicroseconds(us)
#elif defined(__arm__)
# include "wait_api.h"
#else // Unit tests
void wait_ms(uint32_t ms);
#define wait_us(us) wait_ms(us / 1000)
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SCUMM_IMUSE_MAC_M68K_H
#define SCUMM_IMUSE_MAC_M68K_H
#include "audio/softsynth/emumidi.h"
#include "common/hashmap.h"
namespace Common {
class SeekableReadStream;
}
namespace Scumm {
class MacM68kDriver : public MidiDriver_Emulated {
friend class MidiChannel_MacM68k;
public:
MacM68kDriver(Audio::Mixer *mixer);
~MacM68kDriver();
virtual int open();
virtual void close();
virtual void send(uint32 d);
virtual void sysEx_customInstrument(byte channel, uint32 type, const byte *instr);
virtual MidiChannel *allocateChannel();
virtual MidiChannel *getPercussionChannel() { return 0; }
virtual bool isStereo() const { return false; }
virtual int getRate() const {
// The original is using a frequency of approx. 22254.54546 here.
// To be precise it uses the 16.16 fixed point value 0x56EE8BA3.
return 22254;
}
protected:
virtual void generateSamples(int16 *buf, int len);
virtual void onTimer() {}
private:
int *_mixBuffer;
int _mixBufferLength;
struct Instrument {
uint length;
uint sampleRate;
uint loopStart;
uint loopEnd;
int baseFrequency;
byte *data;
};
enum {
kDefaultInstrument = 0x3E7,
kProgramChangeBase = 0x3E8,
kSysExBase = 0x7D0
};
Instrument getInstrument(int idx) const;
typedef Common::HashMap<int, Instrument> InstrumentMap;
InstrumentMap _instruments;
Instrument _defaultInstrument;
void loadAllInstruments();
void addInstrument(int idx, Common::SeekableReadStream *data);
struct OutputChannel {
int pitchModifier;
const byte *instrument;
uint subPos;
const byte *start;
const byte *end;
const byte *soundStart;
const byte *soundEnd;
const byte *loopStart;
const byte *loopEnd;
int frequency;
int volume;
bool isFinished;
int baseFrequency;
};
void setPitch(OutputChannel *out, int frequency);
int _pitchTable[128];
byte *_volumeTable;
static const int _volumeBaseTable[32];
class MidiChannel_MacM68k;
struct VoiceChannel {
MidiChannel_MacM68k *part;
VoiceChannel *prev, *next;
int channel;
int note;
bool sustainNoteOff;
OutputChannel out;
void off();
};
class MidiChannel_MacM68k : public MidiChannel {
friend class MacM68kDriver;
public:
virtual MidiDriver *device() { return _owner; }
virtual byte getNumber() { return _number; }
virtual void release();
virtual void send(uint32 b);
virtual void noteOff(byte note);
virtual void noteOn(byte note, byte velocity);
virtual void programChange(byte program);
virtual void pitchBend(int16 bend);
virtual void controlChange(byte control, byte value);
virtual void pitchBendFactor(byte value);
virtual void priority(byte value);
virtual void sysEx_customInstrument(uint32 type, const byte *instr);
void init(MacM68kDriver *owner, byte channel);
bool allocate();
void addVoice(VoiceChannel *voice);
void removeVoice(VoiceChannel *voice);
private:
MacM68kDriver *_owner;
bool _allocated;
int _number;
VoiceChannel *_voice;
int _priority;
int _sustain;
Instrument _instrument;
int _pitchBend;
int _pitchBendFactor;
int _volume;
};
MidiChannel_MacM68k _channels[32];
enum {
kChannelCount = 8
};
VoiceChannel _voiceChannels[kChannelCount];
int _lastUsedVoiceChannel;
VoiceChannel *allocateVoice(int priority);
};
} // End of namespace Scumm
#endif
|
/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-bank-g0.h
*
* Copyright 2008 Openmoko, Inc.
* Copyright 2008 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
* http://armlinux.simtec.co.uk/
*
* GPIO Bank G0 register and configuration definitions
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#define S5PC11X_GPG0CON (S5PC11X_GPG0_BASE + 0x00)
#define S5PC11X_GPG0DAT (S5PC11X_GPG0_BASE + 0x04)
#define S5PC11X_GPG0PUD (S5PC11X_GPG0_BASE + 0x08)
#define S5PC11X_GPG0DRV (S5PC11X_GPG0_BASE + 0x0c)
#define S5PC11X_GPG0CONPDN (S5PC11X_GPG0_BASE + 0x10)
#define S5PC11X_GPG0PUDPDN (S5PC11X_GPG0_BASE + 0x14)
#define S5PC11X_GPG0_CONMASK(__gpio) (0xf << ((__gpio) * 4))
#define S5PC11X_GPG0_INPUT(__gpio) (0x0 << ((__gpio) * 4))
#define S5PC11X_GPG0_OUTPUT(__gpio) (0x1 << ((__gpio) * 4))
#define S5PC11X_GPG0_0_SD_0_CLK (0x2 << 0)
#define S5PC11X_GPG0_0_GPIO_INT11_0 (0xf << 0)
#define S5PC11X_GPG0_0_GPIO_INT14_0 (0xf << 0)
#define S5PC11X_GPG0_1_SD_0_CMD (0x2 << 4)
#define S5PC11X_GPG0_1_GPIO_INT11_1 (0xf << 4)
#define S5PC11X_GPG0_1_GPIO_INT14_1 (0xf << 4)
#define S5PC11X_GPG0_2_SD_0_CDn (0x2 << 8)
#define S5PC11X_GPG0_2_SD_0_DATA_0 (0x2 << 8)
#define S5PC11X_GPG0_2_GPIO_INT11_2 (0xf << 8)
#define S5PC11X_GPG0_2_GPIO_INT14_2 (0xf << 8)
#define S5PC11X_GPG0_3_SD_0_DATA_1 (0x2 << 12)
#define S5PC11X_GPG0_3_SD_0_DATA_0 (0x2 << 12)
#define S5PC11X_GPG0_3_GPIO_INT11_3 (0xf << 12)
#define S5PC11X_GPG0_3_GPIO_INT14_3 (0xf << 12)
#define S5PC11X_GPG0_4_SD_0_DATA_2 (0x2 << 16)
#define S5PC11X_GPG0_4_SD_0_DATA_1 (0x2 << 16)
#define S5PC11X_GPG0_4_GPIO_INT11_4 (0xf << 16)
#define S5PC11X_GPG0_4_GPIO_INT14_4 (0xf << 16)
#define S5PC11X_GPG0_5_SD_0_DATA_3 (0x2 << 20)
#define S5PC11X_GPG0_5_SD_0_DATA_2 (0x2 << 20)
#define S5PC11X_GPG0_5_GPIO_INT11_5 (0xf << 20)
#define S5PC11X_GPG0_5_GPIO_INT14_5 (0xf << 20)
#define S5PC11X_GPG0_6_SD_0_DATA_4 (0x2 << 24)
#define S5PC11X_GPG0_6_SD_0_DATA_3 (0x2 << 24)
#define S5PC11X_GPG0_6_GPIO_INT11_6 (0xf << 24)
#define S5PC11X_GPG0_6_GPIO_INT14_6 (0xf << 24)
#define S5PC11X_GPG0_7_SD_0_DATA_5 (0x2 << 28)
#define S5PC11X_GPG0_7_GPIO_INT11_7 (0xf << 28)
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 2015-2017 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 <sys/types.h>
#include <unistd.h>
pid_t pid;
static void
done (void)
{
}
int
main (int argc, char **argv)
{
pid = getpid ();
done ();
return 0;
}
|
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
/* generate fatal errors in termios.c
* rtems_semaphore_create( rtems_build_name ('T', 'R', 'i', c),...);
*/
#define FATAL_ERROR_TEST_NAME "19"
#define FATAL_ERROR_DESCRIPTION "termios sem create #4"
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
#define FATAL_ERROR_EXPECTED_ERROR RTEMS_TOO_MANY
#define CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS \
CONSUME_SEMAPHORE_DRIVERS
void force_error()
{
/* we will not run this far */
}
|
/*
* Copyright (C) 2010-2012 Free Software Foundation, Inc.
*
* Author: Nikos Mavrogiannopoulos
*
* This file is part of GnuTLS.
*
* The GnuTLS 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 program. If not, see <http://www.gnu.org/licenses/>
*
*/
#ifndef __GNUTLS_TPM_H
#define __GNUTLS_TPM_H
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#ifdef __cplusplus
extern "C"
{
#endif
struct tpm_key_list_st;
typedef struct tpm_key_list_st *gnutls_tpm_key_list_t;
#define GNUTLS_TPM_KEY_SIGNING (1<<1)
#define GNUTLS_TPM_REGISTER_KEY (1<<2)
#define GNUTLS_TPM_KEY_USER (1<<3)
/**
* gnutls_tpmkey_fmt_t:
* @GNUTLS_TPMKEY_FMT_RAW: The portable data format.
* @GNUTLS_TPMKEY_FMT_DER: An alias for the raw format.
* @GNUTLS_TPMKEY_FMT_CTK_PEM: A custom data format used by some TPM tools.
*
* Enumeration of different certificate encoding formats.
*/
typedef enum
{
GNUTLS_TPMKEY_FMT_RAW = 0,
GNUTLS_TPMKEY_FMT_DER = GNUTLS_TPMKEY_FMT_RAW,
GNUTLS_TPMKEY_FMT_CTK_PEM = 1
} gnutls_tpmkey_fmt_t;
int
gnutls_tpm_privkey_generate (gnutls_pk_algorithm_t pk, unsigned int bits,
const char* srk_password,
const char* key_password,
gnutls_tpmkey_fmt_t format,
gnutls_x509_crt_fmt_t pub_format,
gnutls_datum_t* privkey,
gnutls_datum_t* pubkey,
unsigned int flags);
void gnutls_tpm_key_list_deinit (gnutls_tpm_key_list_t list);
int gnutls_tpm_key_list_get_url (gnutls_tpm_key_list_t list, unsigned int idx, char** url, unsigned int flags);
int gnutls_tpm_get_registered (gnutls_tpm_key_list_t *list);
int gnutls_tpm_privkey_delete (const char* url, const char* srk_password);
#ifdef __cplusplus
}
#endif
#endif
|
#ifdef ENABLE_NLS
#include <libintl.h>
#include <locale.h>
#define _(a) (gettext (a))
#ifdef gettext_noop
#define N_(a) gettext_noop (a)
#else
#define N_(a) (a)
#endif
/* FIXME */
#define NLS_CAT_NAME "e2fsprogs"
#define LOCALEDIR "/usr/share/locale"
/* FIXME */
#else
#define _(a) (a)
#define N_(a) a
#endif
|
/******************************************************************************
* LEGAL NOTICE *
* *
* USE OF THIS SOFTWARE (including any copy or compiled version thereof) AND *
* DOCUMENTATION IS SUBJECT TO THE SOFTWARE LICENSE AND RESTRICTIONS AND THE *
* WARRANTY DISLCAIMER SET FORTH IN LEGAL_NOTICE.TXT FILE. IF YOU DO NOT *
* FULLY ACCEPT THE TERMS, YOU MAY NOT INSTALL OR OTHERWISE USE THE SOFTWARE *
* OR DOCUMENTATION. *
* NOTWITHSTANDING ANYTHING TO THE CONTRARY IN THIS NOTICE, INSTALLING OR *
* OTHERISE USING THE SOFTWARE OR DOCUMENTATION INDICATES YOUR ACCEPTANCE OF *
* THE LICENSE TERMS AS STATED. *
* *
******************************************************************************/
/* Version: 1.8.9\3686 */
/* Build : 13 */
/* Date : 12/08/2012 */
/**
\cond OS_LINUX
*/
/**
\file
\brief Linux implementation of OS depended CellGuide CPU API
\attention This file should not be modified.
If you think something is wrong here, please contact CellGuide
*/
#include <stdarg.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/cdev.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/dma-mapping.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/cacheflush.h>
#include "CgCpuOs.h"
#include "CgCpu.h"
#include "platform.h"
TCgReturnCode CgCpuIntrDone(U32 aInterruptCode)
{
TCgReturnCode rc = ECgOk;
//InterruptDone(aInterruptCode);
return rc;
}
TCgReturnCode CgCpuVirtualAllocate(volatile void **pObject, unsigned long aBaseAddr, unsigned long aSize)
{
ASSERT_NOT_NULL(pObject);
*pObject = ioremap_nocache(aBaseAddr, aSize);
return (*pObject != NULL) ? ECgOk : ECgErrMemory;
}
TCgReturnCode CgCpuVirtualFree(volatile void **pObject)
{
ASSERT_NOT_NULL(pObject);
iounmap((void *)*pObject);
*pObject = NULL;
return ECgOk;
}
TCgReturnCode CgCpuPhysicalAllocate(void **pObject, U32 *pAddress, U32 aSize)
{
DBG_FUNC_NAME("CgCpuPhysicalAllocate")
TCgReturnCode rc = ECgOk;
ASSERT_NOT_NULL(pObject);
//DBGMSG1("Trying to allocate %d bytes", aSize);
//*pObject = dma_alloc_writecombine(0, aSize + 32, (dma_addr_t *)pAddress, GFP_KERNEL);
if(*pObject == NULL) {
DBGMSG("Error! Failed allocating buffer");
rc = ECgErrMemory;
}
else {
DBGMSG2("buffer allocated: ptr=0x%08X, addr=0x%08X", *pObject, *pAddress);
// memset((void *)*pObject, 0, aSize);
}
*pObject = (unsigned char *)((((unsigned long)*pObject + 32 - 1) / 32) * 32);
*pAddress = ((*pAddress + 32 - 1) / 32) * 32;
return rc;
}
TCgReturnCode CgCpuPhysicalFree(void **pObject, U32 *pAddress, unsigned long aSize)
{
DBG_FUNC_NAME("CgCpuPhysicalFree")
TCgReturnCode rc = ECgOk;
ASSERT_NOT_NULL(pObject);
DBGMSG1("pObject=0x%08X", *pObject);
if (*pAddress != 0)
// dma_free_writecombine(0, aSize + 32, *pObject, *pAddress);
*pObject = NULL;
return rc;
}
TCgReturnCode CgxCpuReadMemory(U32 aBaseAddr, U32 aOffset, U32 *apValue)
{
DBG_FUNC_NAME("CgxCpuReadMemory")
DBGMSG1("read addd ress %x",aBaseAddr);
*apValue = sci_glb_read((aBaseAddr + aOffset),-1UL);
return ECgOk;
}
TCgReturnCode CgxCpuWriteMemory(U32 aBaseAddr, U32 aOffset, U32 aValue)
{
DBG_FUNC_NAME("CgxCpuWriteMemory")
DBGMSG1("addd ress %x",aBaseAddr);
sci_glb_write((aBaseAddr + aOffset), aValue, -1UL);
return ECgOk;
}
TCgReturnCode CgCpuKernelModeEnter(void)
{
return ECgOk;
}
TCgReturnCode CgCpuKernelModeExit(void)
{
return ECgOk;
}
TCgReturnCode CgCpuCacheSync(void)
{
//DBG_FUNC_NAME("CgCpuCacheSync")
#ifndef ACP_PORT
flush_cache_all();
#else
DBGMSG("enable ACP");
#endif
return ECgOk;
}
#ifdef TRACE_ON
#define MAX_LINE_LENGTH 256
TCgReturnCode CgxCpuPrint(char *aText)
{
printk(KERN_EMERG "%s", aText);
return ECgOk;
}
TCgReturnCode CgxCpuMsg(const char *aFuncName, const char *aFileName, U32 aLineNum, char *aFormat, ...)
{
#if 0
va_list args;
char buf[MAX_LINE_LENGTH]= {0};
int n = 0;
U32 curTickMSec = 0;
va_start(args, aFormat); // prepare the arguments
n = vsnprintf(buf, MAX_LINE_LENGTH, aFormat, args);
va_end(args); // clean the stack
// Get current tick
CgxCpuTick(&curTickMSec);
if (n > 0)
printk(KERN_EMERG ">>> %d.%03d %s[%d]: %s\n", curTickMSec / 1000, curTickMSec % 1000, aFuncName, (int)aLineNum, buf);
#endif
return ECgOk;
}
#endif
TCgReturnCode CgxCpuSleep(U32 milliSeconds)
{
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout (milliSeconds);
return ECgOk;
}
#ifndef CG_HAS_CPU_TICK
TCgReturnCode CgxCpuTick(U32 * apTickMSec)
{
struct timespec t = current_kernel_time();
*apTickMSec = t.tv_sec * 1000 + t.tv_nsec / 1000000;
return ECgOk;
}
#endif
/** \endcond */
|
/*
* Copyright (C) 2005 Anthony Liguori <anthony@codemonkey.ws>
*
* Network Block Device Common Code
*
* 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; under 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, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "nbd-internal.h"
ssize_t nbd_wr_syncv(QIOChannel *ioc,
struct iovec *iov,
size_t niov,
size_t length,
bool do_read)
{
ssize_t done = 0;
Error *local_err = NULL;
struct iovec *local_iov = g_new(struct iovec, niov);
struct iovec *local_iov_head = local_iov;
unsigned int nlocal_iov = niov;
nlocal_iov = iov_copy(local_iov, nlocal_iov, iov, niov, 0, length);
while (nlocal_iov > 0) {
ssize_t len;
if (do_read) {
len = qio_channel_readv(ioc, local_iov, nlocal_iov, &local_err);
} else {
len = qio_channel_writev(ioc, local_iov, nlocal_iov, &local_err);
}
if (len == QIO_CHANNEL_ERR_BLOCK) {
if (qemu_in_coroutine()) {
/* XXX figure out if we can create a variant on
* qio_channel_yield() that works with AIO contexts
* and consider using that in this branch */
qemu_coroutine_yield();
} else if (done) {
/* XXX this is needed by nbd_reply_ready. */
qio_channel_wait(ioc,
do_read ? G_IO_IN : G_IO_OUT);
} else {
return -EAGAIN;
}
continue;
}
if (len < 0) {
TRACE("I/O error: %s", error_get_pretty(local_err));
error_free(local_err);
/* XXX handle Error objects */
done = -EIO;
goto cleanup;
}
if (do_read && len == 0) {
break;
}
iov_discard_front(&local_iov, &nlocal_iov, len);
done += len;
}
cleanup:
g_free(local_iov_head);
return done;
}
void nbd_tls_handshake(Object *src,
Error *err,
void *opaque)
{
struct NBDTLSHandshakeData *data = opaque;
if (err) {
TRACE("TLS failed %s", error_get_pretty(err));
data->error = error_copy(err);
}
data->complete = true;
g_main_loop_quit(data->loop);
}
|
/** @addtogroup flash_file
*
*/
/*
* This file is part of the libopencm3 project.
*
* Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
* Copyright (C) 2010 Mark Butler <mbutler@physics.otago.ac.nz>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
/**@{*/
#include <libopencm3/stm32/flash.h>
/*---------------------------------------------------------------------------*/
/** @brief Set the Number of Wait States
Used to match the system clock to the FLASH memory access time. See the
programming manual for more information on clock speed ranges. The latency must
be changed to the appropriate value <b>before</b> any increase in clock
speed, or <b>after</b> any decrease in clock speed.
@param[in] ws values from @ref flash_latency.
*/
void flash_set_ws(uint32_t ws)
{
uint32_t reg32;
reg32 = FLASH_ACR;
reg32 &= ~((1 << 0) | (1 << 1) | (1 << 2));
reg32 |= ws;
FLASH_ACR = reg32;
}
/*---------------------------------------------------------------------------*/
/** @brief Unlock the Flash Program and Erase Controller
This enables write access to the Flash memory. It is locked by default on
reset.
*/
void flash_unlock(void)
{
/* Clear the unlock sequence state. */
FLASH_CR |= FLASH_CR_LOCK;
/* Authorize the FPEC access. */
FLASH_KEYR = FLASH_KEYR_KEY1;
FLASH_KEYR = FLASH_KEYR_KEY2;
}
/*---------------------------------------------------------------------------*/
/** @brief Lock the Flash Program and Erase Controller
Used to prevent spurious writes to FLASH.
*/
void flash_lock(void)
{
FLASH_CR |= FLASH_CR_LOCK;
}
/*---------------------------------------------------------------------------*/
/** @brief Clear the Programming Error Status Flag
*/
void flash_clear_pgperr_flag(void)
{
FLASH_SR |= FLASH_SR_PGPERR;
}
/*---------------------------------------------------------------------------*/
/** @brief Clear the End of Operation Status Flag
*/
void flash_clear_eop_flag(void)
{
FLASH_SR |= FLASH_SR_EOP;
}
/*---------------------------------------------------------------------------*/
/** @brief Clear the Busy Status Flag
*/
void flash_clear_bsy_flag(void)
{
FLASH_SR &= ~FLASH_SR_BSY;
}
/*---------------------------------------------------------------------------*/
/** @brief Wait until Last Operation has Ended
This loops indefinitely until an operation (write or erase) has completed by
testing the busy flag.
*/
void flash_wait_for_last_operation(void)
{
while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY);
}
/**@}*/
|
/*
* Cantata
*
* Copyright (c) 2011-2014 Craig Drummond <craig.p.drummond@gmail.com>
*
* ----
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _ALBUM_SCANNER_H_
#define _ALBUM_SCANNER_H_
#include "jobcontroller.h"
#include <QMap>
#include <QStringList>
class QProcess;
class AlbumScanner : public Job
{
Q_OBJECT
public:
struct Values {
Values() : gain(0.0), peak(0.0), ok(false) { }
double gain;
double peak;
bool ok;
};
AlbumScanner(const QMap<int, QString> &files);
~AlbumScanner();
virtual void start();
virtual void stop();
const Values & albumValues() const { return album; }
const QMap<int, Values> trackValues() const { return tracks; }
private Q_SLOTS:
void read();
void procFinished();
private:
QProcess *proc;
Values album;
QMap<int, Values> tracks;
QMap<int, int> trackIndexMap;
QStringList fileNames;
};
#endif
|
// MESSAGE SET_NAV_MODE PACKING
#define MAVLINK_MSG_ID_SET_NAV_MODE 12
typedef struct __mavlink_set_nav_mode_t
{
uint8_t target; ///< The system setting the mode
uint8_t nav_mode; ///< The new navigation mode
} mavlink_set_nav_mode_t;
#define MAVLINK_MSG_ID_SET_NAV_MODE_LEN 2
#define MAVLINK_MSG_ID_12_LEN 2
#define MAVLINK_MESSAGE_INFO_SET_NAV_MODE { \
"SET_NAV_MODE", \
2, \
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_nav_mode_t, target) }, \
{ "nav_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_nav_mode_t, nav_mode) }, \
} \
}
/**
* @brief Pack a set_nav_mode message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system setting the mode
* @param nav_mode The new navigation mode
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_nav_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, uint8_t nav_mode)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[2];
_mav_put_uint8_t(buf, 0, target);
_mav_put_uint8_t(buf, 1, nav_mode);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_set_nav_mode_t packet;
packet.target = target;
packet.nav_mode = nav_mode;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE;
return mavlink_finalize_message(msg, system_id, component_id, 2);
}
/**
* @brief Pack a set_nav_mode message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system setting the mode
* @param nav_mode The new navigation mode
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_nav_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,uint8_t nav_mode)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[2];
_mav_put_uint8_t(buf, 0, target);
_mav_put_uint8_t(buf, 1, nav_mode);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_set_nav_mode_t packet;
packet.target = target;
packet.nav_mode = nav_mode;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_NAV_MODE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2);
}
/**
* @brief Encode a set_nav_mode struct into a message
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param set_nav_mode C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_nav_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_nav_mode_t* set_nav_mode)
{
return mavlink_msg_set_nav_mode_pack(system_id, component_id, msg, set_nav_mode->target, set_nav_mode->nav_mode);
}
/**
* @brief Send a set_nav_mode message
* @param chan MAVLink channel to send the message
*
* @param target The system setting the mode
* @param nav_mode The new navigation mode
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_nav_mode_send(mavlink_channel_t chan, uint8_t target, uint8_t nav_mode)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[2];
_mav_put_uint8_t(buf, 0, target);
_mav_put_uint8_t(buf, 1, nav_mode);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_NAV_MODE, buf, 2);
#else
mavlink_set_nav_mode_t packet;
packet.target = target;
packet.nav_mode = nav_mode;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_NAV_MODE, (const char *)&packet, 2);
#endif
}
#endif
// MESSAGE SET_NAV_MODE UNPACKING
/**
* @brief Get field target from set_nav_mode message
*
* @return The system setting the mode
*/
static inline uint8_t mavlink_msg_set_nav_mode_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field nav_mode from set_nav_mode message
*
* @return The new navigation mode
*/
static inline uint8_t mavlink_msg_set_nav_mode_get_nav_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Decode a set_nav_mode message into a struct
*
* @param msg The message to decode
* @param set_nav_mode C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_nav_mode_decode(const mavlink_message_t* msg, mavlink_set_nav_mode_t* set_nav_mode)
{
#if MAVLINK_NEED_BYTE_SWAP
set_nav_mode->target = mavlink_msg_set_nav_mode_get_target(msg);
set_nav_mode->nav_mode = mavlink_msg_set_nav_mode_get_nav_mode(msg);
#else
memcpy(set_nav_mode, _MAV_PAYLOAD(msg), 2);
#endif
}
|
/*
* GTK VNC Widget
*
* Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
*
* 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.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "coroutine.h"
#include <stdio.h>
#include <stdlib.h>
static GCond *run_cond;
static GMutex *run_lock;
static struct coroutine *current;
static struct coroutine leader;
#if 0
#define CO_DEBUG(OP) fprintf(stderr, "%s %p %s %d\n", OP, g_thread_self(), __FUNCTION__, __LINE__)
#else
#define CO_DEBUG(OP)
#endif
static void coroutine_system_init(void)
{
if (!g_thread_supported()) {
CO_DEBUG("INIT");
g_thread_init(NULL);
}
run_cond = g_cond_new();
run_lock = g_mutex_new();
CO_DEBUG("LOCK");
g_mutex_lock(run_lock);
/* The thread that creates the first coroutine is the system coroutine
* so let's fill out a structure for it */
leader.entry = NULL;
leader.release = NULL;
leader.stack_size = 0;
leader.exited = 0;
leader.thread = g_thread_self();
leader.runnable = TRUE; /* we're the one running right now */
leader.caller = NULL;
leader.data = NULL;
current = &leader;
}
static gpointer coroutine_thread(gpointer opaque)
{
struct coroutine *co = opaque;
CO_DEBUG("LOCK");
g_mutex_lock(run_lock);
while (!co->runnable) {
CO_DEBUG("WAIT");
g_cond_wait(run_cond, run_lock);
}
CO_DEBUG("RUNNABLE");
current = co;
co->caller->data = co->entry(co->data);
co->exited = 1;
co->caller->runnable = TRUE;
CO_DEBUG("BROADCAST");
g_cond_broadcast(run_cond);
CO_DEBUG("UNLOCK");
g_mutex_unlock(run_lock);
return NULL;
}
void coroutine_init(struct coroutine *co)
{
GError *err = NULL;
if (run_cond == NULL)
coroutine_system_init();
CO_DEBUG("NEW");
co->thread = g_thread_create_full(coroutine_thread, co, co->stack_size,
FALSE, TRUE,
G_THREAD_PRIORITY_NORMAL,
&err);
if (err != NULL)
g_error("g_thread_create_full() failed: %s", err->message);
co->exited = 0;
co->runnable = FALSE;
co->caller = NULL;
}
int coroutine_release(struct coroutine *co G_GNUC_UNUSED)
{
return 0;
}
void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)
{
from->runnable = FALSE;
to->runnable = TRUE;
to->data = arg;
to->caller = from;
CO_DEBUG("BROADCAST");
g_cond_broadcast(run_cond);
CO_DEBUG("UNLOCK");
g_mutex_unlock(run_lock);
CO_DEBUG("LOCK");
g_mutex_lock(run_lock);
while (!from->runnable) {
CO_DEBUG("WAIT");
g_cond_wait(run_cond, run_lock);
}
current = from;
to->caller = NULL;
CO_DEBUG("SWAPPED");
return from->data;
}
struct coroutine *coroutine_self(void)
{
if (run_cond == NULL)
coroutine_system_init();
return current;
}
void *coroutine_yieldto(struct coroutine *to, void *arg)
{
g_return_val_if_fail(!to->caller, NULL);
g_return_val_if_fail(!to->exited, NULL);
CO_DEBUG("SWAP");
return coroutine_swap(coroutine_self(), to, arg);
}
void *coroutine_yield(void *arg)
{
struct coroutine *to = coroutine_self()->caller;
if (!to) {
fprintf(stderr, "Co-routine is yielding to no one\n");
abort();
}
CO_DEBUG("SWAP");
coroutine_self()->caller = NULL;
return coroutine_swap(coroutine_self(), to, arg);
}
gboolean coroutine_is_main(struct coroutine *co)
{
return (co == &leader);
}
|
/** @file
A brief file description
@section license License
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/****************************************************************************
P_NetVCTest.h
Description:
Unit test for infastructure for VConnections implementing the
NetVConnection interface
****************************************************************************/
#ifndef _P_NET_VC_TEST_H_
#define _P_NET_VC_TEST_H_
#include "ts/ink_platform.h"
class VIO;
class MIOBuffer;
class IOBufferReader;
enum NetVcTestType_t {
NET_VC_TEST_ACTIVE,
NET_VC_TEST_PASSIVE,
};
struct NVC_test_def {
const char *test_name;
int bytes_to_send;
int nbytes_write;
int bytes_to_read;
int nbytes_read;
int write_bytes_per;
int timeout;
int expected_read_term;
int expected_write_term;
};
extern NVC_test_def netvc_tests_def[];
extern const unsigned num_netvc_tests;
class NetTestDriver : public Continuation
{
public:
NetTestDriver();
~NetTestDriver();
int errors;
protected:
RegressionTest *r;
int *pstatus;
};
class NetVCTest : public Continuation
{
public:
NetVCTest();
~NetVCTest();
NetVcTestType_t test_cont_type;
int main_handler(int event, void *data);
void read_handler(int event);
void write_handler(int event);
void cleanup();
void init_test(NetVcTestType_t n_type, NetTestDriver *driver, NetVConnection *nvc, RegressionTest *robj, NVC_test_def *my_def,
const char *module_name_arg, const char *debug_tag_arg);
void start_test();
int fill_buffer(MIOBuffer *buf, uint8_t *seed, int bytes);
int consume_and_check_bytes(IOBufferReader *r, uint8_t *seed);
void write_finished();
void read_finished();
void finished();
void record_error(const char *msg);
NetVConnection *test_vc;
RegressionTest *regress;
NetTestDriver *driver;
VIO *read_vio;
VIO *write_vio;
MIOBuffer *read_buffer;
MIOBuffer *write_buffer;
IOBufferReader *reader_for_rbuf;
IOBufferReader *reader_for_wbuf;
int write_bytes_to_add_per;
int timeout;
int actual_bytes_read;
int actual_bytes_sent;
bool write_done;
bool read_done;
uint8_t read_seed;
uint8_t write_seed;
int bytes_to_send;
int bytes_to_read;
int nbytes_read;
int nbytes_write;
int expected_read_term;
int expected_write_term;
const char *test_name;
const char *module_name;
const char *debug_tag;
};
#endif
|
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <math.h>
#include <type_traits>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/elementwise_op_function.h"
#include "paddle/fluid/platform/transform.h"
namespace paddle {
namespace operators {
template <typename T>
struct LessThanFunctor {
using ELEM_TYPE = T;
HOSTDEVICE bool operator()(const T& a, const T& b) const { return a < b; }
};
template <typename T>
struct LessEqualFunctor {
using ELEM_TYPE = T;
HOSTDEVICE bool operator()(const T& a, const T& b) const { return a <= b; }
};
template <typename T>
struct GreaterThanFunctor {
using ELEM_TYPE = T;
HOSTDEVICE bool operator()(const T& a, const T& b) const { return a > b; }
};
template <typename T>
struct GreaterEqualFunctor {
using ELEM_TYPE = T;
HOSTDEVICE bool operator()(const T& a, const T& b) const { return a >= b; }
};
template <typename T>
struct EqualFunctor {
using ELEM_TYPE = T;
HOSTDEVICE bool operator()(const T& a, const T& b) const {
if (std::is_floating_point<T>::value) {
// This branch will be optimized while compiling if T is integer. It is
// safe to cast a and b to double.
return fabs(static_cast<double>(a - b)) < 1e-8;
} else {
return (a == b);
}
}
};
template <typename T>
struct NotEqualFunctor {
using ELEM_TYPE = T;
HOSTDEVICE bool operator()(const T& a, const T& b) const {
return !EqualFunctor<T>()(a, b);
}
};
template <typename DeviceContext, typename Functor>
class CompareOpKernel
: public framework::OpKernel<typename Functor::ELEM_TYPE> {
public:
void Compute(const framework::ExecutionContext& context) const override {
using T = typename Functor::ELEM_TYPE;
using Tensor = framework::Tensor;
auto* x = context.Input<Tensor>("X");
auto* y = context.Input<Tensor>("Y");
auto* z = context.Output<Tensor>("Out");
int axis = context.Attr<int>("axis");
ElementwiseComputeEx<Functor, DeviceContext, T, bool>(context, x, y, axis,
Functor(), z);
}
};
} // namespace operators
} // namespace paddle
#define REGISTER_COMPARE_KERNEL(op_type, dev, functor) \
REGISTER_OP_##dev##_KERNEL( \
op_type, ::paddle::operators::CompareOpKernel< \
::paddle::platform::dev##DeviceContext, functor<int>>, \
::paddle::operators::CompareOpKernel< \
::paddle::platform::dev##DeviceContext, functor<int64_t>>, \
::paddle::operators::CompareOpKernel< \
::paddle::platform::dev##DeviceContext, functor<float>>, \
::paddle::operators::CompareOpKernel< \
::paddle::platform::dev##DeviceContext, functor<double>>);
|
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
* Copyright (C) 1999-2010, International Business Machines Corporation and others.
* All Rights Reserved.
**********************************************************************
* Date Name Description
* 11/17/99 aliu Creation.
**********************************************************************
*/
#ifndef UNIFILT_H
#define UNIFILT_H
#include "unicode/unifunct.h"
#include "unicode/unimatch.h"
/**
* \file
* \brief C++ API: Unicode Filter
*/
U_NAMESPACE_BEGIN
/**
* U_ETHER is used to represent character values for positions outside
* a range. For example, transliterator uses this to represent
* characters outside the range contextStart..contextLimit-1. This
* allows explicit matching by rules and UnicodeSets of text outside a
* defined range.
* @stable ICU 3.0
*/
#define U_ETHER ((UChar)0xFFFF)
/**
*
* <code>UnicodeFilter</code> defines a protocol for selecting a
* subset of the full range (U+0000 to U+10FFFF) of Unicode characters.
* Currently, filters are used in conjunction with classes like {@link
* Transliterator} to only process selected characters through a
* transformation.
*
* <p>Note: UnicodeFilter currently stubs out two pure virtual methods
* of its base class, UnicodeMatcher. These methods are toPattern()
* and matchesIndexValue(). This is done so that filter classes that
* are not actually used as matchers -- specifically, those in the
* UnicodeFilterLogic component, and those in tests -- can continue to
* work without defining these methods. As long as a filter is not
* used in an RBT during real transliteration, these methods will not
* be called. However, this breaks the UnicodeMatcher base class
* protocol, and it is not a correct solution.
*
* <p>In the future we may revisit the UnicodeMatcher / UnicodeFilter
* hierarchy and either redesign it, or simply remove the stubs in
* UnicodeFilter and force subclasses to implement the full
* UnicodeMatcher protocol.
*
* @see UnicodeFilterLogic
* @stable ICU 2.0
*/
class U_COMMON_API UnicodeFilter : public UnicodeFunctor, public UnicodeMatcher {
public:
/**
* Destructor
* @stable ICU 2.0
*/
virtual ~UnicodeFilter();
/**
* Returns <tt>true</tt> for characters that are in the selected
* subset. In other words, if a character is <b>to be
* filtered</b>, then <tt>contains()</tt> returns
* <b><tt>false</tt></b>.
* @stable ICU 2.0
*/
virtual UBool contains(UChar32 c) const = 0;
/**
* UnicodeFunctor API. Cast 'this' to a UnicodeMatcher* pointer
* and return the pointer.
* @stable ICU 2.4
*/
virtual UnicodeMatcher* toMatcher() const;
/**
* Implement UnicodeMatcher API.
* @stable ICU 2.4
*/
virtual UMatchDegree matches(const Replaceable& text,
int32_t& offset,
int32_t limit,
UBool incremental);
/**
* UnicodeFunctor API. Nothing to do.
* @stable ICU 2.4
*/
virtual void setData(const TransliterationRuleData*);
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @stable ICU 2.2
*/
static UClassID U_EXPORT2 getStaticClassID();
protected:
/*
* Since this class has pure virtual functions,
* a constructor can't be used.
* @stable ICU 2.0
*/
/* UnicodeFilter();*/
};
/*inline UnicodeFilter::UnicodeFilter() {}*/
U_NAMESPACE_END
#endif
|
/*
* Copyright 2008-2014 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id$
*/
#include <apr_time.h>
#include "apt_test_suite.h"
#include "apt_consumer_task.h"
#include "apt_log.h"
typedef struct {
apr_time_t timestamp;
int number;
} sample_msg_data_t;
static void task_on_start_complete(apt_task_t *task)
{
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"On Task Start");
}
static void task_on_terminate_complete(apt_task_t *task)
{
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"On Task Terminate");
}
static apt_bool_t task_msg_process(apt_task_t *task, apt_task_msg_t *msg)
{
sample_msg_data_t *data = (sample_msg_data_t*)msg->data;
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Process Message [%d]",data->number);
return TRUE;
}
static apt_bool_t consumer_task_test_run(apt_test_suite_t *suite, int argc, const char * const *argv)
{
apt_consumer_task_t *consumer_task;
apt_task_t *task;
apt_task_vtable_t *vtable;
apt_task_msg_pool_t *msg_pool;
apt_task_msg_t *msg;
sample_msg_data_t *data;
int i;
msg_pool = apt_task_msg_pool_create_dynamic(sizeof(sample_msg_data_t),suite->pool);
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create Consumer Task");
consumer_task = apt_consumer_task_create(NULL,msg_pool,suite->pool);
if(!consumer_task) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Consumer Task");
return FALSE;
}
task = apt_consumer_task_base_get(consumer_task);
vtable = apt_task_vtable_get(task);
if(vtable) {
vtable->process_msg = task_msg_process;
vtable->on_start_complete = task_on_start_complete;
vtable->on_terminate_complete = task_on_terminate_complete;
}
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Start Task");
if(apt_task_start(task) == FALSE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Start Task");
apt_task_destroy(task);
return FALSE;
}
for(i=0; i<10; i++) {
msg = apt_task_msg_acquire(msg_pool);
msg->type = TASK_MSG_USER;
data = (sample_msg_data_t*) msg->data;
data->number = i;
data->timestamp = apr_time_now();
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Signal Message [%d]",data->number);
apt_task_msg_signal(task,msg);
}
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Terminate Task [wait till complete]");
apt_task_terminate(task,TRUE);
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Destroy Task");
apt_task_destroy(task);
return TRUE;
}
apt_test_suite_t* consumer_task_test_suite_create(apr_pool_t *pool)
{
apt_test_suite_t *suite = apt_test_suite_create(pool,"consumer",NULL,consumer_task_test_run);
return suite;
}
|
#pragma once
#include "send_packet_data.h"
struct Send_Packet_Data {
PNET_BUFFER m_net_buffer;
UINT m_len;
PMDL m_mdl;
PVOID m_addr;
unsigned char m_locked;
unsigned char* m_data;
HANDLE m_map_process;
};
#define free_send_packet_data(packet_data) { \
if (packet_data) { \
if (packet_data->m_mdl) { \
if (packet_data->m_addr) \
if (packet_data->m_map_process == PsGetCurrentProcessId()) \
MmUnmapLockedPages(packet_data->m_addr, \
packet_data->m_mdl); \
if (packet_data->m_locked) \
MmUnlockPages(packet_data->m_mdl); \
IoFreeMdl(packet_data->m_mdl); \
} \
ExFreePoolWithTag(packet_data, 'tkip'); \
packet_data = NULL; \
} \
}
void free_get_send_packet(
PVOID context,
struct RESOURCE_OBJECT_DATA* rdata) {
struct Send_Packet_Data* packet_data;
PHWT_ADAPTER Adapter;
PNET_BUFFER_LIST NetBufferList;
packet_data = (struct Send_Packet_Data*)rdata->m_associated.m_get_send_packet_out.Packet;
Adapter = (PHWT_ADAPTER)context;
NetBufferList = NET_BUFFER_BUFFER_LIST(packet_data->m_net_buffer);
NET_BUFFER_LIST_STATUS(NetBufferList) = NDIS_STATUS_FAILURE;
switch(InterlockedDecrement(&NET_BUFFER_LIST_BUFFER_COUNT(NetBufferList))) {
case 0:
NdisMSendNetBufferListsComplete(Adapter->AdapterHandle,
NetBufferList,
0);
break;
default:
break;
}
free_send_packet_data(packet_data);
}
PHWT_ADAPTER GetMPAdapter(PDEVICE_OBJECT device) {
return (PHWT_ADAPTER)GlobalData.AdapterList.Flink;
}
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s | FileCheck %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s
// expected-no-diagnostics
int also_before(void) {
return 0;
}
#pragma omp begin declare variant match(device={kind(gpu)})
int also_after(void) {
return 1;
}
int also_before(void) {
return 2;
}
#pragma omp end declare variant
#pragma omp begin declare variant match(device={kind(fpga)})
This text is never parsed!
#pragma omp end declare variant
int also_after(void) {
return 0;
}
int test() {
// Should return 0.
return also_after() + also_before();
}
// Make sure:
// - we do not see the ast nodes for the gpu kind
// - we do not choke on the text in the kind(fpga) guarded scopes
// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:25:1, line:27:1> line:25:5 used also_after 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_5:0x[a-z0-9]*]] <col:22, line:27:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_6:0x[a-z0-9]*]] <line:26:3, col:10>
// CHECK-NEXT: | `-IntegerLiteral [[ADDR_7:0x[a-z0-9]*]] <col:10> 'int' 0
// CHECK-NEXT: `-FunctionDecl [[ADDR_8:0x[a-z0-9]*]] <line:29:1, line:32:1> line:29:5 test 'int ({{.*}})'
// CHECK-NEXT: `-CompoundStmt [[ADDR_9:0x[a-z0-9]*]] <col:12, line:32:1>
// CHECK-NEXT: `-ReturnStmt [[ADDR_10:0x[a-z0-9]*]] <line:31:3, col:37>
// CHECK-NEXT: `-BinaryOperator [[ADDR_11:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
// CHECK-NEXT: |-CallExpr [[ADDR_12:0x[a-z0-9]*]] <col:10, col:21> 'int'
// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_13:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
// CHECK-NEXT: | `-DeclRefExpr [[ADDR_14:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_4]] 'also_after' 'int ({{.*}})'
// CHECK-NEXT: `-CallExpr [[ADDR_15:0x[a-z0-9]*]] <col:25, col:37> 'int'
// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_16:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
// CHECK-NEXT: `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef _lut_PETColor_h_
#define _lut_PETColor_h_
static const int PETColor[256][3]={
{0, 0, 0},
{0, 2, 1},
{0, 4, 3},
{0, 6, 5},
{0, 8, 7},
{0, 10, 9},
{0, 12, 11},
{0, 14, 13},
{0, 16, 15},
{0, 18, 17},
{0, 20, 19},
{0, 22, 21},
{0, 24, 23},
{0, 26, 25},
{0, 28, 27},
{0, 30, 29},
{0, 32, 31},
{0, 34, 33},
{0, 36, 35},
{0, 38, 37},
{0, 40, 39},
{0, 42, 41},
{0, 44, 43},
{0, 46, 45},
{0, 48, 47},
{0, 50, 49},
{0, 52, 51},
{0, 54, 53},
{0, 56, 55},
{0, 58, 57},
{0, 60, 59},
{0, 62, 61},
{0, 65, 63},
{0, 67, 65},
{0, 69, 67},
{0, 71, 69},
{0, 73, 71},
{0, 75, 73},
{0, 77, 75},
{0, 79, 77},
{0, 81, 79},
{0, 83, 81},
{0, 85, 83},
{0, 87, 85},
{0, 89, 87},
{0, 91, 89},
{0, 93, 91},
{0, 95, 93},
{0, 97, 95},
{0, 99, 97},
{0, 101, 99},
{0, 103, 101},
{0, 105, 103},
{0, 107, 105},
{0, 109, 107},
{0, 111, 109},
{0, 113, 111},
{0, 115, 113},
{0, 117, 115},
{0, 119, 117},
{0, 121, 119},
{0, 123, 121},
{0, 125, 123},
{0, 128, 125},
{1, 126, 127},
{3, 124, 129},
{5, 122, 131},
{7, 120, 133},//ok
{136, 118, 135},
{138, 116, 137},
{140, 114, 139},
{142, 112, 141},
{144, 110, 143},
{146, 108, 145},
{148, 106, 147},
{150, 104, 149},
{152, 102, 151},
{154, 100, 153},
{156, 98, 155},
{158, 96, 157},
{160, 94, 159},
{162, 92, 161},
{164, 90, 163},
{166, 88, 165},
{168, 86, 167},
{170, 84, 169},
{172, 82, 171},
{47, 80, 173},
{49, 78, 175},
{51, 76, 177},
{53, 74, 179},
{55, 72, 181},
{57, 70, 183},//ok
{59, 68, 185},
{61, 66, 187},
{63, 64, 189},
{65, 63, 191},
{67, 61, 193},
{69, 59, 195},
{71, 57, 197},
{73, 55, 199},
{75, 53, 201},
{77, 51, 203},
{79, 49, 205},
{81, 47, 207},
{83, 45, 209},
{85, 43, 211},
{86, 41, 213},
{88, 39, 215},
{90, 37, 217},
{92, 35, 219},
{94, 33, 221},
{96, 31, 223},
{98, 29, 225},//ok
{100, 27, 227},
{102, 25, 229},
{104, 23, 231},
{106, 21, 233},
{108, 19, 235},
{110, 17, 237},
{112, 15, 239},
{114, 13, 241},
{116, 11, 243},
{118, 9, 245},
{120, 7, 247},
{122, 5, 249},
{124, 3, 251},
{126, 1, 253},
{128, 0, 255},//ok
{130, 2, 252},
{132, 4, 248},
{134, 6, 244},
{136, 8, 240},
{138, 10, 236},
{140, 12, 232},
{142, 14, 228},
{144, 16, 224},
{146, 18, 220},
{148, 20, 216},
{150, 22, 212},
{152, 24, 208},
{154, 26, 204},
{156, 28, 200},
{158, 30, 196},
{160, 32, 192},
{162, 34, 188},
{164, 36, 184},
{166, 38, 180},
{168, 40, 176},
{170, 42, 172},
{171, 44, 168},
{173, 46, 164},
{175, 48, 160},
{177, 50, 156},
{179, 52, 152},
{181, 54, 148},
{183, 56, 144},
{185, 58, 140},
{187, 60, 136},
{189, 62, 132},
{191, 64, 128},//ok
{193, 66, 124},
{195, 68, 120},
{197, 70, 116},
{199, 72, 112},
{201, 74, 108},
{203, 76, 104},
{205, 78, 100},
{207, 80, 96},
{209, 82, 92},
{211, 84, 88},
{213, 86, 84},
{215, 88, 80},
{217, 90, 76},
{219, 92, 72},
{221, 94, 68},
{223, 96, 64},
{225, 98, 60},
{227, 100, 56},
{229, 102, 52},
{231, 104, 48},
{233, 106, 44},
{235, 108, 40},
{237, 110, 36},
{239, 112, 32},
{241, 114, 28},
{243, 116, 24},
{245, 118, 20},
{247, 120, 16},
{249, 122, 12},
{251, 124, 8},
{253, 126, 4},
{255, 128, 0},//ok
{255, 130, 4},
{255, 132, 8},
{255, 134, 12},
{255, 136, 16},
{255, 138, 20},
{255, 140, 24},
{255, 142, 28},
{255, 144, 32},
{255, 146, 36},
{255, 148, 40},
{255, 150, 44},
{255, 152, 48},
{255, 154, 50},
{255, 156, 54},
{255, 158, 58},
{255, 160, 62},
{255, 162, 64},
{255, 164, 68},
{255, 166, 72},
{255, 168, 76},
{255, 170, 80},
{255, 172, 85},
{255, 174, 89},
{255, 176, 93},
{255, 178, 97},
{255, 180, 101},
{255, 182, 105},
{255, 184, 109},
{255, 186, 113},
{255, 188, 117},
{255, 190, 121},
{255, 192, 125},
{255, 194, 129},
{255, 196, 133},
{255, 198, 137},
{255, 200, 141},
{255, 202, 145},
{255, 204, 149},
{255, 206, 153},
{255, 208, 157},
{255, 210, 161},
{255, 212, 165},
{255, 214, 170},
{255, 216, 174},
{255, 218, 178},
{255, 220, 182},
{255, 222, 186},
{255, 224, 190},
{255, 226, 194},
{255, 228, 198},
{255, 230, 202},
{255, 232, 206},
{255, 234, 210},
{255, 236, 214},
{255, 238, 218},
{255, 240, 222},
{255, 242, 226},
{255, 244, 230},
{255, 246, 234},
{255, 248, 238},
{255, 250, 242},
{255, 252, 250},
{255, 255, 255}};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.