text stringlengths 4 6.14k |
|---|
/* $Id: l3_1tr6.h,v 1.1.1.1 2004/09/28 06:06:09 sure Exp $
*
* German 1TR6 D-channel protocol defines
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*/
#ifndef l3_1tr6
#define l3_1tr6
#define PROTO_DIS_N0 0x40
#define PROTO_DIS_N1 0x41
/*
* MsgType N0
*/
#define MT_N0_REG_IND 0x61
#define MT_N0_CANC_IND 0x62
#define MT_N0_FAC_STA 0x63
#define MT_N0_STA_ACK 0x64
#define MT_N0_STA_REJ 0x65
#define MT_N0_FAC_INF 0x66
#define MT_N0_INF_ACK 0x67
#define MT_N0_INF_REJ 0x68
#define MT_N0_CLOSE 0x75
#define MT_N0_CLO_ACK 0x77
/*
* MsgType N1
*/
#define MT_N1_ESC 0x00
#define MT_N1_ALERT 0x01
#define MT_N1_CALL_SENT 0x02
#define MT_N1_CONN 0x07
#define MT_N1_CONN_ACK 0x0F
#define MT_N1_SETUP 0x05
#define MT_N1_SETUP_ACK 0x0D
#define MT_N1_RES 0x26
#define MT_N1_RES_ACK 0x2E
#define MT_N1_RES_REJ 0x22
#define MT_N1_SUSP 0x25
#define MT_N1_SUSP_ACK 0x2D
#define MT_N1_SUSP_REJ 0x21
#define MT_N1_USER_INFO 0x20
#define MT_N1_DET 0x40
#define MT_N1_DISC 0x45
#define MT_N1_REL 0x4D
#define MT_N1_REL_ACK 0x5A
#define MT_N1_CANC_ACK 0x6E
#define MT_N1_CANC_REJ 0x67
#define MT_N1_CON_CON 0x69
#define MT_N1_FAC 0x60
#define MT_N1_FAC_ACK 0x68
#define MT_N1_FAC_CAN 0x66
#define MT_N1_FAC_REG 0x64
#define MT_N1_FAC_REJ 0x65
#define MT_N1_INFO 0x6D
#define MT_N1_REG_ACK 0x6C
#define MT_N1_REG_REJ 0x6F
#define MT_N1_STAT 0x63
#define MT_N1_INVALID 0
/*
* W Elemente
*/
#define WE_Shift_F0 0x90
#define WE_Shift_F6 0x96
#define WE_Shift_OF0 0x98
#define WE_Shift_OF6 0x9E
#define WE0_cause 0x08
#define WE0_connAddr 0x0C
#define WE0_callID 0x10
#define WE0_chanID 0x18
#define WE0_netSpecFac 0x20
#define WE0_display 0x28
#define WE0_keypad 0x2C
#define WE0_origAddr 0x6C
#define WE0_destAddr 0x70
#define WE0_userInfo 0x7E
#define WE0_moreData 0xA0
#define WE0_congestLevel 0xB0
#define WE6_serviceInd 0x01
#define WE6_chargingInfo 0x02
#define WE6_date 0x03
#define WE6_facSelect 0x05
#define WE6_facStatus 0x06
#define WE6_statusCalled 0x07
#define WE6_addTransAttr 0x08
/*
* FacCodes
*/
#define FAC_Sperre 0x01
#define FAC_Sperre_All 0x02
#define FAC_Sperre_Fern 0x03
#define FAC_Sperre_Intl 0x04
#define FAC_Sperre_Interk 0x05
#define FAC_Forward1 0x02
#define FAC_Forward2 0x03
#define FAC_Konferenz 0x06
#define FAC_GrabBchan 0x0F
#define FAC_Reactivate 0x10
#define FAC_Konferenz3 0x11
#define FAC_Dienstwechsel1 0x12
#define FAC_Dienstwechsel2 0x13
#define FAC_NummernIdent 0x14
#define FAC_GBG 0x15
#define FAC_DisplayUebergeben 0x17
#define FAC_DisplayUmgeleitet 0x1A
#define FAC_Unterdruecke 0x1B
#define FAC_Deactivate 0x1E
#define FAC_Activate 0x1D
#define FAC_SPV 0x1F
#define FAC_Rueckwechsel 0x23
#define FAC_Umleitung 0x24
/*
* Cause codes
*/
#define CAUSE_InvCRef 0x01
#define CAUSE_BearerNotImpl 0x03
#define CAUSE_CIDunknown 0x07
#define CAUSE_CIDinUse 0x08
#define CAUSE_NoChans 0x0A
#define CAUSE_FacNotImpl 0x10
#define CAUSE_FacNotSubscr 0x11
#define CAUSE_OutgoingBarred 0x20
#define CAUSE_UserAccessBusy 0x21
#define CAUSE_NegativeGBG 0x22
#define CAUSE_UnknownGBG 0x23
#define CAUSE_NoSPVknown 0x25
#define CAUSE_DestNotObtain 0x35
#define CAUSE_NumberChanged 0x38
#define CAUSE_OutOfOrder 0x39
#define CAUSE_NoUserResponse 0x3A
#define CAUSE_UserBusy 0x3B
#define CAUSE_IncomingBarred 0x3D
#define CAUSE_CallRejected 0x3E
#define CAUSE_NetworkCongestion 0x59
#define CAUSE_RemoteUser 0x5A
#define CAUSE_LocalProcErr 0x70
#define CAUSE_RemoteProcErr 0x71
#define CAUSE_RemoteUserSuspend 0x72
#define CAUSE_RemoteUserResumed 0x73
#define CAUSE_UserInfoDiscarded 0x7F
#define T303 4000
#define T304 20000
#define T305 4000
#define T308 4000
#define T310 120000
#define T313 4000
#define T318 4000
#define T319 4000
#endif
|
/*
* TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid
* Copyright (C) 2007 C2ME S.A. <tuxdroid@c2me.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Id: parser.h 1304 2008-07-02 15:08:50Z jaguarondi $ */
#ifndef PARSER_H
#define PARSER_H
#include <stdbool.h>
bool parse_cmd(uint8_t *cmd);
#endif /* PARSER_H */
|
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 96
#define __RELEASE_NUM 1
#define __BUILD_NUM 4
#include <stdver.h>
#define __DESCRIPTION "Internet Relay Chat (IRC) protocol support for Miranda NG."
#define __AUTHOR "Miranda team"
#define __COPYRIGHT "© 2003-22 Jurgen Persson, George Hazan"
#define __AUTHORWEB "https://miranda-ng.org/p/IRC/"
#define __PLUGIN_NAME "IRC protocol"
#define __FILENAME "IRC.dll"
|
#include "ythtbbs.h"
const char *const permstrings[] = {
"»ù±¾È¨Á¦", /* PERM_BASIC */
"½øÈëÁÄÌìÊÒ", /* PERM_CHAT */
"ºô½ÐËûÈËÁÄÌì", /* PERM_PAGE */
"·¢±íÎÄÕÂ", /* PERM_POST */
"ʹÓÃÕß×ÊÁÏÕýÈ·", /* PERM_LOGINOK */
"½ûֹʹÓÃÇ©Ãûµµ", /* PERM_DENYSIG */
"ÒþÉíÊõ", /* PERM_CLOAK */
"¿´´©ÒþÉíÊõ", /* PERM_SEECLOAK */
"ÕʺÅÓÀ¾Ã±£Áô", /* PERM_XEMPT */
"±à¼½øÕ¾»Ãæ", /* PERM_WELCOME */
"°åÖ÷", /* PERM_BOARDS */
"ÕʺŹÜÀíÔ±", /* PERM_ACCOUNTS */
"±¾Õ¾ÖÙ²Ã", /* PERM_ARBITRATE */
"ͶƱ¹ÜÀíÔ±", /* PERM_OVOTE */
"ϵͳά»¤¹ÜÀíÔ±", /* PERM_SYSOP */
"Read/Post ÏÞÖÆ", /* PERM_POSTMASK */
"¾«»ªÇø×ܹÜ", /* PERM_ANNOUNCE */
"ÌÖÂÛÇø×ܹÜ", /* PERM_OBOARDS */
"»î¶¯¿´°æ×ܹÜ", /* PERM_ACBOARD */
"²»ÄÜ ZAP(ÌÖÂÛÇø×¨ÓÃ)", /* PERM_NOZAP */
"Ç¿ÖÆºô½Ð", /* PERM_FORCEPAGE */
"ÑÓ³¤·¢´ôʱ¼ä", /* PERM_EXT_IDLE */
"´óÐÅÏä", /* PERM_SPECIAL1 */
"ÌØÊâȨÏÞ 2", /* PERM_SPECIAL2 */
"ÌØÊâȨÏÞ 3", /* PERM_SPECIAL3 */
"Çø³¤", /* PERM_SPECIAL4 */
"±¾Õ¾¼à²ì×é", /* PERM_SPECIAL5 */
"±¾Õ¾Á¢·¨»á", /* PERM_SPECIAL6 */
"ÌØÊâȨÏÞ 7", /* PERM_SPECIAL7 */
"¸öÈËÎļ¯", /* PERM_SPECIAL8 */
"½ûÖ¹·¢ÐÅȨ", /* PERM_DENYMAIL */
};
const char *const user_definestr[NUMDEFINES] = {
"ºô½ÐÆ÷¹Ø±Õʱ¿ÉÈúÃÓѺô½Ð", /* DEF_FRIENDCALL */
"½ÓÊÜËùÓÐÈ˵ÄѶϢ", /* DEF_ALLMSG */
"½ÓÊܺÃÓѵÄѶϢ", /* DEF_FRIENDMSG */
"ÊÕµ½Ñ¶Ï¢·¢³öÉùÒô", /* DEF_SOUNDMSG */
"ʹÓòÊÉ«", /* DEF_COLOR */
"ÏÔʾ»î¶¯¿´°æ", /* DEF_ACBOARD */
"ÏÔʾѡµ¥µÄѶϢÀ¸", /* DEF_ENDLINE */
"±à¼Ê±ÏÔʾ״̬À¸", /* DEF_EDITMSG */
"ѶϢÀ¸²ÉÓÃÒ»°ã/¾«¼òģʽ", /* DEF_NOTMSGFRIEND */
"Ñ¡µ¥²ÉÓÃÒ»°ã/¾«¼òģʽ", /* DEF_NORMALSCR */
"·ÖÀàÌÖÂÛÇøÒÔ New ÏÔʾ", /* DEF_NEWPOST */
"ÔĶÁÎÄÕÂÊÇ·ñʹÓÃÈÆ¾íÑ¡Ôñ", /* DEF_CIRCLE */
"ÔĶÁÎÄÕÂÓαêÍ£ÓÚµÚһƪδ¶Á", /* DEF_FIRSTNEW */
"½øÕ¾Ê±ÏÔʾºÃÓÑÃûµ¥", /* DEF_LOGFRIEND */
"½øÕ¾Ê±ÏÔʾ±¸Íü¼", /* DEF_INNOTE */
"ÀëվʱÏÔʾ±¸Íü¼", /* DEF_OUTNOTE */
"ÀëվʱѯÎʼĻØËùÓÐѶϢ", /* DEF_MAILMSG */
"ʹÓÃ×Ô¼ºµÄÀëÕ¾»Ãæ", /* DEF_LOGOUT */
"ÎÒÊÇÕâ¸ö×éÖ¯µÄ³ÉÔ±", /* DEF_SEEWELC1 */
"ºÃÓÑÉÏվ֪ͨ", /* DEF_LOGINFROM */
"¹Û¿´ÁôÑÔ°æ", /* DEF_NOTEPAD */
"²»ÒªËͳöÉÏվ֪ͨ¸øºÃÓÑ", /* DEF_NOLOGINSEND */
"Ö÷Ìâʽ¿´°æ", /* DEF_THESIS */
"ÊÕµ½Ñ¶Ï¢µÈºò»ØÓ¦»òÇå³ý", /* DEF_MSGGETKEY */
"ºº×ÖÕû×Ö´¦Àí", /* DEF_DELDBLCHAR */
"ʹÓÃGBÂëÔĶÁ", /* DEF_USEGB KCN 99.09.03 */
"ʹÓö¯Ì¬µ×Ïß", /* DEF_ANIENDLINE */
"³õ´Î·ÃÎʰæÃæÌáʾ½øÈ뾫»ªÇø", /* DEF_INTOANN */
"·¢±íÎÄÕÂʱÔÝʱÆÁ±ÎMSG", /* DEF_POSTNOMSG */
"½øÕ¾Ê±¹Û¿´Í³¼ÆÐÅÏ¢", /* DEF_SEESTATINLOG */
"¹ýÂË¿ÉÄÜÁîÈË·´¸ÐÐÅÏ¢", /* DEF_FILTERXXX */
"ÊÕȡվÍâÐżþ" /* DEF_INTERNETMAIL */
};
|
/* This file is part of Evoral.
* Copyright(C) 2008 Dave Robillard <http://drobilla.net>
* Copyright(C) 2000-2008 Paul Davis
*
* Evoral 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.
*
* Evoral 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 details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef EVORAL_MIDI_UTIL_H
#define EVORAL_MIDI_UTIL_H
#include <evoral/midi_events.h>
namespace Evoral {
/** Return the size of the given event NOT including the status byte,
* or -1 if unknown (eg sysex)
*/
static inline int
midi_event_size(unsigned char status)
{
// if we have a channel event
if (status >= 0x80 && status < 0xF0) {
status &= 0xF0; // mask off the channel
}
switch (status) {
case MIDI_CMD_NOTE_OFF:
case MIDI_CMD_NOTE_ON:
case MIDI_CMD_NOTE_PRESSURE:
case MIDI_CMD_CONTROL:
case MIDI_CMD_BENDER:
case MIDI_CMD_COMMON_SONG_POS:
return 2;
case MIDI_CMD_PGM_CHANGE:
case MIDI_CMD_CHANNEL_PRESSURE:
case MIDI_CMD_COMMON_MTC_QUARTER:
case MIDI_CMD_COMMON_SONG_SELECT:
return 1;
case MIDI_CMD_COMMON_TUNE_REQUEST:
case MIDI_CMD_COMMON_SYSEX_END:
case MIDI_CMD_COMMON_CLOCK:
case MIDI_CMD_COMMON_START:
case MIDI_CMD_COMMON_CONTINUE:
case MIDI_CMD_COMMON_STOP:
case MIDI_CMD_COMMON_SENSING:
case MIDI_CMD_COMMON_RESET:
return 0;
case MIDI_CMD_COMMON_SYSEX:
return -1;
}
return -1;
}
} // namespace Evoral
#endif // EVORAL_MIDI_UTIL_H
|
/*
* khexedit - Versatile hex editor
* Copyright (C) 1999 Espen Sand, espensa@online.no
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef _BITSWAP_WIDGET_H_
#define _BITSWAP_WIDGET_H_
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqstring.h>
class CDigitLabel : public TQLabel
{
Q_OBJECT
public:
CDigitLabel( TQWidget *parent, uint digit = 0, const char *name=0 );
~CDigitLabel( void );
virtual TQSize sizeHint() const;
inline uint value( void );
signals:
void stepCell( const TQObject *obj, bool next );
void valueChanged( const TQObject *obj, uint newVal, bool after );
public slots:
void setValue( uint digit, bool notify );
void setDotPosition( uint dotPosition );
protected:
void paletteChange( const TQPalette & );
void drawContents( TQPainter * );
virtual void keyPressEvent( TQKeyEvent *e );
private:
void initialize( void );
private:
uint mDigit;
uint mDotPosition;
};
inline uint CDigitLabel::value( void )
{
return( mDigit );
}
class CByteWidget : public TQWidget
{
Q_OBJECT
public:
CByteWidget( TQWidget *parent, const char *name=0 );
~CByteWidget( void );
bool flag( TQByteArray &buf );
public slots:
void reset( void );
private slots:
void stepCell( const TQObject *obj, bool next );
void valueChanged( const TQObject *obj, uint newVal, bool after );
private:
void setBuddy( const TQObject *obj );
private:
TQHBoxLayout *mHBox;
CDigitLabel *mDigit[8];
};
#endif
|
#ifndef __SOUND_FSI_H
#define __SOUND_FSI_H
/*
* Fifo-attached Serial Interface (FSI) support for SH7724
*
* Copyright (C) 2009 Renesas Solutions Corp.
* Kuninori Morimoto <morimoto.kuninori@renesas.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#define FSI_PORT_A 0
#define FSI_PORT_B 1
#include <linux/clk.h>
#include <sound/soc.h>
/*
* flags format
*
* 0x000000BA
*
* A: inversion
* B: format mode
*/
/* A: clock inversion */
#define SH_FSI_INVERSION_MASK 0x0000000F
#define SH_FSI_LRM_INV (1 << 0)
#define SH_FSI_BRM_INV (1 << 1)
#define SH_FSI_LRS_INV (1 << 2)
#define SH_FSI_BRS_INV (1 << 3)
/* B: format mode */
#define SH_FSI_FMT_MASK 0x000000F0
#define SH_FSI_FMT_DAI (0 << 4)
#define SH_FSI_FMT_SPDIF (1 << 4)
/*
* set_rate return value
*
* see ACKMD/BPFMD on
* ACK_MD (FSI2)
* CKG1 (FSI)
*
* err : return value < 0
* no change : return value == 0
* change xMD : return value > 0
*
* 0x-00000AB
*
* A: ACKMD value
* B: BPFMD value
*/
#define SH_FSI_ACKMD_MASK (0xF << 0)
#define SH_FSI_ACKMD_512 (1 << 0)
#define SH_FSI_ACKMD_256 (2 << 0)
#define SH_FSI_ACKMD_128 (3 << 0)
#define SH_FSI_ACKMD_64 (4 << 0)
#define SH_FSI_ACKMD_32 (5 << 0)
#define SH_FSI_BPFMD_MASK (0xF << 4)
#define SH_FSI_BPFMD_512 (1 << 4)
#define SH_FSI_BPFMD_256 (2 << 4)
#define SH_FSI_BPFMD_128 (3 << 4)
#define SH_FSI_BPFMD_64 (4 << 4)
#define SH_FSI_BPFMD_32 (5 << 4)
#define SH_FSI_BPFMD_16 (6 << 4)
struct sh_fsi_port_info {
unsigned long flags;
int tx_id;
int rx_id;
int (*set_rate)(struct device *dev, int rate, int enable);
};
struct sh_fsi_platform_info {
struct sh_fsi_port_info port_a;
struct sh_fsi_port_info port_b;
};
/*
* for fsi-ak4642
*/
struct fsi_ak4642_info {
const char *name;
const char *card;
const char *cpu_dai;
const char *codec;
const char *platform;
int id;
};
#endif /* __SOUND_FSI_H */
|
#ifndef TRADEAMOUNT_H
#define TRADEAMOUNT_H
#include <TaoApiCpp/TaoDomain.h>
#include <QDateTime>
#include <QList>
#include <QString>
#include <TaoApiCpp/domain/OrderAmount.h>
#include <TaoApiCpp/domain/PromotionDetail.h>
/**
* @brief 交易订单的帐务信息详情
*
* @author sd44 <sd44sdd44@yeah.net>
*/
class TradeAmount : public TaoDomain
{
public:
virtual ~TradeAmount() { }
QString getAlipayNo() const;
void setAlipayNo (QString alipayNo);
QString getBuyerCodFee() const;
void setBuyerCodFee (QString buyerCodFee);
qlonglong getBuyerObtainPointFee() const;
void setBuyerObtainPointFee (qlonglong buyerObtainPointFee);
QString getCodFee() const;
void setCodFee (QString codFee);
QString getCommissionFee() const;
void setCommissionFee (QString commissionFee);
QDateTime getCreated() const;
void setCreated (QDateTime created);
QDateTime getEndTime() const;
void setEndTime (QDateTime endTime);
QString getExpressAgencyFee() const;
void setExpressAgencyFee (QString expressAgencyFee);
QList<OrderAmount> getOrderAmounts() const;
void setOrderAmounts (QList<OrderAmount> orderAmounts);
QDateTime getPayTime() const;
void setPayTime (QDateTime payTime);
QString getPayment() const;
void setPayment (QString payment);
QString getPostFee() const;
void setPostFee (QString postFee);
QList<PromotionDetail> getPromotionDetails() const;
void setPromotionDetails (QList<PromotionDetail> promotionDetails);
QString getSellerCodFee() const;
void setSellerCodFee (QString sellerCodFee);
qlonglong getTid() const;
void setTid (qlonglong tid);
QString getTotalFee() const;
void setTotalFee (QString totalFee);
virtual void parseResponse();
private:
/**
* @brief 支付宝交易号,如:2009112081173831
**/
QString alipayNo;
/**
* @brief 买家货到付款服务费。精确到2位小数;单位:元。如:12.07,表示:12元7分
**/
QString buyerCodFee;
/**
* @brief 买家获得积分,返点的积分。格式:100;单位:个
**/
qlonglong buyerObtainPointFee;
/**
* @brief 货到付款服务费。精确到2位小数;单位:元。如:12.07,表示:12元7分
**/
QString codFee;
/**
* @brief 交易佣金。精确到2位小数;单位:元。如:200.07,表示:200元7分
**/
QString commissionFee;
/**
* @brief 交易创建时间
**/
QDateTime created;
/**
* @brief 交易成功时间(更新交易状态为成功的同时更新)/确认收货时间。格式:yyyy-MM-dd HH:mm:ss
**/
QDateTime endTime;
/**
* @brief 快递代收款。精确到2位小数;单位:元。如:212.07,表示:212元7分
**/
QString expressAgencyFee;
/**
* @brief 子订单的帐务金额详情列表
**/
QList<OrderAmount> orderAmounts;
/**
* @brief 付款时间。格式:yyyy-MM-dd HH:mm:ss
**/
QDateTime payTime;
/**
* @brief 主订单实付金额。精确到2位小数;单位:元。如:200.07,表示:200元7分,计算公式如下:
如果主订单只有一笔子订单 payment = 子订单的实付金额 + 货到付款服务费(如果是货到付款订单) - 主订单的系统级优惠;如果主订单有多笔子订单 payment = 各子订单的实付金额之和 + 货到付款服务费(如果是货到付款订单) + 邮费 - 主订单的系统级优惠
**/
QString payment;
/**
* @brief 邮费。精确到2位小数;单位:元。如:200.07,表示:200元7分。目前只提供整笔交易的邮费,暂不提供各子订单的邮费
**/
QString postFee;
/**
* @brief 主交易订单的系统级优惠详情
**/
QList<PromotionDetail> promotionDetails;
/**
* @brief 卖家货到付款服务费。精确到2位小数;单位:元。如:12.07,表示:12元7分
**/
QString sellerCodFee;
/**
* @brief 交易主订单编号
**/
qlonglong tid;
/**
* @brief 主订单的商品金额(各子订单中商品price * num的和,不包括任何优惠信息)。精确到2位小数;单位:元。如:200.07,表示:200元7分
**/
QString totalFee;
};
#endif /* TRADEAMOUNT_H */
|
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <FBShimmeringView.h> |
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include "teek_client_api.h"
#define TEE_SERVICE_MDPP \
{ \
0x41d21d0f, \
0x9757, \
0x41f1, \
{ \
0x87, 0x06, 0xb3, 0xba, 0xa3, 0x5f, 0xe8, 0x2f \
} \
}
enum SERVICE_MDPP_CMD {
MDPP_CMD_GET_RANDOM,
MDPP_CMD_WRAP_KEY,
MDPP_CMD_CC_ENTROPY_TEST = 0xf0,
};
struct tee_random_data {
TEEC_Session session;
};
static TEEC_Context mdpp_ctx;
static int init_mdpp_context(TEEC_Context *ctx)
{
TEEC_Result ret;
ret = TEEK_InitializeContext(NULL, ctx);
if (ret != TEEC_SUCCESS) {
pr_err("init mdpp context failed, ret=0x%x\n", ret);
return -EBUSY;
}
return 0;
}
static void destroy_mdpp_context(TEEC_Context *ctx)
{
TEEK_FinalizeContext(ctx);
}
static int open_tee_random_session(TEEC_Session *session)
{
TEEC_UUID mdpp_uuid = TEE_SERVICE_MDPP;
int ret = TEEC_ERROR_GENERIC;
TEEC_Operation operation = {0};
u8 package_name[] = "tee_random";
u32 root_id = 0;
operation.started = 1;
operation.cancel_flag = 0;
operation.paramTypes = TEEC_PARAM_TYPES(
TEEC_NONE,
TEEC_NONE,
TEEC_MEMREF_TEMP_INPUT,
TEEC_MEMREF_TEMP_INPUT);
operation.params[2].tmpref.buffer = (void *)(&root_id);
operation.params[2].tmpref.size = sizeof(root_id);
operation.params[3].tmpref.buffer = (void *)(package_name);
operation.params[3].tmpref.size = strlen(package_name) + 1;
ret = TEEK_OpenSession(
&mdpp_ctx,
session,
&mdpp_uuid,
TEEC_LOGIN_IDENTIFY,
NULL,
&operation,
NULL);
if (ret != TEEC_SUCCESS) {
pr_err("open mdpp session failed, ret=0x%x\n", ret);
return -EBUSY;
}
return 0;
}
static int tee_random_open(struct inode *inode, struct file *file)
{
struct tee_random_data *data;
data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
if (open_tee_random_session(&data->session)) {
kfree(data);
return -EBUSY;
}
file->private_data = data;
return 0;
}
static int tee_random_close(struct inode *inode, struct file *file)
{
struct tee_random_data *data = file->private_data;
TEEK_CloseSession(&data->session);
kfree(data);
return 0;
}
static int __get_tee_random_bytes(TEEC_Session *session, void *buf,
int nbytes, int from_user)
{
TEEC_Operation operation;
TEEC_Result ret;
ssize_t count = 0, ret_val = 0, n;
char *random_buffer;
size_t random_len;
uint32_t cmd_id;
if (!buf || nbytes == 0)
return 0;
random_len = nbytes > 4096 ? 4096 : nbytes;
random_buffer = kmalloc(random_len, GFP_KERNEL);
if (!random_buffer) {
pr_err("alloc random buffer failed\n");
return -ENOMEM;
}
operation.started = 1;
operation.cancel_flag = 0;
operation.paramTypes = TEEC_PARAM_TYPES(
TEEC_MEMREF_TEMP_OUTPUT,
TEEC_NONE,
TEEC_NONE,
TEEC_NONE);
operation.params[0].tmpref.buffer = (void *)random_buffer;
cmd_id = MDPP_CMD_GET_RANDOM;
n = nbytes;
while (n) {
random_len = n > 4096 ? 4096 : n;
operation.params[0].tmpref.size = random_len;
ret = TEEK_InvokeCommand(
session,
cmd_id,
&operation,
NULL);
if (ret != TEEC_SUCCESS) {
pr_err("invoke tee random failed, ret=0x%x\n", ret);
ret_val = -EBUSY;
break;
}
#if 0
int i;
pr_debug("tee random(len=%d):\n", count);
for (i = 0; i < count; i++) {
if (i && i%16 == 0)
pr_debug("\n");
pr_debug("0x%02x ", random_buffer[i]);
}
pr_debug("\n");
#endif
if (from_user) {
if (copy_to_user(buf+count, random_buffer,
random_len)) {
ret_val = -ENOMEM;
break;
}
} else
memcpy(buf+count, random_buffer, random_len);
count += random_len;
if (n <= random_len)
break;
n -= random_len;
pr_debug("get tee random %lu, remain %lu, total %d\n",
count, n, nbytes);
}
kfree(random_buffer);
return ret_val ? ret_val : count;
}
static ssize_t
tee_random_read(struct file *file, char __user *buf, size_t nbytes,
loff_t *ppos)
{
struct tee_random_data *data = file->private_data;
TEEC_Session *session = &data->session;
return __get_tee_random_bytes(session, buf, nbytes, 1);
}
int get_tee_random_bytes(void *buf, int nbytes)
{
TEEC_Session session;
int ret;
if (open_tee_random_session(&session))
return -EBUSY;
ret = __get_tee_random_bytes(&session, buf, nbytes, 0);
TEEK_CloseSession(&session);
return ret;
}
EXPORT_SYMBOL(get_tee_random_bytes);
const struct file_operations tee_random_fops = {
.open = tee_random_open,
.release = tee_random_close,
.read = tee_random_read,
};
static int tee_dev_major;
static struct class *tee_random_class;
static struct device *tee_random_dev;
#define TEE_RANDOM_NAME "tee_random"
static __init int tee_random_init(void)
{
int ret = 0;
int major = 0;
major = register_chrdev(0, "tee_random", &tee_random_fops);
if (major <= 0) {
pr_err("unable to get major for tee random devs.\n");
return -EFAULT;
}
tee_random_class = class_create(THIS_MODULE, TEE_RANDOM_NAME);
if (IS_ERR(tee_random_class)) {
ret = -EFAULT;
pr_err("tee random class_create error.\n");
goto error1;
}
tee_random_dev = device_create(tee_random_class, NULL,
MKDEV(major, 0), NULL, TEE_RANDOM_NAME);
if (IS_ERR(tee_random_dev)) {
ret = -EFAULT;
pr_err("tee random device_create error.\n");
goto error2;
}
ret = init_mdpp_context(&mdpp_ctx);
if (ret) {
pr_err("tee random failed init tee context\n");
goto error3;
}
tee_dev_major = major;
return 0;
error3:
device_destroy(tee_random_class, MKDEV(major, 0));
tee_random_dev = NULL;
error2:
class_destroy(tee_random_class);
tee_random_class = NULL;
error1:
unregister_chrdev(major, TEE_RANDOM_NAME);
return ret;
}
static void tee_random_exit(void)
{
destroy_mdpp_context(&mdpp_ctx);
device_destroy(tee_random_class, MKDEV(tee_dev_major, 0));
tee_random_dev = NULL;
class_destroy(tee_random_class);
tee_random_class = NULL;
unregister_chrdev(tee_dev_major, TEE_RANDOM_NAME);
}
late_initcall(tee_random_init);
module_exit(tee_random_exit);
MODULE_DESCRIPTION("TEE random driver");
MODULE_LICENSE("GPL");
|
#ifndef BACKEND_BATTERY_POWERBOOK_H_
#define BACKEND_BATTERY_POWERBOOK_H_
#include "battery.h"
struct battery_powerbook {
struct battery battery;
struct fileaccess *info_file;
struct fileaccess *stat_file;
int on_ac;
int max_charge;
int charge;
};
#endif /* BACKEND_BATTERY_POWERBOOK_H_ */
|
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
Copyright (C) 2002-2014 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "dvipdfmx.h"
#include "system.h"
#include "mem.h"
#include "error.h"
#include "libtexpdf/libtexpdf.h"
#include "specials.h"
#include "spc_util.h"
#include "spc_color.h"
/* Color stack is actually placed into pdfcolor.c.
* The reason why we need to place stack there is
* that we must reinstall color after grestore and
* other operations that can change current color
* implicitely.
*/
static int
spc_handler_color_push (struct spc_env *spe, struct spc_arg *args)
{
int error;
pdf_color colorspec;
error = spc_util_read_colorspec(spe, &colorspec, args, 1);
if (!error) {
texpdf_color_push(pdf, &colorspec, &colorspec);
}
return error;
}
static int
spc_handler_color_pop (struct spc_env *spe, struct spc_arg *args)
{
texpdf_color_pop(pdf);
return 0;
}
/* Invoked by the special command "color rgb .625 0 0".
* DVIPS clears the color stack, and then saves and sets the given color.
*/
static int
spc_handler_color_default (struct spc_env *spe, struct spc_arg *args)
{
int error;
pdf_color colorspec;
error = spc_util_read_colorspec(spe, &colorspec, args, 1);
if (!error) {
texpdf_color_clear_stack();
texpdf_color_set(pdf, &colorspec, &colorspec);
}
return error;
}
/* This is from color special? */
static int
spc_handler_background (struct spc_env *spe, struct spc_arg *args)
{
int error;
pdf_color colorspec;
error = spc_util_read_colorspec(spe, &colorspec, args, 1);
if (!error)
texpdf_doc_set_bgcolor(pdf, &colorspec);
return error;
}
#ifndef ISBLANK
#define ISBLANK(c) ((c) == ' ' || (c) == '\t' || (c) == '\v')
#endif
static void
skip_blank (const char **pp, const char *endptr)
{
const char *p = *pp;
for ( ; p < endptr && ISBLANK(*p); p++);
*pp = p;
}
int
spc_color_check_special (const char *buf, long len)
{
int r = 0;
const char *p, *endptr;
char *q;
p = buf;
endptr = p + len;
skip_blank(&p, endptr);
q = texpdf_parse_c_ident(&p, endptr);
if (!q)
return 0;
else if (!strcmp(q, "color"))
r = 1;
else if (!strcmp(q, "background")) {
r = 1;
}
RELEASE(q);
return r;
}
int
spc_color_setup_handler (struct spc_handler *sph,
struct spc_env *spe, struct spc_arg *ap)
{
const char *p;
char *q;
ASSERT(sph && spe && ap);
skip_blank(&ap->curptr, ap->endptr);
q = texpdf_parse_c_ident(&ap->curptr, ap->endptr);
if (!q)
return -1;
skip_blank(&ap->curptr, ap->endptr);
if (!strcmp(q, "background")) {
ap->command = "background";
sph->exec = &spc_handler_background;
RELEASE(q);
} else if (!strcmp(q, "color")) { /* color */
RELEASE(q);
p = ap->curptr;
q = texpdf_parse_c_ident(&p, ap->endptr);
if (!q)
return -1;
else if (!strcmp(q, "push")) {
ap->command = "push";
sph->exec = &spc_handler_color_push;
ap->curptr = p;
} else if (!strcmp(q, "pop")) {
ap->command = "pop";
sph->exec = &spc_handler_color_pop;
ap->curptr = p;
} else { /* cmyk, rgb, ... */
ap->command = "";
sph->exec = &spc_handler_color_default;
}
RELEASE(q);
} else {
spc_warn(spe, "Not color/background special?");
RELEASE(q);
return -1;
}
skip_blank(&ap->curptr, ap->endptr);
return 0;
}
|
#include <stdio.h>
#include <string.h>
int main() {
char string[10];
int A = -73;
unsigned int B = 31337;
strcpy(string, "sample");
// Example of printing with different format string
printf("[A] Dec: %d, Hex: %x, Unsigned: %u\n", A, A, A);
printf("[B] Dec: %d, Hex: %x, Unsigned: %u\n", B, B, B);
printf("[field width on B] 3: '%3u', 10: '%10u', '%08u'\n", B, B, B);
printf("[string] %s Address %08x\n", string, string);
// Example of unary address operator (dereferencing) and a %x format string
printf("variable A is at address: %08x\n", &A);
}
==================================================OUTPUT===========================================
#cd Desktop
#gcc -o fmt_strings fmt_strings.c
#./fmt_strings
[A] Dec: -73, Hex: ffffffb7, Unsigned: 4294967223
[B] Dec: 31337, Hex: 7a69, Unsigned: 31337
[field width on B] 3: '31337', 10: ' 31337', '00031337'
[string] sample Address 3e562b70
variable A is at address: 3e562b6c
|
/*
* The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) implementation with additional features.
* Copyright (C) 2017 Belledonne Communications SARL
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "ortp-config.h"
#endif
#include "ortp/logging.h"
#include "ortp/payloadtype.h"
#include "ortp/str_utils.h"
#include <bctoolbox/port.h>
char *payload_type_get_rtpmap(PayloadType *pt)
{
int len=(int)strlen(pt->mime_type)+15;
char *rtpmap=(char *) ortp_malloc(len);
if (pt->channels>0)
snprintf(rtpmap,len,"%s/%i/%i",pt->mime_type,pt->clock_rate,pt->channels);
else
snprintf(rtpmap,len,"%s/%i",pt->mime_type,pt->clock_rate);
return rtpmap;
}
PayloadType *payload_type_new()
{
PayloadType *newpayload=(PayloadType *)ortp_new0(PayloadType,1);
newpayload->flags|=PAYLOAD_TYPE_ALLOCATED;
return newpayload;
}
PayloadType *payload_type_clone(const PayloadType *payload)
{
PayloadType *newpayload=(PayloadType *)ortp_new0(PayloadType,1);
memcpy(newpayload,payload,sizeof(PayloadType));
newpayload->mime_type=ortp_strdup(payload->mime_type);
if (payload->recv_fmtp!=NULL) {
newpayload->recv_fmtp=ortp_strdup(payload->recv_fmtp);
}
if (payload->send_fmtp!=NULL){
newpayload->send_fmtp=ortp_strdup(payload->send_fmtp);
}
newpayload->flags|=PAYLOAD_TYPE_ALLOCATED;
return newpayload;
}
static bool_t canWrite(PayloadType *pt){
if (!(pt->flags & PAYLOAD_TYPE_ALLOCATED)) {
ortp_error("Cannot change parameters of statically defined payload types: make your"
" own copy using payload_type_clone() first.");
return FALSE;
}
return TRUE;
}
/**
* Sets a recv parameters (fmtp) for the PayloadType.
* This method is provided for applications using RTP with SDP, but
* actually the ftmp information is not used for RTP processing.
**/
void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->recv_fmtp!=NULL) ortp_free(pt->recv_fmtp);
if (fmtp!=NULL) pt->recv_fmtp=ortp_strdup(fmtp);
else pt->recv_fmtp=NULL;
}
}
/**
* Sets a send parameters (fmtp) for the PayloadType.
* This method is provided for applications using RTP with SDP, but
* actually the ftmp information is not used for RTP processing.
**/
void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->send_fmtp!=NULL) ortp_free(pt->send_fmtp);
if (fmtp!=NULL) pt->send_fmtp=ortp_strdup(fmtp);
else pt->send_fmtp=NULL;
}
}
void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->recv_fmtp==NULL)
pt->recv_fmtp=ortp_strdup(fmtp);
else{
char *tmp=ortp_strdup_printf("%s;%s",pt->recv_fmtp,fmtp);
ortp_free(pt->recv_fmtp);
pt->recv_fmtp=tmp;
}
}
}
void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp){
if (canWrite(pt)){
if (pt->send_fmtp==NULL)
pt->send_fmtp=ortp_strdup(fmtp);
else{
char *tmp=ortp_strdup_printf("%s;%s",pt->send_fmtp,fmtp);
ortp_free(pt->send_fmtp);
pt->send_fmtp=tmp;
}
}
}
void payload_type_set_avpf_params(PayloadType *pt, PayloadTypeAvpfParams params) {
if (canWrite(pt)) {
memcpy(&pt->avpf, ¶ms, sizeof(pt->avpf));
}
}
bool_t payload_type_is_vbr(const PayloadType *pt) {
if (pt->type == PAYLOAD_VIDEO) return TRUE;
return !!(pt->flags & PAYLOAD_TYPE_IS_VBR);
}
/**
* Frees a PayloadType.
**/
void payload_type_destroy(PayloadType *pt)
{
if (pt->mime_type) ortp_free(pt->mime_type);
if (pt->recv_fmtp) ortp_free(pt->recv_fmtp);
if (pt->send_fmtp) ortp_free(pt->send_fmtp);
ortp_free(pt);
}
static const char *find_param_occurence_of(const char *fmtp, const char *param){
const char *pos=fmtp;
do{
pos=strstr(pos,param);
if (pos){
/*check that the occurence found is not a subword of a parameter name*/
if (pos==fmtp) break;
if (pos[-1]==';' || pos[-1]==' '){
break;
}
pos+=strlen(param);
}
}while(pos!=NULL);
return pos;
}
static const char *find_last_param_occurence_of(const char *fmtp, const char *param){
const char *pos=fmtp;
const char *lastpos=NULL;
do{
pos=find_param_occurence_of(pos,param);
if (pos) {
lastpos=pos;
pos+=strlen(param);
}
}while(pos!=NULL);
return lastpos;
}
/**
* Parses a fmtp string such as "profile=0;level=10", finds the value matching
* parameter param_name, and writes it into result.
* If a parameter name is found multiple times, only the value of the last occurence is returned.
* Despite fmtp strings are not used anywhere within oRTP, this function can
* be useful for people using RTP streams described from SDP.
* @param fmtp the fmtp line (format parameters)
* @param param_name the parameter to search for
* @param result the value given for the parameter (if found)
* @param result_len the size allocated to hold the result string
* @return TRUE if the parameter was found, else FALSE.
**/
bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len){
const char *pos=find_last_param_occurence_of(fmtp,param_name);
memset(result, '\0', result_len);
if (pos){
const char *equal=strchr(pos,'=');
if (equal){
int copied;
const char *end=strchr(equal+1,';');
if (end==NULL) end=fmtp+strlen(fmtp); /*assuming this is the last param */
copied=MIN((int)(result_len-1),(int)(end-(equal+1)));
strncpy(result,equal+1,copied);
result[copied]='\0';
return TRUE;
}
}
return FALSE;
}
|
/***************************************************************************
* Copyright (C) 2013-2015 by Savoir-Faire Linux *
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#ifndef KPHONENUMBERSELECTOR_H
#define KPHONENUMBERSELECTOR_H
//SFLPhone
#include "../lib/visitors/phonenumberselector.h"
class PhoneNumber;
class Contact;
class KPhoneNumberSelector : public PhoneNumberSelector
{
public:
virtual ~KPhoneNumberSelector(){}
virtual PhoneNumber* getNumber(const Contact* contact);
static void init();
};
#endif
|
/*
* Copyright (C) 2002-2009 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: serialdummy.h,v 1.5 2009/05/27 09:15:41 qbix79 Exp $ */
#ifndef INCLUDEGUARD_SERIALDUMMY_H
#define INCLUDEGUARD_SERIALDUMMY_H
#include "serialport.h"
//#define CHECKIT_TESTPLUG
class CSerialDummy : public CSerial {
public:
CSerialDummy(Bitu id, CommandLine* cmd);
~CSerialDummy();
void setRTSDTR(bool rts, bool dtr);
void setRTS(bool val);
void setDTR(bool val);
void updatePortConfig(Bit16u, Bit8u lcr);
void updateMSR();
void transmitByte(Bit8u val, bool first);
void setBreak(bool value);
void handleUpperEvent(Bit16u type);
#ifdef CHECKIT_TESTPLUG
Bit8u loopbackdata;
#endif
};
#endif // INCLUDEGUARD
|
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2022 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef _U2_TASK_STARTER_H_
#define _U2_TASK_STARTER_H_
#include <U2Core/Task.h>
namespace U2 {
/**
* Intended for deferred task run, triggered by a signal.
*/
class U2CORE_EXPORT TaskStarter : public QObject {
Q_OBJECT
public:
enum StartCondition {
NoCondition,
NoProject
};
TaskStarter(Task* t, StartCondition condition = NoCondition)
: QObject(t), t(t), condition(condition) {
}
public slots:
void registerTask();
private:
Task* t;
StartCondition condition;
};
} // namespace U2
#endif
|
/**
* WebTester Server - server of on-line testing system
*
* IPC procedures stuff module
*
* Copyright 2008 Sergey I. Sharybin <g.ulairi@gmail.com>
*
* This program can be distributed under the terms of the GNU GPL.
* See the file COPYING.
*/
#include "ipc.h"
#include "sock.h"
/**
* Handler of command `exit`
*
* @param __argc - number of arguments
* @param __argv - array of arguments
* @return zero on success, non-zero otherwise
*/
int
ipc_proc_exit (int __argc, char **__argv)
{
if (__argc != 1)
{
IPC_PROC_ANSWER ("-ERR Usaage: `exit'\n");
return 0;
}
IPC_PROC_ANSWER ("+OK ");
ipc_disconnect_client (ipc_get_current_client (), 1);
return 0;
}
|
/*
dspdfviewer - Dual Screen PDF Viewer for LaTeX-Beamer
Copyright (C) 2012 Danny Edel <mail@danny-edel.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef dspdfviewer_H
#define dspdfviewer_H
#include <QObject>
#include <QTimer>
#include <QFileSystemWatcher>
#include <poppler/qt4/poppler-qt4.h>
#include "pdfviewerwindow.h"
#include "pdfrenderfactory.h"
#include "runtimeconfiguration.h"
class DSPDFViewer: public QObject
{
Q_OBJECT
private:
const RuntimeConfiguration runtimeConfiguration;
enum {
TIMER_UPDATE_INTERVAL=250
};
private:
QTimer clockDisplayTimer;
QTime slideStart;
QTime presentationStart;
bool presentationClockRunning;
private:
QFileSystemWatcher documentFileWatcher;
PdfRenderFactory renderFactory;
unsigned int m_pagenumber;
PDFViewerWindow audienceWindow;
PDFViewerWindow secondaryWindow;
public:
static const QSize thumbnailSize;
private:
QImage renderForTarget( QSharedPointer<Poppler::Page> page, QSize targetSize, bool onlyHalf, bool rightHalf=false);
QString timeToString(QTime time) const;
QString timeToString(int milliseconds) const;
void resetSlideClock();
RenderingIdentifier toRenderIdent(unsigned int pageNumber, const PDFViewerWindow& window);
private slots:
void sendAllClockSignals() const;
public:
DSPDFViewer(const RuntimeConfiguration& r);
virtual ~DSPDFViewer();
/** get current page number
*/
unsigned int pageNumber() const;
/** get page count
*/
unsigned int numberOfPages() const;
void setHighQuality(bool hq);
bool isReadyToRender() const;
PdfRenderFactory* theFactory();
QTime wallClock() const;
QTime slideClock() const;
QTime presentationClock() const;
QTime timeSince( const QTime& startPoint) const;
bool isAudienceScreenBlank() const;
signals:
void wallClockUpdate(const QTime& wallClock) const;
void slideClockUpdate(const QTime& slideClock) const;
void presentationClockUpdate(const QTime& presentationClock) const;
public slots:
/** (re-)Renders the current page on both monitors
*/
void renderPage();
/** goes to the specified page. Pages start at zero.
*/
void gotoPage(unsigned int pageNumber);
/** go Forward one page
*/
void goForward();
/** go backward one page
*/
void goBackward();
void goToStartAndResetClocks();
void swapScreens();
void toggleAudienceScreenBlank();
void setAudienceScreenBlank();
void setAudienceScreenVisible();
void toggleSecondaryScreenFunction();
void exit();
};
#endif // dspdfviewer_H
|
/*
* Copyright (c) 1993-1997 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Computer Systems
* Engineering Group at Lawrence Berkeley Laboratory.
* 4. Neither the name of the University nor of the Laboratory may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Header: /nfs/jade/vint/CVSROOT/nam-1/address.h,v 1.1 1998/04/20 23:49:38 haoboy Exp $
*/
#ifndef ns_addr_params
#define ns_addr_params
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include <assert.h>
class Address : public TclObject {
public:
static Address& instance() { return (*instance_); }
Address();
~Address();
char *print_nodeaddr(int address);
char *print_portaddr(int address);
int str2addr(char *str);
inline int set_word_field(int word, int field, int shift, int mask) {
return (((field & mask)<<shift) | ((~(mask << shift)) & word));
}
int PortShift_;
int PortMask_;
/* for now maximum number of hierarchical levels considered as 10 */
int NodeShift_[10];
int NodeMask_[10];
int McastShift_;
int McastMask_;
int levels_;
protected:
int command(int argc, const char*const* argv);
static Address* instance_;
};
#endif /* ns_addr_params */
|
/* LIGHTP- LIGHT PROCESSOR */
/*COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142*/
/* ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED */
/* WRITTEN BY R. M. SUPNIK */
#include "funcs.h"
#include "vars.h"
logical lightp_(integer obj)
{
/* System generated locals */
logical ret_val;
/* Local variables */
integer flobts;
integer i;
ret_val = TRUE_;
/* !ASSUME WINS */
flobts = FLAMBT + LITEBT + ONBT;
if (obj != oindex_1.candl) {
goto L20000;
}
/* !CANDLE? */
if (findex_1.orcand != 0) {
goto L19100;
}
/* !FIRST REF? */
findex_1.orcand = 1;
/* !YES, CANDLES ARE */
cevent_1.ctick[cindex_1.cevcnd - 1] = 50;
/* !BURNING WHEN SEEN. */
L19100:
if (prsvec_1.prsi == oindex_1.candl) {
goto L10;
}
/* !IGNORE IND REFS. */
if (prsvec_1.prsa != vindex_1.trnofw) {
goto L19200;
}
/* !TURN OFF? */
i = 513;
/* !ASSUME OFF. */
if ((objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) {
i = 514;
}
/* !IF ON, DIFFERENT. */
cevent_1.cflag[cindex_1.cevcnd - 1] = FALSE_;
/* !DISABLE COUNTDOWN. */
objcts_1.oflag1[oindex_1.candl - 1] &= ~ ONBT;
rspeak_(i);
return ret_val;
L19200:
if (prsvec_1.prsa != vindex_1.burnw && prsvec_1.prsa != vindex_1.trnonw) {
goto L10;
}
if ((objcts_1.oflag1[oindex_1.candl - 1] & LITEBT) != 0) {
goto L19300;
}
rspeak_(515);
/* !CANDLES TOO SHORT. */
return ret_val;
L19300:
if (prsvec_1.prsi != 0) {
goto L19400;
}
/* !ANY FLAME? */
rspeak_(516);
/* !NO, LOSE. */
prsvec_1.prswon = FALSE_;
return ret_val;
L19400:
if (prsvec_1.prsi != oindex_1.match || ! ((objcts_1.oflag1[oindex_1.match
- 1] & ONBT) != 0)) {
goto L19500;
}
i = 517;
/* !ASSUME OFF. */
if ((objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) {
i = 518;
}
/* !IF ON, JOKE. */
objcts_1.oflag1[oindex_1.candl - 1] |= ONBT;
cevent_1.cflag[cindex_1.cevcnd - 1] = TRUE_;
/* !RESUME COUNTDOWN. */
rspeak_(i);
return ret_val;
L19500:
if (prsvec_1.prsi != oindex_1.torch || ! ((objcts_1.oflag1[oindex_1.torch
- 1] & ONBT) != 0)) {
goto L19600;
}
if ((objcts_1.oflag1[oindex_1.candl - 1] & ONBT) != 0) {
goto L19700;
}
/* !ALREADY ON? */
newsta_(oindex_1.candl, 521, 0, 0, 0);
/* !NO, VAPORIZE. */
return ret_val;
L19600:
rspeak_(519);
/* !CANT LIGHT WITH THAT. */
return ret_val;
L19700:
rspeak_(520);
/* !ALREADY ON. */
return ret_val;
L20000:
if (obj != oindex_1.match) {
bug_(6, obj);
}
if (prsvec_1.prsa != vindex_1.trnonw || prsvec_1.prso != oindex_1.match) {
goto L20500;
}
if (findex_1.ormtch != 0) {
goto L20100;
}
/* !ANY MATCHES LEFT? */
rspeak_(183);
/* !NO, LOSE. */
return ret_val;
L20100:
--findex_1.ormtch;
/* !DECREMENT NO MATCHES. */
objcts_1.oflag1[oindex_1.match - 1] |= flobts;
cevent_1.ctick[cindex_1.cevmat - 1] = 2;
/* !COUNTDOWN. */
rspeak_(184);
return ret_val;
L20500:
if (prsvec_1.prsa != vindex_1.trnofw || (objcts_1.oflag1[oindex_1.match -
1] & ONBT) == 0) {
goto L10;
}
objcts_1.oflag1[oindex_1.match - 1] &= ~ flobts;
cevent_1.ctick[cindex_1.cevmat - 1] = 0;
rspeak_(185);
return ret_val;
/* HERE FOR FALSE RETURN */
L10:
ret_val = FALSE_;
return ret_val;
} /* lightp_ */
|
/*
PIM for Quagga
Copyright (C) 2008 Everton da Silva Marques
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
*/
#include <zebra.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include "log.h"
#include "thread.h"
#include "pim_time.h"
static int gettime_monotonic(struct timeval *tv)
{
int result;
result = gettimeofday(tv, 0);
if (result) {
zlog_err("%s: gettimeofday() failure: errno=%d: %s",
__PRETTY_FUNCTION__,
errno, safe_strerror(errno));
}
return result;
}
/*
pim_time_monotonic_sec():
number of seconds since some unspecified starting point
*/
int64_t pim_time_monotonic_sec()
{
struct timeval now_tv;
if (gettime_monotonic(&now_tv)) {
zlog_err("%s: gettime_monotonic() failure: errno=%d: %s",
__PRETTY_FUNCTION__,
errno, safe_strerror(errno));
return -1;
}
return now_tv.tv_sec;
}
/*
pim_time_monotonic_dsec():
number of deciseconds since some unspecified starting point
*/
int64_t pim_time_monotonic_dsec()
{
struct timeval now_tv;
int64_t now_dsec;
if (gettime_monotonic(&now_tv)) {
zlog_err("%s: gettime_monotonic() failure: errno=%d: %s",
__PRETTY_FUNCTION__,
errno, safe_strerror(errno));
return -1;
}
now_dsec = ((int64_t) now_tv.tv_sec) * 10 + ((int64_t) now_tv.tv_usec) / 100000;
return now_dsec;
}
int pim_time_mmss(char *buf, int buf_size, long sec)
{
long mm;
int wr;
zassert(buf_size >= 5);
mm = sec / 60;
sec %= 60;
wr = snprintf(buf, buf_size, "%02ld:%02ld", mm, sec);
return wr != 8;
}
static int pim_time_hhmmss(char *buf, int buf_size, long sec)
{
long hh;
long mm;
int wr;
zassert(buf_size >= 8);
hh = sec / 3600;
sec %= 3600;
mm = sec / 60;
sec %= 60;
wr = snprintf(buf, buf_size, "%02ld:%02ld:%02ld", hh, mm, sec);
return wr != 8;
}
void pim_time_timer_to_mmss(char *buf, int buf_size, struct thread *t_timer)
{
if (t_timer) {
pim_time_mmss(buf, buf_size,
thread_timer_remain_second(t_timer));
}
else {
snprintf(buf, buf_size, "--:--");
}
}
void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct thread *t_timer)
{
if (t_timer) {
pim_time_hhmmss(buf, buf_size,
thread_timer_remain_second(t_timer));
}
else {
snprintf(buf, buf_size, "--:--:--");
}
}
void pim_time_uptime(char *buf, int buf_size, int64_t uptime_sec)
{
zassert(buf_size >= 8);
pim_time_hhmmss(buf, buf_size, uptime_sec);
}
void pim_time_uptime_begin(char *buf, int buf_size, int64_t now, int64_t begin)
{
if (begin > 0)
pim_time_uptime(buf, buf_size, now - begin);
else
snprintf(buf, buf_size, "--:--:--");
}
long pim_time_timer_remain_msec(struct thread *t_timer)
{
/* FIXME: Actually fetch msec resolution from thread */
/* no timer thread running means timer has expired: return 0 */
return t_timer ?
1000 * thread_timer_remain_second(t_timer) :
0;
}
|
/*
$port: mediaplayer_setup.h,v 1.3 2010/12/05 22:32:12 tuxbox-cvs Exp $
Neutrino-GUI - DBoxII-Project
media player setup implementation - Neutrino-GUI
Copyright (C) 2001 Steffen Hehn 'McClean'
and some other guys
Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2011 T. Graf 'dbt'
Homepage: http://www.dbox2-tuning.net/
License: GPL
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __mediaplayer_setup__
#define __mediaplayer_setup__
#include <gui/widget/menue.h>
#include <string>
class CMediaPlayerSetup : public CMenuTarget
{
private:
int width, selected;
int showMediaPlayerSetup();
public:
CMediaPlayerSetup();
~CMediaPlayerSetup();
int exec(CMenuTarget *parent, const std::string &actionKey);
};
#endif
|
/* $Id$
*
* Copyright (c) 2007 Anders F Bjorklund <afb@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __XFCESMART_H__
#define __XFCESMART_H__
G_BEGIN_DECLS
/* plugin structure */
typedef struct
{
XfcePanelPlugin *plugin;
/* panel widgets */
GtkWidget *button;
GtkWidget *image;
GtkWidget *menuitem;
GtkTooltips *tooltip;
gint current_icon_size;
GdkPixbuf *application_icon;
GdkPixbuf *nopackage_icon;
GdkPixbuf *newpackage_icon;
GdkPixbuf *available_icon;
GdkPixbuf *downloading_icon;
GdkPixbuf *updated_icon;
GdkPixbuf *error_icon;
GTimer *timer;
guint timeout;
gboolean in_progress;
GTimeVal in_progress_since;
gint updates_available;
gint stdout, stderr;
/* panel settings */
gint check_interval;
gboolean upgrade_directly;
gboolean dist_upgrade;
gint package_manager;
gboolean show_application;
gboolean show_notifications;
gboolean su_instead_of_sudo;
}
SmartPlugin;
void
smart_save (XfcePanelPlugin *plugin,
SmartPlugin *smart);
void
smart_configure (XfcePanelPlugin *plugin,
SmartPlugin *smart);
void
smart_about (XfcePanelPlugin *plugin);
G_END_DECLS
#endif /* !__XFCESMART_H__ */
|
#if !defined(_ALIASES_H_)
#define _ALIASES_H_
#include <string>
#include <list>
#include <iterator>
#include <map>
#include <boost/thread.hpp>
#include <boost/function.hpp>
class aliases
{
public:
aliases();
bool load(const std::string &_file_name);
bool process(const std::string &_rcpt, long long unsigned _suid, boost::function< void (const std::string &, long long unsigned) >); //true if have alias
protected:
std::map<std::string, std::list< std::string > > m_aliases;
boost::shared_mutex m_mutex;
};
extern aliases g_aliases;
#endif // _ALIASES_H_
|
/*-----------------------------------------------------------------------------
// $Date: 2007/12/10 23:24:56 $
// $RCSfile: usleep.c,v $
//-----------------------------------------------------------------------------
//
// Copyright (c) 2004 Xilinx, Inc. All rights reserved.
//
// Xilinx, Inc.
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
// COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
// ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
// STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
// IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
// FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
// XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
// THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
// ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
// FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE.
//
//---------------------------------------------------------------------------*/
#include "sleep.h"
#include "xtime_l.h"
#include "xparameters.h"
void nanosleep(unsigned int nanoseconds)
{
/* not implemented */
}
unsigned int usleep(unsigned int useconds)
{
XTime tEnd, tCur;
XTime_GetTime(&tCur);
tEnd = tCur + ((XTime) useconds) * (XPAR_CPU_PPC440_CORE_CLOCK_FREQ_HZ / 1000000);
do
{
XTime_GetTime(&tCur);
} while (tCur < tEnd);
return 0;
}
|
/*********
*
* In the name of the Father, and of the Son, and of the Holy Spirit.
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2016 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
#ifndef BTABOUTDIALOG_H
#define BTABOUTDIALOG_H
#include <QDialog>
class QDialogButtonBox;
class QLabel;
class QTabWidget;
class QUrl;
class BtWebEngineView;
class BtAboutDialog: public QDialog {
Q_OBJECT
public:
BtAboutDialog(QWidget *parent = nullptr, Qt::WindowFlags wflags = Qt::Dialog);
protected:
void resizeEvent(QResizeEvent* event) override;
private:
void initTab(BtWebEngineView *&tab);
void retranslateUi();
void retranslateBtTab();
void retranslateContributorsTab();
void retranslateSwordTab();
void retranslateQtTab();
void retranslateLicenceTab();
private slots:
void linkClicked(const QUrl &url);
private:
QTabWidget *m_tabWidget;
BtWebEngineView *m_bibletimeTab;
BtWebEngineView *m_contributorsTab;
BtWebEngineView *m_swordTab;
BtWebEngineView *m_qtTab;
BtWebEngineView *m_licenceTab;
QDialogButtonBox *m_buttonBox;
QLabel *m_iconLabel;
QLabel *m_versionLabel;
};
#endif
|
/*
* Copyright (C) 2005-2012 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#ifndef BITSTREAM_H
#define BITSTREAM_H
#include <inttypes.h>
namespace TSDemux
{
class CBitstream
{
private:
uint8_t *m_data;
int m_offset;
int m_len;
bool m_error;
public:
CBitstream(uint8_t *data, int bits);
void setBitstream(uint8_t *data, int bits);
void skipBits(int num);
unsigned int readBits(int num);
unsigned int showBits(int num);
unsigned int readBits1() { return readBits(1); }
unsigned int readGolombUE(int maxbits = 32);
signed int readGolombSE();
unsigned int remainingBits();
void putBits(int val, int num);
int length() { return m_len; }
bool isError() { return m_error; }
};
}
#endif /* BITSTREAM_H */
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2008-2009 coresystems GmbH
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
* the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <console/console.h>
#include <device/device.h>
#include <device/path.h>
#include <device/smbus.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <arch/io.h>
#include "smbus.h"
static void pch_smbus_init(device_t dev)
{
u16 reg16;
/* Enable clock gating */
reg16 = pci_read_config16(dev, 0x80);
reg16 &= ~((1 << 8)|(1 << 10)|(1 << 12)|(1 << 14));
pci_write_config16(dev, 0x80, reg16);
}
static int lsmbus_read_byte(device_t dev, u8 address)
{
u16 device;
struct resource *res;
struct bus *pbus;
device = dev->path.i2c.device;
pbus = get_pbus_smbus(dev);
res = find_resource(pbus->dev, 0x20);
return do_smbus_read_byte(res->base, device, address);
}
static int lsmbus_write_byte(device_t dev, u8 address, u8 val)
{
u16 device;
struct resource *res;
struct bus *pbus;
device = dev->path.i2c.device;
pbus = get_pbus_smbus(dev);
res = find_resource(pbus->dev, 0x20);
return do_smbus_write_byte(res->base, device, address, val);
}
static struct smbus_bus_operations lops_smbus_bus = {
.read_byte = lsmbus_read_byte,
.write_byte = lsmbus_write_byte,
};
static void smbus_set_subsystem(device_t dev, unsigned vendor, unsigned device)
{
if (!vendor || !device) {
pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
pci_read_config32(dev, PCI_VENDOR_ID));
} else {
pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
((device & 0xffff) << 16) | (vendor & 0xffff));
}
}
static struct pci_operations smbus_pci_ops = {
.set_subsystem = smbus_set_subsystem,
};
static void smbus_read_resources(device_t dev)
{
struct resource *res = new_resource(dev, PCI_BASE_ADDRESS_4);
res->base = SMBUS_IO_BASE;
res->size = 32;
res->limit = res->base + res->size - 1;
res->flags = IORESOURCE_IO | IORESOURCE_FIXED | IORESOURCE_RESERVE |
IORESOURCE_STORED | IORESOURCE_ASSIGNED;
/* Also add MMIO resource */
res = pci_get_resource(dev, PCI_BASE_ADDRESS_0);
}
static struct device_operations smbus_ops = {
.read_resources = smbus_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.scan_bus = scan_static_bus,
.init = pch_smbus_init,
.ops_smbus_bus = &lops_smbus_bus,
.ops_pci = &smbus_pci_ops,
};
static const unsigned short pci_device_ids[] = { 0x283e, 0 };
static const struct pci_driver pch_smbus __pci_driver = {
.ops = &smbus_ops,
.vendor = PCI_VENDOR_ID_INTEL,
.devices = pci_device_ids,
};
|
#pragma once
#include "PluginAPI.h"
extern NVSESerializationInterface g_NVSESerializationInterface;
namespace Serialization
{
struct PluginCallbacks
{
PluginCallbacks()
:save(NULL), load(NULL), newGame(NULL), preLoad(NULL) { }
NVSESerializationInterface::EventCallback save;
NVSESerializationInterface::EventCallback load;
NVSESerializationInterface::EventCallback newGame;
NVSESerializationInterface::EventCallback preLoad;
bool hadData;
};
// plugin API
void SetSaveCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
void SetLoadCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
void SetNewGameCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
void SetPreLoadCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
bool WriteRecord(UInt32 type, UInt32 version, const void * buf, UInt32 length);
bool OpenRecord(UInt32 type, UInt32 version);
bool WriteRecordData(const void * buf, UInt32 length);
bool GetNextRecordInfo(UInt32 * type, UInt32 * version, UInt32 * length);
UInt32 ReadRecordData(void * buf, UInt32 length);
bool ResolveRefID(UInt32 refID, UInt32 * outRefID);
// internal event handlers
void HandleSaveGame(const char * path);
void HandleLoadGame(const char * path, NVSESerializationInterface::EventCallback PluginCallbacks::* callback = &PluginCallbacks::load);
void HandleDeleteGame(const char * path);
void HandleRenameGame(const char * oldPath, const char * newPath);
void HandleNewGame(void);
void HandlePreLoadGame(const char* path);
void HandlePostLoadGame(bool bLoadSucceeded);
void InternalSetSaveCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
void InternalSetLoadCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
void InternalSetNewGameCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
void InternalSetPreLoadCallback(PluginHandle plugin, NVSESerializationInterface::EventCallback callback);
const char * GetSavePath(void);
extern bool ignoreNextChunk;
}
|
#include <stdlib.h>
#include "daala/include/daala/daalaenc.h"
#include "daala/include/daala/daaladec.h"
daala_info* daala_info_create(int32_t width, int32_t height,
uint32_t aspect_num, uint32_t aspect_den,
uint32_t timebase_num, uint32_t timebase_den,
int keyframe_rate)
{
daala_info *di = (daala_info*)malloc(sizeof(daala_info));
daala_info_init(di);
di->pic_width = width;
di->pic_height = height;
di->pixel_aspect_numerator = aspect_num;
di->pixel_aspect_denominator = aspect_den;
di->timebase_numerator = timebase_num;
di->timebase_denominator = timebase_den;
di->frame_duration = 1;
di->bitdepth_mode = OD_BITDEPTH_MODE_8;
di->nplanes = 3;
di->plane_info[0].xdec = 0;
di->plane_info[0].ydec = 0;
di->plane_info[1].xdec = 1;
di->plane_info[1].ydec = 1;
di->plane_info[2].xdec = 1;
di->plane_info[2].ydec = 1;
di->keyframe_rate = keyframe_rate;
return di;
}
daala_comment *daala_comment_create()
{
daala_comment *dc = (daala_comment*)malloc(sizeof(daala_comment));
daala_comment_init(dc);
return dc;
}
od_img *od_img_create(int32_t width, int32_t height)
{
od_img *oi = (od_img*)malloc(sizeof(od_img));
if (width > 0 && height > 0) {
oi->width = width;
oi->height = height;
oi->nplanes = 3;
oi->planes[0].data = (unsigned char*)malloc(width * height);
oi->planes[0].xdec = 0;
oi->planes[0].ydec = 0;
oi->planes[0].xstride = 1;
oi->planes[0].ystride = width;
oi->planes[0].bitdepth = 8;
oi->planes[1].data = (unsigned char*)malloc(width * height / 2);
oi->planes[1].xdec = 1;
oi->planes[1].ydec = 1;
oi->planes[1].xstride = 1;
oi->planes[1].ystride = width / 2;
oi->planes[1].bitdepth = 8;
oi->planes[2].data = (unsigned char*)malloc(width * height / 2);
oi->planes[2].xdec = 1;
oi->planes[2].ydec = 1;
oi->planes[2].xstride = 1;
oi->planes[2].ystride = width / 2;
oi->planes[2].bitdepth = 8;
}
return oi;
}
|
/* Gtk+ User Interface Builder
* Copyright (C) 1998-1999 Damon Chaplin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <stdlib.h>
#include <glib.h>
#include <gdk/gdk.h>
#include "gladeconfig.h"
#include "debug.h"
static GDebugKey glade_debug_keys[] = {
{ "warnings", GLADE_DEBUG_WARNINGS },
{ "messages", GLADE_DEBUG_MESSAGES },
{ "properties", GLADE_DEBUG_PROPERTIES },
};
static guint glade_ndebug_keys = sizeof (glade_debug_keys) / sizeof (GDebugKey);
guint glade_debug_flags = 0; /* Global Glade debug flags. */
gboolean glade_debug_messages = FALSE; /* If debugging info is output. */
gboolean glade_debug_properties = FALSE; /* If property info is output. */
static void glade_log_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer unused_data);
void
glade_debug_init ()
{
gchar *env_string = NULL;
env_string = getenv ("GLADE_DEBUG");
if (env_string != NULL)
{
glade_debug_flags = g_parse_debug_string (env_string,
glade_debug_keys,
glade_ndebug_keys);
env_string = NULL;
if (glade_debug_flags & GLADE_DEBUG_MESSAGES)
glade_debug_messages = TRUE;
if (glade_debug_flags & GLADE_DEBUG_PROPERTIES)
glade_debug_properties = TRUE;
}
/* If the GLADE_DEBUG environment variable contains the 'warnings' option,
we tell GLib to abort() on warning and critical messages from Glade,
GTK, GDK and GLib. This can be handy for finding out exactly where the
WARNING/CRITICAL messages occur, with the help of a debugger. */
if (glade_debug_flags & GLADE_DEBUG_WARNINGS)
{
GLogLevelFlags fatal_mask;
fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
g_log_set_always_fatal (fatal_mask);
g_log_set_handler ("GLib", G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL
| G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL,
glade_log_handler, NULL);
g_log_set_handler ("Gdk", G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL
| G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL,
glade_log_handler, NULL);
g_log_set_handler ("Gtk", G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL
| G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL,
glade_log_handler, NULL);
g_log_set_handler (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL
| G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL,
glade_log_handler, NULL);
}
}
/* We try to make sure that any X grab is dropped before an abort() is called,
so we can still use gdb to get a stack trace. */
void
glade_log_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer unused_data)
{
g_log_default_handler (log_domain, log_level, message, unused_data);
if (log_level & G_LOG_FLAG_FATAL)
{
gdk_pointer_ungrab (GDK_CURRENT_TIME);
gdk_flush ();
}
}
|
#include <stdio.h>
#include <stdint.h>
typedef uint64_t queue_local_id; // The id of a specific frame within a queue
#include "alloc.h"
#include "log.h"
#include "buffer.h"
#include "bytestring.h"
#include "hash.h"
#include "bytestring_list.h"
#include "frame.h"
#include "frameparser.h"
#include "frameserializer.h"
#include "headerbundle.h"
#include "connection.h"
#include "connectionbundle.h"
#include "listener.h"
#include "queueconfig.h"
#include "storage.h"
#include "queue.h"
#include "subscription.h"
#include "framerouter.h"
#define LIMIT_FRAME_CMD_LINE_LEN 32
#define LIMIT_FRAME_HEADER_LINE_LEN 8192
#define LIMIT_FRAME_HEADER_LINE_COUNT 128
#define LIMIT_FRAME_BODY_LEN (1024 * 1024 * 10)
#define LIMIT_HEARTBEAT_FREQ_MIN 10000 // 10 seconds
#define DEFAULT_HEARTBEAT_FREQ 30000 // 30 seconds
#define DEFAULT_QUEUE_SIZE_MAX 1024 // 1024 frames
#define DEFAULT_QUEUE_NACK_MAX 20 // 20 nacks
#define NETWORK_READ_SIZE 4096 // Read in 4KiB chunks
|
#pragma once
#include <Box2DSprite.h>
class TTFB_Prop : public Box2DSprite{
public:
TTFB_Prop(Box2DWorld * _world, std::string _samplerResourceId, Shader * _shader = nullptr, float _scaleMult = 1.0f);
}; |
/***************************************************************************
* linphone_tunnel.cc
*
* Fri Dec 9, 2011
* Copyright 2011 Belledonne Communications
* Author: Guillaume Beraudo
* Email: guillaume dot beraudo at linphone dot org
****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphone_tunnel.h"
#include "linphonecore.h"
#include "private.h"
#include "lpconfig.h"
LinphoneTunnel* linphone_core_get_tunnel(const LinphoneCore *lc){
return lc->tunnel;
}
/*stubs to avoid to have #ifdef TUNNEL_ENABLED in upper layers*/
void linphone_tunnel_destroy(LinphoneTunnel *tunnel){
}
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config){
}
void linphone_tunnel_remove_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config){
}
const MSList *linphone_tunnel_get_servers(const LinphoneTunnel *tunnel){
return NULL;
}
void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel){
}
void linphone_tunnel_set_mode(LinphoneTunnel *tunnel, LinphoneTunnelMode mode) {
}
LinphoneTunnelMode linphone_tunnel_get_mode(const LinphoneTunnel *tunnel){
return LinphoneTunnelModeDisable;
}
bool_t linphone_tunnel_connected(const LinphoneTunnel *tunnel){
return FALSE;
}
void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, OrtpLogFunc logHandler){
}
void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel *tunnel, const char* username,const char* passwd){
}
void linphone_tunnel_set_http_proxy(LinphoneTunnel*tunnel, const char *host, int port, const char* username,const char* passwd){
}
void linphone_tunnel_get_http_proxy(LinphoneTunnel*tunnel,const char **host, int *port, const char **username, const char **passwd){
}
void linphone_tunnel_reconnect(LinphoneTunnel *tunnel){
}
void linphone_tunnel_configure(LinphoneTunnel *tunnel){
}
void linphone_tunnel_enable_sip(LinphoneTunnel *tunnel, bool_t enable) {}
bool_t linphone_tunnel_sip_enabled(const LinphoneTunnel *tunnel) { return FALSE; }
/* Deprecated functions */
void linphone_tunnel_enable(LinphoneTunnel *tunnel, bool_t enabled) {}
bool_t linphone_tunnel_enabled(const LinphoneTunnel *tunnel) { return FALSE; }
void linphone_tunnel_auto_detect(LinphoneTunnel *tunnel) {}
bool_t linphone_tunnel_auto_detect_enabled(LinphoneTunnel *tunnel) { return FALSE; }
|
#ifndef __BFI_FCPIM_H__
#define __BFI_FCPIM_H__
#include "bfi.h"
#include <protocol/fcp.h>
#pragma pack(1)
enum bfi_itnim_h2i {
BFI_ITNIM_H2I_CREATE_REQ = 1, /* i-t nexus creation */
BFI_ITNIM_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
};
enum bfi_itnim_i2h {
BFI_ITNIM_I2H_CREATE_RSP = BFA_I2HM(1),
BFI_ITNIM_I2H_DELETE_RSP = BFA_I2HM(2),
BFI_ITNIM_I2H_SLER_EVENT = BFA_I2HM(3),
};
struct bfi_itnim_create_req_s {
struct bfi_mhdr_s mh; /* common msg header */
u16 fw_handle; /* f/w handle for itnim */
u8 class; /* FC class for IO */
u8 seq_rec; /* sequence recovery support */
u8 msg_no; /* seq id of the msg */
};
struct bfi_itnim_create_rsp_s {
struct bfi_mhdr_s mh; /* common msg header */
u16 bfa_handle; /* bfa handle for itnim */
u8 status; /* fcp request status */
u8 seq_id; /* seq id of the msg */
};
struct bfi_itnim_delete_req_s {
struct bfi_mhdr_s mh; /* common msg header */
u16 fw_handle; /* f/w itnim handle */
u8 seq_id; /* seq id of the msg */
u8 rsvd;
};
struct bfi_itnim_delete_rsp_s {
struct bfi_mhdr_s mh; /* common msg header */
u16 bfa_handle; /* bfa handle for itnim */
u8 status; /* fcp request status */
u8 seq_id; /* seq id of the msg */
};
struct bfi_itnim_sler_event_s {
struct bfi_mhdr_s mh; /* common msg header */
u16 bfa_handle; /* bfa handle for itnim */
u16 rsvd;
};
union bfi_itnim_h2i_msg_u {
struct bfi_itnim_create_req_s *create_req;
struct bfi_itnim_delete_req_s *delete_req;
struct bfi_msg_s *msg;
};
union bfi_itnim_i2h_msg_u {
struct bfi_itnim_create_rsp_s *create_rsp;
struct bfi_itnim_delete_rsp_s *delete_rsp;
struct bfi_itnim_sler_event_s *sler_event;
struct bfi_msg_s *msg;
};
enum bfi_ioim_h2i {
BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */
BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */
};
enum bfi_ioim_i2h {
BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */
BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2),/* ABORT rsp */
};
struct bfi_ioim_dif_s {
u32 dif_info[4];
};
struct bfi_ioim_req_s {
struct bfi_mhdr_s mh; /* Common msg header */
u16 io_tag; /* I/O tag */
u16 rport_hdl; /* itnim/rport firmware handle */
struct fcp_cmnd_s cmnd; /* IO request info */
/**
* SG elements array within the IO request must be double word
* aligned. This aligment is required to optimize SGM setup for the IO.
*/
struct bfi_sge_s sges[BFI_SGE_INLINE_MAX];
u8 io_timeout;
u8 dif_en;
u8 rsvd_a[2];
struct bfi_ioim_dif_s dif;
};
enum bfi_ioim_status {
BFI_IOIM_STS_OK = 0,
BFI_IOIM_STS_HOST_ABORTED = 1,
BFI_IOIM_STS_ABORTED = 2,
BFI_IOIM_STS_TIMEDOUT = 3,
BFI_IOIM_STS_RES_FREE = 4,
BFI_IOIM_STS_SQER_NEEDED = 5,
BFI_IOIM_STS_PROTO_ERR = 6,
BFI_IOIM_STS_UTAG = 7,
BFI_IOIM_STS_PATHTOV = 8,
};
#define BFI_IOIM_SNSLEN (256)
struct bfi_ioim_rsp_s {
struct bfi_mhdr_s mh; /* common msg header */
u16 io_tag; /* completed IO tag */
u16 bfa_rport_hndl; /* releated rport handle */
u8 io_status; /* IO completion status */
u8 reuse_io_tag; /* IO tag can be reused */
u16 abort_tag; /* host abort request tag */
u8 scsi_status; /* scsi status from target */
u8 sns_len; /* scsi sense length */
u8 resid_flags; /* IO residue flags */
u8 rsvd_a;
u32 residue; /* IO residual length in bytes */
u32 rsvd_b[3];
};
struct bfi_ioim_abort_req_s {
struct bfi_mhdr_s mh; /* Common msg header */
u16 io_tag; /* I/O tag */
u16 abort_tag; /* unique request tag */
};
enum bfi_tskim_h2i {
BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */
BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */
};
enum bfi_tskim_i2h {
BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1),
};
struct bfi_tskim_req_s {
struct bfi_mhdr_s mh; /* Common msg header */
u16 tsk_tag; /* task management tag */
u16 itn_fhdl; /* itn firmware handle */
lun_t lun; /* LU number */
u8 tm_flags; /* see fcp_tm_cmnd_t */
u8 t_secs; /* Timeout value in seconds */
u8 rsvd[2];
};
struct bfi_tskim_abortreq_s {
struct bfi_mhdr_s mh; /* Common msg header */
u16 tsk_tag; /* task management tag */
u16 rsvd;
};
enum bfi_tskim_status {
/*
* Following are FCP-4 spec defined status codes,
* **DO NOT CHANGE THEM **
*/
BFI_TSKIM_STS_OK = 0,
BFI_TSKIM_STS_NOT_SUPP = 4,
BFI_TSKIM_STS_FAILED = 5,
/**
* Defined by BFA
*/
BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
};
struct bfi_tskim_rsp_s {
struct bfi_mhdr_s mh; /* Common msg header */
u16 tsk_tag; /* task mgmt cmnd tag */
u8 tsk_status; /* @ref bfi_tskim_status */
u8 rsvd;
};
#pragma pack()
#endif /* __BFI_FCPIM_H__ */
|
/* ReproMPI Benchmark
*
* Copyright 2015 Alexandra Carpen-Amarie, Sascha Hunold
Research Group for Parallel Computing
Faculty of Informatics
Vienna University of Technology, Austria
<license>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
</license>
*/
#ifndef SK_PARSE_OPTIONS_H_
#define SK_PARSE_OPTIONS_H_
void sk_parse_options(int argc, char **argv, reprompib_sync_options_t* opts_p);
#endif /* PARSE_OPTIONS_H_ */
|
/*-
* Copyright (c) 2003-2006 Benedikt Meurer <benny@xfce.org>.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU 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 __XFCE_MIME_HELPER_H__
#define __XFCE_MIME_HELPER_H__
#include <exo/exo.h>
G_BEGIN_DECLS
typedef enum /*< enum,prefix=XFCE_MIME_HELPER >*/
{
XFCE_MIME_HELPER_WEBBROWSER, /*< nick=WebBrowser >*/
XFCE_MIME_HELPER_MAILREADER, /*< nick=MailReader >*/
XFCE_MIME_HELPER_FILEMANAGER, /*< nick=FileManager >*/
XFCE_MIME_HELPER_TERMINALEMULATOR, /*< nick=TerminalEmulator >*/
XFCE_MIME_HELPER_N_CATEGORIES, /*< skip >*/
} XfceMimeHelperCategory;
typedef struct _XfceMimeHelperClass XfceMimeHelperClass;
typedef struct _XfceMimeHelper XfceMimeHelper;
#define XFCE_MIME_TYPE_HELPER (xfce_mime_helper_get_type ())
#define XFCE_MIME_HELPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_MIME_TYPE_HELPER, XfceMimeHelper))
#define XFCE_MIME_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_MIME_TYPE_HELPER, XfceMimeHelperClass))
#define XFCE_MIME_IS_HELPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_MIME_TYPE_HELPER))
#define XFCE_MIME_IS_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_MIME_TYPE_HELPER))
#define XFCE_MIME_HELPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_MIME_TYPE_HELPER, XfceMimeHelperClass))
GType xfce_mime_helper_get_type (void) G_GNUC_CONST;
XfceMimeHelperCategory xfce_mime_helper_get_category (const XfceMimeHelper *helper);
const gchar *xfce_mime_helper_get_id (const XfceMimeHelper *helper);
const gchar *xfce_mime_helper_get_name (const XfceMimeHelper *helper);
const gchar *xfce_mime_helper_get_icon (const XfceMimeHelper *helper);
const gchar *xfce_mime_helper_get_command (const XfceMimeHelper *helper);
gboolean xfce_mime_helper_execute (XfceMimeHelper *helper,
GdkScreen *screen,
const gchar *parameter,
GError **error);
#define XFCE_MIME_TYPE_HELPER_DATABASE (xfce_mime_helper_database_get_type ())
#define XFCE_MIME_HELPER_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_MIME_TYPE_HELPER_DATABASE, XfceMimeHelperDatabase))
#define XFCE_MIME_HELPER_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_MIME_TYPE_HELPER_DATABASE, XfceMimeHelperDatabaseClass))
#define XFCE_MIME_IS_HELPER_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_MIME_TYPE_HELPER_DATABASE))
#define XFCE_MIME_IS_HELPER_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_MIME_TYPE_HELPER_DATABASE))
#define XFCE_MIME_HELPER_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_MIME_TYPE_HELPER_DATABASE, XfceMimeHelperDatabaseClass))
typedef struct _XfceMimeHelperDatabaseClass XfceMimeHelperDatabaseClass;
typedef struct _XfceMimeHelperDatabase XfceMimeHelperDatabase;
GType xfce_mime_helper_database_get_type (void) G_GNUC_CONST;
XfceMimeHelperDatabase *xfce_mime_helper_database_get (void);
XfceMimeHelper *xfce_mime_helper_database_get_default (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category);
gboolean xfce_mime_helper_database_set_default (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category,
XfceMimeHelper *helper,
GError **error);
gboolean xfce_mime_helper_database_clear_default (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category,
GError **error);
GList *xfce_mime_helper_database_get_all (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category);
XfceMimeHelper *xfce_mime_helper_database_get_custom (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category);
void xfce_mime_helper_database_set_custom (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category,
const gchar *command);
gboolean xfce_mime_helper_database_get_dismissed (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category);
gboolean xfce_mime_helper_database_set_dismissed (XfceMimeHelperDatabase *database,
XfceMimeHelperCategory category,
gboolean dismissed);
G_END_DECLS
#endif /* !__XFCE_MIME_HELPER_H__ */
|
/*
* Copyright (c) 2007-2012 Inside Secure, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*******************************************************************************
Contains the implementation of the P2P initiator functions
*******************************************************************************/
#ifndef __WME_P2P_TARGET_H
#define __WME_P2P_TARGET_H
#if (P_BUILD_CONFIG == P_CONFIG_DRIVER) || (P_BUILD_CONFIG == P_CONFIG_MONOLITHIC)
void PP2PTargetStartDetection(
tContext * pContext
);
void PP2PTargetStopDetection(
tContext * pContext
);
#endif /* (P_BUILD_CONFIG == P_CONFIG_DRIVER) || (P_BUILD_CONFIG == P_CONFIG_MONOLITHIC) */
#endif /* __WME_P2P_TARGET_H */
|
/*
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Colin Durbridge G4EML
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(DMRDMOTX_H)
#define DMRDMOTX_H
#include "Config.h"
#include "DMRDefines.h"
#include "SerialRB.h"
class CDMRDMOTX {
public:
CDMRDMOTX();
uint8_t writeData(const uint8_t* data, uint8_t length);
void process();
void setTXDelay(uint8_t delay);
uint16_t getSpace() const;
private:
CSerialRB m_fifo;
arm_fir_instance_q15 m_modFilter;
q15_t m_modState[70U]; // NoTaps + BlockSize - 1, 42 + 20 - 1 plus some spare
uint8_t m_poBuffer[80U];
uint16_t m_poLen;
uint16_t m_poPtr;
uint16_t m_txDelay;
uint32_t m_count;
void writeByte(uint8_t c);
};
#endif
|
/***************************************************************************
qgsmultisurface.h
-------------------------------------------------------------------
Date : 28 Oct 2014
Copyright : (C) 2014 by Marco Hugentobler
email : marco.hugentobler at sourcepole dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSMULTISURFACEV2_H
#define QGSMULTISURFACEV2_H
#include "qgis_core.h"
#include "qgis.h"
#include "qgsgeometrycollection.h"
/** \ingroup core
* \class QgsMultiSurface
* \brief Multi surface geometry collection.
* \since QGIS 2.10
*/
class CORE_EXPORT QgsMultiSurface: public QgsGeometryCollection
{
public:
QgsMultiSurface();
QString geometryType() const override;
void clear() override;
QgsMultiSurface *clone() const override SIP_FACTORY;
QgsMultiSurface *toCurveType() const override SIP_FACTORY;
bool fromWkt( const QString &wkt ) override;
QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
QString asJSON( int precision = 17 ) const override;
bool addGeometry( QgsAbstractGeometry *g SIP_TRANSFER ) override;
bool insertGeometry( QgsAbstractGeometry *g SIP_TRANSFER, int index ) override;
QgsAbstractGeometry *boundary() const override SIP_FACTORY;
#ifndef SIP_RUN
/**
* Cast the \a geom to a QgsMultiSurface.
* Should be used by qgsgeometry_cast<QgsMultiSurface *>( geometry ).
*
* \note Not available in Python. Objects will be automatically be converted to the appropriate target type.
* \since QGIS 3.0
*/
inline const QgsMultiSurface *cast( const QgsAbstractGeometry *geom ) const
{
if ( !geom )
return nullptr;
QgsWkbTypes::Type flatType = QgsWkbTypes::flatType( geom->wkbType() );
if ( flatType == QgsWkbTypes::MultiSurface
|| flatType == QgsWkbTypes::MultiPolygon )
return static_cast<const QgsMultiSurface *>( geom );
return nullptr;
}
#endif
};
// clazy:excludeall=qstring-allocations
#endif // QGSMULTISURFACEV2_H
|
/*
gl_model_brush.c
model loading and caching
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
*/
// models are the only shared resource between a client and server running
// on the same machine.
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#include "console.h"
#include "glquake.h"
#include "model.h"
#include "qendian.h"
#include "quakefs.h"
int Mod_Fullbright (byte * skin, int width, int height, char *name);
extern model_t *loadmodel;
extern char loadname[];
extern byte *mod_base;
const int mod_lightmap_bytes = 3;
void
Mod_ProcessTexture (miptex_t *mt, texture_t *tx)
{
char name[32];
snprintf (name, sizeof (name), "fb_%s", mt->name);
tx->gl_fb_texturenum =
Mod_Fullbright ((byte *) (tx + 1), tx->width, tx->height, name);
tx->gl_texturenum =
GL_LoadTexture (mt->name, tx->width, tx->height, (byte *) (tx + 1),
true, false, 1);
}
/*
Mod_LoadLighting
*/
void
Mod_LoadLighting (lump_t *l)
{
int i;
byte *in, *out, *data;
byte d;
char litfilename[1024];
loadmodel->lightdata = NULL;
// LordHavoc: check for a .lit file to load
strcpy (litfilename, loadmodel->name);
COM_StripExtension (litfilename, litfilename);
strncat (litfilename, ".lit", sizeof (litfilename) - strlen (litfilename));
data = (byte *) COM_LoadHunkFile (litfilename);
if (data) {
if (data[0] == 'Q' && data[1] == 'L' && data[2] == 'I'
&& data[3] == 'T') {
i = LittleLong (((int *) data)[1]);
if (i == 1) {
Con_DPrintf ("%s loaded", litfilename);
loadmodel->lightdata = data + 8;
return;
} else
Con_Printf ("Unknown .lit file version (%d)\n", i);
} else
Con_Printf ("Corrupt .lit file (old version?), ignoring\n");
}
// LordHavoc: oh well, expand the white lighting data
if (!l->filelen)
return;
loadmodel->lightdata = Hunk_AllocName (l->filelen * 3, litfilename);
in = loadmodel->lightdata + l->filelen * 2; // place the file at the end,
// so it will not be
// overwritten until the very
// last write
out = loadmodel->lightdata;
memcpy (in, mod_base + l->fileofs, l->filelen);
for (i = 0; i < l->filelen; i++) {
d = *in++;
*out++ = d;
*out++ = d;
*out++ = d;
}
}
|
#ifndef __REDIS_CLIENT_H_
#define __REDIS_CLIENT_H_
#include <string>
#include <vector>
#include "hiredis.h"
#if 1
#define DBG printf("%s %d\n",__func__,__LINE__);
#else
#define DBG
#endif
#define XREDIS_ERR(format,...) printf(format,##__VA_ARGS__)
using namespace std;
//ip 和端口、权重
struct ip_port_pair
{
string ip;
int port;
int weight;
};
//将字符串形式的服务端地址端口权重转换成 struct ip_port_pair结构并放到 vector中
int string2svrlist(const char *svrs,vector<ip_port_pair> &svr_list);
//redis客户端
class redis_client{
public:
redis_client();
redis_client(string svrlist);
redis_client(string ip,int port,int weight);
redis_client(const char *ip,int port,int weight);
~redis_client();
void set_db(string db);//设置数据库名
void set_svr_list(string svrlist);//设置服务端列表
void set_connect_timeout(int);//设置连接超时时间
void set_op_timeout(int);//设置操作超时时间
int connect();//redis客户端连接函数,从服务端列表中选取一个服务端连接
int use_db();//使用数据库
int close();//关闭客户端
int is_connected();//判断客户端是不是在连接状态
int reconnect();//重新连接客户端
redisReply* do_command(const char* cmd);//执行redis命令
private:
vector<ip_port_pair> m_svrlist;//服务端列表
protected:
struct timeval m_connect_timeout;//连接超时时间
struct timeval m_op_timeout;//操作超时时间
string m_sdb_name;//数据库名称
redisContext* m_predis_contx;//连接库时返回的结构,包含所有连接状态信息
};
#endif //__REDIS_CLIENT_H_
/*
连接操作相关的命令
quit:关闭连接(connection)
auth:简单密码认证
持久化
save:将数据同步保存到磁盘
bgsave:将数据异步保存到磁盘
lastsave:返回上次成功将数据保存到磁盘的Unix时戳
shundown:将数据同步保存到磁盘,然后关闭服务
远程服务控制
info:提供服务器的信息和统计
monitor:实时转储收到的请求
slaveof:改变复制策略设置
config:在运行时配置Redis服务器
对value操作的命令
exists(key):确认一个key是否存在
del(key):删除一个key
type(key):返回值的类型
keys(pattern):返回满足给定pattern的所有key
randomkey:随机返回key空间的一个
keyrename(oldname, newname):重命名key
dbsize:返回当前数据库中key的数目
expire:设定一个key的活动时间(s)
ttl:获得一个key的活动时间
select(index):按索引查询
move(key, dbindex):移动当前数据库中的key到dbindex数据库
flushdb:删除当前选择数据库中的所有key
flushall:删除所有数据库中的所有key
对String操作的命令
set(key, value):给数据库中名称为key的string赋予值value
get(key):返回数据库中名称为key的string的value
getset(key, value):给名称为key的string赋予上一次的value
mget(key1, key2,…, key N):返回库中多个string的value
setnx(key, value):添加string,名称为key,值为value
setex(key, time, value):向库中添加string,设定过期时间time
mset(key N, value N):批量设置多个string的值
msetnx(key N, value N):如果所有名称为key i的string都不存在
incr(key):名称为key的string增1操作
incrby(key, integer):名称为key的string增加integer
decr(key):名称为key的string减1操作
decrby(key, integer):名称为key的string减少integer
append(key, value):名称为key的string的值附加value
substr(key, start, end):返回名称为key的string的value的子串
对List操作的命令
rpush(key, value):在名称为key的list尾添加一个值为value的元素
lpush(key, value):在名称为key的list头添加一个值为value的 元素
llen(key):返回名称为key的list的长度
lrange(key, start, end):返回名称为key的list中start至end之间的元素
ltrim(key, start, end):截取名称为key的list
lindex(key, index):返回名称为key的list中index位置的元素
lset(key, index, value):给名称为key的list中index位置的元素赋值
lrem(key, count, value):删除count个key的list中值为value的元素
lpop(key):返回并删除名称为key的list中的首元素
rpop(key):返回并删除名称为key的list中的尾元素
blpop(key1, key2,… key N, timeout):lpop命令的block版本。
brpop(key1, key2,… key N, timeout):rpop的block版本。
rpoplpush(srckey, dstkey):返回并删除名称为srckey的list的尾元素,并将该元素添加到名称为dstkey的list的头部
对Set操作的命令
sadd(key, member):向名称为key的set中添加元素member
srem(key, member) :删除名称为key的set中的元素member
spop(key) :随机返回并删除名称为key的set中一个元素
smove(srckey, dstkey, member) :移到集合元素
scard(key) :返回名称为key的set的基数
sismember(key, member) :member是否是名称为key的set的元素
sinter(key1, key2,…key N) :求交集
sinterstore(dstkey, (keys)) :求交集并将交集保存到dstkey的集合
sunion(key1, (keys)) :求并集
sunionstore(dstkey, (keys)) :求并集并将并集保存到dstkey的集合
sdiff(key1, (keys)) :求差集
sdiffstore(dstkey, (keys)) :求差集并将差集保存到dstkey的集合
smembers(key) :返回名称为key的set的所有元素
srandmember(key) :随机返回名称为key的set的一个元素
对Hash操作的命令
hset(key, field, value):向名称为key的hash中添加元素field
hget(key, field):返回名称为key的hash中field对应的value
hmget(key, (fields)):返回名称为key的hash中field i对应的value
hmset(key, (fields)):向名称为key的hash中添加元素field
hincrby(key, field, integer):将名称为key的hash中field的value增加integer
hexists(key, field):名称为key的hash中是否存在键为field的域
hdel(key, field):删除名称为key的hash中键为field的域
hlen(key):返回名称为key的hash中元素个数
hkeys(key):返回名称为key的hash中所有键
hvals(key):返回名称为key的hash中所有键对应的value
hgetall(key):返回名称为key的hash中所有的键(field)及其对应的value
*/
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef FLOWLAYOUT_H
#define FLOWLAYOUT_H
#include <QLayout>
#include <QRect>
#include <QStyle>
//! [0]
class FlowLayout : public QLayout
{
public:
explicit FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
void addItem(QLayoutItem *item) override;
int horizontalSpacing() const;
int verticalSpacing() const;
Qt::Orientations expandingDirections() const override;
bool hasHeightForWidth() const override;
int heightForWidth(int) const override;
int count() const override;
QLayoutItem *itemAt(int index) const override;
QSize minimumSize() const override;
void setGeometry(const QRect &rect) override;
QSize sizeHint() const override;
QLayoutItem *takeAt(int index) override;
private:
int doLayout(const QRect &rect, bool testOnly) const;
int smartSpacing(QStyle::PixelMetric pm) const;
QList<QLayoutItem *> itemList;
int m_hSpace;
int m_vSpace;
};
//! [0]
#endif // FLOWLAYOUT_H
|
/*
*
* Definitions for mount interface. This describes the in the kernel build
* linkedlist with mounted filesystems.
*
* Author: Marco van Wieringen <mvw@planets.elm.net>
*
*/
#ifndef _LINUX_MOUNT_H
#define _LINUX_MOUNT_H
#include <linux/types.h>
#include <linux/list.h>
#include <linux/nodemask.h>
#include <linux/spinlock.h>
#include <linux/seqlock.h>
#include <linux/atomic.h>
struct super_block;
struct vfsmount;
struct dentry;
struct mnt_namespace;
#define MNT_NOSUID 0x01
#define MNT_NODEV 0x02
#define MNT_NOEXEC 0x04
#define MNT_NOATIME 0x08
#define MNT_NODIRATIME 0x10
#define MNT_RELATIME 0x20
#define MNT_READONLY 0x40 /* does the user want this to be r/o? */
#define MNT_SHRINKABLE 0x100
#define MNT_WRITE_HOLD 0x200
#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */
#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */
/*
* MNT_SHARED_MASK is the set of flags that should be cleared when a
* mount becomes shared. Currently, this is only the flag that says a
* mount cannot be bind mounted, since this is how we create a mount
* that shares events with another mount. If you add a new MNT_*
* flag, consider how it interacts with shared mounts.
*/
#define MNT_SHARED_MASK (MNT_UNBINDABLE)
#define MNT_USER_SETTABLE_MASK (MNT_NOSUID | MNT_NODEV | MNT_NOEXEC \
| MNT_NOATIME | MNT_NODIRATIME | MNT_RELATIME \
| MNT_READONLY)
#define MNT_ATIME_MASK (MNT_NOATIME | MNT_NODIRATIME | MNT_RELATIME )
#define MNT_INTERNAL_FLAGS (MNT_SHARED | MNT_WRITE_HOLD | MNT_INTERNAL | \
MNT_MARKED)
#define MNT_INTERNAL 0x4000
#define MNT_LOCK_ATIME 0x040000
#define MNT_LOCK_NOEXEC 0x080000
#define MNT_LOCK_NOSUID 0x100000
#define MNT_LOCK_NODEV 0x200000
#define MNT_LOCK_READONLY 0x400000
#define MNT_MARKED 0x4000000
struct vfsmount {
struct dentry *mnt_root; /* root of the mounted tree */
struct super_block *mnt_sb; /* pointer to superblock */
int mnt_flags;
};
struct file; /* forward dec */
extern int mnt_want_write(struct vfsmount *mnt);
extern int mnt_want_write_file(struct file *file);
extern int mnt_clone_write(struct vfsmount *mnt);
extern void mnt_drop_write(struct vfsmount *mnt);
extern void mnt_drop_write_file(struct file *file);
extern void mntput(struct vfsmount *mnt);
extern struct vfsmount *mntget(struct vfsmount *mnt);
extern void mnt_pin(struct vfsmount *mnt);
extern void mnt_unpin(struct vfsmount *mnt);
extern int __mnt_is_readonly(struct vfsmount *mnt);
struct file_system_type;
extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
int flags, const char *name,
void *data);
extern void mnt_set_expiry(struct vfsmount *mnt, struct list_head *expiry_list);
extern void mark_mounts_for_expiry(struct list_head *mounts);
extern dev_t name_to_dev_t(char *name);
#endif /* _LINUX_MOUNT_H */
|
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <windows.h>
#include <winsock2.h>
#include "jvm.h"
#include "jni_util.h"
#include "net_util.h"
#include "java_net_AbstractPlainDatagramSocketImpl.h"
static jfieldID IO_fd_fdID;
static jfieldID apdsi_fdID;
/*
* Class: java_net_AbstractPlainDatagramSocketImpl
* Method: init
* Signature: ()V
*/
JNIEXPORT void JNICALL
Java_java_net_AbstractPlainDatagramSocketImpl_init(JNIEnv *env, jclass cls) {
apdsi_fdID = (*env)->GetFieldID(env, cls, "fd",
"Ljava/io/FileDescriptor;");
CHECK_NULL(apdsi_fdID);
IO_fd_fdID = NET_GetFileDescriptorID(env);
CHECK_NULL(IO_fd_fdID);
JNU_CHECK_EXCEPTION(env);
}
/*
* Class: java_net_AbstractPlainDatagramSocketImpl
* Method: dataAvailable
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_java_net_AbstractPlainDatagramSocketImpl_dataAvailable
(JNIEnv *env, jobject this) {
SOCKET fd;
int retval;
jobject fdObj = (*env)->GetObjectField(env, this, apdsi_fdID);
if (IS_NULL(fdObj)) {
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
"Socket closed");
return -1;
}
fd = (SOCKET)(*env)->GetIntField(env, fdObj, IO_fd_fdID);
if (ioctlsocket(fd, FIONREAD, &retval) < 0) {
return -1;
}
return retval;
}
|
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QGLRENDERORDER_H
#define QGLRENDERORDER_H
#include <Qt3D/qglscenenode.h>
#include <Qt3D/qglrenderstate.h>
QT_BEGIN_NAMESPACE
class Q_QT3D_EXPORT QGLRenderOrder
{
public:
explicit QGLRenderOrder(const QGLSceneNode *node_ = 0, const QGLRenderState &state_ = QGLRenderState())
: m_node(node_)
, m_state(state_)
{
}
~QGLRenderOrder() {}
uint effectHash() const;
bool isEqual(const QGLRenderOrder &rhs) const;
bool isLessThan(const QGLRenderOrder &rhs) const;
inline bool isValid() const;
inline bool operator!=(const QGLRenderOrder &rhs) const;
inline bool operator==(const QGLRenderOrder &rhs) const;
inline bool operator<(const QGLRenderOrder &rhs) const;
inline const QGLSceneNode *node() const;
inline void setState(const QGLRenderState &state);
inline QGLRenderState state() const;
inline QGLAbstractEffect *effectiveUserEffect() const;
inline QGL::StandardEffect effectiveStandardEffect() const;
inline QGLMaterial *effectiveMaterial() const;
inline QGLMaterial *effectiveBackMaterial() const;
inline bool effectiveHasEffect() const;
private:
const QGLSceneNode *m_node;
QGLRenderState m_state;
};
inline bool QGLRenderOrder::isValid() const
{
return m_node;
}
inline bool QGLRenderOrder::operator!=(const QGLRenderOrder &rhs) const
{
return !isEqual(rhs);
}
inline bool QGLRenderOrder::operator==(const QGLRenderOrder &rhs) const
{
return isEqual(rhs);
}
inline bool QGLRenderOrder::operator<(const QGLRenderOrder &rhs) const
{
return isLessThan(rhs);
}
inline const QGLSceneNode *QGLRenderOrder::node() const
{
return m_node;
}
inline QGLRenderState QGLRenderOrder::state() const
{
return m_state;
}
inline void QGLRenderOrder::setState(const QGLRenderState &state_)
{
m_state = state_;
}
inline QGLAbstractEffect *QGLRenderOrder::effectiveUserEffect() const
{
QGLAbstractEffect *result = 0;
if (m_node)
{
if (m_node->userEffect())
result = m_node->userEffect();
else if (m_state.userEffect())
result = m_state.userEffect();
}
return result;
}
inline QGL::StandardEffect QGLRenderOrder::effectiveStandardEffect() const
{
QGL::StandardEffect result = QGL::FlatColor;
if (m_node)
{
if (m_node->hasEffect())
result = m_node->effect();
else if (m_state.hasEffect())
result = m_state.standardEffect();
}
return result;
}
inline QGLMaterial *QGLRenderOrder::effectiveMaterial() const
{
QGLMaterial *result = 0;
if (m_node)
{
if (m_node->material())
result = m_node->material();
else if (m_state.material())
result = m_state.material();
}
return result;
}
inline QGLMaterial *QGLRenderOrder::effectiveBackMaterial() const
{
QGLMaterial *result = 0;
if (m_node)
{
if (m_node->backMaterial())
result = m_node->backMaterial();
else if (m_state.backMaterial())
result = m_state.backMaterial();
}
return result;
}
inline bool QGLRenderOrder::effectiveHasEffect() const
{
bool result = false;
if (m_node)
{
if (m_node->hasEffect())
result = true;
else
result = m_state.hasEffect();
}
return result;
}
inline uint qHash(const QGLRenderOrder &order)
{
quint64 result = order.effectHash();
return result ^ reinterpret_cast<quint64>(order.effectiveMaterial());
}
#ifndef QT_NO_DEBUG_STREAM
#include <QtCore/qdebug.h>
Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLRenderOrder &order);
#endif
QT_END_NAMESPACE
#endif // QGLRENDERORDER_H
|
/* linux/arch/arm/mach-s3c2410/s3c2410.c
*
* Copyright (c) 2003-2005 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* http://www.simtec.co.uk/products/EB2410ITX/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/syscore_ops.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/io.h>
#include <linux/platform_data/gpio-samsung-s3c24xx.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm/system_misc.h>
#include <plat/cpu-freq.h>
#include <mach/regs-clock.h>
#include <plat/regs-serial.h>
#include <plat/cpu.h>
#include <plat/devs.h>
#include <plat/clock.h>
#include <plat/pll.h>
#include <plat/pm.h>
#include <plat/watchdog-reset.h>
#include <plat/gpio-core.h>
#include <plat/gpio-cfg.h>
#include <plat/gpio-cfg-helpers.h>
#include "common.h"
/* Initial IO mappings */
static struct map_desc s3c2410_iodesc[] __initdata = {
IODESC_ENT(CLKPWR),
IODESC_ENT(TIMER),
IODESC_ENT(WATCHDOG),
};
/* our uart devices */
/* uart registration process */
void __init s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{
s3c24xx_init_uartdevs("s3c2410-uart", s3c2410_uart_resources, cfg, no);
}
/* s3c2410_map_io
*
* register the standard cpu IO areas, and any passed in from the
* machine specific initialisation.
*/
void __init s3c2410_map_io(void)
{
s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
iotable_init(s3c2410_iodesc, ARRAY_SIZE(s3c2410_iodesc));
}
void __init_or_cpufreq s3c2410_setup_clocks(void)
{
struct clk *xtal_clk;
unsigned long tmp;
unsigned long xtal;
unsigned long fclk;
unsigned long hclk;
unsigned long pclk;
xtal_clk = clk_get(NULL, "xtal");
xtal = clk_get_rate(xtal_clk);
clk_put(xtal_clk);
/* now we've got our machine bits initialised, work out what
* clocks we've got */
fclk = s3c24xx_get_pll(__raw_readl(S3C2410_MPLLCON), xtal);
tmp = __raw_readl(S3C2410_CLKDIVN);
/* work out clock scalings */
hclk = fclk / ((tmp & S3C2410_CLKDIVN_HDIVN) ? 2 : 1);
pclk = hclk / ((tmp & S3C2410_CLKDIVN_PDIVN) ? 2 : 1);
/* print brieft summary of clocks, etc */
printk("S3C2410: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral %ld.%03ld MHz\n",
print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
/* initialise the clocks here, to allow other things like the
* console to use them
*/
s3c24xx_setup_clocks(fclk, hclk, pclk);
}
/* fake ARMCLK for use with cpufreq, etc. */
static struct clk s3c2410_armclk = {
.name = "armclk",
.parent = &clk_f,
.id = -1,
};
static struct clk_lookup s3c2410_clk_lookup[] = {
CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p),
CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
};
void __init s3c2410_init_clocks(int xtal)
{
s3c24xx_register_baseclocks(xtal);
s3c2410_setup_clocks();
s3c2410_baseclk_add();
s3c24xx_register_clock(&s3c2410_armclk);
clkdev_add_table(s3c2410_clk_lookup, ARRAY_SIZE(s3c2410_clk_lookup));
samsung_wdt_reset_init(S3C24XX_VA_WATCHDOG);
}
struct bus_type s3c2410_subsys = {
.name = "s3c2410-core",
.dev_name = "s3c2410-core",
};
/* Note, we would have liked to name this s3c2410-core, but we cannot
* register two subsystems with the same name.
*/
struct bus_type s3c2410a_subsys = {
.name = "s3c2410a-core",
.dev_name = "s3c2410a-core",
};
static struct device s3c2410_dev = {
.bus = &s3c2410_subsys,
};
/* need to register the subsystem before we actually register the device, and
* we also need to ensure that it has been initialised before any of the
* drivers even try to use it (even if not on an s3c2410 based system)
* as a driver which may support both 2410 and 2440 may try and use it.
*/
static int __init s3c2410_core_init(void)
{
return subsys_system_register(&s3c2410_subsys, NULL);
}
core_initcall(s3c2410_core_init);
static int __init s3c2410a_core_init(void)
{
return subsys_system_register(&s3c2410a_subsys, NULL);
}
core_initcall(s3c2410a_core_init);
int __init s3c2410_init(void)
{
printk("S3C2410: Initialising architecture\n");
#ifdef CONFIG_PM
register_syscore_ops(&s3c2410_pm_syscore_ops);
register_syscore_ops(&s3c24xx_irq_syscore_ops);
#endif
return device_register(&s3c2410_dev);
}
int __init s3c2410a_init(void)
{
s3c2410_dev.bus = &s3c2410a_subsys;
return s3c2410_init();
}
void s3c2410_restart(enum reboot_mode mode, const char *cmd)
{
if (mode == REBOOT_SOFT) {
soft_restart(0);
}
samsung_wdt_reset();
/* we'll take a jump through zero as a poor second */
soft_restart(0);
}
|
/*
** rq_interpreter_error.c
**
** Written by Brett Hutley - brett@hutley.net
**
** Copyright (C) 2002-2008 Brett Hutley
**
** This file is part of the Risk Quantify Library
**
** Risk Quantify 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.
**
** Risk Quantify 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 Risk Quantify; if not, write to the Free
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "rq_interpreter_error.h"
#include <stdlib.h>
#include <string.h>
RQ_EXPORT rq_interpreter_error_t
rq_interpreter_error_alloc(const char *error_message)
{
struct rq_interpreter_error *i = (struct rq_interpreter_error *)RQ_MALLOC(
sizeof(struct rq_interpreter_error)
);
i->error_message = RQ_STRDUP(error_message);
return i;
}
RQ_EXPORT void
rq_interpreter_error_free(rq_interpreter_error_t i)
{
RQ_FREE((char *)i->error_message);
RQ_FREE(i);
}
RQ_EXPORT void
_rq_interpreter_error_free(void *ie)
{
rq_interpreter_error_free((rq_interpreter_error_t)ie);
}
RQ_EXPORT int
rq_interpreter_error_is_null(rq_interpreter_error_t obj)
{
return (obj == NULL);
}
RQ_EXPORT const char *
rq_interpreter_error_get_error_message(rq_interpreter_error_t i)
{
return i->error_message;
}
|
macro_line|#include <string.h>
macro_line|#include <stdio.h>
macro_line|#include <netdb.h>
DECL|function|githstrerror
r_const
r_char
op_star
id|githstrerror
c_func
(paren
r_int
id|err
)paren
(brace
r_static
r_char
id|buffer
(braket
l_int|48
)braket
suffix:semicolon
r_switch
c_cond
(paren
id|err
)paren
(brace
r_case
id|HOST_NOT_FOUND
suffix:colon
r_return
l_string|"Authoritative answer: host not found"
suffix:semicolon
r_case
id|NO_DATA
suffix:colon
r_return
l_string|"Valid name, no data record of requested type"
suffix:semicolon
r_case
id|NO_RECOVERY
suffix:colon
r_return
l_string|"Non recoverable errors, FORMERR, REFUSED, NOTIMP"
suffix:semicolon
r_case
id|TRY_AGAIN
suffix:colon
r_return
l_string|"Non-authoritative &bslash;"host not found&bslash;", or SERVERFAIL"
suffix:semicolon
)brace
id|snprintf
c_func
(paren
id|buffer
comma
r_sizeof
(paren
id|buffer
)paren
comma
l_string|"Name resolution error %d"
comma
id|err
)paren
suffix:semicolon
r_return
id|buffer
suffix:semicolon
)brace
eof
|
/* $Id$
*
* Copyright (C) 2006 The OpenNX Team
* Author: Fritz Elfert
*
* This program 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 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 Library 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 _OSDEP_H_
#define _OSDEP_H_
extern "C" {
extern const char *x11_socket_path;
extern const char *x11_keyboard_type;
#ifndef __WXMSW__
extern void reparent_pulldown(long);
extern void close_foreign(long);
extern void close_sid(const char *);
#endif
extern int inKdeSession;
#ifdef __WXMSW__
extern long getppid();
extern int checkMultiMonitors();
extern int CreateDetachedProcess(const char *cmdline);
extern int GetDetachedPID();
extern int getXmingPort(int firstfree);
#endif
#ifdef __WXMAC__
extern unsigned short macFirstFreePort(unsigned short startPort);
#endif
};
#endif
|
/*********************************************************************************
* Copyright (c) 2010-2011, Elliott Cooper-Balis
* Paul Rosenfeld
* Bruce Jacob
* University of Maryland
* dramninjas [at] gmail [dot] com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*********************************************************************************/
#ifndef CMDQUEUE_H
#define CMDQUEUE_H
//CommandQueue.h
//
//Header
//
#include "BusPacket.h"
#include "BankState.h"
#include "Transaction.h"
#include "SystemConfiguration.h"
#include "SimulatorObject.h"
#define FNV_PRIME_64 (1099511628211)
//typedef long long int int64_t;
#define RANK_MASK (NUM_RANKS-1)
#define BANK_MASK (NUM_BANKS-1)
using namespace std;
namespace DRAMSim
{
class CommandQueue : public SimulatorObject
{
CommandQueue();
ostream &dramsim_log;
int64_t index;
public:
//typedefs
typedef vector<BusPacket *> BusPacket1D;
typedef vector<BusPacket1D> BusPacket2D;
typedef vector<BusPacket2D> BusPacket3D;
//functions
CommandQueue(vector< vector<BankState> > &states, ostream &dramsim_log);
virtual ~CommandQueue();
void enqueue(BusPacket *newBusPacket);
bool pop(BusPacket **busPacket);
bool hasRoomFor(unsigned numberToEnqueue, unsigned rank, unsigned bank);
bool isIssuable(BusPacket *busPacket);
bool isEmpty(unsigned rank);
void needRefresh(unsigned rank);
void print();
void update(); //SimulatorObject requirement
vector<BusPacket *> &getCommandQueue(unsigned rank, unsigned bank);
//fields
BusPacket3D queues; // 3D array of BusPacket pointers
vector< vector<BankState> > &bankStates;
private:
void nextRankAndBank(unsigned &rank, unsigned &bank);
//fields
unsigned nextBank;
unsigned nextRank;
unsigned nextBankPRE;
unsigned nextRankPRE;
unsigned refreshRank;
bool refreshWaiting;
vector< vector<unsigned> > tFAWCountdown;
vector< vector<unsigned> > rowAccessCounters;
bool sendAct;
};
}
#endif
|
#ifndef BCM_PHS_DEFINES_H
#define BCM_PHS_DEFINES_H
#define PHS_INVALID_TABLE_INDEX 0xffffffff
/************************* MACROS **********************************************/
#define PHS_MEM_TAG "_SHP"
//PHS Defines
#define STATUS_PHS_COMPRESSED 0xa1
#define STATUS_PHS_NOCOMPRESSION 0xa2
#define APPLY_PHS 1
#define MAX_NO_BIT 7
#define ZERO_PHSI 0
#define VERIFY 0
#define SIZE_MULTIPLE_32 4
#define UNCOMPRESSED_PACKET 0
#define DYNAMIC 0
#define SUPPRESS 0x80
#define NO_CLASSIFIER_MATCH 0
#define SEND_PACKET_UNCOMPRESSED 0
#define PHSI_IS_ZERO 0
#define PHSI_LEN 1
#define ERROR_LEN 0
#define PHS_BUFFER_SIZE 1532
//#define MAX_PHS_LENGTHS 100
#define MAX_PHSRULE_PER_SF 20
#define MAX_SERVICEFLOWS 17
//PHS Error Defines
#define PHS_SUCCESS 0
#define ERR_PHS_INVALID_DEVICE_EXETENSION 0x800
#define ERR_PHS_INVALID_PHS_RULE 0x801
#define ERR_PHS_RULE_ALREADY_EXISTS 0x802
#define ERR_SF_MATCH_FAIL 0x803
#define ERR_INVALID_CLASSIFIERTABLE_FOR_SF 0x804
#define ERR_SFTABLE_FULL 0x805
#define ERR_CLSASSIFIER_TABLE_FULL 0x806
#define ERR_PHSRULE_MEMALLOC_FAIL 0x807
#define ERR_CLSID_MATCH_FAIL 0x808
#define ERR_PHSRULE_MATCH_FAIL 0x809
typedef struct _S_PHS_RULE
{
/// brief 8bit PHSI Of The Service Flow
B_UINT8 u8PHSI;
/// brief PHSF Of The Service Flow
B_UINT8 u8PHSFLength;
B_UINT8 u8PHSF[MAX_PHS_LENGTHS];
/// brief PHSM Of The Service Flow
B_UINT8 u8PHSMLength;
B_UINT8 u8PHSM[MAX_PHS_LENGTHS];
/// brief 8bit PHSS Of The Service Flow
B_UINT8 u8PHSS;
/// brief 8bit PHSV Of The Service Flow
B_UINT8 u8PHSV;
//Reference Count for this PHS Rule
B_UINT8 u8RefCnt;
//Flag to Store Unclassified PHS rules only in DL
B_UINT8 bUnclassifiedPHSRule;
B_UINT8 u8Reserved[3];
LONG PHSModifiedBytes;
ULONG PHSModifiedNumPackets;
ULONG PHSErrorNumPackets;
}S_PHS_RULE;
typedef enum _E_CLASSIFIER_ENTRY_CONTEXT
{
eActiveClassifierRuleContext,
eOldClassifierRuleContext
}E_CLASSIFIER_ENTRY_CONTEXT;
typedef struct _S_CLASSIFIER_ENTRY
{
B_UINT8 bUsed;
B_UINT16 uiClassifierRuleId;
B_UINT8 u8PHSI;
S_PHS_RULE *pstPhsRule;
B_UINT8 bUnclassifiedPHSRule;
}S_CLASSIFIER_ENTRY;
typedef struct _S_CLASSIFIER_TABLE
{
B_UINT16 uiTotalClassifiers;
S_CLASSIFIER_ENTRY stActivePhsRulesList[MAX_PHSRULE_PER_SF];
S_CLASSIFIER_ENTRY stOldPhsRulesList[MAX_PHSRULE_PER_SF];
B_UINT16 uiOldestPhsRuleIndex;
}S_CLASSIFIER_TABLE;
typedef struct _S_SERVICEFLOW_ENTRY
{
B_UINT8 bUsed;
B_UINT16 uiVcid;
S_CLASSIFIER_TABLE *pstClassifierTable;
}S_SERVICEFLOW_ENTRY;
typedef struct _S_SERVICEFLOW_TABLE
{
B_UINT16 uiTotalServiceFlows;
S_SERVICEFLOW_ENTRY stSFList[MAX_SERVICEFLOWS];
}S_SERVICEFLOW_TABLE;
typedef struct _PHS_DEVICE_EXTENSION
{
/* PHS Specific data*/
S_SERVICEFLOW_TABLE *pstServiceFlowPhsRulesTable;
void *CompressedTxBuffer;
void *UnCompressedRxBuffer;
}PHS_DEVICE_EXTENSION,*PPHS_DEVICE_EXTENSION;
#endif
|
/*
Copyright (C) 2015-2019 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file LICENSE for details.
*/
#include "kernel/types.h"
#include "kernel/ascii.h"
#include "library/malloc.h"
#include "library/string.h"
#include "library/malloc.h"
#include "stdarg.h"
void strcpy(char *d, const char *s)
{
while(*s) {
*d++ = *s++;
}
*d = 0;
}
void strncpy(char *d, const char *s, unsigned length)
{
while(*s && length--) {
*d++ = *s++;
}
*d = 0;
}
char * strdup(const char *s)
{
char * d = (char *)malloc((strlen(s)+1) * sizeof(char));
char * tmp = d;
while(*s) {
*tmp++ = *s++;
}
*tmp = 0;
return d;
}
int strcmp(const char *a, const char *b)
{
while(1) {
if(*a < *b) {
return -1;
} else if(*a > *b) {
return 1;
} else if(*a == 0) {
return 0;
} else {
a++;
b++;
}
}
}
int strncmp(const char *a, const char *b, unsigned length)
{
while(length > 0) {
if(*a < *b) {
return -1;
} else if(*a > *b) {
return 1;
} else if(*a == 0) {
return 0;
} else {
a++;
b++;
length--;
}
}
return 0;
}
unsigned strlen(const char *s)
{
unsigned len = 0;
while(*s) {
len++;
s++;
}
return len;
}
char *strrev(char *s)
{
unsigned start = 0;
unsigned end = strlen(s) - 1;
char swap;
while(start < end) {
swap = s[start];
s[start] = s[end];
s[end] = swap;
start++;
end--;
}
return s;
}
char *strcat(char *d, const char *s)
{
strcpy(d + strlen(d), s);
return d;
}
const char *strchr(const char *s, char ch)
{
while(*s) {
if(*s == ch)
return s;
s++;
}
return 0;
}
char *strtok(char *s, const char *delim)
{
static char *oldword = 0;
char *word;
if(!s)
s = oldword;
while(*s && strchr(delim, *s))
s++;
if(!*s) {
oldword = s;
return 0;
}
word = s;
while(*s && !strchr(delim, *s))
s++;
if(*s) {
*s = 0;
oldword = s + 1;
} else {
oldword = s;
}
return word;
}
int str2int(const char *s, int *d)
{
int val = 0;
for(; *s; ++s) {
val *= 10;
if(*s > ASCII_9 || *s < ASCII_0) {
return 0;
}
val += (*s - '0');
}
*d = val;
return 1;
}
void memset(void *vd, char value, unsigned length)
{
char *d = vd;
while(length) {
*d = value;
length--;
d++;
}
}
void memcpy(void *vd, const void *vs, unsigned length)
{
char *d = vd;
const char *s = vs;
while(length) {
*d = *s;
d++;
s++;
length--;
}
}
extern void printf_putstring(const char *str);
extern void printf_putchar(char c);
static void printf_puthexdigit(uint8_t i)
{
if(i < 10) {
printf_putchar('0' + i);
} else {
printf_putchar('a' + i - 10);
}
}
static void printf_puthex(uint32_t i)
{
int j;
for(j = 28; j >= 0; j = j - 4) {
printf_puthexdigit((i >> j) & 0x0f);
}
}
static void printf_putint(int32_t i)
{
int f, d;
if(i < 0 && i != 0) {
printf_putchar('-');
i = -i;
}
f = 1;
while((i / f) >= 10) {
f *= 10;
}
while(f > 0) {
d = i / f;
printf_putchar('0' + d);
i = i - d * f;
f = f / 10;
}
}
static void printf_putuint(uint32_t u)
{
int f, d;
f = 1;
while((u / f) >= 10) {
f *= 10;
}
while(f > 0) {
d = u / f;
printf_putchar('0' + d);
u = u - d * f;
f = f / 10;
}
}
void printf(const char *s, ...)
{
va_list args;
uint32_t u;
int32_t i;
char *str;
va_start(args, s);
while(*s) {
if(*s != '%') {
printf_putchar(*s);
} else {
s++;
switch (*s) {
case 'd':
i = va_arg(args, int32_t);
printf_putint(i);
break;
case 'u':
u = va_arg(args, uint32_t);
printf_putuint(u);
break;
case 'x':
u = va_arg(args, uint32_t);
printf_puthex(u);
break;
case 's':
str = va_arg(args, char *);
printf_putstring(str);
break;
case 'c':
u = va_arg(args, int32_t);
printf_putchar(u);
break;
case 0:
return;
break;
default:
printf_putchar(*s);
break;
}
}
s++;
}
va_end(args);
}
char *uint_to_string(uint32_t u, char *s)
{
uint32_t f, d, i;
f = 1;
i = 0;
while((u / (f * 10)) > 0) {
f *= 10;
}
while(f > 0) {
d = u / f;
s[i] = '0' + d;
u = u % f;
f = f / 10;
i++;
}
s[i] = 0;
return s;
}
|
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *fp;
while (1) {
fp = fopen("txt.x", "w");
if (fp == NULL) {
perror("fopen failed");
exit(1);
}
fclose(fp);
}
return 0;
} |
#ifndef TESTS_LIBMQTT_CCL_TEST_HEADER_FILES_MAIN_H
#define TESTS_LIBMQTT_CCL_TEST_HEADER_FILES_MAIN_H
#include "ccl_mqtt.h"
#include "ccl_test.h"
// === test execution functions ================================================
constexpr int test_cnt = 2;
void test_varint();
void test_mqtt();
#endif
|
/* Test sp_cursorprepare / sp_cursorexecute usage to support SELECT FOR UPDATE
* This test compiles and works fine with SQL Server Native Client, and uses
* the sp_cursor* AIP Server Cursors ...
*/
#include "common.h"
static char software_version[] = "$Id: cursor4.c,v 1.10 2011-07-12 10:16:59 freddy77 Exp $";
static void *no_unused_var_warn[] = { software_version, no_unused_var_warn };
static void
exec_direct(const char *stmt)
{
SQLHSTMT odbc_stmt = SQL_NULL_HSTMT;
CHKAllocHandle(SQL_HANDLE_STMT, (SQLHANDLE) odbc_conn, (SQLHANDLE *) & odbc_stmt, "S");
odbc_command(stmt);
CHKFreeHandle(SQL_HANDLE_STMT, (SQLHANDLE) odbc_stmt, "S");
}
int
main(int argc, char **argv)
{
char buff[64];
SQLLEN ind;
odbc_use_version3 = 1;
odbc_connect();
odbc_check_cursor();
exec_direct("CREATE TABLE #t1 ( k INT, c VARCHAR(20))");
exec_direct("INSERT INTO #t1 VALUES (1, 'aaa')");
odbc_reset_statement();
CHKSetStmtAttr(SQL_ATTR_CONCURRENCY, (SQLPOINTER) SQL_CONCUR_LOCK, SQL_IS_UINTEGER, "S");
CHKSetCursorName(T("c112"), SQL_NTS, "S");
CHKPrepare(T("SELECT * FROM #t1 FOR UPDATE"), SQL_NTS, "S");
exec_direct("BEGIN TRANSACTION");
CHKExecute("S");
CHKFetch("S");
exec_direct("UPDATE #t1 SET c = 'xxx' WHERE CURRENT OF c112");
CHKCloseCursor("SI");
exec_direct("COMMIT TRANSACTION");
CHKExecDirect(T("SELECT c FROM #t1 WHERE k = 1"), SQL_NTS, "S");
CHKFetch("S");
CHKGetData(1, SQL_C_CHAR, buff, sizeof(buff), &ind, "S");
printf(">> New value after update = [%s] (should be [xxx]) \n", buff);
CHKFreeHandle(SQL_HANDLE_STMT, (SQLHANDLE) odbc_stmt, "S");
odbc_stmt = SQL_NULL_HSTMT;
odbc_disconnect();
return 0;
}
|
/*
* Copyright (C) Kreogist Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KNMUSICPLAYLISTM3U8PARSER_H
#define KNMUSICPLAYLISTM3U8PARSER_H
#include "knmusicplaylistm3uparser.h"
/*!
* \brief The KNMusicPlaylistM3u8Parser class is a parser for M3U8 format
* playlist. Actually it's the same as m3u. But only force use UTF-8 to read the
* file.
*/
class KNMusicPlaylistM3u8Parser : public KNMusicPlaylistM3uParser
{
Q_OBJECT
public:
/*!
* \brief Construct a KNMusicPlaylistM3u8Parser object.
* \param parent The parent object.
*/
explicit KNMusicPlaylistM3u8Parser(QObject *parent = 0);
/*!
* \brief Reimplemented from KNMusicPlaylistXspfParser::description().
*/
QString description() Q_DECL_OVERRIDE;
/*!
* \brief Reimplemented from KNMusicPlaylistXspfParser::suffix().
*/
QString suffix() Q_DECL_OVERRIDE;
/*!
* \brief Reimplemented from KNMusicPlaylistM3uParser::read().
*/
KNMusicPlaylistModel *read(const QString &filePath) Q_DECL_OVERRIDE;
};
#endif // KNMUSICPLAYLISTM3U8PARSER_H
|
/* ============================================================
*
* This file is a part of kipi-plugins project
* http://www.digikam.org
*
* Date : 2012-06-14
* Description : Integration of the Photivo RAW-Processor.
*
* Copyright (C) 2012 by Dominic Lyons <domlyons at googlemail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation;
* either version 2, 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.
*
* ============================================================ */
#ifndef PLUGIN_PHOTIVOINTEGRATION_H
#define PLUGIN_PHOTIVOINTEGRATION_H
// Qt includes
#include <QVariant>
// Libkipi includes
#include <KIPI/Plugin>
// local includes
#include "piwindow.h"
// forward declaration:
namespace KIPI
{
class Interface;
}
using namespace KIPI;
namespace KIPIPhotivoIntegrationPlugin
{
// forward declaration:
class PIWindow;
// ----------------------------------------------------------------------------
class Plugin_PhotivoIntegration : public Plugin
{
Q_OBJECT
public:
/** Notice the constructor
takes two arguments QObject* const parent (the parent of this object),
and const QStringList& args (the arguments passed).
*/
Plugin_PhotivoIntegration(QObject* const parent, const QVariantList& args);
virtual ~Plugin_PhotivoIntegration();
void setup(QWidget* const);
private slots:
/** This is an example slot to which your action is connected.
*/
void slotActivate();
private:
void setupActions();
private:
/** This is the plugin action that KIPI host application will plug into menu.
*/
QAction * m_action;
/** this is the interface instance to plugin host application. Note that you can get it everywhere in your plugin using
* instance of KIPI::PluginLoader singleton which provide a method for that.
*/
Interface* m_iface;
/** PIWindow instance */
PIWindow* piWin;
};
// ----------------------------------------------------------------------------
} // namespace KIPIPhotivoIntegrationPlugin
#endif // PLUGIN_PHOTIVOINTEGRATION_H
|
#ifndef __LINUX_MDIO_BITBANG_H
#define __LINUX_MDIO_BITBANG_H
#include <linux/phy.h>
#include <linux/module.h>
struct mdiobb_ctrl;
struct mdiobb_ops {
struct module *owner;
void (*set_mdc)(struct mdiobb_ctrl *ctrl, int level);
void (*set_mdio_dir)(struct mdiobb_ctrl *ctrl, int output);
void (*set_mdio_data)(struct mdiobb_ctrl *ctrl, int value);
int (*get_mdio_data)(struct mdiobb_ctrl *ctrl);
};
struct mdiobb_ctrl {
const struct mdiobb_ops *ops;
};
struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl);
void free_mdio_bitbang(struct mii_bus *bus);
#endif
|
/*
* Copyright (C) 2004-2012 See the AUTHORS file for details.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#ifndef _TEMPLATE_H
#define _TEMPLATE_H
#include <znc/zncconfig.h>
#include <znc/Utils.h>
#include <iostream>
#include <list>
class CTemplate;
class CTemplateTagHandler {
public:
CTemplateTagHandler() {}
virtual ~CTemplateTagHandler() {}
virtual bool HandleVar(CTemplate& Tmpl, const CString& sName, const CString& sArgs, CString& sOutput) {
return false;
}
virtual bool HandleTag(CTemplate& Tmpl, const CString& sName, const CString& sArgs, CString& sOutput) {
return false;
}
virtual bool HandleIf(CTemplate& Tmpl, const CString& sName, const CString& sArgs, CString& sOutput) {
return HandleVar(Tmpl, sName, sArgs, sOutput);
}
virtual bool HandleValue(CTemplate& Tmpl, CString& sValue, const MCString& msOptions) {
return false;
}
private:
};
class CTemplate;
class CTemplateOptions {
public:
CTemplateOptions() {
m_eEscapeFrom = CString::EASCII;
m_eEscapeTo = CString::EASCII;
}
virtual ~CTemplateOptions() {}
void Parse(const CString& sLine);
// Getters
CString::EEscape GetEscapeFrom() const { return m_eEscapeFrom; }
CString::EEscape GetEscapeTo() const { return m_eEscapeTo; }
// !Getters
private:
CString::EEscape m_eEscapeFrom;
CString::EEscape m_eEscapeTo;
};
class CTemplateLoopContext {
public:
CTemplateLoopContext(unsigned long uFilePos, const CString& sLoopName, bool bReverse, std::vector<CTemplate*>* pRows) {
m_uFilePosition = uFilePos;
m_sName = sLoopName;
m_uRowIndex = 0;
m_bReverse = bReverse;
m_pvRows = pRows;
m_bHasData = false;
}
virtual ~CTemplateLoopContext() {}
// Setters
void SetHasData(bool b = true) { m_bHasData = b; }
void SetName(const CString& s) { m_sName = s; }
void SetRowIndex(unsigned int u) { m_uRowIndex = u; }
unsigned int IncRowIndex() { return ++m_uRowIndex; }
unsigned int DecRowIndex() { if (m_uRowIndex == 0) { return 0; } return --m_uRowIndex; }
void SetFilePosition(unsigned int u) { m_uFilePosition = u; }
// !Setters
// Getters
bool HasData() const { return m_bHasData; }
const CString& GetName() const { return m_sName; }
unsigned long GetFilePosition() const { return m_uFilePosition; }
unsigned int GetRowIndex() const { return m_uRowIndex; }
size_t GetRowCount() { return m_pvRows->size(); }
std::vector<CTemplate*>* GetRows() { return m_pvRows; }
CTemplate* GetNextRow() { return GetRow(IncRowIndex()); }
CTemplate* GetCurRow() { return GetRow(m_uRowIndex); }
CTemplate* GetRow(unsigned int uIndex);
CString GetValue(const CString& sName, bool bFromIf = false);
// !Getters
private:
bool m_bReverse; //!< Iterate through this loop in reverse order
bool m_bHasData; //!< Tells whether this loop has real data or not
CString m_sName; //!< The name portion of the <?LOOP name?> tag
unsigned int m_uRowIndex; //!< The index of the current row we're on
unsigned long m_uFilePosition; //!< The file position of the opening <?LOOP?> tag
std::vector<CTemplate*>* m_pvRows; //!< This holds pointers to the templates associated with this loop
};
class CTemplate : public MCString {
public:
CTemplate() : MCString(), m_spOptions(new CTemplateOptions) {
Init();
}
CTemplate(const CString& sFileName) : MCString(), m_sFileName(sFileName), m_spOptions(new CTemplateOptions) {
Init();
}
CTemplate(const CSmartPtr<CTemplateOptions>& Options, CTemplate* pParent = NULL) : MCString(), m_spOptions(Options) {
Init();
m_pParent = pParent;
}
virtual ~CTemplate();
//! Class for implementing custom tags in subclasses
void AddTagHandler(CSmartPtr<CTemplateTagHandler> spTagHandler) {
m_vspTagHandlers.push_back(spTagHandler);
}
std::vector<CSmartPtr<CTemplateTagHandler> >& GetTagHandlers() {
if (m_pParent) {
return m_pParent->GetTagHandlers();
}
return m_vspTagHandlers;
}
CString ResolveLiteral(const CString& sString);
void Init();
CTemplate* GetParent(bool bRoot);
CString ExpandFile(const CString& sFilename, bool bFromInc = false);
bool SetFile(const CString& sFileName);
void SetPath(const CString& sPath); // Sets the dir:dir:dir type path to look at for templates, as of right now no ../../.. protection
CString MakePath(const CString& sPath) const;
void PrependPath(const CString& sPath, bool bIncludesOnly = false);
void AppendPath(const CString& sPath, bool bIncludesOnly = false);
void RemovePath(const CString& sPath);
void ClearPaths();
bool PrintString(CString& sRet);
bool Print(std::ostream& oOut);
bool Print(const CString& sFileName, std::ostream& oOut);
bool ValidIf(const CString& sArgs);
bool ValidExpr(const CString& sExpr);
bool IsTrue(const CString& sName);
bool HasLoop(const CString& sName);
CString GetValue(const CString& sName, bool bFromIf = false);
CTemplate& AddRow(const CString& sName);
CTemplate* GetRow(const CString& sName, unsigned int uIndex);
std::vector<CTemplate*>* GetLoop(const CString& sName);
void DelCurLoopContext();
CTemplateLoopContext* GetCurLoopContext();
CTemplate* GetCurTemplate();
// Getters
const CString& GetFileName() const { return m_sFileName; }
// !Getters
private:
CTemplate* m_pParent;
CString m_sFileName;
std::list<std::pair<CString, bool> > m_lsbPaths;
std::map<CString, std::vector<CTemplate*> > m_mvLoops;
std::vector<CTemplateLoopContext*> m_vLoopContexts;
CSmartPtr<CTemplateOptions> m_spOptions;
std::vector<CSmartPtr<CTemplateTagHandler> > m_vspTagHandlers;
};
#endif // !_TEMPLATE_H
|
#include "infiniband/list_queue.h"
#include <stdlib.h>
#include <stdio.h>
void lq_init (lq *q)
{
q->head = NULL;
q->tail = NULL;
pthread_mutex_init(&(q->mut), NULL);
}
void lq_enq (lq *q, void *data)
{
pthread_mutex_lock(&(q->mut));
lq_d *d;
d = (lq_d*) malloc(sizeof(lq_d));
d->next = NULL;
d->data = data;
if (q->head == NULL && q->tail == NULL) {
q->head = d;
q->tail = d;
} else {
q->tail->next = d;
q->tail = d;
}
// debug(fprintf(stderr, "RDMA lib: COMM: Qued: %p\n", data),2);
pthread_mutex_unlock(&(q->mut));
}
void* lq_deq (lq *q) {
pthread_mutex_lock(&(q->mut));
lq_d *deq_d;
void* data;
if (q->head == NULL) {
return NULL;
} else {
data = q->head->data;
deq_d = q->head;
q->head = q->head->next;
free(deq_d);
if (q->head == NULL) {
q->tail = NULL;
}
}
pthread_mutex_unlock(&(q->mut));
return data;
}
void lq_init_it (lq* q) {
pthread_mutex_lock(&(q->mut));
q->cur = q->head;
return;
}
void lq_fin_it (lq* q) {
q->cur = NULL;
pthread_mutex_unlock(&(q->mut));
return ;
}
void* lq_next(lq* q) {
lq_d *d = q->cur;
if (d == NULL) {
return NULL;
}
q->cur = q->cur->next;
return d->data;
}
void lq_remove(lq* q, void* d) {
lq_d* cur_d = q->head;
lq_d* old_d;
if (cur_d->data == d){
// printf("%p = %p\n", cur_d, d);
q->head = cur_d->next;
if (q->head == NULL) {
q->tail = NULL;
}
// debug(fprintf(stderr, "RDMA lib: COMM: Rmvd: %p\n", d), 2);
return ;
}
old_d = cur_d;
cur_d = cur_d->next;
while(cur_d !=NULL){
if (cur_d->data == d) {
// printf("%p = %p\n", cur_d, d);
old_d->next = cur_d->next;
free(cur_d);
return;
}
// printf("%p != %p\n", cur_d, d);
old_d = cur_d;
cur_d = cur_d->next;
}
return;
}
/*
int main() {
lq q;
int a, b, c;
int *v;
a = 1;
b = 2;
c = 3;
lq_init(&q);
lq_enq(&q, &a);
printf("enq: %d\n", a);
lq_enq(&q, &b);
printf("enq: %d\n", b);
v = lq_deq(&q);
printf("deq: %d\n", *v);
v = lq_deq(&q);
printf("deq: %d\n", *v);
lq_enq(&q, &c);
printf("enq: %d\n", c);
lq_enq(&q, &c);
printf("enq: %d\n", c);
v = lq_deq(&q);
printf("deq: %d\n", *v);
v = lq_deq(&q);
printf("deq: %d\n", *v);
lq_enq(&q, &a);
printf("enq: %d\n", a);
lq_enq(&q, &b);
printf("enq: %d\n", b);
lq_enq(&q, &a);
printf("enq: %d\n", a);
lq_enq(&q, &b);
printf("enq: %d\n", b);
lq_enq(&q, &a);
printf("enq: %d\n", a);
lq_enq(&q, &b);
printf("enq: %d\n", b);
lq_d *d, *d_;
d = q.head;
while (d != NULL) {
int *x = d->data;
printf("%d\n", *x);
if (*x == 1) {
d_ = lq_next(d);
lq_remove(&q, d);
d = d_;
continue;
}
d = lq_next(d);
}
v = lq_deq(&q);
printf("deq: %d\n", *v);
v = lq_deq(&q);
printf("deq: %d\n", *v);
v = lq_deq(&q);
printf("deq: %d\n", *v);
v = lq_deq(&q);
printf("deq: %d\n", *v);
}
*/
|
/*
* LEON Spurious Trap Handler
*
* This is just enough of a trap handler to let us know what
* the likely source of the trap was.
*
* Developed as part of the port of RTEMS to the LEON implementation
* of the SPARC by On-Line Applications Research Corporation (OAR)
* under contract to the European Space Agency (ESA).
*
* COPYRIGHT (c) 1995. European Space Agency.
*
* This terms of the RTEMS license apply to this file.
*
* $Id$
*/
#include <bsp.h>
#include <rtems/bspIo.h>
/*
* bsp_spurious_handler
*
* Print a message on the debug console and then die
*/
rtems_isr bsp_spurious_handler(
rtems_vector_number trap,
CPU_Interrupt_frame *isf
)
{
uint32_t real_trap;
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
printk( "Unexpected trap (%2d) at address 0x%08x\n", real_trap, isf->tpc);
switch (real_trap) {
/*
* First the ones defined by the basic architecture
*/
case 0x00:
printk( "reset\n" );
break;
case 0x01:
printk( "instruction access exception\n" );
break;
case 0x02:
printk( "illegal instruction\n" );
break;
case 0x03:
printk( "privileged instruction\n" );
break;
case 0x04:
printk( "fp disabled\n" );
break;
case 0x07:
printk( "memory address not aligned\n" );
break;
case 0x08:
printk( "fp exception\n" );
break;
case 0x09:
printk("data access exception at 0x%08x\n", LEON_REG.Failed_Address );
break;
case 0x0A:
printk( "tag overflow\n" );
break;
/*
* Then the ones defined by the LEON in particular
*/
case LEON_TRAP_TYPE( LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR ):
printk( "LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_2_RX_TX ):
printk( "LEON_INTERRUPT_UART_2_RX_TX\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_1_RX_TX ):
printk( "LEON_INTERRUPT_UART_1_RX_TX\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_0 ):
printk( "LEON_INTERRUPT_EXTERNAL_0\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_1 ):
printk( "LEON_INTERRUPT_EXTERNAL_1\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_2 ):
printk( "LEON_INTERRUPT_EXTERNAL_2\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_3 ):
printk( "LEON_INTERRUPT_EXTERNAL_3\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER1 ):
printk( "LEON_INTERRUPT_TIMER1\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER2 ):
printk( "LEON_INTERRUPT_TIMER2\n" );
break;
default:
break;
}
/*
* What else can we do but stop ...
*/
__asm__ volatile( "mov 1, %g1; ta 0x0" );
}
/*
* bsp_spurious_initialize
*
* Install the spurious handler for most traps. Note that set_vector()
* will unmask the corresponding asynchronous interrupt, so the initial
* interrupt mask is restored after the handlers are installed.
*/
void bsp_spurious_initialize()
{
uint32_t trap;
uint32_t level;
uint32_t mask;
level = sparc_disable_interrupts();
mask = LEON_REG.Interrupt_Mask;
for ( trap=0 ; trap<256 ; trap++ ) {
/*
* Skip window overflow, underflow, and flush as well as software
* trap 0 which we will use as a shutdown. Also avoid trap 0x70 - 0x7f
* which cannot happen and where some of the space is used to pass
* paramaters to the program.
*/
if (( trap == 5 || trap == 6 ) ||
(( trap >= 0x11 ) && ( trap <= 0x1f )) ||
(( trap >= 0x70 ) && ( trap <= 0x83 )))
continue;
set_vector(
(rtems_isr_entry) bsp_spurious_handler,
SPARC_SYNCHRONOUS_TRAP( trap ),
1
);
}
LEON_REG.Interrupt_Mask = mask;
sparc_enable_interrupts(level);
}
|
/*
* Author: MontaVista Software, Inc. <source@mvista.com>
*
* 2008 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/init.h>
#include <linux/mvl_patch.h>
static __init int regpatch(void)
{
return mvl_register_patch(1454);
}
module_init(regpatch);
|
/**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/CorePDF.framework/CorePDF
*/
#import <CorePDF/CPHitTest.h>
#import <CorePDF/CorePDF-Structs.h>
@class NSMutableArray, CPPage;
@interface CPHitTest : NSObject {
CPPage *page; // 4 = 0x4
NSMutableArray *objectsOnPage; // 8 = 0x8
float mapTemp; // 12 = 0xc
}
@property(readonly, retain) CPPage *page; // G=0x1b1c9; converted property
- (id)initWithPage:(id)page; // 0x1b1d9
- (void)dealloc; // 0x1b811
// converted property getter: - (id)page; // 0x1b1c9
- (id)paragraph:(CGPoint)paragraph; // 0x1b67d
- (id)paragraphNear:(CGPoint)near; // 0x1b519
- (id)layoutArea:(CGPoint)area; // 0x1b4b1
- (unsigned)columnsAt:(CGPoint)at; // 0x1b479
- (id)column:(CGPoint)column; // 0x1b421
- (id)textLine:(CGPoint)line; // 0x1b2c5
- (id)objectAtPoint:(CGPoint)point; // 0x1b28d
- (int)compareByReadingOrder:(CGPoint)order to:(CGPoint)to; // 0x1b231
@end
@interface CPHitTest (Private)
- (void)findClickableObjects:(BOOL)objects; // 0x1b9bd
- (BOOL)hitTestGraphicObject:(id)object point:(CGPoint)point; // 0x1be2d
- (BOOL)hitTestParagraph:(id)paragraph point:(CGPoint)point; // 0x1bf25
- (id)findBestMatch:(id)match atPoint:(CGPoint)point; // 0x1b871
- (id)findObjectIn:(id)anIn at:(CGPoint)at count:(int *)count; // 0x1c05d
@end
|
//
// PTabAdapter.h
// PlayDrama
//
// Created by hairong.chen on 15/8/12.
// Copyright (c) 2015年 times. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PTabAdapterProtocol.h"
@interface PTabAdapter : NSObject<PTabAdapterProtocol>
/**
* 输入对象
*/
@property (nonatomic, strong) id data;
/**
* 与输入对象建立联系
*
* @param data 输入的对象
*
* @return 实例对象
*/
- (instancetype)initWithData:(id)data;
@end
|
/*
* Misc system wide definitions
*
* Copyright (C) 2010, Broadcom Corporation
* All Rights Reserved.
*
* THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
* KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
* SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
* $Id: bcmdefs.h,v 13.38.4.10.2.7.6.11 2010/02/01 05:51:55 Exp $
*/
#ifndef _bcmdefs_h_
#define _bcmdefs_h_
#ifdef DONGLEBUILD
extern bool bcmreclaimed;
extern bool r2_reclaimed;
#define BCMPREATTACHDATA(_data) __attribute__ ((__section__ (".dataini3." #_data))) _data
#define BCMPREATTACHFN(_fn) __attribute__ ((__section__ (".textini3." #_fn), noinline)) _fn
#define BCMATTACHDATA(_data) __attribute__ ((__section__ (".dataini2." #_data))) _data
#define BCMATTACHFN(_fn) __attribute__ ((__section__ (".textini2." #_fn), noinline)) _fn
#if defined(BCMRECLAIM)
#define BCMINITDATA(_data) __attribute__ ((__section__ (".dataini1." #_data))) _data
#define BCMINITFN(_fn) __attribute__ ((__section__ (".textini1." #_fn), noinline)) _fn
#define CONST
#else
#define BCMINITDATA(_data) _data
#define BCMINITFN(_fn) _fn
#define CONST const
#endif
#ifdef BCMNODOWN
#define BCMUNINITFN(_fn) BCMINITFN(_fn)
#else
#define BCMUNINITFN(_fn) _fn
#endif
#else
#define bcmreclaimed 0
#define r2_reclaimed 0
#define BCMATTACHDATA(_data) _data
#define BCMATTACHFN(_fn) _fn
#define BCMINITDATA(_data) _data
#define BCMINITFN(_fn) _fn
#define BCMUNINITFN(_fn) _fn
#define BCMPREATTACHDATA(_data) _data
#define BCMPREATTACHFN(_fn) _fn
#define CONST const
#endif
#if defined(BCMROMOFFLOAD)
#define BCMROMDATA(_data) __attribute__ ((weak, __section__ (".datarom."#_data))) _data
#if defined(BCMROMSHORTCALL)
#define BCMROMFN(_fn) __attribute__ ((weak, __section__ (".textrom."#_fn))) _fn
#else
#define BCMROMFN(_fn) __attribute__ ((weak, long_call, __section__ (".textrom."#_fn))) _fn
#endif
#define BCMROMFN_NAME(_fn) _fn
#define STATIC
#elif defined(BCMROMBUILD)
#define BCMROMDATA(_data) __attribute__ ((__section__ (".datarom."#_data))) _data
#include <bcmjmptbl.h>
#define STATIC
#else
#define BCMROMDATA(_data) _data
#define BCMROMFN(_fn) _fn
#define BCMROMFN_NAME(_fn) _fn
#define STATIC static
#endif
#define SI_BUS 0
#define PCI_BUS 1
#define PCMCIA_BUS 2
#define SDIO_BUS 3
#define JTAG_BUS 4
#define USB_BUS 5
#define SPI_BUS 6
#ifdef BCMBUSTYPE
#define BUSTYPE(bus) (BCMBUSTYPE)
#else
#define BUSTYPE(bus) (bus)
#endif
#ifdef BCMCHIPTYPE
#define CHIPTYPE(bus) (BCMCHIPTYPE)
#else
#define CHIPTYPE(bus) (bus)
#endif
#if defined(BCMSPROMBUS)
#define SPROMBUS (BCMSPROMBUS)
#elif defined(SI_PCMCIA_SROM)
#define SPROMBUS (PCMCIA_BUS)
#else
#define SPROMBUS (PCI_BUS)
#endif
#ifdef BCMCHIPID
#define CHIPID(chip) (BCMCHIPID)
#else
#define CHIPID(chip) (chip)
#endif
#define DMADDR_MASK_32 0x0
#define DMADDR_MASK_30 0xc0000000
#define DMADDR_MASK_0 0xffffffff
#define DMADDRWIDTH_30 30
#define DMADDRWIDTH_32 32
#define DMADDRWIDTH_63 63
#define DMADDRWIDTH_64 64
#define BCMEXTRAHDROOM 164
#define BCMDONGLEHDRSZ 12
#define BCMDONGLEPADSZ 16
#define BCMDONGLEOVERHEAD (BCMDONGLEHDRSZ + BCMDONGLEPADSZ)
#ifdef BCMDBG
#ifndef BCMDBG_ERR
#define BCMDBG_ERR
#endif
#ifndef BCMDBG_ASSERT
#define BCMDBG_ASSERT
#endif
#endif
#define BITFIELD_MASK(width) \
(((unsigned)1 << (width)) - 1)
#define GFIELD(val, field) \
(((val) >> field ## _S) & field ## _M)
#define SFIELD(val, field, bits) \
(((val) & (~(field ## _M << field ## _S))) | \
((unsigned)(bits) << field ## _S))
#ifdef BCMSMALL
#undef BCMSPACE
#define bcmspace FALSE
#else
#define BCMSPACE
#define bcmspace TRUE
#endif
#define MAXSZ_NVRAM_VARS 4096
#ifdef WL_LOCATOR
#define LOCATOR_EXTERN
#else
#define LOCATOR_EXTERN static
#endif
#endif
|
#include "euler.h"
#include "../delay_handle.h"
#include "../flags.h"
#include "../ggets.h"
#include "../markov.h"
#include "../my_rhs.h"
static void one_step_euler(double *y, double dt, double *yp, int neq,
double *t) {
int j;
set_wieners(dt, y, *t);
my_rhs(*t, y, yp, neq);
*t += dt;
for (j = 0; j < neq; j++)
y[j] = y[j] + dt * yp[j];
}
static int one_flag_step_euler(double *y, double dt, double *work, int neq,
double *tim, int *istart) {
double yold[MAXODE], told;
int i, hit;
double s, dtt = dt;
int nstep = 0;
while (1) {
for (i = 0; i < neq; i++)
yold[i] = y[i];
told = *tim;
one_step_euler(y, dtt, work, neq, tim);
if ((hit = one_flag_step(yold, y, istart, told, tim, neq, &s)) == 0)
break;
/* Its a hit !! */
nstep++;
dtt = (1 - s) * dt;
if (nstep > (NFlags + 2)) {
plintf(" Working too hard?? ");
plintf("smin=%g\n", s);
break;
}
}
return (1);
}
int euler(double *y, double *tim, double dt, int nt, int neq, int *istart,
double *work) {
int i;
if (NFlags == 0) {
for (i = 0; i < nt; i++) {
one_step_euler(y, dt, work, neq, tim);
stor_delay(y);
}
return (0);
}
for (i = 0; i < nt; i++) {
one_flag_step_euler(y, dt, work, neq, tim, istart);
stor_delay(y);
}
return (0);
}
|
/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
*/
#include "msm_fb.h"
#include "mddihost.h"
#include "mddihosti.h"
#include "mddi_toshiba.h"
static struct msm_panel_info pinfo;
static int __init mddi_toshiba_wvga_pt_init(void)
{
int ret;
#ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT
uint id;
ret = msm_fb_detect_client("mddi_toshiba_wvga_pt");
if (ret == -ENODEV)
return 0;
if (ret) {
id = mddi_get_client_id();
if (id != 0xd2638722)
return 0;
}
#endif
pinfo.xres = 480;
pinfo.yres = 800;
pinfo.type = MDDI_PANEL;
pinfo.pdest = DISPLAY_1;
pinfo.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR;
pinfo.wait_cycle = 0;
pinfo.bpp = 32;
pinfo.lcd.vsync_enable = FALSE;
pinfo.lcd.refx100 = 6096; /* adjust refx100 to prevent tearing */
pinfo.lcd.v_back_porch = 2; /* vsw=1 + vbp = 2 */
pinfo.lcd.v_front_porch = 3;
pinfo.lcd.v_pulse_width = 1;
pinfo.lcd.hw_vsync_mode = FALSE;
pinfo.lcd.vsync_notifier_period = (1 * HZ);
pinfo.bl_max = 15;
pinfo.bl_min = 1;
pinfo.clk_rate = 222750000;
pinfo.clk_min = 200000000;
pinfo.clk_max = 240000000;
pinfo.fb_num = 2;
ret = mddi_toshiba_device_register(&pinfo, TOSHIBA_VGA_PRIM,
LCD_TOSHIBA_2P4_WVGA_PT);
if (ret)
printk(KERN_ERR "%s: failed to register device!\n", __func__);
return ret;
}
module_init(mddi_toshiba_wvga_pt_init);
|
/* Copyright (C) 2004-2005 Petta Technology, Inc.
*
* See the file "COPYING" for further information about
* the copyright and warranty status of this work.
*/
/* tested on linux & solaris */
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <utmp.h>
#include "io.h"
time_t get_uptime (void);
int main (int argc, char *argv[])
{
time_t uptime;
uptime = get_uptime();
io_debug("uptime = %i\n", uptime);
}
time_t get_uptime (void)
{
struct utmp *ut;
time_t boot_time;
setutent();
while (ut = getutent())
{
if (ut->ut_type == BOOT_TIME)
{
boot_time = ut->ut_time;
}
}
endutent();
if (boot_time)
return (time(NULL) - boot_time);
else
return 0;
}
|
/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
this file is part of rcssserver3D
Fri May 9 2003
Copyright (C) 2002,2003 Koblenz University
Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
$Id$
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef KEROSIN_SOUNDMODULE_H
#define KEROSIN_SOUNDMODULE_H
#include "soundobject.h"
namespace kerosin
{
class SoundModule : public SoundObject
{
public:
SoundModule(SoundServer &inServer) : SoundObject(inServer) {}
virtual ~SoundModule() {}
virtual void Load(const std::string& inName) = 0;
virtual void Load(void *inBuffer, int inSize) = 0;
virtual void Play() = 0;
};
} //namespace kerosin
#endif //KEROSIN_SOUNDMODULE_H
|
// Copyright (c) 2016 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: https://github.com/CGAL/cgal/blob/releases/CGAL-4.14.1/Installation/include/CGAL/license/Optimal_transportation_reconstruction_2.h $
// $Id: Optimal_transportation_reconstruction_2.h 15fe22c %aI Mael Rouxel-Labbé
// SPDX-License-Identifier: LGPL-3.0+
//
// Author(s) : Andreas Fabri
//
// Warning: this file is generated, see include/CGAL/licence/README.md
#ifndef CGAL_LICENSE_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_H
#define CGAL_LICENSE_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_H
#include <CGAL/config.h>
#include <CGAL/license.h>
#ifdef CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE
# if CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("Your commercial license for CGAL does not cover "
"this release of the Optimal Transportation Curve Reconstruction package.")
# endif
# ifdef CGAL_LICENSE_ERROR
# error "Your commercial license for CGAL does not cover this release \
of the Optimal Transportation Curve Reconstruction package. \
You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR
# endif // CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
#else // no CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE
# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("\nThe macro CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE is not defined."
"\nYou use the CGAL Optimal Transportation Curve Reconstruction package under "
"the terms of the GPLv3+.")
# endif // CGAL_LICENSE_WARNING
# ifdef CGAL_LICENSE_ERROR
# error "The macro CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE is not defined.\
You use the CGAL Optimal Transportation Curve Reconstruction package under the terms of \
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR
#endif // no CGAL_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_COMMERCIAL_LICENSE
#endif // CGAL_LICENSE_OPTIMAL_TRANSPORTATION_RECONSTRUCTION_2_H
|
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* GimpCoreConfig class
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_CORE_CONFIG_H__
#define __GIMP_CORE_CONFIG_H__
#include "core/core-enums.h"
#include "config/gimpbaseconfig.h"
#define GIMP_TYPE_CORE_CONFIG (gimp_core_config_get_type ())
#define GIMP_CORE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CORE_CONFIG, GimpCoreConfig))
#define GIMP_CORE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CORE_CONFIG, GimpCoreConfigClass))
#define GIMP_IS_CORE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CORE_CONFIG))
#define GIMP_IS_CORE_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CORE_CONFIG))
typedef struct _GimpCoreConfigClass GimpCoreConfigClass;
struct _GimpCoreConfig
{
GimpBaseConfig parent_instance;
GimpInterpolationType interpolation_type;
gchar *plug_in_path;
gchar *module_path;
gchar *interpreter_path;
gchar *environ_path;
gchar *brush_path;
gchar *brush_path_writable;
gchar *pattern_path;
gchar *pattern_path_writable;
gchar *palette_path;
gchar *palette_path_writable;
gchar *gradient_path;
gchar *gradient_path_writable;
gchar *font_path;
gchar *font_path_writable; /* unused */
gchar *default_brush;
gchar *default_pattern;
gchar *default_palette;
gchar *default_gradient;
gchar *default_font;
gboolean global_brush;
gboolean global_pattern;
gboolean global_palette;
gboolean global_gradient;
gboolean global_font;
GimpTemplate *default_image;
GimpGrid *default_grid;
gint levels_of_undo;
guint64 undo_size;
GimpViewSize undo_preview_size;
gint plug_in_history_size;
gchar *plug_in_rc_path;
gboolean layer_previews;
GimpViewSize layer_preview_size;
GimpThumbnailSize thumbnail_size;
guint64 thumbnail_filesize_limit;
gboolean install_cmap;
gint min_colors;
GimpColorConfig *color_management;
GimpColorProfilePolicy color_profile_policy;
gboolean save_document_history;
gboolean use_gegl;
};
struct _GimpCoreConfigClass
{
GimpBaseConfigClass parent_class;
};
GType gimp_core_config_get_type (void) G_GNUC_CONST;
#endif /* GIMP_CORE_CONFIG_H__ */
|
#include "himd.h"
#include "sony_oma.h"
#include <string.h>
void make_ea3_format_header(char * header, const struct trackinfo * trkinfo)
{
static const char ea3header[12] =
{0x45, 0x41, 0x33, 0x01, 0x00, 0x60,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00};
memset(header, 0, EA3_FORMAT_HEADER_SIZE);
memcpy(header , ea3header,12);
/* Do not set the content ID - this activates DRM stuff in Sonic Stage.
A track with an unknown content ID can not be converted nor transferred.
A zero content ID seems to mean "no DRM, for real!" */
/*memcpy(header+12, trkinfo->contentid,20);*/
header[32] = trkinfo->codec_id;
memcpy(header+33, trkinfo->codecinfo, 3);
}
|
#ifndef _SELECTABLE_ITEM_H
#define _SELECTABLE_ITEM_H
#include "basic_types.h"
#include "color_table.h"
class SelectableItem
{
public:
SelectableItem( const ColorType& c = ColorType(0.,0.,0.,1.) ):color_(c),
visible_(true),
selected_(false),
hightlighted_(false){}
virtual ~SelectableItem(){}
virtual void set_color( const ColorType& c ){ color_ = c; }
virtual const ColorType color()
{
if (selected_)
return SELECTED_COLOR;
else if( hightlighted_ )
return HIGHTLIGHTED_COLOR;
else
return color_;
}
virtual bool is_visible() const { return visible_; }
virtual void set_visble(const bool v) { visible_ = v; }
virtual bool is_selected() const { return selected_; }
virtual void set_selected( const bool s ){ selected_ = s; }
virtual bool is_hightlighted() const { return hightlighted_; }
virtual void set_hightlighted( const bool h ){ hightlighted_ = h; }
protected:
bool visible_;
bool selected_;
bool hightlighted_;
ColorType color_;
};
#endif |
/*
* File : rthw.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://openlab.rt-thread.com/license/LICENSE.
*
* Change Logs:
* Date Author Notes
* 2006-03-18 Bernard the first version
* 2006-04-25 Bernard add rt_hw_context_switch_interrupt declaration
* 2006-09-24 Bernard add rt_hw_context_switch_to declaration
*/
#ifndef __RT_HW_H__
#define __RT_HW_H__
#include <rtthread.h>
#ifdef __cplusplus
extern "C" {
#endif
void rt_hw_cpu_icache_enable(void);
void rt_hw_cpu_icache_disable(void);
rt_base_t rt_hw_cpu_icache_status(void);
void rt_hw_cpu_dcache_enable(void);
void rt_hw_cpu_dcache_disable(void);
rt_base_t rt_hw_cpu_dcache_status(void);
void rt_hw_cpu_reset(void);
void rt_hw_cpu_shutdown(void);
rt_uint8_t *rt_hw_stack_init(void *entry, void *parameter,
rt_uint8_t *stack_addr, void *exit);
void rt_hw_interrupt_init(void);
void rt_hw_interrupt_mask(int vector);
void rt_hw_interrupt_umask(int vector);
void rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handler, rt_isr_handler_t *old_handler);
void rt_hw_interrupt_handle(int vector);
rt_base_t rt_hw_interrupt_disable(void);
void rt_hw_interrupt_enable(rt_base_t level);
void rt_hw_context_switch(rt_uint32_t from, rt_uint32_t to);
void rt_hw_context_switch_to(rt_uint32_t to);
void rt_hw_context_switch_interrupt(rt_uint32_t from, rt_uint32_t to);
void rt_hw_console_output(const char* str);
void rt_hw_backtrace(rt_uint32_t *fp, rt_uint32_t thread_entry);
void rt_hw_show_memory(rt_uint32_t addr, rt_uint32_t size);
#ifdef __cplusplus
}
#endif
#endif
|
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "mediastreamer2/msfilter.h"
#include "mediastreamer2/mssndcard.h"
#include "mediastreamer2/msticker.h"
#include <signal.h>
static int run=1;
static void stop(int signum){
run=0;
}
int main(int argc, char *argv[]){
MSFilter *f1,*f2;
MSSndCard *card_capture;
MSSndCard *card_playback;
MSTicker *ticker;
char *card_id=NULL;
int rate = 16000;
ortp_init();
ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
ms_init();
signal(SIGINT,stop);
if (argc>1)
card_id=argv[1];
if (card_id!=NULL)
{
card_capture = ms_snd_card_manager_get_card(ms_snd_card_manager_get(),card_id);
card_playback = ms_snd_card_manager_get_card(ms_snd_card_manager_get(),card_id);
#ifdef __linux
if (card_playback==NULL)
card_playback = ms_alsa_card_new_custom(card_id, card_id);
if (card_capture==NULL)
card_capture = ms_alsa_card_new_custom(card_id, card_id);
#endif
}
else
{
card_capture = ms_snd_card_manager_get_default_capture_card(ms_snd_card_manager_get());
card_playback = ms_snd_card_manager_get_default_playback_card(ms_snd_card_manager_get());
}
if (card_playback==NULL || card_capture==NULL){
ms_error("No card.");
return -1;
}
f1=ms_snd_card_create_reader(card_capture);
f2=ms_snd_card_create_writer(card_playback);
ms_filter_call_method (f1, MS_FILTER_SET_SAMPLE_RATE,
&rate);
ms_filter_call_method (f2, MS_FILTER_SET_SAMPLE_RATE,
&rate);
ticker=ms_ticker_new();
ms_filter_link(f1,0,f2,0);
ms_ticker_attach(ticker,f1);
while(run)
ms_sleep(1);
ms_ticker_detach(ticker,f1);
ms_ticker_destroy(ticker);
ms_filter_unlink(f1,0,f2,0);
ms_filter_destroy(f1);
ms_filter_destroy(f2);
return 0;
}
|
#ifndef MAKEFILE_HAND
#include "config.h"
#endif
#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <getopt.h>
#include <omp.h>
//#include <cpgplot.h>
#include "ninkasi.h"
#ifdef HAVE_MPI
# include <mpi.h>
# ifndef ACTDATA_DOUBLE
# define MPI_NType MPI_FLOAT
# else
# define MPI_NType MPI_DOUBLE
# endif
#endif
#include "readtod.h"
//#include "dirfile.h"
//#include "astro.h"
#include "actpol/astro.h"
#include "mbCommon.h"
#include "mbCuts.h"
#include "mbTOD.h"
#include "noise.h"
#include "ninkasi_pointing.h"
#define ALTAZ_PER_LINE 3
/*================================================================================*/
int main(int argc, char *argv[])
{
#if 0
Site site;
site.latitude=0.670784476117809;
site.east_longitude=-1.39346796591019;
site.elevation_m=1000.0;
site.temperature_K=290.0;
site.pressure_mb=900.0;
site.relative_humidity=0.5;
struct timeval tv;
gettimeofday(&tv,NULL);
printf("ctime is %d\n",tv.tv_sec);
double ctime_1, ctime_2;
ctime_1=1223150033.0+75600; //1PM EDT, Sunday October 5, 2008
ctime_2=ctime_1+3600.0*3.5;
//az=58, el=70 in degrees @start
float *ra=vector(2);
float *dec=vector(2);
float *alt=vector(2);
float *az=vector(2);
double *tt2=dvector(2);
tt2[0]=ctime_1;
tt2[1]=tt2[0];
alt[0]=mydeg2rad(atof(argv[1]));
alt[1]=alt[0];
az[0]=mydeg2rad(atof(argv[2]));
az[1]=az[0]+mydeg2rad(78.0/3600/cos(alt[1]));
//az[1]=deg2rad(az[0]+78.0/3600/cos(alt[1]));
observed_altaz_to_mean_radec(&site,30.0,2,tt2,alt,az,ra,dec);
printf("ra/dec are %14.6f %14.6f\n",ra[0]*180.0/3.14159265/15.0,dec[0]*180.0/3.14159265);
printf("ra/dec are %14.6f %14.6f\n",ra[1]*180.0/3.14159265/15.0,dec[1]*180.0/3.14159265);
printf("dra and ddec are %14.6f %14.6f\n",(ra[1]-ra[0])*180.0/3.14159265/15.0*3600.0,(dec[1]-dec[0])*180.0/3.14159265*3600.0);
exit(EXIT_SUCCESS);
#endif
TODvec tods;
MAPvec maps;
PARAMS params;
memset(¶ms,0,sizeof(PARAMS));
#ifdef HAVE_MPI
int ierr=MPI_Init(&argc, &argv);
int myrank, nproc;
ierr = MPI_Comm_size(MPI_COMM_WORLD, &nproc);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
#endif
get_parameters(argc, argv, ¶ms);
#ifdef HAVE_MPI
if (myrank==0)
#endif
print_options(¶ms);
if (params.quit)
exit(EXIT_SUCCESS);
#if 0
for (int i=0;i<1500;i++) {
printf("i is %d\n",i);
mbTOD *tmp=read_dirfile_tod_header(params.datanames[0]);
printf("file %s has ndata and ndet %d %d\n",params.datanames[0],tmp->ndata,tmp->ndet);
tmp->cuts=mbCutsAlloc(tmp->nrow,tmp->ncol);
tmp->pointingOffset=nkReadPointingOffset(params.pointing_file);
assign_tod_ra_dec(tmp);
//destroy_pointing_fit(tmp);
destroy_pointing_offset(tmp->pointingOffset);
free(tmp->alt);
free(tmp->az);
}
exit(EXIT_SUCCESS);
#endif
tods.total_tod=how_many_tods(tods.froot,¶ms);
mprintf(stdout,"have %d tods.\n",tods.total_tod);
find_my_tods(&tods,¶ms);
for (int i=0;i<tods.ntod;i++)
mprintf(stdout,"I own %s\n",tods.my_fnames[i]);
read_all_tod_headers(&tods,¶ms);
set_global_radec_lims(&tods);
mprintf(stdout,"global limits are %12.5f %12.5f %12.5f %12.5f\n",tods.ramin,tods.ramax,tods.decmin,tods.decmax);
#if 0
mbTOD *tod=&(tods.tods[0]);
pca_time tt;
tick(&tt);
find_pointing_pivots(tod,1.0);
printf("have %d samples.\n",tod->pointing_fit->ncoarse);
//exit(EXIT_SUCCESS);
#pragma omp parallel shared(tod) default(none)
{
PointingFitScratch *scratch=allocate_pointing_fit_scratch(tod);
#pragma omp for schedule(dynamic, 1)
for (int i=0;i<tod->ndet;i++)
if (!mbCutsIsAlwaysCut(tod->cuts,tod->rows[i],tod->cols[i])) {
get_radec_from_altaz_fit_1det_coarse(tod,i,scratch);
}
destroy_pointing_fit_scratch(scratch);
}
printf("Time to do pointing is %10.4f seconds.\n",tocksilent(&tt));
printf("Max pointing eror is %14.3f\n",find_max_pointing_err(&(tods.tods[0]))*180*3600/M_PI);
exit(EXIT_SUCCESS);
#endif
maps.nmap=1;
{
MAP *mapvec=(MAP *)malloc(maps.nmap*sizeof(MAP));
for (int i=0;i<maps.nmap;i++) {
mapvec[i].projection=(nkProjection *)malloc(sizeof(nkProjection));
mapvec[i].projection->proj_type=NK_RECT;
mapvec[i].have_locks=0;
}
maps.maps=&mapvec;
}
maps.maps[0]->pixsize=params.pixsize; //30 arcsecond pixels
maps.maps[0]->ramin=tods.ramin;
maps.maps[0]->ramax=tods.ramax;
maps.maps[0]->decmin=tods.decmin;
maps.maps[0]->decmax=tods.decmax;
setup_maps(&maps,¶ms);
clear_mapset(&maps);
createFFTWplans(&tods);
run_PCG(&maps,&tods,¶ms);
readwrite_simple_map(maps.maps[0],params.outname,DOWRITE);
exit(EXIT_SUCCESS);
run_PCG(&maps,&tods,¶ms);
readwrite_simple_map(maps.maps[0],"test_crap.map",DOWRITE);
}
|
/* $Id: pio.h,v 1.1.1.1 2004/06/19 05:02:58 ashieh Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
*/
#ifndef _ASM_IA64_SN_PIO_H
#define _ASM_IA64_SN_PIO_H
#include <linux/types.h>
#include <asm/sn/sgi.h>
#include <asm/sn/driver.h>
/*
* pioaddr_t - The kernel virtual address that a PIO can be done upon.
* Should probably be (volatile void*) but EVEREST would do PIO
* to long mostly, just cast for other sizes.
*/
typedef volatile ulong* pioaddr_t;
/*
* iopaddr_t - the physical io space relative address (e.g. VME A16S 0x0800).
* iosapce_t - specifies the io address space to be mapped/accessed.
* piomap_t - the handle returned by pio_alloc() and used with all the pio
* access functions.
*/
typedef struct piomap {
uint pio_bus;
uint pio_adap;
int pio_flag;
int pio_reg;
char pio_name[7]; /* to identify the mapped device */
struct piomap *pio_next; /* dlist to link active piomap's */
struct piomap *pio_prev; /* for debug and error reporting */
iopaddr_t pio_iopmask; /* valid iop address bit mask */
iobush_t pio_bushandle; /* bus-level handle */
} piomap_t;
#define pio_type pio_iospace.ios_type
#define pio_iopaddr pio_iospace.ios_iopaddr
#define pio_size pio_iospace.ios_size
#define pio_vaddr pio_iospace.ios_vaddr
/* Macro to get/set PIO error function */
#define pio_seterrf(p,f) (p)->pio_errfunc = (f)
#define pio_geterrf(p) (p)->pio_errfunc
/*
* piomap_t type defines
*/
#define PIOMAP_NTYPES 7
#define PIOMAP_A16N VME_A16NP
#define PIOMAP_A16S VME_A16S
#define PIOMAP_A24N VME_A24NP
#define PIOMAP_A24S VME_A24S
#define PIOMAP_A32N VME_A32NP
#define PIOMAP_A32S VME_A32S
#define PIOMAP_A64 6
#define PIOMAP_EISA_IO 0
#define PIOMAP_EISA_MEM 1
#define PIOMAP_PCI_IO 0
#define PIOMAP_PCI_MEM 1
#define PIOMAP_PCI_CFG 2
#define PIOMAP_PCI_ID 3
/* IBUS piomap types */
#define PIOMAP_FCI 0
/* dang gio piomap types */
#define PIOMAP_GIO32 0
#define PIOMAP_GIO64 1
#define ET_MEM 0
#define ET_IO 1
#define LAN_RAM 2
#define LAN_IO 3
#define PIOREG_NULL (-1)
/* standard flags values for pio_map routines,
* including {xtalk,pciio}_piomap calls.
* NOTE: try to keep these in step with DMAMAP flags.
*/
#define PIOMAP_UNFIXED 0x0
#define PIOMAP_FIXED 0x1
#define PIOMAP_NOSLEEP 0x2
#define PIOMAP_INPLACE 0x4
#define PIOMAP_FLAGS 0x7
#endif /* _ASM_IA64_SN_PIO_H */
|
/*
* XDR-GTK - user interface for XDR-F1HD tuner with XDR-I2C modification
* Copyright (c) 2012-2021 Konrad Kosmatka
*
* 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.
*/
#include <gtk/gtk.h>
#include <getopt.h>
#include "ui.h"
#include "conf.h"
#include "rdsspy.h"
#include "stationlist.h"
#include "log.h"
#ifdef G_OS_WIN32
#include "win32.h"
#endif
static const gchar*
get_config_path(gint argc,
gchar *argv[])
{
gchar *path = NULL;
gint c;
while((c = getopt(argc, argv, "c:")) != -1)
{
switch(c)
{
case 'c':
path = optarg;
break;
case '?':
if(optopt == 'c')
fprintf(stderr, "No configuration path argument found, using default.\n");
break;
}
}
return path;
}
gint
main(gint argc,
gchar *argv[])
{
gtk_disable_setlocale();
gtk_init(&argc, &argv);
#ifdef G_OS_WIN32
win32_init();
#endif
conf_init(get_config_path(argc, argv));
ui_init();
if(conf.rdsspy_auto)
rdsspy_toggle();
if(conf.srcp)
stationlist_init();
gtk_main();
log_cleanup();
#ifdef G_OS_WIN32
win32_cleanup();
#endif
return 0;
}
|
/* This file is part of the KDE project
* Copyright (C) 2007,2009 Jan Hambrecht <jaham@gmx.net>
* Copyright (C) 2010 Thorsten Zachmann <zachmann@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SVGGRADIENTHELPER_H
#define SVGGRADIENTHELPER_H
#include <FlakeDebug.h>
#include <QTransform>
class QGradient;
class SvgGradientHelper
{
public:
enum Units { UserSpaceOnUse, ObjectBoundingBox };
SvgGradientHelper();
~SvgGradientHelper();
/// Copy constructor
SvgGradientHelper(const SvgGradientHelper &other);
/// Sets the gradient units type
void setGradientUnits(Units units);
/// Returns gradient units type
Units gradientUnits() const;
/// Sets the gradient
void setGradient(QGradient * g);
/// Retrurns the gradient
QGradient * gradient();
/// Copies the given gradient
void copyGradient(QGradient * g);
/// Returns fill adjusted to the given bounding box
QBrush adjustedFill(const QRectF &bound);
/// Returns the gradient transformation
QTransform transform() const;
/// Sets the gradient transformation
void setTransform(const QTransform &transform);
/// Assigment operator
SvgGradientHelper & operator = (const SvgGradientHelper & rhs);
QGradient * adjustedGradient(const QRectF &bound) const;
/// Converts a gradient from LogicalMode to ObjectBoundingMode
static QGradient *convertGradient(const QGradient * originalGradient, const QSizeF &size);
private:
/// Duplicates the given gradient and applies the given transformation
static QGradient *duplicateGradient(const QGradient * g, const QTransform &transform);
QGradient * m_gradient;
Units m_gradientUnits;
QTransform m_gradientTransform;
};
#endif // SVGGRADIENTHELPER_H
|
/*
* ProFTPD - FTP server API testsuite
* Copyright (c) 2008-2015 The ProFTPD Project team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*
* As a special exemption, The ProFTPD Project team and other respective
* copyright holders give permission to link this program with OpenSSL, and
* distribute the resulting executable, without including the source code for
* OpenSSL in the source distribution.
*/
/* Testsuite management */
#ifndef PR_TESTS_H
#define PR_TESTS_H
#include "conf.h"
#include "privs.h"
#ifdef HAVE_CHECK_H
# include <check.h>
#else
# error "Missing Check installation; necessary for ProFTPD testsuite"
#endif
int tests_stubs_set_main_server(server_rec *);
int tests_stubs_set_next_cmd(cmd_rec *);
Suite *tests_get_pool_suite(void);
Suite *tests_get_array_suite(void);
Suite *tests_get_str_suite(void);
Suite *tests_get_sets_suite(void);
Suite *tests_get_timers_suite(void);
Suite *tests_get_table_suite(void);
Suite *tests_get_var_suite(void);
Suite *tests_get_event_suite(void);
Suite *tests_get_env_suite(void);
Suite *tests_get_version_suite(void);
Suite *tests_get_feat_suite(void);
Suite *tests_get_netaddr_suite(void);
Suite *tests_get_netacl_suite(void);
Suite *tests_get_class_suite(void);
Suite *tests_get_regexp_suite(void);
Suite *tests_get_expr_suite(void);
Suite *tests_get_scoreboard_suite(void);
Suite *tests_get_stash_suite(void);
Suite *tests_get_modules_suite(void);
Suite *tests_get_cmd_suite(void);
Suite *tests_get_response_suite(void);
Suite *tests_get_fsio_suite(void);
Suite *tests_get_netio_suite(void);
Suite *tests_get_trace_suite(void);
Suite *tests_get_parser_suite(void);
Suite *tests_get_pidfile_suite(void);
Suite *tests_get_config_suite(void);
Suite *tests_get_auth_suite(void);
Suite *tests_get_filter_suite(void);
Suite *tests_get_inet_suite(void);
Suite *tests_get_data_suite(void);
Suite *tests_get_ascii_suite(void);
Suite *tests_get_help_suite(void);
Suite *tests_get_rlimit_suite(void);
Suite *tests_get_encode_suite(void);
Suite *tests_get_privs_suite(void);
Suite *tests_get_display_suite(void);
Suite *tests_get_misc_suite(void);
/* Temporary hack/placement for this variable, until we get to testing
* the Signals API.
*/
unsigned int recvd_signal_flags;
extern char ServerType;
extern int ServerUseReverseDNS;
extern server_rec *main_server;
extern pid_t mpid;
extern module *loaded_modules;
extern module *static_modules[];
#endif /* PR_TESTS_H */
|
/* This file is part of the KDE project
Copyright (C) 2002 Lucijan Busch <lucijan@gmx.at>
Copyright (C) 2003-2007 Jarosław Staniek <staniek@kde.org>
This program 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 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KexiRelationsView_H
#define KexiRelationsView_H
#include <KexiView.h>
#include "KexiRelationsScrollArea.h"
namespace KexiDB
{
class Connection;
class TableSchema;
class TableOrQuerySchema;
}
//! A Kexi view for displaying relationships.
/*! It is used for within Query Designer
Note: it will be also reused in Database Relationships view. */
class KEXIRELATIONSVIEW_EXPORT KexiRelationsView : public KexiView
{
Q_OBJECT
public:
explicit KexiRelationsView(QWidget *parent = 0);
virtual ~KexiRelationsView();
//! \return a hash of added tables
TablesHash* tables() const;
KexiRelationsTableContainer* table(const QString& name) const;
const ConnectionSet* connections() const;
void addTable(const QString& t);
virtual QSize sizeHint() const;
/*! Used to add newly created object information to the combo box. */
void objectCreated(const QString &mime, const QString& name);
void objectDeleted(const QString &mime, const QString& name);
void objectRenamed(const QString &mime, const QString& name, const QString& newName);
signals:
void tableAdded(KexiDB::TableSchema& t);
void tableHidden(KexiDB::TableSchema& t);
void tablePositionChanged(KexiRelationsTableContainer*);
void aboutConnectionRemove(KexiRelationsConnection*);
void appendFields(KexiDB::TableOrQuerySchema& tableOrQuery, const QStringList& fieldNames);
public slots:
/*! Adds a table \a t to the area. This changes only visual representation.
If \a rect is valid, table widget rgeometry will be initialized.
*/
void addTable(KexiDB::TableSchema *t, const QRect &rect = QRect());
//! Adds a connection \a con to the area. This changes only visual representation.
void addConnection(const SourceConnection& conn);
void removeSelectedObject();
/*! Removes all tables and coonections from the widget. */
void clear();
/*! Removes all coonections from the view. */
void removeAllConnections();
/*! Hides all tables except \a tables. */
void hideAllTablesExcept(KexiDB::TableSchema::List* tables);
protected slots:
void slotAddTable();
void tableViewGotFocus();
void connectionViewGotFocus();
void emptyAreaGotFocus();
void tableContextMenuRequest(const QPoint& pos);
void connectionContextMenuRequest(const QPoint& pos);
void emptyAreaContextMenuRequest(const QPoint& pos);
void appendSelectedFields();
void openSelectedTable();
void designSelectedTable();
void slotTableHidden(KexiDB::TableSchema &table);
void aboutToShowPopupMenu();
protected:
/*! executes popup menu at \a pos, or,
if \a pos not specified: at center of selected table view (if any selected),
or at center point of the relations view. */
void executePopup(QPoint pos = QPoint(-1, -1));
//! Invalidates all actions availability.
void invalidateActions();
//! Fills table's combo box with all available table names.
void fillTablesCombo();
private:
class Private;
Private* const d;
};
#endif
|
#ifndef __SOCKET_LOADED
#define __SOCKET_LOADED 1
/*
* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* socket.h 6.6 (Berkeley) 6/8/85
*/
#ifndef __SOCKET_TYPEDEFS
typedef char * caddr_t;
typedef unsigned short u_short;
typedef unsigned long u_long;
typedef unsigned char u_char;
#define __SOCKET_TYPEDEFS
#endif
/*
* Definitions related to sockets: types, address families, options.
*/
/*
* Types
*/
#define SOCK_STREAM 1 /* stream socket */
#define SOCK_DGRAM 2 /* datagram socket */
#define SOCK_RAW 3 /* raw-protocol interface */
#define SOCK_RDM 4 /* reliably-delivered message */
#define SOCK_SEQPACKET 5 /* sequenced packet stream */
/*
* Option flags per-socket.
*/
#define SO_DEBUG 0x01 /* turn on debugging info recording */
#define SO_ACCEPTCONN 0x02 /* socket has had listen() */
#define SO_REUSEADDR 0x04 /* allow local address reuse */
#define SO_KEEPALIVE 0x08 /* keep connections alive */
#define SO_DONTROUTE 0x10 /* just use interface addresses */
#define SO_BROADCAST 0x20 /* permit sending of broadcast msgs */
#define SO_USELOOPBACK 0x40 /* bypass hardware when possible */
#define SO_LINGER 0x80 /* linger on close if data present */
#define SO_OOBINLINE 0x100 /* leave received OOB data in line */
/*
* Additional options, not kept in so_options.
*/
#define SO_SNDBUF 0x1001 /* send buffer size */
#define SO_RCVBUF 0x1002 /* receive buffer size */
#define SO_SNDLOWAT 0x1003 /* send low-water mark */
#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
#define SO_SNDTIMEO 0x1005 /* send timeout */
#define SO_RCVTIMEO 0x1006 /* receive timeout */
#define SO_ERROR 0x1007 /* get error status and clear */
#define SO_TYPE 0x1008 /* get socket type */
/*
* Structure used for manipulating linger option.
*/
struct linger
{
int l_onoff; /* option on/off */
int l_linger; /* linger time */
};
/*
* Level number for (get/set)sockopt() to apply to socket itself.
*/
#define SOL_SOCKET 0xffff /* options for socket level */
/*
* Address families.
*/
#define AF_UNSPEC 0 /* unspecified */
#define AF_UNIX 1 /* local to host (pipes, portals) */
#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
#define AF_IMPLINK 3 /* arpanet imp addresses */
#define AF_PUP 4 /* pup protocols: e.g. BSP */
#define AF_CHAOS 5 /* mit CHAOS protocols */
#define AF_NS 6 /* XEROX NS protocols */
#define AF_NBS 7 /* nbs protocols */
#define AF_ECMA 8 /* european computer manufacturers */
#define AF_DATAKIT 9 /* datakit protocols */
#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
#define AF_SNA 11 /* IBM SNA */
#define AF_DECnet 12 /* DECnet */
#define AF_DLI 13 /* Direct data link interface */
#define AF_LAT 14 /* LAT */
#define AF_HYLINK 15 /* NSC Hyperchannel */
#define AF_APPLETALK 16 /* Apple talk */
#define AF_BSC 17 /* BISYNC 2780/3780 */
#define AF_DSS 18 /* Distributed system services */
#define AF_MAX 19
/*
* Structure used by kernel to store most
* addresses.
*/
struct sockaddr
{
u_short sa_family; /* address family */
char sa_data[14]; /* up to 14 bytes of direct address */
};
/*
* Structure used by kernel to pass protocol
* information in raw sockets.
*/
struct sockproto
{
u_short sp_family; /* address family */
u_short sp_protocol; /* protocol */
};
/*
* Protocol families, same as address families for now.
*/
#define PF_UNSPEC AF_UNSPEC
#define PF_UNIX AF_UNIX
#define PF_INET AF_INET
#define PF_IMPLINK AF_IMPLINK
#define PF_PUP AF_PUP
#define PF_CHAOS AF_CHAOS
#define PF_NS AF_NS
#define PF_NBS AF_NBS
#define PF_ECMA AF_ECMA
#define PF_DATAKIT AF_DATAKIT
#define PF_CCITT AF_CCITT
#define PF_SNA AF_SNA
#define PF_DECnet AF_DECnet
#define PF_DLI AF_DLI
#define PF_LAT AF_LAT
#define PF_HYLINK AF_HYLINK
#define PF_APPLETALK AF_APPLETALK
#define PF_BSC AF_BSC
#define PF_DSS AF_DSS
#define PF_MAX AF_MAX
/*
* Maximum queue length specifiable by listen.
*/
#define SOMAXCONN 5
#ifndef _UIO_ /* for compatibility with uio.h */
#define _UIO_ /* this is in uio.h on UNIX systems */
/*
* I/O buffer element.
*/
struct iovec
{
caddr_t iov_base;
int iov_len;
};
#endif /* _UIO_ */
/*
* Message header for recvmsg and sendmsg calls.
*/
struct msghdr
{
caddr_t msg_name; /* optional address */
int msg_namelen; /* size of address */
struct iovec *msg_iov; /* scatter/gather array */
int msg_iovlen; /* # elements in msg_iov */
caddr_t msg_accrights; /* access rights sent/received */
int msg_accrightslen;
};
#define MSG_OOB 0x1 /* process out-of-band data */
#define MSG_PEEK 0x2 /* peek at incoming message */
#define MSG_DONTROUTE 0x4 /* send without using routing tables */
#define MSG_MAXIOVLEN 16
int socket( int af, int mess_type, int prot_type);
int accept( int sd, struct sockaddr *S_addr, int *addrlen);
int bind( int sd, struct sockaddr *s_name, int namelen);
int listen( int sd, int backlog);
int connect( int sd, struct sockaddr *name, int namelen);
int send( int sd, char * msg, int length, int flags);
int recvmsg( int sd, struct msghdr *msg, int flags);
int sendmsg( int sd, struct msghdr * msg, int flags);
int sendto( int sd, char * msg, int length, int flags, struct sockaddr *to, int tolen);
int recv( int sd, char * buf, int length, int flags);
int recvfrom( int sd, char * buf, int length, int flags, struct sockaddr *from, int *fromlen);
int shutdown( int sd, int mode);
int select( int nfds, int *readfds, int *writefds, int *exceptfds, struct timeval *timeout);
int gethostname( char *name, int namelen);
int gethostaddr( char *addr);
int getpeername( int sd, struct sockaddr *name, int *namelen);
int getsockname( int sd, struct sockaddr *name, int *namelen);
int getsockopt( int sd, int level, int optname, char *optval, int *optlen);
int setsockopt( int sd, int level, int optname, char *optval, int optlen);
int vaxc$get_sdc( int descrip_no);
#endif /* __SOCKET_LOADED */
|
/*
* libosinfo: an operating system
*
* Copyright (C) 2009-2012 Red Hat, Inc.
*
* 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/>.
*
* Authors:
* Arjun Roy <arroy@redhat.com>
* Daniel P. Berrange <berrange@redhat.com>
*/
#include <glib-object.h>
#include <osinfo/osinfo_product.h>
#include <osinfo/osinfo_device.h>
#include <osinfo/osinfo_devicelist.h>
#include <osinfo/osinfo_medialist.h>
#include <osinfo/osinfo_media.h>
#include <osinfo/osinfo_treelist.h>
#include <osinfo/osinfo_os_variant.h>
#include <osinfo/osinfo_os_variantlist.h>
#include <osinfo/osinfo_tree.h>
#include <osinfo/osinfo_resources.h>
#include <osinfo/osinfo_resourceslist.h>
#ifndef __OSINFO_OS_H__
#define __OSINFO_OS_H__
/*
* Type macros.
*/
#define OSINFO_TYPE_OS (osinfo_os_get_type ())
#define OSINFO_OS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OSINFO_TYPE_OS, OsinfoOs))
#define OSINFO_IS_OS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OSINFO_TYPE_OS))
#define OSINFO_OS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OSINFO_TYPE_OS, OsinfoOsClass))
#define OSINFO_IS_OS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OSINFO_TYPE_OS))
#define OSINFO_OS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OSINFO_TYPE_OS, OsinfoOsClass))
/*
* Forward declared in osinfo_install_script.h
*
* typedef struct _OsinfoOs OsinfoOs;
*/
typedef struct _OsinfoOsClass OsinfoOsClass;
typedef struct _OsinfoOsPrivate OsinfoOsPrivate;
#define OSINFO_OS_PROP_FAMILY "family"
#define OSINFO_OS_PROP_DISTRO "distro"
#define OSINFO_OS_PROP_RELEASE_STATUS "release-status"
/* object */
struct _OsinfoOs
{
OsinfoProduct parent_instance;
/* public */
/* private */
OsinfoOsPrivate *priv;
};
/* class */
struct _OsinfoOsClass
{
/*< private >*/
OsinfoProductClass parent_class;
/* class members */
};
/**
* OsinfoReleaseStatus:
* @OSINFO_RELEASE_STATUS_RELEASED: A released OS.
* @OSINFO_RELEASE_STATUS_SNAPSHOT: A continuous integration snapshot and not
* an actual released product yet. For example, gnome-continuous images for
* development snapshots of GNOME and nightly build ISOs of Fedora etc.
* @OSINFO_RELEASE_STATUS_PRERELEASE: A pre-release. For example, alpha and
* beta pre-releases of Fedora etc.
*/
typedef enum {
OSINFO_RELEASE_STATUS_RELEASED,
OSINFO_RELEASE_STATUS_SNAPSHOT,
OSINFO_RELEASE_STATUS_PRERELEASE
} OsinfoReleaseStatus;
GType osinfo_os_get_type(void);
OsinfoOs *osinfo_os_new(const gchar *id);
OsinfoDeviceList *osinfo_os_get_devices(OsinfoOs *os, OsinfoFilter *filter);
OsinfoDeviceList *osinfo_os_get_all_devices(OsinfoOs *os, OsinfoFilter *filter);
OsinfoDeviceList *osinfo_os_get_devices_by_property(OsinfoOs *os,
const char *property,
const char *value,
gboolean inherited);
OsinfoDeviceLinkList *osinfo_os_get_device_links(OsinfoOs *os, OsinfoFilter *filter);
OsinfoDeviceLink *osinfo_os_add_device(OsinfoOs *os, OsinfoDevice *dev);
const gchar *osinfo_os_get_family(OsinfoOs *os);
const gchar *osinfo_os_get_distro(OsinfoOs *os);
int osinfo_os_get_release_status(OsinfoOs *os);
OsinfoMediaList *osinfo_os_get_media_list(OsinfoOs *os);
void osinfo_os_add_media(OsinfoOs *os, OsinfoMedia *media);
OsinfoTreeList *osinfo_os_get_tree_list(OsinfoOs *os);
void osinfo_os_add_tree(OsinfoOs *os, OsinfoTree *tree);
OsinfoOsVariantList *osinfo_os_get_variant_list(OsinfoOs *os);
void osinfo_os_add_variant(OsinfoOs *os, OsinfoOsVariant *variant);
OsinfoResourcesList *osinfo_os_get_minimum_resources(OsinfoOs *os);
OsinfoResourcesList *osinfo_os_get_recommended_resources(OsinfoOs *os);
void osinfo_os_add_minimum_resources(OsinfoOs *os, OsinfoResources *resources);
void osinfo_os_add_recommended_resources(OsinfoOs *os, OsinfoResources *resources);
OsinfoInstallScript *osinfo_os_find_install_script(OsinfoOs *os, const gchar *profile);
OsinfoInstallScriptList *osinfo_os_get_install_script_list(OsinfoOs *os);
void osinfo_os_add_install_script(OsinfoOs *os, OsinfoInstallScript *script);
OsinfoDeviceDriverList *osinfo_os_get_device_drivers(OsinfoOs *os);
void osinfo_os_add_device_driver(OsinfoOs *os, OsinfoDeviceDriver *driver);
#endif /* __OSINFO_OS_H__ */
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* End:
*/
|
/*CXXR $Id$
*CXXR
*CXXR This file is part of CXXR, a project to refactor the R interpreter
*CXXR into C++. It may consist in whole or in part of program code and
*CXXR documentation taken from the R project itself, incorporated into
*CXXR CXXR (and possibly MODIFIED) under the terms of the GNU General Public
*CXXR Licence.
*CXXR
*CXXR CXXR is Copyright (C) 2008-14 Andrew R. Runnalls, subject to such other
*CXXR copyrights and copyright restrictions as may be stated below.
*CXXR
*CXXR CXXR is not part of the R project, and bugs and other issues should
*CXXR not be reported via r-bugs or other R project channels; instead refer
*CXXR to the CXXR website.
*CXXR */
/*
* Mathlib : A C Library of Special Functions
* Copyright (C) 1998 Ross Ihaka
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, a copy is available at
* http://www.r-project.org/Licenses/
*
* SYNOPSIS
*
* #include <Rmath.h>
* int imin2(int x, int y);
*
* DESCRIPTION
*
* Compute minimum of two integers.
*/
#include "nmath.h"
int imin2(int x, int y)
{
return (x < y) ? x : y;
}
|
/*
* Atheros AR71xx DSA switch device support
*
* Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/netdevice.h>
#include <linux/phy.h>
#include "dev-dsa.h"
static struct platform_device ar71xx_dsa_switch_device = {
.name = "dsa",
.id = 0,
};
void __init ar71xx_add_device_dsa(unsigned int id,
struct dsa_platform_data *d,struct net_device *net,struct mii_bus *bus)
{
int i;
d->netdev = net;
for (i = 0; i < d->nr_chips; i++)
d->chip[i].mii_bus = bus;
ar71xx_dsa_switch_device.dev.platform_data = d;
platform_device_register(&ar71xx_dsa_switch_device);
}
|
/***************************************************************************
qgsdetaileditemwidget.h - A rich QItemWidget subclass
-------------------
begin : Sat May 17 2008
copyright : (C) 2008 Tim Sutton
email : tim@linfiniti.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSDETAILEDITEMWIDGET_H
#define QGSDETAILEDITEMWIDGET_H
#include <ui_qgsdetaileditemwidgetbase.h>
#include "qgis.h"
#include <qgsdetaileditemdata.h>
#include "qgis_gui.h"
/** \ingroup gui
* A widget renderer for detailed item views.
* \see also QgsDetailedItem and QgsDetailedItemData.
*/
class GUI_EXPORT QgsDetailedItemWidget : public QWidget, private Ui::QgsDetailedItemWidgetBase
{
Q_OBJECT
public:
QgsDetailedItemWidget( QWidget *parent SIP_TRANSFERTHIS = 0 );
void setData( const QgsDetailedItemData &data );
void setChecked( bool flag );
private:
QgsDetailedItemData mData;
};
#endif //QGSDETAILEDITEMWIDGET_H
|
/*
* This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
*
* 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 MANGOSSERVER_CAMERA_H
#define MANGOSSERVER_CAMERA_H
#include "Common.h"
#include "GridDefines.h"
class ViewPoint;
class WorldObject;
class UpdateData;
class WorldPacket;
class Player;
/// Camera - object-receiver. Receives broadcast packets from nearby worldobjects, object visibility changes and sends them to client
class MANGOS_DLL_SPEC Camera
{
friend class ViewPoint;
public:
explicit Camera(Player* pl);
~Camera();
WorldObject* GetBody() { return m_source;}
Player* GetOwner() { return &m_owner;}
// set camera's view to any worldobject
// Note: this worldobject must be in same map, in same phase with camera's owner(player)
// client supports only unit and dynamic objects as farsight objects
void SetView(WorldObject* obj, bool update_far_sight_field = true);
// set view to camera's owner
void ResetView(bool update_far_sight_field = true);
template<class T>
void UpdateVisibilityOf(T* obj, UpdateData& d, std::set<WorldObject*>& vis);
void UpdateVisibilityOf(WorldObject* obj);
void ReceivePacket(WorldPacket* data);
// updates visibility of worldobjects around viewpoint for camera's owner
void UpdateVisibilityForOwner();
private:
// called when viewpoint changes visibility state
void Event_AddedToWorld();
void Event_RemovedFromWorld();
void Event_Moved();
void Event_ViewPointVisibilityChanged();
Player& m_owner;
WorldObject* m_source;
void UpdateForCurrentViewPoint();
public:
GridReference<Camera>& GetGridRef() { return m_gridRef; }
bool isActiveObject() const { return false; }
private:
GridReference<Camera> m_gridRef;
};
/// Object-observer, notifies farsight object state to cameras that attached to it
class MANGOS_DLL_SPEC ViewPoint
{
friend class Camera;
typedef std::list<Camera*> CameraList;
CameraList m_cameras;
GridType* m_grid;
void Attach(Camera* c) { m_cameras.push_back(c); }
void Detach(Camera* c) { m_cameras.remove(c); }
void CameraCall(void (Camera::*handler)())
{
if (!m_cameras.empty())
{
for (CameraList::iterator itr = m_cameras.begin(); itr != m_cameras.end();)
{
Camera* c = *(itr++);
(c->*handler)();
}
}
}
public:
ViewPoint() : m_grid(0) {}
~ViewPoint();
bool hasViewers() const { return !m_cameras.empty(); }
// these events are called when viewpoint changes visibility state
void Event_AddedToWorld(GridType* grid)
{
m_grid = grid;
CameraCall(&Camera::Event_AddedToWorld);
}
void Event_RemovedFromWorld()
{
m_grid = NULL;
CameraCall(&Camera::Event_RemovedFromWorld);
}
void Event_GridChanged(GridType* grid)
{
m_grid = grid;
CameraCall(&Camera::Event_Moved);
}
void Event_ViewPointVisibilityChanged()
{
CameraCall(&Camera::Event_ViewPointVisibilityChanged);
}
void Call_UpdateVisibilityForOwner()
{
CameraCall(&Camera::UpdateVisibilityForOwner);
}
};
#endif
|
/*
* Copyright 2014 Dog Hunter SA
* Author: Aurelio Colosimo <aurelio@aureliocolosimo.it>
*
* GNU GPLv2 or later
*/
#define DEBUG
/* mcuio driver for Dog OLED shield */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/regmap.h>
#include <linux/workqueue.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/platform_data/ssd1307.h>
#include <linux/mcuio.h>
#include <linux/mcuio_ids.h>
#include <linux/mcuio-proto.h>
#include "mcuio-internal.h"
#include "mcuio-shields.h"
static unsigned short ssd1307_addr = 0x3c;
static unsigned int ssd1307_rst = 120;
module_param(ssd1307_addr, ushort, 0644);
module_param(ssd1307_rst, uint, 0644);
static struct ssd1307_platform_data ssd1307_plat = {
.type = SSD1307_TYPE_1306,
.width = 128,
.height = 64,
.page_offset = 0,
.pins_config = 0x12,
.display_offset = 0,
};
static struct mcuio_shld_i2c_info i2c_lst[] = {
MCUIO_SHLD_I2C_DEV("ssd1307fb", &ssd1307_addr, &ssd1307_plat, -1),
};
static int mcuio_dogoled_probe(struct mcuio_device *mdev)
{
struct mcuio_shld_i2c_info *i;
struct mcuio_shld_data *data;
dev_dbg(&mdev->dev, "%s entered\n", __func__);
data = devm_kzalloc(&mdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
dev_set_drvdata(&mdev->dev, data);
/* Apply module_param values to ssd1307 platform_data */
ssd1307_plat.reset_gpio = ssd1307_rst;
data->i2c_adap = mcuio_get_i2c_adapter(mdev);
if (!data->i2c_adap) {
dev_err(&mdev->dev, "error setting up i2c adapter\n");
return -ENODEV;
}
data->i2c_info = i2c_lst;
data->i2c_cnt = ARRAY_SIZE(i2c_lst);
i = &data->i2c_info[0];
i->info.addr = *i->paddr;
i->i2c_client = i2c_new_device(data->i2c_adap, &i->info);
dev_dbg(&mdev->dev, "%s returns ok\n", __func__);
return 0;
}
static int mcuio_dogoled_remove(struct mcuio_device *mdev)
{
struct mcuio_shld_i2c_info *i;
struct mcuio_shld_data *data;
data = dev_get_drvdata(&mdev->dev);
i = &data->i2c_info[0];
i2c_unregister_device(i->i2c_client);
i->i2c_client = NULL;
return 0;
}
static const struct mcuio_device_id dogoled_drv_ids[] = {
{
.vendor = MCUIO_VENDOR_DOGHUNTER,
.device = MCUIO_DEVICE_DOGOLED_SHIELD,
},
/* Terminator */
{
.device = MCUIO_NO_DEVICE,
.class = MCUIO_CLASS_UNDEFINED,
},
};
static struct mcuio_driver mcuio_dogoled_driver = {
.driver = {
.name = "mcuio-dogoled-shield",
},
.id_table = dogoled_drv_ids,
.probe = mcuio_dogoled_probe,
.remove = mcuio_dogoled_remove,
};
static int __init mcuio_dogoled_init(void)
{
return mcuio_driver_register(&mcuio_dogoled_driver, THIS_MODULE);
}
static void __exit mcuio_dogoled_exit(void)
{
return mcuio_driver_unregister(&mcuio_dogoled_driver);
}
subsys_initcall(mcuio_dogoled_init);
module_exit(mcuio_dogoled_exit);
MODULE_AUTHOR("Aurelio Colosimo");
MODULE_DESCRIPTION("MCUIO driver for Dog OLED shield");
MODULE_LICENSE("GPL v2");
|
/*
* Author: Aananth C N
* Date: 26 Oct 2014
* License: GPLv2
* Email: c.n.aananth@gmail.com
*
* Purpose: This file contains all definitions related to ipcm server
*/
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include "ipcm.h"
#include "ipcm_client_cmds.h"
int fdmem;
int ipcm_block_size;
void *map;
struct ipcm_block *pserver_block;
struct ipcm_block *pclient_block;
int ipcm_init(void)
{
ipcm_block_size = sizeof(struct ipcm_block);
fdmem = open("/dev/mem", O_RDWR);
map = mmap(NULL, ipcm_block_size, PROT_READ | PROT_WRITE, MAP_SHARED,
fdmem, CONFIG_IPCM_SRV_BLK_ADDR);
pserver_block = (struct ipcm_block *)map;
pclient_block = (struct ipcm_block *)((u8*)pserver_block +
sizeof(struct ipcm_block));
return 0;
}
int ipcm_exit(void)
{
munmap(map, ipcm_block_size);
close(fdmem);
/* create_thread_for_rx_from_server() TODO: this will be done later */
return 0;
}
int ipcm_exec(void)
{
char cmd[128];
printf("Type any of the following commands:\n");
printf(" read - to read data from BYOOS\n");
printf(" write - to write data to BYOOS\n");
printf(" debug - to change debug level of BYOOS\n");
printf(" quit - to exit this application\n");
if(EOF == scanf("%s", cmd)) {
return 0;
}
if(strcmp(cmd, "quit") == 0) {
return 1;
}
else if(strcmp(cmd, "read") == 0) {
ipcm_read(pserver_block);
}
else if(strcmp(cmd, "write") == 0) {
ipcm_write(pserver_block);
}
else if(strcmp(cmd, "debug") == 0) {
ipcm_debug_set(pserver_block);
}
else {
return 0;
}
return 0;
}
int main(void)
{
int die = 0;
ipcm_init();
while(!die) {
die = ipcm_exec();
}
ipcm_exit();
return 0;
}
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_EXTENSIONS_UPDATE_MANIFEST_H_
#define CHROME_COMMON_EXTENSIONS_UPDATE_MANIFEST_H_
#include <string>
#include <vector>
#include "url/gurl.h"
class UpdateManifest {
public:
struct Result {
Result();
~Result();
std::string extension_id;
std::string version;
std::string browser_min_version;
GURL crx_url;
std::string package_hash;
int size;
std::string package_fingerprint;
GURL diff_crx_url;
std::string diff_package_hash;
int diff_size;
};
static const int kNoDaystart = -1;
struct Results {
Results();
~Results();
std::vector<Result> list;
int daystart_elapsed_seconds;
};
UpdateManifest();
~UpdateManifest();
bool Parse(const std::string& manifest_xml);
const Results& results() { return results_; }
const std::string& errors() { return errors_; }
private:
Results results_;
std::string errors_;
void ParseError(const char* details, ...);
DISALLOW_COPY_AND_ASSIGN(UpdateManifest);
};
#endif
|
/* conversations_wlan.c 2004 Giles Scott
* modified from conversations_eth.c 2003 Ronnie Sahlberg
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include <epan/packet.h>
#include <epan/stat_cmd_args.h>
#include <epan/tap.h>
#include <epan/dissectors/packet-ieee80211.h>
#include <epan/stat_groups.h>
#include "ui/gtk/gui_stat_menu.h"
#include "ui/gtk/conversations_table.h"
void register_tap_listener_wlan_conversation(void);
static int
wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
{
conversations_table *ct = (conversations_table *) pct;
const wlan_hdr *whdr=(const wlan_hdr *)vip;
add_conversation_table_data(&ct->hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, CONV_TYPE_WLAN, PT_NONE);
return 1;
}
static void
wlan_conversation_init(const char *opt_arg, void* userdata _U_)
{
const char *filter=NULL;
if(!strncmp(opt_arg,"conv,wlan,",10)){
filter=opt_arg+10;
} else {
filter=NULL;
}
init_conversation_table(CONV_TYPE_WLAN, filter, wlan_conversation_packet);
}
void
wlan_endpoints_cb(GtkAction *action _U_, gpointer user_data _U_)
{
wlan_conversation_init("conv,wlan",NULL);
}
void
register_tap_listener_wlan_conversation(void)
{
register_stat_cmd_arg("conv,wlan", wlan_conversation_init,NULL);
register_conversation_table(CONV_TYPE_WLAN, NULL /*filter*/, wlan_conversation_packet);
}
|
#define exec_op glue(exec_, OP)
#define exec_opl glue(glue(exec_, OP), l)
#define exec_opw glue(glue(exec_, OP), w)
#define exec_opb glue(glue(exec_, OP), b)
#ifndef OP_SHIFTD
#ifdef OP_NOBYTE
#define EXECSHIFT(size, res, s1, s2, flags) \
asm ("push %4\n\t"\
"popf\n\t"\
stringify(OP) size " %" size "2, %" size "0\n\t" \
"pushf\n\t"\
"popl %1\n\t"\
: "=g" (res), "=g" (flags)\
: "r" (s1), "0" (res), "1" (flags));
#else
#define EXECSHIFT(size, res, s1, s2, flags) \
asm ("push %4\n\t"\
"popf\n\t"\
stringify(OP) size " %%cl, %" size "0\n\t" \
"pushf\n\t"\
"popl %1\n\t"\
: "=q" (res), "=g" (flags)\
: "c" (s1), "0" (res), "1" (flags));
#endif
void exec_opl(int s2, int s0, int s1, int iflags)
{
int res, flags;
res = s0;
flags = iflags;
EXECSHIFT("", res, s1, s2, flags);
if (s1 != 1)
flags &= ~CC_O;
printf("%-10s A=%08x B=%08x R=%08x CCIN=%04x CC=%04x\n",
stringify(OP) "l", s0, s1, res, iflags, flags & CC_MASK);
}
void exec_opw(int s2, int s0, int s1, int iflags)
{
int res, flags;
res = s0;
flags = iflags;
EXECSHIFT("w", res, s1, s2, flags);
if (s1 != 1)
flags &= ~CC_O;
printf("%-10s A=%08x B=%08x R=%08x CCIN=%04x CC=%04x\n",
stringify(OP) "w", s0, s1, res, iflags, flags & CC_MASK);
}
#else
#define EXECSHIFT(size, res, s1, s2, flags) \
asm ("push %4\n\t"\
"popf\n\t"\
stringify(OP) size " %%cl, %" size "5, %" size "0\n\t" \
"pushf\n\t"\
"popl %1\n\t"\
: "=g" (res), "=g" (flags)\
: "c" (s1), "0" (res), "1" (flags), "r" (s2));
void exec_opl(int s2, int s0, int s1, int iflags)
{
int res, flags;
res = s0;
flags = iflags;
EXECSHIFT("", res, s1, s2, flags);
if (s1 != 1)
flags &= ~CC_O;
printf("%-10s A=%08x B=%08x C=%08x R=%08x CCIN=%04x CC=%04x\n",
stringify(OP) "l", s0, s2, s1, res, iflags, flags & CC_MASK);
}
void exec_opw(int s2, int s0, int s1, int iflags)
{
int res, flags;
res = s0;
flags = iflags;
EXECSHIFT("w", res, s1, s2, flags);
if (s1 != 1)
flags &= ~CC_O;
printf("%-10s A=%08x B=%08x C=%08x R=%08x CCIN=%04x CC=%04x\n",
stringify(OP) "w", s0, s2, s1, res, iflags, flags & CC_MASK);
}
#endif
#ifndef OP_NOBYTE
void exec_opb(int s0, int s1, int iflags)
{
int res, flags;
res = s0;
flags = iflags;
EXECSHIFT("b", res, s1, 0, flags);
if (s1 != 1)
flags &= ~CC_O;
printf("%-10s A=%08x B=%08x R=%08x CCIN=%04x CC=%04x\n",
stringify(OP) "b", s0, s1, res, iflags, flags & CC_MASK);
}
#endif
void exec_op(int s2, int s0, int s1)
{
int o,s,z,a,c,p,flags_in;
for (o = 0; o < 2; o++) {
for (s = 0; s < 2; s++) {
for (z = 0; z < 2; z++) {
for (a = 0; a < 2; a++) {
for (c = 0; c < 2; c++) {
for (p = 0; p < 2; p++) {
flags_in = (o ? CC_O : 0)
| (s ? CC_S : 0)
| (z ? CC_Z : 0)
| (a ? CC_A : 0)
| (c ? CC_C : 0)
| (p ? CC_P : 0);
exec_opl(s2, s0, s1, flags_in);
#ifdef OP_SHIFTD
if (s1 <= 15)
exec_opw(s2, s0, s1, flags_in);
#else
exec_opw(s2, s0, s1, flags_in);
#endif
#ifndef OP_NOBYTE
exec_opb(s0, s1, flags_in);
#endif
#ifdef OP_CC
exec_opl(s2, s0, s1, flags_in);
exec_opw(s2, s0, s1, flags_in);
exec_opb(s0, s1, flags_in);
#endif
}}}}}}
}
void glue(test_, OP)(void)
{
int i;
for(i = 0; i < 32; i++)
exec_op(0x21ad3d34, 0x12345678, i);
for(i = 0; i < 32; i++)
exec_op(0x813f3421, 0x82345678, i);
}
void *glue(_test_, OP) __init_call = glue(test_, OP);
#undef OP
#undef OP_CC
#undef OP_SHIFTD
#undef OP_NOBYTE
#undef EXECSHIFT
|
#pragma once
#include <TextureColourTable.h>
#include <Colour.h>
typedef enum Palette_t{
kHAIR_OUTLINE = 0,
kHAIR_FILL = 1,
kNOSE_OUTLINE = 2,
kNOSE_FILL = 3,
kEYEBROWS_OUTLINE = 4,
kEYEBROWS_FILL = 5,
kEYES_OUTLINE = 6,
kEYES_FILL = 7,
kPUPILS_OUTLINE = 8,
kPUPILS_FILL = 9,
kSKIN_OUTLINE = 10,
kSKIN_FILL = 11,
kSHIRT1_OUTLINE = 12,
kSHIRT1_FILL = 13,
kSHIRT2_OUTLINE = 14,
kSHIRT2_FILL = 15,
kSHIRT3_OUTLINE = 16,
kSHIRT3_FILL = 17,
kPANTS1_OUTLINE = 18,
kPANTS1_FILL = 19,
kPANTS2_OUTLINE = 20,
kPANTS2_FILL = 21,
kPANTS3_OUTLINE = 22,
kPANTS3_FILL = 23,
kSHOES1_OUTLINE = 24,
kSHOES1_FILL = 25,
kSHOES2_OUTLINE = 26,
kSHOES2_FILL = 27,
kSHOES3_OUTLINE = 28,
kSHOES3_FILL = 29,
kBLACK = 30,
kTRANSPARENT = 31,
kSIZE
};
class PD_Palette : public TextureColourTable{
public:
PD_Palette(bool _autorelease);
~PD_Palette();
virtual void generateRandomTable() override;
Colour generateOutline(Colour _fill, glm::ivec3 _outlineMod);
}; |
#include <diabloalpha.h>
/* Disassemble one instruction in the code section. */
t_uint32 AlphaAssembleOne(t_alpha_ins * i_ins)
{
t_uint32 instr;
alpha_opcode_table[ALPHA_INS_OPCODE(i_ins)].Assemble(i_ins, &instr);
return instr;
}
/* assemble an entire section */
void AlphaAssembleSection(t_section * sec)
{
t_uint64 address=0;
int nins = 0;
t_alpha_ins * i_ins;
char * data = SECTION_TMP_BUF(sec);
i_ins = SECTION_DATA(sec);
address=G_T_UINT64(SECTION_CADDRESS(sec));
while(i_ins != NULL)
{
*((t_uint32 *)data) = AlphaAssembleOne(i_ins);
nins++;
data += 4;
address+=4L;
i_ins = ALPHA_INS_INEXT(i_ins);
}
}
/* vim: set shiftwidth=2: */
|
/***************************************************************************
* Copyright (C) 2008-2017 by Andrzej Rybczak *
* electricityispower@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef NCMPCPP_UTILITY_HTML_H
#define NCMPCPP_UTILITY_HTML_H
#include <string>
std::string unescapeHtmlUtf8(const std::string &s);
void unescapeHtmlEntities(std::string &s);
void stripHtmlTags(std::string &s);
#endif // NCMPCPP_UTILITY_HTML_H
|
/*
* Copyright (C) 2005 Voice Sistem SRL
*
* This file is part of opensips, a free SIP server.
*
* opensips 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.
*
* opensips is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* History:
* ---------
* 2005-06-22 first version (bogdan)
*/
#ifndef _TM_T_REDIRECT_H
#define _TM_T_REDIRECT_H
#include "../../parser/msg_parser.h"
#include "../../sr_module.h"
#include "../../str.h"
#include "../tm/tm_load.h"
#include "../acc/acc_logic.h"
typedef int (*tm_get_trans_f)( struct sip_msg*, struct cell**);
extern struct tm_binds rd_tmb;
extern cmd_function rd_acc_fct;
extern char *acc_db_table;
int get_redirect( struct sip_msg *msg , int maxt, int maxb,
pv_elem_t *reason);
#endif
|
#include <zxvgs.h>
#include <stdio.h>
#pragma -make-app
#define APP_NAME="INFO"
int video()
{
#pragma asm
LD DE,$FF00
LD HL,$0000
LD BC,$0000
RST 8
DEFB $A7
LD L,D
LD H,0
#pragma endasm
}
main()
{
int ok1, ok2;
printf("ZXVGS Info 0.30\n");
printf("(C) 2003-03-07 Jarek Adamski\n\n");
printf("Hardware type: ");
switch(video())
{case 0x00: printf("Sinclair ZX Spectrum (+) ULA 6C001E-7"); break;
case 0x01: printf("Sinclair ZX+ 128 AMSTRAD 40056"); break;
case 0x02: printf("Amstrad ZX +2 ULA 7K010E5"); break;
case 0x03: printf("Amstrad ZX +2A/+2B/+3 GATE ARRAY 40077"); break;
case 0x0C: printf("MGT SAM Coupé ASIC"); break;
case 0x20: printf("Timex Sinclair 2068 TS 2068 - 60Hz"); break;
case 0x21: printf("Timex Computer 2068 TS 2068 - 50Hz, grey"); break;
case 0x22: printf("Timex Computer 2048 TS 2068 - 50Hz, black"); break;
case 0x80: printf("ELWRO 800 Junior"); break;
case 0x81: printf("Solum"); break;
case 0xC0: printf("Pentagon"); break;
case 0xC1: printf("ZS Scorpion"); break;
case 0xF0: printf("Warajevo emulator"); break;
default: printf("unknown");
}
printf("\nAvailable memory: %dkB\n",16*(3+bnkfree()));
printf("AY-3-891X sound: ");
ok1=(opensound(1,077)==077); //device 1 is AY in ZX128
opensound(1,0);
ok2=(opensound(2,077)==077); //device 2 is AY in TC2068
opensound(2,0);
if (!(ok1 || ok2)) printf("not ");
printf("available ");
if (ok1) printf("in ZX128 mode ");
if (ok1 && ok2) printf ("or ");
if (ok2) printf("in TC2068 mode");
printf("\nSAA 1099 sound: ");
ok1=(opensound(4,077)==077); //device 4 is SAA1099 in Sam
opensound(4,0);
if (!ok1) printf("not ");
printf("available\n");
}
|
/*
Permissions handling header for the Go! run-time system
(c) 1994-1998 Imperial College and F.G. McCabe
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
Contact: Francis McCabe <frankmccabe@mac.com>
*/
#ifndef _PERMS_H_
#define _PERMS_H_
#include "config.h" /* pick up standard configuration header */
#include "go.h" /* Main header file */
logical inPermissions(ptrI perms,ptrI perm);
ptrI permitedAmount(ptrI perms,ptrI perm);
ptrI defaultPerms(ptrI baseURI);
ptrI generateKey(char *prefix);
ptrI generateUniKey(uniChar *prefix);
extern ptrI
pFORK, // Permission to fork
pIO, // Permission to perform IO
pSENDMSG, // Permission to send messages
pRECVMSG, // Permission to receive messages
pFILE, // Permission to perform file operations
pROOTURL, // Permission to access root URL
pIOKEY; // Key for accessing the file system
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.