text stringlengths 4 6.14k |
|---|
#pragma once
#ifndef __LOCATION_H__
#define __LOCATION_H__
typedef struct GPSINFO
{
char utc_time[64];
char status;
float latitude_value;
char latitude;
float longtitude_value;
char longtitude;
float speed;
float azimuth_angle;
char utc_data[64];
}GPSINFO;
class CGPS
{
public:
CGPS(const char * com, int bps, int bits, int stopbits, int parity);
~CGPS();
GPSINFO& GetLocation();
private:
GPSINFO gpsinfo;
int fd;
};
#endif
|
#ifndef GRAPH_H
#define GRAPH_H
#include <QWidget>
#include <QLinkedList>
#include <QPointF>
#include <QPolygonF>
#include <QList>
#include <QDebug>
#include <QSize>
#include <QPoint>
#include <QString>
#include <QWheelEvent>
#include <QPainter>
#include <QTime>
#include "instancedata.h"
#include <talloc.h>
#include "../../include/version.h"
class Graph : public QWidget
{
Q_OBJECT
public:
explicit Graph(InstanceData *idata, QWidget *parent = 0);
InstanceData *ldata;
int i_max_index; // Hold value of maximum arrays
int i_s_count;
int i_stepsize;
int i_x_d_size; // Stores width of the diagram - fixed for now, will change dynamically in the future
int i_y_d_size; // Stores height of the diagram - fixed for now, will change dynamically in the future
int i_x_os; // Stores the diagram x offset (Distance widget border - diagram)
int i_y_os; // Stores the diagram y offset (Distance widget border - diagram)
int i_x_w_size; // Stores width of the widget that holds the diagram - fixed for now, will change dynamically in the future
int i_y_w_size; // Stores height of the widget that holdsdiagram - fixed for now, will change dynamically in the future
int i_dp_number; // Number of data points to be displayed in the graph - initialla i_dp_number = i_x_d_size
int i_dp_start, i_dp_end; // Defines index of the datapoints that will appear on the graph
int i_dp_min; // Minimum number of datapoints to be displayed in the graph
int i_dp_max; // Maximum number of datapoints to be displayed in the graph
int i_intpol_count; // Counter for the interpolation steps
float f_scalefactor;
float f_zoomfactor; // Keeps the zoomfactor (i_x_d_size/i_dp_num)
unsigned long l_read_max, l_write_max, l_max, l_c_max; // Holds the max values to do the scaling for the graph
unsigned long l_read_diff, l_write_diff; // Needed to calculate the interpolation steps
unsigned long thrputr;
unsigned long thrputw;
// QLinkedList<unsigned long> readlist, writelist; // Holds traffic values from dpoints
QList<unsigned long> *readlist, *writelist; // Holds traffic values from dpoints
QList<long long> readlist_w, writelist_w, worklist;
QPointF readp, writep;
QPolygonF readpg, writepg; //Stores the QPointFs for the pQPinterpaths
QString xstring1, xstring2, xstring3, xstring4, xstring5; // Graph axis labels
QString t_string, t_i_string; // Holds current time and time for full diagramm width
QString title; // Holds the title displayed in the graph
QTime g_clock;
// Hold configuration data
QString *hostString, *portString, *shareString, *userString,
*domainString, *fileString;
signals:
public slots:
void g_receivelist(QList<unsigned long> readlist_in, QList<unsigned long> writelist_in);
QList<long long> g_prepare_data(QList<unsigned long> getlist);
void g_get_w_size(); // Get the size of the widget that contains the graph
int g_get_dp_offset(); // Get the datapoint offset to t=0
void g_change_dp_num(int i_delta); // Change the number of datapoints for the graph
void g_def_dp_num(); // Map datapoints to pixels
void g_release_dp(); // map data points to pixel width (dp < pw)
void g_squeeze_dp(); // map data points to pixel width (dp > pw)
void g_interpolate(QList<unsigned long> readlist_in, QList<unsigned long> writelist_in); // Inteerpolation and create points to make the graph
void g_create_path(QList<unsigned long> readlist_in, QList<unsigned long> writelist_in);
char *mhr( long long int kb );
void paintEvent(QPaintEvent *event);
void paintGraph(QPaintEvent *event);
void wheelEvent(QWheelEvent *event); // Will catch wheel events to zoom the graph
};
#endif // GRAPH_H
|
#include <avr/io.h>
#include <stdio.h>
#ifndef BAUD
#define BAUD 115200
#endif
#include <util/setbaud.h>
/* http://www.cs.mun.ca/~rod/Winter2007/4723/notes/serial/serial.html */
void uart_init(void) {
UBRRH = UBRRH_VALUE;
UBRRL = UBRRL_VALUE;
#if USE_2X
UCSRA |= _BV(U2X);
#else
UCSRA &= ~(_BV(U2X0));
#endif
UCSRC = _BV(UCSZ1) | _BV(UCSZ0); /* 8-bit data */
UCSRB = _BV(RXEN) | _BV(TXEN); /* Enable RX and TX */
}
void uart_putchar(char c, FILE *stream) {
if (c == '\n') {
uart_putchar('\r', stream);
}
loop_until_bit_is_set(UCSRA, UDRE);
UDR = c;
}
char uart_getchar(FILE *stream) {
loop_until_bit_is_set(UCSRA, RXC);
return UDR;
}
|
//
// Created by simon on 2016-06-21.
//
#ifndef BUBBAROGUEFORT_ACTIONMENU_H
#define BUBBAROGUEFORT_ACTIONMENU_H
#include <HudRenderer.h>
#include <Layout.h>
#include <ListLayout.h>
#include "../logic/Bandit.h"
class Font;
class InventoryItem;
class ActionMenu : public HudRenderer {
public:
struct Action{
std::string attack;
std::string item;
Bandit* performer;
Bandit* target;
bool isAttack();
bool isItem();
Action(Bandit *performer, Bandit *target, std::string attack);
Action(std::string item, Bandit* target);
};
ActionMenu(std::vector<Bandit*>* fightersInPlay,std::vector<Bandit*>* banditsInPlay, std::vector<InventoryItem*>* inventory);
virtual void update(float dt) override;
/**
* If an action has been performed, the pair will
* contain the name of the attack performed and the bandit.
* If no action has been performed 'nullptr' will be returned.
*/
Action* pollAction();
private:
void createMainButtons();
void createInventoryButtons();
void createFighterButtons();
void createAttacksButtons(Bandit* fighter);
Layout* createAttackButton(Bandit* fighter, std::string attack);
Layout* createClickButton(std::string name);
void createTargetButtons(std::vector<Bandit*>* targets, std::function<void (Bandit*)> onTargetClick, std::function<void (void)> back);
Font* font;
ListLayout* buttonList;
std::vector<Bandit*>* fighters;
std::vector<Bandit*>* bandits;
std::vector<InventoryItem*>* inventory;
bool toMainButtons = false;
bool openInventory = false;
InventoryItem* itemPicked = nullptr;
Bandit* openAttackMenu = nullptr;
bool toFighters = false;
std::pair<std::string,Bandit*>* attackPicked = nullptr;
Action* performedAction = nullptr;
static void onActionHover(int x, int y, Layout* hoveredOn, bool enteredElseLeaving);
static void onActionClick(int x, int y, Layout* clickedOn, bool enteredElseLeaving);
};
#endif //BUBBAROGUEFORT_ACTIONMENU_H
|
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <platform.h>
#include "drivers/io.h"
#include "drivers/pwm_mapping.h"
#include "drivers/timer.h"
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
// MOTOR outputs
{ TIM8, IO_TAG(PC6), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_4, TIM_USE_MC_MOTOR }, // PWM1 - PC6 - TIM8_CH1
{ TIM8, IO_TAG(PC7), TIM_Channel_2, 1, IOCFG_AF_PP, GPIO_AF_4, TIM_USE_MC_MOTOR }, // PWM2 - PC7 - TIM8_CH2
{ TIM8, IO_TAG(PC8), TIM_Channel_3, 1, IOCFG_AF_PP, GPIO_AF_4, TIM_USE_MC_MOTOR }, // PWM3 - PC8 - TIM8_CH3
{ TIM8, IO_TAG(PC9), TIM_Channel_4, 1, IOCFG_AF_PP, GPIO_AF_4, TIM_USE_MC_MOTOR }, // PWM4 - PC9 - TIM8_CH4
// Additional servo outputs
{ TIM3, IO_TAG(PA4), TIM_Channel_2, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_SERVO }, // PWM5 - PA4 - TIM3_CH2
{ TIM3, IO_TAG(PB1), TIM_Channel_4, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_SERVO }, // PWM6 - PB1 - TIM3_CH4
// PPM PORT - Also USART2 RX (AF5)
{ TIM2, IO_TAG(PA3), TIM_Channel_4, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PPM }, // PPM - PA3 - TIM2_CH4
// LED_STRIP
{ TIM1, IO_TAG(PA8), TIM_Channel_1, 0, IOCFG_AF_PP, GPIO_AF_6, TIM_USE_ANY }, // GPIO_TIMER / LED_STRIP
// PWM_BUZZER
{ TIM16, IO_TAG(PB4), TIM_Channel_1, 1, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_BEEPER }, // BUZZER - PB4 - TIM16_CH1N
};
|
#ifndef __CAMERA_H_INCLUDED__
#define __CAMERA_H_INCLUDED__
#include "object.h"
class Camera {
private:
float position[3];
float target[3];
float matrix[9];
float *right, *up, *forward;
float positionang[3]; // position angulaire actuelle
float optimalposition[3]; // position angulaire que doit atteindre la caméra
// desc: {angh, dist, h}
bool end; // controle si c'est une caméra placée pour la mort
void calculateMatrix(void);
public:
Camera(void);
void setStart();
void setAutoNormal(Object *obj1, Object *obj2, bool finish);
void setAutoCastOut(Object *obj);
void setAutoBeheaded(Object *head, float angle);
void setAutoFallHead(Object *head, Object *torso);
void setPosition(float position[3]);
void setPosition(float x, float y, float z);
void getPosition(float *position);
void setTarget(float target[3]);
void getTarget(float *target);
void setUp(float up[3]);
void getMatrix(float *matrix);
void moveRight(float amount);
void moveUp(float amount);
void moveForward(float amount);
void glUpdate(void);
};
#endif
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#pragma once
#include <windows.h>
#ifdef __cplusplus
extern "C"
{
#endif
void WINAPI DB_SendCommand(LPCSTR command);
#ifdef __cplusplus
}
#endif
|
/*-------------------------------------------------------------------------
*
* sequence.h
* prototypes for sequence.c.
*
* Portions Copyright (c) 2012-2014, TransLattice, Inc.
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/sequence.h
*
*-------------------------------------------------------------------------
*/
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include "access/xlogreader.h"
#include "catalog/objectaddress.h"
#include "fmgr.h"
#include "lib/stringinfo.h"
#include "nodes/parsenodes.h"
#include "storage/relfilenode.h"
#ifdef PGXC
#include "utils/relcache.h"
#include "gtm/gtm_c.h"
#include "access/xact.h"
#endif
typedef struct FormData_pg_sequence
{
NameData sequence_name;
int64 last_value;
int64 start_value;
int64 increment_by;
int64 max_value;
int64 min_value;
int64 cache_value;
int64 log_cnt;
bool is_cycled;
bool is_called;
} FormData_pg_sequence;
typedef FormData_pg_sequence *Form_pg_sequence;
/*
* Columns of a sequence relation
*/
#define SEQ_COL_NAME 1
#define SEQ_COL_LASTVAL 2
#define SEQ_COL_STARTVAL 3
#define SEQ_COL_INCBY 4
#define SEQ_COL_MAXVALUE 5
#define SEQ_COL_MINVALUE 6
#define SEQ_COL_CACHE 7
#define SEQ_COL_LOG 8
#define SEQ_COL_CYCLE 9
#define SEQ_COL_CALLED 10
#define SEQ_COL_FIRSTCOL SEQ_COL_NAME
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
/* XLOG stuff */
#define XLOG_SEQ_LOG 0x00
typedef struct xl_seq_rec
{
RelFileNode node;
/* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
} xl_seq_rec;
extern Datum nextval(PG_FUNCTION_ARGS);
extern Datum nextval_oid(PG_FUNCTION_ARGS);
extern Datum currval_oid(PG_FUNCTION_ARGS);
extern Datum setval_oid(PG_FUNCTION_ARGS);
extern Datum setval3_oid(PG_FUNCTION_ARGS);
extern Datum lastval(PG_FUNCTION_ARGS);
extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS);
extern ObjectAddress DefineSequence(CreateSeqStmt *stmt);
extern ObjectAddress AlterSequence(AlterSeqStmt *stmt);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
extern void seq_redo(XLogReaderState *rptr);
extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
extern const char *seq_identify(uint8 info);
#ifdef XCP
#define DEFAULT_CACHEVAL 1
extern int SequenceRangeVal;
#endif
#ifdef PGXC
/*
* List of actions that registered the callback.
* This is listed here and not in sequence.c because callback can also
* be registered in dependency.c and tablecmds.c as sequences can be dropped
* or renamed in cascade.
*/
typedef enum
{
GTM_CREATE_SEQ,
GTM_DROP_SEQ
} GTM_SequenceDropType;
/* Sequence callbacks on GTM */
extern void register_sequence_rename_cb(char *oldseqname, char *newseqname);
extern void rename_sequence_cb(GTMEvent event, void *args);
extern void register_sequence_cb(char *seqname, GTM_SequenceKeyType key, GTM_SequenceDropType type);
extern void drop_sequence_cb(GTMEvent event, void *args);
extern bool IsTempSequence(Oid relid);
extern char *GetGlobalSeqName(Relation rel, const char *new_seqname, const char *new_schemaname);
#endif
#endif /* SEQUENCE_H */
|
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 "init.h"
#include "sbi-path.h"
static ogs_thread_t *thread;
static void af_main(void *data);
static int initialized = 0;
int af_initialize()
{
int rv;
af_context_init();
af_event_init();
ogs_sbi_context_init();
rv = ogs_sbi_context_parse_config("af", "nrf");
if (rv != OGS_OK) return rv;
rv = af_context_parse_config();
if (rv != OGS_OK) return rv;
rv = ogs_log_config_domain(
ogs_app()->logger.domain, ogs_app()->logger.level);
if (rv != OGS_OK) return rv;
rv = af_sbi_open();
if (rv != 0) return OGS_ERROR;
thread = ogs_thread_create(af_main, NULL);
if (!thread) return OGS_ERROR;
initialized = 1;
return OGS_OK;
}
static ogs_timer_t *t_termination_holding = NULL;
static void event_termination(void)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
/* Sending NF Instance De-registeration to NRF */
ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance)
af_nf_fsm_fini(nf_instance);
/* Starting holding timer */
t_termination_holding = ogs_timer_add(ogs_app()->timer_mgr, NULL, NULL);
ogs_assert(t_termination_holding);
#define TERMINATION_HOLDING_TIME ogs_time_from_msec(300)
ogs_timer_start(t_termination_holding, TERMINATION_HOLDING_TIME);
/* Sending termination event to the queue */
ogs_queue_term(ogs_app()->queue);
ogs_pollset_notify(ogs_app()->pollset);
}
void af_terminate(void)
{
if (!initialized) return;
/* Daemon terminating */
event_termination();
ogs_thread_destroy(thread);
ogs_timer_delete(t_termination_holding);
af_sbi_close();
af_context_final();
ogs_sbi_context_final();
af_event_final(); /* Destroy event */
}
static void af_main(void *data)
{
ogs_fsm_t af_sm;
int rv;
ogs_fsm_create(&af_sm, af_state_initial, af_state_final);
ogs_fsm_init(&af_sm, 0);
for ( ;; ) {
ogs_pollset_poll(ogs_app()->pollset,
ogs_timer_mgr_next(ogs_app()->timer_mgr));
/*
* After ogs_pollset_poll(), ogs_timer_mgr_expire() must be called.
*
* The reason is why ogs_timer_mgr_next() can get the corrent value
* when ogs_timer_stop() is called internally in ogs_timer_mgr_expire().
*
* You should not use event-queue before ogs_timer_mgr_expire().
* In this case, ogs_timer_mgr_expire() does not work
* because 'if rv == OGS_DONE' statement is exiting and
* not calling ogs_timer_mgr_expire().
*/
ogs_timer_mgr_expire(ogs_app()->timer_mgr);
for ( ;; ) {
af_event_t *e = NULL;
rv = ogs_queue_trypop(ogs_app()->queue, (void**)&e);
ogs_assert(rv != OGS_ERROR);
if (rv == OGS_DONE)
goto done;
if (rv == OGS_RETRY)
break;
ogs_assert(e);
ogs_fsm_dispatch(&af_sm, e);
af_event_free(e);
}
}
done:
ogs_fsm_fini(&af_sm, 0);
ogs_fsm_delete(&af_sm);
}
|
/*
Copyright (c) 2014-2019 AscEmu Team <http://www.ascemu.org>
This file is released under the MIT license. See README-MIT for more information.
*/
#pragma once
enum CreatureEntry
{
// Devouring Ectoplasm AI
CN_DEVOURING_ECTOPLASM = 3638,
// Druid of the Fang AIr
CN_DRUID_FANG = 3840,
// BOSSES
// Lady Anacondra AI
CN_LADY_ANACONDRA = 3671,
// Lord Cobrahn AI
CN_LORD_COBRAHN = 3669,
// Lord Pythas AI
CN_LORD_PYTHAS = 3670,
// Lord Serpentis AI
CN_LORD_SERPENTIS = 3673,
// Verdan the Everliving AI
CN_VERDAN_EVERLIVING = 5775,
// Skum AI
CN_SKUM = 3674,
// Mutanus the Devourer AI
CN_MUTANUS = 3654,
// Wailing Caverns Event
// Discipline of Naralex Gossip
CN_NARALEX = 3679,
CN_DIS_NARALEX = 3678,
};
enum CreatureSpells
{
};
enum CreatureSay
{
};
|
/*
* Handles static content in /www/
*/
# include <system.h>
# include <system/http.h>
# include <status.h>
# include <type.h>
# include <kernel/kernel.h>
inherit resource HTTP_RESOURCE_LIB;
string filename;
void create(varargs int clone) {
resource::create(clone);
set_authentication_flags(HTTP_ALLOWS_PUBLIC_READ);
if(clone) {
}
}
int resource_exists() {
string path;
path = get_parameter("directory") + "/" + get_resource_id();
filename = find_object(DRIVER)->normalize_path("/www/" + path, "/www/");
/* does file exist under /www/ ? */
if(filename[0..4] != "/www/") return FALSE;
if(sizeof(get_dir(filename)[0]) != 1) return FALSE;
return TRUE;
}
int is_authorized(string auth) { return TRUE; }
string *allowed_methods() {
return ({ "OPTIONS", "GET", "HEAD" });
}
int forbidden() { return FALSE; }
mixed *content_types_provided() {
return ({
({ "text/javascript", "get_content" }),
({ "application/javascript", "get_content" }),
({ "text/ecmascript", "get_content" }),
({ "application/ecmascript", "get_content" }),
({ "text/css", "get_content" }),
({ "text/html", "get_content" }),
});
}
mixed *content_types_accepted() { return ({ }); }
mixed get_content(mapping metadata) {
string *content;
int size;
int i, n, strsize;
string *bits;
string ext, type;
size = get_dir(filename)[1][0];
strsize = status(ST_STRSIZE);
if(size < strsize) { /* we can read it all at once */
content = ({ read_file(filename) });
}
else { /* we just have to make sure we don't have any files greater than
* STRSIZE * ARRAYSZ
*/
n = size/strsize+1;
content = allocate(n);
for(i = 0, n = size/strsize+1; i < n; i++)
content[i] = read_file(filename, strsize*i, strsize);
}
bits = explode(filename, "/");
ext = bits[sizeof(bits)-1];
bits = explode(ext, ".");
ext = bits[sizeof(bits)-1];
switch(ext) {
case "html": type = "text/html"; break;
case "css": type = "text/css"; break;
case "min.css": type = "text/css"; break;
case "js": type = "application/javascript"; break;
default: type = "text/plain"; break;
}
get_response() -> add_header("Content-Type", type);
return content;
}
|
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
#pragma hdrstop
#include "rename.h"
#if(!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) || defined(USE_ALTSVC)
#include "curl_multibyte.h"
//#include "timeval.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
/* return 0 on success, 1 on error */
int Curl_rename(const char * oldpath, const char * newpath)
{
#ifdef WIN32
/* rename() on Windows doesn't overwrite, so we can't use it here.
MoveFileEx() will overwrite and is usually atomic, however it fails
when there are open handles to the file. */
const int max_wait_ms = 1000;
struct curltime start = Curl_now();
TCHAR * tchar_oldpath = curlx_convert_UTF8_to_tchar((char *)oldpath);
TCHAR * tchar_newpath = curlx_convert_UTF8_to_tchar((char *)newpath);
for(;;) {
timediff_t diff;
if(MoveFileEx(tchar_oldpath, tchar_newpath, MOVEFILE_REPLACE_EXISTING)) {
curlx_unicodefree(tchar_oldpath);
curlx_unicodefree(tchar_newpath);
break;
}
diff = Curl_timediff(Curl_now(), start);
if(diff < 0 || diff > max_wait_ms) {
curlx_unicodefree(tchar_oldpath);
curlx_unicodefree(tchar_newpath);
return 1;
}
Sleep(1);
}
#else
if(rename(oldpath, newpath))
return 1;
#endif
return 0;
}
#endif
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Object.h"
#include "IntsDuplex.generated.h"
/**
*
*/
UCLASS(BlueprintType)
class VECTORIZINGANIMATION_API UIntsDuplex : public UObject
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "Line")
UIntsDuplex* Clone();
UFUNCTION(BlueprintCallable, Category = "Line")
static TArray<UIntsDuplex*> CloneArray(const TArray<UIntsDuplex*>& src);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Line")
TArray<int32> left;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Line")
TArray<int32> right;
TArray<int32>& operator[](int32 i)
{
if (i % 2 == 0)
{
return left;
}
else
{
return right;
}
}
};
|
//
// Vector3d.h
// CardboardSDK-iOS
//
#pragma once
#include "ofMain.h"
class Vector3d
{
friend class Matrix3x3d;
friend class SO3Util;
public:
Vector3d();
Vector3d(double x, double y, double z);
Vector3d(Vector3d *other);
void set(double x, double y, double z);
void setComponent(int i, double val);
void setZero();
void set(Vector3d *other);
void scale(double s);
void normalize();
static double dot(Vector3d *a, Vector3d *b);
double length();
bool sameValues(Vector3d *other);
static void sub(Vector3d *a, Vector3d *b, Vector3d *result);
static void cross(Vector3d *a, Vector3d *b, Vector3d *result);
static void ortho(Vector3d *v, Vector3d *result);
static int largestAbsComponent(Vector3d *v);
inline double x() const { return _x; }
inline double y() const { return _y; }
inline double z() const { return _z; }
private:
double _x;
double _y;
double _z;
}; |
/**
******************************************************************************
* @file TIM/TIM_PWMInput/Src/stm32f4xx_hal_msp.c
* @author MCD Application Team
* @version V1.2.5
* @date 29-January-2016
* @brief HAL MSP module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/** @addtogroup STM32F4xx_HAL_Examples
* @{
*/
/** @defgroup HAL_MSP
* @brief HAL MSP module.
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup HAL_MSP_Private_Functions
* @{
*/
/**
* @brief TIM MSP Initialization
* This function configures the hardware resources used in this example:
* - Peripheral's clock enable
* - Peripheral's GPIO Configuration
* @param htim: TIM handle pointer
* @retval None
*/
void HAL_TIM_IC_MspInit(TIM_HandleTypeDef *htim)
{
GPIO_InitTypeDef GPIO_InitStruct;
/*##-1- Enable peripherals and GPIO Clocks #################################*/
/* TIMx Peripheral clock enable */
TIMx_CLK_ENABLE();
/* Enable GPIO channels Clock */
TIMx_CHANNEL_GPIO_PORT();
/* Configure (TIMx_Channel) in Alternate function, push-pull and 100MHz speed */
GPIO_InitStruct.Pin = GPIO_PIN_CHANNEL2;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF_TIMx;
HAL_GPIO_Init(GPIO_PORT, &GPIO_InitStruct);
/*##-2- Configure the NVIC for TIMx #########################################*/
/* Sets the priority grouping field */
HAL_NVIC_SetPriority(TIMx_IRQn, 0, 1);
/* Enable the TIM4 global Interrupt */
HAL_NVIC_EnableIRQ(TIMx_IRQn);
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#include "mupdf/fitz.h"
#include "html-imp.h"
#include <string.h>
static fz_font *
fz_load_html_default_font(fz_context *ctx, fz_html_font_set *set, const char *family, int is_bold, int is_italic)
{
int is_mono = !strcmp(family, "monospace");
int is_sans = !strcmp(family, "sans-serif");
const char *real_family = is_mono ? "Courier" : is_sans ? "Helvetica" : "Charis SIL";
const char *backup_family = is_mono ? "Courier" : is_sans ? "Helvetica" : "Times";
int idx = (is_mono ? 8 : is_sans ? 4 : 0) + is_bold * 2 + is_italic;
if (!set->fonts[idx])
{
const unsigned char *data;
int size;
data = fz_lookup_builtin_font(ctx, real_family, is_bold, is_italic, &size);
if (!data)
data = fz_lookup_builtin_font(ctx, backup_family, is_bold, is_italic, &size);
if (!data)
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load html font: %s", real_family);
set->fonts[idx] = fz_new_font_from_memory(ctx, NULL, data, size, 0, 1);
fz_font_flags(set->fonts[idx])->is_serif = !is_sans;
}
return set->fonts[idx];
}
void
fz_add_html_font_face(fz_context *ctx, fz_html_font_set *set,
const char *family, int is_bold, int is_italic, int is_small_caps,
const char *src, fz_font *font)
{
fz_html_font_face *custom = fz_malloc_struct(ctx, fz_html_font_face);
custom->font = fz_keep_font(ctx, font);
custom->src = fz_strdup(ctx, src);
custom->family = fz_strdup(ctx, family);
custom->is_bold = is_bold;
custom->is_italic = is_italic;
custom->is_small_caps = is_small_caps;
custom->next = set->custom;
set->custom = custom;
}
fz_font *
fz_load_html_font(fz_context *ctx, fz_html_font_set *set,
const char *family, int is_bold, int is_italic, int is_small_caps)
{
fz_html_font_face *custom;
const unsigned char *data;
int best_score = 0;
fz_font *best_font = NULL;
int size;
for (custom = set->custom; custom; custom = custom->next)
{
if (!strcmp(family, custom->family))
{
int score =
1 * (is_bold == custom->is_bold) +
2 * (is_italic == custom->is_italic) +
4 * (is_small_caps == custom->is_small_caps);
if (score > best_score)
{
best_score = score;
best_font = custom->font;
}
}
}
if (best_font)
return best_font;
data = fz_lookup_builtin_font(ctx, family, is_bold, is_italic, &size);
if (data)
{
fz_font *font = fz_new_font_from_memory(ctx, NULL, data, size, 0, 0);
fz_font_flags_t *flags = fz_font_flags(font);
if (is_bold && !flags->is_bold)
flags->fake_bold = 1;
if (is_italic && !flags->is_italic)
flags->fake_italic = 1;
fz_add_html_font_face(ctx, set, family, is_bold, is_italic, 0, "<builtin>", font);
fz_drop_font(ctx, font);
return font;
}
if (!strcmp(family, "monospace") || !strcmp(family, "sans-serif") || !strcmp(family, "serif"))
return fz_load_html_default_font(ctx, set, family, is_bold, is_italic);
return NULL;
}
fz_html_font_set *fz_new_html_font_set(fz_context *ctx)
{
return fz_malloc_struct(ctx, fz_html_font_set);
}
void fz_drop_html_font_set(fz_context *ctx, fz_html_font_set *set)
{
fz_html_font_face *font, *next;
int i;
if (!set)
return;
font = set->custom;
while (font)
{
next = font->next;
fz_drop_font(ctx, font->font);
fz_free(ctx, font->src);
fz_free(ctx, font->family);
fz_free(ctx, font);
font = next;
}
for (i = 0; i < nelem(set->fonts); ++i)
fz_drop_font(ctx, set->fonts[i]);
fz_free(ctx, set);
}
|
/*
* opencog/reasoning/pln/PLNModule.h
*
* Copyright (C) 2008 by Singularity Institute for Artificial Intelligence
* All Rights Reserved
*
* Written by Jared Wigmore <jared.wigmore@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* at http://opencog.org/wiki/Licenses
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program; if not, write to:
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _OPENCOG_PLN_MODULE_H
#define _OPENCOG_PLN_MODULE_H
#include <string>
#include <opencog/server/CogServer.h>
#include <opencog/server/Factory.h>
#include <opencog/server/Module.h>
#include <opencog/server/Request.h>
#include "BackInferenceTreeNode.h"
#include "BackChainingAgent.h"
#include "ForwardChainingAgent.h"
#include "FitnessEvaluator.h"
namespace opencog {
class CogServer;
class PLNModule : public Module
{
private:
static const char* usageInfo;
DECLARE_CMD_REQUEST(PLNModule, "pln", do_pln,
"Run a PLN command",usageInfo, false);
Factory<BackChainingAgent, Agent> backChainingFactory;
Factory<ForwardChainingAgent, Agent> forwardChainingFactory;
const std::string* DEFAULT()
{
static const std::string defaultConfig[] = {
"PLN_RECORD_TRAILS", "true",
"PLN_LOG_LEVEL", "2",
"PLN_FW_VARS_IN_ATOMSPACE", "true",
"PLN_PRINT_REAL_ATOMS", "true",
"PLN_FITNESS_EVALUATOR", "best",
"", ""
};
return defaultConfig;
}
void setParameters(const std::string* params);
/**
* That method is used to wrapped in a scheme function.
* It calls infer, returns the Handle of the resulting atom if the
* inference is successful, or the undefined Handle otherwise.
*/
Handle pln_bc(Handle h, int steps);
/**
* That method is used to wrapped in a scheme function.
* It calls applyRule
*/
Handle pln_ar(const std::string& ruleName, const HandleSeq& premises);
public:
virtual const ClassInfo& classinfo() const { return info(); }
static const ClassInfo& info() {
static const ClassInfo _ci("opencog::PLNModule");
return _ci;
}
static inline const char* id();
bool recordingTrails;
PLNModule();
~PLNModule();
void init();
/** Process command request from do_pln
*
* @todo Need to add commands for exploring the AtomSpace as viewed
* through the AtomSpaceWrapper.
* @todo Need to add commands for controlling multiple roots/targets.
*/
std::string runCommand(std::list<std::string> args);
FitnessEvaluatorT fitnessEvaluator;
}; // class
#if 0
/** Takes a real handle, and sets the backward-chaining target to that atom.
*/
void setTarget(Handle h);
#endif
namespace pln {
/** Does steps inference steps on target h. Optionally sets the target used in
* the PLN cogserver commands.
* Intended for use by the pln-bc Scheme command; this is currently set up for
* practical use rather than testing use, and as such will not stop at the
* first result it finds.
*
* @param h The handle to do inference on (a normal handle, not a PLN handle)
* @param steps Takes the maximum number of steps allowed, and stores the
* number of steps performed
* @param setTarget If true, the BIT created here will be/replace the one
* used with the 'pln' cogserver command.
* @return The (normal) handle of the result.
*/
Handle infer(Handle h, int &steps, bool setTarget);
/**
* that function apply a PLN inference rule given its name and its premises
* to produce the conclusion. The set of rules is taken from
* DefaultVariableRuleProvider.
* If the name rule does not correspond to any declared rules
* then the Handle returned is UNDEFINED_HANDLE
*
* @param rule_name the name of PLN rule to apply
* @param premises the list of Handle premises
*
* @return the Handle of the conclusion. Handle::UNDEFINED if no rule
* corresponds to ruleName
*/
Handle applyRule(const std::string& ruleName, const HandleSeq& premises);
}} // ~namespace opencog::pln
#endif // _OPENCOG_PLN_MODULE_H
|
/* MODULE: auth_sasldb */
/* COPYRIGHT
* Copyright (c) 1997-2000 Messaging Direct Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 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 MESSAGING DIRECT LTD. ``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 MESSAGING DIRECT LTD. OR
* ITS EMPLOYEES OR AGENTS 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.
* END COPYRIGHT */
/* SYNOPSIS
* crypt(3) based passwd file validation
* END SYNOPSIS */
/* PUBLIC DEPENDENCIES */
#include "mechanisms.h"
#include <string.h>
#include <stdlib.h>
#include <pwd.h>
#include <config.h>
#include <unistd.h>
/* END PUBLIC DEPENDENCIES */
#define RETURN(x) return strdup(x)
#ifdef AUTH_SASLDB
#include "../include/sasl.h"
#include "../include/saslplug.h"
#include "../sasldb/sasldb.h"
#include "../saslint.h"
static int
vf(void *context __attribute__((unused)),
char *file __attribute__((unused)),
int type __attribute__((unused)))
{
/* always say ok */
return SASL_OK;
}
static int lame_getcallback(sasl_conn_t *conn __attribute__((unused)),
unsigned long callbackid,
int (**pproc)(),
void **pcontext)
{
if(callbackid == SASL_CB_VERIFYFILE) {
*pproc = vf;
*pcontext = NULL;
return SASL_OK;
}
return SASL_FAIL;
}
static void lame_log(sasl_conn_t *conn __attribute__((unused)),
int level __attribute__((unused)),
const char *fmt __attribute__((unused)),
...)
{
return;
}
static void lame_seterror(sasl_conn_t *conn __attribute__((unused)),
unsigned flags __attribute__((unused)),
const char *fmt __attribute__((unused)),
...)
{
return;
}
/* FUNCTION: init_lame_utils */
/* This sets up a very minimal sasl_utils_t for use only with the
* database functions */
static void init_lame_utils(sasl_utils_t *utils)
{
memset(utils, 0, sizeof(sasl_utils_t));
utils->malloc=(sasl_malloc_t *)malloc;
utils->calloc=(sasl_calloc_t *)calloc;
utils->realloc=(sasl_realloc_t *)realloc;
utils->free=(sasl_free_t *)free;
utils->getcallback=lame_getcallback;
utils->log=lame_log;
utils->seterror=lame_seterror;
return;
}
/* END FUNCTION: init_lame_utils */
#endif /* AUTH_SASLDB */
/* FUNCTION: auth_sasldb */
char * /* R: allocated response string */
auth_sasldb (
/* PARAMETERS */
#ifdef AUTH_SASLDB
const char *login, /* I: plaintext authenticator */
const char *password, /* I: plaintext password */
const char *service __attribute__((unused)),
const char *realm,
#else
const char *login __attribute__((unused)),/* I: plaintext authenticator */
const char *password __attribute__((unused)), /* I: plaintext password */
const char *service __attribute__((unused)),
const char *realm __attribute__((unused)),
#endif
const char *remote __attribute__((unused)) /* I: remote host address */
/* END PARAMETERS */
)
{
#ifdef AUTH_SASLDB
/* VARIABLES */
char pw[1024]; /* pointer to passwd file entry */
sasl_utils_t utils;
int ret;
size_t outsize;
const char *use_realm;
char realm_buf[MAXFQDNLEN];
/* END VARIABLES */
init_lame_utils(&utils);
_sasl_check_db(&utils, (void *)0x1);
if(!realm || !strlen(realm)) {
ret = gethostname(realm_buf,MAXFQDNLEN);
if(ret) RETURN("NO");
use_realm = realm_buf;
} else {
use_realm = realm;
}
ret = _sasldb_getdata(&utils, (void *)0x1, login, use_realm,
"userPassword", pw, 1024, &outsize);
if (ret != SASL_OK) {
RETURN("NO");
}
if (strcmp(pw, password)) {
RETURN("NO");
}
RETURN("OK");
#else
RETURN("NO");
#endif
}
/* END FUNCTION: auth_sasldb */
/* END MODULE: auth_sasldb */
|
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _BUILD_XMLUTILS_ENCODINGS_H_
#define _BUILD_XMLUTILS_ENCODINGS_H_
#include "../../common/File.h"
#include "../../../UnicodeConverter/UnicodeConverter.h"
#define XML_HEADER_CHECKER_LENGHT 100
namespace XmlUtils
{
// эта функция считает, что на вход пришла точно хмл.
// надо лишь определить кодировку и отдать строку в utf-8
static std::string GetXmlContentAsUTF8(const std::wstring& sFile)
{
std::string sXmlSource;
if (!NSFile::CFileBinary::ReadAllTextUtf8A(sFile, sXmlSource))
return sXmlSource;
std::string::size_type nCheckCount = sXmlSource.length();
std::string sChecker = (nCheckCount > XML_HEADER_CHECKER_LENGHT) ? sXmlSource.substr(0, XML_HEADER_CHECKER_LENGHT) : sXmlSource;
std::string::size_type posEncoding = sChecker.find("encoding=\"");
if (std::string::npos == posEncoding)
return sXmlSource;
posEncoding += 10; // len(encoding=\")
std::string::size_type posEnd = sChecker.find("\"", posEncoding);
if (std::string::npos == posEnd)
return sXmlSource;
std::string sEncoding = sChecker.substr(posEncoding, posEnd - posEncoding);
if (sEncoding == "utf-8" || sEncoding == "UTF-8")
return sXmlSource;
posEnd = sChecker.find(">", posEnd);
if (std::string::npos == posEnd)
return sXmlSource;
sXmlSource = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + sXmlSource.substr(posEnd + 1);
NSUnicodeConverter::CUnicodeConverter oConverter;
std::wstring sUnicodeContent = oConverter.toUnicode(sXmlSource, sEncoding.c_str());
return U_TO_UTF8(sUnicodeContent);
}
}
#endif // _BUILD_XMLUTILS_ENCODINGS_H_
|
/***************************************************************************/
/* */
/* ttunpat.h */
/* */
/* Definitions for the unpatented TrueType hinting system */
/* */
/* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by Graham Asher <graham.asher@btinternet.com> */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __TTUNPAT_H__
#define __TTUNPAT_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* A constant used as the tag of an @FT_Parameter structure to indicate
* that unpatented methods only should be used by the TrueType bytecode
* interpreter for a typeface opened by @FT_Open_Face.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */
FT_END_HEADER
#endif /* __TTUNPAT_H__ */
/* END */
|
// This file is part of the HörTech Open Master Hearing Aid (openMHA)
// Copyright © 2007 2008 2013 2016 2017 2018 HörTech gGmbH
//
// openMHA is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// openMHA is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License, version 3 for more details.
//
// You should have received a copy of the GNU Affero General Public License,
// version 3 along with openMHA. If not, see <http://www.gnu.org/licenses/>.
#include <alsa/asoundlib.h>
int main(int argc,char** argv)
{
snd_pcm_t* pcm;
int err;
if( argc < 2 ){
fprintf(stderr,"Usage: testalsadevice <card>\n");
exit(2);
}
if( (err = snd_pcm_open(&pcm,argv[1],SND_PCM_STREAM_PLAYBACK,0)) < 0 )
exit(1);
snd_pcm_close(pcm);
return 0;
}
// Local Variables:
// c-basic-offset: 4
// indent-tabs-mode: nil
// coding: utf-8-unix
// End:
|
/*!
\file gd32f10x_fwdgt.c
\brief FWDGT driver
\version 2014-12-26, V1.0.0, firmware for GD32F10x
\version 2017-06-20, V2.0.0, firmware for GD32F10x
\version 2018-07-31, V2.1.0, firmware for GD32F10x
*/
/*
Copyright (c) 2018, GigaDevice Semiconductor 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 the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#include "gd32f10x_fwdgt.h"
/* write value to FWDGT_CTL_CMD bit field */
#define CTL_CMD(regval) (BITS(0,15) & ((uint32_t)(regval) << 0))
/* write value to FWDGT_RLD_RLD bit field */
#define RLD_RLD(regval) (BITS(0,11) & ((uint32_t)(regval) << 0))
/*!
\brief enable write access to FWDGT_PSC and FWDGT_RLD
\param[in] none
\param[out] none
\retval none
*/
void fwdgt_write_enable(void)
{
FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE;
}
/*!
\brief disable write access to FWDGT_PSC and FWDGT_RLD
\param[in] none
\param[out] none
\retval none
*/
void fwdgt_write_disable(void)
{
FWDGT_CTL = FWDGT_WRITEACCESS_DISABLE;
}
/*!
\brief start the free watchdog timer counter
\param[in] none
\param[out] none
\retval none
*/
void fwdgt_enable(void)
{
FWDGT_CTL = FWDGT_KEY_ENABLE;
}
/*!
\brief reload the counter of FWDGT
\param[in] none
\param[out] none
\retval none
*/
void fwdgt_counter_reload(void)
{
FWDGT_CTL = FWDGT_KEY_RELOAD;
}
/*!
\brief configure counter reload value, and prescaler divider value
\param[in] reload_value: specify reload value(0x0000 - 0x0FFF)
\param[in] prescaler_div: FWDGT prescaler value
only one parameter can be selected which is shown as below:
\arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4
\arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8
\arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16
\arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32
\arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64
\arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128
\arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256
\param[out] none
\retval ErrStatus: ERROR or SUCCESS
*/
ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div)
{
uint32_t timeout = FWDGT_PSC_TIMEOUT;
uint32_t flag_status = RESET;
/* enable write access to FWDGT_PSC,and FWDGT_RLD */
FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE;
/* wait until the PUD flag to be reset */
do{
flag_status = FWDGT_STAT & FWDGT_STAT_PUD;
}while((--timeout > 0U) && ((uint32_t)RESET != flag_status));
if((uint32_t)RESET != flag_status){
return ERROR;
}
/* configure FWDGT */
FWDGT_PSC = (uint32_t)prescaler_div;
timeout = FWDGT_RLD_TIMEOUT;
/* wait until the RUD flag to be reset */
do{
flag_status = FWDGT_STAT & FWDGT_STAT_RUD;
}while((--timeout > 0U) && ((uint32_t)RESET != flag_status));
if((uint32_t)RESET != flag_status){
return ERROR;
}
FWDGT_RLD = RLD_RLD(reload_value);
/* reload the counter */
FWDGT_CTL = FWDGT_KEY_RELOAD;
return SUCCESS;
}
/*!
\brief get flag state of FWDGT
\param[in] flag: flag to get
only one parameter can be selected which is shown as below:
\arg FWDGT_FLAG_PUD: a write operation to FWDGT_PSC register is on going
\arg FWDGT_FLAG_RUD: a write operation to FWDGT_RLD register is on going
\param[out] none
\retval FlagStatus: SET or RESET
*/
FlagStatus fwdgt_flag_get(uint16_t flag)
{
if(FWDGT_STAT & flag){
return SET;
}
return RESET;
}
|
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
#define BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
#ifndef BALL_CONCEPT_PROCESSOR_H
#include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_KERNEL_ATOMCONTAINER_H
#include <BALL/KERNEL/atomContainer.h>
#endif
#ifndef BALL_DATATYPE_HASHMAP_H
#include <BALL/DATATYPE/hashMap.h>
#endif
#ifndef BALL_KERNEL_BOND_H
#include <BALL/KERNEL/bond.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
#include <BALL/DATATYPE/options.h>
#endif
namespace BALL
{
/** Bond creation processor
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT BuildBondsProcessor
: public UnaryProcessor<AtomContainer>
{
public:
/** @name Constant Definitions
*/
//@{
/// Option names
struct BALL_EXPORT Option
{
/** Name to the file where the bonds lengths, max and
* min bond lengths are stored in.
*/
static const char* BONDLENGTHS_FILENAME;
/** If true, the existing bonds are deleted before
* bonds detection begins. If the atoms are in
* non-bond distance no bonds will be build! Note
* that the processor cannot rebuild inter-atomcontainer
* bonds, that will cause problem using it with proteins.
*/
static const char* DELETE_EXISTING_BONDS;
/** If this option is set to true, the molecule
* will be reprocessed. In this step the processor
* tries to correct the somtimes wrong orders of
* aromatic rings.
*/
static const char* REESTIMATE_BONDORDERS_RINGS;
/** If this option is set to true an additional
* cleaning step is performed. Overpredicted bonds
* like at multiple bonds at hydrogen or halogens
* are deleted, only the shortest bond will stay.
*/
static const char* DELETE_OVERESTIMATED_BONDS;
};
/// Default values for options
struct BALL_EXPORT Default
{
/// default file name for the bond lengths
static const char* BONDLENGTHS_FILENAME;
/// this option is off by default
static const bool DELETE_EXISTING_BONDS;
/// this option is off by default
static const bool REESTIMATE_BONDORDERS_RINGS;
/// this option is off by default
static const bool DELETE_OVERESTIMATED_BONDS;
};
//@}
/** @name Constructors and Destructors
*/
//@{
BALL_CREATE(BuildBondsProcessor);
/// default constructor
BuildBondsProcessor();
/// copy construcor
BuildBondsProcessor(const BuildBondsProcessor& bbp);
/// constructor with parameter filename
BuildBondsProcessor(const String& file_name) throw(Exception::FileNotFound);
/// destructor
virtual ~BuildBondsProcessor();
//@}
/** @name Processor-related methods
*/
//@{
/// processor method which is called before the operator () call
virtual bool start();
/// operator () for the processor
virtual Processor::Result operator () (AtomContainer& ac);
//@}
/** @name Accessors
*/
//@{
/// Return the number of bonds built during the last application.
Size getNumberOfBondsBuilt();
/// sets the parameters file
void setBondLengths(const String& file_name) throw(Exception::FileNotFound);
/// Return the bond length Hashmap
HashMap<Size, HashMap<Size, HashMap<int, float> > > getBondMap() { return bond_lengths_;};
//@}
/** @name Assignment
*/
//@{
/// assignment operator
BuildBondsProcessor& operator = (const BuildBondsProcessor& bbp);
//@}
/** @name Public Attributes
*/
//@{
/// options
Options options;
/** reset the options to default values
*/
void setDefaultOptions();
//@}
protected:
/// builds bonds, based on atom distances read from parameter file using a 3D hash grid
Size buildBondsHashGrid3_(AtomContainer& ac);
/// after the bonds are built, the orders are estimated
void estimateBondOrders_(AtomContainer& ac);
/// reestimate the bond orders of rings, as aromatic rings are often detected wrong
void reestimateBondOrdersRings_(AtomContainer& ac);
/// deletes bonds, like from multiple bonded hydrogens or halogens
void deleteOverestimatedBonds_(AtomContainer& ac);
/// method to read the paramter file
void readBondLengthsFromFile_(const String& file_name = "") throw(Exception::FileNotFound);
/// number of bonds, which are created during the processor call
Size num_bonds_;
/// structure where bond order distances are stored in
HashMap<Size, HashMap<Size, HashMap<int, float> > > bond_lengths_;
/// structure were the bond maxima stored in (used in buildBonds_)
HashMap<Size, HashMap<Size, float> > max_bond_lengths_;
/// structure were the bond minima stored in (used in buildBonds_)
HashMap<Size, HashMap<Size, float> > min_bond_lengths_;
/*_ returns the best fitting bond order of a bond between atoms of
element e1 and element e2 with a distance of length
*/
Bond::BondOrder getNearestBondOrder_(float length, Size e1, Size e2);
/*_ Returns true if the atom with atomic number an1 and atom with
atomic number an2 can share a bond. If, the parameter length
holds the maximal length of such a bond.
*/
bool getMaxBondLength_(float& length, Size an1, Size an2);
/*_ Returns true if the atom with atomic number an1 and atom with
atomic number an2 can share a bond. If, the parameter length
holds the minimal length of such a bond.
*/
bool getMinBondLength_(float& length, Size an1, Size an2);
/// parameter which holds the longest possible bond
float max_length_;
};
} // namespace BALL
#endif // BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
|
/*
* ggit-ref-spec.h
* This file is part of libgit2-glib
*
* Copyright (C) 2012 - Garrett Regier
*
* libgit2-glib 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.
*
* libgit2-glib 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 libgit2-glib. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GGIT_REF_SPEC_H__
#define __GGIT_REF_SPEC_H__
#include <glib-object.h>
#include <git2.h>
#include "ggit-types.h"
G_BEGIN_DECLS
#define GGIT_TYPE_REF_SPEC (ggit_ref_spec_get_type ())
#define GGIT_REF_SPEC(obj) ((GgitRefSpec *)obj)
GType ggit_ref_spec_get_type (void) G_GNUC_CONST;
GgitRefSpec *_ggit_ref_spec_wrap (const git_refspec *refspec);
GgitRefSpec *ggit_ref_spec_ref (GgitRefSpec *refspec);
void ggit_ref_spec_unref (GgitRefSpec *refspec);
const gchar *ggit_ref_spec_get_source (GgitRefSpec *refspec);
const gchar *ggit_ref_spec_get_destination (GgitRefSpec *refspec);
gboolean ggit_ref_spec_is_forced (GgitRefSpec *refspec);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitRefSpec, ggit_ref_spec_unref)
G_END_DECLS
#endif /* __GGIT_REF_SPEC_H__ */
/* ex:set ts=8 noet: */
|
////////////////////////////////////////////////////////////////
//
// Copyright (C) 2005 Affymetrix, Inc.
//
// 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.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////
/**
* @file QuantMethodTransform.h
* @author Chuck Sugnet
* @date Mon Dec 14 14:39:27 2009
*
* @brief DataTransform wrapper for quantification methods
*
*
*/
#ifndef _QUANTMETHODTRANSFORM_H_
#define _QUANTMETHODTRANSFORM_H_
#include "chipstream/DataTransform.h"
#include "chipstream/QuantMethod.h"
#include "chipstream/QuantMethodReport.h"
#include "chipstream/AnalysisInfo.h"
class QuantMethodTransform : public DataTransform {
public:
QuantMethodTransform(QuantMethod *qMethod);
~QuantMethodTransform();
virtual bool transformData(PsBoard &board, const DataStore &in, DataStore &out);
/**
* Get a unique identifier for this data transform.
*
* @return string that identifies the type of transform
*/
virtual std::string getName() { return m_QuantMethod->getType(); }
private:
bool doAnalysis(ProbeSetGroup &psGroup,
const IntensityMart &iMart,
PmAdjuster &pmAdj,
std::vector<QuantMethodReport *> &reporters,
bool doReport);
void writeHeaders(PsBoard &board,
const IntensityMart &iMart,
QuantMethod *qMethod,
std::vector<QuantMethodReport *> &reporters,
std::vector<QuantMethodReport *> &exprReporters,
AnalysisInfo &info);
QuantMethod *m_QuantMethod;
};
#endif /* _QUANTMETHODTRANSFORM_H_ */
|
//----------------------------------------------------------------------------
// ZetaScale
// Copyright (c) 2016, SanDisk Corp. and/or all its affiliates.
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published by the Free
// Software Foundation;
//
// This 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 v2.1 for more details.
//
// A copy of the GNU Lesser General Public License v2.1 is provided with this package and
// can also be found at: http://opensource.org/licenses/LGPL-2.1
// You should have received a copy of the GNU Lesser General Public License along with
// this program; if not, write to the Free Software Foundation, Inc., 59 Temple
// Place, Suite 330, Boston, MA 02111-1307 USA.
//----------------------------------------------------------------------------
#include "zs.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#define ZS_MAX_KEY_LEN 256
#define OBJ_COUNT 100000
int
main()
{
ZS_container_props_t props;
struct ZS_state *zs_state;
struct ZS_thread_state *thd_state;
ZS_status_t status;
ZS_cguid_t cguid;
char data1[256] = "data is just for testing pstats";
uint64_t i;
char key_var[ZS_MAX_KEY_LEN] ={0};
ZSSetProperty("ZS_REFORMAT", "1");
if (ZSInit(&zs_state) != ZS_SUCCESS) {
return -1;
}
ZSInitPerThreadState(zs_state, &thd_state);
ZSLoadCntrPropDefaults(&props);
props.size_kb = 1024 * 1024 * 2;
props.persistent = 1;
props.evicting = 0;
props.writethru = 1;
props.durability_level= ZS_DURABILITY_SW_CRASH_SAFE;
props.fifo_mode = 0;
/*
* Test 1: Check if asynchronous delete container works
*/
status = ZSOpenContainer(thd_state, "cntr", &props, ZS_CTNR_CREATE, &cguid);
if (status != ZS_SUCCESS) {
printf("Open Cont failed with error=%x.\n", status);
return -1;
}
/*
* Write a million objects
*/
for (i = 1; i <= OBJ_COUNT; i++) {
memset(key_var, 0, ZS_MAX_KEY_LEN);
sprintf(key_var, "key_%ld", i);
sprintf(data1, "data_%ld", i);
status = ZSWriteObject(thd_state, cguid, key_var, strlen(key_var) + 1, data1, strlen(data1), 0);
if (ZS_SUCCESS != status) {
fprintf(stderr, "ZSWriteObject= %s\n", ZSStrError(status));
}
assert(ZS_SUCCESS == status);
}
/*
* Delete the container
*/
status = ZSDeleteContainer(thd_state, cguid);
if (status != ZS_SUCCESS) {
printf("Delete container failed with error=%s.\n", ZSStrError(status));
return -1;
}
/*
* Make sure container do not exist now!
*/
status = ZSOpenContainer(thd_state, "cntr", &props, ZS_CTNR_RO_MODE, &cguid);
if (status == ZS_SUCCESS) {
printf("Open Cont failed with error=%x.\n", status);
return -1;
}
/*
* Test 2
*/
status = ZSOpenContainer(thd_state, "cntr", &props, ZS_CTNR_CREATE, &cguid);
if (status != ZS_SUCCESS) {
printf("Open Cont failed with error=%x.\n", status);
return -1;
}
/*
* Write two million objects
*/
for (i = 1; i <= 2 * OBJ_COUNT; i++) {
memset(key_var, 0, ZS_MAX_KEY_LEN);
sprintf(key_var, "key_%ld", i);
sprintf(data1, "data_%ld", i);
status = ZSWriteObject(thd_state, cguid, key_var, strlen(key_var) + 1, data1, strlen(data1), 0);
assert(ZS_SUCCESS == status);
}
/*
* Delete the container
*/
status = ZSDeleteContainer(thd_state, cguid);
if (status != ZS_SUCCESS) {
printf("Delete container failed with error=%s.\n", ZSStrError(status));
return -1;
}
/*
* Make sure container do not exist now!
*/
status = ZSOpenContainer(thd_state, "cntr", &props, ZS_CTNR_RO_MODE, &cguid);
if (status == ZS_SUCCESS) {
printf("Open Cont failed with error=%x.\n", status);
return -1;
}
status = ZSOpenContainer(thd_state, "cntr", &props, ZS_CTNR_CREATE, &cguid);
if (status != ZS_SUCCESS) {
printf("Open Cont failed with error=%x.\n", status);
return -1;
}
/*
* Write a million objects
*/
for (i = 1; i <= OBJ_COUNT; i++) {
memset(key_var, 0, ZS_MAX_KEY_LEN);
sprintf(key_var, "key_%ld", i);
sprintf(data1, "data_%ld", i);
status = ZSWriteObject(thd_state, cguid, key_var, strlen(key_var) + 1, data1, strlen(data1), 0);
assert(ZS_SUCCESS == status);
}
ZSCloseContainer(thd_state, cguid);
status = ZSDeleteContainer(thd_state, cguid);
assert(ZS_SUCCESS == status);
ZSReleasePerThreadState(&thd_state);
ZSShutdown(zs_state);
return 0;
}
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_thread_c_h
#define _SDL_thread_c_h
/* Need the definitions of SYS_ThreadHandle */
#if SDL_THREADS_DISABLED
#include "generic/SDL_systhread_c.h"
#elif SDL_THREAD_BEOS
#include "beos/SDL_systhread_c.h"
#elif SDL_THREAD_EPOC
#include "epoc/SDL_systhread_c.h"
#elif SDL_THREAD_PTHREAD
#include "pthread/SDL_systhread_c.h"
#elif SDL_THREAD_SPROC
#include "irix/SDL_systhread_c.h"
#elif SDL_THREAD_WINDOWS
#include "windows/SDL_systhread_c.h"
#elif SDL_THREAD_NDS
#include "nds/SDL_systhread_c.h"
#else
#error Need thread implementation for this platform
#include "generic/SDL_systhread_c.h"
#endif
#include "../SDL_error_c.h"
/* This is the system-independent thread info structure */
struct SDL_Thread
{
SDL_threadID threadid;
SYS_ThreadHandle handle;
int status;
SDL_error errbuf;
void *data;
};
/* This is the function called to run a thread */
extern void SDL_RunThread(void *data);
#endif /* _SDL_thread_c_h */
/* vi: set ts=4 sw=4 expandtab: */
|
/*
* Testcase for private mmap.
* Copyright (C) 2016 bww bitwise works GmbH.
* This file is part of the kLIBC Extension Library.
* Authored by Dmitry Kuminov <coding@dmik.org>, 2016.
*
* The kLIBC Extension Library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* The kLIBC Extension 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 <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/param.h>
#include <sys/mman.h>
#ifdef __OS2__
#include <io.h>
#endif
#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
#endif
#define FILE_SIZE (PAGE_SIZE * 4)
#define TEST_SIZE 10
#define TEST_VAL 255
unsigned char buf[FILE_SIZE];
unsigned char buf2[TEST_SIZE * 2];
static int do_test(void);
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
static int
do_test (void)
{
int rc;
int i, n;
unsigned char *addr;
char *fname;
int fd = create_temp_file("tst-mmap2-", &fname);
if (fd == -1)
{
puts("create_temp_file failed");
return 1;
}
#ifdef __OS2__
setmode (fd, O_BINARY);
#endif
srand(getpid());
for (i = 0; i < FILE_SIZE; ++i)
buf[i] = rand() % 255;
if (TEMP_FAILURE_RETRY((n = write(fd, buf, FILE_SIZE))) != FILE_SIZE)
{
if (n != -1)
printf("write failed (write %d bytes instead of %d)\n", n, FILE_SIZE);
else
perror("write failed");
return 1;
}
/*
* Test 1: simple mmap
*/
printf("Test 1\n");
addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (addr == MAP_FAILED)
{
perror("mmap failed");
exit(-1);
}
for (i = PAGE_SIZE - TEST_SIZE; i < PAGE_SIZE + TEST_SIZE; ++i)
{
if (addr[i] != buf[i])
{
printf("addr[%d] is %u, must be %u\n", i, addr[i], buf[i]);
return 1;
}
}
if (munmap(addr, FILE_SIZE) == -1)
{
perror("munmap failed");
return 1;
}
/*
* Test 2: mmap at offset
*/
printf("Test 2\n");
enum { Offset = PAGE_SIZE };
addr = mmap(NULL, FILE_SIZE - Offset, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, Offset);
if (addr == MAP_FAILED)
{
perror("mmap failed");
exit(-1);
}
for (i = PAGE_SIZE - TEST_SIZE; i < PAGE_SIZE + TEST_SIZE; ++i)
{
if (addr[i] != buf[i + Offset])
{
printf("addr[%d] is %u, must be %u\n", i, addr[i], buf[i + Offset]);
return 1;
}
}
/*
* Test 3: modify mmap (should not change the underlying file)
*/
printf("Test 3\n");
for (i = PAGE_SIZE - TEST_SIZE; i < PAGE_SIZE + TEST_SIZE; ++i)
addr[i] = TEST_VAL;
if (munmap(addr, FILE_SIZE - Offset) == -1)
{
perror("munmap failed");
return 1;
}
close(fd);
fd = open(fname, O_RDONLY);
if (fd == -1)
{
perror("open failed");
return 1;
}
#ifdef __OS2__
setmode (fd, O_BINARY);
#endif
if (lseek(fd, Offset + PAGE_SIZE - TEST_SIZE, SEEK_CUR) == -1)
{
perror("lseek failed");
return 1;
}
if (TEMP_FAILURE_RETRY((n = read(fd, buf2, TEST_SIZE * 2))) != TEST_SIZE * 2)
{
if (n != -1)
printf("read failed (read %d bytes instead of %d)\n", n, TEST_SIZE * 2);
else
perror("read failed");
return 1;
}
for (i = 0; i < TEST_SIZE * 2; ++i)
{
if (buf2[i] != buf[i + Offset + PAGE_SIZE - TEST_SIZE])
{
printf("buf2[%d] is %u, must be %u\n", i, buf2[i], buf[i + Offset]);
return 1;
}
}
close(fd);
free(fname);
return 0;
}
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QLAYOUT_H
#define QLAYOUT_H
#include <QtCore/qobject.h>
#include <QtWidgets/qlayoutitem.h>
#include <QtWidgets/qsizepolicy.h>
#include <QtCore/qrect.h>
#include <QtCore/qmargins.h>
#include <limits.h>
QT_BEGIN_NAMESPACE
class QLayout;
class QSize;
class QLayoutPrivate;
class Q_WIDGETS_EXPORT QLayout : public QObject, public QLayoutItem
{
Q_OBJECT
Q_DECLARE_PRIVATE(QLayout)
Q_PROPERTY(int margin READ margin WRITE setMargin)
Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
Q_PROPERTY(SizeConstraint sizeConstraint READ sizeConstraint WRITE setSizeConstraint)
public:
enum SizeConstraint {
SetDefaultConstraint,
SetNoConstraint,
SetMinimumSize,
SetFixedSize,
SetMaximumSize,
SetMinAndMaxSize
};
Q_ENUM(SizeConstraint)
QLayout(QWidget *parent);
QLayout();
~QLayout();
int margin() const;
int spacing() const;
void setMargin(int);
void setSpacing(int);
void setContentsMargins(int left, int top, int right, int bottom);
void setContentsMargins(const QMargins &margins);
void getContentsMargins(int *left, int *top, int *right, int *bottom) const;
QMargins contentsMargins() const;
QRect contentsRect() const;
bool setAlignment(QWidget *w, Qt::Alignment alignment);
bool setAlignment(QLayout *l, Qt::Alignment alignment);
using QLayoutItem::setAlignment;
void setSizeConstraint(SizeConstraint);
SizeConstraint sizeConstraint() const;
void setMenuBar(QWidget *w);
QWidget *menuBar() const;
QWidget *parentWidget() const;
void invalidate() Q_DECL_OVERRIDE;
QRect geometry() const Q_DECL_OVERRIDE;
bool activate();
void update();
void addWidget(QWidget *w);
virtual void addItem(QLayoutItem *) = 0;
void removeWidget(QWidget *w);
void removeItem(QLayoutItem *);
Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
QSize minimumSize() const Q_DECL_OVERRIDE;
QSize maximumSize() const Q_DECL_OVERRIDE;
virtual void setGeometry(const QRect&) Q_DECL_OVERRIDE;
virtual QLayoutItem *itemAt(int index) const = 0;
virtual QLayoutItem *takeAt(int index) = 0;
virtual int indexOf(QWidget *) const;
virtual int count() const = 0;
bool isEmpty() const Q_DECL_OVERRIDE;
QSizePolicy::ControlTypes controlTypes() const Q_DECL_OVERRIDE;
// ### Qt 6 make this function virtual
QLayoutItem *replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOptions options = Qt::FindChildrenRecursively);
int totalHeightForWidth(int w) const;
QSize totalMinimumSize() const;
QSize totalMaximumSize() const;
QSize totalSizeHint() const;
QLayout *layout() Q_DECL_OVERRIDE;
void setEnabled(bool);
bool isEnabled() const;
static QSize closestAcceptableSize(const QWidget *w, const QSize &s);
protected:
void widgetEvent(QEvent *);
void childEvent(QChildEvent *e) Q_DECL_OVERRIDE;
void addChildLayout(QLayout *l);
void addChildWidget(QWidget *w);
bool adoptLayout(QLayout *layout);
QRect alignmentRect(const QRect&) const;
protected:
QLayout(QLayoutPrivate &d, QLayout*, QWidget*);
private:
Q_DISABLE_COPY(QLayout)
static void activateRecursiveHelper(QLayoutItem *item);
friend class QApplicationPrivate;
friend class QWidget;
};
QT_END_NAMESPACE
//### support old includes
#include <QtWidgets/qboxlayout.h>
#include <QtWidgets/qgridlayout.h>
#endif // QLAYOUT_H
|
// The libMesh Finite Element Library.
// Copyright (C) 2002-2021 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// This file can be included multiple times in a single translation
// unit, therefore there are no include guards!
/**
* Sanity check, _without_ prior inclusion of libmesh_config.h.
*
* This file is no typical header file. It is only to be
* included at the _end_ of an implementation file, so that
* the proper variations of the InfFE class are instantiated.
*/
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
// Local includes
#include "libmesh/inf_fe_macro.h"
namespace libMesh
{
/**
* Collect all 3D explicit instantiations for class InfFE
*/
INSTANTIATE_INF_FE(3,CARTESIAN);
/* INSTANTIATE_INF_FE(3,SPHERICAL); */
/* INSTANTIATE_INF_FE(3,ELLIPSOIDAL); */
} // namespace libMesh
#endif
|
/* GStreamer
* Copyright (C) 2012 Stefan Sauer <ensonic@users.sf.net>
*
* envelope-d.h: decay envelope generator
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GSTBT_ENVELOPE_D_H__
#define __GSTBT_ENVELOPE_D_H__
#include <gst/gst.h>
#include <libgstbuzztrax/envelope.h>
G_BEGIN_DECLS
#define GSTBT_TYPE_ENVELOPE_D (gstbt_envelope_d_get_type())
#define GSTBT_ENVELOPE_D(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GSTBT_TYPE_ENVELOPE_D,GstBtEnvelopeD))
#define GSTBT_IS_ENVELOPE_D(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GSTBT_TYPE_ENVELOPE_D))
#define GSTBT_ENVELOPE_D_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GSTBT_TYPE_ENVELOPE_D,GstBtEnvelopeDClass))
#define GSTBT_IS_ENVELOPE_D_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GSTBT_TYPE_ENVELOPE_D))
#define GSTBT_ENVELOPE_D_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GSTBT_TYPE_ENVELOPE_D,GstBtEnvelopeDClass))
typedef struct _GstBtEnvelopeD GstBtEnvelopeD;
typedef struct _GstBtEnvelopeDClass GstBtEnvelopeDClass;
/**
* GstBtEnvelopeD:
*
* Class instance data.
*/
struct _GstBtEnvelopeD {
GstBtEnvelope parent;
/* < private > */
gboolean dispose_has_run; /* validate if dispose has run */
};
struct _GstBtEnvelopeDClass {
GstBtEnvelopeClass parent_class;
};
GType gstbt_envelope_d_get_type (void);
GstBtEnvelopeD *gstbt_envelope_d_new (void);
void gstbt_envelope_d_setup (GstBtEnvelopeD *self, gint samplerate, gdouble decay_time, gdouble peak_level);
G_END_DECLS
#endif /* __GSTBT_ENVELOPE_D_H__ */
|
/*
* LFC Library - Linux toolkit
*
* Copyright (C) 2012, 2013 Daniel Mosquera Villanueva
* (milkatoffeecuco@gmail.com)
* This file is part of LFC Library.
*
* 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, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef DICTIONARY_H
#define DICTIONARY_H
#include "collection.h"
#include "collection_exception.h"
#include "../n_object.h"
#include "../Text/text.h"
#include <stdlib.h>
template<class K, class V>
class DictionaryEntry {
public:
K Key;
V Value;
DictionaryEntry();
DictionaryEntry(K key);
DictionaryEntry(K key, V value);
~DictionaryEntry();
};
template<class K, class V>
DictionaryEntry<K, V>::DictionaryEntry()
{
}
template<class K, class V>
DictionaryEntry<K, V>::DictionaryEntry(K key)
{
Key = key;
}
template<class K, class V>
DictionaryEntry<K, V>::DictionaryEntry(K key, V value)
{
Key = key;
Value = value;
}
template<class K, class V>
DictionaryEntry<K, V>::~DictionaryEntry()
{
}
template<class K, class V>
class Dictionary {
public:
Dictionary();
Dictionary(int (*COMPARER)(const void *u, const void *v));
virtual ~Dictionary();
virtual void SetKey(K key, V value);
bool GetKey(K key, V &value);
void ClearKey(K key);
bool ExistsKey(K key);
void Clear();
void Pack();
void DeleteAndClearKey(K key);
void DeleteAndClear();
Collection<K> Keys();
Collection<V> Values();
protected:
DictionaryEntry<K, V> **entries;
int numEntries;
int capacity;
static int (*KEY_COMPARER)(const void *u, const void *v);
void ensureCapacity(int capacity);
int binarySearchIx(K key);
void deleteEntry(int ix);
static int ENTRY_COMPARER(const void *u, const void *v);
};
template<class K, class V>
int (*Dictionary<K, V>::KEY_COMPARER)(const void *u, const void *v);
template<class K, class V>
Dictionary<K, V>::Dictionary()
{
throw new CollectionException("Not implemented", __FILE__, __LINE__, __func__);
}
template<class K, class V>
Dictionary<K, V>::Dictionary(int (*COMPARER)(const void *u, const void *v))
{
capacity = 0;
numEntries = 0;
KEY_COMPARER = COMPARER;
entries = NULL;
ensureCapacity(1000);
}
template<class K, class V>
Dictionary<K, V>::~Dictionary()
{
Clear();
delete entries;
}
template<class K, class V>
void Dictionary<K, V>::ensureCapacity(int capacity)
{
if (this->capacity >= capacity) return;
int newCapacity = capacity + 1000;
DictionaryEntry<K, V> **q = new DictionaryEntry<K, V> *[newCapacity];
for (int i=0; i<numEntries; i++)
q[i] = entries[i];
if (entries != NULL) delete entries;
entries = q;
this->capacity = newCapacity;
}
template<class K, class V>
int Dictionary<K, V>::binarySearchIx(K key)
{
DictionaryEntry<K, V> *e = new DictionaryEntry<K, V>(key);
void *q = bsearch(&e, entries, numEntries, sizeof(entries[0]), ENTRY_COMPARER);
delete e;
if (q == NULL) return -1;
return ((unsigned long)q - (unsigned long)entries) / sizeof(entries[0]);
}
template<class K, class V>
int Dictionary<K, V>::ENTRY_COMPARER(const void *u, const void *v)
{
DictionaryEntry<K, V> **uu = (DictionaryEntry<K, V> **)u;
DictionaryEntry<K, V> **vv = (DictionaryEntry<K, V> **)v;
K keys[2];
keys[0] = (**uu).Key;
keys[1] = (**vv).Key;
return KEY_COMPARER((const void *)&keys[0], (const void *)&keys[1]);
}
template<class K, class V>
void Dictionary<K, V>::SetKey(K key, V value)
{
int ix = binarySearchIx(key);
if (ix != -1) {
entries[ix]->Value = value;
} else {
ensureCapacity(numEntries + 1);
// Create and insert the new entry
DictionaryEntry<K, V> *e = new DictionaryEntry<K, V>(key, value);
ix = numEntries;
for (int i=numEntries-1; i>=0; i--) {
if (KEY_COMPARER(&key, &entries[i]->Key) > 0) break;
entries[i + 1] = entries[i];
ix--;
}
entries[ix] = e;
numEntries++;
}
}
template<class K, class V>
bool Dictionary<K, V>::GetKey(K key, V &value)
{
int ix = binarySearchIx(key);
if (ix == -1) return false;
value = entries[ix]->Value;
return true;
}
template<class K, class V>
void Dictionary<K, V>::ClearKey(K key)
{
int ix = binarySearchIx(key);
if (ix == -1) return;
delete entries[ix];
numEntries--;
for (int i=ix; i<numEntries; i++)
entries[i] = entries[i + 1];
}
template<class K, class V>
bool Dictionary<K, V>::ExistsKey(K key)
{
return binarySearchIx(key) != -1;
}
template<class K, class V>
void Dictionary<K, V>::Clear()
{
for (int i=0; i<numEntries; i++)
delete entries[i];
numEntries = 0;
}
template<class K, class V>
void Dictionary<K, V>::Pack()
{
if (numEntries == capacity || numEntries < 1) return;
DictionaryEntry<K, V> **q = new DictionaryEntry<K, V> *[numEntries];
for (int i=0; i<numEntries; i++) q[i] = entries[i];
capacity = numEntries;
}
template<class K, class V>
void Dictionary<K, V>::DeleteAndClearKey(K key)
{
int ix = binarySearchIx(key);
if (ix == -1) return;
delete entries[ix]->Key;
delete entries[ix]->Value;
delete entries[ix];
numEntries--;
for (int i = ix; i<numEntries; i++)
entries[i] = entries[i + 1];
}
template<class K, class V>
void Dictionary<K, V>::DeleteAndClear()
{
for (int i=0; i<numEntries; i++) {
delete entries[i]->Key;
delete entries[i]->Value;
delete entries[i];
}
numEntries = 0;
}
template<class K, class V>
Collection<K> Dictionary<K, V>::Keys()
{
Collection<K> res;
for (int i=0; i<numEntries; i++) res.Add(entries[i]->Key);
return res;
}
template<class K, class V>
Collection<V> Dictionary<K, V>::Values()
{
Collection<V> res;
for (int i=0; i<numEntries; i++) res.Add(entries[i]->Value);
return res;
}
#endif // DICTIONARY_H
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui 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$
**
****************************************************************************/
#ifndef QSOUND_H
#define QSOUND_H
#include <QtCore/qobject.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
#ifndef QT_NO_SOUND
class QSoundPrivate;
class Q_GUI_EXPORT QSound : public QObject
{
Q_OBJECT
public:
static bool isAvailable();
static void play(const QString& filename);
explicit QSound(const QString& filename, QObject* parent = 0);
~QSound();
int loops() const;
int loopsRemaining() const;
void setLoops(int);
QString fileName() const;
bool isFinished() const;
public Q_SLOTS:
void play();
void stop();
public:
#ifdef QT3_SUPPORT
QT3_SUPPORT_CONSTRUCTOR QSound(const QString& filename, QObject* parent, const char* name);
static inline QT3_SUPPORT bool available() { return isAvailable(); }
#endif
private:
Q_DECLARE_PRIVATE(QSound)
friend class QAuServer;
};
#endif // QT_NO_SOUND
QT_END_NAMESPACE
QT_END_HEADER
#endif // QSOUND_H
|
/* -*-c++-*- IfcPlusPlus - www.ifcplusplus.com - Copyright (C) 2011 Fabian Gerold
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* 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
* OpenSceneGraph Public License for more details.
*/
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/shared_ptr.h"
#include "ifcpp/model/IfcPPObject.h"
#include "ifcpp/model/IfcPPGlobal.h"
#include "IfcLoop.h"
class IFCPP_EXPORT IfcCartesianPoint;
//ENTITY
class IFCPP_EXPORT IfcPolyLoop : public IfcLoop
{
public:
IfcPolyLoop();
IfcPolyLoop( int id );
~IfcPolyLoop();
virtual shared_ptr<IfcPPObject> getDeepCopy( IfcPPCopyOptions& options );
virtual void getStepLine( std::stringstream& stream ) const;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
virtual void readStepArguments( const std::vector<std::wstring>& args, const boost::unordered_map<int,shared_ptr<IfcPPEntity> >& map );
virtual void setInverseCounterparts( shared_ptr<IfcPPEntity> ptr_self );
virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes );
virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes );
virtual void unlinkFromInverseCounterparts();
virtual const char* className() const { return "IfcPolyLoop"; }
// IfcRepresentationItem -----------------------------------------------------------
// inverse attributes:
// std::vector<weak_ptr<IfcPresentationLayerAssignment> > m_LayerAssignment_inverse;
// std::vector<weak_ptr<IfcStyledItem> > m_StyledByItem_inverse;
// IfcTopologicalRepresentationItem -----------------------------------------------------------
// IfcLoop -----------------------------------------------------------
// IfcPolyLoop -----------------------------------------------------------
// attributes:
std::vector<shared_ptr<IfcCartesianPoint> > m_Polygon;
};
|
/*
$Id: simple_client.c,v 1.8 2006-04-28 09:40:16 erk Exp $
-----------------------------------------------------------------------
TSP Library - core components for a generic Transport Sampling Protocol.
Copyright (c) 2002 Yves DUFRENNE, Stephane GALLES, Eric NOULARD and Robert PAGNOT
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-----------------------------------------------------------------------
Project : TSP
Maintainer: tsp@astrium-space.com
Component : Consumer
-----------------------------------------------------------------------
Purpose : Simple consummer tutorial
-----------------------------------------------------------------------
*/
#include <stdio.h>
#include <stdlib.h>
/* All what you need for creating a TSP consumer */
#include <tsp_consumer.h>
#include <tsp_time.h>
/* Just for fast exit */
void perror_and_exit(char *txt)
{
perror (txt);
exit (-1);
}
/* Everthing must begin somewhere */
int main(int argc, char *argv[])
{
const TSP_answer_sample_t* information;
TSP_sample_symbol_info_list_t symbols;
int i, count_frame, wanted_sym=10, t = -1;
TSP_provider_t provider;
char* url;
printf ("#=========================================================#\n");
printf ("# Launching tutorial client\n");
printf ("#=========================================================#\n");
/* Initialisation for TSP library. */
if(TSP_STATUS_OK!=TSP_consumer_init(&argc, &argv))
perror_and_exit("TSP init failed");
if (argc==2)
url = argv[1];
else
{
printf("USAGE %s : TSP_url \n", argv[0]);
return -1;
}
/*-------------------------------------------------------------------------------------------------------*/
/* Connects to all found providers on the given host. */
provider = TSP_consumer_connect_url(url);
if(0==provider)
perror_and_exit("TSP_consumer_connect_url failed ");
/* Ask the provider for a new consumer session.*/
if(TSP_STATUS_OK!=TSP_consumer_request_open(provider, 0, 0))
perror_and_exit("TSP_request_provider_open failed");
/* Ask the provider informations about several parameters, including
* the available symbol list that can be asked. */
if(TSP_STATUS_OK!=TSP_consumer_request_information(provider))
perror_and_exit("TSP_request_provider_information failed");
/* Get the provider information asked by TSP_consumer_request_information */
information = TSP_consumer_get_information(provider);
if (wanted_sym > information->symbols.TSP_sample_symbol_info_list_t_len)
wanted_sym = information->symbols.TSP_sample_symbol_info_list_t_len;
/* Will use only the "wanted_sym" first symbols of provider */
symbols.TSP_sample_symbol_info_list_t_val = (TSP_sample_symbol_info_t*)calloc(wanted_sym, sizeof(TSP_sample_symbol_info_t));
symbols.TSP_sample_symbol_info_list_t_len = wanted_sym;
for(i = 0 ; i < wanted_sym ; i++)
{
symbols.TSP_sample_symbol_info_list_t_val[i].name = information->symbols.TSP_sample_symbol_info_list_t_val[i].name;
symbols.TSP_sample_symbol_info_list_t_val[i].period = 1; /* at max frequency */
symbols.TSP_sample_symbol_info_list_t_val[i].phase = 0; /* with no offset */
printf ("Asking for symbol = %s\n", symbols.TSP_sample_symbol_info_list_t_val[i].name);
}
/*-------------------------------------------------------------------------------------------------------*/
/* Ask the provider for sampling this list of symbols. Should check if all symbols are OK*/
if(TSP_STATUS_OK!=TSP_consumer_request_sample(provider, &symbols))
perror_and_exit("TSP_request_provider_sample failed");
/* Start the sampling sequence. */
if(TSP_STATUS_OK!=TSP_consumer_request_sample_init(provider, 0, 0))
perror_and_exit("TSP_request_provider_sample_init failed");
/* Loop on data read */
for (count_frame = 0; count_frame<100; )
{
int new_sample=FALSE;
TSP_sample_t sample;
/* Read a sample symbol.*/
if (TSP_STATUS_OK==TSP_consumer_read_sample(provider, &sample, &new_sample))
{
if(new_sample)
{
if (t != sample.time)
{
count_frame++;
t = sample.time;
printf ("======== Frame[%d] ======== Time : %d ========\n", count_frame, t);
}
i = sample.provider_global_index;
printf ("# Sample nb[%d] \t%s \tval=%f\n", i, symbols.TSP_sample_symbol_info_list_t_val[i].name, sample.uvalue.double_value);
}
else
{
/* Used to give time to other thread for filling fifo of received samples */
tsp_usleep(100*1000); /* in µS, so about 100msec */
}
}
else
{
perror_and_exit ("Function TSP_consumer_read_sample failed !!\n");
}
}
free (symbols.TSP_sample_symbol_info_list_t_val);
/*-------------------------------------------------------------------------------------------------------*/
/* Stop and destroy the sampling sequence*/
if(TSP_STATUS_OK!=TSP_consumer_request_sample_destroy(provider))
perror_and_exit("Function TSP_consumer_request_sample_destroy failed" );
/* Close the session.*/
if(TSP_STATUS_OK!=TSP_consumer_request_close(provider))
perror_and_exit("Function TSP_consumer_request_close failed" );
/* call this function when you are done with the librairy.*/
TSP_consumer_end();
return 0;
}
|
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
Last changed Time-stamp: <2006-10-14 07:07:07 raim>
$Id: integrateODEs.c,v 1.2 2006/10/14 05:10:27 raimc Exp $
*/
/*
*
* 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
* 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. The software and
* documentation provided hereunder is on an "as is" basis, and the
* authors have no obligations to provide maintenance, support,
* updates, enhancements or modifications. In no event shall the
* authors be liable to any party for direct, indirect, special,
* incidental or consequential damages, including lost profits, arising
* out of the use of this software and its documentation, even if the
* authors have been advised of the possibility of such damage. See
* the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* The original code contained here was initially developed by:
*
* Rainer Machne
*
* Contributor(s):
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <sbmlsolver/odeSolver.h>
#include <sbmlsolver/solverError.h>
int
main(void)
{
int neq, nass, nconst;
char *x[3];
double x0[3];
char *ode[2];
ASTNode_t *ast[2];
double time, rtol, atol;
double printstep;
/* SBML model containing events */
Model_t *events;
/* SOSlib types */
odeModel_t *om;
cvodeSettings_t *set;
integratorInstance_t *ii;
variableIndex_t *vi;
/* parsing input ODEs and settings */
/* time and error settings */
time = 0.5;
rtol = atol = 1.0E-9;
printstep = 10;
/* variables */
neq = 2;
x[0] = "C_cy";
x0[0] = 0.0;
ode[0] = "((150.0 * (3.8 - (p * D_cy) - (p * C_cy)) * (1.0 - (p * C_cy))) - (9.0 * C_cy))";
x[1] = "D_cy";
x0[1] = 9.0;
ode[1] = "(3.8 - (3.0 * D_cy) - (p * D_cy) - (p * C_cy))";
/* parameters */
nconst = 1;
x[2] = "p";
x0[2] = 0.2;
/* assignments */
nass = 0;
/* SBML model containing events */
events = NULL;
/* creating ODE ASTs from strings */
ast[0] = SBML_parseFormula(ode[0]);
ast[1] = SBML_parseFormula(ode[1]);
/* end of input parsing */
/* Setting SBML ODE Solver integration parameters */
set = CvodeSettings_createWithTime(time, printstep);
CvodeSettings_setErrors(set, atol, rtol, 1e4);
CvodeSettings_setStoreResults(set, 0);
/* activating default sensitivity */
CvodeSettings_setSensitivity(set, 1);
/* creating odeModel */
/* `events' could be an SBML model containing events */
om = ODEModel_createFromODEs(ast, neq, nass, nconst, x, x0, events);
/* creating integrator */
ii = IntegratorInstance_create(om,set);
/* integrate */
printf("integrating:\n");
while( !IntegratorInstance_timeCourseCompleted(ii) )
{
if ( !IntegratorInstance_integrateOneStep(ii) )
{
SolverError_dump();
break;
}
else
IntegratorInstance_dumpData(ii);
}
/* Specific data interfaces: */
/* names are stored in the odeModel and values
are independently stored in the integrator: you can
get different values from different integrator instances
built from the same model */
vi = ODEModel_getVariableIndex(om, "C_cy");
printf("\nVariable %s has final value of %g at time %g\n\n",
ODEModel_getVariableName(om, vi),
IntegratorInstance_getVariableValue(ii, vi),
IntegratorInstance_getTime(ii));
VariableIndex_free(vi);
vi = ODEModel_getVariableIndex(om, "p");
printf("Sensitivies to %s:\n", ODEModel_getVariableName(om, vi));
IntegratorInstance_dumpPSensitivities(ii, vi);
printf("\n\n");
VariableIndex_free(vi);
/* finished, free stuff */
/* free ASTs */
ASTNode_free(ast[0]);
ASTNode_free(ast[1]);
/* free solver structures */
IntegratorInstance_free(ii);
ODEModel_free(om);
CvodeSettings_free(set);
return (EXIT_SUCCESS);
}
/* End of file */
|
/*
SDL - Simple DirectMedia Layer
Copyright (C) 2013 Canonical Ltd
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
Brandon Schaefer
brandon.schaefer@canonical.com
*/
#include "SDL_config.h"
#ifndef _SDL_mirevents_h
#define _SDL_mirevents_h
#include "SDL_mirvideo.h"
extern void Mir_InitOSKeymap(_THIS);
extern void Mir_HandleSurfaceEvent(MirSurface* surface,
MirEvent const* event, void* context);
#endif // _SDL_mirevents_h
|
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support - ROUSSET -
* ----------------------------------------------------------------------------
* Copyright (c) 2007, Atmel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer below in the documentation and/or
* other materials provided with the distribution.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
* File Name : at91sam9xeek.h
* Object :
* Creation : NFe Feb 2nd 2007
*-----------------------------------------------------------------------------
*/
#ifndef _AT91SAM9XEEK_H
#define _AT91SAM9XEEK_H
/* ******************************************************************* */
/* PMC Settings */
/* */
/* The main oscillator is enabled as soon as possible in the c_startup */
/* and MCK is switched on the main oscillator. */
/* PLL initialization is done later in the hw_init() function */
/* ******************************************************************* */
#define MASTER_CLOCK (198656000/2)
#define PLL_LOCK_TIMEOUT 1000000
#define PLLA_SETTINGS 0x2060BF09
#define PLLB_SETTINGS 0x10483F0E
/* Switch MCK on PLLA output PCK = PLLA = 2 * MCK */
#define MCKR_SETTINGS (AT91C_PMC_CSS_PLLA_CLK | AT91C_PMC_PRES_CLK | AT91C_PMC_MDIV_2)
/* ******************************************************************* */
/* DataFlash Settings */
/* */
/* ******************************************************************* */
#define AT91C_BASE_SPI AT91C_BASE_SPI0
#define AT91C_ID_SPI AT91C_ID_SPI0
/* SPI CLOCK */
#define AT91C_SPI_CLK 33000000
/* AC characteristics */
/* DLYBS = tCSS= 250ns min and DLYBCT = tCSH = 250ns */
#define DATAFLASH_TCSS (0x1a << 16) /* 250ns min (tCSS) <=> 12/48000000 = 250ns */
#define DATAFLASH_TCHS (0x1 << 24) /* 250ns min (tCSH) <=> (64*1+SCBR)/(2*48000000) */
#define DF_CS_SETTINGS (AT91C_SPI_NCPHA | (AT91C_SPI_DLYBS & DATAFLASH_TCSS) | (AT91C_SPI_DLYBCT & DATAFLASH_TCHS) | ((MASTER_CLOCK / AT91C_SPI_CLK) << 8))
/* ******************************************************************* */
/* BootStrap Settings */
/* */
/* ******************************************************************* */
#define AT91C_SPI_PCS_DATAFLASH AT91C_SPI_PCS1_DATAFLASH /* Boot on SPI NCS1 */
#define IMG_ADDRESS 0x8000 /* Image Address in DataFlash */
#define IMG_SIZE 0x30000 /* Image Size in DataFlash */
#define MACH_TYPE 0x44B /* AT91SAM9XE-EK same id as AT91SAM9260-EK*/
#define JUMP_ADDR 0x23F00000 /* Final Jump Address */
/* ******************************************************************* */
/* Application Settings */
/* ******************************************************************* */
#undef CFG_DEBUG
#define CFG_DATAFLASH
#define CFG_SDRAM
#define CFG_HW_INIT
#endif /* _AT91SAM9XEEK_H */
|
/*
Print.h - Base class that provides print() and println()
Copyright (c) 2008 David A. Mellis. All right reserved.
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
Modified 20-11-2010 by B.Cook ...
http://arduiniana.org/libraries/flash/
Printable support thanks to Mikal Hart
*/
#ifndef Print_h
#define Print_h
#include <inttypes.h>
#include <stdio.h> // for size_t
#include <avr/pgmspace.h>
#include "WString.h"
#define DEC 10
#define HEX 16
#define OCT 8
//#define BIN 2
#define BYTE 0
#define ARDUINO_CORE_PRINTABLE_SUPPORT
class Print;
/* Printable...*/
class _Printable
{
public:
virtual void print(Print &stream) const = 0;
};
/* ...Printable */
typedef struct
{
char c;
}
fstr_t;
/* rmv: Use the macro below in preparation for the next Arduino release.
# define FSTR(s) ((fstr_t*)PSTR(s))
*/
# define F(s) ((fstr_t*)PSTR(s))
class Print
{
private:
void printNumber(unsigned long, uint8_t);
void printFloat(double, uint8_t);
protected:
void setWriteError(int err = 1) { /*write_error = err;*/ }
public:
virtual size_t write(uint8_t) = 0;
virtual void write(const char *str);
virtual void write(const uint8_t *buffer, size_t size);
void print(const String &);
void print(const char[]);
void print(char, int = BYTE);
void print(unsigned char, int = BYTE);
void print(int, int = DEC);
void print(unsigned int, int = DEC);
void print(long, int = DEC);
void print(unsigned long, int = DEC);
void print(double, int = 2);
int print( fstr_t* );
void println(const String &s);
void println(const char[]);
void println(char, int = BYTE);
void println(unsigned char, int = BYTE);
void println(int, int = DEC);
void println(unsigned int, int = DEC);
void println(long, int = DEC);
void println(unsigned long, int = DEC);
void println(double, int = 2);
int println( fstr_t* );
int println(void);
public:
/* Printable...*/
void println(const _Printable &obj)
{ obj.print(*this); println(); }
void print(const _Printable &obj)
{ obj.print(*this); };
/* ...Printable */
};
#endif
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef QMLPROFILEREVENTTYPES_H
#define QMLPROFILEREVENTTYPES_H
#include <QtCore/QString>
namespace QmlJsDebugClient {
enum QmlEventType {
Painting,
Compiling,
Creating,
Binding,
HandlingSignal,
MaximumQmlEventType
};
QString qmlEventType(QmlEventType typeEnum);
QmlEventType qmlEventType(const QString &typeString);
} // namespace QmlJsDebugClient
#endif //QMLPROFILEREVENTTYPES_H
|
/* This source file is part of XBiG
* (XSLT Bindings Generator)
* For the latest info, see http://sourceforge.net/projects/javaglue/
*
* Copyright (c) 2005 netAllied GmbH, Tettnang
* Also see acknowledgements in Readme.html
*
* 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 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, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307, USA, or go to
* http://www.gnu.org/copyleft/lesser.txt.
*/
#include <jni_base.h>
/* Header for class base_NativeFloatBuffer */
#ifndef _Included_base_NativeFloatBuffer
#define _Included_base_NativeFloatBuffer
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: base_NativeFloatBuffer
* Method: _create
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_org_javaglue_base_NativeFloatBuffer__1create
(JNIEnv *env, jclass that, jint size);
/*
* Class: base_NativeFloatBuffer
* Method: _dispose
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_org_javaglue_base_NativeFloatBuffer__1dispose
(JNIEnv *, jobject, jlong);
/*
* Class: base_NativeFloatBuffer
* Method: _get
* Signature: (J)C
*/
JNIEXPORT jfloat JNICALL Java_org_javaglue_base_NativeFloatBuffer__1getIndex
(JNIEnv *, jobject, jlong, jint);
/*
* Class: base_NativeFloatBuffer
* Method: _set
* Signature: (J)C
*/
JNIEXPORT void JNICALL Java_org_javaglue_base_NativeFloatBuffer__1setIndex
(JNIEnv *, jobject, jlong, jint, jfloat);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* This file is part of the Gluon Development Platform
* Copyright (c) 2011 Laszlo Papp <lpapp@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GLUON_AUDIO_PLAYERTEST_H
#define GLUON_AUDIO_PLAYERTEST_H
#include <QtCore/QObject>
class PlayerTest : public QObject
{
Q_OBJECT
public:
PlayerTest();
virtual ~PlayerTest();
private Q_SLOTS:
void testAppend();
void testInsert();
void testRemoveLast();
void testRemoveAt();
void testIsPlaying();
void testVolume();
void testIsLooping();
void testPlayNext();
void testPlayAt();
void testPause();
void testSeek();
void testStop();
private:
QString m_audioFilePath;
QString m_audioFilePath2;
int m_overRangeValue;
};
#endif // GLUON_AUDIO_PLAYERTEST_H
|
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
Last changed Time-stamp: <2008-03-10 16:35:43 raim>
$Id: testCompiler.c,v 1.7 2008/03/10 19:24:47 raimc Exp $
*/
/*
*
* 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
* 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. The software and
* documentation provided hereunder is on an "as is" basis, and the
* authors have no obligations to provide maintenance, support,
* updates, enhancements or modifications. In no event shall the
* authors be liable to any party for direct, indirect, special,
* incidental or consequential damages, including lost profits, arising
* out of the use of this software and its documentation, even if the
* authors have been advised of the possibility of such damage. See
* the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* The original code contained here was initially developed by:
*
* Andrew Finney
*
* Contributor(s):
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <sbmlsolver/integratorInstance.h>
#include <sbmlsolver/solverError.h>
void DumpErrors()
{
char *errors = SolverError_dumpToString();
fprintf(stderr, "%s", errors);
SolverError_freeDumpString(errors);
SolverError_clear();
}
int doit(int argc, char *argv[])
{
cvodeSettings_t *settings = CvodeSettings_create();
integratorInstance_t *ii;
variableIndex_t *v1, *v2, *v3, *v4;
char *modelStr;
double endtime, relativeErrorTolerance,errorTolerance ;
int printsteps, maximumIntegrationSteps;
odeModel_t *model ;
int sensi = 0;
int nsens = 4;
char *sensIDs[nsens];
sensIDs[0] = "MAPK_PP";
sensIDs[1] = "V1";
sensIDs[2] = "MAPK_P";
sensIDs[3] = "uVol";
if (argc < 3)
{
fprintf(
stderr,
"usage %s sbml-model-file end-time print-steps\n",
argv[0]);
exit(0);
}
modelStr = argv[1];
endtime = atoi(argv[2]);
printsteps = atof(argv[3]);
errorTolerance = 1e-20;
relativeErrorTolerance = 1e-10;
maximumIntegrationSteps = 50000;
model = ODEModel_createFromFile(modelStr);
RETURN_ON_ERRORS_WITH(1);
v1 = ODEModel_getVariableIndex(model, sensIDs[0]);
v2 = ODEModel_getVariableIndex(model, sensIDs[1]);
v3 = ODEModel_getVariableIndex(model, sensIDs[2]);
v4 = ODEModel_getVariableIndex(model, sensIDs[3]);
CvodeSettings_setTime(settings, endtime, printsteps);
CvodeSettings_setError(settings, errorTolerance);
CvodeSettings_setRError(settings, relativeErrorTolerance);
CvodeSettings_setMxstep(settings, maximumIntegrationSteps);
CvodeSettings_setJacobian(settings, 1);
CvodeSettings_setStoreResults(settings, 0);
CvodeSettings_setSensitivity(settings, 1);
if (sensi)
{
CvodeSettings_setSensitivity(settings, 1);
CvodeSettings_setSensParams (settings,sensIDs, nsens );
}
CvodeSettings_setCompileFunctions(settings, 0); /* don't compile model */
ii = IntegratorInstance_create(model, settings);
printf("\n\nINTEGRATE WITHOUT COMPILATION \n");
IntegratorInstance_integrate(ii);
IntegratorInstance_dumpData(ii);
IntegratorInstance_dumpPSensitivities(ii, v1);
IntegratorInstance_dumpPSensitivities(ii, v2);
IntegratorInstance_dumpPSensitivities(ii, v3);
IntegratorInstance_dumpPSensitivities(ii, v4);
DumpErrors();
printf("Integration time was %g\n",
IntegratorInstance_getIntegrationTime(ii));
/* testing combinations of difference quotient and exact calculation
of jacobian and parametric matrices */
CvodeSettings_setJacobian(settings, 1);
/* CvodeSettings_setSensitivity(settings, 1); */
/*!!! sensitivity can't be switched off! but compilation is??? */
CvodeSettings_setCompileFunctions(settings, 1); /* compile model */
IntegratorInstance_reset(ii);
printf("\n\nAGAIN WITH COMPILATION \n");
IntegratorInstance_integrate(ii);
IntegratorInstance_dumpData(ii);
IntegratorInstance_dumpPSensitivities(ii, v1);
IntegratorInstance_dumpPSensitivities(ii, v2);
IntegratorInstance_dumpPSensitivities(ii, v3);
IntegratorInstance_dumpPSensitivities(ii, v4);
DumpErrors();
printf("FINISHED WITH SAME RESULTS??\n");
printf("Integration time was %g\n",
IntegratorInstance_getIntegrationTime(ii));
VariableIndex_free(v1);
VariableIndex_free(v2);
VariableIndex_free(v3);
VariableIndex_free(v4);
IntegratorInstance_free(ii);
ODEModel_free(model);
CvodeSettings_free(settings);
return 0;
}
int main (int argc, char *argv[])
{
int result = doit(argc, argv);
DumpErrors();
return result;
}
|
/*
* WebKit2 EFL
*
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/**
* @file utc_webkit2_ewk_context_application_cache_delete_func.c
* @author SangYong Park <sy302.park@samsung.com>
* @date 2012-06-12
* @brief Tests EWK function ewk_context_application_cache_delete()
*/
/* Define those macros _before_ you include the utc_webkit2_ewk.h header file. */
#define TESTED_FUN_NAME ewk_context_application_cache_delete
#define POSITIVE_TEST_FUN_NUM 1
#define NEGATIVE_TEST_FUN_NUM 2
#include "utc_webkit2_ewk.h"
#include "utc_webkit2_ewk_context_application_cache.h"
/* Startup and cleanup functions */
static void startup(void)
{
utc_webkit2_ewk_test_init();
}
static void cleanup(void)
{
utc_webkit2_ewk_test_end();
}
Eina_Bool isDeleted;
void applicationCacheOriginsGet(Eina_List* origins, void* data)
{
Eina_Bool isFound = EINA_FALSE;
if (origins) {
Eina_List* list = origins;
while (list) {
Ewk_Security_Origin* origin = (Ewk_Security_Origin*) eina_list_data_get(list);
if (!strcmp(ewk_security_origin_protocol_get(origin), APP_CACHE_PROTOCOL) && !strcmp(ewk_security_origin_host_get(origin), APP_CACHE_HOST) && ewk_security_origin_port_get(origin) == APP_CACHE_PORT)
isFound = EINA_TRUE;
list = eina_list_next(list);
}
ewk_context_origins_free(origins);
}
if (!isFound)
isDeleted = EINA_TRUE;
utc_webkit2_main_loop_quit();
}
static void addApplicationCacheFinished()
{
Ewk_Context* context = ewk_view_context_get(test_view.webview);
if (!ewk_context_application_cache_delete(context, 0)
|| !ewk_context_application_cache_origins_get(context, applicationCacheOriginsGet, 0))
utc_webkit2_main_loop_quit();
}
static void addApplicationCacheError()
{
utc_webkit2_main_loop_quit();
}
/**
* @brief Tests if can delete application cache.
*/
POS_TEST_FUN(1)
{
/* TODO: this code should use ewk_context_application_cache_delete and check its behaviour.
Results should be reported using one of utc_ macros */
// FIXME :: addApplicationCacheFinished function is not called.
utc_pass();
#if 0
isDeleted = EINA_FALSE;
if (!addApplicationCache(addApplicationCacheFinished, addApplicationCacheError))
utc_fail();
utc_webkit2_main_loop_begin();
utc_check_eq(isDeleted, EINA_TRUE);
#endif
}
/**
* @brief Tests if returns false which context was null.
*/
NEG_TEST_FUN(1)
{
utc_check_eq(ewk_context_application_cache_delete(0, 0), EINA_FALSE);
}
/**
* @brief Tests if returns false which origin was null.
*/
NEG_TEST_FUN(2)
{
Ewk_Context* context = ewk_view_context_get(test_view.webview);
utc_check_eq(ewk_context_application_cache_delete(context, 0), EINA_FALSE);
}
|
////////////////////////////////////////////////////////////////
//
// Copyright (C) 2005 Affymetrix, Inc.
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License
// (version 2.1) as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
// for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////
#ifndef __FILEWRITEEXCEPTIONTEST_H_
#define __FILEWRITEEXCEPTIONTEST_H_
#include <cppunit/extensions/HelperMacros.h>
class FileWriteExceptionTest : public CPPUNIT_NS::TestFixture
{
CPPUNIT_TEST_SUITE( FileWriteExceptionTest );
CPPUNIT_TEST( testCreation_FileWriteException );
CPPUNIT_TEST( testCreation_FileCreateException );
CPPUNIT_TEST_SUITE_END();
public:
void setUp();
void tearDown();
void testCreation_FileWriteException();
void testCreation_FileCreateException();
};
#endif // __FILEWRITEEXCEPTIONTEST_H_
|
/*
* Copyright 2006 Serge van den Boom <svdb@stack.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _NETOPTIONS_H
#define _NETOPTIONS_H
#include "types.h"
#include <stddef.h>
#define NETPLAY_NUM_PLAYERS 2
// Not using NUM_PLAYERS because that would mean we'd have
// to include init.h, and all that comes with it.
// XXX: Don't use a hardcoded limit.
typedef struct {
bool isServer;
const char *host;
const char *port;
// May be given as a service name.
} NetplayPeerOptions;
typedef struct {
const char *metaServer;
const char *metaPort;
// May be given as a service name.
NetplayPeerOptions peer[NETPLAY_NUM_PLAYERS];
size_t inputDelay;
} NetplayOptions;
extern NetplayOptions netplayOptions;
#endif /* _NETOPTIONS_H */
|
/* GIO - GLib Input, Output and Streaming Library
*
* Copyright (C) 2008 Benjamin Otte <otte@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Benjamin Otte <otte@gnome.org>
*/
#ifndef __G_VFS_BACKEND_FTP_H__
#define __G_VFS_BACKEND_FTP_H__
#include <gvfsbackend.h>
#include <gmountspec.h>
G_BEGIN_DECLS
#define G_VFS_FTP_TIMEOUT_IN_SECONDS 30
typedef enum {
G_VFS_FTP_FEATURE_MDTM,
G_VFS_FTP_FEATURE_SIZE,
G_VFS_FTP_FEATURE_TVFS,
G_VFS_FTP_FEATURE_EPRT,
G_VFS_FTP_FEATURE_EPSV,
G_VFS_FTP_FEATURE_UTF8
} GVfsFtpFeature;
#define G_VFS_FTP_FEATURES_DEFAULT (0)
typedef enum {
G_VFS_FTP_SYSTEM_UNKNOWN = 0,
G_VFS_FTP_SYSTEM_UNIX,
G_VFS_FTP_SYSTEM_WINDOWS
} GVfsFtpSystem;
typedef enum {
G_VFS_FTP_METHOD_ANY = 0,
G_VFS_FTP_METHOD_EPSV,
G_VFS_FTP_METHOD_PASV,
G_VFS_FTP_METHOD_PASV_ADDR,
G_VFS_FTP_METHOD_EPRT,
G_VFS_FTP_METHOD_PORT
} GVfsFtpMethod;
typedef enum {
/* server does not allow querying features before login, so we try after
* logging in instead. */
G_VFS_FTP_WORKAROUND_FEAT_AFTER_LOGIN,
} GVfsFtpWorkaround;
/* forward declarations */
typedef struct _GVfsFtpDirCache GVfsFtpDirCache;
typedef struct _GVfsFtpDirFuncs GVfsFtpDirFuncs;
#define G_VFS_TYPE_BACKEND_FTP (g_vfs_backend_ftp_get_type ())
#define G_VFS_BACKEND_FTP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_BACKEND_FTP, GVfsBackendFtp))
#define G_VFS_BACKEND_FTP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_BACKEND_FTP, GVfsBackendFtpClass))
#define G_VFS_IS_BACKEND_FTP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_VFS_TYPE_BACKEND_FTP))
#define G_VFS_IS_BACKEND_FTP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_VFS_TYPE_BACKEND_FTP))
#define G_VFS_BACKEND_FTP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_VFS_TYPE_BACKEND_FTP, GVfsBackendFtpClass))
typedef struct _GVfsBackendFtp GVfsBackendFtp;
typedef struct _GVfsBackendFtpClass GVfsBackendFtpClass;
struct _GVfsBackendFtp
{
GVfsBackend backend;
GSocketConnectable * addr;
GSocketClient * connection_factory;
char * user;
gboolean has_initial_user;
char * password; /* password or NULL for anonymous */
char * host_display_name;
GVfsFtpSystem system; /* the system from the SYST response */
int features; /* GVfsFtpFeatures that are supported */
int workarounds; /* GVfsFtpWorkarounds in use - int because it's atomic */
int method; /* preferred GVfsFtpMethod - int because it's atomic */
/* directory cache */
const GVfsFtpDirFuncs *dir_funcs; /* functions used in directory cache */
GVfsFtpDirCache * dir_cache; /* directory cache */
/* connection collection - accessed from gvfsftptask.c */
GMutex * mutex; /* mutex protecting the following variables */
GCond * cond; /* cond used to signal tasks waiting on the mutex */
GQueue * queue; /* queue containing the connections */
guint connections; /* current number of connections */
guint busy_connections; /* current number of connections being used for reads/writes */
guint max_connections; /* upper server limit for number of connections - dynamically generated */
};
struct _GVfsBackendFtpClass
{
GVfsBackendClass parent_class;
};
GType g_vfs_backend_ftp_get_type (void) G_GNUC_CONST;
gboolean g_vfs_backend_ftp_has_feature (GVfsBackendFtp * ftp,
GVfsFtpFeature feature);
gboolean g_vfs_backend_ftp_uses_workaround (GVfsBackendFtp * ftp,
GVfsFtpWorkaround workaround);
void g_vfs_backend_ftp_use_workaround (GVfsBackendFtp * ftp,
GVfsFtpWorkaround workaround);
G_END_DECLS
#endif /* __G_VFS_BACKEND_FTP_H__ */
|
/*
* Copyright (C) 2016 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @{
*
* @file
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#include <assert.h>
#include <stdint.h>
#include <sys/uio.h>
#include "msg.h"
#include "net/netdev.h"
#include "evproc.h"
#include "emb6.h"
#include "linkaddr.h"
#include "packetbuf.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
extern uip_lladdr_t uip_lladdr;
static netdev_t *_dev = NULL;
static s_nsLowMac_t *_lowmac = NULL;
static int8_t _rssi_base_value = -100;
static uint8_t _last_rssi;
static int8_t _netdev_init(s_ns_t *p_ns);
static int8_t _netdev_send(const void *pr_payload, uint8_t c_len);
static int8_t _netdev_on(void);
static int8_t _netdev_off(void);
static void _netdev_set_txpower(int8_t power);
static int8_t _netdev_get_txpower(void);
static void _netdev_set_sensitivity(int8_t sens);
static int8_t _netdev_get_sensitivity(void);
static int8_t _netdev_get_rssi(void);
static void _netdev_set_promisc(uint8_t c_on_off);
const s_nsIf_t emb6_netdev_driver = {
.name = "netdev",
.init = &_netdev_init,
.send = &_netdev_send,
.on = &_netdev_on,
.off = &_netdev_off,
.set_txpower = &_netdev_set_txpower,
.get_txpower = &_netdev_get_txpower,
.set_sensitivity = &_netdev_set_sensitivity,
.get_sensitivity = &_netdev_get_sensitivity,
.get_rssi = &_netdev_get_rssi,
.ant_div = NULL,
.ant_rf_switch = NULL,
.set_promisc = &_netdev_set_promisc,
};
static void _get_recv_pkt(void)
{
char *dataptr;
struct netdev_radio_rx_info rx_info;
int8_t len;
packetbuf_clear();
dataptr = packetbuf_dataptr();
len = _dev->driver->recv(_dev, dataptr, PACKETBUF_SIZE, &rx_info);
_last_rssi = rx_info.rssi;
if ((len > 0) && (_lowmac != NULL)) {
packetbuf_set_datalen(len);
_lowmac->input();
}
}
static void _event_cb(netdev_t *dev, netdev_event_t event)
{
if (event == NETDEV_EVENT_ISR) {
/* EVENT_TYPE_PCK_LL is supposed to be used by drivers, so use it
* (though NETDEV_EVENT_ISR technically doesn't only signify
* incoming packets) */
evproc_putEvent(E_EVPROC_HEAD, EVENT_TYPE_PCK_LL, NULL);
}
else {
switch (event) {
case NETDEV_EVENT_RX_COMPLETE: {
_get_recv_pkt();
}
break;
default:
break;
}
}
}
static void _emb6_netdev_callback(c_event_t c_event, p_data_t p_data)
{
(void)p_data;
if (c_event == EVENT_TYPE_PCK_LL) {
_dev->driver->isr(_dev);
}
}
int emb6_netdev_setup(netdev_t *dev)
{
if (_dev == NULL) {
_dev = dev;
return 0;
}
return -1;
}
static int8_t _netdev_init(s_ns_t *p_ns)
{
if ((_dev != NULL) && (p_ns != NULL) && (p_ns->lmac != NULL)) {
_dev->event_callback = _event_cb;
_dev->driver->get(_dev, NETOPT_ADDRESS_LONG, &mac_phy_config.mac_address,
sizeof(mac_phy_config.mac_address));
memcpy(&uip_lladdr, mac_phy_config.mac_address,
sizeof(mac_phy_config.mac_address));
_dev->driver->get(_dev, NETOPT_NID, &mac_phy_config.pan_id,
sizeof(mac_phy_config.pan_id));
linkaddr_set_node_addr((linkaddr_t *)&uip_lladdr);
_lowmac = p_ns->lmac;
evproc_regCallback(EVENT_TYPE_PCK_LL, _emb6_netdev_callback);
return 1;
}
return 0;
}
static int8_t _netdev_send(const void *pr_payload, uint8_t c_len)
{
if (_dev != NULL) {
iolist_t iolist = {
.iol_base = (void *)pr_payload,
.iol_len = c_len,
};
if (_dev->driver->send(_dev, &iolist) < 0) {
DEBUG("Error on send\n");
return RADIO_TX_ERR;
}
DEBUG("Packet of length %u was transmitted\n", (unsigned)c_len);
return RADIO_TX_OK;
}
DEBUG("Device was not initialized\n");
return RADIO_TX_ERR;
}
static int8_t _netdev_on(void)
{
/* TODO: turn netdev on */
return 1;
}
static int8_t _netdev_off(void)
{
/* TODO: turn netdev off */
return 1;
}
static void _netdev_set_txpower(int8_t power)
{
int16_t pwr = power;
_dev->driver->set(_dev, NETOPT_TX_POWER, &pwr, sizeof(pwr));
}
static int8_t _netdev_get_txpower(void)
{
int16_t power = 0;
_dev->driver->get(_dev, NETOPT_TX_POWER, &power, sizeof(power));
return (int8_t)power;
}
static void _netdev_set_sensitivity(int8_t sens)
{
/* TODO: set sensitivity */
}
static int8_t _netdev_get_sensitivity(void)
{
/* TODO: get sensitivity */
return 0;
}
static int8_t _netdev_get_rssi(void)
{
return (int8_t)(_rssi_base_value + 1.03 * _last_rssi);
}
static void _netdev_set_promisc(uint8_t c_on_off)
{
netopt_enable_t en = (c_on_off) ? NETOPT_ENABLE : NETOPT_DISABLE;
_dev->driver->set(_dev, NETOPT_PROMISCUOUSMODE, &en, sizeof(en));
}
/** @} */
|
#include "tokyo_messenger.h"
extern VALUE StringRaw(const char *buf, int bsiz){
VALUE vval;
int i;
vval = rb_str_buf_new2("");
char s[5];
for(i=0;i<bsiz;i++){
char c = *buf++;
s[0] = c;
rb_str_buf_cat(vval, s, 1);
}
// buf -= bsiz;
// rb_str_buf_cat2(vval, "");
return vval;
}
extern VALUE StringValueEx(VALUE vobj){
if (rb_respond_to(vobj, rb_intern("to_tokyo_tyrant"))) {
return rb_convert_type(vobj, T_STRING, "String", "to_tokyo_tyrant");
} else if (rb_respond_to(vobj, rb_intern("to_s"))) {
return rb_convert_type(vobj, T_STRING, "String", "to_s");
} else {
rb_raise(rb_eArgError, "can't stringify object");
}
return StringValue(vobj);
}
extern TCLIST *varytolist(VALUE vary){
VALUE vval;
TCLIST *list;
int i, num;
num = RARRAY_LEN(vary);
list = tclistnew2(num);
for(i = 0; i < num; i++){
vval = rb_ary_entry(vary, i);
vval = StringValueEx(vval);
tclistpush(list, RSTRING_PTR(vval), RSTRING_LEN(vval));
}
return list;
}
extern VALUE listtovary(TCLIST *list){
VALUE vary;
const char *vbuf;
int i, num, vsiz;
num = tclistnum(list);
vary = rb_ary_new2(num);
for(i = 0; i < num; i++){
vbuf = tclistval(list, i, &vsiz);
rb_ary_push(vary, rb_str_new(vbuf, vsiz));
}
return vary;
}
extern TCMAP *vhashtomap(VALUE vhash){
VALUE vkeys, vkey, vval;
TCMAP *map;
int i, num;
map = tcmapnew2(31);
vkeys = rb_funcall(vhash, rb_intern("keys"), 0);
num = RARRAY_LEN(vkeys);
for(i = 0; i < num; i++){
vkey = rb_ary_entry(vkeys, i);
vval = rb_hash_aref(vhash, vkey);
vkey = StringValueEx(vkey);
vval = StringValueEx(vval);
tcmapput(map, RSTRING_PTR(vkey), RSTRING_LEN(vkey), RSTRING_PTR(vval), RSTRING_LEN(vval));
}
return map;
}
extern VALUE maptovhash(TCMAP *map){
const char *kbuf;
int ksiz, vsiz;
VALUE vhash;
vhash = rb_hash_new();
tcmapiterinit(map);
while((kbuf = tcmapiternext(map, &ksiz)) != NULL){
const char *vbuf = tcmapiterval(kbuf, &vsiz);
rb_hash_aset(vhash, rb_str_new(kbuf, ksiz), StringRaw(vbuf, vsiz));
}
return vhash;
}
extern TCMAP *varytomap(VALUE vary){
int i;
TCLIST *keys;
TCMAP *recs = tcmapnew();
keys = varytolist(vary);
for(i = 0; i < tclistnum(keys); i++){
int ksiz;
const char *kbuf = tclistval(keys, i, &ksiz);
tcmapput(recs, kbuf, ksiz, "", 0);
}
tclistdel(keys);
return recs;
}
extern TCLIST *vhashtolist(VALUE vhash){
/*
Seems like something like this might work just as well
vary = rb_hash_to_a(vhash);
vary = rb_ary_flatten(vary);
args = varytolist(vary);
*/
VALUE vkeys, vkey, vval;
TCLIST *list;
int i, num;
vkeys = rb_funcall(vhash, rb_intern("keys"), 0);
num = RARRAY_LEN(vkeys);
list = tclistnew2(num);
for(i = 0; i < num; i++){
vkey = rb_ary_entry(vkeys, i);
vval = rb_hash_aref(vhash, vkey);
vkey = StringValueEx(vkey);
vval = StringValueEx(vval);
tclistpush(list, RSTRING_PTR(vkey), RSTRING_LEN(vkey));
tclistpush(list, RSTRING_PTR(vval), RSTRING_LEN(vval));
}
return list;
}
VALUE mTokyoMessenger;
VALUE eTokyoMessengerError;
VALUE cDB;
VALUE cTable;
VALUE cQuery;
void Init_tokyo_messenger(){
mTokyoMessenger = rb_define_module("TokyoMessenger");
eTokyoMessengerError = rb_define_class("TokyoMessengerError", rb_eStandardError);
init_mod();
cDB = rb_define_class_under(mTokyoMessenger, "DB", rb_cObject);
rb_include_module(cDB, mTokyoMessenger);
init_db();
cTable = rb_define_class_under(mTokyoMessenger, "Table", rb_cObject);
rb_include_module(cTable, mTokyoMessenger);
init_table();
cQuery = rb_define_class_under(mTokyoMessenger, "Query", rb_cObject);
init_query();
}
|
/*
* GeeXboX Valhalla: tiny media scanner API.
* Copyright (C) 2009 Mathieu Schroeter <mathieu@schroetersa.ch>
*
* This file is part of libvalhalla.
*
* libvalhalla 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.
*
* libvalhalla 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 libvalhalla; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <curl/curl.h>
#include "valhalla.h"
#include "valhalla_internals.h"
#include "url_utils.h"
#include "logs.h"
struct url_ctl_s {
pthread_mutex_t mutex;
int abort;
};
static size_t
url_buffer_get (void *ptr, size_t size, size_t nmemb, void *data)
{
size_t realsize = size * nmemb;
url_data_t *mem = (url_data_t *) data;
mem->buffer = realloc (mem->buffer, mem->size + realsize + 1);
if (mem->buffer)
{
memcpy (&(mem->buffer[mem->size]), ptr, realsize);
mem->size += realsize;
mem->buffer[mem->size] = 0;
}
return realsize;
}
static int
url_progress_cb (void *clientp,
vh_unused double dltotal, vh_unused double dlnow,
vh_unused double ultotal, vh_unused double ulnow)
{
url_ctl_t *a = clientp;
int abort;
if (!a)
return 0;
pthread_mutex_lock (&a->mutex);
abort = a->abort;
pthread_mutex_unlock (&a->mutex);
return abort;
}
url_t *
vh_url_new (url_ctl_t *url_ctl)
{
char useragent[256];
CURL *curl;
curl = curl_easy_init ();
if (!curl)
return NULL;
snprintf (useragent, sizeof (useragent),
"libvalhalla/%s %s", LIBVALHALLA_VERSION_STR, curl_version ());
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, url_buffer_get);
curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt (curl, CURLOPT_TIMEOUT, 20);
curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_easy_setopt (curl, CURLOPT_USERAGENT, useragent);
curl_easy_setopt (curl, CURLOPT_FAILONERROR, 1);
if (url_ctl)
{
/*
* The progress callback provides a way to abort a download. A call on
* vh_url_ctl_abort() with the same url_ctl, will break vh_url_get_data()
* with the status code CURLE_ABORTED_BY_CALLBACK. The breaking is not
* immediate. The callback is called roughly once per second.
*/
curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt (curl, CURLOPT_PROGRESSDATA, url_ctl);
curl_easy_setopt (curl, CURLOPT_PROGRESSFUNCTION, url_progress_cb);
}
return (url_t *) curl;
}
void
vh_url_free (url_t *url)
{
if (url)
curl_easy_cleanup ((CURL *) url);
}
void
vh_url_global_init (void)
{
curl_global_init (CURL_GLOBAL_DEFAULT);
}
void
vh_url_global_uninit (void)
{
curl_global_cleanup ();
}
url_data_t
vh_url_get_data (url_t *handler, const char *url)
{
url_data_t chunk;
CURL *curl = (CURL *) handler;
chunk.buffer = NULL; /* we expect realloc(NULL, size) to work */
chunk.size = 0; /* no data at this point */
chunk.status = CURLE_FAILED_INIT;
if (!curl || !url)
return chunk;
curl_easy_setopt (curl, CURLOPT_URL, url);
curl_easy_setopt (curl, CURLOPT_WRITEDATA, (void *) &chunk);
chunk.status = curl_easy_perform (curl);
if (chunk.status)
{
const char *err = curl_easy_strerror (chunk.status);
vh_log (VALHALLA_MSG_VERBOSE, "%s: %s", __FUNCTION__, err);
if (chunk.buffer)
{
free (chunk.buffer);
chunk.buffer = NULL;
}
}
return chunk;
}
char *
vh_url_escape_string (url_t *handler, const char *buf)
{
CURL *curl = (CURL *) handler;
if (!curl || !buf)
return NULL;
return curl_easy_escape (curl, buf, strlen (buf));
}
int
vh_url_save_to_disk (url_t *handler, char *src, char *dst)
{
url_data_t data;
int fd;
size_t n;
CURL *curl = (CURL *) handler;
if (!curl || !src || !dst)
return URL_ERROR_PARAMS;
vh_log (VALHALLA_MSG_VERBOSE, "Saving %s to %s", src, dst);
data = vh_url_get_data (curl, src);
if (data.status != CURLE_OK)
{
if (data.status == CURLE_ABORTED_BY_CALLBACK)
return URL_ERROR_ABORT;
vh_log (VALHALLA_MSG_WARNING, "Unable to download requested file %s", src);
return URL_ERROR_TRANSFER;
}
fd = open (dst, O_WRONLY | O_CREAT | O_BINARY, 0666);
if (fd < 0)
{
vh_log (VALHALLA_MSG_WARNING, "Unable to open stream to save file %s", dst);
free (data.buffer);
return URL_ERROR_FILE;
}
n = write (fd, data.buffer, data.size);
close (fd);
free (data.buffer);
if (n != data.size)
return URL_ERROR_FILE;
return URL_SUCCESS;
}
url_ctl_t *
vh_url_ctl_new (void)
{
url_ctl_t *url_ctl;
url_ctl = calloc (1, sizeof (url_ctl_t));
if (!url_ctl)
return NULL;
pthread_mutex_init (&url_ctl->mutex, NULL);
return url_ctl;
}
void
vh_url_ctl_free (url_ctl_t *url_ctl)
{
if (!url_ctl)
return;
pthread_mutex_destroy (&url_ctl->mutex);
free (url_ctl);
}
void
vh_url_ctl_abort (url_ctl_t *url_ctl)
{
if (!url_ctl)
return;
pthread_mutex_lock (&url_ctl->mutex);
url_ctl->abort = 1;
pthread_mutex_unlock (&url_ctl->mutex);
}
|
/* pager object */
/* vim: set sw=2 et: */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003, 2005-2007 Vincent Untz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#if !defined (__LIBWNCK_H_INSIDE__) && !defined (WNCK_COMPILATION)
#error "Only <libwnck/libwnck.h> can be included directly."
#endif
#ifndef WNCK_PAGER_H
#define WNCK_PAGER_H
#include <gtk/gtk.h>
#include <libwnck/screen.h>
G_BEGIN_DECLS
#define WNCK_TYPE_PAGER (wnck_pager_get_type ())
#define WNCK_PAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), WNCK_TYPE_PAGER, WnckPager))
#define WNCK_PAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WNCK_TYPE_PAGER, WnckPagerClass))
#define WNCK_IS_PAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), WNCK_TYPE_PAGER))
#define WNCK_IS_PAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WNCK_TYPE_PAGER))
#define WNCK_PAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WNCK_TYPE_PAGER, WnckPagerClass))
typedef struct _WnckPager WnckPager;
typedef struct _WnckPagerClass WnckPagerClass;
typedef struct _WnckPagerPrivate WnckPagerPrivate;
/**
* WnckPager:
*
* The #WnckPager struct contains only private fields and should not be
* directly accessed.
*/
struct _WnckPager
{
GtkContainer parent_instance;
WnckPagerPrivate *priv;
};
struct _WnckPagerClass
{
GtkContainerClass parent_class;
/* Padding for future expansion */
void (* pad1) (void);
void (* pad2) (void);
void (* pad3) (void);
void (* pad4) (void);
};
/**
* WnckPagerDisplayMode:
* @WNCK_PAGER_DISPLAY_NAME: the #WnckPager will only display the names of the
* workspaces.
* @WNCK_PAGER_DISPLAY_CONTENT: the #WnckPager will display a representation
* for each window in the workspaces.
*
* Mode defining what a #WnckPager will display.
*/
typedef enum {
WNCK_PAGER_DISPLAY_NAME,
WNCK_PAGER_DISPLAY_CONTENT
} WnckPagerDisplayMode;
GType wnck_pager_get_type (void) G_GNUC_CONST;
GtkWidget* wnck_pager_new (void);
gboolean wnck_pager_set_orientation (WnckPager *pager,
GtkOrientation orientation);
gboolean wnck_pager_set_n_rows (WnckPager *pager,
int n_rows);
void wnck_pager_set_display_mode (WnckPager *pager,
WnckPagerDisplayMode mode);
void wnck_pager_set_show_all (WnckPager *pager,
gboolean show_all_workspaces);
void wnck_pager_set_shadow_type (WnckPager *pager,
GtkShadowType shadow_type);
G_END_DECLS
#endif /* WNCK_PAGER_H */
|
/*
* Copyright (C) 2002 Manuel Novoa III
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "_string.h"
#ifdef __USE_GNU
#ifdef WANT_WIDE
# define Wmempcpy wmempcpy
#else
# undef mempcpy
# define Wmempcpy mempcpy
#endif
Wvoid *Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
{
register Wchar *r1 = s1;
register const Wchar *r2 = s2;
#ifdef __BCC__
while (n--) {
*r1++ = *r2++;
}
#else
while (n) {
*r1++ = *r2++;
--n;
}
#endif
return r1;
}
libc_hidden_weak(Wmempcpy)
#endif
|
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996-2002
* Sleepycat Software. All rights reserved.
*/
#include "db_config.h"
#ifndef lint
static const char copyright[] =
"Copyright (c) 1996-2002\nSleepycat Software Inc. All rights reserved.\n";
static const char revid[] =
"$Id: db_archive.c,v 1.1.1.1 2003/11/20 22:13:15 toshok Exp $";
#endif
#ifndef NO_SYSTEM_INCLUDES
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#endif
#include "db_int.h"
int main __P((int, char *[]));
int usage __P((void));
int version_check __P((const char *));
int
main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind;
const char *progname = "db_archive";
DB_ENV *dbenv;
u_int32_t flags;
int ch, e_close, exitval, ret, verbose;
char **file, *home, **list, *passwd;
if ((ret = version_check(progname)) != 0)
return (ret);
flags = 0;
e_close = exitval = verbose = 0;
home = passwd = NULL;
while ((ch = getopt(argc, argv, "ah:lP:sVv")) != EOF)
switch (ch) {
case 'a':
LF_SET(DB_ARCH_ABS);
break;
case 'h':
home = optarg;
break;
case 'l':
LF_SET(DB_ARCH_LOG);
break;
case 'P':
passwd = strdup(optarg);
memset(optarg, 0, strlen(optarg));
if (passwd == NULL) {
fprintf(stderr, "%s: strdup: %s\n",
progname, strerror(errno));
return (EXIT_FAILURE);
}
break;
case 's':
LF_SET(DB_ARCH_DATA);
break;
case 'V':
printf("%s\n", db_version(NULL, NULL, NULL));
return (EXIT_SUCCESS);
case 'v':
verbose = 1;
break;
case '?':
default:
return (usage());
}
argc -= optind;
argv += optind;
if (argc != 0)
return (usage());
/* Handle possible interruptions. */
__db_util_siginit();
/*
* Create an environment object and initialize it for error
* reporting.
*/
if ((ret = db_env_create(&dbenv, 0)) != 0) {
fprintf(stderr,
"%s: db_env_create: %s\n", progname, db_strerror(ret));
goto shutdown;
}
e_close = 1;
dbenv->set_errfile(dbenv, stderr);
dbenv->set_errpfx(dbenv, progname);
if (verbose)
(void)dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1);
if (passwd != NULL && (ret = dbenv->set_encrypt(dbenv,
passwd, DB_ENCRYPT_AES)) != 0) {
dbenv->err(dbenv, ret, "set_passwd");
goto shutdown;
}
/*
* If attaching to a pre-existing environment fails, create a
* private one and try again.
*/
if ((ret = dbenv->open(dbenv,
home, DB_JOINENV | DB_USE_ENVIRON, 0)) != 0 &&
(ret = dbenv->open(dbenv, home, DB_CREATE |
DB_INIT_LOG | DB_INIT_TXN | DB_PRIVATE | DB_USE_ENVIRON, 0)) != 0) {
dbenv->err(dbenv, ret, "open");
goto shutdown;
}
/* Get the list of names. */
if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) {
dbenv->err(dbenv, ret, "DB_ENV->log_archive");
goto shutdown;
}
/* Print the list of names. */
if (list != NULL) {
for (file = list; *file != NULL; ++file)
printf("%s\n", *file);
free(list);
}
if (0) {
shutdown: exitval = 1;
}
if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) {
exitval = 1;
fprintf(stderr,
"%s: dbenv->close: %s\n", progname, db_strerror(ret));
}
/* Resend any caught signal. */
__db_util_sigresend();
return (exitval == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
int
usage()
{
(void)fprintf(stderr,
"usage: db_archive [-alsVv] [-h home] [-P password]\n");
return (EXIT_FAILURE);
}
int
version_check(progname)
const char *progname;
{
int v_major, v_minor, v_patch;
/* Make sure we're loaded with the right version of the DB library. */
(void)db_version(&v_major, &v_minor, &v_patch);
if (v_major != DB_VERSION_MAJOR ||
v_minor != DB_VERSION_MINOR || v_patch != DB_VERSION_PATCH) {
fprintf(stderr,
"%s: version %d.%d.%d doesn't match library version %d.%d.%d\n",
progname, DB_VERSION_MAJOR, DB_VERSION_MINOR,
DB_VERSION_PATCH, v_major, v_minor, v_patch);
return (EXIT_FAILURE);
}
return (0);
}
|
#ifndef PFFFT_EX_H
#define PFFFT_EX_H
#include "pffft.h"
#ifdef __cplusplus
extern "C" {
#endif
void pffft_zconvolve(PFFFT_Setup *s, const float *a, const float *b, float *ab);
#ifdef __cplusplus
}
#endif
#endif /* PFFFT_EX_H */
|
/*
* Copyright (c) 2008-2010 Wind River Systems; see
* guts/COPYRIGHT for information.
*
* static int
* clone(...) {
* ....
*/
/* because clone() doesn't actually continue in this function, we
* can't check the return and fix up environment variables in the
* child. Instead, we have to temporarily do any fixup, then possibly
* undo it later. UGH!
*/
pseudo_debug(1, "client resetting for clone(2) call\n");
if (!pseudo_get_value("PSEUDO_RELOADED")) {
pseudo_setupenv();
pseudo_reinit_libpseudo();
} else {
pseudo_setupenv();
pseudo_dropenv();
}
/* call the real syscall */
rc = (*real_clone)(fn, child_stack, flags, arg, pid, tls, ctid);
/* ...
* return rc;
* }
*/
|
// Created file "Lib\src\ehstorguids\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WPD_COMMON_INFORMATION_START_DATETIME, 0xb28ae94b, 0x05a4, 0x4e8e, 0xbe, 0x01, 0x72, 0xcc, 0x7e, 0x09, 0x9d, 0x8f);
|
/*
* Copyright (c) 2008 CO-CONV, Corp. 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 THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef __SYS_ATOMIC_H__
#define __SYS_ATOMIC_H__
#if defined(_KERNEL)
#include <ntifs.h>
#else
#include <winbase.h>
#endif
#define atomic_set_long(p, v) InterlockedExchange((PLONG)(p), (LONG)(v))
#define atomic_set_int atomic_set_long
#define atomic_set_short atomic_set_long
#define atomic_set_char atomic_set_long
#define atomic_clear_long(p, v) InterlockedXor((PLONG)(p), (LONG)(v))
#define atomic_clear_int atomic_clear_long
#define atomic_clear_short atomic_clear_long
#define atomic_clear_char atomic_clear_long
#define atomic_add_long(p, v) InterlockedExchangeAdd((PLONG)(p), (LONG)(v))
#define atomic_add_int atomic_add_long
#define atomic_add_short atomic_add_long
#define atomic_add_char atomic_add_long
#define atomic_fetchadd_long atomic_add_long
#define atomic_fetchadd_int atomic_add_int
#define atomic_fetchadd_short atomic_add_short
#define atomic_fetchadd_char atomic_add_char
#define atomic_subtract_long(p, v) InterlockedExchangeAdd((PLONG)(p), -(LONG)(v))
#define atomic_subtract_int atomic_subtract_long
#define atomic_subtract_short atomic_subtract_long
#define atomic_subtract_char atomic_subtract_long
#define atomic_cmpset_long(p, c, v) InterlockedCompareExchange((PLONG)(p), (LONG)v, (LONG)c)
#define atomic_cmpset_int atomic_cmpset_long
#define atomic_cmpset_short atomic_cmpset_long
#define atomic_cmpset_char atomic_cmpset_long
#endif /* __SYS_ATOMIC_H__ */
|
// LdXDlg.h : CLdXDlg Ìé¾
#ifndef __LdXDlg_H_
#define __LdXDlg_H_
#include "resource.h" // C V{
#include <atlhost.h>
#include <coef.h>
/////////////////////////////////////////////////////////////////////////////
// CLdXDlg
class CLdXDlg :
public CAxDialogImpl<CLdXDlg>
{
public:
CLdXDlg( char* srcfilename );
~CLdXDlg();
enum { IDD = IDD_LDX };
BEGIN_MSG_MAP(CLdXDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
COMMAND_ID_HANDLER(IDC_REF, OnRef)
END_MSG_MAP()
// nhÌvg^Cv:
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnRef(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
public:
char name[_MAX_PATH];
float mult;
private:
CWindow m_name_wnd;
CWindow m_mult_wnd;
private:
void SetWnd();
int ParamsToDlg();
};
#endif //__LdXDlg_H_
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DESCRIBECAPACITYPROVIDERSRESPONSE_P_H
#define QTAWS_DESCRIBECAPACITYPROVIDERSRESPONSE_P_H
#include "ecsresponse_p.h"
namespace QtAws {
namespace ECS {
class DescribeCapacityProvidersResponse;
class DescribeCapacityProvidersResponsePrivate : public EcsResponsePrivate {
public:
explicit DescribeCapacityProvidersResponsePrivate(DescribeCapacityProvidersResponse * const q);
void parseDescribeCapacityProvidersResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(DescribeCapacityProvidersResponse)
Q_DISABLE_COPY(DescribeCapacityProvidersResponsePrivate)
};
} // namespace ECS
} // namespace QtAws
#endif
|
#ifndef PTXPARSERH
#define PTXPARSERH
#include "Tokenizer.h"
#include "parser/AbstractParser.h"
namespace ptx {
class Parser : public parser::AbstractParser {
typedef TokenList::token_t token_t;
public:
~Parser(){}
ParserResult parseModule(const std::string& source);
protected:
bool parseTokens(TokenList& tokens, ParserResult& result) const;
};
}
#endif
|
// Created file "Lib\src\MsXml2\msxml2_i"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IXMLElement, 0x3f7f31ac, 0xe15f, 0x11d0, 0x9c, 0x25, 0x00, 0xc0, 0x4f, 0xc9, 0x9c, 0x8e);
|
#include<stdio.h>
int main()
{
printf("\n\n\nHi there!!!!!!\n\n\n");
return 0;
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTIMAGEPIPELINESREQUEST_P_H
#define QTAWS_LISTIMAGEPIPELINESREQUEST_P_H
#include "imagebuilderrequest_p.h"
#include "listimagepipelinesrequest.h"
namespace QtAws {
namespace imagebuilder {
class ListImagePipelinesRequest;
class ListImagePipelinesRequestPrivate : public imagebuilderRequestPrivate {
public:
ListImagePipelinesRequestPrivate(const imagebuilderRequest::Action action,
ListImagePipelinesRequest * const q);
ListImagePipelinesRequestPrivate(const ListImagePipelinesRequestPrivate &other,
ListImagePipelinesRequest * const q);
private:
Q_DECLARE_PUBLIC(ListImagePipelinesRequest)
};
} // namespace imagebuilder
} // namespace QtAws
#endif
|
// Created file "Lib\src\PortableDeviceGuids\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD, 0x68dd2f27, 0xa4ce, 0x4e11, 0x84, 0x87, 0x37, 0x94, 0xe4, 0x13, 0x5d, 0xfa);
|
// Created file "Lib\src\ksuser\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(KSDATAFORMAT_SPECIFIER_NONE, 0x0f6417d6, 0xc318, 0x11d0, 0xa4, 0x3f, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DISCOVERINSTANCESRESPONSE_H
#define QTAWS_DISCOVERINSTANCESRESPONSE_H
#include "servicediscoveryresponse.h"
#include "discoverinstancesrequest.h"
namespace QtAws {
namespace ServiceDiscovery {
class DiscoverInstancesResponsePrivate;
class QTAWSSERVICEDISCOVERY_EXPORT DiscoverInstancesResponse : public ServiceDiscoveryResponse {
Q_OBJECT
public:
DiscoverInstancesResponse(const DiscoverInstancesRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DiscoverInstancesRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DiscoverInstancesResponse)
Q_DISABLE_COPY(DiscoverInstancesResponse)
};
} // namespace ServiceDiscovery
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETUICUSTOMIZATIONRESPONSE_H
#define QTAWS_GETUICUSTOMIZATIONRESPONSE_H
#include "cognitoidentityproviderresponse.h"
#include "getuicustomizationrequest.h"
namespace QtAws {
namespace CognitoIdentityProvider {
class GetUICustomizationResponsePrivate;
class QTAWSCOGNITOIDENTITYPROVIDER_EXPORT GetUICustomizationResponse : public CognitoIdentityProviderResponse {
Q_OBJECT
public:
GetUICustomizationResponse(const GetUICustomizationRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const GetUICustomizationRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(GetUICustomizationResponse)
Q_DISABLE_COPY(GetUICustomizationResponse)
};
} // namespace CognitoIdentityProvider
} // namespace QtAws
#endif
|
// Created file "Lib\src\Uuid\iid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_ITmNodeName, 0x30274f88, 0x6ee4, 0x474e, 0x9b, 0x95, 0x78, 0x07, 0xbc, 0x9e, 0xf8, 0xcf);
|
/*
Created : Jul 31, 2010
Modified: Feb 14, 2013
Author : Yu-Chung Hsiao
Email : project.caplet@gmail.com
*/
/*
This file is part of CAPLET.
CAPLET 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.
CAPLET 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 Lesser GNU General Public License
along with CAPLET. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CAPLET_INT_H_
#define CAPLET_INT_H_
#include "caplet_debug.h"
#include "caplet_const.h"
#ifdef DEBUG_SHAPE_BOUNDARY_CHECK
#include <iostream>
#endif
namespace caplet{
//* FAST GALERKIN MODE
//* Flat-Flat integrals
//* - integral 1
float intZFZF(float* coord1[nDim][nBit], float* coord2[nDim][nBit]);
//* - integral 2
float intZFXF(float* coord1[nDim][nBit], float* coord2[nDim][nBit]);
//* Linear-Flat integrals
//* - integral 3
float intZXZF(
float* coord1[nDim][nBit], float bz, float bsh, float (*shape)(float, float),
float* coord2[nDim][nBit] );
//* - integral 4
float intZXXF(
float* coord1[nDim][nBit], float bz, float bsh, float (*shape)(float, float),
float* coord2[nDim][nBit] );
//* - integral 5
float intZXYF(
float* coord1[nDim][nBit], float bz, float bsh, float (*shape)(float, float),
float* coord2[nDim][nBit] );
//* Linear-Linear integrals
//* - integral 6
float intZXZX(
float* coord1[nDim][nBit], float bz1, float bsh1, float (*shape1)(float, float),
float* coord2[nDim][nBit], float bz2, float bsh2, float (*shape2)(float, float) );
//* - integral 7
float intZXYX(
float* coord1[nDim][nBit], float bz1, float bsh1, float (*shape1)(float, float),
float* coord2[nDim][nBit], float bz2, float bsh2, float (*shape2)(float, float) );
//* - integral 8
float intZXZY(
float* coord1[nDim][nBit], float bz1, float bsh1, float (*shape1)(float, float),
float* coord2[nDim][nBit], float bz2, float bsh2, float (*shape2)(float, float) );
//* - integral 9
float intZXXZ(
float* coord1[nDim][nBit], float bz1, float bsh1, float (*shape1)(float, float),
float* coord2[nDim][nBit], float bz2, float bsh2, float (*shape2)(float, float) );
//* - integral 10
float intZXYZ(
float* coord1[nDim][nBit], float bz1, float bsh1, float (*shape1)(float, float),
float* coord2[nDim][nBit], float bz2, float bsh2, float (*shape2)(float, float) );
//* - integral 11
float intZXXY(
float* coord1[nDim][nBit], float bz1, float bsh1, float (*shape1)(float, float),
float* coord2[nDim][nBit], float bz2, float bsh2, float (*shape2)(float, float) );
//***********************************************************
//*
//* Double collocation mode
//*
//*
double calColD(float* p1[nDim][nBit], float* p2[nDim][nBit]);
//**********************************
//*
//* Shape functions
//*
//*
inline float flat(float x, float w){
return 1;
}
inline float arch(float x, float w){
//* Constant arch shapes are good enough for most of the time
#ifdef CAPLET_FLAT_ARCH
return 0.5;
#endif
#ifdef DEBUG_SHAPE_BOUNDARY_CHECK
if ( x>1.41e-6 || x<0 || w<0){
std::cerr << "ERROR: input argument is out of the arch boundary" << std::endl;
}
#endif
//* Extracted for arch length = 0.4um
if ( w>10e-6 ){
w = 10e-6;
}
return ( -1.1065e-06 + (241.98 + 5.1765e+06*w)*w + (350.58 + -2.3076e+08*x + -5.5044e+07*w)*x )/( -1.0785e-05 + ( 404.46 + ( 2.6513e+06 + 2.7367e+11*w )*w )*w + ( 456.37 + (1.8301e+08 + -3.3833e+14*x)*x + (-1.0181e+07 + 5.4154e+12*w + 1.0317e+15*x )*w )*x );
}
inline float side(float x, float w){
#ifdef CAPLET_FLAT_SIDE
return 0.5;
#endif
#ifdef DEBUG_SHAPE_BOUNDARY_CHECK
if ( x>1.251e-6 || x<0 || w<0){
std::cerr << "ERROR: input argument is out of the arch boundary" << std::endl;
}
#endif
//* Extracted for arch length = 0.4um
if ( w>10e-6 ){
w = 10e-6;
}
return ( 0.00012065 + ( 237.09 + -8.6825e+06*w )*w + ( 1580.3 + -1.7957e+09*x + -2.3054e+07*w )*x )/( 0.00029255 + ( 398.95 + -1.6467e+07*w )*w + ( 2789.4 + 1.447e+09*x + 1.0577e+08*w )*x );
}
}
#endif /* CAPLET_INT_H_ */
|
/*
*
* This file is part of Tulip (http://tulip.labri.fr)
*
* Authors: David Auber and the Tulip development Team
* from LaBRI, University of Bordeaux
*
* Tulip 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.
*
* Tulip 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.
*
*/
///@cond DOXYGEN_HIDDEN
#ifndef TULIPEXCEPTION_H
#define TULIPEXCEPTION_H
#include <tulip/tulipconf.h>
#include <string>
namespace tlp {
//=======================================
/**
* @class TulipException
* @brief TulipException is a basic class to build exceptions from string
**/
class TLP_SCOPE TulipException : public std::exception {
public:
TulipException(const std::string &desc);
~TulipException() throw() override;
const char *what() const throw() override;
private:
std::string desc;
};
} // namespace tlp
#endif // TULIPEXCEPTION
///@endcond
|
// ------------------------------- //
// -------- Start of File -------- //
// ------------------------------- //
// ----------------------------------------------------------- //
// C++ Header File Name: asprint.h
// C++ Compiler Used: MSVC, BCC32, GCC, HPUX aCC, SOLARIS CC
// Produced By: DataReel Software Development Team
// File Creation Date: 09/18/1997
// Date Last Modified: 06/17/2016
// Copyright (c) 2001-2016 DataReel Software Development
// ----------------------------------------------------------- //
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
These classes and functions are used to print data to ASCII
text files and format data for various print functions.
Changes:
==============================================================
03/11/2002: Users now have the option to use the ANSI Standard
C++ library by defining the __USE_ANSI_CPP__ preprocessor directive.
By default the old iostream library will be used for all iostream
operations.
==============================================================
*/
// ----------------------------------------------------------- //
#ifndef __GX_ASPRINT_HPP__
#define __GX_ASPRINT_HPP__
#include "gxdlcode.h"
// This directive must be defined to use the ASCII print driver
#if defined (__USE_TEXT_PRINTING__)
#if defined (__USE_ANSI_CPP__) // Use the ANSI Standard C++ library
#include <fstream>
#else // Use the old iostream library by default
#include <fstream.h>
#endif // __USE_ANSI_CPP__
// Constants for print functions
const int asPrintCols = 80; // Columns for portrait printouts
const int asPrintColsLong = 132; // Columns for landscape printouts
const int asPrintRows = 25; // Rows for portrait printouts
const int asPrintRowsLong = 25; // Rows for landscape printouts
// Control characters
const char asLineFeed = '\n';
// Function prototypes for standalone print functions
GXDLCODE_API void ASPrint(const char *s, GXSTD::ostream &stream, int offset,
int pos = 0, const char pad = ' ');
GXDLCODE_API void ASPrint(const char *s, const char filter,
GXSTD::ostream &stream, int offset,
int pos = 0, const char pad = ' ');
GXDLCODE_API void ASPrint(const char c, GXSTD::ostream &stream, int offset,
int pos = 0,
const char pad = ' ');
GXDLCODE_API void ASPrint(int val, GXSTD::ostream &stream, int offset,
int pos = 0, const char pad = ' ');
GXDLCODE_API void ASPrint(long val, GXSTD::ostream &stream, int offset,
int pos = 0,
const char pad = ' ');
GXDLCODE_API void ASPrint(double val, GXSTD::ostream &stream,
int offset, int pos = 0,
const char pad = ' ');
#endif // __USE_TEXT_PRINTING__
#endif // __GX_ASPRINT_HPP__
// ----------------------------------------------------------- //
// ------------------------------- //
// --------- End of File --------- //
// ------------------------------- //
|
/*
* Author£ºÍõµÂÃ÷
* Email£ºphight@163.com
* QQȺ£º220954528
*/
#pragma once
#include "Sink.h"
#include "MediaPacket.h"
#include "x264/x264.h"
#include "fdk-aac/aacenc_lib.h"
#define H264_PROFILE_HIGH 0
#define H264_PROFILE_MAIN 1
#define H264_PROFILE_LOW 2
#define AAC_PROFILE_LC 0
#define AAC_PROFILE_HE 1
#define AAC_PROFILE_HEV2 2
#define CODEC_STATUS_UNINIT 0
#define CODEC_STATUS_STOP 1
#define CODEC_STATUS_PAUSE 2
#define CODEC_STATUS_START 3
#define MAX_VIDEO_FRAME 5
#define MAX_VIDEO_PACKET 20
#define MAX_AUDIO_FRAME 5
#define MAX_AUDIO_PACKET 20
struct VideoCodecAttribute
{
int width;
int height;
int profile;
int fps;
int bitrate;
};
struct AudioCodecAttribute
{
int channel;
int samplerate;
int bitwide;
int profile;
int bitrate;
};
struct CodecStatistics {
uint32_t videoFrameCnt;
uint32_t videoPacketCnt;
uint32_t videoLostCnt;
uint32_t videoDecCnt;
double videoDecFps;
};
class Codec :
public Sink
{
public:
Codec();
~Codec();
public:
int SetSourceAttribute(void* attribute, AttributeType type);
int SendFrame(MediaFrame * frame);
int GetCodecStatistics(CodecStatistics* statistics);
int SetVideoCodecAttribute(VideoCodecAttribute* attribute);
int GetVideoCodecAttribute(const VideoCodecAttribute** attribute);
int SetAudioCodecAttribute(AudioCodecAttribute* attribute);
int GetAudioCodecAttribute(const AudioCodecAttribute** attribute);
int Start();
int Pause();
int Stop();
int GetVideoPacketCount();
int GetAudioPacketCount();
MediaPacket* GetVideoPacket();
MediaPacket* GetAudioPacket();
private:
HRESULT ChooseConversionFunction(AttributeType type, REFGUID subtype);
int InitCodec();
int UninitCodec();
int AllocMemory();
int FreeMemory();
x264_picture_t* PopVideoPicture();
void PushVideoPicture(x264_picture_t* pic);
MediaPacket* PopVideoPacket();
void PushVideoPacket(MediaPacket* packet);
MediaFrame* PopAudioFrame();
void PushAudioFrame(MediaFrame* frame);
MediaPacket* PopAudioPacket();
void PushAudioPacket(MediaPacket* packet);
int ConfigVideoCodec();
int ConfigAudioCodec();
static DWORD WINAPI VideoEncodecThread(LPVOID lpParam);
static DWORD WINAPI AudioEncodecThread(LPVOID lpParam);
private:
int m_Status = 0;
int m_QuitCmd = 0;
HANDLE m_videoThread = NULL;
HANDLE m_audioThread = NULL;
VideoCaptureAttribute m_videoSrcAttribute = { 0 };
AudioCaptureAttribute m_audioSrcAttribute = { 0 };
VideoCodecAttribute m_videoAttribute = { 0 };
AudioCodecAttribute m_audioAttribute = { 0 };
HANDLE_AACENCODER m_audioEncoder = NULL;
x264_t* m_videoEncoder = NULL;
IMAGE_TRANSFORM_FN m_videoConvertFn;
AUDIO_TRANSFORM_FN m_audioConvertFn;
CRITICAL_SECTION m_vfMtx;
CRITICAL_SECTION m_vpMtx;
CRITICAL_SECTION m_afMtx;
CRITICAL_SECTION m_apMtx;
queue<x264_picture_t *> videoFrameQueue;
queue<MediaPacket *> videoPacketQueue;
queue<MediaFrame *> audioFrameQueue;
queue<MediaPacket *> audioPacketQueue;
//Statistics
uint32_t m_videoLostCnt = 0;
uint32_t m_videoDecCnt = 0;
double m_videoDecFps = 0;
#if REC_CODEC_RAW
ofstream m_pcmfile;
ofstream m_yuvfile;
#endif
};
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_PUTDEDICATEDIPWARMUPATTRIBUTESREQUEST_H
#define QTAWS_PUTDEDICATEDIPWARMUPATTRIBUTESREQUEST_H
#include "sesv2request.h"
namespace QtAws {
namespace SESV2 {
class PutDedicatedIpWarmupAttributesRequestPrivate;
class QTAWSSESV2_EXPORT PutDedicatedIpWarmupAttributesRequest : public Sesv2Request {
public:
PutDedicatedIpWarmupAttributesRequest(const PutDedicatedIpWarmupAttributesRequest &other);
PutDedicatedIpWarmupAttributesRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(PutDedicatedIpWarmupAttributesRequest)
};
} // namespace SESV2
} // namespace QtAws
#endif
|
#include "lpkit.h"
#include <stdio.h>
int main(int argc, char *argv[])
{
lprec *lp;
if (argc != 1) {
printf("lp to mps file converter by Jeroen J. Dirks (jeroend@tor.numetrix.com)\n");
printf("Usage: lp2mps < inputfile.lp > outputfile.mps\n");
}
else {
fprintf(stderr,"reading lp file\n");
lp = read_lp_file(stdin, FALSE, "from_lp_file");
if (lp != NULL) {
fprintf(stderr,"writing mps file\n");
write_MPS(lp, stdout);
}
}
return(0);
}
|
/*
* Codepage functions
*
* Copyright (C) 2006-2021, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* 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 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 <https://www.gnu.org/licenses/>.
*/
#if !defined( _LIBEWF_INTERNAL_CODEPAGE_H )
#define _LIBEWF_INTERNAL_CODEPAGE_H
#include <common.h>
#include <types.h>
#if defined( __cplusplus )
extern "C" {
#endif
/* Define HAVE_LOCAL_LIBEWF for local use of libewf
* The definitions in <libewf/codepage.h> are copied here
* for local use of libewf
*/
#if !defined( HAVE_LOCAL_LIBEWF )
#include <libewf/codepage.h>
#else
/* The codepage definitions
*/
enum LIBEWF_CODEPAGES
{
LIBEWF_CODEPAGE_ASCII = 20127,
LIBEWF_CODEPAGE_ISO_8859_1 = 28591,
LIBEWF_CODEPAGE_ISO_8859_2 = 28592,
LIBEWF_CODEPAGE_ISO_8859_3 = 28593,
LIBEWF_CODEPAGE_ISO_8859_4 = 28594,
LIBEWF_CODEPAGE_ISO_8859_5 = 28595,
LIBEWF_CODEPAGE_ISO_8859_6 = 28596,
LIBEWF_CODEPAGE_ISO_8859_7 = 28597,
LIBEWF_CODEPAGE_ISO_8859_8 = 28598,
LIBEWF_CODEPAGE_ISO_8859_9 = 28599,
LIBEWF_CODEPAGE_ISO_8859_10 = 28600,
LIBEWF_CODEPAGE_ISO_8859_11 = 28601,
LIBEWF_CODEPAGE_ISO_8859_13 = 28603,
LIBEWF_CODEPAGE_ISO_8859_14 = 28604,
LIBEWF_CODEPAGE_ISO_8859_15 = 28605,
LIBEWF_CODEPAGE_ISO_8859_16 = 28606,
LIBEWF_CODEPAGE_KOI8_R = 20866,
LIBEWF_CODEPAGE_KOI8_U = 21866,
LIBEWF_CODEPAGE_WINDOWS_874 = 874,
LIBEWF_CODEPAGE_WINDOWS_932 = 932,
LIBEWF_CODEPAGE_WINDOWS_936 = 936,
LIBEWF_CODEPAGE_WINDOWS_949 = 949,
LIBEWF_CODEPAGE_WINDOWS_950 = 950,
LIBEWF_CODEPAGE_WINDOWS_1250 = 1250,
LIBEWF_CODEPAGE_WINDOWS_1251 = 1251,
LIBEWF_CODEPAGE_WINDOWS_1252 = 1252,
LIBEWF_CODEPAGE_WINDOWS_1253 = 1253,
LIBEWF_CODEPAGE_WINDOWS_1254 = 1254,
LIBEWF_CODEPAGE_WINDOWS_1255 = 1255,
LIBEWF_CODEPAGE_WINDOWS_1256 = 1256,
LIBEWF_CODEPAGE_WINDOWS_1257 = 1257,
LIBEWF_CODEPAGE_WINDOWS_1258 = 1258
};
#endif /* !defined( HAVE_LOCAL_LIBEWF ) */
#if defined( __cplusplus )
}
#endif
#endif /* !defined( _LIBEWF_INTERNAL_CODEPAGE_H ) */
|
// This module defines interface to the QsciStyle class.
//
// Copyright (c) 2012 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file. Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
//
// If you are unsure which license is appropriate for your use, please
// contact the sales department at sales@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#ifndef QSCISTYLE_H
#define QSCISTYLE_H
#ifdef __APPLE__
extern "C++" {
#endif
#include <qcolor.h>
#include <qfont.h>
#include <qstring.h>
#include <Qsci/qsciglobal.h>
class QsciScintillaBase;
//! \brief The QsciStyle class encapsulates all the attributes of a style.
//!
//! Each character of a document has an associated style which determines how
//! the character is displayed, e.g. its font and color. A style is identified
//! by a number. Lexers define styles for each of the language's features so
//! that they are displayed differently. Some style numbers have hard-coded
//! meanings, e.g. the style used for call tips.
class /*QSCINTILLA_EXPORT*/ QsciStyle
{
public:
//! This enum defines the different ways the displayed case of the text can
//! be changed.
enum TextCase {
//! The text is displayed as its original case.
OriginalCase = 0,
//! The text is displayed as upper case.
UpperCase = 1,
//! The text is displayed as lower case.
LowerCase = 2
};
//! Constructs a QsciStyle instance for style number \a style. If \a style
//! is negative then a new style number is automatically allocated.
QsciStyle(int style = -1);
//! Constructs a QsciStyle instance for style number \a style. If \a style
//! is negative then a new style number is automatically allocated. The
//! styles description, color, paper color, font and end-of-line fill are
//! set to \a description, \a color, \a paper, \a font and \a eolFill
//! respectively.
QsciStyle(int style, const QString &description, const QColor &color,
const QColor &paper, const QFont &font, bool eolFill = false);
//! \internal Apply the style to a particular editor.
void apply(QsciScintillaBase *sci) const;
//! Returns the number of the style.
int style() const {return style_nr;}
//! The style's description is set to \a description.
//!
//! \sa description()
void setDescription(const QString &description) {style_description = description;}
//! Returns the style's description.
//!
//! \sa setDescription()
QString description() const {return style_description;}
//! The style's foreground color is set to \a color. The default is taken
//! from the application's default palette.
//!
//! \sa color()
void setColor(const QColor &color);
//! Returns the style's foreground color.
//!
//! \sa setColor()
QColor color() const {return style_color;}
//! The style's background color is set to \a paper. The default is taken
//! from the application's default palette.
//!
//! \sa paper()
void setPaper(const QColor &paper);
//! Returns the style's background color.
//!
//! \sa setPaper()
QColor paper() const {return style_paper;}
//! The style's font is set to \a font. The default is the application's
//! default font.
//!
//! \sa font()
void setFont(const QFont &font);
//! Returns the style's font.
//!
//! \sa setFont()
QFont font() const {return style_font;}
//! The style's end-of-line fill is set to \a fill. The default is false.
//!
//! \sa eolFill()
void setEolFill(bool fill);
//! Returns the style's end-of-line fill.
//!
//! \sa setEolFill()
bool eolFill() const {return style_eol_fill;}
//! The style's text case is set to \a text_case. The default is
//! OriginalCase.
//!
//! \sa textCase()
void setTextCase(TextCase text_case);
//! Returns the style's text case.
//!
//! \sa setTextCase()
TextCase textCase() const {return style_case;}
//! The style's visibility is set to \a visible. The default is true.
//!
//! \sa visible()
void setVisible(bool visible);
//! Returns the style's visibility.
//!
//! \sa setVisible()
bool visible() const {return style_visible;}
//! The style's changeability is set to \a changeable. The default is
//! true.
//!
//! \sa changeable()
void setChangeable(bool changeable);
//! Returns the style's changeability.
//!
//! \sa setChangeable()
bool changeable() const {return style_changeable;}
//! The style's sensitivity to mouse clicks is set to \a hotspot. The
//! default is false.
//!
//! \sa hotspot()
void setHotspot(bool hotspot);
//! Returns the style's sensitivity to mouse clicks.
//!
//! \sa setHotspot()
bool hotspot() const {return style_hotspot;}
//! Refresh the style settings.
void refresh();
private:
int style_nr;
QString style_description;
QColor style_color;
QColor style_paper;
QFont style_font;
bool style_eol_fill;
TextCase style_case;
bool style_visible;
bool style_changeable;
bool style_hotspot;
void init(int style);
};
#ifdef __APPLE__
}
#endif
#endif
|
/**
* \file
* DynamicalItem class
* ----------------------------------------------------------------------------
* \date 2018
* \author Simon Rohou
* \copyright Copyright 2020 Simon Rohou
* \license This program is distributed under the terms of
* the GNU Lesser General Public License (LGPL).
*/
#ifndef __TUBEX_DYNAMICALITEM_H__
#define __TUBEX_DYNAMICALITEM_H__
#include "ibex_Interval.h"
#include "ibex_IntervalVector.h"
namespace tubex
{
/**
* \class DynamicalItem
* \brief Abstract class for common properties of Tube, TubeVector,
* Slice, Trajectory, TrajectoryVector objects
*/
class DynamicalItem
{
public:
/**
* \brief DynamicalItem destructor
*/
virtual ~DynamicalItem();
/**
* \brief Returns the dimension of the object
*
* \return n
*/
virtual int size() const = 0;
/**
* \brief Returns the temporal definition domain of this object
*
* \return an Interval object \f$[t_0,t_f]\f$
*/
virtual const ibex::Interval tdomain() const = 0;
/**
* \brief Returns the box of the feasible values along \f$[t_0,t_f]\f$
*
* \note Used for genericity purposes
*
* \return the envelope of codomain values
*/
virtual const ibex::IntervalVector codomain_box() const = 0;
/**
* \brief Returns the name of this class
*
* \note Only used for some generic display method
*
* \return the predefined name
*/
virtual const std::string class_name() const = 0;
/**
* \brief Verifies that this interval is a feasible tdomain
*
* \note The tdomain must be non-empty, bounded and not degenerated
* \todo Allow unbounded tdomains such as \f$[t_0,\infty]\f$?
*
* \param tdomain temporal domain \f$[t_0,t_f]\f$ to be tested
* \return true in case of valid temporal tdomain
*/
static bool valid_tdomain(const ibex::Interval& tdomain);
};
}
#endif |
// Created file "Lib\src\ADSIid\guid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(DBCOLUMN_DOMAINNAME, 0x0c733a81, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
|
/** \file
* \brief This class is a simple layout that places nodes next to each other
* and draws edges as bows above the nodes.
* The user may decide whether to use a custom permutation or use the ordering
* given by the nodes indices.
*
* \author Sebastian Semper
*
* \par License:
* This file is part of the Open Graph Drawing Framework (OGDF).
*
* \par
* Copyright (C)<br>
* See README.md in the OGDF root directory for details.
*
* \par
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* Version 2 or 3 as published by the Free Software Foundation;
* see the file LICENSE.txt included in the packaging of this file
* for details.
*
* \par
* 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.
*
* \par
* You should have received a copy of the GNU General Public
* License along with this program; if not, see
* http://www.gnu.org/copyleft/gpl.html
*/
#pragma once
#include <ogdf/basic/basic.h>
#include <ogdf/basic/Graph.h>
#include <ogdf/basic/GraphAttributes.h>
#include <ogdf/basic/geometry.h>
#include <ogdf/basic/LayoutModule.h>
#include <cmath>
#include <math.h>
#include <ogdf/basic/Math.h>
namespace ogdf {
/**
* %Layout the graph with nodes next to each other with natural or custom
* order and draw the edges as semicircular bows above them.
*/
class OGDF_EXPORT LinearLayout : public LayoutModule {
private:
//! If true a custom order stored in #m_nodeOrder will be used
bool m_customOrder;
//! Contains a custom ordering for putting the graphs next to each other
ListPure<node> m_nodeOrder;
double m_outWidth;
public:
/**
* Constructor that takes a desired width and a custom ordering
*
* @param w Width of the output
* @param o custom order
*/
LinearLayout(
double w,
ListPure<node> o
);
//! Constructor that uses a standard width and no custom order of the nodes
LinearLayout();
//! Standard destructor
virtual ~LinearLayout();
virtual void call(GraphAttributes& GA) override;
//! Interface function to toggle custom ordering
virtual void setCustomOrder(bool o);
};
}
|
/*******************************************************************************
* This file is part of PlexyDesk.
* Maintained by : Siraj Razick <siraj@kde.org>
* Authored By : Lahiru Lakmal Priyadarshana <llahiru@gmail.com>
*
* PlexyDesk 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.
*
* PlexyDesk 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 PlexyDesk. If not, see <http://www.gnu.org/licenses/lgpl.html>
*******************************************************************************/
#ifndef LPHOTOS_DATA_I
#define LPHOTOS_DATA_I
#include <QtCore>
#include <plexy.h>
#include <backdropinterface.h>
#include <abstractplugininterface.h>
#include <datainterface.h>
#include <dataplugin.h>
#include "localphotos.h"
class VISIBLE_SYM LPhotosInterface :public PlexyDesk::DataInterface
{
Q_OBJECT
Q_INTERFACES(PlexyDesk::AbstractPluginInterface)
public:
LPhotosInterface(QObject * object = 0);
virtual ~LPhotosInterface(){}
PlexyDesk::DataPlugin * instance();
};
#endif
|
/*
L - Linux library for easy writing of linux daemons in C++.
Copyright (C) 2012 Alexander Wenzel.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef L_TIME
#define L_TIME
#include "lstring.h"
/**********************************************************************/
// LTime
/**********************************************************************/
//! Manage the current time and provides time string.
/*!
Get the current time in seconds.
Get text string from time.
*/
class LTime {
public:
//! Default constructor.
/*!
Sets the object to the current time.
*/
LTime();
//! Constructo sets time in seconds.
/*!
\param seconds the seconds to be set.
*/
LTime(time_t seconds);
//! Copy constructor.
/*!
\param tim the existent time object to be copied.
*/
LTime(const LTime& tim);
//! Destructor
~LTime();
//! Copy operator.
/*!
\param tim copy another time object.
\return pointer to itself.
*/
LTime& operator=(const LTime& tim);
//! Set the time to current time.
/*!
\return pointer to itself.
*/
LTime& current();
//! Export time to string.
/*!
\param fmt the directory path to be copied.
\return The returned string.
*/
LString toString(const char* fmt = "%Y%m%d%H%M%S");
//! Get the seconds of the time.
/*!
\return the seconds.
*/
time_t getSeconds();
protected:
private:
time_t seconds;
};
#endif /* L_TIME */
// kate: indent-mode cstyle; indent-width 4; replace-tabs on;
|
#include "amos.h"
/* Copyright, Donald E. Amos: sandia national laboratories
* from slatec library or amos library.
*
* issued by sandia laboratories, a prime contractor to the
* united states department of energy
* notice:
* this report was prepared as an account of work sponsored by the
* united states government. neither the united states nor the
* united states department of energy, nor any of their
* employees, nor any of their contractors, subcontractors, or their
* employees, makes any warranty, express or implied, or assumes any
* legal liability or responsibility for the accuracy, completeness
* or usefulness of any information, apparatus, product or process
* disclosed, or represents that its use would not infringe
* privately owned rights.
*
*
* this code has been approved for unlimited release.
*/
/* Subroutine */ int
amos_fdump (void)
{
/****BEGIN PROLOGUE FDUMP
****DATE WRITTEN 790801 (YYMMDD)
****REVISION DATE 861211 (YYMMDD)
****CATEGORY NO. R3
****KEYWORDS LIBRARY=SLATEC(XERROR),TYPE=ALL(FDUMP-A),ERROR
****AUTHOR JONES, R. E., (SNLA)
****PURPOSE Symbolic dump (should be locally written).
****DESCRIPTION
*
* ***Note*** Machine Dependent Routine
* FDUMP is intended to be replaced by a locally written
* version which produces a symbolic dump. Failing this,
* it should be replaced by a version which prints the
* subprogram nesting list. Note that this dump must be
* printed on each of up to five files, as indicated by the
* XGETUA routine. See XSETUA and XGETUA for details.
*
* Written by Ron Jones, with SLATEC Common Math Library Subcommittee
****REFERENCES (NONE)
****ROUTINES CALLED (NONE)
****END PROLOGUE FDUMP
****FIRST EXECUTABLE STATEMENT FDUMP
*/
return 0;
} /* fdump_ */
|
#ifndef _APP_RESOURCE_ID_H_
#define _APP_RESOURCE_ID_H_
extern const wchar_t* IDC_BUTTON_CAL;
extern const wchar_t* IDC_BUTTON_RESET;
extern const wchar_t* IDC_FEATURE_COUNT;
extern const wchar_t* IDC_LABEL1;
extern const wchar_t* IDC_LABEL10;
extern const wchar_t* IDC_LABEL11;
extern const wchar_t* IDC_LABEL2;
extern const wchar_t* IDC_LABEL3;
extern const wchar_t* IDC_LABEL4;
extern const wchar_t* IDC_LABEL5;
extern const wchar_t* IDC_LABEL6;
extern const wchar_t* IDC_LABEL7;
extern const wchar_t* IDC_LABEL8;
extern const wchar_t* IDC_LABEL9;
extern const wchar_t* IDC_LABEL_CALIBRATION_RESULT;
extern const wchar_t* IDC_LABEL_CAL_M;
extern const wchar_t* IDC_LABEL_CAL_X;
extern const wchar_t* IDC_LABEL_CAL_Y;
extern const wchar_t* IDC_LABEL_CAL_Z;
extern const wchar_t* IDC_LABEL_FEATURE_COUNT;
extern const wchar_t* IDC_LABEL_PROGRESS;
extern const wchar_t* IDC_LABEL_RAWM;
extern const wchar_t* IDC_LABEL_RAWX;
extern const wchar_t* IDC_LABEL_RAWY;
extern const wchar_t* IDC_LABEL_RAWZ;
extern const wchar_t* IDC_LABEL_RAW_M;
extern const wchar_t* IDC_LABEL_RAW_X;
extern const wchar_t* IDC_LABEL_RAW_Y;
extern const wchar_t* IDC_LABEL_RAW_Z;
extern const wchar_t* IDC_LISTVIEW1;
extern const wchar_t* IDL_FORM;
extern const wchar_t* IDSCNT_MAIN_SCENE;
extern const wchar_t* IDC_BUTTON_OK;
#endif // _APP_RESOURCE_ID_H_
|
// Created file "Lib\src\ehstorguids\guids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WPD_MUSIC_OBJECT_PROPERTIES_V1, 0xb324f56a, 0xdc5d, 0x46e5, 0xb6, 0xdf, 0xd2, 0xea, 0x41, 0x48, 0x88, 0xc6);
|
// +-------------------------------------------------------------------------
// | rawMesh.h
// |
// | Author: Gilbert Bernstein
// +-------------------------------------------------------------------------
// | COPYRIGHT:
// | Copyright Gilbert Bernstein 2012
// | See the included COPYRIGHT file for further details.
// |
// | This file is part of the TopTop library.
// |
// | TopTop 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.
// |
// | TopTop 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 TopTop. If not, see <http://www.gnu.org/licenses/>.
// +-------------------------------------------------------------------------
#pragma once
#include "vec.h"
#include <vector>
// vertex and triangle data must satisfy the following minimal specifications!
// These exact field names must be used!
struct MinimalVertexData
{
Vec3d pos; // required for both RawMesh and Mesh
};
struct MinimalTriangleData
{
// Vertex Ids: (only used in raw mesh form)
int a, b, c;
};
// Raw mesh presents an exposed interface to a mesh.
// This allows for easy input/output of data to and from the more powerful
// Mesh data structure, as well as supporting more basic mesh applications
template<class VertData, class TriData>
struct RawMesh
{
std::vector<VertData> vertices;
std::vector<TriData> triangles;
};
// allow for data to move between different kinds of raw meshes
template<class VertDataOut, class TriDataOut,
class VertDataIn, class TriDataIn>
inline RawMesh<VertDataOut,TriDataOut> transduce(
const RawMesh<VertDataIn,TriDataIn> &input,
std::function<void(VertDataOut &, const VertDataIn &)> vertTransduce,
std::function<void(TriDataOut &, const TriDataIn &)> triTransduce
);
#include "rawMesh.tpp" |
/*
Copyright (C) 2007 <SWGEmu>
This File is part of Core3.
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 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, write to
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Linking Engine3 statically or dynamically with other modules
is making a combined work based on Engine3.
Thus, the terms and conditions of the GNU Lesser General Public License
cover the whole combination.
In addition, as a special exception, the copyright holders of Engine3
give you permission to combine Engine3 program with free software
programs or libraries that are released under the GNU LGPL and with
code included in the standard release of Core3 under the GNU LGPL
license (or modified versions of such code, with unchanged license).
You may copy and distribute such a system following the terms of the
GNU LGPL for Engine3 and the licenses of the other code concerned,
provided that you include the source code of that other code when
and as the GNU LGPL requires distribution of source code.
Note that people who make modified versions of Engine3 are not obligated
to grant this special exception for their modified versions;
it is their choice whether to do so. The GNU Lesser General Public License
gives permission to release a modified version without this exception;
this exception also makes it possible to release a modified version
which carries forward this exception.
*/
#ifndef STABILIZERSSLASHCOMMAND_H_
#define STABILIZERSSLASHCOMMAND_H_
#include "../../../scene/SceneObject.h"
class StabilizersSlashCommand : public SlashCommand {
public:
StabilizersSlashCommand(const String& name, ZoneProcessServerImplementation* server)
: SlashCommand(name, server) {
}
bool doSlashCommand(Player* player, Message* packet) {
return true;
}
};
#endif //STABILIZERSSLASHCOMMAND_H_
|
#ifndef MOVZXIRBUILDER_H
#define MOVZXIRBUILDER_H
#include "BaseIRBuilder.h"
#include "Inst.h"
#include "TwoOperandsTemplate.h"
class MovzxIRBuilder: public BaseIRBuilder, public TwoOperandsTemplate {
public:
MovzxIRBuilder(uint64 address, const std::string &disassembly);
// From BaseIRBuilder
virtual Inst *process(AnalysisProcessor &ap) const;
// From TwoOperandsTemplate
virtual void regImm(AnalysisProcessor &ap, Inst &inst) const;
virtual void regReg(AnalysisProcessor &ap, Inst &inst) const;
virtual void regMem(AnalysisProcessor &ap, Inst &inst) const;
virtual void memImm(AnalysisProcessor &ap, Inst &inst) const;
virtual void memReg(AnalysisProcessor &ap, Inst &inst) const;
};
#endif // MOVZXIRBUILDER_H
|
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation and
// any modifications thereto. Any use, reproduction, disclosure, or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA Corporation is strictly prohibited.
//
// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Information and code furnished is believed to be accurate and reliable.
// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
// information or for any infringement of patents or other rights of third parties that may
// result from its use. No license is granted by implication or otherwise under any patent
// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
// This code supersedes and replaces all information previously supplied.
// NVIDIA Corporation products are not authorized for use as critical
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
#ifndef GU_HEIGHTFIELD_DATA_H
#define GU_HEIGHTFIELD_DATA_H
#include "foundation/PxSimpleTypes.h"
#include "PxHeightFieldFlag.h"
#include "PxHeightFieldSample.h"
#include "GuCenterExtents.h"
namespace physx
{
namespace Gu
{
#if PX_VC
#pragma warning(push)
#pragma warning( disable : 4251 ) // class needs to have dll-interface to be used by clients of class
#endif
struct PX_PHYSX_COMMON_API HeightFieldData
{
// PX_SERIALIZATION
PX_FORCE_INLINE HeightFieldData() {}
PX_FORCE_INLINE HeightFieldData(const PxEMPTY) : flags(PxEmpty) {}
//~PX_SERIALIZATION
//properties
// PT: WARNING: bounds must be followed by at least 32bits of data for safe SIMD loading
CenterExtents mAABB;
PxU32 rows; // PT: WARNING: don't change this member's name (used in ConvX)
PxU32 columns; // PT: WARNING: don't change this member's name (used in ConvX)
PxReal rowLimit; // PT: to avoid runtime int-to-float conversions on Xbox
PxReal colLimit; // PT: to avoid runtime int-to-float conversions on Xbox
PxReal nbColumns; // PT: to avoid runtime int-to-float conversions on Xbox
PxHeightFieldSample* samples; // PT: WARNING: don't change this member's name (used in ConvX)
PxReal thickness;
PxReal convexEdgeThreshold;
PxHeightFieldFlags flags;
PxHeightFieldFormat::Enum format;
PX_FORCE_INLINE const CenterExtentsPadded& getPaddedBounds() const
{
// PT: see compile-time assert below
return static_cast<const CenterExtentsPadded&>(mAABB);
}
};
#if PX_VC
#pragma warning(pop)
#endif
// PT: 'getPaddedBounds()' is only safe if we make sure the bounds member is followed by at least 32bits of data
PX_COMPILE_TIME_ASSERT(PX_OFFSET_OF(Gu::HeightFieldData, rows)>=PX_OFFSET_OF(Gu::HeightFieldData, mAABB)+4);
} // namespace Gu
}
#endif
|
#ifndef PLANT_H
#define PLANT_H
#include <core/mjObject.h>
#include <ai/mjAutomaton.h>
#include <util/mjResourceManager.h>
#include "../Level.h"
#include "KosmoObject.h"
using namespace mjEngine;
class Plant : public KosmoObject, public mjAutomaton
{
public:
Plant(Level* levelData, mjResourceManager* resourceManager);
//BatBot(const BatBot& other);
~Plant();
virtual void ProcessPhysicsEffects(double t_elapsed) override;
protected:
private:
};
#endif // PLANT_H
|
#ifndef L3G_h
#define L3G_h
// register addresses
#define L3G_WHO_AM_I 0x0F
#define L3G_CTRL_REG1 0x20
#define L3G_CTRL_REG2 0x21
#define L3G_CTRL_REG3 0x22
#define L3G_CTRL_REG4 0x23
#define L3G_CTRL_REG5 0x24
#define L3G_REFERENCE 0x25
#define L3G_OUT_TEMP 0x26
#define L3G_STATUS_REG 0x27
#define L3G_OUT_X_L 0x28
#define L3G_OUT_X_H 0x29
#define L3G_OUT_Y_L 0x2A
#define L3G_OUT_Y_H 0x2B
#define L3G_OUT_Z_L 0x2C
#define L3G_OUT_Z_H 0x2D
#define L3G_FIFO_CTRL_REG 0x2E
#define L3G_FIFO_SRC_REG 0x2F
#define L3G_INT1_CFG 0x30
#define L3G_INT1_SRC 0x31
#define L3G_INT1_THS_XH 0x32
#define L3G_INT1_THS_XL 0x33
#define L3G_INT1_THS_YH 0x34
#define L3G_INT1_THS_YL 0x35
#define L3G_INT1_THS_ZH 0x36
#define L3G_INT1_THS_ZL 0x37
#define L3G_INT1_DURATION 0x38
class L3G {
public:
typedef struct vector {
float x, y, z;
} vector;
vector g; // gyro angular velocity readings
//
// bool init(byte device = L3G_DEVICE_AUTO, byte sa0 = L3G_SA0_AUTO);
//
void enableDefault(void);
void writeReg(char reg, char value);
char readReg(char reg);
void read(void);
short convertMsbLsb(char msb, char lsb);
//
// // vector functions
// static void vector_cross(const vector *a, const vector *b, vector *out);
// static float vector_dot(const vector *a,const vector *b);
// static void vector_normalize(vector *a);
private:
unsigned char address;
};
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws 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 QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_TAGRESOURCERESPONSE_H
#define QTAWS_TAGRESOURCERESPONSE_H
#include "eksresponse.h"
#include "tagresourcerequest.h"
namespace QtAws {
namespace EKS {
class TagResourceResponsePrivate;
class QTAWSEKS_EXPORT TagResourceResponse : public EksResponse {
Q_OBJECT
public:
TagResourceResponse(const TagResourceRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const TagResourceRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(TagResourceResponse)
Q_DISABLE_COPY(TagResourceResponse)
};
} // namespace EKS
} // namespace QtAws
#endif
|
// Created file "Lib\src\dxguid\X64\d3d9guid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(D3DAUTHENTICATEDQUERY_OUTPUTIDCOUNT, 0x2c042b5e, 0x8c07, 0x46d5, 0xaa, 0xbe, 0x8f, 0x75, 0xcb, 0xad, 0x4c, 0x31);
|
/*
* src/element.h
*
* Copyright (c) 2009 Technische Universität Berlin,
* Stranski-Laboratory for Physical und Theoretical Chemistry
*
* This file is part of libcfp.
*
* libcfp 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.
*
* libcfp 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 libcfp. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Author(s) of this file:
* Ingo Bressler (libcfp at ingobressler.net)
*/
#ifndef CFP_ELEMENT_H
#define CFP_ELEMENT_H
namespace cfp
{
/// Implementation data of a cfp::ChemicalElement.
struct ChemicalElementData
{
/// Default constructor with initialization.
ChemicalElementData()
: symbol(""),
nucleons(ChemicalElementInterface::naturalNucleonNr())
{}
std::string symbol; //!< symbol.
int nucleons; //!< Nucleon number (aka atomic mass number).
};
/// Implementation data of a cfp::CompoundElement.
struct CompoundElementData: public ChemicalElementData
{
/// Default constructor with initialization.
CompoundElementData()
: ChemicalElementData(),
coefficient(1.0)
{}
double coefficient; //!< Compound coefficient of this element.
};
/// Implementation data of a (internal) cfp::CompoundGroupElement.
struct CompoundGroupElementData: public CompoundElementData
{
/// Default constructor with initialization.
CompoundGroupElementData()
: CompoundElementData(),
isGroup(false)
{}
/// Decides if the coefficient is associated to a group rather
/// than to a single element.
bool isGroup;
};
/// Additional to the properties of a cfp::CompoundElement, this
/// owns a group property. It can be a regular cfp::CompoundElement.
/// But it may also be a dummy element which serves only the purpose to
/// store the coefficient value for a group of elements associated with
/// it (by a tree structure in cfp::ElementGroup). If this element
/// represents a group, its name and symbol are empty.
/// \note For internal use, only.
struct CompoundGroupElement: public CompoundElementInterface
{
public:
/// Default constructor.
/// \param[in] coefficient The compound coefficient of this element.
/// \param[in] isGroup True, if this element represents a group
/// of elements. False, otherwise.
CompoundGroupElement(double coefficient = 1.0, bool isGroup = false);
/// Copy constructor.
CompoundGroupElement(const CompoundGroupElement& cge);
~CompoundGroupElement(); //!< Destructor.
/// Identifies an CompoundElement as group descriptor.
/// \returns True, if this element represents a group of
/// elements. False, if it is a regular element.
bool
isGroup(void) const;
/// Copy operator all elements of this kind.
CompoundGroupElement&
operator=(const CompoundGroupElement& e);
private:
/// Specific implementation of ChemicalElementInterface::doSymbol.
virtual std::string
doSymbol(void) const;
/// Specific implementation of ChemicalElementInterface::doSetSymbol.
virtual void
doSetSymbol(const std::string& symbol);
/// Specific implementation of ChemicalElementInterface::doNucleons.
virtual int
doNucleons(void) const;
/// Specific implementation of ChemicalElementInterface::doSetNucleons.
virtual void
doSetNucleons(int i);
/// Specific implementation of ChemicalElementInterface::doCoefficient.
virtual double
doCoefficient(void) const;
/// Specific implementation of ChemicalElementInterface::doSetCoefficient.
virtual void
doSetCoefficient(double coefficient);
private:
CompoundGroupElementData * mD; //!< Implementation data.
};
}
#endif // this file
|
// Created file "Lib\src\MsXml2\X64\msxml2_i"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IDSOControl, 0x310afa62, 0x0575, 0x11d2, 0x9c, 0xa9, 0x00, 0x60, 0xb0, 0xec, 0x3d, 0x39);
|
#ifndef TEST_CALCULATOR_H
#define TEST_CALCULATOR_H
#include "function_calculator.h"
class TestCalculator : public Genetic::FunctionCalculator
{
public:
virtual void process(std::vector <Genetic::BaseIndividual*>& individuals);
};
#endif
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "QDate"
#include <QTimer>
#include <QSound>
#include <QMainWindow>
#include "jobalert.h"
#include "structures.h"
#include "adminpanel.h"
#include "adminlogin.h"
#include "socketclient.h"
#include "pickupwindow.h"
#include "newreservation.h"
#include "deliverywindow.h"
#include "reservationviewer.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void requestForUpdate();
void processData(QString);
private slots:
void on_newReservationBtn_clicked();
void on_editReservation_clicked();
void on_pickupRetrievedBtn_clicked();
void on_deliveredButton_clicked();
void on_viewDetailsButton_clicked();
void updateTimerTimeOut();
void checkToRunAlert();
void on_deliveriesTable_clicked(const QModelIndex &index);
void on_pickupsTable_clicked(const QModelIndex &index);
void on_actionAdmin_Panel_triggered();
void on_actionForce_Update_triggered();
void adminReturnAccess(bool);
void adminPanelCloseEvent();
private:
Ui::MainWindow *ui;
_dataStructs dataStructs;
socketClient socketConn;
QStringList reservationTableColumns,
pickupTableColumns;
QStringList donePickupAlerts, doneDeliveryAlerts;
int deliveryObjectToColor;
int pickupObjectToColor;
void setupMainScreen();
void commenceUpdateChain();
void purgePreviousRecords();
void populateReservations(QStringList);
void populatePickups(QStringList);
void populateLinks(QStringList);
void populateInventory(QStringList);
void populateSchedule(QStringList);
void populateRooms(QStringList);
void updateScreen();
bool updatingStructures;
bool showingLogin;
bool showingAdminPanel;
bool connectedToApi;
bool apiConnectedToServer;
QTimer updateTimer;
QTimer checkForNeedAlert;
};
#endif // MAINWINDOW_H
|
/*
* _hashtable.c
*
* Created on: 26 déc. 2013
* Author: Emmanuel
*/
#include <stdlib.h>
#include <string.h>
#include "shdata.h"
/**
* \fn NewHashtableElement
* \brief Create a new hashtable element and assign it to an existing hashtable.
*
* \inputs parent pointer to hashtable
* key key string (gives access to value)
* value_type
* value stored value
* next pointer to next hashtable elements (can be chosen NULL)
*
* \return pointer to SHHashtableElt
*/
SHHashtableElt* NewHashtableElement(SHHashtable* parent, char* key, SH_RAW_TYPE value_type, char* value, SHHashtableElt* next) {
SHHashtableElt* res = malloc(sizeof(SHHashtableElt));
// Create copy of key in memory
char* loc_key = malloc(sizeof(key)); strcpy(key, loc_key);
// Create copy of value in memory
char* loc_val = malloc(sizeof(value)); strcpy(value, loc_val);
// Assign fields
res->id = -1;
res->parent = parent;
res->key = &loc_key;
res->value_type = value_type;
res->value = &loc_val;
res->next = next;
return res;
}
/**
* \fn DestroyHashtableElement
* \brief Free memory of all allocated variables
*
* \inputs element pointer to hashtable element to destroy
*/
void DestroyHashtableElement(SHHashtableElt* element) {
free(element->key);
free(element->value);
free(element);
}
/**
* \fn NewHashtable
* \brief Create new hashtable
*
* \inputs name
* type
*
* \returns pointer to SHHashtable
*/
SHHashtable* NewHashtable(char* name) {
SHHashtable* res = malloc(sizeof(SHHashtable));
// Create copy of name in memory
char* loc_name = malloc(sizeof(name)); strcpy(name, loc_name);
// Assign fields
res->name = &loc_name;
res->first = NULL;
res->last = NULL;
res->nb_elts = 0;
return res;
}
/**
* \fn DestroyHashtable
* \brief Clear a given hashtable (and all subitems) from memory
*
* \inputs table pointer to hashtable to destroy
*/
void DestroyHashtable(SHHashtable* table) {
// Destroying hashtable elements
SHHashtableElt* current;
SHHashtableElt* next;
current = table->first;
while(current != NULL) {
next = current->next;
DestroyHashtableElement(current);
current = next;
}
// Destroying other fields and finally hashtable
free(table->name);
free(table);
}
/**
* \fn AppendHashtableElement
* \brief Appends an hashtable element to the end of an hashtable
*
* \inputs table pointer to hashtable to consider
* element pointer to element to append
*/
void AppendHashtableElement(SHHashtable* table, SHHashtableElt* element) {
if(table->nb_elts == 0) {
table->first = element;
table->last = element;
} else {
table->last->next = element;
table->last = element;
}
table->last->id = table->nb_elts;
table->last->next = NULL; // delete any unwanted link !
table->nb_elts += 1;
}
/**
* \fn GetHashtableElementByKey
* \brief Returns an hashtable element of an hashtable given its key.
*
* \inputs table pointer to given hashtable
* key pointer to expected key
* \returns pointer to SHHashtableElt, NULL if not found
*/
SHHashtableElt* GetHashtableElementByKey(SHHashtable* table, char* key) {
SHHashtableElt* current = table->first;
while((current != NULL) && !strcmp(key, *current->key))
current = current->next;
return current;
}
/**
* \fn GetHashtableElementIntValue
* \brief Get value when an integer one is awaited
*
* \inputs element pointer to hashtable element
* \return integer
*/
int GetHashtableElementIntValue(SHHashtableElt* element) {
switch(element->value_type) {
case STRING:
return -1;
break;
case INT:
return (int)&element->value; // TODO : corriger --> char* to int !!
break;
default:
return -1;
}
}
/**
* \fn GetHashtableElementStringValue
* \brief Get value when an integer one is awaited
*
* \inputs element pointer to hashtable element
* \return pointer to array of char (string)
*/
char* GetHashtableElementStringValue(SHHashtableElt* element) {
switch(element->value_type) {
case STRING:
return (char*)&element->value;
break;
case INT:
return "";
break;
default:
return "";
}
}
|
#ifndef BST_H
#define BST_H
typedef struct node node;
struct node {
int key;
node *left, *right;
};
typedef enum b_type b_type;
enum b_type {
PREORDER,
INORDER,
POSTORDER
};
void add(node **, int);
void browse(node *, b_type);
node *search(node *, int);
void delete(node **, int);
#endif
|
// ZGUI_Sprite.h: interface for the ZGUI_Sprite class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ZGUI_SPRITE_H__112F0537_0410_4F3C_A75E_C0D9B3B7FDF4__INCLUDED_)
#define AFX_ZGUI_SPRITE_H__112F0537_0410_4F3C_A75E_C0D9B3B7FDF4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ZGUI_Bitmap.h"
#include "ZGUI_TXRect.h"
class ZGUI_Sprite : public ZGUI_Bitmap
{
public:
ZGUI_TXRect m_sprites[64]; // up to 32 sprites per sprite node
int current_sprite;
public:
short int HeightOf(int sprite);
short int WidthOf(int sprite);
void Render();
void Render(int sprite);
void RenderAt(int x, int y, int sprite);
void RenderAug(int sprite, ZGUI_TXRect * src, ZGUI_TXRect * dest);
void LoadDef(char *filename);
ZGUI_Sprite();
virtual ~ZGUI_Sprite();
};
#endif // !defined(AFX_ZGUI_SPRITE_H__112F0537_0410_4F3C_A75E_C0D9B3B7FDF4__INCLUDED_)
|
//
// ViewController.h
// Capture
//
// Created by Peyton Randolph on 8/8/15.
// Copyright © 2015 peytn. All rights reserved.
//
@import UIKit;
@interface CaptureViewController : UIViewController
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.