text
stringlengths 4
6.14k
|
|---|
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2012-2016 Symless Ltd.
* Copyright (C) 2004 Chris Schoeneman
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "platform/OSXClipboardAnyTextConverter.h"
//! Convert to/from UTF-16 encoding
class OSXClipboardUTF16Converter : public OSXClipboardAnyTextConverter {
public:
OSXClipboardUTF16Converter();
virtual ~OSXClipboardUTF16Converter();
// IOSXClipboardAnyTextConverter overrides
virtual CFStringRef
getOSXFormat() const;
protected:
// OSXClipboardAnyTextConverter overrides
virtual String doFromIClipboard(const String&) const;
virtual String doToIClipboard(const String&) const;
};
|
// Copyright (c) 2002 Rob Kaper <cap@capsi.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
// WARNING: this codebase is not being used yet. Please use AtlantikNetwork
// until the protocol seperation has been completed.
#ifndef MONOPDPROTOCOL_H_H
#define MONOPDPROTOCOL_H_H
#include <qobject.h>
class QString;
/*
class AtlanticCore;
class Player;
class EstateGroup;
class Trade;
class Auction;
*/
class Estate;
class MonopdProtocol : public QObject
{
Q_OBJECT
public:
MonopdProtocol();
private slots:
void auctionEstate();
void buyEstate();
void confirmTokenLocation(Estate *estate);
void endTurn();
void rollDice();
void setName(QString name);
void startGame();
private:
virtual void sendData(QString data);
};
#endif
|
#include<stdio.h>
int main(){
int i,k,n,j;
k=0;
do {
k=k+1;
} while (k<=19);
if (k=19); {
do {
k=k+2;
if (k%3==0 && k%7==0){
printf("%d\n",k);}
} while (k<=30000); }
return 0;
}
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: olias_font.h /main/3 1996/06/11 16:48:44 cde-hal $ */
/* Actual Names */
#define OLIAS_DEFAULT ('\0')
#define OLIAS_SPACE (' ')
#define OLIAS_FILLED_RIGHT_ARROW ('>')
#define OLIAS_HOLLOW_RIGHT_ARROW ('?')
#define OLIAS_FILLED_DOWN_ARROW ('V')
#define OLIAS_HOLLOW_DOWN_ARROW ('W')
#define OLIAS_SOLID_TRACKER ('*')
#define OLIAS_HOLLOW_TRACKER ('+')
#define OLIAS_LEAF_ICON ('.')
#define OLIAS_SPACE01 (char)(201)
#define OLIAS_SPACE02 (char)(202)
#define OLIAS_SPACE04 (char)(204)
#define OLIAS_SPACE08 (char)(208)
#define OLIAS_SPACE12 (char)(212)
#define OLIAS_SPACE14 (char)(214)
#define OLIAS_SPACE16 (char)(216)
#define OLIAS_SPACE32 (char)(232)
#define OLIAS_ANNOTATION_MULTI_ICON ('A')
#define OLIAS_BOOKMARK_MULTI_ICON ('B')
#define OLIAS_LINK_MULTI_ICON ('L')
#define OLIAS_ANNOTATION_ICON ('a')
#define OLIAS_BOOKMARK_ICON ('b')
#define OLIAS_LINK_ICON ('l')
#define OLIAS_ICON_SPACE OLIAS_SPACE16
#define OLIAS_PIE_0 ('0')
#define OLIAS_PIE_1 ('1')
#define OLIAS_PIE_2 ('2')
#define OLIAS_PIE_3 ('3')
#define OLIAS_PIE_4 ('4')
#define OLIAS_PIE_5 ('5')
#define OLIAS_PIE_6 ('6')
#define OLIAS_PIE_7 ('7')
#define OLIAS_PIE_8 ('8')
#define OLIAS_INFOLIB_ICON (char)(110)
#define OLIAS_INFOBASE_ICON (char)(111)
#define OLIAS_BOOK_ICON (char)(112)
/* Content Names */
#define OLIAS_CONTRACTED_ICON OLIAS_FILLED_RIGHT_ARROW
#define OLIAS_EXPANDED_ICON OLIAS_FILLED_DOWN_ARROW
#define FILLED (0)
#define HOLLOW (1)
#define OLIAS_NO_CHILDREN_ICON OLIAS_LEAF_ICON
#define OLIAS_PLACEHOLDER_ICON OLIAS_SPACE14
#define OLIAS_RELEVANCY_ICON OLIAS_PIE_0
/* Font Names */
#define OLIAS_FONT "olias"
#define OLIAS_SPACE_FONT "ospace"
|
/*****************************************************************************
* predict.h: arm intra prediction
*****************************************************************************
* Copyright (C) 2009-2021 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
*
* This program is also available under a commercial proprietary license.
* For more information, contact us at licensing@x264.com.
*****************************************************************************/
#ifndef X264_ARM_PREDICT_H
#define X264_ARM_PREDICT_H
#define x264_predict_4x4_dc_armv6 x264_template(predict_4x4_dc_armv6)
void x264_predict_4x4_dc_armv6( uint8_t *src );
#define x264_predict_4x4_dc_top_neon x264_template(predict_4x4_dc_top_neon)
void x264_predict_4x4_dc_top_neon( uint8_t *src );
#define x264_predict_4x4_v_armv6 x264_template(predict_4x4_v_armv6)
void x264_predict_4x4_v_armv6( uint8_t *src );
#define x264_predict_4x4_h_armv6 x264_template(predict_4x4_h_armv6)
void x264_predict_4x4_h_armv6( uint8_t *src );
#define x264_predict_4x4_ddr_armv6 x264_template(predict_4x4_ddr_armv6)
void x264_predict_4x4_ddr_armv6( uint8_t *src );
#define x264_predict_4x4_ddl_neon x264_template(predict_4x4_ddl_neon)
void x264_predict_4x4_ddl_neon( uint8_t *src );
#define x264_predict_8x8c_dc_neon x264_template(predict_8x8c_dc_neon)
void x264_predict_8x8c_dc_neon( uint8_t *src );
#define x264_predict_8x8c_dc_top_neon x264_template(predict_8x8c_dc_top_neon)
void x264_predict_8x8c_dc_top_neon( uint8_t *src );
#define x264_predict_8x8c_dc_left_neon x264_template(predict_8x8c_dc_left_neon)
void x264_predict_8x8c_dc_left_neon( uint8_t *src );
#define x264_predict_8x8c_h_neon x264_template(predict_8x8c_h_neon)
void x264_predict_8x8c_h_neon( uint8_t *src );
#define x264_predict_8x8c_v_neon x264_template(predict_8x8c_v_neon)
void x264_predict_8x8c_v_neon( uint8_t *src );
#define x264_predict_8x8c_p_neon x264_template(predict_8x8c_p_neon)
void x264_predict_8x8c_p_neon( uint8_t *src );
#define x264_predict_8x16c_h_neon x264_template(predict_8x16c_h_neon)
void x264_predict_8x16c_h_neon( uint8_t *src );
#define x264_predict_8x16c_dc_top_neon x264_template(predict_8x16c_dc_top_neon)
void x264_predict_8x16c_dc_top_neon( uint8_t *src );
#define x264_predict_8x16c_p_neon x264_template(predict_8x16c_p_neon)
void x264_predict_8x16c_p_neon( uint8_t *src );
#define x264_predict_8x8_dc_neon x264_template(predict_8x8_dc_neon)
void x264_predict_8x8_dc_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_ddl_neon x264_template(predict_8x8_ddl_neon)
void x264_predict_8x8_ddl_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_ddr_neon x264_template(predict_8x8_ddr_neon)
void x264_predict_8x8_ddr_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_vl_neon x264_template(predict_8x8_vl_neon)
void x264_predict_8x8_vl_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_vr_neon x264_template(predict_8x8_vr_neon)
void x264_predict_8x8_vr_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_v_neon x264_template(predict_8x8_v_neon)
void x264_predict_8x8_v_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_h_neon x264_template(predict_8x8_h_neon)
void x264_predict_8x8_h_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_hd_neon x264_template(predict_8x8_hd_neon)
void x264_predict_8x8_hd_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_8x8_hu_neon x264_template(predict_8x8_hu_neon)
void x264_predict_8x8_hu_neon( uint8_t *src, uint8_t edge[36] );
#define x264_predict_16x16_dc_neon x264_template(predict_16x16_dc_neon)
void x264_predict_16x16_dc_neon( uint8_t *src );
#define x264_predict_16x16_dc_top_neon x264_template(predict_16x16_dc_top_neon)
void x264_predict_16x16_dc_top_neon( uint8_t *src );
#define x264_predict_16x16_dc_left_neon x264_template(predict_16x16_dc_left_neon)
void x264_predict_16x16_dc_left_neon( uint8_t *src );
#define x264_predict_16x16_h_neon x264_template(predict_16x16_h_neon)
void x264_predict_16x16_h_neon( uint8_t *src );
#define x264_predict_16x16_v_neon x264_template(predict_16x16_v_neon)
void x264_predict_16x16_v_neon( uint8_t *src );
#define x264_predict_16x16_p_neon x264_template(predict_16x16_p_neon)
void x264_predict_16x16_p_neon( uint8_t *src );
#define x264_predict_4x4_init_arm x264_template(predict_4x4_init_arm)
void x264_predict_4x4_init_arm( uint32_t cpu, x264_predict_t pf[12] );
#define x264_predict_8x8_init_arm x264_template(predict_8x8_init_arm)
void x264_predict_8x8_init_arm( uint32_t cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_filter );
#define x264_predict_8x8c_init_arm x264_template(predict_8x8c_init_arm)
void x264_predict_8x8c_init_arm( uint32_t cpu, x264_predict_t pf[7] );
#define x264_predict_8x16c_init_arm x264_template(predict_8x16c_init_arm)
void x264_predict_8x16c_init_arm( uint32_t cpu, x264_predict_t pf[7] );
#define x264_predict_16x16_init_arm x264_template(predict_16x16_init_arm)
void x264_predict_16x16_init_arm( uint32_t cpu, x264_predict_t pf[7] );
#endif
|
/**
* collectd - src/zfs_arc.c
* Copyright (C) 2009 Anthony Dewhurst
*
* 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; only version 2 of the License is applicable.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Anthony Dewhurst <dewhurst at gmail>
**/
#include "collectd.h"
#include "common.h"
#include "plugin.h"
/*
* Global variables
*/
static kstat_t *ksp;
extern kstat_ctl_t *kc;
static void za_submit (const char* type, const char* type_instance, value_t* values, int values_len)
{
value_list_t vl = VALUE_LIST_INIT;
vl.values = values;
vl.values_len = values_len;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "zfs_arc", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
}
static void za_submit_gauge (const char* type, const char* type_instance, gauge_t value)
{
value_t vv;
vv.gauge = value;
za_submit (type, type_instance, &vv, 1);
}
static void za_submit_derive (const char* type, const char* type_instance, derive_t dv)
{
value_t vv;
vv.derive = dv;
za_submit (type, type_instance, &vv, 1);
}
static void za_submit_ratio (const char* type_instance, gauge_t hits, gauge_t misses)
{
gauge_t ratio = NAN;
if (!isfinite (hits) || (hits < 0.0))
hits = 0.0;
if (!isfinite (misses) || (misses < 0.0))
misses = 0.0;
if ((hits != 0.0) || (misses != 0.0))
ratio = hits / (hits + misses);
za_submit_gauge ("cache_ratio", type_instance, ratio);
}
static int za_read (void)
{
gauge_t arc_size, l2_size;
derive_t demand_data_hits,
demand_metadata_hits,
prefetch_data_hits,
prefetch_metadata_hits,
demand_data_misses,
demand_metadata_misses,
prefetch_data_misses,
prefetch_metadata_misses;
gauge_t arc_hits, arc_misses, l2_hits, l2_misses;
value_t l2_io[2];
get_kstat (&ksp, "zfs", 0, "arcstats");
if (ksp == NULL)
{
ERROR ("zfs_arc plugin: Cannot find zfs:0:arcstats kstat.");
return (-1);
}
/* Sizes */
arc_size = get_kstat_value(ksp, "size");
l2_size = get_kstat_value(ksp, "l2_size");
za_submit_gauge ("cache_size", "arc", arc_size);
za_submit_gauge ("cache_size", "L2", l2_size);
/* Hits / misses */
demand_data_hits = get_kstat_value(ksp, "demand_data_hits");
demand_metadata_hits = get_kstat_value(ksp, "demand_metadata_hits");
prefetch_data_hits = get_kstat_value(ksp, "prefetch_data_hits");
prefetch_metadata_hits = get_kstat_value(ksp, "prefetch_metadata_hits");
demand_data_misses = get_kstat_value(ksp, "demand_data_misses");
demand_metadata_misses = get_kstat_value(ksp, "demand_metadata_misses");
prefetch_data_misses = get_kstat_value(ksp, "prefetch_data_misses");
prefetch_metadata_misses = get_kstat_value(ksp, "prefetch_metadata_misses");
za_submit_derive ("cache_result", "demand_data-hit", demand_data_hits);
za_submit_derive ("cache_result", "demand_metadata-hit", demand_metadata_hits);
za_submit_derive ("cache_result", "prefetch_data-hit", prefetch_data_hits);
za_submit_derive ("cache_result", "prefetch_metadata-hit", prefetch_metadata_hits);
za_submit_derive ("cache_result", "demand_data-miss", demand_data_misses);
za_submit_derive ("cache_result", "demand_metadata-miss", demand_metadata_misses);
za_submit_derive ("cache_result", "prefetch_data-miss", prefetch_data_misses);
za_submit_derive ("cache_result", "prefetch_metadata-miss", prefetch_metadata_misses);
/* Ratios */
arc_hits = (gauge_t) get_kstat_value(ksp, "hits");
arc_misses = (gauge_t) get_kstat_value(ksp, "misses");
l2_hits = (gauge_t) get_kstat_value(ksp, "l2_hits");
l2_misses = (gauge_t) get_kstat_value(ksp, "l2_misses");
za_submit_ratio ("arc", arc_hits, arc_misses);
za_submit_ratio ("L2", l2_hits, l2_misses);
/* I/O */
l2_io[0].derive = get_kstat_value(ksp, "l2_read_bytes");
l2_io[1].derive = get_kstat_value(ksp, "l2_write_bytes");
za_submit ("io_octets", "L2", l2_io, /* num values = */ 2);
return (0);
} /* int za_read */
static int za_init (void) /* {{{ */
{
ksp = NULL;
/* kstats chain already opened by update_kstat (using *kc), verify everything went fine. */
if (kc == NULL)
{
ERROR ("zfs_arc plugin: kstat chain control structure not available.");
return (-1);
}
return (0);
} /* }}} int za_init */
void module_register (void)
{
plugin_register_init ("zfs_arc", za_init);
plugin_register_read ("zfs_arc", za_read);
} /* void module_register */
/* vmi: set sw=8 noexpandtab fdm=marker : */
|
/*
* Clock Manager - rtems_clock_get_tod
*
* COPYRIGHT (c) 1989-2007.
* 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.
*
* $Id: clockgettod.c,v 1.3 2009/11/30 15:59:55 ralf Exp $
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/clock.h>
#include <rtems/score/isr.h>
#include <rtems/score/thread.h>
#include <rtems/score/tod.h>
#include <rtems/score/watchdog.h>
rtems_status_code rtems_clock_get_tod(
rtems_time_of_day *time_buffer
)
{
rtems_time_of_day *tmbuf = time_buffer;
struct tm time;
struct timeval now;
if ( !time_buffer )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Is_set )
return RTEMS_NOT_DEFINED;
/* Obtain the current time */
_TOD_Get_timeval( &now );
/* Split it into a closer format */
gmtime_r( &now.tv_sec, &time );
/* Now adjust it to the RTEMS format */
tmbuf->year = time.tm_year + 1900;
tmbuf->month = time.tm_mon + 1;
tmbuf->day = time.tm_mday;
tmbuf->hour = time.tm_hour;
tmbuf->minute = time.tm_min;
tmbuf->second = time.tm_sec;
tmbuf->ticks = now.tv_usec /
rtems_configuration_get_microseconds_per_tick();
return RTEMS_SUCCESSFUL;
}
|
#ifndef QEMU_NET_H
#define QEMU_NET_H
#include "qemu-common.h"
/* VLANs support */
typedef ssize_t (IOReadvHandler)(void *, const struct iovec *, int);
typedef struct VLANClientState VLANClientState;
typedef void (NetCleanup) (VLANClientState *);
typedef void (LinkStatusChanged)(VLANClientState *);
struct VLANClientState {
IOReadHandler *fd_read;
IOReadvHandler *fd_readv;
/* Packets may still be sent if this returns zero. It's used to
rate-limit the slirp code. */
IOCanRWHandler *fd_can_read;
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
int link_down;
void *opaque;
struct VLANClientState *next;
struct VLANState *vlan;
char *model;
char *name;
char info_str[256];
};
typedef struct VLANPacket VLANPacket;
struct VLANPacket {
struct VLANPacket *next;
VLANClientState *sender;
int size;
uint8_t data[0];
};
struct VLANState {
int id;
VLANClientState *first_client;
struct VLANState *next;
unsigned int nb_guest_devs, nb_host_devs;
VLANPacket *send_queue;
int delivering;
};
VLANState *qemu_find_vlan(int id);
VLANClientState *qemu_new_vlan_client(VLANState *vlan,
const char *model,
const char *name,
IOReadHandler *fd_read,
IOCanRWHandler *fd_can_read,
NetCleanup *cleanup,
void *opaque);
void qemu_del_vlan_client(VLANClientState *vc);
VLANClientState *qemu_find_vlan_client(VLANState *vlan, void *opaque);
int qemu_can_send_packet(VLANClientState *vc);
ssize_t qemu_sendv_packet(VLANClientState *vc, const struct iovec *iov,
int iovcnt);
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
void qemu_format_nic_info_str(VLANClientState *vc, uint8_t macaddr[6]);
void qemu_check_nic_model(NICInfo *nd, const char *model);
void qemu_check_nic_model_list(NICInfo *nd, const char * const *models,
const char *default_model);
void qemu_handler_true(void *opaque);
void do_info_network(Monitor *mon);
int do_set_link(Monitor *mon, const char *name, const char *up_or_down);
/* NIC info */
#define MAX_NICS 8
struct NICInfo {
uint8_t macaddr[6];
const char *model;
const char *name;
VLANState *vlan;
void *private;
int used;
};
extern int nb_nics;
extern NICInfo nd_table[MAX_NICS];
/* BT HCI info */
struct HCIInfo {
int (*bdaddr_set)(struct HCIInfo *hci, const uint8_t *bd_addr);
void (*cmd_send)(struct HCIInfo *hci, const uint8_t *data, int len);
void (*sco_send)(struct HCIInfo *hci, const uint8_t *data, int len);
void (*acl_send)(struct HCIInfo *hci, const uint8_t *data, int len);
void *opaque;
void (*evt_recv)(void *opaque, const uint8_t *data, int len);
void (*acl_recv)(void *opaque, const uint8_t *data, int len);
};
struct HCIInfo *qemu_next_hci(void);
/* checksumming functions (net-checksum.c) */
uint32_t net_checksum_add(int len, uint8_t *buf);
uint16_t net_checksum_finish(uint32_t sum);
uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto,
uint8_t *addrs, uint8_t *buf);
void net_checksum_calculate(uint8_t *data, int length);
/* from net.c */
int net_client_init(const char *device, const char *p);
void net_client_uninit(NICInfo *nd);
int net_client_parse(const char *str);
void net_slirp_smb(const char *exported_dir);
void net_slirp_redir(Monitor *mon, const char *redir_str, const char *redir_opt2);
void net_cleanup(void);
int slirp_is_inited(void);
void net_client_check(void);
void net_host_device_add(Monitor *mon, const char *device, const char *opts);
void net_host_device_remove(Monitor *mon, int vlan_id, const char *device);
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
#define SMBD_COMMAND "/usr/sbin/smbd"
#endif
void qdev_get_macaddr(DeviceState *dev, uint8_t *macaddr);
VLANClientState *qdev_get_vlan_client(DeviceState *dev,
IOReadHandler *fd_read,
IOCanRWHandler *fd_can_read,
NetCleanup *cleanup,
void *opaque);
#endif
|
/*
* Copyright (C) 2013 Fighter Sun <wanmyqawdr@126.com>
* JZ4780 SoC NAND controller driver
*
* 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.
*
* 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 __MACH_JZ4780_NAND_H__
#define __MACH_JZ4780_NAND_H__
#include <linux/completion.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <soc/gpemc.h>
#define MAX_NUM_NAND_IF 7
struct jz4780_nand;
typedef enum {
/* NAND_XFER_<Data path driver>_<R/B# indicator> */
NAND_XFER_CPU_IRQ = 0,
NAND_XFER_CPU_POLL,
NAND_XFER_DMA_IRQ,
NAND_XFER_DMA_POLL
} nand_xfer_type_t;
typedef enum {
NAND_ECC_TYPE_HW = 0,
NAND_ECC_TYPE_SW
} nand_ecc_type_t;
typedef enum {
NAND_OUTPUT_NORMAL_DRIVER = 0,
NAND_OUTPUT_UNDER_DRIVER1,
NAND_OUTPUT_UNDER_DRIVER2,
NAND_OUTPUT_OVER_DRIVER1,
NAND_OUTPUT_OVER_DRIVER2,
CAN_NOT_ADJUST_OUTPUT_STRENGTH,
} nand_output_driver_strength_t;
typedef enum {
NAND_RB_DOWN_FULL_DRIVER = 0,
NAND_RB_DOWN_THREE_QUARTER_DRIVER,
NAND_RB_DOWN_ONE_HALF_DRIVER,
NAND_RB_DOWN_ONE_QUARTER_DRIVER,
CAN_NOT_ADJUST_RB_DOWN_STRENGTH
} nand_rb_down_driver_strength_t;
typedef struct {
int bank;
int busy_gpio;
int busy_gpio_low_assert;
int wp_gpio; /* -1 if does not exist */
int wp_gpio_low_assert;
gpemc_bank_t cs;
int busy_irq;
struct completion ready;
unsigned int ready_timout_ms;
unsigned int curr_command;
} nand_flash_if_t;
typedef struct {
common_nand_timing_t common_nand_timing;
toggle_nand_timing_t toggle_nand_timing;
} nand_timing_t;
typedef struct {
const char *name;
unsigned int nand_mfr_id;
unsigned int nand_dev_id;
bank_type_t type;
struct {
int data_size;
int ecc_bits;
} ecc_step;
nand_timing_t nand_timing;
nand_output_driver_strength_t output_strength;
nand_rb_down_driver_strength_t rb_down_strength;
struct {
int timing_mode;
} onfi_special;
int (*nand_pre_init)(struct jz4780_nand *nand);
} nand_flash_info_t;
struct jz4780_nand_platform_data {
struct mtd_partition *part_table; /* MTD partitions array */
int num_part; /* number of partitions */
nand_flash_if_t *nand_flash_if_table;
int num_nand_flash_if;
nand_flash_info_t *nand_flash_info_table;
int num_nand_flash_info;
nand_xfer_type_t xfer_type; /* transfer type */
nand_ecc_type_t ecc_type;
int num_nand_flash;
/* not NULL to override default built-in settings in driver */
struct nand_flash_dev *nand_flash_table;
int try_to_reloc_hot;
int flash_bbt;
};
#define COMMON_NAND_CHIP_INFO(_NAME, _MFR_ID, _DEV_ID, \
_DATA_SIZE_PRE_ECC_STEP, \
_ECC_BITS_PRE_ECC_STEP, \
_ALL_TIMINGS_PLUS, \
_Tcls, _Tclh, _Tals, _Talh, \
_Tcs, _Tch, _Tds, _Tdh, _Twp, \
_Twh, _Twc, _Trc, _Tadl, _Tccs, _Trhw, _Twhr, _Twhr2, \
_Trp, _Trr, _Tcwaw, _Twb, _Tww, \
_Trst, _Tfeat, _Tdcbsyr, _Tdcbsyr2, _TIMING_MODE, _BW, \
_OUTPUT_STRENGTH, _RB_DOWN_STRENGTH, \
_NAND_PRE_INIT) \
.name = (_NAME), \
.nand_mfr_id = (_MFR_ID), \
.nand_dev_id = (_DEV_ID), \
.type = BANK_TYPE_NAND, \
.ecc_step = { \
.data_size = (_DATA_SIZE_PRE_ECC_STEP), \
.ecc_bits = (_ECC_BITS_PRE_ECC_STEP), \
}, \
.nand_timing = { \
.common_nand_timing = { \
.Tcls = (_Tcls), \
.Tclh = (_Tclh), \
.Tals = (_Tals), \
.Talh = (_Talh), \
.Tch = (_Tch), \
.Tds = (_Tds), \
.Tdh = (_Tdh), \
.Twp = (_Twp), \
.Twh = (_Twh), \
.Twc = (_Twc), \
.Trc = (_Trc), \
.Trhw = (_Trhw), \
.Trp = (_Trp), \
\
.busy_wait_timing = { \
.Tcs = (_Tcs), \
.Tadl = (_Tadl), \
.Tccs = (_Tccs), \
.Trr = (_Trr), \
.Tcwaw = (_Tcwaw), \
.Twb = (_Twb), \
.Tww = (_Tww), \
.Trst = (_Trst), \
.Tfeat = (_Tfeat), \
.Tdcbsyr = (_Tdcbsyr), \
.Tdcbsyr2 = (_Tdcbsyr2), \
.Twhr = (_Twhr), \
.Twhr2 = (_Twhr2), \
}, \
\
.BW = (_BW), \
.all_timings_plus = (_ALL_TIMINGS_PLUS), \
}, \
}, \
\
.output_strength = (_OUTPUT_STRENGTH), \
.rb_down_strength = (_RB_DOWN_STRENGTH), \
.onfi_special.timing_mode = (_TIMING_MODE), \
.nand_pre_init = (_NAND_PRE_INIT),
/* TODO: implement it */
#define TOGGLE_NAND_CHIP_INFO(TODO)
#define COMMON_NAND_INTERFACE(BANK, \
BUSY_GPIO, BUSY_GPIO_LOW_ASSERT, \
WP_GPIO, WP_GPIO_LOW_ASSERT) \
.bank = (BANK), \
.busy_gpio = (BUSY_GPIO), \
.busy_gpio_low_assert = (BUSY_GPIO_LOW_ASSERT), \
.wp_gpio = (WP_GPIO), \
.wp_gpio_low_assert = (WP_GPIO_LOW_ASSERT), \
.cs = { \
.bank_type = (BANK_TYPE_NAND), \
}, \
/* TODO: implement it */
#define TOGGLE_NAND_INTERFACE(TODO)
#define LP_OPTIONS NAND_SAMSUNG_LP_OPTIONS
#define LP_OPTIONS16 (LP_OPTIONS | NAND_BUSWIDTH_16)
extern int micron_nand_pre_init(struct jz4780_nand *nand);
extern int samsung_nand_pre_init(struct jz4780_nand *nand);
#endif
|
/*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <common.h>
#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || \
defined(CONFIG_S3C2440) || defined (CONFIG_TRAB)
#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
#include <s3c2400.h>
#elif defined(CONFIG_S3C2410)
#include <s3c2410.h>
#elif defined(CONFIG_S3C2440)
#include <s3c2440.h>
#endif
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_SERIAL1
#define UART_NR S3C24X0_UART0
#elif defined(CONFIG_SERIAL2)
# if defined(CONFIG_TRAB)
# error "TRAB supports only CONFIG_SERIAL1"
# endif
#define UART_NR S3C24X0_UART1
#elif defined(CONFIG_SERIAL3)
# if defined(CONFIG_TRAB)
# #error "TRAB supports only CONFIG_SERIAL1"
# endif
#define UART_NR S3C24X0_UART2
#else
#error "Bad: you didn't configure serial ..."
#endif
void serial_setbrg (void)
{
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);
int i;
unsigned int reg = 0;
/* value is calculated so : (int)(PCLK/16./baudrate) -1 */
reg = get_PCLK() / (16 * gd->baudrate) - 1;
/* FIFO enable, Tx/Rx FIFO clear */
uart->UFCON = 0x07;
uart->UMCON = 0x0;
/* Normal,No parity,1 stop,8 bit */
uart->ULCON = 0x3;
/*
* tx=level,rx=edge,disable timeout int.,enable rx error int.,
* normal,interrupt or polling
*/
uart->UCON = 0x245;
uart->UBRDIV = reg;
#ifdef CONFIG_HWFLOW
uart->UMCON = 0x1; /* RTS up */
#endif
for (i = 0; i < 100; i++);
}
/*
* Initialise the serial port with the given baudrate. The settings
* are always 8 data bits, no parity, 1 stop bit, no start bits.
*
*/
int serial_init (void)
{
serial_setbrg ();
return (0);
}
/*
* Read a single byte from the serial port. Returns 1 on success, 0
* otherwise. When the function is succesfull, the character read is
* written into its argument c.
*/
int serial_getc (void)
{
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);
/* wait for character to arrive */
while (!(uart->UTRSTAT & 0x1));
return uart->URXH & 0xff;
}
#ifdef CONFIG_HWFLOW
static int hwflow = 0; /* turned off by default */
int hwflow_onoff(int on)
{
switch(on) {
case 0:
default:
break; /* return current */
case 1:
hwflow = 1; /* turn on */
break;
case -1:
hwflow = 0; /* turn off */
break;
}
return hwflow;
}
#endif
#ifdef CONFIG_MODEM_SUPPORT
static int be_quiet = 0;
void disable_putc(void)
{
be_quiet = 1;
}
void enable_putc(void)
{
be_quiet = 0;
}
#endif
/*
* Output a single byte to the serial port.
*/
void serial_putc (const char c)
{
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);
#ifdef CONFIG_MODEM_SUPPORT
if (be_quiet)
return;
#endif
/* wait for room in the tx FIFO */
while (!(uart->UTRSTAT & 0x2));
#ifdef CONFIG_HWFLOW
/* Wait for CTS up */
while(hwflow && !(uart->UMSTAT & 0x1))
;
#endif
uart->UTXH = c;
/* If \n, also do \r */
if (c == '\n')
serial_putc ('\r');
}
/*
* Test whether a character is in the RX buffer
*/
int serial_tstc (void)
{
S3C24X0_UART * const uart = S3C24X0_GetBase_UART(UART_NR);
return uart->UTRSTAT & 0x1;
}
void
serial_puts (const char *s)
{
while (*s) {
serial_putc (*s++);
}
}
#endif /* defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) ||
defined(CONFIG_S3C2440) || defined (CONFIG_TRAB) */
|
/*
This file is part of GNUnet.
(C) 2012 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet 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 GNUnet; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/**
* @file util/gnunet-config.c
* @brief tool to access and manipulate GNUnet configuration files
* @author Christian Grothoff
*/
#include "platform.h"
#include "gnunet_util_lib.h"
/**
* Name of the section
*/
static char *section;
/**
* Name of the option
*/
static char *option;
/**
* Value to set
*/
static char *value;
/**
* Treat option as a filename.
*/
static int is_filename;
/**
* Return value from 'main'.
*/
static int ret;
/**
* Print each option in a given section.
*
* @param cls closure
* @param section name of the section
* @param option name of the option
* @param value value of the option
*/
static void
print_option (void *cls, const char *section,
const char *option,
const char *value)
{
fprintf (stdout,
"%s = %s\n", option, value);
}
/**
* Main function that will be run by the scheduler.
*
* @param cls closure
* @param args remaining command-line arguments
* @param cfgfile name of the configuration file used (for saving, can be NULL!)
* @param cfg configuration
*/
static void
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct GNUNET_CONFIGURATION_Handle *out;
if (NULL == section)
{
fprintf (stderr, _("--section argument is required\n"));
ret = 1;
return;
}
if (NULL == value)
{
if (NULL == option)
{
GNUNET_CONFIGURATION_iterate_section_values (cfg, section,
&print_option, NULL);
}
else
{
if (is_filename)
{
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg, section, option, &value))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
section, option);
ret = 3;
return;
}
}
else
{
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &value))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
section, option);
ret = 3;
return;
}
}
fprintf (stdout, "%s\n", value);
}
}
else
{
if (NULL == option)
{
fprintf (stderr, _("--option argument required to set value\n"));
ret = 1;
return;
}
out = GNUNET_CONFIGURATION_dup (cfg);
GNUNET_CONFIGURATION_set_value_string (out, section, option, value);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_write (out, cfgfile))
ret = 2;
GNUNET_CONFIGURATION_destroy (out);
return;
}
}
/**
* Program to manipulate configuration files.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
* @return 0 ok, 1 on error
*/
int
main (int argc, char *const *argv)
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{ 'f', "filename", NULL,
gettext_noop ("obtain option of value as a filename (with $-expansion)"),
0, &GNUNET_GETOPT_set_one, &is_filename },
{ 's', "section", "SECTION",
gettext_noop ("name of the section to access"),
1, &GNUNET_GETOPT_set_string, §ion },
{ 'o', "option", "OPTION",
gettext_noop ("name of the option to access"),
1, &GNUNET_GETOPT_set_string, &option },
{ 'V', "value", "VALUE",
gettext_noop ("value to set"),
1, &GNUNET_GETOPT_set_string, &value },
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
return 2;
ret = (GNUNET_OK ==
GNUNET_PROGRAM_run (argc, argv, "gnunet-config [OPTIONS]",
gettext_noop ("Manipulate GNUnet configuration files"),
options, &run, NULL)) ? 0 : ret;
GNUNET_free ((void*) argv);
return ret;
}
/* end of gnunet-config.c */
|
#ifndef GLOBAL_H_
#define GLOBAL_H_
/**
* 공용 필수 라이브러리 포함 부분
*/
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <map>
#include <pthread.h>
using namespace std;
/**
* 리눅스 네트워크 통신 공용 라이브러리 포함 부분
*/
#include <sys/epoll.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <netdb.h>
#include <errno.h>
#include <unistd.h>
/**
* 이 다음 부분에 사용자 정의 라이브러리들을 포함
*/
#endif
|
/* This file is part of Plaine.
*
* Plaine 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.
*
* Plaine 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 Plaine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MATH_H
#define MATH_H
#include <irrlicht.h>
#include <btBulletDynamicsCommon.h>
using namespace irr;
template<typename T>
constexpr T PI = T(3.1415926535897932385);
// shit making it possible to compile with TDM-GCC under Windows
template<>
constexpr float PI<float> = 3.1415926535897932385;
core::vector3df quatToEulerRad(const btQuaternion &quat);
core::vector3df quatToEulerDeg(const btQuaternion &quat);
template <typename Number>
int sign(Number num)
{
if (num < 0)
return -1;
else if (num > 0)
return 1;
else
return 0;
}
#endif // MATH_H
|
/*
* Copyright (C) 2005-2012 MaNGOS <http://www.getmangos.com/>
* Copyright (C) 2008-2012 Trinity <http://www.trinitycore.org/>
* Copyright (C) 2010-2012 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2011-2012 Darkpeninsula Project <http://www.darkpeninsula.eu/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DARKCORE_DISABLEMGR_H
#define DARKCORE_DISABLEMGR_H
#include <ace/Singleton.h>
class Unit;
enum DisableType
{
DISABLE_TYPE_SPELL = 0,
DISABLE_TYPE_QUEST = 1,
DISABLE_TYPE_MAP = 2,
DISABLE_TYPE_BATTLEGROUND = 3,
DISABLE_TYPE_ACHIEVEMENT_CRITERIA = 4,
DISABLE_TYPE_OUTDOORPVP = 5,
};
enum SpellDisableTypes
{
SPELL_DISABLE_PLAYER = 0x1,
SPELL_DISABLE_CREATURE = 0x2,
SPELL_DISABLE_PET = 0x4,
SPELL_DISABLE_DEPRECATED_SPELL = 0x8,
SPELL_DISABLE_MAP = 0x10,
SPELL_DISABLE_AREA = 0x20,
MAX_SPELL_DISABLE_TYPE = ( SPELL_DISABLE_PLAYER | SPELL_DISABLE_CREATURE | SPELL_DISABLE_PET |
SPELL_DISABLE_DEPRECATED_SPELL | SPELL_DISABLE_MAP | SPELL_DISABLE_AREA),
};
#define MAX_DISABLE_TYPES 6
struct DisableData
{
uint8 flags;
std::set<uint32> params[2]; // params0, params1
};
typedef std::map<uint32, DisableData> DisableTypeMap; // single disables here with optional data
typedef std::map<DisableType, DisableTypeMap> DisableMap; // global disable map by source
class DisableMgr
{
friend class ACE_Singleton<DisableMgr, ACE_Null_Mutex>;
DisableMgr();
~DisableMgr();
public:
void LoadDisables();
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit);
void CheckQuestDisables();
protected:
DisableMap m_DisableMap;
};
#define sDisableMgr ACE_Singleton<DisableMgr, ACE_Null_Mutex>::instance()
#endif //DARKCORE_DISABLEMGR_H
|
/*
* Bonjour based service discovery
* Copyright (C) 2009 Mattias Wadman
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BONJOUR_H__
#define BONJOUR_H__
void bonjour_init(void);
#endif
|
/* -*- c++ -*- */
/*
* Copyright 2016 <+YOU OR YOUR COMPANY+>.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_XCORR_CAPON_CCF_H
#define INCLUDED_XCORR_CAPON_CCF_H
#include <xcorr/api.h>
#include <gnuradio/sync_block.h>
namespace gr {
namespace xcorr {
/*!
* \brief <+description of block+>
* \ingroup xcorr
*
*/
class XCORR_API capon_ccf : virtual public gr::sync_block
{
public:
typedef boost::shared_ptr<capon_ccf> sptr;
/*!
* \brief Return a shared_ptr to a new instance of xcorr::capon_ccf.
*
* To avoid accidental use of raw pointers, xcorr::capon_ccf's
* constructor is in a private implementation
* class. xcorr::capon_ccf::make is the public interface for
* creating new instances.
*/
static sptr make(int vector_size);
};
} // namespace xcorr
} // namespace gr
#endif /* INCLUDED_XCORR_CAPON_CCF_H */
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-cen-xr-w32-bld/build/netwerk/base/public/nsIProtocolProxyCallback.idl
*/
#ifndef __gen_nsIProtocolProxyCallback_h__
#define __gen_nsIProtocolProxyCallback_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIURI; /* forward declaration */
class nsIProxyInfo; /* forward declaration */
class nsICancelable; /* forward declaration */
/* starting interface: nsIProtocolProxyCallback */
#define NS_IPROTOCOLPROXYCALLBACK_IID_STR "a9967200-f95e-45c2-beb3-9b060d874bfd"
#define NS_IPROTOCOLPROXYCALLBACK_IID \
{0xa9967200, 0xf95e, 0x45c2, \
{ 0xbe, 0xb3, 0x9b, 0x06, 0x0d, 0x87, 0x4b, 0xfd }}
/**
* This interface serves as a closure for nsIProtocolProxyService's
* asyncResolve method.
*/
class NS_NO_VTABLE NS_SCRIPTABLE nsIProtocolProxyCallback : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROTOCOLPROXYCALLBACK_IID)
/**
* This method is called when proxy info is available or when an error
* in the proxy resolution occurs.
*
* @param aRequest
* The value returned from asyncResolve.
* @param aURI
* The URI passed to asyncResolve.
* @param aProxyInfo
* The resulting proxy info or null if there is no associated proxy
* info for aURI. As with the result of nsIProtocolProxyService's
* resolve method, a null result implies that a direct connection
* should be used.
* @param aStatus
* The status of the callback. This is a failure code if the request
* could not be satisfied, in which case the value of aStatus
* indicates the reason for the failure and aProxyInfo will be null.
*/
/* void onProxyAvailable (in nsICancelable aRequest, in nsIURI aURI, in nsIProxyInfo aProxyInfo, in nsresult aStatus); */
NS_SCRIPTABLE NS_IMETHOD OnProxyAvailable(nsICancelable *aRequest, nsIURI *aURI, nsIProxyInfo *aProxyInfo, nsresult aStatus) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIProtocolProxyCallback, NS_IPROTOCOLPROXYCALLBACK_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPROTOCOLPROXYCALLBACK \
NS_SCRIPTABLE NS_IMETHOD OnProxyAvailable(nsICancelable *aRequest, nsIURI *aURI, nsIProxyInfo *aProxyInfo, nsresult aStatus);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPROTOCOLPROXYCALLBACK(_to) \
NS_SCRIPTABLE NS_IMETHOD OnProxyAvailable(nsICancelable *aRequest, nsIURI *aURI, nsIProxyInfo *aProxyInfo, nsresult aStatus) { return _to OnProxyAvailable(aRequest, aURI, aProxyInfo, aStatus); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROTOCOLPROXYCALLBACK(_to) \
NS_SCRIPTABLE NS_IMETHOD OnProxyAvailable(nsICancelable *aRequest, nsIURI *aURI, nsIProxyInfo *aProxyInfo, nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnProxyAvailable(aRequest, aURI, aProxyInfo, aStatus); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsProtocolProxyCallback : public nsIProtocolProxyCallback
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPROTOCOLPROXYCALLBACK
nsProtocolProxyCallback();
private:
~nsProtocolProxyCallback();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsProtocolProxyCallback, nsIProtocolProxyCallback)
nsProtocolProxyCallback::nsProtocolProxyCallback()
{
/* member initializers and constructor code */
}
nsProtocolProxyCallback::~nsProtocolProxyCallback()
{
/* destructor code */
}
/* void onProxyAvailable (in nsICancelable aRequest, in nsIURI aURI, in nsIProxyInfo aProxyInfo, in nsresult aStatus); */
NS_IMETHODIMP nsProtocolProxyCallback::OnProxyAvailable(nsICancelable *aRequest, nsIURI *aURI, nsIProxyInfo *aProxyInfo, nsresult aStatus)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIProtocolProxyCallback_h__ */
|
/* hpsound.c: HP-UX sound I/O
Copyright (c) 2002-2004 Alexander Yurchenko, Russell Marks, Philip Kendall
Matan Ziv-Av, Stuart Brady
$Id: hpsound.c 3115 2007-08-19 02:49:14Z fredm $
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.
*/
#include <config.h>
#ifdef AUDIO_FORMAT_LINEAR16BIT
#include <sys/types.h>
#include <sys/audio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "settings.h"
#include "sound.h"
#include "ui/ui.h"
static int soundfd = -1;
static int sixteenbit = 1;
int sound_lowlevel_init( const char *device, int *freqptr, int *stereoptr )
{
int flags, tmp, frag;
/* select a default device if we weren't explicitly given one */
if( device == NULL ) device = "/dev/audio";
/* Open the sound device non-blocking to avoid hangs if it is being
* used by something else, but then set it blocking again as that's what
* we actually want */
if( ( soundfd = open( device, O_WRONLY | O_NONBLOCK ) ) == -1 ) {
settings_current.sound = 0;
ui_error( UI_ERROR_ERROR, "Couldn't open sound device '%s'", device );
return 1;
}
if( ( flags = fcntl( soundfd, F_GETFL ) ) == -1 ) {
settings_current.sound = 0;
ui_error( UI_ERROR_ERROR, "Couldn't fcntl sound device '%s'", device );
close( soundfd );
return 1;
}
flags &= ~O_NONBLOCK;
if( fcntl( soundfd, F_SETFL, flags ) == -1 ) {
settings_current.sound = 0;
ui_error( UI_ERROR_ERROR, "Couldn't set sound device '%s' blocking",
device );
close( soundfd );
return 1;
}
tmp = AUDIO_FORMAT_LINEAR16BIT;
if( settings_current.sound_force_8bit ||
ioctl( soundfd, AUDIO_SET_DATA_FORMAT, tmp ) < 0 ) {
/* try 8-bit - may be an 8-bit only device */
tmp = AUDIO_FORMAT_LINEAR8BIT;
if( ioctl( soundfd, AUDIO_SET_DATA_FORMAT, tmp ) < 0 ) {
settings_current.sound = 0;
if( settings_current.sound_force_8bit ) {
ui_error( UI_ERROR_ERROR,
"Couldn't set sound device '%s' into 8-bit mode", device );
} else {
ui_error(
UI_ERROR_ERROR,
"Couldn't set sound device '%s' in either 16-bit or 8-bit mode",
device
);
}
close( soundfd );
return 1;
}
sixteenbit = 0;
}
tmp = ( *stereoptr ) ? 2 : 1;
if( ioctl( soundfd, AUDIO_SET_CHANNELS, tmp ) < 0 ) {
tmp = ( *stereoptr ) ? 1 : 2;
if( ioctl( soundfd, AUDIO_SET_CHANNELS, tmp ) < 0 ) {
settings_current.sound = 0;
ui_error(
UI_ERROR_ERROR,
"Couldn't set sound device '%s' into either mono or stereo mode",
device
);
close( soundfd );
return 1;
}
*stereoptr = tmp;
}
if( ioctl( soundfd, AUDIO_SET_SAMPLE_RATE, *freqptr ) < 0 ) {
settings_current.sound = 0;
ui_error( UI_ERROR_ERROR,"Couldn't set sound device '%s' speed to %d",
device, *freqptr );
close( soundfd );
return 1;
}
frag = 16384;
ioctl( soundfd, AUDIO_SET_FRAGMENT, frag );
return 0;
}
void
sound_lowlevel_end( void )
{
if( soundfd != -1 ) close( soundfd );
}
void
sound_lowlevel_frame( libspectrum_signed_word *data, int len )
{
static unsigned char buf8[4096];
unsigned char *data8=(unsigned char *)data;
int ret=0, ofs=0;
len <<= 1; /* now in bytes */
if( !sixteenbit ) {
libspectrum_signed_word *src;
unsigned char *dst;
int f;
src = data; dst = buf8;
len >>= 1;
/* TODO: confirm byteorder on IA64 */
for( f = 0; f < len; f++ )
*dst++ = 128 + (int)( (*src++) / 256 );
data8 = buf8;
}
while( len ) {
ret = write( soundfd, data8 + ofs, len );
if( ret > 0 ) {
ofs += ret;
len -= ret;
}
}
}
#endif /* #ifdef AUDIO_FORMAT_LINEAR16BIT */
|
/****************************************************************\
* *
* Nucleotide Translation Code *
* *
* Guy St.C. Slater.. mailto:guy@ebi.ac.uk *
* Copyright (C) 2000-2008. All Rights Reserved. *
* *
* This source code is distributed under the terms of the *
* GNU General Public License, version 3. See the file COPYING *
* or http://www.gnu.org/licenses/gpl.txt for details *
* *
* If you use this code, please keep this notice intact. *
* *
\****************************************************************/
#ifndef INCLUDED_TRANSLATE_H
#define INCLUDED_TRANSLATE_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**/
#include <glib.h>
#include "argument.h"
typedef struct {
gchar *genetic_code;
} Translate_ArgumentSet;
Translate_ArgumentSet *Translate_ArgumentSet_create(Argument *arg);
#define Translate_AA_SET_SIZE 40
#define Translate_NT_SET_SIZE (1<<4)
#define Translate_PIMA_SET_SIZE 18
#define Translate_ALPHABET_SIZE (1<<8)
#define Translate_TRANSLATION_SIZE 4096
typedef struct {
guint ref_count;
guchar *nt;
guchar *aa;
guchar *code;
guchar nt2d[Translate_ALPHABET_SIZE];
guchar aa2d[Translate_ALPHABET_SIZE];
gint aamask[Translate_AA_SET_SIZE];
guchar trans[Translate_TRANSLATION_SIZE];
GPtrArray *revtrans[Translate_ALPHABET_SIZE];
} Translate;
Translate *Translate_create(gboolean use_pima);
Translate *Translate_share(Translate *t);
void Translate_destroy(Translate *t);
gint Translate_sequence(Translate *t, gchar *dna,
gint dna_length, gint frame, gchar *aaseq,
guchar *filter);
/* Sequence_translate frame is 1, 2, 3 for forward,
* or -1,-2,-3 for reverse.
* Sufficient space for translated sequence must provided in aaseq
* Translated seq is NULL terminated.
* Length of translated sequence is returned
*/
typedef void (*Translate_reverse_func)(gchar *dna, gint length,
gpointer user_data);
void Translate_reverse(Translate *t, gchar *aaseq, gint length,
Translate_reverse_func trf, gpointer user_data);
#define Translate_codon(t, codon) \
((gchar)((t)->aa[(t)->trans[((t)->nt2d[(guchar)(codon)[0]]) \
|((t)->nt2d[(guchar)(codon)[1]]<<4) \
|((t)->nt2d[(guchar)(codon)[2]]<<8)]]))
#define Translate_base(t, a, b, c) \
((t)->aa[(t)->trans[((t)->nt2d[(guchar)(a)]) \
|((t)->nt2d[(guchar)(b)]<<4) \
|((t)->nt2d[(guchar)(c)]<<8)]])
/**/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* INCLUDED_TRANSLATE_H */
|
//
// PopTableViewController.h
// CoCode
//
// Created by wuxueqian on 15/11/9.
// Copyright (c) 2015年 wuxueqian. All rights reserved.
//
@interface CCFilterViewController : UIViewController
@property (nonatomic, copy) void (^onItemSelected)(NSDictionary *);
@property (nonatomic, copy) void (^onCancel)();
@property (nonatomic, strong) NSArray *filters;
@property (nonatomic, assign) NSInteger tag;
@property (nonatomic, strong) NSString *filterTitle;
@end
|
#ifndef STRINGUTIL_H_
#define STRINGUTIL_H_
#include <vector>
#include <string>
#define MAX_DIGITS_IN_INT 12 // max number of digits in an int (-2147483647 = 11 digits, +1 for the '\0')
// Removes leading white space
extern void TrimLeft(std::string &s);
// Counts the number of lines in a block of text
extern int CountLines(const std::wstring &s);
// Does a classic * & ? pattern match on a file name - this is case sensitive!
extern bool WildcardMatch(const char *pat, const char *str);
extern std::string ToStr(int num, int base = 10);
extern std::string ToStr(unsigned int num, int base = 10);
extern std::string ToStr(unsigned long num, int base = 10);
extern std::string ToStr(float num);
extern std::string ToStr(double num);
extern std::string ToStr(bool val);
extern std::string ToStr(char* val);
extern std::string ToStr(const char* val);
extern std::string ToStr(std::string str);
// Splits a string by the delimeter into a vector of strings. For example, say you have the following string:
// std::string test("one,two,three");
// You could call Split() like this:
// Split(test, outVec, ',');
// outVec will have the following values:
// "one", "two", "three"
void Split(const std::string& str, std::vector<std::string>& vec, char delimiter);
unsigned long HashName(char const* identStr);
std::string GetBaseName(const std::string& path);
std::string RemoveExtension(const std::string& fileName);
std::string StripPathAndExtension(const std::string& fullFilePath);
inline bool StringContains(std::string& str, std::string& what)
{
return str.find(what) != std::string::npos;
}
#endif
|
/*
* This file is part of GtkEveMon.
*
* GtkEveMon 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.
*
* You should have received a copy of the GNU General Public License
* along with GtkEveMon. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GUI_EVE_LAUNCHER
#define GUI_EVE_LAUNCHER
#include <string>
#include <vector>
#include "winbase.h"
class GuiEveLauncher : public WinBase
{
private:
void run_command (std::string const& cmd);
protected:
GuiEveLauncher (std::vector<std::string> const& cmds);
public:
static Gtk::Window* launch_eve (void);
};
#endif /* GUI_EVE_LAUNCHER */
|
/*
* Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef POPPLER_DOCUMENT_H
#define POPPLER_DOCUMENT_H
#include "poppler-global.h"
#include "poppler-font.h"
namespace poppler
{
class document_private;
class embedded_file;
class page;
class toc;
class POPPLER_CPP_EXPORT document : public poppler::noncopyable
{
public:
enum page_mode_enum {
use_none,
use_outlines,
use_thumbs,
fullscreen,
use_oc,
use_attach
};
enum page_layout_enum {
no_layout,
single_page,
one_column,
two_column_left,
two_column_right,
two_page_left,
two_page_right
};
~document();
bool is_locked() const;
bool unlock(const std::string &owner_password, const std::string &user_password);
page_mode_enum page_mode() const;
page_layout_enum page_layout() const;
void get_pdf_version(int *major, int *minor) const;
std::vector<std::string> info_keys() const;
ustring info_key(const std::string &key) const;
time_type info_date(const std::string &key) const;
bool is_encrypted() const;
bool is_linearized() const;
bool has_permission(permission_enum which) const;
ustring metadata() const;
bool get_pdf_id(std::string *permanent_id, std::string *update_id) const;
int pages() const;
page* create_page(const ustring &label) const;
page* create_page(int index) const;
std::vector<font_info> fonts() const;
font_iterator* create_font_iterator(int start_page = 0) const;
toc* create_toc() const;
bool has_embedded_files() const;
std::vector<embedded_file *> embedded_files() const;
static document* load_from_file(const std::string &file_name,
const std::string &owner_password = std::string(),
const std::string &user_password = std::string());
static document* load_from_data(byte_array *file_data,
const std::string &owner_password = std::string(),
const std::string &user_password = std::string());
static document* load_from_raw_data(const char *file_data,
int file_data_length,
const std::string &owner_password = std::string(),
const std::string &user_password = std::string());
private:
document(document_private &dd);
document_private *d;
friend class document_private;
};
}
#endif
|
/*****************************************************************************
* Copyright (c) 2014-2018 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include <string>
#include "../common.h"
#include "../peep/Peep.h"
#include "../world/Map.h"
#include "../world/Sprite.h"
class NetworkPacket;
class NetworkPlayer final
{
public:
uint8_t Id = 0;
std::string Name;
uint16_t Ping = 0;
uint8_t Flags = 0;
uint8_t Group = 0;
money32 MoneySpent = MONEY(0, 0);
uint32_t CommandsRan = 0;
int32_t LastAction = -999;
uint32_t LastActionTime = 0;
LocationXYZ16 LastActionCoord = {};
rct_peep* PickupPeep = nullptr;
int32_t PickupPeepOldX = LOCATION_NULL;
std::string KeyHash;
uint32_t LastDemolishRideTime = 0;
uint32_t LastPlaceSceneryTime = 0;
NetworkPlayer() = default;
void SetName(const std::string &name);
void Read(NetworkPacket &packet);
void Write(NetworkPacket &packet);
void AddMoneySpent(money32 cost);
};
|
#define tableau_entrer t->te
#define tableau_int t->ti
#define tableau_binaire t->tb
#define taille_tableau t->sot
#define tableau_sortie t->ts
#define taille_sortie t->sots
#define tableau_sortieH t->tsh
#define taille_sortieH t->sotsh
struct tabs_s
{
int sot; // size of tabs
char *te; //tabs entrée
int *ti; //tabs int
int *tb; //tab binaire
char *ts;
int sots;
int* tsh;
int sotsh;
};
typedef struct tabs_s *tabs;
struct code_s{
int* b;
char c;
int sob;
int id;
struct code_s *suivant;
};
typedef struct code_s *code;
typedef void* dont_now_type;
dont_now_type mem_remem_tabs(void *tab, char *type, int size);
tabs mem_taux(tabs t);
|
/*
Copyright (C) 2012 Abrt team.
Copyright (C) 2012 RedHat 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 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, Suite 500, Boston, MA 02110-1335 USA
*/
#include "common.h"
#include <pygobject.h>
static char module_doc[] = "gnome-abrt's libreport & abrt wrappers";
static PyMethodDef module_methods[] = {
/* method_name, func, flags, doc_string */
{ "show_events_list_dialog", p_show_events_list_dialog, METH_VARARGS, "Open a dialog with event configurations" },
{ "show_problem_details_for_dir", p_show_problem_details_for_dir, METH_VARARGS, "Open a dialog with technical details" },
{ "get_app_for_cmdline", p_get_app_for_cmdline, METH_VARARGS, "Get the application for a specific command-line" },
{ "get_app_for_env", p_get_app_for_env, METH_VARARGS, "Get the application for a specific environment" },
{ NULL }
};
PyMODINIT_FUNC PyInit__wrappers(void)
{
PyObject *m;
static struct PyModuleDef moduledef = {
.m_base = PyModuleDef_HEAD_INIT,
.m_name = "_wrappers",
.m_doc = module_doc,
.m_size = -1,
.m_methods = module_methods,
/*.m_slots = NULL,*/
/*.m_traverse = NULL,*/
/*.m_clear = NULL,*/
/*.m_free = NULL,*/
};
m = PyModule_Create(&moduledef);
if (m == NULL)
return NULL;
Py_Initialize();
pygobject_init(-1, -1, -1);
return m;
}
|
/*
This file is part of RailRoad.
RailRoad is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
RailRoad 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 RailRoad. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LOGIC_H__
#define __LOGIC_H__
#include "MailCar.h"
#include "Track.h"
class Logic {
public:
static void start_thread(void* t);
Logic(MailCar *output, MailCar *input, Track* track, atomic<bool>* exit, int debug);
~Logic();
void LogicLoop();
private:
MailCar* _inCar;
MailCar* _outCar;
Track* _track;
atomic<bool>* _exit;
int _debug;
};
#endif // __LOGIC_H__
|
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Minitronics v1.0/1.1 pin assignments
*/
#ifndef __AVR_ATmega1281__
#error "Oops! Make sure you have 'Minitronics' selected from the 'Tools -> Boards' menu."
#endif
#if HOTENDS > 2
#error "Minitronics supports up to 2 hotends. Comment this line to keep going."
#endif
#define BOARD_NAME "Minitronics v1.0 / v1.1"
#define LARGE_FLASH true
//
// Limit Switches
//
#define X_MIN_PIN 5
#define X_MAX_PIN 2
#define Y_MIN_PIN 2
#define Y_MAX_PIN 15
#define Z_MIN_PIN 6
#define Z_MAX_PIN -1
//
// Steppers
//
#define X_STEP_PIN 48
#define X_DIR_PIN 47
#define X_ENABLE_PIN 49
#define Y_STEP_PIN 39 // A6
#define Y_DIR_PIN 40 // A0
#define Y_ENABLE_PIN 38
#define Z_STEP_PIN 42 // A2
#define Z_DIR_PIN 43 // A6
#define Z_ENABLE_PIN 41 // A1
#define E0_STEP_PIN 45
#define E0_DIR_PIN 44
#define E0_ENABLE_PIN 27
#define E1_STEP_PIN 36
#define E1_DIR_PIN 35
#define E1_ENABLE_PIN 37
//
// Temperature Sensors
//
#define SDSS 16
#define LED_PIN 46
#define TEMP_0_PIN 7 // ANALOG NUMBERING
#define TEMP_1_PIN 6 // ANALOG NUMBERING
#define TEMP_BED_PIN 6 // ANALOG NUMBERING
//
// Heaters / Fans
//
#define HEATER_0_PIN 7 // EXTRUDER 1
#define HEATER_1_PIN 8 // EXTRUDER 2
#define HEATER_BED_PIN 3 // BED
#define FAN_PIN 9
//
// LCD / Controller
//
#define BEEPER_PIN -1
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define LCD_PINS_RS 15 // CS chip select /SS chip slave select
#define LCD_PINS_ENABLE 11 // SID (MOSI)
#define LCD_PINS_D4 10 // SCK (CLK) clock
#define BTN_EN1 18
#define BTN_EN2 17
#define BTN_ENC 25
#define SD_DETECT_PIN 30
#else
#define LCD_PINS_RS -1
#define LCD_PINS_ENABLE -1
#define LCD_PINS_D4 -1
#define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1
#define LCD_PINS_D7 -1
// Buttons are directly attached using keypad
#define BTN_EN1 -1
#define BTN_EN2 -1
#define BTN_ENC -1
#define SD_DETECT_PIN -1 // Minitronics doesn't use this
#endif
|
#pragma once
#include "DomoticzHardware.h"
#include "csocket.h"
using namespace std;
class bt_openwebnet;
class COpenWebNetTCP : public CDomoticzHardwareBase
{
public:
COpenWebNetTCP(const int ID, const std::string &IPAddress, const unsigned short usIPPort, const std::string &ownPassword);
~COpenWebNetTCP(void);
enum _eWho {
WHO_SCENARIO = 0,
WHO_LIGHTING=1,
WHO_AUTOMATION=2,
WHO_LOAD_CONTROL=3,
WHO_TEMPERATURE_CONTROL = 4,
WHO_BURGLAR_ALARM = 5,
WHO_DOOR_ENTRY_SYSTEM = 6,
WHO_MULTIMEDIA = 7,
WHO_AUXILIARY = 9,
WHO_GATEWAY_INTERFACES_MANAGEMENT = 13,
WHO_LIGHT_SHUTTER_ACTUATOR_LOCK = 14,
WHO_SCENARIO_SCHEDULER_SWITCH = 15,
WHO_AUDIO = 16,
WHO_SCENARIO_PROGRAMMING = 17,
WHO_ENERGY_MANAGEMENT = 18,
WHO_LIHGTING_MANAGEMENT = 24,
WHO_SCENARIO_SCHEDULER_BUTTONS = 25,
WHO_DIAGNOSTIC = 1000,
WHO_AUTOMATIC_DIAGNOSTIC = 1001,
WHO_THERMOREGULATION_DIAGNOSTIC_FAILURES = 1004,
WHO_DEVICE_DIAGNOSTIC = 1013
};
enum _eAutomationWhat {
AUTOMATION_WHAT_STOP = 0,
AUTOMATION_WHAT_UP = 1,
AUTOMATION_WHAT_DOWN = 2
};
enum _eLightWhat {
LIGHT_WHAT_OFF = 0,
LIGHT_WHAT_ON = 1
};
enum _eAuxiliaryWhat {
AUXILIARY_WHAT_OFF = 0,
AUXILIARY_WHAT_ON = 1
};
bool isStatusSocketConnected();
bool WriteToHardware(const char *pdata, const unsigned char length);
// signals
boost::signals2::signal<void()> sDisconnected;
protected:
bool StartHardware();
bool StopHardware();
std::string m_szIPAddress;
unsigned short m_usIPPort;
std::string m_ownPassword;
void Do_Work();
void MonitorFrames();
boost::shared_ptr<boost::thread> m_monitorThread;
boost::shared_ptr<boost::thread> m_heartbeatThread;
volatile bool m_stoprequested;
volatile bool firstscan;
uint32_t ownCalcPass(string password, string nonce);
bool nonceHashAuthentication(csocket *connectionSocket);
csocket* connectGwOwn(const char *connectionMode);
void disconnect();
int m_heartbeatcntr;
csocket* m_pStatusSocket;
bool write(const char *pdata, size_t size);
bool sendCommand(bt_openwebnet& command, vector<bt_openwebnet>& response, int waitForResponse = 0, bool silent=false);
bool ParseData(char* data, int length, vector<bt_openwebnet>& messages);
bool FindDevice(int who, int where, int iInterface, int *used);
void UpdateSwitch(const int who, const int where, const int Level, int iInterface, const int BatteryLevel,const char *devname, const int subtype);
void UpdateBlinds(const int who, const int where, const int Command, int iInterface, const int BatteryLevel, const char *devname);
void UpdateTemp(const int who, const int where, float fval, const int BatteryLevel, const char *devname);
void UpdateDeviceValue(vector<bt_openwebnet>::iterator iter);
void scan_automation_lighting();
void scan_temperature_control();
void scan_device();
void requestTime();
void requestBurglarAlarmStatus();
};
|
/* -*- c++ -*- */
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_FLOAT_TO_CHAR_IMPL_H
#define INCLUDED_FLOAT_TO_CHAR_IMPL_H
#include <gnuradio/blocks/float_to_char.h>
namespace gr {
namespace blocks {
class BLOCKS_API float_to_char_impl : public float_to_char
{
size_t d_vlen;
float d_scale;
public:
float_to_char_impl(size_t vlen, float scale);
virtual float scale() const { return d_scale; }
virtual void set_scale(float scale) { d_scale = scale; }
int work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
};
} /* namespace blocks */
} /* namespace gr */
#endif /* INCLUDED_FLOAT_TO_CHAR_IMPL_H */
|
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Parametrization/ParameterDistribution.h
//! @brief Defines class ParameterDistribution.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef PARAMETERDISTRIBUTION_H
#define PARAMETERDISTRIBUTION_H
#include "IParameterized.h"
#include "RealLimits.h"
#include "ParameterSample.h"
#include <memory>
#include <vector>
class IDistribution1D;
class BA_CORE_API_ ParameterDistribution : public IParameterized
{
public:
ParameterDistribution(const std::string& par_name,
const IDistribution1D& distribution,
size_t nbr_samples, double sigma_factor=0.0,
const RealLimits& limits = RealLimits());
ParameterDistribution(const std::string& par_name,
const IDistribution1D& distribution,
size_t nbr_samples, double xmin, double xmax);
ParameterDistribution(const ParameterDistribution& other);
virtual ~ParameterDistribution();
//! Overload assignment operator
ParameterDistribution& operator=(const ParameterDistribution& other);
ParameterDistribution& linkParameter(std::string par_name);
//! get the main parameter's name
std::string getMainParameterName() const { return m_name; }
//! get number of samples for this distribution
size_t getNbrSamples() const;
//! get the sigma factor
double getSigmaFactor() const { return m_sigma_factor; }
const IDistribution1D* getDistribution() const;
IDistribution1D* getDistribution();
//! generate list of sampled values with their weight
std::vector<ParameterSample> generateSamples() const;
//! get list of linked parameter names
std::vector<std::string> getLinkedParameterNames() const { return m_linked_par_names; }
RealLimits getLimits() const { return m_limits; }
double getMinValue() const { return m_xmin; }
double getMaxValue() const { return m_xmax; }
private:
std::string m_name;
std::unique_ptr<IDistribution1D> mP_distribution;
size_t m_nbr_samples;
double m_sigma_factor;
std::vector<std::string> m_linked_par_names;
RealLimits m_limits;
double m_xmin;
double m_xmax;
};
#endif // PARAMETERDISTRIBUTION_H
|
/*
Copyright 2014 Mona
mathieu.poux[a]gmail.com
jammetthomas[a]gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License received along this program for more
details (or else see http://www.gnu.org/licenses/).
This file is a part of Mona.
*/
#pragma once
#include "Mona/Mona.h"
#include "Mona/Application.h"
#include "Mona/TerminateSignal.h"
namespace Mona {
class ServerApplication : public Application, public virtual Object {
public:
ServerApplication() : _isInteractive(true) { _PThis = this; }
bool isInteractive() const { return _isInteractive; }
int run(int argc, const char* argv[]);
protected:
void defineOptions(Exception& ex, Options& options);
private:
virtual int main(TerminateSignal& terminateSignal) = 0;
int main() { return Application::EXIT_OK; }
bool _isInteractive;
static ServerApplication* _PThis;
static TerminateSignal _TerminateSignal;
#if defined(_WIN32)
static int __stdcall ConsoleCtrlHandler(unsigned long ctrlType);
static void __stdcall ServiceMain(unsigned long argc, char** argv);
static void __stdcall ServiceControlHandler(unsigned long control);
bool hasConsole();
bool isService();
void beService();
bool registerService(Exception& ex);
bool unregisterService(Exception& ex);
std::string _displayName;
std::string _description;
std::string _startup;
#else
void handlePidFile(Exception& ex,const std::string& value);
bool isDaemon(int argc, const char** argv);
void beDaemon();
std::string _pidFile;
#endif
};
} // namespace Mona
|
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file src/gfile/gfile_rules.h
* @brief GFILE safety rules header file.
*
* @addtogroup GFILE
* @{
*/
#ifndef _GFILE_RULES_H
#define _GFILE_RULES_H
#if GFX_USE_GFILE
#if GFILE_NEED_PETITFS && GFILE_NEED_FATFS
#error "GFILE: Both GFILE_NEED_PETITFS and GFILE_NEED_FATFS cannot both be turned on at the same time."
#endif
#endif
#endif /* _GFILE_RULES_H */
/** @} */
|
/*
This file is part of SCSScript.
Copyright (C) 2006-2012 by Nick Sharmanzhinov
SCSScript 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.
SCSScript 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 SCSScript. If not, see <http://www.gnu.org/licenses/>.
Nick Sharmanzhinov
except134@gmail.com
*/
#pragma once
namespace SCSScript
{
namespace SoundEngine
{
struct SoundType
{
Sound* pSound;
UINT iCount;
};
typedef Map<String,SoundType> SoundMap;
typedef Pair<String,SoundType> SoundPair;
typedef Map<String,SoundType>::iterator SoundMapIte;
typedef Map<String,SoundType>::const_iterator SoundMapConstIte;
#define MAX_SND_SOCKETS 1024
class SoundEngine : boost::noncopyable
{
private:
IDirectSound8* m_pDS;
HANDLE m_hThread;
UINT m_dwThreadID;
DWORD s_nEventsCount;
HANDLE s_hEvents[MAX_SND_SOCKETS];
Sound* s_LoopSounds[MAX_SND_SOCKETS];
BOOL s_bIsTerminating;
DWORD m_nSoundsCount;
Sound* m_Sounds[MAX_SND_SOCKETS];
SoundMap m_SoundMap;
String m_MediaPath;
public:
SoundEngine();
virtual ~SoundEngine();
void Init(HWND hwnd,DWORD dwCoopLevel=DSSCL_NORMAL);
void DeInit();
LPDIRECTSOUND8 GetDirectSound() { return m_pDS; }
HRESULT SetPrimaryBufferFormat(DWORD dwPrimaryChannels,DWORD dwPrimaryFreq,DWORD dwPrimaryBitRate);
BOOL AddAndNotify(Sound* pSound);
HRESULT Create(Sound** ppSound,char *strWaveFileName,HINSTANCE g_hInstance,DWORD dwCreationFlags=DSBCAPS_CTRLVOLUME,GUID guid3DAlgorithm=GUID_NULL,DWORD dwNumBuffers=10);
HRESULT CreateFromMemory(Sound** ppSound,PBYTE pbData,ULONG ulDataSize,LPWAVEFORMATEX pwfx,DWORD dwCreationFlags=DSBCAPS_CTRLVOLUME,GUID guid3DAlgorithm=GUID_NULL,DWORD dwNumBuffers=10);
DWORD SoundEventHandler(void);
static DWORD WINAPI SoundEventHandler(LPVOID param) { return ((SoundEngine*)param)->SoundEventHandler(); };
static unsigned __stdcall SoundEventHandler2(LPVOID param) { return ((SoundEngine*)param)->SoundEventHandler(); };
void PreInstall(const String& path) { m_MediaPath=path; };
Sound* Load(const String& filename);
void Play(const String& filename);
void Stop(const String& filename);
bool IsPlaying(const String& filename);
void SetVolume(String& filename,int vol);
int GetVolume(String& filename);
void Mute(String& filename);
void UnMute(String& filename);
void Pause(String& filename);
void UnPause(String& filename);
void PlayIfNotPlaying(const String& filename);
void StopIfPlaying(const String& filename);
void MuteAll();
void UnMuteAll();
void PauseAll();
void UnPauseAll();
void StopAll();
};
}
}
|
/*
** Copyright 2016 @AR
**
**
**
*/
extern void system_call(void);
#include <types.h>
#include <idt.h>
#include <kernel.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <ptrace.h>
#include <mm.h>
#include <console.h>
#include <sched.h>
#include <wait.h>
#include <fs.h>
#include <console.h>
#define DEC_SYSC(name) int sys_##name(unsigned long esp);
DEC_SYSC(restart)
DEC_SYSC(exit)
DEC_SYSC(fork)
DEC_SYSC(execv)
DEC_SYSC(console_write)
DEC_SYSC(console_read)
DEC_SYSC(wait)
DEC_SYSC(uname)
DEC_SYSC(setup)
DEC_SYSC(ls)
DEC_SYSC(cd)
DEC_SYSC(pwd)
DEC_SYSC(ps)
DEC_SYSC(free)
DEC_SYSC(clear)
typedef int (*sys_fn_ptr)(unsigned long);
#define E_SYSC(name) [SYS_##name]=&sys_##name
sys_fn_ptr sys_call_table[] = {[SYS_restart]=&sys_restart, [SYS_exit]=&sys_exit, [SYS_fork]=&sys_fork, [SYS_execv]=&sys_execv,
[SYS_console_write]=&sys_console_write, [SYS_console_read]=&sys_console_read,
E_SYSC(wait),
E_SYSC(uname), E_SYSC(setup), E_SYSC(ls), E_SYSC(cd), E_SYSC(pwd),
E_SYSC(ps), E_SYSC(free), E_SYSC(clear)
};
int sys_restart(unsigned long esp)
{
return -ENOSYS; /* Function not implemented */
}
int sys_exit(unsigned long esp)
{
do_exit();
return 0;
}
int sys_fork(unsigned long esp)
{
return (int)do_fork((struct pt_regs *)esp);
}
int sys_execv(unsigned long esp)
{
char buf[256];
char *filename = (char *)(*(unsigned long*)(esp + _EBX));
strncpy(filename, &buf[0], 256); /*copy str from user to kernel space*/
do_execv(&buf[0], (struct pt_regs *)esp);
return 0;
}
int sys_console_write(unsigned long esp)
{
struct pt_regs* regs;
char buf[256];
regs = (struct pt_regs*)esp;
char *s = (char *)regs->ebx;
strncpy(s, &buf[0], 256); /*copy str from user to kernel space*/
printk(&buf[0]);
return 0;
}
int sys_console_read(unsigned long esp)
{
struct pt_regs* regs;
regs = (struct pt_regs*)esp;
char *buf = (char *)regs->ebx;
cons_read(buf);
return 0;
}
int sys_wait(unsigned long esp)
{
do_wait();
return 0;
}
int sys_ls(unsigned long esp)
{
do_ls();
return 0;
}
int sys_cd(unsigned long esp)
{
struct pt_regs* regs;
char namebuf[256];
regs = (struct pt_regs*)esp;
char *arg1 = (char *)regs->ebx;
strncpy(arg1, &namebuf[0], 256); /*copy str from user to kernel space*/
do_cd(&namebuf[0]);
return 0;
}
int sys_pwd(unsigned long esp)
{
do_pwd();
return 0;
}
int sys_ps(unsigned long esp)
{
do_ps();
return 0;
}
int sys_free(unsigned long esp)
{
show_mem();
return 0;
}
int sys_clear(unsigned long esp)
{
cons_clear(current->tty);
return 0;
}
int sys_setup(unsigned long esp)
{
printk("Appel sys_setup\n");
return 0;
}
int sys_uname(unsigned long esp)
{
printk("Appel sys_uname\n");
return 0;
}
void sys_call_init(void)
{
set_system_gate(0x80, (u32) system_call);
}
|
// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
/*******************************************************************************
* This file is part of NUISANCE.
*
* NUISANCE 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.
*
* NUISANCE 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 NUISANCE. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
#ifndef MINERVA_CCCOHPI_XSEC_1DQ2_NU_H_SEEN
#define MINERVA_CCCOHPI_XSEC_1DQ2_NU_H_SEEN
#include "Measurement1D.h"
class MINERvA_CCCOHPI_XSec_1DQ2_nu : public Measurement1D {
public:
MINERvA_CCCOHPI_XSec_1DQ2_nu(nuiskey samplekey);
virtual ~MINERvA_CCCOHPI_XSec_1DQ2_nu() {};
void FillEventVariables(FitEvent *event);
bool isSignal(FitEvent *event);
private:
};
#endif
|
/*****************************************************************************\
* $Id: ipmipower_output.h,v 1.16 2010-02-08 22:02:31 chu11 Exp $
*****************************************************************************
* Copyright (C) 2007-2015 Lawrence Livermore National Security, LLC.
* Copyright (C) 2003-2007 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Albert Chu <chu11@llnl.gov>
* UCRL-CODE-155698
*
* This file is part of Ipmipower, a remote power control utility.
* For details, see http://www.llnl.gov/linux/.
*
* Ipmipower 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.
*
* Ipmipower 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 Ipmipower. If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/
#ifndef IPMIPOWER_OUTPUT_H
#define IPMIPOWER_OUTPUT_H
#include "ipmipower.h"
void ipmipower_output (ipmipower_msg_type_t num, const char *hostname, const char *extra_arg);
/* ipmipower_output_finish
* - Output final results, mostly notably w/ consolidated output.
*/
void ipmipower_output_finish (void);
#endif /* IPMIPOWER_OUTPUT_H */
|
/*
Copyright (c) 2015-2018 Oliver Lau <ola@ct.de>, Heise Medien GmbH & Co. KG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __UTIL_H_
#define __UTIL_H_
#include <cstring>
#include <QObject>
#include <QString>
#include <QByteArray>
#include <QVector>
#include <qmath.h>
template <class T>
void SafeRenew(T& a, T obj)
{
if (a != Q_NULLPTR)
delete a;
a = obj;
}
template <class T>
void SafeDelete(T& a)
{
SafeRenew<T>(a, Q_NULLPTR);
}
template <class T>
void SecureErase(T *p, size_t size)
{
memset(p, 0, size);
}
template <class T>
void SecureErase(T &obj)
{
for (typename T::iterator i = obj.begin(); i != obj.end(); ++i)
*i = 0;
obj.clear();
}
template<typename T>
T clamp(const T &x, const T &lo, const T &hi)
{
return qMax(lo, qMin(hi, x));
}
extern QString shuffled(const QString&);
extern QByteArray shuffled(const QByteArray&);
extern QString fingerprintify(const QByteArray &ba);
extern bool containsAll(const QString &haystack, const QString &needles);
extern bool containsAny(const QString &haystack, const QString &needles);
#if defined(Q_CC_GNU)
extern void SecureErase(QString str);
#endif
#endif // __UTIL_H_
|
//---------------------------------------------------------------------------------------
//
// Project: DirectionalityIndicator
//
// Copyright 2014-2015 Sebastian Eichelbaum (http://www.sebastian-eichelbaum.de)
// 2014-2015 Max Planck Research Group "Neuroanatomy and Connectivity"
//
// This file is part of DirectionalityIndicator.
//
// DirectionalityIndicator 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.
//
// DirectionalityIndicator 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 DirectionalityIndicator. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------------------
#ifndef DI_SCREENSHOTWIDGET_H
#define DI_SCREENSHOTWIDGET_H
#include <tuple>
#include <string>
#include <vector>
#include <QWidget>
#include <QComboBox>
#include <QToolButton>
#include <QCheckBox>
#include <QVBoxLayout>
#include <di/gfx/PixelData.h>
#include <di/GfxTypes.h>
#include <di/Types.h>
namespace di
{
namespace gui
{
class ScaleLabel;
class ColorPicker;
/**
* A simple widget to provide screenshot functionality.
*/
class ScreenShotWidget: public QWidget
{
Q_OBJECT
public:
/**
* Create the widget.
*
* \param parent the parent widget.
*/
explicit ScreenShotWidget( QWidget* parent = nullptr );
/**
* Destroy and clean up.
*/
virtual ~ScreenShotWidget() = default;
/**
* Get width of the screenshot
*
* \return the width
*/
int getWidth() const;
/**
* Get height of the screenshot
*
* \return the height
*/
int getHeight() const;
/**
* Get the number of samples for the screenshot
*
* \return the number of samples
*/
int getSamples() const;
/**
* Set the max number of samples
*
* \param samples the max num of samples
*/
void setMaxSamples( int samples );
/**
* Set maximum resolution for screenshots.
*
* \param res the max resolution
*/
void setMaxResolution( int res );
/**
* Save the pixel data as screenshot.
*
* \param pixels the image
* \param nameHint hint how to name the file.
* \param pathOverride the path where to store the image. Can be empty to use the user specified path.
*
* \return false on error
*/
bool saveScreenShot( SPtr< core::RGBA8Image > pixels, const std::string& nameHint, const std::string& pathOverride = "" );
/**
* Check if the background should be different from the default
*
* \return true if the screenshot-color should be used
*/
bool getBackgroundOverride() const;
/**
* Get the currently set default background color.
*
* \return the color
*/
di::Color getBackgroundColor() const;
/**
* Checks if the user wants all views to be captured.
*
* \return true if enabled.
*/
bool getCaptureAll() const;
protected slots:
/**
* Handle shutdown. Emited by the main windows
*/
virtual void shutdown();
/**
* Query the image path for screenshots.
*/
virtual void queryImagePath();
private:
/**
* The load/file widget layout.
*/
QVBoxLayout* m_contentLayout;
/**
* Max amount of samples.
*/
int m_maxSamples = 4;
/**
* Max amount of samples.
*/
int m_maxRes = 4;
/**
* The resolutions to support.
*/
std::vector< std::tuple< std::string, int, int > > m_resolutions;
/**
* The supported samples.
*/
std::vector< std::tuple< std::string, int > > m_samples;
/**
* Sampling combobox
*/
QComboBox* m_sampleCombo = nullptr;
/**
* Resolution combobox.
*/
QComboBox* m_resolutionCombo = nullptr;
/**
* Where to place the screenshots.
*/
QToolButton* m_location = nullptr;
/**
* Choose a BG color for screenshots.
*/
ColorPicker* m_bgColor = nullptr;
/**
* Override default background with this one.
*/
QCheckBox* m_bgColorOverride = nullptr;
/**
* Checkbox to force screenshots of all default views.
*/
QCheckBox* m_allDefaultViews = nullptr;
};
}
}
#endif // DI_SCREENSHOTWIDGET_H
|
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
/* Error definitions and output stringification based on the work available
* at the libsllp project repository: https://github.com/brunoseivam/libsllp */
#include "convc.h"
static const char *convc_err [CONVC_ERR_END] =
{
[CONVC_SUCCESS] = "Success",
[CONVC_ERR_ALLOC] = "Could not allocate memory"
};
/* Convert enumeration type to string */
const char * convc_err_str (convc_err_e err)
{
return convc_err [err];
}
|
/*
** ClanLib SDK
** Copyright (c) 1997-2011 The ClanLib Team
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any damages
** arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose,
** including commercial applications, and to alter it and redistribute it
** freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not
** claim that you wrote the original software. If you use this software
** in a product, an acknowledgment in the product documentation would be
** appreciated but is not required.
** 2. Altered source versions must be plainly marked as such, and must not be
** misrepresented as being the original software.
** 3. This notice may not be removed or altered from any source distribution.
**
** Note: Some of the libraries ClanLib may link to may have additional
** requirements or restrictions.
**
** File Author(s):
**
** Emanuel Griesen
** Harry Storbacka
*/
/// \addtogroup clanCore_Math clanCore Math
/// \{
#pragma once
#include "../api_core.h"
#include <vector>
#include "point.h"
#include "circle.h"
#include "rect.h"
/// \brief Math operations related to point sets.
///
/// \xmlonly !group=Core/Math! !header=core.h! \endxmlonly
class CL_API_CORE CL_PointSetMath
{
/// \name Operations
/// \{
public:
/// \brief Find minimum spanning circle for the set of points
///
/// \param points the points to calulate on
static CL_Circlef minimum_enclosing_disc(
const std::vector<CL_Pointf> &points);
/// \brief Return the convex hull of the given set of points
///
/// \param points the set of points
static std::vector<CL_Pointf> convex_hull_from_polygon(std::vector<CL_Pointf> &points);
static CL_Rect bounding_box(const std::vector<CL_Pointf> &points);
/// \}
/// \name Implementation
/// \{
private:
static void calculate_minimum_enclosing_disc(
CL_Circlef &smalldisc,
const std::vector<CL_Pointf> &points,
int start,
int end);
static void minimum_disc_with_1point(
CL_Circlef &smalldisc,
const std::vector<CL_Pointf> &points,
int start,
unsigned int i);
static void minimum_disc_with_2points(
CL_Circlef &smalldisc,
const std::vector<CL_Pointf> &points,
int start,
unsigned int i,
unsigned int j);
static void minimum_disc_with_3points(
CL_Circlef &smalldisc,
const std::vector<CL_Pointf> &points,
unsigned int i,
unsigned int j,
unsigned int k);
friend class CL_OutlineMath;
/// \}
};
/// \}
|
/************************************************************************************//**
* \file Source\HCS12\uart.h
* \brief Bootloader UART communication interface header file.
* \ingroup Target_HCS12
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2013 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
#ifndef UART_H
#define UART_H
#if (BOOT_COM_UART_ENABLE > 0)
/****************************************************************************************
* Function prototypes
****************************************************************************************/
void UartInit(void);
void UartTransmitPacket(blt_int8u *data, blt_int8u len);
blt_bool UartReceivePacket(blt_int8u *data);
#endif /* BOOT_COM_UART_ENABLE > 0 */
#endif /* UART_H */
/*********************************** end of uart.h *************************************/
|
#ifndef MANTID_ALGORITHMS_APPLYDEADTIMECORR_H_
#define MANTID_ALGORITHMS_APPLYDEADTIMECORR_H_
#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
namespace Mantid {
namespace Algorithms {
/** ApplyDeadTimeCorr : The dead-time is here applied according to the
non-extendable paralyzable dead time model.
@author Robert Whitley, RAL
@date 2011-11-30
Copyright © 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport ApplyDeadTimeCorr : public API::Algorithm {
public:
/// Algorithm's name for identification
const std::string name() const override { return "ApplyDeadTimeCorr"; };
/// Summary of algorithms purpose
const std::string summary() const override {
return "Apply deadtime correction to each spectrum of a workspace.";
}
/// Algorithm's version for identification
int version() const override { return 1; };
/// Algorithm's category for identification
const std::string category() const override {
return "Muon;CorrectionFunctions\\EfficiencyCorrections";
}
private:
/// Initialise the properties
void init() override;
/// Run the algorithm
void exec() override;
};
} // namespace Algorithms
} // namespace Mantid
#endif /* MANTID_ALGORITHMS_APPLYDEADTIMECORR_H_ */
|
/* This file was generated by syncqt. */
#ifndef QT_QTNFC_VERSION_H
#define QT_QTNFC_VERSION_H
#define QTNFC_VERSION_STR "5.5.0"
#define QTNFC_VERSION 0x050500
#endif // QT_QTNFC_VERSION_H
|
/* -*- mode: C -*-
*
* File: rec-sex-parser.c
* Date: Tue Jan 12 18:01:37 2010
*
* GNU recutils - Sexy parser
*
*/
/* Copyright (C) 2010, 2011, 2012 Jose E. Marchesi */
/* 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 <config.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <rec-sex-parser.h>
#include "rec-sex-tab.h"
/*#include "rec-sex-lex.h" */
/*
* Data types
*/
struct rec_sex_parser_s
{
char *in; /* String to be parsed. */
size_t index; /* Index in in_str. */
void *scanner; /* Flex scanner. */
bool case_insensitive;
rec_sex_ast_t ast;
};
/*
* Public functions
*/
rec_sex_parser_t
rec_sex_parser_new (void)
{
rec_sex_parser_t new;
new = malloc (sizeof (struct rec_sex_parser_s));
if (new)
{
new->in = NULL;
new->index = 0;
new->case_insensitive = false;
/* Initialize the sexy scanner. */
sexlex_init (&(new->scanner));
sexset_extra (new, new->scanner);
}
return new;
}
void *
rec_sex_parser_scanner (rec_sex_parser_t parser)
{
return parser->scanner;
}
void
rec_sex_parser_destroy (rec_sex_parser_t parser)
{
if (parser->scanner)
{
sexlex_destroy (parser->scanner);
}
free (parser->in);
free (parser);
}
rec_sex_ast_t
rec_sex_parser_ast (rec_sex_parser_t parser)
{
return parser->ast;
}
void
rec_sex_parser_set_ast (rec_sex_parser_t parser,
rec_sex_ast_t ast)
{
parser->ast = ast;
}
bool
rec_sex_parser_case_insensitive (rec_sex_parser_t parser)
{
return parser->case_insensitive;
}
void
rec_sex_parser_set_case_insensitive (rec_sex_parser_t parser,
bool case_insensitive)
{
parser->case_insensitive = case_insensitive;
}
void
rec_sex_parser_set_in (rec_sex_parser_t parser,
const char *str)
{
if (parser->in)
{
free (parser->in);
parser->in = NULL;
}
parser->in = strdup (str);
parser->index = 0;
}
int
rec_sex_parser_getc (rec_sex_parser_t parser)
{
int res;
res = -1;
if ((parser->in)
&& (parser->index < strlen (parser->in)))
{
res = parser->in[parser->index++];
}
return res;
}
bool
rec_sex_parser_run (rec_sex_parser_t parser,
const char *expr)
{
int res;
rec_sex_parser_set_in (parser, expr);
if (!sexparse (parser))
{
res = true;
}
else
{
/* Parse error. */
res = false;
}
return res;
}
void
rec_sex_parser_print_ast (rec_sex_parser_t parser)
{
rec_sex_ast_print (parser->ast);
}
/* End of rec-sex-parser.c */
|
/*
* This file is part of Cleanflight.
*
* Cleanflight 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.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define TARGET_BOARD_IDENTIFIER "FF35"
#define USBD_PRODUCT_STRING "FURIOUS F35-LIGHTNING"
#define LED0 PC10 // Blue LED
// #define LED1 PC10 // Red LED
// #define LED2 PC10 // Green LED
#define BEEPER PA1
#define BEEPER_INVERTED
#define USE_DSHOT
// MPU interrupt
#define USE_EXTI
#define GYRO_INT_EXTI PC4
#define USE_MPU_DATA_READY_SIGNAL
#define MPU9250_CS_PIN PC0
#define MPU9250_SPI_BUS BUS_SPI3
#define USE_IMU_MPU9250
#define IMU_MPU9250_ALIGN CW180_DEG
#define USE_MAG
#define USE_MAG_MPU9250
#define MAG_I2C_BUS BUS_I2C1
#define USE_BARO
#define USE_BARO_BMP280
#define BMP280_CS_PIN PC5
#define BMP280_SPI_BUS BUS_SPI3
#define USE_MAX7456
#define MAX7456_CS_PIN PA4
#define MAX7456_SPI_BUS BUS_SPI1
#define USE_VCP
// #define VBUS_SENSING_PIN PA9
#define USE_UART_INVERTER
#define USE_UART1
#define UART1_RX_PIN PA10
#define UART1_TX_PIN PA9
#define USE_UART2
#define UART2_RX_PIN PA3
#define UART2_TX_PIN PA2
#define USE_UART3
#define UART3_RX_PIN PB11
#define UART3_TX_PIN PB10
#define INVERTER_PIN_UART3_RX PA8
#define USE_UART4
#define UART4_RX_PIN PC11
#define UART4_TX_PIN PA0
#define USE_UART5
#define UART5_RX_PIN PD2
#define UART5_TX_PIN PC12
#define USE_UART6
#define UART6_RX_PIN PC7
#define UART6_TX_PIN PC6
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PA3 // shared with UART2 RX
#define SOFTSERIAL_1_TX_PIN PA2 // shared with UART2 TX
#define SERIAL_PORT_COUNT 8 //VCP, UART1, UART2, UART3, UART4, UART5, UART6
#define USE_SPI
#define USE_SPI_DEVICE_1
#define SPI1_NSS_PIN NONE
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
#define USE_SPI_DEVICE_2
#define SPI2_NSS_PIN NONE
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15
#define USE_SPI_DEVICE_3
#define SPI3_NSS_PIN PA15
#define SPI3_SCK_PIN PB3
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5
#define USE_I2C
#define USE_I2C_DEVICE_1
#define I2C1_SCL PB6
#define I2C1_SDA PB7
#define BOARD_HAS_VOLTAGE_DIVIDER
#define USE_ADC
#define ADC_CHANNEL_1_PIN PC3
#define ADC_CHANNEL_2_PIN PC2
#define ADC_CHANNEL_3_PIN PC1
#define AIRSPEED_ADC_CHANNEL ADC_CHN_1
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
#define VBAT_ADC_CHANNEL ADC_CHN_3
#define USE_PITOT_MS4525
#define PITOT_I2C_BUS BUS_I2C1
#define TEMPERATURE_I2C_BUS BUS_I2C1
#define BNO055_I2C_BUS BUS_I2C1
#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_OSD | FEATURE_GPS | FEATURE_TELEMETRY)
#define CURRENT_METER_SCALE 250
// Number of available PWM outputs
#define MAX_PWM_OUTPUT_PORTS 6
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
|
#ifndef GVERBDSP_H
#define GVERBDSP_H
#include "../include/ladspa-util.h"
typedef struct {
int size;
int idx;
float *buf;
} ty_fixeddelay;
typedef struct {
int size;
float coeff;
int idx;
float *buf;
} ty_diffuser;
typedef struct {
float damping;
float delay;
} ty_damper;
ty_diffuser *diffuser_make(int, float);
void diffuser_free(ty_diffuser *);
void diffuser_flush(ty_diffuser *);
//float diffuser_do(ty_diffuser *, float);
ty_damper *damper_make(float);
void damper_free(ty_damper *);
void damper_flush(ty_damper *);
//void damper_set(ty_damper *, float);
//float damper_do(ty_damper *, float);
ty_fixeddelay *fixeddelay_make(int);
void fixeddelay_free(ty_fixeddelay *);
void fixeddelay_flush(ty_fixeddelay *);
//float fixeddelay_read(ty_fixeddelay *, int);
//void fixeddelay_write(ty_fixeddelay *, float);
int isprime(int);
int nearest_prime(int, float);
static inline float diffuser_do(ty_diffuser *p, float x)
{
float y,w;
w = x - p->buf[p->idx]*p->coeff;
w = flush_to_zero(w);
y = p->buf[p->idx] + w*p->coeff;
p->buf[p->idx] = w;
p->idx = (p->idx + 1) % p->size;
return(y);
}
static inline float fixeddelay_read(ty_fixeddelay *p, int n)
{
int i;
i = (p->idx - n + p->size) % p->size;
return(p->buf[i]);
}
static inline void fixeddelay_write(ty_fixeddelay *p, float x)
{
p->buf[p->idx] = x;
p->idx = (p->idx + 1) % p->size;
}
static inline void damper_set(ty_damper *p, float damping)
{
p->damping = damping;
}
static inline float damper_do(ty_damper *p, float x)
{
float y;
y = x*(1.0-p->damping) + p->delay*p->damping;
p->delay = y;
return(y);
}
#endif
|
/*
Copyright 2013 David Malcolm <dmalcolm@redhat.com>
Copyright 2013 Red Hat, Inc.
This 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 <Python.h>
/*
Regression test for:
NotImplementedError: Don't know how to cope with exprcode: <type 'gcc.FloatExpr'> (<type 'gcc.FloatExpr'>) at pyalsa/alsaseq.c:1762
seen in many places
*/
float
test(int i)
{
return i / 42.0;
}
/*
PEP-7
Local variables:
c-basic-offset: 4
indent-tabs-mode: nil
End:
*/
|
/***************************************************************************
file : MyTrack.h
created : 9 Apr 2006
copyright : (C) 2006 Tim Foden, 2013 D.Schellhammer
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _MYTRACK_H_
#define _MYTRACK_H_
#include <track.h>
#include <car.h>
#include "Seg.h"
class MyTrack
{
public:
MyTrack();
~MyTrack();
void NewTrack( tTrack* pNewTrack, double seg_len );
double GetLength() const;
int GetSize() const;
double GetWidth() const;
double NormalisePos( double trackPos ) const;
int IndexFromPos( double trackPos ) const;
const Seg& operator[]( int index ) const;
const Seg& GetAt( int index ) const;
double GetDelta() const;
double CalcPos( tTrkLocPos& trkPos, double offset = 0 ) const;
double CalcPos( tCarElt* car, double offset = 0 ) const;
double CalcPos( double x, double y, const Seg* hint = 0, bool sides = false ) const;
double CalcForwardAngle( double trackPos ) const;
Vec2d CalcNormal( double trackPos ) const;
private:
void CalcPtAndNormal( const tTrackSeg* pSeg, double toStart, double& t, Vec3d& pt, Vec3d& norm ) const;
private:
int NSEG;
double m_delta;
Seg* m_pSegs;
tTrack* m_pCurTrack;
};
#endif // _MYTRACK_H_
|
/* Copyright (C) 1991, 1997, 2009-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#define UNSIGNED 1
#include "strtol.c"
|
#/*
Unix SMB/CIFS implementation.
routines for marshalling/unmarshalling special netlogon types
Copyright (C) Andrew Tridgell 2005
Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008
Copyright (C) Guenther Deschner 2011
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/>.
*/
/* The following definitions come from ../librpc/ndr/ndr_nbt.c */
#ifndef _LIBRPC_NDR_NDR_NBT_H
#define _LIBRPC_NDR_NDR_NBT_H
#include "librpc/gen_ndr/nbt.h"
NDR_SCALAR_PROTO(nbt_string, const char *)
enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r);
enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r);
enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r);
enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r,
uint32_t nt_version_flags);
enum ndr_err_code ndr_push_netlogon_samlogon_response(struct ndr_push *ndr, int ndr_flags, const struct netlogon_samlogon_response *r);
enum ndr_err_code ndr_pull_netlogon_samlogon_response(struct ndr_pull *ndr, int ndr_flags, struct netlogon_samlogon_response *r);
void ndr_print_netlogon_samlogon_response(struct ndr_print *ndr, const char *name, struct netlogon_samlogon_response *r);
#endif /* _LIBRPC_NDR_NDR_NBT_H */
|
/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
#define WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
#include <map>
#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/event.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
#include "webrtc/test/constants.h"
#include "webrtc/test/direct_transport.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_send_stream.h"
namespace webrtc {
namespace test {
class PacketTransport;
class RtpRtcpObserver {
public:
enum Action {
SEND_PACKET,
DROP_PACKET,
};
virtual ~RtpRtcpObserver() {}
virtual bool Wait() { return observation_complete_.Wait(timeout_ms_); }
virtual Action OnSendRtp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
virtual Action OnSendRtcp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
virtual Action OnReceiveRtp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
virtual Action OnReceiveRtcp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
protected:
explicit RtpRtcpObserver(int event_timeout_ms)
: observation_complete_(false, false),
parser_(RtpHeaderParser::Create()),
timeout_ms_(event_timeout_ms) {
parser_->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
kTOffsetExtensionId);
parser_->RegisterRtpHeaderExtension(kRtpExtensionAbsoluteSendTime,
kAbsSendTimeExtensionId);
parser_->RegisterRtpHeaderExtension(kRtpExtensionTransportSequenceNumber,
kTransportSequenceNumberExtensionId);
}
rtc::Event observation_complete_;
const std::unique_ptr<RtpHeaderParser> parser_;
private:
const int timeout_ms_;
};
class PacketTransport : public test::DirectTransport {
public:
enum TransportType { kReceiver, kSender };
PacketTransport(Call* send_call,
RtpRtcpObserver* observer,
TransportType transport_type,
const FakeNetworkPipe::Config& configuration)
: test::DirectTransport(configuration, send_call),
observer_(observer),
transport_type_(transport_type) {}
private:
bool SendRtp(const uint8_t* packet,
size_t length,
const PacketOptions& options) override {
EXPECT_FALSE(RtpHeaderParser::IsRtcp(packet, length));
RtpRtcpObserver::Action action;
{
if (transport_type_ == kSender) {
action = observer_->OnSendRtp(packet, length);
} else {
action = observer_->OnReceiveRtp(packet, length);
}
}
switch (action) {
case RtpRtcpObserver::DROP_PACKET:
// Drop packet silently.
return true;
case RtpRtcpObserver::SEND_PACKET:
return test::DirectTransport::SendRtp(packet, length, options);
}
return true; // Will never happen, makes compiler happy.
}
bool SendRtcp(const uint8_t* packet, size_t length) override {
EXPECT_TRUE(RtpHeaderParser::IsRtcp(packet, length));
RtpRtcpObserver::Action action;
{
if (transport_type_ == kSender) {
action = observer_->OnSendRtcp(packet, length);
} else {
action = observer_->OnReceiveRtcp(packet, length);
}
}
switch (action) {
case RtpRtcpObserver::DROP_PACKET:
// Drop packet silently.
return true;
case RtpRtcpObserver::SEND_PACKET:
return test::DirectTransport::SendRtcp(packet, length);
}
return true; // Will never happen, makes compiler happy.
}
RtpRtcpObserver* const observer_;
TransportType transport_type_;
};
} // namespace test
} // namespace webrtc
#endif // WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
|
/*
kuroBox / naniBox
Copyright (c) 2013
david morris-oliveros // naniBox.com
This file is part of kuroBox / naniBox.
kuroBox / naniBox 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.
kuroBox / naniBox 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 _naniBox_kuroBox_buttons
#define _naniBox_kuroBox_buttons
#include <ch.h>
#include <hal.h>
//-----------------------------------------------------------------------------
int kuroBoxButtonsInit(void);
//-----------------------------------------------------------------------------
void btn_0_exti_cb(EXTDriver *extp, expchannel_t channel);
void btn_1_exti_cb(EXTDriver *extp, expchannel_t channel);
//-----------------------------------------------------------------------------
bool_t is_btn_0_pressed(void);
bool_t is_btn_1_pressed(void);
#endif /* _naniBox_kuroBox_buttons */
|
#undef ENABLE_NLS
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
#undef HAVE_LC_MESSAGES
#undef HAVE_STPCPY
#undef PACKAGE
#undef VERSION
|
/**
* Copyright (C) 2008 Happy Fish / YuQing
*
* FastDFS may be copied only under the terms of the GNU General
* Public License V3, which may be found in the FastDFS source kit.
* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.
**/
#ifndef _FDFS_HTTP_SHARED_H
#define _FDFS_HTTP_SHARED_H
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "ini_file_reader.h"
#include "hash.h"
typedef struct
{
bool disabled;
bool anti_steal_token;
/* if need find content type by file extension name */
bool need_find_content_type;
/* the web server port */
int server_port;
/* key is file ext name, value is content type */
HashArray content_type_hash;
BufferInfo anti_steal_secret_key;
BufferInfo token_check_fail_buff;
char default_content_type[64];
char token_check_fail_content_type[64];
int token_ttl;
} FDFSHTTPParams;
#ifdef __cplusplus
extern "C" {
#endif
/**
load HTTP params from conf file
params:
pIniContext: the ini file items, return by iniLoadItems
conf_filename: config filename
pHTTPParams: the HTTP params
return: 0 for success, != 0 fail
**/
int fdfs_http_params_load(IniContext *pIniContext, \
const char *conf_filename, FDFSHTTPParams *pHTTPParams);
void fdfs_http_params_destroy(FDFSHTTPParams *pParams);
/**
generate anti-steal token
params:
secret_key: secret key buffer
file_id: FastDFS file id
timestamp: current timestamp, unix timestamp (seconds), 0 for never timeout
token: return token buffer
return: 0 for success, != 0 fail
**/
int fdfs_http_gen_token(const BufferInfo *secret_key, const char *file_id, \
const int timestamp, char *token);
/**
check anti-steal token
params:
secret_key: secret key buffer
file_id: FastDFS file id
timestamp: the timestamp to generate the token, unix timestamp (seconds)
token: token buffer
ttl: token ttl, delta seconds
return: 0 for passed, != 0 fail
**/
int fdfs_http_check_token(const BufferInfo *secret_key, const char *file_id, \
const int timestamp, const char *token, const int ttl);
/**
get parameter value
params:
param_name: the parameter name to get
params: parameter array
param_count: param count
return: param value pointer, return NULL if not exist
**/
char *fdfs_http_get_parameter(const char *param_name, KeyValuePair *params, \
const int param_count);
/**
get file extension name
params:
filename: the filename
filename_len: the length of filename
ext_len: return the length of extension name
return: extension name, NULL for none
**/
const char *fdfs_http_get_file_extension(const char *filename, \
const int filename_len, int *ext_len);
/**
get content type by file extension name
params:
pHTTPParams: the HTTP params
ext_name: the extension name
ext_len: the length of extension name
content_type: return content type
content_type_size: content type buffer size
return: 0 for success, != 0 fail
**/
int fdfs_http_get_content_type_by_extname(FDFSHTTPParams *pParams, \
const char *ext_name, const int ext_len, \
char *content_type, const int content_type_size);
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef VOIPVIDEOLIB_GLOBAL_H
#define VOIPVIDEOLIB_GLOBAL_H
#include <QtCore/qglobal.h>
#ifdef VOIPVIDEOLIB_LIB
# define VOIPVIDEOLIB_EXPORT Q_DECL_EXPORT
#else
# define VOIPVIDEOLIB_EXPORT Q_DECL_IMPORT
#endif
#endif // VOIPVIDEOLIB_GLOBAL_H
|
/*
$Id: KVINDRAIdentRoot.h,v 1.2 2006/10/19 14:32:43 franklan Exp $
$Revision: 1.2 $
$Date: 2006/10/19 14:32:43 $
*/
#ifndef KVINDRAIdentRoot_h
#define KVINDRAIdentRoot_h
#include "KVOldINDRASelector.h"
class TFile;
class TTree;
class KVINDRAIdentRoot: public KVOldINDRASelector {
int codes[15];
int status[4];
int Acodes[15];
int Astatus[4];
protected:
TFile* fIdentFile; //new file
TTree* fIdentTree; //new tree
Int_t fRunNumber;
Int_t fEventNumber;
public:
KVINDRAIdentRoot()
{
fIdentFile = 0;
fIdentTree = 0;
};
virtual ~ KVINDRAIdentRoot()
{
};
virtual void InitRun();
virtual void EndRun();
virtual void InitAnalysis();
virtual Bool_t Analysis();
virtual void EndAnalysis();
void CountStatus();
void CountCodes();
ClassDef(KVINDRAIdentRoot, 0);//Generation of fully-identified and calibrated INDRA data files
};
#endif
|
/* -*- c++ -*-
* Copyright (C) 2007-2016 Hypertable, Inc.
*
* This file is part of Hypertable.
*
* Hypertable 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 any later version.
*
* Hypertable 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.
*/
/// @file
/// Declarations for Rmdir request parameters.
/// This file contains declarations for Rmdir, a class for encoding and
/// decoding paramters to the <i>rmdir</i> file system broker function.
#ifndef FsBroker_Lib_Request_Parameters_Rmdir_h
#define FsBroker_Lib_Request_Parameters_Rmdir_h
#include <Common/Serializable.h>
#include <string>
using namespace std;
namespace Hypertable {
namespace FsBroker {
namespace Lib {
namespace Request {
namespace Parameters {
/// @addtogroup FsBrokerLibRequestParameters
/// @{
/// %Request parameters for <i>rmdir</i> requests.
class Rmdir : public Serializable {
public:
/// Constructor.
/// Empty initialization for decoding.
Rmdir() {}
/// Constructor.
/// Initializes with parameters for encoding. Sets #m_dirname to
/// <code>dirname</code>.
/// @param dirname Directory name
Rmdir(const std::string &dirname) : m_dirname(dirname) {}
/// Gets directory name
/// @return Directory name
const char *get_dirname() { return m_dirname.c_str(); }
private:
uint8_t encoding_version() const override;
size_t encoded_length_internal() const override;
void encode_internal(uint8_t **bufp) const override;
void decode_internal(uint8_t version, const uint8_t **bufp,
size_t *remainp) override;
/// Directory name
std::string m_dirname;
};
/// @}
}}}}}
#endif // FsBroker_Lib_Request_Parameters_Rmdir_h
|
/* The following code is the modified part of the libxml
* available at http://xmlsoft.org
* under the terms of the MIT License
* http://opensource.org/licenses/mit-license.html
*/
/*
* Summary: Provide Canonical XML and Exclusive XML Canonicalization
* Description: the c14n modules provides a
*
* "Canonical XML" implementation
* http://www.w3.org/TR/xml-c14n
*
* and an
*
* "Exclusive XML Canonicalization" implementation
* http://www.w3.org/TR/xml-exc-c14n
* Copy: See Copyright for the status of this software.
*
* Author: Aleksey Sanin <aleksey@aleksey.com>
*/
#ifndef __XML_C14N_H__
#define __XML_C14N_H__
#ifdef LIBXML_C14N_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "xmlversion.h"
#include "tree.h"
#include "xpath.h"
/*
* XML Canonicazation
* http://www.w3.org/TR/xml-c14n
*
* Exclusive XML Canonicazation
* http://www.w3.org/TR/xml-exc-c14n
*
* Canonical form of an XML document could be created if and only if
* a) default attributes (if any) are added to all nodes
* b) all character and parsed entity references are resolved
* In order to achive this in libxml2 the document MUST be loaded with
* following global setings:
*
* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
* xmlSubstituteEntitiesDefault(1);
*
* or corresponding parser context setting:
* xmlParserCtxtPtr ctxt;
*
* ...
* ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
* ctxt->replaceEntities = 1;
* ...
*/
XMLPUBFUN int XMLCALL
xmlC14NDocSaveTo (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int exclusive,
xmlChar **inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf);
XMLPUBFUN int XMLCALL
xmlC14NDocDumpMemory (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int exclusive,
xmlChar **inclusive_ns_prefixes,
int with_comments,
xmlChar **doc_txt_ptr);
XMLPUBFUN int XMLCALL
xmlC14NDocSave (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int exclusive,
xmlChar **inclusive_ns_prefixes,
int with_comments,
const char* filename,
int compression);
/**
* This is the core C14N function
*/
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
xmlNodePtr node,
xmlNodePtr parent);
XMLPUBFUN int XMLCALL
xmlC14NExecute (xmlDocPtr doc,
xmlC14NIsVisibleCallback is_visible_callback,
void* user_data,
int exclusive,
xmlChar **inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_C14N_ENABLED */
#endif /* __XML_C14N_H__ */
|
/*
NUI3 - C++ cross-platform GUI framework for OpenGL based applications
Copyright (C) 2002-2003 Sebastien Metrot
licence: see nui3/LICENCE.TXT
*/
#pragma once
#include "nui.h"
#include "nuiContainer.h"
class nuiSimpleContainer : public nuiContainer
{
public:
nuiSimpleContainer();
virtual ~nuiSimpleContainer();
virtual bool SetObjectClass(const nglString& rName);
virtual void SetObjectName(const nglString& rName);
virtual bool AddChild(nuiWidgetPtr pChild);
virtual bool DelChild(nuiWidgetPtr pChild); ///< Remove this child from the object. If Delete is true then the child will be deleted too. Returns true if success.
virtual int GetChildrenCount() const;
virtual nuiWidgetPtr GetChild(int index);
virtual nuiWidgetPtr GetChild(nuiSize X, nuiSize Y);
virtual nuiWidgetPtr GetChild(const nglString& rName, bool ResolveNameAsPath = true); ///< Find a child by its name property. Try to resolve path names like /window/fixed/toto or ../../tata if deepsearch is true
virtual bool Clear();
virtual nuiContainer::Iterator* GetFirstChild(bool DoRefCounting = false);
virtual nuiContainer::ConstIterator* GetFirstChild(bool DoRefCounting = false) const;
virtual nuiContainer::Iterator* GetLastChild(bool DoRefCounting = false);
virtual nuiContainer::ConstIterator* GetLastChild(bool DoRefCounting = false) const;
virtual bool GetNextChild(nuiContainer::IteratorPtr pIterator);
virtual bool GetNextChild(nuiContainer::ConstIteratorPtr pIterator) const;
virtual bool GetPreviousChild(nuiContainer::IteratorPtr pIterator);
virtual bool GetPreviousChild(nuiContainer::ConstIteratorPtr pIterator) const;
virtual void RaiseChild(nuiWidgetPtr pChild);
virtual void LowerChild(nuiWidgetPtr pChild);
virtual void RaiseChildToFront(nuiWidgetPtr pChild);
virtual void LowerChildToBack(nuiWidgetPtr pChild);
protected:
nuiWidgetList mpChildren;
};
|
/*
* Copyright (C) 2011-2012 DarkCore <http://www.darkpeninsula.eu/>
* Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEF_ARCHAVON_H
#define DEF_ARCHAVON_H
enum Creatures
{
CREATURE_ARCHAVON = 31125,
CREATURE_EMALON = 33993,
CREATURE_KORALON = 35013,
CREATURE_TORAVON = 38433,
};
enum Data
{
DATA_ARCHAVON = 0,
DATA_EMALON = 1,
DATA_KORALON = 2,
DATA_TORAVON = 3,
};
#define MAX_ENCOUNTER 4
enum AchievementCriteriaIds
{
CRITERIA_EARTH_WIND_FIRE_10 = 12018,
CRITERIA_EARTH_WIND_FIRE_25 = 12019,
};
enum AchievementSpells
{
SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK = 68308,
};
#endif
|
/**
* Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
*
* This file is part of iotagent project.
*
* iotagent 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.
*
* iotagent 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 iotagent. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by the GNU Affero General Public License
* please contact with iot_support at tid dot es
*/
#ifndef PUSHCOMMANDSTEST_H
#define PUSHCOMMANDSTEST_H
#include "MockMosquitto.h"
#include "input_mqtt/ESP_Plugin_Input_Mqtt.h"
#include <cppunit/extensions/HelperMacros.h>
class PushCommandsTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(PushCommandsTest);
CPPUNIT_TEST(testSendPushCommand);
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
protected:
void testSendPushCommand();
private:
//Stubs:
int stubPublish(int* mid, const char* topic, int payloadlen,
const void* payload, int qos, bool retain);
int stubSubscribeSilent(int* mid, const char* sub, int qos);
int stubConnectPub(const char* host, int port, int keepalive);
int stubConnectSub(const char* host, int port, int keepalive);
MockMosquitto* mosquittoPub;
MockMosquitto* mosquittoSub;
struct mosquitto_message mqttMsg;
};
#endif // PUSHCOMMANDSTEST_H
|
/*
* Copyright (C) 1994-2016 Altair Engineering, Inc.
* For more information, contact Altair at www.altair.com.
*
* This file is part of the PBS Professional ("PBS Pro") software.
*
* Open Source License Information:
*
* PBS Pro 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.
*
* PBS Pro 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/>.
*
* Commercial License Information:
*
* The PBS Pro software is licensed under the terms of the GNU Affero General
* Public License agreement ("AGPL"), except where a separate commercial license
* agreement for PBS Pro version 14 or later has been executed in writing with Altair.
*
* Altair’s dual-license business model allows companies, individuals, and
* organizations to create proprietary derivative works of PBS Pro and distribute
* them - whether embedded or bundled with other software - under a commercial
* license agreement.
*
* Use of Altair’s trademarks, including but not limited to "PBS™",
* "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
* trademark licensing policies.
*
*/
/**
* @file dec_DelHookFile.c
*/
#include <pbs_config.h> /* the master config generated by configure */
#include <sys/types.h>
#include <stdlib.h>
#include "libpbs.h"
#include "list_link.h"
#include "server_limits.h"
#include "attribute.h"
#include "credential.h"
#include "batch_request.h"
#include "dis.h"
/**
* @brief
* Decode data item(s) needed for a Delete Hook File request.
*
* Data item is: string hook filename
* cnt str data
*
* @param[in] sock - communication channel
* @param[in/out] preq - request structure to fill in
*
* @return int
* @retval 0 for success
* @retval non-zero otherwise
*/
int
decode_DIS_DelHookFile(int sock, struct batch_request *preq)
{
int rc;
if ((rc = disrfst(sock, MAXPATHLEN+1,
preq->rq_ind.rq_hookfile.rq_filename)) != 0)
return rc;
return 0;
}
|
#ifndef QGCPX4SENSORCALIBRATION_H
#define QGCPX4SENSORCALIBRATION_H
#include <QWidget>
#include <UASInterface.h>
#include <QAction>
namespace Ui {
class QGCPX4SensorCalibration;
}
class QGCPX4SensorCalibration : public QWidget
{
Q_OBJECT
public:
explicit QGCPX4SensorCalibration(QWidget *parent = 0);
~QGCPX4SensorCalibration();
public slots:
/**
* @brief Set currently active UAS
* @param uas the current active UAS
*/
void setActiveUAS(UASInterface* uas);
/**
* @brief Handle text message from current active UAS
* @param uasid
* @param componentid
* @param severity
* @param text
*/
void handleTextMessage(int uasid, int componentid, int severity, QString text);
void gyroButtonClicked();
void magButtonClicked();
void accelButtonClicked();
void diffPressureButtonClicked();
/**
* @brief Hand context menu event
* @param event
*/
virtual void contextMenuEvent(QContextMenuEvent* event);
void setAutopilotOrientation(int index);
void setGpsOrientation(int index);
void parameterChanged(int uas, int component, QString parameterName, QVariant value);
protected slots:
void setInstructionImage(const QString &path);
void setAutopilotImage(const QString &path);
void setGpsImage(const int index);
void setAutopilotImage(const int index);
void setGpsImage(const QString &path);
protected:
UASInterface* activeUAS;
QAction* clearAction;
QPixmap instructionIcon;
QPixmap autopilotIcon;
QPixmap gpsIcon;
virtual void resizeEvent(QResizeEvent* event);
void setMagCalibrated(bool calibrated);
void setGyroCalibrated(bool calibrated);
void setAccelCalibrated(bool calibrated);
void setDiffPressureCalibrated(bool calibrated);
void updateIcons();
private:
Ui::QGCPX4SensorCalibration *ui;
};
#endif // QGCPX4SENSORCALIBRATION_H
|
/*
pygame - Python Game Library
Copyright (C) 2000-2001 Pete Shinners
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Pete Shinners
pete@shinners.org
*/
#include <Python.h>
#if defined(HAVE_SNPRINTF) /* also defined in SDL_ttf (SDL.h) */
#undef HAVE_SNPRINTF /* remove GCC macro redefine warning */
#endif
#include <SDL_ttf.h>
/* test font initialization */
#define FONT_INIT_CHECK() \
if(!(*(int*)PyFONT_C_API[2])) \
return RAISE(pgExc_SDLError, "font system not initialized")
#define PYGAMEAPI_FONT_FIRSTSLOT 0
#define PYGAMEAPI_FONT_NUMSLOTS 3
typedef struct {
PyObject_HEAD
TTF_Font* font;
PyObject* weakreflist;
} PyFontObject;
#define PyFont_AsFont(x) (((PyFontObject*)x)->font)
#ifndef PYGAMEAPI_FONT_INTERNAL
#define PyFont_Check(x) ((x)->ob_type == (PyTypeObject*)PyFONT_C_API[0])
#define PyFont_Type (*(PyTypeObject*)PyFONT_C_API[0])
#define PyFont_New (*(PyObject*(*)(TTF_Font*))PyFONT_C_API[1])
/*slot 2 taken by FONT_INIT_CHECK*/
#define import_pygame_font() \
_IMPORT_PYGAME_MODULE(font, FONT, PyFONT_C_API)
static void* PyFONT_C_API[PYGAMEAPI_FONT_NUMSLOTS] = {NULL};
#endif
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "H5LT.h"
#define RANK 2
int main( void )
{
hid_t file_id;
hsize_t dims[RANK]={2,3};
int data[6]={1,2,3,4,5,6};
herr_t status;
/* create a HDF5 file */
file_id = H5Fcreate ("ex_lite1.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* create and write an integer type dataset named "dset" */
status = H5LTmake_dataset(file_id,"/dset",RANK,dims,H5T_NATIVE_INT,data);
/* close file */
status = H5Fclose (file_id);
return 0;
}
|
/*
Copyright (C) 2009 William Hart
Copyright (C) 2010, 2011 Sebastian Pancratz
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
#include "flint.h"
#include "fmpz.h"
#include "fmpz_poly.h"
#include "ulong_extras.h"
int
main(void)
{
int i, result;
FLINT_TEST_INIT(state);
flint_printf("sqr_karatsuba....");
fflush(stdout);
/* Check aliasing of a and b */
for (i = 0; i < 200 * flint_test_multiplier(); i++)
{
fmpz_poly_t a, b, c;
fmpz_poly_init(a);
fmpz_poly_init(b);
fmpz_poly_init(c);
fmpz_poly_randtest(a, state, n_randint(state, 50), 200);
fmpz_poly_set(b, a);
fmpz_poly_sqr_karatsuba(c, b);
fmpz_poly_sqr_karatsuba(b, b);
result = (fmpz_poly_equal(b, c));
if (!result)
{
flint_printf("FAIL:\n");
fmpz_poly_print(a), flint_printf("\n\n");
fmpz_poly_print(b), flint_printf("\n\n");
fmpz_poly_print(c), flint_printf("\n\n");
abort();
}
fmpz_poly_clear(a);
fmpz_poly_clear(b);
fmpz_poly_clear(c);
}
/* Compare with mul_karatsuba */
for (i = 0; i < 200 * flint_test_multiplier(); i++)
{
fmpz_poly_t a, b, c;
fmpz_poly_init(a);
fmpz_poly_init(b);
fmpz_poly_init(c);
fmpz_poly_randtest(a, state, n_randint(state, 50), 200);
fmpz_poly_sqr_karatsuba(b, a);
fmpz_poly_mul_karatsuba(c, a, a);
result = (fmpz_poly_equal(b, c));
if (!result)
{
flint_printf("FAIL:\n");
fmpz_poly_print(a), flint_printf("\n\n");
fmpz_poly_print(b), flint_printf("\n\n");
fmpz_poly_print(c), flint_printf("\n\n");
abort();
}
fmpz_poly_clear(a);
fmpz_poly_clear(b);
fmpz_poly_clear(c);
}
/* Check _fmpz_poly_sqr_karatsuba directly */
for (i = 0; i < 200 * flint_test_multiplier(); i++)
{
slong len;
fmpz_poly_t a, out1, out2;
len = n_randint(state, 100) + 1;
fmpz_poly_init(a);
fmpz_poly_init(out1);
fmpz_poly_init(out2);
fmpz_poly_randtest(a, state, len, 200);
fmpz_poly_sqr_karatsuba(out1, a);
fmpz_poly_fit_length(a, a->alloc + n_randint(state, 10));
a->length = a->alloc;
fmpz_poly_fit_length(out2, 2 * a->length - 1);
_fmpz_poly_sqr_karatsuba(out2->coeffs, a->coeffs, a->length);
_fmpz_poly_set_length(out2, 2 * a->length - 1);
_fmpz_poly_normalise(out2);
result = (fmpz_poly_equal(out1, out2));
if (!result)
{
flint_printf("FAIL:\n");
fmpz_poly_print(out1), flint_printf("\n\n");
fmpz_poly_print(out2), flint_printf("\n\n");
abort();
}
fmpz_poly_clear(a);
fmpz_poly_clear(out1);
fmpz_poly_clear(out2);
}
FLINT_TEST_CLEANUP(state);
flint_printf("PASS\n");
return 0;
}
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef RESTARTABLEDATAIO_H
#define RESTARTABLEDATAIO_H
// MOOSE includes
#include "DataIO.h"
// C++ includes
#include <sstream>
#include <string>
#include <list>
// Forward declarations
class RestartableDatas;
class RestartableDataValue;
class FEProblem;
/**
* Helper class to hold streams for Backup and Restore operations.
*/
class Backup
{
public:
Backup()
{
unsigned int n_threads = libMesh::n_threads();
_restartable_data.resize(n_threads);
for (unsigned int i=0; i < n_threads; i++)
_restartable_data[i] = new std::stringstream;
}
~Backup()
{
unsigned int n_threads = libMesh::n_threads();
for (unsigned int i=0; i < n_threads; i++)
delete _restartable_data[i];
}
std::stringstream _system_data;
std::vector<std::stringstream*> _restartable_data;
};
template<>
inline void
dataStore(std::ostream & stream, Backup * & backup, void * context)
{
dataStore(stream, backup->_system_data, context);
for (unsigned int i=0; i<backup->_restartable_data.size(); i++)
dataStore(stream, backup->_restartable_data[i], context);
}
template<>
inline void
dataLoad(std::istream & stream, Backup * & backup, void * context)
{
dataLoad(stream, backup->_system_data, context);
for (unsigned int i=0; i<backup->_restartable_data.size(); i++)
dataLoad(stream, backup->_restartable_data[i], context);
}
/**
* Class for doing restart.
*
* It takes care of writing and reading the restart files.
*/
class RestartableDataIO
{
public:
RestartableDataIO(FEProblem & fe_problem);
virtual ~RestartableDataIO();
/**
* Write out the restartable data.
*/
void writeRestartableData(std::string base_file_name, const RestartableDatas & restartable_datas, std::set<std::string> & _recoverable_data);
/**
* Read restartable data header to verify that we are restarting on the correct number of processors and threads.
*/
void readRestartableDataHeader(std::string base_file_name);
/**
* Read the restartable data.
*/
void readRestartableData(const RestartableDatas & restartable_datas, const std::set<std::string> & _recoverable_data);
/**
* Create a Backup for the current system.
*/
MooseSharedPointer<Backup> createBackup();
/**
* Restore a Backup for the current system.
*/
void restoreBackup(MooseSharedPointer<Backup> backup, bool for_restart = false);
private:
/**
* Serializes the data into the stream object.
*/
void serializeRestartableData(const std::map<std::string, RestartableDataValue *> & restartable_data, std::ostream & stream);
/**
* Deserializes the data from the stream object.
*/
void deserializeRestartableData(const std::map<std::string, RestartableDataValue *> & restartable_data, std::istream & stream, const std::set<std::string> & recoverable_data);
/**
* Serializes the data for the Systems in FEProblem
*/
void serializeSystems(std::ostream & stream);
/**
* Deserializes the data for the Systems in FEProblem
*/
void deserializeSystems(std::istream & stream);
/// Reference to a FEProblem being restarted
FEProblem & _fe_problem;
/// A vector of file handles, one per thread
std::vector<std::ifstream *> _in_file_handles;
};
#endif /* RESTARTABLEDATAIO_H */
|
/*
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef QGraphicsWebView_h
#define QGraphicsWebView_h
#include "qwebkitglobal.h"
#include "qwebpage.h"
#include <QtCore/qurl.h>
#include <QtGui/qevent.h>
#include <QtGui/qgraphicswidget.h>
#include <QtGui/qicon.h>
#include <QtGui/qpainter.h>
#include <QtNetwork/qnetworkaccessmanager.h>
class QWebPage;
class QWebHistory;
class QWebSettings;
class QGraphicsWebViewPrivate;
class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget {
Q_OBJECT
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
Q_PROPERTY(bool modified READ isModified)
public:
explicit QGraphicsWebView(QGraphicsItem* parent = 0);
~QGraphicsWebView();
QWebPage* page() const;
void setPage(QWebPage*);
QUrl url() const;
void setUrl(const QUrl&);
QString title() const;
QIcon icon() const;
qreal zoomFactor() const;
void setZoomFactor(qreal);
bool isModified() const;
void load(const QUrl &url);
void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray());
void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
// FIXME: Consider rename to setHtml?
void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl());
QWebHistory* history() const;
QWebSettings* settings() const;
QAction* pageAction(QWebPage::WebAction action) const;
void triggerPageAction(QWebPage::WebAction action, bool checked = false);
bool findText(const QString& subString, QWebPage::FindFlags options = 0);
virtual void setGeometry(const QRectF& rect);
virtual void updateGeometry();
virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
virtual bool event(QEvent*);
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF& constraint) const;
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
public Q_SLOTS:
void stop();
void back();
void forward();
void reload();
Q_SIGNALS:
void loadStarted();
void loadFinished(bool);
void loadProgress(int progress);
void urlChanged(const QUrl&);
void titleChanged(const QString&);
void iconChanged();
void statusBarMessage(const QString& message);
void linkClicked(const QUrl&);
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QGraphicsSceneWheelEvent*);
#endif
virtual void keyPressEvent(QKeyEvent*);
virtual void keyReleaseEvent(QKeyEvent*);
#ifndef QT_NO_CONTEXTMENU
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent*);
#endif
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*);
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*);
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*);
virtual void dropEvent(QGraphicsSceneDragDropEvent*);
virtual void focusInEvent(QFocusEvent*);
virtual void focusOutEvent(QFocusEvent*);
virtual void inputMethodEvent(QInputMethodEvent*);
virtual bool focusNextPrevChild(bool next);
virtual bool sceneEvent(QEvent*);
private:
Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
QGraphicsWebViewPrivate* const d;
friend class QGraphicsWebViewPrivate;
};
#endif // QGraphicsWebView_h
|
/*
Copyright (C) 2010 William Hart
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include <gmp.h>
#include "flint.h"
#include "fmpz.h"
#include "fmpz_vec.h"
void
_fmpz_vec_add(fmpz * res, const fmpz * vec1, const fmpz * vec2, slong len2)
{
slong i;
for (i = 0; i < len2; i++)
fmpz_add(res + i, vec1 + i, vec2 + i);
}
|
/*
* filter_vignette.c -- vignette filter
* Copyright (c) 2007 Marco Gittler <g.marco@freenet.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <framework/mlt_filter.h>
#include <framework/mlt_frame.h>
#include <framework/mlt_geometry.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MIN(a,b) (a<b?a:b)
#define MAX(a,b) (a<b?b:a)
#define SIGMOD_STEPS 1000
#define POSITION_VALUE(p,s,e) (s+((double)(e-s)*p ))
//static double pow2[SIGMOD_STEPS];
static float geometry_to_float(char *val, mlt_position pos )
{
float ret=0.0;
struct mlt_geometry_item_s item;
mlt_geometry geom=mlt_geometry_init();
mlt_geometry_parse(geom,val,-1,-1,-1);
mlt_geometry_fetch(geom,&item , pos );
ret=item.x;
mlt_geometry_close(geom);
return ret;
}
static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
mlt_filter filter = mlt_frame_pop_service( this );
*format = mlt_image_yuv422;
int error = mlt_frame_get_image( this, image, format, width, height, 1 );
if ( error == 0 && *image )
{
float smooth, radius, cx, cy, opac;
mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter ) ;
mlt_position pos = mlt_filter_get_position( filter, this );
smooth = geometry_to_float ( mlt_properties_get( filter_props , "smooth" ) , pos ) * 100.0 ;
radius = geometry_to_float ( mlt_properties_get( filter_props , "radius" ) , pos ) * *width;
cx = geometry_to_float ( mlt_properties_get( filter_props , "x" ) , pos ) * *width;
cy = geometry_to_float ( mlt_properties_get( filter_props , "y" ) , pos ) * *height;
opac = geometry_to_float ( mlt_properties_get( filter_props , "opacity" ) , pos );
int video_width = *width;
int video_height = *height;
int x,y;
int w2=cx,h2=cy;
double delta=1.0;
double max_opac=opac;
for (y=0;y<video_height;y++){
int h2_pow2=pow(y-h2,2.0);
for (x=0;x<video_width;x++){
uint8_t *pix=(*image+y*video_width*2+x*2);
int dx=sqrt(h2_pow2+pow(x-w2,2.0));
if (radius-smooth>dx){ //center, make not darker
continue;
}
else if (radius+smooth<=dx){//max dark after smooth area
delta=0.0;
}else{
//double sigx=5.0-10.0*(double)(dx-radius+smooth)/(2.0*smooth);//smooth >10 inner area, <-10 in dark area
//delta=pow2[((int)((sigx+10.0)*SIGMOD_STEPS/20.0))];//sigmoidal
delta = ((double)(radius+smooth-dx)/(2.0*smooth));//linear
}
delta=MAX(max_opac,delta);
*pix=(double)(*pix)*delta;
*(pix+1)=((double)(*(pix+1)-127.0)*delta)+127.0;
}
}
// short a, short b, short c, short d
// a= gray val pix 1
// b: +=blue, -=yellow
// c: =gray pix 2
// d: +=red,-=green
}
return error;
}
static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
{
mlt_frame_push_service( frame, this );
mlt_frame_push_get_image( frame, filter_get_image );
return frame;
}
mlt_filter filter_vignette_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
mlt_filter this = mlt_filter_new( );
//int i=0;
if ( this != NULL )
{
/*
for (i=-SIGMOD_STEPS/2;i<SIGMOD_STEPS/2;i++){
pow2[i+SIGMOD_STEPS/2]=1.0/(1.0+pow(2.0,-((double)i)/((double)SIGMOD_STEPS/20.0)));
}
*/
this->process = filter_process;
mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "smooth", "0.8" );
mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "radius", "0.5" );
mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "x", "0.5" );
mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "y", "0.5" );
mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "opacity", "0.0" );
//mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "end", "" );
}
return this;
}
|
/*
* HwDep Symbols
* Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef PIC
extern const char *_snd_module_hwdep_hw;
static const char **snd_hwdep_open_objects[] = {
&_snd_module_hwdep_hw
};
void *snd_hwdep_open_symbols(void)
{
return snd_hwdep_open_objects;
}
#endif
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2014-2015 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <config.h>
#include <fnmatch.h>
#include <asb-plugin.h>
/**
* asb_plugin_get_name:
*/
const gchar *
asb_plugin_get_name (void)
{
return "gstreamer";
}
/**
* asb_plugin_add_globs:
*/
void
asb_plugin_add_globs (AsbPlugin *plugin, GPtrArray *globs)
{
asb_plugin_add_glob (globs, "/usr/lib64/gstreamer-1.0/libgst*.so");
}
typedef struct {
const gchar *path;
const gchar *text;
} AsbGstreamerDescData;
static const AsbGstreamerDescData data[] = {
{ "/usr/lib64/gstreamer-1.0/libgsta52dec.so", "AC-3" },
{ "/usr/lib64/gstreamer-1.0/libgstaiff.so", "AIFF" },
{ "/usr/lib64/gstreamer-1.0/libgstamrnb.so", "AMR-NB" },
{ "/usr/lib64/gstreamer-1.0/libgstamrwbdec.so", "AMR-WB" },
{ "/usr/lib64/gstreamer-1.0/libgstapetag.so", "APE" },
{ "/usr/lib64/gstreamer-1.0/libgstasf.so", "ASF" },
{ "/usr/lib64/gstreamer-1.0/libgstavi.so", "AVI" },
{ "/usr/lib64/gstreamer-1.0/libgstavidemux.so", "AVI" },
{ "/usr/lib64/gstreamer-1.0/libgstdecklink.so", "SDI" },
{ "/usr/lib64/gstreamer-1.0/libgstdtsdec.so", "DTS" },
{ "/usr/lib64/gstreamer-1.0/libgstdv.so", "DV" },
{ "/usr/lib64/gstreamer-1.0/libgstdvb.so", "DVB" },
{ "/usr/lib64/gstreamer-1.0/libgstdvdread.so", "DVD" },
{ "/usr/lib64/gstreamer-1.0/libgstdvdspu.so", "Bluray" },
{ "/usr/lib64/gstreamer-1.0/libgstespeak.so", "eSpeak" },
{ "/usr/lib64/gstreamer-1.0/libgstfaad.so", "MPEG-4|MPEG-2 AAC" },
{ "/usr/lib64/gstreamer-1.0/libgstflac.so", "FLAC" },
{ "/usr/lib64/gstreamer-1.0/libgstflv.so", "Flash" },
{ "/usr/lib64/gstreamer-1.0/libgstflxdec.so", "FLX" },
{ "/usr/lib64/gstreamer-1.0/libgstgsm.so", "GSM" },
{ "/usr/lib64/gstreamer-1.0/libgstid3tag.so", "ID3" },
{ "/usr/lib64/gstreamer-1.0/libgstisomp4.so", "MP4" },
{ "/usr/lib64/gstreamer-1.0/libgstmad.so", "MP3" },
{ "/usr/lib64/gstreamer-1.0/libgstmatroska.so", "MKV" },
{ "/usr/lib64/gstreamer-1.0/libgstmfc.so", "MFC" },
{ "/usr/lib64/gstreamer-1.0/libgstmidi.so", "MIDI" },
{ "/usr/lib64/gstreamer-1.0/libgstmimic.so", "Mimic" },
{ "/usr/lib64/gstreamer-1.0/libgstmms.so", "MMS" },
{ "/usr/lib64/gstreamer-1.0/libgstmpeg2dec.so", "MPEG-2" },
{ "/usr/lib64/gstreamer-1.0/libgstmpg123.so", "MP3" },
{ "/usr/lib64/gstreamer-1.0/libgstmxf.so", "MXF" },
{ "/usr/lib64/gstreamer-1.0/libgstogg.so", "Ogg" },
{ "/usr/lib64/gstreamer-1.0/libgstopus.so", "Opus" },
{ "/usr/lib64/gstreamer-1.0/libgstrmdemux.so", "RealMedia" },
{ "/usr/lib64/gstreamer-1.0/libgstschro.so", "Dirac" },
{ "/usr/lib64/gstreamer-1.0/libgstsiren.so", "Siren" },
{ "/usr/lib64/gstreamer-1.0/libgstspeex.so", "Speex" },
{ "/usr/lib64/gstreamer-1.0/libgsttheora.so", "Theora" },
{ "/usr/lib64/gstreamer-1.0/libgsttwolame.so", "MP2" },
{ "/usr/lib64/gstreamer-1.0/libgstvorbis.so", "Vorbis" },
{ "/usr/lib64/gstreamer-1.0/libgstvpx.so", "VP8|VP9" },
{ "/usr/lib64/gstreamer-1.0/libgstwavenc.so", "WAV" },
{ "/usr/lib64/gstreamer-1.0/libgstx264.so", "H.264/MPEG-4 AVC" },
{ NULL, NULL }
};
/**
* asb_utils_is_file_in_tmpdir:
*/
static gboolean
asb_utils_is_file_in_tmpdir (const gchar *tmpdir, const gchar *filename)
{
g_autofree gchar *tmp = NULL;
tmp = g_build_filename (tmpdir, filename, NULL);
return g_file_test (tmp, G_FILE_TEST_EXISTS);
}
/**
* asb_plugin_process_app:
*/
gboolean
asb_plugin_process_app (AsbPlugin *plugin,
AsbPackage *pkg,
AsbApp *app,
const gchar *tmpdir,
GError **error)
{
guint i;
guint j;
for (i = 0; data[i].path != NULL; i++) {
g_auto(GStrv) split = NULL;
if (!asb_utils_is_file_in_tmpdir (tmpdir, data[i].path))
continue;
split = g_strsplit (data[i].text, "|", -1);
for (j = 0; split[j] != NULL; j++)
as_app_add_keyword (AS_APP (app), NULL, split[j]);
}
return TRUE;
}
|
/*
* RELIC is an Efficient LIbrary for Cryptography
* Copyright (C) 2007-2014 RELIC Authors
*
* This file is part of RELIC. RELIC is legal property of its developers,
* whose names are not listed here. Please refer to the COPYRIGHT file
* for contact information.
*
* RELIC 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.
*
* RELIC 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 RELIC. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file
*
* Implementation of squaring in a quadratic extension of a prime field.
*
* @version $Id$
* @ingroup fpx
*/
#include "relic_core.h"
#include "relic_fpx_low.h"
/*============================================================================*/
/* Public definitions */
/*============================================================================*/
#if FPX_QDR == BASIC || !defined(STRIP)
void fp2_sqr_basic(fp2_t c, fp2_t a) {
fp_t t0, t1, t2;
fp_null(t0);
fp_null(t1);
fp_null(t2);
TRY {
fp_new(t0);
fp_new(t1);
fp_new(t2);
/* t0 = (a_0 + a_1). */
fp_add(t0, a[0], a[1]);
/* t1 = (a_0 - a_1). */
fp_sub(t1, a[0], a[1]);
/* t1 = a_0 + u^2 * a_1. */
for (int i = -1; i > fp_prime_get_qnr(); i--) {
fp_sub(t1, t1, a[1]);
}
for (int i = 0; i <= fp_prime_get_qnr(); i++) {
fp_add(t1, t1, a[1]);
}
if (fp_prime_get_qnr() == -1) {
/* t2 = 2 * a_0. */
fp_dbl(t2, a[0]);
/* c_1 = 2 * a_0 * a_1. */
fp_mul(c[1], t2, a[1]);
/* c_0 = a_0^2 + a_1^2 * u^2. */
fp_mul(c[0], t0, t1);
} else {
/* c_1 = a_0 * a_1. */
fp_mul(c[1], a[0], a[1]);
/* c_0 = a_0^2 + a_1^2 * u^2. */
fp_mul(c[0], t0, t1);
for (int i = -1; i > fp_prime_get_qnr(); i--) {
fp_add(c[0], c[0], c[1]);
}
for (int i = 0; i <= fp_prime_get_qnr(); i++) {
fp_sub(c[0], c[0], c[1]);
}
/* c_1 = 2 * a_0 * a_1. */
fp_dbl(c[1], c[1]);
}
/* c = c_0 + c_1 * u. */
}
CATCH_ANY {
THROW(ERR_CAUGHT);
}
FINALLY {
fp_free(t0);
fp_free(t1);
fp_free(t2);
}
}
#endif
#if FPX_QDR == INTEG || !defined(STRIP)
void fp2_sqr_integ(fp2_t c, fp2_t a) {
fp2_sqrm_low(c, a);
}
#endif
|
/* include/linux/android_alarm.h
*
* Copyright (C) 2006-2007 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _LINUX_ANDROID_ALARM_H
#define _LINUX_ANDROID_ALARM_H
enum android_alarm_type {
/* return code bit numbers or set alarm arg */
ANDROID_ALARM_RTC_WAKEUP,
ANDROID_ALARM_RTC,
ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
ANDROID_ALARM_ELAPSED_REALTIME,
ANDROID_ALARM_SYSTEMTIME,
ANDROID_ALARM_TYPE_COUNT,
/* return code bit numbers */
/* ANDROID_ALARM_TIME_CHANGE = 16 */
};
enum android_alarm_return_flags {
ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP,
ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC,
ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK =
1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
ANDROID_ALARM_ELAPSED_REALTIME_MASK =
1U << ANDROID_ALARM_ELAPSED_REALTIME,
ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME,
ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16
};
/* Disable alarm */
#define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4))
/* Ack last alarm and wait for next */
#define ANDROID_ALARM_WAIT _IO('a', 1)
#define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size)
/* Set alarm */
#define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec)
#define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec)
#define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec)
#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec)
#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
#endif
|
/*
* tsd2.c
*
* Test Thread Specific Data (TSD) key creation and destruction.
*
*
* --------------------------------------------------------------------------
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2012 Pthreads-win32 contributors
*
* Homepage1: http://sourceware.org/pthreads-win32/
* Homepage2: http://sourceforge.net/projects/pthreads4w/
*
* The current list of contributors is contained
* in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the
* following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
*
* --------------------------------------------------------------------------
*
* Description:
* -
*
* Test Method (validation or falsification):
* - validation
*
* Requirements Tested:
* - keys are created for each existing thread including the main thread
* - keys are created for newly created threads
* - keys are thread specific
* - destroy routine is called on each thread exit including the main thread
*
* Features Tested:
* -
*
* Cases Tested:
* -
*
* Environment:
* -
*
* Input:
* - none
*
* Output:
* - text to stdout
*
* Assumptions:
* - already validated: pthread_create()
* pthread_once()
* - main thread also has a POSIX thread identity
*
* Pass Criteria:
*
* Fail Criteria:
*/
#include <sched.h>
#include "test.h"
enum {
NUM_THREADS = 100
};
static pthread_key_t key = NULL;
static int accesscount[NUM_THREADS];
static int thread_set[NUM_THREADS];
static int thread_destroyed[NUM_THREADS];
static pthread_barrier_t startBarrier;
static void
destroy_key(void * arg)
{
int * j = (int *) arg;
(*j)++;
/*
* Set TSD key from the destructor to test destructor iteration.
* The key value will have been set to NULL by the library before
* calling the destructor (with the value that the key had). We
* reset the key value here which should cause the destructor to be
* called a second time.
*/
if (*j == 2)
assert(pthread_setspecific(key, arg) == 0);
else
assert(*j == 3);
thread_destroyed[j - accesscount] = 1;
}
static void
setkey(void * arg)
{
int * j = (int *) arg;
thread_set[j - accesscount] = 1;
assert(*j == 0);
assert(pthread_getspecific(key) == NULL);
assert(pthread_setspecific(key, arg) == 0);
assert(pthread_setspecific(key, arg) == 0);
assert(pthread_setspecific(key, arg) == 0);
assert(pthread_getspecific(key) == arg);
(*j)++;
assert(*j == 1);
}
static void *
mythread(void * arg)
{
(void) pthread_barrier_wait(&startBarrier);
setkey(arg);
return 0;
/* Exiting the thread will call the key destructor. */
}
int
main()
{
int i;
int fail = 0;
pthread_t thread[NUM_THREADS];
assert(pthread_barrier_init(&startBarrier, NULL, NUM_THREADS/2) == 0);
for (i = 1; i < NUM_THREADS/2; i++)
{
accesscount[i] = thread_set[i] = thread_destroyed[i] = 0;
assert(pthread_create(&thread[i], NULL, mythread, (void *)&accesscount[i]) == 0);
}
/*
* Here we test that existing threads will get a key created
* for them.
*/
assert(pthread_key_create(&key, destroy_key) == 0);
(void) pthread_barrier_wait(&startBarrier);
/*
* Test main thread key.
*/
accesscount[0] = 0;
setkey((void *) &accesscount[0]);
/*
* Here we test that new threads will get a key created
* for them.
*/
for (i = NUM_THREADS/2; i < NUM_THREADS; i++)
{
accesscount[i] = thread_set[i] = thread_destroyed[i] = 0;
assert(pthread_create(&thread[i], NULL, mythread, (void *)&accesscount[i]) == 0);
}
/*
* Wait for all threads to complete.
*/
for (i = 1; i < NUM_THREADS; i++)
{
assert(pthread_join(thread[i], NULL) == 0);
}
assert(pthread_key_delete(key) == 0);
assert(pthread_barrier_destroy(&startBarrier) == 0);
for (i = 1; i < NUM_THREADS; i++)
{
/*
* The counter is incremented once when the key is set to
* a value, and again when the key is destroyed. If the key
* doesn't get set for some reason then it will still be
* NULL and the destroy function will not be called, and
* hence accesscount will not equal 2.
*/
if (accesscount[i] != 3)
{
fail++;
fprintf(stderr, "Thread %d key, set = %d, destroyed = %d\n",
i, thread_set[i], thread_destroyed[i]);
}
}
fflush(stderr);
return (fail);
}
|
#ifndef KINECTPLUGIN_H
#define KINECTPLUGIN_H
#include <QObject>
#include <fugio/core/uuid.h>
#include <fugio/global_interface.h>
#include <fugio/plugin_interface.h>
class KinectPlugin : public QObject, public fugio::PluginInterface
{
Q_OBJECT
Q_INTERFACES( fugio::PluginInterface )
Q_PLUGIN_METADATA( IID "com.bigfug.fugio.kinect.plugin" )
public:
explicit KinectPlugin( void );
virtual ~KinectPlugin( void );
//-------------------------------------------------------------------------
// fugio::PluginInterface
virtual InitResult initialise( fugio::GlobalInterface *pApp, bool pLastChance );
virtual void deinitialise( void );
//-------------------------------------------------------------------------
private:
fugio::GlobalInterface *mApp;
fugio::ClassEntryList mNodeEntries;
fugio::ClassEntryList mPinEntries;
};
#endif // KINECTPLUGIN_H
|
// Copyright (c) 2012-2015, The CryptoNote developers, The Bytecoin developers
//
// This file is part of Bytecoin.
//
// Bytecoin 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.
//
// Bytecoin 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 Bytecoin. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <mutex>
#include <condition_variable>
template <typename T>
class ObservableValueBase {
public:
ObservableValueBase(std::mutex& mtx, std::condition_variable& cv, const T defaultValue = T()) :
m_mutex(mtx), m_cv(cv), m_value(defaultValue), m_updated(false) {
}
void set(T value) {
std::lock_guard<std::mutex> lk(m_mutex);
m_value = value;
m_updated = true;
m_cv.notify_all();
}
void increment() {
std::lock_guard<std::mutex> lk(m_mutex);
++m_value;
m_updated = true;
m_cv.notify_all();
}
T get() {
std::lock_guard<std::mutex> lk(m_mutex);
return m_value;
}
bool waitFor(std::chrono::milliseconds ms, T& value) {
std::unique_lock<std::mutex> lk(m_mutex);
if (m_cv.wait_for(lk, ms, [this] { return m_updated; })) {
value = m_value;
m_updated = false;
return true;
}
return false;
}
T wait() {
std::unique_lock<std::mutex> lk(m_mutex);
m_cv.wait(lk, [this] { return m_updated; });
m_updated = false;
return m_value;
}
private:
std::mutex& m_mutex;
std::condition_variable& m_cv;
T m_value;
bool m_updated;
};
|
/* The LibVMI Library is an introspection library that simplifies access to
* memory in a target virtual machine or in a file containing a dump of
* a system's physical memory. LibVMI is based on the XenAccess Library.
*
* Copyright 2011 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
* retains certain rights in this software.
*
* Author: Bryan D. Payne (bdpayne@acm.org)
* Author: Tamas K Lengyel (tamas.lengyel@zentific.com)
*
* This file is part of LibVMI.
*
* LibVMI is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* LibVMI is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with LibVMI. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KVM_H
#define KVM_H
status_t kvm_init(
vmi_instance_t vmi,
uint32_t init_flags,
void *init_data);
status_t kvm_init_vmi(
vmi_instance_t vmi,
uint32_t init_flags,
void *init_data);
void kvm_destroy(
vmi_instance_t vmi);
uint64_t kvm_get_id_from_name(
vmi_instance_t vmi,
const char *name);
status_t kvm_get_name_from_id(
vmi_instance_t vmi,
uint64_t domainid,
char **name);
uint64_t kvm_get_id(
vmi_instance_t vmi);
void kvm_set_id(
vmi_instance_t vmi,
uint64_t domainid);
status_t kvm_check_id(
vmi_instance_t vmi,
uint64_t domainid);
status_t kvm_get_name(
vmi_instance_t vmi,
char **name);
void kvm_set_name(
vmi_instance_t vmi,
const char *name);
status_t kvm_get_memsize(
vmi_instance_t vmi,
uint64_t *allocate_ram_size,
addr_t *maximum_physical_address);
status_t kvm_get_vcpureg(
vmi_instance_t vmi,
uint64_t *value,
reg_t reg,
unsigned long vcpu);
addr_t kvm_pfn_to_mfn(
vmi_instance_t vmi,
addr_t pfn);
void *kvm_read_page(
vmi_instance_t vmi,
addr_t page);
status_t kvm_write(
vmi_instance_t vmi,
addr_t paddr,
void *buf,
uint32_t length);
int kvm_is_pv(
vmi_instance_t vmi);
status_t kvm_test(
uint64_t domainid,
const char *name,
uint64_t init_flags,
void* init_data);
status_t kvm_pause_vm(
vmi_instance_t vmi);
status_t kvm_resume_vm(
vmi_instance_t vmi);
status_t kvm_create_shm_snapshot(
vmi_instance_t vmi);
status_t kvm_destroy_shm_snapshot(
vmi_instance_t vmi);
size_t kvm_get_dgpma(
vmi_instance_t vmi,
addr_t paddr,
void** medial_addr_ptr,
size_t count);
size_t kvm_get_dgvma(
vmi_instance_t vmi,
addr_t vaddr,
pid_t pid,
void** medial_addr_ptr,
size_t count);
static inline status_t
driver_kvm_setup(vmi_instance_t vmi)
{
driver_interface_t driver = { 0 };
driver.initialized = true;
driver.init_ptr = &kvm_init;
driver.init_vmi_ptr = &kvm_init_vmi;
driver.destroy_ptr = &kvm_destroy;
driver.get_id_from_name_ptr = &kvm_get_id_from_name;
driver.get_name_from_id_ptr = &kvm_get_name_from_id;
driver.get_id_ptr = &kvm_get_id;
driver.set_id_ptr = &kvm_set_id;
driver.check_id_ptr = &kvm_check_id;
driver.get_name_ptr = &kvm_get_name;
driver.set_name_ptr = &kvm_set_name;
driver.get_memsize_ptr = &kvm_get_memsize;
driver.get_vcpureg_ptr = &kvm_get_vcpureg;
driver.read_page_ptr = &kvm_read_page;
driver.write_ptr = &kvm_write;
driver.is_pv_ptr = &kvm_is_pv;
driver.pause_vm_ptr = &kvm_pause_vm;
driver.resume_vm_ptr = &kvm_resume_vm;
#ifdef ENABLE_SHM_SNAPSHOT
driver.create_shm_snapshot_ptr = &kvm_create_shm_snapshot;
driver.destroy_shm_snapshot_ptr = &kvm_destroy_shm_snapshot;
driver.get_dgpma_ptr = &kvm_get_dgpma;
driver.get_dgvma_ptr = &kvm_get_dgvma;
#endif
vmi->driver = driver;
return VMI_SUCCESS;
}
#endif /* KVM_H */
|
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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 "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpcontext.h"
#include "core/gimpdata.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
#include "data-commands.h"
#include "dynamics-actions.h"
#include "gimp-intl.h"
static const GimpActionEntry dynamics_actions[] =
{
{ "dynamics-popup", GIMP_STOCK_DYNAMICS,
NC_("dynamics-action", "Paint Dynamics Menu"), NULL, NULL, NULL,
GIMP_HELP_DYNAMICS_DIALOG },
{ "dynamics-new", "document-new",
NC_("dynamics-action", "_New Dynamics"), NULL,
NC_("dynamics-action", "Create a new dynamics"),
G_CALLBACK (data_new_cmd_callback),
GIMP_HELP_DYNAMICS_NEW },
{ "dynamics-duplicate", GIMP_STOCK_DUPLICATE,
NC_("dynamics-action", "D_uplicate Dynamics"), NULL,
NC_("dynamics-action", "Duplicate this dynamics"),
G_CALLBACK (data_duplicate_cmd_callback),
GIMP_HELP_DYNAMICS_DUPLICATE },
{ "dynamics-copy-location", "edit-copy",
NC_("dynamics-action", "Copy Dynamics _Location"), NULL,
NC_("dynamics-action", "Copy dynamics file location to clipboard"),
G_CALLBACK (data_copy_location_cmd_callback),
GIMP_HELP_DYNAMICS_COPY_LOCATION },
{ "dynamics-show-in-file-manager", "gtk-directory",
NC_("dynamics-action", "Show in _File Manager"), NULL,
NC_("dynamics-action", "Show dynamics file location in the file manager"),
G_CALLBACK (data_show_in_file_manager_cmd_callback),
GIMP_HELP_DYNAMICS_SHOW_IN_FILE_MANAGER },
{ "dynamics-delete", "edit-delete",
NC_("dynamics-action", "_Delete Dynamics"), NULL,
NC_("dynamics-action", "Delete this dynamics"),
G_CALLBACK (data_delete_cmd_callback),
GIMP_HELP_DYNAMICS_DELETE },
{ "dynamics-refresh", "view-refresh",
NC_("dynamics-action", "_Refresh Dynamics"), NULL,
NC_("dynamics-action", "Refresh dynamics"),
G_CALLBACK (data_refresh_cmd_callback),
GIMP_HELP_DYNAMICS_REFRESH }
};
static const GimpStringActionEntry dynamics_edit_actions[] =
{
{ "dynamics-edit", "gtk-edit",
NC_("dynamics-action", "_Edit Dynamics..."), NULL,
NC_("dynamics-action", "Edit dynamics"),
"gimp-dynamics-editor",
GIMP_HELP_DYNAMICS_EDIT }
};
void
dynamics_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "dynamics-action",
dynamics_actions,
G_N_ELEMENTS (dynamics_actions));
gimp_action_group_add_string_actions (group, "dynamics-action",
dynamics_edit_actions,
G_N_ELEMENTS (dynamics_edit_actions),
G_CALLBACK (data_edit_cmd_callback));
}
void
dynamics_actions_update (GimpActionGroup *group,
gpointer user_data)
{
GimpContext *context = action_data_get_context (user_data);
GimpDynamics *dynamics = NULL;
GimpData *data = NULL;
GFile *file = NULL;
if (context)
{
dynamics = gimp_context_get_dynamics (context);
if (dynamics)
{
data = GIMP_DATA (dynamics);
file = gimp_data_get_file (data);
}
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
SET_SENSITIVE ("dynamics-edit", dynamics);
SET_SENSITIVE ("dynamics-duplicate", dynamics && GIMP_DATA_GET_CLASS (data)->duplicate);
SET_SENSITIVE ("dynamics-copy-location", file);
SET_SENSITIVE ("dynamics-show-in-file-manager", file);
SET_SENSITIVE ("dynamics-delete", dynamics && gimp_data_is_deletable (data));
#undef SET_SENSITIVE
}
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: android/libcore/luni/src/main/java/javax/xml/xpath/XPathFactory.java
//
#ifndef _JavaxXmlXpathXPathFactory_H_
#define _JavaxXmlXpathXPathFactory_H_
@class JavaLangClassLoader;
@protocol JavaxXmlXpathXPath;
@protocol JavaxXmlXpathXPathFunctionResolver;
@protocol JavaxXmlXpathXPathVariableResolver;
#include "J2ObjC_header.h"
@interface JavaxXmlXpathXPathFactory : NSObject {
}
- (instancetype)init;
+ (JavaxXmlXpathXPathFactory *)newInstance OBJC_METHOD_FAMILY_NONE;
+ (JavaxXmlXpathXPathFactory *)newInstanceWithNSString:(NSString *)uri OBJC_METHOD_FAMILY_NONE;
+ (JavaxXmlXpathXPathFactory *)newInstanceWithNSString:(NSString *)uri
withNSString:(NSString *)factoryClassName
withJavaLangClassLoader:(JavaLangClassLoader *)classLoader OBJC_METHOD_FAMILY_NONE;
- (jboolean)isObjectModelSupportedWithNSString:(NSString *)objectModel;
- (void)setFeatureWithNSString:(NSString *)name
withBoolean:(jboolean)value;
- (jboolean)getFeatureWithNSString:(NSString *)name;
- (void)setXPathVariableResolverWithJavaxXmlXpathXPathVariableResolver:(id<JavaxXmlXpathXPathVariableResolver>)resolver;
- (void)setXPathFunctionResolverWithJavaxXmlXpathXPathFunctionResolver:(id<JavaxXmlXpathXPathFunctionResolver>)resolver;
- (id<JavaxXmlXpathXPath>)newXPath OBJC_METHOD_FAMILY_NONE;
@end
J2OBJC_EMPTY_STATIC_INIT(JavaxXmlXpathXPathFactory)
CF_EXTERN_C_BEGIN
FOUNDATION_EXPORT JavaxXmlXpathXPathFactory *JavaxXmlXpathXPathFactory_newInstance();
FOUNDATION_EXPORT JavaxXmlXpathXPathFactory *JavaxXmlXpathXPathFactory_newInstanceWithNSString_(NSString *uri);
FOUNDATION_EXPORT JavaxXmlXpathXPathFactory *JavaxXmlXpathXPathFactory_newInstanceWithNSString_withNSString_withJavaLangClassLoader_(NSString *uri, NSString *factoryClassName, JavaLangClassLoader *classLoader);
FOUNDATION_EXPORT NSString *JavaxXmlXpathXPathFactory_DEFAULT_PROPERTY_NAME_;
J2OBJC_STATIC_FIELD_GETTER(JavaxXmlXpathXPathFactory, DEFAULT_PROPERTY_NAME_, NSString *)
FOUNDATION_EXPORT NSString *JavaxXmlXpathXPathFactory_DEFAULT_OBJECT_MODEL_URI_;
J2OBJC_STATIC_FIELD_GETTER(JavaxXmlXpathXPathFactory, DEFAULT_OBJECT_MODEL_URI_, NSString *)
CF_EXTERN_C_END
J2OBJC_TYPE_LITERAL_HEADER(JavaxXmlXpathXPathFactory)
#endif // _JavaxXmlXpathXPathFactory_H_
|
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2012-2017 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed.org for more information.
This file is part of plumed, version 2.
plumed 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.
plumed 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 plumed. If not, see <http://www.gnu.org/licenses/>.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#ifndef __PLUMED_multicolvar_ActionVolume_h
#define __PLUMED_multicolvar_ActionVolume_h
#include "tools/HistogramBead.h"
#include "VolumeGradientBase.h"
namespace PLMD {
namespace multicolvar {
/**
\ingroup INHERIT
This is the abstract base class to use for implementing a new way of definining a particular region of the simulation
box. You can use this to calculate the number of atoms inside that part or the average value of a quantity like the
coordination number inside that part of the cell.
*/
class ActionVolume : public VolumeGradientBase {
private:
/// Number of quantities in use in this colvar
unsigned nquantities;
/// The value of sigma
double sigma;
/// Are we interested in the area outside the colvar
bool not_in;
/// The kernel type for this histogram
std::string kerneltype;
protected:
double getSigma() const ;
std::string getKernelType() const ;
public:
static void registerKeywords( Keywords& keys );
explicit ActionVolume(const ActionOptions&);
/// Get the number of quantities that are calculated each time
virtual unsigned getNumberOfQuantities() const ;
/// Calculate whats in the volume
void calculateAllVolumes( const unsigned& curr, MultiValue& outvals ) const ;
/// This calculates whether or not a particular is inside the box of interest
/// this is used for neighbour list with volumes
bool inVolumeOfInterest( const unsigned& curr ) const ;
virtual double calculateNumberInside( const Vector& cpos, Vector& derivatives, Tensor& vir, std::vector<Vector>& refders ) const=0;
unsigned getCentralAtomElementIndex();
};
inline
unsigned ActionVolume::getNumberOfQuantities() const {
return nquantities;
}
inline
double ActionVolume::getSigma() const {
return sigma;
}
inline
std::string ActionVolume::getKernelType() const {
return kerneltype;
}
inline
unsigned ActionVolume::getCentralAtomElementIndex() {
return 1;
}
}
}
#endif
|
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include "BaseSourcePolicy.h"
#include "FairMQLogger.h"
#include "FairRunAna.h"
#include "FairFileSource.h"
//#include "FairLmdSource.h"
//#include "FairMbsSource.h"
//#include "FairMbsStreamSource.h"
//#include "FairMixedSource.h"
//#include "FairRemoteSource.h"
#include <type_traits>
#include <functional>
template<typename T, typename U>
using enable_if_match = typename std::enable_if<std::is_same<T,U>::value,int>::type;
template<typename FairSourceType, typename DataType>
class FairSourceMQInterface : public BaseSourcePolicy< FairSourceMQInterface<FairSourceType, DataType> >
{
typedef DataType* DataType_ptr;
typedef FairSourceMQInterface<FairSourceType,DataType> this_type;
public:
FairSourceMQInterface() :
BaseSourcePolicy<FairSourceMQInterface<FairSourceType, DataType>>(),
fSource(nullptr),
fData(nullptr),
fIndex(0),
fMaxIndex(-1),
fSourceName(),
fBranchName(),
fRunAna(nullptr)
{
}
virtual ~FairSourceMQInterface()
{
if(fData)
delete fData;
fData=nullptr;
if(fSource)
delete fSource;
fSource=nullptr;
if(fRunAna)
delete fRunAna;
fRunAna=nullptr;
}
//______________________________________________________________________________
int64_t GetNumberOfEvent()
{
return fMaxIndex;
}
void SetFileProperties(const std::string &filename, const std::string &branchname)
{
fSourceName = filename;
fBranchName = branchname;
}
//______________________________________________________________________________
// FairFileSource
template <typename T = FairSourceType, enable_if_match<T, FairFileSource> = 0>
void InitSource()
{
fRunAna = new FairRunAna();
fSource = new FairSourceType(fSourceName.c_str());
fSource->Init();
fSource->ActivateObject((TObject**)&fData,fBranchName.c_str());
fMaxIndex = fSource->CheckMaxEventNo();
}
template <typename T = FairSourceType, enable_if_match<T, FairFileSource> = 0>
void SetIndex(int64_t eventIdx)
{
fIndex=eventIdx;
}
template <typename T = FairSourceType, enable_if_match<T, FairFileSource> = 0>
DataType_ptr GetOutData()
{
fSource->ReadEvent(fIndex);
return fData;
}
protected:
FairSourceType* fSource;
DataType_ptr fData;
int64_t fIndex;
int64_t fMaxIndex;
std::string fClassName;
std::string fBranchName;
std::string fSourceName;
FairRunAna* fRunAna;
};
|
/**
******************************************************************************
* @file stm32f429i_discovery_gyroscope.h
* @author MCD Application Team
* @version V2.1.0
* @date 19-June-2014
* @brief This file contains definitions for stm32f429i_discovery_gyroscope.c
* firmware driver.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F429I_DISCOVERY_GYROSCOPE_H
#define __STM32F429I_DISCOVERY_GYROSCOPE_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f429i_discovery.h"
/* Include Gyroscope component driver */
#include "..\Components\l3gd20\l3gd20.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup STM32F429I_DISCOVERY
* @{
*/
/** @addtogroup STM32F429I_DISCOVERY_GYROSCOPE
* @{
*/
/** @defgroup STM32F429I_DISCOVERY_GYROSCOPE_Exported_Types
* @{
*/
typedef enum
{
GYRO_OK = 0,
GYRO_ERROR = 1,
GYRO_TIMEOUT = 2
}GYRO_StatusTypeDef;
/**
* @}
*/
/** @defgroup STM32F429I_DISCOVERY_GYROSCOPE_Exported_Constants
* @{
*/
/**
* @}
*/
/** @defgroup STM32F429I_DISCOVERY_GYROSCOPE_Exported_Macros
* @{
*/
/**
* @}
*/
/** @defgroup STM32F429I_DISCOVERY_GYROSCOPE_Exported_Functions
* @{
*/
/* Gyroscope Functions */
uint8_t BSP_GYRO_Init(void);
void BSP_GYRO_Reset(void);
uint8_t BSP_GYRO_ReadID(void);
void BSP_GYRO_ITConfig(GYRO_InterruptConfigTypeDef *pIntConfigStruct);
void BSP_GYRO_EnableIT(uint8_t IntPin);
void BSP_GYRO_DisableIT(uint8_t IntPin);
void BSP_GYRO_GetXYZ(float* pfData);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F429I_DISCOVERY_GYROSCOPE_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/* Jakopter
* Copyright © 2015 ALF@INRIA
*
* 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/>.
*/
#ifndef JAKOPTER_NETWORK_H
#define JAKOPTER_NETWORK_H
#include "com_channel.h"
#include "com_master.h"
#include "utils.h"
#define CHANNEL_INPUT_SIZE 16384
#define CHANNEL_OUTPUT_SIZE 1024
#define ORDER_SIZE 256
#define ADDR_SIZE 256
#define DEFAULT_CLIENT_IN "http://127.0.0.1"
#define DEFAULT_CLIENT_OUT "http://127.0.0.1/index.php"
/* 10 ms in ns */
#define TIMEOUT_NETWORK 4000000
/** \brief Start the thread that listen on server_in and send data on server_out
* \param server_in a HTTP address where Curl GET his data
* \param server_out a HTTP address where Curl POST his data
* \return 0 OK, -1 otherwise
*/
int jakopter_init_network(const char* server_in, const char* server_out);
/** \brief Stop curl */
int jakopter_stop_network();
#endif
|
/****************************************************************************
**
** Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QT3DCORE_JOB_COMMON_P_H
#define QT3DCORE_JOB_COMMON_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 <Qt3DCore/private/qaspectjob_p.h>
QT_BEGIN_NAMESPACE
namespace Qt3DCore {
namespace JobTypes {
enum JobType {
LoadBuffer = 4096,
CalcBoundingVolume,
};
} // JobTypes
} // Qt3DCore
QT_END_NAMESPACE
#endif // QT3DCORE_JOB_COMMON_P_H
|
/*!
*
*
* \brief Very basic math abstraction layer.
*
* \par
* This file serves as a minimal abstraction layer.
* Inclusion of this file makes some frequently used
* functions, constants, and header file inclusions
* OS-, compiler-, and version-independent.
*
*
*
*
* \author -
* \date -
*
*
* \par Copyright 1995-2017 Shark Development Team
*
* <BR><HR>
* This file is part of Shark.
* <http://shark-ml.org/>
*
* Shark 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.
*
* Shark 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 Shark. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef SHARK_CORE_MATH_H
#define SHARK_CORE_MATH_H
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/utility/enable_if.hpp>
#include <limits>
#include <cmath>
#include <type_traits>
#include <shark/Core/Exception.h>
namespace shark {
// define doxygen group for shark global functions, var, etc. (should only appear once in all shark files)
/**
* \defgroup shark_globals shark_globals
*
* \brief Several mathematical, linear-algebra, or other functions within Shark are not part of any particular class. They are collected here in the doxygen group "shark_globals"
*
* @{
*
*/
/**
* \brief Constant for sqrt( 2 * pi ).
*/
static const double SQRT_2_PI = boost::math::constants::root_two_pi<double>();
// static const double SQRT_PI = boost::math::constants::root_pi<double>();
/// Maximum allowed input value for exp.
template<class T>
T maxExpInput(){
return boost::math::constants::ln_two<T>()*std::numeric_limits<T>::max_exponent;
}
/// Minimum value for exp(x) allowed so that it is not 0.
template<class T>
T minExpInput(){
return boost::math::constants::ln_two<T>()*std::numeric_limits<T>::min_exponent;
}
/// Calculates x^2.
template <class T>
inline typename boost::enable_if<std::is_arithmetic<T>, T>::type sqr( const T & x) {
return x * x;
}
/// Calculates x^3.
template <class T> inline T cube( const T & x) {
return x * x * x;
}
///\brief Logistic function/logistic function.
///
///Calculates the sigmoid function 1/(1+exp(-x)). The type must be arithmetic. For example
///float,double,long double, int,... but no custom Type.
template<class T>
typename boost::enable_if<std::is_arithmetic<T>, T>::type sigmoid(T x){
if(x < minExpInput<T>()) {
return 1;
}
if(x > maxExpInput<T>()) {
return 0;
}
return 1. / (1.+ std::exp(-x));
}
///\brief Thresholded exp function, over- and underflow safe.
///
///Replaces the value of exp(x) for numerical reasons by the a threshold value if it gets too large.
///Use it only, if there is no other way to get the function stable!
///
///@param x the exponent
template<class T>
T safeExp(T x ){
if(x > maxExpInput<T>()){
//std::cout<<"warning, x too high"<<std::endl;
return 0.9 * std::numeric_limits<long double>::max();
}
//Allow Koenig Lookup
using std::exp;
return exp(x);
}
///\brief Thresholded log function, over- and underflow safe.
///
///Replaces the value of log(x) for numerical reasons by the a threshold value if it gets too low.
///Use it only, if there is no other way to get the function stable!
///@param x the exponent
template<class T>
T safeLog(T x)
{
if(x> -std::numeric_limits<T>::epsilon() && x < std::numeric_limits<T>::epsilon()){
//std::cout<<"warning, x too low"<<std::endl;
return boost::math::sign(x)*std::numeric_limits<T>::min_exponent;
}
//Allow Koenig Lookup
using std::log;
return log(x);
};
///\brief Numerically stable version of the function log(1+exp(x)).
///
///Numerically stable version of the function log(1+exp(x)).
///This function is the integral of the famous sigmoid function.
///The type must be arithmetic. For example
///float,double,long double, int,... but no custom Type.
template<class T>
typename boost::enable_if<std::is_arithmetic<T>, T>::type softPlus(T x){
if(x > maxExpInput<T>()){
return x;
}
if(x < minExpInput<T>()){
return 0;
}
return std::log(1+std::exp(x));
}
///\brief Numerically stable version of the function log(1+exp(x)). calculated with float precision to save some time
///
///Numerically stable version of the function log(1+exp(x)).
///This function is the integral of the famous sigmoid function.
inline double softPlus(double x){
if(x > 15){
return x;
}
if(x < -17){
return 0;
}
return std::log(1.0f+std::exp(float(x)));
}
///brief lets x have the same sign as y.
///
///This is the famous well known copysign function from fortran.
template<class T>
T copySign(T x, T y){
using std::abs;
if(y > 0){
return abs(x);
}
return -abs(x);
}
}
/** @}*/
#endif
|
#ifndef FILE_POSITION_H
#define FILE_POSITION_H
#include <cstddef>
#include "finite_state_machine.h"
class FilePosition {
private:
std::size_t line, column;
bool carriage_return;
public:
FilePosition() : line(1), column(1), carriage_return(false) {}
void on_state_change(Direction direction, char symbol);
void increment_column() { this->column++; }
void increment_column(size_t column_count) { this->column += column_count; }
void increment_line();
std::size_t get_line() const { return this->line; }
std::size_t get_column() const { return this->column; }
};
#endif /* FILE_POSITION_H */
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define max(x,y) ( x>y?x:y )
#define min(x,y) ( x<y?x:y )
void Roe_HLL_solver(double *V_mk, double *F, double gamma, double P_L, double RHO_L, double U_L, double V_L, double P_R, double RHO_R, double U_R, double V_R, double *lambda_max, double delta)
{
// double const Q_user = 2.0;
double C_L, C_R;
C_L = sqrt(gamma*P_L/RHO_L);
C_R = sqrt(gamma*P_R/RHO_R);
double z = 0.5 * (gamma-1.0) / gamma;
/*
double Q, P_pvrs, P_max, P_min, RHO_bar, C_bar;
P_min = min(P_L,P_R);
P_max = max(P_L,P_R);
Q = P_max/P_min;
RHO_bar = 0.5*(RHO_L+RHO_R);
C_bar = 0.5*(C_L+C_R);
P_pvrs = 0.5*(P_L+P_R)+0.5*(U_L-U_R)*RHO_bar*C_bar;
double A_L,A_R,B_L,B_R;
A_L = 2.0/(gamma+1.0)/RHO_L;
A_R = 2.0/(gamma+1.0)/RHO_R;
B_L = (gamma-1)/(gamma+1)*P_L;
B_R = (gamma-1)/(gamma+1)*P_R;
double P_star, U_star, U_star_L, U_star_R, RHO_star_L, RHO_star_R, C_star_L, C_star_R, P_0, g_L_0, g_R_0, lambda_L_1, lambda_R_1, lambda_L_3, lambda_R_3;
if(Q<Q_user&&P_min<P_pvrs&&P_pvrs<P_max) //PVRS
{
P_star = max(0,P_pvrs);
U_star = 0.5*(U_L+U_R)+0.5*(P_L-P_R)/(RHO_bar*C_bar);
RHO_star_L = RHO_L + (U_L-U_star)*RHO_bar/C_bar;
RHO_star_R = RHO_R + (U_star - U_R)*RHO_bar/C_bar;
C_star_L = sqrt(gamma*P_star/RHO_star_L);
C_star_R = sqrt(gamma*P_star/RHO_star_R);
U_star_L = U_star;
U_star_R = U_star;
}
else if(P_pvrs<P_min) //TRRS
{
P_star = pow((C_L + C_R - (gamma-1.0)/2.0*(U_R - U_L))/(C_L/pow(P_L,z) + C_R/pow(P_R,z)), 1.0/z);
C_star_L = C_L * pow(P_star/P_L, z);
U_star_L = U_L + 2.0/(gamma - 1.0)*(C_L - C_star_L);
C_star_R = C_R * pow(P_star/P_R, z);
U_star_R = U_R + 2.0/(gamma - 1.0)*(C_star_R - C_R);
}
else //TSRS
{
P_0 = max(0,P_pvrs);
g_L_0 = sqrt(A_L/(P_0+B_L));
g_R_0 = sqrt(A_R/(P_0+B_R));
P_star = (g_L_0*P_L+g_R_0*P_R-(U_R-U_L))/(g_L_0+g_R_0);
U_star = 0.5*(U_R+U_L)+0.5*((P_star-P_R)*g_R_0-(P_star-P_L)*g_L_0);
RHO_star_L = RHO_L*(P_star/P_L+(gamma-1.0)/(gamma+1.0))/((gamma-1.0)*P_star/(gamma+1.0)/P_L+1.0);
RHO_star_R = RHO_R*(P_star/P_R+(gamma-1.0)/(gamma+1.0))/((gamma-1.0)*P_star/(gamma+1.0)/P_R+1.0);
C_star_L = sqrt(gamma*P_star/RHO_star_L);
C_star_R = sqrt(gamma*P_star/RHO_star_R);
U_star_L = U_star;
U_star_R = U_star;
}
lambda_L_1 = U_L - C_L;
lambda_R_1 = U_star_L - C_star_L;
lambda_L_3 = U_star_R + C_star_R;
lambda_R_3 = U_R + C_R;
*/
double H_L, H_R;
H_L = gamma/(gamma-1.0)*P_L/RHO_L + 0.5*(U_L*U_L);
H_R = gamma/(gamma-1.0)*P_R/RHO_R + 0.5*(U_R*U_R);
double E_L, E_R;
E_L = 1.0/(gamma-1.0)*P_L/RHO_L + 0.5*(U_L*U_L);
E_R = 1.0/(gamma-1.0)*P_R/RHO_R + 0.5*(U_R*U_R);
double U[3];
U[0] = RHO_L;
U[1] = RHO_L*U_L;
U[2] = RHO_L*E_L;
double RHO_S, U_S, H_S, C_S;
RHO_S = sqrt(RHO_L*RHO_R);
U_S = (U_L*sqrt(RHO_L)+U_R*sqrt(RHO_R)) / (sqrt(RHO_L)+sqrt(RHO_R));
H_S = (H_L*sqrt(RHO_L)+H_R*sqrt(RHO_R)) / (sqrt(RHO_L)+sqrt(RHO_R));
C_S = sqrt((gamma-1.0)*(H_S-0.5*U_S*U_S));
double R[3][3];
double lambda[3], W[3];
R[0][0] = 1.0;
R[0][1] = 1.0;
R[0][2] = 1.0;
R[1][0] = U_S - C_S;
R[1][1] = U_S;
R[1][2] = U_S + C_S;
R[2][0] = H_S - U_S*C_S;
R[2][1] = 0.5*(U_S*U_S);
R[2][2] = H_S + U_S*C_S;
int i, j;
W[0] = 0.5*((P_R-P_L)-RHO_S*C_S*(U_R-U_L))/(C_S*C_S);
W[1] = (RHO_R-RHO_L)-(P_R-P_L)/(C_S*C_S);
W[2] = 0.5*((P_R-P_L)+RHO_S*C_S*(U_R-U_L))/(C_S*C_S);
lambda[0] = U_S - C_S;
lambda[1] = U_S;
lambda[2] = U_S + C_S;
*lambda_max = fabs(U_S) + C_S;
/*
if(lambda_L_1<0&&lambda_R_1>0)
{
for(i = 0; i < 3; i++)
{
U[i] += (lambda_R_1-(U_S-C_S))/(lambda_R_1-lambda_L_1)*W[0]*R[i][0];
}
}
else if(lambda_L_3<0&&lambda_R_3>0)
{
U[0] = RHO_R;
U[1] = RHO_R*U_R;
U[2] = RHO_R*E_R;
for(i = 0; i < 3; i++)
{
U[i] += -((U_S+C_S)-lambda_L_3)/(lambda_R_3-lambda_L_3)*W[2]*R[i][2];
}
}
else
{
*/ for(j = 0; j < 3; j++)
{
if(lambda[j]<=0)
{
for(i = 0; i < 3 ; i++)
{
U[i] += W[j]*R[i][j];
}
}
}
// }
F[0] = U[0];
F[1] = U[1]/U[0];
F[2] = (U[2]/U[0] - 0.5*F[1]*F[1])*(gamma-1.0)*F[0];
double S_L, S_R;
S_L=min(U_S-C_S,U_L-C_L);
S_R=max(U_S+C_S,U_R+C_R);
S_L=min(0,S_L);
S_R=max(0,S_R);
*V_mk=(RHO_R*(S_R-U_R)*V_R-RHO_L*(S_L-U_L)*V_L)/(RHO_R*(S_R-U_R)-RHO_L*(S_L-U_L));
}
|
/**
* @defgroup Win Win
* @ingroup Elementary
*
* @image html win_inheritance_tree.png
* @image latex win_inheritance_tree.eps
*
* @image html img/widget/win/preview-00.png
* @image latex img/widget/win/preview-00.eps
*
* The window class of Elementary. Contains functions to manipulate
* windows. The Evas engine used to render the window contents is specified
* in the system or user elementary config files (whichever is found last),
* and can be overridden with the ELM_ENGINE environment variable for
* testing. Engines that may be supported (depending on Evas and Ecore-Evas
* compilation setup and modules actually installed at runtime) are (listed
* in order of best supported and most likely to be complete and work to
* lowest quality).
*
* @li "x11", "x", "software-x11", "software_x11" (Software rendering in X11)
* @li "gl", "opengl", "opengl-x11", "opengl_x11" (OpenGL or OpenGL-ES2
* rendering in X11)
* @li "shot:..." (Virtual screenshot renderer - renders to output file and
* exits)
* @li "fb", "software-fb", "software_fb" (Linux framebuffer direct software
* rendering)
* @li "sdl", "software-sdl", "software_sdl" (SDL software rendering to SDL
* buffer)
* @li "gl-sdl", "gl_sdl", "opengl-sdl", "opengl_sdl" (OpenGL or OpenGL-ES2
* rendering using SDL as the buffer)
* @li "gdi", "software-gdi", "software_gdi" (Windows WIN32 rendering via
* GDI with software)
* @li "dfb", "directfb" (Rendering to a DirectFB window)
* @li "x11-8", "x8", "software-8-x11", "software_8_x11" (Rendering in
* grayscale using dedicated 8bit software engine in X11)
* @li "x11-16", "x16", "software-16-x11", "software_16_x11" (Rendering in
* X11 using 16bit software engine)
* @li "wince-gdi", "software-16-wince-gdi", "software_16_wince_gdi"
* (Windows CE rendering via GDI with 16bit software renderer)
* @li "sdl-16", "software-16-sdl", "software_16_sdl" (Rendering to SDL
* buffer with 16bit software renderer)
* @li "ews" (rendering to EWS - Ecore + Evas Single Process Windowing System)
* @li "gl-cocoa", "gl_cocoa", "opengl-cocoa", "opengl_cocoa" (OpenGL rendering in Cocoa)
* @li "psl1ght" (PS3 rendering using PSL1GHT)
*
* All engines use a simple string to select the engine to render, EXCEPT
* the "shot" engine. This actually encodes the output of the virtual
* screenshot and how long to delay in the engine string. The engine string
* is encoded in the following way:
*
* "shot:[delay=XX][:][repeat=DDD][:][file=XX]"
*
* Where options are separated by a ":" char if more than one option is
* given, with delay, if provided being the first option and file the last
* (order is important). The delay specifies how long to wait after the
* window is shown before doing the virtual "in memory" rendering and then
* save the output to the file specified by the file option (and then exit).
* If no delay is given, the default is 0.5 seconds. If no file is given the
* default output file is "out.png". Repeat option is for continuous
* capturing screenshots. Repeat range is from 1 to 999 and filename is
* fixed to "out001.png" Some examples of using the shot engine:
*
* ELM_ENGINE="shot:delay=1.0:repeat=5:file=elm_test.png" elementary_test
* ELM_ENGINE="shot:delay=1.0:file=elm_test.png" elementary_test
* ELM_ENGINE="shot:file=elm_test2.png" elementary_test
* ELM_ENGINE="shot:delay=2.0" elementary_test
* ELM_ENGINE="shot:" elementary_test
*
* Signals that you can add callbacks for are:
*
* @li "delete,request": the user requested to close the window. See
* elm_win_autodel_set().
* @li "focus,in": window got focus (deprecated. use "focused" instead.)
* @li "focus,out": window lost focus (deprecated. use "unfocused" instead.)
* @li "moved": window that holds the canvas was moved
* @li "withdrawn": window is still managed normally but removed from view
* @li "iconified": window is minimized (perhaps into an icon or taskbar)
* @li "normal": window is in a normal state (not withdrawn or iconified)
* @li "stick": window has become sticky (shows on all desktops)
* @li "unstick": window has stopped being sticky
* @li "fullscreen": window has become fullscreen
* @li "unfullscreen": window has stopped being fullscreen
* @li "maximized": window has been maximized
* @li "unmaximized": window has stopped being maximized
* @li "ioerr": there has been a low-level I/O error with the display system
* @li "indicator,prop,changed": an indicator's property has been changed
* @li "rotation,changed": window rotation has been changed
* @li "profile,changed": profile of the window has been changed
* @li "focused" : When the win has received focus. (since 1.8)
* @li "unfocused" : When the win has lost focus. (since 1.8)
*
* Note that calling evas_object_show() after window contents creation is
* recommended. It will trigger evas_smart_objects_calculate() and some backend
* calls directly. For example, XMapWindow is called directly during
* evas_object_show() in X11 engine.
*
* Examples:
* @li @ref win_example_01
*
* @{
*/
#include <elm_win_common.h>
#ifdef EFL_EO_API_SUPPORT
#include <elm_win_eo.h>
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
#include <elm_win_legacy.h>
#endif
/**
* @}
*/
|
/*
* tkUnixXId.c --
*
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkUnixInt.h"
/*
*----------------------------------------------------------------------
*
* Tk_FreeXId --
*
* This function is called to indicate that an X resource identifier is
* now free.
*
* Results:
* None.
*
* Side effects:
* The identifier is added to the stack of free identifiers for its
* display, so that it can be re-used.
*
*----------------------------------------------------------------------
*/
void
Tk_FreeXId(
Display *display, /* Display for which xid was allocated. */
XID xid) /* Identifier that is no longer in use. */
{
/*
* This does nothing, because the XC-MISC extension takes care of
* freeing XIDs for us. It has been a standard X11 extension for
* about 15 years as of 2008. Keith Packard and another X.org
* developer suggested that we remove the previous code that used:
* #define XLIB_ILLEGAL_ACCESS.
*/
}
/*
*----------------------------------------------------------------------
*
* Tk_GetPixmap --
*
* Same as the XCreatePixmap function except that it manages resource
* identifiers better.
*
* Results:
* Returns a new pixmap.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
Pixmap
Tk_GetPixmap(
Display *display, /* Display for new pixmap. */
Drawable d, /* Drawable where pixmap will be used. */
int width, int height, /* Dimensions of pixmap. */
int depth) /* Bits per pixel for pixmap. */
{
return XCreatePixmap(display, d, (unsigned) width, (unsigned) height,
(unsigned) depth);
}
/*
*----------------------------------------------------------------------
*
* Tk_FreePixmap --
*
* Same as the XFreePixmap function except that it also marks the
* resource identifier as free.
*
* Results:
* None.
*
* Side effects:
* The pixmap is freed in the X server and its resource identifier is
* saved for re-use.
*
*----------------------------------------------------------------------
*/
void
Tk_FreePixmap(
Display *display, /* Display for which pixmap was allocated. */
Pixmap pixmap) /* Identifier for pixmap. */
{
XFreePixmap(display, pixmap);
Tk_FreeXId(display, (XID) pixmap);
}
/*
*----------------------------------------------------------------------
*
* TkpScanWindowId --
*
* Given a string, produce the corresponding Window Id.
*
* Results:
* The return value is normally TCL_OK; in this case *idPtr will be set
* to the Window value equivalent to string. If string is improperly
* formed then TCL_ERROR is returned and an error message will be left in
* the interp's result.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
int
TkpScanWindowId(
Tcl_Interp *interp,
const char *string,
Window *idPtr)
{
int value;
if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
return TCL_ERROR;
}
*idPtr = (Window) value;
return TCL_OK;
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
|
/*
Dummy MA57 interface to be used when MA57 isn't available.
10 Sept 08: First version.
*/
#include "lbl.h"
#include "ma57.h"
#ifdef __cplusplus
extern "C" { /* To prevent C++ compilers from mangling symbols */
#endif
/* ================================================================= */
#ifdef __FUNCT__
#undef __FUNCT__
#endif
#define __FUNCT__ "MA57_Initialize"
Ma57_Data *Ma57_Initialize( int nz, int n, FILE *logfile ) {
return 0;
}
/* ================================================================= */
#ifdef __FUNCT__
#undef __FUNCT__
#endif
#define __FUNCT__ "Ma57_Analyze"
int Ma57_Analyze( Ma57_Data *ma57 ) {
return 0;
}
/* ================================================================= */
#ifdef __FUNCT__
#undef __FUNCT__
#endif
#define __FUNCT__ "Ma57_Factorize"
int Ma57_Factorize( Ma57_Data *ma57, double A[] ) {
return 0;
}
/* ================================================================= */
#ifdef __FUNCT__
#undef __FUNCT__
#endif
#define __FUNCT__ "Ma57_Solve"
int Ma57_Solve( Ma57_Data *ma57, double x[] ) {
return 0;
}
/* ================================================================= */
#ifdef __FUNCT__
#undef __FUNCT__
#endif
#define __FUNCT__ "Ma57_Refine"
int Ma57_Refine( Ma57_Data *ma57, double x[], double rhs[],
double A[], int maxitref, int job ) {
return 0;
}
/* ================================================================= */
#ifdef __FUNCT__
#undef __FUNCT__
#endif
#define __FUNCT__ "Ma57_Finalize"
void Ma57_Finalize( Ma57_Data *ma57 ) {
return;
}
/* ================================================================= */
#ifdef __cplusplus
} /* Closing brace for extern "C" block */
#endif
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/directconnect/DirectConnect_EXPORTS.h>
#include <aws/directconnect/DirectConnectRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace DirectConnect
{
namespace Model
{
/**
* <p>Container for the parameters to the DeleteBGPPeer operation.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteBGPPeerRequest">AWS
* API Reference</a></p>
*/
class AWS_DIRECTCONNECT_API DeleteBGPPeerRequest : public DirectConnectRequest
{
public:
DeleteBGPPeerRequest();
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline const Aws::String& GetVirtualInterfaceId() const{ return m_virtualInterfaceId; }
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline void SetVirtualInterfaceId(const Aws::String& value) { m_virtualInterfaceIdHasBeenSet = true; m_virtualInterfaceId = value; }
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline void SetVirtualInterfaceId(Aws::String&& value) { m_virtualInterfaceIdHasBeenSet = true; m_virtualInterfaceId = std::move(value); }
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline void SetVirtualInterfaceId(const char* value) { m_virtualInterfaceIdHasBeenSet = true; m_virtualInterfaceId.assign(value); }
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline DeleteBGPPeerRequest& WithVirtualInterfaceId(const Aws::String& value) { SetVirtualInterfaceId(value); return *this;}
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline DeleteBGPPeerRequest& WithVirtualInterfaceId(Aws::String&& value) { SetVirtualInterfaceId(std::move(value)); return *this;}
/**
* <p>The ID of the virtual interface from which the BGP peer will be deleted.</p>
* <p>Example: dxvif-456abc78</p> <p>Default: None</p>
*/
inline DeleteBGPPeerRequest& WithVirtualInterfaceId(const char* value) { SetVirtualInterfaceId(value); return *this;}
inline int GetAsn() const{ return m_asn; }
inline void SetAsn(int value) { m_asnHasBeenSet = true; m_asn = value; }
inline DeleteBGPPeerRequest& WithAsn(int value) { SetAsn(value); return *this;}
inline const Aws::String& GetCustomerAddress() const{ return m_customerAddress; }
inline void SetCustomerAddress(const Aws::String& value) { m_customerAddressHasBeenSet = true; m_customerAddress = value; }
inline void SetCustomerAddress(Aws::String&& value) { m_customerAddressHasBeenSet = true; m_customerAddress = std::move(value); }
inline void SetCustomerAddress(const char* value) { m_customerAddressHasBeenSet = true; m_customerAddress.assign(value); }
inline DeleteBGPPeerRequest& WithCustomerAddress(const Aws::String& value) { SetCustomerAddress(value); return *this;}
inline DeleteBGPPeerRequest& WithCustomerAddress(Aws::String&& value) { SetCustomerAddress(std::move(value)); return *this;}
inline DeleteBGPPeerRequest& WithCustomerAddress(const char* value) { SetCustomerAddress(value); return *this;}
private:
Aws::String m_virtualInterfaceId;
bool m_virtualInterfaceIdHasBeenSet;
int m_asn;
bool m_asnHasBeenSet;
Aws::String m_customerAddress;
bool m_customerAddressHasBeenSet;
};
} // namespace Model
} // namespace DirectConnect
} // namespace Aws
|
/*
* Copyright 2017 Google
*
* 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.
*/
#import <Foundation/Foundation.h>
#import "FirebaseDatabase/Sources/Persistence/FStorageEngine.h"
@interface FMockStorageEngine : NSObject <FStorageEngine>
@end
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Dan Larkin-York
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <cstdint>
#include "Basics/ReadWriteSpinLock.h"
namespace arangodb::basics {
class SpinUnlocker {
public:
enum class Mode : std::uint8_t { Read, Write };
public:
SpinUnlocker(Mode mode, ReadWriteSpinLock& lock)
: _lock(lock), _mode(mode), _locked(true) {
if (_mode == Mode::Read) {
_lock.unlockRead();
} else {
_lock.unlockWrite();
}
_locked = false;
}
~SpinUnlocker() { acquire(); }
// no move
SpinUnlocker(SpinUnlocker&&) = delete;
SpinUnlocker& operator=(SpinUnlocker&&) = delete;
// no copy
SpinUnlocker(SpinUnlocker const&) = delete;
SpinUnlocker& operator=(SpinUnlocker const&) = delete;
bool isLocked() const { return _locked; }
void acquire() {
if (!_locked) {
if (_mode == Mode::Read) {
_lock.lockRead();
} else {
_lock.lockWrite();
}
_locked = true;
}
}
private:
ReadWriteSpinLock& _lock;
Mode _mode;
bool _locked;
};
} // namespace arangodb::basics
|
/*
Copyright (c) 2007 Cyrus Daboo. 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.
*/
// Header for CEditIdentitySecurity class
#ifndef __CEDITIDENTITYSECURITY__MULBERRY__
#define __CEDITIDENTITYSECURITY__MULBERRY__
#include "CPrefsTabSubPanel.h"
#include "cdstring.h"
#include <LListener.h>
// Constants
// Panes
const PaneIDT paneid_EditIdentitySecurity = 5111;
const PaneIDT paneid_EditIdentitySecurityActive = 'ACTI';
const PaneIDT paneid_EditIdentitySecurityGroup1 = 'GRP1';
const PaneIDT paneid_EditIdentitySign = 'SIGN';
const PaneIDT paneid_EditIdentityEncrypt = 'ENCR';
const PaneIDT paneid_EditIdentitySignWith = 'WITH';
const PaneIDT paneid_EditIdentitySignOther = 'OTHE';
// Mesages
const MessageT msg_EditIdentitySecurityActive = 'ACTI';
const MessageT msg_EditIdentitySignWith = 'WITH';
// Resources
const ResIDT RidL_CEditIdentitySecurityBtns = 5111;
// Classes
class LCheckBox;
class LCheckBoxGroupBox;
class LPopupButton;
class CTextFieldX;
class CEditIdentitySecurity : public CPrefsTabSubPanel,
public LListener
{
private:
LCheckBoxGroupBox* mActive;
LCheckBox* mSign;
LCheckBox* mEncrypt;
LPopupButton* mSignWithPopup;
CTextFieldX* mSignOther;
public:
enum { class_ID = 'Iese' };
CEditIdentitySecurity();
CEditIdentitySecurity(LStream *inStream);
virtual ~CEditIdentitySecurity();
protected:
virtual void FinishCreateSelf(void); // Do odds & ends
public:
virtual void ListenToMessage(MessageT inMessage,
void *ioParam); // Respond to clicks in the buttons
virtual void SetData(void* data); // Set data
virtual void UpdateData(void* data); // Force update of data
};
#endif
|
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ROI_POOL_F_OP_H_
#define ROI_POOL_F_OP_H_
#include "caffe2/core/context.h"
#include "caffe2/core/logging.h"
#include "caffe2/core/operator.h"
#include "caffe2/utils/math.h"
namespace caffe2 {
template <typename T, class Context>
class RoIPoolFOp final : public Operator<Context> {
public:
RoIPoolFOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<Context>(operator_def, ws),
spatial_scale_(OperatorBase::GetSingleArgument<float>(
"spatial_scale", 1.)),
pooled_height_(OperatorBase::GetSingleArgument<int>("pooled_h", 1)),
pooled_width_(OperatorBase::GetSingleArgument<int>("pooled_w", 1)) {
DCHECK_GT(spatial_scale_, 0);
DCHECK_GT(pooled_height_, 0);
DCHECK_GT(pooled_width_, 0);
}
USE_OPERATOR_CONTEXT_FUNCTIONS;
bool RunOnDevice() override {
// No CPU implementation for now
CAFFE_NOT_IMPLEMENTED;
}
protected:
float spatial_scale_;
int pooled_height_;
int pooled_width_;
};
template <typename T, class Context>
class RoIPoolFGradientOp final : public Operator<Context> {
public:
RoIPoolFGradientOp(const OperatorDef& def, Workspace* ws)
: Operator<Context>(def, ws),
spatial_scale_(OperatorBase::GetSingleArgument<float>(
"spatial_scale", 1.)),
pooled_height_(OperatorBase::GetSingleArgument<int>("pooled_h", 1)),
pooled_width_(OperatorBase::GetSingleArgument<int>("pooled_w", 1)) {
DCHECK_GT(spatial_scale_, 0);
DCHECK_GT(pooled_height_, 0);
DCHECK_GT(pooled_width_, 0);
}
USE_OPERATOR_CONTEXT_FUNCTIONS;
bool RunOnDevice() override {
// No CPU implementation for now
CAFFE_NOT_IMPLEMENTED;
}
protected:
float spatial_scale_;
int pooled_height_;
int pooled_width_;
};
} // namespace caffe2
#endif // ROI_POOL_F_OP_H_
|
/*
* sxg's debug macro
*
* @2007-2008, China
* @song.xian-guang@hotmail.com (MSN Accounts)
*
* This code is licenced under the GPL
* Feel free to contact me if any questions
*
*/
#ifndef _SXG_DEBUG_H_
#define _SXG_DEBUG_H_
/* debug macro*/
#ifdef _sxg_debug_
# define sxg_debug(fmt, args...) printk("ksocket : %s, %s, %d, "fmt, __FILE__, __FUNCTION__, __LINE__, ##args)
#else
# define sxg_debug(fmt, args...)
#endif
#endif /* !_SXG_DEBUG_H_ */
|
/*
* Copyright (c) 2016 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <zephyr.h>
#include <sys_clock.h>
#include <stdio.h>
#include <device.h>
#include <sensor.h>
#include <misc/util.h>
#include <gpio.h>
#include <ipm.h>
#include <ipm/ipm_quark_se.h>
QUARK_SE_IPM_DEFINE(bmi160_ipm, 0, QUARK_SE_IPM_OUTBOUND);
#define SLEEPTIME MSEC(1000)
#define BMI160_INTERRUPT_PIN 4
struct device *ipm;
struct gpio_callback cb;
static void aon_gpio_callback(struct device *port,
struct gpio_callback *cb, uint32_t pins)
{
ipm_send(ipm, 0, 0, NULL, 0);
}
void main(void)
{
uint32_t timer_data[2] = {0, 0};
struct device *aon_gpio;
struct nano_timer timer;
nano_timer_init(&timer, timer_data);
aon_gpio = device_get_binding("GPIO_AON_0");
if (!aon_gpio) {
printf("aon_gpio device not found.\n");
return;
}
ipm = device_get_binding("bmi160_ipm");
if (!ipm) {
printf("ipm device not found.\n");
return;
}
gpio_init_callback(&cb, aon_gpio_callback, BIT(BMI160_INTERRUPT_PIN));
gpio_add_callback(aon_gpio, &cb);
gpio_pin_configure(aon_gpio, BMI160_INTERRUPT_PIN,
GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
GPIO_INT_ACTIVE_LOW | GPIO_INT_DEBOUNCE);
gpio_pin_enable_callback(aon_gpio, BMI160_INTERRUPT_PIN);
while (1) {
nano_task_timer_start(&timer, SLEEPTIME);
nano_task_timer_test(&timer, TICKS_UNLIMITED);
}
}
|
/*
* Copyright (C) 2004-2006 Autodesk, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser
* General Public License as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/// <library>GRFPOverrides.lib</library>
#ifndef FDOGRFPRASTERIMAGEDEFINITION_H
#define FDOGRFPRASTERIMAGEDEFINITION_H
#ifdef _WIN32
#pragma once
#endif //_WIN32
class FdoGrfpRasterExtents;
class FdoGrfpRasterGeoreferenceLocation;
/// <summary>
/// The FdoGrfpRasterImageDefinition class defines a raster image which contains a name
/// and the extents of the raster image.
/// </summary>
class FdoGrfpRasterImageDefinition : public FdoPhysicalElementMapping
{
typedef FdoPhysicalElementMapping BaseType;
friend class FdoGrfpRasterBandDefinition;
public:
/// <summary>Constructs a new Raster Image Definition.</summary>
/// <returns>Returns the newly created FdoGrfpRasterImageDefinition instance.</returns>
FDOGRFP_API static FdoGrfpRasterImageDefinition* Create();
/// <summary>Gets the frame number of the raster image.</summary>
/// <returns>Returns the frame number of the raster image.</returns>
FDOGRFP_API FdoInt32 GetFrameNumber();
/// <summary>Sets the frame number of the raster image.</summary>
/// <param name="extents">Input the frame number of the raster image.</param>
/// <returns>Returns nothing</returns>
FDOGRFP_API void SetFrameNumber(FdoInt32 frameNumber);
/// <summary>Gets the georeferenced location of the raster image.</summary>
/// <returns>Returns the georeferenced location of the raster image.</returns>
FDOGRFP_API FdoGrfpRasterGeoreferenceLocation * GetGeoreferencedLocation();
/// <summary>Sets the georeferenced location of the raster image.</summary>
/// <param name="location">Input the georeferenced location of the raster image.</param>
/// <returns>Returns nothing</returns>
FDOGRFP_API void SetGeoreferencedLocation (FdoGrfpRasterGeoreferenceLocation * location);
FDOGRFP_API bool GetBounds( double &minX, double &minY, double &maxX, double &maxY );
FDOGRFP_API void SetBounds( double minX, double minY, double maxX, double maxY );
//DOM-IGNORE-BEGIN
// XML Serialization functions, not part of supported API.
FDOGRFP_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
FDOGRFP_API virtual FdoXmlSaxHandler* XmlStartElement(
FdoXmlSaxContext* context,
FdoString* uri,
FdoString* name,
FdoString* qname,
FdoXmlAttributeCollection* atts
);
FDOGRFP_API virtual FdoBoolean XmlEndElement(
FdoXmlSaxContext* context,
FdoString* uri,
FdoString* name,
FdoString* qname
);
FDOGRFP_API virtual void XmlCharacters(FdoXmlSaxContext*, FdoString*);
FDOGRFP_API void _writeXml( FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags );
protected:
FDOGRFP_API FdoGrfpRasterImageDefinition(void);
FDOGRFP_API virtual ~FdoGrfpRasterImageDefinition(void);
void Dispose(void);
private:
FdoInt32 m_state;
FdoInt32 m_frameNumber;
FdoPtr<FdoGrfpRasterGeoreferenceLocation> m_geoReference;
bool m_haveBounds;
double m_minX;
double m_minY;
double m_maxX;
double m_maxY;
//DOM-IGNORE-END
};
/// <summary> FdoGrfpRasterImageDefinitionP is a FdoPtr on FdoGrfpRasterImageDefinition, provided for convenience. </summary>
typedef FdoPtr<FdoGrfpRasterImageDefinition> FdoGrfpRasterImageDefinitionP;
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.