text stringlengths 4 6.14k |
|---|
static const char connman_service_introspection[] =
"<node>"
" <interface name=\"net.connman.Service\">"
" <method name=\"GetProperties\">"
" <arg type=\"a{sv}\" direction=\"out\"/>"
" </method>"
" <method name=\"SetProperty\">"
" <arg type=\"s\" direction=\"in\"/>"
" <arg type=\"v\" direction=\"in\"/>"
" </method>"
" <method name=\"ClearProperty\">"
" <arg type=\"s\" direction=\"in\"/>"
" </method>"
" <method name=\"Connect\"/>"
" <method name=\"Disconnect\"/>"
" <method name=\"Remove\"/>"
" <method name=\"MoveBefore\">"
" <arg type=\"o\" direction=\"in\"/>"
" </method>"
" <method name=\"MoveAfter\">"
" <arg type=\"o\" direction=\"in\"/>"
" </method>"
" <method name=\"ResetCounters\"/>"
" <signal name=\"PropertyChanged\">"
" <arg type=\"s\"/>"
" <arg type=\"v\"/>"
" </signal>"
" </interface>"
"</node>"
""
;
|
/*****************************************************************************
* quant.h: h264 encoder library
*****************************************************************************
* Copyright (C) 2005 x264 project
*
* Authors: Christian Heine <sennindemokrit@gmx.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _I386_QUANT_H
#define _I386_QUANT_H 1
void x264_quant_2x2_dc_mmxext( int16_t dct[2][2], int mf, int bias );
void x264_quant_4x4_dc_mmxext( int16_t dct[4][4], int mf, int bias );
void x264_quant_4x4_mmx( int16_t dct[4][4], uint16_t mf[16], uint16_t bias[16] );
void x264_quant_8x8_mmx( int16_t dct[8][8], uint16_t mf[64], uint16_t bias[64] );
void x264_quant_4x4_dc_sse2( int16_t dct[4][4], int mf, int bias );
void x264_quant_4x4_sse2( int16_t dct[4][4], uint16_t mf[16], uint16_t bias[16] );
void x264_quant_8x8_sse2( int16_t dct[8][8], uint16_t mf[64], uint16_t bias[64] );
void x264_quant_4x4_dc_ssse3( int16_t dct[4][4], int mf, int bias );
void x264_quant_4x4_ssse3( int16_t dct[4][4], uint16_t mf[16], uint16_t bias[16] );
void x264_quant_8x8_ssse3( int16_t dct[8][8], uint16_t mf[64], uint16_t bias[64] );
void x264_dequant_4x4_mmx( int16_t dct[4][4], int dequant_mf[6][4][4], int i_qp );
void x264_dequant_8x8_mmx( int16_t dct[8][8], int dequant_mf[6][8][8], int i_qp );
#endif
|
/*
* Copyright (C) 2013 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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.
*/
#include <stdio.h>
#include "imv_policy_manager_usage.h"
/**
* print imv_policy_manager usage info
*/
void usage(void)
{
printf("\
Usage:\n\
imv_policy_manager start|stop\n");
}
|
/* auditd-config.h --
* Copyright 2004-2009 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License 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
*
* Authors:
* Steve Grubb <sgrubb@redhat.com>
*
*/
#ifndef AUDITD_CONFIG_H
#define AUDITD_CONFIG_H
#include "libaudit.h"
#include <grp.h>
#define CONFIG_FILE "/etc/audit/auditd.conf"
#define MEGABYTE 1048576UL
typedef enum { D_FOREGROUND, D_BACKGROUND } daemon_t;
typedef enum { LF_RAW, LF_NOLOG } logging_formats;
typedef enum { FT_NONE, FT_INCREMENTAL, FT_DATA, FT_SYNC } flush_technique;
typedef enum { FA_IGNORE, FA_SYSLOG, FA_EMAIL, FA_EXEC, FA_SUSPEND,
FA_SINGLE, FA_HALT } failure_action_t;
typedef enum { SZ_IGNORE, SZ_SYSLOG, SZ_SUSPEND, SZ_ROTATE,
SZ_KEEP_LOGS } size_action;
typedef enum { QOS_NON_BLOCKING, QOS_BLOCKING } qos_t;
typedef enum { TEST_AUDITD, TEST_SEARCH } log_test_t;
typedef enum { N_NONE, N_HOSTNAME, N_FQD, N_NUMERIC, N_USER } node_t;
struct daemon_conf
{
daemon_t daemonize;
qos_t qos; /* use blocking/non-blocking sockets */
uid_t sender_uid; /* the uid for sender of sighup */
pid_t sender_pid; /* the pid for sender of sighup */
const char *sender_ctx; /* the context for the sender of sighup */
const char *log_file;
logging_formats log_format;
gid_t log_group;
unsigned int priority_boost;
flush_technique flush;
unsigned int freq;
unsigned int num_logs;
const char *dispatcher;
node_t node_name_format;
const char *node_name;
unsigned long max_log_size;
size_action max_log_size_action;
unsigned long space_left;
failure_action_t space_left_action;
const char *space_left_exe;
const char *action_mail_acct;
unsigned long admin_space_left;
failure_action_t admin_space_left_action;
const char *admin_space_left_exe;
failure_action_t disk_full_action;
const char *disk_full_exe;
failure_action_t disk_error_action;
const char *disk_error_exe;
unsigned long tcp_listen_port;
unsigned long tcp_listen_queue;
unsigned long tcp_max_per_addr;
int use_libwrap;
unsigned long tcp_client_min_port;
unsigned long tcp_client_max_port;
unsigned long tcp_client_max_idle;
int enable_krb5;
const char *krb5_principal;
const char *krb5_key_file;
};
void set_allow_links(int allow);
int load_config(struct daemon_conf *config, log_test_t lt);
const char *audit_lookup_format(int fmt);
int create_log_file(const char *val);
int resolve_node(struct daemon_conf *config);
void init_config_manager(void);
#ifdef AUDITD_EVENT_H
int start_config_manager(struct auditd_reply_list *rep);
#endif
void shutdown_config(void);
void free_config(struct daemon_conf *config);
#endif
|
#ifndef __ORG_XMLVM_IPHONE_UITABLEVIEWDELEGATE__
#define __ORG_XMLVM_IPHONE_UITABLEVIEWDELEGATE__
#include "xmlvm.h"
// Preprocessor constants for interfaces:
// Implemented interfaces:
// Super Class:
#include "org_xmlvm_iphone_NSObject.h"
// Circular references:
#ifndef XMLVM_FORWARD_DECL_java_lang_String
#define XMLVM_FORWARD_DECL_java_lang_String
XMLVM_FORWARD_DECL(java_lang_String)
#endif
#ifndef XMLVM_FORWARD_DECL_org_xmlvm_iphone_NSIndexPath
#define XMLVM_FORWARD_DECL_org_xmlvm_iphone_NSIndexPath
XMLVM_FORWARD_DECL(org_xmlvm_iphone_NSIndexPath)
#endif
#ifndef XMLVM_FORWARD_DECL_org_xmlvm_iphone_UITableView
#define XMLVM_FORWARD_DECL_org_xmlvm_iphone_UITableView
XMLVM_FORWARD_DECL(org_xmlvm_iphone_UITableView)
#endif
#ifndef XMLVM_FORWARD_DECL_org_xmlvm_iphone_UITableViewCell
#define XMLVM_FORWARD_DECL_org_xmlvm_iphone_UITableViewCell
XMLVM_FORWARD_DECL(org_xmlvm_iphone_UITableViewCell)
#endif
#ifndef XMLVM_FORWARD_DECL_org_xmlvm_iphone_UIView
#define XMLVM_FORWARD_DECL_org_xmlvm_iphone_UIView
XMLVM_FORWARD_DECL(org_xmlvm_iphone_UIView)
#endif
// Class declarations for org.xmlvm.iphone.UITableViewDelegate
XMLVM_DEFINE_CLASS(org_xmlvm_iphone_UITableViewDelegate, 7, XMLVM_ITABLE_SIZE_org_xmlvm_iphone_UITableViewDelegate)
extern JAVA_OBJECT __CLASS_org_xmlvm_iphone_UITableViewDelegate;
extern JAVA_OBJECT __CLASS_org_xmlvm_iphone_UITableViewDelegate_1ARRAY;
extern JAVA_OBJECT __CLASS_org_xmlvm_iphone_UITableViewDelegate_2ARRAY;
extern JAVA_OBJECT __CLASS_org_xmlvm_iphone_UITableViewDelegate_3ARRAY;
//XMLVM_BEGIN_DECLARATIONS
#import <UIKit/UIKit.h>
#define __ADDITIONAL_INSTANCE_FIELDS_org_xmlvm_iphone_UITableViewDelegate
@interface UITableViewDelegateWrapper : DelegateWrapper <UITableViewDelegate>
{
@public JAVA_OBJECT delegate_;
}
- (id) initWithDelegate: (JAVA_OBJECT) d_;
- (CGFloat) tableView: (UITableView*) tableView heightForRowAtIndexPath: (NSIndexPath*) indexPath;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
@end
//XMLVM_END_DECLARATIONS
#define __INSTANCE_FIELDS_org_xmlvm_iphone_UITableViewDelegate \
__INSTANCE_FIELDS_org_xmlvm_iphone_NSObject; \
struct { \
__ADDITIONAL_INSTANCE_FIELDS_org_xmlvm_iphone_UITableViewDelegate \
} org_xmlvm_iphone_UITableViewDelegate
struct org_xmlvm_iphone_UITableViewDelegate {
__TIB_DEFINITION_org_xmlvm_iphone_UITableViewDelegate* tib;
struct {
__INSTANCE_FIELDS_org_xmlvm_iphone_UITableViewDelegate;
} fields;
};
#ifndef XMLVM_FORWARD_DECL_org_xmlvm_iphone_UITableViewDelegate
#define XMLVM_FORWARD_DECL_org_xmlvm_iphone_UITableViewDelegate
typedef struct org_xmlvm_iphone_UITableViewDelegate org_xmlvm_iphone_UITableViewDelegate;
#endif
#define XMLVM_VTABLE_SIZE_org_xmlvm_iphone_UITableViewDelegate 7
void __INIT_org_xmlvm_iphone_UITableViewDelegate();
void __INIT_IMPL_org_xmlvm_iphone_UITableViewDelegate();
void __DELETE_org_xmlvm_iphone_UITableViewDelegate(void* me, void* client_data);
void __INIT_INSTANCE_MEMBERS_org_xmlvm_iphone_UITableViewDelegate(JAVA_OBJECT me, int derivedClassWillRegisterFinalizer);
JAVA_OBJECT __NEW_org_xmlvm_iphone_UITableViewDelegate();
JAVA_OBJECT __NEW_INSTANCE_org_xmlvm_iphone_UITableViewDelegate();
void org_xmlvm_iphone_UITableViewDelegate___INIT___(JAVA_OBJECT me);
void org_xmlvm_iphone_UITableViewDelegate_willDisplayCellForRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_UITableViewCell_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2, JAVA_OBJECT n3);
void org_xmlvm_iphone_UITableViewDelegate_accessoryButtonTappedForRowWithIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
void org_xmlvm_iphone_UITableViewDelegate_didSelectRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
void org_xmlvm_iphone_UITableViewDelegate_didDeselectRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
void org_xmlvm_iphone_UITableViewDelegate_willBeginEditingRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
void org_xmlvm_iphone_UITableViewDelegate_didEndEditingRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
JAVA_BOOLEAN org_xmlvm_iphone_UITableViewDelegate_shouldIndentWhileEditingRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
JAVA_INT org_xmlvm_iphone_UITableViewDelegate_editingStyleForRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
JAVA_FLOAT org_xmlvm_iphone_UITableViewDelegate_heightForRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
JAVA_OBJECT org_xmlvm_iphone_UITableViewDelegate_viewForHeaderInSection___org_xmlvm_iphone_UITableView_int(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_INT n2);
JAVA_OBJECT org_xmlvm_iphone_UITableViewDelegate_viewForFooterInSection___org_xmlvm_iphone_UITableView_int(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_INT n2);
JAVA_FLOAT org_xmlvm_iphone_UITableViewDelegate_heightForHeaderInSection___org_xmlvm_iphone_UITableView_int(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_INT n2);
JAVA_FLOAT org_xmlvm_iphone_UITableViewDelegate_heightForFooterInSection___org_xmlvm_iphone_UITableView_int(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_INT n2);
JAVA_OBJECT org_xmlvm_iphone_UITableViewDelegate_titleForDeleteConfirmationButtonForRowAtIndexPath___org_xmlvm_iphone_UITableView_org_xmlvm_iphone_NSIndexPath(JAVA_OBJECT me, JAVA_OBJECT n1, JAVA_OBJECT n2);
#endif
|
#ifndef __FRV_AUXVEC_H
#define __FRV_AUXVEC_H
#endif
|
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2017 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef _U2_CREATE_DOCUMENT_FROM_TEXT_DIALOG_CONTROLLER_H_
#define _U2_CREATE_DOCUMENT_FROM_TEXT_DIALOG_CONTROLLER_H_
#include <QDialog>
#include <U2Core/DocumentModel.h>
#include <U2Core/global.h>
#include <U2Gui/DialogUtils.h>
#include "SeqPasterWidgetController.h"
class Ui_CreateDocumentFromTextDialog;
namespace U2 {
class SaveDocumentController;
class U2GUI_EXPORT CreateDocumentFromTextDialogController : public QDialog {
Q_OBJECT
public:
CreateDocumentFromTextDialogController(QWidget* p = NULL);
~CreateDocumentFromTextDialogController();
void accept();
private slots:
void sl_filepathTextChanged();
private:
void addSeqPasterWidget();
QList<DNASequence> prepareSequences() const;
void initSaveController();
SeqPasterWidgetController *w;
SaveDocumentController *saveController;
QString filter;
Ui_CreateDocumentFromTextDialog* ui;
};
}//ns
#endif
|
/*
IGraph library.
Copyright (C) 2021 The igraph development team <igraph@igraph.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <igraph.h>
#include "test_utilities.inc"
int handler(const char* message, igraph_real_t percent, void*data) {
printf("handler, %s, %f, %d\n", message, percent, *(int*)data);
return IGRAPH_SUCCESS;
}
int main() {
igraph_set_progress_handler(handler);
int data = 10;
printf("progress with set progress handler:\n");
IGRAPH_PROGRESS("message", 100.0, &data);
igraph_progress_handler_t *previous = igraph_set_progress_handler(NULL);
printf("\nprogress with no handler:\n");
IGRAPH_PROGRESS("message", 100.0, &data);
igraph_set_progress_handler(previous);
printf("\nprogress with previous handler:\n");
IGRAPH_PROGRESS("message", 100.0, &data);
VERIFY_FINALLY_STACK();
return 0;
}
|
/* miscellaneous BIOS stuff */
#ifndef BIOS_H
#define BIOS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "bios_offsets.hh"
#define DOSEMU_BIOS_SIZE() (bios_f000_end - bios_data_start + 1)
/*
* symbols to access BIOS-data with meaningful names, not just addresses,
* which are only numbers. The names are retranslatios from an old german
* book :-(
*/
#define BIOS_BASE_ADDRESS_COM1 0x400
#define BIOS_BASE_ADDRESS_COM2 0x402
#define BIOS_BASE_ADDRESS_COM3 0x404
#define BIOS_BASE_ADDRESS_COM4 0x406
#define BIOS_ADDRESS_LPT1 0x408
#define BIOS_ADDRESS_LPT2 0x40a
#define BIOS_ADDRESS_LPT3 0x40c
/* 0x40e is reserved */
#define BIOS_CONFIGURATION 0x410
/* 0x412 is reserved */
#define BIOS_MEMORY_SIZE 0x413
/* #define bios_expansion_memory_size (*(unsigned int *) 0x415) */
#define BIOS_KEYBOARD_STATE 0x417
#define BIOS_KEYBOARD_FLAGS1 BIOS_KEYBOARD_STATE
#define BIOS_KEYBOARD_FLAGS2 0x418
#define BIOS_KEYBOARD_TOKEN 0x419
/* used for keyboard input with Alt-Number */
#define BIOS_KEYBOARD_BUFFER_HEAD 0x41a
#define BIOS_KEYBOARD_BUFFER_TAIL 0x41c
#define BIOS_KEYBOARD_BUFFER 0x41e
/* #define bios_keyboard_buffer (*(unsigned int *) 0x41e) */
#define BIOS_DRIVE_ACTIVE 0x43e
#define BIOS_DRIVE_RUNNING 0x43f
#define BIOS_MOTOR_TIMEOUT 0x440
#define BIOS_DISK_STATUS 0x441
#define BIOS_FDC_RESULT_BUFFER 0x442
#define BIOS_VIDEO_MODE 0x449
#define BIOS_SCREEN_COLUMNS 0x44a
#define BIOS_VIDEO_MEMORY_USED 0x44c
#define BIOS_VIDEO_MEMORY_ADDRESS 0x44e
#define set_bios_cursor_x_position(screen, val) \
LOWMEM_WRITE_BYTE(0x450 + 2*(screen), (val))
#define get_bios_cursor_x_position(screen) \
LOWMEM_READ_BYTE(0x450 + 2*(screen))
#define set_bios_cursor_y_position(screen, val) \
LOWMEM_WRITE_BYTE(0x451 + 2*(screen), (val))
#define get_bios_cursor_y_position(screen) \
LOWMEM_READ_BYTE(0x451 + 2*(screen))
#define BIOS_CURSOR_SHAPE 0x460
#define BIOS_CURSOR_LAST_LINE 0x460
#define BIOS_CURSOR_FIRST_LINE 0x461
#define BIOS_CURRENT_SCREEN_PAGE 0x462
#define BIOS_VIDEO_PORT 0x463
#define BIOS_VDU_CONTROL 0x465
#define BIOS_VDU_COLOR_REGISTER 0x466
/* 0x467-0x468 is reserved */
#define BIOS_TIMER 0x46c
#define BIOS_24_HOURS_FLAG 0x470
#define BIOS_KEYBOARD_FLAGS 0x471
#define BIOS_CTRL_ALT_DEL_FLAG 0x472
#define BIOS_HARDDISK_COUNT 0x475
/* 0x474, 0x476, 0x477 is reserved */
#define BIOS_LPT1_TIMEOUT 0x478
#define BIOS_LPT2_TIMEOUT 0x479
#define BIOS_LPT3_TIMEOUT 0x47a
/* 0x47b is reserved */
#define BIOS_COM1_TIMEOUT 0x47c
#define BIOS_COM2_TIMEOUT 0x47d
/* 0x47e is reserved */
/* 0x47f-0x4ff is unknow for me */
#define BIOS_KEYBOARD_BUFFER_START 0x480
#define BIOS_KEYBOARD_BUFFER_END 0x482
#define BIOS_ROWS_ON_SCREEN_MINUS_1 0x484
#define BIOS_FONT_HEIGHT 0x485
#define BIOS_VIDEO_INFO_0 0x487
#define BIOS_VIDEO_INFO_1 0x488
#define BIOS_VIDEO_INFO_2 0x489
#define BIOS_VIDEO_COMBO 0x48a
#define BIOS_KEYBOARD_FLAGS3 0x496
#define BIOS_KEYBOARD_LEDS 0x497
#define BIOS_PRINT_SCREEN_FLAG 0x500
#define BIOS_VIDEO_SAVEPTR 0x4a8
#define BIT(x) (1<<x)
/*
* int 11h config single bit tests
*/
#define CONF_FLOP BIT(0)
#define CONF_MATHCO BIT(1)
#define CONF_MOUSE BIT(2)
#define CONF_DMA BIT(8)
#define CONF_GAME BIT(12)
/*
* don't use CONF_NSER with num > 4, CONF_NLPT with num > 3, CONF_NFLOP
* with num > 4
*/
#define CONF_NSER(c,num) {c&=~(BIT(9)|BIT(10)|BIT(11)); c|=(num<<9);}
#define CONF_NLPT(c,num) {c&=~(BIT(14)|BIT(15)); c|=(num<<14);}
#define CONF_NFLOP(c,num) {c&=~(CONF_FLOP|BIT(6)|BIT(7)); \
if (num) c|=((num-1)<<6)|CONF_FLOP;}
extern unsigned int bios_configuration; // The virtual
// BIOS-configuration
void bios_setup_init(void);
#define HLT_OFF(offs) (offs-DPMI_OFF)
void post_hook(void);
#ifdef __cplusplus
};
#endif
#endif /* BIOS_H */
|
/* TA3D, a remake of Total Annihilation
Copyright (C) 2005 Roland BROCHARD
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA*/
/*-----------------------------------------------------------------------------\
| intro.h |
| Ce module contient les fonctions de l'introduction de TA3D |
| |
\-----------------------------------------------------------------------------*/
#ifndef __TA3D_INTO_H__
# define __TA3D_INTO_H__
void loading(const float percent, const String& msg);
#endif // __TA3D_INTO_H__
|
/* Inspect a disk image and display operating systems it may contain. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <guestfs.h>
static int
compare_keys_len (const void *p1, const void *p2)
{
const char *key1 = * (char * const *) p1;
const char *key2 = * (char * const *) p2;
return strlen (key1) - strlen (key2);
}
static size_t
count_strings (char *const *argv)
{
size_t c;
for (c = 0; argv[c]; ++c)
;
return c;
}
int
main (int argc, char *argv[])
{
guestfs_h *g;
const char *disk;
char **roots, *root, *str, **mountpoints, **lines;
size_t i, j;
if (argc != 2) {
fprintf (stderr, "usage: inspect_vm disk.img\n");
exit (EXIT_FAILURE);
}
disk = argv[1];
g = guestfs_create ();
if (g == NULL) {
perror ("failed to create libguestfs handle");
exit (EXIT_FAILURE);
}
/* Attach the disk image read-only to libguestfs. */
if (guestfs_add_drive_opts (g, disk,
/* GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", */
GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,
-1) /* this marks end of optional arguments */
== -1)
exit (EXIT_FAILURE);
/* Run the libguestfs back-end. */
if (guestfs_launch (g) == -1)
exit (EXIT_FAILURE);
/* Ask libguestfs to inspect for operating systems. */
roots = guestfs_inspect_os (g);
if (roots == NULL)
exit (EXIT_FAILURE);
if (roots[0] == NULL) {
fprintf (stderr, "inspect_vm: no operating systems found\n");
exit (EXIT_FAILURE);
}
for (j = 0; roots[j] != NULL; ++j) {
root = roots[j];
printf ("Root device: %s\n", root);
/* Print basic information about the operating system. */
str = guestfs_inspect_get_product_name (g, root);
if (str)
printf (" Product name: %s\n", str);
free (str);
printf (" Version: %d.%d\n",
guestfs_inspect_get_major_version (g, root),
guestfs_inspect_get_minor_version (g, root));
str = guestfs_inspect_get_type (g, root);
if (str)
printf (" Type: %s\n", str);
free (str);
str = guestfs_inspect_get_distro (g, root);
if (str)
printf (" Distro: %s\n", str);
free (str);
/* Mount up the disks, like guestfish -i.
*
* Sort keys by length, shortest first, so that we end up
* mounting the filesystems in the correct order.
*/
mountpoints = guestfs_inspect_get_mountpoints (g, root);
if (mountpoints == NULL)
exit (EXIT_FAILURE);
qsort (mountpoints, count_strings (mountpoints) / 2, 2 * sizeof (char *),
compare_keys_len);
for (i = 0; mountpoints[i] != NULL; i += 2) {
/* Ignore failures from this call, since bogus entries can
* appear in the guest's /etc/fstab.
*/
guestfs_mount_ro (g, mountpoints[i+1], mountpoints[i]);
free (mountpoints[i]);
free (mountpoints[i+1]);
}
free (mountpoints);
/* If /etc/issue.net file exists, print up to 3 lines. */
if (guestfs_is_file (g, "/etc/issue.net") > 0) {
printf ("--- /etc/issue.net ---\n");
lines = guestfs_head_n (g, 3, "/etc/issue.net");
if (lines == NULL)
exit (EXIT_FAILURE);
for (i = 0; lines[i] != NULL; ++i) {
printf ("%s\n", lines[i]);
free (lines[i]);
}
free (lines);
}
/* Unmount everything. */
if (guestfs_umount_all (g) == -1)
exit (EXIT_FAILURE);
free (root);
}
free (roots);
guestfs_close (g);
exit (EXIT_SUCCESS);
}
|
/* Copyright (C) 1994, 1995 Aladdin Enterprises. All rights reserved.
This file is part of GNU Ghostscript.
GNU Ghostscript is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to
anyone for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing. Refer to
the GNU General Public License for full details.
Everyone is granted permission to copy, modify and redistribute GNU
Ghostscript, but only under the conditions described in the GNU General
Public License. A copy of this license is supposed to have been given to
you along with GNU Ghostscript so you can know your rights and
responsibilities. It should be in a file named COPYING. Among other
things, the copyright notice and this notice must be preserved on all
copies.
Aladdin Enterprises is not affiliated with the Free Software Foundation or
the GNU Project. GNU Ghostscript, as distributed by Aladdin Enterprises,
does not depend on any other GNU software.
*/
/* gxdither.h */
/* Interface to gxdither.c */
#ifndef gx_device_halftone_DEFINED
# define gx_device_halftone_DEFINED
typedef struct gx_device_halftone_s gx_device_halftone;
#endif
/* Render a gray, possibly by halftoning. */
/* Return 0 if complete, 1 if caller must do gx_color_load, <0 on error. */
int gx_render_device_gray(P6(frac gray, gx_color_value alpha,
gx_device_color *pdevc, gx_device *dev,
const gx_device_halftone *dev_ht,
const gs_int_point *ht_phase));
#define gx_render_gray(gray, pdevc, pgs)\
gx_render_device_gray(gray, pgs->alpha, pdevc, pgs->device, pgs->dev_ht,\
&pgs->ht_phase)
/* Render a color, possibly by halftoning. */
/* Return as for gx_render_[device_]gray. */
int gx_render_device_color(P10(frac red, frac green, frac blue, frac white,
bool cmyk, gx_color_value alpha,
gx_device_color *pdevc, gx_device *dev,
const gx_device_halftone *pdht,
const gs_int_point *ht_phase));
#define gx_render_color(r, g, b, w, cmyk, pdevc, pgs)\
gx_render_device_color(r, g, b, w, cmyk, pgs->alpha,\
pdevc, pgs->device, pgs->dev_ht, &pgs->ht_phase)
#define gx_render_rgb(r, g, b, pdevc, pgs)\
gx_render_color(r, g, b, frac_0, false, pdevc, pgs)
#define gx_render_cmyk(c, m, y, k, pdevc, pgs)\
gx_render_color(c, m, y, k, true, pdevc, pgs)
|
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "output_api.h"
#include "fd_util.h"
#include <glib.h>
#include <sys/audio.h>
#include <sys/stropts.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "solaris_output"
struct solaris_output {
/* configuration */
const char *device;
int fd;
};
/**
* The quark used for GError.domain.
*/
static inline GQuark
solaris_output_quark(void)
{
return g_quark_from_static_string("solaris_output");
}
static bool
solaris_output_test_default_device(void)
{
struct stat st;
return stat("/dev/audio", &st) == 0 && S_ISCHR(st.st_mode) &&
access("/dev/audio", W_OK) == 0;
}
static void *
solaris_output_init(G_GNUC_UNUSED const struct audio_format *audio_format,
const struct config_param *param,
G_GNUC_UNUSED GError **error)
{
struct solaris_output *so = g_new(struct solaris_output, 1);
so->device = config_get_block_string(param, "device", "/dev/audio");
return so;
}
static void
solaris_output_finish(void *data)
{
struct solaris_output *so = data;
g_free(so);
}
static bool
solaris_output_open(void *data, struct audio_format *audio_format,
GError **error)
{
struct solaris_output *so = data;
struct audio_info info;
int ret, flags;
/* support only 16 bit mono/stereo for now; nothing else has
been tested */
audio_format->format = SAMPLE_FORMAT_S16;
/* open the device in non-blocking mode */
so->fd = open_cloexec(so->device, O_WRONLY|O_NONBLOCK, 0);
if (so->fd < 0) {
g_set_error(error, solaris_output_quark(), errno,
"Failed to open %s: %s",
so->device, g_strerror(errno));
return false;
}
/* restore blocking mode */
flags = fcntl(so->fd, F_GETFL);
if (flags > 0 && (flags & O_NONBLOCK) != 0)
fcntl(so->fd, F_SETFL, flags & ~O_NONBLOCK);
/* configure the audio device */
ret = ioctl(so->fd, AUDIO_GETINFO, &info);
if (ret < 0) {
g_set_error(error, solaris_output_quark(), errno,
"AUDIO_GETINFO failed: %s", g_strerror(errno));
close(so->fd);
return false;
}
info.play.sample_rate = audio_format->sample_rate;
info.play.channels = audio_format->channels;
info.play.precision = 16;
info.play.encoding = AUDIO_ENCODING_LINEAR;
ret = ioctl(so->fd, AUDIO_SETINFO, &info);
if (ret < 0) {
g_set_error(error, solaris_output_quark(), errno,
"AUDIO_SETINFO failed: %s", g_strerror(errno));
close(so->fd);
return false;
}
return true;
}
static void
solaris_output_close(void *data)
{
struct solaris_output *so = data;
close(so->fd);
}
static size_t
solaris_output_play(void *data, const void *chunk, size_t size, GError **error)
{
struct solaris_output *so = data;
ssize_t nbytes;
nbytes = write(so->fd, chunk, size);
if (nbytes <= 0) {
g_set_error(error, solaris_output_quark(), errno,
"Write failed: %s", g_strerror(errno));
return 0;
}
return nbytes;
}
static void
solaris_output_cancel(void *data)
{
struct solaris_output *so = data;
ioctl(so->fd, I_FLUSH);
}
const struct audio_output_plugin solaris_output_plugin = {
.name = "solaris",
.test_default_device = solaris_output_test_default_device,
.init = solaris_output_init,
.finish = solaris_output_finish,
.open = solaris_output_open,
.close = solaris_output_close,
.play = solaris_output_play,
.cancel = solaris_output_cancel,
};
|
// CRTSIS.H
// Copyright (c) 1997-1999 Symbian Ltd. All rights reserved.
//
// Handles creation of a SIS file
//
#ifndef __CRTSIS_H_
#define __CRTSIS_H_
// ===========================================================================
// INCLUDES
// ===========================================================================
#include <instform.h>
#include "parsepkg.h"
//#include <stdint.h>
// ===========================================================================
// DEFINES
// ===========================================================================
// ===========================================================================
// CLASS DEFINITIONS
// ===========================================================================
class CSISWriter
// Holds SIS file info, as generated by the parser and builds the output SIS file.
// All strings are held internally by this class as UNICODE (wide) strings.
{
public:
CSISWriter();
void Release(); // Destroy contained objects and free memory
void WriteSIS(LPCWSTR pszTargetFile, BOOL fIsStub = FALSE); // Construct the output SIS file
void AddLanguageNode(LANGNODE *pLNode);
void AddPkgLineNode(PKGLINENODE *pPkgNode);
void AddDependencyNode(DEPENDNODE *pNode);
void AddPlatformDependencyNode(DEPENDNODE *pNode);
void AddSignatureNode(SIGNATURENODE *pSig);
void AddCapabilityNode(CAPABILITYNODE *pNode);
void AddLangStringNode(LANGSTRINGNODE *pLSNode);
void AddLocalizedVendorNode(LANGSTRINGNODE *pLSNode);
void AddVendorNode(LANGSTRINGNODE *pLSNode);
void AddLogo(LOGO *pLSNode);
void SetCmdPassword(LPCWSTR pszCmdPassword);
void SetObserver(const MParserObserver *pObserver) { m_pObserver = pObserver; }
void SetVersionInfo(DWORD dwUID, WORD wMajor, WORD wMinor, DWORD dwBuild, TSISType wType, WORD wFlags);
void SetLangDependFileDestinations(LPCWSTR pszDest, LPCWSTR pszMimeType, DWORD dwType, DWORD dwOptions);
void SetLangDependCompDestinations(DWORD dwUid);
BOOL GetCmdPassword(LPWSTR pszCmdPassword) const;
const MParserObserver* GetObserver() const { return m_pObserver; };
const LANGSTRINGNODE* GetLangStringBase() const { return m_pLangStringBase; }
const LANGSTRINGNODE* GetLocalizedVendorBase() const { return m_pLocalizedVendorBase; }
const LANGSTRINGNODE* GetVendorName() const { return m_pVendorName; }
const LOGO* GetLogoBase() const { return m_pLogoBase; }
const LANGNODE* GetLanguageBase() const { return m_pLangBase; }
const PKGLINENODE* GetPkgLineBase() const { return m_pPkgLineBase; }
const DEPENDNODE* GetDependencyBase() const { return m_pDependBase; }
const DEPENDNODE* GetPlatformDependencyBase() const { return m_pPlatformDependBase; }
const SIGNATURENODE* GetSignatureBase() const { return m_pSignatureBase;}
const CAPABILITYNODE* GetCapabilityBase() const { return m_pCapabilityBase; }
DWORD GetUID() const { return m_dwUID; }
TSISType GetType() const { return m_wType; }
WORD GetFlags() const { return m_wFlags; }
WORD GetNoLanguages() const { return m_wNumLangs; }
void QueryVersionInfo (WORD* wMajor, WORD* wMinor, DWORD* dwBuild) const;
BOOL AreLangStringInit();
BOOL AreLocalizedVendorNamesInit();
BOOL IsVendorNameInit();
void SetTimestamp(DWORD dwYear, DWORD dwMonth, DWORD dwDay, DWORD dwHours, DWORD dwMinutes, DWORD dwSeconds);
BOOL GetTimestamp(DWORD* dwYear, DWORD* dwMonth, DWORD* dwDay, DWORD* dwHours, DWORD* dwMinutes, DWORD* dwSeconds) const;
private:
void ReleaseCondExpr(PKGLINECONDITION* expr); // Destroy condition expr
private:
// Installation data
DWORD m_dwUID; // Installee app's UID
WORD m_wMajor; // Version info
WORD m_wMinor; // " "
DWORD m_dwBuild; // " "
TSISType m_wType; // SIS type (app, system, patch,...)
WORD m_wFlags; // Installation flags (Unicode, redist ++)
WORD m_wNumLangs; // How many languages do we speak ?
LANGSTRINGNODE* m_pLangStringBase; // Language strings - the app names in N languages
LANGSTRINGNODE* m_pLocalizedVendorBase; // Localized vendor names
LANGSTRINGNODE* m_pVendorName; // Vendor name
LOGO* m_pLogoBase; // Vendor name
LANGNODE* m_pLangBase; // Language data - which langauges are supported
PKGLINENODE* m_pPkgLineBase; // Linked list of PKG line nodes
DEPENDNODE* m_pDependBase; // Dependency data
DEPENDNODE* m_pPlatformDependBase; // Dependency data
SIGNATURENODE* m_pSignatureBase; // Digital signature data
CAPABILITYNODE* m_pCapabilityBase; // Capability data
BOOL m_bCmdPassword; // Commnand Line Password Flag
WCHAR m_pszCmdPassword[MAX_PATH]; // Command Line Decryption Password
BOOL m_bSetTimestamp;
DWORD m_dwYear, m_dwMonth, m_dwDay, m_dwHours, m_dwMinutes, m_dwSeconds;
const MParserObserver *m_pObserver; // Observer object
};
#endif // __CRTSIS_H_
|
/* This file is part of the KDE project
Copyright 2007, 2009 Stefan Nikolaus <stefan.nikolaus@kdemail.net>
Copyright 2003 Philipp Müller <philipp.mueller@gmx.de>
Copyright 1998, 1999 Torben Weis <weis@kde.org>,
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSPREAD_SHEET_PRINT
#define KSPREAD_SHEET_PRINT
#include <QRectF>
#include "kspread_export.h"
class QPainter;
namespace KSpread
{
class HeaderFooter;
class PrintSettings;
class Sheet;
/**
* \class SheetPrint
* Manages the layout of pages for printing.
* Supports next to the obligatory page dimensions
* zooming, page limits and column/row repetitions.
* \ingroup Printing
*/
class KSPREAD_EXPORT SheetPrint
{
public:
explicit SheetPrint(Sheet * sheet = 0);
SheetPrint(const SheetPrint &other);
~SheetPrint();
/**
* \return the print settings
*/
PrintSettings *settings() const;
/**
* Sets the print \p settings.
* \param force Forces a relayout of the pages, if \c true.
*/
void setSettings(const PrintSettings &settings, bool force = false);
/**
* \return the header & footer object
*/
HeaderFooter *headerFooter() const;
/**
* Tests whether @p column is the first column of a new page. In this
* case the left border of this column may be drawn highlighted to show
* that this is a page break.
*/
bool isColumnOnNewPage(int column);
/**
* Tests whether \p row is the first row of a new page. In this
* case the top border of this row may be drawn highlighted to show
* that this is a page break.
*/
bool isRowOnNewPage(int row);
/**
* Updates the page parameters in horizontal direction (for columns)
* starting at \p column.
* Actually, only removes them and they get calculated on demand.
* Triggers an update of the repeated columns' pre-calculated width,
* if \p column is not beyond the repetition.
*/
void updateHorizontalPageParameters(int column);
/**
* Updates the page parameters in vertical direction (for rows)
* starting at \p row.
* Actually, only removes them and they get calculated on demand.
* Triggers an update of the repeated rows' pre-calculated height,
* if \p row is not beyond the repetition.
*/
void updateVerticalPageParameters(int row);
/**
* Updates the print range, according to the inserted columns
* \param col the column index
* \param nbCol number of inserted columns
*/
void insertColumn(int col, int nbCol);
/**
* Updates the print range, according to the removed columns
* \param col the column index
* \param nbCol number of removed columns
*/
void removeColumn(int col, int nbCol);
/**
* Updates the print range, according to the inserted rows
* \param row the row index
* \param nbRow number of inserted rows
*/
void insertRow(int row, int nbRow);
/**
* Updates the print range, according to the removed rows
* \param row the row index
* \param nbRow number of removed rows
*/
void removeRow(int row, int nbRow);
/**
* The number of pages.
*/
int pageCount() const;
/**
* Return the cell range of the requested page.
* \param page the page number
* \return the page's cell range
*/
QRect cellRange(int page) const;
/**
* Return the document area of the requested page.
* \param page the page number
* \return the page's document area
*/
QRectF documentArea(int page) const;
/**
* Assignment operator.
*/
void operator=(const SheetPrint &);
private:
class Private;
Private *const d;
};
} // namespace KSpread
#endif // KSPREAD_SHEET_PRINT
|
/*
* QEMU model of the Xilinx ZynqMP Real Time Clock (RTC).
*
* Copyright (c) 2017 Xilinx Inc.
*
* Written-by: Alistair Francis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef HW_RTC_XLNX_ZYNQMP_H
#define HW_RTC_XLNX_ZYNQMP_H
#include "hw/register.h"
#include "hw/sysbus.h"
#include "qom/object.h"
#define TYPE_XLNX_ZYNQMP_RTC "xlnx-zynmp.rtc"
typedef struct XlnxZynqMPRTC XlnxZynqMPRTC;
DECLARE_INSTANCE_CHECKER(XlnxZynqMPRTC, XLNX_ZYNQMP_RTC,
TYPE_XLNX_ZYNQMP_RTC)
REG32(SET_TIME_WRITE, 0x0)
REG32(SET_TIME_READ, 0x4)
REG32(CALIB_WRITE, 0x8)
FIELD(CALIB_WRITE, FRACTION_EN, 20, 1)
FIELD(CALIB_WRITE, FRACTION_DATA, 16, 4)
FIELD(CALIB_WRITE, MAX_TICK, 0, 16)
REG32(CALIB_READ, 0xc)
FIELD(CALIB_READ, FRACTION_EN, 20, 1)
FIELD(CALIB_READ, FRACTION_DATA, 16, 4)
FIELD(CALIB_READ, MAX_TICK, 0, 16)
REG32(CURRENT_TIME, 0x10)
REG32(CURRENT_TICK, 0x14)
FIELD(CURRENT_TICK, VALUE, 0, 16)
REG32(ALARM, 0x18)
REG32(RTC_INT_STATUS, 0x20)
FIELD(RTC_INT_STATUS, ALARM, 1, 1)
FIELD(RTC_INT_STATUS, SECONDS, 0, 1)
REG32(RTC_INT_MASK, 0x24)
FIELD(RTC_INT_MASK, ALARM, 1, 1)
FIELD(RTC_INT_MASK, SECONDS, 0, 1)
REG32(RTC_INT_EN, 0x28)
FIELD(RTC_INT_EN, ALARM, 1, 1)
FIELD(RTC_INT_EN, SECONDS, 0, 1)
REG32(RTC_INT_DIS, 0x2c)
FIELD(RTC_INT_DIS, ALARM, 1, 1)
FIELD(RTC_INT_DIS, SECONDS, 0, 1)
REG32(ADDR_ERROR, 0x30)
FIELD(ADDR_ERROR, STATUS, 0, 1)
REG32(ADDR_ERROR_INT_MASK, 0x34)
FIELD(ADDR_ERROR_INT_MASK, MASK, 0, 1)
REG32(ADDR_ERROR_INT_EN, 0x38)
FIELD(ADDR_ERROR_INT_EN, MASK, 0, 1)
REG32(ADDR_ERROR_INT_DIS, 0x3c)
FIELD(ADDR_ERROR_INT_DIS, MASK, 0, 1)
REG32(CONTROL, 0x40)
FIELD(CONTROL, BATTERY_DISABLE, 31, 1)
FIELD(CONTROL, OSC_CNTRL, 24, 4)
FIELD(CONTROL, SLVERR_ENABLE, 0, 1)
REG32(SAFETY_CHK, 0x50)
#define XLNX_ZYNQMP_RTC_R_MAX (R_SAFETY_CHK + 1)
struct XlnxZynqMPRTC {
SysBusDevice parent_obj;
MemoryRegion iomem;
qemu_irq irq_rtc_int;
qemu_irq irq_addr_error_int;
uint32_t tick_offset;
uint32_t regs[XLNX_ZYNQMP_RTC_R_MAX];
RegisterInfo regs_info[XLNX_ZYNQMP_RTC_R_MAX];
};
#endif
|
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* gc0312yuv_Sensor.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* Image sensor driver declare and macro define in the header file.
*
* Author:
* -------
* Mormo
*
*=============================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* $Log$
* 2011/10/25 Firsty Released By Mormo;
*
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*=============================================================
******************************************************************************/
#ifndef __GC0312_SENSOR_H
#define __GC0312_SENSOR_H
#define VGA_PERIOD_PIXEL_NUMS 694
#define VGA_PERIOD_LINE_NUMS 488
#define IMAGE_SENSOR_VGA_GRAB_PIXELS 0
#define IMAGE_SENSOR_VGA_GRAB_LINES 1
#define IMAGE_SENSOR_VGA_WIDTH (640)
#define IMAGE_SENSOR_VGA_HEIGHT (480)
#define IMAGE_SENSOR_PV_WIDTH (IMAGE_SENSOR_VGA_WIDTH - 8)
#define IMAGE_SENSOR_PV_HEIGHT (IMAGE_SENSOR_VGA_HEIGHT - 6)
#define IMAGE_SENSOR_FULL_WIDTH (IMAGE_SENSOR_VGA_WIDTH - 8)
#define IMAGE_SENSOR_FULL_HEIGHT (IMAGE_SENSOR_VGA_HEIGHT - 6)
#define GC0312_WRITE_ID 0x42
#define GC0312_READ_ID 0x43
// GC0312 SENSOR Chip ID: 0xb310
typedef enum
{
GC0312_RGB_Gamma_m1 = 0,
GC0312_RGB_Gamma_m2,
GC0312_RGB_Gamma_m3,
GC0312_RGB_Gamma_m4,
GC0312_RGB_Gamma_m5,
GC0312_RGB_Gamma_m6,
GC0312_RGB_Gamma_night
}GC0312_GAMMA_TAG;
UINT32 GC0312Open(void);
UINT32 GC0312Control(MSDK_SCENARIO_ID_ENUM ScenarioId, MSDK_SENSOR_EXPOSURE_WINDOW_STRUCT *pImageWindow, MSDK_SENSOR_CONFIG_STRUCT *pSensorConfigData);
UINT32 GC0312FeatureControl(MSDK_SENSOR_FEATURE_ENUM FeatureId, UINT8 *pFeaturePara,UINT32 *pFeatureParaLen);
UINT32 GC0312GetInfo(MSDK_SCENARIO_ID_ENUM ScenarioId, MSDK_SENSOR_INFO_STRUCT *pSensorInfo, MSDK_SENSOR_CONFIG_STRUCT *pSensorConfigData);
UINT32 GC0312GetResolution(MSDK_SENSOR_RESOLUTION_INFO_STRUCT *pSensorResolution);
UINT32 GC0312Close(void);
#endif /* __SENSOR_H */
|
/****************************************************************************
*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2019 by Inria. All rights reserved.
*
* This software 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.
* See the file LICENSE.txt at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using ViSP with software that can not be combined with the GNU
* GPL, please contact Inria about acquiring a ViSP Professional
* Edition License.
*
* See http://visp.inria.fr for more information.
*
* This software was developed at:
* Inria Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
*
* If you have questions regarding the use of this file, please contact
* Inria at visp@inria.fr
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Description:
* Le module "vwstack.h" contient les macros, les types et
* les specifications des procedures de gestion de la pile
* des points de vue (VieW STACK).
*
* Authors:
* Jean-Luc CORRE
*
*****************************************************************************/
#ifndef vpVwstack_H
#define vpVwstack_H
#include <visp3/core/vpConfig.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "vpView.h"
void fprintf_vwstack(FILE *fp, char *argv);
View_parameters *get_vwstack(void);
void load_vwstack(View_parameters *vp);
void pop_vwstack(void);
void push_vwstack(void);
void swap_vwstack(void);
void add_vwstack(const char *path, ...);
#endif
#endif
|
/*
* arch/arm/include/asm/thread_info.h
*
* Copyright (C) 2002 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __ASM_ARM_THREAD_INFO_H
#define __ASM_ARM_THREAD_INFO_H
#ifdef __KERNEL__
#include <linux/compiler.h>
#include <asm/fpstate.h>
#define THREAD_SIZE_ORDER 1
#define THREAD_SIZE 8192
#define THREAD_START_SP (THREAD_SIZE - 8)
#ifndef __ASSEMBLY__
struct task_struct;
struct exec_domain;
#include <asm/types.h>
#include <asm/domain.h>
typedef unsigned long mm_segment_t;
struct cpu_context_save {
__u32 r4;
__u32 r5;
__u32 r6;
__u32 r7;
__u32 r8;
__u32 r9;
__u32 sl;
__u32 fp;
__u32 sp;
__u32 pc;
__u32 extra[2]; /* Xscale 'acc' register, etc */
};
/*
* low level task data that entry.S needs immediate access to.
* __switch_to() assumes cpu_context follows immediately after cpu_domain.
*/
struct thread_info {
unsigned long flags; /* low level flags */
int preempt_count; /* 0 => preemptable, <0 => bug */
mm_segment_t addr_limit; /* address limit */
struct task_struct *task; /* main task structure */
struct exec_domain *exec_domain; /* execution domain */
__u32 cpu; /* cpu */
__u32 cpu_domain; /* cpu domain */
struct cpu_context_save cpu_context; /* cpu context */
__u32 syscall; /* syscall number */
__u8 used_cp[16]; /* thread used copro */
unsigned long tp_value;
struct crunch_state crunchstate;
union fp_state fpstate __attribute__((aligned(8)));
union vfp_state vfpstate;
#ifdef CONFIG_ARM_THUMBEE
unsigned long thumbee_state; /* ThumbEE Handler Base register */
#endif
struct restart_block restart_block;
};
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
.exec_domain = &default_exec_domain, \
.flags = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
.addr_limit = KERNEL_DS, \
.cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
domain_val(DOMAIN_IO, DOMAIN_CLIENT), \
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
}
#define init_thread_info (init_thread_union.thread_info)
#define init_stack (init_thread_union.stack)
/*
* how to get the thread information struct from C
*/
static inline struct thread_info *current_thread_info(void) __attribute_const__;
static inline struct thread_info *current_thread_info(void)
{
register unsigned long sp asm ("sp");
return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
}
#define thread_saved_pc(tsk) \
((unsigned long)(task_thread_info(tsk)->cpu_context.pc))
#define thread_saved_sp(tsk) \
((unsigned long)(task_thread_info(tsk)->cpu_context.sp))
#define thread_saved_fp(tsk) \
((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
extern void crunch_task_disable(struct thread_info *);
extern void crunch_task_copy(struct thread_info *, void *);
extern void crunch_task_restore(struct thread_info *, void *);
extern void crunch_task_release(struct thread_info *);
extern void iwmmxt_task_disable(struct thread_info *);
extern void iwmmxt_task_copy(struct thread_info *, void *);
extern void iwmmxt_task_restore(struct thread_info *, void *);
extern void iwmmxt_task_release(struct thread_info *);
extern void iwmmxt_task_switch(struct thread_info *);
extern void vfp_sync_hwstate(struct thread_info *);
extern void vfp_flush_hwstate(struct thread_info *);
#endif
/*
* We use bit 30 of the preempt_count to indicate that kernel
* preemption is occurring. See <asm/hardirq.h>.
*/
#define PREEMPT_ACTIVE 0x40000000
/*
* thread information flags:
* TIF_SYSCALL_TRACE - syscall trace active
* TIF_SIGPENDING - signal pending
* TIF_NEED_RESCHED - rescheduling necessary
* TIF_NOTIFY_RESUME - callback before returning to user
* TIF_USEDFPU - FPU was used by this task this quantum (SMP)
* TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
*/
#define TIF_SIGPENDING 0
#define TIF_NEED_RESCHED 1
#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
#define TIF_SYSCALL_TRACE 8
#define TIF_POLLING_NRFLAG 16
#define TIF_USING_IWMMXT 17
#define TIF_MEMDIE 18 /* is terminating due to OOM killer */
#define TIF_FREEZE 19
#define TIF_RESTORE_SIGMASK 20
#define TIF_SECCOMP 21
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
#define _TIF_FREEZE (1 << TIF_FREEZE)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
/*
* Change these and you break ASM code in entry-common.S
*/
#define _TIF_WORK_MASK 0x000000ff
#endif /* __KERNEL__ */
#endif /* __ASM_ARM_THREAD_INFO_H */
|
/*
Copyright (C) 2011 Grame - Lyon
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted.
*/
#include "faust/gui/OSCControler.h"
#include "faust/gui/GUI.h"
#include <vector>
/******************************************************************************
*******************************************************************************
OSC (Open Sound Control) USER INTERFACE
*******************************************************************************
*******************************************************************************/
/*
Note about the OSC addresses and the Faust UI names:
----------------------------------------------------
There are potential conflicts between the Faust UI objects naming scheme and
the OSC address space. An OSC symbolic names is an ASCII string consisting of
printable characters other than the following:
space
# number sign
* asterisk
, comma
/ forward
? question mark
[ open bracket
] close bracket
{ open curly brace
} close curly brace
a simple solution to address the problem consists in replacing
space or tabulation with '_' (underscore)
all the other osc excluded characters with '-' (hyphen)
This solution is implemented in the proposed OSC UI;
*/
using namespace std;
//class oscfaust::OSCIO;
class OSCUI : public GUI
{
oscfaust::OSCControler* fCtrl;
vector<const char*> fAlias;
const char* tr(const char* label) const;
// add all accumulated alias
void addalias(FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max)
{
for (unsigned int i=0; i<fAlias.size(); i++) {
fCtrl->addfullpathnode(fAlias[i], zone, (FAUSTFLOAT)0, (FAUSTFLOAT)1, init, min, max);
}
fAlias.clear();
}
public:
OSCUI(char* /*applicationname*/, int argc, char *argv[], oscfaust::OSCIO* io=0) : GUI()
{
fCtrl = new oscfaust::OSCControler(argc, argv, io);
// fCtrl->opengroup(applicationname);
}
virtual ~OSCUI() { delete fCtrl; }
// -- widget's layouts
virtual void openTabBox(const char* label) { fCtrl->opengroup( tr(label)); }
virtual void openHorizontalBox(const char* label) { fCtrl->opengroup( tr(label)); }
virtual void openVerticalBox(const char* label) { fCtrl->opengroup( tr(label)); }
virtual void closeBox() { fCtrl->closegroup(); }
// -- active widgets
virtual void addButton(const char* label, FAUSTFLOAT* zone) { addalias(zone, 0, 0, 1); fCtrl->addnode( tr(label), zone, (FAUSTFLOAT)0, (FAUSTFLOAT)0, (FAUSTFLOAT)1); }
virtual void addCheckButton(const char* label, FAUSTFLOAT* zone) { addalias(zone, 0, 0, 1); fCtrl->addnode( tr(label), zone, (FAUSTFLOAT)0, (FAUSTFLOAT)0, (FAUSTFLOAT)1); }
virtual void addVerticalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT /*step*/) { addalias(zone, init, min, max); fCtrl->addnode( tr(label), zone, init, min, max); }
virtual void addHorizontalSlider(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT /*step*/) { addalias(zone, init, min, max); fCtrl->addnode( tr(label), zone, init, min, max); }
virtual void addNumEntry(const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT /*step*/) { addalias(zone, init, min, max); fCtrl->addnode( tr(label), zone, init, min, max); }
// -- passive widgets
virtual void addHorizontalBargraph(const char* /*label*/, FAUSTFLOAT* /*zone*/, FAUSTFLOAT /*min*/, FAUSTFLOAT /*max*/) {}
virtual void addVerticalBargraph(const char* /*label*/, FAUSTFLOAT* /*zone*/, FAUSTFLOAT /*min*/, FAUSTFLOAT /*max*/) {}
// -- metadata declarations
virtual void declare(FAUSTFLOAT* , const char* key , const char* alias)
{
if (strcasecmp(key,"OSC")==0) fAlias.push_back(alias);
}
virtual void show() {}
void run() { fCtrl->run(); }
const char* getRootName() { return fCtrl->getRootName(); }
};
const char* OSCUI::tr(const char* label) const
{
static char buffer[1024];
char * ptr = buffer; int n=1;
while (*label && (n++ < 1024)) {
switch (*label) {
case ' ': case ' ':
*ptr++ = '_';
break;
case '#': case '*': case ',': case '/': case '?':
case '[': case ']': case '{': case '}':
*ptr++ = '_';
break;
default:
*ptr++ = *label;
}
label++;
}
*ptr = 0;
return buffer;
}
|
//
// iTermStatusBarBatteryComponent.h
// iTerm2SharedARC
//
// Created by George Nachman on 5/7/19.
//
#import "iTermStatusBarSparklinesComponent.h"
NS_ASSUME_NONNULL_BEGIN
@interface iTermStatusBarBatteryComponent : iTermStatusBarSparklinesComponent
@end
NS_ASSUME_NONNULL_END
|
/*
* Flash-based transactional key-value store
*
* Copyright (C) 2010 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.
*
*/
#ifndef _LINUX_FLASH_TS_H_
#define _LINUX_FLASH_TS_H_
#include <asm/ioctl.h>
#include <asm/types.h>
#define FLASH_TS_MAX_KEY_SIZE 64
#define FLASH_TS_MAX_VAL_SIZE 2048
struct flash_ts_io_req {
char key[FLASH_TS_MAX_KEY_SIZE];
char val[FLASH_TS_MAX_VAL_SIZE];
};
#define FLASH_TS_IO_MAGIC 0xFE
#define FLASH_TS_IO_SET _IOW(FLASH_TS_IO_MAGIC, 0, struct flash_ts_io_req)
#define FLASH_TS_IO_GET _IOWR(FLASH_TS_IO_MAGIC, 1, struct flash_ts_io_req)
#ifdef __KERNEL__
#include <linux/errno.h>
#ifdef CONFIG_FLASH_TS
/* Get/set value, returns 0 on success */
int flash_ts_set(const char *key, const char *value);
void flash_ts_get(const char *key, char *value, unsigned int size);
#else
static inline int flash_ts_set(const char *key, const char *value)
{
return -ENOSYS;
}
static inline void flash_ts_get(const char *key, char *value, unsigned int size)
{
}
#endif
#endif /* __KERNEL__ */
#endif /* _LINUX_FLASH_TS_H_ */
|
/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
*/
#pragma once
#include "FileSystem.h"
#include <wtf/Assertions.h>
namespace WebCore {
class WEBCORE_EXPORT FileHandle final {
public:
FileHandle() = default;
FileHandle(const String& path, FileOpenMode);
FileHandle(const FileHandle& other) = delete;
FileHandle(FileHandle&& other);
~FileHandle();
FileHandle& operator=(const FileHandle& other) = delete;
FileHandle& operator=(FileHandle&& other);
explicit operator bool() const;
bool open(const String& path, FileOpenMode);
bool open();
int read(void* data, int length);
int write(const void* data, int length);
bool printf(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3);
void close();
private:
String m_path;
FileOpenMode m_mode { OpenForRead };
PlatformFileHandle m_fileHandle { invalidPlatformFileHandle };
};
} // namespace WebCore
|
#ifndef __LOCKSERVICE__H
#define __LOCKSERVICE__H
#include "../version_no.h"
#include "../version_fu.h"
bool OpenLockClient(CSocketIOPtr s);
bool CloseLockClient(CSocketIOPtr s);
bool ParseLockCommand(CSocketIOPtr s, const char *command);
void run_server(int port, int seq, int local_only);
void InitServer();
void CloseServer();
#endif
|
/* Delayed_events_task
*
* This task continuously sends itself events at one tick
* intervals.
*
* Input parameters:
* argument - task argument
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id: evtmtask.c,v 1.11 2008/09/05 21:30:17 joel Exp $
*/
#include "system.h"
rtems_task Delayed_events_task(
rtems_task_argument argument
)
{
uint32_t count;
uint32_t previous_mode;
rtems_status_code status;
rtems_event_set events;
rtems_id self;
status = rtems_task_mode(
RTEMS_PREEMPT | RTEMS_TIMESLICE,
RTEMS_PREEMPT_MASK | RTEMS_TIMESLICE_MASK,
&previous_mode
);
directive_failed( status, "rtems_task_mode" );
status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
directive_failed( status, "rtems_timer_create" );
self = rtems_task_self();
while ( Stop_Test == false ) {
for ( count=DELAYED_EVENT_DOT_COUNT; Stop_Test == false && count; count-- ){
status = rtems_timer_fire_after(
Timer_id[ 1 ],
1,
Delayed_send_event,
&self
);
directive_failed( status, "rtems_timer_reset" );
status = rtems_event_receive(
RTEMS_EVENT_16,
RTEMS_DEFAULT_OPTIONS,
RTEMS_NO_TIMEOUT,
&events
);
directive_failed( status, "rtems_event_receive" );
}
put_dot('.');
}
Exit_test();
}
|
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(INCLUDED_GENERIC_H)
#define INCLUDED_GENERIC_H
scene::Node& New_GenericEntity (EntityClass* eclass);
#endif
|
/******************************************************************************
*
* This file is part of openDarkEngine project
* Copyright (C) 2009 openDarkEngine team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id$
*
*****************************************************************************/
#ifndef __TEXTUREATLAS_H
#define __TEXTUREATLAS_H
#include "DrawCommon.h"
#include "FreeSpaceInfo.h"
namespace Opde {
// Forward decl.
class DrawService;
class FontDrawSource;
/** Texture atlas for DrawSource grouping. Textures created within this atlas are
* grouped together into a single rendering call when used as a source for draw operations, resulting
* in better performance.
*/
class TextureAtlas : public DrawSourceBase {
public:
/** Constructor. Creates a new atlas for texture storage */
TextureAtlas(DrawService* owner, DrawSource::ID id);
/** destructor */
~TextureAtlas();
/** Creates an atlased draw source */
DrawSourcePtr createDrawSource(const Ogre::String& imgName, const Ogre::String& groupName);
/** Adds a font instance (to be filled with glyphs afterwards) to this atlas
* @note You probably don't want to use this. You'll want to use DrawService::loadFont instead */
void _addFont(FontDrawSource* fdsp);
/** Removes the specified font from the atlas */
void _removeFont(FontDrawSource* fdsp);
/** returns this Atlase's source ID */
inline DrawSource::ID getAtlasID() const { return mAtlasID; };
/** Internal tool to allow external addition of draw sources. Used by font code. */
void _addDrawSource(const DrawSourcePtr& ds);
/** Internal tool to allow removal of draw sources */
void _removeDrawSource(const DrawSourcePtr& ds);
/** Builds the atlas. Locks it for further additions, makes it useable */
void build();
/// Owner getter
inline DrawService* getOwner() const { return mOwner; };
/// Returns a draw source for vertex colour rendering (2x2 white pixels)
const DrawSourcePtr& getVertexColourDrawSource() const { return mVertexColour; };
protected:
void enlarge(size_t area);
void markDirty();
void prepareResources();
void dropResources();
DrawService* mOwner;
DrawSource::ID mAtlasID;
typedef std::list<DrawSourcePtr> DrawSourceList;
typedef std::list<FontDrawSource*> FontSet;
DrawSourceList mMyDrawSources;
FontSet mMyFonts;
FreeSpaceInfo* mAtlasAllocation;
bool mIsDirty; // TODO: Replace by mIsBuilt
PixelSize mAtlasSize;
Ogre::String mAtlasName; // atlas texture name
/// Used with vertex colour (texture less) rendering
DrawSourcePtr mVertexColour;
};
};
#endif
|
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* "Ping" sockets
*
* 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.
*
* Based on ipv4/ping.c code.
*
* Authors: Lorenzo Colitti (IPv6 support)
* Vasiliy Kulikov / Openwall (IPv4 implementation, for Linux 2.6),
* Pavel Kankovsky (IPv4 implementation, for Linux 2.4.32)
*
*/
#include <linux/export.h>
#include <net/addrconf.h>
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/protocol.h>
#include <net/udp.h>
#include <net/transp_v6.h>
#include <net/ping.h>
struct proto pingv6_prot = {
.name = "PINGv6",
.owner = THIS_MODULE,
.init = ping_init_sock,
.close = ping_close,
.connect = ip6_datagram_connect,
.disconnect = udp_disconnect,
.setsockopt = ipv6_setsockopt,
.getsockopt = ipv6_getsockopt,
.sendmsg = ping_v6_sendmsg,
.recvmsg = ping_recvmsg,
.bind = ping_bind,
.backlog_rcv = ping_queue_rcv_skb,
.hash = ping_hash,
.unhash = ping_unhash,
.get_port = ping_get_port,
.obj_size = sizeof(struct raw6_sock),
};
EXPORT_SYMBOL_GPL(pingv6_prot);
static struct inet_protosw pingv6_protosw = {
.type = SOCK_DGRAM,
.protocol = IPPROTO_ICMPV6,
.prot = &pingv6_prot,
.ops = &inet6_dgram_ops,
.no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_REUSE,
};
/* Compatibility glue so we can support IPv6 when it's compiled as a module */
int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
int *addr_len)
{
return -EAFNOSUPPORT;
}
int dummy_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
struct sk_buff *skb)
{
return -EAFNOSUPPORT;
}
int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
{
return -EAFNOSUPPORT;
}
void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
__be16 port, u32 info, u8 *payload) {}
int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
struct net_device *dev, int strict)
{
return 0;
}
int __init pingv6_init(void)
{
pingv6_ops.ipv6_recv_error = ipv6_recv_error;
pingv6_ops.datagram_recv_ctl = datagram_recv_ctl;
pingv6_ops.icmpv6_err_convert = icmpv6_err_convert;
pingv6_ops.ipv6_icmp_error = ipv6_icmp_error;
pingv6_ops.ipv6_chk_addr = ipv6_chk_addr;
return inet6_register_protosw(&pingv6_protosw);
}
/* This never gets called because it's not possible to unload the ipv6 module,
* but just in case.
*/
void pingv6_exit(void)
{
pingv6_ops.ipv6_recv_error = dummy_ipv6_recv_error;
pingv6_ops.datagram_recv_ctl = dummy_datagram_recv_ctl;
pingv6_ops.icmpv6_err_convert = dummy_icmpv6_err_convert;
pingv6_ops.ipv6_icmp_error = dummy_ipv6_icmp_error;
pingv6_ops.ipv6_chk_addr = dummy_ipv6_chk_addr;
inet6_unregister_protosw(&pingv6_protosw);
}
int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct icmp6hdr user_icmph;
int addr_type;
struct in6_addr *daddr;
int iif = 0;
struct flowi6 fl6;
int err;
int hlimit;
struct dst_entry *dst;
struct rt6_info *rt;
struct pingfakehdr pfh;
pr_debug("ping_v6_sendmsg(sk=%p,sk->num=%u)\n", inet, inet->inet_num);
err = ping_common_sendmsg(AF_INET6, msg, len, &user_icmph,
sizeof(user_icmph));
if (err)
return err;
if (msg->msg_name) {
struct sockaddr_in6 *u = (struct sockaddr_in6 *) msg->msg_name;
if (msg->msg_namelen < sizeof(struct sockaddr_in6) ||
u->sin6_family != AF_INET6) {
return -EINVAL;
}
if (sk->sk_bound_dev_if &&
sk->sk_bound_dev_if != u->sin6_scope_id) {
return -EINVAL;
}
daddr = &(u->sin6_addr);
iif = u->sin6_scope_id;
} else {
if (sk->sk_state != TCP_ESTABLISHED)
return -EDESTADDRREQ;
daddr = &np->daddr;
}
if (!iif)
iif = sk->sk_bound_dev_if;
addr_type = ipv6_addr_type(daddr);
if (__ipv6_addr_needs_scope_id(addr_type) && !iif)
return -EINVAL;
if (addr_type & IPV6_ADDR_MAPPED)
return -EINVAL;
/* TODO: use ip6_datagram_send_ctl to get options from cmsg */
memset(&fl6, 0, sizeof(fl6));
fl6.flowi6_proto = IPPROTO_ICMPV6;
fl6.saddr = np->saddr;
fl6.daddr = *daddr;
fl6.flowi6_mark = sk->sk_mark;
fl6.fl6_icmp_type = user_icmph.icmp6_type;
fl6.fl6_icmp_code = user_icmph.icmp6_code;
fl6.flowi6_uid = sock_i_uid(sk);
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
fl6.flowi6_oif = np->mcast_oif;
else if (!fl6.flowi6_oif)
fl6.flowi6_oif = np->ucast_oif;
dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, 1);
if (IS_ERR(dst))
return PTR_ERR(dst);
rt = (struct rt6_info *) dst;
np = inet6_sk(sk);
if (!np)
return -EBADF;
if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr))
fl6.flowi6_oif = np->mcast_oif;
else if (!fl6.flowi6_oif)
fl6.flowi6_oif = np->ucast_oif;
pfh.icmph.type = user_icmph.icmp6_type;
pfh.icmph.code = user_icmph.icmp6_code;
pfh.icmph.checksum = 0;
pfh.icmph.un.echo.id = inet->inet_sport;
pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence;
pfh.iov = msg->msg_iov;
pfh.wcheck = 0;
pfh.family = AF_INET6;
if (ipv6_addr_is_multicast(&fl6.daddr))
hlimit = np->mcast_hops;
else
hlimit = np->hop_limit;
if (hlimit < 0)
hlimit = ip6_dst_hoplimit(dst);
lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,
0, hlimit,
np->tclass, NULL, &fl6, rt,
MSG_DONTWAIT, np->dontfrag);
if (err) {
ICMP6_INC_STATS_BH(sock_net(sk), rt->rt6i_idev,
ICMP6_MIB_OUTERRORS);
ip6_flush_pending_frames(sk);
} else {
err = icmpv6_push_pending_frames(sk, &fl6,
(struct icmp6hdr *) &pfh.icmph,
len);
}
release_sock(sk);
if (err)
return err;
return len;
}
|
/**
* Copyright (C) <2014> <Emil Todorov>
*
* 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/>
*/
#import <Foundation/Foundation.h>
#import "EtSqlite.h"
extern NSString * const COLNAME_SCID;
extern NSString * const COLNAME_SCIDX;
extern NSString * const SQL_METADATA_COL_TYPE;
extern NSString * const SQL_METADATA_COL_NAME;
extern NSString* const SQL_METADATA_TABLE_MASTER;
extern NSString * const STRING_NULL;
@interface HelperSC : NSObject
+ (NSString *)getStmt_createTable:(NSString *)aTableName columnsAndValues:(NSDictionary *)aColsAndValuesDict;
+ (NSString *)getStmt_insertIntoTable:(NSString *)aTableName columnsAndValues:(NSDictionary *)aColsAndValues db:(EtSqlite *)aDb;
+ (NSString *)getStmt_insertIntoTable:(NSString *)aTableName columnsAndValues:(NSDictionary *)aDictColsAndValues index:(int)aIndex;
+ (NSString *)getStmt_selectFromTable:(NSString *)aTableName index:(int)aIndex;
+ (NSString *)getStmt_update:(NSString *)aTableName columnsAndValues:(NSDictionary *)aColAndValues
whereColumnsHaveValues:(NSDictionary *)aWhereColsHaveValues;
+ (NSString *)getStmt_update:(NSString *)aTableName columnsAndValues:(NSDictionary *)aColAndValues atRowId:(int)aRowId;
+ (NSString *)getStmt_deleteFromTable:(NSString *)aTableName whereElement:(NSDictionary *)aDictElement;
+ (NSString *)getStmt_deleteFromTable:(NSString *)aTableName index:(int)aIndex;
+ (NSString *)getStmt_deleteAllFromTable:(NSString *)aTableName;
+ (NSString *)getStmt_dropTable:(NSString *)aTableName;
+ (NSString *)escapeSingleQuotesForSQL:(NSString *)aString;
+ (NSString *)getStmt_updateForInsertAtIndex:(int)aIndex table:(NSString *)aTableName;
+ (NSString *)getStmt_updateForRemoveAtIndex:(int)aIndex table:(NSString *)aTableName;
+ (NSString *)getStmt_updateForRemoveOfElement:(NSDictionary *)aDictElement table:(NSString *)aTableName;
@end
|
#ifndef LINUX_SPI_FLASH_H
#define LINUX_SPI_FLASH_H
struct mtd_partition;
/**
* struct flash_platform_data: board-specific flash data
* @name: optional flash device name (eg, as used with mtdparts=)
* @parts: optional array of mtd_partitions for static partitioning
* @nr_parts: number of mtd_partitions for static partitoning
* @type: optional flash device type (e.g. m25p80 vs m25p64), for use
* with chips that can't be queried for JEDEC or other IDs
*
* Board init code (in arch/.../mach-xxx/board-yyy.c files) can
* provide information about SPI flash parts (such as DataFlash) to
* help set up the device and its appropriate default partitioning.
*
* Note that for DataFlash, sizes for pages, blocks, and sectors are
* rarely powers of two; and partitions should be sector-aligned.
*/
struct flash_platform_data {
char *name;
struct mtd_partition *parts;
unsigned int nr_parts;
char *type;
/* we'll likely add more ... use JEDEC IDs, etc */
};
#endif
|
#ifndef __ASM_SECCOMP_H
#include <linux/unistd.h>
#define __NR_seccomp_read __NR_read
#define __NR_seccomp_write __NR_write
#define __NR_seccomp_exit __NR_exit
#define __NR_seccomp_sigreturn __NR_rt_sigreturn
#endif /* __ASM_SECCOMP_H */
|
#ifndef _ASM_SCORE_MMU_H
#define _ASM_SCORE_MMU_H
typedef unsigned long mm_context_t;
#endif /* _ASM_SCORE_MMU_H */
|
/* Copyright (C) 2011-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <time.h>
/* Set TS to calendar time based in time base BASE. */
int
timespec_get (struct timespec *ts, int base)
{
switch (base)
{
case TIME_UTC:
/* Not supported. */
return 0;
default:
return 0;
}
return base;
}
stub_warning (timespec_get)
|
/*
*
* Copyright (C) International Business Machines Corp., 2004, 2005
*
* 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
*/
/*
* NAME
* Tspi_Policy_SetSecret03.c
*
* DESCRIPTION
* This test will verify Tspi_Policy_SetSecret.
* The purpose of this test is to get TSS_E_BAD_PARAMETER
* to be returned. This is easily accomplished by
* passing in an incorrect second parameter. For
* this test case TSS_KEY_SIZE_1024 is passed
* in instead of TSS_SECRET_MODE_PLAIN.
* ALGORITHM
* Setup:
* Create Context
* Connect Context
* Get Default Policy
*
* Test: Call Policy_SetSecret and if it is not a success
* Make sure that it returns the proper return codes
*
* Cleanup:
* Free memory associated with the context
* Close Context
* Print error/success message
*
* USAGE: First parameter is --options
* -v or --version
* Second Parameter is the version of the test case to be run.
* This test case is currently only implemented for 1.1
*
* HISTORY
* Author: Kathy Robertson.
* Date: June 2004
* Email: klrobert@us.ibm.com
*
* RESTRICTIONS
* None.
*/
#include "common.h"
int main(int argc, char **argv)
{
char version;
version = parseArgs( argc, argv );
if (version)
main_v1_1();
else
print_wrongVersion();
}
main_v1_1(void){
char *nameOfFunction = "Tspi_Policy_SetSecret03";
TSS_HCONTEXT hContext;
TSS_HPOLICY hPolicy;
TSS_RESULT result;
print_begin_test(nameOfFunction);
//Create Context
result = Tspi_Context_Create(&hContext);
if (result != TSS_SUCCESS) {
print_error("Tspi_Context_Create ", result);
print_error_exit(nameOfFunction, err_string(result));
exit(result);
}
//Connect Context
result = Tspi_Context_Connect(hContext, get_server(GLOBALSERVER));
if (result != TSS_SUCCESS) {
print_error("Tspi_Context_Connect ", result);
print_error_exit(nameOfFunction, err_string(result));
Tspi_Context_Close(hContext);
exit(result);
}
//Get Default Policy
result = Tspi_Context_GetDefaultPolicy(hContext, &hPolicy);
if (result != TSS_SUCCESS) {
print_error("Tspi_Context_GetDefaultPolicy ", result);
print_error_exit(nameOfFunction, err_string(result));
Tspi_Context_Close(hContext);
exit(result);
}
//Set Secret
result = Tspi_Policy_SetSecret(hPolicy, TSS_KEY_SIZE_1024,
TESTSUITE_NEW_SECRET_LEN, TESTSUITE_NEW_SECRET);
if (TSS_ERROR_CODE(result) != TSS_E_BAD_PARAMETER) {
if(!checkNonAPI(result)){
print_error(nameOfFunction, result);
print_end_test(nameOfFunction);
Tspi_Context_FreeMemory(hContext, NULL);
Tspi_Context_Close(hContext);
exit(result);
}
else{
print_error_nonapi(nameOfFunction, result);
print_end_test(nameOfFunction);
Tspi_Context_FreeMemory(hContext, NULL);
Tspi_Context_Close(hContext);
exit(result);
}
}
else{
print_success(nameOfFunction, result);
print_end_test(nameOfFunction);
Tspi_Context_FreeMemory(hContext, NULL);
Tspi_Context_Close(hContext);
exit(0);
}
}
|
/*****************************************************************************
*
* LOGGING.H - Header file for logging functions
*
* Copyright (c) 2010-2011 Nagios Core Development Team and Community Contributors
* Copyright (c) 2010-2011 Icinga Development Team (http://www.icinga.org)
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*****************************************************************************/
#ifndef INCLUDE_logging_h__
#define INCLUDE_logging_h__
#include "objects.h"
/******************* LOGGING TYPES ********************/
#define NSLOG_RUNTIME_ERROR 1
#define NSLOG_RUNTIME_WARNING 2
#define NSLOG_VERIFICATION_ERROR 4
#define NSLOG_VERIFICATION_WARNING 8
#define NSLOG_CONFIG_ERROR 16
#define NSLOG_CONFIG_WARNING 32
#define NSLOG_PROCESS_INFO 64
#define NSLOG_EVENT_HANDLER 128
/*#define NSLOG_NOTIFICATION 256*/ /* NOT USED ANYMORE - CAN BE REUSED */
#define NSLOG_EXTERNAL_COMMAND 512
#define NSLOG_HOST_UP 1024
#define NSLOG_HOST_DOWN 2048
#define NSLOG_HOST_UNREACHABLE 4096
#define NSLOG_SERVICE_OK 8192
#define NSLOG_SERVICE_UNKNOWN 16384
#define NSLOG_SERVICE_WARNING 32768
#define NSLOG_SERVICE_CRITICAL 65536
#define NSLOG_PASSIVE_CHECK 131072
#define NSLOG_INFO_MESSAGE 262144
#define NSLOG_HOST_NOTIFICATION 524288
#define NSLOG_SERVICE_NOTIFICATION 1048576
/***************** DEBUGGING LEVELS *******************/
#define DEBUGL_ALL -1
#define DEBUGL_NONE 0
#define DEBUGL_FUNCTIONS 1
#define DEBUGL_CONFIG 2
#define DEBUGL_PROCESS 4
#define DEBUGL_STATUSDATA 4
#define DEBUGL_RETENTIONDATA 4
#define DEBUGL_EVENTS 8
#define DEBUGL_CHECKS 16
#define DEBUGL_IPC 16
#define DEBUGL_FLAPPING 16
#define DEBUGL_EVENTHANDLERS 16
#define DEBUGL_PERFDATA 16
#define DEBUGL_NOTIFICATIONS 32
#define DEBUGL_EVENTBROKER 64
#define DEBUGL_EXTERNALCOMMANDS 128
#define DEBUGL_COMMANDS 256
#define DEBUGL_DOWNTIME 512
#define DEBUGL_COMMENTS 1024
#define DEBUGL_MACROS 2048
#define DEBUGV_BASIC 0
#define DEBUGV_MORE 1
#define DEBUGV_MOST 2
/**** Logging Functions ****/
/* __printf__ etc. are gnu specific,not usable with cc */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
void logit(int,int,const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));
int log_debug_info(int,int,const char *,...)
__attribute__((__format__(__printf__, 3, 4)));
#else
void logit(int,int,const char *, ...);
int log_debug_info(int,int,const char *,...);
#endif /* gnu */
#ifndef NSCGI
int write_to_all_logs_with_host_service(char *, unsigned long, host *, service *);
int write_to_log_with_host_service(char *, unsigned long, time_t *, host *, service *);
int write_to_all_logs(char *,unsigned long); /* writes a string to main log file and syslog facility */
int write_to_log(char *,unsigned long,time_t *); /* write a string to the main log file */
int write_to_syslog(char *,unsigned long); /* write a string to the syslog facility */
void write_to_console(char *); /* write a string to the console */
void write_to_logs_and_console(char *, unsigned long, int); /* write a string to all logs and the console */
int log_service_event(service *); /* logs a service event */
int log_host_event(host *); /* logs a host event */
int log_host_states(int,time_t *); /* logs initial/current host states */
int log_service_states(int,time_t *); /* logs initial/current service states */
int rotate_log_file(time_t); /* rotates the main log file */
int write_log_file_info(time_t *); /* records log file/version info */
int open_debug_log(void);
int close_debug_log(void);
FILE *open_log_file(void);
int close_log_file(void);
int fix_log_file_owner(uid_t, gid_t);
int log_level(int, int);
#endif /* !NSCGI */
#endif
|
/***************************************************************************
Bally/Sente SAC-1 system
driver by Aaron Giles
***************************************************************************/
/*----------- defined in machine/balsente.c -----------*/
extern UINT8 balsente_shooter;
extern UINT8 balsente_shooter_x;
extern UINT8 balsente_shooter_y;
extern UINT8 balsente_adc_shift;
extern UINT16 *shrike_shared;
extern UINT16 *shrike_io;
MACHINE_RESET( balsente );
void balsente_noise_gen(int chip, int count, short *buffer);
WRITE8_HANDLER( balsente_random_reset_w );
READ8_HANDLER( balsente_random_num_r );
WRITE8_HANDLER( balsente_rombank_select_w );
WRITE8_HANDLER( balsente_rombank2_select_w );
WRITE8_HANDLER( balsente_misc_output_w );
READ8_HANDLER( balsente_m6850_r );
WRITE8_HANDLER( balsente_m6850_w );
READ8_HANDLER( balsente_m6850_sound_r );
WRITE8_HANDLER( balsente_m6850_sound_w );
INTERRUPT_GEN( balsente_update_analog_inputs );
READ8_HANDLER( balsente_adc_data_r );
WRITE8_HANDLER( balsente_adc_select_w );
READ8_HANDLER( balsente_counter_8253_r );
WRITE8_HANDLER( balsente_counter_8253_w );
READ8_HANDLER( balsente_counter_state_r );
WRITE8_HANDLER( balsente_counter_control_w );
WRITE8_HANDLER( balsente_chip_select_w );
WRITE8_HANDLER( balsente_dac_data_w );
WRITE8_HANDLER( balsente_register_addr_w );
READ8_HANDLER( nstocker_port2_r );
WRITE8_HANDLER( spiker_expand_w );
READ8_HANDLER( spiker_expand_r );
READ8_HANDLER( grudge_steering_r );
READ8_HANDLER( shrike_shared_6809_r );
WRITE8_HANDLER( shrike_shared_6809_w );
READ16_HANDLER( shrike_io_68k_r );
WRITE16_HANDLER( shrike_io_68k_w );
/*----------- defined in vidhrdw/balsente.c -----------*/
VIDEO_START( balsente );
VIDEO_UPDATE( balsente );
WRITE8_HANDLER( balsente_videoram_w );
WRITE8_HANDLER( balsente_paletteram_w );
WRITE8_HANDLER( balsente_palette_select_w );
WRITE8_HANDLER( shrike_sprite_select_w );
|
/*
* Copyright (c) 2014, STMicroelectronics International N.V.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "tee-op.h"
static const char CMD_TEEC_OPEN_SESSION_STR[] = "OPEN_SESSION ";
static const char CMD_TEEC_CLOSE_SESSION_STR[] = "CLOSE_SESSION ";
static const char CMD_TEEC_INVOKE_COMMAND_STR[] = "INVOKE_COMMAND ";
static const char CMD_REGISTER_RPC_STR[] = "REGISTER_RPC ";
static const char CMD_SET_SEC_DDR_STR[] = "SET_SEC_DDR ";
static const char CMD_TEEC_CANCEL_COMMAND_STR[] = "CANCEL_COMMAND ";
static const char CMD_TEE_DEINIT_CPU_STR[] = "DEINIT_CPU ";
static const char CMD_TEE_SET_CORE_TRACE_LEVEL_STR[] =
"SET_CORE_TRACE_LEVEL";
static const char CMD_TEE_GET_CORE_TRACE_LEVEL_STR[] =
"GET_CORE_TRACE_LEVEL";
static const char CMD_TEE_SET_TA_TRACE_LEVEL_STR[] = "SET_TA_TRACE_LEVEL";
static const char CMD_TEE_GET_TA_TRACE_LEVEL_STR[] = "GET_TA_TRACE_LEVEL";
static const char CMD_REGISTER_DEF_SHM_STR[] = "REGISTER_DEF_SHM";
static const char CMD_UNREGISTER_DEF_SHM_STR[] = "UNREGISTER_DEF_SHM";
const char *tee_cmd_str(enum t_cmd_service_id cmd)
{
switch (cmd) {
case CMD_TEEC_OPEN_SESSION:
return CMD_TEEC_OPEN_SESSION_STR;
case CMD_TEEC_CLOSE_SESSION:
return CMD_TEEC_CLOSE_SESSION_STR;
case CMD_TEEC_INVOKE_COMMAND:
return CMD_TEEC_INVOKE_COMMAND_STR;
case CMD_REGISTER_RPC:
return CMD_REGISTER_RPC_STR;
case CMD_SET_SEC_DDR:
return CMD_SET_SEC_DDR_STR;
case CMD_TEEC_CANCEL_COMMAND:
return CMD_TEEC_CANCEL_COMMAND_STR;
case CMD_TEE_DEINIT_CPU:
return CMD_TEE_DEINIT_CPU_STR;
case CMD_TEE_SET_CORE_TRACE_LEVEL:
return CMD_TEE_SET_CORE_TRACE_LEVEL_STR;
case CMD_TEE_GET_CORE_TRACE_LEVEL:
return CMD_TEE_GET_CORE_TRACE_LEVEL_STR;
case CMD_TEE_SET_TA_TRACE_LEVEL:
return CMD_TEE_SET_TA_TRACE_LEVEL_STR;
case CMD_TEE_GET_TA_TRACE_LEVEL:
return CMD_TEE_GET_TA_TRACE_LEVEL_STR;
case CMD_REGISTER_DEF_SHM:
return CMD_REGISTER_DEF_SHM_STR;
case CMD_UNREGISTER_DEF_SHM:
return CMD_UNREGISTER_DEF_SHM_STR;
default:
return NULL;
}
}
|
/***************************************************************************
cmapcommand.h
-------------------
begin : Fri Jun 7 2002
copyright : (C) 2002 by Kmud Developer Team
email : kmud-devel@kmud.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. *
* *
***************************************************************************/
#ifndef CMAPCOMMAND_H
#define CMAPCOMMAND_H
#include <QUndoCommand>
#include <QString>
#include <kmuddy_export.h>
/**
*@author Kmud Developer Team
*/
class KMUDDY_EXPORT CMapCommand : public QUndoCommand
{
public:
CMapCommand(QString name);
~CMapCommand();
QString name() const { return m_name; }
private:
QString m_name;
};
#endif
|
/*
* cui.h
*
* Copyright (c) 2004 Arnout Engelen
*
* 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.
*
*/
/* NetHogs console UI */
void do_refresh();
void init_ui();
void exit_ui();
/* periodically gives some CPU-time to the UI */
void ui_tick();
|
/*
* 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: long_pstring.h /main/5 1996/07/18 14:42:33 drk $
*
* Copyright (c) 1993 HAL Computer Systems International, Ltd.
* All rights reserved. Unpublished -- rights reserved under
* the Copyright Laws of the United States. USE OF A COPYRIGHT
* NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
* OR DISCLOSURE.
*
* THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
* SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
* DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
* PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
* INTERNATIONAL, LTD.
*
* RESTRICTED RIGHTS LEGEND
* Use, duplication, or disclosure by the Government is subject
* to the restrictions as set forth in subparagraph (c)(l)(ii)
* of the Rights in Technical Data and Computer Software clause
* at DFARS 252.227-7013.
*
* HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
* 1315 Dell Avenue
* Campbell, CA 95008
*
*/
#ifndef _long_pstring_h
#define _long_pstring_h 1
#include "object/pstring.h"
#include "utility/ostring.h"
#include "storage/page_storage.h"
#include "storage/chunks_index.h"
/***************************************
* long string class.
****************************************/
class long_pstring: public pstring
{
public:
long_pstring(long_pstring&);
long_pstring(c_code_t = LONG_STRING_CODE);
long_pstring(char* string, int sz, c_code_t = LONG_STRING_CODE);
virtual ~long_pstring();
MMDB_SIGNATURES(long_pstring);
// export function
Boolean extract(int left, int right, char* sink);
/*
// comparison functions
Boolean value_LS(root& x, Boolean safe) const;
Boolean value_EQ(root& x, Boolean safe) const;
*/
// print function
using pstring::asciiIn;
virtual io_status asciiIn(istream&);
protected:
chunks_index *v_str_index;
};
HANDLER_SIGNATURES(long_pstring)
#endif
|
/*
* Copyright (C) 2007-2008 Guillaume Desmottes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: Guillaume Desmottes <gdesmott@gnome.org>
* Frederic Peters <fpeters@0d.be>
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libempathy/empathy-utils.h>
#include "empathy-account-widget.h"
#include "empathy-account-widget-private.h"
#include "empathy-account-widget-sip.h"
#include "empathy-ui-utils.h"
typedef struct {
EmpathyAccountWidget *self;
GtkWidget *vbox_settings;
GtkWidget *entry_stun_server;
GtkWidget *spinbutton_stun_part;
GtkWidget *checkbutton_discover_stun;
} EmpathyAccountWidgetSip;
static void
account_widget_sip_destroy_cb (GtkWidget *widget,
EmpathyAccountWidgetSip *settings)
{
g_slice_free (EmpathyAccountWidgetSip, settings);
}
static void
account_widget_sip_discover_stun_toggled_cb (
GtkWidget *checkbox,
EmpathyAccountWidgetSip *settings)
{
gboolean active;
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
gtk_widget_set_sensitive (settings->entry_stun_server, !active);
gtk_widget_set_sensitive (settings->spinbutton_stun_part, !active);
}
void
empathy_account_widget_sip_build (EmpathyAccountWidget *self,
const char *filename,
GtkWidget **table_common_settings)
{
EmpathyAccountWidgetSip *settings;
GtkWidget *vbox_settings;
gboolean is_simple;
g_object_get (self, "simple", &is_simple, NULL);
if (is_simple)
{
self->ui_details->gui = empathy_builder_get_file (filename,
"vbox_sip_simple", &vbox_settings,
NULL);
empathy_account_widget_handle_params (self,
"entry_userid_simple", "account",
"entry_password_simple", "password",
NULL);
self->ui_details->default_focus = g_strdup ("entry_userid_simple");
}
else
{
settings = g_slice_new0 (EmpathyAccountWidgetSip);
settings->self = self;
self->ui_details->gui = empathy_builder_get_file (filename,
"table_common_settings", table_common_settings,
"vbox_sip_settings", &vbox_settings,
"entry_stun-server", &settings->entry_stun_server,
"spinbutton_stun-port", &settings->spinbutton_stun_part,
"checkbutton_discover-stun", &settings->checkbutton_discover_stun,
NULL);
settings->vbox_settings = vbox_settings;
empathy_account_widget_handle_params (self,
"entry_userid", "account",
"entry_password", "password",
"checkbutton_discover-stun", "discover-stun",
"entry_stun-server", "stun-server",
"spinbutton_stun-port", "stun-port",
NULL);
account_widget_sip_discover_stun_toggled_cb (
settings->checkbutton_discover_stun,
settings);
empathy_builder_connect (self->ui_details->gui, settings,
"vbox_sip_settings", "destroy", account_widget_sip_destroy_cb,
"checkbutton_discover-stun", "toggled",
account_widget_sip_discover_stun_toggled_cb,
NULL);
self->ui_details->add_forget = TRUE;
self->ui_details->default_focus = g_strdup ("entry_userid");
}
self->ui_details->widget = vbox_settings;
}
|
/*
* 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
*/
/*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
/*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
/*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
/*%% (c) Copyright 1993, 1994 Novell, Inc. */
/*%% $XConsortium: isindexinfo.c /main/3 1995/10/23 11:40:56 rswiston $ */
#ifndef lint
static char sccsid[] = "@(#)isindexinfo.c 1.2 91/05/16 Copyr 1988 Sun Micro";
#endif
/*
* Copyright (c) 1988 by Sun Microsystems, Inc.
*/
/*
* isindexinfo.c
*
* Description:
* Access file status information
*/
#include "isam_impl.h"
#include <sys/time.h>
#define ZERO 0
/*
* err = isindexinfo(isfd, buffer, number)
*
* Return information about index.
* Return information about the data file (if number == 0).
*
* (this function is overloaded).
*
* Errors:
* EBADARG number is out of range
* ENOTOPEN isfd is not ISAM file descriptor of open ISAM file
*/
#define dibuf ((struct dictinfo *)buffer)
int
isindexinfo(isfd, buffer, number)
int isfd;
struct keydesc *buffer;
int number;
{
register Fab *fab;
int ret;
Fcb *fcb = NULL;
/*
* Get File Access Block.
*/
if ((fab = _isfd_find(isfd)) == NULL) {
_setiserrno2(ENOTOPEN, '9', '0');
return (ISERROR);
}
/*
* Call the Access Method or RPC client function, depending whether
* the file is local or remote.
*/
_isam_entryhook();
/*
* Get FCB corresponding to the isfhandle handle.
*/
if ((fcb = _openfcb(&fab->isfhandle, &fab->errcode)) == NULL) {
_isam_exithook();
return (ISERROR);
}
/*
* Update information in FCB from CNTL page on the disk
*/
(void)_isfcb_cntlpg_r(fcb);
/*
* Validate number argument.
*/
if (number < 0 || number > fcb->nkeys) {
_amseterrcode(&fab->errcode, EBADARG);
goto ERROR;
}
if (number == 0) {
/*
* Return dictinfo structure.
*/
dibuf->di_nkeys = fcb->nkeys;
dibuf->di_recsize = fcb->maxreclen;
dibuf->di_idxsize = fcb->keys[0].k2_len;
dibuf->di_nrecords = fcb->nrecords;
/* Set msb of di_nkeys for variable length records. */
if (fcb->varflag == TRUE)
dibuf->di_nkeys |= DICTVARLENBIT;
}
else {
/*
* Return index information.
*/
_iskey_itox(fcb->keys + number - 1, buffer);
}
_amseterrcode(&fab->errcode, ISOK);
/* XXX This fixes a core dump that occurs when isindexinfo is
* called on brand new tables
_isdisk_commit();
_isdisk_sync();
_isdisk_inval();
*/
_isam_exithook();
ret = ISOK;
goto CLEANUP;
ERROR:
/*
* Restore FCB from CNTL page.
*/
_isdisk_rollback();
_isdisk_inval();
_isam_exithook();
ret = ISERROR;
CLEANUP:
if (ret == ISOK)
isreclen = fab->minreclen; /* for variable length */
_seterr_errcode(&fab->errcode);
/*
* This is a patch to conform with the VSX 3.0 test that checks
* that k_leng == 2 and k_type == 1 for index 1 if the ISAM file
* has no primary key. I suspect that these numbers are returned by
* C-ISAM and the author of VSX tests diligently checks them even
* though they have no meaning.
*/
if (ret == ISOK && number == 1 && buffer->k_nparts == 0) {
buffer->k_leng = 2;
buffer->k_type = INTTYPE;
}
return (ret);
}
|
/*****************************************************************************\
* $Id: ipmi-fru-argp.h,v 1.10 2010-02-08 22:20:58 chu11 Exp $
*****************************************************************************
* Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC.
* Copyright (C) 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-232183
*
* This file is part of Ipmi-fru, a tool used for retrieving
* motherboard field replaceable unit (FRU) information. For details,
* see http://www.llnl.gov/linux/.
*
* Ipmi-fru 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.
*
* Ipmi-fru 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 Ipmi-fru. If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/
#ifndef IPMI_FRU_ARGP_H
#define IPMI_FRU_ARGP_H
#include "ipmi-fru_.h"
void ipmi_fru_argp_parse (int argc, char **argv, struct ipmi_fru_arguments *cmd_args);
#endif /* IPMI_FRU_ARGP_H */
|
/*
This file is part of GNUnet.
(C) 2010, 2011 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 fs/fs_misc.c
* @brief misc. functions related to file-sharing in general
* @author Christian Grothoff
*/
#include "platform.h"
#include "gnunet_constants.h"
#include "gnunet_fs_service.h"
#include "fs_api.h"
/**
* Suggest a filename based on given metadata.
*
* @param md given meta data
* @return NULL if meta data is useless for suggesting a filename
*/
char *
GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData
*md)
{
static const char *mimeMap[][2] = {
{"application/bz2", ".bz2"},
{"application/gnunet-directory", ".gnd"},
{"application/java", ".class"},
{"application/msword", ".doc"},
{"application/ogg", ".ogg"},
{"application/pdf", ".pdf"},
{"application/pgp-keys", ".key"},
{"application/pgp-signature", ".pgp"},
{"application/postscript", ".ps"},
{"application/rar", ".rar"},
{"application/rtf", ".rtf"},
{"application/xml", ".xml"},
{"application/x-debian-package", ".deb"},
{"application/x-dvi", ".dvi"},
{"applixation/x-flac", ".flac"},
{"applixation/x-gzip", ".gz"},
{"application/x-java-archive", ".jar"},
{"application/x-java-vm", ".class"},
{"application/x-python-code", ".pyc"},
{"application/x-redhat-package-manager", ".rpm"},
{"application/x-rpm", ".rpm"},
{"application/x-tar", ".tar"},
{"application/x-tex-pk", ".pk"},
{"application/x-texinfo", ".texinfo"},
{"application/x-xcf", ".xcf"},
{"application/x-xfig", ".xfig"},
{"application/zip", ".zip"},
{"audio/midi", ".midi"},
{"audio/mpeg", ".mp3"},
{"audio/real", ".rm"},
{"audio/x-wav", ".wav"},
{"image/gif", ".gif"},
{"image/jpeg", ".jpg"},
{"image/pcx", ".pcx"},
{"image/png", ".png"},
{"image/tiff", ".tiff"},
{"image/x-ms-bmp", ".bmp"},
{"image/x-xpixmap", ".xpm"},
{"text/css", ".css"},
{"text/html", ".html"},
{"text/plain", ".txt"},
{"text/rtf", ".rtf"},
{"text/x-c++hdr", ".h++"},
{"text/x-c++src", ".c++"},
{"text/x-chdr", ".h"},
{"text/x-csrc", ".c"},
{"text/x-java", ".java"},
{"text/x-moc", ".moc"},
{"text/x-pascal", ".pas"},
{"text/x-perl", ".pl"},
{"text/x-python", ".py"},
{"text/x-tex", ".tex"},
{"video/avi", ".avi"},
{"video/mpeg", ".mpeg"},
{"video/quicktime", ".qt"},
{"video/real", ".rm"},
{"video/x-msvideo", ".avi"},
{NULL, NULL},
};
char *ret;
unsigned int i;
char *mime;
char *base;
const char *ext;
ret =
GNUNET_CONTAINER_meta_data_get_by_type (md,
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME);
if (ret != NULL)
return ret;
ext = NULL;
mime =
GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_MIMETYPE);
if (mime != NULL)
{
i = 0;
while ((mimeMap[i][0] != NULL) && (0 != strcmp (mime, mimeMap[i][0])))
i++;
if (mimeMap[i][1] == NULL)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
_("Did not find mime type `%s' in extension list.\n"), mime);
else
ext = mimeMap[i][1];
GNUNET_free (mime);
}
base =
GNUNET_CONTAINER_meta_data_get_first_by_types (md,
EXTRACTOR_METATYPE_TITLE,
EXTRACTOR_METATYPE_BOOK_TITLE,
EXTRACTOR_METATYPE_ORIGINAL_TITLE,
EXTRACTOR_METATYPE_PACKAGE_NAME,
EXTRACTOR_METATYPE_URL,
EXTRACTOR_METATYPE_URI,
EXTRACTOR_METATYPE_DESCRIPTION,
EXTRACTOR_METATYPE_ISRC,
EXTRACTOR_METATYPE_JOURNAL_NAME,
EXTRACTOR_METATYPE_AUTHOR_NAME,
EXTRACTOR_METATYPE_SUBJECT,
EXTRACTOR_METATYPE_ALBUM,
EXTRACTOR_METATYPE_ARTIST,
EXTRACTOR_METATYPE_KEYWORDS,
EXTRACTOR_METATYPE_COMMENT,
EXTRACTOR_METATYPE_UNKNOWN,
-1);
if ((base == NULL) && (ext == NULL))
return NULL;
if (base == NULL)
return GNUNET_strdup (ext);
if (ext == NULL)
return base;
GNUNET_asprintf (&ret, "%s%s", base, ext);
GNUNET_free (base);
return ret;
}
/* end of fs_misc.c */
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#pragma once
//==============================================================================
/**
Represents the 'success' or 'failure' of an operation, and holds an associated
error message to describe the error when there's a failure.
E.g.
@code
Result myOperation()
{
if (doSomeKindOfFoobar())
return Result::ok();
else
return Result::fail ("foobar didn't work!");
}
const Result result (myOperation());
if (result.wasOk())
{
...it's all good...
}
else
{
warnUserAboutFailure ("The foobar operation failed! Error message was: "
+ result.getErrorMessage());
}
@endcode
*/
class JUCE_API Result
{
public:
//==============================================================================
/** Creates and returns a 'successful' result. */
static Result ok() noexcept { return Result(); }
/** Creates a 'failure' result.
If you pass a blank error message in here, a default "Unknown Error" message
will be used instead.
*/
static Result fail (const String& errorMessage) noexcept;
//==============================================================================
/** Returns true if this result indicates a success. */
bool wasOk() const noexcept;
/** Returns true if this result indicates a failure.
You can use getErrorMessage() to retrieve the error message associated
with the failure.
*/
bool failed() const noexcept;
/** Returns true if this result indicates a success.
This is equivalent to calling wasOk().
*/
operator bool() const noexcept;
/** Returns true if this result indicates a failure.
This is equivalent to calling failed().
*/
bool operator!() const noexcept;
/** Returns the error message that was set when this result was created.
For a successful result, this will be an empty string;
*/
const String& getErrorMessage() const noexcept;
//==============================================================================
Result (const Result&);
Result& operator= (const Result&);
Result (Result&&) noexcept;
Result& operator= (Result&&) noexcept;
bool operator== (const Result& other) const noexcept;
bool operator!= (const Result& other) const noexcept;
private:
String errorMessage;
// The default constructor is not for public use!
// Instead, use Result::ok() or Result::fail()
Result() noexcept;
explicit Result (const String&) noexcept;
// These casts are private to prevent people trying to use the Result object in numeric contexts
operator int() const;
operator void*() const;
};
|
/* Retrieve information about a FILE stream.
Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include "freadahead.h"
#include <stdlib.h>
#include "stdio-impl.h"
size_t
freadahead (FILE *fp)
{
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
if (fp->_IO_write_ptr > fp->_IO_write_base)
return 0;
return (fp->_IO_read_end - fp->_IO_read_ptr)
+ (fp->_flags & _IO_IN_BACKUP ? fp->_IO_save_end - fp->_IO_save_base :
0);
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
if ((fp_->_flags & __SWR) != 0 || fp_->_r < 0)
return 0;
# if defined __DragonFly__
return __sreadahead (fp);
# else
return fp_->_r
+ (HASUB (fp) ? fp_->_ur : 0);
# endif
#elif defined __EMX__ /* emx+gcc */
if ((fp->_flags & _IOWRT) != 0)
return 0;
/* Note: fp->_ungetc_count > 0 implies fp->_rcount <= 0,
fp->_ungetc_count = 0 implies fp->_rcount >= 0. */
/* equivalent to
(fp->_ungetc_count == 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount) */
return (fp->_rcount > 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount);
#elif defined __minix /* Minix */
if ((fp_->_flags & _IOWRITING) != 0)
return 0;
return fp_->_count;
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
if ((fp_->_flag & _IOWRT) != 0)
return 0;
return fp_->_cnt;
#elif defined __UCLIBC__ /* uClibc */
# ifdef __STDIO_BUFFERS
if (fp->__modeflags & __FLAG_WRITING)
return 0;
return (fp->__bufread - fp->__bufpos)
+ (fp->__modeflags & __FLAG_UNGOT ? 1 : 0);
# else
return 0;
# endif
#elif defined __QNX__ /* QNX */
if ((fp->_Mode & 0x2000 /* _MWRITE */) != 0)
return 0;
/* fp->_Buf <= fp->_Next <= fp->_Rend,
and fp->_Rend may be overridden by fp->_Rsave. */
return ((fp->_Rsave ? fp->_Rsave : fp->_Rend) - fp->_Next)
+ (fp->_Mode & 0x4000 /* _MBYTE */
? (fp->_Back + sizeof (fp->_Back)) - fp->_Rback
: 0);
#elif defined __MINT__ /* Atari FreeMiNT */
if (!fp->__mode.__read)
return 0;
return (fp->__pushed_back
? fp->__get_limit - fp->__pushback_bufp + 1
: fp->__get_limit - fp->__bufp);
#elif defined EPLAN9 /* Plan9 */
if (fp->state == 4 /* WR */ || fp->rp >= fp->wp)
return 0;
return fp->wp - fp->rp;
#elif defined SLOW_BUT_NO_HACKS /* users can define this */
abort ();
return 0;
#else
#error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
#endif
}
|
#pragma once
#include "vector.h"
typedef struct type type;
typedef struct ast ast;
typedef struct sym sym;
typedef struct irFn irFn;
/**
* Symbol tags
* @see sym @see sym::tag
*/
typedef enum symTag {
symUndefined,
symScope,
///When a module is included, a module link is added to the current scope.
///Its first child is the module scope of the file included. symFind and
///symChild will look in here for symbols.
symModuleLink,
///Whenever a symbol is (legally) redeclared, it is replaced by a link in
///its original scope, and the symbol moved to the new scope. This is so
///a function implementation sees the symbols of the scope it is actually
///in, not of the first declaration. symFind and symChild work as above.
///@see symChangeParent
symLink,
symType,
symTypedef,
symStruct,
symUnion,
symEnum,
symEnumConstant,
symId,
symParam
} symTag;
/**
* Storage tags for a symbol, defining their linkage and lifetime
*/
typedef enum storageTag {
storageUndefined,
storageAuto,
storageStatic,
storageExtern
} storageTag;
/**
* Bitmask attributes for types and structs defining their operations
* @see sym::typeMask
*/
typedef enum symTypeMask {
typeNone,
///Numeric describes whether arithmetic operators can be performed
///on it. e.g. +, unary -, bitwise &
typeNumeric = 1 << 0,
///Ordinal describes whether it has a defined order, and therefore
///can be compared with <, <=, >, >=
typeOrdinal = 1 << 1,
///Equality describes whether equality can be tested with != and ==
typeEquality = 1 << 2,
///Assignment describes whether you can assign new values directly
///with =
typeAssignment = 1 << 3,
///Condition describes whether the type can be tested for boolean
///truth
typeCondition = 1 << 4,
///Combination of attributes
typeIntegral = typeNumeric | typeOrdinal | typeEquality | typeAssignment | typeCondition,
typeBool = typeEquality | typeAssignment | typeCondition,
typeStruct = typeAssignment,
typeUnion = typeAssignment,
typeEnum = typeIntegral
} symTypeMask;
/**
* A member of the symbol table.
*
* Can represent functions, structs, parameters, unnamed scopes etc
*
* @see symInit @see symEnd
*
* Owns:
* - ident
* - Its children
* - dt
* - label (if static or extern)
*/
typedef struct sym {
symTag tag;
char* ident;
///Vector of AST nodes for each declaration (inc. impls)
vector/*<const ast* >*/ decls;
///Implementation
///Points to the astFnImpl, astStruct etc, whichever relevant if any
const ast* impl;
union {
/*symId symParam symTypedef symEnumConstant*/
struct {
type* dt;
/*symId symParam*/
storageTag storage;
};
/*symType symStruct symUnion symEnum*/
struct {
///Size in bytes
int size;
///A mask defining operator capabilities
symTypeMask typeMask;
bool complete;
};
};
///Children, including parameters for functions and constants in enums
vector/*<sym*>*/ children;
sym* parent;
///Position in parent's vector
int nthChild;
union {
/*symId: storageStatic storageExtern*/
///Label associated with this symbol in the assembly
char* label;
/*symId: storageAuto symParam*/
///Offset in bytes, from the top of the stack frame or struct/union
int offset;
/*symEnumConstants*/
int constValue;
/*symStruct*/
bool hasConstFields;
};
} sym;
/**
* Initialize the symbol table
* @return the global namespace symbol
* @see symEnd
*/
sym* symInit (void);
/**
* Destroy a symbol table
*/
void symEnd (sym* global);
sym* symCreateScope (sym* parent);
sym* symCreateModuleLink (sym* parent, const sym* module);
sym* symCreateType (sym* parent, const char* ident, int size, symTypeMask typeMask);
sym* symCreateNamed (symTag tag, sym* Parent, const char* ident);
/**
* Changes the parent of a symbol, replacing it with a symLink
*/
void symChangeParent (sym* Symbol, sym* parent);
bool symIsFunction (const sym* Symbol);
const sym* symGetNthParam (const sym* fn, int n);
/**
* Attempt to find a symbol directly accessible from a scope. Will search
* inside contained enums, anon. unions but will not look at parent scopes.
* @return Symbol, or null on failure.
*/
sym* symChild (const sym* scope, const char* look);
/**
* Attempt to find a symbol visible from a scope. Will recurse up parent
* scopes.
* @return Symbol, or null on failure
*/
sym* symFind (const sym* scope, const char* look);
const char* symTagGetStr (symTag tag);
const char* storageTagGetStr (storageTag tag);
|
#ifndef RAPIDMODEL_H
#define RAPIDMODEL_H
#include <QObject>
#include <QAbstractTableModel>
#include <QSqlError>
#include <QVector>
#include <QStringList>
#include <QSqlDatabase>
namespace RapidModelNamespace
{
class RapidModel:public QAbstractTableModel
{
Q_OBJECT
public:
RapidModel (QObject * parent = 0);
~RapidModel ();
int rowCount(const QModelIndex &parent ) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
bool insertRows( int position, int count, const QModelIndex & parent = QModelIndex() );
bool removeRows(int position, int count, const QModelIndex & parent = QModelIndex());
bool submit();
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
bool setHeaderData( int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole );
QSqlError lastError();
Qt::ItemFlags flags(const QModelIndex &index) const;
void setRapidModelReady();
void setRapidModelNotReady();
bool clear();
protected slots :
void replaceValueInDatabase(const QModelIndex&,const QModelIndex&);
private:
bool removeDatabaseRows(const QStringList & idlist);
QVector<QList<QVariant> > * m_listsOfValuesbyRows;
QStringList m_headersRows;
QStringList m_headersColumns;
QSqlDatabase m_db;
bool m_ready;
};//class RapidModel
};//namespace RapidModelNamespace
#endif
|
#ifndef __NAO_CAM_THREAD_H__
#define __NAO_CAM_THREAD_H__
#include <map>
#include <string>
#include <vector>
#include <pthread.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <linux/videodev2.h>
#include <stdio.h>
#include <errno.h>
#include <string>
#include <string.h>
#include <stdlib.h>
typedef unsigned char uint8;
typedef unsigned int uint32;
#define WIDTH 640
#define HEIGHT 480
#define NUM_FRAME_BUFFERS 4
#define NCAMERA_DEVICES 2
typedef struct {
int count;
int select;
double time;
double joint[22];
} CAMERA_STATUS;
int construct_parameter_map(int fd, std::map<std::string, int> ¶mMap);
#ifdef __cplusplus
extern "C" {
#endif
void write_yuyv(uint32 *ptr, int len);
int nao_cam_thread_init();
void nao_cam_thread_cleanup();
void nao_cam_thread_camera_select(int bottom);
int nao_cam_thread_set_control(const char *name, int val);
int nao_cam_thread_get_control(const char *name);
uint32 *nao_cam_thread_get_images();
uint32 *nao_cam_thread_get_image(int select);
int nao_cam_thread_get_height();
int nao_cam_thread_get_width();
int nao_cam_thread_get_selected_camera();
#ifdef __cplusplus
}
#endif
#endif
|
#pragma once
struct dialog_contactprops_params_s
{
contact_key_s key;
bool details_tab = false;
dialog_contactprops_params_s() {}
dialog_contactprops_params_s(const contact_key_s &key, bool details_tab = false) :key(key), details_tab( details_tab ) {}
};
class dialog_contact_props_c;
template<> struct MAKE_ROOT<dialog_contact_props_c> : public _PROOT(dialog_contact_props_c)
{
dialog_contactprops_params_s prms;
MAKE_ROOT() :_PROOT(dialog_contact_props_c)() { init(RS_NORMAL_MAINPARENT); }
MAKE_ROOT(bool, const dialog_contactprops_params_s &prms) :_PROOT(dialog_contact_props_c)(), prms(prms) { init(RS_NORMAL_MAINPARENT); }
~MAKE_ROOT() {}
};
class dialog_contact_props_c : public gui_isodialog_c
{
typedef gui_isodialog_c super;
GM_RECEIVER(dialog_contact_props_c, ISOGM_V_UPDATE_CONTACT);
ts::shared_ptr<contact_root_c> contactue;
ts::str_c customname; // utf8
bool custom_name( const ts::wstr_c &, bool );
ts::str_c ccomment; // utf8
bool comment( const ts::wstr_c &, bool );
ts::str_c cgreeting; // utf8
int cgreeting_per = 60;
bool greeting( const ts::wstr_c &, bool );
bool greeting_per( const ts::wstr_c &, bool );
ts::astrings_c tags;
bool tags_handler(const ts::wstr_c &, bool );
ts::wstr_c regexp;
ts::wstr_c keywords;
bool regexp_handler( const ts::wstr_c &, bool );
bool keywords_handler( const ts::wstr_c &, bool );
int imb = 0;
keep_contact_history_e keeph = KCH_DEFAULT;
auto_accept_audio_call_e aaac = AAAC_NOT;
void history_settings( const ts::str_c& );
void aaac_settings( const ts::str_c& );
void imb_settings( const ts::str_c& );
menu_c gethistorymenu();
menu_c getaacmenu();
menu_c getmhtmenu();
menu_c imnmenu();
msg_handler_e mh = MH_NOT;
ts::wstr_c msghandler;
ts::wstr_c msghandler_p;
void msghandler_m( const ts::str_c& );
bool msghandler_h( const ts::wstr_c & t, bool );
bool msghandler_p_h( const ts::wstr_c & t, bool );
ts::wstr_c genmhi();
ts::wstr_c buildmh();
void add_det(RID lst, int index, contact_c *c);
struct cinfo_s : public ts::movable_flag<true>
{
ts::shared_ptr<contact_c> c;
UNIQUE_PTR(ts::bitmap_c) btmp;
const ts::bitmap_c *bmp = nullptr;
ts::json_c cldets;
cinfo_s() {}
private:
cinfo_s(const cinfo_s&) UNUSED;
cinfo_s &operator=(const cinfo_s&) UNUSED;
};
ts::array_inplace_t<cinfo_s, 0> infs;
cinfo_s & getinfo(contact_c *c)
{
for (cinfo_s &inf : infs)
if (inf.c == c) return inf;
cinfo_s & inf = infs.add();
inf.c = c;
return inf;
}
void update();
void fill_list();
void tags_menu(menu_c &m, ts::aint );
void tags_menu_handler(const ts::str_c&);
bool open_details_tab = false;
bool do_refresh_details = false;
bool refresh_details(RID, GUIPARAM);
void enable_refresh_details( bool f );
ts::str_c lst_ajust_height;
RID lstrid;
protected:
/*virtual*/ int unique_tag() override { return UD_CONTACTPROPS; }
/*virtual*/ void created() override;
/*virtual*/ void getbutton(bcreate_s &bcr) override;
/*virtual*/ int additions(ts::irect & border) override;
/*virtual*/ void on_confirm() override;
/*virtual*/ void tabselected(ts::uint32 mask) override;
public:
dialog_contact_props_c(MAKE_ROOT<dialog_contact_props_c> &data);
~dialog_contact_props_c();
/*virtual*/ ts::wstr_c get_name() const override;
/*virtual*/ ts::ivec2 get_min_size() const override;
/*virtual*/ bool sq_evt(system_query_e qp, RID rid, evt_data_s &data) override;
};
|
//
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
// Foundation, Inc
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef GNASH_FUNCTION2_H
#define GNASH_FUNCTION2_H
#include <vector>
#include <cassert>
#include <string>
#include "Function.h"
#include "smart_ptr.h"
// Forward declarations
namespace gnash {
class action_buffer;
class as_object;
}
namespace gnash {
/// Function2 adds extra sauce to ordinary Functions.
//
/// The Function2 was introduced in version 6 of the player. Differences from
/// ordinary functions are:
/// 1. Up to 256 local registers.
/// 2. Ability to suppress super, this, arguments
/// 3. Ability to store super, this, arguments, _global, _root, and _parent
/// in registers.
class Function2 : public Function
{
public:
enum DefineFunction2Flags
{
/// Bind one register to "this"
PRELOAD_THIS = 0x01,
/// No "this" variable accessible by name
SUPPRESS_THIS = 0x02,
/// Bind one register to "arguments"
PRELOAD_ARGUMENTS = 0x04,
/// No "argument" variable accessible by name
SUPPRESS_ARGUMENTS = 0x08,
/// Bind one register to "super"
PRELOAD_SUPER = 0x10,
/// No "super" variable accessible by name
SUPPRESS_SUPER = 0x20,
/// Bind one register to "_root"
PRELOAD_ROOT = 0x40,
/// Bind one register to "_parent"
PRELOAD_PARENT = 0x80,
/// Bind one register to "_global"
PRELOAD_GLOBAL = 256
};
// Create a function defined in a DefineFunction2 opcode.
Function2(const action_buffer& ab, as_environment& env, size_t start,
const ScopeStack& with_stack);
virtual ~Function2() {}
/// Return the number of registers to allocate for this function.
virtual boost::uint8_t registers() const {
return _registerCount;
}
void setRegisterCount(boost::uint8_t ct) {
_registerCount = ct;
}
void setFlags(boost::uint16_t flags) {
_function2Flags = flags;
}
/// Dispatch.
virtual as_value call(const fn_call& fn);
private:
/// The number of registers required.
boost::uint8_t _registerCount;
/// Used to control implicit arg register assignments
boost::uint16_t _function2Flags;
};
} // end of gnash namespace
#endif
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: sdk/game/CFireManager.h
* PURPOSE: Fire entity manager interface
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __CGAME_FIREMANAGER
#define __CGAME_FIREMANAGER
#include <CVector.h>
#include "CFire.h"
#include "CEntity.h"
class CFireManager
{
public:
virtual VOID ExtinguishPoint ( CVector & vecPosition, float fRadius )=0;
// doesn't work, use below instead
//virtual CFire * StartFire ( CEntity * entityTarget, CEntity * entityCreator, float fSize )=0;
virtual CFire * StartFire ( CVector & vecPosition, float fSize )=0;
virtual VOID ExtinguishAllFires ( )=0;
virtual CFire * GetFire ( DWORD ID )=0;
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "abstractcustomtool.h"
#include "selectionindicator.h"
#include <QHash>
#include <QPointer>
#include <QColorDialog>
namespace QmlDesigner {
class ColorTool : public QObject, public AbstractCustomTool
{
Q_OBJECT
public:
ColorTool();
~ColorTool() override;
void mousePressEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent *event) override;
void mouseDoubleClickEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent *event) override;
void hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneMouseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *keyEvent) override;
void dragLeaveEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneDragDropEvent * event) override;
void dragMoveEvent(const QList<QGraphicsItem*> &itemList,
QGraphicsSceneDragDropEvent * event) override;
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList) override;
void selectedItemsChanged(const QList<FormEditorItem*> &itemList) override;
void instancesCompleted(const QList<FormEditorItem*> &itemList) override;
void instancesParentChanged(const QList<FormEditorItem *> &itemList) override;
void instancePropertyChange(const QList<QPair<ModelNode, PropertyName> > &propertyList) override;
void clear() override;
void formEditorItemsChanged(const QList<FormEditorItem*> &itemList) override;
int wantHandleItem(const ModelNode &modelNode) const override;
QString name() const override;
private:
void colorDialogAccepted();
void colorDialogRejected();
void currentColorChanged(const QColor &color);
private:
QPointer<QColorDialog> m_colorDialog;
FormEditorItem *m_formEditorItem = nullptr;
QColor m_oldColor;
QString m_oldExpression;
};
}
|
//____________________________________________________________________________
/*!
\class genie::IBDInteractionListGenerator
\brief Generates a list of all the interactions that can be generated by the
VLE SV QEL Nu-Nucleon generator
\author Corey Reed <cjreed \at nikhef.nl>
Nikhef
\created Jun 26, 2009
\cpright Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
For the full text of the license visit http://copyright.genie-mc.org
or see $GENIE/LICENSE
*/
//____________________________________________________________________________
#ifndef _INVERSEBETADECAY_INTERACTION_GENERATOR_H_
#define _INVERSEBETADECAY_INTERACTION_GENERATOR_H_
#include "EVGCore/InteractionListGeneratorI.h"
namespace genie {
class IBDInteractionListGenerator : public InteractionListGeneratorI {
private:
void LoadConfigData(void);
public :
IBDInteractionListGenerator();
IBDInteractionListGenerator(string config);
virtual ~IBDInteractionListGenerator();
//-- implement the InteractionListGeneratorI interface
InteractionList * CreateInteractionList(const InitialState & init) const;
// overload the Algorithm::Configure() methods to load private data
// members from configuration options
void Configure(const Registry & config);
void Configure(string config);
};
} // genie namespace
#endif // _SVQELNUNUCLEON_INTERACTION_GENERATOR_H_
|
/* System description file for hpux version 10.20.
Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs 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.
GNU Emacs 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 Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define RUN_TIME_REMAP
/*
* Define symbols to identify the version of Unix this is.
* Define all the symbols that apply correctly.
*/
#define USG /* System III, System V, etc */
#define USG5
#define HPUX
/* SYSTEM_TYPE should indicate the kind of system you are using.
It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "hpux"
/* Letter to use in finding device name of first pty,
if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */
#define FIRST_PTY_LETTER 'p'
/*
* Define HAVE_TERMIO if the system provides sysV-style ioctls
* for terminal control.
*/
#define HAVE_TERMIO
/*
* Define HAVE_PTYS if the system supports pty devices.
*/
#define HAVE_PTYS
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
/* Define this symbol if your system has the functions bcopy, etc.
* s800 and later versions of s300 (s200) kernels have equivalents
* of the BSTRING functions of BSD. If your s200 kernel doesn't have
* em comment out this section.
*/
#define BSTRING
/* Define CLASH_DETECTION if you want lock files to be written
so that Emacs can tell instantly when you try to modify
a file that someone else has modified in his Emacs. */
#define CLASH_DETECTION
/* The symbol in the kernel where the load average is found
depends on the cpu type, so we let the m- files define LDAV_SYMBOL. */
/* Special hacks needed to make Emacs run on this system. */
/* Use the system provided termcap(3) library */
#define TERMINFO
/* In hpux, the symbol SIGIO is defined, but the feature
doesn't work in the way Emacs needs it to. */
#define BROKEN_SIGIO
/* Some additional system facilities exist. */
#define HAVE_PERROR /* Delete this line for version 6. */
/* This is how to get the device name of the tty end of a pty. */
#define PTY_TTY_NAME_SPRINTF \
sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
/* This is how to get the device name of the control end of a pty. */
#define PTY_NAME_SPRINTF \
sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);
/* This triggers a conditional in xfaces.c. */
#define XOS_NEEDS_TIME_H
/* Don't use shared libraries. unexec doesn't handle them.
Note GCC automatically passes -a archive to ld, and it has its own
conflicting -a. */
#define LD_SWITCH_SYSTEM_TEMACS
#ifndef HAVE_LIBXMU
/* HP-UX doesn't supply Xmu. */
#define LIBXMU
#endif
/* Assar Westerlund <assar@sics.se> says this is necessary for
HP-UX 10.20, and that it works for HP-UX 0 as well. */
#define NO_EDITRES
/* Tested in getloadavg.c. */
#define HAVE_PSTAT_GETDYNAMIC
/* Eric Backus <ericb@lsid.hp.com> says, HP-UX 9.x on HP 700 machines
has a broken `rint' in some library versions including math library
version number A.09.05.
You can fix the math library by installing patch number PHSS_4630.
But we can fix it more reliably for Emacs like this. */
#undef HAVE_RINT
/* We have to go this route, rather than hpux9's approach of renaming the
functions via macros. The system's stdlib.h has fully prototyped
declarations, which yields a conflicting definition of srand48; it
tries to redeclare what was once srandom to be srand48. So we go
with HAVE_LRAND48 being defined. */
#undef srandom
#undef random
#undef HAVE_RANDOM
/* AlainF 20-Jul-1996 says this is right. */
#define KERNEL_FILE "/stand/vmunix"
#define LIBS_SYSTEM -l:libdld.sl
/* Rainer Malzbender <rainer@displaytech.com> says definining
HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20
using GCC. */
#ifndef HAVE_XRMSETDATABASE
#define HAVE_XRMSETDATABASE
#endif
/* Make sure we get select from libc rather than from libcurses
because libcurses on HPUX 10.10 has a broken version of select.
We used to use -lc -lcurses, but this may be cleaner. */
#define LIBS_TERMCAP -ltermcap
/* However, HPUX 10 puts Xaw and Xmu in a strange place
(if you install them at all). So search that place. */
#define C_SWITCH_X_SYSTEM -I/usr/include/X11R6 -I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/contrib/X11R6/include -I/usr/contrib/X11R5/include
#define LD_SWITCH_X_DEFAULT -L/usr/lib/X11R6 -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 -L/usr/contrib/X11R5/lib
/* 2000-11-21: Temporarily disable Unix 98 large file support found by
configure. It fails on HPUX 11, at least, because it enables
header sections which lose when `static' is defined away, as it is
on HP-UX. (You get duplicate symbol errors on linking). */
#undef _FILE_OFFSET_BITS
/* otherwise sigunblock wont be defined */
#define POSIX_SIGNALS
/* arch-tag: 8d8dcbf1-ca9b-48a1-94be-b750de18a5c6
(do not change this comment) */
|
#pragma once
#include <Windows.h>
#include <SDKDDKVer.h>
#include <stdio.h>
#include <tchar.h>
#include "Mmsystem.h"
#include <string>
typedef struct __WAVEDESCR
{
BYTE riff[4];
DWORD size;
BYTE wave[4];
} _WAVEDESCR, *_LPWAVEDESCR;
typedef struct __WAVEFORMAT
{
BYTE id[4];
DWORD size;
SHORT format;
SHORT channels;
DWORD sampleRate;
DWORD byteRate;
SHORT blockAlign;
SHORT bitsPerSample;
} _WAVEFORMAT, *_LPWAVEFORMAT;
class CWave
{
public:
CWave(void);
virtual ~CWave(void);
public:
// Public methods
BOOL Load(std::string wavFile);
BOOL IsValid() {return (m_lpData != NULL);}
LPBYTE GetData() {return m_lpData;}
DWORD GetSize() {return m_dwSize;}
SHORT GetChannels() {return m_Format.channels;}
DWORD GetSampleRate() {return m_Format.sampleRate;}
SHORT GetBitsPerSample() {return m_Format.bitsPerSample;}
private:
// Private members
_WAVEDESCR m_Descriptor;
_WAVEFORMAT m_Format;
LPBYTE m_lpData;
DWORD m_dwSize;
HWAVEOUT m_hWaveout;
WAVEHDR m_WaveHeader;
BOOL m_bStopped;
BOOL m_bPaused;
};
|
/*****************************************************************************
* Copyright 2015-2016 Alexander Barthel albar965@mailbox.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef LITTLELOGBOOK_EXPORTER_H
#define LITTLELOGBOOK_EXPORTER_H
#include <QObject>
namespace atools {
namespace gui {
class Dialog;
class ErrorHandler;
}
}
class Controller;
class QWidget;
class QSqlRecord;
/*
* Base for all export classes.
*/
class Exporter :
public QObject
{
Q_OBJECT
public:
Exporter(QWidget *parentWidget, Controller *controllerObj);
virtual ~Exporter();
virtual int exportAll(bool open) = 0;
virtual int exportSelected(bool open) = 0;
protected:
QWidget *parentWidget = nullptr;
Controller *controller = nullptr;
atools::gui::Dialog *dialog = nullptr;
atools::gui::ErrorHandler *errorHandler = nullptr;
/* Get table header names with any LF or dash cleaned out */
QStringList headerNames(int cnt);
QStringList headerNames(int cnt, const QVector<int>& visualToIndex);
/* Open document with application */
void openDocument(const QString& file);
/* Create an index mapping physical to logical column numbers */
void createVisualColumnIndex(int cnt, QVector<int>& visualToIndex);
/* Create an SQL record from column names and values */
void fillRecord(const QVariantList& values, const QStringList& cols, QSqlRecord& rec);
};
#endif // LITTLELOGBOOK_EXPORTER_H
|
#include "settings.h"
#include <Eet.h>
#include <assert.h>
static Eet_Data_Descriptor *lv_settings_desc;
static Eet_Data_Descriptor *lv_fc_rule_desc;
static int inits = 0;
static const char *filename = "/home/hendrik/.config/limeviewrc.eet";
void lv_settings_init(void)
{
inits++;
if (inits > 1)
return;
Eet_Data_Descriptor_Class eddc_rule;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc_rule, Default_Fc_Rule);
lv_fc_rule_desc = eet_data_descriptor_stream_new(&eddc_rule);
#define MY_CONF_ADD_BASIC(member, eet_type) \
EET_DATA_DESCRIPTOR_ADD_BASIC \
(lv_fc_rule_desc, Default_Fc_Rule, # member, member, eet_type)
MY_CONF_ADD_BASIC(cam, EET_T_STRING);
MY_CONF_ADD_BASIC(format, EET_T_STRING);
MY_CONF_ADD_BASIC(fc, EET_T_STRING);
#undef MY_CONF_ADD_BASIC
Eet_Data_Descriptor_Class eddc_settings;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc_settings, Limeview_Settings);
lv_settings_desc = eet_data_descriptor_stream_new(&eddc_settings);
#define MY_CONF_ADD_BASIC(member, eet_type) \
EET_DATA_DESCRIPTOR_ADD_BASIC \
(lv_settings_desc, Limeview_Settings, # member, member, eet_type)
MY_CONF_ADD_BASIC(version, EET_T_UINT);
MY_CONF_ADD_BASIC(cache_size, EET_T_UINT);
MY_CONF_ADD_BASIC(high_quality_delay, EET_T_UINT);
#undef MY_CONF_ADD_BASIC
EET_DATA_DESCRIPTOR_ADD_LIST(lv_settings_desc, Limeview_Settings, "default_fc_rules", default_fc_rules,
lv_fc_rule_desc);
}
void lv_settings_shutdown(void)
{
assert(inits);
inits--;
if (inits)
return;
eet_data_descriptor_free(lv_settings_desc);
eet_data_descriptor_free(lv_fc_rule_desc);
}
Limeview_Settings *lv_setting_new(void)
{
Limeview_Settings *s = calloc(sizeof(Limeview_Settings), 1);
s->version = 1;
s->cache_size = 100;
return s;
}
void lv_setting_free(Limeview_Settings *s)
{
free(s);
}
Limeview_Settings *lv_setting_load(void)
{
Limeview_Settings *s;
Eet_File *ef = eet_open(filename, EET_FILE_MODE_READ);
if (!ef) {
printf("configuration in \"%s\" does not exist or not valid eet file\n", filename);
return lv_setting_new();
}
s = eet_data_read(ef, lv_settings_desc, "config");
if (!s) {
printf("configuration in \"%s\" is not valid\n", filename);
eet_close(ef);
return lv_setting_new();
}
assert(s->version == 1);
return s;
}
void lv_setting_save(Limeview_Settings *s)
{
char tmp[PATH_MAX];
Eet_File *ef;
Eina_Bool ret;
unsigned int i, len;
struct stat st;
len = eina_strlcpy(tmp, filename, sizeof(tmp));
if (len + 12 >= (int)sizeof(tmp)) {
fprintf(stderr, "ERROR: file name is too big: %s\n", filename);
return;
}
i = 0;
do {
snprintf(tmp + len, 12, ".%u", i);
i++;
}
while (stat(tmp, &st) == 0);
ef = eet_open(tmp, EET_FILE_MODE_WRITE);
if (!ef) {
fprintf(stderr, "ERROR: could not open '%s' for write\n", tmp);
return;
}
ret = eet_data_write(ef, lv_settings_desc, "config", s, EINA_TRUE);
eet_close(ef);
if (ret) {
unlink(filename);
rename(tmp, filename);
}
else {
fprintf(stderr, "ERROR: while writing temporary config to '%s', leaving old config in place\n", tmp);
}
}
|
// CkMessageSetW.h: interface for the CkMessageSetW class.
//
//////////////////////////////////////////////////////////////////////
// This header is generated for Chilkat v9.5.0
#ifndef _CkMessageSetW_H
#define _CkMessageSetW_H
#include "chilkatDefs.h"
#include "CkString.h"
#include "CkWideCharBase.h"
class CkTaskW;
#if !defined(__sun__) && !defined(__sun)
#pragma pack (push, 8)
#endif
// CLASS: CkMessageSetW
class CK_VISIBLE_PUBLIC CkMessageSetW : public CkWideCharBase
{
private:
// Don't allow assignment or copying these objects.
CkMessageSetW(const CkMessageSetW &);
CkMessageSetW &operator=(const CkMessageSetW &);
public:
CkMessageSetW(void);
virtual ~CkMessageSetW(void);
static CkMessageSetW *createNew(void);
void CK_VISIBLE_PRIVATE inject(void *impl);
// May be called when finished with the object to free/dispose of any
// internal resources held by the object.
void dispose(void);
// BEGIN PUBLIC INTERFACE
// ----------------------
// Properties
// ----------------------
// The number of message UIDs (or sequence numbers) in this message set.
int get_Count(void);
// If true then the message set contains UIDs, otherwise it contains sequence
// numbers.
bool get_HasUids(void);
// If true then the message set contains UIDs, otherwise it contains sequence
// numbers.
void put_HasUids(bool newVal);
// ----------------------
// Methods
// ----------------------
// Returns true if the msgId is contained in the message set.
bool ContainsId(int id);
// Loads the message set from a compact-string representation. Here are some
// examples:
//
// Non-Compact String
//
// Compact String
//
// 1,2,3,4,5
//
// 1:5
//
// 1,2,3,4,5,8,9,10
//
// 1:5,8:10
//
// 1,3,4,5,8,9,10
//
// 1,3:5,8:10
//
bool FromCompactString(const wchar_t *str);
// Returns the message ID of the Nth message in the set. (indexing begins at 0).
// Returns -1 if the index is out of range.
int GetId(int index);
// Inserts a message ID into the set. If the ID already exists, a duplicate is not
// inserted.
void InsertId(int id);
// Loads the message set from a completed asynchronous task.
bool LoadTaskResult(CkTaskW &task);
// Removes a message ID from the set.
void RemoveId(int id);
// Returns a string of comma-separated message IDs. (This is the non-compact string
// format.)
bool ToCommaSeparatedStr(CkString &outStr);
// Returns a string of comma-separated message IDs. (This is the non-compact string
// format.)
const wchar_t *toCommaSeparatedStr(void);
// Returns the set of message IDs represented as a compact string. Here are some
// examples:
//
// Non-Compact String
//
// Compact String
//
// 1,2,3,4,5
//
// 1:5
//
// 1,2,3,4,5,8,9,10
//
// 1:5,8:10
//
// 1,3,4,5,8,9,10
//
// 1,3:5,8:10
//
bool ToCompactString(CkString &outStr);
// Returns the set of message IDs represented as a compact string. Here are some
// examples:
//
// Non-Compact String
//
// Compact String
//
// 1,2,3,4,5
//
// 1:5
//
// 1,2,3,4,5,8,9,10
//
// 1:5,8:10
//
// 1,3,4,5,8,9,10
//
// 1,3:5,8:10
//
const wchar_t *toCompactString(void);
// END PUBLIC INTERFACE
};
#if !defined(__sun__) && !defined(__sun)
#pragma pack (pop)
#endif
#endif
|
/*****************************************************************************
* Copyright 2015-2020 Alexander Barthel alex@littlenavmap.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef ATOOLS_BGL_AIRPORTTAXIPOINT_H
#define ATOOLS_BGL_AIRPORTTAXIPOINT_H
#include "fs/bgl/bglposition.h"
#include "fs/bgl/ap/parking.h"
#include "fs/bgl/ap/parking.h"
#include "fs/bgl/record.h"
#include <QString>
namespace atools {
namespace io {
class BinaryStream;
}
}
namespace atools {
namespace fs {
namespace bgl {
namespace taxipoint {
enum PointType
{
UNKNOWN = 0,
NORMAL = 1,
HOLD_SHORT = 2,
ILS_HOLD_SHORT = 4,
HOLD_SHORT_NO_DRAW = 5, // TODO wiki add
ILS_HOLD_SHORT_NO_DRAW = 6, // TODO wiki add
PARKING /* not a BGL type */
};
/* Orientation of a hold short point */
enum PointDir
{
UNKNOWN_DIR = 0,
FORWARD = 1,
REVERSE = 2
};
}
/*
* Start or end point of a taxiway segment.
*/
class TaxiPoint
{
public:
TaxiPoint();
TaxiPoint(atools::io::BinaryStream *bs, atools::fs::bgl::StructureType structureType);
TaxiPoint(const atools::fs::bgl::Parking& parking);
atools::fs::bgl::taxipoint::PointType getType() const
{
return type;
}
/*
* @return get orientation of a hold short point (only valid for hold short point types)
*/
atools::fs::bgl::taxipoint::PointDir getOrientation() const
{
return dir;
}
const atools::fs::bgl::BglPosition& getPosition() const
{
return pos;
}
/*
* @return get parking record class. Only valid if type is PARKING.
*/
const atools::fs::bgl::Parking& getParking() const
{
return parking;
}
static QString pointTypeToString(atools::fs::bgl::taxipoint::PointType type);
static QString dirToString(atools::fs::bgl::taxipoint::PointDir dir);
private:
friend QDebug operator<<(QDebug out, const TaxiPoint& record);
atools::fs::bgl::taxipoint::PointType type = atools::fs::bgl::taxipoint::UNKNOWN;
atools::fs::bgl::taxipoint::PointDir dir = atools::fs::bgl::taxipoint::UNKNOWN_DIR;
atools::fs::bgl::BglPosition pos;
atools::fs::bgl::Parking parking;
};
QDebug operator<<(QDebug out, const atools::fs::bgl::TaxiPoint& record);
} // namespace bgl
} // namespace fs
} // namespace atools
#endif // ATOOLS_BGL_AIRPORTTAXIPOINT_H
|
/* gw-init-documents.h
*
* Copyright (C) 2017 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* This file 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 file 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 General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "languages/C/gw-document-fallback.h"
|
/*
* ExploitMe #2
*/
#include<stdio.h>
#include<string.h>
int checkpass(char *p);
int main(int argc, char **argv)
{
printf("ExploitMe - Mission 2\n");
if(argc != 2)
{
printf("Please provide a password...\n");
return 1;
}
if(checkpass(argv[1]))
printf("Access granted!\n");
else
printf("Access denied!\n");
return 0;
}
int checkpass(char *p)
{
char pass[30];
strcpy(pass, p);
if(strcmp(pass, "stupidlyinsecure") == 0)
return 1;
return 0;
}
|
//
// LJXPhotoAlbum.h
// LJXPhotoAlbum
//
// Created by jianxin.li on 16/4/14.
// Copyright © 2016年 m6go.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void (^PhotoBlock)(UIImage *image);
@interface LJXPhotoAlbum : NSObject
- (void)getPhotoAlbumOrTakeAPhotoWithController:(UIViewController *)Controller
andWithBlock:(PhotoBlock)photoBlock;
@end
|
//
// BLE-Bridging-Header.h
// BLE
//
// Created by Juan Haladjian on 19/02/16.
// Copyright © 2016 TUM. All rights reserved.
//
#ifndef BLE_Bridging_Header_h
#define BLE_Bridging_Header_h
#import "BLEDiscovery.h"
#endif /* BLE_Bridging_Header_h */
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "deployablefile.h"
#include "projectexplorer_export.h"
#include <utils/environment.h>
#include <QList>
namespace ProjectExplorer {
enum class DeploymentKnowledge { Perfect, Approximative, Bad };
class PROJECTEXPLORER_EXPORT MakeInstallCommand
{
public:
Utils::FilePath command;
QStringList arguments;
Utils::Environment environment;
};
class PROJECTEXPLORER_EXPORT DeploymentData
{
public:
void setFileList(const QList<DeployableFile> &files) { m_files = files; }
QList<DeployableFile> allFiles() const { return m_files; }
void setLocalInstallRoot(const Utils::FilePath &installRoot);
Utils::FilePath localInstallRoot() const { return m_localInstallRoot; }
void addFile(const DeployableFile &file);
void addFile(const Utils::FilePath &localFilePath, const QString &remoteDirectory,
DeployableFile::Type type = DeployableFile::TypeNormal);
QString addFilesFromDeploymentFile(const QString &deploymentFilePath, const QString &sourceDir);
int fileCount() const { return m_files.count(); }
DeployableFile fileAt(int index) const { return m_files.at(index); }
DeployableFile deployableForLocalFile(const Utils::FilePath &localFilePath) const;
bool operator==(const DeploymentData &other) const;
private:
QList<DeployableFile> m_files;
Utils::FilePath m_localInstallRoot;
};
inline bool operator!=(const DeploymentData &d1, const DeploymentData &d2) { return !(d1 == d2); }
} // namespace ProjectExplorer
|
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Client side CTeam class
//
// $NoKeywords: $
//=============================================================================//
#ifndef C_TEAM_H
#define C_TEAM_H
#ifdef _WIN32
#pragma once
#endif
#include "shareddefs.h"
#include "utlvector.h"
#include "client_thinklist.h"
class C_BasePlayer;
class C_Team : public C_BaseEntity
{
DECLARE_CLASS( C_Team, C_BaseEntity );
public:
DECLARE_CLIENTCLASS();
DECLARE_PREDICTABLE();
C_Team();
virtual ~C_Team();
virtual void PreDataUpdate( DataUpdateType_t updateType );
// Data Handling
virtual char *Get_Name( void );
virtual int Get_Deaths( void );
virtual int Get_Ping( void );
// Player Handling
virtual int Get_Number_Players( void );
virtual bool ContainsPlayer( int iPlayerIndex );
C_BasePlayer* GetPlayer( int idx );
// for shared code, use the same function name
virtual int GetNumPlayers( void ) { return Get_Number_Players(); }
int GetTeamNumber() const;
virtual int GetMatchScore( void );
virtual int GetRoundScore(void) { return m_iRoundScore; }
void RemoveAllPlayers();
// IClientThinkable overrides.
public:
virtual void ClientThink();
public:
// Data received from the server
CUtlVector< int > m_aPlayers;
char m_szTeamname[ MAX_TEAM_NAME_LENGTH ];
int m_iMatchScore;
int m_iRoundScore;
// Data for the scoreboard
int m_iDeaths;
int m_iPing;
int m_iPacketloss;
int m_iTeamNum;
};
// Global list of client side team entities
extern CUtlVector< C_Team * > g_Teams;
// Global team handling functions
C_Team *GetLocalTeam( void );
C_Team *GetGlobalTeam( int iTeamNumber );
C_Team *GetPlayersTeam( int iPlayerIndex );
C_Team *GetPlayersTeam( C_BasePlayer *pPlayer );
bool ArePlayersOnSameTeam( int iPlayerIndex1, int iPlayerIndex2 );
extern int GetNumberOfTeams( void );
#endif // C_TEAM_H
|
/*
* Copyright (C) 2009-2012 Free Software Foundation, Inc.
*
* Author: Jonathan Bastien-Filiatrault
*
* This file is part of GNUTLS.
*
* The GNUTLS 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 program. If not, see <http://www.gnu.org/licenses/>
*
*/
#ifndef GNUTLS_MBUFFERS_H
#define GNUTLS_MBUFFERS_H
#include <gnutls_int.h>
#include <gnutls_errors.h>
void _mbuffer_head_init (mbuffer_head_st * buf);
void _mbuffer_head_clear (mbuffer_head_st * buf);
void _mbuffer_enqueue (mbuffer_head_st * buf, mbuffer_st * bufel);
mbuffer_st* _mbuffer_dequeue (mbuffer_head_st * buf, mbuffer_st * bufel);
int _mbuffer_head_remove_bytes (mbuffer_head_st * buf, size_t bytes);
mbuffer_st *_mbuffer_alloc (size_t payload_size, size_t maximum_size);
mbuffer_st *_mbuffer_head_get_first (mbuffer_head_st * buf, gnutls_datum_t * msg);
mbuffer_st *_mbuffer_head_get_next (mbuffer_st * cur, gnutls_datum_t * msg);
mbuffer_st *
_mbuffer_head_pop_first (mbuffer_head_st * buf);
/* This is dangerous since it will replace bufel with a new
* one.
*/
int _mbuffer_append_data (mbuffer_st * bufel, void *newdata,
size_t newdata_size);
int _mbuffer_linearize (mbuffer_head_st * buf);
/* For "user" use. One can have buffer data and header.
*/
inline static void
_mbuffer_set_udata (mbuffer_st * bufel, void *data, size_t data_size)
{
memcpy (bufel->msg.data + bufel->mark + bufel->user_mark, data, data_size);
bufel->msg.size = data_size + bufel->user_mark + bufel->mark;
}
inline static void *
_mbuffer_get_uhead_ptr (mbuffer_st * bufel)
{
return bufel->msg.data + bufel->mark;
}
inline static void *
_mbuffer_get_udata_ptr (mbuffer_st * bufel)
{
return bufel->msg.data + bufel->user_mark + bufel->mark;
}
inline static void
_mbuffer_set_udata_size (mbuffer_st * bufel, size_t size)
{
bufel->msg.size = size + bufel->user_mark + bufel->mark;
}
inline static size_t
_mbuffer_get_udata_size (mbuffer_st * bufel)
{
return bufel->msg.size - bufel->user_mark - bufel->mark;
}
/* discards size bytes from the begging of the buffer */
inline static void
_mbuffer_consume (mbuffer_head_st* buf, mbuffer_st * bufel, size_t size)
{
bufel->user_mark = 0;
if (bufel->mark+size < bufel->msg.size)
bufel->mark += size;
else
bufel->mark = bufel->msg.size;
buf->byte_length -= size;
}
inline static size_t
_mbuffer_get_uhead_size (mbuffer_st * bufel)
{
return bufel->user_mark;
}
inline static void
_mbuffer_set_uhead_size (mbuffer_st * bufel, size_t size)
{
bufel->user_mark = size;
}
inline static mbuffer_st *
_gnutls_handshake_alloc (gnutls_session_t session, size_t size, size_t maximum)
{
mbuffer_st *ret = _mbuffer_alloc (HANDSHAKE_HEADER_SIZE(session) + size,
HANDSHAKE_HEADER_SIZE(session) + maximum);
if (!ret)
return NULL;
_mbuffer_set_uhead_size (ret, HANDSHAKE_HEADER_SIZE(session));
return ret;
}
/* Free a segment, if the pointer is not NULL
*
* We take a ** to detect and fix double free bugs (the dangling
* pointer case). It also makes sure the pointer has a known value
* after freeing.
*/
inline static void
_mbuffer_xfree (mbuffer_st ** bufel)
{
if (*bufel)
gnutls_free (*bufel);
*bufel = NULL;
}
#endif
|
//////////////////////////////////////////////////////////////////////////////////
//
// B L I N K
//
// Copyright (C) 2016-2019 Blink Mobile Shell Project
//
// This file is part of Blink.
//
// Blink 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.
//
// Blink 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 Blink. If not, see <http://www.gnu.org/licenses/>.
//
// In addition, Blink is also subject to certain additional terms under
// GNU GPL version 3 section 7.
//
// You should have received a copy of these additional terms immediately
// following the terms and conditions of the GNU General Public License
// which accompanied the Blink Source Code. If not, see
// <http://www.github.com/blinksh/blink>.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef xcall_h
#define xcall_h
@interface BlinkXCall: NSObject
@property NSString *callID;
@property BOOL async;
@property BOOL verbose;
@property NSURL *xURL;
@property NSURL *xCallbackURL;
@property NSURL *xSuccessURL;
@property NSURL *xErrorURL;
@property NSURL *xCancelURL;
@property NSURL *xOriginalSuccessURL;
@property NSURL *xOriginalErrorURL;
@property NSURL *xOriginalCancelURL;
@property NSMutableArray<NSArray<NSString *> *> *parseOutputParams; // [<paramName>, <decoder:json|base64>]
@property NSMutableArray<NSArray<NSString *> *> *encodeInputParams; // [<paramName>, <value>]
@property NSString *stdInParameterName;
@end
void blink_xcall(NSURL *url);
void blink_handle_url(NSURL *url);
#endif /* xcall_h */
|
/* QWinFF - a qt4 gui frontend for ffmpeg
* Copyright (C) 2011-2013 Timothy Lin <lzh9102@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPTIONSDIALOG_H
#define OPTIONSDIALOG_H
#include <QDialog>
namespace Ui {
class OptionsDialog;
}
class OptionsDialog : public QDialog
{
Q_OBJECT
public:
explicit OptionsDialog(QWidget *parent = 0);
~OptionsDialog();
int exec();
int exec_tools();
private:
Ui::OptionsDialog *ui;
void read_fields();
void write_fields();
};
#endif // OPTIONSDIALOG_H
|
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997,2007 Oracle. All rights reserved.
*
* $Id: os_yield.c,v 12.14 2007/05/17 15:15:46 bostic Exp $
*/
#include "db_config.h"
#include "db_int.h"
#ifdef HAVE_SYSTEM_INCLUDE_FILES
#if defined(HAVE_SCHED_YIELD)
#include <sched.h>
#endif
#endif
/*
* __os_yield --
* Yield the processor.
*
* PUBLIC: void __os_yield __P((DB_ENV *));
*/
void
__os_yield(dbenv)
DB_ENV *dbenv;
{
if (DB_GLOBAL(j_yield) != NULL) {
(void)DB_GLOBAL(j_yield)();
return;
}
#if defined(HAVE_MUTEX_UI_THREADS)
thr_yield();
#elif defined(HAVE_PTHREAD_YIELD) && \
(defined(HAVE_MUTEX_PTHREADS) || defined(HAVE_PTHREAD_API))
pthread_yield();
#elif defined(HAVE_SCHED_YIELD)
(void)sched_yield();
#elif defined(HAVE_YIELD)
yield();
#else
__os_sleep(dbenv, 0, 1);
#endif
COMPQUIET(dbenv, NULL);
}
|
/*!
@file L1DF3WriteEntry.h
@verbatim
$Id: L1DF3WriteEntry.h 58500 2009-02-18 19:45:46Z jbraness $
Copyright (c) 2006-2008 DivX, Inc. All rights reserved.
This software is the confidential and proprietary information of
DivX, Inc. and may be used only in accordance with the terms of
your license from DivX, Inc.
@endverbatim
**/
#ifndef _L1DF3WRITEENTRY_H_
#define _L1DF3WRITEENTRY_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "DivXInt.h"
#include "DivXMem.h"
#include "DivXString.h"
#include "DMFVariant.h"
#include "DMFBlockType.h"
#include "DMFBlockNode.h"
#include "L1ContainerHandle.h"
#include "DMFModuleInfo.h"
/*! Initializes the DF3 module
@param data (IN) - Pointer to DMFModuleInitStruct containing initialization values
@return int32_t (OUT) - Returns 0 for success 1 for failure
*/
int32_t L1DF3w_Init( const void *data );
/*! Retrieves module info for given Module
@param ModuleID (IN) - Unique module ID
@return pointer to DMFModuleInfo associated with ModuleID
@retval NULL if Module could be found
*/
DMFModuleInfo *L1DF3w_GetDMFModuleInfo( int32_t ModuleID );
/*! Retrieves the DMFModuleAttributes from module
@return DMFModuleAttributes (OUT) - Returns the DMFModuleAttributes struct
describing modules capabilities
*/
DMFModuleAttributes *L1DF3w_GetCaps( void );
/*! Checks if the container is supported
@param SupportLevel (OUT) - Pointer to support level of the container
@param Filename (IN) - File name of the container to open
@return DivXError (OUT) - See DivXError.h for more details
*/
DivXError L1DF3w_IsContainerSupported( int32_t *SupportLevel,
const DivXString *Filename );
#ifdef __cplusplus
}
#endif
#endif /* _L1DF3WRITEENTRY_H_ */
|
#pragma once
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <stdarg.h>
using namespace std;
//DEBUG LOG LEVELS
#define DEBUGLOG_LEVEL_ALL 0x0006
#define DEBUGLOG_LEVEL_DEBUG 0x0004
#define DEBUGLOG_LEVEL_WARNING 0x0003
#define DEBUGLOG_LEVEL_ERROR 0x0002
#define DEBUGLOG_LEVEL_FATAL 0x0001
#define DEBUGLOG_LEVEL_INFO 0x0005
#define DEBUGLOG_ALL "ALL"
#define DEBUGLOG_WARNING "WARN"
#define DEBUGLOG_ERROR "ERROR"
#define DEBUGLOG_DEBUG "DEBUG"
#define DEBUGLOG_FATAL "FATAL"
#define DEBUGLOG_INFO "INFO"
#define DEBUGLOG_DEFAULT_FILE "Logs\\default.txt"
class CLog
{
public:
CLog(const char* file = DEBUGLOG_DEFAULT_FILE);
~CLog();
//If true then logs will be printed to the command window
void CMDLog(bool cmdLog);
//Set what type of messages to log
void SetLogLevel(unsigned int level);
//Set the file to save logs to (default is "Logs\\default.txt")
void SetLogFile(string file);
//Creates an entry in the debug log
void Log(const void* src_obj, unsigned int level, const char* format, ...);
void Log(const void* src_obj, unsigned int level, const char* format, va_list args);
//Get the Log Level String definition
const char* GetLLString(unsigned int LL);
//Get the lof level index from string definition
unsigned int GetLLIndex(const char* str);
//set whether to append debug log or clear it
void OpenClean(bool b);
private:
//Print Log Header
void PrintHeader();
//Print Log Footer
void PrintFooter();
//Creates the log signature and stores it in the 'm_sSignature' member
void GetSignature(const void* src_obj, unsigned int level);
//Prints the formatted string to the log file
void PrintToFile(bool bPrintSignature, const char* format, va_list args) const;
void PrintToFileF(bool bPrintSignature, const char* format, ...) const;
//Prints the formatted string to the console
void PrintToConsole(bool bPrintSignature, const char* format, va_list args) const;
void PrintToConsoleF(bool bPrintSignature, const char* format, ...) const;
string m_sFile;
string m_sSignature;
bool m_bPrint_time;
bool m_bCmd_log;
unsigned int m_log_level;
char m_log_time[50];
bool m_bClear;
};
extern CLog _LOG;
void Log(const void* src_obj, unsigned int level, const char* format, ...); |
/**************************************************************************
Lightspark, a free flash player implementation
Copyright (C) 2009-2013 Alessandro Pignotti (a.pignotti@sssup.it)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
#ifndef SCRIPTING_TOPLEVEL_BOOLEAN_H
#define SCRIPTING_TOPLEVEL_BOOLEAN_H 1
#include "asobject.h"
namespace lightspark
{
/* returns a fully inialized Boolean object with value b
* like Class<Boolean>::getInstanceS(b) but without the constructor problems */
Boolean* abstract_b(bool b);
/* implements ecma3's ToBoolean() operation, see section 9.2, but returns the value instead of an Boolean object */
bool Boolean_concrete(const ASObject* obj);
class Boolean: public ASObject
{
public:
Boolean(Class_base* c, bool v=false):ASObject(c),val(v) {type=T_BOOLEAN;}
static void sinit(Class_base*);
static void buildTraits(ASObject* o){};
bool val;
int32_t toInt()
{
return val ? 1 : 0;
}
bool isEqual(ASObject* r);
TRISTATE isLess(ASObject* r);
ASFUNCTION(_constructor);
ASFUNCTION(_toString);
ASFUNCTION(_valueOf);
ASFUNCTION(generator);
//Serialization interface
void serialize(ByteArray* out, std::map<tiny_string, uint32_t>& stringMap,
std::map<const ASObject*, uint32_t>& objMap,
std::map<const Class_base*, uint32_t>& traitsMap);
};
}
#endif /* SCRIPTING_TOPLEVEL_BOOLEAN_H */
|
#ifdef TI83P
# include <ti83pdefs.h>
# include <ti83p.h>
void CpyTo2FPS5() __naked
{
__asm
push iy
push ix
push hl
push de
push bc
push af
ld iy,#flags___dw
BCALL(_CpyTo2FPS5___db)
pop af
pop bc
pop de
pop hl
pop ix
pop iy
ret
__endasm;
}
#endif
|
/**
******************************************************************************
* File Name : dma.h
* Description : This file contains all the function prototypes for
* the dma.c file
******************************************************************************
*
* Copyright (c) 2016 STMicroelectronics International N.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted, provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of other
* contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
* 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
* 5. Redistribution and use of this software other than as permitted under
* this license is void and will automatically terminate your rights under
* this license.
*
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __dma_H
#define __dma_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
#include "main.h"
/* DMA memory to memory transfer handles -------------------------------------*/
extern void Error_Handler(void);
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_DMA_Init(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */
#ifdef __cplusplus
}
#endif
#endif /* __dma_H */
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* Copyright (C) Ambroz Bizjak <ambrop7@gmail.com>
* Contributions:
* Transparent DNS: Copyright (C) Kerem Hadimli <kerem.hadimli@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author 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 AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BADVPN_TUN2SOCKS_SOCKSUDPGWCLIENT_H
#define BADVPN_TUN2SOCKS_SOCKSUDPGWCLIENT_H
#include <misc/debug.h>
#include <base/DebugObject.h>
#include <system/BReactor.h>
#ifdef ANDROID_UDP
#include <protocol/udpgw_proto.h>
#include <protocol/packetproto.h>
#include <system/BDatagram.h>
#include <flow/PacketBuffer.h>
#include <flow/SinglePacketBuffer.h>
#include <flow/BufferWriter.h>
#include <structure/BAVL.h>
#include <structure/LinkedList1.h>
#include <misc/offset.h>
#else
#include <udpgw_client/UdpGwClient.h>
#include <socksclient/BSocksClient.h>
#endif
typedef void (*SocksUdpGwClient_handler_received) (void *user, BAddr local_addr, BAddr remote_addr, const uint8_t *data, int data_len);
typedef struct {
int udp_mtu;
BAddr socks_server_addr;
const struct BSocksClient_auth_info *auth_info;
size_t num_auth_info;
BAddr remote_udpgw_addr;
BReactor *reactor;
void *user;
SocksUdpGwClient_handler_received handler_received;
#ifdef ANDROID_UDP
int udpgw_mtu;
int num_connections;
int max_connections;
BAVL connections_tree;
LinkedList1 connections_list;
#else
UdpGwClient udpgw_client;
BTimer reconnect_timer;
int have_socks;
BSocksClient socks_client;
int socks_up;
#endif
DebugObject d_obj;
} SocksUdpGwClient;
#ifdef ANDROID_UDP
typedef struct {
BAddr local_addr;
BAddr remote_addr;
} SocksUdpGwClient_conaddr;
typedef struct {
SocksUdpGwClient *client;
SocksUdpGwClient_conaddr conaddr;
BPending first_job;
const uint8_t *first_data;
int first_data_len;
BDatagram udp_dgram;
BufferWriter udp_send_writer;
PacketBuffer udp_send_buffer;
SinglePacketBuffer udp_recv_buffer;
PacketPassInterface udp_recv_if;
BAVLNode connections_tree_node;
LinkedList1Node connections_list_node;
} SocksUdpGwClient_connection;
#endif
int SocksUdpGwClient_Init (SocksUdpGwClient *o, int udp_mtu, int max_connections, int send_buffer_size, btime_t keepalive_time,
BAddr socks_server_addr, const struct BSocksClient_auth_info *auth_info, size_t num_auth_info,
BAddr remote_udpgw_addr, btime_t reconnect_time, BReactor *reactor, void *user,
SocksUdpGwClient_handler_received handler_received) WARN_UNUSED;
void SocksUdpGwClient_Free (SocksUdpGwClient *o);
void SocksUdpGwClient_SubmitPacket (SocksUdpGwClient *o, BAddr local_addr, BAddr remote_addr, int is_dns, const uint8_t *data, int data_len);
#endif
|
/* vim: set expandtab ts=4 sw=4: */
/*
* You may redistribute this program 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 "util/log/Log_impl.h"
#include "util/log/IndirectLog.h"
#include "util/Identity.h"
#include <stdint.h>
struct IndirectLog_pvt
{
struct Log log;
struct Log* wrapped;
Identity
};
static void doLog(struct Log* genericLog,
enum Log_Level logLevel,
const char* file,
int lineNum,
const char* format,
va_list args)
{
struct IndirectLog_pvt* il = Identity_cast((struct IndirectLog_pvt*) genericLog);
if (il && il->wrapped) {
il->wrapped->print(il->wrapped, logLevel, file, lineNum, format, args);
}
}
struct Log* IndirectLog_new(struct Allocator* alloc)
{
struct IndirectLog_pvt* il = Allocator_clone(alloc, (&(struct IndirectLog_pvt) {
.log = {
.print = doLog
}
}));
Identity_set(il);
return &il->log;
}
void IndirectLog_set(struct Log* indirectLog, struct Log* wrapped)
{
struct IndirectLog_pvt* il = Identity_cast((struct IndirectLog_pvt*) indirectLog);
il->wrapped = wrapped;
}
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-avx512.h"
#include "../common/n1bv_25.c"
|
/*
* This file is part of wlcore
*
* Copyright (C) 2014 Texas Instruments. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*/
#include <net/mac80211.h>
#include <net/netlink.h>
#include "wlcore.h"
#include "debug.h"
#include "ps.h"
#include "hw_ops.h"
#include "vendor_cmd.h"
static const
struct nla_policy wlcore_vendor_attr_policy[NUM_WLCORE_VENDOR_ATTR] = {
[WLCORE_VENDOR_ATTR_FREQ] = { .type = NLA_U32 },
[WLCORE_VENDOR_ATTR_GROUP_ID] = { .type = NLA_U32 },
[WLCORE_VENDOR_ATTR_GROUP_KEY] = { .type = NLA_BINARY,
.len = WLAN_MAX_KEY_LEN },
};
static int
wlcore_vendor_cmd_smart_config_start(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len)
{
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct wl1271 *wl = hw->priv;
struct nlattr *tb[NUM_WLCORE_VENDOR_ATTR];
int ret;
wl1271_debug(DEBUG_CMD, "vendor cmd smart config start");
if (!data)
return -EINVAL;
ret = nla_parse(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len,
wlcore_vendor_attr_policy, NULL);
if (ret)
return ret;
if (!tb[WLCORE_VENDOR_ATTR_GROUP_ID])
return -EINVAL;
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON)) {
ret = -EINVAL;
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;
ret = wlcore_smart_config_start(wl,
nla_get_u32(tb[WLCORE_VENDOR_ATTR_GROUP_ID]));
wl1271_ps_elp_sleep(wl);
out:
mutex_unlock(&wl->mutex);
return ret;
}
static int
wlcore_vendor_cmd_smart_config_stop(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len)
{
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct wl1271 *wl = hw->priv;
int ret;
wl1271_debug(DEBUG_CMD, "testmode cmd smart config stop");
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON)) {
ret = -EINVAL;
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;
ret = wlcore_smart_config_stop(wl);
wl1271_ps_elp_sleep(wl);
out:
mutex_unlock(&wl->mutex);
return ret;
}
static int
wlcore_vendor_cmd_smart_config_set_group_key(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data, int data_len)
{
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct wl1271 *wl = hw->priv;
struct nlattr *tb[NUM_WLCORE_VENDOR_ATTR];
int ret;
wl1271_debug(DEBUG_CMD, "testmode cmd smart config set group key");
if (!data)
return -EINVAL;
ret = nla_parse(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len,
wlcore_vendor_attr_policy, NULL);
if (ret)
return ret;
if (!tb[WLCORE_VENDOR_ATTR_GROUP_ID] ||
!tb[WLCORE_VENDOR_ATTR_GROUP_KEY])
return -EINVAL;
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON)) {
ret = -EINVAL;
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;
ret = wlcore_smart_config_set_group_key(wl,
nla_get_u32(tb[WLCORE_VENDOR_ATTR_GROUP_ID]),
nla_len(tb[WLCORE_VENDOR_ATTR_GROUP_KEY]),
nla_data(tb[WLCORE_VENDOR_ATTR_GROUP_KEY]));
wl1271_ps_elp_sleep(wl);
out:
mutex_unlock(&wl->mutex);
return ret;
}
static const struct wiphy_vendor_command wlcore_vendor_commands[] = {
{
.info = {
.vendor_id = TI_OUI,
.subcmd = WLCORE_VENDOR_CMD_SMART_CONFIG_START,
},
.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlcore_vendor_cmd_smart_config_start,
},
{
.info = {
.vendor_id = TI_OUI,
.subcmd = WLCORE_VENDOR_CMD_SMART_CONFIG_STOP,
},
.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlcore_vendor_cmd_smart_config_stop,
},
{
.info = {
.vendor_id = TI_OUI,
.subcmd = WLCORE_VENDOR_CMD_SMART_CONFIG_SET_GROUP_KEY,
},
.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlcore_vendor_cmd_smart_config_set_group_key,
},
};
static const struct nl80211_vendor_cmd_info wlcore_vendor_events[] = {
{
.vendor_id = TI_OUI,
.subcmd = WLCORE_VENDOR_EVENT_SC_SYNC,
},
{
.vendor_id = TI_OUI,
.subcmd = WLCORE_VENDOR_EVENT_SC_DECODE,
},
};
void wlcore_set_vendor_commands(struct wiphy *wiphy)
{
wiphy->vendor_commands = wlcore_vendor_commands;
wiphy->n_vendor_commands = ARRAY_SIZE(wlcore_vendor_commands);
wiphy->vendor_events = wlcore_vendor_events;
wiphy->n_vendor_events = ARRAY_SIZE(wlcore_vendor_events);
}
|
#include "q_shared.h"
#include "entity.h"
#include "g_shared.h"
#include "scr_vm.h"
qboolean __cdecl G_SpawnString(SpawnVar_t *spawnVar, const char *key, const char *defaultString, const char **out)
{
int i;
if ( spawnVar->numSpawnVars <= 0 )
{
*out = defaultString;
return 0;
}
for(i = 0; i < spawnVar->numSpawnVars; i++)
{
if(!Q_stricmp(key, spawnVar->keyValPairs[i].key))
{
*out = spawnVar->keyValPairs[i].value;
return 1;
}
}
*out = defaultString;
return 0;
}
qboolean __cdecl G_LevelSpawnString(const char *key, const char *defaultString, const char **out)
{
return G_SpawnString(&level.spawnVars, key, defaultString, out);
}
void __cdecl G_VehSpawner(gentity_t *ent)
{
const char* value;
char vehTypeStr[MAX_QPATH];
if(level.spawnVars.isGameLoadingSpawn)
{
G_LevelSpawnString("vehicletype", 0, &value);
}else{
if(Scr_GetNumParam() == 3)
{
//Scr_Error("Usage: spawn(\"script_vehicle\", <origin>, <spawnflags>, <vehicletype>)");
Q_strncpyz(vehTypeStr, "defaultvehicle_mp", sizeof(vehTypeStr));
}else{
Q_strncpyz(vehTypeStr, Scr_GetString(3), sizeof(vehTypeStr));
if(Scr_GetNumParam() == 5)
{
G_SetModel(ent, Scr_GetString(4));
}
}
value = vehTypeStr;
}
SpawnVehicle( ent, value );
}
void __cdecl G_VehCollmapSpawner(gentity_t *ent)
{
ent->r.contents = 0;
ent->s.eType = 15;
}
|
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include "common_local.h"
int main()
{
int sockfd;
struct sockaddr_un addr;
size_t len;
int res;
int ch = 'A';
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, "server_socket");
len = sizeof(addr);
res = connect(sockfd, (struct sockaddr *)&addr, len);
PD(res);
if(res == -1) {
perror("connect failed:");
return -1;
}
write(sockfd, &ch, 1);
read(sockfd, &ch, 1);
printf("char from server is:%c\n", ch);
close(sockfd);
return 0;
}
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
#ifndef Patternist_LetClause_H
#define Patternist_LetClause_H
#include "qpaircontainer_p.h"
#include "qvariabledeclaration_p.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
namespace QPatternist
{
/**
* @short Represents a <tt>let</tt>-clause, but is only used at compile
* time.
*
* LetClause is inserted into the AST tree for the single purpose of
* ensuring that the focus is correct for the binding expression. Once
* that is done, LetClause sometimes rewrites itself to its
* <tt>return</tt> expression, and the ExpressionVariableReference will
* handle the evaluation of the variable.
*
* @author Frans Englich <frans.englich@nokia.com>
* @ingroup Patternist_expressions
*/
class LetClause : public PairContainer
{
public:
LetClause(const Expression::Ptr &operand1,
const Expression::Ptr &operand2,
const VariableDeclaration::Ptr &decl);
virtual Item::Iterator::Ptr evaluateSequence(const DynamicContext::Ptr &context) const;
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const;
virtual void evaluateToSequenceReceiver(const DynamicContext::Ptr &context) const;
virtual SequenceType::List expectedOperandTypes() const;
virtual Expression::Ptr typeCheck(const StaticContext::Ptr &context,
const SequenceType::Ptr &reqType);
virtual SequenceType::Ptr staticType() const;
virtual Properties properties() const;
virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const;
virtual ID id() const;
private:
inline DynamicContext::Ptr bindVariable(const DynamicContext::Ptr &context) const;
const VariableDeclaration::Ptr m_varDecl;
};
}
QT_END_NAMESPACE
QT_END_HEADER
#endif
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DIRMODEL_H
#define DIRMODEL_H
#include <QDirModel>
// With a QDirModel, set on a view, you will see "Program Files" in the view
// But with this model, you will see "C:\Program Files" in the view.
// We acheive this, by having the data() return the entire file path for
// the display role. Note that the Qt::EditRole over which the QCompleter
// looks for matches is left unchanged
//! [0]
class DirModel : public QDirModel
{
public:
DirModel(QObject *parent = 0);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
};
//! [0]
#endif
|
/*
Copyright (C) 2016 Fredrik Johansson
This file is part of Arb.
Arb 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 "arb_poly.h"
slong
arb_poly_valuation(const arb_poly_t poly)
{
slong i, len = poly->length;
for (i = 0; i < len; i++)
if (!arb_is_zero(poly->coeffs + i))
return i;
return -1;
}
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "Kernel.h"
#include "RichardsDensity.h"
#include "RichardsRelPerm.h"
#include "Material.h"
// Forward Declarations
/**
* This is a fully upwinded flux Kernel
* The Variable of this Kernel should be the porepressure
*
* The residual for the kernel is the darcy flux.
* This is
* R_i = int{mobility*flux_no_mob} = int{mobility*grad(pot)*permeability*grad(test_i)}
* for node i. where int is the integral over the element, and
* pot = Porepressure - density*gravity.x
*
* However, in fully-upwind, the first step is to take the mobility outside the
* integral.
* R_i = mobility*int{flux_no_mob} = mobility*F_i
* NOTE: R_i is exactly the mass flux flowing out of node i.
* Similarly, F_i is a measure of fluid flowing out of node i.
*
* This leads to the definition of upwinding:
*
* If F_i is positive then R_i = mobility_i * F_i
* That is, we use the upwind value of mobility.
*
* For the F_i<0 nodes we construct their R_i using mass conservation
*/
class Q2PPorepressureFlux : public Kernel
{
public:
static InputParameters validParams();
Q2PPorepressureFlux(const InputParameters & parameters);
protected:
/**
* Note that this is not the complete residual for the quadpoint
* In computeResidual we sum over the quadpoints and then add
* the upwind mobility parts
*/
virtual Real computeQpResidual() override;
/// This simply calls upwind
virtual void computeResidual() override;
/// this simply calls upwind
virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
using Kernel::computeOffDiagJacobian;
/// this simply calls upwind
virtual void computeJacobian() override;
/// the derivative of the flux without the upstream mobility terms
Real computeQpJac(unsigned int dvar);
/**
* Do the upwinding for both the residual and jacobian
* I've put both calculations in the same code to try to
* reduce code duplication. This is because when calculating
* the jacobian we need to calculate the residual to see
* which nodes are upwind and which are downwind
*/
void upwind(bool compute_res, bool compute_jac, unsigned int jvar);
/// calculates the nodal values of mobility, and derivatives thereof
void prepareNodalValues();
/// fluid density
const RichardsDensity & _density;
/// saturation at the nodes
const VariableValue & _sat;
/// variable number of the saturation variable
unsigned int _sat_var;
/// fluid relative permeability
const RichardsRelPerm & _relperm;
/// fluid viscosity
Real _viscosity;
/// gravity
const MaterialProperty<RealVectorValue> & _gravity;
/// permeability
const MaterialProperty<RealTensorValue> & _permeability;
/// number of nodes in the element
unsigned int _num_nodes;
/**
* nodal values of mobility = density*relperm/viscosity
* These are multiplied by _flux_no_mob to give the residual
*/
std::vector<Real> _mobility;
/**
* d(_mobility)/d(porepressure)
* These are used in the jacobian calculations
*/
std::vector<Real> _dmobility_dp;
/**
* d(_mobility)/d(saturation)
* These are used in the jacobian calculations
*/
std::vector<Real> _dmobility_ds;
};
|
/*
Copyright (C) 2010 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 <https://www.gnu.org/licenses/>.
*/
#include <gmp.h>
#include "flint.h"
#include "fmpz.h"
#include "fmpz_vec.h"
#include "fmpq_poly.h"
int _fmpq_poly_cmp(const fmpz * lpoly, const fmpz_t lden,
const fmpz * rpoly, const fmpz_t rden, slong len)
{
int ans;
slong i = len - 1;
fmpz_t lcoeff, rcoeff;
if (fmpz_equal(lden, rden))
{
while (i && fmpz_equal(lpoly + i, rpoly + i))
i--;
ans = fmpz_cmp(lpoly + i, rpoly + i);
}
else if (*lden == WORD(1)) /* Here rden exceeds 1 */
{
fmpz_init(lcoeff);
fmpz_mul(lcoeff, lpoly + i, rden);
while (i && fmpz_equal(lcoeff, rpoly + i))
fmpz_mul(lcoeff, lpoly + (--i), rden);
ans = fmpz_cmp(lcoeff, rpoly + i);
fmpz_clear(lcoeff);
}
else if (*rden == WORD(1)) /* Here lden exceeds 1 */
{
fmpz_init(rcoeff);
fmpz_mul(rcoeff, rpoly + i, lden);
while (i && fmpz_equal(rcoeff, lpoly + i))
fmpz_mul(rcoeff, rpoly + (--i), lden);
ans = fmpz_cmp(lpoly + i, rcoeff);
fmpz_clear(rcoeff);
}
else /* Here both lden, rden exceed 1 */
{
fmpz_init(lcoeff);
fmpz_init(rcoeff);
fmpz_mul(lcoeff, lpoly + i, rden);
fmpz_mul(rcoeff, rpoly + i, lden);
while (i && fmpz_equal(lcoeff, rcoeff))
{
i--;
fmpz_mul(lcoeff, lpoly + i, rden);
fmpz_mul(rcoeff, rpoly + i, lden);
}
ans = fmpz_cmp(lcoeff, rcoeff);
fmpz_clear(lcoeff);
fmpz_clear(rcoeff);
}
return ans;
}
int fmpq_poly_cmp(const fmpq_poly_t left, const fmpq_poly_t right)
{
slong len1, len2;
if (left == right)
return 0;
len1 = left->length;
len2 = right->length;
if (len1 < len2)
return -1;
else if (len1 > len2)
return 1;
else if (len1 == 0)
return 0;
else
return _fmpq_poly_cmp(left->coeffs, left->den, right->coeffs, right->den, len1);
}
|
/*
* =====================================================================================
*
* Filename: debug_log.h
*
* Description:
*
* Version: 1.0
* Created: 06/25/2015 02:42:15 PM
* Revision: none
* Compiler: gcc
*
* Author: alan lin (), a1an1in@sina.com
* Organization:
*
* =====================================================================================
*/
#ifndef __DEBUG_LOG_H__
#define __DEBUG_LOG_H__
#include <stdio.h>
#include "libthread/sync_lock.h"
/*
*#include <pthread.h>
*/
typedef struct debug_log_prive{
#define MAX_DEBUG_LOG_FILE_NAME_LEN 50
FILE *fp;
char log_file_name[MAX_DEBUG_LOG_FILE_NAME_LEN];
/*
*pthread_mutex_t log_file_lock;
*/
sync_lock_t log_file_lock;
#undef MAX_DEBUG_LOG_FILE_NAME_LEN
}debug_log_prive_t;
void log_print_regester();
#endif
|
/* Flushing buffers of a FILE stream.
Copyright (C) 2007-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; 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 program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <stdio.h>
#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */
# include <stdio_ext.h>
#endif
#include <stdlib.h>
#include "stdio-impl.h"
int
fpurge (FILE *fp)
{
#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7 */
__fpurge (fp);
/* The __fpurge function does not have a return value. */
return 0;
#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin 1.7 */
/* Call the system's fpurge function. */
# undef fpurge
# if !HAVE_DECL_FPURGE
extern int fpurge (FILE *);
# endif
int result = fpurge (fp);
# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
if (result == 0)
/* Correct the invariants that fpurge broke.
<stdio.h> on BSD systems says:
"The following always hold: if _flags & __SRD, _w is 0."
If this invariant is not fulfilled and the stream is read-write but
currently reading, subsequent putc or fputc calls will write directly
into the buffer, although they shouldn't be allowed to. */
if ((fp_->_flags & __SRD) != 0)
fp_->_w = 0;
# endif
return result;
#else
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, because they need it for implementing getc() and putc() as
fast macros. */
# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_IO_read_end = fp->_IO_read_ptr;
fp->_IO_write_ptr = fp->_IO_write_base;
/* Avoid memory leak when there is an active ungetc buffer. */
if (fp->_IO_save_base != NULL)
{
free (fp->_IO_save_base);
fp->_IO_save_base = NULL;
}
return 0;
# elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
fp_->_p = fp_->_bf._base;
fp_->_r = 0;
fp_->_w = ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
? fp_->_bf._size
: 0);
/* Avoid memory leak when there is an active ungetc buffer. */
if (fp_ub._base != NULL)
{
if (fp_ub._base != fp_->_ubuf)
free (fp_ub._base);
fp_ub._base = NULL;
}
return 0;
# elif defined __EMX__ /* emx+gcc */
fp->_ptr = fp->_buffer;
fp->_rcount = 0;
fp->_wcount = 0;
fp->_ungetc_count = 0;
return 0;
# elif defined __minix /* Minix */
fp->_ptr = fp->_buf;
if (fp->_ptr != NULL)
fp->_count = 0;
return 0;
# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
fp->_ptr = fp->_base;
if (fp->_ptr != NULL)
fp->_cnt = 0;
return 0;
# elif defined __UCLIBC__ /* uClibc */
# ifdef __STDIO_BUFFERS
if (fp->__modeflags & __FLAG_WRITING)
fp->__bufpos = fp->__bufstart;
else if (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING))
fp->__bufpos = fp->__bufread;
# endif
return 0;
# elif defined __QNX__ /* QNX */
fp->_Rback = fp->_Back + sizeof (fp->_Back);
fp->_Rsave = NULL;
if (fp->_Mode & 0x2000 /* _MWRITE */)
/* fp->_Buf <= fp->_Next <= fp->_Wend */
fp->_Next = fp->_Buf;
else
/* fp->_Buf <= fp->_Next <= fp->_Rend */
fp->_Rend = fp->_Next;
return 0;
# elif defined __MINT__ /* Atari FreeMiNT */
if (fp->__pushed_back)
{
fp->__bufp = fp->__pushback_bufp;
fp->__pushed_back = 0;
}
/* Preserve the current file position. */
if (fp->__target != -1)
fp->__target += fp->__bufp - fp->__buffer;
fp->__bufp = fp->__buffer;
/* Nothing in the buffer, next getc is nontrivial. */
fp->__get_limit = fp->__bufp;
/* Nothing in the buffer, next putc is nontrivial. */
fp->__put_limit = fp->__buffer;
return 0;
# elif defined EPLAN9 /* Plan9 */
fp->rp = fp->wp = fp->lp = fp->buf;
return 0;
# else
# error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib."
# endif
#endif
}
|
/*
Teem: Tools to process and visualize scientific data and images .
Copyright (C) 2013, 2012, 2011, 2010, 2009 University of Chicago
Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
(LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The terms of redistributing and/or modifying this software also
include exceptions to the LGPL that facilitate static linking.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <teem/biff.h>
#include <teem/hest.h>
#include <teem/nrrd.h>
#include <teem/gage.h>
#include <teem/ten.h>
#include <teem/meet.h>
#define SPACING(spc) (AIR_EXISTS(spc) ? spc: nrrdDefaultSpacing)
/* copied this from ten.h; I don't want gage to depend on ten */
#define PROBE_MAT2LIST(l, m) ( \
(l)[1] = (m)[0], \
(l)[2] = (m)[3], \
(l)[3] = (m)[6], \
(l)[4] = (m)[4], \
(l)[5] = (m)[7], \
(l)[6] = (m)[8] )
static const char *deconvInfo = ("Does deconvolution. ");
int
main(int argc, const char *argv[]) {
gageKind *kind;
const char *me;
char *outS, *err;
hestParm *hparm;
hestOpt *hopt = NULL;
NrrdKernelSpec *ksp;
int otype, separ, ret;
unsigned int maxIter;
double epsilon, lastDiff, step;
Nrrd *nin, *nout;
airArray *mop;
mop = airMopNew();
me = argv[0];
hparm = hestParmNew();
airMopAdd(mop, hparm, AIR_CAST(airMopper, hestParmFree), airMopAlways);
hparm->elideSingleOtherType = AIR_TRUE;
hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL,
"input volume", NULL, NULL, nrrdHestNrrd);
hestOptAdd(&hopt, "k", "kind", airTypeOther, 1, 1, &kind, NULL,
"\"kind\" of volume (\"scalar\", \"vector\", "
"\"tensor\", or \"dwi\")",
NULL, NULL, meetHestGageKind);
hestOptAdd(&hopt, "k00", "kernel", airTypeOther, 1, 1, &ksp, NULL,
"convolution kernel",
NULL, NULL, nrrdHestKernelSpec);
hestOptAdd(&hopt, "mi", "max # iters", airTypeUInt, 1, 1, &maxIter, "100",
"maximum number of iterations with which to compute the "
"deconvolution");
hestOptAdd(&hopt, "e", "epsilon", airTypeDouble, 1, 1, &epsilon,
"0.00000001", "convergence threshold");
hestOptAdd(&hopt, "s", "step", airTypeDouble, 1, 1, &step, "1.0",
"scaling of value update");
hestOptAdd(&hopt, "t", "type", airTypeOther, 1, 1, &otype, "default",
"type to save output as. By default (not using this option), "
"the output type is the same as the input type",
NULL, NULL, &unrrduHestMaybeTypeCB);
hestOptAdd(&hopt, "sep", "bool", airTypeBool, 1, 1, &separ, "false",
"use fast separable deconvolution instead of brain-dead "
"brute-force iterative method");
hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",
"output volume");
hestParseOrDie(hopt, argc-1, argv+1, hparm,
me, deconvInfo, AIR_TRUE, AIR_TRUE, AIR_TRUE);
airMopAdd(mop, hopt, AIR_CAST(airMopper, hestOptFree), airMopAlways);
airMopAdd(mop, hopt, AIR_CAST(airMopper, hestParseFree), airMopAlways);
nout = nrrdNew();
airMopAdd(mop, nout, AIR_CAST(airMopper, nrrdNuke), airMopAlways);
if (separ) {
ret = gageDeconvolveSeparable(nout, nin, kind, ksp, otype);
} else {
ret = gageDeconvolve(nout, &lastDiff,
nin, kind,
ksp, otype,
maxIter, AIR_TRUE,
step, epsilon, 1);
}
if (ret) {
airMopAdd(mop, err = biffGetDone(GAGE), airFree, airMopAlways);
fprintf(stderr, "%s: trouble:\n%s\n", me, err);
airMopError(mop);
return 1;
}
if (nrrdSave(outS, nout, NULL)) {
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "%s: trouble saving output:\n%s\n", me, err);
airMopError(mop);
return 1;
}
airMopOkay(mop);
return 0;
}
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QNEARFIELDTAGIMPL_H
#define QNEARFIELDTAGIMPL_H
#include "nearfieldtagimplcommon_symbian.h"
#include "debug.h"
QTM_BEGIN_NAMESPACE
class QNearFieldTagType1Symbian;
class QNearFieldTagType2Symbian;
class QNearFieldTagType3Symbian;
class QNearFieldTagType4Symbian;
template<typename TAGTYPE>
struct TagConstValue
{
enum { MaxResponseSize = 4096, Timeout = 100 * 1000 };
};
template<>
struct TagConstValue<QNearFieldTagType1Symbian>
{
enum { MaxResponseSize = 131, Timeout = 5 * 1000 };
};
template<>
struct TagConstValue<QNearFieldTagType2Symbian>
{
enum { MaxResponseSize = 18, Timeout = 5 * 1000 };
};
template<>
struct TagConstValue<QNearFieldTagType3Symbian>
{
enum { MaxResponseSize = 256, Timeout = 500 * 1000 };
};
template <typename TAGTYPE>
class QNearFieldTagImpl : public QNearFieldTagImplCommon
{
public: // From MNearFieldTargetOperation
void HandleResponse(const QNearFieldTarget::RequestId &id, const QByteArray &command, const QByteArray &response, bool emitRequestCompleted);
void HandleResponse(const QNearFieldTarget::RequestId &id, const QVariantList& response, int error);
QVariant decodeResponse(const QByteArray& command, const QByteArray& response);
void EmitNdefMessageRead(const QNdefMessage &message);
void EmitNdefMessagesWritten();
void EmitRequestCompleted(const QNearFieldTarget::RequestId &id);
void EmitError(int error, const QNearFieldTarget::RequestId &id);
public:
QNearFieldTagImpl(CNearFieldNdefTarget *tag);
};
template<typename TAGTYPE>
QNearFieldTagImpl<TAGTYPE>::QNearFieldTagImpl(CNearFieldNdefTarget *tag) : QNearFieldTagImplCommon(tag)
{
TRAP_IGNORE(mResponse.CreateL(TagConstValue<TAGTYPE>::MaxResponseSize));
mTimeout = TagConstValue<TAGTYPE>::Timeout;
}
template<typename TAGTYPE>
void QNearFieldTagImpl<TAGTYPE>::HandleResponse(const QNearFieldTarget::RequestId &id, const QByteArray &command, const QByteArray &response, bool emitRequestCompleted)
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
tag->handleTagOperationResponse(id, command, response, emitRequestCompleted);
END
}
template<typename TAGTYPE>
void QNearFieldTagImpl<TAGTYPE>::HandleResponse(const QNearFieldTarget::RequestId &id, const QVariantList& response, int error)
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
tag->setResponseForRequest(id, response, (error == KErrNone));
END
}
template<typename TAGTYPE>
QVariant QNearFieldTagImpl<TAGTYPE>::decodeResponse(const QByteArray& command, const QByteArray& response)
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
END
return tag->decodeResponse(command, response);
}
template<typename TAGTYPE>
void QNearFieldTagImpl<TAGTYPE>::EmitNdefMessageRead(const QNdefMessage &message)
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
int err;
QT_TRYCATCH_ERROR(err, emit tag->ndefMessageRead(message));
Q_UNUSED(err);
END
}
template<typename TAGTYPE>
void QNearFieldTagImpl<TAGTYPE>::EmitNdefMessagesWritten()
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
int err;
QT_TRYCATCH_ERROR(err, emit tag->ndefMessagesWritten());
Q_UNUSED(err);
END
}
template<typename TAGTYPE>
void QNearFieldTagImpl<TAGTYPE>::EmitRequestCompleted(const QNearFieldTarget::RequestId &id)
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
int err;
QT_TRYCATCH_ERROR(err, emit tag->requestCompleted(id));
Q_UNUSED(err);
END
}
template<typename TAGTYPE>
void QNearFieldTagImpl<TAGTYPE>::EmitError(int error, const QNearFieldTarget::RequestId &id)
{
BEGIN
TAGTYPE * tag = static_cast<TAGTYPE *>(this);
int err = KErrNone;
try {
QMetaObject::invokeMethod(tag, "error", Qt::QueuedConnection,
Q_ARG(QNearFieldTarget::Error, SymbianError2QtError(error)),
Q_ARG(QNearFieldTarget::RequestId, id));
} catch (const std::exception &ex) {
err = qt_symbian_exception2Error(ex);
}
Q_UNUSED(err);
END
}
QTM_END_NAMESPACE
#endif // QNEARFIELDTAGIMPL_H
|
/****************************************************************************
This file is part of the GLC-lib library.
Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
http://glc-lib.sourceforge.net
GLC-lib 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.
GLC-lib 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 GLC-lib; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*****************************************************************************/
//! \file glc_octreenode.h interface for the GLC_OctreeNode class.
#ifndef GLC_OCTREENODE_H_
#define GLC_OCTREENODE_H_
#include "glc_3dviewinstance.h"
#include "../glc_boundingbox.h"
#include "../glc_config.h"
#include "../viewport/glc_frustum.h"
#include <QList>
#include <QSet>
class GLC_LIB_EXPORT GLC_OctreeNode;
//////////////////////////////////////////////////////////////////////
//! \class GLC_OctreeNode
/*! \brief GLC_OctreeNode : A node of Space partioning implemented with octree */
//////////////////////////////////////////////////////////////////////
class GLC_OctreeNode
{
typedef QList<GLC_OctreeNode*> NodeList;
//////////////////////////////////////////////////////////////////////
/*! @name Constructor / Destructor */
//@{
//////////////////////////////////////////////////////////////////////
public:
//! Construct a octree node from the given bounding box within the given octree node
GLC_OctreeNode(const GLC_BoundingBox&, GLC_OctreeNode* pParent= NULL);
//! Construct a octree node from the first given octree node within the second given octree node
GLC_OctreeNode(const GLC_OctreeNode&, GLC_OctreeNode* pParent= NULL);
//! Destructor
virtual ~GLC_OctreeNode();
//@}
//////////////////////////////////////////////////////////////////////
/*! \name Get Functions*/
//@{
//////////////////////////////////////////////////////////////////////
public:
// Return this octree node bounding box
inline GLC_BoundingBox& boundingBox()
{return m_BoundingBox;}
//! Return True if this octree node intersect the bounding box
inline bool intersect(const GLC_BoundingBox& boundingBox);
//! Return true if this octree has child octree node
inline bool hasChild() const
{return !m_Children.isEmpty();}
//! Return the child octree node at the given index
/*! The child must exist*/
inline GLC_OctreeNode* childAt(int i) const
{
Q_ASSERT(i < m_Children.size());
return m_Children.at(i);
}
//! Return this octree node child octree node count
inline int childCount() const
{return m_Children.size();}
//! Return true if this node contains 3D view instances
inline bool hasGeometry() const
{return !m_3DViewInstanceSet.isEmpty();}
//! Return true if this octree node is empty
/*! An empty node doesn't contains child and 3d view instance*/
inline bool isEmpty() const
{return m_Empty;}
//! Return true if intersection are calculated with bounded sphere
static bool intersectionWithBoundingSphereUsed();
//! Return the list off instances inside or intersect the given bounding box
QSet<GLC_3DViewInstance*> setOfIntersectedInstances(const GLC_BoundingBox& bBox);
//@}
//////////////////////////////////////////////////////////////////////
/*! \name Set Functions*/
//@{
//////////////////////////////////////////////////////////////////////
public:
//! Add 8 octree node children to this octree node
void addChildren();
//! Add 3d view instance in this octree node branch
void addInstance(GLC_3DViewInstance*, int);
//! Update 3d view instances visibility of this octree node branch from the given frustum
/*! Viewable 3d view instance are inserted the the given set if exist also the set is created*/
void updateViewableInstances(const GLC_Frustum&, QSet<GLC_3DViewInstance*>* pInstanceSet= NULL);
//! Remove empty child octree node from this octree node
void removeEmptyChildren();
//! Set intersection to bounding sphere
static void useBoundingSphereIntersection(bool);
//@}
//////////////////////////////////////////////////////////////////////
// Private services function
//////////////////////////////////////////////////////////////////////
private:
//! Unable the node and sub node view flag
void unableViewFlag(QSet<GLC_3DViewInstance*>*);
//! Disable the node and sub node view flag
void disableViewFlag(QSet<GLC_3DViewInstance*>*);
//////////////////////////////////////////////////////////////////////
// Private members
//////////////////////////////////////////////////////////////////////
private:
//! Octree node bounding box
GLC_BoundingBox m_BoundingBox;
//! Parent Octree node
GLC_OctreeNode* m_pParent;
//! Children list of octree node
NodeList m_Children;
//! This node set of 3DViewInstance
QSet<GLC_3DViewInstance*> m_3DViewInstanceSet;
//! Flag to know if the node is empty
bool m_Empty;
//! Flag to know if intersection is calculated with bounding sphere
static bool m_useBoundingSphere;
};
bool GLC_OctreeNode::intersect(const GLC_BoundingBox& boundingBox)
{
if (m_useBoundingSphere)
return m_BoundingBox.intersectBoundingSphere(boundingBox);
else
return m_BoundingBox.intersect(boundingBox);
}
#endif /* GLC_OCTREENODE_H_ */
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QTUICODEMODELSUPPORT_H
#define QTUICODEMODELSUPPORT_H
#include <cpptools/uicodecompletionsupport.h>
namespace CPlusPlus {
class CppModelManagerInterface;
}
namespace Qt4ProjectManager {
class Qt4Project;
namespace Internal {
class Qt4UiCodeModelSupport : public CppTools::UiCodeModelSupport
{
Q_OBJECT
public:
Qt4UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager,
Qt4Project *project,
const QString &sourceFile,
const QString &uiHeaderFile);
virtual ~Qt4UiCodeModelSupport();
protected:
virtual QString uicCommand() const;
virtual QStringList environment() const;
private:
Qt4Project *m_project;
};
} // Internal
} // Qt4ProjectManager
#endif // QTUICODEMODELSUPPORT_H
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef TEST_BACKENDS_H
#define TEST_BACKENDS_H
#include <qsensorbackend.h>
QTM_USE_NAMESPACE
void register_test_backends();
void unregister_test_backends();
#include <qaccelerometer.h>
#include <qaltimeter.h>
#include <qambientlightsensor.h>
#include <qambienttemperaturesensor.h>
#include <qcompass.h>
#include <qgyroscope.h>
#include <qlightsensor.h>
#include <qmagnetometer.h>
#include <qorientationsensor.h>
#include <qproximitysensor.h>
#include <qrotationsensor.h>
#include <qtapsensor.h>
QTM_USE_NAMESPACE
#define PREPARE_SENSORINTERFACE_DECLS(SensorClass, ReadingClass, FilterClass, readingcode)\
class SensorClass ## _impl : public QSensorBackend\
{\
public:\
SensorClass ## _impl(QSensor *sensor);\
void start();\
void stop();\
};\
class SensorClass ## _testfilter : public FilterClass { bool filter(ReadingClass *); };
#define PREPARE_SENSORINTERFACE_IMPLS(SensorClass, ReadingClass, FilterClass, readingcode)\
SensorClass ## _impl::SensorClass ##_impl(QSensor *sensor) : QSensorBackend(sensor) {}\
void SensorClass ## _impl::start() {\
ReadingClass *reading = setReading<ReadingClass>(0);\
readingcode\
newReadingAvailable();\
}\
void SensorClass ##_impl::stop() {}\
bool SensorClass ## _testfilter::filter(ReadingClass *) { return true; }\
static QSensorBackend *create_ ## SensorClass ## _impl(QSensor *sensor) { return new SensorClass ## _impl(sensor); }\
static bool registered_ ## SensorClass = registerTestBackend(#SensorClass, create_ ## SensorClass ## _impl);
#ifdef REGISTER_TOO
#define PREPARE_SENSORINTERFACE(SensorClass, ReadingClass, FilterClass, readingcode)\
PREPARE_SENSORINTERFACE_DECLS(SensorClass, ReadingClass, FilterClass, readingcode)\
PREPARE_SENSORINTERFACE_IMPLS(SensorClass, ReadingClass, FilterClass, readingcode)
#else
#define PREPARE_SENSORINTERFACE(SensorClass, ReadingClass, FilterClass, readingcode)\
PREPARE_SENSORINTERFACE_DECLS(SensorClass, ReadingClass, FilterClass, readingcode)
#endif
PREPARE_SENSORINTERFACE(QAltimeter, QAltimeterReading, QAltimeterFilter, {
reading->setAltitude(8848);
})
PREPARE_SENSORINTERFACE(QAccelerometer, QAccelerometerReading, QAccelerometerFilter, {
reading->setX(1.0);
reading->setY(1.0);
reading->setZ(1.0);
})
PREPARE_SENSORINTERFACE(QAmbientLightSensor, QAmbientLightReading, QAmbientLightFilter, {
reading->setLightLevel(QAmbientLightReading::Twilight);
})
PREPARE_SENSORINTERFACE(QAmbientTemperatureSensor, QAmbientTemperatureReading, QAmbientTemperatureFilter, {
reading->setTemperature(30);
})
PREPARE_SENSORINTERFACE(QCompass, QCompassReading, QCompassFilter, {
reading->setAzimuth(1.0);
reading->setCalibrationLevel(1.0);
})
PREPARE_SENSORINTERFACE(QGyroscope, QGyroscopeReading, QGyroscopeFilter, {
reading->setX(1.0);
reading->setY(1.0);
reading->setZ(1.0);
})
PREPARE_SENSORINTERFACE(QLightSensor, QLightReading, QLightFilter, {
reading->setLux(1.0);
})
PREPARE_SENSORINTERFACE(QMagnetometer, QMagnetometerReading, QMagnetometerFilter, {
reading->setX(1.0);
reading->setY(1.0);
reading->setZ(1.0);
reading->setCalibrationLevel(1.0);
})
PREPARE_SENSORINTERFACE(QOrientationSensor, QOrientationReading, QOrientationFilter, {
reading->setOrientation(QOrientationReading::LeftUp);
})
PREPARE_SENSORINTERFACE(QProximitySensor, QProximityReading, QProximityFilter, {
reading->setClose(true);
})
PREPARE_SENSORINTERFACE(QRotationSensor, QRotationReading, QRotationFilter, {
reading->setX(1.0);
reading->setY(1.0);
reading->setZ(1.0);
})
PREPARE_SENSORINTERFACE(QTapSensor, QTapReading, QTapFilter, {
reading->setTapDirection(QTapReading::Z_Both);
reading->setDoubleTap(true);
})
#define TEST_SENSORINTERFACE(SensorClass, ReadingClass, readingcode)\
do {\
SensorClass sensor;\
SensorClass ## _testfilter filter;\
sensor.addFilter(&filter);\
sensor.start();\
ReadingClass *reading = sensor.reading();\
readingcode\
} while (0);
#endif
|
#ifndef MTEXTSELECTIONOVERLAY_H
#define MTEXTSELECTIONOVERLAY_H
#include <QGraphicsWidget>
#include <QPointer>
#include <QRegion>
#include <mtexteditview.h>
class MSceneManager;
class MTextEdit;
//! \internal
class MTextSelectionOverlay : public QGraphicsWidget
{
Q_OBJECT
public:
enum HandleType {
Cursor,
Anchor
};
explicit MTextSelectionOverlay(MTextEdit *,
MTextEditView *view)
{
connect(view, SIGNAL(selectionChanged(int, QRectF, bool, int, QRectF, bool)),
this, SLOT(onSelectionChange(int, QRectF, bool, int, QRectF, bool)));
};
void disappear()
{
hide();
}
void skipTransitions()
{
}
QRegion region()
{
return selectionHandleRegion;
}
Q_SIGNALS:
void selectionHandlePressed(const QPointF &, MTextSelectionOverlay::HandleType);
void selectionHandleMoved(const QPointF &);
void selectionHandleReleased(const QPointF &);
void selectionHandlesAppeared();
private Q_SLOTS:
void onSelectionChange(int newAnchor, const QRectF &, bool,
int newCursor, const QRectF &, bool)
{
if (newAnchor != newCursor) {
emit selectionHandlesAppeared();
show();
} else {
hide();
}
};
public:
QRegion selectionHandleRegion;
};
//! \internal_end
#endif
|
/*
Copyright (C) 2013 Fredrik Johansson
This file is part of Arb.
Arb 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 "arb.h"
/* Use series expansion of the elliptic integral
pi/(4K(z^2)) = 1/2 - z^2/8 - 5z^4/128 - 11z^6/512 - 469z^8/32768 + O(z^10)
to avoid computing the last couple of AGM iterations.
The higher coefficients are bounded by 1/64, so the tail is easily
bounded by a geometric series (the error is passed as input here).
Note: the input data is a+b, a-b; the variables z, z2 are scratch space. */
static void
arb_agm_close_taylor(arb_t res, arb_t z, arb_t z2,
const arb_t aplusb, const arb_t aminusb,
const mag_t err, slong prec)
{
arb_div(z, aminusb, aplusb, prec);
arb_sqr(z, z, prec);
arb_sqr(z2, z, prec);
arb_mul_si(res, z2, -469, prec);
arb_addmul_si(res, z, -704, prec);
arb_mul(res, res, z2, prec);
arb_addmul_si(res, z2, -1280, prec);
arb_mul_2exp_si(z, z, 12);
arb_sub(res, res, z, prec);
arb_add_ui(res, res, 16384, prec);
arb_mul_2exp_si(res, res, -15);
arb_add_error_mag(res, err);
arb_mul(res, res, aplusb, prec);
}
void
mag_agm(mag_t res, const mag_t x, const mag_t y)
{
if (!mag_is_finite(x) || !mag_is_finite(y))
{
mag_inf(res);
}
else if (mag_is_zero(x) || mag_is_zero(y))
{
mag_zero(res);
}
else
{
mag_t t, u, a, b, one_eps;
mag_init(a);
mag_init(b);
mag_init(t);
mag_init(u);
mag_init(one_eps);
/* invariant: a is an upper bound for agm(x,y) */
/* b would be a lower bound if not for rounding errors */
mag_max(a, x, y);
mag_min(b, x, y);
mag_one(one_eps);
mag_add_ui_2exp_si(one_eps, one_eps, 1, -26);
while (1)
{
mag_mul(t, b, one_eps);
if (mag_cmp(t, a) > 0)
{
mag_set(res, a);
break;
}
mag_add(t, a, b);
mag_mul_2exp_si(t, t, -1);
mag_mul(u, a, b);
mag_sqrt(u, u);
mag_swap(t, a);
mag_swap(u, b);
}
mag_clear(a);
mag_clear(b);
mag_clear(t);
mag_clear(u);
mag_clear(one_eps);
}
}
void
mag_agm_lower(mag_t res, const mag_t x, const mag_t y)
{
if (mag_is_zero(x) || mag_is_zero(y))
{
mag_zero(res);
}
else if (!mag_is_finite(x) || !mag_is_finite(y))
{
mag_inf(res);
}
else
{
mag_t t, u, a, b, one_eps;
mag_init(a);
mag_init(b);
mag_init(t);
mag_init(u);
mag_init(one_eps);
/* invariant: b is a lower bound for agm(x,y) */
/* a would be an upper bound if not for rounding errors */
mag_max(a, x, y);
mag_min(b, x, y);
mag_one(one_eps);
mag_add_ui_2exp_si(one_eps, one_eps, 1, -26);
while (1)
{
mag_mul(t, b, one_eps);
if (mag_cmp(t, a) > 0)
{
mag_set(res, b);
break;
}
mag_add_lower(t, a, b);
mag_mul_2exp_si(t, t, -1);
mag_mul_lower(u, a, b);
mag_sqrt_lower(u, u);
mag_swap(t, a);
mag_swap(u, b);
}
mag_clear(a);
mag_clear(b);
mag_clear(t);
mag_clear(u);
mag_clear(one_eps);
}
}
void
arb_agm(arb_t res, const arb_t x, const arb_t y, slong prec)
{
arb_t a, b, t, u;
mag_t err, err2;
slong acc1, acc2, wp;
if (!arb_is_nonnegative(x) || !arb_is_nonnegative(y) ||
!arb_is_finite(x) || !arb_is_finite(y))
{
arb_indeterminate(res);
return;
}
if (arb_is_zero(x) || arb_is_zero(y))
{
arb_zero(res);
return;
}
arb_init(a);
arb_init(b);
arb_init(t);
arb_init(u);
mag_init(err);
mag_init(err2);
arb_set(a, x);
arb_set(b, y);
wp = prec;
while (1)
{
acc1 = arb_rel_accuracy_bits(a);
acc2 = arb_rel_accuracy_bits(b);
acc1 = FLINT_MIN(acc1, acc2);
/* Compute lower and upper bounds if we don't need high precision. */
if (acc1 < 20 || wp < 20)
{
arb_get_mag_lower(arb_radref(t), a);
arb_get_mag_lower(arb_radref(u), b);
mag_agm_lower(err, arb_radref(t), arb_radref(u));
arb_get_mag(arb_radref(t), a);
arb_get_mag(arb_radref(u), b);
mag_agm(err2, arb_radref(t), arb_radref(u));
arf_set_mag(arb_midref(t), err);
arf_set_mag(arb_midref(u), err2);
arb_set_interval_arf(res, arb_midref(t), arb_midref(u), prec);
break;
}
if (acc1 < wp - 2 * MAG_BITS)
wp = acc1 + 2 * MAG_BITS;
arb_sub(u, a, b, wp);
/* Fallback exit. */
if (arb_contains_zero(u))
{
arb_union(res, a, b, wp);
break;
}
arb_add(t, a, b, wp);
arb_get_mag(err, u);
arb_get_mag_lower(err2, t);
mag_div(err, err, err2);
mag_geom_series(err, err, 10);
mag_mul_2exp_si(err, err, -6);
/* Use Taylor series when we have 1/10 the accurate bits. */
if (mag_cmp_2exp_si(err, -wp) < 0)
{
/* pass a, b as scratch space */
arb_agm_close_taylor(res, a, b, t, u, err, wp);
break;
}
arb_mul_2exp_si(t, t, -1);
arb_mul(u, a, b, wp);
arb_sqrt(u, u, wp);
arb_swap(t, a);
arb_swap(u, b);
}
arb_clear(a);
arb_clear(b);
arb_clear(t);
arb_clear(u);
mag_clear(err);
mag_clear(err2);
}
|
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebMediaStreamDescriptor_h
#define WebMediaStreamDescriptor_h
#include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h"
#include "WebVector.h"
namespace WebCore {
class MediaStreamDescriptor;
}
namespace WebKit {
class WebMediaStreamComponent;
class WebMediaStreamSource;
class WebString;
class WebMediaStreamDescriptor {
public:
class ExtraData {
public:
virtual ~ExtraData() { }
};
WebMediaStreamDescriptor() { }
WebMediaStreamDescriptor(const WebMediaStreamDescriptor& other) { assign(other); }
~WebMediaStreamDescriptor() { reset(); }
WebMediaStreamDescriptor& operator=(const WebMediaStreamDescriptor& other)
{
assign(other);
return *this;
}
WEBKIT_EXPORT void assign(const WebMediaStreamDescriptor&);
// DEPRECATED
WEBKIT_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamSource>&);
WEBKIT_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources);
WEBKIT_EXPORT void reset();
bool isNull() const { return m_private.isNull(); }
WEBKIT_EXPORT WebString label() const;
WEBKIT_EXPORT void audioSources(WebVector<WebMediaStreamComponent>&) const;
WEBKIT_EXPORT void videoSources(WebVector<WebMediaStreamComponent>&) const;
// Extra data associated with this WebMediaStreamDescriptor.
// If non-null, the extra data pointer will be deleted when the object is destroyed.
// Setting the extra data pointer will cause any existing non-null
// extra data pointer to be deleted.
WEBKIT_EXPORT ExtraData* extraData() const;
WEBKIT_EXPORT void setExtraData(ExtraData*);
#if WEBKIT_IMPLEMENTATION
WebMediaStreamDescriptor(WebCore::MediaStreamDescriptor*);
WebMediaStreamDescriptor(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&);
operator WTF::PassRefPtr<WebCore::MediaStreamDescriptor>() const;
operator WebCore::MediaStreamDescriptor*() const;
WebMediaStreamDescriptor& operator=(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&);
#endif
private:
WebPrivatePtr<WebCore::MediaStreamDescriptor> m_private;
};
} // namespace WebKit
#endif // WebMediaStreamDescriptor_h
|
/*
BoincLite, a light-weight library for BOINC clients.
Copyright (C) 2008 Sony Computer Science Laboratory Paris
Authors: Peter Hanappe, Anthony Beurive, Tangui Morlier
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; version 2.1 of the
License.
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 "BoincTest.h"
#include "BoincHttpTest.h"
#include "BoincProxyTest.h"
#include "BoincConfigurationTest.h"
#include "BoincHashTest.h"
#include "BoincSchedulerTest.h"
#include "BoincMem.h"
#include "BoincUtil.h"
#include <stdlib.h>
int main(int argc, char * argv[] )
{
boincMemInit();
BoincLogger log = { boincDefaultLogFunction, (void*) 9 };
boincLogInit(&log);
int test = 0;
if (argc > 1) {
test = atoi(argv[1]);
}
BoincTest myTests;
boincTestInit(&myTests);
// (void) boincNew(int); // to test memory leak detector
switch (test) {
default:
case 0:
testBoincHash(&myTests);
testBoincHttp(&myTests);
testBoincConfiguration(&myTests);
testBoincProxy(&myTests);
testBoincScheduler(&myTests);
break;
case 1:
log.userData = (void*) 0;
testBoincHash(&myTests);
break;
case 2:
log.userData = (void*) 0;
testBoincHttp(&myTests);
break;
case 3:
log.userData = (void*) 0;
testBoincConfiguration(&myTests);
break;
case 4:
log.userData = (void*) 0;
testBoincProxy(&myTests);
break;
case 999: ///LAST
case 5:
log.userData = (void*) 0;
testBoincScheduler(&myTests);
break;
}
boincTestEnd(&myTests);
boincMemLeaks();
boincMemCleanup();
return 0;
}
|
/*
* ion/mod_statusbar/statusd-launch.c
*
* Copyright (c) Tuomo Valkonen 1999-2009.
*
* See the included file LICENSE for details.
*/
#include <sys/time.h>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <libtu/minmax.h>
#include <libextl/readconfig.h>
#include <libmainloop/exec.h>
#include <libmainloop/select.h>
#include <libmainloop/signal.h>
#include <ioncore/saveload.h>
#include <ioncore/bindmaps.h>
#include <ioncore/global.h>
#include <ioncore/ioncore.h>
#include "statusbar.h"
#define CF_STATUSD_TIMEOUT_SEC 3
#define BL 1024
#define USEC 1000000
static bool process_pipe(int fd, ExtlFn fn,
bool *doneseen, bool *eagain)
{
char buf[BL];
int n;
*eagain=FALSE;
n=read(fd, buf, BL-1);
if(n<0){
if(errno==EAGAIN || errno==EINTR){
*eagain=(errno==EAGAIN);
return TRUE;
}
warn_err_obj(TR("reading a pipe"));
return FALSE;
}else if(n>0){
buf[n]='\0';
*doneseen=FALSE;
return extl_call(fn, "s", "b", &buf, doneseen);
}
return FALSE;
}
static bool wait_statusd_init(int outfd, int errfd, ExtlFn dh, ExtlFn eh)
{
fd_set rfds;
struct timeval tv, endtime, now;
int nfds=MAXOF(outfd, errfd);
int retval;
bool dummy, doneseen, eagain=FALSE;
if(mainloop_gettime(&endtime)!=0){
warn_err();
return FALSE;
}
now=endtime;
endtime.tv_sec+=CF_STATUSD_TIMEOUT_SEC;
while(1){
FD_ZERO(&rfds);
/* Calculate remaining time */
if(now.tv_sec>endtime.tv_sec){
goto timeout;
}else if(now.tv_sec==endtime.tv_sec){
if(now.tv_usec>=endtime.tv_usec)
goto timeout;
tv.tv_sec=0;
tv.tv_usec=endtime.tv_usec-now.tv_usec;
}else{
tv.tv_usec=USEC+endtime.tv_usec-now.tv_usec;
tv.tv_sec=-1+endtime.tv_sec-now.tv_sec;
/* Kernel lameness tuner: */
tv.tv_sec+=tv.tv_usec/USEC;
tv.tv_usec%=USEC;
}
FD_SET(outfd, &rfds);
FD_SET(errfd, &rfds);
retval=select(nfds+1, &rfds, NULL, NULL, &tv);
if(retval>0){
if(FD_ISSET(errfd, &rfds)){
if(!process_pipe(errfd, eh, &dummy, &eagain))
return FALSE;
}
if(FD_ISSET(outfd, &rfds)){
if(!process_pipe(outfd, dh, &doneseen, &eagain))
return FALSE;
if(doneseen){
/* Read rest of errors. */
bool ok;
do{
ok=process_pipe(errfd, eh, &dummy, &eagain);
}while(ok && !eagain);
return TRUE;
}
}
}else if(retval==0){
goto timeout;
}
if(mainloop_gettime(&now)!=0){
warn_err();
return FALSE;
}
}
return TRUE;
timeout:
/* Just complain to stderr, not startup error log, and do not fail.
* The system might just be a bit slow. We can continue, but without
* initial values for the meters, geometry adjustments may be necessary
* when we finally get that information.
*/
ioncore_warn_nolog(TR("ion-statusd timed out."));
return TRUE;
}
EXTL_EXPORT
int mod_statusbar__launch_statusd(const char *cmd,
ExtlFn initdatahandler,
ExtlFn initerrhandler,
ExtlFn datahandler,
ExtlFn errhandler)
{
pid_t pid;
int outfd=-1, errfd=-1;
if(cmd==NULL)
return -1;
pid=mainloop_do_spawn(cmd, NULL, NULL,
NULL, &outfd, &errfd);
if(pid<0)
return -1;
if(!wait_statusd_init(outfd, errfd, initdatahandler, initerrhandler))
goto err;
if(!mainloop_register_input_fd_extlfn(outfd, datahandler))
goto err;
if(!mainloop_register_input_fd_extlfn(errfd, errhandler))
goto err2;
return pid;
err2:
mainloop_unregister_input_fd(outfd);
err:
close(outfd);
close(errfd);
return -1;
}
/* statusd automatically exits when notion dies. However, when notion is
* restarted (i.e. notioncore.restart()), the new notion process is simply
* execve'ed on top of the old one, therefore the ion-statusd process must
* be explicitly terminated on deinit. This function should be called
* from Lua on deinit with the ion-statusd process id generated above.
*/
EXTL_EXPORT
int mod_statusbar__terminate_statusd(int pid)
{
if(pid==0) {
return -1;
}
/* Send SIGHUP to the specified statusd process to indicate
* that we're done. */
kill( (pid_t)pid, SIGHUP);
return 0;
}
|
//
// NCDatabaseTypeVariationsViewController.h
// Neocom
//
// Created by Артем Шиманский on 16.01.14.
// Copyright (c) 2014 Artem Shimanski. All rights reserved.
//
#import "NCTableViewController.h"
@class NCDBInvType;
@interface NCDatabaseTypeVariationsViewController : NCTableViewController
@property (nonatomic, strong) NSManagedObjectID* typeID;
@end
|
#ifndef MISC_HEAPALLOCATOR_H
#define MISC_HEAPALLOCATOR_H
namespace Misc {
class HeapAllocator
{
public:
void* Alloc(size_t size) { return new unsigned char[size]; }
void Free(void* ptr) { delete[] (unsigned char*)ptr; }
void FreeAll() { }
void SetBlockSize(int) { }
void SetObjectSize(int) { }
};
} // namespace Misc
#endif // MISC_HEAPALLOCATOR_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.